[PATCH 0/3] coda: check and serialize Venus replies
From: Mar Dominguez
Date: Sat Dec 05 2026 - 00:48:24 EST
Three fixes for the Coda upcall path.
Patches 1 and 2 check the symlink target in venus_readlink() and the
pioctl output in venus_pioctl() against the size of the reply from
Venus, instead of using the offset and length in the reply as given.
Patch 3 makes coda_psdev_write() hold vc_mutex until the reply has been
copied, the request is marked done and the waiter has been woken, as
coda_psdev_read() already does. Until now a waiter that was interrupted
by a signal, or that timed out, in that window unlinked and freed the
request while coda_psdev_write() was still using it.
Tested on x86_64 with KASAN under QEMU using a minimal stand-in Venus
that sends the malformed replies and, for patch 3, interrupts the
waiting process while the reply is copied: KASAN and list-debug reports
before, none after. Not tested with the real Venus userspace, on other
architectures or on a kernel without KASAN. A reproducer is available
privately on request.
Found and written with an LLM coding assistant.
Mar Dominguez (3):
coda: bound the symlink target in venus_readlink()
coda: bound the pioctl output in venus_pioctl()
coda: hold vc_mutex while completing a Venus reply
fs/coda/psdev.c | 21 +++++++++++++++------
fs/coda/upcall.c | 23 +++++++++++++++++++----
2 files changed, 34 insertions(+), 10 deletions(-)
base-commit: 007722b8211f7b34fdf21b1e6a9c32497633ea29
--
2.53.0