Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938981AbcKQROE (ORCPT ); Thu, 17 Nov 2016 12:14:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45656 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933486AbcKQRN6 (ORCPT ); Thu, 17 Nov 2016 12:13:58 -0500 From: Josh Poimboeuf To: x86@kernel.org Cc: Peter Zijlstra , Vince Weaver , linux-kernel@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo , davej@codemonkey.org.uk, dvyukov@google.com, Stephane Eranian Subject: [PATCH 2/2] dumpstack: prevent KASAN false positive warnings Date: Thu, 17 Nov 2016 09:57:24 -0600 Message-Id: <5f6e80c4b0c7f7f0b6211900847a247cdaad753c.1479398226.git.jpoimboe@redhat.com> In-Reply-To: <20161116130337.GT3142@twins.programming.kicks-ass.net> References: <20161116130337.GT3142@twins.programming.kicks-ass.net> In-Reply-To: <61939c0b2b2d63ce97ba59cba3b00fd47c2962cf.1479398226.git.jpoimboe@redhat.com> References: <61939c0b2b2d63ce97ba59cba3b00fd47c2962cf.1479398226.git.jpoimboe@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 17 Nov 2016 15:57:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 815 Lines: 23 The oops stack dump code scans the entire stack, which can cause KASAN "stack-out-of-bounds" false positive warnings. Tell KASAN to ignore it. Signed-off-by: Josh Poimboeuf --- arch/x86/kernel/dumpstack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 9b7cf5c..85f854b 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -112,7 +112,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, for (; stack < stack_info.end; stack++) { unsigned long real_addr; int reliable = 0; - unsigned long addr = *stack; + unsigned long addr = READ_ONCE_NOCHECK(*stack); unsigned long *ret_addr_p = unwind_get_return_address_ptr(&state); -- 2.7.4