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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f585168-7296-58aa-7fdb-c2aa08f346f4@infradead.org>
Date: Tue, 27 Jun 2023 19:53:08 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Alexandra Winter <wintera@...ux.ibm.com>,
 Simon Horman <simon.horman@...igine.com>
Cc: linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>,
 Wenjia Zhang <wenjia@...ux.ibm.com>, linux-s390@...r.kernel.org,
 netdev@...r.kernel.org, Heiko Carstens <hca@...ux.ibm.com>,
 Vasily Gorbik <gor@...ux.ibm.com>, Alexander Gordeev
 <agordeev@...ux.ibm.com>, Christian Borntraeger <borntraeger@...ux.ibm.com>,
 Sven Schnelle <svens@...ux.ibm.com>, "David S . Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH] s390/net: lcs: fix build errors when FDDI is a loadable
 module

Hi,
Sorry for the delay.

On 6/22/23 05:16, Alexandra Winter wrote:
> 
> 
> On 22.06.23 09:53, Simon Horman wrote:
>> On Thu, Jun 22, 2023 at 09:15:24AM +0200, Alexandra Winter wrote:
>>>
>>>
>>> On 21.06.23 23:37, Randy Dunlap wrote:
>>>> Require FDDI to be built-in if it is used. LCS needs FDDI to be
>>>> built-in to build without errors.
>>>>
>>>> Prevents these build errors:
>>>> s390-linux-ld: drivers/s390/net/lcs.o: in function `lcs_new_device':
>>>> drivers/s390/net/lcs.c:2150: undefined reference to `fddi_type_trans'
>>>> s390-linux-ld: drivers/s390/net/lcs.c:2151: undefined reference to `alloc_fddidev'
>>>>
>>>> This FDDI requirement effectively restores the previous condition
>>>> before the blamed patch, when #ifdef CONFIG_FDDI was used, without
>>>> testing for CONFIG_FDDI_MODULE.
>>>>
>>>> Fixes: 128272336120 ("s390/net: lcs: use IS_ENABLED() for kconfig detection")
> [...]
>>
>>> 2) I wonder whether
>>>
>>>   	depends on CCW && NETDEVICES && (ETHERNET || FDDI)
>>>  +	depends on FDDI || FDDI=n
>>>
>>> would do what we want here:
>>> When FDDI is a loadable module, LCS mustn't be built-in.
>>>
>>> I will do some experiments and let you know.
>>
>> It does seem to on my side.
>> But checking would be much appreciated.
>  
> 
> Here are my experiments:
> 
> Current net-next:
> -----------------
> if !IS_ENABLED(CONFIG_ETHERNET) && !IS_ENABLED(CONFIG_FDDI)
> 
> drivers/s390/net/KConfig:
> config LCS
> 	def_tristate m
> 	depends on CCW && NETDEVICES && (ETHERNET || FDDI)
> 
> .config:
> ETHERNET  |  FDDI | LCS choices | LCS | compile
> --------------------------------------------------------
> n		m	m,n	  m	success (failed before Randy's fix)
> y		m	y,m,n	  m	success (failed before Randy's fix)
> y		m		  y	fails: undefined reference to `fddi_type_trans'
> 
> 
> Simon's proposal:
> -----------------
>         depends on CCW && NETDEVICES && (ETHERNET || FDDI)
> +       depends on FDDI=y || FDDI=n
> 
> ETHERNET  |  FDDI | LCS choices | LCS | compile
> --------------------------------------------------------
> n		m	-
> y		m	-
> y		m	-
> y		n	y,m,n	  y	success
> y		n	y,m,n	  m	success
> y		y	y,m,n	  m	success
> 
> 
> Alexandra's proposal:
> ---------------------
>         depends on CCW && NETDEVICES && (ETHERNET || FDDI)
> +       depends on FDDI || FDDI=n
> 
> ETHERNET  |  FDDI | LCS choices | LCS | compile
> --------------------------------------------------------
> n		m	m,n	  m	success
> y		m	m,n	  m	success
> y		n	y,m,n	  y	success
> y		n	y,m,n	  m	success
> y		y	y,m,n	  m	success
> 
> -----------------------------------------------------------
> 
> Seems that 
> 	A[tristate] depends on B[tristate]
> means that A cannot be 'higher' than B.
> Meaning, if B=n -> A= must be n
> 	if B=m -> A can be m or n
> 	if B=y -> A can be y or m or n

Looks correct.

> Although I did not find documentation confirming that.

I think that it's in Documentation/kbuild/kconfig-language.rst,
under "Menu dependencies", but not quite in that format. :)

> 
> @Randy, do you want give a v2 a try with that?

Sure, I'll try that.

> I guess then it is safe to delete from drivers/s390/net/lcs.c
> -#if !IS_ENABLED(CONFIG_ETHERNET) && !IS_ENABLED(CONFIG_FDDI)
> -#error Cannot compile lcs.c without some net devices switched on.
> -#endif

Yes, I was planning to do that as well.

Thanks for the time that you have spent on this.
-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ