]> git.baikalelectronics.ru Git - kernel.git/commit
tools, bpf_asm: Warn when jumps are out of range
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 7 Nov 2019 10:03:49 +0000 (11:03 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 7 Nov 2019 15:01:34 +0000 (16:01 +0100)
commit8d6d3ba1b202c5393990f83e619d0710d41c135e
tree341749de11e136cd25048774bc1ccbc765172fbf
parentf3d58d2bbcb10bec8587b717aa2217c2357a99b8
tools, bpf_asm: Warn when jumps are out of range

When compiling larger programs with bpf_asm, it's possible to
accidentally exceed jt/jf range, in which case it won't complain, but
rather silently emit a truncated offset, leading to a "happy debugging"
situation.

Add a warning to help detecting such issues. It could be made an error
instead, but this might break compilation of existing code (which might
be working by accident).

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191107100349.88976-1-iii@linux.ibm.com
tools/bpf/bpf_exp.y