mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
Kernel: Fix integer overflow in KCOV_SETBUFSIZE ioctl
This commit is contained in:
parent
4857943a71
commit
d5fdb97a81
2 changed files with 4 additions and 0 deletions
|
@ -17,6 +17,9 @@ KCOVInstance::KCOVInstance(ProcessID pid)
|
|||
|
||||
KResult KCOVInstance::buffer_allocate(size_t buffer_size_in_entries)
|
||||
{
|
||||
if (buffer_size_in_entries < 2 || buffer_size_in_entries > KCOV_MAX_ENTRIES)
|
||||
return EINVAL;
|
||||
|
||||
// first entry contains index of last PC
|
||||
this->m_buffer_size_in_entries = buffer_size_in_entries - 1;
|
||||
this->m_buffer_size_in_bytes = page_round_up(buffer_size_in_entries * KCOV_ENTRY_SIZE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue