From patchwork Sat Nov 10 22:05:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Popov X-Patchwork-Id: 10677447 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 BAD2D15A6 for ; Sat, 10 Nov 2018 22:05:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A805C2C079 for ; Sat, 10 Nov 2018 22:05:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AA5B2C153; Sat, 10 Nov 2018 22:05:55 +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 BC9F72C079 for ; Sat, 10 Nov 2018 22:05:54 +0000 (UTC) Received: (qmail 28042 invoked by uid 550); 10 Nov 2018 22:05:52 -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 28010 invoked from network); 10 Nov 2018 22:05:52 -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; bh=pYkHvT7Kj+Of9cWYDNEc04Shp+/KNmHnxms8QJaJZYM=; b=JiAnrfLxd92Z739wWk16iaUOmLF0YBtUZPmMlqklnq5aEdYclqesthpPmNBe+kkWA5 ztW++P1/eQn9nnn0NtIFEPVgoRBgOh/zSckZZJJFIPfOSopIfDZSX7eY0gJnKW5HW8iW ndQp63lFSYYmH3ySNQXvHhZYnCX5qJ/3ywpHLUGXhhNJihh3ePTFiuroAxykLrJC6GQr vJ2RddKHMYKGYFLuNgO6CEDAD+A84biHd8mL/D63GLGeDD4FSG3iBqzQHTEU003GdnFe 7Q2U7D6u4E2LcvCRl8CnHdwciH91Bc+jQ1s4LW6g53S3qctD53wPkvIjab7FyXKE4dcK x3+g== X-Gm-Message-State: AGRZ1gKaIREDMnwAMGgkf4vCX4QLuRIaw7oJTFoZGhfUi6I5IHSYKKj2 yriEC22ez+qbnFGxH2PVS8Zyotub X-Google-Smtp-Source: AJdET5f7i2ZruZqnmoYdoVVrHEZsYq/Rp2mHAvgHHhVMqp/NRJd0HoiMI47tYh4edKTdAA72FeqSzg== X-Received: by 2002:a19:920a:: with SMTP id u10mr8101431lfd.122.1541887540432; Sat, 10 Nov 2018 14:05:40 -0800 (PST) From: Alexander Popov To: kernel-hardening@lists.openwall.com, Kees Cook , Jann Horn , Ingo Molnar , Andy Lutomirski , Joerg Roedel , Borislav Petkov , Thomas Gleixner , Dave Hansen , Steven Rostedt , Peter Zijlstra , Jan Kara , Mathieu Desnoyers , Dan Williams , Masahiro Yamada , Masami Hiramatsu , x86@kernel.org, alex.popov@linux.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] stackleak: Disable ftrace for stackleak.c Date: Sun, 11 Nov 2018 01:05:30 +0300 Message-Id: <1541887530-16610-1-git-send-email-alex.popov@linux.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP The stackleak_erase() function is called on the trampoline stack at the end of syscall. This stack is not big enough for ftrace operations, e.g. it can be overflowed if we enable kprobe_events for stackleak_erase(). Let's disable ftrace for stackleak.c to avoid such situations. Reported-by: kernel test robot Signed-off-by: Alexander Popov Reviewed-by: Kees Cook --- kernel/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/Makefile b/kernel/Makefile index 7343b3a..0906f6d 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -18,6 +18,7 @@ obj-$(CONFIG_MULTIUSER) += groups.o ifdef CONFIG_FUNCTION_TRACER # Do not trace internal ftrace files CFLAGS_REMOVE_irq_work.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_stackleak.o = $(CC_FLAGS_FTRACE) endif # Prevents flicker of uninteresting __do_softirq()/__local_bh_disable_ip()