Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2316651pxb; Fri, 5 Feb 2021 14:54:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyh5hRmWOJtLUi4MaUZgchEmtW9DeIR49PVji6715C1jiaOnj1cd7KrVEDlBRfCZOqqJi8z X-Received: by 2002:aa7:c755:: with SMTP id c21mr5824920eds.47.1612565681660; Fri, 05 Feb 2021 14:54:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612565681; cv=none; d=google.com; s=arc-20160816; b=E3/WiQhH69wegPUXkUUfVnhASYmyA/Gv/Rrvp/L3i0mw46W+6BBNdRGJ3P8zQG3okQ Gj5E3dqhiAAGMMnPvyiNJSBck3xqaP+s9C71tL1iOqmE0Zp9QDySvIezNDN7jgoIDDqT cKupB3Bh5iWH+OH5hhdWThClhwYkrPS2woc1padZdsqbgJYTawR7zvcAKzE4XprhDgp8 06ZxCbsyLVvW81wSLMRgslBUoCZaS+iOO0I5Khr2RC44hzUfh/UKPWE5+2+nFFsRh7Eg 8bF8oFzFzAgoJ0y7COQIxKwSCmmpAM9e/5dgtci7WCb1uBVXOAZJs7g8SQAn08d17vfZ lU+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=0V7GSa1ZjyQ6vQx6Kjj++tuNtj3h1Bfpq9ekpBitL80=; b=h4xpyDc/pR9FjyQr5dPSmRjj6OXXEKH9ECdli1TbjxtKfsvPK5ZGZI+kkqSndvx+Wz Gad6QCpLlr16yEZ7dQYxQ5JoI9tf9oZvyG3Hbo7adF42TC1NgG6xW40Bo1ZNDknktBiw busTg0ZbvRhJmosIswWquJFuD2oG7R+Abb3XY+z73qYAgmTij7SeEAEgjRn5TtqpOyNI 0VXQeHbdaj0lKtPpvIBqR2YsrQH4z62lXL4m2cHnMJWJGY/0sbzWgMGvoogkxdmsWoRi Ijt4Jiq6AmmwGo5YkNoy3eiF9MNNR5aW2LTU50OxT19b8/d6wRdZQP4md97U3ThWCsYd 4C6g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df22si6254579edb.163.2021.02.05.14.54.16; Fri, 05 Feb 2021 14:54:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231788AbhBEWuh (ORCPT + 99 others); Fri, 5 Feb 2021 17:50:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:43558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232640AbhBEOqA (ORCPT ); Fri, 5 Feb 2021 09:46:00 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4202064FFF; Fri, 5 Feb 2021 14:51:13 +0000 (UTC) Date: Fri, 5 Feb 2021 09:51:11 -0500 From: Steven Rostedt To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Ivan Babrou , Peter Zijlstra , stable@vger.kernel.org Subject: Re: [PATCH 1/2] x86/unwind/orc: Disable KASAN checking in the ORC unwinder, part 2 Message-ID: <20210205095111.2dba8515@gandalf.local.home> In-Reply-To: <9583327904ebbbeda399eca9c56d6c7085ac20fe.1612534649.git.jpoimboe@redhat.com> References: <9583327904ebbbeda399eca9c56d6c7085ac20fe.1612534649.git.jpoimboe@redhat.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 5 Feb 2021 08:24:02 -0600 Josh Poimboeuf wrote: > KASAN reserves "redzone" areas between stack frames in order to detect > stack overruns. A read or write to such an area triggers a KASAN > "stack-out-of-bounds" BUG. > > Normally, the ORC unwinder stays in-bounds and doesn't access the > redzone. But sometimes it can't find ORC metadata for a given > instruction. This can happen for code which is missing ORC metadata, or > for generated code. In such cases, the unwinder attempts to fall back > to frame pointers, as a best-effort type thing. > > This fallback often works, but when it doesn't, the unwinder can get > confused and go off into the weeds into the KASAN redzone, triggering > the aforementioned KASAN BUG. > > But in this case, the unwinder's confusion is actually harmless and > working as designed. It already has checks in place to prevent > off-stack accesses, but those checks get short-circuited by the KASAN > BUG. And a BUG is a lot more disruptive than a harmless unwinder > warning. > > Disable the KASAN checks by using READ_ONCE_NOCHECK() for all stack > accesses. This finishes the job started by commit 881125bfe65b > ("x86/unwind: Disable KASAN checking in the ORC unwinder"), which only > partially fixed the issue. > > Fixes: ee9f8fce9964 ("x86/unwind: Add the ORC unwinder") > Reported-by: Ivan Babrou > Cc: stable@vger.kernel.org > Signed-off-by: Josh Poimboeuf Reviewed-by: Steven Rostedt (VMware) -- Steve