Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3387125rwi; Wed, 12 Oct 2022 00:53:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4WUQ8ksLVteGH8c/QnDrRtq5fe3waNCR1862sWzryKf0CnXdeoLgtp0BrHtPkt1smhn7mM X-Received: by 2002:a05:6402:11ce:b0:45c:a2a2:4207 with SMTP id j14-20020a05640211ce00b0045ca2a24207mr2770243edw.3.1665561220209; Wed, 12 Oct 2022 00:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665561220; cv=none; d=google.com; s=arc-20160816; b=Msxw0d70mJTXkcKMmbw70BKMIVl7X002B1OI2NOlIcYOFX4dHu8ejIPb/Y7p0ikGJt 0b92PVWwra8JQI1W4Apf/fOVif7OBCqKZtuYgnusZbhEivxa3L5hoQysy1yoR3R9YQ0a UxS+BavU8+NnJYh0oRkIUow/tGKkhc9shB7U2L0LcFKgLjmlIatHQtFiLU0l4RsQZtEY iixEGvCfmbiwKdYS1H9l8Hzk8CtlmFWn5Wos4v8nyBX4hQ6xRFYcXApJ1e40MvmFoLtZ TrTLJ2FTufmPCAby+3WwQHNX/aPUm2VLh5cBIrbfR3LzrnDk6HG8s6+Pls4GFPCtpdMV lGBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bmU9W0XZiRdP2N9ImJn0s77Xn78tcaTvvKQgrKl9v5I=; b=ajdI+ix0vAmM30Ipl9tehZ+EfaUsX947QRVuJIemegARosZZVBDqR7UnpmNjauxiGt JkRsZ+sC8zSQDXH+m8Zs5sG58OciLTGeiLB7VIFbdBzotuwyKIzEFvMxS9iNDksBc39j dGc6fWoV6xx9HgfR4M5mu9L+kwSm69VEUjXpoXHGZUzSiUZjmZPGzHHs2IOoFfz3L5jy xebO3cVx3YPXENeZydfSVMbjG/m0Hdl324GnhTZKOwMajdvQXt1J/BXn5lvl+CcJtD6f r1cMJEz2T2gAwed4kIvPxMgaElcXFhb3MO9WOa6AHcPiAND9DR0dezG1qevlwylEeFvt wGFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd3-20020a1709069b8300b0078d99e20b68si14425823ejc.715.2022.10.12.00.53.04; Wed, 12 Oct 2022 00:53:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbiJLHwQ (ORCPT + 99 others); Wed, 12 Oct 2022 03:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbiJLHwO (ORCPT ); Wed, 12 Oct 2022 03:52:14 -0400 X-Greylist: delayed 401 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 12 Oct 2022 00:52:12 PDT Received: from giacobini.uberspace.de (giacobini.uberspace.de [185.26.156.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50CEA9C2DD for ; Wed, 12 Oct 2022 00:52:12 -0700 (PDT) Received: (qmail 18606 invoked by uid 990); 12 Oct 2022 07:45:29 -0000 Authentication-Results: giacobini.uberspace.de; auth=pass (plain) From: Soenke Huster To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: Soenke Huster , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 RESEND] Bluetooth: virtio_bt: Use skb_put to set length Date: Wed, 12 Oct 2022 09:45:06 +0200 Message-Id: <20221012074507.8157-1-soenke.huster@eknoes.de> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20220727070541.6450-1-soenke.huster@eknoes.de> References: <20220727070541.6450-1-soenke.huster@eknoes.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Bar: / X-Rspamd-Report: BAYES_HAM(-2.823088) R_MISSING_CHARSET(0.5) MIME_GOOD(-0.1) MID_CONTAINS_FROM(1) SUSPICIOUS_RECIPS(1.5) X-Rspamd-Score: 0.076911 Received: from unknown (HELO unkown) (::1) by giacobini.uberspace.de (Haraka/2.8.28) with ESMTPSA; Wed, 12 Oct 2022 09:45:29 +0200 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org By using skb_put we ensure that skb->tail is set correctly. Currently, skb->tail is always zero, which leads to errors, such as the following page fault in rfcomm_recv_frame: BUG: unable to handle page fault for address: ffffed1021de29ff #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page RIP: 0010:rfcomm_run+0x831/0x4040 (net/bluetooth/rfcomm/core.c:1751) Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver") Signed-off-by: Soenke Huster --- v2: Add Fixes tag drivers/bluetooth/virtio_bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c index 67c21263f9e0..fd281d439505 100644 --- a/drivers/bluetooth/virtio_bt.c +++ b/drivers/bluetooth/virtio_bt.c @@ -219,7 +219,7 @@ static void virtbt_rx_work(struct work_struct *work) if (!skb) return; - skb->len = len; + skb_put(skb, len); virtbt_rx_handle(vbt, skb); if (virtbt_add_inbuf(vbt) < 0) -- 2.36.1