[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wi=qJr4r2DTLDMDh=ryK-x9sciGEeL+ZaWExpiHGyPhiQ@mail.gmail.com>
Date: Tue, 3 Sep 2024 12:12:34 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Sven Schnelle <svens@...ux.ibm.com>, Michael Ellerman <mpe@...erman.id.au>,
Masami Hiramatsu <mhiramat@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH] uprobes: use vm_special_mapping close() functionality
On Tue, 3 Sept 2024 at 02:09, Oleg Nesterov <oleg@...hat.com> wrote:
>
> but with or without this fix __create_xol_area() also needs
>
> area->xol_mapping.mremap = NULL;
I think the whole thing needs to be zeroed out.
It was always horribly buggy. The close thing just made it more
*obviously* buggy, because closing a vma is a lot more common than
mremap'ing it.
Either use kzalloc(), or do a proper initializer something like this:
- area->xol_mapping.name = "[uprobes]";
- area->xol_mapping.fault = NULL;
- area->xol_mapping.pages = area->pages;
+ area->xol_mapping = (struct vm_special_mapping) {
+ .name = "[uprobes]",
+ .pages = area->pages,
+ .close = uprobe_clear_state,
+ };
which should initialize the struct vm_special_mapping fully.
Linus
Powered by blists - more mailing lists