Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751665AbdDHEND (ORCPT ); Sat, 8 Apr 2017 00:13:03 -0400 Received: from mail-yb0-f172.google.com ([209.85.213.172]:34772 "EHLO mail-yb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751090AbdDHEMz (ORCPT ); Sat, 8 Apr 2017 00:12:55 -0400 MIME-Version: 1.0 In-Reply-To: References: <1490811363-93944-1-git-send-email-keescook@chromium.org> <1490811363-93944-5-git-send-email-keescook@chromium.org> From: Daniel Micay Date: Sat, 8 Apr 2017 00:12:53 -0400 Message-ID: Subject: Re: [kernel-hardening] Re: [RFC v2][PATCH 04/11] x86: Implement __arch_rare_write_begin/unmap() To: Kees Cook Cc: Thomas Gleixner , Andy Lutomirski , Mathias Krause , "kernel-hardening@lists.openwall.com" , Mark Rutland , Hoeun Ryu , PaX Team , Emese Revfy , Russell King , X86 ML , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Peter Zijlstra Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1354 Lines: 24 > I probably chose the wrong name for this feature (write rarely). > That's _usually_ true, but "sensitive_write()" was getting rather > long. The things that we need to protect with this are certainly stuff > that doesn't get much writing, but some things are just plain > sensitive (like page tables) and we should still try to be as fast as > possible with them. Not too late to rename it. Scoped write? I think it makes change to use a different API than PaX for portability too, but not a different x86 implementation. It's quite important to limit the writes to the calling thread and it needs to perform well to be introduced widely. > I'm all for a general case for the infrastructure (as Andy and Mark > has mentioned), but I don't want to get into the situation where > people start refusing to use it because it's "too slow" (for example, > see refcount_t vs net-dev right now). Meanwhile, the PaX implementation has improved to avoid the issues that were brought up while only introducing a single always-predicted (due to code placement) branch on the overflow flag. That seems to have gone unnoticed upstream, where there's now a much slower implementation that's not more secure, and is blocked from introduction in areas where it's most needed based on the performance. Not to mention that it's opt-in... which is never going to work.