Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1279093imm; Wed, 25 Jul 2018 15:07:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdwe+lJD0qMNVx4z7OuodG0NjDVLk6EQZwoNUole2lDRknQpc18KFvxBjZ9imDt9WADdDDj X-Received: by 2002:a17:902:be07:: with SMTP id r7-v6mr23209552pls.124.1532556425548; Wed, 25 Jul 2018 15:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532556425; cv=none; d=google.com; s=arc-20160816; b=p+4XPbATq3hhzu9HO23eQqSyq0VGqkx/yjNF3ypuDwYKcfZ2zO04qiLJfaDnTWlViE fHantifaJUnG8at4lWGetH1Gqo921gPIeMOeF/orBysZhwishfQslYkSqWof3fpbdbRd iRsRNu6KRvAFM9mRCsNLzMlJwdB4I15fQl5QIPRLjh7pyBezV3GHcOL2sNbQZCsQWN1G Haxc+cBfnmeJk+CSHVbjsNoggbZqO3HsMvzByRpWlR8gZWLOPtT1/3UGiseIwtSC4cnW wJe1s9TEFkTHk0oAubRHLB74f/rfJqYwZk23LgQG7mVkhp0R+MzfYl85kXyvguQ4mnzB 8Yow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=TqUQGvjpy6YGyMH+20ABayDGzBCid31vSSfRp2cZRxI=; b=kwA+F38L46nb3SA3W3PDPgeaNYT8sQv5HgAgGew0kfBDtWg8r70R8IWRtzmnf+uR64 I6ecs78miy2B4oC6N5wzJ3Lb1w+499rEduy6e7u+eh9peQjizF20hNCRBKxc1ddYXwlz RApsISkd/b4xiBuZ8rJ/rZj43nOBGvmArtuMZ2KOGEpMLW9sVdmvw3Vz5VhUVB8uxVy7 uTIUQ4DT0b1yWYO0OFkiybusiufGlQL/DTXvH4s4UvhFDcR7OGCYRk7Fza/7XQczxazS xtzy2DlIqYEDRHjylopwwNTq9pEPQA8hgUiVA2Nml7JIakHQm0kfJrUx7qOyCmMxN7fX 8iXg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si14915231pgg.326.2018.07.25.15.06.50; Wed, 25 Jul 2018 15:07:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731370AbeGYXTn (ORCPT + 99 others); Wed, 25 Jul 2018 19:19:43 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:46520 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729182AbeGYXTn (ORCPT ); Wed, 25 Jul 2018 19:19:43 -0400 Received: by mail-qk0-f193.google.com with SMTP id o2-v6so5942234qkc.13 for ; Wed, 25 Jul 2018 15:06:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TqUQGvjpy6YGyMH+20ABayDGzBCid31vSSfRp2cZRxI=; b=dxvdz6b0DYj+gaticvw8roHJRiRFZO1r7Dy5cVtZYzzXpmAlgYVa14xShm2270P/wY txJaU+A5mZYpAFZI9aT9CvEKTHRWn9ukMeDn9dDG+hbGPoWobhmOhYhrBBGGclzs+Pjl ZxqTFmiHIYkU38q3K4lWlHwcc2j/KlOnMJ844Gm79YMR9SGkDg0pvXQKJS8Jx8eHoA8O dc4H5DwQeCb1l17jX6UadjwZv9aiurnG2jWD9SOwmhG5rxJjuNzCR4Tq9ByybzgaOiXg P1Im95HimvkKhIzPklUM7HlXPTi7L2EhQ/fCwQA5B1J+FitqOnJmgKLLzNowl9CUqXaO K8aw== X-Gm-Message-State: AOUpUlElHtXnkpM8kcMv2KDGRqcT88ynach3Vwyhh7xBT7LUX6LQNdIr RDvWkMbN8CbFvGSSRPMl1jlDCg== X-Received: by 2002:a37:7883:: with SMTP id t125-v6mr22151086qkc.334.1532556362345; Wed, 25 Jul 2018 15:06:02 -0700 (PDT) Received: from ?IPv6:2601:602:9802:a8dc:4eb2:6dae:ab32:e5b0? ([2601:602:9802:a8dc:4eb2:6dae:ab32:e5b0]) by smtp.gmail.com with ESMTPSA id 134-v6sm10392072qke.94.2018.07.25.15.05.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 15:06:00 -0700 (PDT) Subject: Re: [PATCHv3 0/2] Stackleak for arm64 To: Will Deacon Cc: Alexander Popov , Kees Cook , Mark Rutland , Ard Biesheuvel , kernel-hardening@lists.openwall.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Catalin Marinas , james.morse@arm.com References: <1531341400-12077-1-git-send-email-alex.popov@linux.com> <20180720214154.2940-1-labbott@redhat.com> <20180724163807.GE25888@arm.com> <20180725114954.GD30289@arm.com> From: Laura Abbott Message-ID: Date: Wed, 25 Jul 2018 15:05:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180725114954.GD30289@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/25/2018 04:49 AM, Will Deacon wrote: > Hi Laura, > > On Tue, Jul 24, 2018 at 05:38:07PM +0100, Will Deacon wrote: >> On Fri, Jul 20, 2018 at 02:41:52PM -0700, Laura Abbott wrote: >>> This is the version of stackleak for arm64, hopefully ready for queueing >> >> Thanks. I'll push these into linux-next tomorrow, once I've had a chance >> to test my conflict resolution in entry.S. > > I've run into a couple of issues with this series: > > 1. I had to install libmpc-dev to get GCC_PLUGINS to appear, otherwise the > hostcc check would silently fail. I guess that's a general observation, > but it might be nice to print a message about the missing dependencies. > > 2. It breaks arm64 allmodconfig build. Log below. > > Please can you take a look at the build failure? Otherwise, the patches > look good to me. > > Cheers, > > Will > > --->8 > > arch/arm64/kernel/sdei.c: In function ‘on_sdei_normal_stack’: > arch/arm64/kernel/sdei.c:101:7: error: dereferencing pointer to incomplete type ‘struct stack_info’ > info->low = low; > ^~ > arch/arm64/kernel/sdei.c:103:16: error: ‘STACK_TYPE_SDEI_NORMAL’ undeclared (first use in this function); did you mean ‘SCHED_NORMAL’? > info->type = STACK_TYPE_SDEI_NORMAL; > ^~~~~~~~~~~~~~~~~~~~~~ > SCHED_NORMAL > arch/arm64/kernel/sdei.c:103:16: note: each undeclared identifier is reported only once for each function it appears in > arch/arm64/kernel/sdei.c: In function ‘on_sdei_critical_stack’: > arch/arm64/kernel/sdei.c:121:16: error: ‘STACK_TYPE_SDEI_CRITICAL’ undeclared (first use in this function) > info->type = STACK_TYPE_SDEI_CRITICAL; > ^~~~~~~~~~~~~~~~~~~~~~~~ > arch/arm64/kernel/sdei.c: At top level: > arch/arm64/kernel/sdei.c:127:6: error: conflicting types for ‘_on_sdei_stack’ > bool _on_sdei_stack(unsigned long sp, > ^~~~~~~~~~~~~~ > In file included from ./include/linux/arm_sdei.h:14:0, > from arch/arm64/kernel/sdei.c:5: > ./arch/arm64/include/asm/sdei.h:45:6: note: previous declaration of ‘_on_sdei_stack’ was here > bool _on_sdei_stack(unsigned long sp, struct stack_info *info); > ^~~~~~~~~~~~~~ > arch/arm64/kernel/sdei.c: In function ‘_on_sdei_stack’: > arch/arm64/kernel/sdei.c:136:33: error: ‘info’ undeclared (first use in this function); did you mean ‘int’? > if (on_sdei_critical_stack(sp, info)) > ^~~~ > int > arch/arm64/kernel/sdei.c:131:21: warning: unused variable ‘high’ [-Wunused-variable] > unsigned long low, high; > ^~~~ > arch/arm64/kernel/sdei.c:131:16: warning: unused variable ‘low’ [-Wunused-variable] > unsigned long low, high; > ^~~ > make[1]: *** [arch/arm64/kernel/sdei.o] Error 1 > make[1]: *** Waiting for unfinished jobs.... > make: *** [arch/arm64/kernel] Error 2 > Ugh this was a failure that I missed folding in, sorry about that --- 8< ---- diff --git a/arch/arm64/kernel/sdei.c b/arch/arm64/kernel/sdei.c index 7154fee1cb2b..a94a868f0532 100644 --- a/arch/arm64/kernel/sdei.c +++ b/arch/arm64/kernel/sdei.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -125,11 +126,8 @@ bool on_sdei_critical_stack(unsigned long sp, } bool _on_sdei_stack(unsigned long sp, - unsigned long *stack_low, - unsigned long *stack_high) + struct stack_info *info) { - unsigned long low, high; - if (!IS_ENABLED(CONFIG_VMAP_STACK)) return false;