From 08234503854ff143f7aea2a14cc87185ee8538d0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 6 Jan 2022 17:47:25 +0100 Subject: [PATCH] 4.4-stable patches added patches: bpf-test-fix-ld_abs-vlan-push-pop-stress-test.patch --- ...fix-ld_abs-vlan-push-pop-stress-test.patch | 48 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 49 insertions(+) create mode 100644 queue-4.4/bpf-test-fix-ld_abs-vlan-push-pop-stress-test.patch create mode 100644 queue-4.4/series diff --git a/queue-4.4/bpf-test-fix-ld_abs-vlan-push-pop-stress-test.patch b/queue-4.4/bpf-test-fix-ld_abs-vlan-push-pop-stress-test.patch new file mode 100644 index 00000000000..59a3a7a6928 --- /dev/null +++ b/queue-4.4/bpf-test-fix-ld_abs-vlan-push-pop-stress-test.patch @@ -0,0 +1,48 @@ +From 0d906b1e8d4002cdd59590fec630f4e75023e288 Mon Sep 17 00:00:00 2001 +From: Daniel Borkmann +Date: Thu, 20 Oct 2016 17:13:53 +0200 +Subject: bpf, test: fix ld_abs + vlan push/pop stress test + +From: Daniel Borkmann + +commit 0d906b1e8d4002cdd59590fec630f4e75023e288 upstream. + +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 +Acked-by: Alexei Starovoitov +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + lib/test_bpf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/test_bpf.c ++++ b/lib/test_bpf.c +@@ -4556,7 +4556,7 @@ static struct bpf_test tests[] = { + { }, + INTERNAL, + { 0x34 }, +- { { 1, 0xbef } }, ++ { { ETH_HLEN, 0xbef } }, + .fill_helper = bpf_fill_ld_abs_vlan_push_pop, + }, + /* diff --git a/queue-4.4/series b/queue-4.4/series new file mode 100644 index 00000000000..e9a17531249 --- /dev/null +++ b/queue-4.4/series @@ -0,0 +1 @@ +bpf-test-fix-ld_abs-vlan-push-pop-stress-test.patch -- 2.47.3