Re: [systemd-devel] SD_BUS_VTABLE_CAPABILITY

2015-04-17 Thread Djalal Harouni
n perhaps ? Please note that we also have _per_ user quota accounting, the trade off of accouting prevents further performance penalties on other bus operations. Referring to performance critical code, this code path can just be ignored by to not opt-in for KDBUS_ATTACH_CAPS which is the default

Re: [systemd-devel] [PATCH v2] log: be more verbose if dbus job fails

2015-04-09 Thread Djalal Harouni
uot;, > > +[SERVICE_FAILURE_TIMEOUT] = "timeout", > > +[SERVICE_FAILURE_EXIT_CODE] = "exit-code", > > +[SERVICE_FAILURE_SIGNAL] = "signal", > > +[SERVICE_FAILURE_CORE_DUMP] = "core-dump", > > +[SER

Re: [systemd-devel] [PATCH 2/2] macro: allow assert_se() assertions to also be optimized out when NDEBUG is set

2015-03-31 Thread Djalal Harouni
Hi Shawn, On Tue, Mar 31, 2015 at 04:59:29PM -0700, Shawn Landden wrote: > On Tue, Mar 31, 2015 at 2:40 PM, Djalal Harouni wrote: > > On Tue, Mar 31, 2015 at 11:10:34AM -0700, Shawn Landden wrote: [...] > >> The point is that assert() and assert_se() should only be used fo

Re: [systemd-devel] [PATCH 2/2] macro: allow assert_se() assertions to also be optimized out when NDEBUG is set

2015-03-31 Thread Djalal Harouni
On Tue, Mar 31, 2015 at 11:10:34AM -0700, Shawn Landden wrote: > On Tue, Mar 31, 2015 at 8:38 AM, Djalal Harouni wrote: > > On Mon, Mar 30, 2015 at 07:32:35PM -0700, Shawn Landden wrote: > >> On Mon, Mar 30, 2015 at 5:04 PM, Djalal Harouni wrote: > >> > On Fri, Ma

Re: [systemd-devel] [PATCH 2/2] macro: allow assert_se() assertions to also be optimized out when NDEBUG is set

2015-03-31 Thread Djalal Harouni
On Mon, Mar 30, 2015 at 07:32:35PM -0700, Shawn Landden wrote: > On Mon, Mar 30, 2015 at 5:04 PM, Djalal Harouni wrote: > > On Fri, Mar 27, 2015 at 09:51:26AM -0700, Shawn Landden wrote: > >> On Fri, Mar 27, 2015 at 8:16 AM, Tom Gundersen wrote: > > [...] > >> &

Re: [systemd-devel] [PATCH 2/2] macro: allow assert_se() assertions to also be optimized out when NDEBUG is set

2015-03-30 Thread Djalal Harouni
s. It is not to make it > faster, I think that is negligible. Hmm embedded cases are real, I had to deal with some in the past. But not sure here since I didn't see any numbers before/after stripping, but perhaps you can start by updating the callers and their semantics if y

Re: [systemd-devel] [PATCH 2/2] macro: allow assert_se() assertions to also be optimized out when NDEBUG is set

2015-03-28 Thread Djalal Harouni
On Fri, Mar 27, 2015 at 04:16:55PM +0100, Tom Gundersen wrote: > On Fri, Mar 27, 2015 at 2:04 PM, Djalal Harouni wrote: > > Hi Shawn, > > > > On Thu, Mar 26, 2015 at 11:21:54PM -0700, Shawn Landden wrote: > >> On Thu, Mar 26, 2015 at 5:47 PM, Djalal Harouni wrote:

Re: [systemd-devel] [PATCH 2/2] macro: allow assert_se() assertions to also be optimized out when NDEBUG is set

2015-03-27 Thread Djalal Harouni
Hi Shawn, On Thu, Mar 26, 2015 at 11:21:54PM -0700, Shawn Landden wrote: > On Thu, Mar 26, 2015 at 5:47 PM, Djalal Harouni wrote: > > On Fri, Mar 27, 2015 at 12:30:53AM +0100, Tom Gundersen wrote: > >> On Thu, Mar 26, 2015 at 9:19 AM, Lennart Poettering > >> wrote: &g

Re: [systemd-devel] [PATCH 2/2] macro: allow assert_se() assertions to also be optimized out when NDEBUG is set

2015-03-26 Thread Djalal Harouni
ndif > >> > >> -- > >> 2.2.1.209.g41e5f3a > >> > >> ___ > >> systemd-devel mailing list > >> systemd-devel@lists.freedesktop.org > >> http://lists.freedesktop.org/mailman/listinfo/systemd-

Re: [systemd-devel] [PATCH] path-lookup: use secure_getenv()

2015-03-16 Thread Djalal Harouni
forget about them even if they are called later from libraries or copy+past into a library call... ?! > Thanks > David > ___ > systemd-devel mailing list > systemd-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/list

Re: [systemd-devel] [PATCH][RFC] bus-proxy: add support for "GetConnectionCredentials" method

2015-02-19 Thread Djalal Harouni
On Thu, Feb 19, 2015 at 05:44:34PM +0100, Djalal Harouni wrote: > On Thu, Feb 19, 2015 at 01:05:22PM +, Simon McVittie wrote: > > On 19/02/15 12:43, Lukasz Skalski wrote: > > >GetConnectionCredentials method was added to dbus-1 specification > > >more than one y

Re: [systemd-devel] [PATCH][RFC] bus-proxy: add support for "GetConnectionCredentials" method

2015-02-19 Thread Djalal Harouni
gh kdbus knowledge to > know about those might as well be using kdbus directly. > > >+r = get_creds_by_message(a, m, > >SD_BUS_CREDS_PID|SD_BUS_CREDS_EUID, &creds, &error); > > Can this ever return "unknown" (-1?) for creds->pid or creds->e

Re: [systemd-devel] [PATCH] test: bump KDBUS_CONN_MAX_MSGS_PER_USER value

2015-02-17 Thread Djalal Harouni
USER16 > +#define KDBUS_CONN_MAX_MSGS_PER_USER128 > > /** > * Note: this test can be used to inspect policy_db->talk_access_hash > -- > 1.9.3 > > ___ > systemd-devel mailing list > systemd-devel@li

[systemd-devel] [PATCH] sd-rtnl: add missing IFLA_INET6_ADDR_GEN_MODE definition

2015-02-13 Thread Djalal Harouni
Add missing IFLA_INET6_ADDR_GEN_MODE definition so we can build with kernel headers < 3.17 --- configure.ac | 3 ++- src/shared/missing.h | 18 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 684c793..97a29d6 100644 --- a

Re: [systemd-devel] systemd-nspawn create container under unprivileged user

2015-02-11 Thread Djalal Harouni
On Wed, Feb 11, 2015 at 05:06:56PM +0100, Lennart Poettering wrote: > On Wed, 11.02.15 13:53, Djalal Harouni (tix...@opendz.org) wrote: > > > On Tue, Feb 10, 2015 at 12:52:34PM +0100, Lennart Poettering wrote: > > > On Thu, 05.02.15 02:03, Vasiliy Tolstov (v.tol

Re: [systemd-devel] systemd-nspawn create container under unprivileged user

2015-02-11 Thread Djalal Harouni
his is not true, we don't have CAP_SYS_MODULE... this will confuse programs running inside containers, we'll have to add more code paths for this special case... and not only CAP_SYS_MODULE, perhaps there are other cases... -- Djalal Harouni http://opendz.org

Re: [systemd-devel] [PATCH] Assorted typo fixes

2015-01-19 Thread Djalal Harouni
On Mon, Jan 19, 2015 at 02:42:31PM +0200, Mantas Mikulėnas wrote: > On Mon, Jan 19, 2015 at 2:26 PM, Djalal Harouni wrote: > > > Hi, > > > > On Mon, Jan 19, 2015 at 10:46:23AM +0100, Rémi Audebert wrote: > > > Signed-off-by: Rémi Audebert > > Your email

Re: [systemd-devel] [PATCH] Assorted typo fixes

2015-01-19 Thread Djalal Harouni
to be sent. An attempt to send less that that should result > - * in -ECONNREFUSED. > + * to be sent. An attempt to send less than that should result in > + * -ECONNREFUSED. >*/ > hello.attach_flags_send = _KDBUS_ATTACH_ALL & ~KDBUS_ATTACH_TIMESTAMP;

Re: [systemd-devel] [PATCH 1/2] Add detect_userns to detect uid/gid shifts

2015-01-08 Thread Djalal Harouni
space, major ones do not support this... > Tom > > [0]: > [1]: > > [root@tomegun-x240 userns]# ./userns_child_exec -U -M '0 0 4294967295' > -G '0 0 4294967295' bash > [root@tomegun-x240 userns]# mknod null b 1 3 > mknod: ‘null’: Operation not perm

Re: [systemd-devel] [PATCH 1/2] Add detect_userns to detect uid/gid shifts

2015-01-08 Thread Djalal Harouni
eparate user namespace and still > have the same map as the host is if you had a privileged helper write > the whole host uid and gid map to your process' uid_map and gid_map, in > which case, your process' uid 0 is mapped to the host uid 0 and while > you are technically in a different namespace than the host, yo

Re: [systemd-devel] [PATCH v3] Do not clear parent mount flags when setting up namespaces

2015-01-04 Thread Djalal Harouni
> MS_RDONLY : 0), NULL) < 0) { > > +r = get_mount_flags(x, &orig_flags); > > +if (r < 0) > > + return r; > > +orig_flags &= ~MS_RDONLY; > > +

Re: [systemd-devel] [PATCH v2] Do not clear parent mount flags when setting up namespaces

2015-01-02 Thread Djalal Harouni
/shared/util.c > @@ -61,6 +61,7 @@ > #include > #include > #include > +#include > #undef basename > > #ifdef HAVE_SYS_AUXV_H > @@ -6858,6 +6859,15 @@ int umount_recursive(const char *prefix, int flags) { > return r ? r : n; > } > > +uns

Re: [systemd-devel] [PATCH] Do not clear parent mount flags when setting up namespaces

2015-01-02 Thread Djalal Harouni
custom endpoints /sys/fs/kdbus// [1], the whole thing is mounted on top of tmpfs in order to hide the rest of the kdbufs tree The custom endpoints are created when creating services, this will be part of the namespaced apps setup where apps will only see a subset of names on a bus... the cus

Re: [systemd-devel] Compatibility between D-Bus and kdbus

2014-12-01 Thread Djalal Harouni
if they cannot be translated due to namespaces. > > > > Thanks. Could you clarify in the docs? > > Daniel, David? Could you add a note about this? Ok pushed a note about namespace issues, thanks! -- Djalal Harouni http://opendz.org ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] Unprivileged poweroff

2014-10-22 Thread Djalal Harouni
ged (capabilities gathered when the message was queued). Hope I'm not missing something, otherwise let me know, thank you Simon! > S > > ___ > systemd-devel mailing list > systemd-dev

[systemd-devel] [PATCH 2/2] test: Use 'CapBnd' string for capability bounding set

2014-09-16 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- test/kdbus-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kdbus-util.c b/test/kdbus-util.c index fe4565c..b1c5864 100644 --- a/test/kdbus-util.c +++ b/test/kdbus-util.c @@ -569,7 +569,7 @@ void kdbus_msg_dump(const struct

[systemd-devel] [PATCH 1/2] test: some tests to enforce routing messages by connections ID

2014-09-16 Thread Djalal Harouni
best practice and to be able to free the returned kdbus_msg and the slice pointed by that offset. Signed-off-by: Djalal Harouni --- Hi Daniel, before applying please make sure that we want this. It follows what I've discussed in the other mail, otherwise just test it, it will give a better vi

Re: [systemd-devel] [PATCH 2/2] policy: make policy checks work across user namespaces

2014-09-09 Thread Djalal Harouni
On Tue, Sep 09, 2014 at 10:40:57AM +0200, Daniel Mack wrote: > On 09/08/2014 03:50 PM, Djalal Harouni wrote: > > Yes there are compile time checks, and it is perhaps easier/consistent > > to read this way! but yes a union is also good. OK I'll update it. > > Nevermind

Re: [systemd-devel] [PATCH 1/2] test: update policy tests to handle user namespaces

2014-09-08 Thread Djalal Harouni
On Mon, Sep 08, 2014 at 03:32:21PM +0200, Daniel Mack wrote: > On 09/08/2014 03:18 PM, Djalal Harouni wrote: > > Upstream kernels allow unprivileged users to create user namespaces > > and change their uid/gid. > > > > These patches update kdbus policy logic to handl

Re: [systemd-devel] [PATCH 2/2] policy: make policy checks work across user namespaces

2014-09-08 Thread Djalal Harouni
On Mon, Sep 08, 2014 at 03:27:42PM +0200, Daniel Mack wrote: > On 09/08/2014 03:18 PM, Djalal Harouni wrote: > > * This is the internal version of struct kdbus_policy_db_access. > > @@ -51,7 +52,8 @@ struct kdbus_policy_db_cache_entry { > > struct kdbus_policy_db_entry_acc

[systemd-devel] [PATCH 2/2] policy: make policy checks work across user namespaces

2014-09-08 Thread Djalal Harouni
we can add it later a la: fs/inode.c:inode_owner_or_capable() Add kdbus_policy_make_access() to convert the user provided info to the current user namespace. Userspace struct is not changed, only the kernel one. This patch fixes test #8 of test-kdbus-policy Signed-off-by: Djalal Harouni

[systemd-devel] [PATCH 1/2] test: update policy tests to handle user namespaces

2014-09-08 Thread Djalal Harouni
. * kdbus_clone_userns_test() that performs the test inside a new user namespace. * Converts all the other tests to return CHECK_OK, CHECK_SKIP or CHECK_ERR so we are consistent. Currently we fail at kdbus_clone_userns_test() test #8. The next patch will fix this issue. Signed-off-by: Djalal Harouni --- test

[systemd-devel] [PATCH] sd-bus: kdbus: monitor connections use the KDBUS_HELLO_MONITOR flag

2014-08-22 Thread Djalal Harouni
--- Currently this bus_kernel_create_monitor() is not used. Patch compile tested. src/libsystemd/sd-bus/bus-kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index 3ca271c..1440e43 100644 --- a/sr

Re: [systemd-devel] [PATCH 3/3] kdbus: get some creds during meta append for optimization

2014-08-21 Thread Djalal Harouni
On Wed, Aug 20, 2014 at 10:49:22PM +0200, Daniel Mack wrote: > On 08/20/2014 06:16 PM, Djalal Harouni wrote: > > On Tue, Aug 19, 2014 at 09:15:35AM +0200, Daniel Mack wrote: > > >> Hmm, I'm not convinced this buys us anything really. After all, that > >>

[systemd-devel] [PATCH] test: use audit.loginuid and audit.sessionid when dumping the audit item

2014-08-20 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- test/kdbus-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/kdbus-util.c b/test/kdbus-util.c index f79d7ec..5b3df7d 100644 --- a/test/kdbus-util.c +++ b/test/kdbus-util.c @@ -471,8 +471,8 @@ void msg_dump(const struct conn

Re: [systemd-devel] [PATCH 1/2] test: in msg_dump() fix kdbus_audit fields order

2014-08-20 Thread Djalal Harouni
On Wed, Aug 20, 2014 at 06:04:09PM +0200, Daniel Mack wrote: > On 08/20/2014 05:58 PM, Djalal Harouni wrote: > > case KDBUS_ITEM_AUDIT: > > - printf(" +%s (%llu bytes) loginuid=%llu > > sessionid=%llu\n", > > +

Re: [systemd-devel] [PATCH 3/3] kdbus: get some creds during meta append for optimization

2014-08-20 Thread Djalal Harouni
On Tue, Aug 19, 2014 at 09:15:35AM +0200, Daniel Mack wrote: > Hi Djalal, Thanks for applying the others. > On 08/19/2014 03:43 AM, Djalal Harouni wrote: > > Some creds can be gathered during kdbus_meta_append() instead of > > kdbus_conn_queue_alloc() where they will be ga

[systemd-devel] [PATCH 2/2] kdbus: do the audit loginuid translation as late as possible

2014-08-20 Thread Djalal Harouni
Do the namespace translation just before pushing into the receiver's slice, so we map to the receiver's user namespace. Patch tested. Signed-off-by: Djalal Harouni --- connection.c | 37 + metadata.c | 3 +++ metadata.h | 4 3 files c

[systemd-devel] [PATCH 1/2] test: in msg_dump() fix kdbus_audit fields order

2014-08-20 Thread Djalal Harouni
We have sessionid then loginuid in kdbus_audit. Signed-off-by: Djalal Harouni --- test/kdbus-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kdbus-util.c b/test/kdbus-util.c index f79d7ec..956fa6f 100644 --- a/test/kdbus-util.c +++ b/test/kdbus-util.c @@ -469,7

Re: [systemd-devel] kdbus: merge 3.17 branch into master?

2014-08-19 Thread Djalal Harouni
, name, MFD_ALLOW_SEALING); > > Ok, cpp is really confused about which headers to look at now. I guess > we have to rely on the kernel headers being available under > $(KERNELDIR)/usr/include. > > Could you please try if temporarily reverting my top-m

Re: [systemd-devel] kdbus: merge 3.17 branch into master?

2014-08-19 Thread Djalal Harouni
was first reported by Greg, and to compile and test kdbus, I just added "export KERNELDIR" to the root Makefile, didn't bother to search... -- Djalal Harouni http://opendz.org ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] [PATCH 3/3] kdbus: get some creds during meta append for optimization

2014-08-18 Thread Djalal Harouni
it. Patch tested with the test-kdbus-metadata-ns Signed-off-by: Djalal Harouni --- connection.c | 56 metadata.c | 6 +- metadata.h | 26 ++ 3 files changed, 67 insertions(+), 21 deletions(-) diff --git a

[systemd-devel] [PATCH 2/3] connection: move the install creds into the slice to its own function

2014-08-18 Thread Djalal Harouni
Move the install creds into the receiver's slice to its own function kdbus_conn_creds_install(). Use from_kuid_munged(), so the uid mapping never fails. Signed-off-by: Djalal Harouni --- connection.c | 32 1 file changed, 20 insertions(+), 12 deletions(-)

[systemd-devel] [PATCH 1/3] metadata: document creds_item_off and auxgrps_item_off fields

2014-08-18 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- metadata.c | 3 ++- metadata.h | 8 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/metadata.c b/metadata.c index eb286aa..3dff9ac 100644 --- a/metadata.c +++ b/metadata.c @@ -130,7 +130,8 @@ kdbus_meta_append_item(struct kdbus_meta *meta

[systemd-devel] [PATCH 0/3] kdbus: metadata improvements

2014-08-18 Thread Djalal Harouni
Hi, Patch 1 and 2 should be applied. For patch 3 it can be discussed :-) Please apply on top of the test series that contain the test-kdbus-metadta-ns tool. Thanks! ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freede

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread Djalal Harouni
ered a compile-time > constant. I don't know whether conditions with __builtin_constant_p() > are evaluated at the parser-step. The GCC example replaces the ELSE > case with -1, effectively making both compile-time constants. Sorry I didn't follow the thread, but: Actually and IIRC

[systemd-devel] [PATCH 3/3] test: split conn_update() into update attach-flags and update policy

2014-08-04 Thread Djalal Harouni
all the tests. This prevents messing up with the attach-flags. Signed-off-by: Djalal Harouni --- test/kdbus-util.c| 62 +++- test/kdbus-util.h| 7 +++--- test/test-kdbus-policy.c | 2 +- 3 files changed, 45 insertions(+), 26 deletions

[systemd-devel] [PATCH 2/3] connection: improve kdbus_cmd_conn_update() connection type checks

2014-08-04 Thread Djalal Harouni
in it. And update a kdbus_policy_set() call to only pass a one name per policy-holding connection Signed-off-by: Djalal Harouni --- connection.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/connection.c b/connection.c index c2d71a8..342c870 100644

[systemd-devel] [PATCH 1/3] handle: allow KDBUS_CMD_CONN_UPDATE ioctl for policy holders

2014-08-04 Thread Djalal Harouni
Allow KDBUS_CMD_CONN_UPDATE for KDBUS_CONN_POLICY_HOLDER connections. Signed-off-by: Djalal Harouni --- handle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handle.c b/handle.c index 2e6502b..ac68681 100644 --- a/handle.c +++ b/handle.c @@ -636,8 +636,8 @@ static

[systemd-devel] [PATCH 0/3] more improvements on connection types checks

2014-08-04 Thread Djalal Harouni
Hi, This goes on top of the previous one: http://lists.freedesktop.org/archives/systemd-devel/2014-August/021747.html Kay, sorry it should be perhaps just be a one series, but I just noticed those bugs, so just send quick fixes. If you want me to resend as a one series, I will do it, no problem.

[systemd-devel] [PATCH 2/2] handle: return -EOPNOTSUPP instead of -EPERM if an operation is not supported

2014-08-04 Thread Djalal Harouni
If userspace calls in with the wrong connection type, just return -EOPNOTSUPP instead of -EPERM. This will not confuse unprivileged and privileged processes, and permits to identify legitimate -EPERM errors. This just converts errors introduced in commit 7015a1e6746 Signed-off-by: Djalal

[systemd-devel] [PATCH 1/2] test: sync the policy tests with the recent activators and policy holders changes

2014-08-04 Thread Djalal Harouni
. Signed-off-by: Djalal Harouni --- test/test-kdbus-policy.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/test/test-kdbus-policy.c b/test/test-kdbus-policy.c index a2430f2..e0bd619 100644 --- a/test/test-kdbus-policy.c +++ b/test/test-kdbus

Re: [systemd-devel] [PATCH 0/5] kdbus: allow multiple policies

2014-08-03 Thread Djalal Harouni
nd in different places of the code we only check for activators when doing send/recv validation. So I guess we should also block policy holders from owning well-known names ? hmm, then add the policy holders to the "block X connections from sending or receiving

Re: [systemd-devel] [PATCH 0/5] kdbus: allow multiple policies

2014-08-01 Thread Djalal Harouni
Hi, On Thu, Jul 31, 2014 at 10:38:47PM +0200, Kay Sievers wrote: > On Thu, Jul 31, 2014 at 8:57 PM, Djalal Harouni wrote: > > (Cc'ed Lennart) > > > > On Thu, Jul 31, 2014 at 05:40:53PM +0200, Kay Sievers wrote: > >> On Wed, Jul 23, 2014 at 6:34 PM, Djalal Haro

Re: [systemd-devel] [PATCH 0/5] kdbus: allow multiple policies

2014-07-31 Thread Djalal Harouni
(Cc'ed Lennart) On Thu, Jul 31, 2014 at 05:40:53PM +0200, Kay Sievers wrote: > On Wed, Jul 23, 2014 at 6:34 PM, Djalal Harouni wrote: > > This series adds the infrastructure to test and upload multiple > > policies. > > > > The last #5 patch allows to upload

[systemd-devel] [PATCH v2 7/7] domain: remove dead kdbus_domain_user_find_or_new()

2014-07-30 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- domain.c | 67 domain.h | 2 -- 2 files changed, 69 deletions(-) diff --git a/domain.c b/domain.c index 1e2c3c9..eeb73ca 100644 --- a/domain.c +++ b/domain.c @@ -557,73 +557,6 @@ int

[systemd-devel] [PATCH v2 6/7] connection: fix user quota accounting corruption

2014-07-30 Thread Djalal Harouni
First use kzalloc to allocate the users array, so we do not reference unintialized values. And free the old conn->msg_users array not the newly allocated 'users' one. Patch tested, and users will hit the KDBUS_CONN_MAX_MSGS_PER_USER limit and fail with -ENOBUFS Signed-off-by: D

[systemd-devel] [PATCH v2 5/7] bus: improve user quota accounting and domain locking

2014-07-30 Thread Djalal Harouni
mes. kdbus_bus_new(): => take domain lock => check if domain is still active/connected => __kdbus_domain_user_account() ... Signed-off-by: Djalal Harouni --- bus.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bus.c b/bus.c index d09e3c6..9e

[systemd-devel] [PATCH v2 4/7] kdbus: improve user quota accounting by using kdbus_domain_user_account()

2014-07-30 Thread Djalal Harouni
last one in bus.c is updated in the next patch. Signed-off-by: Djalal Harouni --- connection.c | 12 ++-- handle.c | 8 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/connection.c b/connection.c index 1658a92..8838029 100644 --- a/connection.c +++ b

[systemd-devel] [PATCH v2 3/7] domain: add kdbus_domain_user_account()

2014-07-30 Thread Djalal Harouni
Add kdbus_domain_user_account() to account and link users into a domain. This function will take the domain lock, and it will be used as a replacement for kdbus_domain_user_find_or_new(). Signed-off-by: Djalal Harouni --- domain.c | 36 domain.h | 4

[systemd-devel] [PATCH v2 2/7] domain: add __kdbus_domain_user_account() to account domain users

2014-07-30 Thread Djalal Harouni
Add __kdbus_domain_user_account() to account and link users into a domain. Signed-off-by: Djalal Harouni --- domain.c | 70 domain.h | 4 2 files changed, 74 insertions(+) diff --git a/domain.c b/domain.c index af9d986

[systemd-devel] [PATCH v2 1/7] domain: add kdbus_domain_user_assign_id() to assign IDs to domain users

2014-07-30 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- domain.c | 33 + 1 file changed, 33 insertions(+) diff --git a/domain.c b/domain.c index c4912fa..af9d986 100644 --- a/domain.c +++ b/domain.c @@ -419,6 +419,39 @@ int kdbus_domain_make_user(struct kdbus_cmd_make *cmd, char

[systemd-devel] [PATCH v2 0/7] kdbus: improve user domain accounting

2014-07-30 Thread Djalal Harouni
Hi, This is series v2 of: http://lists.freedesktop.org/archives/systemd-devel/2014-July/021526.html This series improves user domain accounting and fixes some bugs. It should go on top of the "kdbus: allow multiple policies" series: http://lists.freedesktop.org/archives/systemd-devel/2014-July/0

Re: [systemd-devel] [PATCH 0/7] kdbus: improve user domain accounting

2014-07-29 Thread Djalal Harouni
On Wed, Jul 23, 2014 at 10:19:04PM +0100, Djalal Harouni wrote: > Hi, > > This series improves user domain accounting and fixes some bugs. > > On top of the "kdbus: allow multiple policies" series: > http://lists.freedesktop.org/archives/systemd-devel/2014-July/0215

Re: [systemd-devel] [PATCH 7/7] connection: fix user quota accounting corruption

2014-07-24 Thread Djalal Harouni
Hi, It seems there is still another bug in the use/caculation of conn->msg_users_max, will send another patch on top of this. On Wed, Jul 23, 2014 at 10:19:11PM +0100, Djalal Harouni wrote: > First use kzalloc to allocate the users array, so we do not reference > unintialized values.

[systemd-devel] [PATCH 7/7] connection: fix user quota accounting corruption

2014-07-23 Thread Djalal Harouni
First use kzalloc to allocate the users array, so we do not reference unintialized values. And free the old conn->msg_users array not the newly allocated 'users' one. Patch tested, and users will hit the KDBUS_CONN_MAX_MSGS_PER_USER limit and fail with -ENOBUFS Signed-off-by: D

[systemd-devel] [PATCH 6/7] bus: call __kdbus_domain_user_account() and avoid an extra domain lock

2014-07-23 Thread Djalal Harouni
ain lock 2 times by replacing the kdbus_domain_user_find_or_new() with kdbus_domain_user_find(): take the lock 1 time kdbus_domain_user_new() + kdbus_bus_new(): take the lock 1 time and use the unlocked version __kdbus_domain_user_account() to account the user. Signed-off-by: Djalal Harouni --- bu

[systemd-devel] [PATCH 5/7] kdbus: improve user domain accounting

2014-07-23 Thread Djalal Harouni
) So convert the former to 1, and adapt other parts of the code to treat 1 as the starting id of user indexes. Signed-off-by: Djalal Harouni --- bus.c| 4 ++-- connection.c | 19 +++ domain.c | 76 +--- handle.c

[systemd-devel] [PATCH 4/7] domain: add kdbus_domain_user_find()

2014-07-23 Thread Djalal Harouni
Add kdbus_domain_user_find() to look up domain users Signed-off-by: Djalal Harouni --- domain.c | 32 1 file changed, 32 insertions(+) diff --git a/domain.c b/domain.c index 18dc2a7..a5abb2d 100644 --- a/domain.c +++ b/domain.c @@ -446,6 +446,38

[systemd-devel] [PATCH 3/7] domain: add kdbus_domain_user_new()

2014-07-23 Thread Djalal Harouni
Add kdbus_domain_user_new() to allocate kdbus_domain_user objects. Signed-off-by: Djalal Harouni --- domain.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/domain.c b/domain.c index 86fde55..18dc2a7 100644 --- a/domain.c +++ b/domain.c @@ -419,6 +419,33 @@ int

[systemd-devel] [PATCH 2/7] domain: add the lock protected version of user accounting

2014-07-23 Thread Djalal Harouni
Add the lock protected version of __kdbus_domain_user_account(). It will check if the domain is still active before linking users. Signed-off-by: Djalal Harouni --- domain.c | 24 1 file changed, 24 insertions(+) diff --git a/domain.c b/domain.c index a321f31..86fde55

[systemd-devel] [PATCH 1/7] domain: add __kdbus_domain_user_account() to account and link users

2014-07-23 Thread Djalal Harouni
Add __kdbus_domain_user_account() to account and link users into a domain. Signed-off-by: Djalal Harouni --- domain.c | 32 1 file changed, 32 insertions(+) diff --git a/domain.c b/domain.c index c4912fa..a321f31 100644 --- a/domain.c +++ b/domain.c @@ -419,6

[systemd-devel] [PATCH 0/7] kdbus: improve user domain accounting

2014-07-23 Thread Djalal Harouni
Hi, This series improves user domain accounting and fixes some bugs. On top of the "kdbus: allow multiple policies" series: http://lists.freedesktop.org/archives/systemd-devel/2014-July/021514.html Patches 1, 2, 3 and 4 are preparation patches to improve the code. Patch 5 fixes kdbus_domain_us

[systemd-devel] [PATCH 5/5] connection: allow policy holders to install multiple names

2014-07-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- connection.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/connection.c b/connection.c index 85ffa5a..1658a92 100644 --- a/connection.c +++ b/connection.c @@ -1905,7 +1905,11 @@ int kdbus_conn_new(struct kdbus_ep *ep

[systemd-devel] [PATCH 4/5] test: register multiple policies

2014-07-23 Thread Djalal Harouni
Update the policy test in order to register multiple policies Signed-off-by: Djalal Harouni --- test/test-kdbus-policy.c | 57 +--- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/test/test-kdbus-policy.c b/test/test-kdbus-policy.c

[systemd-devel] [PATCH 3/5] test: add infrastructure to allow multiple policies per connection

2014-07-23 Thread Djalal Harouni
icies size kdbus_policy_make_item_name() to make a policy item composed of: KDBUS_ITEM_NAME + (num_access * KDBUS_ITEM_POLICY_ACCESS) kdbus_policy_make_entries() a helper to construct multiple policies Signed-off-by: Djalal Harouni --- test/kdbus-u

[systemd-devel] [PATCH 2/5] test: add the struct kdbus_policy_entry to be used for tests

2014-07-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- test/kdbus-util.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/test/kdbus-util.h b/test/kdbus-util.h index 0fcfb72..39d7bb5 100644 --- a/test/kdbus-util.h +++ b/test/kdbus-util.h @@ -36,6 +36,12 @@ struct conn { size_t size; }; +struct

[systemd-devel] [PATCH 1/5] test: correctly set the 'ret' variable

2014-07-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- test/test-kdbus-policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test-kdbus-policy.c b/test/test-kdbus-policy.c index 6099087..de725e9 100644 --- a/test/test-kdbus-policy.c +++ b/test/test-kdbus-policy.c @@ -200,7 +200,7

[systemd-devel] [PATCH 0/5] kdbus: allow multiple policies

2014-07-23 Thread Djalal Harouni
This series adds the infrastructure to test and upload multiple policies. The last #5 patch allows to upload multiple policies per connection The todo for the policy holders is: * Should we set a maximum value for how many names/policies a policy holder is allowed to upload. This is needed sin

Re: [systemd-devel] [PATCH 2/3] nspawn: use Barrier API instead of eventfd-util

2014-07-17 Thread Djalal Harouni
On Thu, Jul 17, 2014 at 11:30:26AM +0200, David Herrmann wrote: > Hi > > On Mon, Jul 14, 2014 at 3:28 AM, Djalal Harouni wrote: > > ppoll is atomic and it is handled by the kernel, so perhaps > > setting/restoring sigmask can be done easily! and for nspawn: IMO we need &

Re: [systemd-devel] [PATCH 2/3] nspawn: use Barrier API instead of eventfd-util

2014-07-13 Thread Djalal Harouni
EXIT_FAILURE); > } > > +barrier_set_role(&barrier, BARRIER_PARENT); > fdset_free(fds); > fds = NULL; > > -/* Wait for the child event: > - * If EVENTFD_CHILD_FAILED, the c

Re: [systemd-devel] How to Listen for SessionRemoved Signal

2014-07-11 Thread Djalal Harouni
is wrong, your target here is shutdown... and your process should only do small operations to record something or clean things up... So there is the 'PrepareForShutdown' signal, assume SessionRemoved, then release the inhibitor lock ? http://www.fr

Re: [systemd-devel] kdbus performance regression by ~70% on 3.15 kernels ?

2014-07-01 Thread Djalal Harouni
d try to report. I don't know if memfd needs to do something special, or just convert! I really don't know... > It might also be a good idea to investigate whether one specific meta > data attachments causes the regression. Ok will do, thanks! > > Thanks, > Daniel -- Djalal Harouni http://opendz.org ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] [PATCH] nspawn: When exiting with an error, make the error code meaningful.

2014-06-29 Thread Djalal Harouni
On Mon, Jun 30, 2014 at 01:54:57AM +0100, Djalal Harouni wrote: > On Sun, Jun 29, 2014 at 07:59:38PM -0400, Luke Shumaker wrote: > > At Sun, 29 Jun 2014 12:31:13 +0100, > > Djalal Harouni wrote: > > > On Sat, Jun 28, 2014 at 12:09:56PM -0400, Luke Shumaker wrote: > &g

Re: [systemd-devel] [PATCH] nspawn: When exiting with an error, make the error code meaningful.

2014-06-29 Thread Djalal Harouni
On Sun, Jun 29, 2014 at 07:59:38PM -0400, Luke Shumaker wrote: > At Sun, 29 Jun 2014 12:31:13 +0100, > Djalal Harouni wrote: > > On Sat, Jun 28, 2014 at 12:09:56PM -0400, Luke Shumaker wrote: > > > This is accomplished by having wait_for_container() return a positive > &

Re: [systemd-devel] [PATCH 3/4] connection: use the already cached metadata if KDBUS_HELLO_CACHE_META is set

2014-06-29 Thread Djalal Harouni
On Fri, Jun 27, 2014 at 01:02:19PM +0200, Daniel Mack wrote: > On 06/27/2014 12:46 PM, Kay Sievers wrote: > > On Fri, Jun 27, 2014 at 12:32 PM, Djalal Harouni wrote: > >> For connections with the KDBUS_HELLO_CACHE_META flag dup the > >> metadata/credentials from handle

Re: [systemd-devel] [PATCH] nspawn: When exiting with an error, make the error code meaningful.

2014-06-29 Thread Djalal Harouni
if (r < 0) explicitly set to EXIT_FAILURE, otherwise return the exit code of the containered process. > +if (r < 0) > + r = EXIT_FAILURE; > break; > } else if (container_status == CONTAI

Re: [systemd-devel] kdbus performance regression by ~70% on 3.15 kernels ?

2014-06-27 Thread Djalal Harouni
On Fri, Jun 27, 2014 at 04:55:30PM -0700, Steven Noonan wrote: > On Fri, Jun 27, 2014 at 3:14 PM, Djalal Harouni wrote: > > On Fri, Jun 27, 2014 at 02:28:56PM -0700, Greg KH wrote: > >> On Fri, Jun 27, 2014 at 10:19:03PM +0100, Djalal Harouni wrote: > >> > On Fri, Ju

Re: [systemd-devel] kdbus performance regression by ~70% on 3.15 kernels ?

2014-06-27 Thread Djalal Harouni
On Fri, Jun 27, 2014 at 02:28:56PM -0700, Greg KH wrote: > On Fri, Jun 27, 2014 at 10:19:03PM +0100, Djalal Harouni wrote: > > On Fri, Jun 27, 2014 at 12:23:05PM +0100, Djalal Harouni wrote: > > > On Fri, Jun 27, 2014 at 01:04:00PM +0200, Daniel Mack wrote: > > > >

Re: [systemd-devel] kdbus performance regression by ~70% on 3.15 kernels ?

2014-06-27 Thread Djalal Harouni
On Fri, Jun 27, 2014 at 12:23:05PM +0100, Djalal Harouni wrote: > On Fri, Jun 27, 2014 at 01:04:00PM +0200, Daniel Mack wrote: > > On 06/27/2014 12:51 PM, Djalal Harouni wrote: > > > Just to let you know that I did notice a regression by ~70% when running > > > test-kdb

Re: [systemd-devel] kdbus performance regression by ~70% on 3.15 kernels ?

2014-06-27 Thread Djalal Harouni
On Fri, Jun 27, 2014 at 01:04:00PM +0200, Daniel Mack wrote: > On 06/27/2014 12:51 PM, Djalal Harouni wrote: > > Just to let you know that I did notice a regression by ~70% when running > > test-kdbus-benchmark on a kvm guest (that's what I've under hands now) > >

[systemd-devel] kdbus performance regression by ~70% on 3.15 kernels ?

2014-06-27 Thread Djalal Harouni
x27; name_acquire(): flags after call: 0x0 -- entering poll loop ... stats: 5590 packets processed, latency (usecs) min/max/avg 113/10274/131 stats: 5507 packets processed, latency (usecs) min/max/avg 113/10314/132 stats: 5550 packets processed, latency

[systemd-devel] [PATCH 4/4] kdbus-benchmark: use KDBUS_HELLO_CACHE_META to improve benchmark

2014-06-27 Thread Djalal Harouni
Use the new KDBUS_HELLO_CACHE_META flag to improve benchmark by ~50% This reduces latency and allows sending metadata at the same time. Signed-off-by: Djalal Harouni --- test/test-kdbus-benchmark.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test-kdbus

[systemd-devel] [PATCH 3/4] connection: use the already cached metadata if KDBUS_HELLO_CACHE_META is set

2014-06-27 Thread Djalal Harouni
privileged process. Signed-off-by: Djalal Harouni --- connection.c | 22 +++--- connection.h | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/connection.c b/connection.c index 85ffa5a..f460ad1 100644 --- a/connection.c +++ b/connection.c @@ -1230,7 +1230,16 @@ int

[systemd-devel] [PATCH 2/4] metadata: add kdbus_meta_memdup() to dup a metadata object

2014-06-27 Thread Djalal Harouni
This is a preparation patch thats add kdbus_meta_memdup() to memdup a metadata object. This is useful to connections with a KDBUS_HELLO_CACHE_META flag. Signed-off-by: Djalal Harouni --- metadata.c | 27 +++ metadata.h | 3 ++- 2 files changed, 29 insertions(+), 1

[systemd-devel] [PATCH 1/4] kdbus: add KDBUS_HELLO_CACHE_META to use the cached metadata

2014-06-27 Thread Djalal Harouni
cause the source connection to collect its data on every broadcast round. This allows to provide metadata and reduce latency. Signed-off-by: Djalal Harouni --- kdbus.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/kdbus.h b/kdbus.h index 0b189cb..f637203 100644 --- a/kdbus.h +++ b

[systemd-devel] [PATCH 0/4] kdbus: improve benchmark by using cached metadata

2014-06-27 Thread Djalal Harouni
Hi, First this is just to investigate things! and if it follows kdbus use cases. This is in the spirit of the late kdbus benchmark threads. Do not apply, just trying to investigate things and if it is really useful. I did benchmarks and the improvement is say ~50%, but did not post numbers, sorry

Re: [systemd-devel] [RFC 4/8] HACK0: allow meta information customizable

2014-06-27 Thread Djalal Harouni
On Fri, Jun 27, 2014 at 11:44:06AM +0200, Daniel Mack wrote: > On 06/27/2014 11:33 AM, Djalal Harouni wrote: > > On Fri, Jun 27, 2014 at 11:24:48AM +0200, Daniel Mack wrote: > > >> No, that's what I'm saying. We cannot cache anything as any information > >&g

Re: [systemd-devel] [RFC 4/8] HACK0: allow meta information customizable

2014-06-27 Thread Djalal Harouni
the bus owner nor the bus! you should not connect to that bus. I've already patches that do this! will send them in minutes, we have metadata for free and bechmark improvment hmm say ~50% > > Thanks, > Daniel > > ___

Re: [systemd-devel] [PATCH 07/12] policy: use the db->entries_hash to access the policy db entries

2014-06-24 Thread Djalal Harouni
Hi, On Fri, Jun 20, 2014 at 07:12:13PM +0100, Djalal Harouni wrote: > On Fri, Jun 20, 2014 at 08:01:04PM +0200, Daniel Mack wrote: > > On 06/20/2014 07:28 PM, Daniel Mack wrote: > > > On 06/20/2014 06:50 PM, Djalal Harouni wrote: > > >> Use the db->entries_has

  1   2   3   >