Skip to content

Commit 18e66ae

Browse files
t-8chbrauner
authored andcommitted
proc: use generic setattr() for /proc/$PID/net
All other files in /proc/$PID/ use proc_setattr(). Not using it allows the usage of chmod() on /proc/$PID/net, even on other processes owned by the same user. The same would probably also be true for other attributes to be changed. As this technically represents an ABI change it is not marked for stable so any unlikely regressions are caught during a full release cycle. Fixes: e9720ac ("[NET]: Make /proc/net a symlink on /proc/self/net (v3)") Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Fixes: b4844fa ("selftests/nolibc: implement a few tests for various syscalls") Tested-by: Zhangjin Wu <[email protected]> Signed-off-by: Willy Tarreau <[email protected]> Message-Id: <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 4931983 commit 18e66ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/proc/proc_net.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ static int proc_tgid_net_getattr(struct mnt_idmap *idmap,
321321
const struct inode_operations proc_net_inode_operations = {
322322
.lookup = proc_tgid_net_lookup,
323323
.getattr = proc_tgid_net_getattr,
324+
.setattr = proc_setattr,
324325
};
325326

326327
static int proc_tgid_net_readdir(struct file *file, struct dir_context *ctx)

0 commit comments

Comments
 (0)