Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10140379imu; Wed, 5 Dec 2018 17:09:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/WIcrUrDLqbg10SaugcDlQElhJP7JQYj6XADrH1Bvq0a5pn+IhHDfgTLF3OPeAoiaU4WiLp X-Received: by 2002:a62:8985:: with SMTP id n5mr26873664pfk.255.1544058589712; Wed, 05 Dec 2018 17:09:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544058589; cv=none; d=google.com; s=arc-20160816; b=iHbRtoAIvqO6spIfVvh2z9Vu8fmp3PF1WsuIJLCOcejiVkP+votrvYRr8ceW21Qwa/ XXdrETD5WlqWNaFlpsppde7aSqTslNafCEDS1JruJYFaJlWfjOY6n9KLZO2ETXFJKMlT 6SVhSE78pUffSiUAUU06tt2iinh6mgNwWfiyB73HUzL2G+sVoFddzofxsZxFiX7mwqMW FoSrYWfjYeOOvFPXzR/ZbLDwvC6a6WEru9jItASR+LK/TXgrEDsWhA3lKUwpTQorH6mn MEBJ1oya64eSLmra0nR7DfQLTmQegvUsLe7S3kDd3CxMQvDowMNGybHU7FS9SEZ6RXpn 5q0w== 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 :in-reply-to:references:mime-version:dkim-signature; bh=/jINOn+sc+LBZeMo1BY7lNtqrudJ8L4pImVfyYsvKio=; b=LQ8xVqpyW8K93HS+qFGVWn328klIA+oRIvpuXrHVoHKqjS9bYMYbNAz4exJb7nujNN /ufaqbm1lFQG4RQqiQ/w0Jlx6qKNBxtnaIgxKpLUHpEIbOBB39pQ6Fwljtg9ihdI3ThL 8nZuVbf6iQ881X/+zt++ve+7ZAHOons35fvy5474WB1h650C7xzxPPR9YhuhBTGdCHd3 zSpHBbGsM/U+j8bRMuryTiypba1d18GmaUYZwd7w9vjVehJ87mi+MrFUCiO5pYtVAC0r v6lQ0UV8JGDUdz1Ixi2Ndf2xhSAv/eapQxxG+23qdacHT5Ni+81S+bzab9rOSnRu3M45 Wkaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=etcSboKn; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si22551948plo.102.2018.12.05.17.09.34; Wed, 05 Dec 2018 17:09:49 -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=@chromium.org header.s=google header.b=etcSboKn; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728156AbeLFBIt (ORCPT + 99 others); Wed, 5 Dec 2018 20:08:49 -0500 Received: from mail-yb1-f195.google.com ([209.85.219.195]:41877 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727620AbeLFBIs (ORCPT ); Wed, 5 Dec 2018 20:08:48 -0500 Received: by mail-yb1-f195.google.com with SMTP id n134so958699ybf.8 for ; Wed, 05 Dec 2018 17:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/jINOn+sc+LBZeMo1BY7lNtqrudJ8L4pImVfyYsvKio=; b=etcSboKnrSf3gjBausw5JNUVn6fOhTzKy8NbTJP0l8Sx8LBzfCRlcFEvFoBahKoCRU 77CDRPgCmWT79f81oyAaivKXiWM0RwLYNKLieoI9uM7Wn1XVPF2VLJP+Wji4xSZf7lWt P/oUFq1ndWet0jsCIMciqfiPHDjHUj73ntpWQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/jINOn+sc+LBZeMo1BY7lNtqrudJ8L4pImVfyYsvKio=; b=pugQM/bsCXFexNszzUFvf9YbKHxPPpHrma4edm1HzBL7on8lxhVcQIdhmi09zCjvyM O9sP7fgFZQOFNwG2zzMJAJ3qEifGn6JC55KoEVuPMjF5irujY8PcOW+yJNWhkG5jxFQH ZL2o2+yW+SJTmu45rE+CuPkihc1txh6KF18cqEYeHaQs/qqSz87rpsQEIC8mvaHmpTr0 SGythsGSklOYhlYfYy/6vorFP94KRKywDrlcIhOzG1tpTQPTR0KkdyZiqRZNX/y9qfnX x7G5i6mESMgI17Ob9v/z2HU3C64H2HZ/mjg9H79xAn0NKFhipRhuI59BKePHyRDXekZ0 RZvA== X-Gm-Message-State: AA+aEWZZl+l4VI5TANOahJSU5OvKS9oJuvW2Q/TaaPWU4qZVAw4HYTSb 48QPo7kD0OrWrWku9OC2jyhMORfKAx8= X-Received: by 2002:a25:4457:: with SMTP id r84-v6mr24987497yba.192.1544058526801; Wed, 05 Dec 2018 17:08:46 -0800 (PST) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com. [209.85.219.178]) by smtp.gmail.com with ESMTPSA id u2sm8125459ywe.84.2018.12.05.17.08.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 17:08:46 -0800 (PST) Received: by mail-yb1-f178.google.com with SMTP id f125so5080343ybc.0 for ; Wed, 05 Dec 2018 17:08:45 -0800 (PST) X-Received: by 2002:a25:a22a:: with SMTP id b39-v6mr26098595ybi.209.1544058525402; Wed, 05 Dec 2018 17:08:45 -0800 (PST) MIME-Version: 1.0 References: <20181130150859.27366-1-anders.roxell@linaro.org> In-Reply-To: <20181130150859.27366-1-anders.roxell@linaro.org> From: Kees Cook Date: Wed, 5 Dec 2018 17:08:34 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/3] stackleak: mark stackleak_track_stack() as notrace To: Anders Roxell Cc: Steven Rostedt , Ingo Molnar , Catalin Marinas , Will Deacon , LKML , linux-arm-kernel , Arnd Bergmann 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 Fri, Nov 30, 2018 at 7:09 AM Anders Roxell wrote: > > 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 > Acked-by: Kees Cook Steven, I assume this series going via your tree? -- Kees Cook