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>] [day] [month] [year] [list]
Message-ID: <202103020116.9BsY8hVS-lkp@intel.com>
Date:   Tue, 2 Mar 2021 01:10:21 +0800
From:   kernel test robot <lkp@...el.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: drivers/staging/vt6656/rxtx.c:385:34: warning: taking address of
 packed member 'tx' of class or structure 'vnt_tx_head::(anonymous)' may
 result in an unaligned pointer value

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8
commit: 2faf12c57efe1f905007e866d753af7851205aec staging: vt665x: fix alignment constraints
date:   3 weeks ago
config: mips-randconfig-r011-20210301 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project b077d82b00d81934c7c27ac89dd8b0e7f448bded)
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 mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2faf12c57efe1f905007e866d753af7851205aec
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2faf12c57efe1f905007e866d753af7851205aec
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

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

All warnings (new ones prefixed by >>):

   In file included from drivers/staging/vt6656/rxtx.c:23:
   In file included from include/linux/etherdevice.h:20:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:14:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/mips/include/asm/pgtable.h:202:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
   arch/mips/include/asm/cmpxchg.h:220:2: note: expanded from macro 'cmpxchg64'
           cmpxchg((ptr), (o), (n));                                       \
           ^
   arch/mips/include/asm/cmpxchg.h:204:7: note: expanded from macro 'cmpxchg'
           if (!__SYNC_loongson3_war)                                      \
                ^
   arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
   # define __SYNC_loongson3_war   (1 << 31)
                                      ^
   In file included from drivers/staging/vt6656/rxtx.c:23:
   In file included from include/linux/etherdevice.h:20:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:28:
   In file included from include/net/checksum.h:22:
   arch/mips/include/asm/checksum.h:161:9: error: unsupported inline asm: input with type 'unsigned long' matching output with type '__wsum' (aka 'unsigned int')
           : "0" ((__force unsigned long)daddr),
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/staging/vt6656/rxtx.c:23:
   In file included from include/linux/etherdevice.h:21:
   include/linux/netdevice.h:560:11: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
           } while (cmpxchg(&n->state, val, new) != val);
                    ^
   arch/mips/include/asm/cmpxchg.h:194:7: note: expanded from macro 'cmpxchg'
           if (!__SYNC_loongson3_war)                                      \
                ^
   arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
   # define __SYNC_loongson3_war   (1 << 31)
                                      ^
   In file included from drivers/staging/vt6656/rxtx.c:23:
   In file included from include/linux/etherdevice.h:21:
   include/linux/netdevice.h:560:11: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
   arch/mips/include/asm/cmpxchg.h:204:7: note: expanded from macro 'cmpxchg'
           if (!__SYNC_loongson3_war)                                      \
                ^
   arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
   # define __SYNC_loongson3_war   (1 << 31)
                                      ^
   In file included from drivers/staging/vt6656/rxtx.c:24:
   In file included from drivers/staging/vt6656/device.h:32:
   In file included from include/net/mac80211.h:22:
   In file included from include/net/codel.h:48:
   In file included from include/net/inet_ecn.h:9:
   In file included from include/net/inet_sock.h:22:
   In file included from include/net/sock.h:61:
   include/linux/poll.h:142:27: warning: division by zero is undefined [-Wdivision-by-zero]
                   M(RDNORM) | M(RDBAND) | M(WRNORM) | M(WRBAND) |
                                           ^~~~~~~~~
   include/linux/poll.h:140:32: note: expanded from macro 'M'
   #define M(X) (__force __poll_t)__MAP(val, POLL##X, (__force __u16)EPOLL##X)
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/poll.h:126:51: note: expanded from macro '__MAP'
           (from < to ? (v & from) * (to/from) : (v & from) / (from/to))
                                                            ^ ~~~~~~~~~
   include/linux/poll.h:142:39: warning: division by zero is undefined [-Wdivision-by-zero]
                   M(RDNORM) | M(RDBAND) | M(WRNORM) | M(WRBAND) |
                                                       ^~~~~~~~~
   include/linux/poll.h:140:32: note: expanded from macro 'M'
   #define M(X) (__force __poll_t)__MAP(val, POLL##X, (__force __u16)EPOLL##X)
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/poll.h:126:51: note: expanded from macro '__MAP'
           (from < to ? (v & from) * (to/from) : (v & from) / (from/to))
                                                            ^ ~~~~~~~~~
   In file included from drivers/staging/vt6656/rxtx.c:24:
   In file included from drivers/staging/vt6656/device.h:32:
   In file included from include/net/mac80211.h:22:
   In file included from include/net/codel.h:48:
   In file included from include/net/inet_ecn.h:9:
   In file included from include/net/inet_sock.h:22:
   include/net/sock.h:1994:12: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
           old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst);
                     ^
   arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
           if (!__SYNC_loongson3_war)                                      \
                ^
   arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
   # define __SYNC_loongson3_war   (1 << 31)
                                      ^
   In file included from drivers/staging/vt6656/rxtx.c:24:
   In file included from drivers/staging/vt6656/device.h:32:
   In file included from include/net/mac80211.h:22:
   In file included from include/net/codel.h:48:
   In file included from include/net/inet_ecn.h:9:
   In file included from include/net/inet_sock.h:22:
   include/net/sock.h:2244:8: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
           err = xchg(&sk->sk_err, 0);
                 ^
   arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
           if (!__SYNC_loongson3_war)                                      \
                ^
   arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
   # define __SYNC_loongson3_war   (1 << 31)
                                      ^
>> drivers/staging/vt6656/rxtx.c:385:34: warning: taking address of packed member 'tx' of class or structure 'vnt_tx_head::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member]
           union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head;
                                           ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/vt6656/rxtx.c:396:12: warning: taking address of packed member 'head' of class or structure 'vnt_tx_mic_hdr' may result in an unaligned pointer value [-Waddress-of-packed-member]
                           head = &tx_head->tx_rts.tx.mic.head;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/vt6656/rxtx.c:408:34: warning: taking address of packed member 'tx' of class or structure 'vnt_tx_head::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member]
           union vnt_tx_data_head *head = &tx_head->tx_cts.tx.head;
                                           ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/vt6656/rxtx.c:417:12: warning: taking address of packed member 'head' of class or structure 'vnt_tx_mic_hdr' may result in an unaligned pointer value [-Waddress-of-packed-member]
                           head = &tx_head->tx_cts.tx.mic.head;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/vt6656/rxtx.c:429:34: warning: taking address of packed member 'tx' of class or structure 'vnt_tx_head::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member]
           union vnt_tx_data_head *head = &tx_head->tx_ab.tx.head;
                                           ^~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/vt6656/rxtx.c:435:12: warning: taking address of packed member 'head' of class or structure 'vnt_tx_mic_hdr' may result in an unaligned pointer value [-Waddress-of-packed-member]
                           head = &tx_head->tx_ab.tx.mic.head;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
   24 warnings and 1 error generated.


vim +385 drivers/staging/vt6656/rxtx.c

dc6490b0c5058c Malcolm Priestley 2020-05-21  378  
dc6490b0c5058c Malcolm Priestley 2020-05-21  379  static void vnt_rxtx_rts(struct vnt_usb_send_context *tx_context)
dc6490b0c5058c Malcolm Priestley 2020-05-21  380  {
dc6490b0c5058c Malcolm Priestley 2020-05-21  381  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
dc6490b0c5058c Malcolm Priestley 2020-05-21  382  	struct vnt_tx_buffer *tx_buffer = tx_context->tx_buffer;
dc6490b0c5058c Malcolm Priestley 2020-05-21  383  	union vnt_tx_head *tx_head = &tx_buffer->tx_head;
dc6490b0c5058c Malcolm Priestley 2020-05-21  384  	struct vnt_rrv_time_rts *buf = &tx_head->tx_rts.rts;
dc6490b0c5058c Malcolm Priestley 2020-05-21 @385  	union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head;
dc6490b0c5058c Malcolm Priestley 2020-05-21  386  
dc6490b0c5058c Malcolm Priestley 2020-05-21  387  	buf->rts_rrv_time_aa = vnt_get_rts_duration(tx_context);
dc6490b0c5058c Malcolm Priestley 2020-05-21  388  	buf->rts_rrv_time_ba = buf->rts_rrv_time_aa;
dc6490b0c5058c Malcolm Priestley 2020-05-21  389  	buf->rts_rrv_time_bb = buf->rts_rrv_time_aa;
dc6490b0c5058c Malcolm Priestley 2020-05-21  390  
dc6490b0c5058c Malcolm Priestley 2020-05-21  391  	buf->rrv_time_a = vnt_rxtx_rsvtime_le16(tx_context);
dc6490b0c5058c Malcolm Priestley 2020-05-21  392  	buf->rrv_time_b = buf->rrv_time_a;
dc6490b0c5058c Malcolm Priestley 2020-05-21  393  
dc6490b0c5058c Malcolm Priestley 2020-05-21  394  	if (info->control.hw_key) {
dc6490b0c5058c Malcolm Priestley 2020-05-21  395  		if (vnt_fill_txkey(tx_buffer, tx_context->skb))
dc6490b0c5058c Malcolm Priestley 2020-05-21 @396  			head = &tx_head->tx_rts.tx.mic.head;
dc6490b0c5058c Malcolm Priestley 2020-05-21  397  	}
dc6490b0c5058c Malcolm Priestley 2020-05-21  398  
dc6490b0c5058c Malcolm Priestley 2020-05-21  399  	vnt_rxtx_rts_g_head(tx_context, &head->rts_g);
dc6490b0c5058c Malcolm Priestley 2020-05-21  400  }
dc6490b0c5058c Malcolm Priestley 2020-05-21  401  

:::::: The code at line 385 was first introduced by commit
:::::: dc6490b0c5058c44868b3921cfd3b2a223ee038c staging: vt6656: Move calling point of vnt_fill_txkey.

:::::: TO: Malcolm Priestley <tvboxspy@...il.com>
:::::: CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

---
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" (31221 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ