All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btintel: fix dereference after free in btintel_ppag_callback()
@ 2023-08-17  9:35 Konstantin Meskhidze
  2023-08-17 10:45 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Meskhidze @ 2023-08-17  9:35 UTC (permalink / raw)
  To: marcel
  Cc: johan.hedberg, luiz.dentz, seema.sreemantha, kiran.k,
	linux-bluetooth, linux-kernel, yusongping, artem.kuzin

'buffer.pointer' is freed and then dereferenced via 'p' pointer at
'bt_dev_warn' function call.

Fixes: c585a92b2f9c ("Bluetooth: btintel: Set Per Platform Antenna Gain(PPAG)")
Co-developed-by: Ivanov Mikhail <ivanov.mikhail1@huawei-partners.com>
Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.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 d9349ba48..4ac1eba9c 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -1340,11 +1340,11 @@ static acpi_status btintel_ppag_callback(acpi_handle handle, u32 lvl, void *data
 	p = buffer.pointer;
 	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.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: Bluetooth: btintel: fix dereference after free in btintel_ppag_callback()
  2023-08-17  9:35 [PATCH] Bluetooth: btintel: fix dereference after free in btintel_ppag_callback() Konstantin Meskhidze
@ 2023-08-17 10:45 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2023-08-17 10:45 UTC (permalink / raw)
  To: linux-bluetooth, konstantin.meskhidze

[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=776931

---Test result---

Test Summary:
CheckPatch                    FAIL      0.99 seconds
GitLint                       PASS      0.33 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      45.39 seconds
CheckAllWarning               PASS      51.63 seconds
CheckSparse                   PASS      57.38 seconds
CheckSmatch                   PASS      154.80 seconds
BuildKernel32                 PASS      44.78 seconds
TestRunnerSetup               PASS      683.76 seconds
TestRunner_l2cap-tester       PASS      39.79 seconds
TestRunner_iso-tester         PASS      112.43 seconds
TestRunner_bnep-tester        PASS      16.63 seconds
TestRunner_mgmt-tester        PASS      282.19 seconds
TestRunner_rfcomm-tester      PASS      25.00 seconds
TestRunner_sco-tester         PASS      27.23 seconds
TestRunner_ioctl-tester       PASS      27.91 seconds
TestRunner_mesh-tester        PASS      21.51 seconds
TestRunner_smp-tester         PASS      23.08 seconds
TestRunner_userchan-tester    PASS      17.92 seconds
IncrementalBuild              PASS      42.96 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
Bluetooth: btintel: fix dereference after free in btintel_ppag_callback()
WARNING: Co-developed-by and Signed-off-by: name/email do not match
#58: 
Co-developed-by: Ivanov Mikhail <ivanov.mikhail1@huawei-partners.com>
Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.com>

total: 0 errors, 1 warnings, 12 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13356210.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-17 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17  9:35 [PATCH] Bluetooth: btintel: fix dereference after free in btintel_ppag_callback() Konstantin Meskhidze
2023-08-17 10:45 ` bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.