@@ -115,7 +115,7 @@ int __init init_eaccess(const char *filename)
struct path path;
int error;
- error = kern_path(filename, LOOKUP_FOLLOW, &path);
+ error = kern_path(filename, LOOKUP_FOLLOW | LOOKUP_DOWN, &path);
if (error)
return error;
error = path_permission(&path, MAY_ACCESS);
@@ -1522,6 +1522,11 @@ void __init console_on_rootfs(void)
fput(file);
}
+bool __init ramdisk_exec_exist(void)
+{
+ return init_eaccess(ramdisk_execute_command) == 0;
+}
+
static noinline void __init kernel_init_freeable(void)
{
/*
@@ -1568,7 +1573,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 (init_eaccess(ramdisk_execute_command) != 0) {
+ if (!ramdisk_exec_exist()) {
ramdisk_execute_command = NULL;
prepare_namespace();
}