From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.53 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796512865; b=lMQeA4pIknKZEv1Vl8tP30qQH4rF7uYCue8oO8gzKw0BLEmSHvpysM++m/v/tN66lHUJ GoSVa/MWhsJfDsUds/xbd+/NWKhGHzd2R7LFarGKm77u8ihQ6jLnD5WjBhGWp2wZ3IQmv 5lYPkjE4ZAV2bwrEbHHlYimhAP8KMNrxbNFZrbVVsRXuoxwC8D83GGYG8qwcxK1Tts0vQ +zgL78GCkCc/ulIDqs1SaOk2yHKfwX0wZjey3zcB44Zw/B/fW2dhzANGhlPYIX2JFXOnH B7fDXFftjAORdJoYfVOSFTgmyanjKFL8FthxUf5xTwd8B1F7KxSp81pI44PuTEhWCZQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796512865; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=8+EwxPIuCAPwA6Y6veEeZLaUYsvwn5lQFGxIbT+JGMc=; b=jfX/D1TUVrtDUn8tAMIciywUx00s9B3A3NSiVt02OPHbX+sY6VQrF4CuoZDQ0fIXIWTf rAVFSR3wIppGLkS4TrY07mSlCsJ4s7i1xxZ3IJgrcbtdtUd8NWZbBvvTRSXPY++D2DnKJ mUsTsUL/Gl3rR1cL6A8SB8WO+GlTZakvOUNKkKq5zeStZTjC6Ai2tLmA/x4vMcaTxw5Kp p+2hXxkRLdv5CkhhqI5Wrau2QXxyuQsSSG6kn7RJqXLPri2WMNFZkHNU2sQS6OAe5Supy Nj8YkfJ2dMFZ9xe2O/OL0O5U/a+dt9fh5nMGyvYUwMNbD5qtZMFjeXMuJpYaPHc3ONw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=cs.cmu.edu; spf=pass smtp.mailfrom=andrew.cmu.edu; dkim=pass header.d=cs.cmu.edu header.i=@cs.cmu.edu header.a=rsa-sha256 header.s=google-2021 header.b=MGtovB50; arc=none smtp.remote-ip=209.85.219.53 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5364606A322 for ; Sat, 5 Dec 2026 23:21:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A5364606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cs.cmu.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=andrew.cmu.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=cs.cmu.edu header.i=@cs.cmu.edu header.a=rsa-sha256 header.s=google-2021 header.b=MGtovB50 Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-921d18b2fdfso17472506d6.3 for ; Sat, 05 Dec 2026 15:21:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.cmu.edu; s=google-2021; t=1796512861; x=1797117661; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=8+EwxPIuCAPwA6Y6veEeZLaUYsvwn5lQFGxIbT+JGMc=; b=MGtovB50HQJk/Pnh2tvrIwL8ImAJ6K2yospAf4WbccPPLtZwfvQiIBZkLUO4LPCFwH Ts4uA1C1S+IfV5ihq+5ZHBHC1LZVy6fqSXuEggjpNGAhU4WLMXoJ/isLpNkg+1NhY8gc bJOsUoQHsiph2jOpxpvn6E0g7VYQ44G7s1d6/Lmqx3Jg4C45miy0KWmYy12UM4lWuCTI tkJpaShBnT2BU6JrfcWW1DOCIwBxiH7kkr5mnpXGZJ/69xsfxSnTHpQjwijY62nabCzU QJd254U2GjUW5t5GESEKZ0IrWZZ+d6afuL0mY9eVKEs0Ob0urEHODz3OGRsUE1qH/M4y 9idQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796512861; x=1797117661; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=8+EwxPIuCAPwA6Y6veEeZLaUYsvwn5lQFGxIbT+JGMc=; b=mCZkp7vUdXPISIVuaDTOZoU4P+0Rrr8L1YYlRYOwBio/VsaPvKyucUq0S+mF1NBtlM sBbclp31F+tE/khdPB0U6OGZMqobkJDEp4aJ8toRnAGwBgBItdMhN+wlUfB0DCQp3eah OIuBSA8ai93FF5HN0NxlG0/BG9FHdcbMp/77RmjDhGWqRXjjeQPpXnrr+OcOL/ahFcxQ 1MD3i0fPa3XIKd1tvD4Dg3epRPrPJhzRlAc/UWbX4rP3BOhogL1ZIIvhTtcSQSOIUczP UTH86pLnrwzCZX764P3JFOy4eE+Ofyj68Vr6c4C4EpIMy5Qm+fTO93T//sn2+bJoQATF rVFw== X-Forwarded-Encrypted: i=1; AL+hErH93nkVm7hqwmurGHUcySZJD0RMZ026vu+1V+D9y175QrgJmeP8ZDnR0GUeRb+XU6AtZzMg+AHxtKGawBA=@vger.kernel.org X-Gm-Message-State: AB4q+uG+uRXN4mOidJkS3P6Da3Z4iOA3KoEb5FKJU6y8LlrlY3d7qpxR SvsxzeobsL4R4r+iqyN5bSEhKKxjHgI/a8SuYtiW44gYn2VKnPyPKiN+vo+vEsT3dg== X-Gm-Gg: AZFdTZfFDdvUgmSXGlzWqNmjawfJKtErLpsoI5OXCc0peOkdUh6N8DugV+8x17ZBuYd SZ0KI0HYtZuw5qRVPBwJbtiXqkhvBVD2STeNYnXOY8eMU6TSEG8MaEjLc0gXouPpz2UV7DcJmsQ sZKKP8e6aa+mxhSYBK5ks4SennFWb4fV3Kq1KY9RGsXa1vu079SxtkgHpBTt0ItG6qwOpnR39zg 9QzRyp+4RIGxhc7N55jwRUOq4vl9LK7NzKKA1plPFBwiFYtQl5l6sScYoNKmyNi8LMJ9rYWp352 IRJsyctu11Spg8kfyC9FgGuwwqTJEFFkPx/2u3BSOUSgEX9vdl13Vn38JN1Q03XNQV2dCKkgh82 GHlQ3z2PVnipEJgpMpY0I2hMRcE71QnS4MivmjXNfkBuJdDHIIBq1sINppxuiGBsSvV6JCG8aIX lwJ9FezF4Q/HdqJBL4lE3Ltah3f2NQb1pwhcEmz9ReGCra+XAAeZ9dJi4gjK3UPLAAj+2UyfSbF 6dzf9GKh+MKNNX2VUB+qifEsv1bqoxV4IkXDOFtZF2ZKQDXufaruh2Njnl9wKaeG+27pE/wE8k1 Er0bLDMDD51BDX3imSvk6PrebNj/gvFzwbovMKeZF1nhdG5gtX34lwdR+ktJ5UapWQXX5g== X-Received: by 2002:a05:6214:c47:b0:921:e107:72b with SMTP id 6a1803df08f44-921e268681dmr99356536d6.47.1796512861547; Sat, 05 Dec 2026 15:21:01 -0800 (PST) Received: from cs.cmu.edu (tempest.elijah.cs.cmu.edu. [128.2.210.10]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921e05a4e1fsm53615976d6.36.2026.12.05.15.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 15:21:01 -0800 (PST) Date: Sat, 5 Dec 2026 18:20:47 -0500 From: Jan Harkes To: Mar Dominguez Cc: Christian Brauner , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/3] coda: check and serialize Venus replies Message-ID: <20261205232047.fpt2h26fsn4oamli@cs.cmu.edu> Mail-Followup-To: Mar Dominguez , Christian Brauner , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <4tunabGBgBhPxJPJjae4oObi5JWoQRidatkh@talkjune.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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