summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-06-09Prepare version 1.12.16dbus-1.12.16Simon McVittie2-4/+17
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-09test: Add basic test coverage for DBUS_COOKIE_SHA1Simon McVittie7-3/+184
We don't actually complete successful authentication, because that would require us to generate a cookie and compute the correct SHA1, which is difficult to do in a deterministic authentication script. However, we do assert that dbus#269 (CVE-2019-12749) has been fixed. Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-09auth: Reject DBUS_COOKIE_SHA1 for users other than the server ownerSimon McVittie1-0/+32
The DBUS_COOKIE_SHA1 authentication mechanism aims to prove ownership of a shared home directory by having the server write a secret "cookie" into a .dbus-keyrings subdirectory of the desired identity's home directory with 0700 permissions, and having the client prove that it can read the cookie. This never actually worked for non-malicious clients in the case where server uid != client uid (unless the server and client both have privileges, such as Linux CAP_DAC_OVERRIDE or traditional Unix uid 0) because an unprivileged server would fail to write out the cookie, and an unprivileged client would be unable to read the resulting file owned by the server. Additionally, since dbus 1.7.10 we have checked that ~/.dbus-keyrings is owned by the uid of the server (a side-effect of a check added to harden our use of XDG_RUNTIME_DIR), further ruling out successful use by a non-malicious client with a uid differing from the server's. Joe Vennix of Apple Information Security discovered that the implementation of DBUS_COOKIE_SHA1 was susceptible to a symbolic link attack: a malicious client with write access to its own home directory could manipulate a ~/.dbus-keyrings symlink to cause the DBusServer to read and write in unintended locations. In the worst case this could result in the DBusServer reusing a cookie that is known to the malicious client, and treating that cookie as evidence that a subsequent client connection came from an attacker-chosen uid, allowing authentication bypass. This is mitigated by the fact that by default, the well-known system dbus-daemon (since 2003) and the well-known session dbus-daemon (in stable releases since dbus 1.10.0 in 2015) only accept the EXTERNAL authentication mechanism, and as a result will reject DBUS_COOKIE_SHA1 at an early stage, before manipulating cookies. As a result, this vulnerability only applies to: * system or session dbus-daemons with non-standard configuration * third-party dbus-daemon invocations such as at-spi2-core (although in practice at-spi2-core also only accepts EXTERNAL by default) * third-party uses of DBusServer such as the one in Upstart Avoiding symlink attacks in a portable way is difficult, because APIs like openat() and Linux /proc/self/fd are not universally available. However, because DBUS_COOKIE_SHA1 already doesn't work in practice for a non-matching uid, we can solve this vulnerability in an easier way without regressions, by rejecting it early (before looking at ~/.dbus-keyrings) whenever the requested identity doesn't match the identity of the process hosting the DBusServer. Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/269 Closes: CVE-2019-12749
2019-05-17Start 1.12.16 developmentSimon McVittie2-1/+6
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-05-17Release 1.12.14dbus-1.12.14Simon McVittie2-3/+5
2019-05-14apply default deny own policysubmit/tizen/20190530.011453accepted/tizen/unified/20190602.221846sanghyeok.oh1-1/+1
Change default own policy from allow to deny. Change-Id: Ifde07a31ea3e6b8c97a6b7aee093ff9bf67c301c Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-05-13Update NEWSSimon McVittie1-1/+36
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-05-13bus: Try to raise soft fd limit to match hard limitSimon McVittie4-34/+44
Linux systems have traditionally set the soft limit to 1024 and the hard limit to 4096. Recent versions of systemd keep the soft fd limit at 1024 to avoid breaking programs that still use select(), but raise the hard limit to 512*1024, while in recent Debian versions a complicated interaction between components gives a soft limit of 1024 and a hard limit of 1024*1024. If we can, we might as well elevate our soft limit to match the hard limit, minimizing the chance that we will run out of file descriptor slots. Unlike the previous code to raise the hard and soft limits to at least 65536, we do this even if we don't have privileges: privileges are unnecessary to raise the soft limit up to the hard limit. If we *do* have privileges, we also continue to raise the hard and soft limits to at least 65536 if they weren't already that high, making it harder to carry out a denial of service attack on the system bus on systems that use the traditional limit (CVE-2014-7824). As was previously the case on the system bus, we'll drop the limits back to our initial limits before we execute a subprocess for traditional (non-systemd) activation, if enabled. systemd activation doesn't involve us starting subprocesses at all, so in both cases activated services will still inherit the same limits they did previously. This change also fixes a bug when the hard limit is very large but the soft limit is not, for example seen as a regression when upgrading to systemd >= 240 (Debian #928877). In such environments, dbus-daemon would previously have changed its fd limit to 64K soft/64K hard. Because this hard limit is less than its original hard limit, it was unable to restore its original hard limit as intended when carrying out traditional activation, leaving activated subprocesses with unintended limits (while logging a warning). Reviewed-by: Lennart Poettering <lennart@poettering.net> [smcv: Correct a comment based on Lennart's review, reword commit message] Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 7eacbfece70f16bb54d0f3ac51f87ae398759ef5) [smcv: Mention that this also fixes Debian #928877]
2019-05-13cmake: Avoid overwriting PKG_CONFIG_PATH env varClemens Lang1-0/+27
The CMake config file installed by DBus will run in the context of other projects. Consequently, changing the value of the PKG_CONFIG_DIR, PKG_CONFIG_PATH or PKG_CONFIG_LIBDIR environment variables will affect any further calls to pkg-config made by such projects, which can cause problems. A common case of this happening are pkg-config files installed in usr/share/pkgconfig for .pc files that are architecture-independent, as for example systemd does. Avoid clobbering the environment variables by saving and restoring their values. Note that for some of the variables, setting them to an empty string is different from not setting them at all. Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de> (cherry picked from commit 3525cc045d4c683dfc6048f5be795cc372c323a3) Closes: dbus#267
2019-05-09coverity fixsanghyeok.oh3-13/+33
Change-Id: Iac35795aaa9a0640c83b59ddb6fb5dc18435746f Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-05-07tizen: Add additional unit for "unified" user sessionsubmit/tizen/20190509.015828accepted/tizen/unified/20190510.111111Mateusz Moscicki5-1/+43
The unified user session is about moving user session units, managed by systemd --user, to main systemd, where it's managed as part of newly created user@.target. user@.target will contain same units as previously available in user/, with same UID and environment setup. systemd instance is used for unit to be able to specify UID (inherited from user@.target). The rationale behind this work is following: * VD requirement to remove user session support * boot time optimization requirements, due to: + 'systemd --user' taking 1s its own startup that could be used for unit startup + ability to better rearrange units if these managed by one systemd instance Unit installed by this commit will not be used till user login mechanism will be changed in systemd package (via changing pam_systemd to start user@.target, rather than user@.service). Change-Id: I524768f116ca91d812ae0884adbb300e52817975
2019-04-29Remove DefaultDependencies=no from dbus.socketsubmit/tizen/20190502.044443accepted/tizen/unified/20190503.075041INSUN PYO1-1/+0
Change-Id: I1f1b72c237451aa04da92195c696a0387cad9e18
2019-04-29dbus-daemon: Don't create /tmp/dbus_launchsubmit/tizen/20190429.043102accepted/tizen/unified/20190430.113428INSUN PYO2-6/+1
VD only uses /tmp/dbus_launch - VD target: use /tmp/dbus_launch generated by systemd in kdbus - VD emulator: use /tmp/dbus_launch generated by dbus-daemon that uses VD plugin drop-in Change-Id: If2120a016015ee76c589416dab7cc6c96ee21b05
2019-04-25Add dependency to security-manager.socketsubmit/tizen/20190426.023004accepted/tizen/unified/20190429.103648INSUN PYO1-0/+2
dbus-daemon connect to security-manager.service to get getgrouplist. (gdb) bt 0 security_manager_groups_get_for_user (uid=0, groups=groups@entry=0xfffef754, groups_count=groups_count@entry=0xfffef758) at /usr/src/debug/security-manager-1.5.3/src/client/client-security-manager.cpp:1391 1 0xf71faa14 in _nss_securitymanager_initgroups_dyn (user=0x443f70 "root", group_gid=<optimized out>, start=0xfffef7cc, size=0xfffef800, groupsp=0xfffef804, limit=-1, errnop=0xf77ea11c) at /usr/src/debug/security-manager-1.5.3/src/nss/nss_securitymanager.cpp:109 2 0xf759f204 in internal_getgrouplist (user=0x1 <error: Cannot access memory at address 0x1>, user@entry=0x443f70 "root", group=124, group@entry=0, size=0xfffef800, size@entry=0xfffef7f8, groupsp=0xfffef804, groupsp@entry=0xfffef7fc, limit=limit@entry=-1) at initgroups.c:112 3 0xf759f45c in getgrouplist (user=user@entry=0x443f70 "root", group=0, groups=groups@entry=0x443f90, ngroups=ngroups@entry=0xfffef834) at initgroups.c:170 4 0xf778d940 in fill_user_info (info=info@entry=0x442ce0, uid=uid@entry=0, username=username@entry=0x0, error=0x1c, error@entry=0xfffef8b0) at dbus-sysdeps-unix.c:2410 5 0xf778db24 in _dbus_user_info_fill_uid (info=info@entry=0x442ce0, uid=uid@entry=0, error=error@entry=0xfffef8b0) at dbus-sysdeps-unix.c:2534 6 0xf7790b24 in _dbus_user_database_lookup (db=db@entry=0x4424c0, uid=<optimized out>, username=username@entry=0x0, error=error@entry=0xfffef8b0) at dbus-userdb.c:176 7 0xf7790d64 in _dbus_user_database_get_uid (db=db@entry=0x4424c0, uid=<optimized out>, info=0xfffef8ac, info@entry=0xfffef8a4, error=error@entry=0xfffef8b0) at dbus-userdb.c:662 8 0xf7790dc8 in init_system_db () at dbus-userdb.c:247 9 0xf7790f4c in init_system_db () at dbus-userdb.c:238 10 _dbus_user_database_get_system () at dbus-userdb.c:340 11 0x00421e58 in _dbus_get_user_id_and_primary_group (username=0xfffef928, uid_p=0x442584, gid_p=0x0) at dbus-userdb-util.c:210 12 0x0040f344 in start_busconfig_child (error=0xfffef9b8, attribute_values=0x0, attribute_names=0x4404f8, element_name=0x4399e0 "\250\230\003", parser=0x440d08) at config-parser.c:1048 13 bus_config_parser_start_element (parser=0x440d08, element_name=element_name@entry=0x442478 "policy", attribute_names=attribute_names@entry=0x4404f8, attribute_values=attribute_values@entry=0x442568, error=0xfffefc08) at config-parser.c:1919 14 0x0041ecc8 in expat_StartElementHandler (userData=0xfffefb18, name=0x442478 "policy", atts=0x440710) at config-loader-expat.c:107 15 0xf76c84a0 in doContent (parser=parser@entry=0x440518, startTagLevel=startTagLevel@entry=0, enc=enc@entry=0xf76e8a50 <utf8_encoding>, s=s@entry=0x4414d0 "<busconfig>\n\n <type>accessibility</type>\n\n<servicedir>/usr/share/dbus-1/accessibility-services</servicedir>\n <auth>EXTERNAL</auth>\n\n <listen>unix:tmpdir=/tmp</listen>\n\n <policy user=\"owner\">\n <"..., end=end@entry=0x441957 "", nextPtr=nextPtr@entry=0x440530, haveMore=haveMore@entry=0 '\000') at xmlparse.c:2890 16 0xf76c8ca0 in contentProcessor (parser=parser@entry=0x440518, start=start@entry=0x4414d0 "<busconfig>\n\n <type>accessibility</type>\n\n<servicedir>/usr/share/dbus-1/accessibility-services</servicedir>\n <auth>EXTERNAL</auth>\n\n <listen>unix:tmpdir=/tmp</listen>\n\n <policy user=\"owner\">\n <"..., end=end@entry=0x441957 "", endPtr=endPtr@entry=0x440530) at xmlparse.c:2552 17 0xf76c9d9e in doProlog (parser=parser@entry=0x440518, enc=0xf76e8a50 <utf8_encoding>, s=0x4414d0 "<busconfig>\n\n <type>accessibility</type>\n\n<servicedir>/usr/share/dbus-1/accessibility-services</servicedir>\n <auth>EXTERNAL</auth>\n\n <listen>unix:tmpdir=/tmp</listen>\n\n <policy user=\"owner\">\n <"..., s@entry=0x441440 "<!DOCTYPE busconfig PUBLIC \"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">\n<busconfig>\n\n <type>accessibility</type>\n\n<servicedir>/"..., end=0x441957 "", tok=<optimized out>, next=<optimized out>, next@entry=0x441449 " busconfig PUBLIC \"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">\n<busconfig>\n\n <type>accessibility</type>\n\n<servicedir>/usr/share"..., nextPtr=nextPtr@entry=0x440530, haveMore=haveMore@entry=0 '\000') at xmlparse.c:4579 18 0xf76ca2da in prologProcessor (parser=0x440518, s=0x441440 "<!DOCTYPE busconfig PUBLIC \"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">\n<busconfig>\n\n <type>accessibility</type>\n\n<servicedir>/"..., end=<optimized out>, nextPtr=0x440530) at xmlparse.c:4293 19 0xf76cb678 in XML_ParseBuffer (parser=0x440518, len=<optimized out>, isFinal=1) at xmlparse.c:1988 20 0x0041eebc in bus_config_load (file=file@entry=0xfffefc18, is_toplevel=is_toplevel@entry=1, parent=parent@entry=0x0, error=0xfffefc08, error@entry=0x406824 <main+960>) at config-loader-expat.c:245 21 0x0040a890 in bus_context_new (config_file=0xfffefc18, flags=(BUS_CONTEXT_FLAG_FORK_NEVER | BUS_CONTEXT_FLAG_WRITE_PID_FILE), print_addr_pipe=0xfffefc00, print_pid_pipe=0xfffefc04, address=0x0, error=0xfffefc08) at bus.c:797 22 0x00406824 in main (argc=<optimized out>, argv=<optimized out>) at main.c:634 Change-Id: Ic1ee03c3e760506e72032247da36b2567d903ba3
2019-04-18Merge branch 'cherry-pick-14f46d14' into 'dbus-1.12'Simon McVittie1-1/+4
build: Don't assume we can set permissions on a directory See merge request dbus/dbus!112
2019-04-18build: Don't assume we can set permissions on a directorySimon McVittie1-1/+4
MSYS2 has enough of a Unixish environment to run Autotools, but apparently not enough of a Unixish environment to have functional permissions. Closes: dbus#216 (cherry picked from commit 14f46d14a0526f137f81a3fff5d32f26733323cd)
2019-04-17Merge branch '1-12-logical-op' into 'dbus-1.12'Simon McVittie3-7/+22
Backport -Wlogical-op fixes to 1.12.x See merge request dbus/dbus!109
2019-04-17Merge branch '1-12-code-coverage' into 'dbus-1.12'Simon McVittie11-7/+443
Adapt to API change in AX_CODE_COVERAGE version 28 See merge request dbus/dbus!108
2019-04-17_dbus_get_is_errno_eagain_or_ewouldblock: Avoid warningDavid King1-0/+8
EAGAIN and EWOULDBLOCK are documented to possibly be numerically equal, for instance in errno(3), and a simple logical OR check will trigger the -Wlogical-op warning of GCC. The GCC developers consider the warning to work as-designed in this case: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 Avoid such a warning by explicitly checking if the values are identical. Fixes: https://gitlab.freedesktop.org/dbus/dbus/issues/225 Signed-off-by: David King <dking@redhat.com> Reviewed-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit a65319134209d39f5eb6e5425ec6a35fad05bcd7)
2019-04-17dbus-send: Avoid duplicated-branches warningDavid King1-4/+7
Switch the order of the argument checks to avoid the -Wduplicated-branches warning. Signed-off-by: David King <dking@redhat.com> Reviewed-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit c0bf0d185d72e20e70da9a98e13f69e19f2a87d5)
2019-04-17desktop-file: Justify implementation of is_valid_section_name()Simon McVittie1-1/+6
Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 99580298f305e1e2426f0c016d797a1ff9ea0b79)
2019-04-17is_valid_section_name: Fix logical expressionDavid King1-2/+1
Group names in desktop files may contain all ASCII characters, except control characters and '[' and ']'. Rather than accepting all values, thanks to a logical operator confusion found by GCC warning -Wlogical-op, instead explicitly reject the invalid values. Signed-off-by: David King <dking@redhat.com> Fixes: https://gitlab.freedesktop.org/dbus/dbus/issues/208 (cherry picked from commit 3ef9e789c1b99f420078f4debabd4f5c4fa0a748)
2019-04-17Adapt to API change in AX_CODE_COVERAGE version 28Simon McVittie11-7/+443
AX_CODE_COVERAGE recently changed the way it embedded its Makefile rules in the output file: instead of using @CODE_COVERAGE_RULES@, users are now meant to include aminclude_static.am. The new AX_CODE_COVERAGE is only in the latest autoconf-archive release, version 2019.01.06, which is inconveniently new, so bundle everything we need for the moment. This requires us to stop using the deprecated CODE_COVERAGE_LDFLAGS (which we still used to support older versions of autoconf-archive) and replace them with CODE_COVERAGE_LIBS. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 2938c2125ebcd001e470aeac1ffac45b6b1ebe89) Closes: dbus#265
2019-03-19kdbus: share fd and pool with libdbuspolicysubmit/tizen/20190321.094448accepted/tizen/unified/20190322.075523Adrian Szyndela3-2/+14
This uses new functionality of libdbuspolicy: using client's pool and fd. This way libdbuspolicy doesn't have to create its own connection, and what is more important it doesn't have to create its own 1MB pool. This is at the cost of using client's pool for receiving responses to ioctl(KDBUS_CMD_GET_CONN_INFO), which are small. Change-Id: I183a91196fead179a9fba22fa6418680305d3558
2019-03-18kdbus: add assert for non-NULL memberAdrian Szyndela1-0/+2
Trying to call an unnammed method on org.freedesktop.DBus is considered a programming error. This detects such errors. Change-Id: Ic341df0eef0e7ef5ab8234aacc2c256c295327c3
2019-03-14kdbus: move dbuspolicy init to bus_register_kdbusAdrian Szyndela3-31/+49
This changes the moment of checking if user is allowed to connect to the bus. Now, it reflects standard process a bit more. The standard process is: - open fd (e.g. socket); - check authentication, if needed and possible; - connect to the bus (say hello). In kdbus, we have only: - open kdbus fd; - connect to the bus (ioctl KDBUS_CMD_HELLO). Calling libdbuspolicy for authentication fits between the two. Additionally, and most importantly, this is required to share the connection between libdbus and libdbuspolicy in the future. Change-Id: Id6fe1dbc1cdc6ec774316e13fe5d60d862949476
2019-02-14kdbus: Fix memory leakage in capture_org_freedesktop_DBus_StartServiceByName()submit/tizen/20190215.045528accepted/tizen/unified/20190219.154258sanghyeok.oh1-2/+6
Change-Id: If4b04d0f287e199e809cdf183ce4ce779c0f4dd4 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-02-13DBusMessage: bugfix for wrong type specifiersubmit/tizen/20190213.080620accepted/tizen/unified/20190214.154123sanghyeok.oh1-1/+1
Change-Id: I0743a3d67e3d6d58acc605ded013eedb6b0af9c5 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-02-01dbus_message_iter_open_container: Don't leak signature on failuresubmit/tizen/20190211.015911Simon McVittie1-2/+9
If we run out of memory while calling _dbus_type_writer_recurse() (which is impossible for most contained types, but can happen for structs and dict-entries), then the memory we allocated in the call to _dbus_message_iter_open_signature() will still be allocated, and we have to free it in order to return to the state of the world prior to calling open_container(). One might reasonably worry that this change can break callers that use this (incorrect) pattern: if (!dbus_message_iter_open_container (outer, ..., inner)) { dbus_message_iter_abandon_container (outer, inner); goto fail; } /* now we know inner is open, and we must close it later */ However, testing that pattern with _dbus_test_oom_handling() demonstrates that it already dies with a DBusString assertion failure even before this commit. This is all concerningly fragile, and I think the next step should be to zero out DBusMessageIter instances when they are invalidated, so that a "double-free" is always detected. Change-Id: I2ccd4b516c7714f64c4543dd8d2e5c99633733a5 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
2019-02-01dbus_message_append_args_valist: Don't leak memory on inappropriate typeSimon McVittie1-0/+1
Found by source code inspection while trying to debug an unrelated leak. Change-Id: I0726c57bb4b0ccdadee2263b14f9fe3fe4ebc99a Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
2019-02-01DBusMessage: Fix UB (misaligned access) in call to ↵Marc Mutz1-60/+62
_dbus_header_set_field_basic() The const void* 'value' pointer that is passed the address of a uint32_t here eventually ends up in _dbus_marshal_write_basic(), which casts it to a DBusBasicValue, a union type that has an alignment of eight on 64-bit platforms and is therefore more-aligned than the uint32. The read of a value of a more-aligned type through a pointer to a less -aligned type is undefined behaviour. Fix by storing the uint32 in a DBusBasicValue and passing that instead. Found by UBSan: dbus/dbus/dbus-marshal-basic.c:832:14: runtime error: member access within misaligned address 0x7fdb8dac3a04 for type 'const union DBusBasicValue', which requires 8 byte alignment 0x7fdb8dac3a04: note: pointer points here 4a 87 b5 71 01 00 00 00 40 7d 01 00 00 61 00 00 10 3b ac 8d db 7f 00 00 2c 2a 3e 94 db 7f 00 00 ^ #0 0x7fdb9444a2c3 in _dbus_marshal_write_basic dbus/dbus/dbus-marshal-basic.c:832 #1 0x7fdb943d22fb in _dbus_type_writer_write_basic_no_typecode dbus/dbus/dbus-marshal-recursive.c:1605 #2 0x7fdb943d64e9 in _dbus_type_writer_write_basic dbus/dbus/dbus-marshal-recursive.c:2327 #3 0x7fdb943c52a6 in write_basic_field dbus/dbus/dbus-marshal-header.c:318 #4 0x7fdb943c919e in _dbus_header_set_field_basic dbus/dbus/dbus-marshal-header.c:1321 #5 0x7fdb943e1349 in dbus_message_set_reply_serial dbus/dbus/dbus-message.c:1173 Change-Id: I0149da4ebbead9b4b38c8c62af1ea892e24ec95e Signed-off-by: Marc Mutz <marc@kdab.net> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98035
2019-02-01dbus_message_iter_append_basic: Don't leak signature if appending fd failsSimon McVittie1-3/+9
Change-Id: I37ac4d243832476772ffbd822bbf4598e6f8f9a5 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
2019-02-01dbus-hash: Fix a potential shift by a negative integerPhilip Withnall1-1/+2
As a hash table becomes unbelievably large and full, the down_shift tends towards 0. The overflow detection code in rebuild_table() does not prevent down_shift becoming negative, which then causes undefined behaviour in RANDOM_INDEX for int-keyed tables. Note that this can only happen with approaching INT_MAX entries in the hash table, at which point we’ve almost certainly hit OOM somewhere, so this is vanishingly unlikely to happen. This is why I can’t add a test for the bug. As always, thanks to Coverity. Coverity ID: 54682 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99641 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Change-Id: Iac3047fc0bff11b3d08c2938c0fda292bddb1466
2019-02-01Display thread id in _dbus_verbose to be able to see threading issues.Ralf Habacker5-12/+31
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191 Change-Id: I16b39c8c3123436d54655a67f9d00aa090933aba Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2019-01-29tools: modify execute label of dbus-monitorsubmit/tizen/20190131.080207submit/tizen/20190131.021840accepted/tizen/unified/20190201.061340sanghyeok.oh1-1/+1
Unable to read 'fd passing messages' due to permission. Set execute label as "System" Change-Id: I765081a58cc285951216fdb63f8cf9a5c68e39de Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-01-21configure.ac: Forbid AX_-prefixed patterns more selectivelySimon McVittie1-1/+1
We want to make autoconf fail early and with a user-comprehensible message if autoconf-archive isn't installed, rather than generating a configure script with syntax errors, or a configure script that runs successfully but doesn't do what we intended. However, autoconf-archive doesn't actually guarantee not to use AX_-prefixed shell variable names without m4_pattern_allow'ing them (unlike Autoconf, Automake, Libtool and pkg-config, which explicitly use m4_pattern_allow for variables with AC_, AM_, LT_ and PKG_ prefixes), so it isn't safe to assume that they won't be used. In particular, recent versions of AX_CHECK_GNU_MAKE appear to be using $AX_CHECK_GNU_MAKE_HEADLINE as a shell variable. Instead, specifically forbid the names of the finite list of macros that we actually use. Signed-off-by: Simon McVittie <smcv@collabora.com> Resolves: dbus#249 (cherry picked from commit ee09cc0acdc1c34e8ae999adf9922f3d0d66f407)
2019-01-17dbus-connection: Add _dbus_string_free to deallocate memorysubmit/tizen/20190121.055508submit/tizen/20190117.090745accepted/tizen/unified/20190128.061345sanghyeok.oh1-0/+2
The string must eventually be freed with _dbus_string_free(). Change-Id: I4041940684dd1dc7099bf823b22fabc357f17901 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-01-17Fix missing dbus_message_unref() in error reply pathShin-ichi MORITA3-1/+122
The error message was leaked when blocking on a pending call after the connection was disconnected. Change-Id: Icc95bcef32b2fd1d2b4d4a7db3bdf2936579c52c Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: re-word commit message] Reviewed-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101481
2019-01-17dbus-connection: Remove a duplicate _dbus_list_clear() callPhilip Withnall1-2/+0
This was doing no harm (clearing an already-cleared list is a no-op), but it was also pointless. Change-Id: I21b580f01439ef2113183a116f208bf91e09ac76 Signed-off-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99435
2019-01-09dbus-daemon: add send_destination_prefix supportsubmit/tizen/20190109.021130accepted/tizen/unified/20190110.060340Adrian Szyndela7-47/+164
Change-Id: Iaa1eff400c045ec46465f248e8460c97bb183e5b
2019-01-03kdbus: fixed memory leak in process_connection_info_cmd()submit/tizen/20190104.021452accepted/tizen/unified/20190105.054101sanghyeok.oh1-1/+4
Change-Id: I67e577761e7596eac400bc8c35386f4c0cbf840a Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2018-12-04Start working on dbus 1.12.14Simon McVittie2-1/+6
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-041.12.12dbus-1.12.12Simon McVittie2-3/+5
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04CI: Start supporting Debian 10 'buster', currently under developmentSimon McVittie2-0/+9
This gives us a way to build on a more recent host OS if we want to. For Gitlab-CI it's disabled by default. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 28c27349e252e33215e21b570d41853badd770ef)
2018-12-04CI: Exercise maintainer-only documentation buildSimon McVittie2-0/+33
Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit bcc34caa43d8e5dba8266cf163d8a24e4fb55dce)
2018-12-04CI: Stop building on Ubuntu 14.04 'trusty'Simon McVittie3-30/+8
The version of gcc in trusty is too old for AddressSanitizer, which we want to be able to start using, and Travis-CI finally supports Ubuntu 16.04 'xenial' now. This lets us remove some workarounds, but we need to update others. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 0c553afcd9c79bc19ffdad67980f421def5d0613)
2018-12-04ci-build.sh: Show file size in list of files to be able to compare generated ↵Ralf Habacker1-1/+1
file size (cherry picked from commit bac2fd3aa458c7dfd002f7ec96a245d630c5830f)
2018-12-04CI: Remove unimplemented --with-glib optionSimon McVittie1-1/+0
dbus has never actually had this option. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit e0a1bfb26a9f72e8fe59af770d394a90810a7cea)
2018-12-04CI: List attributes, sizes etc. of installed files, not just namesSimon McVittie1-1/+1
Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit d71049799a3f87de95151e00c667c05dd0b5386c)
2018-12-04doc: Remove obsolete message about man2htmlSimon McVittie1-1/+0
We no longer run man2html. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit f134e2d2c7ae53965dfba0c85bf76ad38fb7fa4c)