]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Perform CFG walk for exception callback
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Tue, 12 Sep 2023 23:32:04 +0000 (01:32 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 16 Sep 2023 16:34:21 +0000 (09:34 -0700)
commitb62bf8a5e9110922f58f6ea8fe747e1759f49e61
treeb5992be840bc234adc2157ec1f62fa4e14b8bd62
parentb9ae0c9dd0aca79bffc17be51c2dc148d1f72708
bpf: Perform CFG walk for exception callback

Since exception callbacks are not referenced using bpf_pseudo_func and
bpf_pseudo_call instructions, check_cfg traversal will never explore
instructions of the exception callback. Even after adding the subprog,
the program will then fail with a 'unreachable insn' error.

We thus need to begin walking from the start of the exception callback
again in check_cfg after a complete CFG traversal finishes, so as to
explore the CFG rooted at the exception callback.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20230912233214.1518551-8-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c