提交 27f5417e 编写于 作者: N Navid Emamdoost 提交者: Xie XiuQi

tracing: Have error path in predicate_parse() free its allocated memory

mainline inclusion
from mainline-v5.4-rc1
commit 96c5c6e6a5b6db592acae039fed54b5c8844cd35
category: bugfix
bugzilla: 13690
CVE: CVE-2019-19072

-------------------------------------------------

In predicate_parse, there is an error path that is not going to
out_free instead it returns directly which leads to a memory leak.

Link: http://lkml.kernel.org/r/20190920225800.3870-1-navid.emamdoost@gmail.comSigned-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NJian Cheng <cj.chengjian@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 a2ced2a0
...@@ -451,8 +451,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, ...@@ -451,8 +451,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
switch (*next) { switch (*next) {
case '(': /* #2 */ case '(': /* #2 */
if (top - op_stack > nr_parens) if (top - op_stack > nr_parens) {
return ERR_PTR(-EINVAL); ret = -EINVAL;
goto out_free;
}
*(++top) = invert; *(++top) = invert;
continue; continue;
case '!': /* #3 */ case '!': /* #3 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册