Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1438361ybl; Sat, 25 Jan 2020 00:24:46 -0800 (PST) X-Google-Smtp-Source: APXvYqxFbTOY2W4A6yPEVzWRjFyyLSBTTNvTWirnP6YZPKNewCc+g1xkdoLTpBNxzyR0e8Ddqf96 X-Received: by 2002:a05:6808:907:: with SMTP id w7mr1815547oih.137.1579940686558; Sat, 25 Jan 2020 00:24:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579940686; cv=none; d=google.com; s=arc-20160816; b=ok7USQ8etui5kE/SAHSwFzUvPstbvpIuiI+7DSRPkcVEseK9uSbRXg2G+WeYi9axd1 zufn5B1vORmngdV+pcnCWC6G9TbHqk+HZZb3Nqs5EB2OcXduXoZ+RF9pIiK7mGmI35gi 60COp/K2IpqkMR53VoJ3RUCGiObh2dLBzpgTve9llG5/m8zU221vUZ30pEHsIJ4yBLfc AgFBWxYSmo7NgWafDHbRDFvg0+ugUepUWbRk2peN1J6cwbOfYf78H9aK994HMz3U0Rr2 KGIzBJvMBRGB9HneszTtWYkA4mGE+TbUB8NOkOj3l2cPjlz3jG0jiGq0uJC86mZfqfUI LzIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=E9WZoYS6GlumS3W/nonQ1liJEwU8Bk1S1/kfR+CuHN4=; b=MLu8DIuKMxwWAzP2JeJnYkZApnDoGIEZsiQU5abmb73a5S9xQvFe5UHzq7c0jzp/1R vaY9ht/mTLO97Dgz8+6geZ0PfSq0rZsGN7kDiVT/6kSJ4oBQMnUvDQUQjQ7nBkewofrk LVDv7AKHott+zyEqtngADlzEIz4O9WXHVHw4DP8PsftkKJ0kdgp2qmN12rxozPg8nu2Q BbIH2T89Ij8HPBYE3FiAYVVnNL/uQ4KXkLM9GfaMCKmXlQrdaVKOcROasAj/n9sDcpic AiKtDwV2DNVGauQBu3FYPc5PTf730RKC6V3MjuYhThpY2bH/oeUqaX6lAckgBZr0LbZj o79Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si3758493oti.273.2020.01.25.00.24.15; Sat, 25 Jan 2020 00:24:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbgAYIXw (ORCPT + 99 others); Sat, 25 Jan 2020 03:23:52 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:44876 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbgAYIXw (ORCPT ); Sat, 25 Jan 2020 03:23:52 -0500 Received: from localhost.localdomain (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id 37B91CED19 for ; Sat, 25 Jan 2020 09:33:11 +0100 (CET) From: Marcel Holtmann To: linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: Add missing checks for HCI_ISODATA_PKT packet type Date: Sat, 25 Jan 2020 09:23:47 +0100 Message-Id: <20200125082347.96440-1-marcel@holtmann.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The checks for HCI_ISODATA_PKT packet type are required in a few additional locations to allow sending/receiving of this new packet type. Signed-off-by: Marcel Holtmann --- net/bluetooth/hci_core.c | 4 +++- net/bluetooth/hci_sock.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 1ca7508b6ca7..cbbc34a006d1 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3565,7 +3565,8 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb) if (hci_skb_pkt_type(skb) != HCI_EVENT_PKT && hci_skb_pkt_type(skb) != HCI_ACLDATA_PKT && - hci_skb_pkt_type(skb) != HCI_SCODATA_PKT) { + hci_skb_pkt_type(skb) != HCI_SCODATA_PKT && + hci_skb_pkt_type(skb) != HCI_ISODATA_PKT) { kfree_skb(skb); return -EINVAL; } @@ -4543,6 +4544,7 @@ static void hci_rx_work(struct work_struct *work) switch (hci_skb_pkt_type(skb)) { case HCI_ACLDATA_PKT: case HCI_SCODATA_PKT: + case HCI_ISODATA_PKT: kfree_skb(skb); continue; } diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 3ae508674ef7..5756b124c2cb 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -211,7 +211,8 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb) if (hci_skb_pkt_type(skb) != HCI_COMMAND_PKT && hci_skb_pkt_type(skb) != HCI_EVENT_PKT && hci_skb_pkt_type(skb) != HCI_ACLDATA_PKT && - hci_skb_pkt_type(skb) != HCI_SCODATA_PKT) + hci_skb_pkt_type(skb) != HCI_SCODATA_PKT && + hci_skb_pkt_type(skb) != HCI_ISODATA_PKT) continue; if (is_filtered_packet(sk, skb)) continue; @@ -220,7 +221,8 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb) continue; if (hci_skb_pkt_type(skb) != HCI_EVENT_PKT && hci_skb_pkt_type(skb) != HCI_ACLDATA_PKT && - hci_skb_pkt_type(skb) != HCI_SCODATA_PKT) + hci_skb_pkt_type(skb) != HCI_SCODATA_PKT && + hci_skb_pkt_type(skb) != HCI_ISODATA_PKT) continue; } else { /* Don't send frame to other channel types */ @@ -1768,7 +1770,8 @@ static int hci_sock_sendmsg(struct socket *sock, struct msghdr *msg, */ if (hci_skb_pkt_type(skb) != HCI_COMMAND_PKT && hci_skb_pkt_type(skb) != HCI_ACLDATA_PKT && - hci_skb_pkt_type(skb) != HCI_SCODATA_PKT) { + hci_skb_pkt_type(skb) != HCI_SCODATA_PKT && + hci_skb_pkt_type(skb) != HCI_ISODATA_PKT) { err = -EINVAL; goto drop; } @@ -1812,7 +1815,8 @@ static int hci_sock_sendmsg(struct socket *sock, struct msghdr *msg, } if (hci_skb_pkt_type(skb) != HCI_ACLDATA_PKT && - hci_skb_pkt_type(skb) != HCI_SCODATA_PKT) { + hci_skb_pkt_type(skb) != HCI_SCODATA_PKT && + hci_skb_pkt_type(skb) != HCI_ISODATA_PKT) { err = -EINVAL; goto drop; } -- 2.24.1