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]
Message-ID: <202103050534.dhDhsOLi-lkp@intel.com>
Date:   Fri, 5 Mar 2021 05:21:43 +0800
From:   kernel test robot <lkp@...el.com>
To:     Stefano Garzarella <sgarzare@...hat.com>
Cc:     clang-built-linux@...glegroups.com, linux-kernel@...r.kernel.org,
        Jens Axboe <axboe@...nel.dk>, Kees Cook <keescook@...omium.org>
Subject: fs/io_uring.c:6538:12: warning: stack frame size of 2208 bytes in
 function 'io_submit_sqes'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f69d02e37a85645aa90d18cacfff36dba370f797
commit: 21b55dbc0653018b8cd4513c37cbca303b0f0d50 io_uring: add IOURING_REGISTER_RESTRICTIONS opcode
date:   5 months ago
config: powerpc-randconfig-r023-20210304 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project eec7f8f7b1226be422a76542cb403d02538f453a)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=21b55dbc0653018b8cd4513c37cbca303b0f0d50
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 21b55dbc0653018b8cd4513c37cbca303b0f0d50
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

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

All warnings (new ones prefixed by >>):

   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:61:1: note: expanded from here
   __do_insw
   ^
   arch/powerpc/include/asm/io.h:542:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/io_uring.c:45:
   In file included from include/linux/syscalls.h:84:
   In file included from include/trace/syscall.h:7:
   In file included from include/linux/trace_events.h:9:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:66:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/io_uring.c:45:
   In file included from include/linux/syscalls.h:84:
   In file included from include/trace/syscall.h:7:
   In file included from include/linux/trace_events.h:9:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:71:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/io_uring.c:45:
   In file included from include/linux/syscalls.h:84:
   In file included from include/trace/syscall.h:7:
   In file included from include/linux/trace_events.h:9:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:76:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/io_uring.c:45:
   In file included from include/linux/syscalls.h:84:
   In file included from include/trace/syscall.h:7:
   In file included from include/linux/trace_events.h:9:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:81:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
>> fs/io_uring.c:6538:12: warning: stack frame size of 2208 bytes in function 'io_submit_sqes' [-Wframe-larger-than=]
   static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
              ^
   13 warnings generated.


vim +/io_submit_sqes +6538 fs/io_uring.c

0553b8bda8709c Pavel Begunkov 2020-04-08  6537  
0f2122045b9462 Jens Axboe     2020-09-13 @6538  static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
6c271ce2f1d572 Jens Axboe     2019-01-10  6539  {
ac8691c415e0ce Jens Axboe     2020-06-01  6540  	struct io_submit_state state;
9e645e1105ca60 Jens Axboe     2019-05-10  6541  	struct io_kiocb *link = NULL;
9e645e1105ca60 Jens Axboe     2019-05-10  6542  	int i, submitted = 0;
6c271ce2f1d572 Jens Axboe     2019-01-10  6543  
c4a2ed72c9a615 Jens Axboe     2019-11-21  6544  	/* if we have a backlog and couldn't flush it all, return BUSY */
ad3eb2c89fb24d Jens Axboe     2019-12-18  6545  	if (test_bit(0, &ctx->sq_check_overflow)) {
c4a2ed72c9a615 Jens Axboe     2019-11-21  6546  		if (!list_empty(&ctx->cq_overflow_list) &&
e6c8aa9ac33bd7 Jens Axboe     2020-09-28  6547  		    !io_cqring_overflow_flush(ctx, false, NULL, NULL))
1d7bb1d50fb4dc Jens Axboe     2019-11-06  6548  			return -EBUSY;
ad3eb2c89fb24d Jens Axboe     2019-12-18  6549  	}
6c271ce2f1d572 Jens Axboe     2019-01-10  6550  
ee7d46d9db19de Pavel Begunkov 2019-12-30  6551  	/* make sure SQ entry isn't read before tail */
ee7d46d9db19de Pavel Begunkov 2019-12-30  6552  	nr = min3(nr, ctx->sq_entries, io_sqring_entries(ctx));
9ef4f124894b7b Pavel Begunkov 2019-12-30  6553  
2b85edfc0c90ef Pavel Begunkov 2019-12-28  6554  	if (!percpu_ref_tryget_many(&ctx->refs, nr))
2b85edfc0c90ef Pavel Begunkov 2019-12-28  6555  		return -EAGAIN;
6c271ce2f1d572 Jens Axboe     2019-01-10  6556  
013538bd65fd3c Jens Axboe     2020-06-22  6557  	io_submit_state_start(&state, ctx, nr);
6c271ce2f1d572 Jens Axboe     2019-01-10  6558  
6c271ce2f1d572 Jens Axboe     2019-01-10  6559  	for (i = 0; i < nr; i++) {
3529d8c2b353e6 Jens Axboe     2019-12-19  6560  		const struct io_uring_sqe *sqe;
196be95cd55720 Pavel Begunkov 2019-11-07  6561  		struct io_kiocb *req;
1cb1edb2f5ba8a Pavel Begunkov 2020-02-06  6562  		int err;
fb5ccc98782f65 Pavel Begunkov 2019-10-25  6563  
b1e50e549b1372 Pavel Begunkov 2020-04-08  6564  		sqe = io_get_sqe(ctx);
b1e50e549b1372 Pavel Begunkov 2020-04-08  6565  		if (unlikely(!sqe)) {
b1e50e549b1372 Pavel Begunkov 2020-04-08  6566  			io_consume_sqe(ctx);
b1e50e549b1372 Pavel Begunkov 2020-04-08  6567  			break;
b1e50e549b1372 Pavel Begunkov 2020-04-08  6568  		}
ac8691c415e0ce Jens Axboe     2020-06-01  6569  		req = io_alloc_req(ctx, &state);
196be95cd55720 Pavel Begunkov 2019-11-07  6570  		if (unlikely(!req)) {
196be95cd55720 Pavel Begunkov 2019-11-07  6571  			if (!submitted)
196be95cd55720 Pavel Begunkov 2019-11-07  6572  				submitted = -EAGAIN;
fb5ccc98782f65 Pavel Begunkov 2019-10-25  6573  			break;
196be95cd55720 Pavel Begunkov 2019-11-07  6574  		}
fb5ccc98782f65 Pavel Begunkov 2019-10-25  6575  
ac8691c415e0ce Jens Axboe     2020-06-01  6576  		err = io_init_req(ctx, req, sqe, &state);
709b302faddfac Pavel Begunkov 2020-04-08  6577  		io_consume_sqe(ctx);
d3656344fea033 Jens Axboe     2019-12-18  6578  		/* will complete beyond this point, count as submitted */
d3656344fea033 Jens Axboe     2019-12-18  6579  		submitted++;
d3656344fea033 Jens Axboe     2019-12-18  6580  
ef4ff581102a91 Pavel Begunkov 2020-04-12  6581  		if (unlikely(err)) {
1cb1edb2f5ba8a Pavel Begunkov 2020-02-06  6582  fail_req:
e1e16097e265da Jens Axboe     2020-06-22  6583  			io_put_req(req);
e1e16097e265da Jens Axboe     2020-06-22  6584  			io_req_complete(req, err);
fb5ccc98782f65 Pavel Begunkov 2019-10-25  6585  			break;
196be95cd55720 Pavel Begunkov 2019-11-07  6586  		}
fb5ccc98782f65 Pavel Begunkov 2019-10-25  6587  
354420f705ccd0 Jens Axboe     2020-01-08  6588  		trace_io_uring_submit_sqe(ctx, req->opcode, req->user_data,
0cdaf760f42eb8 Pavel Begunkov 2020-05-17  6589  						true, io_async_submit(ctx));
f13fad7ba41cef Jens Axboe     2020-06-22  6590  		err = io_submit_sqe(req, sqe, &link, &state.comp);
1d4240cc9e7bb1 Pavel Begunkov 2020-04-12  6591  		if (err)
1d4240cc9e7bb1 Pavel Begunkov 2020-04-12  6592  			goto fail_req;
6c271ce2f1d572 Jens Axboe     2019-01-10  6593  	}
6c271ce2f1d572 Jens Axboe     2019-01-10  6594  
9466f43741bc08 Pavel Begunkov 2020-01-25  6595  	if (unlikely(submitted != nr)) {
9466f43741bc08 Pavel Begunkov 2020-01-25  6596  		int ref_used = (submitted == -EAGAIN) ? 0 : submitted;
9466f43741bc08 Pavel Begunkov 2020-01-25  6597  
9466f43741bc08 Pavel Begunkov 2020-01-25  6598  		percpu_ref_put_many(&ctx->refs, nr - ref_used);
9466f43741bc08 Pavel Begunkov 2020-01-25  6599  	}
9e645e1105ca60 Jens Axboe     2019-05-10  6600  	if (link)
f13fad7ba41cef Jens Axboe     2020-06-22  6601  		io_queue_link_head(link, &state.comp);
6c271ce2f1d572 Jens Axboe     2019-01-10  6602  	io_submit_state_end(&state);
6c271ce2f1d572 Jens Axboe     2019-01-10  6603  
ae9428ca61271b Pavel Begunkov 2019-11-06  6604  	 /* Commit SQ ring head once we've consumed and submitted all SQEs */
ae9428ca61271b Pavel Begunkov 2019-11-06  6605  	io_commit_sqring(ctx);
ae9428ca61271b Pavel Begunkov 2019-11-06  6606  
6c271ce2f1d572 Jens Axboe     2019-01-10  6607  	return submitted;
6c271ce2f1d572 Jens Axboe     2019-01-10  6608  }
6c271ce2f1d572 Jens Axboe     2019-01-10  6609  

:::::: The code at line 6538 was first introduced by commit
:::::: 0f2122045b946241a9e549c2a76cea54fa58a7ff io_uring: don't rely on weak ->files references

:::::: TO: Jens Axboe <axboe@...nel.dk>
:::::: CC: Jens Axboe <axboe@...nel.dk>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (24416 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ