Commit de0b73d
libbpf: Fix out-of-bound read in bpf_linker__add_buf()
Fix a potential out-of-bound read in bpf_linker__add_buf() by advancing
the buffer pointer and reducing the remaining buffer size passed to
write() in each iteration. The bug is reported in [0].
[0]: libbpf/libbpf#945
Fixes: 6d5e5e5 ("libbpf: Extend linker API to support in-memory ELF files")
Signed-off-by: Amery Hung <ameryhung@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>1 parent 2bae014 commit de0b73d
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
| |||
0 commit comments