Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp94061imn; Wed, 27 Jul 2022 00:10:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sbsP8L5HpWUpcp2isVAWJaWEGNxniB25fx3HHnkZdIXnULCgEltC+wYWxRWBQlZvM9PCFw X-Received: by 2002:a17:90b:4ccb:b0:1f2:59ad:1eb with SMTP id nd11-20020a17090b4ccb00b001f259ad01ebmr3097806pjb.119.1658905818309; Wed, 27 Jul 2022 00:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658905818; cv=none; d=google.com; s=arc-20160816; b=ql/TBHRuPTyk4C4Yz0m5MM5cit8IntBSsIomSg5vSNGP4K61CDGtLbdalPiPdXKNKx A5f/bJW1a84ooQ7WE3/2xugBouEm00yQDRPm1CUIgXJ/j9v3TbnroWMsxaUVZetGP3WO /vstL2dp2qaO6p4TcpYNELw5rGy7daBf7GpmpkiByYv/WBg5dxb5ICtF7Vzu1l21hAOH 0z7HXPiu/wlNh9KfavxXoXDBAomyiiFc0crWvZo/iOzOkTI4L2NwDbpj7vob8nlFHldR +mwv9f7G+z68GyZwQCMkcJUg8VWG18XYkuO3JJw4feTkYL9tBA9U3KFSgHi/7eLvGUxp rK4A== 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 :message-id:date:subject:cc:to:from; bh=bmU9W0XZiRdP2N9ImJn0s77Xn78tcaTvvKQgrKl9v5I=; b=KqHy2GFt6n1nixaTcX7mJTAfPCGqyTL2hWB/+S2W9V02rxvWkDRXDoImaoOCKgqpFC DkxMNB5ct64d58hm58Y6UjvCeONpdvuUYd1uNumIyCz4Df3LrAPK2A/PmvhtpZxbAour 8sctesP55yZnzmEZsyhrfZmM7cAsYKdKBon0jxaWvSwh5CEzDhhZ6Ratq2cUIZ6/SI4l wKztVWcCdG0BDAcjGQiQDuHOWip/AkYCjw9TnGQyss3IypniYUrND3sZiFoeiq4MWkw4 O/2SMVl6yggQTg7KIni0LXQQ66UmtBDWUNKwPv+0Tdqyq13zwBO1FPb4DUo1KrNSsiRc GPJA== 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 a23-20020a637057000000b004199b7e9ff2si16468425pgn.132.2022.07.27.00.09.48; Wed, 27 Jul 2022 00:10:18 -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 S229580AbiG0HHk (ORCPT + 99 others); Wed, 27 Jul 2022 03:07:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbiG0HHj (ORCPT ); Wed, 27 Jul 2022 03:07:39 -0400 Received: from giacobini.uberspace.de (giacobini.uberspace.de [185.26.156.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C69E31DD8 for ; Wed, 27 Jul 2022 00:07:36 -0700 (PDT) Received: (qmail 3033 invoked by uid 990); 27 Jul 2022 07:07:34 -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] Bluetooth: virtio_bt: Use skb_put to set length Date: Wed, 27 Jul 2022 09:05:42 +0200 Message-Id: <20220727070541.6450-1-soenke.huster@eknoes.de> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Bar: / X-Rspamd-Report: BAYES_HAM(-2.900355) R_MISSING_CHARSET(0.5) MIME_GOOD(-0.1) MID_CONTAINS_FROM(1) SUSPICIOUS_RECIPS(1.5) X-Rspamd-Score: -0.000355 Received: from unknown (HELO unkown) (::1) by giacobini.uberspace.de (Haraka/2.8.28) with ESMTPSA; Wed, 27 Jul 2022 09:07:33 +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