mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-12 17:37:53 +03:00
Kernel: Address validation helpers should take size_t, not ssize_t
This commit is contained in:
parent
164d9ecad7
commit
c9e877a294
Notes:
sideshowbarker
2024-07-19 09:44:59 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c9e877a2948
@ -2334,21 +2334,21 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
|
|||||||
return waitee_pid;
|
return waitee_pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Process::validate_read_from_kernel(VirtualAddress vaddr, ssize_t size) const
|
bool Process::validate_read_from_kernel(VirtualAddress vaddr, size_t size) const
|
||||||
{
|
{
|
||||||
if (vaddr.is_null())
|
if (vaddr.is_null())
|
||||||
return false;
|
return false;
|
||||||
return MM.validate_kernel_read(*this, vaddr, size);
|
return MM.validate_kernel_read(*this, vaddr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Process::validate_read(const void* address, ssize_t size) const
|
bool Process::validate_read(const void* address, size_t size) const
|
||||||
{
|
{
|
||||||
if (!size)
|
if (!size)
|
||||||
return false;
|
return false;
|
||||||
return MM.validate_user_read(*this, VirtualAddress(address), size);
|
return MM.validate_user_read(*this, VirtualAddress(address), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Process::validate_write(void* address, ssize_t size) const
|
bool Process::validate_write(void* address, size_t size) const
|
||||||
{
|
{
|
||||||
if (!size)
|
if (!size)
|
||||||
return false;
|
return false;
|
||||||
|
@ -326,10 +326,10 @@ public:
|
|||||||
u32 m_ticks_in_user_for_dead_children { 0 };
|
u32 m_ticks_in_user_for_dead_children { 0 };
|
||||||
u32 m_ticks_in_kernel_for_dead_children { 0 };
|
u32 m_ticks_in_kernel_for_dead_children { 0 };
|
||||||
|
|
||||||
bool validate_read_from_kernel(VirtualAddress, ssize_t) const;
|
bool validate_read_from_kernel(VirtualAddress, size_t) const;
|
||||||
|
|
||||||
bool validate_read(const void*, ssize_t) const;
|
bool validate_read(const void*, size_t) const;
|
||||||
bool validate_write(void*, ssize_t) const;
|
bool validate_write(void*, size_t) const;
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool validate_read_typed(T* value, size_t count = 1) { return validate_read(value, sizeof(T) * count); }
|
bool validate_read_typed(T* value, size_t count = 1) { return validate_read(value, sizeof(T) * count); }
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user