Re: [PATCH] signal: Avoid undefined behaviour in kill_something_info

2017-06-05 Thread zhong jiang
On 2017/6/5 20:37, Oleg Nesterov wrote: > On 06/05, zhongjiang wrote: >> static int kill_something_info(int sig, struct siginfo *info, pid_t pid) >> { >> -int ret; >> +int ret, vpid; >> >> if (pid > 0) { >> rcu_read_lock(); >> @@ -1395,8 +1395,12 @@ static int kill_som

Re: [PATCH] signal: Avoid undefined behaviour in kill_something_info

2017-06-05 Thread Oleg Nesterov
On 06/05, zhongjiang wrote: > > static int kill_something_info(int sig, struct siginfo *info, pid_t pid) > { > - int ret; > + int ret, vpid; > > if (pid > 0) { > rcu_read_lock(); > @@ -1395,8 +1395,12 @@ static int kill_something_info(int sig, struct siginfo > *info

[PATCH] signal: Avoid undefined behaviour in kill_something_info

2017-06-05 Thread zhongjiang
when I run the kill(72057458746458112, 0) in the userspace, I hit the following issue. [ 304.606353] UBSAN: Undefined behaviour in kernel/signal.c:1462:11 [ 304.612622] negation of -2147483648 cannot be represented in type 'int': [ 304.619516] CPU: 226 PID: 9849 Comm: test Tainted: GB