Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216344/?format=api
{ "id": 2216344, "url": "http://patchwork.ozlabs.org/api/patches/2216344/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-2-dhowells@redhat.com/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/projects/12/?format=api", "name": "Linux CIFS Client", "link_name": "linux-cifs-client", "list_id": "linux-cifs.vger.kernel.org", "list_email": "linux-cifs@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260326104544.509518-2-dhowells@redhat.com>", "list_archive_url": null, "date": "2026-03-26T10:45:16", "name": "[01/26] netfs: Fix NULL pointer dereference in netfs_unbuffered_write() on retry", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "8ebb1a818a1bd36833b76e2ab4645e478cff4ab2", "submitter": { "id": 59, "url": "http://patchwork.ozlabs.org/api/people/59/?format=api", "name": "David Howells", "email": "dhowells@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-2-dhowells@redhat.com/mbox/", "series": [ { "id": 497565, "url": "http://patchwork.ozlabs.org/api/series/497565/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=497565", "date": "2026-03-26T10:45:15", "name": "netfs: Keep track of folios in a segmented bio_vec[] chain", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497565/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216344/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216344/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10524-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-cifs@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=fDj6xJtm;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10524-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=\"fDj6xJtm\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=170.10.129.124", "smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=redhat.com" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhLL50JhQz1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 21:56:13 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 3055B30E480D\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 10:47:03 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 750AB322B7B;\n\tThu, 26 Mar 2026 10:46:25 +0000 (UTC)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id A439A38B12D\n\tfor <linux-cifs@vger.kernel.org>; Thu, 26 Mar 2026 10:46:23 +0000 (UTC)", "from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-365-ZuIOung0PmK_T8_--PBq-A-1; Thu,\n 26 Mar 2026 06:46:19 -0400", "from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id AE5CD19560B6;\n\tThu, 26 Mar 2026 10:46:13 +0000 (UTC)", "from warthog.procyon.org.com (unknown [10.44.33.121])\n\tby mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id CF2E618002A6;\n\tThu, 26 Mar 2026 10:46:04 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774521985; cv=none;\n b=Nh3qJ+bp7/tgy9qn+LYqBQRKDWfh6fCfQHubQfX2pqz3SbWck6wEDfKBL++VmVni+Fs69UWYhwsb0wfgtGmkPdl9lEBa1SeuFVEqMYLC9XTfUUSPXT8kEqsSBrZ2R91ku3ucnJwkGJU5Mh+Ya0ehU2PSDzQ8TgxqrU6HK6aLCb4=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774521985; c=relaxed/simple;\n\tbh=V4fOTRTogYEpBNmIJVKnkZTFC5/VLtjae4HU+6Q4TwE=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=LT8rLr8wnPOTNSaNU1Pz8o4x09sgGqogtnOFaDPsrNS4GMLI65aviMhIWyXsY840uO7GMg/wrXvjO+iMwgWNQex4LQzFbNPSTUhA19d1OQ2AcbT9C5idfRs1yrI/qWeiou3EHogQM/0rOw/DSUN37xF9QYgIK/wreuRGlef2OKU=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com;\n spf=pass smtp.mailfrom=redhat.com;\n dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=fDj6xJtm; arc=none smtp.client-ip=170.10.129.124", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1774521982;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=ikME2fKnQmyL6ccsVR9iuIqF4Gk7rE38Es/pzWOmTZE=;\n\tb=fDj6xJtm/N4+mEoHE3Ot/4nj1rIvAkUjzm5xDVpkMklyTUn9dT2YmukaWCszz8vkKWmccp\n\tPX/OMy1ynxsrn0WAbi6snzNZK6PS11qX/fP1zC8POHrjBxaost4KV9oUZBvM7mAm6CFlS9\n\t4pPRMKh+7LNovGqCQK2JZXsdlJ0WwFo=", "X-MC-Unique": "ZuIOung0PmK_T8_--PBq-A-1", "X-Mimecast-MFC-AGG-ID": "ZuIOung0PmK_T8_--PBq-A_1774521975", "From": "David Howells <dhowells@redhat.com>", "To": "Christian Brauner <christian@brauner.io>,\n\tMatthew Wilcox <willy@infradead.org>,\n\tChristoph Hellwig <hch@infradead.org>", "Cc": "David Howells <dhowells@redhat.com>,\n\tPaulo Alcantara <pc@manguebit.com>,\n\tJens Axboe <axboe@kernel.dk>,\n\tLeon Romanovsky <leon@kernel.org>,\n\tSteve French <sfrench@samba.org>,\n\tChenXiaoSong <chenxiaosong@chenxiaosong.com>,\n\tMarc Dionne <marc.dionne@auristor.com>,\n\tEric Van Hensbergen <ericvh@kernel.org>,\n\tDominique Martinet <asmadeus@codewreck.org>,\n\tIlya Dryomov <idryomov@gmail.com>,\n\tTrond Myklebust <trondmy@kernel.org>,\n\tnetfs@lists.linux.dev,\n\tlinux-afs@lists.infradead.org,\n\tlinux-cifs@vger.kernel.org,\n\tlinux-nfs@vger.kernel.org,\n\tceph-devel@vger.kernel.org,\n\tv9fs@lists.linux.dev,\n\tlinux-erofs@lists.ozlabs.org,\n\tlinux-fsdevel@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tDeepanshu Kartikey <kartikey406@gmail.com>,\n\tsyzbot+7227db0fbac9f348dba0@syzkaller.appspotmail.com,\n\tDeepanshu Kartikey <Kartikey406@gmail.com>", "Subject": "[PATCH 01/26] netfs: Fix NULL pointer dereference in\n netfs_unbuffered_write() on retry", "Date": "Thu, 26 Mar 2026 10:45:16 +0000", "Message-ID": "<20260326104544.509518-2-dhowells@redhat.com>", "In-Reply-To": "<20260326104544.509518-1-dhowells@redhat.com>", "References": "<20260326104544.509518-1-dhowells@redhat.com>", "Precedence": "bulk", "X-Mailing-List": "linux-cifs@vger.kernel.org", "List-Id": "<linux-cifs.vger.kernel.org>", "List-Subscribe": "<mailto:linux-cifs+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-cifs+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.111" }, "content": "From: Deepanshu Kartikey <kartikey406@gmail.com>\n\nWhen a write subrequest is marked NETFS_SREQ_NEED_RETRY, the retry path\nin netfs_unbuffered_write() unconditionally calls stream->prepare_write()\nwithout checking if it is NULL.\n\nFilesystems such as 9P do not set the prepare_write operation, so\nstream->prepare_write remains NULL. When get_user_pages() fails with\n-EFAULT and the subrequest is flagged for retry, this results in a NULL\npointer dereference at fs/netfs/direct_write.c:189.\n\nFix this by mirroring the pattern already used in write_retry.c: if\nstream->prepare_write is NULL, skip renegotiation and directly reissue\nthe subrequest via netfs_reissue_write(), which handles iterator reset,\nIN_PROGRESS flag, stats update and reissue internally.\n\nFixes: a0b4c7a49137 (\"netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict sequence\")\nReported-by: syzbot+7227db0fbac9f348dba0@syzkaller.appspotmail.com\nCloses: https://syzkaller.appspot.com/bug?extid=7227db0fbac9f348dba0\nSigned-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>\nSigned-off-by: David Howells <dhowells@redhat.com>\n---\n fs/netfs/direct_write.c | 14 +++++++++++---\n 1 file changed, 11 insertions(+), 3 deletions(-)", "diff": "diff --git a/fs/netfs/direct_write.c b/fs/netfs/direct_write.c\nindex dd1451bf7543..4d9760e36c11 100644\n--- a/fs/netfs/direct_write.c\n+++ b/fs/netfs/direct_write.c\n@@ -186,10 +186,18 @@ static int netfs_unbuffered_write(struct netfs_io_request *wreq)\n \t\tstream->sreq_max_segs\t= INT_MAX;\n \n \t\tnetfs_get_subrequest(subreq, netfs_sreq_trace_get_resubmit);\n-\t\tstream->prepare_write(subreq);\n \n-\t\t__set_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags);\n-\t\tnetfs_stat(&netfs_n_wh_retry_write_subreq);\n+\t\tif (stream->prepare_write) {\n+\t\t\tstream->prepare_write(subreq);\n+\t\t\t__set_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags);\n+\t\t\tnetfs_stat(&netfs_n_wh_retry_write_subreq);\n+\t\t} else {\n+\t\t\tstruct iov_iter source;\n+\n+\t\t\tnetfs_reset_iter(subreq);\n+\t\t\tsource = subreq->io_iter;\n+\t\t\tnetfs_reissue_write(stream, subreq, &source);\n+\t\t}\n \t}\n \n \tnetfs_unbuffered_write_done(wreq);\n", "prefixes": [ "01/26" ] }