]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: unify main prog and subprog
authorJiong Wang <jiong.wang@netronome.com>
Wed, 2 May 2018 20:17:17 +0000 (16:17 -0400)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 4 May 2018 09:58:35 +0000 (11:58 +0200)
commit813671eb02fdb5704d279c1f7c287f157b797d79
tree9749a7702e13b451ed514d4d8711bb28af91c8ea
parent8e2fb0d8d2931e1fd1a7d9de6d6b4fce105eec0a
bpf: unify main prog and subprog

Currently, verifier treat main prog and subprog differently. All subprogs
detected are kept in env->subprog_starts while main prog is not kept there.
Instead, main prog is implicitly defined as the prog start at 0.

There is actually no difference between main prog and subprog, it is better
to unify them, and register all progs detected into env->subprog_starts.

This could also help simplifying some code logic.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf_verifier.h
kernel/bpf/verifier.c