Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3599834pxb; Mon, 24 Jan 2022 13:12:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4WmiIaRDxz7BH3AdGaDYo8Eng38aKL+oCKbUFeNAfbyQ2wyBeC+u/kPm4xuH9FJK3snla X-Received: by 2002:a05:6a00:24d6:b0:4ca:c762:71b9 with SMTP id d22-20020a056a0024d600b004cac76271b9mr14715pfv.40.1643058775224; Mon, 24 Jan 2022 13:12:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058775; cv=none; d=google.com; s=arc-20160816; b=K9eWZSjAht3dAdiCmwde3T+KTFdBsOkNQr9MroFeBCIfAEdRLuJMwWWLoY9n9rZl2S n0FND+SLww4irL50jYuFMKAdjTB9M3s9LRO+lbTQHEHute1Cq1fgmRsY5RvCMT67ih7p 8upKNntI8I2+YeNtiMKOKt0Bg2ZP7FcpkAmjt1QCkv6Myr1cM6OvEiVgGtJoPvH03eLX 2awkVj58vsrukTVWSlelRJ8KI61I1Ovb0dMrx2dbD4F+KCPbJ+biOCNEYWdO99LQOnop SROvogKZJs55Nb1LnMTt2LGDij3hXlh+04O8HtBpUni7Cd9fDaTtSVuDm+96AzqZAnd+ STOQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=skxMpqLhmxn2Cz2BnuaUW2bh6br/MchAg2jgIw/unm8=; b=QD80pWiT7Ur16O0iZMjTUQPdR50EuIPZHGiHNuQqzf5aZI8ZLxCBIQGvz91bLz5sZl 1KRh72v3QtDvi2wbLrWcJpOeSnKhPPywqvdS3XiEtJ5QNPkB54shlphSj+XCdOb3nzNI 6w3l1Zc5V8M6ux2E6dIWTzCsCP6WcBMf1D2f/hQLu3WeuiBGBqlKYUL26tR++VoFEY8V YVENJQ1VWrCN386+HssaU+yvJc9WXMvn47c7C5AJLzmmoIQLC5T4tFp1ehrVGQGd7UpI 6gvQPfe95T4omar4NRSc9Z5FfPo123l/jO5NeBsT/nCCwXWRztKfZ3MQLVUsrqO86pMf GZ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Dhqk25Il; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k30si14818943pgl.212.2022.01.24.13.12.42; Mon, 24 Jan 2022 13:12:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Dhqk25Il; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387382AbiAXUgs (ORCPT + 99 others); Mon, 24 Jan 2022 15:36:48 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:53466 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238014AbiAXUN4 (ORCPT ); Mon, 24 Jan 2022 15:13:56 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EC87FB810BD; Mon, 24 Jan 2022 20:13:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D904C340E5; Mon, 24 Jan 2022 20:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055233; bh=oM9XJ6lkMtHrXDqXRQuGbTYoOCRv3BOX3desWydiKQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dhqk25IlSh+VbzFu9jM3o/OzwzP3hb2kSMYSeyNBXt2GMO3Ct/D9xPtkFeqWbUlqr c/Q7tgpMX0bL+/TmJji/lpbs8aN/F7BHYGplnE/adbCdjTGdz1Bfq3rzEh1a4jEpS5 +/9hP3sIKUPaDta/4YVTCk1ZJQo83gCioBpK5hww= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Soenke Huster , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.15 085/846] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle() Date: Mon, 24 Jan 2022 19:33:22 +0100 Message-Id: <20220124184103.918696402@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Soenke Huster [ Upstream commit 1d0688421449718c6c5f46e458a378c9b530ba18 ] On the reception of packets with an invalid packet type, the memory of the allocated socket buffers is never freed. Add a default case that frees these to avoid a memory leak. Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver") Signed-off-by: Soenke Huster Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/virtio_bt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c index 57908ce4fae85..076e4942a3f0e 100644 --- a/drivers/bluetooth/virtio_bt.c +++ b/drivers/bluetooth/virtio_bt.c @@ -202,6 +202,9 @@ static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb) hci_skb_pkt_type(skb) = pkt_type; hci_recv_frame(vbt->hdev, skb); break; + default: + kfree_skb(skb); + break; } } -- 2.34.1