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: <CAMp3bLW_NwMZ7DTErUHMmzEfz4M6r0PkU=w2WzptGzhmW2FmaQ@mail.gmail.com>
Date: Wed, 29 Jan 2025 23:54:11 +0530
From: Purva Yeshi <purvayeshi550@...il.com>
To: Christophe Leroy <christophe.leroy@...roup.eu>, skhan@...uxfoundation.org
Cc: shuah@...nel.org, Jason@...c4.com, liaoyu15@...wei.com, broonie@...nel.org, 
	linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests/vDSO: Fix undefined CLONE_NEWTIME by including

On 27/01/25 13:32, Christophe Leroy wrote:
>
>
> Le 26/01/2025 à 11:59, Purva Yeshi a écrit :
>> [Vous ne recevez pas souvent de courriers de purvayeshi550@...il.com.
>> Découvrez pourquoi ceci est important à
>> https://aka.ms/LearnAboutSenderIdentification ]
>>
>> Fix the build failure caused by the undefined `CLONE_NEWTIME`.
>> Include the `linux/sched.h` header file where the function is defined to
>> ensure successful compilation of the selftests.
>
> This is supposed to be already fixed by commit 34d5b600172b ("selftests:
> vDSO: Explicitly include sched.h")
>
> Can you explain what is the exact problem still ? And why linux/sched.h ?

Yes, I noticed that sched.h is already included, but I still encountered
an "undeclared CLONE_NEWTIME" error during compilation.

Error I got:
CC       vdso_test_getrandom
vdso_test_getrandom.c: In function ‘kselftest’:
vdso_test_getrandom.c:257:29: error: ‘CLONE_NEWTIME’ undeclared (first
use in this function); did you mean ‘CLONE_NEWPID’?
   257 |         ksft_assert(unshare(CLONE_NEWTIME) == 0);
       |                             ^~~~~
vdso_test_getrandom.c:47:20: note: in definition of macro ‘ksft_assert’
    47 |         do { if (!(condition)) ksft_exit_fail_msg("Assertion
failed: %s\n", #condition); } while (0)
       |                    ^~~~~
vdso_test_getrandom.c:257:29: note: each undeclared identifier is
reported only once for each function it appears in
   257 |         ksft_assert(unshare(CLONE_NEWTIME) == 0);
       |                             ^~~~~
vdso_test_getrandom.c:47:20: note: in definition of macro ‘ksft_assert’
    47 |         do { if (!(condition)) ksft_exit_fail_msg("Assertion
failed: %s\n", #condition); } while (0)
       |                    ^~~~~
make[1]: * [../lib.mk:222:
/home/purva/linux/tools/testing/selftests/vDSO/vdso_test_getrandom] Error 1
make[1]: Leaving directory '/home/purva/linux/tools/testing/selftests/vDSO'


>
> Did you properly build kernel headers before building selftests ?
>
>
>>
>> Signed-off-by: Purva Yeshi <purvayeshi550@...il.com>
>> ---
>>   tools/testing/selftests/vDSO/vdso_test_getrandom.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c
>> b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
>> index 95057f7567db..b2c9cf15878b 100644
>> --- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c
>> +++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
>> @@ -29,6 +29,8 @@
>>   #include "vdso_config.h"
>>   #include "vdso_call.h"
>>
>> +#include <linux/sched.h>
>> +
>>   #ifndef timespecsub
>>   #define        timespecsub(tsp, usp,
>> vsp)                                      \
>>          do
>> {                                                            \
>> --
>> 2.34.1
>>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ