Search Linux Wireless

Re: [PATCH] wifi: use struct_group to copy addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johannes,

I love your patch! Yet something to improve:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v6.0-rc2 next-20220826]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Johannes-Berg/wifi-use-struct_group-to-copy-addresses/20220827-042146
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
config: i386-randconfig-a005 (https://download.01.org/0day-ci/archive/20220827/202208270736.nc6uwnQv-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/b170af98c24ca49976213745cd2ded205febf09d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Johannes-Berg/wifi-use-struct_group-to-copy-addresses/20220827-042146
        git checkout b170af98c24ca49976213745cd2ded205febf09d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/wireless/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   In file included from include/linux/string.h:253,
                    from arch/x86/include/asm/page_32.h:22,
                    from arch/x86/include/asm/page.h:14,
                    from arch/x86/include/asm/processor.h:19,
                    from arch/x86/include/asm/timex.h:5,
                    from include/linux/timex.h:67,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from net/wireless/lib80211_crypt_ccmp.c:11:
   net/wireless/lib80211_crypt_ccmp.c: In function 'ccmp_init_iv_and_aad':
>> net/wireless/lib80211_crypt_ccmp.c:139:28: error: incompatible type for argument 1 of '__builtin_object_size'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |                         ~~~^~~~~~~
         |                            |
         |                            struct <anonymous>
   include/linux/fortify-string.h:376:52: note: in definition of macro '__fortify_memcpy_chk'
     376 |         fortify_memcpy_chk(__fortify_size, p_size, q_size,              \
         |                                                    ^~~~~~
   net/wireless/lib80211_crypt_ccmp.c:139:9: note: in expansion of macro 'memcpy'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |         ^~~~~~
   net/wireless/lib80211_crypt_ccmp.c:139:28: note: expected 'const void *' but argument is of type 'struct <anonymous>'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |                         ~~~^~~~~~~
   include/linux/fortify-string.h:376:52: note: in definition of macro '__fortify_memcpy_chk'
     376 |         fortify_memcpy_chk(__fortify_size, p_size, q_size,              \
         |                                                    ^~~~~~
   net/wireless/lib80211_crypt_ccmp.c:139:9: note: in expansion of macro 'memcpy'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |         ^~~~~~
>> net/wireless/lib80211_crypt_ccmp.c:139:28: error: incompatible type for argument 1 of '__builtin_object_size'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |                         ~~~^~~~~~~
         |                            |
         |                            struct <anonymous>
   include/linux/fortify-string.h:377:42: note: in definition of macro '__fortify_memcpy_chk'
     377 |                            p_size_field, q_size_field, #op);            \
         |                                          ^~~~~~~~~~~~
   net/wireless/lib80211_crypt_ccmp.c:139:9: note: in expansion of macro 'memcpy'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |         ^~~~~~
   net/wireless/lib80211_crypt_ccmp.c:139:28: note: expected 'const void *' but argument is of type 'struct <anonymous>'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |                         ~~~^~~~~~~
   include/linux/fortify-string.h:377:42: note: in definition of macro '__fortify_memcpy_chk'
     377 |                            p_size_field, q_size_field, #op);            \
         |                                          ^~~~~~~~~~~~
   net/wireless/lib80211_crypt_ccmp.c:139:9: note: in expansion of macro 'memcpy'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |         ^~~~~~
>> net/wireless/lib80211_crypt_ccmp.c:139:28: error: incompatible type for argument 2 of '__builtin_memcpy'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |                         ~~~^~~~~~~
         |                            |
         |                            struct <anonymous>
   include/linux/fortify-string.h:378:30: note: in definition of macro '__fortify_memcpy_chk'
     378 |         __underlying_##op(p, q, __fortify_size);                        \
         |                              ^
   net/wireless/lib80211_crypt_ccmp.c:139:9: note: in expansion of macro 'memcpy'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |         ^~~~~~
   net/wireless/lib80211_crypt_ccmp.c:139:28: note: expected 'const void *' but argument is of type 'struct <anonymous>'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |                         ~~~^~~~~~~
   include/linux/fortify-string.h:378:30: note: in definition of macro '__fortify_memcpy_chk'
     378 |         __underlying_##op(p, q, __fortify_size);                        \
         |                              ^
   net/wireless/lib80211_crypt_ccmp.c:139:9: note: in expansion of macro 'memcpy'
     139 |         memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
         |         ^~~~~~


vim +/__builtin_object_size +139 net/wireless/lib80211_crypt_ccmp.c

    93	
    94	static int ccmp_init_iv_and_aad(const struct ieee80211_hdr *hdr,
    95					const u8 *pn, u8 *iv, u8 *aad)
    96	{
    97		u8 *pos, qc = 0;
    98		size_t aad_len;
    99		int a4_included, qc_included;
   100	
   101		a4_included = ieee80211_has_a4(hdr->frame_control);
   102		qc_included = ieee80211_is_data_qos(hdr->frame_control);
   103	
   104		aad_len = 22;
   105		if (a4_included)
   106			aad_len += 6;
   107		if (qc_included) {
   108			pos = (u8 *) & hdr->addr4;
   109			if (a4_included)
   110				pos += 6;
   111			qc = *pos & 0x0f;
   112			aad_len += 2;
   113		}
   114	
   115		/* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC
   116		 * mode authentication are not allowed to collide, yet both are derived
   117		 * from the same vector. We only set L := 1 here to indicate that the
   118		 * data size can be represented in (L+1) bytes. The CCM layer will take
   119		 * care of storing the data length in the top (L+1) bytes and setting
   120		 * and clearing the other bits as is required to derive the two IVs.
   121		 */
   122		iv[0] = 0x1;
   123	
   124		/* Nonce: QC | A2 | PN */
   125		iv[1] = qc;
   126		memcpy(iv + 2, hdr->addr2, ETH_ALEN);
   127		memcpy(iv + 8, pn, CCMP_PN_LEN);
   128	
   129		/* AAD:
   130		 * FC with bits 4..6 and 11..13 masked to zero; 14 is always one
   131		 * A1 | A2 | A3
   132		 * SC with bits 4..15 (seq#) masked to zero
   133		 * A4 (if present)
   134		 * QC (if present)
   135		 */
   136		pos = (u8 *) hdr;
   137		aad[0] = pos[0] & 0x8f;
   138		aad[1] = pos[1] & 0xc7;
 > 139		memcpy(aad + 2, hdr->addrs, 3 * ETH_ALEN);
   140		pos = (u8 *) & hdr->seq_ctrl;
   141		aad[20] = pos[0] & 0x0f;
   142		aad[21] = 0;		/* all bits masked */
   143		memset(aad + 22, 0, 8);
   144		if (a4_included)
   145			memcpy(aad + 22, hdr->addr4, ETH_ALEN);
   146		if (qc_included) {
   147			aad[a4_included ? 28 : 22] = qc;
   148			/* rest of QC masked */
   149		}
   150		return aad_len;
   151	}
   152	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux