netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Antonio Quartulli <antonio@openvpn.net>,
	netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Donald Hunter <donald.hunter@gmail.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	sd@queasysnail.net, ryazanov.s.a@gmail.com,
	Andrew Lunn <andrew+netdev@lunn.ch>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Simon Horman <horms@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Xiao Liang <shaw.leon@gmail.com>
Subject: Re: [PATCH net-next v22 18/23] ovpn: implement peer add/get/dump/delete via netlink
Date: Thu, 13 Mar 2025 00:52:34 +0800	[thread overview]
Message-ID: <202503130050.cIMoMcyw-lkp@intel.com> (raw)
In-Reply-To: <20250311-b4-ovpn-v22-18-2b7b02155412@openvpn.net>

Hi Antonio,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 40587f749df216889163dd6e02d88ad53e759e66]

url:    https://github.com/intel-lab-lkp/linux/commits/Antonio-Quartulli/net-introduce-OpenVPN-Data-Channel-Offload-ovpn/20250311-202334
base:   40587f749df216889163dd6e02d88ad53e759e66
patch link:    https://lore.kernel.org/r/20250311-b4-ovpn-v22-18-2b7b02155412%40openvpn.net
patch subject: [PATCH net-next v22 18/23] ovpn: implement peer add/get/dump/delete via netlink
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250313/202503130050.cIMoMcyw-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250313/202503130050.cIMoMcyw-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/202503130050.cIMoMcyw-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ovpn/peer.c:10:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/mm.h:2224:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ovpn/peer.c:152:6: warning: variable 'ip_len' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     152 |         if (local_ip) {
         |             ^~~~~~~~
   drivers/net/ovpn/peer.c:166:33: note: uninitialized use occurs here
     166 |         memcpy(&bind->local, local_ip, ip_len);
         |                                        ^~~~~~
   include/linux/fortify-string.h:690:53: note: expanded from macro 'memcpy'
     690 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
         |                                                     ^
   include/linux/fortify-string.h:627:41: note: expanded from macro '__fortify_memcpy_chk'
     627 |         const size_t __fortify_size = (size_t)(size);                   \
         |                                                ^~~~
   drivers/net/ovpn/peer.c:152:2: note: remove the 'if' if its condition is always true
     152 |         if (local_ip) {
         |         ^~~~~~~~~~~~~
   drivers/net/ovpn/peer.c:143:15: note: initialize the variable 'ip_len' to silence this warning
     143 |         size_t ip_len;
         |                      ^
         |                       = 0
   4 warnings generated.


vim +152 drivers/net/ovpn/peer.c

   129	
   130	/**
   131	 * ovpn_peer_reset_sockaddr - recreate binding for peer
   132	 * @peer: peer to recreate the binding for
   133	 * @ss: sockaddr to use as remote endpoint for the binding
   134	 * @local_ip: local IP for the binding
   135	 *
   136	 * Return: 0 on success or a negative error code otherwise
   137	 */
   138	int ovpn_peer_reset_sockaddr(struct ovpn_peer *peer,
   139				     const struct sockaddr_storage *ss,
   140				     const void *local_ip)
   141	{
   142		struct ovpn_bind *bind;
   143		size_t ip_len;
   144	
   145		lockdep_assert_held(&peer->lock);
   146	
   147		/* create new ovpn_bind object */
   148		bind = ovpn_bind_from_sockaddr(ss);
   149		if (IS_ERR(bind))
   150			return PTR_ERR(bind);
   151	
 > 152		if (local_ip) {
   153			if (ss->ss_family == AF_INET) {
   154				ip_len = sizeof(struct in_addr);
   155			} else if (ss->ss_family == AF_INET6) {
   156				ip_len = sizeof(struct in6_addr);
   157			} else {
   158				net_dbg_ratelimited("%s: invalid family %u for remote endpoint for peer %u\n",
   159						    netdev_name(peer->ovpn->dev),
   160						    ss->ss_family, peer->id);
   161				kfree(bind);
   162				return -EINVAL;
   163			}
   164		}
   165	
   166		memcpy(&bind->local, local_ip, ip_len);
   167	
   168		/* set binding */
   169		ovpn_bind_reset(peer, bind);
   170	
   171		return 0;
   172	}
   173	

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

  reply	other threads:[~2025-03-12 16:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 12:02 [PATCH net-next v22 00/23] Introducing OpenVPN Data Channel Offload Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 01/23] net: introduce OpenVPN Data Channel Offload (ovpn) Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 02/23] ovpn: add basic netlink support Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 03/23] ovpn: add basic interface creation/destruction/management routines Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 04/23] ovpn: keep carrier always on for MP interfaces Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 05/23] ovpn: introduce the ovpn_peer object Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 06/23] ovpn: introduce the ovpn_socket object Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 07/23] ovpn: implement basic TX path (UDP) Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 08/23] ovpn: implement basic RX " Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 09/23] ovpn: implement packet processing Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 10/23] ovpn: store tunnel and transport statistics Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 11/23] ovpn: implement TCP transport Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 12/23] skb: implement skb_send_sock_locked_with_flags() Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 13/23] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 14/23] ovpn: implement multi-peer support Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 15/23] ovpn: implement peer lookup logic Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 16/23] ovpn: implement keepalive mechanism Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 17/23] ovpn: add support for updating local or remote UDP endpoint Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 18/23] ovpn: implement peer add/get/dump/delete via netlink Antonio Quartulli
2025-03-12 16:52   ` kernel test robot [this message]
2025-03-11 12:02 ` [PATCH net-next v22 19/23] ovpn: implement key add/get/del/swap " Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 20/23] ovpn: kill key and notify userspace in case of IV exhaustion Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 21/23] ovpn: notify userspace when a peer is deleted Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 22/23] ovpn: add basic ethtool support Antonio Quartulli
2025-03-11 12:02 ` [PATCH net-next v22 23/23] testing/selftests: add test tool and scripts for ovpn module Antonio Quartulli

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=202503130050.cIMoMcyw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=antonio@openvpn.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=sd@queasysnail.net \
    --cc=shaw.leon@gmail.com \
    --cc=skhan@linuxfoundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).