forked from Minki/linux
fprobe: Check rethook_alloc() return in rethook initialization
Check if fp->rethook succeeded to be allocated. Otherwise, if
rethook_alloc() fails, then we end up dereferencing a NULL pointer in
rethook_add_node().
Link: https://lore.kernel.org/all/20221025031209.954836-1-rafaelmendsr@gmail.com/
Fixes: 5b0ab78998
("fprobe: Add exit_handler support")
Cc: stable@vger.kernel.org
Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
This commit is contained in:
parent
4a6f316d68
commit
d05ea35e7e
@ -141,6 +141,8 @@ static int fprobe_init_rethook(struct fprobe *fp, int num)
|
||||
return -E2BIG;
|
||||
|
||||
fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler);
|
||||
if (!fp->rethook)
|
||||
return -ENOMEM;
|
||||
for (i = 0; i < size; i++) {
|
||||
struct fprobe_rethook_node *node;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user