Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH net-next v2 02/10] net: dsa: debugfs: add tree | Date | Fri, 8 Sep 2017 15:03:16 +0000 |
| |
From: Vivien Didelot > Sent: 08 September 2017 15:57 ... > > > Also more important, you will notice what seems to be a bug to me: > > > I can read or write a file even if I didn't mask the corresponding mode > > > hence the double check in dsa_debugfs_show and dsa_debugfs_write. > > > > The mode can be changed by userspace, you shouldn't ever need to check > > it in any debugfs calls, right? > > Correct. But this happens even if the file mode isn't changed by > userspace in the meantime, which seemed weird to me. e.g. echo > redirected to a -r--r--r-- debugfs entry will call dsa_debugfs_write.
root will be able to write using 'root' permissions, regardless of the directory entry.
David
| |