public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 0/1] Fix null pointer dereference in util_ltv_foreach
@ 2024-06-21  7:55 Sarveshwar Bajaj
  2024-06-21  7:55 ` [PATCH BlueZ v2 1/1] shared/util: Fix null pointer dereference in util_ltv_foreach() Sarveshwar Bajaj
  2024-06-25 14:10 ` [PATCH BlueZ v2 0/1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 5+ messages in thread
From: Sarveshwar Bajaj @ 2024-06-21  7:55 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: luiz.von.dentz, vinit.mehta, mahesh.talewad, devyani.godbole

In the existing code, iov structure is initialized with iov.iov_base = (void *)
data. If data is NULL,casting (void *) NULL to iov_base results in a null
pointer dereference.Inside the loop of util_ltv_foreach,
util_iov_pull_u8(&iov, &l) is called to pull uint8_t values from iov.
If iov.iov_base (derived from data) is NULL,attempting to dereference it in
util_iov_pull_u8 will cause a segmentation fault.

Added NULL pointer check for data so it will presvent null pointer dereference


Sarveshwar Bajaj (1):
  shared/util: Fix null pointer dereference in util_ltv_foreach()

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

-- 
2.21.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH BlueZ v2 0/1] Fix null pointer dereference in util_ltv_foreach
@ 2024-06-21  6:43 Sarveshwar Bajaj
  0 siblings, 0 replies; 5+ messages in thread
From: Sarveshwar Bajaj @ 2024-06-21  6:43 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: luiz.von.dentz, vinit.mehta, mahesh.talewad, devyani.godbole

In the existing code, iov structure is initialized with iov.iov_base = (void *)
data. If data is NULL,casting (void *) NULL to iov_base results in a null 
pointer dereference.Inside the loop of util_ltv_foreach, 
util_iov_pull_u8(&iov, &l) is called to pull uint8_t values from iov.
If iov.iov_base (derived from data) is NULL,attempting to dereference it in 
util_iov_pull_u8 will cause a segmentation fault.

Added NULL pointer check for data so it will presvent null pointer dereference



Sarveshwar Bajaj (1):
  shared/util: Fix null pointer dereference in util_ltv_foreach()

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

-- 
2.21.0.windows.1


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

end of thread, other threads:[~2024-06-25 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-21  7:55 [PATCH BlueZ v2 0/1] Fix null pointer dereference in util_ltv_foreach Sarveshwar Bajaj
2024-06-21  7:55 ` [PATCH BlueZ v2 1/1] shared/util: Fix null pointer dereference in util_ltv_foreach() Sarveshwar Bajaj
2024-06-21  9:47   ` Fix null pointer dereference in util_ltv_foreach bluez.test.bot
2024-06-25 14:10 ` [PATCH BlueZ v2 0/1] " patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2024-06-21  6:43 Sarveshwar Bajaj

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