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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190912165110.GA719@redhat.com>
Date:   Thu, 12 Sep 2019 18:51:11 +0200
From:   Oleg Nesterov <oleg@...hat.com>
To:     Eugene Syromiatnikov <esyr@...hat.com>
Cc:     linux-kernel@...r.kernel.org,
        Christian Brauner <christian@...uner.io>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        "Dmitry V. Levin" <ldv@...linux.org>,
        Eric Biederman <ebiederm@...ssion.com>
Subject: Re: [PATCH v3] fork: check exit_signal passed in clone3() call

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@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ