From patchwork Thu Aug 16 22:17:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Popov X-Patchwork-Id: 10568261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9551F1390 for ; Thu, 16 Aug 2018 22:19:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 849472B8C4 for ; Thu, 16 Aug 2018 22:19:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75FE02B8C8; Thu, 16 Aug 2018 22:19:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 858412B8C4 for ; Thu, 16 Aug 2018 22:19:04 +0000 (UTC) Received: (qmail 28617 invoked by uid 550); 16 Aug 2018 22:18:01 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 28515 invoked from network); 16 Aug 2018 22:17:57 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=HK48LtC0t9m0PRU8VrvPhrF4molpr67f3Kkp461wI6w=; b=g1vWmMTMkCvu7Cnmc3qN9DNoU6UtpkIf5WrLdFwynS+NwSrKAjZckCm4w0rW2tFD9/ JB3A2zFARRcf0aBPE57jO0+q2VQ0PFVNlycH7qPBgiFnYOtwk8KpJ4mKaiZCHTfzWJXH Kmb+Sb6zUy1IziR0zoiYMVPffzullt/3IorU+fwl8Wkrxf1kYmzDAwZGAYUexSHQz2kj sl69nMZDGTZZN4SEo+mbr2pYsBaAoAo2dcyp4K/mJ/XXn0oame4r6SNfOzsyOtFjSPyg CJyiCvf9R1cHurzwj6lsomKjZm5etSTyaroDl3jsirdHtazkkclK9xaRwPEdXdkZRdtL LgWg== X-Gm-Message-State: AOUpUlE/fmt3pX2MDqpy5aPpEaBl0mokVTcbYpLmNfDDt2ARE4USh31a OsoWYAgGHGRRDFhN0NRhmsa8xhfbJnM= X-Google-Smtp-Source: AA+uWPyzzneUCX0z4FnZK0bcYripd+jRQrYRf+awUK35j3leClf4YOsx8jW3lwlO675cSSMsUUiVrw== X-Received: by 2002:a19:2194:: with SMTP id h142-v6mr19888542lfh.75.1534457865938; Thu, 16 Aug 2018 15:17:45 -0700 (PDT) From: Alexander Popov To: kernel-hardening@lists.openwall.com, Kees Cook , PaX Team , Brad Spengler , Ingo Molnar , Andy Lutomirski , Tycho Andersen , Laura Abbott , Mark Rutland , Ard Biesheuvel , Borislav Petkov , Richard Sandiford , Thomas Gleixner , "H . Peter Anvin" , Peter Zijlstra , "Dmitry V . Levin" , Emese Revfy , Jonathan Corbet , Andrey Ryabinin , "Kirill A . Shutemov" , Thomas Garnier , Andrew Morton , Alexei Starovoitov , Josef Bacik , Masami Hiramatsu , Nicholas Piggin , Al Viro , "David S . Miller" , Ding Tianhong , David Woodhouse , Josh Poimboeuf , Steven Rostedt , Dominik Brodowski , Juergen Gross , Linus Torvalds , Greg Kroah-Hartman , Dan Williams , Dave Hansen , Mathias Krause , Vikas Shivappa , Kyle Huey , Dmitry Safonov , Will Deacon , Arnd Bergmann , Florian Weimer , Boris Lukashev , Andrey Konovalov , x86@kernel.org, linux-kernel@vger.kernel.org, alex.popov@linux.com Subject: [PATCH v15 7/7] arm64: Drop unneeded stackleak_check_alloca() Date: Fri, 17 Aug 2018 01:17:04 +0300 Message-Id: <1534457824-7211-8-git-send-email-alex.popov@linux.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534457824-7211-1-git-send-email-alex.popov@linux.com> References: <1534457824-7211-1-git-send-email-alex.popov@linux.com> X-Virus-Scanned: ClamAV using ClamSMTP Drop stackleak_check_alloca() for arm64 since the STACKLEAK gcc plugin now doesn't track stack depth overflow caused by alloca(). Signed-off-by: Alexander Popov Acked-by: Will Deacon --- arch/arm64/kernel/process.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 7f1628e..740b31f 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -493,25 +493,3 @@ void arch_setup_new_exec(void) { current->mm->context.flags = is_compat_task() ? MMCF_AARCH32 : 0; } - -#ifdef CONFIG_GCC_PLUGIN_STACKLEAK -void __used stackleak_check_alloca(unsigned long size) -{ - unsigned long stack_left; - unsigned long current_sp = current_stack_pointer; - struct stack_info info; - - BUG_ON(!on_accessible_stack(current, current_sp, &info)); - - stack_left = current_sp - info.low; - - /* - * There's a good chance we're almost out of stack space if this - * is true. Using panic() over BUG() is more likely to give - * reliable debugging output. - */ - if (size >= stack_left) - panic("alloca() over the kernel stack boundary\n"); -} -EXPORT_SYMBOL(stackleak_check_alloca); -#endif