Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3078708ybt; Mon, 22 Jun 2020 14:31:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzadpWguBEGwUJGR+Vjyyr9PCLbQ6lgbyo0EKWyG0r1WewrneTTPoveh7udYO5UbXUGPkCY X-Received: by 2002:a17:907:20ee:: with SMTP id rh14mr17602866ejb.395.1592861478416; Mon, 22 Jun 2020 14:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592861478; cv=none; d=google.com; s=arc-20160816; b=vMXFSLEY1GsD87EvW6n8nI2qK/f4XgNOgDBJKTVVYAWYQw5Tu0dxmGlg2XamxARgdf LqeL4EHA/ui5MQ8wBqeonUtXKSJKL2a8AaDuUoSRXlJJZAY3FjuSY+FpbuwCDGCFiv4b 5riz3GoAi3yRG4Fv3/znNjg4wDBg3YWV/sTrYoJqAcFiWjSaDkxVAQ2Q5Cq2QKSCeG/J JhC/1nqmvq6CgQUGS9QpN38q5HpKtSd9dG4V+6OIAKJHI613jwUDUUOdeYbbHRNtsIZ4 4JZx33IttWz10tFOYGAFN/15B7pxgWiFBIYOny0OHHFFzYtwDF8F58aq4O4gqA6EaEgw G9zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+fGVHQGbJSfeZpDFh+8/BeMq0iFulsSXIRYour5Vm0w=; b=u0+kJYkmXtlwDrQAi8vnprJI2Y7rBIvM1G7WMwHw5VFaD9HMiOdRsjYA0b9dT2+Nsb 30ltdGw04830SehZ8MsyuBHRxfvI/iyhzkqCLTq6UlGTWR6NPvWtOro2hXVvaEsFm1Qi Aw4CXIMi7OyBWxZgeeQgRkg82JqGY/DDzxxHEfCvecysfiKYva4qAPRJTzbzZL+Qw09T H8bp2Bh7egcV1GY+OK4HTJ6neoN3qj1qk/Lq9gch57GteG/Vv8uThMjrWpKskMBUcixP kB9FoTQjbM3RBM1SVrDphKPw3KX/yu2uQ+RkgYINJ8vDfak1czai4JtplNQD38xquLUH IWNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=J00hIsrX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w11si1307396ede.247.2020.06.22.14.30.55; Mon, 22 Jun 2020 14:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=J00hIsrX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730520AbgFVV0a (ORCPT + 99 others); Mon, 22 Jun 2020 17:26:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730430AbgFVV03 (ORCPT ); Mon, 22 Jun 2020 17:26:29 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25D72C061573 for ; Mon, 22 Jun 2020 14:26:28 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id z5so356114pgb.6 for ; Mon, 22 Jun 2020 14:26:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+fGVHQGbJSfeZpDFh+8/BeMq0iFulsSXIRYour5Vm0w=; b=J00hIsrXU7lUbB9T6uH+6OCvgVWQVpgD3QI0ZPH4Hk8LTAUfUiRewvjxyBQzGiD1ve iFnCJBgzFqit6FhHqe5BM8n1JJmg8rHtVkq3RtopnM4OgUUVSs4z5vEKGujmdV8eaHzg QPi3H0BTKGLlJqCPNPE+nQs3/vQLHDYWXLkWY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+fGVHQGbJSfeZpDFh+8/BeMq0iFulsSXIRYour5Vm0w=; b=nQAumhEMXdqVuKpXvUcsQXogMWh0NtShzUH4fp4IADK6M9ICLEA69gBGpHGq0kRg8t Kt4vOJyTy49Wb6dVJReJMnqwvso1gukQGHDU4cALnBMX90We9RNYTKBGE6RuaxfAGM1i 8uhTK7p15LaV9fUBt3Qc2Aptafvs3r6MerRQJbSHnGnzEHoCzYf++IGvMPxvkV24rzpr TKWGzaL2gf3heEyq5q+to3bY1Y6mjeRFekg65hS6NF8qMZhNOM+oFrcIRmH/G4V4yw3Y TOes799Lcldb5pA00rqIFOSNTN5d72D9FCHG5/8+GZ2BQgbCJLYdTGzS+QGM84hOo0gH sYyA== X-Gm-Message-State: AOAM531TeE814vuw5x5OBEYH0oikY9fNq5k5BD1WmiX+f+tIUqBX7Uaq ZzY2SrErPxuJDTwNHm1Z6zOiJQ== X-Received: by 2002:aa7:8a4c:: with SMTP id n12mr22059315pfa.326.1592861187688; Mon, 22 Jun 2020 14:26:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u35sm11783923pgm.48.2020.06.22.14.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 14:26:26 -0700 (PDT) Date: Mon, 22 Jun 2020 14:26:25 -0700 From: Kees Cook To: Randy Dunlap Cc: Thomas Gleixner , Elena Reshetova , x86@kernel.org, Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , Mark Rutland , Alexander Potapenko , Alexander Popov , Ard Biesheuvel , Jann Horn , kernel-hardening@lists.openwall.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/5] stack: Optionally randomize kernel stack offset each syscall Message-ID: <202006221425.805E17B67@keescook> References: <20200622193146.2985288-1-keescook@chromium.org> <20200622193146.2985288-4-keescook@chromium.org> <87a7b943-ed15-8521-773e-c182a37ee61e@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a7b943-ed15-8521-773e-c182a37ee61e@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22, 2020 at 12:40:49PM -0700, Randy Dunlap wrote: > On 6/22/20 12:31 PM, Kees Cook wrote: > > This provides the ability for architectures to enable kernel stack base > > address offset randomization. This feature is controlled by the boot > > param "randomize_kstack_offset=on/off", with its default value set by > > CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT. > > > > Co-developed-by: Elena Reshetova > > Signed-off-by: Elena Reshetova > > Link: https://lore.kernel.org/r/20190415060918.3766-1-elena.reshetova@intel.com > > Signed-off-by: Kees Cook > > --- > > Makefile | 4 ++++ > > arch/Kconfig | 23 ++++++++++++++++++ > > include/linux/randomize_kstack.h | 40 ++++++++++++++++++++++++++++++++ > > init/main.c | 23 ++++++++++++++++++ > > 4 files changed, 90 insertions(+) > > create mode 100644 include/linux/randomize_kstack.h > > Please add documentation for the new kernel boot parameter to > Documentation/admin-guide/kernel-parameters.txt. Oops, yes. Thanks for the reminder! (I wonder if checkpatch can notice "+early_param" and suggest the Doc update hmmm) -- Kees Cook