summaryrefslogtreecommitdiff
path: root/fs/coda/upcall.c
diff options
context:
space:
mode:
authorJan Harkes <jaharkes@cs.cmu.edu>2017-09-27 15:52:12 -0400
committerSasha Levin <alexander.levin@verizon.com>2017-12-06 21:20:16 -0500
commit47c253b95c094b7d087884b99c91fd99ad33d220 (patch)
tree4ca62e53b08d333f9e9429ddcbcb989c6433ecdc /fs/coda/upcall.c
parentbead4ab544f2b3f5d0a963cdd1e1b0382a4d218b (diff)
coda: fix 'kernel memory exposure attempt' in fsync
[ Upstream commit d337b66a4c52c7b04eec661d86c2ef6e168965a2 ] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'fs/coda/upcall.c')
-rw-r--r--fs/coda/upcall.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index 9b1ffaa0572e..e362c5dad208 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -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;