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]
Date:   Thu, 5 Jan 2023 13:58:45 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kees Cook <keescook@...omium.org>, Jens Axboe <axboe@...nel.dk>
Cc:     oe-kbuild-all@...ts.linux.dev, Kees Cook <keescook@...omium.org>,
        Pavel Begunkov <asml.silence@...il.com>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        stable@...r.kernel.org, io-uring@...r.kernel.org,
        Dylan Yudaken <dylany@...com>, linux-kernel@...r.kernel.org,
        linux-hardening@...r.kernel.org
Subject: Re: [PATCH] io_uring: Replace 0-length array with flexible array

Hi Kees,

I love your patch! Yet something to improve:

[auto build test ERROR on kees/for-next/pstore]
[also build test ERROR on kees/for-next/kspp linus/master v6.2-rc2 next-20230105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kees-Cook/io_uring-Replace-0-length-array-with-flexible-array/20230105-114008
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/pstore
patch link:    https://lore.kernel.org/r/20230105033743.never.628-kees%40kernel.org
patch subject: [PATCH] io_uring: Replace 0-length array with flexible array
config: arc-defconfig
compiler: arc-elf-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/6239ffe2f8611e707b90e0c902bfa1f0dbe578bb
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Kees-Cook/io_uring-Replace-0-length-array-with-flexible-array/20230105-114008
        git checkout 6239ffe2f8611e707b90e0c902bfa1f0dbe578bb
        # 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=arc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   In file included from include/linux/io_uring.h:7,
                    from kernel/fork.c:97:
>> include/uapi/linux/io_uring.h:628:41: error: flexible array member in union
     628 |                 struct io_uring_buf     bufs[];
         |                                         ^~~~
   kernel/fork.c:162:13: warning: no previous prototype for 'arch_release_task_struct' [-Wmissing-prototypes]
     162 | void __weak arch_release_task_struct(struct task_struct *tsk)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
   kernel/fork.c:862:20: warning: no previous prototype for 'arch_task_cache_init' [-Wmissing-prototypes]
     862 | void __init __weak arch_task_cache_init(void) { }
         |                    ^~~~~~~~~~~~~~~~~~~~
   kernel/fork.c:957:12: warning: no previous prototype for 'arch_dup_task_struct' [-Wmissing-prototypes]
     957 | int __weak arch_dup_task_struct(struct task_struct *dst,
         |            ^~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/io_uring.h:7,
                    from kernel/exit.c:67:
>> include/uapi/linux/io_uring.h:628:41: error: flexible array member in union
     628 |                 struct io_uring_buf     bufs[];
         |                                         ^~~~
   kernel/exit.c:1901:13: warning: no previous prototype for 'abort' [-Wmissing-prototypes]
    1901 | __weak void abort(void)
         |             ^~~~~
--
   In file included from include/linux/io_uring.h:7,
                    from fs/exec.c:64:
>> include/uapi/linux/io_uring.h:628:41: error: flexible array member in union
     628 |                 struct io_uring_buf     bufs[];
         |                                         ^~~~
--
   In file included from include/linux/io_uring.h:7,
                    from io_uring/io_uring.c:72:
>> include/uapi/linux/io_uring.h:628:41: error: flexible array member in union
     628 |                 struct io_uring_buf     bufs[];
         |                                         ^~~~
   io_uring/io_uring.c: In function '__io_submit_flush_completions':
   io_uring/io_uring.c:1443:40: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
    1443 |         struct io_wq_work_node *node, *prev;
         |                                        ^~~~
--
   In file included from include/linux/io_uring.h:7,
                    from io_uring/kbuf.c:10:
>> include/uapi/linux/io_uring.h:628:41: error: flexible array member in union
     628 |                 struct io_uring_buf     bufs[];
         |                                         ^~~~
   In file included from include/linux/container_of.h:5,
                    from include/linux/kernel.h:21,
                    from io_uring/kbuf.c:2:
   io_uring/kbuf.c: In function 'io_register_pbuf_ring':
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/compiler.h:232:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     232 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                                 ^~~~~~~~~~~~~~~~~
   include/linux/overflow.h:277:50: note: in expansion of macro '__must_be_array'
     277 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:293:32: note: in expansion of macro 'flex_array_size'
     293 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   io_uring/kbuf.c:508:30: note: in expansion of macro 'struct_size'
     508 |                              struct_size(br, bufs, reg.ring_entries),
         |                              ^~~~~~~~~~~
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/compiler.h:232:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     232 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                                 ^~~~~~~~~~~~~~~~~
   include/linux/overflow.h:278:56: note: in expansion of macro '__must_be_array'
     278 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:293:32: note: in expansion of macro 'flex_array_size'
     293 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   io_uring/kbuf.c:508:30: note: in expansion of macro 'struct_size'
     508 |                              struct_size(br, bufs, reg.ring_entries),
         |                              ^~~~~~~~~~~
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/compiler.h:232:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     232 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                                 ^~~~~~~~~~~~~~~~~
   include/linux/overflow.h:277:50: note: in expansion of macro '__must_be_array'
     277 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:294:40: note: in expansion of macro 'flex_array_size'
     294 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   io_uring/kbuf.c:508:30: note: in expansion of macro 'struct_size'
     508 |                              struct_size(br, bufs, reg.ring_entries),
         |                              ^~~~~~~~~~~
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/compiler.h:232:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     232 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                                 ^~~~~~~~~~~~~~~~~
   include/linux/overflow.h:278:56: note: in expansion of macro '__must_be_array'
     278 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:294:40: note: in expansion of macro 'flex_array_size'
     294 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   io_uring/kbuf.c:508:30: note: in expansion of macro 'struct_size'
     508 |                              struct_size(br, bufs, reg.ring_entries),
         |                              ^~~~~~~~~~~


vim +628 include/uapi/linux/io_uring.h

   615	
   616	struct io_uring_buf_ring {
   617		union {
   618			/*
   619			 * To avoid spilling into more pages than we need to, the
   620			 * ring tail is overlaid with the io_uring_buf->resv field.
   621			 */
   622			struct {
   623				__u64	resv1;
   624				__u32	resv2;
   625				__u16	resv3;
   626				__u16	tail;
   627			};
 > 628			struct io_uring_buf	bufs[];
   629		};
   630	};
   631	

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ