From: Michal Hocko <mhocko@kernel.org>
To: zhongjiang <zhongjiang@huawei.com>
Cc: akpm@linux-foundation.org, oleg@redhat.com, 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 15:09:03 +0200 [thread overview]
Message-ID: <20170605130903.GP9248@dhcp22.suse.cz> (raw)
In-Reply-To: <1496667207-56723-1-git-send-email-zhongjiang@huawei.com>
On Mon 05-06-17 20:53:27, zhongjiang wrote:
> diff --git a/kernel/signal.c b/kernel/signal.c
> index ca92bcf..63148f7 100644
> --- 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;
this will obviously keep the tasklist_lock held...
> ret = __kill_pgrp_info(sig, info,
> pid ? find_vpid(-pid) : task_pgrp(current));
> } else {
> --
> 1.7.12.4
--
Michal Hocko
SUSE Labs
--
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>
next prev parent reply other threads:[~2017-06-05 13:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-05 12:53 zhongjiang
2017-06-05 13:09 ` Michal Hocko [this message]
2017-06-05 13:18 ` zhong jiang
2017-06-05 13:31 ` Oleg Nesterov
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=20170605130903.GP9248@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=oleg@redhat.com \
--cc=qiuxishi@huawei.com \
--cc=vbabka@suse.cz \
--cc=zhongjiang@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox