#include #include #include #include /* amount of vm to protect from userspace access by both DAC and the LSM*/ unsigned long mmap_min_addr; /* amount of vm to protect from userspace using CAP_SYS_RAWIO (DAC) */ unsigned long dac_mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR; /* amount of vm to protect from userspace using the LSM = CONFIG_LSM_MMAP_MIN_ADDR */ /* * Update mmap_min_addr = max(dac_mmap_min_addr, CONFIG_LSM_MMAP_MIN_ADDR) */ static void update_mmap_min_addr(void) { #ifdef CONFIG_LSM_MMAP_MIN_ADDR if (dac_mmap_min_addr > CONFIG_LSM_MMAP_MIN_ADDR) mmap_min_addr = dac_mmap_min_addr; else mmap_min_addr = CONFIG_LSM_MMAP_MIN_ADDR; #else mmap_min_addr = dac_mmap_min_addr; #endif } /* * sysctl handler which just sets dac_mmap_min_addr = the new value and then * calls update_mmap_min_addr() so non MAP_FIXED hints get rounded properly */ int mmap_min_addr_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int ret; if (write && !capable(CAP_SYS_RAWIO)) return -EPERM; ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos); update_mmap_min_addr(); return ret; } static int __init init_mmap_min_addr(void) { update_mmap_min_addr(); return 0; } pure_initcall(init_mmap_min_addr); ump-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-27 12:36:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-27 12:36:39 -0800
commit2fb78e89405f4321b86274a0c24b30896dd50529 (patch)
tree4de241e242441b80bd3f0022fc546bb07374571f /include/xen/balloon.h
parentdd3b9f25c867cb2507a45e436d6ede8eb08e7b05 (diff)
parentc14024dbb156c8392908aaa822097d27c6af8ec8 (diff)
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "A set of fixes for this series. This contains: - Set of fixes for the nvme target code - A revert of patch from this merge window, causing a regression with WRITE_SAME on iSCSI targets at least. - A fix for a use-after-free in the new O_DIRECT bdev code. - Two fixes for the xen-blkfront driver" * 'for-linus' of git://git.kernel.dk/linux-block: Revert "sd: remove __data_len hack for WRITE SAME" nvme-fc: use blk_rq_nr_phys_segments nvmet-rdma: Fix missing dma sync to nvme data structures nvmet: Call fatal_error from keep-alive timout expiration nvmet: cancel fatal error and flush async work before free controller nvmet: delete controllers deletion upon subsystem release nvmet_fc: correct logic in disconnect queue LS handling block: fix use after free in __blkdev_direct_IO xen-blkfront: correct maximum segment accounting xen-blkfront: feature flags handling adjustments
Diffstat (limited to 'include/xen/balloon.h')