lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241124083939.1fab4656@gandalf.local.home>
Date: Sun, 24 Nov 2024 08:39:39 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Shakeel Butt <shakeel.butt@...ux.dev>, Matthew Wilcox
 <willy@...radead.org>, Andrew Morton <akpm@...ux-foundation.org>, Johannes
 Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>, Roman
 Gushchin <roman.gushchin@...ux.dev>, Muchun Song <muchun.song@...ux.dev>,
 Axel Rasmussen <axelrasmussen@...gle.com>, Suren Baghdasaryan
 <surenb@...gle.com>, linux-mm@...ck.org, cgroups@...r.kernel.org,
 linux-kernel@...r.kernel.org, Meta kernel team <kernel-team@...a.com>
Subject: Re: [PATCH] mm: mmap_lock: optimize mmap_lock tracepoints

On Sat, 23 Nov 2024 22:38:59 +0100
Vlastimil Babka <vbabka@...e.cz> wrote:

> On 11/23/24 22:35, Shakeel Butt wrote:
> > On Sat, Nov 23, 2024 at 05:01:57PM +0000, Matthew Wilcox wrote:  
> >> On Fri, Nov 22, 2024 at 10:09:39PM -0800, Shakeel Butt wrote:  
> >> >  	TP_printk(
> >> > -		"mm=%p memcg_path=%s write=%s",
> >> > -		__entry->mm,
> >> > -		__get_str(memcg_path),
> >> > +		"mm=%p memcg_id=%llu write=%s",
> >> > +		__entry->mm, __entry->memcg_id,
> >> >  		__entry->write ? "true" : "false"  
> >> 
> >> Is it actually useful to print out the (hashed) pointer of the mm?
> >> Wouldn't the PID be more useful so you could actually associate it with
> >> a task?
> >>   
> > 
> > For our usecase i.e. bpftrace, we don't really care about these prints
> > as we can directly access the arguments like mm in bpftrace. I wonder if
> > others are using this hased pointer in some other way. I don't mind
> > chaning it but I think that would be a separate patch.  
> 
> I wonder if it's actually hashed when trace events are obtained in binary
> form, i.e. via trace-cmd. Might be hashed only when doing e.g. cat
> trace_pipe as that's when the kernel's printk with its hashing is used?
> 
> I guess that would be another argument for not using it in the tracepoint,
> as it would be a sidechannel...

This is no more a sidechannel than /proc/kallsyms. It is only accessible
via the privileged users. It's very common and useful to show pointers in
trace events.

You can use eprobes to get information off of pointers too:

 echo 'e:mmap_lock_count mmap_lock/mmap_lock_start_locking count=+0($mm):u32' > /sys/kernel/tracing/dynamic_events

and now you have an event that shows the mm_count of the mm structure.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ