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: <20130206085653.GQ1712@moon>
Date:	Wed, 6 Feb 2013 12:56:53 +0400
From:	Cyrill Gorcunov <gorcunov@...nvz.org>
To:	Chen Gang <gang.chen@...anux.com>
Cc:	akpm@...ux-foundation.org, keescook@...omium.org,
	serge.hallyn@...onical.com, ebiederm@...ssion.com,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kernel: arg2 is unsigned long which is never < 0

On Wed, Feb 06, 2013 at 04:44:35PM +0800, Chen Gang wrote:
> 
>   arg2 will never < 0, for its type is 'unsigned long'
> 
>   so delete the waste code.
> 
> 
> Signed-off-by: Chen Gang <gang.chen@...anux.com>
> ---
>  kernel/sys.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/sys.c b/kernel/sys.c
> index 24d1ef5..568b9ca 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -2027,7 +2027,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
>  			error = get_dumpable(me->mm);
>  			break;
>  		case PR_SET_DUMPABLE:
> -			if (arg2 < 0 || arg2 > 1) {
> +			if (arg2 > 1) {
>  				error = -EINVAL;
>  				break;
>  			}

I guess

	if (arg2 != SUID_DUMPABLE_DISABLED &&
	    arg2 != SUID_DUMPABLE_ENABLED) {
		error = -EINVAL;
		break;
	}

would be better. Still, current patch looks good to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ