* commit 55516b355b0c cause SMEP/SMAP feature not work
[not found] <203df167-267e-4893-807a-42ad3c8934f7@windriver.com>
@ 2024-09-23 8:21 ` guocai he
0 siblings, 0 replies; only message in thread
From: guocai he @ 2024-09-23 8:21 UTC (permalink / raw)
To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin, linux-kernel
Andy, Thomas and all:
> branch: v5.15/standard/preempt-rt/x86
>
> commit: 55516b355b0c x86/syscall: Don't force use of indirect calls
> for system calls
>
> I found this commit cause the intel CPU feature of SMEP/SMAP does not
> work.
>
SMEP/SMAP is to "trick" the kernel into using instructions or data from
a user-space program and get call trace
>
>
> testing:
>
> 1 enable SMEP/SMAP
>
> 2 in user-space, the test case source code:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <unistd.h>
> #include <sys/mman.h>
> #include <sys/syscall.h>
> #include <errno.h>
>
> #define BUF_SIZE 128
>
> int main(int argc, char **argv)
> {
> char *map;
>
> map = mmap(NULL , 1024, PROT_READ|PROT_WRITE|PROT_EXEC,
> MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
> if (map == MAP_FAILED) {
> printf("Failed to mmap: %s\n", strerror(errno));
> return -1;
> }
>
> memset(map, 0, sizeof(BUF_SIZE));
>
> mlockall(MCL_CURRENT);
>
> syscall(247, map);
>
> return 0;
> }
>
> 3 after the test case executed, expect to get the call trace. but
> this commit cause the test case can not find the call trace.
>
>
> do you have chance to look at this issue?
>
>
> Thanks
>
> Guocai
>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-09-23 8:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <203df167-267e-4893-807a-42ad3c8934f7@windriver.com>
2024-09-23 8:21 ` commit 55516b355b0c cause SMEP/SMAP feature not work guocai he
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®