lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e0bef3a-6667-461a-80f9-791891e11d8d@lucifer.local>
Date: Thu, 17 Oct 2024 13:06:13 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Shuah Khan <skhan@...uxfoundation.org>
Cc: Christian Brauner <christian@...uner.io>, Shuah Khan <shuah@...nel.org>,
        "Liam R . Howlett" <Liam.Howlett@...cle.com>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Vlastimil Babka <vbabka@...e.cz>, pedro.falcato@...il.com,
        linux-kselftest@...r.kernel.org, linux-mm@...ck.org,
        linux-fsdevel@...r.kernel.org, linux-api@...r.kernel.org,
        linux-kernel@...r.kernel.org, Oliver Sang <oliver.sang@...el.com>,
        John Hubbard <jhubbard@...dia.com>
Subject: Re: [PATCH v3 3/3] selftests: pidfd: add tests for PIDFD_SELF_*

+cc John, sorry I forgot to cc you on other replies!!

On Thu, Oct 17, 2024 at 09:08:19AM +0100, Lorenzo Stoakes wrote:
[snip]
>
> In any case I think copying the header to the tools/ directory with this
> linux/fcntl.h in some way stubbed out (we could even stub out fcntl.h
> there?) is the sensible way forward.
>
> A 'just include the header' is simply not an option as it breaks the tests.

Ohhh ok I think maybe we could have a good compromise that should (hopefully!)
satisfy both you and John.

I can introduce tools/include/linux/pidfd.h that is a stub wrapper around
the pidfd.h file.

So it can be something like:


	#ifndef __TOOLS_LINUX_PIDFD_H
	#define __TOOLS_LINUX_PIDFD_H

	/*
	 * Some systems have issues with the linux/fcntl.h import in linux/pidfd.h, so
	 * work around this by setting the header guard.
	 */
	#define _LINUX_FCNTL_H
	#include "../../../include/uapi/linux/pidfd.h"
	#undef _LINUX_FCNTL_H

	#endif /* __TOOLS_LINUX_PIDFD_H */


Then the test code needs only to update the pidfd.h file to #include
<linux/pidfd.h> and add a simple $(TOOLS_INCLUDES) to the CFLAGS += line in
the pidfd self tests Makefile and we should be all good.

That way we always import everything in this header correctly, we directly
document this issue, we include the header as you would in userland and we
should cover off all the issues?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ