Messages in this thread | | | Subject | Re: [Patch] ext4: avoid null dereference | From | Steven Rostedt <> | Date | Tue, 31 Aug 2010 13:43:26 -0400 |
| |
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;
| |