summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-25BUS_RESULT: fix missed changes of TRUE/FALSE to BUS_RESULTtizen_6.0.m2_releasesubmit/tizen_6.0_hotfix/20201103.115101submit/tizen_6.0_hotfix/20201102.192901submit/tizen_6.0/20201029.205501submit/tizen/20200925.142828accepted/tizen/unified/20200928.072833accepted/tizen/6.0/unified/hotfix/20201103.000322tizen_6.0_hotfixaccepted/tizen_6.0_unified_hotfixAdrian Szyndela3-8/+8
The Tizen's branch code that added Cynara integration had changed return types in some functions from dbus_bool_t to BusResult. The code from upstream master branch uses dbus_bool_t. While merging recent changes from the upstream, there were some parts that were merged without changing TRUE/FALSE to BUS_RESULT_* or with checking conditions as bool values instead of checking the enum. The above, and the fact that TRUE==1, FALSE==0, BUS_RESULT_TRUE==0, BUS_RESULT_FALSE==1 has led to aborting on asserts, when enabled. This could also lead to issues with activation. This commit fixes the TRUE/FALSE handling where needed. Change-Id: I6cbf1aa0b43699464c9214b50fd8bb23a84709e8
2020-09-25policy: take proper eavesdropping value in verbose modeAdrian Szyndela1-1/+1
Change-Id: I5a5893d56c1d4fd98d3dc807319c73c9791dff6a
2020-09-21bus/connection: don't check cmdline in session dbus-daemonsubmit/tizen/20200921.022732accepted/tizen/unified/20200922.090815Adrian Szyndela1-2/+20
Session dbus-daemon may have no rights to look into cmdline in /proc. In such cases logs are cluttered with access denied. This commit disables checking cmdline for session dbus-daemon. (Before) May 21 08:13:06 localhost dbus-daemon[676]: [session uid=5001 pid=676] Rejected send message, 1 matched rules; type="method_call", send er=":1.33" (uid=5001 pid=1090 comm="/usr/apps/org.tizen.multi-assistant-service/bin/or" label="User::Pkg::org.tizen.multi-assistant-ser vice") interface="org.freedesktop.DBus" member="RequestName" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus " privilege="(n/a)" (bus) rule(<deny send_type="method_call" />) (After) May 21 08:21:55 localhost dbus-daemon[678]: [session uid=5001 pid=678] Rejected send message, 1 matched rules; type="method_call", send er=":1.33" (uid=5001 pid=1110 comm="<not-read>" label="User::Pkg::org.tizen.multi-assistant-service") interface="org.freedesktop.DBus" member="RequestName" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" privilege="(n/a)" (bus) rule(<deny sen d_type="method_call" />) Change-Id: I15c3b9b2a5675546b6adb3b1521e790088bd8f85 Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2020-09-17bus: initialize can_send_resultsubmit/tizen/20200918.070747Adrian Szyndela1-1/+1
can_send_result may be uninitialized for cases with no send_policy. Change-Id: I0f490c3c6920df525f5583b421162f7f33b8cb68
2020-09-17check: remove 'return sth' from void functionAdrian Szyndela1-1/+1
Change-Id: I362319c7de7ac38f68595202efe8fb2b3c5a3389
2020-09-15cynara integration: check policy right away for both send and receiveAdrian Szyndela7-113/+96
Check policy at moments, when sender is still present, so the policy can be checked for both sender and receiver. This way only potential waiting for cynara check is left with no need to access any connection data. Change-Id: I6544740c6e31dee286261fe3cddb3f692c669c4d
2020-09-15cynara integration: create deferred message only when it's not already createdAdrian Szyndela1-8/+18
This will allow altering existing deferred messages, enabling concurrent asynchronous cynara checks for SEND and RECEIVE. Change-Id: I1f31c173e4229661bca9f14ecaa158ee67342db4
2020-09-15cynara integration: initialize deferred_messagesAdrian Szyndela4-8/+8
Initialize deferred messages in order to be able to alter them on concurrent Cynara calls. This way we'll be able to run both asynchronous requests for SEND and RECEIVE, if needed. Change-Id: I060969ad5645c6a1d72f1c91edb46ecc3217ef79
2020-09-15policy: bugfix -> get const data instead non-constAdrian Szyndela1-1/+1
Get const data instead of non-const data for constant strings. It triggered asserts when they are enabled, although the underlying production code is the same. Change-Id: Ic7102b6601ca168e6bf5f6902988a06c6ab76f03
2020-08-27Added a check to avoid integer underflow.submit/tizen/20200903.044811submit/tizen/20200827.104709accepted/tizen/unified/20200907.023444DEEPAK SINGH1-0/+3
Change-Id: I68962e09d1c2c8ef367a4766c23e7b15cf1e6dc1 Signed-off-by: Deepak Singh <deepak.sn@samsung.com>
2020-08-25bus/connection: Add assert to BUS_CONNECTION_DATAINSUN PYO1-0/+21
Change-Id: Ie56e99fc5c8038863b69b350128f2d6eef1acc6a
2020-08-05spec: change system bus socket location: /var/run/dbus/system_bus_socket → ↵submit/tizen/20200812.075733accepted/tizen/unified/20200819.122321INSUN PYO1-54/+58
/run/dbus/system_bus_socket Journal Log - Jan 01 09:11:45 localhost systemd[1]: /usr/lib/systemd/system/dbus.socket:8: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly Change-Id: Idf5d68e791efc70ef324a0ba50807a5512815ac7 Ref: https://gitlab.freedesktop.org/dbus/dbus/-/issues/180
2020-08-05Revert "tizen: notify service readyness after successful config file parsing"submit/tizen/20200805.062948accepted/tizen/unified/20200806.062507INSUN PYO2-8/+0
This reverts commit bbacc6024e474f4e7dd1387618209cab9524a95c. - security-manager's nss plugin removed the dependency with security-manager service. - So, deadlock is removed. Change-Id: I047da2ae670f59a6dcac9f58877c49f77bb25c7f
2020-08-05Remove unused license file, COPYINGsubmit/tizen/20200805.013704accepted/tizen/unified/20200805.122533Hyotaek Shim3-11/+1
Change-Id: Ie3e28ff56652ee454ad1f7362a93fec0973af0f6 Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2020-08-04packaging: Cleanup license definitionsKarol Lewandowski1-7/+8
State clearly that libdbus and dbus-daemon are distributed under AFL-2.1 license in Tizen (including kdbus support). The tools that are in "dbus" package are under various licensed so all are listed. Change-Id: Ibfc3731e1e4bc0f59d9eae198ecc453fb9bea180
2020-07-06Remove unnecessary build dependency to libziosubmit/tizen/20200706.012823submit/tizen/20200706.011908accepted/tizen/unified/20200707.140952Hyotaek Shim1-1/+0
Change-Id: I7c9f8584c81602c773c342360dc12621c3e6b760 Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2020-06-04bus/policy: activation: check target namesubmit/tizen/20200605.005713submit/tizen/20200604.233300submit/tizen/20200604.095417accepted/tizen/unified/20200605.020519Adrian Szyndela1-5/+10
Check target name taken from message instead of org.freedesktop.DBus in case of no peer available. This is the case when activation is happening. Change-Id: I181edbb28a1b26ed79552bb6df8b00892d2ceac8
2020-06-01bus/policy: use hash tables for checking policysubmit/tizen/20200601.123056accepted/tizen/unified/20200602.133244Adrian Szyndela2-14/+322
Only for send/receive/own rules in default context. Change-Id: Iabbbfa5d582f9993b832f49193da93225c645014
2020-06-01bus/connection: API for getting list of names from connectionsAdrian Szyndela2-0/+10
Change-Id: I2854f6cc51b26ff04a9984778f899ba9656ba290
2020-06-01bus/policy: direct checking of policy, without copiesAdrian Szyndela1-166/+95
Change-Id: I42926c107aae0be1a1247a61f3558122b07f9914
2020-06-01bus/policy: generalized policy checking processAdrian Szyndela1-135/+135
Change-Id: I573ddbc7e64bef38ed7517644bd842728e14679b
2020-06-01bus/policy: reduce warnings by adding default casesAdrian Szyndela1-0/+8
Change-Id: I6267b3c7cc6fead8c4dd37967c122e1597239ebf
2020-06-01bus/policy: reduce number of params in check_ functionsAdrian Szyndela1-60/+76
No functional changes, just packed arguments to structs. Change-Id: I0e5a22a208ba7085727e617c52cd061c39524967
2020-06-01bus/policy: extract check_* functionsAdrian Szyndela1-444/+485
No functional changes, just moving code around. This extracts check_send_rule, check_receive_rule, and check_own_rule from their own respective bus_client_policy_can_check_* functions. Change-Id: Ice4b2b96054b33a376bc3f48df29447747e7980e
2020-06-01bus/policy: remove optimizationAdrian Szyndela1-106/+0
This removes optimization, because in subsequent commits we're going to apply: * direct checking of policy * hash tables instead of lists. Change-Id: I6de32c4a29bac1d185f76eb88b22198c9ea22413
2020-06-01bus/policy: make local functions staticAdrian Szyndela2-7/+9
Change-Id: Ideba1fea470bc0d38c04f428b23270fe6176ac95
2020-05-22Stats: Add field PendingRepliessanghyeok.oh3-1/+54
Pending replies will increasing 1) if client sending lots of messages to destination at once 2) if server eats incoming messages.(no reply) In case of 2) dbus-daemon still has pending information. With default bus context option (reply_timeout=-1) it never freed. Assuming 2) happended repeatedly, then it is hard to detect until it exceeds maximum pending replies limit, because of dbus-daemon print warning messages only if pending replies over bus limit(default 1024 for system bus). Change-Id: Iee0515fac68af7586547cc5ef5e6fa73d388a312 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2020-05-19Coverity fixsanghyeok.oh1-3/+8
Change-Id: I57c318bdf8a0e2d8d731c002185946930392718e
2020-04-20dbus-message: bring back the original layout of DBusMessageItersubmit/tizen/20200420.213220submit/tizen/20200420.123023accepted/tizen/unified/20200421.051607Adrian Szyndela2-99/+96
The layout introduced with GVariant was kind of mimicking the real structure, as opposed to the original layout, which was taking into account only total sizes. Dbus-1.10.8 introduced some static assertions for the properties of DBusMessageIter. These are incompatible with the "GVariant" layout. Moreover, they show that the "GVariant" layout could be prone to the copying, that could omit some fields or parts of fields, due to its not "packed" structure. This commit brings back the original layout, with modifications suited for GVariant-sized DBusMessageRealIter. As an additional feature - this should fix compilation for 64-bit architectures. Change-Id: Ie1cac3748d408c22acf177ede5fb9e4e29818c9b
2020-04-20spec: fix dbus.conf paths in files sectionAdrian Szyndela1-2/+2
The two files: sysusers.d/dbus.conf and tmpfiles.d/dbus.conf are always installed into {%_prefix}/lib, even if libdir is %{_prefix}/lib64 or %{_prefix}/lib/x86_86-linux-gnu or %{_prefix}/what/ever. This commit fixes spec file to package the files from %{_prefix}/lib instead of %{_libdir}. Change-Id: I1f3a99f04c4bc880a9e38f77c112acdb61bbd4ad
2020-04-16Merge dbus-1.12.16 into tizensubmit/tizen/20200417.133959Adrian Szyndela277-7241/+17628
Change-Id: Ie55319b9a3075a1f1f12afadecc6c06c39e3dd3b
2020-04-16activation: fix indentationupgrade-to-1.12.16Adrian Szyndela1-1/+1
2020-04-16dbus-transport: stop using orig_len outside its contextAdrian Szyndela1-1/+1
2020-04-16packaging: update packaging for dbus-1.12.16Adrian Szyndela2-8/+10
- spec: drop deprecated option --with-init-scripts - spec: package new, installed files - spec: acknowledge removing of dbus.socket from dbus.target.wants - spec: add autoconf-archive build dependency - acknowledge renaming HACKING to CONTRIBUTING.md - spec: bump version to 1.12.16
2020-04-16Merge dbus-1.12.16 into tizenAdrian Szyndela275-7232/+17617
dbus 1.12.16
2020-03-30Revert "Add dependency to security-manager.socket"submit/tizen/20200402.112144accepted/tizen/unified/20200406.133221INSUN PYO1-2/+0
This reverts commit 8d7fa32af68f2ba1f5da3494ce6d50e8e7c2c034. Change-Id: Iaf3890e804b87b7c6751237e0ef93b3ad5db9ceb
2020-03-25Revert "Remove DefaultDependencies=no from dbus.socket"INSUN PYO1-0/+1
This reverts commit 873bad7e9515fbafb8682fa6cdadfee629762e0d. Change-Id: I642e8ca08d551320b56d97e682c969689640700f
2020-03-12policy: print policy denied complaint log for signal broadcastingsanghyeok.oh1-2/+4
Debugging is difficult due to lack of error information: When the broadcast signal is blocked by dbus policy, unlike other types of dbus messages, dbus-daemon does not print any error logs, it just passes an error message to the bus monitor. Change-Id: I9c6c55530d64451403664ea1eee4b703360691eb
2020-01-13auth: Reject DBUS_COOKIE_SHA1 for users other than the server ownerSimon McVittie1-0/+30
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. Change-Id: I04d70bf97d78d25551e9adc217a4dd7652d428b6 Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/269 Closes: CVE-2019-12749
2019-08-20Revert "tizen: Add additional unit for "unified" user session"tizen_5.5.m2_releasesubmit/tizen_5.5_mobile_hotfix/20201026.185106submit/tizen_5.5/20191031.000006submit/tizen/20190820.090809accepted/tizen/unified/20190822.045457accepted/tizen/5.5/unified/mobile/hotfix/20201027.063100accepted/tizen/5.5/unified/20191031.005930tizen_5.5_tvtizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_mobile_hotfixYunmi Ha5-43/+1
This reverts commit 662187a7597aaf9c9ad2a635944951e6174a36da. We've optimized systemd-user without unified system/session. So, we revert the patch for unified system/session. Change-Id: I70ee37ebeda65e549c5f544d37d511cb6d54b757
2019-07-30policy: modify complaint log to print out matched rulesubmit/tizen/20190812.022819accepted/tizen/unified/20190816.112439sanghyeok.oh4-16/+132
Reconstruct rule with xml format. Change-Id: I760f5c89f519672743a10fa15b66ac14b7e819a1 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-07-23policy: change complaint log format of bus_client_policy_check_can_own() to ↵sanghyeok.oh1-5/+9
print out connection log Change-Id: Ib0fc3be8b07577da687a024f5c39178dad387644 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-07-19kdbus: fix computing bloom filterssubmit/tizen/20190719.104741accepted/tizen/unified/20190722.074825Adrian Szyndela1-3/+3
The bloom filters computing had been implemented in the past, basing on systemd. However, the reimplementation introduced two bugs: - no clearing of 'p' variable; - clearing of hash_index variable in a wrong place. This fixes the bugs. The same applies to glib. Change-Id: Ie7c602c6bc881e38c62f41d482ab3785b03c5503
2019-07-17Revert "Fix for smack error when dbus-daemon(session) accesses proc/cmdline"submit/tizen/20190717.061730accepted/tizen/unified/20190717.220434Hyotaek Shim1-1/+1
This reverts commit c7fbfc743059b3e9988a359106ad459511b5ea78. Change-Id: I86742a428f372ff6988a13df12694c550e2a53c2
2019-07-01gvariant: fix UBSan related codesubmit/tizen/20190701.095512accepted/tizen/unified/20190702.114943sanghyeok.oh1-2/+2
fix Undefined Behavior Sanitizer error. Change-Id: If3b68e68d4de753d0e66c0eeb07f626431057cbf Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-06-26policy: add complaint log for bus_client_policy_check_can_own()sanghyeok.oh1-0/+5
Change-Id: I4e67ff2258b11bab764f51cfe7e2ae01f2a11d49 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-06-24Merge "Remove unused DbusError to avoid memory leak." into tizensubmit/tizen/20190624.005319accepted/tizen/unified/20190624.115337sanghyeok oh1-3/+1
2019-06-17remove unused DBusError in kdbus_read_message()Himanshu Maithani1-6/+2
The function defines and initializes local DBusError. It is not used in kdbus_decode_msg() and function relies on assert for error. So, remove the DBusError variable in kdbus_decode_msg(). Change-Id: Ic726f2a161f06766b081f1a98e83ff4f3834f75b Signed-off-by: Himanshu Maithani <himanshu.m@samsung.com> Signed-off-by: Gaurav Gupta <g.gupta@samsung.com>
2019-06-13Remove unused DbusError to avoid memory leak.Gaurav Gupta1-3/+1
Pass NULL as error argument to avoid setting error string in dbus_validate_bus_name(), thus avoid possible memory leak. We expect the name to be valid bus name (utf8) as it is fetched from the connection. It will also optimize stack usage as "local_error" variable & dbus_error_init() function are called in for loop. Other fix could be to check free "error" if it is set. Signed-off-by: Gaurav Gupta <g.gupta@samsung.com> Reviewed-by: Himanshu Maithani <himanshu.m@samsung.com> Change-Id: I773211edd76b6591369bbaae5464971894481a28
2019-06-12fix: missing dbus_error_free in kdbus_write_msg_internalsubmit/tizen/20190624.001018himanshu.m@samsung.com1-0/+1
free message/name from the error in kdbus_write_msg_internal Change-Id: I7f03abc0fc3f7c81e3725b3325f9e15209906e35 Signed-off-by: Himanshu Maithani <himanshu.m@samsung.com> Signed-off-by: Gaurav Gupta <g.gupta@samsung.com>