]> www.infradead.org Git - users/dwmw2/linux.git/commit
eventfs: Fix a possible null pointer dereference in eventfs_find_events()
authorHao Ge <gehao@kylinos.cn>
Mon, 13 May 2024 05:33:38 +0000 (13:33 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 14 May 2024 15:13:45 +0000 (11:13 -0400)
commitd4e9a968738bf66d3bb852dd5588d4c7afd6d7f4
tree5e1870189a87134d79bad978cb24ac3a2360624b
parente60b613df8b6253def41215402f72986fee3fc8d
eventfs: Fix a possible null pointer dereference in eventfs_find_events()

In function eventfs_find_events,there is a potential null pointer
that may be caused by calling update_events_attr which will perform
some operations on the members of the ei struct when ei is NULL.

Hence,When ei->is_freed is set,return NULL directly.

Link: https://lore.kernel.org/linux-trace-kernel/20240513053338.63017-1-hao.ge@linux.dev
Cc: stable@vger.kernel.org
Fixes: 8186fff7ab64 ("tracefs/eventfs: Use root and instance inodes as default ownership")
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
fs/tracefs/event_inode.c