Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UBUNTU: SAUCE: bpf: prevent helper argument PTR_TO_ALLOC_MEM to have …
…offset other than 0 BugLink: https://bugs.launchpad.net/bugs/1956585 (OOB write on BPF_RINGBUF (LP: #1956585)) bpf_ringbuf_reserve is currently the only helper that returns a PTR_TO_ALLOC_MEM, and bpf_ringbuf_submit and bpf_ringbuf_discard expect only such pointers. If some arithmetic is done on those pointers, those functions may corrupt arbritary memory. Prevent such argument types from having an offset other than 0. Also, other valid PTR_TO_MEM should not be accepted as parameters to bpf_ringbuf_submit and bpf_ringbuf_discard. A different type mechanism should be used instead, in order to guarantee that only values returned by bpf_ringbuf_reserve can be used. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> Acked-by: Kamal Mostafa <kamal@canonical.com> Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
- Loading branch information