lkml.org 
[lkml]   [2017]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] signal: Avoid undefined behaviour in kill_something_info
On 06/05, zhongjiang wrote:
>
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1395,6 +1395,12 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid)
>
> read_lock(&tasklist_lock);
> if (pid != -1) {
> + /*
> + * -INT_MIN is undefined, it need to exclude following case to
> + * avoid the UBSAN detection.
> + */
> + if (pid == INT_MIN)
> + return -ESRCH;

you need to do this before read_lock(tasklist)

Oleg.

\
 
 \ /
  Last update: 2017-06-12 00:23    [W:0.172 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site