mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: guocai he <guocai.he.cn@windriver.com>
To: Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: commit 55516b355b0c cause SMEP/SMAP feature not work
Date: Mon, 23 Sep 2024 16:21:09 +0800	[thread overview]
Message-ID: <34533c4a-994a-4d4d-bcaa-b3f517c8695d@windriver.com> (raw)
In-Reply-To: <203df167-267e-4893-807a-42ad3c8934f7@windriver.com>

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
>

           reply	other threads:[~2024-09-23  8:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <203df167-267e-4893-807a-42ad3c8934f7@windriver.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34533c4a-994a-4d4d-bcaa-b3f517c8695d@windriver.com \
    --to=guocai.he.cn@windriver.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®