Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mempolicy: mask off internal flags for userspace API

Flags considered internal to the mempolicy kernel code are stored as part
of the "flags" member of struct mempolicy.

Before exposing a policy type to userspace via get_mempolicy(), these
internal flags must be masked. Flags exposed to userspace, however,
should still be returned to the user.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Rientjes and committed by
Linus Torvalds
d79df630 b8a0b6cc

+5 -1
+5 -1
mm/mempolicy.c
··· 729 729 } else { 730 730 *policy = pol == &default_policy ? MPOL_DEFAULT : 731 731 pol->mode; 732 - *policy |= pol->flags; 732 + /* 733 + * Internal mempolicy flags must be masked off before exposing 734 + * the policy to userspace. 735 + */ 736 + *policy |= (pol->flags & MPOL_MODE_FLAGS); 733 737 } 734 738 735 739 if (vma) {