certs: Replace K{U,G}IDT_INIT() with GLOBAL_ROOT_{U,G}ID
authorMickaël Salaün <mic@linux.microsoft.com>
Fri, 20 Nov 2020 18:04:25 +0000 (19:04 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 21 Jan 2021 16:16:10 +0000 (16:16 +0000)
Align with the new macros and add appropriate include files.

Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: David Woodhouse <dwmw2@infradead.org>
certs/blacklist.c
certs/system_keyring.c

index 0294719..bffe4c6 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/ctype.h>
 #include <linux/err.h>
 #include <linux/seq_file.h>
+#include <linux/uidgid.h>
 #include <keys/system_keyring.h>
 #include "blacklist.h"
 
@@ -156,8 +157,7 @@ static int __init blacklist_init(void)
 
        blacklist_keyring =
                keyring_alloc(".blacklist",
-                             KUIDT_INIT(0), KGIDT_INIT(0),
-                             current_cred(),
+                             GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, current_cred(),
                              (KEY_POS_ALL & ~KEY_POS_SETATTR) |
                              KEY_USR_VIEW | KEY_USR_READ |
                              KEY_USR_SEARCH,
index 7982911..4b693da 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/cred.h>
 #include <linux/err.h>
 #include <linux/slab.h>
+#include <linux/uidgid.h>
 #include <linux/verification.h>
 #include <keys/asymmetric-type.h>
 #include <keys/system_keyring.h>
@@ -98,7 +99,7 @@ static __init int system_trusted_keyring_init(void)
 
        builtin_trusted_keys =
                keyring_alloc(".builtin_trusted_keys",
-                             KUIDT_INIT(0), KGIDT_INIT(0), current_cred(),
+                             GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, current_cred(),
                              ((KEY_POS_ALL & ~KEY_POS_SETATTR) |
                              KEY_USR_VIEW | KEY_USR_READ | KEY_USR_SEARCH),
                              KEY_ALLOC_NOT_IN_QUOTA,
@@ -109,7 +110,7 @@ static __init int system_trusted_keyring_init(void)
 #ifdef CONFIG_SECONDARY_TRUSTED_KEYRING
        secondary_trusted_keys =
                keyring_alloc(".secondary_trusted_keys",
-                             KUIDT_INIT(0), KGIDT_INIT(0), current_cred(),
+                             GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, current_cred(),
                              ((KEY_POS_ALL & ~KEY_POS_SETATTR) |
                               KEY_USR_VIEW | KEY_USR_READ | KEY_USR_SEARCH |
                               KEY_USR_WRITE),