summaryrefslogtreecommitdiffstats
path: root/drivers/block/paride
diff options
context:
space:
mode:
authorKees Cook2017-02-14 01:25:26 +0100
committerJens Axboe2017-02-14 16:29:56 +0100
commit853fe1bf7554155376bb3b231112cdff9ff79177 (patch)
tree7d8b38a77574919d078443cecffcae9dd380a692 /drivers/block/paride
parentelevator: fix loading wrong elevator type for blk-mq devices (diff)
downloadkernel-qcow2-linux-853fe1bf7554155376bb3b231112cdff9ff79177.tar.gz
kernel-qcow2-linux-853fe1bf7554155376bb3b231112cdff9ff79177.tar.xz
kernel-qcow2-linux-853fe1bf7554155376bb3b231112cdff9ff79177.zip
cdrom: Make device operations read-only
Since function tables are a common target for attackers, it's best to keep them in read-only memory. As such, this makes the CDROM device ops tables const. This drops additionally n_minors, since it isn't used meaningfully, and sets the only user of cdrom_dummy_generic_packet explicitly so the variables can all be const. Inspired by similar changes in grsecurity/PaX. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/paride')
-rw-r--r--drivers/block/paride/pcd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 5fd2d0e25567..10aed84244f5 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -273,7 +273,7 @@ static const struct block_device_operations pcd_bdops = {
.check_events = pcd_block_check_events,
};
-static struct cdrom_device_ops pcd_dops = {
+static const struct cdrom_device_ops pcd_dops = {
.open = pcd_open,
.release = pcd_release,
.drive_status = pcd_drive_status,