* [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y
@ 2022-08-24 14:43 Jean-Philippe Brucker
2022-08-24 14:43 ` [PATCH 5.4 1/2] Revert "selftests/bpf: Fix "dubious pointer arithmetic" test" Jean-Philippe Brucker
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jean-Philippe Brucker @ 2022-08-24 14:43 UTC (permalink / raw)
To: stable; +Cc: gregkh, raajeshdasari, ovidiu.panait, Jean-Philippe Brucker
Rajesh reports [1] that the test_align BPF selftest is broken in
5.4.210. Three patches were added since 5.4.209:
(A) 7c1134c7da99 ("bpf: Verifer, adjust_scalar_min_max_vals to always call update_reg_bounds()")
(B) 6a9b3f0f3bad ("selftests/bpf: Fix test_align verifier log patterns")
(C) 6098562ed9df ("selftests/bpf: Fix "dubious pointer arithmetic" test")
(A) fixes an issue in the BPF verifier, which changes the verifier trace
output. (B) fixes those trace changes in the selftests.
Unfortunately (B) also address changes to the verifier output from other
patches that weren't backported to v5.4, so the test now fails.
(C) also addresses a different verifier change that is not in v5.4.
Therefore revert (C), and partially revert (B).
[1] https://lore.kernel.org/all/CAPXMrf-C5XEUfOJd3GCtgtHOkc8DxDGbLxE5=GFmr+Py0zKxJA@mail.gmail.com/
Jean-Philippe Brucker (2):
Revert "selftests/bpf: Fix "dubious pointer arithmetic" test"
Revert "selftests/bpf: Fix test_align verifier log patterns"
tools/testing/selftests/bpf/test_align.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--
2.37.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 5.4 1/2] Revert "selftests/bpf: Fix "dubious pointer arithmetic" test"
2022-08-24 14:43 [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y Jean-Philippe Brucker
@ 2022-08-24 14:43 ` Jean-Philippe Brucker
2022-08-24 14:43 ` [PATCH 5.4 2/2] Revert "selftests/bpf: Fix test_align verifier log patterns" Jean-Philippe Brucker
2022-08-25 11:57 ` [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y Greg KH
2 siblings, 0 replies; 4+ messages in thread
From: Jean-Philippe Brucker @ 2022-08-24 14:43 UTC (permalink / raw)
To: stable; +Cc: gregkh, raajeshdasari, ovidiu.panait, Jean-Philippe Brucker
This reverts commit 6098562ed9df1babcc0ba5b89c4fb47715ba3f72.
It shouldn't be in v5.4 because the commit it fixes is only present in
v5.9 onward.
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
tools/testing/selftests/bpf/test_align.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_align.c b/tools/testing/selftests/bpf/test_align.c
index 4b9a26caa2c2..c9c9bdce9d6d 100644
--- a/tools/testing/selftests/bpf/test_align.c
+++ b/tools/testing/selftests/bpf/test_align.c
@@ -475,10 +475,10 @@ static struct bpf_align_test tests[] = {
*/
{7, "R5_w=inv(id=0,smin_value=-9223372036854775806,smax_value=9223372036854775806,umin_value=2,umax_value=18446744073709551614,var_off=(0x2; 0xfffffffffffffffc)"},
/* Checked s>=0 */
- {9, "R5=inv(id=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"},
+ {9, "R5=inv(id=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"},
/* packet pointer + nonnegative (4n+2) */
- {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"},
- {13, "R4_w=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"},
+ {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"},
+ {13, "R4_w=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"},
/* NET_IP_ALIGN + (4n+2) == (4n), alignment is fine.
* We checked the bounds, but it might have been able
* to overflow if the packet pointer started in the
@@ -486,7 +486,7 @@ static struct bpf_align_test tests[] = {
* So we did not get a 'range' on R6, and the access
* attempt will fail.
*/
- {15, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"},
+ {15, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"},
}
},
{
--
2.37.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 5.4 2/2] Revert "selftests/bpf: Fix test_align verifier log patterns"
2022-08-24 14:43 [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y Jean-Philippe Brucker
2022-08-24 14:43 ` [PATCH 5.4 1/2] Revert "selftests/bpf: Fix "dubious pointer arithmetic" test" Jean-Philippe Brucker
@ 2022-08-24 14:43 ` Jean-Philippe Brucker
2022-08-25 11:57 ` [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y Greg KH
2 siblings, 0 replies; 4+ messages in thread
From: Jean-Philippe Brucker @ 2022-08-24 14:43 UTC (permalink / raw)
To: stable; +Cc: gregkh, raajeshdasari, ovidiu.panait, Jean-Philippe Brucker
This partially reverts commit 6a9b3f0f3bad4ca6421f8c20e1dde9839699db0f.
The upstream commit addresses multiple verifier changes, only one of
which was backported to v5.4. Therefore only keep the relevant changes
and revert the others.
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
tools/testing/selftests/bpf/test_align.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_align.c b/tools/testing/selftests/bpf/test_align.c
index c9c9bdce9d6d..6cc29b58d670 100644
--- a/tools/testing/selftests/bpf/test_align.c
+++ b/tools/testing/selftests/bpf/test_align.c
@@ -475,10 +475,10 @@ static struct bpf_align_test tests[] = {
*/
{7, "R5_w=inv(id=0,smin_value=-9223372036854775806,smax_value=9223372036854775806,umin_value=2,umax_value=18446744073709551614,var_off=(0x2; 0xfffffffffffffffc)"},
/* Checked s>=0 */
- {9, "R5=inv(id=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"},
+ {9, "R5=inv(id=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"},
/* packet pointer + nonnegative (4n+2) */
- {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"},
- {13, "R4_w=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"},
+ {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"},
+ {13, "R4_w=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"},
/* NET_IP_ALIGN + (4n+2) == (4n), alignment is fine.
* We checked the bounds, but it might have been able
* to overflow if the packet pointer started in the
@@ -486,7 +486,7 @@ static struct bpf_align_test tests[] = {
* So we did not get a 'range' on R6, and the access
* attempt will fail.
*/
- {15, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"},
+ {15, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"},
}
},
{
@@ -580,18 +580,18 @@ static struct bpf_align_test tests[] = {
/* Adding 14 makes R6 be (4n+2) */
{11, "R6_w=inv(id=0,umin_value=14,umax_value=74,var_off=(0x2; 0x7c))"},
/* Subtracting from packet pointer overflows ubounds */
- {13, "R5_w=pkt(id=1,off=0,r=8,umin_value=18446744073709551542,umax_value=18446744073709551602,var_off=(0xffffffffffffff82; 0x7c)"},
+ {13, "R5_w=pkt(id=1,off=0,r=8,umin_value=18446744073709551542,umax_value=18446744073709551602,var_off=(0xffffffffffffff82; 0x7c))"},
/* New unknown value in R7 is (4n), >= 76 */
{15, "R7_w=inv(id=0,umin_value=76,umax_value=1096,var_off=(0x0; 0x7fc))"},
/* Adding it to packet pointer gives nice bounds again */
- {16, "R5_w=pkt(id=2,off=0,r=0,umin_value=2,umax_value=1082,var_off=(0x2; 0xfffffffc)"},
+ {16, "R5_w=pkt(id=2,off=0,r=0,umin_value=2,umax_value=1082,var_off=(0x2; 0x7fc))"},
/* At the time the word size load is performed from R5,
* its total fixed offset is NET_IP_ALIGN + reg->off (0)
* which is 2. Then the variable offset is (4n+2), so
* the total offset is 4-byte aligned and meets the
* load's requirements.
*/
- {20, "R5=pkt(id=2,off=0,r=4,umin_value=2,umax_value=1082,var_off=(0x2; 0xfffffffc)"},
+ {20, "R5=pkt(id=2,off=0,r=4,umin_value=2,umax_value=1082,var_off=(0x2; 0x7fc))"},
},
},
};
--
2.37.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y
2022-08-24 14:43 [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y Jean-Philippe Brucker
2022-08-24 14:43 ` [PATCH 5.4 1/2] Revert "selftests/bpf: Fix "dubious pointer arithmetic" test" Jean-Philippe Brucker
2022-08-24 14:43 ` [PATCH 5.4 2/2] Revert "selftests/bpf: Fix test_align verifier log patterns" Jean-Philippe Brucker
@ 2022-08-25 11:57 ` Greg KH
2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2022-08-25 11:57 UTC (permalink / raw)
To: Jean-Philippe Brucker; +Cc: stable, raajeshdasari, ovidiu.panait
On Wed, Aug 24, 2022 at 03:43:26PM +0100, Jean-Philippe Brucker wrote:
> Rajesh reports [1] that the test_align BPF selftest is broken in
> 5.4.210. Three patches were added since 5.4.209:
>
> (A) 7c1134c7da99 ("bpf: Verifer, adjust_scalar_min_max_vals to always call update_reg_bounds()")
> (B) 6a9b3f0f3bad ("selftests/bpf: Fix test_align verifier log patterns")
> (C) 6098562ed9df ("selftests/bpf: Fix "dubious pointer arithmetic" test")
>
> (A) fixes an issue in the BPF verifier, which changes the verifier trace
> output. (B) fixes those trace changes in the selftests.
>
> Unfortunately (B) also address changes to the verifier output from other
> patches that weren't backported to v5.4, so the test now fails.
> (C) also addresses a different verifier change that is not in v5.4.
>
> Therefore revert (C), and partially revert (B).
>
> [1] https://lore.kernel.org/all/CAPXMrf-C5XEUfOJd3GCtgtHOkc8DxDGbLxE5=GFmr+Py0zKxJA@mail.gmail.com/
>
> Jean-Philippe Brucker (2):
> Revert "selftests/bpf: Fix "dubious pointer arithmetic" test"
> Revert "selftests/bpf: Fix test_align verifier log patterns"
>
> tools/testing/selftests/bpf/test_align.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> --
> 2.37.1
>
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-25 11:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-24 14:43 [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y Jean-Philippe Brucker
2022-08-24 14:43 ` [PATCH 5.4 1/2] Revert "selftests/bpf: Fix "dubious pointer arithmetic" test" Jean-Philippe Brucker
2022-08-24 14:43 ` [PATCH 5.4 2/2] Revert "selftests/bpf: Fix test_align verifier log patterns" Jean-Philippe Brucker
2022-08-25 11:57 ` [PATCH 5.4 0/2] Revert BPF selftest fixes in 5.4.y Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.