diff options
author | Christoph Hellwig <hch@lst.de> | 2020-07-22 11:14:02 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-07-31 08:17:53 +0200 |
commit | eb9d7d390e51108b4c6a9a7993ed9be92548c8f7 (patch) | |
tree | 6881b1da19a06e63f1c4d6ba81403dfe94697553 /init/main.c | |
parent | 1097742efc643ffc667c5c6684635b2663145a7d (diff) |
init: add an init_eaccess helper
Add a simple helper to check if a file exists based on kernel space file
name and switch the early init code over to it. Note that this
theoretically changes behavior as it always is based on the effective
permissions. But during early init that doesn't make a difference.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/init/main.c b/init/main.c index 47698427b15f..1c710d3e1d46 100644 --- a/init/main.c +++ b/init/main.c @@ -96,6 +96,7 @@ #include <linux/jump_label.h> #include <linux/mem_encrypt.h> #include <linux/kcsan.h> +#include <linux/init_syscalls.h> #include <asm/io.h> #include <asm/bugs.h> @@ -1514,8 +1515,7 @@ static noinline void __init kernel_init_freeable(void) * check if there is an early userspace init. If yes, let it do all * the work */ - if (ksys_access((const char __user *) - ramdisk_execute_command, 0) != 0) { + if (init_eaccess(ramdisk_execute_command) != 0) { ramdisk_execute_command = NULL; prepare_namespace(); } |