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: <rzn6qnbyf6ug4ahjdiq2wmjgcqwr4m3fegfihfnovg5h44upu6@gb77ttnfarnj>
Date: Wed, 27 Nov 2024 18:47:38 +0100
From: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
To: Shuah Khan <skhan@...uxfoundation.org>
CC: <shuah@...nel.org>, <hpa@...or.com>, <x86@...nel.org>,
	<dave.hansen@...ux.intel.com>, <bp@...en8.de>, <mingo@...hat.com>,
	<tglx@...utronix.de>, <linux-kernel@...r.kernel.org>,
	<linux-kselftest@...r.kernel.org>, <kirill@...temov.name>
Subject: Re: [PATCH v4 0/3] selftests/lam: get_user additions and LAM enabled
 check

On 2024-11-26 at 09:34:36 -0700, Shuah Khan wrote:
>On 11/26/24 06:34, Maciej Wieczor-Retman wrote:
>> Recent change in how get_user() handles pointers [1] has a specific case
>> for LAM. It assigns a different bitmask that's later used to check
>> whether a pointer comes from userland in get_user().
>> 
>> While currently commented out (until LASS [2] is merged into the kernel)
>> it's worth making changes to the LAM selftest ahead of time.
>> 
>> Modify cpu_has_la57() so it provides current paging level information
>> instead of the cpuid one.
>> 
>> Add test case to LAM that utilizes a ioctl (FIOASYNC) syscall which uses
>> get_user() in its implementation. Execute the syscall with differently
>> tagged pointers to verify that valid user pointers are passing through
>> and invalid kernel/non-canonical pointers are not.
>> 
>> Also to avoid unhelpful test failures add a check in main() to skip
>> running tests if LAM was not compiled into the kernel.
>> 
>> Code was tested on a Sierra Forest Xeon machine that's LAM capable. The
>> test was ran without issues with both the LAM lines from [1] untouched
>> and commented out. The test was also ran without issues with LAM_SUP
>> both enabled and disabled.
>> 
>> 4/5 level pagetables code paths were also successfully tested in Simics
>> on a 5-level capable machine.
>> 
>> [1] https://lore.kernel.org/all/20241024013214.129639-1-torvalds@linux-foundation.org/
>> [2] https://lore.kernel.org/all/20241028160917.1380714-1-alexander.shishkin@linux.intel.com/
>> 
>> Maciej Wieczor-Retman (3):
>>    selftests/lam: Move cpu_has_la57() to use cpuinfo flag
>>    selftests/lam: Skip test if LAM is disabled
>>    selftests/lam: Test get_user() LAM pointer handling
>> 
>>   tools/testing/selftests/x86/lam.c | 122 ++++++++++++++++++++++++++++--
>>   1 file changed, 117 insertions(+), 5 deletions(-)
>> 
>
>Looks good to me. For selftests if it is going through x86 tree.
>
>Acked-by: Shuah Khan <skhan@...uxfoundation.org>
>
>If you want me to take this through selftest tree, I can do that.
>
>thanks,
>-- Shuah

Thank you, yes, that'd be great!

I also just resent v5 [1] fixing the small mistake that Kirill pointed out in
"selftests/lam: Move cpu_has_la57() to use cpuinfo flag" [2]. Could you please
pull that fixed version?

[1] https://lore.kernel.org/all/cover.1732728879.git.maciej.wieczor-retman@intel.com/
[2] https://lore.kernel.org/all/6kfafs7wio7ruth3p54pezqwcultxqqpnjvehjzaz7hlba4rp3@6kb5zdqfglsl/

-- 
Kind regards
Maciej Wieczór-Retman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ