linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Garnier <thgarnie@google.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Russell King - ARM Linux" <linux@armlinux.org.uk>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"David Howells" <dhowells@redhat.com>,
	"Al Viro" <viro@zeniv.linux.org.uk>,
	"Dave Hansen" <dave.hansen@intel.com>,
	"René Nyffenegger" <mail@renenyffenegger.ch>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Kees Cook" <keescook@chromium.org>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Ard Biesheuvel" <ard.biesheuvel@linaro.org>,
	"Nicolas Pitre" <nicolas.pitre@linaro.org>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Sergey Senozhatsky" <sergey.senozhatsky@gmail.com>,
	"Helge Deller" <deller@gmx.de>, "Rik van Riel" <riel@redhat.com>,
	"Ingo Molnar" <mingo@kernel.org>,
	"John Stultz" <john.stultz@linaro.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Oleg Nesterov" <oleg@redhat.com>,
	"Stanislav Kinsburskiy" <skinsbursky@virt>
Subject: Re: [PATCH v1 1/4] syscalls: Restore address limit after a syscall
Date: Wed, 8 Mar 2017 14:27:18 -0800	[thread overview]
Message-ID: <CAJcbSZG21d3=1w5eiWtxUF4ooDiGPZc7wOExPsGiB3D3wTUFLQ@mail.gmail.com> (raw)
In-Reply-To: <CALCETrX1RpjZxdo1aauQa8hGQPO1Dzn5gU6NoT1CvSKo8ea1uQ@mail.gmail.com>

That make sense. I will optimize each architecture to not require a call.

On Wed, Mar 8, 2017 at 2:20 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> On Wed, Mar 8, 2017 at 1:58 PM, Russell King - ARM Linux
> <linux@armlinux.org.uk> wrote:
>> On Wed, Mar 08, 2017 at 01:38:41PM -0800, Thomas Garnier wrote:
>>> This patch prevents a syscall to modify the address limit of the
>>> caller. The address limit is kept by the syscall wrapper and restored
>>> just after the syscall ends.
>>
>> I would much rather architectures were given the opportunity to code up
>> checks like this efficiently (iow, inline in the exit path assembly),
>> rather than having to unconditionally call an additional function on
>> every syscall, with its register saving overheads.
>>
>
> Me too.  I think the two config choices should be:
>
> (a) BUG_ON(!segment_eq(...));
>
> (b) No generic check at all -- arch code will handle it
>
> --Andy



-- 
Thomas

      reply	other threads:[~2017-03-08 22:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 21:38 [PATCH v1 1/4] syscalls: Restore address limit after a syscall Thomas Garnier
2017-03-08 21:38 ` [PATCH v1 2/4] x86/syscalls: Specific usage of verify_pre_usermode_state Thomas Garnier
2017-03-08 21:38 ` [PATCH v1 3/4] arm/syscalls: " Thomas Garnier
2017-03-08 21:49   ` Russell King - ARM Linux
2017-03-08 22:05   ` Nicolas Pitre
2017-03-08 22:33     ` Thomas Garnier
2017-03-08 21:38 ` [PATCH v1 4/4] arm64/syscalls: " Thomas Garnier
2017-03-08 21:57 ` [PATCH v1 1/4] syscalls: Restore address limit after a syscall Kees Cook
2017-03-09  1:13   ` Thomas Garnier
2017-03-08 21:58 ` Russell King - ARM Linux
2017-03-08 22:20   ` Andy Lutomirski
2017-03-08 22:27     ` Thomas Garnier [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='CAJcbSZG21d3=1w5eiWtxUF4ooDiGPZc7wOExPsGiB3D3wTUFLQ@mail.gmail.com' \
    --to=thgarnie@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=dave.hansen@intel.com \
    --cc=deller@gmx.de \
    --cc=dhowells@redhat.com \
    --cc=john.stultz@linaro.org \
    --cc=keescook@chromium.org \
    --cc=linux@armlinux.org.uk \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mail@renenyffenegger.ch \
    --cc=mingo@kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pmladek@suse.com \
    --cc=riel@redhat.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=skinsbursky@virt \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).