Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix regression due to "fs: move binfmt_misc sysctl to its own file"

Commit 3ba442d5331f ("fs: move binfmt_misc sysctl to its own file") did
not go unnoticed, binfmt-support stopped to work on my Debian system
since v5.17-rc2 (did not check with -rc1).

The existance of the /proc/sys/fs/binfmt_misc is a precondition for
attempting to mount the binfmt_misc fs, which in turn triggers the
autoload of the binfmt_misc module. Without it, no module is loaded and
no binfmt is available at boot.

Building as built-in or manually loading the module and mounting the fs
works fine, it's therefore only a matter of interaction with user-space.
I could try to improve the Debian systemd configuration but I can't say
anything about the other distributions.

This patch restores a working system right after boot.

Fixes: 3ba442d5331f ("fs: move binfmt_misc sysctl to its own file")
Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Domenico Andreoli and committed by
Linus Torvalds
b42bc9a3 09a93c1d

+3 -5
+1 -5
fs/binfmt_misc.c
··· 817 817 }; 818 818 MODULE_ALIAS_FS("binfmt_misc"); 819 819 820 - static struct ctl_table_header *binfmt_misc_header; 821 - 822 820 static int __init init_misc_binfmt(void) 823 821 { 824 822 int err = register_filesystem(&bm_fs_type); 825 823 if (!err) 826 824 insert_binfmt(&misc_format); 827 - binfmt_misc_header = register_sysctl_mount_point("fs/binfmt_misc"); 828 - return 0; 825 + return err; 829 826 } 830 827 831 828 static void __exit exit_misc_binfmt(void) 832 829 { 833 - unregister_sysctl_table(binfmt_misc_header); 834 830 unregister_binfmt(&misc_format); 835 831 unregister_filesystem(&bm_fs_type); 836 832 }
+2
fs/file_table.c
··· 119 119 static int __init init_fs_stat_sysctls(void) 120 120 { 121 121 register_sysctl_init("fs", fs_stat_sysctls); 122 + if (IS_ENABLED(CONFIG_BINFMT_MISC)) 123 + register_sysctl_mount_point("fs/binfmt_misc"); 122 124 return 0; 123 125 } 124 126 fs_initcall(init_fs_stat_sysctls);