linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Matthew Garrett <mjg59@google.com>,
	Igor Zhbanov <i.zhbanov@omprussia.ru>
Cc: linux-integrity <linux-integrity@vger.kernel.org>,
	Jann Horn <jannh@google.com>
Subject: Re: Should mprotect(..., PROT_EXEC) be checked by IMA?
Date: Thu, 21 Mar 2019 07:21:58 -0400	[thread overview]
Message-ID: <1553167318.4899.382.camel@linux.ibm.com> (raw)
In-Reply-To: <CACdnJut6YfLnq-nCC1hHTrKYXabHoSEXN1wMuCyVybU+o_iwCg@mail.gmail.com>

[Cc'ing Jann Horn, who brought this topic up last year.]

On Wed, 2019-03-20 at 10:23 -0700, Matthew Garrett wrote:
> On Wed, Mar 20, 2019 at 1:11 AM Igor Zhbanov <i.zhbanov@omprussia.ru> wrote:

<snip>

> > My point was about better protecting of shared libraries making life harder
> > for exploits that are downloading extra code from external servers.
> 
> Like you said, they can implement this by copying the code from
> read-only pages to separate executable pages. It does make it harder,
> but not to a huge degree - anything that's mprotect()ing file-backed
> pages to PROT_EXEC later is presumably doing so to avoid IMA, and
> making this change will just encourage them to add further
> workarounds. Since this is a fight we literally can't win, what's the
> benefit?

Really, Matthew?  Such gloomy thoughts coming from someone advocating
the "lockdown" patch set and extending IMA/EVM.  Part of our job
description as Linux kernel security/integrity developers is exactly
that - to make it more difficult for attackers, by hardening the
system and closing one measurement/appraisal gap at a time.

Igor, as for shared libraries:

1. Extend ima_file_mmap() to permit, based on policy, verifying file
signatures for files being mmap'ed read and preventing validly signed
files from being mmap'ed write.

2. Define an IMA mprotect hook that permits, based on policy,
preventing memory having validly signed backing storage from setting
the memory region to write, but allow execute.

(This will require access to the IMA mmap signature verification
status cached in the "iint".)

Mimi


  parent reply	other threads:[~2019-03-21 11:22 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 15:18 Should mprotect(..., PROT_EXEC) be checked by IMA? Igor Zhbanov
2019-03-18 21:48 ` Mimi Zohar
2019-03-19  7:50   ` Igor Zhbanov
2019-03-19 11:22     ` Mimi Zohar
2019-03-19 12:19       ` Igor Zhbanov
2019-03-19 17:05         ` Mimi Zohar
2019-03-20  8:11           ` Igor Zhbanov
2019-03-20 17:23             ` Matthew Garrett
2019-03-20 18:08               ` Igor Zhbanov
2019-03-21 11:21               ` Mimi Zohar [this message]
2019-03-21 11:48                 ` Igor Zhbanov
2019-03-21 18:04                   ` Matthew Garrett
2019-03-22  7:59                     ` Igor Zhbanov
2019-03-28 17:17                       ` Mimi Zohar
2019-03-29 10:00                         ` Igor Zhbanov
2019-03-29 10:59                           ` Mimi Zohar
2019-03-29 11:51                             ` Jordan Glover
2019-03-29 12:28                             ` Stephen Smalley
2019-03-29 12:50                               ` Igor Zhbanov
2019-04-02 22:31                                 ` Matthew Garrett
2019-04-03  9:59                                   ` Igor Zhbanov
2019-04-03 16:58                                     ` Matthew Garrett
2019-04-03 17:31                                       ` Igor Zhbanov
2019-04-03 18:19                                         ` Matthew Garrett
2019-04-03 18:47                                           ` Igor Zhbanov
2019-04-03 19:25                                             ` Matthew Garrett
2019-04-04 11:44                                               ` Igor Zhbanov
2019-04-03 12:11                                   ` Mimi Zohar
2019-04-03 13:18                                     ` Perez Yves-Alexis
2019-04-03 11:57                                 ` Mimi Zohar
2019-04-03 13:10                                   ` Stephen Smalley
2019-04-03 14:33                                     ` Mimi Zohar
2019-04-03 14:33                                       ` Stephen Smalley
2019-04-03 16:21                                         ` Mimi Zohar
2019-03-21 18:13                 ` Matthew Garrett
2019-03-19 17:07         ` Matthew Garrett

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=1553167318.4899.382.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=i.zhbanov@omprussia.ru \
    --cc=jannh@google.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=mjg59@google.com \
    /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).