lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f40160aa-7cbd-4264-be44-45396b09574f@embeddedor.com>
Date: Thu, 1 Aug 2024 14:17:50 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: kernel test robot <lkp@...el.com>,
 "Gustavo A. R. Silva" <gustavoars@...nel.org>, llvm@...ts.linux.dev,
 oe-kbuild-all@...ts.linux.dev, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [gustavoars:testing/wfamnae-next20240729-cbc-2 11/18]
 include/rdma/uverbs_ioctl.h:643:15: error: static assertion failed due to
 requirement '__builtin_offsetof(struct uverbs_attr_bundle, attrs) ==
 sizeof(struct uverbs_attr_bundle_hdr)': struct member likely outside of
 struct_group_tagged()



On 01/08/24 13:08, Nathan Chancellor wrote:
> On Thu, Aug 01, 2024 at 06:47:58AM -0600, Gustavo A. R. Silva wrote:
>>
>>
>> On 01/08/24 05:35, kernel test robot wrote:
>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/wfamnae-next20240729-cbc-2
>>> head:   df15c862c1b93b6e1f6c90b0d7971f7a6ad66751
>>> commit: e7cd9f429a852fb7e37a706c7d08fc36e7863e06 [11/18] RDMA/uverbs: Use static_assert() to check struct sizes
>>> config: hexagon-randconfig-001-20240801 (https://download.01.org/0day-ci/archive/20240801/202408011956.wscyBwq6-lkp@intel.com/config)
>>> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 430b90f04533b099d788db2668176038be38c53b)
>>
>>
>> Clang 20.0.0?? (thinkingface)
> 
> Indeed, Clang 19 branched and main is now 20 :)
> 
> https://github.com/llvm/llvm-project/commit/8f701b5df0adb3a2960d78ca2ad9cf53f39ba2fe

Yeah, but is that a stable release?

BTW, I don't see GCC reporting the same problem below:

>>>>> include/rdma/uverbs_ioctl.h:643:15: error: static assertion failed due to requirement '__builtin_offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr)': struct member likely outside of struct_group_tagged()
>>>        643 | static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr),
>>>            | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>        644 |               "struct member likely outside of struct_group_tagged()");
>>>            |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>      include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
>>>         16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
>>>            |                                 ^
>>>      include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
>>>         77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
>>>            |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>      include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
>>>         78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
>>>            |                                                        ^~~~
>>>      include/rdma/uverbs_ioctl.h:643:58: note: expression evaluates to '56 == 52'
>>>        643 | static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr),
>>>            | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>        644 |               "struct member likely outside of struct_group_tagged()");
>>>            |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>      include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
>>>         77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
>>>            |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>      include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
>>>         78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
>>>            |                                                        ^~~~
>>>      7 warnings and 1 error generated.
>>>
>>>
>>> vim +643 include/rdma/uverbs_ioctl.h
>>>
>>>      630	
>>>      631	struct uverbs_attr_bundle {
>>>      632		/* New members MUST be added within the struct_group() macro below. */
>>>      633		struct_group_tagged(uverbs_attr_bundle_hdr, hdr,
>>>      634			struct ib_udata driver_udata;
>>>      635			struct ib_udata ucore;
>>>      636			struct ib_uverbs_file *ufile;
>>>      637			struct ib_ucontext *context;
>>>      638			struct ib_uobject *uobject;
>>>      639			DECLARE_BITMAP(attr_present, UVERBS_API_ATTR_BKEY_LEN);
>>>      640		);
>>>      641		struct uverbs_attr attrs[];
>>>      642	};
>>>    > 643	static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr),
>>>      644		      "struct member likely outside of struct_group_tagged()");
>>>      645	
>>>
>>

Thanks
--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ