From: Steven Rostedt <rostedt@goodmis.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>,
mhiramat@kernel.org, linux-kernel@vger.kernel.org,
heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com,
brueckner@linux.vnet.ibm.com
Subject: Re: [PATCH] trace/uprobes: fix output issue with address randomization
Date: Fri, 15 Dec 2017 12:41:00 -0500 [thread overview]
Message-ID: <20171215124100.1317dafe@gandalf.local.home> (raw)
In-Reply-To: <20171215173156.nvggmxozugo5jld5@hirez.programming.kicks-ass.net>
On Fri, 15 Dec 2017 18:31:56 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> > --- a/kernel/trace/trace_uprobe.c
> > +++ b/kernel/trace/trace_uprobe.c
> > @@ -608,7 +608,7 @@ static int probes_seq_show(struct seq_file *m, void *v)
> >
> > /* Don't print "0x (null)" when offset is 0 */
> > if (tu->offset) {
> > - seq_printf(m, "0x%p", (void *)tu->offset);
> > + seq_printf(m, "0x%px", (void *)tu->offset);
> > } else {
> > switch (sizeof(void *)) {
> > case 4:
>
> So I had a wee peek and afaict this ends up at:
>
> trace_create_file("uprobe_events", 0644, d_tracer,
> NULL, &uprobe_events_ops);
>
> which is a world readable file. Doesn't that leak the kaslr offset?
Usually the tracefs directory is mounted and is not world readable.
I just checked, and sure enough, after mounting tracefs, I can't read
it from non-root:
# mount -t tracefs nodev /sys/kernel/tracing/
# ls /sys/kernel/tracing/
available_events max_graph_depth stack_max_size
available_filter_functions options stack_trace
available_tracers per_cpu stack_trace_filter
buffer_size_kb printk_formats trace
buffer_total_size_kb README trace_clock
current_tracer saved_cmdlines trace_marker
dyn_ftrace_total_info saved_cmdlines_size trace_marker_raw
enabled_functions saved_tgids trace_options
eval_map set_event trace_pipe
events set_event_pid trace_stat
free_buffer set_ftrace_filter tracing_cpumask
function_profile_enabled set_ftrace_notrace tracing_max_latency
hwlat_detector set_ftrace_pid tracing_on
instances set_graph_function tracing_thresh
kprobe_events set_graph_notrace uprobe_events
kprobe_profile snapshot uprobe_profile
# exit
$ ls /sys/kernel/tracing/
ls: cannot open directory '/sys/kernel/tracing/': Permission denied
-- Steve
next prev parent reply other threads:[~2017-12-15 17:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-15 15:36 Thomas Richter
2017-12-15 17:31 ` Peter Zijlstra
2017-12-15 17:41 ` Steven Rostedt [this message]
2017-12-19 0:25 ` Masami Hiramatsu
2017-12-18 15:32 Thomas Richter
2017-12-18 17:55 ` Peter Zijlstra
2017-12-18 17:59 ` Steven Rostedt
2017-12-18 18:16 ` Linus Torvalds
2017-12-19 8:53 ` Thomas-Mich Richter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171215124100.1317dafe@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=brueckner@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=peterz@infradead.org \
--cc=schwidefsky@de.ibm.com \
--cc=tmricht@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®