* [PATCH BlueZ v2 1/2] device: Run reverse service discovery on the bonded bearer
@ 2026-11-24 18:11 Simon Mikuda
2026-11-24 18:11 ` [PATCH BlueZ v2 2/2] main.conf: Add 'paired' to ReverseServiceDiscovery Simon Mikuda
2026-11-24 21:02 ` [BlueZ,v2,1/2] device: Run reverse service discovery on the bonded bearer bluez.test.bot
0 siblings, 2 replies; 3+ messages in thread
From: Simon Mikuda @ 2026-11-24 18:11 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda
When a remote bonds with us, reverse service discovery is started after
DISCOVERY_TIMER, but it browses SDP whenever the device supports
BR/EDR, whichever bearer bonded. A dual-mode phone that connects and
bonds over LE is then paged for SDP while only LE is connected. A
browse on one bearer also makes a browse on the other fail with
-EBUSY, as there is a single request per device.
Keep the discovery timer and the browse request per bearer, and
discover SDP on BR/EDR and GATT on LE.
Assisted-by: Claude:claude-opus-5-5
---
Changes in v2:
- change ReverseServiceDiscovery default back to 'true'
src/device.c | 122 +++++++++++++++++++++++++++------------------------
1 file changed, 65 insertions(+), 57 deletions(-)
diff --git a/src/device.c b/src/device.c
index 36a980d1e..40d17bae4 100644
--- a/src/device.c
+++ b/src/device.c
@@ -157,6 +157,8 @@ struct bearer_state {
bool connectable;
time_t last_seen;
time_t last_used;
+ unsigned int discov_timer; /* reverse service discovery timer */
+ struct browse_req *browse; /* service discovery request */
};
struct ltk_info {
@@ -246,9 +248,7 @@ struct btd_device {
bool connectable;
bool cable_pairing;
unsigned int disconn_timer;
- unsigned int discov_timer;
unsigned int temporary_timer; /* Temporary/disappear timer */
- struct browse_req *browse; /* service discover request */
struct bonding_req *bonding;
struct authentication_req *authr; /* authentication request */
uint8_t bonding_status;
@@ -787,8 +787,10 @@ static void browse_request_free(struct browse_req *req)
{
struct btd_device *device = req->device;
- if (device->browse == req)
- device->browse = NULL;
+ if (device->bredr_state.browse == req)
+ device->bredr_state.browse = NULL;
+ if (device->le_state.browse == req)
+ device->le_state.browse = NULL;
if (req->listener_id)
g_dbus_remove_watch(dbus_conn, req->listener_id);
@@ -928,8 +930,10 @@ static void device_free(gpointer user_data)
if (device->disconn_timer)
timeout_remove(device->disconn_timer);
- if (device->discov_timer)
- timeout_remove(device->discov_timer);
+ if (device->bredr_state.discov_timer)
+ timeout_remove(device->bredr_state.discov_timer);
+ if (device->le_state.discov_timer)
+ timeout_remove(device->le_state.discov_timer);
if (device->temporary_timer)
timeout_remove(device->temporary_timer);
@@ -2076,8 +2080,10 @@ void device_request_disconnect(struct btd_device *device, DBusMessage *msg)
if (device->bonding)
bonding_request_cancel(device->bonding);
- if (device->browse)
- browse_request_cancel(device->browse);
+ if (device->bredr_state.browse)
+ browse_request_cancel(device->bredr_state.browse);
+ if (device->le_state.browse)
+ browse_request_cancel(device->le_state.browse);
if (device->att_io) {
g_io_channel_shutdown(device->att_io, FALSE, NULL);
@@ -2660,7 +2666,7 @@ void btd_device_update_allowed_services(struct btd_device *dev)
/* If service discovery is ongoing, let the service discovery complete
* callback call this function.
*/
- if (dev->browse) {
+ if (dev->bredr_state.browse || dev->le_state.browse) {
ba2str(&dev->bdaddr, addr);
DBG("service discovery of %s is ongoing. Skip updating allowed "
"services", addr);
@@ -2801,7 +2807,7 @@ int btd_device_connect_services(struct btd_device *dev, GSList *services)
GSList *l;
uint8_t bdaddr_type;
- if (dev->pending || dev->connect || dev->browse)
+ if (dev->pending || dev->connect || dev->bredr_state.browse)
return -EBUSY;
if (!btd_adapter_get_powered(dev->adapter))
@@ -2852,7 +2858,7 @@ DBusMessage *device_connect_profiles(struct btd_device *dev,
DBG("%s %s, client %s", dev->path, uuid ? uuid : "(all)",
dbus_message_get_sender(msg));
- if (dev->pending || dev->connect || dev->browse)
+ if (dev->pending || dev->connect || dev->bredr_state.browse)
return btd_error_in_progress_str(msg, ERR_BREDR_CONN_BUSY);
if (!btd_adapter_get_powered(dev->adapter)) {
@@ -3206,7 +3212,7 @@ static void browse_request_complete(struct browse_req *req, uint8_t type,
/* if successfully resolved services we need to free browsing request
* before passing message back to connect functions, otherwise
- * device->browse is set and "InProgress" error is returned instead
+ * the bearer's browse is set and "InProgress" error is returned instead
* of actually connecting services
*/
msg = dbus_message_ref(req->msg);
@@ -3251,7 +3257,7 @@ static void device_svc_resolved(struct btd_device *dev, uint8_t browse_type,
uint8_t bdaddr_type, int err)
{
struct bearer_state *state = get_state(dev, bdaddr_type);
- struct browse_req *req = dev->browse;
+ struct browse_req *req = state->browse;
DBG("%s err %d", dev->path, err);
@@ -5658,8 +5664,10 @@ void device_remove(struct btd_device *device, gboolean remove_stored)
device_cancel_bonding(device, status);
}
- if (device->browse)
- browse_request_cancel(device->browse);
+ if (device->bredr_state.browse)
+ browse_request_cancel(device->bredr_state.browse);
+ if (device->le_state.browse)
+ browse_request_cancel(device->le_state.browse);
while (device->services != NULL) {
struct btd_service *service = device->services->data;
@@ -6364,7 +6372,7 @@ static void att_disconnected_cb(int err, void *user_data)
DBG("");
- if (device->browse)
+ if (device->le_state.browse)
goto done;
DBG("%s (%d)", strerror(err), err);
@@ -6392,7 +6400,7 @@ done:
static void register_gatt_services(struct btd_device *device)
{
- struct browse_req *req = device->browse;
+ struct browse_req *req = device->le_state.browse;
GSList *services = NULL;
if (!bt_gatt_client_is_ready(device->client))
@@ -6797,8 +6805,8 @@ static void att_connect_cb(GIOChannel *io, GError *gerr, gpointer user_data)
adapter_connect_list_add(device->adapter, device);
}
- if (device->browse)
- browse_request_complete(device->browse,
+ if (device->le_state.browse)
+ browse_request_complete(device->le_state.browse,
BROWSE_GATT,
device->bdaddr_type,
-ECONNABORTED);
@@ -6924,15 +6932,17 @@ static struct browse_req *browse_request_new(struct btd_device *device,
DBusMessage *msg)
{
struct browse_req *req;
+ struct bearer_state *state = type == BROWSE_SDP ?
+ &device->bredr_state : &device->le_state;
- if (device->browse)
+ if (state->browse)
return NULL;
req = g_new0(struct browse_req, 1);
req->device = device;
req->type = type;
- device->browse = req;
+ state->browse = req;
if (!msg)
return req;
@@ -7051,16 +7061,7 @@ static int device_browse_sdp(struct btd_device *device, DBusMessage *msg)
static gboolean device_is_browsing(struct btd_device *device,
uint8_t bdaddr_type)
{
- if (!device->browse)
- return FALSE;
-
- if (bdaddr_type == BDADDR_BREDR && device->browse->type == BROWSE_SDP)
- return TRUE;
-
- if (bdaddr_type != BDADDR_BREDR && device->browse->type == BROWSE_GATT)
- return TRUE;
-
- return FALSE;
+ return get_state(device, bdaddr_type)->browse != NULL;
}
void device_cancel_browse(struct btd_device *device, uint8_t bdaddr_type)
@@ -7078,12 +7079,13 @@ void device_cancel_browse(struct btd_device *device, uint8_t bdaddr_type)
else
attio_cleanup(device);
- browse_request_free(device->browse);
+ browse_request_free(get_state(device, bdaddr_type)->browse);
}
int device_discover_services(struct btd_device *device,
uint8_t bdaddr_type, DBusMessage *msg)
{
+ struct bearer_state *state = get_state(device, bdaddr_type);
int err;
if (bdaddr_type == BDADDR_BREDR)
@@ -7091,9 +7093,9 @@ int device_discover_services(struct btd_device *device,
else
err = device_browse_gatt(device, msg);
- if (err == 0 && device->discov_timer) {
- timeout_remove(device->discov_timer);
- device->discov_timer = 0;
+ if (err == 0 && state->discov_timer) {
+ timeout_remove(state->discov_timer);
+ state->discov_timer = 0;
}
return err;
@@ -7435,16 +7437,22 @@ bool device_is_connectable(struct btd_device *device)
return state->connectable;
}
-static bool start_discovery_cb(gpointer user_data)
+static bool start_sdp_discovery_cb(gpointer user_data)
{
struct btd_device *device = user_data;
- if (device->bredr)
- device_browse_sdp(device, NULL);
- else
- device_browse_gatt(device, NULL);
+ device->bredr_state.discov_timer = 0;
+ device_browse_sdp(device, NULL);
+
+ return FALSE;
+}
+
+static bool start_gatt_discovery_cb(gpointer user_data)
+{
+ struct btd_device *device = user_data;
- device->discov_timer = 0;
+ device->le_state.discov_timer = 0;
+ device_browse_gatt(device, NULL);
return FALSE;
}
@@ -7618,18 +7626,18 @@ void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,
DBUS_TYPE_INVALID);
}
bonding_request_free(bonding);
- } else if (!state->svc_resolved) {
- if (!device->browse && !device->discov_timer &&
- btd_opts.reverse_discovery) {
- /* If we are not initiators and there is no currently
- * active discovery or discovery timer, set discovery
- * timer */
- DBG("setting timer for reverse service discovery");
- device->discov_timer = timeout_add_seconds(
- DISCOVERY_TIMER,
- start_discovery_cb,
- device, NULL);
- }
+ } else if (!state->svc_resolved && !state->browse &&
+ !state->discov_timer && btd_opts.reverse_discovery) {
+ /* If we are not initiators and there is no currently
+ * active discovery or discovery timer, set discovery
+ * timer on the bearer that was bonded.
+ */
+ DBG("setting timer for reverse service discovery");
+ state->discov_timer = timeout_add_seconds(DISCOVERY_TIMER,
+ bdaddr_type == BDADDR_BREDR ?
+ start_sdp_discovery_cb :
+ start_gatt_discovery_cb,
+ device, NULL);
}
}
@@ -7667,12 +7675,12 @@ unsigned int device_wait_for_svc_complete(struct btd_device *dev,
if (state->svc_resolved || !btd_opts.reverse_discovery)
cb->idle_id = g_idle_add(svc_idle_cb, cb);
else {
- if (dev->discov_timer > 0)
- timeout_remove(dev->discov_timer);
+ if (dev->bredr_state.discov_timer > 0)
+ timeout_remove(dev->bredr_state.discov_timer);
- dev->discov_timer = timeout_add_seconds(
+ dev->bredr_state.discov_timer = timeout_add_seconds(
0,
- start_discovery_cb,
+ start_sdp_discovery_cb,
dev, NULL);
}
base-commit: 1608f836188610aabeff5a3164169ebe0360e443
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH BlueZ v2 2/2] main.conf: Add 'paired' to ReverseServiceDiscovery
2026-11-24 18:11 [PATCH BlueZ v2 1/2] device: Run reverse service discovery on the bonded bearer Simon Mikuda
@ 2026-11-24 18:11 ` Simon Mikuda
2026-11-24 21:02 ` [BlueZ,v2,1/2] device: Run reverse service discovery on the bonded bearer bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: Simon Mikuda @ 2026-11-24 18:11 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda
Reverse GATT discovery on a device that connected to us but is not
paired reads characteristics that may need encryption. The remote
answers those with ATT error Insufficient Authentication (0x05) or
Insufficient Encryption (0x0f), and bt_att then raises the link's
security level to retry the read, which sends a pairing request to the
device although nobody asked for pairing.
Add 'paired' in addition to true and false to ReverseServiceDiscovery:
with it, reverse discovery waits until the device is paired, and the
GATT client of an LE link that connected without one is started once
it is. The default stays true.
Assisted-by: Claude:claude-opus-5-5
---
src/btd.h | 8 +++++++-
src/device.c | 26 +++++++++++++++++++++++---
src/main.c | 29 ++++++++++++++++++++++++++---
src/main.conf | 3 +++
4 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/src/btd.h b/src/btd.h
index 9bf310271..2c897756c 100644
--- a/src/btd.h
+++ b/src/btd.h
@@ -48,6 +48,12 @@ enum bt_gatt_export_t {
BT_GATT_EXPORT_READ_WRITE,
};
+enum reverse_discovery_t {
+ REVERSE_DISCOVERY_NEVER,
+ REVERSE_DISCOVERY_ALWAYS,
+ REVERSE_DISCOVERY_PAIRED,
+};
+
struct btd_br_defaults {
uint16_t page_scan_type;
uint16_t page_scan_interval;
@@ -144,7 +150,7 @@ struct btd_opts {
struct btd_defaults defaults;
- bool reverse_discovery;
+ uint8_t reverse_discovery;
bool name_resolv;
bool debug_keys;
bool fast_conn;
diff --git a/src/device.c b/src/device.c
index 40d17bae4..3ece82c8d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -350,6 +350,18 @@ bool btd_device_is_initiator(struct btd_device *dev)
return dev->att_io ? true : false;
}
+static bool reverse_discovery(struct btd_device *dev, uint8_t bdaddr_type)
+{
+ switch (btd_opts.reverse_discovery) {
+ case REVERSE_DISCOVERY_ALWAYS:
+ return true;
+ case REVERSE_DISCOVERY_PAIRED:
+ return device_is_paired(dev, bdaddr_type);
+ default:
+ return false;
+ }
+}
+
static GSList *find_service_with_profile(GSList *list, struct btd_profile *p)
{
GSList *l;
@@ -6471,7 +6483,8 @@ static void gatt_client_init(struct btd_device *device)
gatt_client_cleanup(device);
- if (!btd_device_is_initiator(device) && !btd_opts.reverse_discovery) {
+ if (!btd_device_is_initiator(device) &&
+ !reverse_discovery(device, device->bdaddr_type)) {
DBG("Reverse service discovery disabled: skipping GATT client");
return;
}
@@ -6970,6 +6983,12 @@ static int device_browse_gatt(struct btd_device *device, DBusMessage *msg)
if (!req)
return -EBUSY;
+ /* Connected without a client, as reverse discovery waited for the
+ * device to be paired: start it on the existing link.
+ */
+ if (!device->client && device->att)
+ gatt_client_init(device);
+
if (device->client) {
/*
* If discovery has not yet completed, then wait for gatt-client
@@ -7627,7 +7646,8 @@ void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,
}
bonding_request_free(bonding);
} else if (!state->svc_resolved && !state->browse &&
- !state->discov_timer && btd_opts.reverse_discovery) {
+ !state->discov_timer &&
+ reverse_discovery(device, bdaddr_type)) {
/* If we are not initiators and there is no currently
* active discovery or discovery timer, set discovery
* timer on the bearer that was bonded.
@@ -7672,7 +7692,7 @@ unsigned int device_wait_for_svc_complete(struct btd_device *dev,
dev->svc_callbacks = g_slist_prepend(dev->svc_callbacks, cb);
- if (state->svc_resolved || !btd_opts.reverse_discovery)
+ if (state->svc_resolved || !reverse_discovery(dev, BDADDR_BREDR))
cb->idle_id = g_idle_add(svc_idle_cb, cb);
else {
if (dev->bredr_state.discov_timer > 0)
diff --git a/src/main.c b/src/main.c
index 3a051c5a4..3672bb707 100644
--- a/src/main.c
+++ b/src/main.c
@@ -924,6 +924,30 @@ static bool parse_config_bool(GKeyFile *config, const char *group,
return true;
}
+static void parse_reverse_discovery(GKeyFile *config)
+{
+ char *str = NULL;
+ bool val;
+
+ if (parse_config_bool(config, "General", "ReverseServiceDiscovery",
+ &val)) {
+ btd_opts.reverse_discovery = val ? REVERSE_DISCOVERY_ALWAYS :
+ REVERSE_DISCOVERY_NEVER;
+ return;
+ }
+
+ if (!parse_config_string(config, "General", "ReverseServiceDiscovery",
+ &str))
+ return;
+
+ if (!strcmp(str, "paired"))
+ btd_opts.reverse_discovery = REVERSE_DISCOVERY_PAIRED;
+ else
+ warn("Invalid value for ReverseServiceDiscovery: %s", str);
+
+ g_free(str);
+}
+
static void parse_privacy(GKeyFile *config)
{
char *str = NULL;
@@ -1096,8 +1120,7 @@ static void parse_general(GKeyFile *config)
&btd_opts.pairto,
0, UINT32_MAX);
parse_device_id(config);
- parse_config_bool(config, "General", "ReverseServiceDiscovery",
- &btd_opts.reverse_discovery);
+ parse_reverse_discovery(config);
parse_config_bool(config, "General", "NameResolving",
&btd_opts.name_resolv);
parse_config_bool(config, "General", "DebugKeys",
@@ -1473,7 +1496,7 @@ static void init_defaults(void)
btd_opts.pairto = DEFAULT_PAIRABLE_TIMEOUT;
btd_opts.discovto = DEFAULT_DISCOVERABLE_TIMEOUT;
btd_opts.tmpto = DEFAULT_TEMPORARY_TIMEOUT;
- btd_opts.reverse_discovery = TRUE;
+ btd_opts.reverse_discovery = REVERSE_DISCOVERY_ALWAYS;
btd_opts.name_resolv = TRUE;
btd_opts.debug_keys = FALSE;
btd_opts.refresh_discovery = TRUE;
diff --git a/src/main.conf b/src/main.conf
index c9906148d..6e9a974f7 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -34,6 +34,9 @@
# BITE tester doesn't like us doing reverse SDP for some test cases, for LE
# this disables the GATT client functionally so it can be used in system which
# can only operate as peripheral (see also GATT Client option).
+# Possible values: 'true', 'false' or 'paired'. With 'paired' it is done only
+# once the device is paired, so that reading the services of a device that
+# connected to us does not start pairing when they need encryption.
# Defaults to 'true'.
#ReverseServiceDiscovery = true
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ,v2,1/2] device: Run reverse service discovery on the bonded bearer
2026-11-24 18:11 [PATCH BlueZ v2 1/2] device: Run reverse service discovery on the bonded bearer Simon Mikuda
2026-11-24 18:11 ` [PATCH BlueZ v2 2/2] main.conf: Add 'paired' to ReverseServiceDiscovery Simon Mikuda
@ 2026-11-24 21:02 ` bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-11-24 21:02 UTC (permalink / raw)
To: linux-bluetooth, simon.mikuda
[-- Attachment #1: Type: text/plain, Size: 6355 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/1221204/
---Test result---
Test Summary:
CheckPatch PASS 1.23 seconds
GitLint PASS 0.67 seconds
BuildEll PASS 20.66 seconds
BluezMake PASS 314.16 seconds
CheckSmatch WARNING 321.63 seconds
bluezmakeextell PASS 102.64 seconds
TestFunctional FAIL 1230.58 seconds
IncrementalBuild PASS 343.73 seconds
ScanBuild PASS 1212.88 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/main.c: note: in included file (through src/device.h):
##############################
Test: TestFunctional - FAIL
Desc: Run test-functional
Output:
FAIL functional.test_bap::test_bap_unicast_transport_acquire[hosts4-vm2]: pytest_bluezenv.rpc.RemoteError: <pexpect.popen_spawn.PopenSpawn object at 0x7f9254346a50>
searcher: searcher_re:
0: re.compile(b'\tTransport (/org/bluez/\\S+/fd0)')
<pexpect.popen_spawn.PopenSpawn object at 0x7f9254346a50>
searcher: searcher_re:
0: re.compile(b'\tTransport (/org/bluez/\\S+/fd0)')
Remote traceback:
Traceback (most recent call last):
File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/rpc.py", line 102, in server_stream
result = method(*msg["a"], **msg["kw"])
File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/env.py", line 256, in call_plugin
return getattr(self.plugins[name], method)(*a, **kw)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/host_plugins.py", line 441, in expect
ret = ctl.expect(*a, **kw)
File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 354, in expect
return self.expect_list(compiled_pattern_list,
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
timeout, searchwindowsize, async_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 383, in expect_list
return exp.expect_loop(timeout)
~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 181, in expect_loop
return self.timeout(e)
~~~~~~~~~~~~^^^
File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 144, in timeout
raise exc
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f9254346a50>
searcher: searcher_re:
0: re.compile(b'\tTransport (/org/bluez/\\S+/fd0)')
<pexpect.popen_spawn.PopenSpawn object at 0x7f9254346a50>
searcher: searcher_re:
0: re.compile(b'\tTransport (/org/bluez/\\S+/fd0)')
FAIL functional.test_bap::test_bap_unicast_transport_acquire[hosts4-vm2]: failed on teardown with "pytest_bluezenv.utils.SanitizerWarning: [btvirt] ==151984==ERROR: AddressSanitizer: heap-use-after-free on address 0x777c177e3010 at pc 0x5a423b71944e bp 0x7ffcb09fde40 sp 0x7ffcb09fde30
READ of size 4 at 0x777c177e3010 thread T0
#0 0x5a423b71944d in timeout_callback emulator/timeout.c:47
#1 0x5a423b7284f5 in timeout_callback src/shared/mainloop.c:271
#2 0x5a423b729626 in mainloop_run src/shared/mainloop.c:125
#3 0x5a423b72bf4a in mainloop_run_with_signal src/shared/mainloop-notify.c:196
#4 0x5a423b667179 in main emulator/main.c:417
#5 0x7b3c18843600 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:59
#6 0x7b3c18843717 in __libc_start_main_impl ../csu/libc-start.c:360
#7 0x5a423b667ff4 in _start (/home/runner/work/bluez/bluez/src/src/emulator/btvirt+0x152ff4) (BuildId: ed53605ba86d207d9357e9c6c40b6f2098898adb)
0x777c177e3010 is located 0 bytes inside of 40-byte region [0x777c177e3010,0x777c177e3038)
freed by thread T0 here:
#0 0x7b3c191813ff in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:51
#1 0x5a423b72824a in timeout_destroy src/shared/mainloop.c:252
previously allocated by thread T0 here:
#0 0x7b3c1918260f in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:67
#1 0x5a423b71bba5 in util_malloc src/shared/util.c:46
SUMMARY: AddressSanitizer: heap-use-after-free emulator/timeout.c:47 in timeout_callback
Shadow bytes around the buggy address:
0x777c177e2d80: fa fa fd fd fd fd fd fd fa fa fd fd fd fd fd fd
0x777c177e2e00: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa
0x777c177e2e80: fa fa fd fd fd fd fd fd fa fa fd fd fd fd fd fd
0x777c177e2f00: fa fa fd fd fd fd fd fd fa fa fd fd fd fd fd fa
0x777c177e2f80: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fd
=>0x777c177e3000: fa fa[fd]fd fd fd fd fa fa fa fd fd fd fd fd fd
0x777c177e3080: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fd
0x777c177e3100: fa fa 00 00 00 00 00 00 fa fa 00 00 00 00 00 00
0x777c177e3180: fa fa fd fd fd fd fd fa fa fa fa fa fa fa fa fa
0x777c177e3200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x777c177e3280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
..."
https://github.com/bluez/bluez/pull/2912
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-24 21:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 18:11 [PATCH BlueZ v2 1/2] device: Run reverse service discovery on the bonded bearer Simon Mikuda
2026-11-24 18:11 ` [PATCH BlueZ v2 2/2] main.conf: Add 'paired' to ReverseServiceDiscovery Simon Mikuda
2026-11-24 21:02 ` [BlueZ,v2,1/2] device: Run reverse service discovery on the bonded bearer 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