Skip to content

Commit 61cda68

Browse files
axboegregkh
authored andcommitted
proc: don't allow async path resolution of /proc/self components
[ Upstream commit 8d4c3e7 ] If this is attempted by a kthread, then return -EOPNOTSUPP as we don't currently support that. Once we can get task_pid_ptr() doing the right thing, then this can go away again. Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 65e22ae commit 61cda68

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

fs/proc/self.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ static const char *proc_self_get_link(struct dentry *dentry,
2626
pid_t tgid = task_tgid_nr_ns(current, ns);
2727
char *name;
2828

29+
/*
30+
* Not currently supported. Once we can inherit all of struct pid,
31+
* we can allow this.
32+
*/
33+
if (current->flags & PF_KTHREAD)
34+
return ERR_PTR(-EOPNOTSUPP);
35+
2936
if (!tgid)
3037
return ERR_PTR(-ENOENT);
3138
/* 11 for max length of signed int in decimal + NULL term */

0 commit comments

Comments
 (0)