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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 30 Jun 2017 18:32:12 -0600
From:   Michael Sartain <mikesart@...tmail.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     linux-kernel@...r.kernel.org, Joel Fernandes <joelaf@...gle.com>,
        Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] tracing: Add saved_tgids file to show cached pid to tgid
 mappings

On Fri, Jun 30, 2017 at 05:50:57PM -0400, Steven Rostedt wrote:
> On Fri, 30 Jun 2017 11:17:50 -0600
> Michael Sartain <mikesart@...tmail.com> wrote:
> 
> > Export the cached pid / tgid mappings to userspace. This allows user
> > apps to translate the pids from a trace to their respective thread
> > group.
> > 
> > Example saved_tgids file with pid / tgid values separated by ' ':
> > 
> >   # cat saved_tgids
> >   1048 1048
> >   1047 1047
> >   7 7
> >   1049 1047
> >   1054 1047
> >   1053 1047
> > 
> > [ Impact: let userspace apps reading binary buffer know tgid's ]
> 
> Impact line? Linus put a kibosh on this a while ago...
> 
>   https://lkml.org/lkml/2009/4/15/296
> 
> Although, I will admit that this line is actually useful. Just remove
> the brackets.

Ah, thank you. I saw it used in the previous cmdline patch and used it
as a reference.

> > Signed-off-by: Michael Sartain <mikesart@...tmail.com>
> > ---
> >  kernel/trace/trace.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 59 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index 68c214b..ca84c97 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -4692,6 +4692,7 @@ static const struct file_operations tracing_readme_fops = {
> >  static void *saved_cmdlines_next(struct seq_file *m, void *v, loff_t *pos)
> >  {
> >  	unsigned int *ptr = v;
> > +	long tgid_check = (long) m->private;
> 
> I really don't like the subtle use of having m->private != NULL mean
> this is for tgid listing.
> 
> In fact, I don't see the purpose of reusing the seq code. The cmdlines
> and tgid map are quite different. Just create its own functions. I
> don't see the benefit of trying to reuse this except for making the
> code more complex.

Will do. Joel was also kind enough to send me feedback about RFCs and
merge windows, etc. so I apologize - wasn't trying to get anything by
anyone, just that this is my first real patch and I've obviously got a
lot to learn here. Thank you for the comments. I'll fix and resubmit
next week.
 -Mike

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ