lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 5 Jun 2017 20:47:47 +0800
From:   zhong jiang <zhongjiang@...wei.com>
To:     Oleg Nesterov <oleg@...hat.com>
CC:     <akpm@...ux-foundation.org>, <stsp@...t.ru>, <Waiman.Long@....com>,
        <mingo@...nel.org>, <mhocko@...nel.org>, <vbabka@...e.cz>,
        <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <qiuxishi@...wei.com>
Subject: Re: [PATCH] signal: Avoid undefined behaviour in kill_something_info

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_something_info(int sig, struct siginfo *info, pid_t pid)
>>  
>>  	read_lock(&tasklist_lock);
>>  	if (pid != -1) {
>> +		if (pid == INT_MIN)
>> +			vpid = INT_MAX;
> Well, this probably needs a comment to explain that this is just "avoid ub".
>
> And if we really want the fix, to me
>
> 	if (pid == INT_MIN)
> 		return -ESRCH;
>
> at the start makes more sense...
>
> Oleg.
>
>
> .
>
 ok, I will motify it in v2 shortly,  Thanks

 Regards
zhongjiang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ