commit | 7f9c031edfc6d2f6be1c6e25a0d1e746427ab14a | [log] [tgz] |
---|---|---|
author | Ihor Solodrai <ihor.solodrai@pm.me> | Fri Jan 10 02:31:41 2025 +0000 |
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | Fri Jan 10 10:49:36 2025 -0300 |
tree | 46e4bff6df3aeedda7a1324e03c434eead04d3f1 | |
parent | 24c655f17e87549264415a34d9ed8982ff3fd706 [diff] |
btf_encoder: Always initialize func_state to 0 BPF CI caught a segfault on aarch64 and s390x [1] after recent merges into the master branch. The segfault happened at free(func_state->annots) in btf_encoder__delete_saved_funcs(). func_state->annots arrived there uninitialized because after patch [2] in some cases func_state may be allocated with a realloc, but was not zeroed out. Fix this bug by always memset-ing a func_state to zero in btf_encoder__alloc_func_state(). [1] https://github.com/kernel-patches/bpf/actions/runs/12700574327 [2] https://lore.kernel.org/dwarves/20250109185950.653110-11-ihor.solodrai@pm.me/ Tested-by: Alan Maguire <alan.maguire@oracle.com> Cc: Andrii Nakryiko <andrii@kernel.org> Cc: Eduard Zingerman <eddyz87@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mykola Lysenko <mykolal@fb.com> Link: https://lore.kernel.org/r/20250110023138.659519-1-ihor.solodrai@pm.me Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>