Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3622590pxb; Mon, 24 Jan 2022 13:44:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfZUITtEvW5iZYwV3zU61WDOZg74mLMf7Sm23TctutMGYEZnqGRpC+Al+Q9o7sfuENlBhl X-Received: by 2002:a17:902:e801:b0:14b:6dd1:b35f with SMTP id u1-20020a170902e80100b0014b6dd1b35fmr1467580plg.113.1643060669029; Mon, 24 Jan 2022 13:44:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060669; cv=none; d=google.com; s=arc-20160816; b=oJGDgV9wLCb9IueJYlY/2euRP+XtahSmNiyzCOVo3Ctl1HhQF3wRhvhUosOUj2ld67 na9Nu4DY4s8zJPXIcSdKSpdnLWQuWJSRzI3mbmxKPjg12Awt1lfbInXIWpf4sS7tiiX+ XPcR20x0X8ph+Q97FvQ5T79GDGQWx34U8dwilAbDX1HTckLxda7Y/53F/s9WPFKxd/Lr IHEJ2MpY59R78u2lqPcX3zJmi9Ab0pqu07XrawEUfj52C2+ZNrWu0Gi8kYWA5P6ucf8X W7z+sQHvQK/XptUvMOEE5KL5bywwds4RQO0caPPv9tggxmCbzQ0NkMUGN3xdNE4Xbq4E y5kQ== 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=vk9bLCdVCpDkROvGb1rZf7aL7Q5EpoIrlVN+Ngn0SuuC44tOGJzcxL13taqsc6NfSk 8hM1Ns134vOaQNE+20Z9/Wh6lrDbgsy1BX7Q16+RwDIQxz7meHQyZeqSBjHKp9k162sK RZmonXaFc9S5JEk0rf+1xZlNp7WbFVjzI7VWKzbJy8kiG5nwEqUZAqgYRYX0aKWMzAMJ wFWZhLQ8oIzez7ev2DYltfYSgh1FfzQoDm52StC+mgAv+z1HQFYQNZmHbIWQMw7oMcap qKjj+J9AJkj9pmAEfbHRonnI9ifPg4pQtNbdA2TYd77b5k3kr22jai7AjLL07M6mBxHY wUUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WAfhJkZJ; 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 83si7034105pgc.454.2022.01.24.13.44.16; Mon, 24 Jan 2022 13:44:29 -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=WAfhJkZJ; 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 S1452312AbiAXVYd (ORCPT + 99 others); Mon, 24 Jan 2022 16:24:33 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:52000 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443725AbiAXU6w (ORCPT ); Mon, 24 Jan 2022 15:58:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 08E9460C60; Mon, 24 Jan 2022 20:58:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6069C340E7; Mon, 24 Jan 2022 20:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057929; bh=oM9XJ6lkMtHrXDqXRQuGbTYoOCRv3BOX3desWydiKQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WAfhJkZJ5adSIvZcHjbhHh/eWgXADFrXpZq8LfCrT26ZRyV2B2IhyvhXeKEJvnsjT AmfPYj6P5rGWbA1N++BdrWqL+cMgalf4WmxW4ilb1n45SMFlv+6Ydvr+zbK7+QZjLt 3QVlaJhrLa6dMyi4chBnP/u4Knh6hvEtCi0znNpY= 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.16 0092/1039] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle() Date: Mon, 24 Jan 2022 19:31:21 +0100 Message-Id: <20220124184128.250254555@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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