From: Jan Harkes <jaharkes@cs.cmu.edu>
To: Mar Dominguez <mar@talkjune.com>
Cc: Christian Brauner <brauner@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] coda: check and serialize Venus replies
Date: Sat, 5 Dec 2026 18:20:47 -0500 [thread overview]
Message-ID: <20261205232047.fpt2h26fsn4oamli@cs.cmu.edu> (raw)
In-Reply-To: <4tunabGBgBhPxJPJjae4oObi5JWoQRidatkh@talkjune.com>
On Sat, Dec 05, 2026 at 12:53:48AM -0500, Mar Dominguez wrote:
> 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.
These sanitize fields in the reply that Venus, our userspace cache manager
wrote: readlink's count/data and pioctl's len/data. In Coda, Venus is part of
the trusted computing base, it already controls the reply contents and can do
far more damage through the filesystem semantics than by handing the kernel a
bad offset. So these are not security fixes; at best they are robustness checks
against a buggy or short reply from Venus.
The checks themselves look reasonable. But they are not stable/security fixes.
Please reframe them as defensive hardening against a malfunctioning Venus and
drop the security and stable-backport language.
> 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.
This is a genuine bug, but your description has some inaccuracies, the
one-second timeout is not the trigger and when CODA_REQ_WRITE is set the
waiter's flag check breaks out, so there is no free window there.
The real trigger is a signal that is handled after the request is unlinked but
before CODA_REQ_WRITE is set. It triggers an oops on a second list_del and an
UAF happens when CONFIG_DEBUG_LIST and BUG_ON_DATA_CORRUPTION=n are both set.
Your patch 3 closes that window by extending the vc_mutex across fget and
copy_from_user. Putting copy_from_user under vc_mutex adds a new lockdep false
positive wrt. mmap_lock, but we already have a similar one like that in
coda_psdev_read with copy_to_user.
It does introduce a new lockdep false positive between vc_mutex and mmap_lock,
but I looked into that and both are in different mm address spaces as long as
our userspace cache manager doesn't try to recurse onto itself by opening files
in /coda, which we obviously avoid doing.
Jan
next prev parent reply other threads:[~2026-12-05 23:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 5:48 Mar Dominguez
2026-12-05 5:50 ` [PATCH 1/3] coda: bound the symlink target in venus_readlink() Mar Dominguez
2026-12-05 5:53 ` [PATCH 2/3] coda: bound the pioctl output in venus_pioctl() Mar Dominguez
2026-12-05 5:56 ` [PATCH 3/3] coda: hold vc_mutex while completing a Venus reply Mar Dominguez
2026-12-05 23:20 ` Jan Harkes [this message]
2026-12-05 23:26 ` [PATCH 0/3] coda: check and serialize Venus replies Mar Dominguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261205232047.fpt2h26fsn4oamli@cs.cmu.edu \
--to=jaharkes@cs.cmu.edu \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mar@talkjune.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®