Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3864528imu; Fri, 30 Nov 2018 07:12:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/XSLeGRU9FUPyYf4bQy67/wFzAlk7sO0jDSYfA01D/q+m0fNNdIiRddGpTSDF99L8yMRJH6 X-Received: by 2002:a17:902:4124:: with SMTP id e33mr6033461pld.236.1543590773888; Fri, 30 Nov 2018 07:12:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543590773; cv=none; d=google.com; s=arc-20160816; b=I3NzVyw8t6k/adrbU5Bd50H+kXMrOMpPAqfpxkzW80G4T2dBPam4coWJXQ7VZfBRzj sCMDITZIgkgssYlYSRU9iTiRz9noCsroeqFJya32hRYFcOe/CcU/xn03Wh+yWyOXdwOa AWldKVnGmrUWEf5jSz+GMbTk3d2sWAFV+0JwG6M3ogUAV2X5frL73WHTZHqgsO4IybSS c/VWdDgxBtSGLg1HVq8ng/rqAQ6CZwLphMn5LgLoB1gA1kOBeWDluqxYg2Cv8nsadepn mY12izVsJ3YeuFwk8jbNYyT66AAG+/F+tjazA4MlAOhjs9nxUqcuYE6kQAUfF+bZmR2l ajTA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=cevKt/iVwCRv9xli91T/QyVSDidq+ft7LMiFzNhTbQc=; b=n0qg5uXxyPXpecJV2fHBOcAz+dJGsh891k+4SPHh83sevjZsl6gzeSORXNmMAuIgdR TLt84RihcG9XOGRv7E8s/tmerL9BG+rHFDUAtEimdUi8SOc9SVjrpM4IvjP1QJ6Y42Jh td0nBUC+ivrNMpZDaxflz+EXPuRxNmdWiR5UO2lL1gaa+20aH8RtbscyL6ftc0Ma4i+y tcM7zTRNK18RS4uCq1rhHbmrW3l2i5fBdKb0DaVadzvth8Ty0ZZEGeCh2ovFmhua75of CUIVFzGoMlMF549pPTeStnc3F5/eMH7M2RfJiIiIQG2243nf04izNeNuwUK8kFcam64e SyrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Awggy/OC"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v190si5676533pfv.8.2018.11.30.07.12.01; Fri, 30 Nov 2018 07:12:53 -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=@linaro.org header.s=google header.b="Awggy/OC"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727055AbeLACSw (ORCPT + 99 others); Fri, 30 Nov 2018 21:18:52 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44229 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbeLACSw (ORCPT ); Fri, 30 Nov 2018 21:18:52 -0500 Received: by mail-lj1-f193.google.com with SMTP id k19-v6so5258732lji.11 for ; Fri, 30 Nov 2018 07:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cevKt/iVwCRv9xli91T/QyVSDidq+ft7LMiFzNhTbQc=; b=Awggy/OCtNUr8kqjtPE28UJFmBPZvDO48FDcUcWjDpeHWrRglJpug7qXTQQCvQ05ER 3mxRE/+7bidUJDNjqD7hHAVoV43JehZ2xsPfFjbcEKATeafqVHOrvmCANLYzYuDpH3r8 rPB9SO9J5Zarads+PxHl3nlT9XF8dBjrwROTc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cevKt/iVwCRv9xli91T/QyVSDidq+ft7LMiFzNhTbQc=; b=Yevo2sukd7UB+jOY1fCTKTwN2tZlHoN5bXoyRUaghAYpoAer9m+ESB6jLCHC8Q8LYG ykOZpXqNelxuKE1aH+xKfhzF+SVRrlUrQRxkkGarEVWw3AZK24m1wMrJbl+lAIJ32OHl r1DFah7AmyfgTOeuI6mNkBMqxYx953ACq7mRVQDGCwgpZd/q3Wb4ymn/wi3SvgBKzDOU XLktI8Su/fD5PASwL3jNEwwG/t1GUSVH+OOCuHUazckcdP0+W4Xmdrq9Ts2AeB6/UYp5 PetGyc5TKBuEgSLxEwyrB48yGRbcHhPqd+NXZJiMeZjQUJb6u0AzUtBeZ1Sshcr/zczl jkTw== X-Gm-Message-State: AA+aEWYcvsbJglj2870DOpjgWyEM1tilCkXj1kvzTqnhGVFuofYOhibk OyP3BwgRZ8MQ1Gedac/crKEpwQ== X-Received: by 2002:a2e:568b:: with SMTP id k11-v6mr4225309lje.105.1543590553021; Fri, 30 Nov 2018 07:09:13 -0800 (PST) Received: from localhost (c-732171d5.07-21-73746f28.bbcust.telenor.se. [213.113.33.115]) by smtp.gmail.com with ESMTPSA id o26sm912850lfl.18.2018.11.30.07.09.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Nov 2018 07:09:12 -0800 (PST) From: Anders Roxell To: keescook@chromium.org Cc: rostedt@goodmis.org, mingo@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Anders Roxell , Arnd Bergmann Subject: [PATCH 1/3] stackleak: mark stackleak_track_stack() as notrace Date: Fri, 30 Nov 2018 16:08:59 +0100 Message-Id: <20181130150859.27366-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function graph tracing recurses into itself when stackleak is enabled, causing the ftrace graph selftest to run for up to 90 seconds and trigger the softlockup watchdog. Breakpoint 2, ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:200 200 mcount_get_lr_addr x0 // pointer to function's saved lr (gdb) bt \#0 ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:200 \#1 0xffffff80081d5280 in ftrace_caller () at ../arch/arm64/kernel/entry-ftrace.S:153 \#2 0xffffff8008555484 in stackleak_track_stack () at ../kernel/stackleak.c:106 \#3 0xffffff8008421ff8 in ftrace_ops_test (ops=0xffffff8009eaa840 , ip=18446743524091297036, regs=) at ../kernel/trace/ftrace.c:1507 \#4 0xffffff8008428770 in __ftrace_ops_list_func (regs=, ignored=, parent_ip=, ip=) at ../kernel/trace/ftrace.c:6286 \#5 ftrace_ops_no_ops (ip=18446743524091297036, parent_ip=18446743524091242824) at ../kernel/trace/ftrace.c:6321 \#6 0xffffff80081d5280 in ftrace_caller () at ../arch/arm64/kernel/entry-ftrace.S:153 \#7 0xffffff800832fd10 in irq_find_mapping (domain=0xffffffc03fc4bc80, hwirq=27) at ../kernel/irq/irqdomain.c:876 \#8 0xffffff800832294c in __handle_domain_irq (domain=0xffffffc03fc4bc80, hwirq=27, lookup=true, regs=0xffffff800814b840) at ../kernel/irq/irqdesc.c:650 \#9 0xffffff80081d52b4 in ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:205 Rework so we mark stackleak_track_stack as notrace Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Anders Roxell --- kernel/stackleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/stackleak.c b/kernel/stackleak.c index e42892926244..5de3bf596dd7 100644 --- a/kernel/stackleak.c +++ b/kernel/stackleak.c @@ -102,7 +102,7 @@ asmlinkage void stackleak_erase(void) current->lowest_stack = current_top_of_stack() - THREAD_SIZE/64; } -void __used stackleak_track_stack(void) +void __used notrace stackleak_track_stack(void) { /* * N.B. stackleak_erase() fills the kernel stack with the poison value, -- 2.19.2