Skip to content

Commit

Permalink
kernel: remove problematic pend() assertion
Browse files Browse the repository at this point in the history
This assertion, if built in, allows users threads to crash
the kernel in a critical section by passing a negative timeout
value, creating a DoS attack vector.

Remove this assertion, immediately below it there's a check
which just resets it to 0 anyway.

Fixes: zephyrproject-rtos#22999

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
  • Loading branch information
Andrew Boie committed Feb 21, 2020
1 parent 82e0066 commit c7c888b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,6 @@ static void pend(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout)
if (timeout != K_FOREVER) {
s32_t ticks;

__ASSERT(timeout >= 0,
"Only non-negative values are accepted.");

if (timeout < 0) {
timeout = 0;
}
Expand Down

0 comments on commit c7c888b

Please sign in to comment.