]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ftrace: Check for successful allocation of hash
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Thu, 4 Jul 2019 14:34:42 +0000 (20:04 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:23:38 +0000 (10:23 +0200)
commitd784aa1a0f136740cbd3b94163b66022336342ca
tree682e65913222f9529348ff748ad6815da9451462
parentcd419e7c03e9abe6a1ecd3a8f18a8a417b8ee231
ftrace: Check for successful allocation of hash

commit 5b0022dd32b7c2e15edf1827ba80aa1407edf9ff upstream.

In register_ftrace_function_probe(), we are not checking the return
value of alloc_and_copy_ftrace_hash(). The subsequent call to
ftrace_match_records() may end up dereferencing the same. Add a check to
ensure this doesn't happen.

Link: http://lkml.kernel.org/r/26e92574f25ad23e7cafa3cf5f7a819de1832cbe.1562249521.git.naveen.n.rao@linux.vnet.ibm.com
Cc: stable@vger.kernel.org
Fixes: 1ec3a81a0cf42 ("ftrace: Have each function probe use its own ftrace_ops")
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ftrace.c