Skip to content

Commit

Permalink
s390/drivers: fix proc/debugfs file permissions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Dec 13, 2018
1 parent ca92b93 commit 87ccdcf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions drivers/s390/block/dasd_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ dasd_proc_init(void)
dasd_proc_root_entry = proc_mkdir("dasd", NULL);
if (!dasd_proc_root_entry)
goto out_nodasd;
dasd_devices_entry = proc_create_seq("devices",
S_IFREG | S_IRUGO | S_IWUSR,
dasd_devices_entry = proc_create_seq("devices", 0444,
dasd_proc_root_entry,
&dasd_devices_seq_ops);
if (!dasd_devices_entry)
Expand Down
7 changes: 2 additions & 5 deletions drivers/s390/char/tape_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,8 @@ static const struct seq_operations tape_proc_seq = {
void
tape_proc_init(void)
{
tape_proc_devices = proc_create_seq("tapedevices",
S_IFREG | S_IRUGO | S_IWUSR, NULL, &tape_proc_seq);
if (tape_proc_devices == NULL) {
return;
}
tape_proc_devices = proc_create_seq("tapedevices", 0444, NULL,
&tape_proc_seq);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/s390/cio/qdio_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static void setup_debugfs_entry(struct qdio_q *q)
snprintf(name, QDIO_DEBUGFS_NAME_LEN, "%s_%d",
q->is_input_q ? "input" : "output",
q->nr);
q->debugfs_q = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR,
q->debugfs_q = debugfs_create_file(name, 0444,
q->irq_ptr->debugfs_dev, q, &qstat_fops);
if (IS_ERR(q->debugfs_q))
q->debugfs_q = NULL;
Expand Down

0 comments on commit 87ccdcf

Please sign in to comment.