From: kernel test robot <lkp@intel.com>
To: Julian Anastasov <ja@ssi.bg>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Florian Westphal <fw@strlen.de>
Subject: net/netfilter/ipvs/ip_vs_core.c:1732:36: sparse: sparse: cast truncates bits from constant value (ffff7fff becomes 7fff)
Date: Sun, 06 Dec 2026 12:27:37 +0100 [thread overview]
Message-ID: <20261204130833.615cRlog-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 007722b8211f7b34fdf21b1e6a9c32497633ea29
commit: b655388111cf7e43f70e49db64bdaa42bcb8a038 ipvs: add resizable hash tables
date: 9 months ago
config: sparc64-randconfig-r2305-20261203 (https://download.01.org/0day-ci/archive/20261204/20261204130833.615cRlog-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 9.5.0
sparse: v0.6.5-rc1-94-g0d159c10
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261204/20261204130833.615cRlog-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
| Fixes: b655388111cf ("ipvs: add resizable hash tables")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261204130833.615cRlog-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
net/netfilter/ipvs/ip_vs_core.c:179:31: sparse: sparse: Initializer entry defined twice
net/netfilter/ipvs/ip_vs_core.c:179:31: sparse: also defined here
net/netfilter/ipvs/ip_vs_core.c:189:27: sparse: sparse: Initializer entry defined twice
net/netfilter/ipvs/ip_vs_core.c:189:27: sparse: also defined here
net/netfilter/ipvs/ip_vs_core.c:197:35: sparse: sparse: Initializer entry defined twice
net/netfilter/ipvs/ip_vs_core.c:197:35: sparse: also defined here
net/netfilter/ipvs/ip_vs_core.c:206:22: sparse: sparse: Initializer entry defined twice
net/netfilter/ipvs/ip_vs_core.c:206:22: sparse: also defined here
>> net/netfilter/ipvs/ip_vs_core.c:1732:36: sparse: sparse: cast truncates bits from constant value (ffff7fff becomes 7fff)
vim +1732 net/netfilter/ipvs/ip_vs_core.c
508f744c0de38f Julian Anastasov 2019-05-05 1712
6aedd14b25dbcf Julian Anastasov 2019-07-03 1713 /* Check the GRE tunnel and return its header length */
6aedd14b25dbcf Julian Anastasov 2019-07-03 1714 static int ipvs_gre_decap(struct netns_ipvs *ipvs, struct sk_buff *skb,
6aedd14b25dbcf Julian Anastasov 2019-07-03 1715 unsigned int offset, __u16 af,
6aedd14b25dbcf Julian Anastasov 2019-07-03 1716 const union nf_inet_addr *daddr, __u8 *proto)
6aedd14b25dbcf Julian Anastasov 2019-07-03 1717 {
6aedd14b25dbcf Julian Anastasov 2019-07-03 1718 struct gre_base_hdr _greh, *greh;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1719 struct ip_vs_dest *dest;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1720
6aedd14b25dbcf Julian Anastasov 2019-07-03 1721 greh = skb_header_pointer(skb, offset, sizeof(_greh), &_greh);
6aedd14b25dbcf Julian Anastasov 2019-07-03 1722 if (!greh)
6aedd14b25dbcf Julian Anastasov 2019-07-03 1723 goto unk;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1724 dest = ip_vs_find_tunnel(ipvs, af, daddr, 0);
6aedd14b25dbcf Julian Anastasov 2019-07-03 1725 if (!dest)
6aedd14b25dbcf Julian Anastasov 2019-07-03 1726 goto unk;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1727 if (dest->tun_type == IP_VS_CONN_F_TUNNEL_TYPE_GRE) {
5832c4a77d6931 Alexander Lobakin 2024-03-27 1728 IP_TUNNEL_DECLARE_FLAGS(flags);
6aedd14b25dbcf Julian Anastasov 2019-07-03 1729 __be16 type;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1730
6aedd14b25dbcf Julian Anastasov 2019-07-03 1731 /* Only support version 0 and C (csum) */
6aedd14b25dbcf Julian Anastasov 2019-07-03 @1732 if ((greh->flags & ~GRE_CSUM) != 0)
6aedd14b25dbcf Julian Anastasov 2019-07-03 1733 goto unk;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1734 type = greh->protocol;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1735 /* Later we can support also IPPROTO_IPV6 */
6aedd14b25dbcf Julian Anastasov 2019-07-03 1736 if (type != htons(ETH_P_IP))
6aedd14b25dbcf Julian Anastasov 2019-07-03 1737 goto unk;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1738 *proto = IPPROTO_IPIP;
5832c4a77d6931 Alexander Lobakin 2024-03-27 1739
5832c4a77d6931 Alexander Lobakin 2024-03-27 1740 gre_flags_to_tnl_flags(flags, greh->flags);
5832c4a77d6931 Alexander Lobakin 2024-03-27 1741
5832c4a77d6931 Alexander Lobakin 2024-03-27 1742 return gre_calc_hlen(flags);
6aedd14b25dbcf Julian Anastasov 2019-07-03 1743 }
6aedd14b25dbcf Julian Anastasov 2019-07-03 1744
6aedd14b25dbcf Julian Anastasov 2019-07-03 1745 unk:
6aedd14b25dbcf Julian Anastasov 2019-07-03 1746 return 0;
6aedd14b25dbcf Julian Anastasov 2019-07-03 1747 }
6aedd14b25dbcf Julian Anastasov 2019-07-03 1748
:::::: The code at line 1732 was first introduced by commit
:::::: 6aedd14b25dbcf6cfdf2da8569153d45b3e5d9fd ipvs: strip gre tunnel headers from icmp errors
:::::: TO: Julian Anastasov <ja@ssi.bg>
:::::: CC: Pablo Neira Ayuso <pablo@netfilter.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-12-06 11:27 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=20261204130833.615cRlog-lkp@intel.com \
--to=lkp@intel.com \
--cc=fw@strlen.de \
--cc=ja@ssi.bg \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®