mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Wen Congyang <wency@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>, "Theodore Ts'o" <tytso@mit.edu>,
	Li Zefan <lizf@cn.fujitsu.com>
Subject: Re: [Patch] ext4: avoid null dereference
Date: Tue, 31 Aug 2010 13:43:26 -0400	[thread overview]
Message-ID: <1283276606.1377.244.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <4C777C04.7080906@cn.fujitsu.com>

On Fri, 2010-08-27 at 16:49 +0800, Wen Congyang wrote:
> ac->inode is set to null in function ext4_mb_release_group_pa(),
> and then trace_ext4_mballoc_discard(ac) is called, the kernel
> will panic.

> diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
> index 01e9e00..6a1fcff 100644
> --- a/include/trace/events/ext4.h
> +++ b/include/trace/events/ext4.h
> @@ -796,8 +796,9 @@ DECLARE_EVENT_CLASS(ext4__mballoc,
>  	),
>  
>  	TP_fast_assign(
> -		__entry->dev		= ac->ac_inode->i_sb->s_dev;
> -		__entry->ino		= ac->ac_inode->i_ino;
> +		__entry->dev		= ac->ac_sb->s_dev;
> +		__entry->ino		= ac->ac_inode ?
> +						ac->ac_inode->i_ino : 0;

Is i_ino == 0 a valid inode number?

If not, then

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

>  		__entry->result_logical	= ac->ac_b_ex.fe_logical;
>  		__entry->result_start	= ac->ac_b_ex.fe_start;
>  		__entry->result_group	= ac->ac_b_ex.fe_group;



  reply	other threads:[~2010-08-31 17:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27  8:49 Wen Congyang
2010-08-31 17:43 ` Steven Rostedt [this message]
2010-09-02  8:39 ` Ted Ts'o

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=1283276606.1377.244.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@redhat.com \
    --cc=tytso@mit.edu \
    --cc=wency@cn.fujitsu.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®