[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20120123200034.GJ1907@moon>
Date: Tue, 24 Jan 2012 00:00:34 +0400
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Michael Kerrisk <mtk.manpages@...il.com>
Cc: Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, mtk.man-pages@...il.com
Subject: Re: [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@...il.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@...il.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
--
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