coda: fix 'kernel memory exposure attempt' in fsync
authorJan Harkes <jaharkes@cs.cmu.edu>
Wed, 27 Sep 2017 19:52:12 +0000 (15:52 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:32:13 +0000 (18:32 +0000)
commit855913fbdad38116df6b1b630a7ecdbadbf992d0
tree53e182fd2eb8f8103a0b5f5fef0e4e7e63f99623
parent05132b9b54f1fc800439fcbcd2c88049ee9d8630
coda: fix 'kernel memory exposure attempt' in fsync

commit d337b66a4c52c7b04eec661d86c2ef6e168965a2 upstream.

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.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/coda/upcall.c