lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ACE55B66-3A0B-4990-B51D-57711E5E4E5F@amazon.com>
Date: Mon, 1 Sep 2025 15:08:09 +0000
From: "Faruqui, Aqib" <aqibaf@...zon.co.uk>
To: Sean Christopherson <seanjc@...gle.com>
CC: Paolo Bonzini <pbonzini@...hat.com>, Shuah Khan <shuah@...nel.org>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"nh-open-source@...zon.com" <nh-open-source@...zon.com>
Subject: Re: [PATCH 2/9] KVM: selftests: Add __packed attribute fallback

After investigating a little, looks like tools/include/linux/compiler.h already defines __packed correctly. While UAPI headers (e.g. linux/kvm.h) use __packed but don't include it themselves, the include ordering looks fine for this to be handled by the build system.

I'll drop this patch and investigate further why the tools infrastructure isn't working correctly in my setup.

Thanks for the feedback!

-- 
Aqib Faruqui 
Software Dev Intern (Embedded) | EC2 Accelerated Nitro | AWS 
+44 7763104413 




On 29/08/2025, 23:48, "Sean Christopherson" <seanjc@...gle.com <mailto:seanjc@...gle.com>> wrote:


CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.






On Fri, Aug 29, 2025, Aqib Faruqui wrote:
> Kernel UAPI headers use __packed but don't provide the definition in
> userspace builds.
>
> Add a fallback definition matching the kernel's implementation. This
> follows the same pattern used by BPF and SGX selftests.


Ugh. No, this needs to be fixed in a central location, not splattered all over
random subsystem selftests. My first choice would be to copy (and keep synchronize)
all of the include/linux/compiler*.h headers to tools/include/linux/.


If for some reason that's not a viable option, we should yank the __packed and
similar #defines out of tools/include/linux/compiler-gcc.h and place them in
tools/include/linux/compiler.h. AFAICT, none of them are actually GCC-only.


> Signed-off-by: Aqib Faruqui <aqibaf@...zon.com <mailto:aqibaf@...zon.com>>
> ---
> tools/testing/selftests/kvm/include/kvm_util.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
> index 23a506d7e..7fae7f5e7 100644
> --- a/tools/testing/selftests/kvm/include/kvm_util.h
> +++ b/tools/testing/selftests/kvm/include/kvm_util.h
> @@ -5,6 +5,10 @@
> #ifndef SELFTEST_KVM_UTIL_H
> #define SELFTEST_KVM_UTIL_H
>
> +#ifndef __packed
> +#define __packed __attribute__((__packed__))
> +#endif
> +
> #include "test_util.h"
>
> #include <linux/compiler.h>
> --
> 2.47.3
>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ