Skip to content

Commit

Permalink
p9_client_attach(): set fid->uid correctly
Browse files Browse the repository at this point in the history
it's almost always equal to current_fsuid(), but there's an exception -
if the first writeback fid is opened by non-root *and* that happens before
root has done any lookups in /, we end up doing attach for root.  The
current code leaves the resulting FID owned by root from the server POV
and by non-root from the client one.  Unfortunately, it means that e.g.
massive dcache eviction will leave that user buggered - they'll end
up redoing walks from / *and* picking that FID every time.  As soon as
they try to create something, the things will get nasty.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Apr 12, 2015
1 parent ce85dd5 commit 21c9f5c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,7 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
fid = NULL;
goto error;
}
fid->uid = n_uname;

req = p9_client_rpc(clnt, P9_TATTACH, "ddss?u", fid->fid,
afid ? afid->fid : P9_NOFID, uname, aname, n_uname);
Expand Down

0 comments on commit 21c9f5c

Please sign in to comment.