* RE: Periodic advertising and PAwR over MGMT
2026-11-27 8:55 [RFC PATCH BlueZ 1/9] doc/mgmt: Add periodic advertising and PAwR commands and events Roland Schober
@ 2026-11-27 15:37 ` bluez.test.bot
0 siblings, 0 replies; 15+ messages in thread
From: bluez.test.bot @ 2026-11-27 15:37 UTC (permalink / raw)
To: linux-bluetooth, rolandschober1968
[-- Attachment #1: Type: text/plain, Size: 50801 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/series/1224183/
---Test result---
Test Summary:
CheckPatch PASS 3.74 seconds
GitLint FAIL 2.19 seconds
BuildEll PASS 13.84 seconds
BluezMake PASS 185.88 seconds
MakeCheck PASS 13.07 seconds
MakeDistcheck PASS 101.62 seconds
CheckValgrind PASS 231.20 seconds
CheckSmatch WARNING 190.54 seconds
bluezmakeextell PASS 67.01 seconds
TestFunctional FAIL 937.64 seconds
IncrementalBuild PASS 323.72 seconds
ScanBuild WARNING 627.10 seconds
Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[RFC,BlueZ,3/9] monitor: Decode periodic advertising and PAwR MGMT commands and events
1: T1 Title exceeds max length (86>80): "[RFC,BlueZ,3/9] monitor: Decode periodic advertising and PAwR MGMT commands and events"
[RFC,BlueZ,8/9] emulator/btdev: Add Periodic Advertising with Responses advertiser
1: T1 Title exceeds max length (82>80): "[RFC,BlueZ,8/9] emulator/btdev: Add Periodic Advertising with Responses advertiser"
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
monitor/packet.c:2292:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:4304:52: warning: array of flexible structuresmonitor/bt.h:4292:40: warning: array of flexible structuresemulator/btdev.c: note: in included file:./monitor/bt.h:3048:52: warning: array of flexible structuresemulator/btdev.c: note: in included file:./monitor/bt.h:3048:52: warning: array of flexible structures
##############################
Test: TestFunctional - FAIL
Desc: Run test-functional
Output:
FAIL functional.test_bap::test_bap_broadcast_earbuds_transport_created[hosts8-vm3]: AssertionError: Failed to acquire: org.bluez.Error.Failed
FAIL functional.test_bap::test_bap_broadcast_earbuds_transport_created[hosts8-vm3]: failed on teardown with "pytest_bluezenv.plugin.CoredumpWarning: Core dump: test-bluezenv-hosts8.0-bluetoothd-1795792828-118.core
/usr/bin/gdb: warning: Couldn't determine a path for the index cache directory.
[New LWP 118]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/runner/work/bluez/bluez/src/src/src/bluetoothd --nodetach -f /run/bluetoo'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
warning: 44 ./nptl/pthread_kill.c: No such file or directory
Thread 1 (Thread 0x7f7279d30900 (LWP 118)):
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
tid = <optimized out>
ret = 0
pd = <optimized out>
old_mask = {__val = {0}}
ret = <optimized out>
#1 __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
No locals.
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:100
No locals.
#3 0x00007f727a48bb7e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
ret = <optimized out>
#4 0x00007f727a46e8ec in __GI_abort () at ./stdlib/abort.c:77
act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
#5 0x00007f727b096a0f in __sanitizer::Abort () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp:165
No locals.
#6 0x00007f727b1bcc2d in __sanitizer::Die () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:58
No locals.
#7 0x00007f727b19193c in __asan::ScopedInErrorReport::~ScopedInErrorReport (this=0x7ffe44b4afa6) at ../../../../src/libsanitizer/asan/asan_report.cpp:221
buffer_copy = {buffer_ = {<__sanitizer::InternalMmapVectorNoCtor<char, false>> = {data_ = 0x7f7279904000 '=' <repeats 65 times>, "\n==118==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bf2791e67e4 at pc 0x55ca2e0937d3 bp 0x7ffe44b4bc20 sp 0x7ffe44b4bc10"..., capacity_bytes_ = 4096, size_ = 3753}, <No data fields>}}
buffer_copy = <optimized out>
l = <optimized out>
#8 0x00007f727b190e02 in __asan::ReportGenericError (pc=94326844110803, bp=140730051116064, sp=sp@entry=140730051116048, addr=addr@entry=136281344337892, is_write=is_write@entry=false, access_size=4, fatal=true, exp=<optimized out>) at ../../../../src/libsanitizer/asan/asan_report.cpp:536
in_report = {error_report_lock_ = {<No data fields>}, static current_error_ = {kind = __asan::kErrorKindGeneric, {Base = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, DeadlySignal = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, signal = {siginfo = 0x7c8200000002, context = 0x7bf2791e67e4, addr = 0, pc = 0, sp = 7348689045010, bp = 136281344337892, is_memory_access = 68, write_flag = __sanitizer::SignalContext::Unknown, is_true_faulting_addr = 160}}, DoubleFree = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, second_free_stack = 0x7c8200000002, addr_description = {addr = 136281344337892, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1554, free_stack_id = 1711, chunk_access = {bad_addr = 136281344337892, offset = 68, chunk_begin = 136281344337824, chunk_size = 88, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}}, NewDeleteTypeMismatch = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, free_stack = 0x7c8200000002, addr_description = {addr = 136281344337892, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1554, free_stack_id = 1711, chunk_access = {bad_addr = 136281344337892, offset = 68, chunk_begin = 136281344337824, chunk_size = 88, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, delete_size = 136899819602944, delete_alignment = 136281344312608}, FreeNotMalloced = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, free_stack = 0x7c8200000002, addr_description = {data = {kind = 2032035812, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 7348689045010, alloc_stack_id = 2032035812, free_stack_id = 31730, chunk_access = {bad_addr = 68, offset = 136281344337824, chunk_begin = 88, chunk_size = 4294926344, user_requested_alignment = 1024, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 0, offset = 7348689045010, frame_pc = 136281344337892, access_size = 68, frame_descr = 0x7bf2791e67a0 "\257\006"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 7348689045010, size_with_redzone = 136281344337892, name = 0x44 <error: Cannot access memory at address 0x44>, module_name = 0x7bf2791e67a0 "\257\006", has_dynamic_init = 88, gcc_location = 0xffff6008, odr_indicator = 136899819602944}, {beg = 136281344312608, size = 0, size_with_redzone = 0, name = 0xf6e4f021e00 <error: Cannot access memory at address 0xf6e4f021e00>, module_name = 0x7ffe44b4b490 "P\001\036y\002}", has_dynamic_init = 140129664621916, gcc_location = 0x7ffe44b4b490, odr_indicator = 140129664622654}, {beg = 5, size = 7550163712, size_with_redzone = 136831100126024, name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, module_name = 0x2 <error: Cannot access memory at address 0x2>, has_dynamic_init = 140129664571758, gcc_location = 0x7ffe44b4b4a0, odr_indicator = 140129664627413}, {beg = 137449575416144, size = 140730051114160, size_with_redzone = 140730051114192, name = 0x7f727adfdd6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", module_name = 0x0, has_dynamic_init = 2163868852705188608, gcc_location = 0x7c92791e0040, odr_indicator = 1}}, reg_sites = {1152693520, 32766, 2061507205, 32626}, access_size = 140730051114256, size = 211 '\323'}, wild = {addr = 0, access_size = 0}}}}}, AllocTypeMismatch = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, dealloc_stack = 0x7c8200000002, alloc_type = 2032035812, dealloc_type = 31730, addr_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 0, kind = (__asan::kShadowKindHigh | unknown: 0x10), shadow_byte = 6 '\006'}, heap = {addr = 0, alloc_tid = 7348689045010, free_tid = 136281344337892, alloc_stack_id = 68, free_stack_id = 0, chunk_access = {bad_addr = 136281344337824, offset = 88, chunk_begin = 4294926344, chunk_size = 136899819602944, user_requested_alignment = 1312, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 7348689045010, offset = 136281344337892, frame_pc = 68, access_size = 136281344337824, frame_descr = 0x58 <error: Cannot access memory at address 0x58>}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 7348689045010, size = 136281344337892, size_with_redzone = 68, name = 0x7bf2791e67a0 "\257\006", module_name = 0x58 <error: Cannot access memory at address 0x58>, has_dynamic_init = 4294926344, gcc_location = 0x7c82791e0400, odr_indicator = 136281344312608}, {beg = 0, size = 0, size_with_redzone = 16966446358016, name = 0x7ffe44b4b490 "P\001\036y\002}", module_name = 0x7f727ae1dd5c "\205\300\017\204\214", has_dynamic_init = 140730051114128, gcc_location = 0x7f727ae1e03e, odr_indicator = 5}, {beg = 7550163712, size = 136831100126024, size_with_redzone = 2163868852705188608, name = 0x2 <error: Cannot access memory at address 0x2>, module_name = 0x7f727ae1196e <dbus_message_unref+46> "\203\370\001tmH\213]\370\311\303\017\037\200", has_dynamic_init = 140730051114144, gcc_location = 0x7f727ae1f2d5 <_dbus_list_pop_first_link+21>, odr_indicator = 137449575416144}, {beg = 140730051114160, size = 140730051114192, size_with_redzone = 140129664490858, name = 0x0, module_name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, has_dynamic_init = 136968539078720, gcc_location = 0x1, odr_indicator = 140730051114256}}, reg_sites = {2061507205, 32626, 1152693520, 32766}, access_size = 94326844110803, size = 32 ' '}, wild = {addr = 0, access_size = 7348689045010}}}}}, MallocUsableSizeNotOwned = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, addr_description = {data = {kind = 2032035812, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 7348689045010, alloc_stack_id = 2032035812, free_stack_id = 31730, chunk_access = {bad_addr = 68, offset = 136281344337824, chunk_begin = 88, chunk_size = 4294926344, user_requested_alignment = 1024, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 0, offset = 7348689045010, frame_pc = 136281344337892, access_size = 68, frame_descr = 0x7bf2791e67a0 "\257\006"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 7348689045010, size_with_redzone = 136281344337892, name = 0x44 <error: Cannot access memory at address 0x44>, module_name = 0x7bf2791e67a0 "\257\006", has_dynamic_init = 88, gcc_location = 0xffff6008, odr_indicator = 136899819602944}, {beg = 136281344312608, size = 0, size_with_redzone = 0, name = 0xf6e4f021e00 <error: Cannot access memory at address 0xf6e4f021e00>, module_name = 0x7ffe44b4b490 "P\001\036y\002}", has_dynamic_init = 140129664621916, gcc_location = 0x7ffe44b4b490, odr_indicator = 140129664622654}, {beg = 5, size = 7550163712, size_with_redzone = 136831100126024, name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, module_name = 0x2 <error: Cannot access memory at address 0x2>, has_dynamic_init = 140129664571758, gcc_location = 0x7ffe44b4b4a0, odr_indicator = 140129664627413}, {beg = 137449575416144, size = 140730051114160, size_with_redzone = 140730051114192, name = 0x7f727adfdd6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", module_name = 0x0, has_dynamic_init = 2163868852705188608, gcc_location = 0x7c92791e0040, odr_indicator = 1}}, reg_sites = {1152693520, 32766, 2061507205, 32626}, access_size = 140730051114256, size = 211 '\323'}, wild = {addr = 0, access_size = 0}}}}}, SanitizerGetAllocatedSizeNotOwned = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, addr_description = {data = {kind = 2032035812, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 7348689045010, alloc_stack_id = 2032035812, free_stack_id = 31730, chunk_access = {bad_addr = 68, offset = 136281344337824, chunk_begin = 88, chunk_size = 4294926344, user_requested_alignment = 1024, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 0, offset = 7348689045010, frame_pc = 136281344337892, access_size = 68, frame_descr = 0x7bf2791e67a0 "\257\006"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 7348689045010, size_with_redzone = 136281344337892, name = 0x44 <error: Cannot access memory at address 0x44>, module_name = 0x7bf2791e67a0 "\257\006", has_dynamic_init = 88, gcc_location = 0xffff6008, odr_indicator = 136899819602944}, {beg = 136281344312608, size = 0, size_with_redzone = 0, name = 0xf6e4f021e00 <error: Cannot access memory at address 0xf6e4f021e00>, module_name = 0x7ffe44b4b490 "P\001\036y\002}", has_dynamic_init = 140129664621916, gcc_location = 0x7ffe44b4b490, odr_indicator = 140129664622654}, {beg = 5, size = 7550163712, size_with_redzone = 136831100126024, name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, module_name = 0x2 <error: Cannot access memory at address 0x2>, has_dynamic_init = 140129664571758, gcc_location = 0x7ffe44b4b4a0, odr_indicator = 140129664627413}, {beg = 137449575416144, size = 140730051114160, size_with_redzone = 140730051114192, name = 0x7f727adfdd6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", module_name = 0x0, has_dynamic_init = 2163868852705188608, gcc_location = 0x7c92791e0040, odr_indicator = 1}}, reg_sites = {1152693520, 32766, 2061507205, 32626}, access_size = 140730051114256, size = 211 '\323'}, wild = {addr = 0, access_size = 0}}}}}, CallocOverflow = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, count = 136281344337892, size = 0}, ReallocArrayOverflow = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, count = 136281344337892, size = 0}, PvallocOverflow = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, size = 136281344337892}, InvalidAllocationAlignment = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, alignment = 136281344337892}, InvalidAlignedAllocAlignment = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, size = 136281344337892, alignment = 0}, InvalidPosixMemalignAlignment = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, alignment = 136281344337892}, AllocationSizeTooBig = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, user_size = 136281344337892, total_size = 0, max_size = 0}, RssLimitExceeded = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002}, OutOfMemory = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, requested_size = 136281344337892}, StringFunctionMemoryRangesOverlap = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, length1 = 136281344337892, length2 = 0, addr1_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 7348689045010, kind = (unknown: 0xe4), shadow_byte = 103 'g'}, heap = {addr = 7348689045010, alloc_tid = 136281344337892, free_tid = 68, alloc_stack_id = 2032035744, free_stack_id = 31730, chunk_access = {bad_addr = 88, offset = 4294926344, chunk_begin = 136899819602944, chunk_size = 136281344312608, user_requested_alignment = 0, access_type = 0, alloc_type = 0}}, stack = {addr = 7348689045010, tid = 136281344337892, offset = 68, frame_pc = 136281344337824, access_size = 88, frame_descr = 0xffff6008 <error: Cannot access memory at address 0xffff6008>}, global = {addr = 7348689045010, static kMaxGlobals = 4, globals = {{beg = 136281344337892, size = 68, size_with_redzone = 136281344337824, name = 0x58 <error: Cannot access memory at address 0x58>, module_name = 0xffff6008 <error: Cannot access memory at address 0xffff6008>, has_dynamic_init = 136899819602944, gcc_location = 0x7bf2791e0520, odr_indicator = 0}, {beg = 0, size = 16966446358016, size_with_redzone = 140730051114128, name = 0x7f727ae1dd5c "\205\300\017\204\214", module_name = 0x7ffe44b4b490 "P\001\036y\002}", has_dynamic_init = 140129664622654, gcc_location = 0x5, odr_indicator = 7550163712}, {beg = 136831100126024, size = 2163868852705188608, size_with_redzone = 2, name = 0x7f727ae1196e <dbus_message_unref+46> "\203\370\001tmH\213]\370\311\303\017\037\200", module_name = 0x7ffe44b4b4a0 "\320\264\264D\376\177", has_dynamic_init = 140129664627413, gcc_location = 0x7d02791e0150, odr_indicator = 140730051114160}, {beg = 140730051114192, size = 140129664490858, size_with_redzone = 0, name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, module_name = 0x7c92791e0040 "\031", has_dynamic_init = 1, gcc_location = 0x7ffe44b4b510, odr_indicator = 140129664506501}}, reg_sites = {1152693520, 32766, 772356051, 21962}, access_size = 140730051116064, size = 16 '\020'}, wild = {addr = 7348689045010, access_size = 136281344337892}}}}, addr2_description = {data = {kind = __asan::kAddressKindGlobal, {shadow = {addr = 140129668614039, kind = __asan::kShadowKindLow, shadow_byte = 253 '\375'}, heap = {addr = 140129668614039, alloc_tid = 140730051132672, free_tid = 94326847736768, alloc_stack_id = 2032013120, free_stack_id = 31842, chunk_access = {bad_addr = 136831100128576, offset = 94326847998031, chunk_begin = 4294967298, chunk_size = 136760348639233, user_requested_alignment = 2800, access_type = 3, alloc_type = 2}}, stack = {addr = 140129668614039, tid = 140730051132672, offset = 94326847736768, frame_pc = 136762380652352, access_size = 136831100128576, frame_descr = 0x55ca2e44884f <bt_bap_stream_release+383> "\213D$\bH\203\304([]A^A_\303f\220H\203\304(1\300[]A^A_\303H\211\317\350\213.\300\377H\211\312H\211\336H\211L$\bH\215=\371\"{"}, global = {addr = 140129668614039, static kMaxGlobals = 4, globals = {{beg = 140730051132672, size = 94326847736768, size_with_redzone = 136762380652352, name = 0x7c72791e0d40 "\001", module_name = 0x55ca2e44884f <bt_bap_stream_release+383> "\213D$\bH\203\304([]A^A_\303f\220H\203\304(1\300[]A^A_\303H\211\317\350\213.\300\377H\211\312H\211\336H\211L$\bH\215=\371\"{", has_dynamic_init = 4294967298, gcc_location = 0x7c6200000001, odr_indicator = 140730051115760}, {beg = 135937747023632, size = 135869027628432, size_with_redzone = 135937747023632, name = 0x0, module_name = 0x55ca2e408bc0 <stream_state_changed> "\363\017\036\372H\203\354(H\211\370I\211\360H\205\377\017\204#\001", has_dynamic_init = 136762380652352, gcc_location = 0x7ffe44b4bb20, odr_indicator = 0}, {beg = 2163868852705188608, size = 135869027634304, size_with_redzone = 3, name = 0x1 <error: Cannot access memory at address 0x1>, module_name = 0x7ffe44b4bb50 "\240\357\b.\312U", has_dynamic_init = 136831100128576, gcc_location = 0x1e079b41c2065b00, odr_indicator = 136762380652352}, {beg = 140730051115888, size = 94326844092320, size_with_redzone = 2163868852705188608, name = 0x7c62791e0f40 "\327\006", module_name = 0x7c62791e0f40 "\327\006", has_dynamic_init = 94326844092320, gcc_location = 0x55ca2e436784 <stream_set_state+292>, odr_indicator = 136762380652352}}, reg_sites = {2032012608, 31858, 2032144352, 31650}, access_size = 94326847753604, size = 64 '@'}, wild = {addr = 140129668614039, access_size = 140730051132672}}}}, function = 0x7c62791e0f40 "\327\006"}, StringFunctionSizeOverflow = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, addr_description = {data = {kind = 2032035812, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 7348689045010, alloc_stack_id = 2032035812, free_stack_id = 31730, chunk_access = {bad_addr = 68, offset = 136281344337824, chunk_begin = 88, chunk_size = 4294926344, user_requested_alignment = 1024, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 0, offset = 7348689045010, frame_pc = 136281344337892, access_size = 68, frame_descr = 0x7bf2791e67a0 "\257\006"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 7348689045010, size_with_redzone = 136281344337892, name = 0x44 <error: Cannot access memory at address 0x44>, module_name = 0x7bf2791e67a0 "\257\006", has_dynamic_init = 88, gcc_location = 0xffff6008, odr_indicator = 136899819602944}, {beg = 136281344312608, size = 0, size_with_redzone = 0, name = 0xf6e4f021e00 <error: Cannot access memory at address 0xf6e4f021e00>, module_name = 0x7ffe44b4b490 "P\001\036y\002}", has_dynamic_init = 140129664621916, gcc_location = 0x7ffe44b4b490, odr_indicator = 140129664622654}, {beg = 5, size = 7550163712, size_with_redzone = 136831100126024, name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, module_name = 0x2 <error: Cannot access memory at address 0x2>, has_dynamic_init = 140129664571758, gcc_location = 0x7ffe44b4b4a0, odr_indicator = 140129664627413}, {beg = 137449575416144, size = 140730051114160, size_with_redzone = 140730051114192, name = 0x7f727adfdd6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", module_name = 0x0, has_dynamic_init = 2163868852705188608, gcc_location = 0x7c92791e0040, odr_indicator = 1}}, reg_sites = {1152693520, 32766, 2061507205, 32626}, access_size = 140730051114256, size = 211 '\323'}, wild = {addr = 0, access_size = 0}}}}, size = 140730051116064}, BadParamsToAnnotateContiguousContainer = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, beg = 136281344337892, end = 0, old_mid = 0, new_mid = 7348689045010}, BadParamsToAnnotateDoubleEndedContiguousContainer = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, storage_beg = 136281344337892, storage_end = 0, old_container_beg = 0, old_container_end = 7348689045010, new_container_beg = 136281344337892, new_container_end = 68}, BadParamsToCopyContiguousContainerAnnotations = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, stack = 0x7c8200000002, old_storage_beg = 136281344337892, old_storage_end = 0, new_storage_beg = 0, new_storage_end = 7348689045010}, ODRViolation = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, global1 = {beg = 136897787592706, size = 136281344337892, size_with_redzone = 0, name = 0x0, module_name = 0x6af00000612 <error: Cannot access memory at address 0x6af00000612>, has_dynamic_init = 136281344337892, gcc_location = 0x44, odr_indicator = 136281344337824}, global2 = {beg = 88, size = 4294926344, size_with_redzone = 136899819602944, name = 0x7bf2791e0520 "\003", module_name = 0x0, has_dynamic_init = 0, gcc_location = 0xf6e4f021e00, odr_indicator = 140730051114128}, stack_id1 = 2061622620, stack_id2 = 32626}, InvalidPointerPair = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, pc = 136897787592706, bp = 136281344337892, sp = 0, addr1_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 7348689045010, kind = (unknown: 0xe4), shadow_byte = 103 'g'}, heap = {addr = 7348689045010, alloc_tid = 136281344337892, free_tid = 68, alloc_stack_id = 2032035744, free_stack_id = 31730, chunk_access = {bad_addr = 88, offset = 4294926344, chunk_begin = 136899819602944, chunk_size = 136281344312608, user_requested_alignment = 0, access_type = 0, alloc_type = 0}}, stack = {addr = 7348689045010, tid = 136281344337892, offset = 68, frame_pc = 136281344337824, access_size = 88, frame_descr = 0xffff6008 <error: Cannot access memory at address 0xffff6008>}, global = {addr = 7348689045010, static kMaxGlobals = 4, globals = {{beg = 136281344337892, size = 68, size_with_redzone = 136281344337824, name = 0x58 <error: Cannot access memory at address 0x58>, module_name = 0xffff6008 <error: Cannot access memory at address 0xffff6008>, has_dynamic_init = 136899819602944, gcc_location = 0x7bf2791e0520, odr_indicator = 0}, {beg = 0, size = 16966446358016, size_with_redzone = 140730051114128, name = 0x7f727ae1dd5c "\205\300\017\204\214", module_name = 0x7ffe44b4b490 "P\001\036y\002}", has_dynamic_init = 140129664622654, gcc_location = 0x5, odr_indicator = 7550163712}, {beg = 136831100126024, size = 2163868852705188608, size_with_redzone = 2, name = 0x7f727ae1196e <dbus_message_unref+46> "\203\370\001tmH\213]\370\311\303\017\037\200", module_name = 0x7ffe44b4b4a0 "\320\264\264D\376\177", has_dynamic_init = 140129664627413, gcc_location = 0x7d02791e0150, odr_indicator = 140730051114160}, {beg = 140730051114192, size = 140129664490858, size_with_redzone = 0, name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, module_name = 0x7c92791e0040 "\031", has_dynamic_init = 1, gcc_location = 0x7ffe44b4b510, odr_indicator = 140129664506501}}, reg_sites = {1152693520, 32766, 772356051, 21962}, access_size = 140730051116064, size = 16 '\020'}, wild = {addr = 7348689045010, access_size = 136281344337892}}}}, addr2_description = {data = {kind = __asan::kAddressKindGlobal, {shadow = {addr = 140129668614039, kind = __asan::kShadowKindLow, shadow_byte = 253 '\375'}, heap = {addr = 140129668614039, alloc_tid = 140730051132672, free_tid = 94326847736768, alloc_stack_id = 2032013120, free_stack_id = 31842, chunk_access = {bad_addr = 136831100128576, offset = 94326847998031, chunk_begin = 4294967298, chunk_size = 136760348639233, user_requested_alignment = 2800, access_type = 3, alloc_type = 2}}, stack = {addr = 140129668614039, tid = 140730051132672, offset = 94326847736768, frame_pc = 136762380652352, access_size = 136831100128576, frame_descr = 0x55ca2e44884f <bt_bap_stream_release+383> "\213D$\bH\203\304([]A^A_\303f\220H\203\304(1\300[]A^A_\303H\211\317\350\213.\300\377H\211\312H\211\336H\211L$\bH\215=\371\"{"}, global = {addr = 140129668614039, static kMaxGlobals = 4, globals = {{beg = 140730051132672, size = 94326847736768, size_with_redzone = 136762380652352, name = 0x7c72791e0d40 "\001", module_name = 0x55ca2e44884f <bt_bap_stream_release+383> "\213D$\bH\203\304([]A^A_\303f\220H\203\304(1\300[]A^A_\303H\211\317\350\213.\300\377H\211\312H\211\336H\211L$\bH\215=\371\"{", has_dynamic_init = 4294967298, gcc_location = 0x7c6200000001, odr_indicator = 140730051115760}, {beg = 135937747023632, size = 135869027628432, size_with_redzone = 135937747023632, name = 0x0, module_name = 0x55ca2e408bc0 <stream_state_changed> "\363\017\036\372H\203\354(H\211\370I\211\360H\205\377\017\204#\001", has_dynamic_init = 136762380652352, gcc_location = 0x7ffe44b4bb20, odr_indicator = 0}, {beg = 2163868852705188608, size = 135869027634304, size_with_redzone = 3, name = 0x1 <error: Cannot access memory at address 0x1>, module_name = 0x7ffe44b4bb50 "\240\357\b.\312U", has_dynamic_init = 136831100128576, gcc_location = 0x1e079b41c2065b00, odr_indicator = 136762380652352}, {beg = 140730051115888, size = 94326844092320, size_with_redzone = 2163868852705188608, name = 0x7c62791e0f40 "\327\006", module_name = 0x7c62791e0f40 "\327\006", has_dynamic_init = 94326844092320, gcc_location = 0x55ca2e436784 <stream_set_state+292>, odr_indicator = 136762380652352}}, reg_sites = {2032012608, 31858, 2032144352, 31650}, access_size = 94326847753604, size = 64 '@'}, wild = {addr = 140129668614039, access_size = 140730051132672}}}}}, Generic = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, addr_description = {data = {kind = __asan::kAddressKindHeap, {shadow = {addr = 136281344337892, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 136281344337892, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1554, free_stack_id = 1711, chunk_access = {bad_addr = 136281344337892, offset = 68, chunk_begin = 136281344337824, chunk_size = 88, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, stack = {addr = 136281344337892, tid = 0, offset = 0, frame_pc = 7348689045010, access_size = 136281344337892, frame_descr = 0x44 <error: Cannot access memory at address 0x44>}, global = {addr = 136281344337892, static kMaxGlobals = 4, globals = {{beg = 0, size = 0, size_with_redzone = 7348689045010, name = 0x7bf2791e67e4 "", module_name = 0x44 <error: Cannot access memory at address 0x44>, has_dynamic_init = 136281344337824, gcc_location = 0x58, odr_indicator = 4294926344}, {beg = 136899819602944, size = 136281344312608, size_with_redzone = 0, name = 0x0, module_name = 0xf6e4f021e00 <error: Cannot access memory at address 0xf6e4f021e00>, has_dynamic_init = 140730051114128, gcc_location = 0x7f727ae1dd5c, odr_indicator = 140730051114128}, {beg = 140129664622654, size = 5, size_with_redzone = 7550163712, name = 0x7c72791e0348 "0\001\036yb|", module_name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, has_dynamic_init = 2, gcc_location = 0x7f727ae1196e <dbus_message_unref+46>, odr_indicator = 140730051114144}, {beg = 140129664627413, size = 137449575416144, size_with_redzone = 140730051114160, name = 0x7ffe44b4b4d0 "\020\265\264D\376\177", module_name = 0x7f727adfdd6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", has_dynamic_init = 0, gcc_location = 0x1e079b41c2065b00, odr_indicator = 136968539078720}}, reg_sites = {1, 0, 1152693520, 32766}, access_size = 140129664506501, size = 16 '\020'}, wild = {addr = 136281344337892, access_size = 0}}}}, pc = 94326844110803, bp = 140730051116064, sp = 140730051116048, access_size = 4, bug_descr = 0x7f727b1ec797 "heap-use-after-free", is_write = false, shadow_val = 253 '\375'}}}, halt_on_error_ = true}
error = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\020\260\264D\376\177\000\000\213\025\033{r\177", '\000' <repeats 11 times>, "[\006\302A\233\a\036`", '\000' <repeats 15 times>, "p\260\264D\376\177\000\0002!\033{r\177\000\000`\204\000On\017\000\000\000[\006\302A\233\a\036\000\000\000\000r{\000\000l\305Q{r\177\000\000\323\006\000\000n\017\000\0000mpyr\177\000\000\360\260\264D\376\177\000\000\002\000\000\000\000\000\000\000\300/#{r\177\000\000\320\025 y\242{\000\000\300\260\264D\376\177\000\0008\a\n{"...}, tid = 0}, addr_description = {data = {kind = __asan::kAddressKindHeap, {shadow = {addr = 136281344337892, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 136281344337892, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1554, free_stack_id = 1711, chunk_access = {bad_addr = 136281344337892, offset = 68, chunk_begin = 136281344337824, chunk_size = 88, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, stack = {addr = 136281344337892, tid = 0, offset = 0, frame_pc = 7348689045010, access_size = 136281344337892, frame_descr = 0x44 <error: Cannot access memory at address 0x44>}, global = {addr = 136281344337892, static kMaxGlobals = 4, globals = {{beg = 0, size = 0, size_with_redzone = 7348689045010, name = 0x7bf2791e67e4 "", module_name = 0x44 <error: Cannot access memory at address 0x44>, has_dynamic_init = 136281344337824, gcc_location = 0x58, odr_indicator = 4294926344}, {beg = 136899819602944, size = 136281344312608, size_with_redzone = 0, name = 0x0, module_name = 0xf6e4f021e00 <error: Cannot access memory at address 0xf6e4f021e00>, has_dynamic_init = 140730051114128, gcc_location = 0x7f727ae1dd5c, odr_indicator = 140730051114128}, {beg = 140129664622654, size = 5, size_with_redzone = 7550163712, name = 0x7c72791e0348 "0\001\036yb|", module_name = 0x1e079b41c2065b00 <error: Cannot access memory at address 0x1e079b41c2065b00>, has_dynamic_init = 2, gcc_location = 0x7f727ae1196e <dbus_message_unref+46>, odr_indicator = 140730051114144}, {beg = 140129664627413, size = 137449575416144, size_with_redzone = 140730051114160, name = 0x7ffe44b4b4d0 "\020\265\264D\376\177", module_name = 0x7f727adfdd6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", has_dynamic_init = 0, gcc_location = 0x1e079b41c2065b00, odr_indicator = 136968539078720}}, reg_sites = {1, 0, 1152693520, 32766}, access_size = 140129664506501, size = 16 '\020'}, wild = {addr = 136281344337892, access_size = 0}}}}, pc = 94326844110803, bp = 140730051116064, sp = 140730051116048, access_size = 4, bug_descr = 0x7f727b1ec797 "heap-use-after-free", is_write = false, shadow_val = 253 '\375'}
#9 0x00007f727b190f8d in __asan::ReportGenericError (pc=<optimized out>, bp=bp@entry=140730051116064, sp=sp@entry=140730051116048, addr=addr@entry=136281344337892, is_write=is_write@entry=false, access_size=access_size@entry=4, exp=<optimized out>, fatal=true) at ../../../../src/libsanitizer/asan/asan_report.cpp:536
in_report = <optimized out>
error = <optimized out>
enable_fp = <optimized out>
#10 0x00007f727b1922e9 in __asan::__asan_report_load4 (addr=addr@entry=136281344337892) at ../../../../src/libsanitizer/asan/asan_rtl.cpp:130
bp = 140730051116064
pc = <optimized out>
local_stack = 136212624879952
sp = 140730051116048
#11 0x000055ca2e0937d3 in transport_bap_resume (transport=0x7bf2791e67a0, owner=0x7ba279200fe0) at profiles/audio/transport.c:2221
bap = 0x7bf2791e6820
id = <optimized out>
#12 0x000055ca2e08f59e in acquire (conn=<optimized out>, msg=0x7c72791e0440, data=0x7bf2791e67a0) at profiles/audio/transport.c:901
transport = <optimized out>
owner = 0x7ba279200fe0
req = 0x7b927920d330
id = <optimized out>
#13 acquire (conn=<optimized out>, msg=0x7c72791e0440, data=0x7bf2791e67a0) at profiles/audio/transport.c:876
transport = 0x7bf2791e67a0
owner = <optimized out>
req = 0x0
id = <optimized out>
#14 0x000055ca2e3617a1 in process_message (connection=0x7c92791e0040, message=0x7c72791e0440, method=0x55ca2e6580c0 <transport_methods>, iface_user_data=<optimized out>) at gdbus/object.c:293
reply = <optimized out>
#15 0x00007f727ae050f4 in dbus_connection_dispatch () from /usr/lib/x86_64-linux-gnu/libdbus-1.so.3
No symbol table info available.
#16 0x000055ca2e350ad8 in message_dispatch (data=0x7c92791e0040) at gdbus/mainloop.c:59
conn = 0x7c92791e0040
#17 0x00007f727ae9cb9b in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#18 0x00007f727ae9e1d7 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#19 0x00007f727ae9e577 in g_main_loop_run () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#20 0x000055ca2e4e96d9 in mainloop_run () at src/shared/mainloop-glib.c:65
No locals.
#21 0x000055ca2e4ea00b in mainloop_run_with_signal (func=func@entry=0x55ca2e3338f0 <signal_callback>, user_data=user_data@entry=0x0) at src/shared/mainloop-notify.c:196
data = 0x7ba2791e3610
io = 0x7bb2791f98d0
ret = <optimized out>
#22 0x000055ca2e05f05f in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:1793
context = <optimized out>
err = <optimized out>
sdp_mtu = 0
sdp_flags = <optimized out>
gdbus_flags = <optimized out>
__func__ = "main""
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
tools/btgatt-server.c:1204:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores]
tools/btgatt-client.c:1822:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores]
1204 | argv -= optind;
| ^ ~~~~~~
1822 | argv += optind;
1 warning generated.
https://github.com/bluez/bluez/pull/2937
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT
@ 2026-12-03 22:15 Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 01/12] doc/mgmt: Add PA and PAwR commands and events Roland Schober
` (11 more replies)
0 siblings, 12 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
This is the user space side of the kernel RFC
"[RFC PATCH v2 0/6] Bluetooth: Periodic advertising and PAwR over
MGMT": a MGMT interface for periodic advertising and for the
advertiser side of Periodic Advertising with Responses (PAwR), with
emulator support and tests. The interface is the one of v1. The kernel
series is at v2 for one more fix: the train of an instance whose
advertising timed out went on.
Patch 1 documents the three commands and two events in
doc/mgmt-protocol.rst; it is the place to comment on the interface.
Patch 2 adds the definitions, patch 3 the btmon decoding.
Patches 4 and 5 fix how btmgmt reads a byte array, which the new
commands use: the length with empty entries, and negative values.
Patch 6 adds three btmgmt commands: pa-params sends Add Periodic
Advertising Parameters, pa-data sends Add Periodic Advertising Data,
pawr-serve answers the subevent data requests and prints the response
reports.
Plain periodic advertising:
btmgmt add-ext-adv-params -P 1M 1
btmgmt pa-params 1 0x50 0x50
btmgmt pa-data 1 0x05 0xff 0x59 0x00 0x01 0x02
btmgmt add-ext-adv-data 1
A PAwR train with 5 subevents of 5 response slots:
btmgmt add-ext-adv-params -P 1M 1
btmgmt pa-params 1 0xff 0xff 5 0x30 8 0x50 5
btmgmt pawr-serve 1 5 5 &
btmgmt add-ext-adv-data 1
Patches 7 to 11 are the emulator:
- Patch 7 adds the PAwR HCI definitions to bt.h. They are the ones of
my btmon series "monitor: Decode Periodic Advertising with
Responses", which is not applied yet; the patch is dropped here
when that series is in.
- Patch 8 gives the handlers which patches 10 and 11 extend a check
of the command length.
- Patch 9 keeps the advertising set when the duration of its
advertising ends. The emulator freed it, also with periodic
advertising enabled on it.
- Patch 10 makes the emulator refuse to remove an advertising set
while periodic advertising is enabled on it, as a controller does.
The kernel needs "Bluetooth: hci_sync: Disable PA before removing
an advertising set" for this, which is part of the kernel RFC and
which I also sent on its own. Without it the broadcast cases of
test/functional/test_bap.py fail, as the CI run of v1 showed.
- Patch 11 adds the PAwR advertiser to controllers of version 6.0 and
later: the parameters [v2], the subevent data requests once per
periodic advertising interval, and the subevent data command, which
refuses data that was not asked for. Nothing is transmitted: the
responder side and the response reports are not emulated yet.
Patch 12 adds 33 mgmt-tester cases. They need the kernel series; on a
kernel without it they fail. The case with a timeout needs v2 of it.
Also tested with the kernel RFC in QEMU against the Nordic SoftDevice
Controller on a simulated nRF52 (BabbleSim), with Zephyr's
periodic_sync_rsp sample as the responder. That run covers what the
emulator does not: a synchronised responder and its response reports.
The D-Bus API is not part of this RFC; it follows when the MGMT
interface is agreed. For PAwR I expect bluetoothd to keep the data of
each subevent and to answer the data requests itself, since a D-Bus
round trip per request does not fit the controller's lead time.
v3:
- Emulator: check the length of LE Set Periodic Advertising
Parameters [v2] (Copilot), and of the commands whose handlers the
series extends (new patch 8). The handlers were then fed truncated,
extended and random commands under AddressSanitizer.
- btmgmt pawr-serve: tell the shell that the command stays running,
so that the lines of a script after it are run (Copilot). Print a
response report which has no responses.
- btmgmt: refuse negative values in a byte array (new patch 5).
- Emulator: LE Set Periodic Advertising Enable checks its handle. It
is refused for a set which does not exist, and for a set other than
the one with the parameters.
- Emulator: keep the advertising set when the duration of its
advertising ends (new patch 9). With the check above, a train on a
set which was freed that way could not be disabled any more.
- doc/mgmt-protocol.rst: subevent data which was not requested fails
with Busy.
- mgmt-tester: new case for an instance with a timeout and a train.
The kernel has to disable the train and remove the set when the
advertising of the set ends, which v2 of the kernel series does.
- mgmt-tester: the "Sent twice" case uses an interval of 2 s, so the
second answer is out before the next request. The "too many
subevents" case breaks no other rule than the number.
- Rebased.
v2:
- btmgmt pawr-serve: do not write beyond the command buffer, send
data which does not fit one command in several, check the arguments
before the running configuration is changed, and replace an earlier
pawr-serve instead of answering twice. Copilot found these four.
- btmgmt: refuse numbers out of range, take the data from all
remaining arguments, size the buffer which prints a response for
the largest data length. Add patch 4 and the commands to
doc/bluetoothctl-mgmt.rst.
- Emulator: a refused LE Set Periodic Advertising Enable leaves the
train as it is (Copilot). Check the response slot spacing against
the subevent interval, refuse a command which names a subevent
twice, and forget the subevents of a set which is removed.
- Emulator: answer Command Disallowed for subevent data before the
first request, for a second command for one subevent and for a
subevent the train does not have, as the Core Specification lists
it. v1 answered Too Early and Too Late, which are for data that
misses its subevent in time; the patch with their definitions is
dropped.
- mgmt-tester: send the two commands of the "two commands" test
without waiting for the first reply (Copilot), use a periodic
advertising interval of 400 ms, which leaves time to answer, and
add a case for a subevent the train does not have.
- doc/mgmt-protocol.rst: a command takes the data of up to 15
subevents.
- The trace in the commit message of patch 3 is a complete excerpt.
- Shorter subjects for patches 1, 3, 7 and 8 (now 1, 3, 10 and 11).
- Rebased.
Roland Schober (12):
doc/mgmt: Add PA and PAwR commands and events
lib/mgmt: Add periodic advertising and PAwR definitions
monitor: Decode PA and PAwR MGMT commands and events
client/mgmt: Fix length of byte arrays with empty entries
client/mgmt: Refuse negative values in byte arrays
client/mgmt: Add pa-params, pa-data and pawr-serve commands
monitor: Add PAwR HCI definitions
emulator/btdev: Check the length of PA commands
emulator/btdev: Keep the advertising set after a timeout
emulator/btdev: Keep advertising sets with PA enabled
emulator/btdev: Add PAwR advertiser
mgmt-tester: Add periodic advertising and PAwR tests
client/mgmt.c | 384 ++++++++++++-
doc/bluetoothctl-mgmt.rst | 51 ++
doc/mgmt-protocol.rst | 210 +++++++
emulator/btdev.c | 337 ++++++++++-
lib/bluetooth/mgmt.h | 74 +++
monitor/bt.h | 174 ++++++
monitor/packet.c | 204 +++++++
tools/mgmt-tester.c | 1119 +++++++++++++++++++++++++++++++++++++
8 files changed, 2544 insertions(+), 9 deletions(-)
base-commit: 736384fcdc45dc343c8109317510f4e2a31bd7fb
--
2.47.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 01/12] doc/mgmt: Add PA and PAwR commands and events
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-04 8:23 ` Periodic advertising and PAwR over MGMT bluez.test.bot
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 02/12] lib/mgmt: Add periodic advertising and PAwR definitions Roland Schober
` (10 subsequent siblings)
11 siblings, 1 reply; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
Add Periodic Advertising Parameters makes an advertising instance
periodic and, with subevents, Periodic Advertising with Responses.
Add Periodic Advertising Data sets the data of a periodic advertising
train. Set Periodic Advertising Subevent Data and the events Periodic
Advertising Subevent Data Request and Periodic Advertising Response
Report carry the data of the subevents and the responses to them.
Assisted-by: Claude:claude-fable-5-2
---
doc/mgmt-protocol.rst | 210 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 210 insertions(+)
diff --git a/doc/mgmt-protocol.rst b/doc/mgmt-protocol.rst
index c4e1421e3..5fdb6d8d6 100644
--- a/doc/mgmt-protocol.rst
+++ b/doc/mgmt-protocol.rst
@@ -4278,6 +4278,155 @@ Possible errors:
:Invalid Index:
:Not Supported:
+Add Periodic Advertising Parameters
+```````````````````````````````````
+
+:Command Code: 0x005D
+:Controller Index: <controller id>
+:Command Parameters: Instance (1 Octet)
+:...: Min_Interval (2 Octets)
+:...: Max_Interval (2 Octets)
+:...: Num_Subevents (1 Octet)
+:...: Subevent_Interval (1 Octet)
+:...: Response_Slot_Delay (1 Octet)
+:...: Response_Slot_Spacing (1 Octet)
+:...: Num_Response_Slots (1 Octet)
+:Return Parameters: Instance (1 Octet)
+
+This command is used to make an advertising instance a periodic advertising
+instance. The instance has to exist: the command is sent between Add Extended
+Advertising Parameters, which creates the instance, and Add Extended
+Advertising Data, which enables it:
+
+.. csv-table::
+ :header: "Step", "Command"
+ :widths: auto
+
+ 1, Add Extended Advertising Parameters
+ 2, Add Periodic Advertising Parameters
+ 3, Add Periodic Advertising Data (optional)
+ 4, Add Extended Advertising Data
+
+The instance must use one of the secondary channel flags (Secondary Channel
+with LE 1M, LE 2M or LE Coded) and must not be connectable.
+
+The Min_Interval and Max_Interval parameters specify the range of the periodic
+advertising interval in units of 1.25 ms (range: 0x0006 to 0xFFFF).
+
+A Num_Subevents of 0 makes the instance plain periodic advertising, and the
+remaining parameters are ignored. Any other value (range: 0x01 to 0x80) makes
+it Periodic Advertising with Responses, which requires the controller to
+support the Periodic Advertising with Responses - Advertiser feature. The
+remaining parameters are then those of the HCI command LE Set Periodic
+Advertising Parameters [v2]:
+
+.. csv-table::
+ :header: "Parameter", "Unit", "Description"
+ :widths: auto
+
+ Subevent_Interval, 1.25 ms, Time between the subevents of one periodic advertising event
+ Response_Slot_Delay, 1.25 ms, Time from the start of a subevent to its first response slot
+ Response_Slot_Spacing, 0.125 ms, Time between the starts of two response slots
+ Num_Response_Slots, , Number of response slots of a subevent
+
+The controller checks these values against each other and against the
+interval. The data of the subevents is requested with the Periodic Advertising
+Subevent Data Request event.
+
+Remove Advertising stops the periodic advertising and removes the instance.
+
+This command can only be used when the controller is powered.
+
+This command generates a Command Complete event on success or a Command Status
+event on failure.
+
+Possible errors:
+
+:Failed:
+:Busy:
+:Rejected:
+:Not Supported:
+:Invalid Parameters:
+:Invalid Index:
+
+Add Periodic Advertising Data
+`````````````````````````````
+
+:Command Code: 0x005E
+:Controller Index: <controller id>
+:Command Parameters: Instance (1 Octet)
+:...: Data_Length (1 Octet)
+:...: Data (0-252 Octets)
+:Return Parameters: Instance (1 Octet)
+
+This command is used to set the data of the periodic advertising train of an
+instance which was made periodic with Add Periodic Advertising Parameters. It
+may be sent again to change the data while the train is running.
+
+The Data parameter holds advertising data structures, each with its length
+and type. The kernel does not add anything to it.
+
+An instance with Periodic Advertising with Responses has no such data: the
+data of its subevents is set with Set Periodic Advertising Subevent Data.
+
+This command can only be used when the controller is powered.
+
+This command generates a Command Complete event on success or a Command Status
+event on failure.
+
+Possible errors:
+
+:Failed:
+:Rejected:
+:Invalid Parameters:
+:Invalid Index:
+
+Set Periodic Advertising Subevent Data
+``````````````````````````````````````
+
+:Command Code: 0x005F
+:Controller Index: <controller id>
+:Command Parameters: Instance (1 Octet)
+:...: Num_Subevents (1 Octet)
+:...: Subevent[] (1 Octet)
+:...: Response_Slot_Start[] (1 Octet)
+:...: Response_Slot_Count[] (1 Octet)
+:...: Data_Length[] (1 Octet)
+:...: Data[] (variable)
+:...: ...[]
+:Return Parameters: Instance (1 Octet)
+
+This command is used to set the data of subevents of an instance with
+Periodic Advertising with Responses. It is the answer to the Periodic
+Advertising Subevent Data Request event and may hold the data of any number of
+the requested subevents.
+
+The Response_Slot_Start and Response_Slot_Count parameters specify the
+response slots of the subevent the controller listens to. A count of 0 means
+that no response is expected.
+
+All entries of one command are sent to the controller in a single HCI command,
+which takes the data of up to 15 subevents: the entries, each with its four
+octets of header, are limited to 253 octets in total.
+
+The controller accepts the data of a subevent only for a limited time before
+the subevent. Data which arrives too late fails the command, and nothing is
+transmitted in that subevent. Data for a subevent which was not requested, or
+which has its data already, fails the command with Busy.
+
+This command can only be used when the controller is powered.
+
+This command generates a Command Complete event on success or a Command Status
+event on failure.
+
+Possible errors:
+
+:Failed:
+:Busy:
+:Rejected:
+:Invalid Parameters:
+:Invalid Index:
+
Events
------
@@ -5599,3 +5748,64 @@ Possible values for the Encryption type:
0x02, AES-CCM encryption
This event will be sent to all management sockets.
+
+Periodic Advertising Subevent Data Request
+``````````````````````````````````````````
+
+:Event Code: 0x0035
+:Controller Index: <controller id>
+:Event Parameters: Instance (1 Octet)
+:...: Subevent_Start (1 Octet)
+:...: Subevent_Data_Count (1 Octet)
+
+This event indicates that the controller is ready to accept the data of
+Subevent_Data_Count subevents of an instance with Periodic Advertising with
+Responses, starting with the subevent Subevent_Start and wrapping to subevent
+0 after the last one. The data is set with the Set
+Periodic Advertising Subevent Data command.
+
+This event will be sent to all management sockets.
+
+Periodic Advertising Response Report
+````````````````````````````````````
+
+:Event Code: 0x0036
+:Controller Index: <controller id>
+:Event Parameters: Instance (1 Octet)
+:...: Subevent (1 Octet)
+:...: TX_Status (1 Octet)
+:...: Num_Responses (1 Octet)
+:...: TX_Power[] (1 Octet)
+:...: RSSI[] (1 Octet)
+:...: CTE_Type[] (1 Octet)
+:...: Response_Slot[] (1 Octet)
+:...: Data_Status[] (1 Octet)
+:...: Data_Length[] (1 Octet)
+:...: Data[] (variable)
+:...: ...[]
+
+This event reports the responses received in the response slots of a subevent
+of an instance with Periodic Advertising with Responses.
+
+Possible values for the TX_Status parameter:
+
+.. csv-table::
+ :header: "Value", "Description"
+ :widths: auto
+
+ 0x00, The subevent was transmitted
+ 0x01, The subevent was not transmitted
+
+The parameters of a response are those of the HCI event LE Periodic
+Advertising Response Report. TX_Power and RSSI are in dBm, with 0x7F for a
+value which is not available. Possible values for the Data_Status parameter:
+
+.. csv-table::
+ :header: "Value", "Description"
+ :widths: auto
+
+ 0x00, Data complete
+ 0x01, "Data incomplete, more data to come"
+ 0xFF, Failed to receive the response
+
+This event will be sent to all management sockets.
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 02/12] lib/mgmt: Add periodic advertising and PAwR definitions
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 01/12] doc/mgmt: Add PA and PAwR commands and events Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 03/12] monitor: Decode PA and PAwR MGMT commands and events Roland Schober
` (9 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
Add the MGMT commands and events for periodic advertising and Periodic
Advertising with Responses (PAwR):
- Add Periodic Advertising Parameters (0x005d)
- Add Periodic Advertising Data (0x005e)
- Set Periodic Advertising Subevent Data (0x005f)
- Periodic Advertising Subevent Data Request event (0x0035)
- Periodic Advertising Response Report event (0x0036)
Assisted-by: Claude:claude-fable-5-2
---
lib/bluetooth/mgmt.h | 74 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/lib/bluetooth/mgmt.h b/lib/bluetooth/mgmt.h
index af71be828..450d20afb 100644
--- a/lib/bluetooth/mgmt.h
+++ b/lib/bluetooth/mgmt.h
@@ -838,6 +838,49 @@ struct mgmt_cp_load_conn_subrate {
struct mgmt_conn_subrate params[];
} __packed;
+#define MGMT_OP_ADD_PERIODIC_ADV_PARAMS 0x005D
+struct mgmt_cp_add_periodic_adv_params {
+ uint8_t instance;
+ uint16_t min_interval;
+ uint16_t max_interval;
+ uint8_t num_subevents;
+ uint8_t subevent_interval;
+ uint8_t response_slot_delay;
+ uint8_t response_slot_spacing;
+ uint8_t num_response_slots;
+} __packed;
+struct mgmt_rp_add_periodic_adv_params {
+ uint8_t instance;
+} __packed;
+
+#define MGMT_OP_ADD_PERIODIC_ADV_DATA 0x005E
+struct mgmt_cp_add_periodic_adv_data {
+ uint8_t instance;
+ uint8_t data_len;
+ uint8_t data[];
+} __packed;
+struct mgmt_rp_add_periodic_adv_data {
+ uint8_t instance;
+} __packed;
+
+struct mgmt_pa_subevent_data {
+ uint8_t subevent;
+ uint8_t response_slot_start;
+ uint8_t response_slot_count;
+ uint8_t data_len;
+ uint8_t data[];
+} __packed;
+
+#define MGMT_OP_SET_PA_SUBEVENT_DATA 0x005F
+struct mgmt_cp_set_pa_subevent_data {
+ uint8_t instance;
+ uint8_t num_subevents;
+ uint8_t subevents[];
+} __packed;
+struct mgmt_rp_set_pa_subevent_data {
+ uint8_t instance;
+} __packed;
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
uint16_t opcode;
@@ -1156,6 +1199,32 @@ struct mgmt_ev_security_level_changed {
uint8_t tlv_data[];
} __packed;
+#define MGMT_EV_PA_SUBEVENT_DATA_REQUEST 0x0035
+struct mgmt_ev_pa_subevent_data_request {
+ uint8_t instance;
+ uint8_t subevent_start;
+ uint8_t subevent_data_count;
+} __packed;
+
+struct mgmt_pa_response {
+ int8_t tx_power;
+ int8_t rssi;
+ uint8_t cte_type;
+ uint8_t response_slot;
+ uint8_t data_status;
+ uint8_t data_len;
+ uint8_t data[];
+} __packed;
+
+#define MGMT_EV_PA_RESPONSE_REPORT 0x0036
+struct mgmt_ev_pa_response_report {
+ uint8_t instance;
+ uint8_t subevent;
+ uint8_t tx_status;
+ uint8_t num_responses;
+ uint8_t responses[];
+} __packed;
+
static const char *mgmt_op[] = {
"<0x0000>",
"Read Version",
@@ -1250,6 +1319,9 @@ static const char *mgmt_op[] = {
"Mesh Send Cancel",
"HCI Cmd Sync",
"Load Connection Subrate",
+ "Add Periodic Advertising Parameters",
+ "Add Periodic Advertising Data",
+ "Set Periodic Advertising Subevent Data",
};
static const char *mgmt_ev[] = {
@@ -1306,6 +1378,8 @@ static const char *mgmt_ev[] = {
"Mesh Packet Complete",
"Connection Subrate",
"Security Level Changed",
+ "Periodic Advertising Subevent Data Request",
+ "Periodic Advertising Response Report",
};
static const char *mgmt_status[] = {
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 03/12] monitor: Decode PA and PAwR MGMT commands and events
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 01/12] doc/mgmt: Add PA and PAwR commands and events Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 02/12] lib/mgmt: Add periodic advertising and PAwR definitions Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 04/12] client/mgmt: Fix length of byte arrays with empty entries Roland Schober
` (8 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
Decode Add Periodic Advertising Parameters, Add Periodic Advertising
Data, Set Periodic Advertising Subevent Data and the events Periodic
Advertising Subevent Data Request and Periodic Advertising Response
Report. A train with responses, a request for the data of two
subevents, the answer to it and a response:
@ MGMT Command: Add Periodic.. (0x005d) plen 10 {0x0001} [hci0] 2.872447
Instance: 1
Min interval: 318.75 msec (0x00ff)
Max interval: 318.75 msec (0x00ff)
Num subevents: 5
Subevent interval: 60.00 msec (0x30)
Response slot delay: 10.00 msec (0x08)
Response slot spacing: 10.000 msec (0x50)
Num response slots: 5
@ MGMT Event: Periodic Advert.. (0x0035) plen 3 {0x0001} [hci0] 3.329062
Instance: 1
Subevent start: 4 (0x04)
Subevent data count: 2 (0x02)
@ MGMT Command: Set Periodic.. (0x005f) plen 22 {0x0001} [hci0] 3.330232
Instance: 1
Num subevents: 2
Entry 0
Subevent: 4 (0x04)
Response slot start: 0
Response slot count: 5
Data length: 6
Data[6]:
05 ff 59 00 04 03 ..Y...
Company: Nordic Semiconductor ASA (89)
Data[2]:
04 03 ..
Entry 1
Subevent: 0 (0x00)
Response slot start: 0
Response slot count: 5
Data length: 6
Data[6]:
05 ff 59 00 00 04 ..Y...
Company: Nordic Semiconductor ASA (89)
Data[2]:
00 04 ..
@ MGMT Event: Periodic Adver.. (0x0036) plen 16 {0x0001} [hci0] 4.776838
Instance: 1
Subevent: 0 (0x00)
TX status: Subevent was transmitted (0x00)
Num responses: 1
Entry 0
TX power: not available (0x7f)
RSSI: -59 dBm (0xc5)
CTE type: 0xff
Response slot: 0 (0x00)
Data status: Complete (0x00)
Data length: 6
Data[6]:
05 ff 59 00 00 18 ..Y...
Company: Nordic Semiconductor ASA (89)
Data[2]:
00 18 ..
Assisted-by: Claude:claude-fable-5-2
---
monitor/packet.c | 204 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 204 insertions(+)
diff --git a/monitor/packet.c b/monitor/packet.c
index eddf8706a..1ecbe8050 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -18436,6 +18436,99 @@ static void mgmt_hci_cmd_sync_rsp(const void *data, uint16_t size)
print_hex_field("Response", data, size);
}
+static void mgmt_add_periodic_adv_params_cmd(const void *data, uint16_t size)
+{
+ const struct mgmt_cp_add_periodic_adv_params *cp = data;
+ uint16_t min_interval = le16_to_cpu(cp->min_interval);
+ uint16_t max_interval = le16_to_cpu(cp->max_interval);
+
+ print_field("Instance: %u", cp->instance);
+ print_field("Min interval: %.2f msec (0x%4.4x)", min_interval * 1.25,
+ min_interval);
+ print_field("Max interval: %.2f msec (0x%4.4x)", max_interval * 1.25,
+ max_interval);
+ print_field("Num subevents: %u", cp->num_subevents);
+ print_field("Subevent interval: %.2f msec (0x%2.2x)",
+ cp->subevent_interval * 1.25, cp->subevent_interval);
+ print_field("Response slot delay: %.2f msec (0x%2.2x)",
+ cp->response_slot_delay * 1.25,
+ cp->response_slot_delay);
+ print_field("Response slot spacing: %.3f msec (0x%2.2x)",
+ cp->response_slot_spacing * 0.125,
+ cp->response_slot_spacing);
+ print_field("Num response slots: %u", cp->num_response_slots);
+}
+
+static void mgmt_instance_rsp(const void *data, uint16_t size)
+{
+ uint8_t instance = get_u8(data);
+
+ print_field("Instance: %u", instance);
+}
+
+static void mgmt_add_periodic_adv_data_cmd(const void *data, uint16_t size)
+{
+ struct iovec iov = { .iov_base = (void *) data, .iov_len = size };
+ const struct mgmt_cp_add_periodic_adv_data *cp;
+
+ cp = util_iov_pull_mem(&iov, sizeof(*cp));
+ if (!cp)
+ return;
+
+ print_field("Instance: %u", cp->instance);
+ print_field("Data length: %u", cp->data_len);
+
+ if (iov.iov_len != cp->data_len) {
+ print_text(COLOR_ERROR, " invalid packet size");
+ print_hex_field(" Data", iov.iov_base, iov.iov_len);
+ return;
+ }
+
+ print_eir("Data", cp->data, cp->data_len, true);
+}
+
+static void mgmt_set_pa_subevent_data_cmd(const void *data, uint16_t size)
+{
+ struct iovec iov = { .iov_base = (void *) data, .iov_len = size };
+ const struct mgmt_cp_set_pa_subevent_data *cp;
+ const struct mgmt_pa_subevent_data *se;
+ uint8_t i;
+
+ cp = util_iov_pull_mem(&iov, sizeof(*cp));
+ if (!cp)
+ return;
+
+ print_field("Instance: %u", cp->instance);
+ print_field("Num subevents: %u", cp->num_subevents);
+
+ for (i = 0; i < cp->num_subevents; i++) {
+ se = util_iov_pull_mem(&iov, sizeof(*se));
+ if (!se)
+ break;
+
+ print_field("Entry %u", i);
+ print_field(" Subevent: %u (0x%2.2x)", se->subevent,
+ se->subevent);
+ print_field(" Response slot start: %u",
+ se->response_slot_start);
+ print_field(" Response slot count: %u",
+ se->response_slot_count);
+ print_field(" Data length: %u", se->data_len);
+
+ if (!util_iov_pull(&iov, se->data_len))
+ break;
+
+ print_eir(" Data", se->data, se->data_len, true);
+ }
+
+ /* Fewer entries than announced, or octets after the last one */
+ if (i < cp->num_subevents || iov.iov_len) {
+ print_text(COLOR_ERROR, " invalid packet size");
+ if (iov.iov_len)
+ print_hex_field(" Data", iov.iov_base, iov.iov_len);
+ }
+}
+
struct mgmt_data {
uint16_t opcode;
const char *str;
@@ -18719,6 +18812,15 @@ static const struct mgmt_data mgmt_command_table[] = {
{ 0x005C, "Load Connection Subrate",
mgmt_load_conn_subrate_cmd, 2, false,
mgmt_null_rsp, 0, true },
+ { 0x005D, "Add Periodic Advertising Parameters",
+ mgmt_add_periodic_adv_params_cmd, 10, true,
+ mgmt_instance_rsp, 1, true },
+ { 0x005E, "Add Periodic Advertising Data",
+ mgmt_add_periodic_adv_data_cmd, 2, false,
+ mgmt_instance_rsp, 1, true },
+ { 0x005F, "Set Periodic Advertising Subevent Data",
+ mgmt_set_pa_subevent_data_cmd, 2, false,
+ mgmt_instance_rsp, 1, true },
{ }
};
@@ -19383,6 +19485,104 @@ static void mgmt_security_level_changed_evt(const void *data, uint16_t size)
mgmt_tlv_list_free(tlv_list);
}
+static void mgmt_pa_subevent_data_request_evt(const void *data,
+ uint16_t size)
+{
+ const struct mgmt_ev_pa_subevent_data_request *ev = data;
+
+ print_field("Instance: %u", ev->instance);
+ print_field("Subevent start: %u (0x%2.2x)", ev->subevent_start,
+ ev->subevent_start);
+ print_field("Subevent data count: %u (0x%2.2x)",
+ ev->subevent_data_count, ev->subevent_data_count);
+}
+
+static void mgmt_pa_response_report_evt(const void *data, uint16_t size)
+{
+ struct iovec iov = { .iov_base = (void *) data, .iov_len = size };
+ const struct mgmt_ev_pa_response_report *ev;
+ const struct mgmt_pa_response *rsp;
+ const char *str;
+ uint8_t i;
+
+ ev = util_iov_pull_mem(&iov, sizeof(*ev));
+ if (!ev)
+ return;
+
+ print_field("Instance: %u", ev->instance);
+ print_field("Subevent: %u (0x%2.2x)", ev->subevent, ev->subevent);
+
+ switch (ev->tx_status) {
+ case 0x00:
+ str = "Subevent was transmitted";
+ break;
+ case 0x01:
+ str = "Subevent was not transmitted";
+ break;
+ default:
+ str = "Reserved";
+ break;
+ }
+
+ print_field("TX status: %s (0x%2.2x)", str, ev->tx_status);
+ print_field("Num responses: %u", ev->num_responses);
+
+ for (i = 0; i < ev->num_responses; i++) {
+ rsp = util_iov_pull_mem(&iov, sizeof(*rsp));
+ if (!rsp)
+ break;
+
+ print_field("Entry %u", i);
+
+ if (rsp->tx_power == 0x7f)
+ print_field(" TX power: not available (0x7f)");
+ else
+ print_field(" TX power: %d dBm (0x%2.2x)",
+ rsp->tx_power, (uint8_t) rsp->tx_power);
+
+ if (rsp->rssi == 0x7f)
+ print_field(" RSSI: not available (0x7f)");
+ else
+ print_field(" RSSI: %d dBm (0x%2.2x)", rsp->rssi,
+ (uint8_t) rsp->rssi);
+
+ print_field(" CTE type: 0x%2.2x", rsp->cte_type);
+ print_field(" Response slot: %u (0x%2.2x)",
+ rsp->response_slot, rsp->response_slot);
+
+ switch (rsp->data_status) {
+ case 0x00:
+ str = "Complete";
+ break;
+ case 0x01:
+ str = "Incomplete, more data to come";
+ break;
+ case 0xff:
+ str = "Failed to receive the response";
+ break;
+ default:
+ str = "Reserved";
+ break;
+ }
+
+ print_field(" Data status: %s (0x%2.2x)", str,
+ rsp->data_status);
+ print_field(" Data length: %u", rsp->data_len);
+
+ if (!util_iov_pull(&iov, rsp->data_len))
+ break;
+
+ print_eir(" Data", rsp->data, rsp->data_len, true);
+ }
+
+ /* Fewer responses than announced, or octets after the last one */
+ if (i < ev->num_responses || iov.iov_len) {
+ print_text(COLOR_ERROR, " invalid packet size");
+ if (iov.iov_len)
+ print_hex_field(" Data", iov.iov_base, iov.iov_len);
+ }
+}
+
static const struct mgmt_data mgmt_event_table[] = {
{ 0x0001, "Command Complete",
mgmt_command_complete_evt, 3, false },
@@ -19484,6 +19684,10 @@ static const struct mgmt_data mgmt_event_table[] = {
mgmt_conn_subrate_evt, 18, true },
{ 0x0034, "Security Level Changed",
mgmt_security_level_changed_evt, 8, false },
+ { 0x0035, "Periodic Advertising Subevent Data Request",
+ mgmt_pa_subevent_data_request_evt, 3, true },
+ { 0x0036, "Periodic Advertising Response Report",
+ mgmt_pa_response_report_evt, 4, false },
{ }
};
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 04/12] client/mgmt: Fix length of byte arrays with empty entries
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (2 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 03/12] monitor: Decode PA and PAwR MGMT commands and events Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 05/12] client/mgmt: Refuse negative values in byte arrays Roland Schober
` (7 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
str2bytearray() counts the empty entries which two separators in a row
or one at the end of the argument leave, although it stores nothing for
them. The length it returns is then larger than the number of octets
given, and with enough empty entries larger than the buffer: hci-cmd
sends octets it was not given, and octets beyond its packet.
Count the octets which are stored.
Fixes: 95e89cd2e4f8 ("client/mgmt: Add hci-cmd command")
Assisted-by: Claude:claude-fable-5-2
---
client/mgmt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/client/mgmt.c b/client/mgmt.c
index a7069e5bb..bdf1bbfec 100644
--- a/client/mgmt.c
+++ b/client/mgmt.c
@@ -2398,9 +2398,9 @@ static void cmd_set_flags(int argc, char **argv)
static uint8_t *str2bytearray(char *arg, uint8_t *val, long *val_len)
{
char *entry;
- long i;
+ long i = 0;
- for (i = 0; (entry = strsep(&arg, " \t")) != NULL; i++) {
+ while ((entry = strsep(&arg, " \t")) != NULL) {
long v;
char *endptr = NULL;
@@ -2418,7 +2418,7 @@ static uint8_t *str2bytearray(char *arg, uint8_t *val, long *val_len)
return NULL;
}
- val[i] = v;
+ val[i++] = v;
}
*val_len = i;
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 05/12] client/mgmt: Refuse negative values in byte arrays
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (3 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 04/12] client/mgmt: Fix length of byte arrays with empty entries Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 06/12] client/mgmt: Add pa-params, pa-data and pawr-serve commands Roland Schober
` (6 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
str2bytearray() checks the upper limit of an octet only, so a negative
value is stored as its low eight bits: hci-cmd sends 0xff for -1 and
0x00 for -256, without an error.
Refuse values below 0 like those above 255.
Fixes: 95e89cd2e4f8 ("client/mgmt: Add hci-cmd command")
Assisted-by: Claude:claude-fable-5-2
---
client/mgmt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/client/mgmt.c b/client/mgmt.c
index bdf1bbfec..fa5abec9e 100644
--- a/client/mgmt.c
+++ b/client/mgmt.c
@@ -2413,7 +2413,8 @@ static uint8_t *str2bytearray(char *arg, uint8_t *val, long *val_len)
}
v = strtol(entry, &endptr, 0);
- if (!endptr || *endptr != '\0' || v > UINT8_MAX) {
+ if (!endptr || *endptr != '\0' || v < 0 ||
+ v > UINT8_MAX) {
bt_shell_printf("Invalid value at index %ld\n", i);
return NULL;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 06/12] client/mgmt: Add pa-params, pa-data and pawr-serve commands
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (4 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 05/12] client/mgmt: Refuse negative values in byte arrays Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 07/12] monitor: Add PAwR HCI definitions Roland Schober
` (5 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
pa-params adds periodic advertising to an instance created with
add-ext-adv-params, with the parameters of Periodic Advertising with
Responses if subevents are given. pa-data sets the data of a periodic
advertising train.
pawr-serve answers the subevent data requests of an instance, with
the data given or with manufacturer data which carries the subevent
and a counter, and prints the response reports. Data which does not
fit into one command is sent in several. It runs until the shell is
quit or another pawr-serve replaces it.
Assisted-by: Claude:claude-fable-5-2
---
client/mgmt.c | 375 ++++++++++++++++++++++++++++++++++++++
doc/bluetoothctl-mgmt.rst | 51 ++++++
2 files changed, 426 insertions(+)
diff --git a/client/mgmt.c b/client/mgmt.c
index fa5abec9e..1b1c2cf0a 100644
--- a/client/mgmt.c
+++ b/client/mgmt.c
@@ -2505,6 +2505,367 @@ static void cmd_hci_cmd(int argc, char **argv)
}
}
+static void pa_params_rsp(uint8_t status, uint16_t len, const void *param,
+ void *user_data)
+{
+ const struct mgmt_rp_add_periodic_adv_params *rp = param;
+
+ if (status != 0) {
+ error("Add Periodic Advertising Parameters failed with status "
+ "0x%02x (%s)", status, mgmt_errstr(status));
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ if (len < sizeof(*rp)) {
+ error("Too small (%u bytes) reply", len);
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ print("Periodic advertising set on instance %u", rp->instance);
+
+ bt_shell_noninteractive_quit(EXIT_SUCCESS);
+}
+
+/* A number for a field of a command: all of the argument, in its range */
+static bool parse_num(const char *str, unsigned long max, unsigned long *val)
+{
+ char *endptr = NULL;
+
+ *val = strtoul(str, &endptr, 0);
+ if (!endptr || endptr == str || *endptr != '\0' || *val > max) {
+ error("Invalid value %s (0-%lu)", str, max);
+ return false;
+ }
+
+ return true;
+}
+
+/* The data of a command: the octets of all the arguments which are left */
+static bool parse_data(int argc, char **argv, uint8_t *data, long size,
+ long *len)
+{
+ int i;
+
+ *len = 0;
+
+ for (i = 0; i < argc; i++) {
+ long n = size - *len;
+
+ if (!str2bytearray(argv[i], data + *len, &n))
+ return false;
+
+ *len += n;
+ }
+
+ return true;
+}
+
+static void cmd_pa_params(int argc, char **argv)
+{
+ struct mgmt_cp_add_periodic_adv_params cp;
+ unsigned long val[8];
+ uint16_t index;
+ int i;
+
+ if (argc != 4 && argc != 9) {
+ error("Either none or all five PAwR parameters");
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ /* The two intervals have 16 bits, the other parameters 8 */
+ for (i = 1; i < argc; i++) {
+ if (!parse_num(argv[i], i == 2 || i == 3 ? UINT16_MAX :
+ UINT8_MAX, &val[i - 1]))
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ memset(&cp, 0, sizeof(cp));
+ cp.instance = val[0];
+ cp.min_interval = cpu_to_le16(val[1]);
+ cp.max_interval = cpu_to_le16(val[2]);
+
+ if (argc > 4) {
+ cp.num_subevents = val[3];
+ cp.subevent_interval = val[4];
+ cp.response_slot_delay = val[5];
+ cp.response_slot_spacing = val[6];
+ cp.num_response_slots = val[7];
+ }
+
+ index = mgmt_index;
+ if (index == MGMT_INDEX_NONE)
+ index = 0;
+
+ if (mgmt_send(mgmt, MGMT_OP_ADD_PERIODIC_ADV_PARAMS, index,
+ sizeof(cp), &cp, pa_params_rsp, NULL, NULL) == 0) {
+ error("Unable to send Add Periodic Advertising Parameters");
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+}
+
+static void pa_data_rsp(uint8_t status, uint16_t len, const void *param,
+ void *user_data)
+{
+ const struct mgmt_rp_add_periodic_adv_data *rp = param;
+
+ if (status != 0) {
+ error("Add Periodic Advertising Data failed with status "
+ "0x%02x (%s)", status, mgmt_errstr(status));
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ if (len < sizeof(*rp)) {
+ error("Too small (%u bytes) reply", len);
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ print("Periodic advertising data set on instance %u", rp->instance);
+
+ bt_shell_noninteractive_quit(EXIT_SUCCESS);
+}
+
+static void cmd_pa_data(int argc, char **argv)
+{
+ uint8_t buf[sizeof(struct mgmt_cp_add_periodic_adv_data) + 252];
+ struct mgmt_cp_add_periodic_adv_data *cp = (void *) buf;
+ unsigned long instance;
+ long data_len;
+ uint16_t index;
+
+ memset(buf, 0, sizeof(buf));
+
+ if (!parse_num(argv[1], UINT8_MAX, &instance) ||
+ !parse_data(argc - 2, argv + 2, cp->data, 252,
+ &data_len))
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+
+ cp->instance = instance;
+ cp->data_len = data_len;
+
+ index = mgmt_index;
+ if (index == MGMT_INDEX_NONE)
+ index = 0;
+
+ if (mgmt_send(mgmt, MGMT_OP_ADD_PERIODIC_ADV_DATA, index,
+ sizeof(*cp) + data_len, cp, pa_data_rsp, NULL,
+ NULL) == 0) {
+ error("Unable to send Add Periodic Advertising Data");
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+}
+
+/*
+ * One command has room for 255 octets of parameters and for 15 subevents,
+ * like the HCI command the kernel makes of it.
+ */
+#define PAWR_CMD_SIZE 255
+#define PAWR_CMD_SUBEVENTS 15
+#define PAWR_DATA_SIZE (PAWR_CMD_SIZE - \
+ sizeof(struct mgmt_cp_set_pa_subevent_data) - \
+ sizeof(struct mgmt_pa_subevent_data))
+
+/* What pawr-serve answers the subevent data requests with */
+static struct {
+ uint8_t instance;
+ uint8_t num_subevents;
+ uint8_t num_response_slots;
+ bool has_data;
+ uint8_t data[PAWR_DATA_SIZE];
+ long data_len;
+ uint8_t counter;
+ unsigned int request_id;
+ unsigned int report_id;
+} pawr;
+
+static void pawr_data_rsp(uint8_t status, uint16_t len, const void *param,
+ void *user_data)
+{
+ if (status != 0)
+ error("Set Periodic Advertising Subevent Data failed with "
+ "status 0x%02x (%s)", status, mgmt_errstr(status));
+}
+
+/*
+ * Not mgmt_send(): it holds a command back until the one before it has its
+ * reply, and the commands which answer one request cannot wait that long.
+ */
+static void pawr_send_data(uint16_t index, const void *buf, size_t len)
+{
+ if (mgmt_send_nowait(mgmt, MGMT_OP_SET_PA_SUBEVENT_DATA, index, len,
+ buf, pawr_data_rsp, NULL, NULL) == 0)
+ error("Unable to send Set Periodic Advertising Subevent Data");
+}
+
+static void pawr_data_request(uint16_t index, uint16_t len, const void *param,
+ void *user_data)
+{
+ const struct mgmt_ev_pa_subevent_data_request *ev = param;
+ uint8_t buf[PAWR_CMD_SIZE];
+ struct mgmt_cp_set_pa_subevent_data *cp = (void *) buf;
+ size_t pos = sizeof(*cp);
+ uint8_t i;
+
+ if (len < sizeof(*ev)) {
+ error("Too small (%u bytes) pa_subevent_data_request event",
+ len);
+ return;
+ }
+
+ if (ev->instance != pawr.instance)
+ return;
+
+ print("hci%u pa_subevent_data_request: instance %u start %u count %u",
+ index, ev->instance, ev->subevent_start,
+ ev->subevent_data_count);
+
+ cp->instance = ev->instance;
+ cp->num_subevents = 0;
+
+ for (i = 0; i < ev->subevent_data_count; i++) {
+ struct mgmt_pa_subevent_data *subevent;
+ uint8_t data[sizeof(pawr.data)];
+ uint8_t data_len = pawr.data_len;
+ uint8_t nr = (ev->subevent_start + i) % pawr.num_subevents;
+
+ /* Without data from the command line: manufacturer data
+ * with the subevent and a counter.
+ */
+ if (pawr.has_data) {
+ memcpy(data, pawr.data, data_len);
+ } else {
+ data[0] = 0x05;
+ data[1] = 0xff;
+ data[2] = 0x59;
+ data[3] = 0x00;
+ data[4] = nr;
+ data[5] = pawr.counter++;
+ data_len = 6;
+ }
+
+ /* The command is full: send it and go on with a new one */
+ if (pos + sizeof(*subevent) + data_len > sizeof(buf) ||
+ cp->num_subevents == PAWR_CMD_SUBEVENTS) {
+ pawr_send_data(index, buf, pos);
+ pos = sizeof(*cp);
+ cp->num_subevents = 0;
+ }
+
+ subevent = (void *) (buf + pos);
+ subevent->subevent = nr;
+ subevent->response_slot_start = 0;
+ subevent->response_slot_count = pawr.num_response_slots;
+ subevent->data_len = data_len;
+ memcpy(subevent->data, data, data_len);
+
+ pos += sizeof(*subevent) + data_len;
+ cp->num_subevents++;
+ }
+
+ if (cp->num_subevents)
+ pawr_send_data(index, buf, pos);
+}
+
+static void pawr_response_report(uint16_t index, uint16_t len,
+ const void *param, void *user_data)
+{
+ const struct mgmt_ev_pa_response_report *ev = param;
+ const uint8_t *ptr;
+ uint8_t i;
+
+ if (len < sizeof(*ev)) {
+ error("Too small (%u bytes) pa_response_report event", len);
+ return;
+ }
+
+ if (ev->instance != pawr.instance)
+ return;
+
+ ptr = ev->responses;
+ len -= sizeof(*ev);
+
+ if (!ev->num_responses)
+ print("hci%u pa_response_report: instance %u subevent %u "
+ "tx_status %u, no responses", index, ev->instance,
+ ev->subevent, ev->tx_status);
+
+ for (i = 0; i < ev->num_responses; i++) {
+ const struct mgmt_pa_response *rsp = (const void *) ptr;
+ char str[2 * UINT8_MAX + 1];
+ uint8_t j;
+
+ if (len < sizeof(*rsp) || len < sizeof(*rsp) + rsp->data_len) {
+ error("Truncated pa_response_report event");
+ return;
+ }
+
+ for (j = 0; j < rsp->data_len; j++)
+ sprintf(str + 2 * j, "%02x", rsp->data[j]);
+ str[2 * rsp->data_len] = '\0';
+
+ print("hci%u pa_response_report: instance %u subevent %u "
+ "tx_status %u slot %u rssi %d status 0x%02x data %s",
+ index, ev->instance, ev->subevent, ev->tx_status,
+ rsp->response_slot, rsp->rssi, rsp->data_status, str);
+
+ ptr += sizeof(*rsp) + rsp->data_len;
+ len -= sizeof(*rsp) + rsp->data_len;
+ }
+}
+
+/* Runs until the shell is quit or another pawr-serve replaces it */
+static void cmd_pawr_serve(int argc, char **argv)
+{
+ unsigned long instance, num_subevents, num_response_slots;
+ uint8_t data[sizeof(pawr.data)];
+ long data_len;
+ uint16_t index;
+
+ if (!parse_num(argv[1], UINT8_MAX, &instance) ||
+ !parse_num(argv[2], 128, &num_subevents) ||
+ !parse_num(argv[3], UINT8_MAX, &num_response_slots) ||
+ !parse_data(argc - 4, argv + 4, data, sizeof(data),
+ &data_len))
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+
+ if (!num_subevents) {
+ error("Invalid number of subevents");
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ /* A second pawr-serve replaces the first */
+ if (pawr.request_id)
+ mgmt_unregister(mgmt, pawr.request_id);
+
+ if (pawr.report_id)
+ mgmt_unregister(mgmt, pawr.report_id);
+
+ memset(&pawr, 0, sizeof(pawr));
+ pawr.instance = instance;
+ pawr.num_subevents = num_subevents;
+ pawr.num_response_slots = num_response_slots;
+ pawr.has_data = argc > 4;
+ pawr.data_len = data_len;
+ memcpy(pawr.data, data, data_len);
+
+ index = mgmt_index;
+ if (index == MGMT_INDEX_NONE)
+ index = 0;
+
+ pawr.request_id = mgmt_register(mgmt, MGMT_EV_PA_SUBEVENT_DATA_REQUEST,
+ index, pawr_data_request, NULL, NULL);
+ pawr.report_id = mgmt_register(mgmt, MGMT_EV_PA_RESPONSE_REPORT, index,
+ pawr_response_report, NULL, NULL);
+ if (!pawr.request_id || !pawr.report_id) {
+ error("Unable to register for the PAwR events");
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ print("Serving subevent data of instance %u", pawr.instance);
+
+ /* The command stays running: a script goes on with its next line */
+ bt_shell_noninteractive_quit(-EINPROGRESS);
+}
+
/* Wrapper to get the index and opcode to the response callback */
struct command_data {
uint16_t id;
@@ -6355,6 +6716,20 @@ static const struct bt_shell_menu mgmt_menu = {
cmd_conn_subrate, "Load Connection Subrate" },
{ "hci-cmd", "<opcode> [event] [timeout] [param...]",
cmd_hci_cmd, "Send HCI Command and wait for Event" },
+ { "pa-params", "<instance> <min_interval> <max_interval> "
+ "[num_subevents] [subevent_interval] "
+ "[response_slot_delay] [response_slot_spacing] "
+ "[num_response_slots]",
+ cmd_pa_params,
+ "Add periodic advertising to an instance, with "
+ "responses if it has subevents" },
+ { "pa-data", "<instance> [data...]",
+ cmd_pa_data,
+ "Set the periodic advertising data of an instance" },
+ { "pawr-serve", "<instance> <num_subevents> "
+ "<num_response_slots> [data...]",
+ cmd_pawr_serve,
+ "Answer subevent data requests, print responses" },
{} },
};
diff --git a/doc/bluetoothctl-mgmt.rst b/doc/bluetoothctl-mgmt.rst
index 91406041c..730ee255a 100644
--- a/doc/bluetoothctl-mgmt.rst
+++ b/doc/bluetoothctl-mgmt.rst
@@ -1314,6 +1314,57 @@ Load Connection Subrate
:Example Load subrate for LE random address device:
| **> conn-subrate -t 2 AA:BB:CC:DD:EE:FF 16 1600 2 8 0 4 100**
+pa-params
+---------
+
+Add periodic advertising to an advertising instance. With the five optional
+parameters it is Periodic Advertising with Responses (PAwR).
+
+:Usage: **> pa-params <instance> <min_interval> <max_interval> [num_subevents]
+ [subevent_interval] [response_slot_delay] [response_slot_spacing]
+ [num_response_slots]**
+:<instance>: Advertising instance, added with add-ext-adv-params before
+:<min_interval>: Minimum periodic advertising interval (units of 1.25 ms)
+:<max_interval>: Maximum periodic advertising interval (units of 1.25 ms)
+:[num_subevents]: Number of subevents of a periodic advertising event
+:[subevent_interval]: Time between two subevents (units of 1.25 ms)
+:[response_slot_delay]: Time from the start of a subevent to its first
+ response slot (units of 1.25 ms)
+:[response_slot_spacing]: Time between two response slots (units of 0.125 ms)
+:[num_response_slots]: Number of response slots of a subevent
+:Example Add periodic advertising with an interval of 100 ms to instance 1:
+ | **> pa-params 1 80 80**
+:Example Add PAwR with 5 subevents of 60 ms and 5 response slots of 10 ms:
+ | **> pa-params 1 255 255 5 48 8 80 5**
+
+pa-data
+-------
+
+Set the periodic advertising data of an advertising instance.
+
+:Usage: **> pa-data <instance> [data...]**
+:<instance>: Advertising instance with periodic advertising
+:[data...]: Octets of the data, none for no data
+:Example Set a manufacturer specific AD structure as data of instance 1:
+ | **> pa-data 1 0x05 0xff 0x59 0x00 0x01 0x02**
+
+pawr-serve
+----------
+
+Answer the subevent data requests of an advertising instance with PAwR, and
+print the responses which are received. It runs until the shell is quit, or
+until another pawr-serve replaces it.
+
+:Usage: **> pawr-serve <instance> <num_subevents> <num_response_slots>
+ [data...]**
+:<instance>: Advertising instance with PAwR
+:<num_subevents>: Number of subevents of the instance (1 to 128)
+:<num_response_slots>: Number of response slots to listen to in a subevent
+:[data...]: Octets of the data of every subevent (up to 249). Without it, a
+ manufacturer specific AD structure with the subevent and a counter
+:Example Serve instance 1 with 5 subevents and 5 response slots:
+ | **> pawr-serve 1 5 5**
+
RESOURCES
=========
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 07/12] monitor: Add PAwR HCI definitions
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (5 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 06/12] client/mgmt: Add pa-params, pa-data and pawr-serve commands Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 08/12] emulator/btdev: Check the length of PA commands Roland Schober
` (4 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
Add the commands and events of Periodic Advertising with Responses to
bt.h, for the emulator. They are those of "monitor: Decode Periodic
Advertising with Responses", which adds the decoding.
Assisted-by: Claude:claude-fable-5-2
---
monitor/bt.h | 174 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 174 insertions(+)
diff --git a/monitor/bt.h b/monitor/bt.h
index 59bc90ccd..1231f3e84 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -3032,6 +3032,90 @@ struct bt_hci_rsp_le_read_iso_link_quality {
uint32_t duplicated_packets;
} __packed;
+#define BT_HCI_CMD_LE_SET_PA_SUBEVENT_DATA 0x2082
+#define BT_HCI_BIT_LE_SET_PA_SUBEVENT_DATA BT_HCI_CMD_BIT(46, 5)
+struct bt_hci_le_pa_subevent_data {
+ uint8_t subevent;
+ uint8_t response_slot_start;
+ uint8_t response_slot_count;
+ uint8_t data_len;
+ uint8_t data[];
+} __packed;
+
+struct bt_hci_cmd_le_set_pa_subevent_data {
+ uint8_t handle;
+ uint8_t num_subevents;
+ struct bt_hci_le_pa_subevent_data subevents[];
+} __packed;
+
+struct bt_hci_rsp_le_set_pa_subevent_data {
+ uint8_t status;
+ uint8_t handle;
+} __packed;
+
+#define BT_HCI_CMD_LE_SET_PA_RESPONSE_DATA 0x2083
+#define BT_HCI_BIT_LE_SET_PA_RESPONSE_DATA BT_HCI_CMD_BIT(46, 6)
+struct bt_hci_cmd_le_set_pa_response_data {
+ uint16_t sync_handle;
+ uint16_t request_event;
+ uint8_t request_subevent;
+ uint8_t response_subevent;
+ uint8_t response_slot;
+ uint8_t data_len;
+ uint8_t data[];
+} __packed;
+
+struct bt_hci_rsp_le_set_pa_response_data {
+ uint8_t status;
+ uint16_t sync_handle;
+} __packed;
+
+#define BT_HCI_CMD_LE_SET_PA_SYNC_SUBEVENT 0x2084
+#define BT_HCI_BIT_LE_SET_PA_SYNC_SUBEVENT BT_HCI_CMD_BIT(46, 7)
+struct bt_hci_cmd_le_set_pa_sync_subevent {
+ uint16_t sync_handle;
+ uint16_t properties;
+ uint8_t num_subevents;
+ uint8_t subevents[];
+} __packed;
+
+struct bt_hci_rsp_le_set_pa_sync_subevent {
+ uint8_t status;
+ uint16_t sync_handle;
+} __packed;
+
+#define BT_HCI_CMD_LE_EXT_CREATE_CONN_V2 0x2085
+#define BT_HCI_BIT_LE_EXT_CREATE_CONN_V2 BT_HCI_CMD_BIT(47, 0)
+struct bt_hci_cmd_le_ext_create_conn_v2 {
+ uint8_t adv_handle;
+ uint8_t subevent;
+ uint8_t filter_policy;
+ uint8_t own_addr_type;
+ uint8_t peer_addr_type;
+ uint8_t peer_addr[6];
+ uint8_t phys;
+ uint8_t data[];
+} __packed;
+
+#define BT_HCI_CMD_LE_SET_PA_PARAMS_V2 0x2086
+#define BT_HCI_BIT_LE_SET_PA_PARAMS_V2 BT_HCI_CMD_BIT(47, 1)
+struct bt_hci_cmd_le_set_pa_params_v2 {
+ uint8_t handle;
+ uint16_t min_interval;
+ uint16_t max_interval;
+ uint16_t properties;
+ uint8_t num_subevents;
+ uint8_t subevent_interval;
+ uint8_t response_slot_delay;
+ uint8_t response_slot_spacing;
+ uint8_t num_response_slots;
+} __packed;
+
+struct bt_hci_rsp_le_set_pa_params_v2 {
+ uint8_t status;
+ uint8_t handle;
+} __packed;
+
#define BT_HCI_CMD_LE_READ_ALL_LOCAL_FEATURES 0x2087
#define BT_HCI_BIT_LE_READ_ALL_LOCAL_FEATURES BT_HCI_CMD_BIT(47, 2)
struct bt_hci_rsp_le_read_all_local_features {
@@ -4373,6 +4457,96 @@ struct bt_hci_evt_le_big_info_adv_report {
uint8_t encryption;
} __packed;
+#define BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED_V2 0x24
+struct bt_hci_evt_le_per_sync_established_v2 {
+ uint8_t status;
+ uint16_t handle;
+ uint8_t sid;
+ uint8_t addr_type;
+ uint8_t addr[6];
+ uint8_t phy;
+ uint16_t interval;
+ uint8_t clock_accuracy;
+ uint8_t num_subevents;
+ uint8_t subevent_interval;
+ uint8_t response_slot_delay;
+ uint8_t response_slot_spacing;
+} __packed;
+
+#define BT_HCI_EVT_LE_PA_REPORT_V2 0x25
+struct bt_hci_le_pa_report_v2 {
+ uint16_t handle;
+ uint8_t tx_power;
+ int8_t rssi;
+ uint8_t cte_type;
+ uint16_t event_counter;
+ uint8_t subevent;
+ uint8_t data_status;
+ uint8_t data_len;
+ uint8_t data[];
+} __packed;
+
+#define BT_HCI_EVT_LE_PAST_RECEIVED_V2 0x26
+struct bt_hci_evt_le_past_recv_v2 {
+ uint8_t status;
+ uint16_t handle;
+ uint16_t service_data;
+ uint16_t sync_handle;
+ uint8_t sid;
+ uint8_t addr_type;
+ uint8_t addr[6];
+ uint8_t phy;
+ uint16_t interval;
+ uint8_t clock_accuracy;
+ uint8_t num_subevents;
+ uint8_t subevent_interval;
+ uint8_t response_slot_delay;
+ uint8_t response_slot_spacing;
+} __packed;
+
+#define BT_HCI_EVT_LE_PA_SUBEVENT_DATA_REQUEST 0x27
+struct bt_hci_evt_le_pa_subevent_data_request {
+ uint8_t handle;
+ uint8_t subevent_start;
+ uint8_t subevent_data_count;
+} __packed;
+
+#define BT_HCI_EVT_LE_PA_RESPONSE_REPORT 0x28
+struct bt_hci_le_pa_response {
+ int8_t tx_power;
+ int8_t rssi;
+ uint8_t cte_type;
+ uint8_t response_slot;
+ uint8_t data_status;
+ uint8_t data_len;
+ uint8_t data[];
+} __packed;
+
+struct bt_hci_evt_le_pa_response_report {
+ uint8_t handle;
+ uint8_t subevent;
+ uint8_t tx_status;
+ uint8_t num_responses;
+ struct bt_hci_le_pa_response responses[];
+} __packed;
+
+#define BT_HCI_EVT_LE_ENHANCED_CONN_COMPLETE_V2 0x29
+struct bt_hci_evt_le_enhanced_conn_complete_v2 {
+ uint8_t status;
+ uint16_t handle;
+ uint8_t role;
+ uint8_t peer_addr_type;
+ uint8_t peer_addr[6];
+ uint8_t local_rpa[6];
+ uint8_t peer_rpa[6];
+ uint16_t interval;
+ uint16_t latency;
+ uint16_t supv_timeout;
+ uint8_t clock_accuracy;
+ uint8_t adv_handle;
+ uint16_t sync_handle;
+} __packed;
+
#define BT_HCI_EVT_LE_READ_ALL_REMOTE_FEATURES_COMPLETE 0x2B
struct bt_hci_evt_le_read_all_remote_features_complete {
uint8_t status;
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 08/12] emulator/btdev: Check the length of PA commands
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (6 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 07/12] monitor: Add PAwR HCI definitions Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 09/12] emulator/btdev: Keep the advertising set after a timeout Roland Schober
` (3 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
btdev hands a command of any length to its handler. The handlers of
LE Set Periodic Advertising Parameters, Data and Enable and of LE
Remove Advertising Set read their parameters without a look at the
length: a command which is too short makes them read beyond the
packet, and LE Set Periodic Advertising Data copies as many octets as
its length field says, whatever the command holds.
Answer a command of the wrong length with Invalid HCI Command
Parameters. The following patches add to these handlers.
Assisted-by: Claude:claude-fable-5-2
---
emulator/btdev.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/emulator/btdev.c b/emulator/btdev.c
index 7c6307180..3987972ac 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -5977,6 +5977,9 @@ static int cmd_remove_adv_set(struct btdev *dev, const void *data,
struct le_ext_adv *ext_adv;
uint8_t status = BT_HCI_ERR_SUCCESS;
+ if (len != sizeof(*cmd))
+ return -EINVAL;
+
ext_adv = queue_find(dev->le_ext_adv, match_ext_adv_handle,
UINT_TO_PTR(cmd->handle));
if (!ext_adv) {
@@ -6034,6 +6037,9 @@ static int cmd_set_pa_params(struct btdev *dev, const void *data,
const struct bt_hci_cmd_le_set_pa_params *cmd = data;
uint8_t status;
+ if (len != sizeof(*cmd))
+ return -EINVAL;
+
if (dev->le_pa_enable) {
status = BT_HCI_ERR_COMMAND_DISALLOWED;
} else {
@@ -6053,7 +6059,12 @@ static int cmd_set_pa_data(struct btdev *dev, const void *data,
{
const struct bt_hci_cmd_le_set_pa_data *cmd = data;
uint8_t status = BT_HCI_ERR_SUCCESS;
- uint8_t data_len = cmd->data_len;
+ uint8_t data_len;
+
+ if (len < sizeof(*cmd) || cmd->data_len != len - sizeof(*cmd))
+ return -EINVAL;
+
+ data_len = cmd->data_len;
if (data_len > MAX_PA_DATA_LEN)
data_len = MAX_PA_DATA_LEN;
@@ -6267,6 +6278,9 @@ static int cmd_set_pa_enable(struct btdev *dev, const void *data, uint8_t len)
uint8_t status;
int i;
+ if (len != sizeof(*cmd))
+ return -EINVAL;
+
if (dev->le_pa_enable == cmd->enable) {
status = BT_HCI_ERR_COMMAND_DISALLOWED;
} else {
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 09/12] emulator/btdev: Keep the advertising set after a timeout
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (7 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 08/12] emulator/btdev: Check the length of PA commands Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 10/12] emulator/btdev: Keep advertising sets with PA enabled Roland Schober
` (2 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
When the duration of LE Set Extended Advertising Enable ends, the
emulator sends LE Advertising Set Terminated and frees the advertising
set. A controller only stops advertising: the set stays until the host
removes it, and periodic advertising on the set goes on.
Disable the set instead, as commit 558c44cda02c ("btdev: Fix removing
advertising set if it was terminated") did for a set which is
terminated by a connection.
Assisted-by: Claude:claude-fable-5-2
---
emulator/btdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emulator/btdev.c b/emulator/btdev.c
index 3987972ac..fc5cfb1ba 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -5833,7 +5833,8 @@ static bool ext_adv_timeout(void *user_data)
adv->timeout_id = 0;
adv_set_terminate(adv->dev, BT_HCI_ERR_ADV_TIMEOUT, adv->handle,
0x0000, 0x00);
- le_ext_adv_free(adv);
+ /* Only the advertising ends, the set stays */
+ ext_adv_disable(adv, NULL);
return false;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 10/12] emulator/btdev: Keep advertising sets with PA enabled
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (8 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 09/12] emulator/btdev: Keep the advertising set after a timeout Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 11/12] emulator/btdev: Add PAwR advertiser Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 12/12] mgmt-tester: Add periodic advertising and PAwR tests Roland Schober
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
LE Remove Advertising Set and LE Clear Advertising Sets are answered
with Command Disallowed while periodic advertising is enabled on the
set, as the specification says.
The set is the one named in LE Set Periodic Advertising Parameters.
LE Set Periodic Advertising Enable took any handle so far: it is now
answered with Unknown Advertising Identifier for a set which does not
exist, and with Command Disallowed for a set other than the one with
the parameters.
Assisted-by: Claude:claude-fable-5-2
---
emulator/btdev.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/emulator/btdev.c b/emulator/btdev.c
index fc5cfb1ba..5ea22acbf 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -268,6 +268,7 @@ struct btdev {
uint16_t le_pa_max_interval;
uint8_t le_pa_data_len;
uint8_t le_pa_data[MAX_PA_DATA_LEN];
+ uint8_t le_pa_handle;
uint8_t le_ltk[16];
uint8_t hdt_def_mic_len;
uint8_t hdt_def_format;
@@ -5990,7 +5991,8 @@ static int cmd_remove_adv_set(struct btdev *dev, const void *data,
return 0;
}
- if (ext_adv->enable) {
+ if (ext_adv->enable || (dev->le_pa_enable &&
+ dev->le_pa_handle == cmd->handle)) {
status = BT_HCI_ERR_COMMAND_DISALLOWED;
cmd_complete(dev, BT_HCI_CMD_LE_REMOVE_ADV_SET, &status,
sizeof(status));
@@ -6012,6 +6014,13 @@ static int cmd_clear_adv_sets(struct btdev *dev, const void *data,
const struct queue_entry *entry;
uint8_t status = BT_HCI_ERR_SUCCESS;
+ if (dev->le_pa_enable) {
+ status = BT_HCI_ERR_COMMAND_DISALLOWED;
+ cmd_complete(dev, BT_HCI_CMD_LE_CLEAR_ADV_SETS, &status,
+ sizeof(status));
+ return 0;
+ }
+
for (entry = queue_get_entries(dev->le_ext_adv); entry;
entry = entry->next) {
struct le_ext_adv *ext_adv = entry->data;
@@ -6048,6 +6057,7 @@ static int cmd_set_pa_params(struct btdev *dev, const void *data,
dev->le_pa_properties = le16_to_cpu(cmd->properties);
dev->le_pa_min_interval = cmd->min_interval;
dev->le_pa_max_interval = cmd->max_interval;
+ dev->le_pa_handle = cmd->handle;
}
cmd_complete(dev, BT_HCI_CMD_LE_SET_PA_PARAMS, &status,
@@ -6282,7 +6292,12 @@ static int cmd_set_pa_enable(struct btdev *dev, const void *data, uint8_t len)
if (len != sizeof(*cmd))
return -EINVAL;
- if (dev->le_pa_enable == cmd->enable) {
+ if (!queue_find(dev->le_ext_adv, match_ext_adv_handle,
+ UINT_TO_PTR(cmd->handle))) {
+ status = BT_HCI_ERR_UNKNOWN_ADVERTISING_ID;
+ } else if (cmd->handle != dev->le_pa_handle ||
+ dev->le_pa_enable == cmd->enable) {
+ /* There is one train, on the set which has the parameters */
status = BT_HCI_ERR_COMMAND_DISALLOWED;
} else {
dev->le_pa_enable = cmd->enable;
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 11/12] emulator/btdev: Add PAwR advertiser
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (9 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 10/12] emulator/btdev: Keep advertising sets with PA enabled Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 12/12] mgmt-tester: Add periodic advertising and PAwR tests Roland Schober
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
Add the advertiser side of Periodic Advertising with Responses to
controllers of version 6.0 and later:
- the PAwR Advertiser feature;
- LE Set Periodic Advertising Parameters [v2], which checks the
subevent parameters against each other and against the interval;
- LE Periodic Advertising Subevent Data Request, sent once per
periodic advertising interval for all subevents while the train is
enabled;
- LE Set Periodic Advertising Subevent Data, which takes the data of
a subevent once per request. Data which was not asked for is
refused with Command Disallowed: before the first request, a second
time for one subevent, and for a subevent the train does not have.
LE Set Periodic Advertising Data is refused for a set with subevents.
Nothing is transmitted and no responses are reported, so the command
never answers Too Late or Too Early.
Assisted-by: Claude:claude-fable-5-2
---
emulator/btdev.c | 299 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 298 insertions(+), 1 deletion(-)
diff --git a/emulator/btdev.c b/emulator/btdev.c
index 5ea22acbf..31fee28b0 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -269,6 +269,11 @@ struct btdev {
uint8_t le_pa_data_len;
uint8_t le_pa_data[MAX_PA_DATA_LEN];
uint8_t le_pa_handle;
+ uint8_t le_pa_num_subevents;
+ uint8_t le_pa_num_rsp_slots;
+ bool le_pa_data_requested;
+ uint8_t le_pa_subevents[16]; /* Subevents which wait for data */
+ unsigned int le_pa_subevent_id;
uint8_t le_ltk[16];
uint8_t hdt_def_mic_len;
uint8_t hdt_def_format;
@@ -696,6 +701,11 @@ static void btdev_reset(struct btdev *btdev)
btdev->inquiry_id = 0;
}
+ if (btdev->le_pa_subevent_id > 0) {
+ timeout_remove(btdev->le_pa_subevent_id);
+ btdev->le_pa_subevent_id = 0;
+ }
+
queue_remove_all(btdev->conns, NULL, NULL, conn_remove);
queue_remove_all(btdev->le_ext_adv, NULL, NULL, le_ext_adv_free);
queue_remove_all(btdev->le_per_adv, NULL, NULL, free);
@@ -6002,6 +6012,10 @@ static int cmd_remove_adv_set(struct btdev *dev, const void *data,
queue_remove(dev->le_ext_adv, ext_adv);
free(ext_adv);
+ /* The subevents go with their set */
+ if (dev->le_pa_handle == cmd->handle)
+ dev->le_pa_num_subevents = 0;
+
cmd_complete(dev, BT_HCI_CMD_LE_REMOVE_ADV_SET, &status,
sizeof(status));
@@ -6034,6 +6048,7 @@ static int cmd_clear_adv_sets(struct btdev *dev, const void *data,
}
queue_remove_all(dev->le_ext_adv, NULL, NULL, le_ext_adv_free);
+ dev->le_pa_num_subevents = 0;
cmd_complete(dev, BT_HCI_CMD_LE_CLEAR_ADV_SETS, &status,
sizeof(status));
@@ -6058,6 +6073,7 @@ static int cmd_set_pa_params(struct btdev *dev, const void *data,
dev->le_pa_min_interval = cmd->min_interval;
dev->le_pa_max_interval = cmd->max_interval;
dev->le_pa_handle = cmd->handle;
+ dev->le_pa_num_subevents = 0;
}
cmd_complete(dev, BT_HCI_CMD_LE_SET_PA_PARAMS, &status,
@@ -6065,6 +6081,244 @@ static int cmd_set_pa_params(struct btdev *dev, const void *data,
return 0;
}
+/*
+ * The intervals and the response slot delay are in units of 1.25 ms, the
+ * response slot spacing in units of 0.125 ms.
+ */
+static bool pa_params_v2_valid(const struct bt_hci_cmd_le_set_pa_params_v2 *cmd)
+{
+ uint16_t min_interval = le16_to_cpu(cmd->min_interval);
+ uint16_t max_interval = le16_to_cpu(cmd->max_interval);
+ uint16_t subevent_interval = cmd->subevent_interval;
+
+ if (min_interval < 0x0006 || min_interval > max_interval ||
+ cmd->num_subevents > 0x80)
+ return false;
+
+ /* Without subevents the other parameters are ignored */
+ if (!cmd->num_subevents)
+ return true;
+
+ /* With a single subevent the response slots are checked against
+ * Periodic_Advertising_Interval_Max in place of Subevent_Interval,
+ * whichever interval the controller selects (Core Specification,
+ * Vol 4, Part E, 7.8.61). Nothing is sent in the slots here.
+ */
+ if (cmd->num_subevents == 1)
+ subevent_interval = max_interval;
+ else if (subevent_interval < 0x06 ||
+ cmd->num_subevents * subevent_interval > min_interval)
+ return false;
+
+ if (!cmd->num_response_slots)
+ return true;
+
+ /* The response slots follow the packet and end with the subevent */
+ if (!cmd->response_slot_delay ||
+ cmd->response_slot_delay >= subevent_interval)
+ return false;
+
+ if (cmd->num_response_slots > 1 &&
+ (cmd->response_slot_spacing < 0x02 ||
+ cmd->response_slot_spacing * cmd->num_response_slots >
+ 10 * (subevent_interval - cmd->response_slot_delay)))
+ return false;
+
+ return true;
+}
+
+static int cmd_set_pa_params_v2(struct btdev *dev, const void *data,
+ uint8_t len)
+{
+ const struct bt_hci_cmd_le_set_pa_params_v2 *cmd = data;
+ struct bt_hci_rsp_le_set_pa_params_v2 rsp;
+
+ if (len != sizeof(*cmd))
+ return -EINVAL;
+
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.handle = cmd->handle;
+
+ if (!queue_find(dev->le_ext_adv, match_ext_adv_handle,
+ UINT_TO_PTR(cmd->handle))) {
+ rsp.status = BT_HCI_ERR_UNKNOWN_ADVERTISING_ID;
+ goto done;
+ }
+
+ if (dev->le_pa_enable) {
+ rsp.status = BT_HCI_ERR_COMMAND_DISALLOWED;
+ goto done;
+ }
+
+ if (!pa_params_v2_valid(cmd)) {
+ rsp.status = BT_HCI_ERR_INVALID_PARAMETERS;
+ goto done;
+ }
+
+ dev->le_pa_properties = le16_to_cpu(cmd->properties);
+ dev->le_pa_min_interval = cmd->min_interval;
+ dev->le_pa_max_interval = cmd->max_interval;
+ dev->le_pa_handle = cmd->handle;
+ dev->le_pa_num_subevents = cmd->num_subevents;
+ dev->le_pa_num_rsp_slots = cmd->num_response_slots;
+
+done:
+ cmd_complete(dev, BT_HCI_CMD_LE_SET_PA_PARAMS_V2, &rsp, sizeof(rsp));
+
+ return 0;
+}
+
+static int cmd_set_pa_subevent_data(struct btdev *dev, const void *data,
+ uint8_t len)
+{
+ struct iovec iov = { .iov_base = (void *) data, .iov_len = len };
+ const struct bt_hci_cmd_le_set_pa_subevent_data *cmd;
+ const struct bt_hci_le_pa_subevent_data *se;
+ struct bt_hci_rsp_le_set_pa_subevent_data rsp;
+ uint8_t seen[sizeof(dev->le_pa_subevents)] = {};
+ uint8_t i;
+
+ memset(&rsp, 0, sizeof(rsp));
+
+ cmd = util_iov_pull_mem(&iov, sizeof(*cmd));
+ if (!cmd)
+ return -EINVAL;
+
+ rsp.handle = cmd->handle;
+
+ if (!queue_find(dev->le_ext_adv, match_ext_adv_handle,
+ UINT_TO_PTR(cmd->handle))) {
+ rsp.status = BT_HCI_ERR_UNKNOWN_ADVERTISING_ID;
+ goto done;
+ }
+
+ /* Only a running train with subevents asks for data */
+ if (!dev->le_pa_enable || dev->le_pa_handle != cmd->handle ||
+ !dev->le_pa_num_subevents) {
+ rsp.status = BT_HCI_ERR_COMMAND_DISALLOWED;
+ goto done;
+ }
+
+ if (!cmd->num_subevents || cmd->num_subevents > 0x0f) {
+ rsp.status = BT_HCI_ERR_INVALID_PARAMETERS;
+ goto done;
+ }
+
+ for (i = 0; i < cmd->num_subevents; i++) {
+ se = util_iov_pull_mem(&iov, sizeof(*se));
+ if (!se || !util_iov_pull(&iov, se->data_len)) {
+ rsp.status = BT_HCI_ERR_INVALID_PARAMETERS;
+ goto done;
+ }
+
+ /* Outside of the subevents which are asked for */
+ if (se->subevent >= dev->le_pa_num_subevents) {
+ rsp.status = BT_HCI_ERR_COMMAND_DISALLOWED;
+ goto done;
+ }
+
+ if (se->response_slot_start + se->response_slot_count >
+ dev->le_pa_num_rsp_slots) {
+ rsp.status = BT_HCI_ERR_INVALID_PARAMETERS;
+ goto done;
+ }
+
+ /* A subevent is named once */
+ if (seen[se->subevent / 8] & BIT(se->subevent % 8)) {
+ rsp.status = BT_HCI_ERR_INVALID_PARAMETERS;
+ goto done;
+ }
+
+ seen[se->subevent / 8] |= BIT(se->subevent % 8);
+ }
+
+ if (iov.iov_len) {
+ rsp.status = BT_HCI_ERR_INVALID_PARAMETERS;
+ goto done;
+ }
+
+ /* Data is taken once for each subevent asked for: not before the
+ * first request, and not a second time in one periodic advertising
+ * event.
+ */
+ iov.iov_base = (void *) cmd->subevents;
+ iov.iov_len = len - sizeof(*cmd);
+
+ for (i = 0; i < cmd->num_subevents; i++) {
+ se = util_iov_pull_mem(&iov, sizeof(*se));
+ util_iov_pull(&iov, se->data_len);
+
+ if (!dev->le_pa_data_requested ||
+ !(dev->le_pa_subevents[se->subevent / 8] &
+ BIT(se->subevent % 8))) {
+ rsp.status = BT_HCI_ERR_COMMAND_DISALLOWED;
+ goto done;
+ }
+ }
+
+ iov.iov_base = (void *) cmd->subevents;
+ iov.iov_len = len - sizeof(*cmd);
+
+ for (i = 0; i < cmd->num_subevents; i++) {
+ se = util_iov_pull_mem(&iov, sizeof(*se));
+ util_iov_pull(&iov, se->data_len);
+
+ dev->le_pa_subevents[se->subevent / 8] &=
+ ~BIT(se->subevent % 8);
+ }
+
+done:
+ cmd_complete(dev, BT_HCI_CMD_LE_SET_PA_SUBEVENT_DATA, &rsp,
+ sizeof(rsp));
+
+ return 0;
+}
+
+/* Ask the host for the data of all subevents, once per periodic advertising
+ * interval. A subevent which got no data in the last interval is asked for
+ * again like the others: no data is too late here.
+ */
+static bool pa_subevent_data_request(void *user_data)
+{
+ struct btdev *dev = user_data;
+ struct bt_hci_evt_le_pa_subevent_data_request ev;
+ uint8_t start = 0;
+
+ if (!dev->le_pa_enable || !dev->le_pa_num_subevents) {
+ dev->le_pa_subevent_id = 0;
+ return false;
+ }
+
+ /* LE Periodic Advertising Subevent Data Request event */
+ if (!(dev->le_event_mask[4] & 0x40))
+ return true;
+
+ /* Ask for no more than one command can answer, 15 subevents */
+ while (start < dev->le_pa_num_subevents) {
+ uint8_t count = dev->le_pa_num_subevents - start;
+ uint8_t i;
+
+ if (count > 0x0f)
+ count = 0x0f;
+
+ for (i = start; i < start + count; i++)
+ dev->le_pa_subevents[i / 8] |= BIT(i % 8);
+
+ dev->le_pa_data_requested = true;
+
+ ev.handle = dev->le_pa_handle;
+ ev.subevent_start = start;
+ ev.subevent_data_count = count;
+
+ le_meta_event(dev, BT_HCI_EVT_LE_PA_SUBEVENT_DATA_REQUEST,
+ &ev, sizeof(ev));
+
+ start += count;
+ }
+
+ return true;
+}
+
static int cmd_set_pa_data(struct btdev *dev, const void *data,
uint8_t len)
{
@@ -6077,6 +6331,14 @@ static int cmd_set_pa_data(struct btdev *dev, const void *data,
data_len = cmd->data_len;
+ /* A train with subevents carries its data in the subevents */
+ if (dev->le_pa_num_subevents && dev->le_pa_handle == cmd->handle) {
+ status = BT_HCI_ERR_COMMAND_DISALLOWED;
+ cmd_complete(dev, BT_HCI_CMD_LE_SET_PA_DATA, &status,
+ sizeof(status));
+ return 0;
+ }
+
if (data_len > MAX_PA_DATA_LEN)
data_len = MAX_PA_DATA_LEN;
@@ -6283,6 +6545,28 @@ static bool match_remote(const void *data, const void *match_data)
return pa->remote == remote;
}
+/* Start, or stop, asking the host for subevent data */
+static void pa_subevent_restart(struct btdev *dev)
+{
+ if (dev->le_pa_subevent_id > 0) {
+ timeout_remove(dev->le_pa_subevent_id);
+ dev->le_pa_subevent_id = 0;
+ }
+
+ dev->le_pa_data_requested = false;
+ memset(dev->le_pa_subevents, 0, sizeof(dev->le_pa_subevents));
+
+ if (dev->le_pa_enable && dev->le_pa_num_subevents) {
+ /* The interval is in units of 1.25 ms */
+ unsigned int msec = le16_to_cpu(dev->le_pa_min_interval) *
+ 5 / 4;
+
+ dev->le_pa_subevent_id = timeout_add(msec,
+ pa_subevent_data_request,
+ dev, NULL);
+ }
+}
+
static int cmd_set_pa_enable(struct btdev *dev, const void *data, uint8_t len)
{
const struct bt_hci_cmd_le_set_pa_enable *cmd = data;
@@ -6307,6 +6591,10 @@ static int cmd_set_pa_enable(struct btdev *dev, const void *data, uint8_t len)
cmd_complete(dev, BT_HCI_CMD_LE_SET_PA_ENABLE, &status,
sizeof(status));
+ /* A command which is refused leaves the train as it is */
+ if (status == BT_HCI_ERR_SUCCESS)
+ pa_subevent_restart(dev);
+
for (i = 0; i < MAX_BTDEV_ENTRIES; i++) {
struct btdev *remote = btdev_list[i];
@@ -8385,7 +8673,10 @@ done:
CMD(BT_HCI_CMD_LE_READ_ALL_REMOTE_FEATURES, \
cmd_le_read_all_remote_features, NULL), \
CMD(BT_HCI_CMD_LE_SET_HOST_FEATURE_V2, \
- cmd_set_host_feature_v2, NULL)
+ cmd_set_host_feature_v2, NULL), \
+ CMD(BT_HCI_CMD_LE_SET_PA_PARAMS_V2, cmd_set_pa_params_v2, NULL), \
+ CMD(BT_HCI_CMD_LE_SET_PA_SUBEVENT_DATA, cmd_set_pa_subevent_data, \
+ NULL)
static const struct btdev_cmd cmd_le_6_0[] = {
CMD_COMMON_ALL,
@@ -8405,6 +8696,8 @@ static void set_le_60_commands(struct btdev *btdev)
btdev->commands[47] |= BIT(2); /* LE Read All Local Features */
btdev->commands[47] |= BIT(3); /* LE Read All Remote Features */
btdev->commands[47] |= BIT(4); /* LE Set Host Feature V2 */
+ btdev->commands[46] |= BIT(5); /* LE Set PA Subevent Data */
+ btdev->commands[47] |= BIT(1); /* LE Set PA Parameters v2 */
btdev->cmds = cmd_le_6_0;
}
@@ -9182,6 +9475,7 @@ static void set_bredrle_features(struct btdev *btdev)
if (btdev->type >= BTDEV_TYPE_BREDRLE60) {
btdev->version = 0x0e;
+ btdev->le_features[5] |= BIT(3); /* PAwR Advertiser */
btdev->le_features[7] |= BIT(7); /* LL Extended Features */
}
@@ -9404,6 +9698,9 @@ void btdev_destroy(struct btdev *btdev)
if (btdev->inquiry_id > 0)
timeout_remove(btdev->inquiry_id);
+ if (btdev->le_pa_subevent_id > 0)
+ timeout_remove(btdev->le_pa_subevent_id);
+
bt_crypto_unref(btdev->crypto);
del_btdev(btdev);
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [RFC PATCH BlueZ v3 12/12] mgmt-tester: Add periodic advertising and PAwR tests
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
` (10 preceding siblings ...)
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 11/12] emulator/btdev: Add PAwR advertiser Roland Schober
@ 2026-12-03 22:15 ` Roland Schober
11 siblings, 0 replies; 15+ messages in thread
From: Roland Schober @ 2026-12-03 22:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Roland Schober
Add tests for Add Periodic Advertising Parameters, Add Periodic
Advertising Data, Set Periodic Advertising Subevent Data and the
Periodic Advertising Subevent Data Request event:
- the HCI commands sent for plain periodic advertising and for
Periodic Advertising with Responses, on a second instance as well;
- parameters and states which are refused, and controllers without
the features;
- Remove Advertising and Set Powered off with a train running, where
periodic advertising has to be disabled before the advertising set
is removed;
- an instance with a timeout and a train: when the advertising of the
set ends, the controller goes on with the train, so the kernel has
to disable it and remove the set;
- subevent data sent before the controller asked for it, in answer to
its request, in two commands at once, twice for one subevent and
for a subevent the train does not have.
Assisted-by: Claude:claude-fable-5-2
---
tools/mgmt-tester.c | 1119 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 1119 insertions(+)
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 18dbd3f89..25538e43e 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -8191,6 +8191,993 @@ static void setup_command_generic(const void *test_data)
}
}
+/* Periodic advertising and Periodic Advertising with Responses over MGMT */
+static const uint8_t pa_ext_adv_params[] = {
+ 0x01, /* instance */
+ 0x80, 0x00, 0x00, 0x00, /* flags: secondary channel LE 1M */
+ 0x00, 0x00, /* duration */
+ 0x00, 0x00, /* timeout */
+ 0x00, 0x00, 0x00, 0x00, /* min_interval */
+ 0x00, 0x00, 0x00, 0x00, /* max_interval */
+ 0x7f, /* tx_power */
+};
+
+static const uint8_t pa_ext_adv_params_2[] = {
+ 0x02, /* instance */
+ 0x80, 0x00, 0x00, 0x00, /* flags: secondary channel LE 1M */
+ 0x00, 0x00, /* duration */
+ 0x00, 0x00, /* timeout */
+ 0x00, 0x00, 0x00, 0x00, /* min_interval */
+ 0x00, 0x00, 0x00, 0x00, /* max_interval */
+ 0x7f, /* tx_power */
+};
+
+static const uint8_t pa_ext_adv_params_conn[] = {
+ 0x01, /* instance */
+ 0x81, 0x00, 0x00, 0x00, /* flags: connectable, LE 1M */
+ 0x00, 0x00, /* duration */
+ 0x00, 0x00, /* timeout */
+ 0x00, 0x00, 0x00, 0x00, /* min_interval */
+ 0x00, 0x00, 0x00, 0x00, /* max_interval */
+ 0x7f, /* tx_power */
+};
+
+static const uint8_t pa_ext_adv_params_legacy[] = {
+ 0x01, /* instance */
+ 0x00, 0x00, 0x00, 0x00, /* flags: none, legacy PDUs */
+ 0x00, 0x00, /* duration */
+ 0x00, 0x00, /* timeout */
+ 0x00, 0x00, 0x00, 0x00, /* min_interval */
+ 0x00, 0x00, 0x00, 0x00, /* max_interval */
+ 0x7f, /* tx_power */
+};
+
+static const uint8_t pa_ext_adv_data[] = {
+ 0x01, /* instance */
+ 0x04, /* Ad data len */
+ 0x00, /* Scan response data len */
+ 0x03, /* Section length */
+ 0x19, /* GAP Appearance */
+ 0x01,
+ 0x23,
+};
+
+static const uint8_t pa_ext_adv_data_2[] = {
+ 0x02, /* instance */
+ 0x04, /* Ad data len */
+ 0x00, /* Scan response data len */
+ 0x03, /* Section length */
+ 0x19, /* GAP Appearance */
+ 0x01,
+ 0x23,
+};
+
+static const uint8_t pa_instance_1[] = { 0x01 };
+static const uint8_t pa_instance_2[] = { 0x02 };
+static const uint8_t pa_instance_all[] = { 0x00 };
+
+static const uint8_t pa_params[] = {
+ 0x01, /* instance */
+ 0x50, 0x00, /* min_interval: 100 ms */
+ 0x50, 0x00, /* max_interval */
+ 0x00, /* num_subevents */
+ 0x00, /* subevent_interval */
+ 0x00, /* response_slot_delay */
+ 0x00, /* response_slot_spacing */
+ 0x00, /* num_response_slots */
+};
+
+static const uint8_t pa_params_2[] = {
+ 0x02, /* instance */
+ 0x50, 0x00, /* min_interval: 100 ms */
+ 0x50, 0x00, /* max_interval */
+ 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+static const uint8_t pa_params_short[] = {
+ 0x01, /* instance */
+ 0x05, 0x00, /* min_interval: below 7.5 ms */
+ 0x50, 0x00, /* max_interval */
+ 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+static const uint8_t pa_params_min_max[] = {
+ 0x01, /* instance */
+ 0x51, 0x00, /* min_interval: above the maximum */
+ 0x50, 0x00, /* max_interval */
+ 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+/* An interval which leaves time to answer a data request, also on a slow
+ * machine: the controller asks again with every interval.
+ */
+static const uint8_t pawr_params[] = {
+ 0x01, /* instance */
+ 0x40, 0x01, /* min_interval: 400 ms */
+ 0x40, 0x01, /* max_interval */
+ 0x05, /* num_subevents */
+ 0x06, /* subevent_interval: 7.5 ms */
+ 0x02, /* response_slot_delay: 2.5 ms */
+ 0x08, /* response_slot_spacing: 1 ms */
+ 0x05, /* num_response_slots */
+};
+
+/* The first data request comes after one interval: time to send data which
+ * was not asked for
+ */
+static const uint8_t pawr_params_slow[] = {
+ 0x01, /* instance */
+ 0x40, 0x06, /* min_interval: 2 s */
+ 0x40, 0x06, /* max_interval */
+ 0x05, /* num_subevents */
+ 0x06, /* subevent_interval: 7.5 ms */
+ 0x02, /* response_slot_delay: 2.5 ms */
+ 0x08, /* response_slot_spacing: 1 ms */
+ 0x05, /* num_response_slots */
+};
+
+/* The interval has room for the subevents: only their number is wrong */
+static const uint8_t pawr_params_subevents[] = {
+ 0x01, /* instance */
+ 0x00, 0x04, /* min_interval: 1.28 s */
+ 0x00, 0x04, /* max_interval */
+ 0x81, /* num_subevents: more than 128 */
+ 0x06, 0x02, 0x08, 0x05,
+};
+
+static const uint8_t hci_pa_params[] = {
+ 0x01, /* handle */
+ 0x50, 0x00, /* min_interval */
+ 0x50, 0x00, /* max_interval */
+ 0x00, 0x00, /* properties */
+};
+
+static const uint8_t hci_pa_params_2[] = {
+ 0x02, /* handle */
+ 0x50, 0x00, /* min_interval */
+ 0x50, 0x00, /* max_interval */
+ 0x00, 0x00, /* properties */
+};
+
+static const uint8_t hci_pa_params_v2[] = {
+ 0x01, /* handle */
+ 0x40, 0x01, /* min_interval */
+ 0x40, 0x01, /* max_interval */
+ 0x00, 0x00, /* properties */
+ 0x05, /* num_subevents */
+ 0x06, /* subevent_interval */
+ 0x02, /* response_slot_delay */
+ 0x08, /* response_slot_spacing */
+ 0x05, /* num_response_slots */
+};
+
+static const uint8_t hci_pa_enable[] = { 0x01, 0x01 };
+static const uint8_t hci_pa_enable_2[] = { 0x01, 0x02 };
+static const uint8_t hci_pa_disable[] = { 0x00, 0x01 };
+static const uint8_t hci_pa_remove_set[] = { 0x01 };
+
+static const uint8_t pa_data[] = {
+ 0x01, /* instance */
+ 0x04, /* data_len */
+ 0x03, 0xff, 0x59, 0x00, /* Manufacturer data */
+};
+
+static const uint8_t pa_data_len[] = {
+ 0x01, /* instance */
+ 0x05, /* data_len: one more than there is */
+ 0x03, 0xff, 0x59, 0x00,
+};
+
+static const uint8_t hci_pa_data[] = {
+ 0x01, /* handle */
+ 0x03, /* operation: complete */
+ 0x04, /* data_len */
+ 0x03, 0xff, 0x59, 0x00,
+};
+
+static const uint8_t pa_subevent_data_0[] = {
+ 0x01, /* instance */
+ 0x01, /* num_subevents */
+ 0x00, /* subevent */
+ 0x00, /* response_slot_start */
+ 0x05, /* response_slot_count */
+ 0x04, /* data_len */
+ 0x03, 0xff, 0x59, 0x00,
+};
+
+static const uint8_t pa_subevent_data_1[] = {
+ 0x01, /* instance */
+ 0x01, /* num_subevents */
+ 0x01, /* subevent */
+ 0x00, /* response_slot_start */
+ 0x05, /* response_slot_count */
+ 0x04, /* data_len */
+ 0x03, 0xff, 0x59, 0x01,
+};
+
+static const uint8_t pa_subevent_data_5[] = {
+ 0x01, /* instance */
+ 0x01, /* num_subevents */
+ 0x05, /* subevent */
+ 0x00, /* response_slot_start */
+ 0x05, /* response_slot_count */
+ 0x04, /* data_len */
+ 0x03, 0xff, 0x59, 0x05,
+};
+
+static const uint8_t hci_pa_subevent_data_0[] = {
+ 0x01, /* handle */
+ 0x01, /* num_subevents */
+ 0x00, /* subevent */
+ 0x00, /* response_slot_start */
+ 0x05, /* response_slot_count */
+ 0x04, /* data_len */
+ 0x03, 0xff, 0x59, 0x00,
+};
+
+static const uint8_t pa_subevent_data_none[] = {
+ 0x01, /* instance */
+ 0x00, /* num_subevents */
+};
+
+static const uint8_t pa_subevent_data_short[] = {
+ 0x01, /* instance */
+ 0x01, /* num_subevents */
+ 0x00, 0x00, 0x05,
+ 0x05, /* data_len: one more than there is */
+ 0x03, 0xff, 0x59, 0x00,
+};
+
+static const uint8_t pa_subevent_data_long[] = {
+ 0x01, /* instance */
+ 0x01, /* num_subevents */
+ 0x00, 0x00, 0x05,
+ 0x04, /* data_len */
+ 0x03, 0xff, 0x59, 0x00,
+ 0x00, /* an octet after the last entry */
+};
+
+static const struct setup_mgmt_cmd pa_setup_instance[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params,
+ .send_len = sizeof(pa_ext_adv_params),
+ },
+};
+
+static const struct setup_mgmt_cmd pa_setup_instance_conn[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params_conn,
+ .send_len = sizeof(pa_ext_adv_params_conn),
+ },
+};
+
+static const struct setup_mgmt_cmd pa_setup_instance_legacy[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params_legacy,
+ .send_len = sizeof(pa_ext_adv_params_legacy),
+ },
+};
+
+static const struct setup_mgmt_cmd pa_setup_instances[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params,
+ .send_len = sizeof(pa_ext_adv_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params_2,
+ .send_len = sizeof(pa_ext_adv_params_2),
+ },
+};
+
+static const struct setup_mgmt_cmd pa_setup_periodic[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params,
+ .send_len = sizeof(pa_ext_adv_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params,
+ .send_len = sizeof(pa_params),
+ },
+};
+
+static const struct setup_mgmt_cmd pa_setup_train[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params,
+ .send_len = sizeof(pa_ext_adv_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params,
+ .send_len = sizeof(pa_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_DATA,
+ .send_param = pa_ext_adv_data,
+ .send_len = sizeof(pa_ext_adv_data),
+ },
+};
+
+/* Instance 1 advertises, instance 2 has the periodic advertising train */
+static const struct setup_mgmt_cmd pa_setup_trains[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params,
+ .send_len = sizeof(pa_ext_adv_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_DATA,
+ .send_param = pa_ext_adv_data,
+ .send_len = sizeof(pa_ext_adv_data),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params_2,
+ .send_len = sizeof(pa_ext_adv_params_2),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params_2,
+ .send_len = sizeof(pa_params_2),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_DATA,
+ .send_param = pa_ext_adv_data_2,
+ .send_len = sizeof(pa_ext_adv_data_2),
+ },
+};
+
+static const struct setup_mgmt_cmd pawr_setup_periodic[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params,
+ .send_len = sizeof(pa_ext_adv_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pawr_params,
+ .send_len = sizeof(pawr_params),
+ },
+};
+
+static const struct setup_mgmt_cmd pawr_setup_train[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params,
+ .send_len = sizeof(pa_ext_adv_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pawr_params,
+ .send_len = sizeof(pawr_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_DATA,
+ .send_param = pa_ext_adv_data,
+ .send_len = sizeof(pa_ext_adv_data),
+ },
+};
+
+static const struct setup_mgmt_cmd pawr_setup_train_slow[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params,
+ .send_len = sizeof(pa_ext_adv_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pawr_params_slow,
+ .send_len = sizeof(pawr_params_slow),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_DATA,
+ .send_param = pa_ext_adv_data,
+ .send_len = sizeof(pa_ext_adv_data),
+ },
+};
+
+static const struct hci_cmd_data pa_params_hci_cmds[] = {
+ {
+ .opcode = BT_HCI_CMD_LE_SET_PA_PARAMS,
+ .len = sizeof(hci_pa_params),
+ .param = hci_pa_params,
+ },
+ {
+ .opcode = BT_HCI_CMD_LE_SET_PA_ENABLE,
+ .len = sizeof(hci_pa_enable),
+ .param = hci_pa_enable,
+ },
+ {},
+};
+
+static const struct hci_cmd_data pa_params_2_hci_cmds[] = {
+ {
+ .opcode = BT_HCI_CMD_LE_SET_PA_PARAMS,
+ .len = sizeof(hci_pa_params_2),
+ .param = hci_pa_params_2,
+ },
+ {
+ .opcode = BT_HCI_CMD_LE_SET_PA_ENABLE,
+ .len = sizeof(hci_pa_enable_2),
+ .param = hci_pa_enable_2,
+ },
+ {},
+};
+
+static const struct hci_cmd_data pawr_params_hci_cmds[] = {
+ {
+ .opcode = BT_HCI_CMD_LE_SET_PA_PARAMS_V2,
+ .len = sizeof(hci_pa_params_v2),
+ .param = hci_pa_params_v2,
+ },
+ {
+ .opcode = BT_HCI_CMD_LE_SET_PA_ENABLE,
+ .len = sizeof(hci_pa_enable),
+ .param = hci_pa_enable,
+ },
+ {},
+};
+
+/* Both commands have to be sent. Their order is not checked here: the
+ * emulator refuses to remove a set with periodic advertising enabled, which
+ * fails the command.
+ */
+static const struct hci_cmd_data pa_remove_hci_cmds[] = {
+ {
+ .opcode = BT_HCI_CMD_LE_SET_PA_ENABLE,
+ .len = sizeof(hci_pa_disable),
+ .param = hci_pa_disable,
+ },
+ {
+ .opcode = BT_HCI_CMD_LE_REMOVE_ADV_SET,
+ .len = sizeof(hci_pa_remove_set),
+ .param = hci_pa_remove_set,
+ },
+ {},
+};
+
+static const uint8_t hci_pa_disable_2[] = { 0x00, 0x02 };
+
+static const struct hci_cmd_data pa_remove_all_hci_cmds[] = {
+ {
+ .opcode = BT_HCI_CMD_LE_SET_PA_ENABLE,
+ .len = sizeof(hci_pa_disable_2),
+ .param = hci_pa_disable_2,
+ },
+ {
+ .opcode = BT_HCI_CMD_LE_CLEAR_ADV_SETS,
+ .len = 0,
+ },
+ {},
+};
+
+static const struct generic_data pa_params_success = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instance,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instance),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params,
+ .send_len = sizeof(pa_params),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_param = pa_instance_1,
+ .expect_len = sizeof(pa_instance_1),
+ .expect_hci_list = pa_params_hci_cmds,
+};
+
+static const struct generic_data pa_params_success_2 = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instances,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instances),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params_2,
+ .send_len = sizeof(pa_params_2),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_param = pa_instance_2,
+ .expect_len = sizeof(pa_instance_2),
+ .expect_hci_list = pa_params_2_hci_cmds,
+};
+
+static const struct generic_data pa_params_not_powered = {
+ .setup_settings = settings_le,
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params,
+ .send_len = sizeof(pa_params),
+ .expect_status = MGMT_STATUS_REJECTED,
+};
+
+static const struct generic_data pa_params_no_instance = {
+ .setup_settings = settings_powered_le,
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params,
+ .send_len = sizeof(pa_params),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_params_connectable = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instance_conn,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instance_conn),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params,
+ .send_len = sizeof(pa_params),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_params_legacy = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instance_legacy,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instance_legacy),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params,
+ .send_len = sizeof(pa_params),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_params_short_interval = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instance,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instance),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params_short,
+ .send_len = sizeof(pa_params_short),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_params_min_above_max = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instance,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instance),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params_min_max,
+ .send_len = sizeof(pa_params_min_max),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+/* For a controller without the feature, with or without an instance */
+static const struct generic_data pa_params_not_supported = {
+ .setup_settings = settings_powered_le,
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pa_params,
+ .send_len = sizeof(pa_params),
+ .expect_status = MGMT_STATUS_NOT_SUPPORTED,
+};
+
+static const struct generic_data pawr_params_not_supported = {
+ .setup_settings = settings_powered_le,
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pawr_params,
+ .send_len = sizeof(pawr_params),
+ .expect_status = MGMT_STATUS_NOT_SUPPORTED,
+};
+
+static const struct generic_data pawr_params_success = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instance,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instance),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pawr_params,
+ .send_len = sizeof(pawr_params),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_param = pa_instance_1,
+ .expect_len = sizeof(pa_instance_1),
+ .expect_hci_list = pawr_params_hci_cmds,
+};
+
+static const struct generic_data pawr_params_too_many_subevents = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instance,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instance),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pawr_params_subevents,
+ .send_len = sizeof(pawr_params_subevents),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_data_success = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_periodic,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_periodic),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_DATA,
+ .send_param = pa_data,
+ .send_len = sizeof(pa_data),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_param = pa_instance_1,
+ .expect_len = sizeof(pa_instance_1),
+ .expect_hci_command = BT_HCI_CMD_LE_SET_PA_DATA,
+ .expect_hci_param = hci_pa_data,
+ .expect_hci_len = sizeof(hci_pa_data),
+};
+
+/* The data can be changed while the train runs */
+static const struct generic_data pa_data_success_running = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_train),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_DATA,
+ .send_param = pa_data,
+ .send_len = sizeof(pa_data),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_param = pa_instance_1,
+ .expect_len = sizeof(pa_instance_1),
+ .expect_hci_command = BT_HCI_CMD_LE_SET_PA_DATA,
+ .expect_hci_param = hci_pa_data,
+ .expect_hci_len = sizeof(hci_pa_data),
+};
+
+static const struct generic_data pa_data_not_periodic = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_instance,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_instance),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_DATA,
+ .send_param = pa_data,
+ .send_len = sizeof(pa_data),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_data_invalid_len = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_periodic,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_periodic),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_DATA,
+ .send_param = pa_data_len,
+ .send_len = sizeof(pa_data_len),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_data_subevents = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_periodic,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_periodic),
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_DATA,
+ .send_param = pa_data,
+ .send_len = sizeof(pa_data),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_remove_success = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_train),
+ .send_opcode = MGMT_OP_REMOVE_ADVERTISING,
+ .send_param = pa_instance_1,
+ .send_len = sizeof(pa_instance_1),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_param = pa_instance_1,
+ .expect_len = sizeof(pa_instance_1),
+ .expect_alt_ev = MGMT_EV_ADVERTISING_REMOVED,
+ .expect_alt_ev_param = pa_instance_1,
+ .expect_alt_ev_len = sizeof(pa_instance_1),
+ .expect_hci_list = pa_remove_hci_cmds,
+};
+
+static const struct generic_data pawr_remove_success = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+ .send_opcode = MGMT_OP_REMOVE_ADVERTISING,
+ .send_param = pa_instance_1,
+ .send_len = sizeof(pa_instance_1),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_param = pa_instance_1,
+ .expect_len = sizeof(pa_instance_1),
+ .expect_alt_ev = MGMT_EV_ADVERTISING_REMOVED,
+ .expect_alt_ev_param = pa_instance_1,
+ .expect_alt_ev_len = sizeof(pa_instance_1),
+ .expect_hci_list = pa_remove_hci_cmds,
+};
+
+/* Instance 1 with a timeout of 1 s and a PAwR train */
+static const uint8_t pa_ext_adv_params_timeout[] = {
+ 0x01, /* instance */
+ 0x80, 0x20, 0x00, 0x00, /* flags: secondary channel LE 1M, timeout */
+ 0x00, 0x00, /* duration */
+ 0x01, 0x00, /* timeout */
+ 0x00, 0x00, 0x00, 0x00, /* min_interval */
+ 0x00, 0x00, 0x00, 0x00, /* max_interval */
+ 0x7f, /* tx_power */
+};
+
+static const struct setup_mgmt_cmd pawr_setup_train_timeout[] = {
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_PARAMS,
+ .send_param = pa_ext_adv_params_timeout,
+ .send_len = sizeof(pa_ext_adv_params_timeout),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_PERIODIC_ADV_PARAMS,
+ .send_param = pawr_params,
+ .send_len = sizeof(pawr_params),
+ },
+ {
+ .send_opcode = MGMT_OP_ADD_EXT_ADV_DATA,
+ .send_param = pa_ext_adv_data,
+ .send_len = sizeof(pa_ext_adv_data),
+ },
+};
+
+/* The controller goes on with the train when the advertising of the set
+ * ends, so the instance is only gone when the train is disabled and the set
+ * removed.
+ */
+static const struct generic_data pawr_timeout_expired = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train_timeout,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train_timeout),
+ .expect_alt_ev = MGMT_EV_ADVERTISING_REMOVED,
+ .expect_alt_ev_param = pa_instance_1,
+ .expect_alt_ev_len = sizeof(pa_instance_1),
+ .expect_hci_list = pa_remove_hci_cmds,
+};
+
+static const struct generic_data pa_remove_all_success = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_trains,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_trains),
+ .send_opcode = MGMT_OP_REMOVE_ADVERTISING,
+ .send_param = pa_instance_all,
+ .send_len = sizeof(pa_instance_all),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_param = pa_instance_all,
+ .expect_len = sizeof(pa_instance_all),
+ .expect_hci_list = pa_remove_all_hci_cmds,
+};
+
+/* The emulator refuses LE Clear Advertising Sets while periodic advertising
+ * is enabled, which fails Set Powered.
+ */
+static const struct generic_data pawr_power_off = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+ .send_opcode = MGMT_OP_SET_POWERED,
+ .send_param = set_powered_off_param,
+ .send_len = sizeof(set_powered_off_param),
+ .expect_status = MGMT_STATUS_SUCCESS,
+ .expect_ignore_param = true,
+};
+
+static const struct generic_data pa_subevent_data_no_subevents = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pa_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pa_setup_train),
+ .send_opcode = MGMT_OP_SET_PA_SUBEVENT_DATA,
+ .send_param = pa_subevent_data_0,
+ .send_len = sizeof(pa_subevent_data_0),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_subevent_data_not_powered = {
+ .setup_settings = settings_le,
+ .send_opcode = MGMT_OP_SET_PA_SUBEVENT_DATA,
+ .send_param = pa_subevent_data_0,
+ .send_len = sizeof(pa_subevent_data_0),
+ .expect_status = MGMT_STATUS_REJECTED,
+};
+
+static const struct generic_data pa_subevent_data_no_entries = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+ .send_opcode = MGMT_OP_SET_PA_SUBEVENT_DATA,
+ .send_param = pa_subevent_data_none,
+ .send_len = sizeof(pa_subevent_data_none),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_subevent_data_short_entry = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+ .send_opcode = MGMT_OP_SET_PA_SUBEVENT_DATA,
+ .send_param = pa_subevent_data_short,
+ .send_len = sizeof(pa_subevent_data_short),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data pa_subevent_data_trailing = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+ .send_opcode = MGMT_OP_SET_PA_SUBEVENT_DATA,
+ .send_param = pa_subevent_data_long,
+ .send_len = sizeof(pa_subevent_data_long),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+/* The controller refuses data it has not asked for yet */
+static const struct generic_data pa_subevent_data_no_request = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train_slow,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train_slow),
+ .send_opcode = MGMT_OP_SET_PA_SUBEVENT_DATA,
+ .send_param = pa_subevent_data_0,
+ .send_len = sizeof(pa_subevent_data_0),
+ .expect_status = MGMT_STATUS_BUSY,
+ .expect_hci_command = BT_HCI_CMD_LE_SET_PA_SUBEVENT_DATA,
+ .expect_hci_param = hci_pa_subevent_data_0,
+ .expect_hci_len = sizeof(hci_pa_subevent_data_0),
+};
+
+/* What a test sends when the controller asks for subevent data, and the
+ * status it expects for each command.
+ */
+struct pawr_answer {
+ const void *param;
+ uint16_t len;
+ uint8_t status;
+};
+
+static const uint8_t pawr_data_request_all[] = {
+ 0x01, /* instance */
+ 0x00, /* subevent_start */
+ 0x05, /* subevent_data_count */
+};
+
+static const struct pawr_answer pawr_answers_one[] = {
+ { pa_subevent_data_0, sizeof(pa_subevent_data_0),
+ MGMT_STATUS_SUCCESS },
+ { }
+};
+
+/* Both commands are out before the controller answers the first */
+static const struct pawr_answer pawr_answers_two[] = {
+ { pa_subevent_data_0, sizeof(pa_subevent_data_0),
+ MGMT_STATUS_SUCCESS },
+ { pa_subevent_data_1, sizeof(pa_subevent_data_1),
+ MGMT_STATUS_SUCCESS },
+ { }
+};
+
+/* The controller takes the data of a subevent once */
+static const struct pawr_answer pawr_answers_twice[] = {
+ { pa_subevent_data_0, sizeof(pa_subevent_data_0),
+ MGMT_STATUS_SUCCESS },
+ { pa_subevent_data_0, sizeof(pa_subevent_data_0),
+ MGMT_STATUS_BUSY },
+ { pa_subevent_data_1, sizeof(pa_subevent_data_1),
+ MGMT_STATUS_SUCCESS },
+ { }
+};
+
+/* The train has subevents 0 to 4 */
+static const struct pawr_answer pawr_answers_not_requested[] = {
+ { pa_subevent_data_5, sizeof(pa_subevent_data_5),
+ MGMT_STATUS_BUSY },
+ { pa_subevent_data_0, sizeof(pa_subevent_data_0),
+ MGMT_STATUS_SUCCESS },
+ { }
+};
+
+static const struct generic_data pawr_data_request = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+};
+
+static const struct generic_data pawr_answer_success = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+ .expect_hci_command = BT_HCI_CMD_LE_SET_PA_SUBEVENT_DATA,
+ .expect_hci_param = hci_pa_subevent_data_0,
+ .expect_hci_len = sizeof(hci_pa_subevent_data_0),
+ .send_param = pawr_answers_one,
+};
+
+static const struct generic_data pawr_answer_two = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+ .send_param = pawr_answers_two,
+};
+
+/* The second answer has to be out before the controller asks again: the
+ * slow train leaves 2 s for it
+ */
+static const struct generic_data pawr_answer_twice = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train_slow,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train_slow),
+ .send_param = pawr_answers_twice,
+};
+
+static const struct generic_data pawr_answer_not_requested = {
+ .setup_settings = settings_powered_le,
+ .setup_mgmt_cmd_arr = pawr_setup_train,
+ .setup_mgmt_cmd_arr_size = ARRAY_SIZE(pawr_setup_train),
+ .send_param = pawr_answers_not_requested,
+};
+
+static void pawr_answer_callback(uint8_t status, uint16_t length,
+ const void *param, void *user_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct pawr_answer *answer = user_data;
+
+ tester_print("Set PA Subevent Data: %s (0x%02x)",
+ mgmt_errstr(status), status);
+
+ if (status != answer->status) {
+ tester_warn("Expected status 0x%02x", answer->status);
+ tester_test_failed();
+ return;
+ }
+
+ if (status == MGMT_STATUS_SUCCESS &&
+ (length != sizeof(pa_instance_1) ||
+ memcmp(param, pa_instance_1, length))) {
+ tester_warn("Unexpected return parameters");
+ tester_test_failed();
+ return;
+ }
+
+ test_condition_complete(data);
+}
+
+static void pawr_data_request_callback(uint16_t index, uint16_t length,
+ const void *param, void *user_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const struct pawr_answer *answer = test->send_param;
+
+ /* Only the first request of the train is answered */
+ if (!data->mgmt_alt_ev_id)
+ return;
+
+ mgmt_unregister(data->mgmt_alt, data->mgmt_alt_ev_id);
+ data->mgmt_alt_ev_id = 0;
+
+ if (length != sizeof(pawr_data_request_all) ||
+ memcmp(param, pawr_data_request_all, length)) {
+ tester_warn("Unexpected data request:");
+ util_hexdump('>', param, length, print_debug, "");
+ tester_test_failed();
+ return;
+ }
+
+ for (; answer && answer->param; answer++) {
+ test_add_condition(data);
+
+ /* Not mgmt_send(), which waits for the reply to the first
+ * command before it sends the second.
+ */
+ mgmt_send_nowait(data->mgmt, MGMT_OP_SET_PA_SUBEVENT_DATA,
+ data->mgmt_index, answer->len,
+ answer->param, pawr_answer_callback,
+ (void *) answer, NULL);
+ }
+
+ test_condition_complete(data);
+}
+
+/* Wait for the first data request of the train and answer it */
+static void test_pawr_answer(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+
+ if (test->expect_hci_command) {
+ hciemu_add_central_post_command_hook(data->hciemu,
+ command_hci_callback, data);
+ test_add_condition(data);
+ }
+
+ data->mgmt_alt_ev_id = mgmt_register(data->mgmt_alt,
+ MGMT_EV_PA_SUBEVENT_DATA_REQUEST,
+ data->mgmt_index,
+ pawr_data_request_callback,
+ NULL, NULL);
+ test_add_condition(data);
+}
+
static const uint8_t add_advertising_param_empty[] = {
0x01, /* adv instance */
0x00, 0x00, 0x00, 0x00, /* flags: none */
@@ -16211,6 +17198,138 @@ int main(int argc, char *argv[])
setup_add_ext_adv_on_off,
test_command_generic);
+ test_bredrle52("Add Periodic Adv Params - Success",
+ &pa_params_success,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Params - Success (2nd instance)",
+ &pa_params_success_2,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Params - Not powered",
+ &pa_params_not_powered,
+ NULL, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Params - No instance",
+ &pa_params_no_instance,
+ NULL, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Params - Connectable",
+ &pa_params_connectable,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Params - Legacy PDUs",
+ &pa_params_legacy,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Params - Interval too short",
+ &pa_params_short_interval,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Params - Min above max interval",
+ &pa_params_min_above_max,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle50("Add Periodic Adv Params - Not supported (5.0)",
+ &pa_params_not_supported,
+ NULL, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Params - PAwR not supported (5.2)",
+ &pawr_params_not_supported,
+ NULL, test_command_generic);
+
+ test_bredrle60("Add Periodic Adv Params - PAwR Success",
+ &pawr_params_success,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("Add Periodic Adv Params - PAwR too many subevents",
+ &pawr_params_too_many_subevents,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Data - Success",
+ &pa_data_success,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Data - Success (train running)",
+ &pa_data_success_running,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Data - Not periodic",
+ &pa_data_not_periodic,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Add Periodic Adv Data - Invalid length",
+ &pa_data_invalid_len,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("Add Periodic Adv Data - Instance with subevents",
+ &pa_data_subevents,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Remove Advertising - Periodic Success",
+ &pa_remove_success,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle52("Remove Advertising - Periodic Success (All)",
+ &pa_remove_all_success,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("Remove Advertising - PAwR Success",
+ &pawr_remove_success,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60_full("Add Periodic Adv Params - PAwR timeout expires",
+ &pawr_timeout_expired,
+ setup_command_generic, test_command_generic, 5);
+
+ test_bredrle60("Set Powered - Off with PAwR train",
+ &pawr_power_off,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("Set PA Subevent Data - No subevents",
+ &pa_subevent_data_no_subevents,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("Set PA Subevent Data - Not powered",
+ &pa_subevent_data_not_powered,
+ NULL, test_command_generic);
+
+ test_bredrle60("Set PA Subevent Data - No entries",
+ &pa_subevent_data_no_entries,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("Set PA Subevent Data - Entry beyond the packet",
+ &pa_subevent_data_short_entry,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("Set PA Subevent Data - Octets after the entries",
+ &pa_subevent_data_trailing,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("Set PA Subevent Data - No request",
+ &pa_subevent_data_no_request,
+ setup_command_generic, test_command_generic);
+
+ test_bredrle60("PA Subevent Data Request - Success",
+ &pawr_data_request,
+ setup_command_generic, test_pawr_answer);
+
+ test_bredrle60("Set PA Subevent Data - Success",
+ &pawr_answer_success,
+ setup_command_generic, test_pawr_answer);
+
+ test_bredrle60("Set PA Subevent Data - Success (two commands)",
+ &pawr_answer_two,
+ setup_command_generic, test_pawr_answer);
+
+ test_bredrle60_full("Set PA Subevent Data - Sent twice",
+ &pawr_answer_twice,
+ setup_command_generic, test_pawr_answer, 5);
+
+ test_bredrle60("Set PA Subevent Data - Subevent not requested",
+ &pawr_answer_not_requested,
+ setup_command_generic, test_pawr_answer);
+
/* MGMT_OP_SET_DEVICE_ID
* Using Bluetooth SIG for source.
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* RE: Periodic advertising and PAwR over MGMT
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 01/12] doc/mgmt: Add PA and PAwR commands and events Roland Schober
@ 2026-12-04 8:23 ` bluez.test.bot
0 siblings, 0 replies; 15+ messages in thread
From: bluez.test.bot @ 2026-12-04 8:23 UTC (permalink / raw)
To: linux-bluetooth, rolandschober1968
[-- Attachment #1: Type: text/plain, Size: 50193 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/series/1231164/
---Test result---
Test Summary:
CheckPatch PASS 4.83 seconds
GitLint PASS 2.77 seconds
BuildEll PASS 16.58 seconds
BluezMake PASS 240.03 seconds
MakeCheck PASS 13.80 seconds
MakeDistcheck PASS 123.88 seconds
CheckValgrind PASS 299.76 seconds
CheckSmatch WARNING 245.46 seconds
bluezmakeextell PASS 78.70 seconds
TestFunctional FAIL 1045.57 seconds
IncrementalBuild PASS 383.51 seconds
ScanBuild PASS 858.01 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
monitor/packet.c:2292:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:4304:52: warning: array of flexible structuresmonitor/bt.h:4292:40: warning: array of flexible structuresemulator/btdev.c: note: in included file:./monitor/bt.h:3048:52: warning: array of flexible structuresemulator/btdev.c: note: in included file:./monitor/bt.h:3048:52: warning: array of flexible structuresemulator/btdev.c: note: in included file:./monitor/bt.h:3048:52: warning: array of flexible structuresemulator/btdev.c: note: in included file:./monitor/bt.h:3048:52: warning: array of flexible structures
##############################
Test: TestFunctional - FAIL
Desc: Run test-functional
Output:
FAIL functional.test_bap::test_bap_broadcast_earbuds_transport_created[hosts8-vm3]: AssertionError: Failed to acquire: org.bluez.Error.Failed
FAIL functional.test_bap::test_bap_broadcast_earbuds_transport_created[hosts8-vm3]: failed on teardown with "pytest_bluezenv.plugin.CoredumpWarning: Core dump: test-bluezenv-hosts8.0-bluetoothd-1796371350-118.core
/usr/bin/gdb: warning: Couldn't determine a path for the index cache directory.
[New LWP 118]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/runner/work/bluez/bluez/src/src/src/bluetoothd --nodetach -f /run/bluetoo'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
warning: 44 ./nptl/pthread_kill.c: No such file or directory
Thread 1 (Thread 0x7f716bb3b900 (LWP 118)):
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
tid = <optimized out>
ret = 0
pd = <optimized out>
old_mask = {__val = {0}}
ret = <optimized out>
#1 __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
No locals.
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:100
No locals.
#3 0x00007f716c296b7e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
ret = <optimized out>
#4 0x00007f716c2798ec in __GI_abort () at ./stdlib/abort.c:77
act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
#5 0x00007f716cea1a0f in __sanitizer::Abort () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp:165
No locals.
#6 0x00007f716cfc7c2d in __sanitizer::Die () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:58
No locals.
#7 0x00007f716cf9c93c in __asan::ScopedInErrorReport::~ScopedInErrorReport (this=0x7ffc8b6eda36) at ../../../../src/libsanitizer/asan/asan_report.cpp:221
buffer_copy = {buffer_ = {<__sanitizer::InternalMmapVectorNoCtor<char, false>> = {data_ = 0x7f716b34f000 '=' <repeats 65 times>, "\n==118==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bf16afe68e4 at pc 0x557666d484e3 bp 0x7ffc8b6ee6b0 sp 0x7ffc8b6ee6a0"..., capacity_bytes_ = 4096, size_ = 3753}, <No data fields>}}
buffer_copy = <optimized out>
l = <optimized out>
#8 0x00007f716cf9be02 in __asan::ReportGenericError (pc=93967019705571, bp=140722647787184, sp=sp@entry=140722647787168, addr=addr@entry=136276812392676, is_write=is_write@entry=false, access_size=4, fatal=true, exp=<optimized out>) at ../../../../src/libsanitizer/asan/asan_report.cpp:536
in_report = {error_report_lock_ = {<No data fields>}, static current_error_ = {kind = __asan::kErrorKindGeneric, {Base = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, DeadlySignal = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, signal = {siginfo = 0x7c8100000002, context = 0x7bf16afe68e4, addr = 0, pc = 0, sp = 7413113554466, bp = 136276812392676, is_memory_access = 68, write_flag = __sanitizer::SignalContext::Unknown, is_true_faulting_addr = 160}}, DoubleFree = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, second_free_stack = 0x7c8100000002, addr_description = {addr = 136276812392676, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1570, free_stack_id = 1726, chunk_access = {bad_addr = 136276812392676, offset = 68, chunk_begin = 136276812392608, chunk_size = 88, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}}, NewDeleteTypeMismatch = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, free_stack = 0x7c8100000002, addr_description = {addr = 136276812392676, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1570, free_stack_id = 1726, chunk_access = {bad_addr = 136276812392676, offset = 68, chunk_begin = 136276812392608, chunk_size = 88, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, delete_size = 136895287657472, delete_alignment = 136276812367136}, FreeNotMalloced = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, free_stack = 0x7c8100000002, addr_description = {data = {kind = 1795057892, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 7413113554466, alloc_stack_id = 1795057892, free_stack_id = 31729, chunk_access = {bad_addr = 68, offset = 136276812392608, chunk_begin = 88, chunk_size = 4294926344, user_requested_alignment = 1024, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 0, offset = 7413113554466, frame_pc = 136276812392676, access_size = 68, frame_descr = 0x7bf16afe68a0 "\276\006"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 7413113554466, size_with_redzone = 136276812392676, name = 0x44 <error: Cannot access memory at address 0x44>, module_name = 0x7bf16afe68a0 "\276\006", has_dynamic_init = 88, gcc_location = 0xffff6008, odr_indicator = 136895287657472}, {beg = 136276812367136, size = 0, size_with_redzone = 0, name = 0xf6e2d3e1e20 <error: Cannot access memory at address 0xf6e2d3e1e20>, module_name = 0x7ffc8b6edf20 "0\002\376j\321|", has_dynamic_init = 140125132721500, gcc_location = 0x7ffc8b6edf20, odr_indicator = 140125132722238}, {beg = 5, size = 6730581248, size_with_redzone = 136826568180552, name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, module_name = 0x2 <error: Cannot access memory at address 0x2>, has_dynamic_init = 140125132671342, gcc_location = 0x7ffc8b6edf30, odr_indicator = 140125132726997}, {beg = 137238885040688, size = 140722647785280, size_with_redzone = 140722647785312, name = 0x7f716cc08d6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", module_name = 0x0, has_dynamic_init = 7073628186225706240, gcc_location = 0x7c916afe0040, odr_indicator = 1}}, reg_sites = {2339299232, 32764, 1824574085, 32625}, access_size = 140722647785376, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, AllocTypeMismatch = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, dealloc_stack = 0x7c8100000002, alloc_type = 1795057892, dealloc_type = 31729, addr_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 0, kind = (__asan::kShadowKindHigh | unknown: 0x20), shadow_byte = 6 '\006'}, heap = {addr = 0, alloc_tid = 7413113554466, free_tid = 136276812392676, alloc_stack_id = 68, free_stack_id = 0, chunk_access = {bad_addr = 136276812392608, offset = 88, chunk_begin = 4294926344, chunk_size = 136895287657472, user_requested_alignment = 1312, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 7413113554466, offset = 136276812392676, frame_pc = 68, access_size = 136276812392608, frame_descr = 0x58 <error: Cannot access memory at address 0x58>}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 7413113554466, size = 136276812392676, size_with_redzone = 68, name = 0x7bf16afe68a0 "\276\006", module_name = 0x58 <error: Cannot access memory at address 0x58>, has_dynamic_init = 4294926344, gcc_location = 0x7c816afe0400, odr_indicator = 136276812367136}, {beg = 0, size = 0, size_with_redzone = 16965879864864, name = 0x7ffc8b6edf20 "0\002\376j\321|", module_name = 0x7f716cc28d5c "\205\300\017\204\214", has_dynamic_init = 140722647785248, gcc_location = 0x7f716cc2903e, odr_indicator = 5}, {beg = 6730581248, size = 136826568180552, size_with_redzone = 7073628186225706240, name = 0x2 <error: Cannot access memory at address 0x2>, module_name = 0x7f716cc1c96e <dbus_message_unref+46> "\203\370\001tmH\213]\370\311\303\017\037\200", has_dynamic_init = 140722647785264, gcc_location = 0x7f716cc2a2d5 <_dbus_list_pop_first_link+21>, odr_indicator = 137238885040688}, {beg = 140722647785280, size = 140722647785312, size_with_redzone = 140125132590442, name = 0x0, module_name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, has_dynamic_init = 136964007133248, gcc_location = 0x1, odr_indicator = 140722647785376}}, reg_sites = {1824574085, 32625, 2339299232, 32764}, access_size = 93967019705571, size = 176 '\260'}, wild = {addr = 0, access_size = 7413113554466}}}}}, MallocUsableSizeNotOwned = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, addr_description = {data = {kind = 1795057892, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 7413113554466, alloc_stack_id = 1795057892, free_stack_id = 31729, chunk_access = {bad_addr = 68, offset = 136276812392608, chunk_begin = 88, chunk_size = 4294926344, user_requested_alignment = 1024, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 0, offset = 7413113554466, frame_pc = 136276812392676, access_size = 68, frame_descr = 0x7bf16afe68a0 "\276\006"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 7413113554466, size_with_redzone = 136276812392676, name = 0x44 <error: Cannot access memory at address 0x44>, module_name = 0x7bf16afe68a0 "\276\006", has_dynamic_init = 88, gcc_location = 0xffff6008, odr_indicator = 136895287657472}, {beg = 136276812367136, size = 0, size_with_redzone = 0, name = 0xf6e2d3e1e20 <error: Cannot access memory at address 0xf6e2d3e1e20>, module_name = 0x7ffc8b6edf20 "0\002\376j\321|", has_dynamic_init = 140125132721500, gcc_location = 0x7ffc8b6edf20, odr_indicator = 140125132722238}, {beg = 5, size = 6730581248, size_with_redzone = 136826568180552, name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, module_name = 0x2 <error: Cannot access memory at address 0x2>, has_dynamic_init = 140125132671342, gcc_location = 0x7ffc8b6edf30, odr_indicator = 140125132726997}, {beg = 137238885040688, size = 140722647785280, size_with_redzone = 140722647785312, name = 0x7f716cc08d6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", module_name = 0x0, has_dynamic_init = 7073628186225706240, gcc_location = 0x7c916afe0040, odr_indicator = 1}}, reg_sites = {2339299232, 32764, 1824574085, 32625}, access_size = 140722647785376, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, SanitizerGetAllocatedSizeNotOwned = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, addr_description = {data = {kind = 1795057892, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 7413113554466, alloc_stack_id = 1795057892, free_stack_id = 31729, chunk_access = {bad_addr = 68, offset = 136276812392608, chunk_begin = 88, chunk_size = 4294926344, user_requested_alignment = 1024, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 0, offset = 7413113554466, frame_pc = 136276812392676, access_size = 68, frame_descr = 0x7bf16afe68a0 "\276\006"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 7413113554466, size_with_redzone = 136276812392676, name = 0x44 <error: Cannot access memory at address 0x44>, module_name = 0x7bf16afe68a0 "\276\006", has_dynamic_init = 88, gcc_location = 0xffff6008, odr_indicator = 136895287657472}, {beg = 136276812367136, size = 0, size_with_redzone = 0, name = 0xf6e2d3e1e20 <error: Cannot access memory at address 0xf6e2d3e1e20>, module_name = 0x7ffc8b6edf20 "0\002\376j\321|", has_dynamic_init = 140125132721500, gcc_location = 0x7ffc8b6edf20, odr_indicator = 140125132722238}, {beg = 5, size = 6730581248, size_with_redzone = 136826568180552, name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, module_name = 0x2 <error: Cannot access memory at address 0x2>, has_dynamic_init = 140125132671342, gcc_location = 0x7ffc8b6edf30, odr_indicator = 140125132726997}, {beg = 137238885040688, size = 140722647785280, size_with_redzone = 140722647785312, name = 0x7f716cc08d6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", module_name = 0x0, has_dynamic_init = 7073628186225706240, gcc_location = 0x7c916afe0040, odr_indicator = 1}}, reg_sites = {2339299232, 32764, 1824574085, 32625}, access_size = 140722647785376, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, CallocOverflow = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, count = 136276812392676, size = 0}, ReallocArrayOverflow = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, count = 136276812392676, size = 0}, PvallocOverflow = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, size = 136276812392676}, InvalidAllocationAlignment = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, alignment = 136276812392676}, InvalidAlignedAllocAlignment = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, size = 136276812392676, alignment = 0}, InvalidPosixMemalignAlignment = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, alignment = 136276812392676}, AllocationSizeTooBig = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, user_size = 136276812392676, total_size = 0, max_size = 0}, RssLimitExceeded = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002}, OutOfMemory = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, requested_size = 136276812392676}, StringFunctionMemoryRangesOverlap = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, length1 = 136276812392676, length2 = 0, addr1_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 7413113554466, kind = (unknown: 0xe4), shadow_byte = 104 'h'}, heap = {addr = 7413113554466, alloc_tid = 136276812392676, free_tid = 68, alloc_stack_id = 1795057824, free_stack_id = 31729, chunk_access = {bad_addr = 88, offset = 4294926344, chunk_begin = 136895287657472, chunk_size = 136276812367136, user_requested_alignment = 0, access_type = 0, alloc_type = 0}}, stack = {addr = 7413113554466, tid = 136276812392676, offset = 68, frame_pc = 136276812392608, access_size = 88, frame_descr = 0xffff6008 <error: Cannot access memory at address 0xffff6008>}, global = {addr = 7413113554466, static kMaxGlobals = 4, globals = {{beg = 136276812392676, size = 68, size_with_redzone = 136276812392608, name = 0x58 <error: Cannot access memory at address 0x58>, module_name = 0xffff6008 <error: Cannot access memory at address 0xffff6008>, has_dynamic_init = 136895287657472, gcc_location = 0x7bf16afe0520, odr_indicator = 0}, {beg = 0, size = 16965879864864, size_with_redzone = 140722647785248, name = 0x7f716cc28d5c "\205\300\017\204\214", module_name = 0x7ffc8b6edf20 "0\002\376j\321|", has_dynamic_init = 140125132722238, gcc_location = 0x5, odr_indicator = 6730581248}, {beg = 136826568180552, size = 7073628186225706240, size_with_redzone = 2, name = 0x7f716cc1c96e <dbus_message_unref+46> "\203\370\001tmH\213]\370\311\303\017\037\200", module_name = 0x7ffc8b6edf30 "`\337n\213\374\177", has_dynamic_init = 140125132726997, gcc_location = 0x7cd16afe0230, odr_indicator = 140722647785280}, {beg = 140722647785312, size = 140125132590442, size_with_redzone = 0, name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, module_name = 0x7c916afe0040 "\031", has_dynamic_init = 1, gcc_location = 0x7ffc8b6edfa0, odr_indicator = 140125132606085}}, reg_sites = {2339299232, 32764, 1725203683, 21878}, access_size = 140722647787184, size = 160 '\240'}, wild = {addr = 7413113554466, access_size = 136276812392676}}}}, addr2_description = {data = {kind = __asan::kAddressKindGlobal, {shadow = {addr = 140125136713623, kind = __asan::kShadowKindLow, shadow_byte = 253 '\375'}, heap = {addr = 140125136713623, alloc_tid = 140722647792896, free_tid = 93967023344384, alloc_stack_id = 1795034944, free_stack_id = 31841, chunk_access = {bad_addr = 136826568183104, offset = 93967023605647, chunk_begin = 4294967298, chunk_size = 136756053671937, user_requested_alignment = 1408, access_type = 2, alloc_type = 3}}, stack = {addr = 140125136713623, tid = 140722647792896, offset = 93967023344384, frame_pc = 136757848706880, access_size = 136826568183104, frame_descr = 0x55766710078f <bt_bap_stream_release+383> "\213D$\bH\203\304([]A^A_\303f\220H\203\304(1\300[]A^A_\303H\211\317\350K\377\277\377H\211\312H\211\336H\211L$\bH\215=Y\177{"}, global = {addr = 140125136713623, static kMaxGlobals = 4, globals = {{beg = 140722647792896, size = 93967023344384, size_with_redzone = 136757848706880, name = 0x7c716afe0d40 "\001", module_name = 0x55766710078f <bt_bap_stream_release+383> "\213D$\bH\203\304([]A^A_\303f\220H\203\304(1\300[]A^A_\303H\211\317\350K\377\277\377H\211\312H\211\336H\211L$\bH\215=Y\177{", has_dynamic_init = 4294967298, gcc_location = 0x7c6100000001, odr_indicator = 140722647786880}, {beg = 135933215078976, size = 135864495683504, size_with_redzone = 135933215078976, name = 0x0, module_name = 0x5576670c0b00 <stream_state_changed> "\363\017\036\372H\203\354(H\211\370I\211\360H\205\377\017\204#\001", has_dynamic_init = 136757848706880, gcc_location = 0x7ffc8b6ee5b0, odr_indicator = 0}, {beg = 7073628186225706240, size = 135864495689312, size_with_redzone = 3, name = 0x1 <error: Cannot access memory at address 0x1>, module_name = 0x7ffc8b6ee5e0 "@C\324fvU", has_dynamic_init = 136826568183104, gcc_location = 0x622a935b912c8500, odr_indicator = 136757848706880}, {beg = 140722647787008, size = 93967019688768, size_with_redzone = 7073628186225706240, name = 0x7c616afe0f40 "\346\006", module_name = 0x7c616afe0f40 "\346\006", has_dynamic_init = 93967019688768, gcc_location = 0x5576670ee6c4 <stream_set_state+292>, odr_indicator = 136757848706880}}, reg_sites = {1795034432, 31857, 1795166800, 31649}, access_size = 93967023361220, size = 64 '@'}, wild = {addr = 140125136713623, access_size = 140722647792896}}}}, function = 0x7c616afe0f40 "\346\006"}, StringFunctionSizeOverflow = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, addr_description = {data = {kind = 1795057892, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 7413113554466, alloc_stack_id = 1795057892, free_stack_id = 31729, chunk_access = {bad_addr = 68, offset = 136276812392608, chunk_begin = 88, chunk_size = 4294926344, user_requested_alignment = 1024, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 0, offset = 7413113554466, frame_pc = 136276812392676, access_size = 68, frame_descr = 0x7bf16afe68a0 "\276\006"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 7413113554466, size_with_redzone = 136276812392676, name = 0x44 <error: Cannot access memory at address 0x44>, module_name = 0x7bf16afe68a0 "\276\006", has_dynamic_init = 88, gcc_location = 0xffff6008, odr_indicator = 136895287657472}, {beg = 136276812367136, size = 0, size_with_redzone = 0, name = 0xf6e2d3e1e20 <error: Cannot access memory at address 0xf6e2d3e1e20>, module_name = 0x7ffc8b6edf20 "0\002\376j\321|", has_dynamic_init = 140125132721500, gcc_location = 0x7ffc8b6edf20, odr_indicator = 140125132722238}, {beg = 5, size = 6730581248, size_with_redzone = 136826568180552, name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, module_name = 0x2 <error: Cannot access memory at address 0x2>, has_dynamic_init = 140125132671342, gcc_location = 0x7ffc8b6edf30, odr_indicator = 140125132726997}, {beg = 137238885040688, size = 140722647785280, size_with_redzone = 140722647785312, name = 0x7f716cc08d6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", module_name = 0x0, has_dynamic_init = 7073628186225706240, gcc_location = 0x7c916afe0040, odr_indicator = 1}}, reg_sites = {2339299232, 32764, 1824574085, 32625}, access_size = 140722647785376, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}, size = 140722647787184}, BadParamsToAnnotateContiguousContainer = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, beg = 136276812392676, end = 0, old_mid = 0, new_mid = 7413113554466}, BadParamsToAnnotateDoubleEndedContiguousContainer = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, storage_beg = 136276812392676, storage_end = 0, old_container_beg = 0, old_container_end = 7413113554466, new_container_beg = 136276812392676, new_container_end = 68}, BadParamsToCopyContiguousContainerAnnotations = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, stack = 0x7c8100000002, old_storage_beg = 136276812392676, old_storage_end = 0, new_storage_beg = 0, new_storage_end = 7413113554466}, ODRViolation = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, global1 = {beg = 136893492625410, size = 136276812392676, size_with_redzone = 0, name = 0x0, module_name = 0x6be00000622 <error: Cannot access memory at address 0x6be00000622>, has_dynamic_init = 136276812392676, gcc_location = 0x44, odr_indicator = 136276812392608}, global2 = {beg = 88, size = 4294926344, size_with_redzone = 136895287657472, name = 0x7bf16afe0520 "\003", module_name = 0x0, has_dynamic_init = 0, gcc_location = 0xf6e2d3e1e20, odr_indicator = 140722647785248}, stack_id1 = 1824689500, stack_id2 = 32625}, InvalidPointerPair = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, pc = 136893492625410, bp = 136276812392676, sp = 0, addr1_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 7413113554466, kind = (unknown: 0xe4), shadow_byte = 104 'h'}, heap = {addr = 7413113554466, alloc_tid = 136276812392676, free_tid = 68, alloc_stack_id = 1795057824, free_stack_id = 31729, chunk_access = {bad_addr = 88, offset = 4294926344, chunk_begin = 136895287657472, chunk_size = 136276812367136, user_requested_alignment = 0, access_type = 0, alloc_type = 0}}, stack = {addr = 7413113554466, tid = 136276812392676, offset = 68, frame_pc = 136276812392608, access_size = 88, frame_descr = 0xffff6008 <error: Cannot access memory at address 0xffff6008>}, global = {addr = 7413113554466, static kMaxGlobals = 4, globals = {{beg = 136276812392676, size = 68, size_with_redzone = 136276812392608, name = 0x58 <error: Cannot access memory at address 0x58>, module_name = 0xffff6008 <error: Cannot access memory at address 0xffff6008>, has_dynamic_init = 136895287657472, gcc_location = 0x7bf16afe0520, odr_indicator = 0}, {beg = 0, size = 16965879864864, size_with_redzone = 140722647785248, name = 0x7f716cc28d5c "\205\300\017\204\214", module_name = 0x7ffc8b6edf20 "0\002\376j\321|", has_dynamic_init = 140125132722238, gcc_location = 0x5, odr_indicator = 6730581248}, {beg = 136826568180552, size = 7073628186225706240, size_with_redzone = 2, name = 0x7f716cc1c96e <dbus_message_unref+46> "\203\370\001tmH\213]\370\311\303\017\037\200", module_name = 0x7ffc8b6edf30 "`\337n\213\374\177", has_dynamic_init = 140125132726997, gcc_location = 0x7cd16afe0230, odr_indicator = 140722647785280}, {beg = 140722647785312, size = 140125132590442, size_with_redzone = 0, name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, module_name = 0x7c916afe0040 "\031", has_dynamic_init = 1, gcc_location = 0x7ffc8b6edfa0, odr_indicator = 140125132606085}}, reg_sites = {2339299232, 32764, 1725203683, 21878}, access_size = 140722647787184, size = 160 '\240'}, wild = {addr = 7413113554466, access_size = 136276812392676}}}}, addr2_description = {data = {kind = __asan::kAddressKindGlobal, {shadow = {addr = 140125136713623, kind = __asan::kShadowKindLow, shadow_byte = 253 '\375'}, heap = {addr = 140125136713623, alloc_tid = 140722647792896, free_tid = 93967023344384, alloc_stack_id = 1795034944, free_stack_id = 31841, chunk_access = {bad_addr = 136826568183104, offset = 93967023605647, chunk_begin = 4294967298, chunk_size = 136756053671937, user_requested_alignment = 1408, access_type = 2, alloc_type = 3}}, stack = {addr = 140125136713623, tid = 140722647792896, offset = 93967023344384, frame_pc = 136757848706880, access_size = 136826568183104, frame_descr = 0x55766710078f <bt_bap_stream_release+383> "\213D$\bH\203\304([]A^A_\303f\220H\203\304(1\300[]A^A_\303H\211\317\350K\377\277\377H\211\312H\211\336H\211L$\bH\215=Y\177{"}, global = {addr = 140125136713623, static kMaxGlobals = 4, globals = {{beg = 140722647792896, size = 93967023344384, size_with_redzone = 136757848706880, name = 0x7c716afe0d40 "\001", module_name = 0x55766710078f <bt_bap_stream_release+383> "\213D$\bH\203\304([]A^A_\303f\220H\203\304(1\300[]A^A_\303H\211\317\350K\377\277\377H\211\312H\211\336H\211L$\bH\215=Y\177{", has_dynamic_init = 4294967298, gcc_location = 0x7c6100000001, odr_indicator = 140722647786880}, {beg = 135933215078976, size = 135864495683504, size_with_redzone = 135933215078976, name = 0x0, module_name = 0x5576670c0b00 <stream_state_changed> "\363\017\036\372H\203\354(H\211\370I\211\360H\205\377\017\204#\001", has_dynamic_init = 136757848706880, gcc_location = 0x7ffc8b6ee5b0, odr_indicator = 0}, {beg = 7073628186225706240, size = 135864495689312, size_with_redzone = 3, name = 0x1 <error: Cannot access memory at address 0x1>, module_name = 0x7ffc8b6ee5e0 "@C\324fvU", has_dynamic_init = 136826568183104, gcc_location = 0x622a935b912c8500, odr_indicator = 136757848706880}, {beg = 140722647787008, size = 93967019688768, size_with_redzone = 7073628186225706240, name = 0x7c616afe0f40 "\346\006", module_name = 0x7c616afe0f40 "\346\006", has_dynamic_init = 93967019688768, gcc_location = 0x5576670ee6c4 <stream_set_state+292>, odr_indicator = 136757848706880}}, reg_sites = {1795034432, 31857, 1795166800, 31649}, access_size = 93967023361220, size = 64 '@'}, wild = {addr = 140125136713623, access_size = 140722647792896}}}}}, Generic = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, addr_description = {data = {kind = __asan::kAddressKindHeap, {shadow = {addr = 136276812392676, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 136276812392676, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1570, free_stack_id = 1726, chunk_access = {bad_addr = 136276812392676, offset = 68, chunk_begin = 136276812392608, chunk_size = 88, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, stack = {addr = 136276812392676, tid = 0, offset = 0, frame_pc = 7413113554466, access_size = 136276812392676, frame_descr = 0x44 <error: Cannot access memory at address 0x44>}, global = {addr = 136276812392676, static kMaxGlobals = 4, globals = {{beg = 0, size = 0, size_with_redzone = 7413113554466, name = 0x7bf16afe68e4 "", module_name = 0x44 <error: Cannot access memory at address 0x44>, has_dynamic_init = 136276812392608, gcc_location = 0x58, odr_indicator = 4294926344}, {beg = 136895287657472, size = 136276812367136, size_with_redzone = 0, name = 0x0, module_name = 0xf6e2d3e1e20 <error: Cannot access memory at address 0xf6e2d3e1e20>, has_dynamic_init = 140722647785248, gcc_location = 0x7f716cc28d5c, odr_indicator = 140722647785248}, {beg = 140125132722238, size = 5, size_with_redzone = 6730581248, name = 0x7c716afe0348 "0\001\376ja|", module_name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, has_dynamic_init = 2, gcc_location = 0x7f716cc1c96e <dbus_message_unref+46>, odr_indicator = 140722647785264}, {beg = 140125132726997, size = 137238885040688, size_with_redzone = 140722647785280, name = 0x7ffc8b6edf60 "\240\337n\213\374\177", module_name = 0x7f716cc08d6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", has_dynamic_init = 0, gcc_location = 0x622a935b912c8500, odr_indicator = 136964007133248}}, reg_sites = {1, 0, 2339299232, 32764}, access_size = 140125132606085, size = 160 '\240'}, wild = {addr = 136276812392676, access_size = 0}}}}, pc = 93967019705571, bp = 140722647787184, sp = 140722647787168, access_size = 4, bug_descr = 0x7f716cff7797 "heap-use-after-free", is_write = false, shadow_val = 253 '\375'}}}, halt_on_error_ = true}
error = {<__asan::ErrorBase> = {scariness = {score = 45, descr = "4-byte-read-heap-use-after-free\000\000\000\000\000\001\000\000\000\000\000\000\000\240\332n\213\374\177\000\000\213\305\373lq\177", '\000' <repeats 11 times>, "\205,\221[\223*b`", '\000' <repeats 16 times>, "\333n\213\374\177\000\0002\321\373lq\177\000\000\220\204<-n\017\000\000\000\205,\221[\223*b\000\000\000\000q{\000\0004\264\037mq\177\000\000\342\006\000\000n\017\000\000 nPkq\177\000\000\200\333n\213\374\177\000\000\002\000\000\000\000\000\000\000\300\337\003mq\177\000\000@\030\000k\241{\000\000P\333n\213\374\177\000\0008\267\352l"...}, tid = 0}, addr_description = {data = {kind = __asan::kAddressKindHeap, {shadow = {addr = 136276812392676, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 136276812392676, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1570, free_stack_id = 1726, chunk_access = {bad_addr = 136276812392676, offset = 68, chunk_begin = 136276812392608, chunk_size = 88, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, stack = {addr = 136276812392676, tid = 0, offset = 0, frame_pc = 7413113554466, access_size = 136276812392676, frame_descr = 0x44 <error: Cannot access memory at address 0x44>}, global = {addr = 136276812392676, static kMaxGlobals = 4, globals = {{beg = 0, size = 0, size_with_redzone = 7413113554466, name = 0x7bf16afe68e4 "", module_name = 0x44 <error: Cannot access memory at address 0x44>, has_dynamic_init = 136276812392608, gcc_location = 0x58, odr_indicator = 4294926344}, {beg = 136895287657472, size = 136276812367136, size_with_redzone = 0, name = 0x0, module_name = 0xf6e2d3e1e20 <error: Cannot access memory at address 0xf6e2d3e1e20>, has_dynamic_init = 140722647785248, gcc_location = 0x7f716cc28d5c, odr_indicator = 140722647785248}, {beg = 140125132722238, size = 5, size_with_redzone = 6730581248, name = 0x7c716afe0348 "0\001\376ja|", module_name = 0x622a935b912c8500 <error: Cannot access memory at address 0x622a935b912c8500>, has_dynamic_init = 2, gcc_location = 0x7f716cc1c96e <dbus_message_unref+46>, odr_indicator = 140722647785264}, {beg = 140125132726997, size = 137238885040688, size_with_redzone = 140722647785280, name = 0x7ffc8b6edf60 "\240\337n\213\374\177", module_name = 0x7f716cc08d6a <_dbus_connection_unlock+106> "H\211\303H\205\300u\336H\213E\350dH+\004%(", has_dynamic_init = 0, gcc_location = 0x622a935b912c8500, odr_indicator = 136964007133248}}, reg_sites = {1, 0, 2339299232, 32764}, access_size = 140125132606085, size = 160 '\240'}, wild = {addr = 136276812392676, access_size = 0}}}}, pc = 93967019705571, bp = 140722647787184, sp = 140722647787168, access_size = 4, bug_descr = 0x7f716cff7797 "heap-use-after-free", is_write = false, shadow_val = 253 '\375'}
#9 0x00007f716cf9bf8d in __asan::ReportGenericError (pc=<optimized out>, bp=bp@entry=140722647787184, sp=sp@entry=140722647787168, addr=addr@entry=136276812392676, is_write=is_write@entry=false, access_size=access_size@entry=4, exp=<optimized out>, fatal=true) at ../../../../src/libsanitizer/asan/asan_report.cpp:536
in_report = <optimized out>
error = <optimized out>
enable_fp = <optimized out>
#10 0x00007f716cf9d2e9 in __asan::__asan_report_load4 (addr=addr@entry=136276812392676) at ../../../../src/libsanitizer/asan/asan_rtl.cpp:130
bp = 140722647787184
pc = <optimized out>
local_stack = 136208092934816
sp = 140722647787168
#11 0x0000557666d484e3 in transport_bap_resume (transport=0x7bf16afe68a0, owner=0x7ba16b001250) at profiles/audio/transport.c:2232
bap = 0x7bf16afe6920
id = <optimized out>
#12 0x0000557666d4493e in acquire (conn=<optimized out>, msg=0x7c716afe1040, data=0x7bf16afe68a0) at profiles/audio/transport.c:912
transport = <optimized out>
owner = 0x7ba16b001250
req = 0x7b916b00d510
id = <optimized out>
#13 acquire (conn=<optimized out>, msg=0x7c716afe1040, data=0x7bf16afe68a0) at profiles/audio/transport.c:887
transport = 0x7bf16afe68a0
owner = <optimized out>
req = 0x0
id = <optimized out>
#14 0x0000557667018e71 in process_message (connection=0x7c916afe0040, message=0x7c716afe1040, method=0x557667312060 <transport_methods>, iface_user_data=<optimized out>) at gdbus/object.c:293
reply = <optimized out>
#15 0x00007f716cc100f4 in dbus_connection_dispatch () from /usr/lib/x86_64-linux-gnu/libdbus-1.so.3
No symbol table info available.
#16 0x00005576670081a8 in message_dispatch (data=0x7c916afe0040) at gdbus/mainloop.c:59
conn = 0x7c916afe0040
#17 0x00007f716cca7b9b in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#18 0x00007f716cca91d7 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#19 0x00007f716cca9577 in g_main_loop_run () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#20 0x00005576671a2259 in mainloop_run () at src/shared/mainloop-glib.c:65
No locals.
#21 0x00005576671a2b8b in mainloop_run_with_signal (func=func@entry=0x557666feaf30 <signal_callback>, user_data=user_data@entry=0x0) at src/shared/mainloop-notify.c:196
data = 0x7ba16afe3670
io = 0x7bb16aff9a50
ret = <optimized out>
#22 0x0000557666d14630 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:1817
context = <optimized out>
err = <optimized out>
sdp_mtu = 0
sdp_flags = <optimized out>
gdbus_flags = <optimized out>
__func__ = "main""
https://github.com/bluez/bluez/pull/2978
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-12-04 8:24 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 22:15 [RFC PATCH BlueZ v3 00/12] Periodic advertising and PAwR over MGMT Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 01/12] doc/mgmt: Add PA and PAwR commands and events Roland Schober
2026-12-04 8:23 ` Periodic advertising and PAwR over MGMT bluez.test.bot
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 02/12] lib/mgmt: Add periodic advertising and PAwR definitions Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 03/12] monitor: Decode PA and PAwR MGMT commands and events Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 04/12] client/mgmt: Fix length of byte arrays with empty entries Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 05/12] client/mgmt: Refuse negative values in byte arrays Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 06/12] client/mgmt: Add pa-params, pa-data and pawr-serve commands Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 07/12] monitor: Add PAwR HCI definitions Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 08/12] emulator/btdev: Check the length of PA commands Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 09/12] emulator/btdev: Keep the advertising set after a timeout Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 10/12] emulator/btdev: Keep advertising sets with PA enabled Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 11/12] emulator/btdev: Add PAwR advertiser Roland Schober
2026-12-03 22:15 ` [RFC PATCH BlueZ v3 12/12] mgmt-tester: Add periodic advertising and PAwR tests Roland Schober
-- strict thread matches above, loose matches on Subject: below --
2026-11-27 8:55 [RFC PATCH BlueZ 1/9] doc/mgmt: Add periodic advertising and PAwR commands and events Roland Schober
2026-11-27 15:37 ` Periodic advertising and PAwR over MGMT bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox