Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp692302pxb; Wed, 3 Feb 2021 15:34:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZmDpiClBVQvuKWSQ2ospT3VQ6vsODpJv/lLi4I75zXIX8W9ax/Xx8waf8fjZCW2hb2IlN X-Received: by 2002:a17:906:3719:: with SMTP id d25mr5570299ejc.256.1612395282537; Wed, 03 Feb 2021 15:34:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612395282; cv=none; d=google.com; s=arc-20160816; b=k/+D/VAuMEl2kodZii9iMUmgF9d24+Lgt1YRQCblsDOypT6BInhCu8CWbDR5hGNfFN PKpka9PFXVDcV19sznZ8CfGMbbPaV3rKHOOgpEgBhMs0ArctHxPfQPc4NOG+tGjfTSSJ scrme9I1l5nwbr6pCdX9ZxpGCPyj1dCN8zJbjf9TDv9AOKRmiwB4vVb6FvL0H+JZ7Gaz lTignt46dJBmm/XtShQ2OMCuSUAR95mwMB2WTf0ckd32xNQrzwqpLP/SGRnGtZONnuzY FwJq5xQD7I0PyytFkUnHqq6XPIF6DYDsi7LqowAlL3pFsjQfNFw5YfAGUgSlSKyxl4xT y6lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hocG39X+tz3ResWtWHRihYuESyyVfrOSMJOVeII1Yr4=; b=X7Kve0B1+34l5ebM+ukxWOVBppftaQZetmBorfNsC605XH0IXCCG+7ZAQfWtp1YBjd CbsuKXgqRDVZ+nc0yHJhJtYrJ0oDezZummOphlkxfHVxll85/HoDfv2egXPUaKGltjkD b/L8FCaH4YYu1svVO8cs71oTMBi7U+TUZxItB0pZOSFPkjF8raJKc0tktepb9yQTmsDg uxrDQUg5UREC15tZYOYEQymbWFFwPEXhv1ZwIxa5uO86sujW13a75+dXXP+ha9qyjhj7 6tN4gdH9TZ42+xLC8Wvnm58jifrVZNGwJJ9qPDI4GdpAZEb/ObTd2kuBjRFD1eYFMPVt JNrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=B2166ME1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp19si2219299ejc.733.2021.02.03.15.34.18; Wed, 03 Feb 2021 15:34:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=B2166ME1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233395AbhBCXbj (ORCPT + 99 others); Wed, 3 Feb 2021 18:31:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232458AbhBCXbi (ORCPT ); Wed, 3 Feb 2021 18:31:38 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 129EFC061573 for ; Wed, 3 Feb 2021 15:30:48 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id v24so1736517lfr.7 for ; Wed, 03 Feb 2021 15:30:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hocG39X+tz3ResWtWHRihYuESyyVfrOSMJOVeII1Yr4=; b=B2166ME1KxF1tjOfSskWGSBW8hJ+RS3FE8tEbGM4Lr3PUwGWeSJovyx+hQNe9qBQI9 rT7r7WGKmmoaUsz66RLyIyeLDsYSL4yrpDHUMNecfmB3bkhRfiLjReBu7lU0fHABvFHw 8ZBL9rWHyJ85CiiAU569/ODbFCVhWqu25t0X0= 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=hocG39X+tz3ResWtWHRihYuESyyVfrOSMJOVeII1Yr4=; b=Pryk8ZoEO5WRvtwrbBB6Mz+xAHykBYUER4KzXqirzBpH5oXR2ENz6eejcbco5Frb06 Z11uCuddUEA6KP2bBH4kRUCedAzqGJw4+seZElPFjPkIdD/LItnkhnc3jcgk4PlUqbwt 0NoQz5/cYGDZgGDWFEi/lc6WJVkVS7tXf4ZpHpFKZw0SDasxer7+n7eFCdBaQjrpZo/G UhwV5JJ9pmWCCpuQH0R2XB+94RaKtyvoB8YK2JKbcSr8nEfFw7xlJnX5Ngdw/ltKKczV w1HQ2fyJ8qe4if9e/u7m4aD1a6Nwoy/J2bbz1UnKlTiSM+UJolZGcpXFoMXeyh/DshTm sVaA== X-Gm-Message-State: AOAM530VjEAV9KyeJWO2L3zAywO2FegAM2GcQZQeyoXo6NkTLckkiPQ/ NJKkBQ+O6ODRdMtl+hyIfX2YXlD117diua5LtRi/kQ== X-Received: by 2002:a05:6512:3904:: with SMTP id a4mr2912750lfu.340.1612395046510; Wed, 03 Feb 2021 15:30:46 -0800 (PST) MIME-Version: 1.0 References: <20210203190518.nlwghesq75enas6n@treble> <20210203232735.nw73kugja56jp4ls@treble> In-Reply-To: <20210203232735.nw73kugja56jp4ls@treble> From: Ivan Babrou Date: Wed, 3 Feb 2021 15:30:35 -0800 Message-ID: Subject: Re: BUG: KASAN: stack-out-of-bounds in unwind_next_frame+0x1df5/0x2650 To: Josh Poimboeuf Cc: Peter Zijlstra , kernel-team , Ignat Korchagin , Hailong liu , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Miroslav Benes , Julien Thierry , Jiri Slaby , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, "Steven Rostedt (VMware)" , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Robert Richter , "Joel Fernandes (Google)" , Mathieu Desnoyers , Linux Kernel Network Developers , bpf@vger.kernel.org, Alexey Kardashevskiy Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 3, 2021 at 3:28 PM Josh Poimboeuf wrote: > > On Wed, Feb 03, 2021 at 02:41:53PM -0800, Ivan Babrou wrote: > > On Wed, Feb 3, 2021 at 11:05 AM Josh Poimboeuf wrote: > > > > > > On Wed, Feb 03, 2021 at 09:46:55AM -0800, Ivan Babrou wrote: > > > > > Can you pretty please not line-wrap console output? It's unreadable. > > > > > > > > GMail doesn't make it easy, I'll send a link to a pastebin next time. > > > > Let me know if you'd like me to regenerate the decoded stack. > > > > > > > > > > edfd9b7838ba5e47f19ad8466d0565aba5c59bf0 is the first bad commit > > > > > > commit edfd9b7838ba5e47f19ad8466d0565aba5c59bf0 > > > > > > > > > > Not sure what tree you're on, but that's not the upstream commit. > > > > > > > > I mentioned that it's a rebased core-static_call-2020-10-12 tag and > > > > added a link to the upstream hash right below. > > > > > > > > > > Author: Steven Rostedt (VMware) > > > > > > Date: Tue Aug 18 15:57:52 2020 +0200 > > > > > > > > > > > > tracepoint: Optimize using static_call() > > > > > > > > > > > > > > > > There's a known issue with that patch, can you try: > > > > > > > > > > http://lkml.kernel.org/r/20210202220121.435051654@goodmis.org > > > > > > > > I've tried it on top of core-static_call-2020-10-12 tag rebased on top > > > > of v5.9 (to make it reproducible), and the patch did not help. Do I > > > > need to apply the whole series or something else? > > > > > > Can you recreate with this patch, and add "unwind_debug" to the cmdline? > > > It will spit out a bunch of stack data. > > > > Here's the three I'm building: > > > > * https://github.com/bobrik/linux/tree/ivan/static-call-5.9 > > > > It contains: > > > > * v5.9 tag as the base > > * static_call-2020-10-12 tag > > * dm-crypt patches to reproduce the issue with KASAN > > * x86/unwind: Add 'unwind_debug' cmdline option > > * tracepoint: Fix race between tracing and removing tracepoint > > > > The very same issue can be reproduced on 5.10.11 with no patches, > > but I'm going with 5.9, since it boils down to static call changes. > > > > Here's the decoded stack from the kernel with unwind debug enabled: > > > > * https://gist.github.com/bobrik/ed052ac0ae44c880f3170299ad4af56b > > > > See my first email for the exact commands that trigger this. > > Thanks. Do you happen to have the original dmesg, before running it > through the post-processing script? Yes, here it is: * https://gist.github.com/bobrik/8c13e6a02555fb21cadabb74cdd6f9ab > I assume you're using decode_stacktrace.sh? It could use some > improvement, it's stripping the function offset. > > Also spaces are getting inserted in odd places, messing the alignment. > > [ 137.291837][ C0] ffff88809c409858: d7c4f3ce817a1700 (0xd7c4f3ce817a1700) > [ 137.291837][ C0] ffff88809c409860: 0000000000000000 (0x0) > [ 137.291839][ C0] ffff88809c409868: 00000000ffffffff (0xffffffff) > [ 137.291841][ C0] ffff88809c409870: ffffffffa4f01a52 unwind_next_frame (arch/x86/kernel/unwind_orc.c:380 arch/x86/kernel/unwind_orc.c:553) > [ 137.291843][ C0] ffff88809c409878: ffffffffa4f01a52 unwind_next_frame (arch/x86/kernel/unwind_orc.c:380 arch/x86/kernel/unwind_orc.c:553) > [ 137.291844][ C0] ffff88809c409880: ffff88809c409ac8 (0xffff88809c409ac8) > [ 137.291845][ C0] ffff88809c409888: 0000000000000086 (0x86) > > -- > Josh >