linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: Jiri Slaby <jslaby@suse.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"kernel-hardening@lists.openwall.com" 
	<kernel-hardening@lists.openwall.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pty: make ptmx file ops read-only after init
Date: Wed, 14 Sep 2016 09:17:44 -0700	[thread overview]
Message-ID: <CAGXu5jJWE-z_DLwP=cZdSMkJLYhQ+B2=AEEdCuFDucxsSn9b-w@mail.gmail.com> (raw)
In-Reply-To: <20160914150416.2d938c60@lxorguk.ukuu.org.uk>

On Wed, Sep 14, 2016 at 7:04 AM, One Thousand Gnomes
<gnomes@lxorguk.ukuu.org.uk> wrote:
> On Wed, 14 Sep 2016 09:59:42 +0200
> Jiri Slaby <jslaby@suse.cz> wrote:
>
>> On 09/09/2016, 12:35 AM, Kees Cook wrote:
>> > The ptmx_fops structure is only changed during init, so mark it as such.
>>
>> Right, but I am missing what is the benefit? You would have to elaborate
>> here...
>
> The pages end up marked read only even to the kernel (and in future could
> even be marked read only forever when in kvm if we get suitable virtual
> machine extensions). That makes it much harder to patch those vectors
> when making security attacks.

Correct, this is a continuing effort to reduce the internal attack
surface of the kernel, where one of the most common exploitation
methods is overwriting function pointers.

Some examples of attacks and mitigations are here:
http://kernsec.org/wiki/index.php/Exploit_Methods/Function_pointer_overwrite

While this patch isn't a huge change, it's still a viable candidate. I
send these as I notice them, and hope that other folks will start to
see these opportunities and send more patches too. :)

-Kees

-- 
Kees Cook
Nexus Security

  reply	other threads:[~2016-09-14 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 22:35 [PATCH] pty: make ptmx file ops read-only after init Kees Cook
2016-09-14  7:59 ` Jiri Slaby
2016-09-14 14:04   ` One Thousand Gnomes
2016-09-14 16:17     ` Kees Cook [this message]
2016-09-21  9:40       ` Jiri Slaby

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='CAGXu5jJWE-z_DLwP=cZdSMkJLYhQ+B2=AEEdCuFDucxsSn9b-w@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).