Files
rockchip-kernel/drivers/block
Will Drewry b679f15466 CHROMIUM: Restrict swapon() to "zram" devices / lock down zram
This cl contains three distinct changes collapsed into
one CL as per semenzato's request:
1. Restrict CONFIG_SWAP to ensure that only zram devices
   may be used.
2. Restrict zram to disallow open calls, even from root, if
   the device is claimed (e.g., by sys_swapon)
3. Add swapoff fallback when filp_open fails to use the path lookup.
   I don't believe swapoff needs filp_open() since kern_path()
   provides the data needed without a file object.
4. Add an open counter to zram to ensure that it is not opened more
   times than swapon(2) will claim it -- twice:
   - blkdev_get and filp_open (for swap_file)

Signed-off-by: Will Drewry <wad@chromium.org>
TEST=tested on lumpy; swapon, swapoff, change zram during swapon fails, change withotu swapon succeeds.
BUG=chromium:220974

Change-Id: Ic281a7004a81b2897cf0bf1c5d334351061261f1
[sonnyrao: 3.8: fixup conflicts]
Reviewed-on: https://gerrit.chromium.org/gerrit/46168
Tested-by: Will Drewry <wad@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Will Drewry <wad@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58780
Commit-Queue: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>

[benzh: 3.14 rebase. Squashed a compilation error fix. Also zram driver moved
from drivers/staging/ to drivers/block/ in upstream]
Signed-off-by: Ben Zhang <benzh@chromium.org>
2014-05-07 17:06:02 -07:00
..
2014-03-04 07:55:47 -08:00
2013-11-23 22:33:49 -08:00
2013-04-09 14:13:19 -04:00
2011-08-08 11:40:15 +02:00
2013-04-09 14:13:32 -04:00
2012-03-28 18:30:03 +01:00
2014-01-30 16:56:55 -08:00
2013-06-29 12:46:45 +04:00
2014-01-30 16:56:55 -08:00
2013-11-23 22:33:49 -08:00
2013-12-16 15:49:40 -05:00
2014-01-03 10:05:34 +01:00
2014-03-29 10:38:14 -07:00
2013-11-08 09:10:30 -07:00