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: <76770ce2-f6a6-4af0-b29c-0070933a1dfb@nvidia.com>
Date: Thu, 13 Feb 2025 00:04:30 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Dave Hansen <dave.hansen@...el.com>,
 Andrew Morton <akpm@...ux-foundation.org>, Jeff Xu <jeffxu@...omium.org>,
 Shuah Khan <shuah@...nel.org>
Cc: Andrei Vagin <avagin@...gle.com>,
 Axel Rasmussen <axelrasmussen@...gle.com>,
 Christian Brauner <brauner@...nel.org>, David Hildenbrand
 <david@...hat.com>, Kees Cook <kees@...nel.org>,
 Kent Overstreet <kent.overstreet@...ux.dev>,
 "Liam R . Howlett" <Liam.Howlett@...cle.com>,
 Muhammad Usama Anjum <usama.anjum@...labora.com>,
 Peter Xu <peterx@...hat.com>, Rich Felker <dalias@...c.org>,
 linux-mm@...ck.org, linux-kselftest@...r.kernel.org,
 LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 6/6] selftests/mm: remove local __NR_* definitions

On 2/12/25 12:34 PM, Dave Hansen wrote:
> Hi John,
> 
> On 6/13/24 19:30, John Hubbard wrote:
>> --- a/tools/testing/selftests/mm/protection_keys.c
>> +++ b/tools/testing/selftests/mm/protection_keys.c
>> @@ -42,7 +42,7 @@
>>   #include <sys/wait.h>
>>   #include <sys/stat.h>
>>   #include <fcntl.h>
>> -#include <unistd.h>
>> +#include <linux/unistd.h>
>>   #include <sys/ptrace.h>
>>   #include <setjmp.h>
> 
> I'm not quite sure how but this broke the protection_keys.c selftest for
> me. Before this commit (a5c6bc590094a1a73cf6fa3f505e1945d2bf2461) things
> are fine.  But after, I get:
> 
> 	running PKEY tests for unsupported CPU/OS
> 
> The "unsupported" test just makes a pkey_alloc() syscall. It's probably
> calling the wrong syscall number or something.
> 
> I think it's still broken in mainline. What's the right fix?

A couple of thoughts:

1) I now think that that commit was a bad idea, because it turns out
kselftests doesn't make it easy to set up an asm/header.h approach.
And this partial approach seems like it won't work at all for syscalls
in particular.

I think reverting the commit is appropriate. It doesn't revert cleanly
at top of tree, but a very small fix allows a revert.

I'm attaching a patch that does that.

2) I'm unable to reproduce what you saw, because in ALL cases (before
or after the commit, and with or without a revert), I get the same
results on my Intel test machine:

     $ ./protection_keys_64
     has pkeys: 0
     running PKEY tests for unsupported CPU/OS

...so that's why I'm attaching a patch, in case you can verify that a
revert fixes it.


thanks,
-- 
John Hubbard

View attachment "0001-Revert-selftests-mm-remove-local-__NR_-definitions.patch" of type "text/x-patch" (8067 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ