Messages in this thread | | | Date | Tue, 24 Jan 2012 00:00:34 +0400 | From | Cyrill Gorcunov <> | 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@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
| |