Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315242

Re: [kernel-hardening] [PATCH v4 0/8] introduce post-init read-only memory

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [kernel-hardening] [PATCH v4 0/8] introduce post-init read-only memory
Date Fri, 22 Jan 2016 21:00:01 +0100
Message-ID <qTQ2d-cO-1@gated-at.bofh.it> (permalink)
References <qSIT8-33H-5@gated-at.bofh.it> <qTNH3-7bM-3@gated-at.bofh.it> <qTPpw-8pj-19@gated-at.bofh.it>
X-Original-To Laura Abbott <laura@labbott.name>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=L8/jJcWjjeDNMqYIXn7YtYiFC+Xn/64ZAD8OM3OEX/c=; b=LPvwwe5qlScIhUGoRRPBEfzpZY8EMjsbI5LNxlHCkpUJw+e8F6dWN7VMP0OfLN3YDn U5V96/eefXJ/op4t2FaacBUQ2c7gPBWOVF9fm+prqw9Q9eORS02V+t17Zi9qyZ1k49jg IkcgezRkfykZgb/pcn50ZWZLMMJsNI08i+pFUGpwfhpwrUrqTcA8qnjNmdprAjLgpcNA kOjWrY/wdlWQJUzJzigGnmuGp6aBwJip4Sg9u1YwOT1ZIXNRW7vAuXSV7wa9Te0OVrSc 8IO1MxqqIYvie3ORZME4e4T9VoXeMeQ7wI3otYysXCuntrIgUwhx70CQrO6Asxn6bY+E ebuQ==
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=L8/jJcWjjeDNMqYIXn7YtYiFC+Xn/64ZAD8OM3OEX/c=; b=oLjGKR1aGZtmK0veOANRSpBcWJLXll13uqfo0Y40neB/a/iJj+tbbVq0r0KdLayMf8 GfTT1/6uKvNht3JbXQDqpjFGpVyVshsN3CeV0q+izILpIx9xCkYfOoqIey134rbBWAU+ 3BbsFU2u/ofyE/Yh32yWG7XjsYnYhi/HU22eo=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=L8/jJcWjjeDNMqYIXn7YtYiFC+Xn/64ZAD8OM3OEX/c=; b=ehcS/hEj8Poto/P144UR+kwS9mPyEvx1cQ3RhqxvSETDXDtuljNf1bFOjAUwSkwhsO SYVtA6CuyCoezkS0gh2QVUbI0rdDLkRZmSaHm0rFjuWA7BznHy8U/Xn6KzPtJ7YXAdqf AgRX+jqzmINecJP53s/AP19zBD+2eH9RHvuvclZIdJ+jdOuJTBTAmxspa/iq/cLpc6UJ kwHo29tFvkY9RNdIDQfGuv9uc9/k/SdC5uiXg9OH329DF0f/4Y2undMYtI6OBIaynQK+ qieNQ+4N0/MBxkU/JSptP7uuf/j13CQp8X/k9Cjc0jo1MVJG+AiqeIRLRKUUo7NgELj/ lo8w==
X-Gm-Message-State AG10YOQqR3e7bJQQgY+TKdWYswZ9+0NKp6djGZK3OnLIkgkca1W0IODxQzUBOxCdsKGsvKz/i9KaJyYWyXbVluhG
MIME-Version 1.0
X-Received by 10.107.167.17 with SMTP id q17mr5174403ioe.61.1453492625270; Fri, 22 Jan 2016 11:57:05 -0800 (PST)
X-Google-Sender-Auth VFczYee-m2NFXxBpGml7hg3FmrI
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 48
Organization linux.* mail to news gateway
X-Original-Cc "kernel-hardening@lists.openwall.com" <kernel-hardening@lists.openwall.com>, Ingo Molnar <mingo@redhat.com>, Andy Lutomirski <luto@amacapital.net>, "H. Peter Anvin" <hpa@zytor.com>, Michael Ellerman <mpe@ellerman.id.au>, Mathias Krause <minipli@googlemail.com>, Thomas Gleixner <tglx@linutronix.de>, "x86@kernel.org" <x86@kernel.org>, Arnd Bergmann <arnd@arndb.de>, PaX Team <pageexec@freemail.hu>, Emese Revfy <re.emese@gmail.com>, LKML <linux-kernel@vger.kernel.org>, linux-arch <linux-arch@vger.kernel.org>
X-Original-Date Fri, 22 Jan 2016 11:57:05 -0800
X-Original-Message-ID <CAGXu5j+5EB5f335RHOP+CugFC1z29cAV0pWy6zB34dQBz7W6_Q@mail.gmail.com>
X-Original-References <1453226922-16831-1-git-send-email-keescook@chromium.org> <20160122171954.GA3945@davidb.org> <56A28029.2060608@labbott.name>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1315242

Show key headers only | View raw


On Fri, Jan 22, 2016 at 11:16 AM, Laura Abbott <laura@labbott.name> wrote:
> On 1/22/16 9:19 AM, David Brown wrote:
>>
>> On Tue, Jan 19, 2016 at 10:08:34AM -0800, Kees Cook wrote:
>>
>>> This introduces __ro_after_init as a way to mark such memory, and uses
>>> it on the x86 vDSO to kill an extant kernel exploitation method. Also
>>> adds a new kernel parameter to help debug future use and adds an lkdtm
>>> test to check the results.
>>
>>
>> I've tested these patches on 32-bit ARM using the provoke-crashes
>> test.  However, they do require CONFIG_ARM_KERNMEM_PERMS to be enabled
>> as well, which does incur additional memory usage.

Thanks for testing!

>> Do we want to consider making CONFIG_ARM_KERNMEM_PERMS default y for
>> security reasons, and just document that memory-constrained systems
>> may want to turn it off?
>>
>> I'll test the arm64 next.
>>
>> David
>
>
> Kees had previously pushed a patch to do so but it exposed a couple of
> underlying issues, mostly with low power paths
> (c.f. http://article.gmane.org/gmane.linux.ports.arm.kernel/471199,
> http://article.gmane.org/gmane.linux.kernel.mm/143489)
> Those will need to be all fixed up before this could be made default.

Yeah, I've got a patch waiting to reorganize CONFIG_ARM_KERNMEM_PERMS
to look more like arm64 (and x86) and get the feature correctly under
CONFIG_DEBUG_RODATA. I made it default=y on v7+. rmk asked me to wait
until -rc1 before resubmitting it.

http://git.kernel.org/cgit/linux/kernel/git/kees/linux.git/commit/?h=kspp/arm-rodata&id=08bebfd2e7fb8a9f364ced74c356642d64e1f43e

and a small improvement too:

http://git.kernel.org/cgit/linux/kernel/git/kees/linux.git/commit/?h=kspp/arm-rodata&id=8e16f005ce0d4069aee5502379cff845b4c6f950

-Kees

-- 
Kees Cook
Chrome OS & Brillo Security

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/8] introduce post-init read-only memory Kees Cook <keescook@chromium.org> - 2016-01-19 19:20 +0100
  [PATCH v4 7/8] lkdtm: verify that __ro_after_init works correctly Kees Cook <keescook@chromium.org> - 2016-01-19 19:20 +0100
  Re: [kernel-hardening] [PATCH v4 0/8] introduce post-init read-only  memory David Brown <david.brown@linaro.org> - 2016-01-22 18:30 +0100
    Re: [kernel-hardening] [PATCH v4 0/8] introduce post-init read-only  memory Laura Abbott <laura@labbott.name> - 2016-01-22 20:20 +0100
      Re: [kernel-hardening] [PATCH v4 0/8] introduce post-init read-only memory Kees Cook <keescook@chromium.org> - 2016-01-22 21:00 +0100
        Re: [kernel-hardening] [PATCH v4 0/8] introduce post-init read-only memory Geert Uytterhoeven <geert@linux-m68k.org> - 2016-01-23 10:50 +0100

csiph-web