]> git.baikalelectronics.ru Git - kernel.git/commit
swapon: check validity of swap_flags
authorHugh Dickins <hughd@google.com>
Wed, 28 Mar 2012 21:42:42 +0000 (14:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 29 Mar 2012 00:14:35 +0000 (17:14 -0700)
commitd889905460f100cf239d57df48008b92b3c44ebd
tree5c1d8d18c65a34eb738c97d75f2c44becdff1de3
parent91730d96bb9a2edbfe9a38e24114ff4385e46288
swapon: check validity of swap_flags

Most system calls taking flags first check that the flags passed in are
valid, and that helps userspace to detect when new flags are supported.

But swapon never did so: start checking now, to help if we ever want to
support more swap_flags in future.

It's difficult to get stray bits set in an int, and swapon is not widely
used, so this is most unlikely to break any userspace; but we can just
revert if it turns out to do so.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/swap.h
mm/swapfile.c