Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1657597
| From | Oleg Nesterov <oleg@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] signal: Avoid undefined behaviour in kill_something_info |
| Date | 2017-06-05 15:40 +0200 |
| Message-ID | <tP0oF-3td-7@gated-at.bofh.it> (permalink) |
| References | <tOZLY-30O-35@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] signal: Avoid undefined behaviour in kill_something_info zhongjiang <zhongjiang@huawei.com> - 2017-06-05 15:00 +0200
Re: [PATCH v2] signal: Avoid undefined behaviour in kill_something_info Michal Hocko <mhocko@kernel.org> - 2017-06-05 15:10 +0200
Re: [PATCH v2] signal: Avoid undefined behaviour in kill_something_info zhong jiang <zhongjiang@huawei.com> - 2017-06-05 15:30 +0200
Re: [PATCH v2] signal: Avoid undefined behaviour in kill_something_info Oleg Nesterov <oleg@redhat.com> - 2017-06-05 15:40 +0200
Re: [PATCH v2] signal: Avoid undefined behaviour in kill_something_info zhong jiang <zhongjiang@huawei.com> - 2017-06-05 15:50 +0200
csiph-web