Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2378202lqp; Sun, 24 Mar 2024 16:44:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLQVb2uQ+UhLgs/vc5pawEhO2XpqT4yMQBeEq6w+IkWZllCUpANFAhNzHTw+PwVu0TJgi+CcSMZ0pX0usFyRJLXHz+VyX5BXWifpd+cg== X-Google-Smtp-Source: AGHT+IEQMeylWAYY0SxBKbzvOeVtYfvEp28ggVicgg7R0adMjnSVt3GlZTXFeL8+7NNjXxj7bhLR X-Received: by 2002:a05:620a:4592:b0:78a:2d35:3071 with SMTP id bp18-20020a05620a459200b0078a2d353071mr8125540qkb.38.1711323840029; Sun, 24 Mar 2024 16:44:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711323840; cv=pass; d=google.com; s=arc-20160816; b=zrLK9ad+He9S9zIrp3a7eRS+f3JTVHCaCFvQQiHsbn422d1DUG05q9xeV216UOA/G+ SIVKPmaNt5M3zYgTzJQ9s1JU6c3DPO5EOa2reUcPOPuj8KNmkMFsmRywmcBijrAI8gxO 2m3XOwt/p0M/5UYzd9K7VX7l+McjE2vRzacozRrNCrJy19m0B3rLpqfpzxcZ1+k0SaeR yjftb6ZeST9JGMaZFjq4BKRHMqAxunwV1m03IhSbz2+C3JKyfD2cNvdT5tcDe2XZzgwH s1JXLNukOq3syJwet+3ljZluH4I7mzbF1PI8jM9swD3qC5rSDbAWwP3vCu9hUVDyN2ak 1l/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4NdBOiUXwLiVBPnw5d8BJTbs+W3QP+OUPNn5Dlg380o=; fh=/TnrLxI5sd/8bhOUk5NCak+Scug04k+QZYgHCAWUD88=; b=VtqwbuP9jsx5870Y3+OiDbFO7PDi8WJHY1sBCrZ+NSiRJgmhXmzd1F18DfxdXG/dYF JH1HLZx18fC4AxnjpdpXqyEnC3X6wLIt6gMFkjf07aWT+9EhtxJeGRsvzk4/1zaAM0Fg plm1Jsp1JuKu4G3M6wKVTtHtrEXnXSqkmyaX2bbOEiKmZNC9aYkFpU+9XvajDzIpryFO 2D08nEfvusR0ssg6gxy0UuBQzvn9iTzIujSUZEuhT+IFh1ejHVP7ge0VpueomZB53W23 dG9Sypdo1WIUg1/J3BLDN3nSD5o2teywOevW1f+v98g/4limo4OiQqcGHoxWHwL6ppV5 EF0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c9li5U84; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vw2-20020a05620a564200b00789dc7d12b3si4259618qkn.560.2024.03.24.16.43.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c9li5U84; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B0BE31C22717 for ; Sun, 24 Mar 2024 23:43:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC05D17C6DA; Sun, 24 Mar 2024 22:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c9li5U84" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C85CE17C6D7; Sun, 24 Mar 2024 22:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320006; cv=none; b=TdS4MH00xEe9XdlzFWz/zobs0XN7jTN6UWH/9H13zjO5er28qmpggu2xGPckvrgkZqzgWOk+37FF11O70CFGN6+RztSe5FqB7OJAewonol+ENDkDwvruQpJLczS9+I0KPWAS5CuEGpbVOgp5Q+UIZl939eZWbOwUCqKCrg+46OU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320006; c=relaxed/simple; bh=eZ8P3VvFJh8AOiFHtetE+vSb5xhTtJgCpVECyeF04SA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RVSXGhmnDUc6MgSFWNA8Ry1Pv8YeOTattN37ryBaOJfsLzHcO8//QAZyRzcKtCWaXqyr63UBd5wo4JhNuAMrzXXinHO+6/rft5R/aduH5//CbqpLzLzYUBcmLkQUXDS3a3VX0zFW/pWh7vfkqqiW+QSHS04GNUGfH0LQpT2EqTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c9li5U84; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3B9BC43399; Sun, 24 Mar 2024 22:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320006; bh=eZ8P3VvFJh8AOiFHtetE+vSb5xhTtJgCpVECyeF04SA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c9li5U84URkqNto81I00q47G6+N8Gcn4V8F7jYHos3fxnrTWv1rG4c/rvvDk+5X+J 8QrbHFAZkRRHww2kxECLGlrIvMN+cneheznxz6Ny+npZaj84fz7lZ0CbUnpIQ6Y0rT euAK4jqJDRjntj9vCSUXTdLxmuVRjwYmZMKOa42HxU9pFafOTS4Z2V8HVKVAj1IXTn IdDpwNd3w/+i8WTDI7V6Wt16wixJ3Ljk3dxBC/uQQIVjET2fKgSXawTIs4qpf4ChE1 xtYqm7OTPmpXSgKOwc/85O9v6Il9vUVptHY+nEtdSjEjf5g1vS2UZ9UCM10vMIPDU6 NNfw1ikRuZyWg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.8 313/715] Bluetooth: msft: Fix memory leak Date: Sun, 24 Mar 2024 18:28:12 -0400 Message-ID: <20240324223455.1342824-314-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz [ Upstream commit a6e06258f4c31eba0fcd503e19828b5f8fe7b08b ] Fix leaking buffer allocated to send MSFT_OP_LE_MONITOR_ADVERTISEMENT. Fixes: 9e14606d8f38 ("Bluetooth: msft: Extended monitor tracking by address filter") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/msft.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c index 630e3023273b2..9612c5d1b13f6 100644 --- a/net/bluetooth/msft.c +++ b/net/bluetooth/msft.c @@ -875,6 +875,7 @@ static int msft_add_address_filter_sync(struct hci_dev *hdev, void *data) remove = true; goto done; } + cp->sub_opcode = MSFT_OP_LE_MONITOR_ADVERTISEMENT; cp->rssi_high = address_filter->rssi_high; cp->rssi_low = address_filter->rssi_low; @@ -887,6 +888,8 @@ static int msft_add_address_filter_sync(struct hci_dev *hdev, void *data) skb = __hci_cmd_sync(hdev, hdev->msft_opcode, size, cp, HCI_CMD_TIMEOUT); + kfree(cp); + if (IS_ERR(skb)) { bt_dev_err(hdev, "Failed to enable address %pMR filter", &address_filter->bdaddr); -- 2.43.0