* [PATCH v1] obexd: fix PBAP PullPhoneBook failure with ebook backend
@ 2026-05-22 6:03 Zhiyuan Sheng
2026-05-22 8:51 ` [v1] " bluez.test.bot
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Zhiyuan Sheng @ 2026-05-22 6:03 UTC (permalink / raw)
To: linux-bluetooth; +Cc: cheng.jiang, shuai.zhang
phonebook_pull() in phonebook-ebook.c does not set *err = 0 on the
success path, unlike phonebook-tracker.c and phonebook-dummy.c. The
caller vobject_pull_open() in pbap.c declares 'ret' without
initialization and passes &ret to phonebook_pull(), so 'ret' retains
an indeterminate stack value when the ebook backend is in use. The
subsequent 'if (ret < 0)' check then incorrectly triggers and rejects
the request with Internal Server Error.
Fix this by setting *err = 0 on success in phonebook-ebook.c, and
initialize 'ret' to 0 in vobject_pull_open() as a defensive measure
to guard against any backend that omits this assignment.
Signed-off-by: Zhiyuan Sheng <zhiyuan.sheng@oss.qualcomm.com>
---
obexd/plugins/pbap.c | 2 +-
obexd/plugins/phonebook-ebook.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c
index 74976890d..9f8684863 100644
--- a/obexd/plugins/pbap.c
+++ b/obexd/plugins/pbap.c
@@ -661,7 +661,7 @@ static void *vobject_pull_open(const char *name, int oflag, mode_t mode,
{
struct pbap_session *pbap = context;
phonebook_cb cb;
- int ret;
+ int ret = 0;
void *request;
DBG("name %s context %p maxlistcount %d", name, context,
diff --git a/obexd/plugins/phonebook-ebook.c b/obexd/plugins/phonebook-ebook.c
index d772edca0..5fc0498c1 100644
--- a/obexd/plugins/phonebook-ebook.c
+++ b/obexd/plugins/phonebook-ebook.c
@@ -262,6 +262,9 @@ void *phonebook_pull(const char *name, const struct apparam_field *params,
data->query = e_book_query_to_string(query);
e_book_query_unref(query);
+ if (err)
+ *err = 0;
+
return data;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* RE: [v1] obexd: fix PBAP PullPhoneBook failure with ebook backend
2026-05-22 6:03 [PATCH v1] obexd: fix PBAP PullPhoneBook failure with ebook backend Zhiyuan Sheng
@ 2026-05-22 8:51 ` bluez.test.bot
2026-06-05 9:39 ` [PATCH v1] " Bastien Nocera
2026-06-05 16:30 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2026-05-22 8:51 UTC (permalink / raw)
To: linux-bluetooth, zhiyuan.sheng
[-- Attachment #1: Type: text/plain, Size: 826 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1099150
---Test result---
Test Summary:
CheckPatch PASS 0.49 seconds
GitLint PASS 0.34 seconds
BuildEll PASS 20.38 seconds
BluezMake PASS 679.47 seconds
CheckSmatch PASS 362.36 seconds
bluezmakeextell PASS 187.61 seconds
IncrementalBuild PASS 668.91 seconds
ScanBuild PASS 1076.15 seconds
https://github.com/bluez/bluez/pull/2145
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] obexd: fix PBAP PullPhoneBook failure with ebook backend
2026-05-22 6:03 [PATCH v1] obexd: fix PBAP PullPhoneBook failure with ebook backend Zhiyuan Sheng
2026-05-22 8:51 ` [v1] " bluez.test.bot
@ 2026-06-05 9:39 ` Bastien Nocera
2026-06-05 16:30 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: Bastien Nocera @ 2026-06-05 9:39 UTC (permalink / raw)
To: Zhiyuan Sheng, linux-bluetooth; +Cc: cheng.jiang, shuai.zhang
On Fri, 2026-05-22 at 14:03 +0800, Zhiyuan Sheng wrote:
> phonebook_pull() in phonebook-ebook.c does not set *err = 0 on the
> success path, unlike phonebook-tracker.c and phonebook-dummy.c. The
> caller vobject_pull_open() in pbap.c declares 'ret' without
> initialization and passes &ret to phonebook_pull(), so 'ret' retains
> an indeterminate stack value when the ebook backend is in use. The
> subsequent 'if (ret < 0)' check then incorrectly triggers and rejects
> the request with Internal Server Error.
>
> Fix this by setting *err = 0 on success in phonebook-ebook.c, and
> initialize 'ret' to 0 in vobject_pull_open() as a defensive measure
> to guard against any backend that omits this assignment.
>
> Signed-off-by: Zhiyuan Sheng <zhiyuan.sheng@oss.qualcomm.com>
Looks good to me
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] obexd: fix PBAP PullPhoneBook failure with ebook backend
2026-05-22 6:03 [PATCH v1] obexd: fix PBAP PullPhoneBook failure with ebook backend Zhiyuan Sheng
2026-05-22 8:51 ` [v1] " bluez.test.bot
2026-06-05 9:39 ` [PATCH v1] " Bastien Nocera
@ 2026-06-05 16:30 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2026-06-05 16:30 UTC (permalink / raw)
To: Zhiyuan Sheng; +Cc: linux-bluetooth, cheng.jiang, shuai.zhang
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 22 May 2026 14:03:12 +0800 you wrote:
> phonebook_pull() in phonebook-ebook.c does not set *err = 0 on the
> success path, unlike phonebook-tracker.c and phonebook-dummy.c. The
> caller vobject_pull_open() in pbap.c declares 'ret' without
> initialization and passes &ret to phonebook_pull(), so 'ret' retains
> an indeterminate stack value when the ebook backend is in use. The
> subsequent 'if (ret < 0)' check then incorrectly triggers and rejects
> the request with Internal Server Error.
>
> [...]
Here is the summary with links:
- [v1] obexd: fix PBAP PullPhoneBook failure with ebook backend
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7a0c8ebf91e6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-05 16:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 6:03 [PATCH v1] obexd: fix PBAP PullPhoneBook failure with ebook backend Zhiyuan Sheng
2026-05-22 8:51 ` [v1] " bluez.test.bot
2026-06-05 9:39 ` [PATCH v1] " Bastien Nocera
2026-06-05 16:30 ` patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox