Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2514385imi; Sun, 24 Jul 2022 23:55:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u/7GO7KelJXxOV5yuXc3hkAjnsg63z8hJzNJ7XHRmImMbDh11UP6SRNVJf469rj203tpkf X-Received: by 2002:a17:903:25d2:b0:16d:20e4:8c0f with SMTP id jc18-20020a17090325d200b0016d20e48c0fmr10783290plb.29.1658732151797; Sun, 24 Jul 2022 23:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658732151; cv=none; d=google.com; s=arc-20160816; b=yJgPKg4HlGF5wCFDul4QCJbWDm9I2m6EPCZ8iYW8jQmD5kHXne4yF5BeIZcU9XGdBg t1hVuYY366TbQJJOiNueIUbKeJNHNhrOnH5ghcYtN0wvMiv0AdZFLgPZvqZDUYELK/y6 ELdUj8wB5xXcA0xj1E6+inG28cdzw5zp/94JpEa6uizxzl1dlHlH0g3qz4JDuOYtS1vm a3tdAZ8erDf2I29u9uMVJkLs8LYPRhUBNte+RsXfJ7Y9mPlmOgtMkYqdAqRpxKtyMjW3 sox0DPPWzpSS4uoikGtQWaGM9Wes4KJ+iKJWnS4GNpQyyAsgcxJ1sgY00MsYvod80H4X xu1g== 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=tyzAfpFP40QhcruORiT6nJY2vBim91Mc5sVwL164+P4=; b=Mga4x5g4Kyg3NVsrqfT2jwkZlnsStZxvVtRnuciZ7q259BKSb/PIdMlOKuEdZUmguM Skq4Ejn7fGO2FgxS2phWFVNcBnZaqtxPk+gaSPKqowO/UhtRhCTDJIgVyD0sx+Wdnj/l iZ0zzHRH25V0g70y65gtkHl697hDYEdxHEDJFvhI3z6K8M5+6tnu18giTo7ROurDZbNk vrLU/RnlZsrgnmvvac6CH7gXiGAIbLIsomOjNZrP5xhiaFgp/KiLKba0CJX/8DXmMzTv mIFGIZjsXvI8Z+AHM1GwnUupZ3VnYjPMNOCtF65W9mWWiNvIAR9x7bE5el13mRffe4Zq 46Ig== 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 w69-20020a638248000000b0041ab001260csi8231207pgd.164.2022.07.24.23.55.28; Sun, 24 Jul 2022 23:55:51 -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 S229694AbiGYGxt (ORCPT + 99 others); Mon, 25 Jul 2022 02:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230270AbiGYGxd (ORCPT ); Mon, 25 Jul 2022 02:53:33 -0400 Received: from giacobini.uberspace.de (giacobini.uberspace.de [185.26.156.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 055AC11C0B for ; Sun, 24 Jul 2022 23:53:29 -0700 (PDT) Received: (qmail 23557 invoked by uid 990); 25 Jul 2022 06:53:27 -0000 Authentication-Results: giacobini.uberspace.de; auth=pass (plain) From: Soenke Huster To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: Soenke Huster , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH Resend] Bluetooth: virtio_bt: Use skb_put to set length Date: Mon, 25 Jul 2022 08:53:15 +0200 Message-Id: <20220725065316.6942-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.923892) R_MISSING_CHARSET(0.5) MIME_GOOD(-0.1) MID_CONTAINS_FROM(1) SUSPICIOUS_RECIPS(1.5) X-Rspamd-Score: -0.023892 Received: from unknown (HELO unkown) (::1) by giacobini.uberspace.de (Haraka/2.8.28) with ESMTPSA; Mon, 25 Jul 2022 08:53:26 +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) Signed-off-by: Soenke Huster --- 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