[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211082322.B7ILgv9S-lkp@intel.com>
Date: Wed, 9 Nov 2022 00:06:32 +0800
From: kernel test robot <lkp@...el.com>
To: Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc: oe-kbuild-all@...ts.linux.dev, Jay Vosburgh <j.vosburgh@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jonathan Toppins <jtoppins@...hat.com>,
Paolo Abeni <pabeni@...hat.com>,
David Ahern <dsahern@...il.com>,
Hangbin Liu <liuhangbin@...il.com>, Liang Li <liali@...hat.com>
Subject: Re: [PATCHv2 net] bonding: fix ICMPv6 header handling when receiving
IPv6 messages
Hi Hangbin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net/master]
url: https://github.com/intel-lab-lkp/linux/commits/Hangbin-Liu/bonding-fix-ICMPv6-header-handling-when-receiving-IPv6-messages/20221108-160309
patch link: https://lore.kernel.org/r/20221108070035.177036-1-liuhangbin%40gmail.com
patch subject: [PATCHv2 net] bonding: fix ICMPv6 header handling when receiving IPv6 messages
config: x86_64-rhel-8.3-kselftests
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/5e0e0829758bb233fee4eaaf620edce9dcfc53ac
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Hangbin-Liu/bonding-fix-ICMPv6-header-handling-when-receiving-IPv6-messages/20221108-160309
git checkout 5e0e0829758bb233fee4eaaf620edce9dcfc53ac
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
drivers/net/bonding/bond_main.c: In function 'bond_na_rcv':
>> drivers/net/bonding/bond_main.c:3242:77: warning: passing argument 4 of 'skb_header_pointer' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
3242 | hdr = skb_header_pointer(skb, sizeof(struct ipv6hdr), sizeof(_hdr), &_hdr);
| ^~~~~
In file included from include/linux/filter.h:12,
from drivers/net/bonding/bond_main.c:38:
include/linux/skbuff.h:3998:74: note: expected 'void *' but argument is of type 'const struct icmp6hdr *'
3998 | skb_header_pointer(const struct sk_buff *skb, int offset, int len, void *buffer)
| ~~~~~~^~~~~~
In file included from include/linux/string.h:253,
from include/linux/bitmap.h:11,
from include/linux/cpumask.h:12,
from arch/x86/include/asm/cpumask.h:5,
from arch/x86/include/asm/msr.h:11,
from arch/x86/include/asm/processor.h:22,
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 drivers/net/bonding/bond_main.c:35:
In function 'fortify_memcpy_chk',
inlined from 'iph_to_flow_copy_v4addrs' at include/net/ip.h:566:2,
inlined from 'bond_flow_ip' at drivers/net/bonding/bond_main.c:3983:3:
include/linux/fortify-string.h:413:25: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
413 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'fortify_memcpy_chk',
inlined from 'iph_to_flow_copy_v6addrs' at include/net/ipv6.h:900:2,
inlined from 'bond_flow_ip' at drivers/net/bonding/bond_main.c:3993:3:
include/linux/fortify-string.h:413:25: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
413 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +3242 drivers/net/bonding/bond_main.c
3229
3230 static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond,
3231 struct slave *slave)
3232 {
3233 struct slave *curr_active_slave, *curr_arp_slave;
3234 const struct icmp6hdr *hdr, _hdr;
3235 struct in6_addr *saddr, *daddr;
3236
3237 if (skb->pkt_type == PACKET_OTHERHOST ||
3238 skb->pkt_type == PACKET_LOOPBACK ||
3239 ipv6_hdr(skb)->nexthdr != NEXTHDR_ICMP)
3240 goto out;
3241
> 3242 hdr = skb_header_pointer(skb, sizeof(struct ipv6hdr), sizeof(_hdr), &_hdr);
3243 if (!hdr || hdr->icmp6_type != NDISC_NEIGHBOUR_ADVERTISEMENT)
3244 goto out;
3245
3246 saddr = &ipv6_hdr(skb)->saddr;
3247 daddr = &ipv6_hdr(skb)->daddr;
3248
3249 slave_dbg(bond->dev, slave->dev, "%s: %s/%d av %d sv %d sip %pI6c tip %pI6c\n",
3250 __func__, slave->dev->name, bond_slave_state(slave),
3251 bond->params.arp_validate, slave_do_arp_validate(bond, slave),
3252 saddr, daddr);
3253
3254 curr_active_slave = rcu_dereference(bond->curr_active_slave);
3255 curr_arp_slave = rcu_dereference(bond->current_arp_slave);
3256
3257 /* We 'trust' the received ARP enough to validate it if:
3258 * see bond_arp_rcv().
3259 */
3260 if (bond_is_active_slave(slave))
3261 bond_validate_na(bond, slave, saddr, daddr);
3262 else if (curr_active_slave &&
3263 time_after(slave_last_rx(bond, curr_active_slave),
3264 curr_active_slave->last_link_up))
3265 bond_validate_na(bond, slave, saddr, daddr);
3266 else if (curr_arp_slave &&
3267 bond_time_in_interval(bond, slave_last_tx(curr_arp_slave), 1))
3268 bond_validate_na(bond, slave, saddr, daddr);
3269
3270 out:
3271 return RX_HANDLER_ANOTHER;
3272 }
3273 #endif
3274
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (171018 bytes)
Powered by blists - more mailing lists