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>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user