]> 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)
commit3253437477606b81a151e57b015d2b4665b2fe4c
tree5c1d8d18c65a34eb738c97d75f2c44becdff1de3
parent7a932c1f77c2478652c7ce93dd90871d23d87cc4
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