From: Oleg Nesterov <oleg@redhat.com>
To: Eugene Syromiatnikov <esyr@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Christian Brauner <christian@brauner.io>,
Andrew Morton <akpm@linux-foundation.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
"Dmitry V. Levin" <ldv@altlinux.org>,
Eric Biederman <ebiederm@xmission.com>
Subject: Re: [PATCH v3] fork: check exit_signal passed in clone3() call
Date: Thu, 12 Sep 2019 18:51:11 +0200 [thread overview]
Message-ID: <20190912165110.GA719@redhat.com> (raw)
In-Reply-To: <4b38fa4ce420b119a4c6345f42fe3cec2de9b0b5.1568223594.git.esyr@redhat.com>
On 09/11, Eugene Syromiatnikov wrote:
>
> @@ -2562,6 +2564,15 @@ noinline static int copy_clone_args_from_user(struct kernel_clone_args *kargs,
> if (copy_from_user(&args, uargs, size))
> return -EFAULT;
>
> + /*
> + * Two separate checks are needed, as valid_signal() takes unsigned long
> + * as an argument, and struct kernel_clone_args uses int type
> + * for the exit_signal field.
> + */
> + if (unlikely((args.exit_signal > UINT_MAX) ||
> + !valid_signal(args.exit_signal)))
> + return -EINVAL;
OK, I equally agree with this version. Although I'd simply do
if (args.exit_signal > _NSIG)
return -EINVAL;
but this is cosmetic.
Acked-by: Oleg Nesterov <oleg@redhat.com>
next prev parent reply other threads:[~2019-09-12 16:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-11 17:45 [PATCH v3] fork: check exit_signal passed in clone3() call Eugene Syromiatnikov
2019-09-11 17:45 ` Eugene Syromiatnikov
2019-09-12 16:51 ` Oleg Nesterov [this message]
2019-09-13 11:40 ` Christian Brauner
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=20190912165110.GA719@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=christian@brauner.io \
--cc=ebiederm@xmission.com \
--cc=esyr@redhat.com \
--cc=ldv@altlinux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/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.