Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp910195imu; Tue, 11 Dec 2018 09:24:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/UE3PeWZo2kv7SpU13KlclNGl34m1KUQajHtNVbd8fo6nfOq/4jnw2JLMmqy4fl+DmceEkH X-Received: by 2002:a63:d513:: with SMTP id c19mr15326932pgg.287.1544549098204; Tue, 11 Dec 2018 09:24:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544549098; cv=none; d=google.com; s=arc-20160816; b=hfUY7sb1BpJ/rSkfN2ME+Wx2ZJcBMXS+KcJsGSb4Es99lxQUgiWz6uDIGtYVwdOOnI dckkbHu2mklHpvkLLwTdulHVc7sox7v0qL6wfKh2/0To86mJahv7ABCUsb0KRyes25ux qphTBQXYPJ+hKhwhSqaXLSpgIFnnllN7sjicApLniOyqbxOw63wzV2i8I0NMLMANbAnw Byozwoi/nS/uaEs/1Pjzj3K1v6kkguuoTt1jvotrcc6RlqmPodtd0a2OgoXkpH/1UD/a TCSqEDi5QQwfMOeS0Q9sTMTkGp8j4Mox9h+LyOOCXocd8t+YIFNj0+NOoTEWmQ6L1fZL BesQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=h0hsgksLXZZZ+Za4ufYtYeUu6sbcdg1JL7mSLK44kUY=; b=SYTFEa3BkeHSV7RjUr7jjJzPAKE0ye2grqZCFRjSIwoo3ItcNKADAIqKxb9XOvOrNL RXntw3R6mqj5kHc9KeanwuuLDlIgpVO35CCcVvU9i+Vlda2E4GT9TZrZIU1MRYZKELPI ndQKe7fu/TGWbKj+UEIQ4qmogcz2HJmKTJlc40WMx5WqQSMytljd38yv9xvRLKuycrkl j4Gy+MvcyTT6CEVgyTjWBiB+oijW0JEgFAkQZqF1QpiVod2IOj/j8yLm1U1Kf8gG5c5m rRslCuxOKJKwbtWorRotnn0/HJ8Od37QNiK96v4YySNM/q+h6LM74cSnsmnwJbsKHteQ GrCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=svMzx1Nh; 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 r2si12829762pgk.389.2018.12.11.09.24.43; Tue, 11 Dec 2018 09:24:58 -0800 (PST) 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=pass header.i=@lca.pw header.s=google header.b=svMzx1Nh; 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 S1727189AbeLKRSb (ORCPT + 99 others); Tue, 11 Dec 2018 12:18:31 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:44158 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbeLKRSb (ORCPT ); Tue, 11 Dec 2018 12:18:31 -0500 Received: by mail-qt1-f196.google.com with SMTP id n32so17233669qte.11 for ; Tue, 11 Dec 2018 09:18:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=h0hsgksLXZZZ+Za4ufYtYeUu6sbcdg1JL7mSLK44kUY=; b=svMzx1NhUA9/VSxg+zlHTLuVM1Ssqd+JJ3soT1feYkYRvsGy51GQxFr+fTh2/vEanU Vh3X3biNlEDE0T3+3TqTxCgKWoA3IBZaeQKhaH7Y4MRY/dYP95rmNdkMlF6s9VZvL2Up i05Lg8dUO8w4zpxnyWrMDxNbQxQs8WV6Mw6r+CojIOzDnUeMhFgYDGmRX+iqCYmtkHEj v0cMyZnE6QlWqtyOkrzmHFvdtkfi1qvAgUmuU2uk4wiy8r1+TMG3iZQEJRZZ5oyRVK5n TSA9+yGqA0UP3yA786ErRqWFNIBnhwPp+C9sSL8YxAvulCbOfLRUX9Tx9pppJ72twWzP Mh7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=h0hsgksLXZZZ+Za4ufYtYeUu6sbcdg1JL7mSLK44kUY=; b=r265q33Lj3Lq2X3NtsCWPDkcHs5prWbNABuCHsRTRRYOJ3zIFqJJG38L4crKXrIwh3 LdLKfXtFcHyAUZqHN03EQumS4DDNK6IL7IklpFrBII+wQuEBwxr7CLLt2DyMRS2+eIcg heu1FphQu488ic+d8RClBgVJuf8njVplpUzmRgOeMkzI2CFxKhpeWKGkc6FsfGoLUDLu eOZx/voG5nnVPR2AeGSQNE4Ghw3NtnupwxGVYHBCORRT44AqkjGcjEoLRnaehCWoxAob 0bN8xdtvsNV4zteVINFLQ6y7n0sPjtWEjqQpeWtiSsbZ4ev42Wh91oZXYf6BXUOpNLRl MVcA== X-Gm-Message-State: AA+aEWZfEgYcF7SnyVfKvysGW7107mM2GZJy8g5VFJkGCZlT7/raqo4R vcJaB0jeve7ftaKXX3KnzjbLXA== X-Received: by 2002:ac8:16d8:: with SMTP id y24mr17243898qtk.253.1544548709912; Tue, 11 Dec 2018 09:18:29 -0800 (PST) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id e89sm8298135qtb.78.2018.12.11.09.18.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 09:18:29 -0800 (PST) Message-ID: <1544548707.18411.3.camel@lca.pw> Subject: Re: [PATCH] arm64: increase stack size for KASAN_EXTRA From: Qian Cai To: Arnd Bergmann Cc: Catalin Marinas , Will Deacon , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev , Linux-MM , Linux ARM , Linux Kernel Mailing List Date: Tue, 11 Dec 2018 12:18:27 -0500 In-Reply-To: References: <721E7B42-2D55-4866-9C1A-3E8D64F33F9C@gmx.us> <20181207223449.38808-1-cai@lca.pw> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-12-11 at 13:42 +0100, Arnd Bergmann wrote: > On Fri, Dec 7, 2018 at 11:35 PM Qian Cai wrote: > > > > If the kernel is configured with KASAN_EXTRA, the stack size is > > increasted significantly due to enable this option will set > > -fstack-reuse to "none" in GCC [1]. As the results, it could trigger > > stack overrun quite often with 32k stack size compiled using GCC 8. For > > example, this reproducer > > > > size > > 7536 shrink_inactive_list > > 7440 shrink_page_list > > 6560 fscache_stats_show > > 3920 jbd2_journal_commit_transaction > > 3216 try_to_unmap_one > > 3072 migrate_page_move_mapping > > 3584 migrate_misplaced_transhuge_page > > 3920 ip_vs_lblcr_schedule > > 4304 lpfc_nvme_info_show > > 3888 lpfc_debugfs_nvmestat_data.constprop > > > > There are other 49 functions are over 2k in size while compiling kernel > > with "-Wframe-larger-than=" on this machine. Hence, it is too much work > > to change Makefiles for each object to compile without > > -fsanitize-address-use-after-scope individually. > > > > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715#c23 > > Could you clarify: are the numbers you see with or without the bugfix > from that bugzilla? > The numbers were from GCC8 which does NOT contain this patch [1]. GCC9 is awesome which reduced the numbers in half even for KASAN_EXTRA. Only thing is that GCC9 has not been officially released yet, so it is a bit inconvenient for users need to compile the compiler by themselves first. I am fine either way to drop this patch or keep it until GCC9 is GA. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715#c35