From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B110606A31B for ; Wed, 21 Oct 2026 07:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=E5qlnPPT; dkim=pass (1024-bit key, unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=NL3VYw0n 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:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nCsIQozWbiChRVAnBeeMNJUrcxjUzwc0Cz0qWxIuZNg=; b=E5qlnPPT3vPI0aUCkuBhGqSp5/ 5YVyLFGuMpgjureHZmNm81SFezyn7QHMzQurC9dTk70p/Zwwrfq3I/0MOZAsopNe3uoAT357TRz5B 9Vp+9ctotFde4IjYigDGFv+44DHhxdofr8dtx4EgCEPmi0AcprZObscppoGP83Erh0b8Pzh8+/I+e Qa8I1WFh15xYdcv+kVAkRyOQwIZklPBsUYui0wJZDHMzzm4xSZ91JGFNfs15xs6Dhet6wihjqOknr f7LSEBETeicy+7mDY+bcEllJF9D2Y9z2ZKZ7U6QBcxrmyvFHgiYEpM96QsqtkcUKAI0OjUhsXQIUp NZ976InA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xJQgB-0000000BFUf-1lg0; Wed, 21 Oct 2026 07:24:07 +0000 Received: from [216.200.240.185] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xJQg8-0000000BFTF-3ehB for linux-mediatek@lists.infradead.org; Wed, 21 Oct 2026 07:24:05 +0000 X-UUID: 62b93050cd2011f1acbe4559397dec65-20261021 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=nCsIQozWbiChRVAnBeeMNJUrcxjUzwc0Cz0qWxIuZNg=; b=NL3VYw0n0lfQ+q17Mch6dwDZkxEpdi2dM9cbHFuz24Ztqi3QGDApZeu+qbkFDdJ72s6z2q4PBfCQ109kf7A2D6pw47KqVoiIYuTaxWOwDTf/XUlnCLw0P5bDzvzFe57uqDVZTVjMd0iSLo75Ey2Y9Rz9hVrJDEADx0IrugbkmlE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.20,REQID:3ebd238d-4319-4941-a47c-c6325137b52a,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:291e20b,CLOUDID:573cdeba-4006-44bb-949c-6e25a7b8dad4,B ulkID:nil,BulkQuantity:0,SF:81|82|102|836|865|888|898,TC:-5,Content:0|15|5 0|99,EDM:-3,IP:nil,URL:0,File:130,RT:0,Bulk:nil,QS:nil,BEC:-1,COL:0,OSI:0, OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 62b93050cd2011f1acbe4559397dec65-20261021 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2041823890; Wed, 21 Oct 2026 00:24:00 -0700 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Wed, 21 Oct 2026 15:23:57 +0800 Received: from mtksitap99.mediatek.inc (10.233.130.16) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Wed, 21 Oct 2026 15:23:57 +0800 From: Chris Lu To: Marcel Holtmann , Johan Hedberg , Luiz Von Dentz CC: Hao Qin , Wenlong Tian , Sean Wang , Will Lee , SS Wu , linux-bluetooth , linux-kernel , linux-mediatek , Chris Lu Subject: [PATCH v3 1/3] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding Date: Wed, 21 Oct 2026 15:23:53 +0800 Message-ID: <20261021072356.1449539-2-chris.lu@mediatek.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20261021072356.1449539-1-chris.lu@mediatek.com> References: <20261021072356.1449539-1-chris.lu@mediatek.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261021_002404_954843_825B3022 X-CRM114-Status: GOOD ( 15.64 ) X-Spam-Score: -1.3 (-) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The ISO interrupt IN endpoint delivers a fixed-size transfer that holds one HCI ISO packet and zero-fills the remainder. That padding belongs to the transfer rather than to the stream, so it has to be dropped instead of reported to the host. btmtk_recv_isopkt() keeps parsing it: the zero bytes read as an ISO header with handle 0 and a Data_Total_Length of zero, and each one is passed to hci_recv_frame() as a complete frame. A single transfer yields a long run of them, which is what fills the HCI log with malformed ISO packets, and iso_recv() drops the SDU it is reassembling whenever handle 0 belongs to a live CIS/BIS. A zero Data_Total_Length carries no ISO Data Load, so such a packet is never part of the stream. Confirm that the rest of the transfer is zero-filled before dropping it, since the padding runs to the end of the transfer. This was observed on MT7925, but btmtk_recv_isopkt() is shared by every MediaTek USB controller that supports ISO data. Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions") Co-developed-by: Hao Qin Signed-off-by: Hao Qin Co-developed-by: Wenlong Tian Signed-off-by: Wenlong Tian Signed-off-by: Chris Lu --- drivers/bluetooth/btmtk.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index bdc85147b97f..63b4c99b20d8 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -1201,6 +1202,25 @@ static int btmtk_recv_isopkt(struct hci_dev *hdev, void *buffer, int count) /* Complete ISO header */ hci_skb_expect(skb) = __le16_to_cpu(dlen); + if (!hci_skb_expect(skb)) { + /* The interrupt endpoint zero-fills the + * remainder of the transfer after the one + * packet it carries. Confirm that is what + * this is before dropping it. + */ + if (!mem_is_zero(buffer, count)) { + kfree_skb(skb); + skb = NULL; + + err = -EILSEQ; + break; + } + + kfree_skb(skb); + skb = NULL; + break; + } + if (skb_tailroom(skb) < hci_skb_expect(skb)) { kfree_skb(skb); skb = NULL; -- 2.45.2