Re: [patch] Fix argument check for PR_SET_MM

From: Cyrill Gorcunov
Date: Mon Jan 23 2012 - 15:00:38 EST


On Tue, Jan 24, 2012 at 08:51:50AM +1300, Michael Kerrisk wrote:
> From: Michael Kerrisk <mtk.manpages@xxxxxxxxx>
>
> 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@xxxxxxxxx>
>
> --- 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/