[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241001143624.08291d00@gandalf.local.home>
Date: Tue, 1 Oct 2024 14:36:24 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Indu Bhagat <indu.bhagat@...cle.com>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>, x86@...nel.org, Peter Zijlstra
<peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>, Arnaldo Carvalho de
Melo <acme@...nel.org>, linux-kernel@...r.kernel.org, Mark Rutland
<mark.rutland@....com>, Alexander Shishkin
<alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Ian Rogers <irogers@...gle.com>, Adrian
Hunter <adrian.hunter@...el.com>, linux-perf-users@...r.kernel.org, Mark
Brown <broonie@...nel.org>, linux-toolchains@...r.kernel.org, Jordan Rome
<jordalgo@...a.com>, Sam James <sam@...too.org>
Subject: Re: [PATCH v2 03/11] unwind: Introduce SFrame user space unwinding
On Tue, 1 Oct 2024 11:20:35 -0700
Indu Bhagat <indu.bhagat@...cle.com> wrote:
> > So we trust user space to have this table sorted?
> >
>
> GNU ld will create this table sorted when linking .sframe sections and
> will set SFRAME_F_FDE_SORTED in flags in the output .sframe section. In
> the current patch, I see the __sframe_add_section () includes a check
> for SFRAME_F_FDE_SORTED for admitting SFrame sections.
>
> So proceeding here with the assumption that the SFrame FDE list is
> sorted should work fine.
No not at all! We *cannot trust* user space. This could lead to a security
hole if we assume it's sorted. The kernel must not trust anything it
receives from user space. Because an attacker will be looking for ways to
confuse the kernel to exploit it.
When I look at code that reads user space, I do not look at it as if it
were made by the compiler. I look at it as if it were made by someone
that's trying to find ways to crack the system. Every read from user space
*must* be validated *every* time it's read. It can not even validate it
once and then think its immutable (unless the kernel actually made it
immutable).
-- Steve
Powered by blists - more mailing lists