From nobody Mon Jun 8 09:48:09 2026 Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) (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 4244F31354F for ; Sat, 30 May 2026 02:13:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780107212; cv=none; b=Cz1IePMbIrAkEvzXTrTFw/1z8o7TnOLLaWxsvTM60Rq20nCgYOKFYhdbDThTEelrePLPRUfiet5kvAt5gO6HuG8jq0yCslxAHxiiik9rjckqiKIrNxLbpyVyysTU3sGfsLvdbNeYhLCpt1SDOZ/vGwxDVfDP6tGvDe8xvTEjJ1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780107212; c=relaxed/simple; bh=DncT/JA1ZvuEGMmO+QISnQiTMSrSe6hr9M96V4cBBwQ=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=OJCP29Wf6jVvG0edJDqoWINoJXsAcTsdsaObecgAUYdGgRQeKVPzVKW2kfNDjmRCoYlAL+QheoftNGzJ2Z0rJw+tLSwcZm/UvgVb38O5QwYsSASDb3qCqaab+OQ+emv8h1wbs1GqPDCbB7igSXiV6dwWFbzUss8BMuzpl+eCLZA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.160.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-43b472c3a38so15863916fac.1 for ; Fri, 29 May 2026 19:13:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780107210; x=1780712010; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qk2TiBpB8utinet1GClRfFalAZkA0G6+kxIcl/nSN5w=; b=PLuxRRROa9/77GUyOtUwAdSElYg3Qg9OdUid9Wk+Ipj6jmeoXEZ16S+EBBfJoZ+nXI NaSyvZ4TQJ4tuVY+bHC0Phr4Q7bNP3AbJC2GfL4EEPZjP1dxPZz4qudA9PPOEMASq2+p mmE6LAjcXhp4CuS0sLX1Ck+ck6M+nrSfyQNjoXtJfz3RedsTziUOUiTAGGhDaxwOBYs0 /7fhE7keLYf2jebmMrUZlfL2B8Bk/bCPeMwSIHfxTVjEMHApcUy0KPOSgSBY9TL2jpCO v4ODEdtTSh0GbxaigU9KCMTHCX/dib+/xI0wCd+Znsa8m5U+ap4N1d+8GZT6H9oOcAe0 Ft8w== X-Gm-Message-State: AOJu0Yw7MEviDA+iq6ovS+hAoHTZF+zrlU2DDQYOus4vqOWvimRbUvtl C0Z+jTBlg6bgTgNPSR4mYlLfOmLlxfGtyElwcJfBF4WDsA4jV6c5ziCSAsz3peQqnYYxHxjwdH/ KzaV4ZPXCyy4SXxnO/FLI5kNVz/mSOBhE6V34rGFLW6pnTe4fuAJ+DoULCW0= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:2229:b0:69b:8beb:945a with SMTP id 006d021491bc7-69e042c1b98mr2431413eaf.12.1780107210385; Fri, 29 May 2026 19:13:30 -0700 (PDT) Date: Fri, 29 May 2026 19:13:30 -0700 In-Reply-To: <6a19f098.abb04025.19af7b.0003.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a1a47ca.fd5edf16.2e7427.0004.GAE@google.com> Subject: Forwarded: #syz test From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: #syz test Author: hongao@uniontech.com From 57d3537f407aaf4229abc9b78513c6222cbfb799 Mon Sep 17 00:00:00 2001 From: hongao Date: Sat, 30 May 2026 09:08:24 +0800 Subject: [PATCH] netfs: Fix UAF in netfs_unbuffered_write() on failed preparation #syz test If write subrequest preparation fails, netfs_unbuffered_write() calls netfs_write_subrequest_terminated() and then reads subreq->error to set wreq->error. However, netfs_write_subrequest_terminated() consumes a reference to the subrequest through netfs_put_subrequest(), so the subrequest may be freed before netfs_unbuffered_write() reads subreq->error again. This can trigger a slab-use-after-free. Save the error locally before terminating the subrequest, and use the saved value afterwards. Fixes: a0b4c7a49137 ("netfs: Fix unbuffered/DIO writes to dispatch subreque= sts in strict sequence") Reported-by: syzbot+3c74b1f0c372e98efc32@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D3c74b1f0c372e98efc32 Signed-off-by: hongao --- fs/netfs/direct_write.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/netfs/direct_write.c b/fs/netfs/direct_write.c index 25f8ceb15fad..2d5361702076 100644 --- a/fs/netfs/direct_write.c +++ b/fs/netfs/direct_write.c @@ -115,8 +115,9 @@ static int netfs_unbuffered_write(struct netfs_io_reque= st *wreq) =20 /* Check if (re-)preparation failed. */ if (unlikely(test_bit(NETFS_SREQ_FAILED, &subreq->flags))) { - netfs_write_subrequest_terminated(subreq, subreq->error); - wreq->error =3D subreq->error; + ret =3D subreq->error; + wreq->error =3D ret; + netfs_write_subrequest_terminated(subreq, ret); break; } =20 --=20 2.51.0