bpf: fix check array size
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Fri, 21 Jun 2019 14:26:49 +0000 (15:26 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 27 Jun 2019 21:17:10 +0000 (23:17 +0200)
commit28b2d3d112e2bde5264921d8feca89e2e5708a87
tree367a54fdbf62d502d9c9d374bf6b1d4e9057a252
parentb11b76c22c55c06cabd113a04d7c92bdc3f18aa7
bpf: fix check array size

Array ins_chk in lib/librte_bpf/bpf_validate.c has 255 entries.
So the instruction with opcode == 255 will reading beyond array
boundaries.
For more details please refer to:
https://bugs.dpdk.org/show_bug.cgi?id=283

Fixes: 6e12ec4c4d6d ("bpf: add more checks")
Cc: stable@dpdk.org
Reported-by: Michel Machado <michel@digirati.com.br>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_bpf/bpf_validate.c