From: "K, Kiran" <kiran.k@intel.com>
To: Su Hui <suhui@nfschina.com>,
"marcel@holtmann.org" <marcel@holtmann.org>,
"luiz.dentz@gmail.com" <luiz.dentz@gmail.com>,
"nathan@kernel.org" <nathan@kernel.org>,
"ndesaulniers@google.com" <ndesaulniers@google.com>,
"morbo@google.com" <morbo@google.com>,
"justinstitt@google.com" <justinstitt@google.com>
Cc: "seema.sreemantha@intel.com" <seema.sreemantha@intel.com>,
"linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"llvm@lists.linux.dev" <llvm@lists.linux.dev>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH 2/2] Bluetooth: btintel: fix use after free problem in btintel_ppag_callback()
Date: Tue, 21 May 2024 00:19:56 +0000 [thread overview]
Message-ID: <PH0PR11MB7585ADB11BA022103C6394EFF5EA2@PH0PR11MB7585.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240520021625.110430-2-suhui@nfschina.com>
Hi Su Hui,
Thanks for your patch. 'btintel_ppag_callback' has been removed as part of 287da9035b2e.
>-----Original Message-----
>From: Su Hui <suhui@nfschina.com>
>Sent: Monday, May 20, 2024 7:46 AM
>To: marcel@holtmann.org; luiz.dentz@gmail.com; nathan@kernel.org;
>ndesaulniers@google.com; morbo@google.com; justinstitt@google.com
>Cc: Su Hui <suhui@nfschina.com>; K, Kiran <kiran.k@intel.com>;
>seema.sreemantha@intel.com; linux-bluetooth@vger.kernel.org; linux-
>kernel@vger.kernel.org; llvm@lists.linux.dev; kernel-janitors@vger.kernel.org
>Subject: [PATCH 2/2] Bluetooth: btintel: fix use after free problem in
>btintel_ppag_callback()
>
>Clang static checker(scan-build) warning:
>drivers/bluetooth/btintel.c:1369:8: Use of memory after it is freed.
>
>'p' is equal to 'buffer.pointer', using of 'p->type' after releasing 'buffer.pointer'
>causes this use after free problem.
>Change the order of releasing buffer.pointer to fix this problem.
>
>Fixes: c585a92b2f9c ("Bluetooth: btintel: Set Per Platform Antenna
>Gain(PPAG)")
>Signed-off-by: Su Hui <suhui@nfschina.com>
>---
> drivers/bluetooth/btintel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index
>f1c101dc0c28..d94a8ccd1428 100644
>--- a/drivers/bluetooth/btintel.c
>+++ b/drivers/bluetooth/btintel.c
>@@ -1364,9 +1364,9 @@ static acpi_status btintel_ppag_callback(acpi_handle
>handle, u32 lvl, void *data
> ppag = (struct btintel_ppag *)data;
>
> if (p->type != ACPI_TYPE_PACKAGE || p->package.count != 2) {
>- kfree(buffer.pointer);
> bt_dev_warn(hdev, "PPAG-BT: Invalid object type: %d or
>package count: %d",
> p->type, p->package.count);
>+ kfree(buffer.pointer);
> ppag->status = AE_ERROR;
> return AE_ERROR;
> }
>--
>2.30.2
Thanks,
Kiran
next prev parent reply other threads:[~2024-05-21 0:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-20 2:16 [PATCH 1/2] Bluetooth: btintel: remove useless code in btintel_set_dsm_reset_method Su Hui
2024-05-20 2:16 ` [PATCH 2/2] Bluetooth: btintel: fix use after free problem in btintel_ppag_callback() Su Hui
2024-05-21 0:19 ` K, Kiran [this message]
2024-05-20 5:12 ` [PATCH 1/2] Bluetooth: btintel: remove useless code in btintel_set_dsm_reset_method Paul Menzel
2024-05-20 9:41 ` Su Hui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PH0PR11MB7585ADB11BA022103C6394EFF5EA2@PH0PR11MB7585.namprd11.prod.outlook.com \
--to=kiran.k@intel.com \
--cc=justinstitt@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=seema.sreemantha@intel.com \
--cc=suhui@nfschina.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®