From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64E17330B2D for ; Sat, 25 Jul 2026 01:44:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784943899; cv=none; b=ENsANjozVcUWMjMRaO134wAgj3krGE/g3eM4rkJ8E76VAS7UTEjPGcHU+CwSBsUr5tJJG/3O1UpmAbYIj5Daigo2Ttj/f+By4hQD2IJXvXPo3O44BharEvjKz9CxEafdFthWvntREYTt+Gs563TFSnjZWy2xINVOzNrSYayGUkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784943899; c=relaxed/simple; bh=JC1RPRMvNmvIV9WziwHo2xygwz477pttSg/6YpjAA0c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bTCq295skXhUi9a1kI22CIq4lOaK0ivX0OLeiBzcvgm8bEPxbrzCbTEYf/eSq7Bh8Vw9RoJfYFDsX67ajsUK/P+E/KFexlnM5AxxVmBuAM9LdvaaKJfUcBxJ/275lSe638TYbsvyThHYZTWykDdAdXM3NUtLbWJnVJ5DhAf8cJs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hrJT21/F; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hrJT21/F" Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-c9fe3c9bd5fso1392807a12.0 for ; Fri, 24 Jul 2026 18:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784943898; x=1785548698; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=SsycQkK3K/Sg2WBClWyOTHAiyU64+SefL9aiA1MnBEs=; b=hrJT21/FyTBpDU9WFEthxK3RYF+hY5y6AONOf9swwwMfpC5PtlCORBcYNeUQFyQvKA AWf+RFQ4SnxM91BM4tfAS/lpBoeG7OtsF9L4AK83juIt5imnpsSO/9gW/3UrCeYRCf+1 +2B+WbL3n5r72ffhupIyEvKHYXnmz13qNemqlrPQeMJvW/mBUSB5YP2ynQiF5yoMneod yAY5MKFPN2NK/NUx0iP4hZ8Lvw3nop21ZTtjZOVLlskBMjFk9kE+2MkWxrRtKZKvM+HE Saanq2xFpw5487Qnjon88ifmNe8Fsdu1T+xcbvZpKhyakldtomjEjCjDDpxFg2/OxMsT KePA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784943898; x=1785548698; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=SsycQkK3K/Sg2WBClWyOTHAiyU64+SefL9aiA1MnBEs=; b=LEPKY5uvlmqtXoSxsZQ2GDFnkNksR9jfXTMhICIovh0qx5JrtJwn2oNtKqpGdmnYOa YDB8ClK8WNRC7OoBLSEZIMQ+mQEqEPXwD3mE/ckb07NL0ed2d3H6vQ3X/uUjROn5uPBS 8KTX9GwvKcOoHuNIF2GEa7PYweY9OjG5kkevAK4PnX6waNFlSRfoAtlbzUtK62UV9/zK 6lrHjyGAKH0tYO1fHxtAJXGg9VcRkuOp9xG6wdTH/rTNOc48goaXlUHfld7UbDqd+ZdJ KH9whULGEU57kkJPE2HqF3cKd2HlVp7dFvn2gYPRMAlKzSeYTuLCOFkIdzlCiANbapSA 5ZLQ== X-Forwarded-Encrypted: i=1; AHgh+RpXm7Txfs88y1L5Uk3tcB41F/erirOMbFkuPAmeAZ0wmhfeu7Vhp2c2W944acpupPor50LGbQvUp0SCdEE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/nF6FOgtcdxr96trwa1vNH+Qu9BNSAN6v78xijuBAqzGZa5KM vP2q9AlX2LO11hBjtOCOY3HilUVqyCosIWxXRgrvsgU5+0W45nE8laWv X-Gm-Gg: AR+sD10X/3N3XEojc0mgozXg0tf5UyqwdAFS49BFmmyEnHYvZ+S5sSK1MFrwePwjLA/ RbjOJ95BJH5ep54j2rAofwd/dtdDMJA2rTXGeFTUaDKrtBHhVsY1+x05OQYnxv7Xh4niPAr771B O2c+QGYbRc9hASPjbpayOEepktl0iRHGt08kevThCoshBzesHs1IPoogHDlKJzwQ7x8IPxkErBM EZT7ELQOkaDd2Y6IJb4UgcD3TG0o3KFp8+i6Co4Z+P3s4AdR8KeyPAx7oI+ZLxITTMCB7Ox2vdS qOPhGrsQbvx72vSl1Seu/t3dZEIa1akOVsRSUedCSa/pZgmWVASa9TY46FLmKiAZbQdmsSMOdgU iW4O5z1wvNrgaOHyc59Pr22PkqcS71E8c3gS3RcIt7bNXuN7ml73p0f491w4FL9izN0OkSbTnUl o34K8sk1CsubeuPNDuBpFVR66iG/r6GpVbdxBxGJbzKUhbIGa1UgcSX71pspg= X-Received: by 2002:a17:90b:380e:b0:37f:e5b1:ec4b with SMTP id 98e67ed59e1d1-38f1eaaa3e2mr2990188a91.5.1784943897637; Fri, 24 Jul 2026 18:44:57 -0700 (PDT) Received: from deepanshu-kernel-hacker.. ([2401:4900:30d2:c11f:7948:960a:6d92:5986]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13e53094d65sm1378443c88.13.2026.07.24.18.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2026 18:44:56 -0700 (PDT) From: Deepanshu Kartikey To: ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, linux_oss@crudebyte.com Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, Deepanshu Kartikey , syzbot+344c09c64fcd8d3d2782@syzkaller.appspotmail.com Subject: [PATCH] 9p: don't WARN_ONCE on racy symlink fid lookup failure Date: Sat, 25 Jul 2026 07:14:48 +0530 Message-ID: <20260725014448.18711-1-kartikey406@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit v9fs_init_request() WARN_ONCE()s when v9fs_fid_lookup() fails for a symlink read via the page cache. This is a benign TOCTOU race: a concurrent unlink()/rename() can remove the target between the walk finding the dentry and p9_client_walk() completing, so the lookup legitimately fails with -ENOENT (observed: dentry=/file0, err=-2). With panic_on_warn=1, this WARN escalates to a full kernel panic -- an unprivileged local DoS reachable by racing mount() against a concurrent unlink/rename. Return the error directly instead of WARN_ONCE(). Reported-by: syzbot+344c09c64fcd8d3d2782@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=344c09c64fcd8d3d2782 Signed-off-by: Deepanshu Kartikey --- fs/9p/vfs_addr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index 1ac0b3dcc077..121679488ab9 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -140,13 +140,16 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file) goto no_fid; p9_fid_get(fid); } else if (S_ISLNK(rreq->inode->i_mode)) { + /* racing unlink/rename can make this fail with -ENOENT; + * that's expected, not a kernel bug, so don't WARN + */ dentry = d_find_any_alias(rreq->inode); if (!dentry) goto no_fid; fid = v9fs_fid_lookup(dentry); dput(dentry); if (IS_ERR(fid)) - goto no_fid; + return PTR_ERR(fid); } else { fid = v9fs_fid_find_inode(rreq->inode, writing, INVALID_UID, true); if (!fid) -- 2.43.0