[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <lhupld4zdjp.fsf@oldenburg.str.redhat.com>
Date: Sat, 09 Aug 2025 18:04:58 +0200
From: Florian Weimer <fweimer@...hat.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>, Andy Lutomirski
<luto@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
x86@...nel.org, Kostya Serebryany <kcc@...gle.com>, Andrey Ryabinin
<ryabinin.a.a@...il.com>, Andrey Konovalov <andreyknvl@...il.com>,
Alexander Potapenko <glider@...gle.com>, Taras Madan
<tarasmadan@...gle.com>, Dmitry Vyukov <dvyukov@...gle.com>, "H . J .
Lu" <hjl.tools@...il.com>, Andi Kleen <ak@...ux.intel.com>, Rick
Edgecombe <rick.p.edgecombe@...el.com>, Bharata B Rao <bharata@....com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>, Ashok Raj
<ashok.raj@...el.com>, Linus Torvalds <torvalds@...ux-foundation.org>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org, Weihong Zhang
<weihong.zhang@...el.com>
Subject: Re: [PATCHv16 13/17] selftests/x86/lam: Add mmap and SYSCALL test
cases for linear-address masking
* Kirill A. Shutemov:
> From: Weihong Zhang <weihong.zhang@...el.com>
>
> Add mmap and SYSCALL test cases.
>
> SYSCALL test cases:
>
> - LAM supports set metadata in high bits 62:57 (LAM_U57) of a user
> pointer, pass the pointer to SYSCALL, SYSCALL can dereference the
> pointer and return correct result.
Is this test expected to pass?
I've tried to compile the Fedora kernel (6.15.9-201.fc42) with address
masking and LAM enabled, and while basic LAM support is there (the CPU
ignores the metadata bits after the arch_prctl system call), it's not
valid to use addresses with metadata in system calls:
$ ./lam_64 -t 8
not ok 1 SYSCALL: LAM_U57. syscall with metadata
ok 2 SYSCALL:[Negative] Disable LAM. Dereferencing pointer with metadata.
not ok 3 GET_USER: get_user() and pass a properly tagged user pointer.
ok 4 GET_USER:[Negative] get_user() with a kernel pointer and the top bit cleared.
ok 5 GET_USER:[Negative] get_user() with a kernel pointer and the bottom sign-extension bit cleared.
ok 6 GET_USER:[Negative] get_user() and pass a kernel pointer.
1..6
# Totals: pass:4 fail:2 xfail:0 xpass:0 skip:0 error:0
This also happens outside the test, where write (for example) returns
EFAULT if passed an address with metadata.
Thanks,
Florian
Powered by blists - more mailing lists