From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35FA8C433DB for ; Thu, 4 Feb 2021 18:41:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C1C8964DE1 for ; Thu, 4 Feb 2021 18:41:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1C8964DE1 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=cloudflare.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 444626B0005; Thu, 4 Feb 2021 13:41:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F3F56B0006; Thu, 4 Feb 2021 13:41:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E34A6B006E; Thu, 4 Feb 2021 13:41:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 142BE6B0005 for ; Thu, 4 Feb 2021 13:41:33 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CCB4C8249980 for ; Thu, 4 Feb 2021 18:41:32 +0000 (UTC) X-FDA: 77781453624.19.792681F Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by imf07.hostedemail.com (Postfix) with ESMTP id 052ACA0000FA for ; Thu, 4 Feb 2021 18:41:31 +0000 (UTC) Received: by mail-lj1-f169.google.com with SMTP id u4so4658500ljh.6 for ; Thu, 04 Feb 2021 10:41:32 -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=QilnL1GiLc35zL0JKgGqLLH0jCvxrl7AURnizvwxOrk=; b=wwOS3lN7TXu7QWeoGhYz2RQIaOHUMrxwlkR7ONEgKZc8tcuOjeXZTXB1WKjKgAsbTt yBmSE3VnOWAKWOMUea3DJjb2qXnmzvGek24oz8Rn6MMVgsK6wQrdn+irVG6eFfiwAFAq /d6esWbvjJAsIQ26Ihjbz7XJe2at9o+eKRRE8= 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=QilnL1GiLc35zL0JKgGqLLH0jCvxrl7AURnizvwxOrk=; b=AtMBt/Ja3TE41zlzBZ7l3gjbVQ717DQeaADnH5wQ9dRgLWTgQ1F5jeqrcMGYzyPqhj Q8BPZClYUbwMK2E65Adm/IDAEj0mVakfsb1x+NP4Zo14r8R5M+XwkFXolbROdVTylnLe jqZMgt5lFGV6uR3TS06d7y3XdeVevMDRZyWNKTVQWOn85jIjMLIBgfynqJC3fi5WfLYo 00Bg/2T0TDPMiZUNAb89LqaRWsJ6d25OozbzfmE+0t4+3kUXowS+fLZZ2NwHpvp9q5o0 1IsZ63WSiz5RydIay0wvcpMZWqc1xG3Ub44glf80zr5dA1bluV0LSrGA3pKlz9CHCj6g 6EHw== X-Gm-Message-State: AOAM533BMk20WKmmNMRyMle92UMXp5QxrY2lXfRznxOViBmPshuNaR46 j3lHJs0d3nc9OnVXEtJlSccepqZkDTTUe+bYVPb+xQ== X-Google-Smtp-Source: ABdhPJwJtrhYEdPaQdR6fHW3cU2NP6bOoOiL2TtDHuAX1Y9bu5c2RTiAw480hYJajzznm79yfeZHPAMVBc9ok0h1jMo= X-Received: by 2002:a2e:9b57:: with SMTP id o23mr427754ljj.314.1612464090601; Thu, 04 Feb 2021 10:41:30 -0800 (PST) MIME-Version: 1.0 References: <20210203214448.2703930e@oasis.local.home> <20210204030948.dmsmwyw6fu5kzgey@treble> In-Reply-To: <20210204030948.dmsmwyw6fu5kzgey@treble> From: Ivan Babrou Date: Thu, 4 Feb 2021 10:41:18 -0800 Message-ID: Subject: Re: BUG: KASAN: stack-out-of-bounds in unwind_next_frame+0x1df5/0x2650 To: Josh Poimboeuf Cc: Steven Rostedt , 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, 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 Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 052ACA0000FA X-Stat-Signature: zki7kk9yxg7p5uhxrrndc5bkoag5krmr Received-SPF: none (cloudflare.com>: No applicable sender policy available) receiver=imf07; identity=mailfrom; envelope-from=""; helo=mail-lj1-f169.google.com; client-ip=209.85.208.169 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1612464091-183473 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Feb 3, 2021 at 7:10 PM Josh Poimboeuf wrote: > This line gives a big clue: > > [160676.608966][ C4] RIP: 0010:0xffffffffc17d814c > > That address, without a function name, most likely means that it was > running in some generated code (mostly likely BPF) when it got > interrupted. We do have eBPF/XDP in our environment. > Right now, the ORC unwinder tries to fall back to frame pointers when it > encounters generated code: > > orc = orc_find(state->signal ? state->ip : state->ip - 1); > if (!orc) > /* > * As a fallback, try to assume this code uses a frame pointer. > * This is useful for generated code, like BPF, which ORC > * doesn't know about. This is just a guess, so the rest of > * the unwind is no longer considered reliable. > */ > orc = &orc_fp_entry; > state->error = true; > } > > Because the ORC unwinder is guessing from that point onward, it's > possible for it to read the KASAN stack redzone, if the generated code > hasn't set up frame pointers. So the best fix may be for the unwinder > to just always bypass KASAN when reading the stack. > > The unwinder has a mechanism for detecting and warning about > out-of-bounds, and KASAN is short-circuiting that. > > This should hopefully get rid of *all* the KASAN unwinder warnings, both > crypto and networking. It definitely worked on my dm-crypt case, and I've tried it without your previous AVX related patch. I will apply it to our tree and deploy to the staging KASAN environment to see how it fares with respect to networking stacks. Feel free to ping me if I don't get back to you with the results on Monday. Thanks for looking into this!