Skip to content

Commit

Permalink
coda: fix 'kernel memory exposure attempt' in fsync
Browse files Browse the repository at this point in the history
When an application called fsync on a file in Coda a small request with
just the file identifier was allocated, but the declared length was set
to the size of union of all possible upcall requests.

This bug has been around for a very long time and is now caught by the
extra checking in usercopy that was introduced in Linux-4.8.

The exposure happens when the Coda cache manager process reads the fsync
upcall request at which point it is killed. As a result there is nobody
servicing any further upcalls, trapping any processes that try to access
the mounted Coda filesystem.

Cc: [email protected]
Signed-off-by: Jan Harkes <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
jaharkes authored and Al Viro committed Nov 5, 2017
1 parent dfd6fa3 commit d337b66
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/coda/upcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,7 @@ int venus_fsync(struct super_block *sb, struct CodaFid *fid)
UPARG(CODA_FSYNC);

inp->coda_fsync.VFid = *fid;
error = coda_upcall(coda_vcp(sb), sizeof(union inputArgs),
&outsize, inp);
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);

CODA_FREE(inp, insize);
return error;
Expand Down

0 comments on commit d337b66

Please sign in to comment.