mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: "Geyslan Gregório Bem" <geyslan@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	kernel-br <kernel-br@googlegroups.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	open list <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Subject: Re: [PATCH] tracing: fix referencing after memory freeing and refactors code
Date: Sat, 19 Oct 2013 16:18:59 +0200	[thread overview]
Message-ID: <20131019141859.GA30765@redhat.com> (raw)
In-Reply-To: <CAGG-pUSk-A=m=cXL85fY+nNgRGQVtG62GouPoANuXFUSrKK6BA@mail.gmail.com>

On 10/19, Geyslan Gregório Bem wrote:
>
> 2013/10/19 Oleg Nesterov <oleg@redhat.com>:
> > On 10/17, Steven Rostedt wrote:
> >>
> >> I'm thinking of just nuking the tracing_open_generic() here. The only
> >> thing it does here is the tracing_disabled check. The assignment of
> >> inode->i_private to filp->private_data is pointless
> >
> > The same for ftrace_enable_fops() and ftrace_event_filter_fops() at
> > least. The users of event_file_data() do not use ->private_data.
> >
>
> Aren't "ftrace_enable_fops" and "ftrace_event_filter_fops" structures?

I meant, their ->open() methods.

> About event_file_data() I think that the callers uses the
> private_data. So, we have to analyze better.

No, event_file_data() uses ->i_private, filp->private_data is not used.
And it can't be used, it can point to the already destroyed/freed data.

but, as for seq_open() users,

> static int trace_format_open(struct inode *inode, struct file *file)
> {
>     struct seq_file *m;
>     int ret;
>
>     ret = seq_open(file, &trace_format_seq_ops);
>     if (ret < 0)
>         return ret;
>
>     m = file->private_data;
>     m->private = file;
>
>     return 0;
> }
>
> I really got confused here. The 'm' assignments are, to me, pointless.

I confused too... Why do you think it is pointless?

Just in case, not that after seq_open() ->private_data points to seq_file
but it is still "void *". And in this case ->private_data has nothing to
do with ->private_data  set by tracing_open_generic().

Oleg.


  reply	other threads:[~2013-10-19 14:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18  1:44 Geyslan G. Bem
2013-10-18  2:46 ` Steven Rostedt
2013-10-18  9:49   ` Geyslan Gregório Bem
2013-10-18 11:02     ` Geyslan Gregório Bem
2013-10-18 12:34       ` Steven Rostedt
2013-10-19 12:43   ` Oleg Nesterov
2013-10-19 13:34     ` Oleg Nesterov
2013-10-19 13:58     ` Geyslan Gregório Bem
2013-10-19 14:18       ` Oleg Nesterov [this message]
2013-10-19 14:41         ` Geyslan Gregório Bem
2013-10-19 19:10           ` Steven Rostedt
2013-10-19 19:35             ` Geyslan Gregório Bem

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=20131019141859.GA30765@redhat.com \
    --to=oleg@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=geyslan@gmail.com \
    --cc=kernel-br@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /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®