Skip to content

Commit 8d4c3e7

Browse files
committed
proc: don't allow async path resolution of /proc/self components
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>
1 parent 88ec321 commit 8d4c3e7

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
@@ -16,6 +16,13 @@ static const char *proc_self_get_link(struct dentry *dentry,
1616
pid_t tgid = task_tgid_nr_ns(current, ns);
1717
char *name;
1818

19+
/*
20+
* Not currently supported. Once we can inherit all of struct pid,
21+
* we can allow this.
22+
*/
23+
if (current->flags & PF_KTHREAD)
24+
return ERR_PTR(-EOPNOTSUPP);
25+
1926
if (!tgid)
2027
return ERR_PTR(-ENOENT);
2128
/* max length of unsigned int in decimal + NULL term */

0 commit comments

Comments
 (0)