bpf: Use memmove for bpf_dynptr_{read,write}
It may happen that destination buffer memory overlaps with memory dynptr points to. Hence, we must use memmove to correctly copy from dynptr to destination buffer, or source buffer to dynptr. This actually isn't a problem right now, as memcpy implementation falls back to memmove on detecting overlap and warns about it, but we shouldn't be relying on that. Acked-by: NJoanne Koong <joannelkoong@gmail.com> Acked-by: NDavid Vernet <void@manifault.com> Signed-off-by: NKumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20221207204141.308952-7-memxor@gmail.comSigned-off-by: NAlexei Starovoitov <ast@kernel.org>
Showing
想要评论请 注册 或 登录