Re: [syzbot] [efi?] [fs?] BUG: unable to handle kernel paging request in efivarfs_pm_notify

Ard Biesheuvel
2025-02-23T15:45:30Z

#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci

--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -367,6 +367,8 @@ static int efivarfs_fill_super(struct super_block
*sb, struct fs_context *fc)
if (err)
return err;

+ register_pm_notifier(&sfi->pm_nb);
+
return efivar_init(efivarfs_callback, sb, true);
}

@@ -552,7 +554,6 @@ static int efivarfs_init_fs_context(struct fs_context *fc)

sfi->pm_nb.notifier_call = efivarfs_pm_notify;
sfi->pm_nb.priority = 0;
- register_pm_notifier(&sfi->pm_nb);

return 0;
}