lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190304210007.sqlkp5ylt5qy2hjf@brauner.io>
Date:   Mon, 4 Mar 2019 22:00:08 +0100
From:   Christian Brauner <christian@...uner.io>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        Zhu Yanjun <Yanjun.Zhu@...driver.com>,
        Tonghao Zhang <xiangxia.m.yue@...il.com>,
        Nicolas Dichtel <nicolas.dichtel@...nd.com>,
        David Ahern <dsahern@...il.com>,
        Xin Long <lucien.xin@...il.com>,
        Cong Wang <xiyou.wangcong@...il.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: ignore sysctl_devconf_inherit_init_net without
 SYSCTL

On Mon, Mar 04, 2019 at 09:38:03PM +0100, Arnd Bergmann wrote:
> When CONFIG_SYSCTL is turned off, we get a link failure for
> the newly introduced tuning knob.
> 
> net/ipv6/addrconf.o: In function `addrconf_init_net':
> addrconf.c:(.text+0x31dc): undefined reference to `sysctl_devconf_inherit_init_net'
> 
> Add an IS_ENABLED() check to fall back to the default behavior
> (sysctl_devconf_inherit_init_net=0) here.
> 
> Fixes: 856c395cfa63 ("net: introduce a knob to control whether to inherit devconf config")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  net/ipv4/devinet.c  | 4 +++-
>  net/ipv6/addrconf.c | 3 ++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index cd9033245b98..eb514f312e6f 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -2614,7 +2614,9 @@ static __net_init int devinet_init_net(struct net *net)
>  	tbl[0].extra2 = net;
>  #endif
>  
> -	if (sysctl_devconf_inherit_init_net != 2 && !net_eq(net, &init_net)) {
> +	if ((!IS_ENABLED(CONFIG_SYSCTL) ||
> +	     sysctl_devconf_inherit_init_net != 2) &&

I'm sure I'm just being stupid here but wouldn't this still trigger the
warning or is sysctl_devconf_inherit_init_net unconditionally defined?
The error you're reporting makes it look like it isn't.

> +	    !net_eq(net, &init_net)) {
>  		memcpy(all, init_net.ipv4.devconf_all, sizeof(ipv4_devconf));
>  		memcpy(dflt, init_net.ipv4.devconf_dflt, sizeof(ipv4_devconf_dflt));
>  	}
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index da5a21050ba9..4ae17a966ae3 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -6905,7 +6905,8 @@ static int __net_init addrconf_init_net(struct net *net)
>  	if (!dflt)
>  		goto err_alloc_dflt;
>  
> -	if (sysctl_devconf_inherit_init_net == 1 && !net_eq(net, &init_net)) {
> +	if (IS_ENABLED(CONFIG_SYSCTL) &&
> +	    sysctl_devconf_inherit_init_net == 1 && !net_eq(net, &init_net)) {
>  		memcpy(all, init_net.ipv6.devconf_all, sizeof(ipv6_devconf));
>  		memcpy(dflt, init_net.ipv6.devconf_dflt, sizeof(ipv6_devconf_dflt));
>  	}
> -- 
> 2.20.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ