[PATCH 0/1] Use a log identity always valid while logging
Christian Meusel <[email protected]>
| Newsgroups | dev.linux.lists.connman |
|---|---|
| Message-ID | <[email protected]> |
I encountered garbled and changing log identifiers from connmand 1.42
running on Yocto Kirkstone.
Feb 09 02:40:18 foo time[590]: Connection Manager version 1.42
Feb 09 02:40:18 foo time[590]: ../connman-1.42/src/dbus.c:__connman_dbus_init()
Feb 09 02:40:18 foo time[590]: ../connman-1.42/src/main.c:parse_config() parsing main.conf
Feb 09 02:40:18 foo time[590]: Online check disabled by main config.
Feb 09 02:40:19 foo U[590]: ../connman-1.42/src/inotify.c:__connman_inotify_init()
Feb 09 02:40:19 foo U[590]: ../connman-1.42/src/technology.c:__connman_technology_init()
This variant is slightly patched (see
https://git.yoctoproject.org/poky/tree/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch)
which creates a use-after-free situation. But nevertheless there is no
lifetime requirement communicated for the 'program' argument passed to
'__connman_log_init' and on the other hand 'basename' might as well
return a pointer to an internal buffer.
In either case, a locally allocated log identity string will prevent
potential issues.
Best regards,
Christian
Christian Meusel (1):
log: Use a log identity always valid while logging
src/log.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--
2.34.1