Re: [PATCH v1] binfmt_misc: fix crash when load/unload module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 24, 2022 at 2:40 AM Christian Brauner <brauner@xxxxxxxxxx> wrote:
> The fix itself is obviously needed.
>
> However, afaict the previous patch introduced another bug and this patch
> right here doesn't fix it either.
>
> Namely, if you set CONFIG_SYSCTL=n and CONFIG_BINFMT_MISC={y,m}, then
> register_sysctl_mount_point() will return NULL causing modprobe
> binfmt_misc to fail. However, before 3ba442d5331f ("fs: move binfmt_misc
> sysctl to its own file") loading binfmt_misc would've succeeded even if
> fs/binfmt_misc wasn't created in kernel/sysctl.c. Afaict, that goes for
> both CONFIG_SYSCTL={y,n} since even in the CONFIG_SYSCTL=y case the
> kernel would've moved on if creating the sysctl header would've failed.
> And that makes sense since binfmt_misc is mountable wherever, not just
> at fs/binfmt_misc.
>
> All that indicates that the correct fix here would be to simply:
>
> binfmt_misc_header = register_sysctl_mount_point("fs/binfmt_misc");
>
> without checking for an error. That should fully restore the old
> behavior.
>

Thanks! That makes sense.
I modified the patch according to your comment, added another fix for
the return type issue and sent a v2.
Thanks again.
- Tong



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux