Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3704505imm; Mon, 2 Jul 2018 04:12:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKltFwzkdKkpHjSUOsHcT8umawN5hAucLeAPlUnCCqXnB8Fh5nevKtCim9zy7pmk7d3tDZG X-Received: by 2002:a65:64d7:: with SMTP id t23-v6mr21986377pgv.207.1530529962211; Mon, 02 Jul 2018 04:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530529962; cv=none; d=google.com; s=arc-20160816; b=htD2NpAu3u6Aan2iA315Z1VbhBBOwpn0VyrOa/2vU52MiCYhtZmEWc4++x2VaVhZzw oJXz2/N81Ta6KjguU5+33xG+MeszhJyfaubrkfsWDDDrYYIUnmE7QElUTD2aZauL9XLK 1gunalgcDDFMpT1xKWlaskMXriB+wZjTuBqrF+2q64Oc2oDRKwl+eUKE7Mp5iZVKHYiH GV76YtqowJXNpS0IlW/XuD20/wgUAfCDXAZ12cvcYu8F9j3Egeau5apQ7wRxC3EPuJ62 UQnFX4g9i/5c5NnaiNv0ljqCZf7qjYdVMyKKirl04pKR8FyrQ3pEB2DEz1Dg7jEbrTxn eveQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=K+7Ieq5iIvytl4cYskhszeUF9Qz1E/y5qio1Ipbrh1Q=; b=viMLUUz0SUBMQtf93/ciXp/nbaVHVeFMJVdpKvPOIc7tUFdsFbLSb+jNQZ3MfRSdTR S3rFvNEmfTBAhpTfcFpdan7osHTC+Q5yJpktP8vNQk7+/oxVI46zuWhuTDqtZWPFXusW 4mlxECAlLjMG05/GXypS/XSYVQAzfCi8Fp55/HULCu82oh6XROrd4UNUp+hpox8YNJEl Wjn4+9i7/MX41nmQzz8Qtgt4fAS4bEr0Xqkn0s1vAWT2ag84hS16Ne9GBDNvaZJIXxx1 nce4NlSOi6HxqF3Yq28XX+CHfSceQ6QR8fLEjBL/Jux2eiMQnk7yj3nqAxp6/sFVgewb 51Uw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b74-v6si3066450pfd.273.2018.07.02.04.12.27; Mon, 02 Jul 2018 04:12:42 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754556AbeGBJ64 (ORCPT + 99 others); Mon, 2 Jul 2018 05:58:56 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56310 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753269AbeGBJ6x (ORCPT ); Mon, 2 Jul 2018 05:58:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 41D3F18A; Mon, 2 Jul 2018 02:58:53 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 10D543F5BA; Mon, 2 Jul 2018 02:58:53 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 57EF81AE2FEE; Mon, 2 Jul 2018 10:59:32 +0100 (BST) Date: Mon, 2 Jul 2018 10:59:32 +0100 From: Will Deacon To: Kees Cook Cc: Laura Abbott , Mark Rutland , Ard Biesheuvel , Kernel Hardening , LKML , linux-arm-kernel , Alexander Popov , catalin.marinas@arm.com Subject: Re: [PATCH] arm64: Clear the stack Message-ID: <20180702095931.GB28665@arm.com> References: <20180629190553.7282-1-labbott@redhat.com> <706dc06b-0157-89cb-33a6-d0b9d811dcf0@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kees, On Fri, Jun 29, 2018 at 01:25:20PM -0700, Kees Cook wrote: > On Fri, Jun 29, 2018 at 1:22 PM, Laura Abbott wrote: > > On 06/29/2018 01:19 PM, Kees Cook wrote: > >> > >> On Fri, Jun 29, 2018 at 12:05 PM, Laura Abbott wrote: > >>> > >>> Implementation of stackleak based heavily on the x86 version > >>> > >>> Signed-off-by: Laura Abbott > >>> [...] > >>> +#define current_top_of_stack() (task_stack_page(current) + THREAD_SIZE) > >>> +#define on_thread_stack() (on_task_stack(current, > >>> current_stack_pointer)) > >> > >> > >> nit on types here. I get some warnings: > >> > >> kernel/stackleak.c:55:12: warning: assignment makes integer from > >> pointer without a cast [-Wint-conversion] > >> boundary = current_top_of_stack(); > >> ^ > >> kernel/stackleak.c:65:24: warning: assignment makes integer from > >> pointer without a cast [-Wint-conversion] > >> current->lowest_stack = current_top_of_stack() - THREAD_SIZE / 64; > >> ^ > >> > >> So I think this needs to be: > >> > >> +#define current_top_of_stack() ((unsigned long)task_stack_page(current) + > >> \ > >> + THREAD_SIZE) > >> > > > > Argh, missed that in an amend, can fix for next version if there > > are no other objections to this approach. > > No worries! I've made the change locally and will push this out to > -next unless there are objections? I'm a bit wary of conflicts in entry.S, since it's likely that we're going to have a lot going on in there for 4.19. Could I take this via arm64 instead, please, or are there dependencies on other parts of your tree? Will