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: <202006032237.iAlp1CJd%lkp@intel.com>
Date:   Wed, 3 Jun 2020 22:11:52 +0800
From:   kernel test robot <lkp@...el.com>
To:     Vinay Kumar Yadav <vinay.yadav@...lsio.com>,
        netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        edumazet@...gle.com, borisp@...lanox.com, secdev@...lsio.com,
        Vinay Kumar Yadav <vinay.yadav@...lsio.com>
Subject: Re: [PATCH net-next] crypto/chtls: Fix compile error when
 CONFIG_IPV6 is disabled

Hi Vinay,

I love your patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Vinay-Kumar-Yadav/crypto-chtls-Fix-compile-error-when-CONFIG_IPV6-is-disabled/20200603-184315
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 065fcfd49763ec71ae345bb5c5a74f961031e70e
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 16437992cac249f6fe1efd392d20e3469b47e39e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/crypto/chelsio/chtls/chtls_cm.c:105:3: error: expected expression
struct net_device *temp;
^
>> drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'; did you mean 'bcmp'?
for_each_netdev_rcu(&init_net, temp) {
^~~~
bcmp
include/linux/netdevice.h:2669:27: note: expanded from macro 'for_each_netdev_rcu'
list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
^
include/linux/rculist.h:382:50: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member);                                                             ^
include/linux/rculist.h:306:31: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:350:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler.h:338:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler.h:330:9: note: expanded from macro '__compiletime_assert'
if (!(condition))                                                                ^
include/linux/string.h:159:12: note: 'bcmp' declared here
extern int bcmp(const void *,const void *,__kernel_size_t);
^
>> drivers/crypto/chelsio/chtls/chtls_cm.c:112:3: error: member reference base type 'typeof (*bcmp)' (aka 'int (const void *, const void *, unsigned long)') is not a structure or union
for_each_netdev_rcu(&init_net, temp) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/netdevice.h:2669:3: note: expanded from macro 'for_each_netdev_rcu'
list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:382:13: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member);                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:306:2: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:350:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:338:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:330:9: note: expanded from macro '__compiletime_assert'
if (!(condition))                                                                ^~~~~~~~~
>> drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'; did you mean 'bcmp'?
for_each_netdev_rcu(&init_net, temp) {
^~~~
bcmp
include/linux/netdevice.h:2669:27: note: expanded from macro 'for_each_netdev_rcu'
list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
^
include/linux/rculist.h:382:50: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member);                                                             ^
include/linux/rculist.h:306:31: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
include/linux/kernel.h:997:4: note: expanded from macro 'container_of'
((type *)(__mptr - offsetof(type, member))); })
^
include/linux/string.h:159:12: note: 'bcmp' declared here
extern int bcmp(const void *,const void *,__kernel_size_t);
^
>> drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'; did you mean 'bcmp'?
for_each_netdev_rcu(&init_net, temp) {
^~~~
bcmp
include/linux/netdevice.h:2669:27: note: expanded from macro 'for_each_netdev_rcu'
list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
^
include/linux/rculist.h:382:50: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member);                                                             ^
include/linux/rculist.h:306:31: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
include/linux/kernel.h:997:30: note: expanded from macro 'container_of'
((type *)(__mptr - offsetof(type, member))); })
^
include/linux/stddef.h:17:52: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER)  __compiler_offsetof(TYPE, MEMBER)
^
include/linux/compiler_types.h:129:54: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b)       __builtin_offsetof(a, b)
^
include/linux/string.h:159:12: note: 'bcmp' declared here
extern int bcmp(const void *,const void *,__kernel_size_t);
^
>> drivers/crypto/chelsio/chtls/chtls_cm.c:112:3: error: offsetof requires struct, union, or class type, 'typeof (*bcmp)' (aka 'int (const void *, const void *, unsigned long)') invalid
for_each_netdev_rcu(&init_net, temp) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/netdevice.h:2669:3: note: expanded from macro 'for_each_netdev_rcu'
list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:382:13: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member);                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:306:2: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:997:21: note: expanded from macro 'container_of'
((type *)(__mptr - offsetof(type, member))); })
^~~~~~~~~~~~~~~~~~~~~~
include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER)  __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:129:35: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b)       __builtin_offsetof(a, b)
^                  ~
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
for_each_netdev_rcu(&init_net, temp) {
^
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
>> drivers/crypto/chelsio/chtls/chtls_cm.c:112:3: error: operand of type 'void' where arithmetic or pointer type is required
for_each_netdev_rcu(&init_net, temp) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/netdevice.h:2669:3: note: expanded from macro 'for_each_netdev_rcu'
list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:384:9: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:306:2: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:993:25: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr);                                                                     ^~~~~
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
for_each_netdev_rcu(&init_net, temp) {
^
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
drivers/crypto/chelsio/chtls/chtls_cm.c:112:34: error: use of undeclared identifier 'temp'
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

vim +105 drivers/crypto/chelsio/chtls/chtls_cm.c

    91	
    92	static struct net_device *chtls_find_netdev(struct chtls_dev *cdev,
    93						    struct sock *sk)
    94	{
    95		struct net_device *ndev = cdev->ports[0];
    96	
    97		switch (sk->sk_family) {
    98		case PF_INET:
    99			if (likely(!inet_sk(sk)->inet_rcv_saddr))
   100				return ndev;
   101			ndev = ip_dev_find(&init_net, inet_sk(sk)->inet_rcv_saddr);
   102			break;
   103	#if IS_ENABLED(CONFIG_IPV6)
   104		case PF_INET6:
 > 105			struct net_device *temp;
   106			int addr_type;
   107	
   108			addr_type = ipv6_addr_type(&sk->sk_v6_rcv_saddr);
   109			if (likely(addr_type == IPV6_ADDR_ANY))
   110				return ndev;
   111	
 > 112			for_each_netdev_rcu(&init_net, temp) {
   113				if (ipv6_chk_addr(&init_net, (struct in6_addr *)
   114						  &sk->sk_v6_rcv_saddr, temp, 1)) {
   115					ndev = temp;
   116					break;
   117				}
   118			}
   119		break;
   120	#endif
   121		default:
   122			return NULL;
   123		}
   124	
   125		if (!ndev)
   126			return NULL;
   127	
   128		if (is_vlan_dev(ndev))
   129			return vlan_dev_real_dev(ndev);
   130		return ndev;
   131	}
   132	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (73579 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ