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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202210140233.uZiMQfOD-lkp@intel.com>
Date:   Fri, 14 Oct 2022 02:52:16 +0800
From:   kernel test robot <lkp@...el.com>
To:     Nick Desaulniers <ndesaulniers@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Arnd Bergmann <arnd@...db.de>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        Linux Memory Management List <linux-mm@...ck.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Nathan Chancellor <nathan@...nel.org>,
        Tom Rix <trix@...hat.com>, Xiaoming Ni <nixiaoming@...wei.com>,
        Luis Chamberlain <mcgrof@...nel.org>,
        Andi Kleen <ak@...ux.intel.com>, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>,
        Eric Dumazet <edumazet@...gle.com>,
        "Darrick J. Wong" <darrick.wong@...cle.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH] fs/select: mark do_select noinline_for_stack for 32b

Hi Nick,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 93ed07a23fd08b8613f64cf0a15d7fbdaca010fd]

url:    https://github.com/intel-lab-lkp/linux/commits/Nick-Desaulniers/fs-select-mark-do_select-noinline_for_stack-for-32b/20221008-041539
base:   93ed07a23fd08b8613f64cf0a15d7fbdaca010fd
patch link:    https://lore.kernel.org/r/20221007201140.1744961-1-ndesaulniers%40google.com
patch subject: [PATCH] fs/select: mark do_select noinline_for_stack for 32b
config: powerpc-randconfig-c003-20221012
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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 powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/58064d22945d0fed666adc4cef463401981e2719
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Nick-Desaulniers/fs-select-mark-do_select-noinline_for_stack-for-32b/20221008-041539
        git checkout 58064d22945d0fed666adc4cef463401981e2719
        # 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=powerpc SHELL=/bin/bash

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 >>):

>> fs/select.c:981:12: warning: stack frame size (1056) exceeds limit (1024) in 'do_sys_poll' [-Wframe-larger-than]
   static int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
              ^
   1 warning generated.


vim +/do_sys_poll +981 fs/select.c

^1da177e4c3f41 Linus Torvalds      2005-04-16   977  
70674f95c0a2ea Andi Kleen          2006-03-28   978  #define N_STACK_PPS ((sizeof(stack_pps) - sizeof(struct poll_list))  / \
70674f95c0a2ea Andi Kleen          2006-03-28   979  			sizeof(struct pollfd))
70674f95c0a2ea Andi Kleen          2006-03-28   980  
e99ca56ce03dd9 Al Viro             2017-04-08  @981  static int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
766b9f928bd5b9 Deepa Dinamani      2016-05-19   982  		struct timespec64 *end_time)
^1da177e4c3f41 Linus Torvalds      2005-04-16   983  {
^1da177e4c3f41 Linus Torvalds      2005-04-16   984  	struct poll_wqueues table;
43e11fa2d1d3b6 Gustavo A. R. Silva 2019-07-16   985  	int err = -EFAULT, fdcount, len;
30c14e40ed8546 Jes Sorensen        2006-03-31   986  	/* Allocate small arguments on the stack to save memory and be
30c14e40ed8546 Jes Sorensen        2006-03-31   987  	   faster - use long to make sure the buffer is aligned properly
30c14e40ed8546 Jes Sorensen        2006-03-31   988  	   on 64 bit archs to avoid unaligned access */
30c14e40ed8546 Jes Sorensen        2006-03-31   989  	long stack_pps[POLL_STACK_ALLOC/sizeof(long)];
252e5725cfb55a Oleg Nesterov       2007-10-16   990  	struct poll_list *const head = (struct poll_list *)stack_pps;
252e5725cfb55a Oleg Nesterov       2007-10-16   991   	struct poll_list *walk = head;
252e5725cfb55a Oleg Nesterov       2007-10-16   992   	unsigned long todo = nfds;
^1da177e4c3f41 Linus Torvalds      2005-04-16   993  
d554ed895dc8f2 Jiri Slaby          2010-03-05   994  	if (nfds > rlimit(RLIMIT_NOFILE))
^1da177e4c3f41 Linus Torvalds      2005-04-16   995  		return -EINVAL;
^1da177e4c3f41 Linus Torvalds      2005-04-16   996  
252e5725cfb55a Oleg Nesterov       2007-10-16   997  	len = min_t(unsigned int, nfds, N_STACK_PPS);
252e5725cfb55a Oleg Nesterov       2007-10-16   998  	for (;;) {
252e5725cfb55a Oleg Nesterov       2007-10-16   999  		walk->next = NULL;
252e5725cfb55a Oleg Nesterov       2007-10-16  1000  		walk->len = len;
252e5725cfb55a Oleg Nesterov       2007-10-16  1001  		if (!len)
252e5725cfb55a Oleg Nesterov       2007-10-16  1002  			break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1003  
252e5725cfb55a Oleg Nesterov       2007-10-16  1004  		if (copy_from_user(walk->entries, ufds + nfds-todo,
252e5725cfb55a Oleg Nesterov       2007-10-16  1005  					sizeof(struct pollfd) * walk->len))
^1da177e4c3f41 Linus Torvalds      2005-04-16  1006  			goto out_fds;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1007  
252e5725cfb55a Oleg Nesterov       2007-10-16  1008  		todo -= walk->len;
252e5725cfb55a Oleg Nesterov       2007-10-16  1009  		if (!todo)
252e5725cfb55a Oleg Nesterov       2007-10-16  1010  			break;
252e5725cfb55a Oleg Nesterov       2007-10-16  1011  
252e5725cfb55a Oleg Nesterov       2007-10-16  1012  		len = min(todo, POLLFD_PER_PAGE);
43e11fa2d1d3b6 Gustavo A. R. Silva 2019-07-16  1013  		walk = walk->next = kmalloc(struct_size(walk, entries, len),
0bcfe68b876748 Linus Torvalds      2021-09-07  1014  					    GFP_KERNEL);
252e5725cfb55a Oleg Nesterov       2007-10-16  1015  		if (!walk) {
252e5725cfb55a Oleg Nesterov       2007-10-16  1016  			err = -ENOMEM;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1017  			goto out_fds;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1018  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16  1019  	}
9f72949f679df0 David Woodhouse     2006-01-18  1020  
252e5725cfb55a Oleg Nesterov       2007-10-16  1021  	poll_initwait(&table);
ccec5ee302d5cb Mateusz Guzik       2016-01-06  1022  	fdcount = do_poll(head, &table, end_time);
252e5725cfb55a Oleg Nesterov       2007-10-16  1023  	poll_freewait(&table);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1024  
ef0ba05538299f Linus Torvalds      2021-01-07  1025  	if (!user_write_access_begin(ufds, nfds * sizeof(*ufds)))
ef0ba05538299f Linus Torvalds      2021-01-07  1026  		goto out_fds;
ef0ba05538299f Linus Torvalds      2021-01-07  1027  
252e5725cfb55a Oleg Nesterov       2007-10-16  1028  	for (walk = head; walk; walk = walk->next) {
^1da177e4c3f41 Linus Torvalds      2005-04-16  1029  		struct pollfd *fds = walk->entries;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1030  		int j;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1031  
ef0ba05538299f Linus Torvalds      2021-01-07  1032  		for (j = walk->len; j; fds++, ufds++, j--)
ef0ba05538299f Linus Torvalds      2021-01-07  1033  			unsafe_put_user(fds->revents, &ufds->revents, Efault);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1034    	}
ef0ba05538299f Linus Torvalds      2021-01-07  1035  	user_write_access_end();
252e5725cfb55a Oleg Nesterov       2007-10-16  1036  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1037  	err = fdcount;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1038  out_fds:
252e5725cfb55a Oleg Nesterov       2007-10-16  1039  	walk = head->next;
252e5725cfb55a Oleg Nesterov       2007-10-16  1040  	while (walk) {
252e5725cfb55a Oleg Nesterov       2007-10-16  1041  		struct poll_list *pos = walk;
252e5725cfb55a Oleg Nesterov       2007-10-16  1042  		walk = walk->next;
252e5725cfb55a Oleg Nesterov       2007-10-16  1043  		kfree(pos);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1044  	}
252e5725cfb55a Oleg Nesterov       2007-10-16  1045  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1046  	return err;
ef0ba05538299f Linus Torvalds      2021-01-07  1047  
ef0ba05538299f Linus Torvalds      2021-01-07  1048  Efault:
ef0ba05538299f Linus Torvalds      2021-01-07  1049  	user_write_access_end();
ef0ba05538299f Linus Torvalds      2021-01-07  1050  	err = -EFAULT;
ef0ba05538299f Linus Torvalds      2021-01-07  1051  	goto out_fds;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1052  }
9f72949f679df0 David Woodhouse     2006-01-18  1053  

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ