Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1209075imm; Wed, 11 Jul 2018 20:12:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcbQ+z0EPIWAnvunFqf49dagNsxZunPeYAt1ePkEEGMliNqCOX3b3xiqRAAubjy2bij40LA X-Received: by 2002:a63:1e08:: with SMTP id e8-v6mr448949pge.281.1531365145115; Wed, 11 Jul 2018 20:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531365145; cv=none; d=google.com; s=arc-20160816; b=DXUuU+8TDrMOzFlp6uHk3A3QNLeO5LNg9PWSeXvvt2NXRziM3utPgBzg4Wx4opdiPN v6SPuSBWMXYNcg7DEnXqHb654wAspHSlSodcdLOp6dFT1/8GNNg/ibp/IqD8tE8fBQHv G4i1a52iMqLtnBXt9ryVckTCr1E9zdXkCMZfjI92GFOumhUcwdwjxuc8cJfxHeX0W5MX NilY/2yEdSrvpdjV+6sNZGh/M5dWhmbXEWdeIZ5hdqaPQSkeETXHhLZKpA1OOx4NhytL vov0sIc9EszbRegTCG+UmdkWbB7RcJvANEzC1Hy+4oltwXriF5+4sfufrg+w1O3Did0H cyjQ== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=Lh3G6ijysGk7hzzWxXKzuyM9t1uCBV7NJ1HstZBtPO0=; b=c+3Q5dZQDTrburvV6hytu52gkGCRLGyyX7/y+IwR49E3ppVomgHtauG4xWcTDITMhO B80z0h496H7ZYrsRP0oB4rZCyQrYsEOJEX8FCjcJvAb41pCKcCTraY29hFQf8M1xq5iS De77jz8//H0+KJpk7DXMwfxydCQWQ/tCVS0qc2yoR7pFvk2FGF3hAGLZbXi4I2Em15iP SQBVIxipi3FdZKSCzK2yXgDegSyH9AzAJIk8qIiP7Zt4YHzCIQ+dqy9gW5vdw35S0L0B Uyo92kfoLKO10z4iEatuWrZJkqMMyit+1ksslenkuRUXTpL6MI/dVsxBsf0IyC4yF3ht kSuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=tCa+d3Di; dkim=fail header.i=@chromium.org header.s=google header.b=nZoNvSdb; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 75-v6si20578131pgh.110.2018.07.11.20.12.10; Wed, 11 Jul 2018 20:12:25 -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; dkim=fail header.i=@google.com header.s=20161025 header.b=tCa+d3Di; dkim=fail header.i=@chromium.org header.s=google header.b=nZoNvSdb; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389965AbeGLCNh (ORCPT + 99 others); Wed, 11 Jul 2018 22:13:37 -0400 Received: from mail-yb0-f196.google.com ([209.85.213.196]:42672 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732852AbeGLCNg (ORCPT ); Wed, 11 Jul 2018 22:13:36 -0400 Received: by mail-yb0-f196.google.com with SMTP id c10-v6so9094105ybf.9 for ; Wed, 11 Jul 2018 19:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Lh3G6ijysGk7hzzWxXKzuyM9t1uCBV7NJ1HstZBtPO0=; b=tCa+d3DiBo5PCBVvHRC3yu4hZ6IMWUrUZsBt9QEi+NUqXqTo6HBF3C8t46QutXc4WA 0WrqPlHe9pXXtbrP1YQE3JdfVnkJMBssSkO6tBa6/h4/xf9w5AxNyfu/aHE+2GNKvUBm 6EDm1zhbnPOKuGp5Jv2vkWYNO2LEM1fTVU3ZlwH46WHRj8hsN28LUKVAMIBYfwDRRACB XE0pdTMMOi89K0PbVQQOKmKqMSY9s5bSaOURoh8Oq8htcun7wM1HCliF9GnWikG6pJ/Z KrRygtnLTgzZloAc4vNuoWZ8Cy8Zofzx1AHWsFqMnTa4XiRwKTINAOJeRO65bk9tEzPT EFjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Lh3G6ijysGk7hzzWxXKzuyM9t1uCBV7NJ1HstZBtPO0=; b=nZoNvSdbriCr3mO19+iV5BofxxhyuBmuH5T0Qcp/ihjx3ziB3smpBLUJz3rkh+nQ31 j7vOWbfq2cgflf9MJ/yvy3CCUQt3xADc3QYZ6aq8y4gGxynyH4E5GPvSxpTzViSg6B9T 5I1pbxuKTKgPaNKsPDTfzP7DWSgWfoOkqZNlU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Lh3G6ijysGk7hzzWxXKzuyM9t1uCBV7NJ1HstZBtPO0=; b=b9Kq/GVX7aX588GgJWRJoJW49GTLPk0SfS7X0a77+zAUwXDNv27cJRfU9PpQOZ57o8 BTY6MCGH8mbkR7tEWIfNsU0UUdIaJzJFRZGUx5o0Ccgnx1Wj5kjpWU7e9Cj/wMGl2eY3 7P/70CPTqy5ET9GV59EzF3LcV210GysuKWUT2/nKxt7fYddSVIbaGK27RTUNBsHN0sFU F5NrbyLLxjmOkksSGYBNP1nANlVlG88ORE6dr2jofnk2IBEJ8ojmZj0x0Rhy6lvCYgkT Rc07x9NFO1/EvYc5q4KZfL3ChA5wQ8aHjmq3YmAE7A6OidnT0+7uXMyPRJGWPrariRCZ AmcA== X-Gm-Message-State: AOUpUlGDLf62Kv/BrqyGy9znOzdbL6U1i2k3aj2Al+w1WqMl3GnqrNcY yVBs8JhCOhGoHG6SAHoLgTlmOuu1hpaBY4wGt29AZQ== X-Received: by 2002:a25:b219:: with SMTP id i25-v6mr161705ybj.112.1531361185687; Wed, 11 Jul 2018 19:06:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:5f51:0:0:0:0:0 with HTTP; Wed, 11 Jul 2018 19:06:25 -0700 (PDT) In-Reply-To: <08f1c1d4-52a8-6d42-fe56-241c255ba934@redhat.com> References: <20180712000337.GA4022@beast> <08f1c1d4-52a8-6d42-fe56-241c255ba934@redhat.com> From: Kees Cook Date: Wed, 11 Jul 2018 19:06:25 -0700 X-Google-Sender-Auth: GP7OoByvHCEKupBdPdJKeIuFOns Message-ID: Subject: Re: [PATCH] arm64: Add support for STACKLEAK gcc plugin To: Laura Abbott Cc: Will Deacon , Mark Rutland , Ard Biesheuvel , Kernel Hardening , LKML , linux-arm-kernel , Alexander Popov , Catalin Marinas 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 Wed, Jul 11, 2018 at 6:45 PM, Laura Abbott wrote: >> +#ifdef CONFIG_GCC_PLUGIN_STACKLEAK >> +#define MIN_STACK_LEFT 256 >> + >> +void __used stackleak_check_alloca(unsigned long size) >> +{ >> + unsigned long sp, stack_left; >> + >> + sp = current_stack_pointer; >> + >> + stack_left = sp & (THREAD_SIZE - 1); >> + BUG_ON(stack_left < MIN_STACK_LEFT || >> + size >= stack_left - MIN_STACK_LEFT); >> +} >> +EXPORT_SYMBOL(stackleak_check_alloca); >> +#endif > > > I think the conclusion was this needs to be re-written to account > for the different stack sizes in the same way as x86. Oh, whoops! Sorry, I missed that fork of the thread. :) -Kees -- Kees Cook Pixel Security