Skip to content

Commit d337b66

Browse files
jaharkesAl Viro
authored andcommitted
coda: fix 'kernel memory exposure attempt' in fsync
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: stable@vger.kernel.org Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent dfd6fa3 commit d337b66

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/coda/upcall.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,7 @@ int venus_fsync(struct super_block *sb, struct CodaFid *fid)
446446
UPARG(CODA_FSYNC);
447447

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

452451
CODA_FREE(inp, insize);
453452
return error;

0 commit comments

Comments
 (0)