Re: [PATCH bpf-next v5 2/9] bpf: Propagate modified uaddrlen from cgroup sockaddr programs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Daan-De-Meyer/selftests-bpf-Add-missing-section-name-tests-for-getpeername-getsockname/20230922-032515
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20230921120913.566702-3-daan.j.demeyer%40gmail.com
patch subject: [PATCH bpf-next v5 2/9] bpf: Propagate modified uaddrlen from cgroup sockaddr programs
config: arm-defconfig (https://download.01.org/0day-ci/archive/20230922/202309221052.Tb6xh9pg-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230922/202309221052.Tb6xh9pg-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309221052.Tb6xh9pg-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   net/ipv4/af_inet.c: In function 'inet_getname':
>> net/ipv4/af_inet.c:791:13: warning: unused variable 'sin_addr_len' [-Wunused-variable]
     791 |         int sin_addr_len = sizeof(*sin);
         |             ^~~~~~~~~~~~


vim +/sin_addr_len +791 net/ipv4/af_inet.c

   781	
   782	/*
   783	 *	This does both peername and sockname.
   784	 */
   785	int inet_getname(struct socket *sock, struct sockaddr *uaddr,
   786			 int peer)
   787	{
   788		struct sock *sk		= sock->sk;
   789		struct inet_sock *inet	= inet_sk(sk);
   790		DECLARE_SOCKADDR(struct sockaddr_in *, sin, uaddr);
 > 791		int sin_addr_len = sizeof(*sin);
   792	
   793		sin->sin_family = AF_INET;
   794		lock_sock(sk);
   795		if (peer) {
   796			if (!inet->inet_dport ||
   797			    (((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_SYN_SENT)) &&
   798			     peer == 1)) {
   799				release_sock(sk);
   800				return -ENOTCONN;
   801			}
   802			sin->sin_port = inet->inet_dport;
   803			sin->sin_addr.s_addr = inet->inet_daddr;
   804			BPF_CGROUP_RUN_SA_PROG(sk, (struct sockaddr *)sin, &sin_addr_len,
   805					       CGROUP_INET4_GETPEERNAME);
   806		} else {
   807			__be32 addr = inet->inet_rcv_saddr;
   808			if (!addr)
   809				addr = inet->inet_saddr;
   810			sin->sin_port = inet->inet_sport;
   811			sin->sin_addr.s_addr = addr;
   812			BPF_CGROUP_RUN_SA_PROG(sk, (struct sockaddr *)sin, &sin_addr_len,
   813					       CGROUP_INET4_GETSOCKNAME);
   814		}
   815		release_sock(sk);
   816		memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
   817		return sizeof(*sin);
   818	}
   819	EXPORT_SYMBOL(inet_getname);
   820	

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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux