From nobody Wed Oct 8 07:29:11 2025 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 AC044288C84; Tue, 1 Jul 2025 19:19:12 +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=1751397552; cv=none; b=tDp94ML3iyz3o70YXyf+fvLjzu+kVlbB9DgQSzT9DtJzVbMn3uhqUBytKMkTkn9WC4McbPB7gRtgD1LBZu3h+Zq4WmsI2WifmjnRZdCxc0+K4JlFY3NtogWetBWvVogCeE8+mJ7d5DFIdgOpmnvTPMUfanJTQQ2adqdxu/cRuvM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751397552; c=relaxed/simple; bh=tQh371Xu4aNv634IWnbNpzI8g0gGO4AVuobSDHJ5Ps4=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=tq05MMUDcmppoFZe/wJwTkmEKcZBMhETmIUP8WardVGyPmpK84V/P33ize1TghWCHHAGrqpxz+Ffo51kjql171uDAFZNJ6W9NnsZ9aibuaudAe7PWOd4+ztaLRc41Weh+HQg1dC+3jec872dl/zpVgSfc6CtB9StUs+lwT1lHac= 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 85424C4CEEB; Tue, 1 Jul 2025 19:19:12 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uWg3t-00000007gqc-0MqE; Tue, 01 Jul 2025 14:50:33 -0400 Message-ID: <20250701185032.940717002@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 01 Jul 2025 14:49:47 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org Cc: Masami Hiramatsu , Mathieu Desnoyers , Josh Poimboeuf , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Andrii Nakryiko , Indu Bhagat , "Jose E. Marchesi" , Beau Belgrave , Jens Remus , Linus Torvalds , Andrew Morton , Jens Axboe , Florian Weimer Subject: [PATCH v7 08/12] unwind_user/sframe: Remove .sframe section on detected corruption References: <20250701184939.026626626@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 b10420d19840..f246ead6c2a0 100644 --- a/kernel/unwind/sframe.c +++ b/kernel/unwind/sframe.c @@ -310,6 +310,10 @@ int sframe_find(unsigned long ip, struct unwind_user_f= rame *frame) ret =3D __find_fre(sec, &fde, ip, frame); end: user_read_access_end(); + + if (ret =3D=3D -EFAULT) + WARN_ON_ONCE(sframe_remove_section(sec->sframe_start)); + return ret; } =20 --=20 2.47.2