Daniel Borkmann 0d906b1e8d bpf, test: fix ld_abs + vlan push/pop stress test
After commit 636c2628086e ("net: skbuff: Remove errornous length
validation in skb_vlan_pop()") mentioned test case stopped working,
throwing a -12 (ENOMEM) return code. The issue however is not due to
636c2628086e, but rather due to a buggy test case that got uncovered
from the change in behaviour in 636c2628086e.

The data_size of that test case for the skb was set to 1. In the
bpf_fill_ld_abs_vlan_push_pop() handler bpf insns are generated that
loop with: reading skb data, pushing 68 tags, reading skb data,
popping 68 tags, reading skb data, etc, in order to force a skb
expansion and thus trigger that JITs recache skb->data. Problem is
that initial data_size is too small.

While before 636c2628086e, the test silently bailed out due to the
skb->len < VLAN_ETH_HLEN check with returning 0, and now throwing an
error from failing skb_ensure_writable(). Set at least minimum of
ETH_HLEN as an initial length so that on first push of data, equivalent
pop will succeed.

Fixes: 4d9c5c53ac99 ("test_bpf: add bpf_skb_vlan_push/pop() tests")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-10-20 14:39:06 -04:00
..
2014-10-09 11:35:48 +03:00
2016-07-29 18:30:16 +08:00
2011-03-11 14:25:50 +00:00
2016-10-11 15:06:30 -07:00
2015-11-23 09:44:58 +01:00
2016-03-17 15:09:34 -07:00
2011-10-29 21:20:22 +02:00
2016-02-29 09:35:20 +01:00
2016-02-07 23:17:59 -08:00
2016-10-06 17:13:54 -07:00
2014-04-30 19:49:37 +01:00
2014-08-06 18:01:25 -07:00
2014-05-05 09:09:14 +02:00
2016-05-23 17:04:14 -07:00
2014-08-08 15:57:25 -07:00
2016-03-09 15:43:42 -08:00
2015-02-12 18:54:15 -08:00
2012-07-30 17:25:16 -07:00
2014-06-25 17:45:43 -07:00
2016-04-23 20:13:24 -04:00
2015-09-08 14:35:59 -07:00
2015-02-12 18:54:16 -08:00
2016-09-27 22:09:17 -04:00
2016-07-06 10:51:14 +01:00
2016-09-20 04:43:36 -04:00
2016-09-19 08:19:40 -06:00
2015-03-23 22:12:08 -04:00
2015-06-25 17:00:40 -07:00
2016-03-17 15:09:34 -07:00
2016-05-30 15:26:57 -07:00
2016-08-02 17:31:41 -04:00