Commit 43fa1adb authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds
Browse files

[PATCH] file: Add locking to f_getown

This has been needed for a long time, but now with the advent of a
reference counted struct pid there are real consequences for getting this

Someone I think it was Oleg Nesterov pointed out that this construct was
missing locking, when I introduced struct pid.  After taking time to review
the locking construct already present I figured out which lock needs to be
taken.  The other paths that access take either the f_owner
read or the write lock.
Signed-off-by: default avatarEric W. Biederman <>
Cc: Oleg Nesterov <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent a03fcb73
......@@ -305,9 +305,11 @@ void f_delown(struct file *filp)
pid_t f_getown(struct file *filp)
pid_t pid;
pid = pid_nr(filp->;
if (filp->f_owner.pid_type == PIDTYPE_PGID)
pid = -pid;
return pid;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment