Page MenuHomePhabricator

eldbus: check message serial before using
ClosedPublic

Authored by kimcinoo on Jul 30 2017, 11:20 PM.

Details

Summary

Whatever the dbus_connection_send_with_reply returns, the serial value
should be checked, because if the seral value is invalid a process could be aborted.

There is backtrace as below.
#0 GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1 0xb66973f0 in
GI_abort () at abort.c:89
#2 0xb6040254 in _dbus_abort () at dbus-sysdeps.c:91
#3 0xb603974c in _dbus_warn_check_failed at dbus-internals.c:275
#4 0xb602e59c in dbus_message_set_reply_serial at dbus-message.c:1252
#5 0xb6031056 in dbus_message_new_error at dbus-message.c:1631
#6 0xb69b3d7c in eldbus_message_error_new at lib/eldbus/eldbus_message.c:875
#7 0xb69b64d4 in _eldbus_connection_send at lib/eldbus/eldbus_pending.c:162
#8 0xb69ac0e4 in _eldbus_proxy_send at lib/eldbus/eldbus_proxy.c:551
#9 0xb69ada2a in eldbus_proxy_call at lib/eldbus/eldbus_proxy.c:627
#10 0xb69ade88 in eldbus_proxy_property_get at lib/eldbus/eldbus_proxy.c:680

The dbus_connection_send_with_reply could return TRUE
even though it has a problem. Please refer to following comment:

/* Refuse to send fds on a connection that cannot handle
   them. Unfortunately we cannot return a proper error here, so
   the best we can do is return TRUE but leave *pending_return
   as NULL. */
Test Plan

There is not a exact reproduce step. If the Tizen login manager is relaunched
repeatedly, then the dbus and other service processes are relaunched.
If a service process tries to use dbus when the dbus has problem as above,
then it could be possilbe to get above backtrace.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kimcinoo created this revision.Jul 30 2017, 11:20 PM
raster accepted this revision.Jul 30 2017, 11:53 PM

oh really? it aborts? libdbus aborts? fantastic. not very nice of it... so i'd consider this a bug fix.

This revision is now accepted and ready to land.Jul 30 2017, 11:53 PM
This revision was automatically updated to reflect the committed changes.
zehortigoza edited edge metadata.Jul 31 2017, 10:32 AM

LGTM, I would just say to add "static" to _eldbus_message_error_get()