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:   Tue, 17 Jul 2018 17:25:00 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Stefano Brivio <sbrivio@...hat.com>
Cc:     kbuild-all@...org, "David S. Miller" <davem@...emloft.net>,
        Boris Pismenny <borisp@...lanox.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: Move skb decrypted field, avoid explicity
 copy

Hi Stefano,

Thank you for the patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Stefano-Brivio/net-Move-skb-decrypted-field-avoid-explicity-copy/20180717-152125
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10:0,
                    from include/linux/list.h:9,
                    from include/linux/module.h:9,
                    from net//core/skbuff.c:41:
   net//core/skbuff.c: In function '__copy_skb_header':
   net//core/skbuff.c:787:31: error: attempt to take address of bit-field structure member 'decrypted'
     BUILD_BUG_ON(offsetof(struct sk_buff, field) <  \
                                  ^
   include/linux/compiler.h:316:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:339:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:45:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:69:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^~~~~~~~~~~~~~~~
>> net//core/skbuff.c:787:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(offsetof(struct sk_buff, field) <  \
     ^~~~~~~~~~~~
   include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
    #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
                                   ^~~~~~~~~~~~~~~~~~~
>> net//core/skbuff.c:787:15: note: in expansion of macro 'offsetof'
     BUILD_BUG_ON(offsetof(struct sk_buff, field) <  \
                  ^~~~~~~~
>> net//core/skbuff.c:837:2: note: in expansion of macro 'CHECK_SKB_FIELD'
     CHECK_SKB_FIELD(decrypted);
     ^~~~~~~~~~~~~~~
   net//core/skbuff.c:789:31: error: attempt to take address of bit-field structure member 'decrypted'
     BUILD_BUG_ON(offsetof(struct sk_buff, field) >  \
                                  ^
   include/linux/compiler.h:316:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:339:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:45:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:69:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^~~~~~~~~~~~~~~~
   net//core/skbuff.c:789:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(offsetof(struct sk_buff, field) >  \
     ^~~~~~~~~~~~
   include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
    #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
                                   ^~~~~~~~~~~~~~~~~~~
   net//core/skbuff.c:789:15: note: in expansion of macro 'offsetof'
     BUILD_BUG_ON(offsetof(struct sk_buff, field) >  \
                  ^~~~~~~~
>> net//core/skbuff.c:837:2: note: in expansion of macro 'CHECK_SKB_FIELD'
     CHECK_SKB_FIELD(decrypted);
     ^~~~~~~~~~~~~~~

vim +/CHECK_SKB_FIELD +837 net//core/skbuff.c

   784	
   785	/* Make sure a field is enclosed inside headers_start/headers_end section */
   786	#define CHECK_SKB_FIELD(field) \
 > 787		BUILD_BUG_ON(offsetof(struct sk_buff, field) <		\
   788			     offsetof(struct sk_buff, headers_start));	\
   789		BUILD_BUG_ON(offsetof(struct sk_buff, field) >		\
   790			     offsetof(struct sk_buff, headers_end));	\
   791	
   792	static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
   793	{
   794		new->tstamp		= old->tstamp;
   795		/* We do not copy old->sk */
   796		new->dev		= old->dev;
   797		memcpy(new->cb, old->cb, sizeof(old->cb));
   798		skb_dst_copy(new, old);
   799	#ifdef CONFIG_XFRM
   800		new->sp			= secpath_get(old->sp);
   801	#endif
   802		__nf_copy(new, old, false);
   803	
   804		/* Note : this field could be in headers_start/headers_end section
   805		 * It is not yet because we do not want to have a 16 bit hole
   806		 */
   807		new->queue_mapping = old->queue_mapping;
   808	
   809		memcpy(&new->headers_start, &old->headers_start,
   810		       offsetof(struct sk_buff, headers_end) -
   811		       offsetof(struct sk_buff, headers_start));
   812		CHECK_SKB_FIELD(protocol);
   813		CHECK_SKB_FIELD(csum);
   814		CHECK_SKB_FIELD(hash);
   815		CHECK_SKB_FIELD(priority);
   816		CHECK_SKB_FIELD(skb_iif);
   817		CHECK_SKB_FIELD(vlan_proto);
   818		CHECK_SKB_FIELD(vlan_tci);
   819		CHECK_SKB_FIELD(transport_header);
   820		CHECK_SKB_FIELD(network_header);
   821		CHECK_SKB_FIELD(mac_header);
   822		CHECK_SKB_FIELD(inner_protocol);
   823		CHECK_SKB_FIELD(inner_transport_header);
   824		CHECK_SKB_FIELD(inner_network_header);
   825		CHECK_SKB_FIELD(inner_mac_header);
   826		CHECK_SKB_FIELD(mark);
   827	#ifdef CONFIG_NETWORK_SECMARK
   828		CHECK_SKB_FIELD(secmark);
   829	#endif
   830	#ifdef CONFIG_NET_RX_BUSY_POLL
   831		CHECK_SKB_FIELD(napi_id);
   832	#endif
   833	#ifdef CONFIG_XPS
   834		CHECK_SKB_FIELD(sender_cpu);
   835	#endif
   836	#ifdef CONFIG_TLS_DEVICE
 > 837		CHECK_SKB_FIELD(decrypted);
   838	#endif
   839	#ifdef CONFIG_NET_SCHED
   840		CHECK_SKB_FIELD(tc_index);
   841	#endif
   842	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ