• Ian Rogers's avatar
    perf tools: Splice events onto evlist even on error · 6ad06c84
    Ian Rogers authored
    [ Upstream commit 8e8714c3
    
     ]
    
    If event parsing fails the event list is leaked, instead splice the list
    onto the out result and let the caller cleanup.
    
    An example input for parse_events found by libFuzzer that reproduces
    this memory leak is 'm{'.
    Signed-off-by: default avatarIan Rogers <irogers@google.com>
    Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Jin Yao <yao.jin@linux.intel.com>
    Cc: John Garry <john.garry@huawei.com>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Martin KaFai Lau <kafai@fb.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Song Liu <songliubraving@fb.com>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Yonghong Song <yhs@fb.com>
    Cc: bpf@vger.kernel.org
    Cc: clang-built-linux@googlegroups.com
    Cc: netdev@vger.kernel.org
    Link: http://lore.kernel.org/lkml/20191025180827.191916-5-irogers@google.com
    
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    6ad06c84
parse-events.c 64.6 KB