lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sat, 24 Dec 2022 19:23:47 +0800
From:   kernel test robot <lkp@...el.com>
To:     Ilya Dryomov <idryomov@...il.com>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-kernel@...r.kernel.org, Jeff Layton <jlayton@...nel.org>
Subject: net/ceph/messenger_v2.c:2897:5: warning: stack frame size (2064)
 exceeds limit (2048) in 'ceph_con_v2_try_read'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   72a85e2b0a1e1e6fb4ee51ae902730212b2de25c
commit: 2ea88716369ac9a7486a8cb309d6bf1239ea156c libceph: make recv path in secure mode work the same as send path
date:   11 months ago
config: mips-randconfig-r026-20221224
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project f5700e7b69048de958172fb513b336564e7f8709)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips64el-linux-gnuabi64
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2ea88716369ac9a7486a8cb309d6bf1239ea156c
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2ea88716369ac9a7486a8cb309d6bf1239ea156c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash mm/ net/ceph/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   In file included from net/ceph/messenger_v2.c:24:
   include/linux/ceph/decode.h:236:33: warning: taking address of packed member 'in_addr' of class or structure 'ceph_entity_addr' may result in an unaligned pointer value [-Waddress-of-packed-member]
           __be16 ss_family = *(__be16 *)&a->in_addr.ss_family;
                                          ^~~~~~~~~~~~~~~~~~~~
   net/ceph/messenger_v2.c:558:16: warning: taking address of packed member 'front_crc' of class or structure 'ceph_connection_v2_info::(anonymous struct)::(anonymous union)::struct (anonymous at include/linux/ceph/messenger.h:416:4)' may result in an unaligned pointer value [-Waddress-of-packed-member]
           cpu_to_le32s(&con->v2.out_epil.front_crc);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/byteorder/generic.h:112:22: note: expanded from macro 'cpu_to_le32s'
   #define cpu_to_le32s __cpu_to_le32s
                        ^
   include/uapi/linux/byteorder/little_endian.h:95:39: note: expanded from macro '__cpu_to_le32s'
   #define __cpu_to_le32s(x) do { (void)(x); } while (0)
                                         ^
   net/ceph/messenger_v2.c:559:16: warning: taking address of packed member 'middle_crc' of class or structure 'ceph_connection_v2_info::(anonymous struct)::(anonymous union)::struct (anonymous at include/linux/ceph/messenger.h:416:4)' may result in an unaligned pointer value [-Waddress-of-packed-member]
           cpu_to_le32s(&con->v2.out_epil.middle_crc);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/byteorder/generic.h:112:22: note: expanded from macro 'cpu_to_le32s'
   #define cpu_to_le32s __cpu_to_le32s
                        ^
   include/uapi/linux/byteorder/little_endian.h:95:39: note: expanded from macro '__cpu_to_le32s'
   #define __cpu_to_le32s(x) do { (void)(x); } while (0)
                                         ^
   net/ceph/messenger_v2.c:560:16: warning: taking address of packed member 'data_crc' of class or structure 'ceph_connection_v2_info::(anonymous struct)::(anonymous union)::struct (anonymous at include/linux/ceph/messenger.h:416:4)' may result in an unaligned pointer value [-Waddress-of-packed-member]
           cpu_to_le32s(&con->v2.out_epil.data_crc);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/byteorder/generic.h:112:22: note: expanded from macro 'cpu_to_le32s'
   #define cpu_to_le32s __cpu_to_le32s
                        ^
   include/uapi/linux/byteorder/little_endian.h:95:39: note: expanded from macro '__cpu_to_le32s'
   #define __cpu_to_le32s(x) do { (void)(x); } while (0)
                                         ^
>> net/ceph/messenger_v2.c:2897:5: warning: stack frame size (2064) exceeds limit (2048) in 'ceph_con_v2_try_read' [-Wframe-larger-than]
   int ceph_con_v2_try_read(struct ceph_connection *con)
       ^
   1926/2064 (93.31%) spills, 138/2064 (6.69%) variables
   5 warnings generated.


vim +/ceph_con_v2_try_read +2897 net/ceph/messenger_v2.c

cd1a677cad9940 Ilya Dryomov 2020-11-19  2896  
cd1a677cad9940 Ilya Dryomov 2020-11-19 @2897  int ceph_con_v2_try_read(struct ceph_connection *con)
cd1a677cad9940 Ilya Dryomov 2020-11-19  2898  {
cd1a677cad9940 Ilya Dryomov 2020-11-19  2899  	int ret;
cd1a677cad9940 Ilya Dryomov 2020-11-19  2900  
cd1a677cad9940 Ilya Dryomov 2020-11-19  2901  	dout("%s con %p state %d need %zu\n", __func__, con, con->state,
cd1a677cad9940 Ilya Dryomov 2020-11-19  2902  	     iov_iter_count(&con->v2.in_iter));
cd1a677cad9940 Ilya Dryomov 2020-11-19  2903  
cd1a677cad9940 Ilya Dryomov 2020-11-19  2904  	if (con->state == CEPH_CON_S_PREOPEN)
cd1a677cad9940 Ilya Dryomov 2020-11-19  2905  		return 0;
cd1a677cad9940 Ilya Dryomov 2020-11-19  2906  
cd1a677cad9940 Ilya Dryomov 2020-11-19  2907  	/*
cd1a677cad9940 Ilya Dryomov 2020-11-19  2908  	 * We should always have something pending here.  If not,
cd1a677cad9940 Ilya Dryomov 2020-11-19  2909  	 * avoid calling populate_in_iter() as if we read something
cd1a677cad9940 Ilya Dryomov 2020-11-19  2910  	 * (ceph_tcp_recv() would immediately return 1).
cd1a677cad9940 Ilya Dryomov 2020-11-19  2911  	 */
cd1a677cad9940 Ilya Dryomov 2020-11-19  2912  	if (WARN_ON(!iov_iter_count(&con->v2.in_iter)))
cd1a677cad9940 Ilya Dryomov 2020-11-19  2913  		return -ENODATA;
cd1a677cad9940 Ilya Dryomov 2020-11-19  2914  
cd1a677cad9940 Ilya Dryomov 2020-11-19  2915  	for (;;) {
cd1a677cad9940 Ilya Dryomov 2020-11-19  2916  		ret = ceph_tcp_recv(con);
cd1a677cad9940 Ilya Dryomov 2020-11-19  2917  		if (ret <= 0)
cd1a677cad9940 Ilya Dryomov 2020-11-19  2918  			return ret;
cd1a677cad9940 Ilya Dryomov 2020-11-19  2919  
cd1a677cad9940 Ilya Dryomov 2020-11-19  2920  		ret = populate_in_iter(con);
cd1a677cad9940 Ilya Dryomov 2020-11-19  2921  		if (ret <= 0) {
cd1a677cad9940 Ilya Dryomov 2020-11-19  2922  			if (ret && ret != -EAGAIN && !con->error_msg)
cd1a677cad9940 Ilya Dryomov 2020-11-19  2923  				con->error_msg = "read processing error";
cd1a677cad9940 Ilya Dryomov 2020-11-19  2924  			return ret;
cd1a677cad9940 Ilya Dryomov 2020-11-19  2925  		}
cd1a677cad9940 Ilya Dryomov 2020-11-19  2926  	}
cd1a677cad9940 Ilya Dryomov 2020-11-19  2927  }
cd1a677cad9940 Ilya Dryomov 2020-11-19  2928  

:::::: The code at line 2897 was first introduced by commit
:::::: cd1a677cad994021b19665ed476aea63f5d54f31 libceph, ceph: implement msgr2.1 protocol (crc and secure modes)

:::::: TO: Ilya Dryomov <idryomov@...il.com>
:::::: CC: Ilya Dryomov <idryomov@...il.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (169378 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ