From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FE96218838; Thu, 24 Apr 2025 20:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745525789; cv=none; b=PQ0QXMX9W1lnV/jGR/7mRwMiqdob+t/zOZQ9Oev4CLiMtBjoZIEg3P2OeAP0E5Nwm/SPExwEOHSv7KLmVtKNYdIp0w6XzviGj0OcKkcFH8s8RKI26XZgkTYducI6IX3jhb5BH9S2kwmGb/REaQVmRCuGxXcfQzq57cen2fbWAis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745525789; c=relaxed/simple; bh=fp29FQG7tCj2MT79QM0yn2AjFI3efyx4XK+jS6q+wv4=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=g6FYrzGsRJSgvhHSEbTg9aSrzt7vUii99rqD2JH6Kq5OmPZmtzReBDHAK34KmWC0EV7wYpFEkepnFVTPTffyTXHNlEsMLLQITCte2TLve6LOe0N7WyUA1jXPO7wpPrgbRWUWB1XKI4cJ+wjMBx8batpWYkiepzy+twtrxhxc54o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0A6AC4AF60; Thu, 24 Apr 2025 20:16:28 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1u831d-0000000H3wi-0Wkx; Thu, 24 Apr 2025 16:18:25 -0400 Message-ID: <20250424201824.978358670@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 24 Apr 2025 16:15:20 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Josh Poimboeuf , x86@kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Indu Bhagat , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, Mark Brown , linux-toolchains@vger.kernel.org, Jordan Rome , Sam James , Andrii Nakryiko , Jens Remus , Florian Weimer , Andy Lutomirski , Weinan Liu , Blake Jones , Beau Belgrave , "Jose E. Marchesi" , Alexander Aring Subject: [PATCH v5 09/12] unwind_user/sframe: Remove .sframe section on detected corruption References: <20250424201511.921245242@goodmis.org> Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: Josh Poimboeuf To avoid continued attempted use of a bad .sframe section, remove it on demand when the first sign of corruption is detected. Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) --- kernel/unwind/sframe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/unwind/sframe.c b/kernel/unwind/sframe.c index 1a35615a361e..66b920441692 100644 --- a/kernel/unwind/sframe.c +++ b/kernel/unwind/sframe.c @@ -294,6 +294,10 @@ int sframe_find(unsigned long ip, struct unwind_user_frame *frame) ret = __find_fre(sec, &fde, ip, frame); end: user_read_access_end(); + + if (ret == -EFAULT) + WARN_ON_ONCE(sframe_remove_section(sec->sframe_start)); + return ret; } -- 2.47.2