bpf: add more checks
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Thu, 10 May 2018 10:23:05 +0000 (11:23 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 11 May 2018 22:35:23 +0000 (00:35 +0200)
commit6e12ec4c4d6d1489ad7423cc33ce0e602636fe64
tree05dcac6c45a2ff4efe2be9f449a9cc0ab8728616
parent5dba93ae5f2dc38a13f373634bd06926716d150a
bpf: add more checks

Add checks for:
 - all instructions are valid ones
   (known opcodes, correct syntax, valid reg/off/imm values, etc.)
 - no unreachable instructions
 - no loops
 - basic stack boundaries checks
 - division by zero

Still need to add checks for:
 - use/return only initialized registers and stack data.
 - memory boundaries violation

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_bpf/bpf_validate.c