]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:47:47 +0000 (13:47 +0200)
commit5ade5fbdbbb1f023bb70730ba4d74146c8bc7eb9
treeb0f3dcad528419153210315ef3c21ef85a27aaa7
parentcbc4dacaa5b1923065a8273aaecd7c46367995e4
eventfs: Fix a possible null pointer dereference in eventfs_find_events()

commit d4e9a968738bf66d3bb852dd5588d4c7afd6d7f4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/tracefs/event_inode.c