All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: akpm@linux-foundation.org, mhocko@kernel.org, vbabka@suse.cz,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	qiuxishi@huawei.com
Subject: Re: [PATCH v2] signal: Avoid undefined behaviour in kill_something_info
Date: Mon, 5 Jun 2017 21:46:02 +0800	[thread overview]
Message-ID: <5935609A.3080303@huawei.com> (raw)
In-Reply-To: <20170605133159.GA10301@redhat.com>

On 2017/6/5 21:31, Oleg Nesterov wrote:
> 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.
>
>
> .
>
  I am so sorry for disturbing.

 Thanks
zhongjiang

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: zhong jiang <zhongjiang@huawei.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: <akpm@linux-foundation.org>, <mhocko@kernel.org>,
	<vbabka@suse.cz>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>, <qiuxishi@huawei.com>
Subject: Re: [PATCH v2] signal: Avoid undefined behaviour in kill_something_info
Date: Mon, 5 Jun 2017 21:46:02 +0800	[thread overview]
Message-ID: <5935609A.3080303@huawei.com> (raw)
In-Reply-To: <20170605133159.GA10301@redhat.com>

On 2017/6/5 21:31, Oleg Nesterov wrote:
> 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.
>
>
> .
>
  I am so sorry for disturbing.

 Thanks
zhongjiang

  reply	other threads:[~2017-06-05 14:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05 12:53 [PATCH v2] signal: Avoid undefined behaviour in kill_something_info zhongjiang
2017-06-05 12:53 ` zhongjiang
2017-06-05 13:09 ` Michal Hocko
2017-06-05 13:09   ` Michal Hocko
2017-06-05 13:18   ` zhong jiang
2017-06-05 13:18     ` zhong jiang
2017-06-05 13:31 ` Oleg Nesterov
2017-06-05 13:31   ` Oleg Nesterov
2017-06-05 13:46   ` zhong jiang [this message]
2017-06-05 13:46     ` zhong jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5935609A.3080303@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=oleg@redhat.com \
    --cc=qiuxishi@huawei.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.