Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1364697pxb; Thu, 4 Feb 2021 11:00:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPD7HdR8gIajX8QMaPRatPfkOCwrMS+FSEMrTMj0CtND7bJslCQWBzYci5kC9LUQzZnCv3 X-Received: by 2002:a05:600c:1552:: with SMTP id f18mr506648wmg.149.1612465256573; Thu, 04 Feb 2021 11:00:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612465256; cv=none; d=google.com; s=arc-20160816; b=TtJmvK5CWDZiMUZHOPZBlFl5cme9eh3CpC4nf6qW9ZoismmbqfdVEcRCCEE7wZFGgI foh42mQot2tmsa1aQbghjIlq8SRNMm9fifCnKRISTvqewTCV1x2Sd5kw3EfC/1X7InzD Smujlpk2qqMR4ED4ppGeDGv94EFClaWYWS8bz/T1a+Nz2J9GAZiPW+8lyjIUuEfQKBJo 5TvRgbRau/uE384hdOyOtvaoEqcMVpH7qwxv90F11ERiKqhdeSgN4iN0ONZsNeQHMPeo JE3FEVrNWihKExwZa4jr/6Q7vMwspi374ZriP6m597LmLoHUdxyRcjo0m2hJM+GAXU0m we9g== 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=QilnL1GiLc35zL0JKgGqLLH0jCvxrl7AURnizvwxOrk=; b=Dz1MGCeto2ni9FYUc3LxryFUAQeCbswi6n/jqdJx2EM6qkR+CmFoDn/BskBW+Z1aXA 5k6y52FDeqSenAhXfJMhK7jMNGp0v6fFrqRli22AqRfAEUp9Ki3vR0gf6paubQPyADLM HZrIRSVuIvCKYaOXSwx7LGENlHE1xaHgJA5BOYGggz7Q+MoD5DfB6vb2YBU3Zmw74WUf i3GjaQwM6prhpSD6PmfY89DnCQVsJnaZuhl/yPM2en9zuL7S9SJofb0zFA4cK+JkcU8h q83CmdIHlfubttB/FaD9j7WbdCvJj4WWgZKecO9NjLcx1dU32cCGWiBzro+scGiOR8qB D7zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=wwOS3lN7; 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 i8si255535edy.413.2021.02.04.11.00.30; Thu, 04 Feb 2021 11:00:56 -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=wwOS3lN7; 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 S239379AbhBDS6J (ORCPT + 99 others); Thu, 4 Feb 2021 13:58:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239292AbhBDSmR (ORCPT ); Thu, 4 Feb 2021 13:42:17 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55A92C06178C for ; Thu, 4 Feb 2021 10:41:32 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id f19so4658878ljn.5 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=ocyD7F4TNPKrZnvM+9K/QpTMKLCnQiPJQJcMYNQ+HR6hexerP80wxXQBUqsadbn+Id 4Am35Cq3uRkaokveupZ23Kq/BEn+DQnc+d5/E4k+iMV5tMeWsNZLIDNplpU/ZZqcTeJC L2miLJqy8rmv5M8IMBhjx+Ye6dsz0tzCHl/lDpukiIoiiyoK93uDq2K2zf8yaX1d9XTk j7AAGyVSB9IoRmp4KlKjd/dbHjjMoHq30ZSnCL0VhDmNL9K3lKfdUbd7d/Cl6Yn0ksFC yb9e+uhj717WaxddP3lMZjY7sqX5Mr0QC2ZH5DQ+nDfQbcChMkYGk6ZDXlEm2HCJVuYp wzlg== X-Gm-Message-State: AOAM532wtCh70Uezxzi6RoIKFl9L0vLLoNzOEBihj9g3O6U4+dET2++E CxVY92fAN3psCI/y8Tautf8dO7tp/+TmgGetUKu5Bw== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!