Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [RFC PATCH 5/9] Define user structure for events and responses.
       [not found] <cde6bbf0b52710b33170f2787fdcb11538e40813.1741047969.git.m@maowtm.org>
@ 2025-03-05  4:13 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-03-05  4:13 UTC (permalink / raw)
  To: Tingmao Wang; +Cc: llvm, oe-kbuild-all

Hi Tingmao,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.14-rc5 next-20250304]
[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/Tingmao-Wang/Define-the-supervisor-and-event-structure/20250304-092354
base:   linus/master
patch link:    https://lore.kernel.org/r/cde6bbf0b52710b33170f2787fdcb11538e40813.1741047969.git.m%40maowtm.org
patch subject: [RFC PATCH 5/9] Define user structure for events and responses.
config: i386-buildonly-randconfig-003-20250305 (https://download.01.org/0day-ci/archive/20250305/202503051149.MimDe0ds-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250305/202503051149.MimDe0ds-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/202503051149.MimDe0ds-lkp@intel.com/

All errors (new ones prefixed by >>):

>> security/landlock/syscalls.c:137:2: error: call to '__compiletime_assert_358' declared with 'error' attribute: BUILD_BUG_ON failed: __alignof__(typeof(*event)) != 8
     137 |         BUILD_BUG_ON(__alignof__(typeof(*event)) != 8);
         |         ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
      50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
         |         ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^
   include/linux/compiler_types.h:542:2: note: expanded from macro 'compiletime_assert'
     542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^
   include/linux/compiler_types.h:530:2: note: expanded from macro '_compiletime_assert'
     530 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ^
   include/linux/compiler_types.h:523:4: note: expanded from macro '__compiletime_assert'
     523 |                         prefix ## suffix();                             \
         |                         ^
   <scratch space>:137:1: note: expanded from here
     137 | __compiletime_assert_358
         | ^
   1 error generated.


vim +137 security/landlock/syscalls.c

    82	
    83	/*
    84	 * This function only contains arithmetic operations with constants, leading to
    85	 * BUILD_BUG_ON().  The related code is evaluated and checked at build time,
    86	 * but it is then ignored thanks to compiler optimizations.
    87	 */
    88	static void build_check_abi(void)
    89	{
    90		struct landlock_ruleset_attr ruleset_attr;
    91		struct landlock_path_beneath_attr path_beneath_attr;
    92		struct landlock_net_port_attr net_port_attr;
    93		size_t ruleset_size, path_beneath_size, net_port_size;
    94		struct landlock_supervise_event *event;
    95		struct landlock_supervise_response response;
    96		size_t supervise_evt_size, supervise_response_size;
    97	
    98		/*
    99		 * For each user space ABI structures, first checks that there is no
   100		 * hole in them, then checks that all architectures have the same
   101		 * struct size.
   102		 */
   103		ruleset_size = sizeof(ruleset_attr.handled_access_fs);
   104		ruleset_size += sizeof(ruleset_attr.handled_access_net);
   105		ruleset_size += sizeof(ruleset_attr.scoped);
   106		ruleset_size += sizeof(ruleset_attr.supervisor_fd);
   107		ruleset_size += sizeof(ruleset_attr.pad);
   108		BUILD_BUG_ON(sizeof(ruleset_attr) != ruleset_size);
   109		BUILD_BUG_ON(sizeof(ruleset_attr) != 32);
   110	
   111		path_beneath_size = sizeof(path_beneath_attr.allowed_access);
   112		path_beneath_size += sizeof(path_beneath_attr.parent_fd);
   113		BUILD_BUG_ON(sizeof(path_beneath_attr) != path_beneath_size);
   114		BUILD_BUG_ON(sizeof(path_beneath_attr) != 12);
   115	
   116		net_port_size = sizeof(net_port_attr.allowed_access);
   117		net_port_size += sizeof(net_port_attr.port);
   118		BUILD_BUG_ON(sizeof(net_port_attr) != net_port_size);
   119		BUILD_BUG_ON(sizeof(net_port_attr) != 16);
   120	
   121		/* Check that anything before the destname does not have holes */
   122		supervise_evt_size = sizeof(event->hdr.type);
   123		supervise_evt_size += sizeof(event->hdr.length);
   124		supervise_evt_size += sizeof(event->hdr.cookie);
   125		BUILD_BUG_ON(offsetofend(typeof(*event), hdr) != 8);
   126		supervise_evt_size += sizeof(event->access_request);
   127		supervise_evt_size += sizeof(event->accessor);
   128		supervise_evt_size += sizeof(event->fd1);
   129		supervise_evt_size += sizeof(event->fd2);
   130		BUILD_BUG_ON(offsetof(typeof(*event), destname) != supervise_evt_size);
   131		BUILD_BUG_ON(offsetof(typeof(*event), destname) != 28);
   132	
   133		/*
   134		 * Make sure this struct does not end up with stricter
   135		 * alignment than 8
   136		 */
 > 137		BUILD_BUG_ON(__alignof__(typeof(*event)) != 8);
   138	
   139		supervise_response_size = sizeof(response.length);
   140		supervise_response_size += sizeof(response.decision);
   141		supervise_response_size += sizeof(response._reserved);
   142		supervise_response_size += sizeof(response.cookie);
   143		BUILD_BUG_ON(sizeof(response) != supervise_response_size);
   144		BUILD_BUG_ON(sizeof(response) != 8);
   145	}
   146	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-05  4:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cde6bbf0b52710b33170f2787fdcb11538e40813.1741047969.git.m@maowtm.org>
2025-03-05  4:13 ` [RFC PATCH 5/9] Define user structure for events and responses kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox