From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F00DCEB64D9 for ; Thu, 29 Jun 2023 21:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Message-ID:Date: Content-Transfer-Encoding:Content-ID:Content-Type:MIME-Version:Subject:cc:To: From:Reply-To:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=K03oWfg7ltpvcM3Ih7makmSjGjXBMyrolfLAXXIm6H0=; b=1n5MrRR+hCCDUuMyZwc5kBiOeU WetCRBQT9CWNgM5vFm2vMEBcw4ipoPo1EfJ1havsGNSxAZe1FDfZNhcq7erSrh2UiBmNULRYjQrec xOYPzrsKa7SDl3bhlzOGi89lx4Tw7EPW1i4rlAPY5J+OwrPR1UXzty01T/FcCCPCB6jH/YgCuekCi /pu+Gd7jfXgxPxKCXiR+AWmyNvGYlOh6nX4Rtzv70Q5C5kqdgsJwJz2BM0y2465uzc1iGdqhvLTCk 69YRot7lzyUVB1F/nIujOko9APv/lLfa/5SKaPzoy8Rs6fxjuUXoq80Bnzb9DnEL+z6XfXkYHcMMd GgXNgoMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEzUj-002GsL-2e; Thu, 29 Jun 2023 21:48:05 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEzUg-002GrP-2u for linux-nvme@lists.infradead.org; Thu, 29 Jun 2023 21:48:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688075279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K03oWfg7ltpvcM3Ih7makmSjGjXBMyrolfLAXXIm6H0=; b=ETabmBBVtfHZUZdPmr4QpyCd2rE9qPx3pa5glsk78K9bYXTip2J9Bbzk31i//un3w+RsmM OMEN2AQ65MI+X7mzvXA8LDwQ7OrDn38LFwW8t/EdQ3KW/qRSiiYzz6kQwfgNmOF+OaaSeH 15Q8C83JNXgIvtCd6CA/LMnuvjl4T0M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-421-11qw2n_LObuF0zIJeZUVIA-1; Thu, 29 Jun 2023 17:47:56 -0400 X-MC-Unique: 11qw2n_LObuF0zIJeZUVIA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C353185A793; Thu, 29 Jun 2023 21:47:55 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id D355B492B02; Thu, 29 Jun 2023 21:47:53 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: netdev@vger.kernel.org cc: dhowells@redhat.com, Aurelien Aptel , Sagi Grimberg , Willem de Bruijn , Keith Busch , Jens Axboe , Christoph Hellwig , Chaitanya Kulkarni , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jens Axboe , Matthew Wilcox , linux-nvme@lists.infradead.org Subject: [PATCH net] nvme-tcp: Fix comma-related oops MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <59061.1688075273.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Jun 2023 22:47:53 +0100 Message-ID: <59062.1688075273@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230629_144803_037714_5CE8FA67 X-CRM114-Status: GOOD ( 21.41 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org Fix a comma that should be a semicolon. The comma is at the end of an if-body and thus makes the statement after (a bvec_set_page()) conditional too, resulting in an oops because we didn't fill out the bio_vec[]: BUG: kernel NULL pointer dereference, address: 0000000000000008 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page ... Workqueue: nvme_tcp_wq nvme_tcp_io_work [nvme_tcp] RIP: 0010:skb_splice_from_iter+0xf1/0x370 ... Call Trace: tcp_sendmsg_locked+0x3a6/0xdd0 tcp_sendmsg+0x31/0x50 inet_sendmsg+0x47/0x80 sock_sendmsg+0x99/0xb0 nvme_tcp_try_send_data+0x149/0x490 [nvme_tcp] nvme_tcp_try_send+0x1b7/0x300 [nvme_tcp] nvme_tcp_io_work+0x40/0xc0 [nvme_tcp] process_one_work+0x21c/0x430 worker_thread+0x54/0x3e0 kthread+0xf8/0x130 Fixes: 7769887817c3 ("nvme-tcp: Use sendmsg(MSG_SPLICE_PAGES) rather then = sendpage") Reported-by: Aurelien Aptel Link: https://lore.kernel.org/r/253mt0il43o.fsf@mtr-vdi-124.i-did-not-set-= -mail-host-address--so-tickle-me/ Signed-off-by: David Howells cc: Sagi Grimberg cc: Willem de Bruijn cc: Keith Busch cc: Jens Axboe cc: Christoph Hellwig cc: Chaitanya Kulkarni cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Jens Axboe cc: Matthew Wilcox cc: linux-nvme@lists.infradead.org cc: netdev@vger.kernel.org --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 3e7dd6f91832..9ce417cd32a7 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1014,7 +1014,7 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_re= quest *req) msg.msg_flags |=3D MSG_MORE; = if (!sendpage_ok(page)) - msg.msg_flags &=3D ~MSG_SPLICE_PAGES, + msg.msg_flags &=3D ~MSG_SPLICE_PAGES; = bvec_set_page(&bvec, page, len, offset); iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, len);