Re: [PATCH net-next] sctp: add bpf_bypass_getsockopt proto callback

From: kernel test robot
Date: Wed May 10 2023 - 11:06:47 EST


Hi Alexander,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url: https://github.com/intel-lab-lkp/linux/commits/Alexander-Mikhalitsyn/sctp-add-bpf_bypass_getsockopt-proto-callback/20230510-211646
base: net-next/main
patch link: https://lore.kernel.org/r/20230510131527.1244929-1-aleksandr.mikhalitsyn%40canonical.com
patch subject: [PATCH net-next] sctp: add bpf_bypass_getsockopt proto callback
config: m68k-defconfig (https://download.01.org/0day-ci/archive/20230510/202305102234.u4T0ut0T-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/8ad9818b4b74026fe549b2aa34ea800ab6c8e66d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Alexander-Mikhalitsyn/sctp-add-bpf_bypass_getsockopt-proto-callback/20230510-211646
git checkout 8ad9818b4b74026fe549b2aa34ea800ab6c8e66d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash net/sctp/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202305102234.u4T0ut0T-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> net/sctp/socket.c:8284:6: warning: no previous prototype for 'sctp_bpf_bypass_getsockopt' [-Wmissing-prototypes]
8284 | bool sctp_bpf_bypass_getsockopt(int level, int optname)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/sctp_bpf_bypass_getsockopt +8284 net/sctp/socket.c

8283
> 8284 bool sctp_bpf_bypass_getsockopt(int level, int optname)
8285 {
8286 /*
8287 * These options do fd_install(), and if BPF_CGROUP_RUN_PROG_GETSOCKOPT
8288 * hook returns an error after success of the original handler
8289 * sctp_getsockopt(...), userspace will receive an error from getsockopt
8290 * syscall and will be not aware that fd was successfully installed into fdtable.
8291 *
8292 * Let's prevent bpf cgroup hook from running on them.
8293 */
8294 if (level == SOL_SCTP) {
8295 switch (optname) {
8296 case SCTP_SOCKOPT_PEELOFF:
8297 case SCTP_SOCKOPT_PEELOFF_FLAGS:
8298 return true;
8299 default:
8300 return false;
8301 }
8302 }
8303
8304 return false;
8305 }
8306

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