From: Oleg Nesterov <oleg@redhat.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Elliott Hughes <enh@google.com>,
linux-kernel@vger.kernel.org, linux-um@lists.infradead.org,
llvm@lists.linux.dev, Bill Wendling <morbo@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Justin Stitt <justinstitt@google.com>,
Johannes Berg <johannes@sipsolutions.net>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
Thomas Gleixner <tglx@kernel.org>, 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>,
Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH] x86: uapi: ptrace: guard register offset macros with __ASSEMBLER__ or __FRAME_OFFSETS
Date: Wed, 2 Sep 2026 19:29:09 +0200 [thread overview]
Message-ID: <aphc5Xf0HU0SWcTI@redhat.com> (raw)
In-Reply-To: <CAKwvOdkCGEYWnyJtWT=jArXkA47X==G0PU4UNV=s8htpA3Dg6g@mail.gmail.com>
On 09/01, Nick Desaulniers wrote:
>
> On Fri, Aug 21, 2026 at 3:46 PM Nick Desaulniers
> <ndesaulniers@google.com> wrote:
> >
> > The register offset macros in <asm/ptrace-abi.h> are guarded by
> > `defined(__ASSEMBLER__) || defined(__FRAME_OFFSETS)` for 64-bit, but
> > were left unguarded for 32-bit. This causes havoc for userspace that
> > happens to use identifiers colliding with these short macro names
> > (e.g., EBX, ECX, EAX, DS, ES, FS, GS, CS, SS). Without this guard,
> > userspace is forced to be super extra careful with include ordering to
> > minimize the chance of collision.
> >
> > Wrap both the 32-bit and 64-bit register definitions under
> > `#if defined(__ASSEMBLER__) || defined(__FRAME_OFFSETS)`, and ensure
> > User-Mode Linux (UML) defines `__FRAME_OFFSETS` for 32-bit as well.
> >
> > Assisted-by: Gemini
> > Link: https://github.com/llvm/llvm-project/issues/217413
> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>
> + enh (who pulled this into android for testing)
>
> Oleg, can I get an ack/nack here?
Oh... there is a little problem, I don't understand the usage of
(magic to me) __FRAME_OFFSETS ;)
> Or someone who knows better the
> history of UAPI headers?
Certainly not me....
OK. I'll try to read this patch tomorrow with the clear head after sleep.
Oleg.
prev parent reply other threads:[~2026-09-02 17:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 22:45 [PATCH] x86: uapi: ptrace: guard register offset macros with __ASSEMBLER__ or __FRAME_OFFSETS Nick Desaulniers
2026-09-01 21:45 ` Nick Desaulniers
2026-09-02 13:43 ` enh
2026-09-02 17:29 ` Oleg Nesterov [this message]
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=aphc5Xf0HU0SWcTI@redhat.com \
--to=oleg@redhat.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=enh@google.com \
--cc=hpa@zytor.com \
--cc=johannes@sipsolutions.net \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=richard@nod.at \
--cc=tglx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.