Fix argument check for PR_SET_MM
Quoted 17 lines · Michael Kerrisk
From: Michael Kerrisk <[email protected]>
Cyrill,
I imagine that the small operator fix below gives the behavior you intended. Please apply.
Thanks,
Michael
Signed-off-by Michael Kerrisk <[email protected]>
sys.c static int prctl_set_mm(int opt, unsigne · line 1709
Quoted 8 lines
sys.c renamed from sys.c.orig +1
-1@@ -1703,7 +1703,7 @@ static int prctl_set_mm(int opt, unsigneint 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