[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cgV-c2bLE9KGSA2qTHNbzGriQo9NqYD5k177+46e51pJA@mail.gmail.com>
Date: Wed, 7 Feb 2024 11:08:15 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>, Stephane Eranian <eranian@...gle.com>,
Masami Hiramatsu <mhiramat@...nel.org>, linux-toolchains@...r.kernel.org,
linux-trace-devel@...r.kernel.org
Subject: Re: [PATCH 14/14] perf annotate-data: Add stack canary type
On Tue, Feb 6, 2024 at 3:40 PM Ian Rogers <irogers@...gle.com> wrote:
>
> On Tue, Feb 6, 2024 at 3:19 PM Namhyung Kim <namhyung@...nel.org> wrote:
> >
> > On Fri, Feb 2, 2024 at 7:21 PM Ian Rogers <irogers@...gle.com> wrote:
> > >
> > > On Fri, Feb 2, 2024 at 2:05 PM Namhyung Kim <namhyung@...nel.org> wrote:
> > > >
> > > > When the stack protector is enabled, compiler would generate code to
> > > > check stack overflow with a special value called 'stack carary' at
> > > > runtime. On x86_64, GCC hard-codes the stack canary as %gs:40.
> > > >
> > > > While there's a definition of fixed_percpu_data in asm/processor.h,
> > > > it seems that the header is not included everywhere and many places
> > > > it cannot find the type info. As it's in the well-known location (at
> > > > %gs:40), let's add a pseudo stack canary type to handle it specially.
> > >
> > > I wonder if cases like this can be handled by debug info rather than
> > > special cases in the tool. Special cases are fine too, but are
> > > potentially less portable.
> >
> > Agreed, but I couldn't find anything special in DWARF.
>
> The fs and gs selectors are commonly used for thread local storage, so
> could something like DW_OP_form_tls_address be used?
> https://dwarfstd.org/issues/110803.1.html
I'm not sure if it's the same thing. Maybe it's for variables with
__thread annotation. I don't know if compilers generate a
(pseudo) variable for stack canary.
Thanks,
Namhyung
Powered by blists - more mailing lists