From: David Laight <David.Laight@ACULAB.COM>
To: 'Andy Lutomirski' <luto@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
X86 ML <x86@kernel.org>
Subject: RE: in_compat_syscall() on x86
Date: Wed, 6 Jan 2021 09:42:33 +0000 [thread overview]
Message-ID: <113ae3678beb4d33882506a85b398362@AcuMS.aculab.com> (raw)
In-Reply-To: <CALCETrV_Ng4xjd1fanXZJ5=EFN4w2RYMK0EqsnKmMkSYbQhN0w@mail.gmail.com>
From: Andy Lutomirski
> Sent: 05 January 2021 17:35
>
> On Tue, Jan 5, 2021 at 1:53 AM David Laight <David.Laight@aculab.com> wrote:
> > ...
...
> > > > I also wondered about resetting it to zero when an x32 system call
> > > > exits (rather than entry to a 64bit one).
> > > >
> > > > For ia32 the flag is set (with |=) on every syscall entry.
> > > > Even though I'm pretty sure it can only change during exec.
> > >
> > > It can change for every syscall. I have tests that do this.
> >
> > Do they still work?
>
> They seem to.
>
> > I don't think the ia32 flag is cleared anywhere.
>
> It's hiding in arch_exit_to_user_mode_prepare().
No wonder I don't notice.
There is a RMW to clear TS_COMPAT | TS_I386_REGS_POKED as (about)
the very last thing done before returning to user.
Short or renaming the 'status' field and fixing the compilation errors
I can't see an obvious way of detecting any other status flag bits.
If none are used (or a different field is used) then an unconditional
write of the syscall type in the entry paths would remove the need for
the clear in the syscall exit path.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2021-01-06 9:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 12:16 David Laight
2021-01-04 16:46 ` David Laight
2021-01-04 16:58 ` Al Viro
2021-01-04 20:41 ` Eric W. Biederman
2021-01-04 22:34 ` David Laight
2021-01-04 23:04 ` Andy Lutomirski
2021-01-05 0:47 ` Eric W. Biederman
2021-01-05 0:57 ` Al Viro
2021-01-06 0:03 ` Eric W. Biederman
2021-01-06 0:11 ` Bernd Petrovitsch
2021-01-06 0:30 ` Al Viro
2021-01-05 9:53 ` David Laight
2021-01-05 17:35 ` Andy Lutomirski
2021-01-06 9:42 ` David Laight [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=113ae3678beb4d33882506a85b398362@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=ebiederm@xmission.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--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®