lkml.org 
[lkml]   [2021]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectQuestion on commit dc7109aaa233 ("futex: Validate waiter correctly in futex_proxy_trylock_atomic()")
Dear Thomas,

in commit dc7109aaa233 ("futex: Validate waiter correctly in
futex_proxy_trylock_atomic()") visible on next-20210819, you add:

+ /*
+ * Ensure that this is a waiter sitting in futex_wait_requeue_pi()
+ * and waiting on the 'waitqueue' futex which is always !PI.
+ */
+ if (!top_waiter->rt_waiter || top_waiter->pi_state)
+ ret = -EINVAL;

However, ret is unconditionally reassigned later and erases any
intended effect of this assignment. This is making that assignment
above a Dead Store, which clang-analyzer correctly warns about and
which motivates me to write you an email.

Did you intend to return -EINVAL here? So:

+ if (!top_waiter->rt_waiter || top_waiter->pi_state)
+ return -EINVAL;



Best regards,

Lukas

Static analysis tools are as foolish as they are... but every dog has its day...

\
 
 \ /
  Last update: 2021-08-20 13:18    [W:0.067 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site