Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/drivers: fix proc/debugfs file permissions

Remove write permissions for fops without a write callback.

Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
87ccdcfa ca92b93d

+4 -8
+1 -2
drivers/s390/block/dasd_proc.c
··· 339 339 dasd_proc_root_entry = proc_mkdir("dasd", NULL); 340 340 if (!dasd_proc_root_entry) 341 341 goto out_nodasd; 342 - dasd_devices_entry = proc_create_seq("devices", 343 - S_IFREG | S_IRUGO | S_IWUSR, 342 + dasd_devices_entry = proc_create_seq("devices", 0444, 344 343 dasd_proc_root_entry, 345 344 &dasd_devices_seq_ops); 346 345 if (!dasd_devices_entry)
+2 -5
drivers/s390/char/tape_proc.c
··· 111 111 void 112 112 tape_proc_init(void) 113 113 { 114 - tape_proc_devices = proc_create_seq("tapedevices", 115 - S_IFREG | S_IRUGO | S_IWUSR, NULL, &tape_proc_seq); 116 - if (tape_proc_devices == NULL) { 117 - return; 118 - } 114 + tape_proc_devices = proc_create_seq("tapedevices", 0444, NULL, 115 + &tape_proc_seq); 119 116 } 120 117 121 118 /*
+1 -1
drivers/s390/cio/qdio_debug.c
··· 293 293 snprintf(name, QDIO_DEBUGFS_NAME_LEN, "%s_%d", 294 294 q->is_input_q ? "input" : "output", 295 295 q->nr); 296 - q->debugfs_q = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR, 296 + q->debugfs_q = debugfs_create_file(name, 0444, 297 297 q->irq_ptr->debugfs_dev, q, &qstat_fops); 298 298 if (IS_ERR(q->debugfs_q)) 299 299 q->debugfs_q = NULL;