lkml.org 
[lkml]   [2012]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] Fix argument check for PR_SET_MM
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


\
 
 \ /
  Last update: 2012-01-23 21:03    [W:0.101 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site