public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: System call number masking
Date: Mon, 18 Apr 2016 01:45:17 +0100	[thread overview]
Message-ID: <1460940317.9121.56.camel@decadent.org.uk> (raw)
In-Reply-To: <CALCETrWo2TFWR6gW3sw4LBYuNdeVeaw8V54DGDNde3we9mLv9A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

On Thu, 2016-04-14 at 10:48 -0700, Andy Lutomirski wrote:
> On Thu, Apr 14, 2016 at 10:22 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > 
> > I'm updating my x32-as-boot-time-option patch for 4.6, and I noticed a
> > subtle change in system call number masking on x86_64 as a result of
> > moving the slow path into C.
> > 
> > Previously we would mask out the upper 32 bits before doing anything
> > with the system call number, both on the slow and fast paths, if and
> > only if x32 was enabled.
> I always thought that the old behavior was nonsensical.  The behavior
> should be the same regardless of config options.
[...]

Oops, my C is failing me - ints are sign-extended, not zero-extended,
when promoted to unsigned long.  So the slow path actually does test
the upper 32 bits, and the odd one out is the x32 fast path.

Ben.

-- 
Ben Hutchings
Always try to do things in chronological order;
it's less confusing that way.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-04-18  0:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 17:22 System call number masking Ben Hutchings
2016-04-14 17:48 ` Andy Lutomirski
2016-04-18  0:45   ` Ben Hutchings [this message]
2016-04-18  0:47     ` [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the fast path Ben Hutchings
2016-04-18  4:50       ` H. Peter Anvin
2016-04-18  5:18         ` Andy Lutomirski
2016-04-18  5:21           ` H. Peter Anvin
2016-04-18  5:39             ` Andy Lutomirski
2016-04-18  5:45               ` H. Peter Anvin
2016-04-18  5:48                 ` Andy Lutomirski
2016-04-18  6:01                   ` H. Peter Anvin
2016-04-18  6:14                     ` Andy Lutomirski
2016-04-18  6:19                       ` H. Peter Anvin
2016-04-18  5:24           ` H. Peter Anvin

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=1460940317.9121.56.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@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