mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "ldv@strace.io" <ldv@strace.io>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"bp@alien8.de" <bp@alien8.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>
Subject: Re: [PATCH] x86/uapi: fix SHADOW_STACK_SET_TOKEN type
Date: Mon, 23 Oct 2023 16:36:48 +0000	[thread overview]
Message-ID: <006699efc5ccdce1bd62f45ef2852ab0233e295c.camel@intel.com> (raw)
In-Reply-To: <20231022222134.GA5334@altlinux.org>

On Mon, 2023-10-23 at 01:21 +0300, Dmitry V. Levin wrote:
> Fix the type of SHADOW_STACK_SET_TOKEN to match the type of the
> corresponding "flags" argument of map_shadow_stack syscall which
> is of type "unsigned int".
> 
> Fixes: c35559f94ebc3 ("x86/shstk: Introduce map_shadow_stack
> syscall")
> Signed-off-by: Dmitry V. Levin <ldv@strace.io>
> ---
>  arch/x86/include/uapi/asm/mman.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/uapi/asm/mman.h
> b/arch/x86/include/uapi/asm/mman.h
> index 46cdc941f958..8419e25bb617 100644
> --- a/arch/x86/include/uapi/asm/mman.h
> +++ b/arch/x86/include/uapi/asm/mman.h
> @@ -6,7 +6,7 @@
>  #define MAP_ABOVE4G    0x80            /* only map above 4GB */
>  
>  /* Flags for map_shadow_stack(2) */
> -#define SHADOW_STACK_SET_TOKEN (1ULL << 0)     /* Set up a restore
> token in the shadow stack */
> +#define SHADOW_STACK_SET_TOKEN (1U << 0)       /* Set up a restore
> token in the shadow stack */
>  
>  #include <asm-generic/mman.h>

Good point that they are mismatched. I don't remember why flags is not
an unsigned long though. I wonder if we should quick change it to an
unsigned long, if it's not too late. We probably won't run out of
flags, but maybe some value could get stuffed in the upper bits or
something someday.

  reply	other threads:[~2023-10-23 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-22 22:21 Dmitry V. Levin
2023-10-23 16:36 ` Edgecombe, Rick P [this message]
2023-10-23 20:11   ` Dmitry V. Levin

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=006699efc5ccdce1bd62f45ef2852ab0233e295c.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=ldv@strace.io \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

Powered by JetHome