Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3265492imj; Mon, 11 Feb 2019 17:26:46 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibg8hTUdDKi1v8kVQLXKG2yi7qH6w1iFkgl5B7HnWbV2OIFswpL+lMafG9TXBSC2UXqkEWT X-Received: by 2002:a62:9683:: with SMTP id s3mr1324094pfk.60.1549934805959; Mon, 11 Feb 2019 17:26:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549934805; cv=none; d=google.com; s=arc-20160816; b=KgQcIytlL17GqGmeaQJHycz1VCs6ntqdyFkfCQEPFalyD+IHtyN2Sl4NtcnxKMWxzx 9P1ZTvM2T5x8WkuKnV2una7dCSXq3DQxRtdME3Kv1vU8BAUrkKtznZYu4igYRUQZS3gw qQLQnZHoMHG+RibaPQ71qC1zoWnYTHDHh6Pa9HtST/G+SLrxFRgkXZdKf1D7ARQXPir6 zsoDkLK3ek08kD1VJLGN6DOFCpT2QKG3QO0u2Nuvr5V+XkmvYGjjBvQYuuTdokyLgNuF VRmZEOg/5Z85WXuznBU+Ow8Ptu+SOoBBO6VbdO5y4v9JRs4b7Qrk5ZMEwI+iQcIdWTVR Ee8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tjplqgKWE3Hxn72OdOjfAgA2B9kW+HOJdNRvmQcqtBU=; b=WWmHb3pos8Vvr+SraXVrnPkJ5qUunNQQGSCQj9a9yooJL9x3JSTlcZYDRExkxNNjyE SVis7+DQHOecNkTar0w8Mm/Tu84OwbrkGSAz/7scn6O+ubpwuuuXa3PyCRS3v5nh6HYr yP9hI53p6arJvduqMoELfBfUWS6G6rsMVZCyXYhwrEImbf5TDlFx4XRaLYM0mtLOExQI eVXhp5EQewYTIforXlBye0/0ZGeEBqJ9/5lIA9ej6ihyxGh0menoSFH2cqkqLnNfbG4R X7O7EiCUDDI/V3C1Fn2LiWLbg8wi+4rGGllIZViDLmGNM0G2iGVeIkH0XVJw8x31ZR8f SSdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kTOcJz2Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si11701605pll.306.2019.02.11.17.26.29; Mon, 11 Feb 2019 17:26:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kTOcJz2Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbfBLB0X (ORCPT + 99 others); Mon, 11 Feb 2019 20:26:23 -0500 Received: from mail-ua1-f67.google.com ([209.85.222.67]:33916 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbfBLB0X (ORCPT ); Mon, 11 Feb 2019 20:26:23 -0500 Received: by mail-ua1-f67.google.com with SMTP id x15so342050uaq.1 for ; Mon, 11 Feb 2019 17:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tjplqgKWE3Hxn72OdOjfAgA2B9kW+HOJdNRvmQcqtBU=; b=kTOcJz2ZF73lKlesFnKYD0iEmI0plfu6EuXCcoJ6kJKDZPfjpJGUSCp3DuhQ6OELVg 5HhafM/ks7gDn02lvD5VacZAtMTrAu5New5ehqSGe1dBNc+0ZaBWBxgdfn5RgePWCruq I4VRoypIEvm6GzpzCYX3K/JnpeK7DLkQ7GF4c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tjplqgKWE3Hxn72OdOjfAgA2B9kW+HOJdNRvmQcqtBU=; b=fzxzgtaqw1aEl9PBsFnCPn2veoXFhU2b4MiNKDjkGBh1gICkPwujwPU3H94XNb8zqt pz5LL+MH0NGUYtLhuHGpkS9r9XOzHJyuXISgt1DEX8UNpaWNJAsvuu1Xl3Y1ArAH9ZKz 7hCXUbLxlMR5ssQtYzqJXgM6KLYpSvRf2VD9v5Kq5sSkKe7CrUzF3x29Hwj3gKGhLD3u FzS5C473cFadV/wtyB5RZUFsfdkorJjpimTmp7dgouLitREdFbTPrL/bilklNWAHQjc7 zyBTk0SHLwhC6OZ0xrMFQ1ZcQZY0t/7kXDFyN3xfn4BIWXkVzz5ycBeb37WMG/UB/9K+ 41hQ== X-Gm-Message-State: AHQUAuZaG1D8yv10l7mgM++U0GJNkqsMUQLtnRWQXproiCLWS4NdEEuC NXB56CIh0gYALnHskSE7HecEht7QZAg= X-Received: by 2002:ab0:69ca:: with SMTP id u10mr470563uaq.57.1549934781065; Mon, 11 Feb 2019 17:26:21 -0800 (PST) Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com. [209.85.221.178]) by smtp.gmail.com with ESMTPSA id q199sm2848914vke.23.2019.02.11.17.26.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 17:26:19 -0800 (PST) Received: by mail-vk1-f178.google.com with SMTP id o130so220897vke.10 for ; Mon, 11 Feb 2019 17:26:19 -0800 (PST) X-Received: by 2002:a1f:4982:: with SMTP id w124mr512476vka.4.1549934779282; Mon, 11 Feb 2019 17:26:19 -0800 (PST) MIME-Version: 1.0 References: <25bf3c63-c54c-f7ea-bec1-996a2c05d997@gmail.com> In-Reply-To: From: Kees Cook Date: Mon, 11 Feb 2019 17:26:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v4 00/12] hardening: statically allocated protected memory To: "igor.stoppa@gmail.com" Cc: Igor Stoppa , Ahmed Soliman , linux-integrity , Kernel Hardening , Linux-MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 11, 2019 at 5:08 PM igor.stoppa@gmail.com wrote: > > > > On Tue, 12 Feb 2019, 4.47 Kees Cook > >> On Mon, Feb 11, 2019 at 4:37 PM Igor Stoppa wrote: >> > >> > >> > >> > On 12/02/2019 02:09, Kees Cook wrote: >> > > On Mon, Feb 11, 2019 at 3:28 PM Igor Stoppa wrote: >> > > It looked like only the memset() needed architecture support. Is there >> > > a reason for not being able to implement memset() in terms of an >> > > inefficient put_user() loop instead? That would eliminate the need for >> > > per-arch support, yes? >> > >> > So far, yes, however from previous discussion about power arch, I >> > understood this implementation would not be so easy to adapt. >> > Lacking other examples where the extra mapping could be used, I did not >> > want to add code without a use case. >> > >> > Probably both arm and x86 32 bit could do, but I would like to first get >> > to the bitter end with memory protection (the other 2 thirds). >> > >> > Mostly, I hated having just one arch and I also really wanted to have arm64. >> >> Right, I meant, if you implemented the _memset() case with put_user() >> in this version, you could drop the arch-specific _memset() and shrink >> the patch series. Then you could also enable this across all the >> architectures in one patch. (Would you even need the Kconfig patches, >> i.e. won't this "Just Work" on everything with an MMU?) > > > I had similar thoughts, but this answer [1] deflated my hopes (if I understood it correctly). > It seems that each arch needs to be massaged in separately. True, but I think x86_64, x86, arm64, and arm will all be "normal". power may be that way too, but they always surprise me. :) Anyway, series looks good, but since nothing uses _memset(), it might make sense to leave it out and put all the arch-enabling into a single patch to cover the 4 archs above, in an effort to make the series even smaller. -- Kees Cook