diff options
author | David Howells <dhowells@redhat.com> | 2020-06-04 22:31:39 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2020-06-09 16:22:06 +0200 |
commit | 5749ce92c4b707353cbd934dd0518a1966d7988f (patch) | |
tree | a5473fbf8e54509339008b9a45e2ea336fe7c494 /fs/afs/flock.c | |
parent | afs: Fix memory leak in afs_put_sysnames() (diff) | |
download | linux-5749ce92c4b707353cbd934dd0518a1966d7988f.tar.xz linux-5749ce92c4b707353cbd934dd0518a1966d7988f.zip |
afs: Fix file locking
Fix AFS file locking to use the correct vnode pointer and remove a member
of the afs_operation struct that is never set, but it is read and followed,
causing an oops.
This can be triggered by:
flock -s /afs/example.com/foo sleep 1
when it calls the kernel to get a file lock.
Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept")
Reported-by: Dave Botsch <botsch@cnf.cornell.edu>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Dave Botsch <botsch@cnf.cornell.edu>
Diffstat (limited to 'fs/afs/flock.c')
-rw-r--r-- | fs/afs/flock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/afs/flock.c b/fs/afs/flock.c index 70e518f7bc19..71eea2a908c7 100644 --- a/fs/afs/flock.c +++ b/fs/afs/flock.c @@ -71,7 +71,7 @@ static void afs_schedule_lock_extension(struct afs_vnode *vnode) void afs_lock_op_done(struct afs_call *call) { struct afs_operation *op = call->op; - struct afs_vnode *vnode = op->lock.lvnode; + struct afs_vnode *vnode = op->file[0].vnode; if (call->error == 0) { spin_lock(&vnode->lock); |