All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: "ksummit-discuss@lists.linuxfoundation.org"
	<ksummit-discuss@lists.linuxfoundation.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Emily Ratliff <eratliff@linuxfoundation.org>
Subject: Re: [Ksummit-discuss] [TECH TOPIC] Kernel Hardening
Date: Tue, 22 Sep 2015 11:02:37 -0700	[thread overview]
Message-ID: <CALCETrXU9VV6hOiCgaFw6jim1SMJhThB5sPR1XXCrbZf=u2uVw@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1509221436130.6225@hadrien>

On Tue, Sep 22, 2015 at 5:59 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Tue, 22 Sep 2015, Dan Carpenter wrote:
>
>> On Mon, Aug 24, 2015 at 09:35:50AM -0700, Kees Cook wrote:
>> > As an example, making the kernel code memory read-only means an
>> > attacker cannot just directly change the kernel's execution path when
>> > they use an arbitrary memory-writing flaw.
>>
>> Part of the problem is that C defaults to writable and you have to
>> explicitly add a const if you want it read only.  Then when you are
>> reading the code and you see:
>>
>> static struct uvc_format_desc uvc_fmts[] = {
>>
>> You can't immediately tell if it is writeable because it needs to be or
>> because that's just the default.  We should make a new keyword that
>> means non constant then we could grep for structs which have a function
>> pointer and complain if they weren't specified as const or __writable.
>>
>> Maybe there is a way to do this with GCC attributes but I have never
>> used them before and I couldn't immediately see how to do it.
>
> But the bigger problem is that some of these kinds of structs have a
> single writeable field lurking inside fo them.  For example,
> platform_driver contains struct device_driver driver; that is initialized
> in the platform driver library, and not in the device driver itself.
> Would it be beneficial to put const on the individual function-typed
> fields, if that is indeed possible?  For example, I don't find any
> assignments to a platform_driver remove field.
>

PaX gets around this with special tricks to write to fields in
otherwise const structures in appropriately annotated code.  We could
clean that up and do it upstream.

--Andy

  reply	other threads:[~2015-09-22 18:02 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  4:20 [Ksummit-discuss] [TECH TOPIC] Kernel Hardening James Morris
2015-08-24 11:46 ` Jiri Kosina
2015-08-24 11:56   ` James Morris
2015-08-24 17:17     ` Kees Cook
2015-08-24 17:28       ` Andy Lutomirski
2015-08-24 17:39         ` Julia Lawall
2015-08-24 18:01         ` Kees Cook
2015-08-24 18:19           ` Andy Lutomirski
2015-08-24 18:57             ` Kees Cook
2015-08-24 18:52       ` Thomas Gleixner
2015-08-24 18:59         ` Thomas Gleixner
2015-08-24 19:00         ` Kees Cook
2015-08-24 22:05           ` Greg KH
2015-08-25  0:51             ` Rafael J. Wysocki
2015-08-31 20:10             ` Eric W. Biederman
2015-08-31 20:22               ` josh
2015-08-26 20:51       ` Kees Cook
2015-08-26 21:10         ` Matthew Garrett
2015-08-30  0:41           ` [Ksummit-discuss] Self nomination Matthew Garrett
2015-08-24 11:48 ` [Ksummit-discuss] [TECH TOPIC] Kernel Hardening Jiri Kosina
2015-08-24 12:29 ` Linus Walleij
2015-08-24 12:51   ` Jason Cooper
2015-08-24 16:35   ` Kees Cook
2015-08-24 20:09     ` James Bottomley
2015-08-24 20:17       ` James Morris
2015-08-24 20:46         ` Thomas Gleixner
2015-08-24 22:22           ` James Morris
2015-08-24 23:20             ` Kees Cook
2015-08-24 23:54               ` Theodore Ts'o
2015-08-25  0:06                 ` James Morris
2015-08-25  0:06                 ` Kees Cook
2015-08-27 22:08                   ` [Ksummit-discuss] grsecurity and kernel hardening Stephen Hemminger
2015-08-27 22:49                     ` James Bottomley
2015-08-27 23:03                       ` Stephen Hemminger
2015-08-24 23:04           ` [Ksummit-discuss] [TECH TOPIC] Kernel Hardening Kees Cook
2015-08-25 16:45           ` Luis R. Rodriguez
2015-08-24 22:57         ` Kees Cook
2015-08-24 23:25           ` Kees Cook
2015-08-24 20:28       ` josh
2015-08-24 22:55       ` Kees Cook
2015-08-24 23:13         ` Andy Lutomirski
2015-08-31 20:58         ` Eric W. Biederman
2015-09-01  9:03           ` Jiri Kosina
2015-09-01 16:52             ` Kees Cook
2015-09-01 16:50           ` Kees Cook
2015-08-25 15:15     ` Shuah Khan
2015-08-25 16:15       ` Kees Cook
2015-08-25 16:30       ` Mark Brown
2015-08-25 16:33         ` Kees Cook
2015-08-25 16:58         ` Shuah Khan
2015-09-22 12:24     ` Dan Carpenter
2015-09-22 12:55       ` Yves-Alexis Perez
2015-09-22 12:59       ` Julia Lawall
2015-09-22 18:02         ` Andy Lutomirski [this message]
2015-08-24 16:20 ` Aneesh Kumar K.V
2015-08-24 17:19   ` Kees Cook
2015-08-24 18:50     ` James Morris

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='CALCETrXU9VV6hOiCgaFw6jim1SMJhThB5sPR1XXCrbZf=u2uVw@mail.gmail.com' \
    --to=luto@amacapital.net \
    --cc=dan.carpenter@oracle.com \
    --cc=eratliff@linuxfoundation.org \
    --cc=julia.lawall@lip6.fr \
    --cc=ksummit-discuss@lists.linuxfoundation.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.