* [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
* [PATCH BlueZ v2 1/2] shared/util: Add util_iov_new function
@ 2024-06-19 9:51 Vlad Pruteanu
2024-06-19 12:07 ` bap: Allocate memory for broadcast code bluez.test.bot
0 siblings, 1 reply; 5+ messages in thread
From: Vlad Pruteanu @ 2024-06-19 9:51 UTC (permalink / raw)
To: linux-bluetooth
Cc: mihai-octavian.urzica, iulia.tanasescu, andrei.istodorescu,
luiz.dentz, Vlad Pruteanu
This adds the util_iov_new function that allows the user both allocated
and set an iovec to the desired value, using only one function call.
---
src/shared/util.c | 10 ++++++++++
src/shared/util.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/src/shared/util.c b/src/shared/util.c
index 6a29b5068..30f054a5e 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -542,6 +542,16 @@ void *util_iov_append(struct iovec *iov, const void *data, size_t len)
return util_iov_push_mem(iov, len, data);
}
+struct iovec *util_iov_new(void *data, size_t len)
+{
+ struct iovec *iov;
+
+ iov = new0(struct iovec, 1);
+ util_iov_append(iov, data, len);
+
+ return iov;
+}
+
void *util_iov_pull(struct iovec *iov, size_t len)
{
if (!iov)
diff --git a/src/shared/util.h b/src/shared/util.h
index bd71577d6..f2ca4f29f 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -176,6 +176,7 @@ void *util_iov_push_le16(struct iovec *iov, uint16_t val);
void *util_iov_push_be16(struct iovec *iov, uint16_t val);
void *util_iov_push_u8(struct iovec *iov, uint8_t val);
void *util_iov_append(struct iovec *iov, const void *data, size_t len);
+struct iovec *util_iov_new(void *data, size_t len);
void *util_iov_pull(struct iovec *iov, size_t len);
void *util_iov_pull_mem(struct iovec *iov, size_t len);
void *util_iov_pull_le64(struct iovec *iov, uint64_t *val);
--
2.40.1
^ permalink raw reply related [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.