kpatch/kpatch-build
Joe Lawrence 321bbf9417 kpatch-build: clear Elf_Data d_buf buffer on allocation
Valgrind complains about uninitialized bytes passed to pwrite64(buf)
from kpatch_write_output_elf()'s call to elf_update():

  ==32378== Syscall param pwrite64(buf) points to uninitialised byte(s)
  ==32378==    at 0x5141A03: __pwrite_nocancel (in /usr/lib64/libc-2.23.so)
  ==32378==    by 0x4E46846: ??? (in /usr/lib64/libelf-0.168.so)
  ==32378==    by 0x4E42B88: elf_update (in /usr/lib64/libelf-0.168.so)
  ==32378==    by 0x40C57A: kpatch_write_output_elf (kpatch-elf.c:895)
  ==32378==    by 0x40926F: main (create-diff-object.c:2851)
  ==32378==  Address 0x28d52300 is 0 bytes inside a block of size 56 alloc'd
  ==32378==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
  ==32378==    by 0x40B86A: create_section_pair (kpatch-elf.c:707)
  ==32378==    by 0x406CAE: kpatch_create_patches_sections (create-diff-object.c:2109)
  ==32378==    by 0x4090C5: main (create-diff-object.c:2815)

These are fields which we don't need to populate (like a
funcs[index].new_addr value that will be filled by relocation).  The
easiest way to appease valgrind and not clutter the code is to just
zero-out this entire buffer on allocation.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2017-10-03 16:42:28 -04:00
..
insn insn: get it to compile in create-diff-object 2014-05-30 15:19:57 -05:00
create-diff-object.c kpatch-build: ignore .discard sections 2017-10-03 15:28:52 -04:00
create-klp-module.c create-klp-module: support unbundled symbols 2017-09-20 23:57:31 -05:00
create-kpatch-module.c create-kpatch-module: support unbundled symbols 2017-09-20 23:57:24 -05:00
kpatch-build kpatch-build: set default module prefix accordingly 2017-09-20 16:30:00 -04:00
kpatch-elf.c kpatch-build: clear Elf_Data d_buf buffer on allocation 2017-10-03 16:42:28 -04:00
kpatch-elf.h kpatch-build: Support gcc-6 function prologue 2017-07-27 12:56:00 +05:30
kpatch-gcc kpatch: fix kpatch-build matching changed object bug 2017-09-13 21:08:54 -05:00
kpatch-intermediate.h kpatch-intermediate.h: fix comments 2017-01-23 22:42:25 -08:00
list.h new .fixup group size algorithm 2014-09-15 14:54:57 -05:00
log.h log: include error.h 2017-01-23 12:42:35 -08:00
lookup.c lookup: allow local symbols to be in any order 2017-07-06 12:44:50 -05:00
lookup.h support dup file+symbol 2017-02-04 09:37:18 +08:00
Makefile kpatch-build: use implicit make rules 2017-08-22 03:21:00 +02:00