public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs()
@ 2024-04-23  7:44 Sarveshwar Bajaj
  2024-04-23  7:44 ` [PATCH BlueZ v1 0/1] " Sarveshwar Bajaj
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sarveshwar Bajaj @ 2024-04-23  7:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: vinit.mehta, devyani.godbole, mahesh.talewad

Ensure that bap and rdb pointers are valid before accessing or
allocating memory for ascs. Added  null check to prevent potential
crash
---
 src/shared/bap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 71eadbdb6..0db9ba285 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1405,7 +1405,7 @@ static bool match_req(const void *data, const void *match_data)
 
 static struct bt_ascs *bap_get_ascs(struct bt_bap *bap)
 {
-	if (!bap)
+	if (!bap || !bap->rdb)
 		return NULL;
 
 	if (bap->rdb->ascs)
-- 
2.21.0.windows.1


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

* [PATCH BlueZ v1 0/1] Fix null pointer deference in bap_get_ascs()
  2024-04-23  7:44 [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs() Sarveshwar Bajaj
@ 2024-04-23  7:44 ` Sarveshwar Bajaj
  2024-04-23  9:40 ` [BlueZ,v1,1/1] " bluez.test.bot
  2024-04-29 14:50 ` [PATCH BlueZ v1 1/1] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Sarveshwar Bajaj @ 2024-04-23  7:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: vinit.mehta, devyani.godbole, mahesh.talewad

Hi team,

This is the fix for preventing crash for null pointer dereference.

Ensure that bap and rdb pointers are valid before accessing or allocating 
memory for ascs. Added  null check to prevent potential crash


Sarveshwar Bajaj (1):
  Fix null pointer deference in bap_get_ascs()

 src/shared/bap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.21.0.windows.1


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

* RE: [BlueZ,v1,1/1] Fix null pointer deference in bap_get_ascs()
  2024-04-23  7:44 [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs() Sarveshwar Bajaj
  2024-04-23  7:44 ` [PATCH BlueZ v1 0/1] " Sarveshwar Bajaj
@ 2024-04-23  9:40 ` bluez.test.bot
  2024-04-29 14:50 ` [PATCH BlueZ v1 1/1] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2024-04-23  9:40 UTC (permalink / raw)
  To: linux-bluetooth, sarveshwar.bajaj

[-- Attachment #1: Type: text/plain, Size: 1560 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=846898

---Test result---

Test Summary:
CheckPatch                    PASS      0.29 seconds
GitLint                       PASS      0.21 seconds
BuildEll                      PASS      24.58 seconds
BluezMake                     PASS      1601.80 seconds
MakeCheck                     PASS      13.30 seconds
MakeDistcheck                 PASS      165.87 seconds
CheckValgrind                 PASS      232.35 seconds
CheckSmatch                   WARNING   333.77 seconds
bluezmakeextell               PASS      118.82 seconds
IncrementalBuild              PASS      1420.00 seconds
ScanBuild                     PASS      1028.67 seconds

Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/bap.c:282:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:282:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:282:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures


---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs()
  2024-04-23  7:44 [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs() Sarveshwar Bajaj
  2024-04-23  7:44 ` [PATCH BlueZ v1 0/1] " Sarveshwar Bajaj
  2024-04-23  9:40 ` [BlueZ,v1,1/1] " bluez.test.bot
@ 2024-04-29 14:50 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2024-04-29 14:50 UTC (permalink / raw)
  To: Sarveshwar Bajaj
  Cc: linux-bluetooth, vinit.mehta, devyani.godbole, mahesh.talewad

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 23 Apr 2024 13:14:25 +0530 you wrote:
> Ensure that bap and rdb pointers are valid before accessing or
> allocating memory for ascs. Added  null check to prevent potential
> crash
> ---
>  src/shared/bap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,v1,1/1] Fix null pointer deference in bap_get_ascs()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d2a2aabee646

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-04-29 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23  7:44 [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs() Sarveshwar Bajaj
2024-04-23  7:44 ` [PATCH BlueZ v1 0/1] " Sarveshwar Bajaj
2024-04-23  9:40 ` [BlueZ,v1,1/1] " bluez.test.bot
2024-04-29 14:50 ` [PATCH BlueZ v1 1/1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox