Re: [linus:master] [sysctl] 8d75c338f0: BUG:KASAN:slab-use-after-free_in_touch_wq_lockdep_map
From: Oleg Nesterov
Date: Tue Oct 20 2026 - 05:27:20 EST
On 10/20, Joel Granados wrote:
>
> You can also do this (also untested and not compiled):
>
> diff --git i/net/rds/ib_sysctl.c w/net/rds/ib_sysctl.c
> index 2af678e71e3c6..bc97a3eecad69 100644
> --- i/net/rds/ib_sysctl.c
> +++ w/net/rds/ib_sysctl.c
> @@ -114,7 +114,7 @@ void rds_ib_sysctl_exit(void)
> int rds_ib_sysctl_init(void)
> {
> rds_ib_sysctl_hdr = register_net_sysctl(&init_net, "net/rds/ib", rds_ib_sysctl_table);
> - if (!rds_ib_sysctl_hdr)
> + if (!rds_ib_sysctl_hdr && IS_ENABLED(CONFIG_SYSCTL))
> return -ENOMEM;
> return 0;
> }
> diff --git i/net/rds/sysctl.c w/net/rds/sysctl.c
> index 025f518a43495..41c65b98c94bd 100644
> --- i/net/rds/sysctl.c
> +++ w/net/rds/sysctl.c
> @@ -93,7 +93,8 @@ static struct ctl_table rds_sysctl_rds_table[] = {
>
> void rds_sysctl_exit(void)
> {
> - unregister_net_sysctl_table(rds_sysctl_reg_table);
> + if (rds_sysctl_reg_table)
> + unregister_net_sysctl_table(rds_sysctl_reg_table);
Yes, this is what Allison suggested too. But he also pointed out that
the changes in _exit() are not strictly needed, unregister_net_sysctl_table
is nop if !CONFIG_SYSCTL. Plus we also need to change rds_tcp_init_net()
the same way, see register_net_sysctl_sz().
So, let me repeat, I agree in advance with anything you and Allison prefer.
Oleg.