summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-05-19Merge "kdbus: add full support for synchronous method calls" into tizenKarol Lewandowski6-22/+348
2016-05-19Merge "transport: add initial support for synchronous calls" into tizenKarol Lewandowski3-0/+44
2016-05-13kdbus: increase kdbus receive pool size to 16Msubmit/tizen/20160516.081330accepted/tizen/wearable/20160517.032352accepted/tizen/tv/20160517.032329accepted/tizen/mobile/20160517.032335accepted/tizen/ivi/20160517.032312accepted/tizen/common/20160517.173904Lukasz Skalski1-1/+1
Current kdbus receive pool size is too small (only 2MB - in GLib we have 16MB). Due to quite specific 'pool layout' in kdbus module, 2MB was not enough for 512kB messages - according to kdbus docs: "50% of a pool is always owned by the connection. It is reserved for kernel queries, handling received messages and other tasks that are under control of the pool owner. The other 50% of the pool are used as incoming queue. As we optionally support user-space based policies, we need fair allocation schemes. Furthermore, resource utilization should be maximized, so only minimal resources stay reserved. However, we need to adapt to a dynamic number of users, as we cannot know how many users will talk to a connection. Therefore, the current allocation works like this: We limit the number of bytes in a destination's pool per sending user. The space available for a user is 33% of the unused pool space (whereas the space used by the user itself is also treated as 'unused'). This way, we favor users coming first, but keep enough pool space available for any following users. Given that messages are dequeued in FIFO order, this should balance nicely if the number of users grows. At the same time, this algorithm guarantees that the space available to a connection is reduced dynamically, the more concurrent users talk to a connection." Change-Id: Iffddc018f0d8bf08451d12d305c8d392ed3e1f55
2016-05-13kdbus: fix memfd kdbus items mappingLukasz Skalski1-1/+1
Change-Id: I48e9799e4fccaea2016cd77a92ebe971eeb1b660
2016-05-13modified to check pending call completionsanghyeok.oh1-1/+1
for blocking call(pending_call_block) after acuire io path, check pending call completion before iteration(poll) and wake up by any reason, but there are no reply, timeout is not reached, then retry polling, next time, if it acquire io path, then just enter iteration(poll) without completion check, for multi-threaded blocking call, 1. if first thread waiting io path(not 1st iteration), 2. second thread is polling, 3. reply message is arrived and this wake up seconds thread's polling, 4. first thread just enter polling until timeout 5. if there are no incoming event, then dead-lock until timeout. Change-Id: Ifcfe53b7610996d1892519f4a69cf435aa395968 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2016-05-11kdbus: add full support for synchronous method callsLukasz Skalski6-22/+348
Change-Id: Ib7b2115ab6a3ea76f25915eaf153772d2fa1c02f
2016-05-09Merge "Bug fix for kdbus_do_iteration() causing busy loop" into tizensubmit/tizen/20160509.070355accepted/tizen/wearable/20160510.002105accepted/tizen/tv/20160510.002122accepted/tizen/mobile/20160510.002101accepted/tizen/ivi/20160510.002139accepted/tizen/common/20160510.050907Hyotaek Shim1-1/+6
2016-05-06transport: add initial support for synchronous callsLukasz Skalski3-0/+44
Change-Id: I641e09e8710d97e03ffdb467a35cff4c8889edc7
2016-05-04policy: temporary workaround for libdbuspolicy parser issuesubmit/tizen/20160509.050757accepted/tizen/common/20160509.134950Lukasz Skalski1-0/+3
Change-Id: I04c508a6e14568ad6e28f687a433f6bde3f815f8
2016-04-28kdbus: catch up with latest libdbuspolicy API changessubmit/tizen/20160428.152642accepted/tizen/wearable/20160429.011727accepted/tizen/tv/20160429.011722accepted/tizen/mobile/20160429.011802accepted/tizen/ivi/20160429.011827accepted/tizen/common/20160429.170330Lukasz Skalski3-29/+5
Change-Id: Ie68b9b9d88cb30f48341f7fcf8cc7caf01c06126
2016-04-28Bug fix for kdbus_do_iteration() causing busy loopsubmit/tizen/20160428.103823Hyotaek Shim1-1/+6
Change-Id: I75a6267471b7fdff2d147514210726a3cec6c5dd Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2016-04-22fix some warningsPaweł Szewczyk5-4/+6
Change-Id: Iffc672d09b30447ba714e50d5ab182fd6370078f Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
2016-04-20reduced number of warningsAdrian Szyndela6-13/+16
Change-Id: I9e28b9eeaa185caa1eeea8e5d7f79feaaae7d799
2016-04-20fix SVACE bugssubmit/tizen/20160422.093504accepted/tizen/wearable/20160423.060351accepted/tizen/tv/20160423.060059accepted/tizen/mobile/20160423.055705accepted/tizen/ivi/20160423.060622accepted/tizen/common/20160422.172237Adrian Szyndela2-37/+37
WGID 31177: strcpy/stpcpy->snprintf WGID 31178: strcpy/stpcpy->snprintf WGID 31179: strcpy/stpcpy->snprintf/strncpy WGID 31180: use _dbus_strdup for string duplication WGID 31183: sprintf->snprintf WGID 31184: sprintf->snprintf WGID 31185: sprintf->snprintf WGID 31186: sprintf->snprintf WGID 31200: added explanation and unified conditions WGID 31210: added cast to __u64 all other sprintf->snprintf in dbus-transport-kdbus.c Change-Id: I8a488d37ec8be66370cba7b88a464787dcfeefc3
2016-04-20packaging: Integrate libdbus and dbus spec filesKarol Lewandowski2-153/+46
With dbus-1.10 depending on systemd code there is no benefit in keeping separate spec files. Change-Id: I3a9311e1730b51b3d4ff1dda513b564d19065aa9
2016-04-19packaging: Remove dbus-x11 flavorKarol Lewandowski3-158/+0
dbus-x11 is not used on tizen.org in any of available profiles. Change-Id: I94205fbdb526a96202bd2f2165e6a5bcf2c2a080
2016-04-19packaging: Remove documentation packagesKarol Lewandowski2-50/+7
Change-Id: I3b2ddc48b26819452ffa73d25d35177997c844b1
2016-04-19Added a strategy for selecting default protocol type.Adrian Szyndela7-13/+131
When a message is created, it is created without context of a bus. Thus, we have to guess what type of protocol is correct for the message. This commit introduces a possibility to influence guessing. An environment variable is introduced (DBUS_DEFAULT_PROTOCOL_STRATEGY), with following values recognized: * first-bus - messages created for type of first opened bus; * last-bus - messages created for type of last opened bus; * last-message - messages created for type of last sent message; * dbus1 - messages created with dbus1 protocol; * gvariant - messages created with GVariant protocol. last-bus is a default strategy. Change-Id: I2a185761973191ad5917bc2b6f4bfb2f4a3ed547
2016-04-19fixed some compiler/Valgrind warningsAdrian Szyndela3-17/+52
Change-Id: I5c9c0f7c5e50f89e69db9e5f000b181ebc98add6
2016-04-19refactoring: org.freedesktop.DBus method handling simplificationsLukasz Skalski1-166/+156
Change-Id: I4060e9ad4a6703cdcfdccd3bce69fd2b2c958031
2016-04-18refactoring: bloom filters handling moved to low-levelAdrian Szyndela3-319/+302
Constructing bloom filters belongs to low level API now. Change-Id: I95b524e91905029a1a040a95204e7008120cd89c
2016-04-18refactoring: cleanupAdrian Szyndela1-90/+98
String name to unique id conversion simplified. Item names for debug strings simplified. Change-Id: I934c6e3f64708db777dfdff2ffb4b4f5e7fa41a2
2016-04-18refactoring: using local types where availableAdrian Szyndela3-38/+49
Change-Id: I91cb72a2c52d1d55fdfd8afb1e6599483d637ea1
2016-04-18refactoring: low-level API types changed to low-levelAdrian Szyndela3-100/+100
Change-Id: I934800df6da5ad5fa34366683541782eb88daa9f
2016-04-18refactoring: coding styleAdrian Szyndela3-75/+72
Change-Id: I2a39f9b86a5ebbde11ee496ecc40a6cc08e6a1a1
2016-04-14fix for memleaksAdrian Szyndela4-11/+24
Freeing non-converted message after conversion Freeing string objects Freeing unique name in kdbus transport at end-of-life Freeing matchmaker in kdbus transport at end-of-life Change-Id: Iae4e231c52b78af3efd5a8a366fc01e50b03feeb
2016-04-11checking policy: don't check 'ins' if not a method callAdrian Szyndela1-8/+9
Change-Id: I666bc6474475906aa0ca2de96e47bfaa2c402ce2
2016-04-05Update to dbus-1.10.6submit/tizen/20160405.144419accepted/tizen/wearable/20160406.014752accepted/tizen/tv/20160406.014732accepted/tizen/mobile/20160406.014711accepted/tizen/ivi/20160406.014807accepted/tizen/common/20160406.143833Adrian Szyndela3-7/+25
Note: from version 1.10 it's required to have systemd support to be enabled not only in dbus-daemon code but also in libdbus. This is because maintainers removed built-in systemd support code (dbus/sd-daemon.c) and now depend on libsystemd- provided functionality. Additionally, update pkgconfig name to libsystemd (as required by configure.ac) Change-Id: I2056086a9281543695643ac31fd3ab8648a4d205
2016-04-05MOVe License patch (LGPL2.1+, BSD2.0 license files)Hyotaek, Shim7-545/+1913
Signed-off-by: Hyotaek, Shim <hyotaek.shim@samsung.com> Change-Id: Ie0e4364412bdf83cde0dd33faddef7a22b856f58
2016-02-19add dbuspolicy supportAdrian Szyndela10-135/+493
Change-Id: I1bef17d3930a2ca626d3c002eaa10cf6f16c8aac
2016-02-19dbus:modified to default allow own & send method_call for system bussanghyeok.oh1-2/+2
Change-Id: I439cfcbf9c8e44217f6a906836c579dd952b9ec7 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2016-02-19Fixed remarshalling and getting signatureAdrian Szyndela5-17/+15
A few fixes: - remarshalling to GVariant lacked locking of messages. It caused missing signature and offsets. - dbus_message_get_signature returned signature with outer parentheses. - removed unused param in _dbus_header_load_gvariant(). - editorial corrections in kdbus_decode_dbus_message(). Change-Id: I29ca21cef6769b725be0c98580f54313bda842c8
2016-02-19Remembering last offset and position at the message levelAdrian Szyndela6-31/+79
In GVariant, offsets in structs are stored for every end of variable-sized elements except the last one. We never know if an element we just added is the last one. Therefore, the offset may be added when next element is added. However, some users use multiple iterators. This change fixes it at the root level - last offset value and position is kept in the message. Change-Id: I954657424d9da075edb10e5630b27df5bca8f917
2016-02-19Disable GVARIANT feature temporallyINSUN PYO1-1/+1
Signed-off-by: INSUN PYO <insun.pyo@samsung.com> Change-Id: I84cf169d64f59b6b2086ade14a827b252ab44b97
2016-02-19Add kdbus transportAdrian Szyndela35-456/+11168
This reverts commit 197db0df78e0a9f82df4162885854f99ff749505, which reverts commit 771f5155c9a393a242329988d56661a51fc04e6c. Change-Id: I4133020c585a6f9b42f487ffae4d2005b25a1d08
2016-02-19dbus:MOVe:modify license IDsanghyeok.oh3-3/+3
Change-Id: Iea6db9311c918f99059bb98e8bd396b36387d902 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2016-02-19Revert "Add kdbus transport"Hyotaek, Shim34-11201/+455
This reverts commit 771f5155c9a393a242329988d56661a51fc04e6c. Change-Id: I73b6adc6b76b63e972f7228c88c18dabda81b006
2016-02-19Add kdbus transportAdrian Szyndela34-456/+11169
This commit introduces ABI break due to size change of DBusMessageIter structure. Consequently, all packages depending on libdbus need to be rebuilt. Other authors: Paweł Szewczyk <p.szewczyk@samsung.com> Karol Lewandowski <k.lewandowsk@samsung.com> and possibly others Change-Id: Ie04b34295c38e5aaac63982996fa9eddc97dd696
2016-02-19Revert "Perform Cynara runtime policy checks by default"Lukasz Skalski2-43/+11
This reverts commit e8610297cf7031e94eb314a2e8c11246f4405403. Change-Id: Ifb60464c705f5b4e92f02f9e809d23e982d31c3d Signed-off-by: Lukasz Skalski <l.skalski@samsung.com>
2016-02-19Perform Cynara runtime policy checks by defaultJacek Bukarewicz2-11/+44
This change introduces http://tizen.org/privilege/internal/dbus privilege which is supposed to be available only to trusted system resources. Checks for this privilege are used in place of certain allow rules to make security policy more strict. For system bus sending and receiving signals now requires http://tizen.org/privilege/internal/dbus privilege. Requesting name ownership and sending methods is still denied by default. For session bus http://tizen.org/privilege/internal/dbus privilege is now required for requesting name, calling methods, sending and receiving signals. Services are supposed to override these default settings to implement their own security policy. Change-Id: Ifb4a160bf6e0638404e0295a2e4fa3077efd881c Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
2016-02-19packaging: remove character class negation for sedJosé Bollo1-1/+1
When running the command sed provided by toybox, the expression [^[:cntrl:]] is not understood, what forbids to detect DBUS and cause further errors. This patch removes this expression. Change-Id: If30543fadddf8b6811e14b548a747be99612894b Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
2016-02-19Do not package libdbus-1.la fileJacek Bukarewicz1-2/+1
Change-Id: I8de1d91e6ab3c891de9549bfb94ae637d7ff664a
2016-02-19Add missing security manifestsJacek Bukarewicz4-1/+19
Change-Id: I765c1f189a4496620e5edc8c02b3055db5b45c09
2016-02-19Do not rely on Cynara cache when processing check rulesJacek Bukarewicz2-9/+73
Cynara cache was required when processing messages that have been blocked at the sender's message queue. Reliance on cache turned out to be unacceptable due to the fact that some policies are not cacheable. For example responses provided by Cynara askuser plugin might be single-use and thus cannot be cached. The solution is to attach deferred message to the message object when policy result is unavailable. Upon next bus_check_privilege call use response from Cynara which is saved in deferred message object. Change-Id: I17152343540d7b8d13ad3540c25c043d57aa5949
2016-02-19Fix several BusResult/dbus_bool_t mismatchesJacek Bukarewicz1-5/+5
They were found by temporarily redefining BusResult in the following way: typedef enum { BUS_RESULT_TRUE_E, BUS_RESULT_FALSE_E, BUS_RESULT_LATER_E } bus_result_t; typedef struct { bus_result_t result; } BusResult; #define BUS_RESULT_TRUE ((BusResult){BUS_RESULT_TRUE_E}) #define BUS_RESULT_FALSE ((BusResult){BUS_RESULT_FALSE_E}) #define BUS_RESULT_LATER ((BusResult){BUS_RESULT_LATER_E}) It doesn't compile because equality operator is not defined for structs. Also, structs are not allowed in switch statement. However, some errors indicated type mismatches which are now fixed. Change-Id: I0eb5368359f342e0f4239a2ad95d34b9a8e10a23 Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
2016-02-19Add <check own="..." > supportJacek Bukarewicz9-155/+218
Policy result unavailability is handled like send rules - dispatching messages from the sender is blocked and resumed when result becomes available. Handler of "RequestName" method needs to return BUS_RESULT_LATER when policy result is not known therefore its return type is modified. Since bus message handlers are put into function pointer array other message handler function singatures are also affected. Change-Id: I4c2cbd4585e41fccd8a30f825a8f0d342ab56755
2016-02-19Handle receive rule result unavailability and message broadcastsJacek Bukarewicz11-66/+711
When message is sent to the addressed recipient and receive rule result is unavailable we don't want to block the sender as it most likely will be the privileged service, so instead we queue it at the recipient. Any further messages sent to it will be queued to maintain message order. Once the answer from Cynara arrives messages are dispatched from the recipient queue. In such case full dispatch is performed - messages are sent to addressed recipient and other interested connections. Messages sent to non-addressed recipients (eavesdroppers or broadcast message recipients) are handled in a similar way. The difference is that it is not full dispatch meaning message is sent to a single recipient. Change-Id: Iecd5395f75a4c7811fa97247a37d8fc4d42e8814
2016-02-19Disable message dispatching when send rule result is not knownJacek Bukarewicz11-32/+472
When unicast message to addressed recipient is sent and policy result is not available message dispatch from the sender is disabled. This also means that any further messages from the given connection are put into the incoming queue. If response is received message dispatching is resumed. This time answer is expected to be in cache so the message is processed synchronously. Receive rule result unavailability is not yet handled - such messages are rejected. Also, if message is sent to non-addressed recipient message is silently dropped. Change-Id: Ia45905baf667ca42f386c1def108eca190d615bb
2016-02-19Integration of asynchronous security checksJacek Bukarewicz14-124/+995
This commit introduces basic framework for asynchronous policy checks and Cynara integration code. Functions for checking security policy can now return third value - BUS_RESULT_LATER denoting check result unavailability. Whenever policy checker cannot decide on the result of the check it is supposed to allocate DeferredMessage structure that will be passed to the upper layers which can decide what should be done in such situation. Proper handling of such case will be implemented in subsequent commits. Currently such return value results in message denial. Change-Id: I324b6ab68442e493853d8fe219c7a37fbd831872
2016-02-19policy: add <check> elementPatrick Ohly11-45/+186
The new <check> element is almost the same as <allow> and <deny>. The difference is that it has an additional "privilege" parameter which will be tested at runtime. Depending on the outcome of the check, the rule turns into an allow or deny rule. Executing these checks will be implemented separately. At the moment, a <check> is basically the same as <deny>. The representation of a rule grows by one additional pointer and needs one additional bit to represent <check> in addition to <allow>/<deny>. Reordering elements might mitigate this effect. Change-Id: I25baa802fdf41413a78200273c3a0b17ae7f1cfa