All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Helge Deller <deller@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [deller-parisc:for-next 2/9] net/ipv4/af_inet.c:1523:49: sparse: sparse: restricted __be32 degrades to integer
Date: Wed, 08 Apr 2026 13:14:03 +0800	[thread overview]
Message-ID: <202604081313.ceFDMEFQ-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git for-next
head:   bc8a19a194d5a72df5982c04f8a9e7bcff1306ca
commit: 595407f94f5e5b778a349bd5a323c5051920b864 [2/9] net: Avoid unaligned access in inet_gro_receive()
config: i386-randconfig-r111-20260408 (https://download.01.org/0day-ci/archive/20260408/202604081313.ceFDMEFQ-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260408/202604081313.ceFDMEFQ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604081313.ceFDMEFQ-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> net/ipv4/af_inet.c:1523:49: sparse: sparse: restricted __be32 degrades to integer
   net/ipv4/af_inet.c:1524:49: sparse: sparse: restricted __be32 degrades to integer

vim +1523 net/ipv4/af_inet.c

  1473	
  1474	struct sk_buff *inet_gro_receive(struct list_head *head, struct sk_buff *skb)
  1475	{
  1476		const struct net_offload *ops;
  1477		struct sk_buff *pp = NULL;
  1478		const struct iphdr *iph;
  1479		struct sk_buff *p;
  1480		unsigned int hlen;
  1481		unsigned int off;
  1482		__u16 flush;
  1483		int proto;
  1484	
  1485		off = skb_gro_offset(skb);
  1486		hlen = off + sizeof(*iph);
  1487		iph = skb_gro_header(skb, hlen, off);
  1488		if (unlikely(!iph))
  1489			goto out;
  1490	
  1491		proto = iph->protocol;
  1492	
  1493		ops = rcu_dereference(inet_offloads[proto]);
  1494		if (!ops || !ops->callbacks.gro_receive)
  1495			goto out;
  1496	
  1497		if (*(u8 *)iph != 0x45)
  1498			goto out;
  1499	
  1500		if (ip_is_fragment(iph))
  1501			goto out;
  1502	
  1503		if (unlikely(ip_fast_csum((u8 *)iph, 5)))
  1504			goto out;
  1505	
  1506		NAPI_GRO_CB(skb)->proto = proto;
  1507		flush = (get_unaligned_be16(&iph->tot_len) ^ skb_gro_len(skb)) |
  1508		        (get_unaligned_be16(&iph->frag_off) & ~IP_DF);
  1509	
  1510		list_for_each_entry(p, head, list) {
  1511			struct iphdr *iph2;
  1512	
  1513			if (!NAPI_GRO_CB(p)->same_flow)
  1514				continue;
  1515	
  1516			iph2 = (struct iphdr *)(p->data + off);
  1517			/* The above works because, with the exception of the top
  1518			 * (inner most) layer, we only aggregate pkts with the same
  1519			 * hdr length so all the hdrs we'll need to verify will start
  1520			 * at the same offset.
  1521			 */
  1522			if ((iph->protocol ^ iph2->protocol) |
> 1523			    (get_unaligned(&iph->saddr) ^ get_unaligned(&iph2->saddr)) |
  1524			    (get_unaligned(&iph->daddr) ^ get_unaligned(&iph2->daddr))) {
  1525				NAPI_GRO_CB(p)->same_flow = 0;
  1526				continue;
  1527			}
  1528		}
  1529	
  1530		NAPI_GRO_CB(skb)->flush |= flush;
  1531		NAPI_GRO_CB(skb)->network_offsets[NAPI_GRO_CB(skb)->encap_mark] = off;
  1532	
  1533		/* Note : No need to call skb_gro_postpull_rcsum() here,
  1534		 * as we already checked checksum over ipv4 header was 0
  1535		 */
  1536		skb_gro_pull(skb, sizeof(*iph));
  1537		skb_set_transport_header(skb, skb_gro_offset(skb));
  1538	
  1539		pp = indirect_call_gro_receive(tcp4_gro_receive, udp4_gro_receive,
  1540					       ops->callbacks.gro_receive, head, skb);
  1541	
  1542	out:
  1543		skb_gro_flush_final(skb, pp, flush);
  1544	
  1545		return pp;
  1546	}
  1547	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-04-08  5:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202604081313.ceFDMEFQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=deller@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.