All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/1] bap: Allocate memory for broadcast code
@ 2024-06-18  8:58 Vlad Pruteanu
  2024-06-18  8:58 ` [PATCH BlueZ 1/1] " Vlad Pruteanu
  0 siblings, 1 reply; 5+ messages in thread
From: Vlad Pruteanu @ 2024-06-18  8:58 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, silviu.barbulescu, iulia.tanasescu,
	andrei.istodorescu, luiz.dentz, Vlad Pruteanu

This fixes segmentation fault caused by trying to write to
unallocated memory.

Vlad Pruteanu (1):
  bap: Allocate memory for broadcast code

 profiles/audio/bap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.40.1


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

* [PATCH BlueZ 1/1] bap: Allocate memory for broadcast code
  2024-06-18  8:58 [PATCH BlueZ 0/1] bap: Allocate memory for broadcast code Vlad Pruteanu
@ 2024-06-18  8:58 ` Vlad Pruteanu
  2024-06-18 10:44   ` bluez.test.bot
  2024-06-18 15:23   ` [PATCH BlueZ 1/1] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 5+ messages in thread
From: Vlad Pruteanu @ 2024-06-18  8:58 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, silviu.barbulescu, iulia.tanasescu,
	andrei.istodorescu, luiz.dentz, Vlad Pruteanu

This fixes segmentation fault caused by trying to write to
unallocated memory.
---
 profiles/audio/bap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 53e7b3e34..3d249a4e4 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -1041,10 +1041,12 @@ static void create_stream_for_bis(struct bap_data *bap_data,
 	setup->qos.bcast.packing = qos->bcast.packing;
 	setup->qos.bcast.framing = qos->bcast.framing;
 	setup->qos.bcast.encryption = qos->bcast.encryption;
-	if (setup->qos.bcast.encryption)
+	if (setup->qos.bcast.encryption) {
+		setup->qos.bcast.bcode = new0(struct iovec, 1);
 		util_iov_append(setup->qos.bcast.bcode,
 				qos->bcast.bcode,
 				sizeof(qos->bcast.bcode));
+	}
 	setup->qos.bcast.options = qos->bcast.options;
 	setup->qos.bcast.skip = qos->bcast.skip;
 	setup->qos.bcast.sync_timeout = qos->bcast.sync_timeout;
-- 
2.40.1


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

* RE: bap: Allocate memory for broadcast code
  2024-06-18  8:58 ` [PATCH BlueZ 1/1] " Vlad Pruteanu
@ 2024-06-18 10:44   ` bluez.test.bot
  2024-06-18 15:23   ` [PATCH BlueZ 1/1] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2024-06-18 10:44 UTC (permalink / raw)
  To: linux-bluetooth, vlad.pruteanu

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

---Test result---

Test Summary:
CheckPatch                    PASS      0.40 seconds
GitLint                       PASS      0.29 seconds
BuildEll                      PASS      25.46 seconds
BluezMake                     PASS      1731.99 seconds
MakeCheck                     PASS      13.66 seconds
MakeDistcheck                 PASS      183.45 seconds
CheckValgrind                 PASS      259.49 seconds
CheckSmatch                   PASS      364.19 seconds
bluezmakeextell               PASS      125.23 seconds
IncrementalBuild              PASS      1506.81 seconds
ScanBuild                     PASS      1052.66 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ 1/1] bap: Allocate memory for broadcast code
  2024-06-18  8:58 ` [PATCH BlueZ 1/1] " Vlad Pruteanu
  2024-06-18 10:44   ` bluez.test.bot
@ 2024-06-18 15:23   ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2024-06-18 15:23 UTC (permalink / raw)
  To: Vlad Pruteanu
  Cc: linux-bluetooth, mihai-octavian.urzica, silviu.barbulescu,
	iulia.tanasescu, andrei.istodorescu

Hi Vlad,

On Tue, Jun 18, 2024 at 4:58 AM Vlad Pruteanu <vlad.pruteanu@nxp.com> wrote:
>
> This fixes segmentation fault caused by trying to write to
> unallocated memory.
> ---
>  profiles/audio/bap.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
> index 53e7b3e34..3d249a4e4 100644
> --- a/profiles/audio/bap.c
> +++ b/profiles/audio/bap.c
> @@ -1041,10 +1041,12 @@ static void create_stream_for_bis(struct bap_data *bap_data,
>         setup->qos.bcast.packing = qos->bcast.packing;
>         setup->qos.bcast.framing = qos->bcast.framing;
>         setup->qos.bcast.encryption = qos->bcast.encryption;
> -       if (setup->qos.bcast.encryption)
> +       if (setup->qos.bcast.encryption) {
> +               setup->qos.bcast.bcode = new0(struct iovec, 1);

I wonder if it wouldn't be better to add something like struct iovec
*util_iov_new(void *data, size_t len) so we don't have to do this in 2
steps?

>                 util_iov_append(setup->qos.bcast.bcode,
>                                 qos->bcast.bcode,
>                                 sizeof(qos->bcast.bcode));
> +       }
>         setup->qos.bcast.options = qos->bcast.options;
>         setup->qos.bcast.skip = qos->bcast.skip;
>         setup->qos.bcast.sync_timeout = qos->bcast.sync_timeout;
> --
> 2.40.1
>


-- 
Luiz Augusto von Dentz

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

* RE: bap: Allocate memory for broadcast code
  2024-06-19  9:51 [PATCH BlueZ v2 1/2] shared/util: Add util_iov_new function Vlad Pruteanu
@ 2024-06-19 12:07 ` bluez.test.bot
  0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2024-06-19 12:07 UTC (permalink / raw)
  To: linux-bluetooth, vlad.pruteanu

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

---Test result---

Test Summary:
CheckPatch                    PASS      0.95 seconds
GitLint                       PASS      0.67 seconds
BuildEll                      PASS      24.51 seconds
BluezMake                     PASS      1675.31 seconds
MakeCheck                     PASS      13.64 seconds
MakeDistcheck                 PASS      176.61 seconds
CheckValgrind                 PASS      250.75 seconds
CheckSmatch                   PASS      352.42 seconds
bluezmakeextell               PASS      119.14 seconds
IncrementalBuild              PASS      2986.68 seconds
ScanBuild                     WARNING   1020.79 seconds

Details
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
In file included from tools/mesh-gatt/crypto.c:32:
./src/shared/util.h:240:9: warning: 1st function call argument is an uninitialized value
        return be32_to_cpu(get_unaligned((const uint32_t *) ptr));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/shared/util.h:33:26: note: expanded from macro 'be32_to_cpu'
#define be32_to_cpu(val) bswap_32(val)
                         ^~~~~~~~~~~~~
/usr/include/byteswap.h:34:21: note: expanded from macro 'bswap_32'
#define bswap_32(x) __bswap_32 (x)
                    ^~~~~~~~~~~~~~
In file included from tools/mesh-gatt/crypto.c:32:
./src/shared/util.h:250:9: warning: 1st function call argument is an uninitialized value
        return be64_to_cpu(get_unaligned((const uint64_t *) ptr));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/shared/util.h:34:26: note: expanded from macro 'be64_to_cpu'
#define be64_to_cpu(val) bswap_64(val)
                         ^~~~~~~~~~~~~
/usr/include/byteswap.h:37:21: note: expanded from macro 'bswap_64'
#define bswap_64(x) __bswap_64 (x)
                    ^~~~~~~~~~~~~~
2 warnings generated.



---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2024-06-19 12:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-18  8:58 [PATCH BlueZ 0/1] bap: Allocate memory for broadcast code Vlad Pruteanu
2024-06-18  8:58 ` [PATCH BlueZ 1/1] " Vlad Pruteanu
2024-06-18 10:44   ` bluez.test.bot
2024-06-18 15:23   ` [PATCH BlueZ 1/1] " Luiz Augusto von Dentz
  -- strict thread matches above, loose matches on Subject: below --
2024-06-19  9:51 [PATCH BlueZ v2 1/2] shared/util: Add util_iov_new function Vlad Pruteanu
2024-06-19 12:07 ` bap: Allocate memory for broadcast code 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.