From: kernel test robot <lkp@intel.com>
To: Baoquan He <bhe@redhat.com>, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, akpm@linux-foundation.org,
kexec@lists.infradead.org, hbathini@linux.ibm.com, arnd@arndb.de,
ignat@cloudflare.com, eric_devolder@yahoo.com,
viro@zeniv.linux.org.uk, ebiederm@xmission.com, x86@kernel.org,
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
linux-fsdevel@vger.kernel.org, Baoquan He <bhe@redhat.com>
Subject: Re: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
Date: Sat, 6 Jan 2024 18:59:56 +0800 [thread overview]
Message-ID: <202401061800.3XPSaPsa-lkp@intel.com> (raw)
In-Reply-To: <20240105103305.557273-2-bhe@redhat.com>
Hi Baoquan,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.7-rc8]
[cannot apply to powerpc/next powerpc/fixes tip/x86/core arm64/for-next/core next-20240105]
[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/Baoquan-He/kexec_core-move-kdump-related-codes-from-crash_core-c-to-kexec_core-c/20240105-223735
base: linus/master
patch link: https://lore.kernel.org/r/20240105103305.557273-2-bhe%40redhat.com
patch subject: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
config: x86_64-randconfig-104-20240106 (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401061800.3XPSaPsa-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/string.h:11,
from include/linux/bitmap.h:12,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from arch/x86/kernel/crash.c:18:
arch/x86/kernel/crash.c: In function 'fill_up_crash_elf_data':
>> include/linux/overflow.h:293:23: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
293 | sizeof(*(p)) + flex_array_size(p, member, count), \
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
In file included from include/linux/container_of.h:5,
from include/linux/kernel.h:22,
from arch/x86/kernel/crash.c:17:
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:294:32: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
294 | size_add(sizeof(*(p)), flex_array_size(p, member, count)))
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> arch/x86/kernel/crash.c:158:13: error: invalid use of undefined type 'struct crash_mem'
158 | cmem->max_nr_ranges = nr_ranges;
| ^~
arch/x86/kernel/crash.c:159:13: error: invalid use of undefined type 'struct crash_mem'
159 | cmem->nr_ranges = 0;
| ^~
arch/x86/kernel/crash.c: In function 'elf_header_exclude_ranges':
>> arch/x86/kernel/crash.c:173:15: error: implicit declaration of function 'crash_exclude_mem_range' [-Werror=implicit-function-declaration]
173 | ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1);
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/crash.c: In function 'prepare_elf64_ram_headers_callback':
arch/x86/kernel/crash.c:193:13: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:193:26: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:194:13: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:194:26: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:195:13: error: invalid use of undefined type 'struct crash_mem'
195 | cmem->nr_ranges++;
| ^~
arch/x86/kernel/crash.c: In function 'prepare_elf_headers':
arch/x86/kernel/crash.c:221:30: error: invalid use of undefined type 'struct crash_mem'
221 | *nr_mem_ranges = cmem->nr_ranges;
| ^~
>> arch/x86/kernel/crash.c:224:16: error: implicit declaration of function 'crash_prepare_elf64_headers'; did you mean 'prepare_elf_headers'? [-Werror=implicit-function-declaration]
224 | ret = crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| prepare_elf_headers
cc1: some warnings being treated as errors
vim +293 include/linux/overflow.h
610b15c50e86eb Kees Cook 2018-05-07 262
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 263 /**
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 264 * flex_array_size() - Calculate size of a flexible array member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 265 * within an enclosing structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 266 * @p: Pointer to the structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 267 * @member: Name of the flexible array member.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 268 * @count: Number of elements in the array.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 269 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 270 * Calculates size of a flexible array of @count number of @member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 271 * elements, at the end of structure @p.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 272 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 273 * Return: number of bytes needed or SIZE_MAX on overflow.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 274 */
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 275 #define flex_array_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 276 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @277 (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
230f6fa2c1db6a Kees Cook 2022-02-09 278 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 279
e1be43d9b5d0d1 Kees Cook 2021-09-18 280 /**
e1be43d9b5d0d1 Kees Cook 2021-09-18 281 * struct_size() - Calculate size of structure with trailing flexible array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 282 * @p: Pointer to the structure.
e1be43d9b5d0d1 Kees Cook 2021-09-18 283 * @member: Name of the array member.
e1be43d9b5d0d1 Kees Cook 2021-09-18 284 * @count: Number of elements in the array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 285 *
d67790ddf0219a Kees Cook 2023-05-22 286 * Calculates size of memory needed for structure of @p followed by an
e1be43d9b5d0d1 Kees Cook 2021-09-18 287 * array of @count number of @member elements.
e1be43d9b5d0d1 Kees Cook 2021-09-18 288 *
e1be43d9b5d0d1 Kees Cook 2021-09-18 289 * Return: number of bytes needed or SIZE_MAX on overflow.
e1be43d9b5d0d1 Kees Cook 2021-09-18 290 */
e1be43d9b5d0d1 Kees Cook 2021-09-18 291 #define struct_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 292 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @293 sizeof(*(p)) + flex_array_size(p, member, count), \
230f6fa2c1db6a Kees Cook 2022-02-09 294 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
e1be43d9b5d0d1 Kees Cook 2021-09-18 295
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Baoquan He <bhe@redhat.com>, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, akpm@linux-foundation.org,
kexec@lists.infradead.org, hbathini@linux.ibm.com, arnd@arndb.de,
ignat@cloudflare.com, eric_devolder@yahoo.com,
viro@zeniv.linux.org.uk, ebiederm@xmission.com, x86@kernel.org,
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
linux-fsdevel@vger.kernel.org, Baoquan He <bhe@redhat.com>
Subject: Re: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
Date: Sat, 6 Jan 2024 18:59:56 +0800 [thread overview]
Message-ID: <202401061800.3XPSaPsa-lkp@intel.com> (raw)
In-Reply-To: <20240105103305.557273-2-bhe@redhat.com>
Hi Baoquan,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.7-rc8]
[cannot apply to powerpc/next powerpc/fixes tip/x86/core arm64/for-next/core next-20240105]
[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/Baoquan-He/kexec_core-move-kdump-related-codes-from-crash_core-c-to-kexec_core-c/20240105-223735
base: linus/master
patch link: https://lore.kernel.org/r/20240105103305.557273-2-bhe%40redhat.com
patch subject: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
config: x86_64-randconfig-104-20240106 (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401061800.3XPSaPsa-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/string.h:11,
from include/linux/bitmap.h:12,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from arch/x86/kernel/crash.c:18:
arch/x86/kernel/crash.c: In function 'fill_up_crash_elf_data':
>> include/linux/overflow.h:293:23: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
293 | sizeof(*(p)) + flex_array_size(p, member, count), \
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
In file included from include/linux/container_of.h:5,
from include/linux/kernel.h:22,
from arch/x86/kernel/crash.c:17:
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:294:32: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
294 | size_add(sizeof(*(p)), flex_array_size(p, member, count)))
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> arch/x86/kernel/crash.c:158:13: error: invalid use of undefined type 'struct crash_mem'
158 | cmem->max_nr_ranges = nr_ranges;
| ^~
arch/x86/kernel/crash.c:159:13: error: invalid use of undefined type 'struct crash_mem'
159 | cmem->nr_ranges = 0;
| ^~
arch/x86/kernel/crash.c: In function 'elf_header_exclude_ranges':
>> arch/x86/kernel/crash.c:173:15: error: implicit declaration of function 'crash_exclude_mem_range' [-Werror=implicit-function-declaration]
173 | ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1);
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/crash.c: In function 'prepare_elf64_ram_headers_callback':
arch/x86/kernel/crash.c:193:13: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:193:26: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:194:13: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:194:26: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:195:13: error: invalid use of undefined type 'struct crash_mem'
195 | cmem->nr_ranges++;
| ^~
arch/x86/kernel/crash.c: In function 'prepare_elf_headers':
arch/x86/kernel/crash.c:221:30: error: invalid use of undefined type 'struct crash_mem'
221 | *nr_mem_ranges = cmem->nr_ranges;
| ^~
>> arch/x86/kernel/crash.c:224:16: error: implicit declaration of function 'crash_prepare_elf64_headers'; did you mean 'prepare_elf_headers'? [-Werror=implicit-function-declaration]
224 | ret = crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| prepare_elf_headers
cc1: some warnings being treated as errors
vim +293 include/linux/overflow.h
610b15c50e86eb Kees Cook 2018-05-07 262
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 263 /**
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 264 * flex_array_size() - Calculate size of a flexible array member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 265 * within an enclosing structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 266 * @p: Pointer to the structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 267 * @member: Name of the flexible array member.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 268 * @count: Number of elements in the array.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 269 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 270 * Calculates size of a flexible array of @count number of @member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 271 * elements, at the end of structure @p.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 272 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 273 * Return: number of bytes needed or SIZE_MAX on overflow.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 274 */
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 275 #define flex_array_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 276 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @277 (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
230f6fa2c1db6a Kees Cook 2022-02-09 278 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 279
e1be43d9b5d0d1 Kees Cook 2021-09-18 280 /**
e1be43d9b5d0d1 Kees Cook 2021-09-18 281 * struct_size() - Calculate size of structure with trailing flexible array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 282 * @p: Pointer to the structure.
e1be43d9b5d0d1 Kees Cook 2021-09-18 283 * @member: Name of the array member.
e1be43d9b5d0d1 Kees Cook 2021-09-18 284 * @count: Number of elements in the array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 285 *
d67790ddf0219a Kees Cook 2023-05-22 286 * Calculates size of memory needed for structure of @p followed by an
e1be43d9b5d0d1 Kees Cook 2021-09-18 287 * array of @count number of @member elements.
e1be43d9b5d0d1 Kees Cook 2021-09-18 288 *
e1be43d9b5d0d1 Kees Cook 2021-09-18 289 * Return: number of bytes needed or SIZE_MAX on overflow.
e1be43d9b5d0d1 Kees Cook 2021-09-18 290 */
e1be43d9b5d0d1 Kees Cook 2021-09-18 291 #define struct_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 292 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @293 sizeof(*(p)) + flex_array_size(p, member, count), \
230f6fa2c1db6a Kees Cook 2022-02-09 294 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
e1be43d9b5d0d1 Kees Cook 2021-09-18 295
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Baoquan He <bhe@redhat.com>, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, akpm@linux-foundation.org,
kexec@lists.infradead.org, hbathini@linux.ibm.com, arnd@arndb.de,
ignat@cloudflare.com, eric_devolder@yahoo.com,
viro@zeniv.linux.org.uk, ebiederm@xmission.com, x86@kernel.org,
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
linux-fsdevel@vger.kernel.org, Baoquan He <bhe@redhat.com>
Subject: Re: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
Date: Sat, 6 Jan 2024 18:59:56 +0800 [thread overview]
Message-ID: <202401061800.3XPSaPsa-lkp@intel.com> (raw)
In-Reply-To: <20240105103305.557273-2-bhe@redhat.com>
Hi Baoquan,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.7-rc8]
[cannot apply to powerpc/next powerpc/fixes tip/x86/core arm64/for-next/core next-20240105]
[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/Baoquan-He/kexec_core-move-kdump-related-codes-from-crash_core-c-to-kexec_core-c/20240105-223735
base: linus/master
patch link: https://lore.kernel.org/r/20240105103305.557273-2-bhe%40redhat.com
patch subject: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
config: x86_64-randconfig-104-20240106 (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401061800.3XPSaPsa-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/string.h:11,
from include/linux/bitmap.h:12,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from arch/x86/kernel/crash.c:18:
arch/x86/kernel/crash.c: In function 'fill_up_crash_elf_data':
>> include/linux/overflow.h:293:23: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
293 | sizeof(*(p)) + flex_array_size(p, member, count), \
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
In file included from include/linux/container_of.h:5,
from include/linux/kernel.h:22,
from arch/x86/kernel/crash.c:17:
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:294:32: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
294 | size_add(sizeof(*(p)), flex_array_size(p, member, count)))
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> arch/x86/kernel/crash.c:158:13: error: invalid use of undefined type 'struct crash_mem'
158 | cmem->max_nr_ranges = nr_ranges;
| ^~
arch/x86/kernel/crash.c:159:13: error: invalid use of undefined type 'struct crash_mem'
159 | cmem->nr_ranges = 0;
| ^~
arch/x86/kernel/crash.c: In function 'elf_header_exclude_ranges':
>> arch/x86/kernel/crash.c:173:15: error: implicit declaration of function 'crash_exclude_mem_range' [-Werror=implicit-function-declaration]
173 | ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1);
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/crash.c: In function 'prepare_elf64_ram_headers_callback':
arch/x86/kernel/crash.c:193:13: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:193:26: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:194:13: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:194:26: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:195:13: error: invalid use of undefined type 'struct crash_mem'
195 | cmem->nr_ranges++;
| ^~
arch/x86/kernel/crash.c: In function 'prepare_elf_headers':
arch/x86/kernel/crash.c:221:30: error: invalid use of undefined type 'struct crash_mem'
221 | *nr_mem_ranges = cmem->nr_ranges;
| ^~
>> arch/x86/kernel/crash.c:224:16: error: implicit declaration of function 'crash_prepare_elf64_headers'; did you mean 'prepare_elf_headers'? [-Werror=implicit-function-declaration]
224 | ret = crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| prepare_elf_headers
cc1: some warnings being treated as errors
vim +293 include/linux/overflow.h
610b15c50e86eb Kees Cook 2018-05-07 262
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 263 /**
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 264 * flex_array_size() - Calculate size of a flexible array member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 265 * within an enclosing structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 266 * @p: Pointer to the structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 267 * @member: Name of the flexible array member.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 268 * @count: Number of elements in the array.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 269 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 270 * Calculates size of a flexible array of @count number of @member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 271 * elements, at the end of structure @p.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 272 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 273 * Return: number of bytes needed or SIZE_MAX on overflow.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 274 */
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 275 #define flex_array_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 276 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @277 (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
230f6fa2c1db6a Kees Cook 2022-02-09 278 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 279
e1be43d9b5d0d1 Kees Cook 2021-09-18 280 /**
e1be43d9b5d0d1 Kees Cook 2021-09-18 281 * struct_size() - Calculate size of structure with trailing flexible array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 282 * @p: Pointer to the structure.
e1be43d9b5d0d1 Kees Cook 2021-09-18 283 * @member: Name of the array member.
e1be43d9b5d0d1 Kees Cook 2021-09-18 284 * @count: Number of elements in the array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 285 *
d67790ddf0219a Kees Cook 2023-05-22 286 * Calculates size of memory needed for structure of @p followed by an
e1be43d9b5d0d1 Kees Cook 2021-09-18 287 * array of @count number of @member elements.
e1be43d9b5d0d1 Kees Cook 2021-09-18 288 *
e1be43d9b5d0d1 Kees Cook 2021-09-18 289 * Return: number of bytes needed or SIZE_MAX on overflow.
e1be43d9b5d0d1 Kees Cook 2021-09-18 290 */
e1be43d9b5d0d1 Kees Cook 2021-09-18 291 #define struct_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 292 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @293 sizeof(*(p)) + flex_array_size(p, member, count), \
230f6fa2c1db6a Kees Cook 2022-02-09 294 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
e1be43d9b5d0d1 Kees Cook 2021-09-18 295
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Baoquan He <bhe@redhat.com>, linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, x86@kernel.org,
Baoquan He <bhe@redhat.com>,
arnd@arndb.de, oe-kbuild-all@lists.linux.dev,
kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org,
viro@zeniv.linux.org.uk, ignat@cloudflare.com,
eric_devolder@yahoo.com, akpm@linux-foundation.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
hbathini@linux.ibm.com, ebiederm@xmission.com
Subject: Re: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
Date: Sat, 6 Jan 2024 18:59:56 +0800 [thread overview]
Message-ID: <202401061800.3XPSaPsa-lkp@intel.com> (raw)
In-Reply-To: <20240105103305.557273-2-bhe@redhat.com>
Hi Baoquan,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.7-rc8]
[cannot apply to powerpc/next powerpc/fixes tip/x86/core arm64/for-next/core next-20240105]
[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/Baoquan-He/kexec_core-move-kdump-related-codes-from-crash_core-c-to-kexec_core-c/20240105-223735
base: linus/master
patch link: https://lore.kernel.org/r/20240105103305.557273-2-bhe%40redhat.com
patch subject: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
config: x86_64-randconfig-104-20240106 (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401061800.3XPSaPsa-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/string.h:11,
from include/linux/bitmap.h:12,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from arch/x86/kernel/crash.c:18:
arch/x86/kernel/crash.c: In function 'fill_up_crash_elf_data':
>> include/linux/overflow.h:293:23: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
293 | sizeof(*(p)) + flex_array_size(p, member, count), \
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
In file included from include/linux/container_of.h:5,
from include/linux/kernel.h:22,
from arch/x86/kernel/crash.c:17:
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:294:32: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
294 | size_add(sizeof(*(p)), flex_array_size(p, member, count)))
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> arch/x86/kernel/crash.c:158:13: error: invalid use of undefined type 'struct crash_mem'
158 | cmem->max_nr_ranges = nr_ranges;
| ^~
arch/x86/kernel/crash.c:159:13: error: invalid use of undefined type 'struct crash_mem'
159 | cmem->nr_ranges = 0;
| ^~
arch/x86/kernel/crash.c: In function 'elf_header_exclude_ranges':
>> arch/x86/kernel/crash.c:173:15: error: implicit declaration of function 'crash_exclude_mem_range' [-Werror=implicit-function-declaration]
173 | ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1);
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/crash.c: In function 'prepare_elf64_ram_headers_callback':
arch/x86/kernel/crash.c:193:13: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:193:26: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:194:13: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:194:26: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:195:13: error: invalid use of undefined type 'struct crash_mem'
195 | cmem->nr_ranges++;
| ^~
arch/x86/kernel/crash.c: In function 'prepare_elf_headers':
arch/x86/kernel/crash.c:221:30: error: invalid use of undefined type 'struct crash_mem'
221 | *nr_mem_ranges = cmem->nr_ranges;
| ^~
>> arch/x86/kernel/crash.c:224:16: error: implicit declaration of function 'crash_prepare_elf64_headers'; did you mean 'prepare_elf_headers'? [-Werror=implicit-function-declaration]
224 | ret = crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| prepare_elf_headers
cc1: some warnings being treated as errors
vim +293 include/linux/overflow.h
610b15c50e86eb Kees Cook 2018-05-07 262
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 263 /**
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 264 * flex_array_size() - Calculate size of a flexible array member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 265 * within an enclosing structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 266 * @p: Pointer to the structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 267 * @member: Name of the flexible array member.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 268 * @count: Number of elements in the array.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 269 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 270 * Calculates size of a flexible array of @count number of @member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 271 * elements, at the end of structure @p.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 272 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 273 * Return: number of bytes needed or SIZE_MAX on overflow.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 274 */
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 275 #define flex_array_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 276 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @277 (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
230f6fa2c1db6a Kees Cook 2022-02-09 278 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 279
e1be43d9b5d0d1 Kees Cook 2021-09-18 280 /**
e1be43d9b5d0d1 Kees Cook 2021-09-18 281 * struct_size() - Calculate size of structure with trailing flexible array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 282 * @p: Pointer to the structure.
e1be43d9b5d0d1 Kees Cook 2021-09-18 283 * @member: Name of the array member.
e1be43d9b5d0d1 Kees Cook 2021-09-18 284 * @count: Number of elements in the array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 285 *
d67790ddf0219a Kees Cook 2023-05-22 286 * Calculates size of memory needed for structure of @p followed by an
e1be43d9b5d0d1 Kees Cook 2021-09-18 287 * array of @count number of @member elements.
e1be43d9b5d0d1 Kees Cook 2021-09-18 288 *
e1be43d9b5d0d1 Kees Cook 2021-09-18 289 * Return: number of bytes needed or SIZE_MAX on overflow.
e1be43d9b5d0d1 Kees Cook 2021-09-18 290 */
e1be43d9b5d0d1 Kees Cook 2021-09-18 291 #define struct_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 292 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @293 sizeof(*(p)) + flex_array_size(p, member, count), \
230f6fa2c1db6a Kees Cook 2022-02-09 294 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
e1be43d9b5d0d1 Kees Cook 2021-09-18 295
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Baoquan He <bhe@redhat.com>, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, akpm@linux-foundation.org,
kexec@lists.infradead.org, hbathini@linux.ibm.com, arnd@arndb.de,
ignat@cloudflare.com, eric_devolder@yahoo.com,
viro@zeniv.linux.org.uk, ebiederm@xmission.com, x86@kernel.org,
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
linux-fsdevel@vger.kernel.org, Baoquan He <bhe@redhat.com>
Subject: Re: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
Date: Sat, 6 Jan 2024 18:59:56 +0800 [thread overview]
Message-ID: <202401061800.3XPSaPsa-lkp@intel.com> (raw)
In-Reply-To: <20240105103305.557273-2-bhe@redhat.com>
Hi Baoquan,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.7-rc8]
[cannot apply to powerpc/next powerpc/fixes tip/x86/core arm64/for-next/core next-20240105]
[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/Baoquan-He/kexec_core-move-kdump-related-codes-from-crash_core-c-to-kexec_core-c/20240105-223735
base: linus/master
patch link: https://lore.kernel.org/r/20240105103305.557273-2-bhe%40redhat.com
patch subject: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
config: x86_64-randconfig-104-20240106 (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240106/202401061800.3XPSaPsa-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401061800.3XPSaPsa-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/string.h:11,
from include/linux/bitmap.h:12,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from arch/x86/kernel/crash.c:18:
arch/x86/kernel/crash.c: In function 'fill_up_crash_elf_data':
>> include/linux/overflow.h:293:23: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
293 | sizeof(*(p)) + flex_array_size(p, member, count), \
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
In file included from include/linux/container_of.h:5,
from include/linux/kernel.h:22,
from arch/x86/kernel/crash.c:17:
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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), \
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:294:32: error: invalid application of 'sizeof' to incomplete type 'struct crash_mem'
294 | size_add(sizeof(*(p)), flex_array_size(p, member, count)))
| ^
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> include/linux/overflow.h:277:38: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:277:69: error: invalid use of undefined type 'struct crash_mem'
277 | (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:44: error: invalid use of undefined type 'struct crash_mem'
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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
include/linux/overflow.h:278:75: error: invalid use of undefined type 'struct crash_mem'
278 | size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
| ^~
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/compiler.h:228:51: note: in expansion of macro '__same_type'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
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:228:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
228 | #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)))
| ^~~~~~~~~~~~~~~
arch/x86/kernel/crash.c:154:24: note: in expansion of macro 'struct_size'
154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
| ^~~~~~~~~~~
>> arch/x86/kernel/crash.c:158:13: error: invalid use of undefined type 'struct crash_mem'
158 | cmem->max_nr_ranges = nr_ranges;
| ^~
arch/x86/kernel/crash.c:159:13: error: invalid use of undefined type 'struct crash_mem'
159 | cmem->nr_ranges = 0;
| ^~
arch/x86/kernel/crash.c: In function 'elf_header_exclude_ranges':
>> arch/x86/kernel/crash.c:173:15: error: implicit declaration of function 'crash_exclude_mem_range' [-Werror=implicit-function-declaration]
173 | ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1);
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/crash.c: In function 'prepare_elf64_ram_headers_callback':
arch/x86/kernel/crash.c:193:13: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:193:26: error: invalid use of undefined type 'struct crash_mem'
193 | cmem->ranges[cmem->nr_ranges].start = res->start;
| ^~
arch/x86/kernel/crash.c:194:13: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:194:26: error: invalid use of undefined type 'struct crash_mem'
194 | cmem->ranges[cmem->nr_ranges].end = res->end;
| ^~
arch/x86/kernel/crash.c:195:13: error: invalid use of undefined type 'struct crash_mem'
195 | cmem->nr_ranges++;
| ^~
arch/x86/kernel/crash.c: In function 'prepare_elf_headers':
arch/x86/kernel/crash.c:221:30: error: invalid use of undefined type 'struct crash_mem'
221 | *nr_mem_ranges = cmem->nr_ranges;
| ^~
>> arch/x86/kernel/crash.c:224:16: error: implicit declaration of function 'crash_prepare_elf64_headers'; did you mean 'prepare_elf_headers'? [-Werror=implicit-function-declaration]
224 | ret = crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| prepare_elf_headers
cc1: some warnings being treated as errors
vim +293 include/linux/overflow.h
610b15c50e86eb Kees Cook 2018-05-07 262
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 263 /**
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 264 * flex_array_size() - Calculate size of a flexible array member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 265 * within an enclosing structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 266 * @p: Pointer to the structure.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 267 * @member: Name of the flexible array member.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 268 * @count: Number of elements in the array.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 269 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 270 * Calculates size of a flexible array of @count number of @member
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 271 * elements, at the end of structure @p.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 272 *
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 273 * Return: number of bytes needed or SIZE_MAX on overflow.
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 274 */
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 275 #define flex_array_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 276 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @277 (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
230f6fa2c1db6a Kees Cook 2022-02-09 278 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
b19d57d0f3cc6f Gustavo A. R. Silva 2020-06-08 279
e1be43d9b5d0d1 Kees Cook 2021-09-18 280 /**
e1be43d9b5d0d1 Kees Cook 2021-09-18 281 * struct_size() - Calculate size of structure with trailing flexible array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 282 * @p: Pointer to the structure.
e1be43d9b5d0d1 Kees Cook 2021-09-18 283 * @member: Name of the array member.
e1be43d9b5d0d1 Kees Cook 2021-09-18 284 * @count: Number of elements in the array.
e1be43d9b5d0d1 Kees Cook 2021-09-18 285 *
d67790ddf0219a Kees Cook 2023-05-22 286 * Calculates size of memory needed for structure of @p followed by an
e1be43d9b5d0d1 Kees Cook 2021-09-18 287 * array of @count number of @member elements.
e1be43d9b5d0d1 Kees Cook 2021-09-18 288 *
e1be43d9b5d0d1 Kees Cook 2021-09-18 289 * Return: number of bytes needed or SIZE_MAX on overflow.
e1be43d9b5d0d1 Kees Cook 2021-09-18 290 */
e1be43d9b5d0d1 Kees Cook 2021-09-18 291 #define struct_size(p, member, count) \
230f6fa2c1db6a Kees Cook 2022-02-09 292 __builtin_choose_expr(__is_constexpr(count), \
230f6fa2c1db6a Kees Cook 2022-02-09 @293 sizeof(*(p)) + flex_array_size(p, member, count), \
230f6fa2c1db6a Kees Cook 2022-02-09 294 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
e1be43d9b5d0d1 Kees Cook 2021-09-18 295
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-01-06 11:01 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-05 10:33 [PATCH 0/5] crash: clean up kdump related config items Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-06 10:59 ` kernel test robot [this message]
2024-01-06 10:59 ` kernel test robot
2024-01-06 10:59 ` kernel test robot
2024-01-06 10:59 ` kernel test robot
2024-01-06 10:59 ` kernel test robot
2024-01-07 13:58 ` Baoquan He
2024-01-07 13:58 ` Baoquan He
2024-01-07 13:58 ` Baoquan He
2024-01-07 13:58 ` Baoquan He
2024-01-07 13:58 ` Baoquan He
2024-01-06 14:58 ` kernel test robot
2024-01-06 14:58 ` kernel test robot
2024-01-06 14:58 ` kernel test robot
2024-01-06 14:58 ` kernel test robot
2024-01-06 14:58 ` kernel test robot
2024-01-07 8:52 ` Baoquan He
2024-01-07 8:52 ` Baoquan He
2024-01-07 8:52 ` Baoquan He
2024-01-07 8:52 ` Baoquan He
2024-01-07 8:52 ` Baoquan He
2024-01-05 10:33 ` [PATCH 2/5] kexec: split crashkernel reservation code out from crash_core.c Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` [PATCH 3/5] crash: rename crash_core to vmcore_info Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` [PATCH 4/5] crash: remove dependency of FA_DUMP on CRASH_DUMP Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` [PATCH 5/5] crash: clean up CRASH_DUMP Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-05 10:33 ` Baoquan He
2024-01-07 13:19 ` kernel test robot
2024-01-07 13:19 ` kernel test robot
2024-01-07 13:19 ` kernel test robot
2024-01-07 13:19 ` kernel test robot
2024-01-07 13:19 ` kernel test robot
2024-01-09 3:49 ` Baoquan He
2024-01-09 3:49 ` Baoquan He
2024-01-09 3:49 ` Baoquan He
2024-01-09 3:49 ` Baoquan He
2024-01-09 3:49 ` Baoquan He
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202401061800.3XPSaPsa-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bhe@redhat.com \
--cc=ebiederm@xmission.com \
--cc=eric_devolder@yahoo.com \
--cc=hbathini@linux.ibm.com \
--cc=ignat@cloudflare.com \
--cc=kexec@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=viro@zeniv.linux.org.uk \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.