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: <2bcbefab-7c4d-dd36-01f8-9759ba4b2bdf@linaro.org>
Date:   Fri, 5 Mar 2021 06:59:50 -0600
From:   Alex Elder <elder@...aro.org>
To:     kernel test robot <lkp@...el.com>, subashab@...eaurora.org,
        stranche@...eaurora.org, davem@...emloft.net, kuba@...nel.org
Cc:     kbuild-all@...org, sharathv@...eaurora.org,
        bjorn.andersson@...aro.org, evgreen@...omium.org,
        cpratapa@...eaurora.org, elder@...nel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 6/6] net: qualcomm: rmnet: don't use C bit-fields
 in rmnet checksum header

On 3/5/21 12:22 AM, kernel test robot wrote:
> Hi Alex,
> 
> I love your patch! Perhaps something to improve:
> 
> [auto build test WARNING on net-next/master]

Well that's embarrassing.  It explains why I had to make
a change or two after testing though.

I will fix this so the bit fields are defined in host
byte order, and will fix the encoding calls to use
u32_encode_bits() instead of be32_encode_bits().

I will redo my testing (for all of the patches) and
will then submit version 2 of the series.

					-Alex

> 
> url:    https://github.com/0day-ci/linux/commits/Alex-Elder/net-qualcomm-rmnet-stop-using-C-bit-fields/20210305-064128
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git d310ec03a34e92a77302edb804f7d68ee4f01ba0
> config: riscv-randconfig-s031-20210305 (attached as .config)
> compiler: riscv64-linux-gcc (GCC) 9.3.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.3-245-gacc5c298-dirty
>         # https://github.com/0day-ci/linux/commit/dba638b67dff001926855ed81e35e52bd54880ea
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Alex-Elder/net-qualcomm-rmnet-stop-using-C-bit-fields/20210305-064128
>         git checkout dba638b67dff001926855ed81e35e52bd54880ea
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=riscv 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
> 
> 
> "sparse warnings: (new ones prefixed by >>)"
>>> drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:208:13: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] val @@     got restricted __be16 @@
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:208:13: sparse:     expected unsigned short [usertype] val
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:208:13: sparse:     got restricted __be16
>>> drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:210:21: sparse: sparse: invalid assignment: |=
>>> drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:210:21: sparse:    left side has type unsigned short
>>> drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:210:21: sparse:    right side has type restricted __be16
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:211:13: sparse: sparse: invalid assignment: |=
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:211:13: sparse:    left side has type unsigned short
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:211:13: sparse:    right side has type restricted __be16
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:247:13: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] val @@     got restricted __be16 @@
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:247:13: sparse:     expected unsigned short [usertype] val
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:247:13: sparse:     got restricted __be16
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:249:21: sparse: sparse: invalid assignment: |=
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:249:21: sparse:    left side has type unsigned short
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:249:21: sparse:    right side has type restricted __be16
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:250:13: sparse: sparse: invalid assignment: |=
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:250:13: sparse:    left side has type unsigned short
>    drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:250:13: sparse:    right side has type restricted __be16
> 
> vim +208 drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
> 
>    195	
>    196	static void
>    197	rmnet_map_ipv4_ul_csum_header(void *iphdr,
>    198				      struct rmnet_map_ul_csum_header *ul_header,
>    199				      struct sk_buff *skb)
>    200	{
>    201		struct iphdr *ip4h = iphdr;
>    202		u16 offset;
>    203		u16 val;
>    204	
>    205		offset = skb_transport_header(skb) - (unsigned char *)iphdr;
>    206		ul_header->csum_start_offset = htons(offset);
>    207	
>  > 208		val = be16_encode_bits(1, MAP_CSUM_UL_ENABLED_FMASK);
>    209		if (ip4h->protocol == IPPROTO_UDP)
>  > 210			val |= be16_encode_bits(1, MAP_CSUM_UL_UDP_FMASK);
>    211		val |= be16_encode_bits(skb->csum_offset, MAP_CSUM_UL_OFFSET_FMASK);
>    212	
>    213		ul_header->csum_info = htons(val);
>    214	
>    215		skb->ip_summed = CHECKSUM_NONE;
>    216	
>    217		rmnet_map_complement_ipv4_txporthdr_csum_field(iphdr);
>    218	}
>    219	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ