Thread (3 messages) flat view 3 messages, 3 authors, 2022-02-15

Re: [PATCH bpf-next v4] bpf: reject kfunc calls that overflow insn->imm

From: Yonghong Song <hidden>
Date: 2022-02-15 15:51:08
Also in: bpf


On 2/14/22 10:57 PM, Hou Tao wrote:
Now kfunc call uses s32 to represent the offset between the address of
kfunc and __bpf_call_base, but it doesn't check whether or not s32 will
be overflowed. The overflow is possible when kfunc is in module and the
offset between module and kernel is greater than 2GB. Take arm64 as an
example, before commit b2eed9b58811 ("arm64/kernel: kaslr: reduce module
randomization range to 2 GB"), the offset between module symbol and
__bpf_call_base will in 4GB range due to KASLR and may overflow s32.

So add an extra checking to reject these invalid kfunc calls.

Signed-off-by: Hou Tao <redacted>
Acked-by: Yonghong Song <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help