kdbus: adapt to Linux v5.15 release 34/283434/1
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 26 Oct 2022 11:38:16 +0000 (13:38 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 26 Oct 2022 12:58:36 +0000 (14:58 +0200)
Change-Id: I272a0e64cd2a849366803505a291eb2d31548b7b
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
kernel/kdbus/metadata.c

index 274a419..3358d06 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/uidgid.h>
 #include <linux/uio.h>
 #include <linux/user_namespace.h>
+#include <linux/version.h>
 
 #include "bus.h"
 #include "connection.h"
@@ -291,7 +292,11 @@ static int kdbus_meta_proc_collect_seclabel(struct kdbus_meta_proc *mp)
        u32 sid, len;
        int ret;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
+       security_task_getsecid_subj(current, &sid);
+#else
        security_task_getsecid(current, &sid);
+#endif
        ret = security_secid_to_secctx(sid, &ctx, &len);
        if (ret < 0) {
                /*