public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [patch] Fix argument check for PR_SET_MM
       [not found] <4F1DBA56.7070903@gmail.com>
@ 2012-01-23 20:00 ` Cyrill Gorcunov
  0 siblings, 0 replies; only message in thread
From: Cyrill Gorcunov @ 2012-01-23 20:00 UTC (permalink / raw)
  To: Michael Kerrisk
  Cc: Kees Cook, Andrew Morton, Linus Torvalds, linux-kernel,
	mtk.man-pages

On Tue, Jan 24, 2012 at 08:51:50AM +1300, Michael Kerrisk wrote:
> From: Michael Kerrisk <mtk.manpages@gmail.com>
> 
> Cyrill,
> 
> I imagine that the small operator fix below gives the behavior you intended.
> Please apply.
> 
> Thanks,
> 
> Michael
> 
> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
> 
> --- kernel/sys.c.orig	2012-01-24 07:26:44.986370466 +1300
> +++ kernel/sys.c	2012-01-24 07:27:52.202703776 +1300
> @@ -1703,7 +1703,7 @@ static int prctl_set_mm(int opt, unsigne
>  	int error = 0;
>  	struct mm_struct *mm = current->mm;
>  
> -	if (arg4 | arg5)
> +	if (arg4 || arg5)
>  		return -EINVAL;
>  
>  	if (!capable(CAP_SYS_ADMIN))
> 

Hi Michael, thanks. But actually (arg4 | arg5) will give nonzero result
if any of operands is not a zero ;) So no error here. From readability pov
sure this will be clear. Thanks, I'll update.

	Cyrill

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-23 20:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4F1DBA56.7070903@gmail.com>
2012-01-23 20:00 ` [patch] Fix argument check for PR_SET_MM Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox