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] [day] [month] [year] [list]
Date:   Wed, 04 Apr 2018 11:48:04 -0400 (EDT)
From:   David Miller <davem@...emloft.net>
To:     arnd@...db.de
Cc:     srinivas.kandagatla@...aro.org, mike.looijmans@...ic.nl,
        f.fainelli@...il.com, andrew@...n.ch, netdev@...r.kernel.org,
        gregkh@...uxfoundation.org, o.rempel@...gutronix.de,
        martin.blumenstingl@...glemail.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [net] nvmem: disallow modular CONFIG_NVMEM

From: Arnd Bergmann <arnd@...db.de>
Date: Wed,  4 Apr 2018 12:38:40 +0200

> The new of_get_nvmem_mac_address() helper function causes a link error
> with CONFIG_NVMEM=m:
> 
> drivers/of/of_net.o: In function `of_get_nvmem_mac_address':
> of_net.c:(.text+0x168): undefined reference to `of_nvmem_cell_get'
> of_net.c:(.text+0x19c): undefined reference to `nvmem_cell_read'
> of_net.c:(.text+0x1a8): undefined reference to `nvmem_cell_put'
> 
> I could not come up with a good solution for this, as the code is always
> built-in. Using an #if IS_REACHABLE() check around it would solve the
> link time issue but then stop it from working in that configuration.
> Making of_nvmem_cell_get() an inline function could also solve that, but
> seems a bit ugly since it's somewhat larger than most inline functions,
> and it would just bring that problem into the callers.  Splitting the
> function into a separate file might be an alternative.
> 
> This uses the big hammer by making CONFIG_NVMEM itself a 'bool' symbol,
> which avoids the problem entirely but makes the vmlinux larger for anyone
> that might use NVMEM support but doesn't need it built-in otherwise.
> 
> Fixes: 9217e566bdee ("of_net: Implement of_get_nvmem_mac_address helper")
> Cc: Mike Looijmans <mike.looijmans@...ic.nl>
> Cc: Florian Fainelli <f.fainelli@...il.com>
> Cc: Andrew Lunn <andrew@...n.ch>
> Cc: David S. Miller <davem@...emloft.net>
> Cc: netdev@...r.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> The problem arrived through the networking tree, but it's now in
> mainline, so the fix could go through either tree

Ok, applied, thanks Arnd.

Powered by blists - more mailing lists