Fix false-negative return value for rtnetlink.sh in kselftests/net
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
Bionic |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
Eoan |
Invalid
|
Undecided
|
Po-Hsu Lin | ||
Focal |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
Groovy |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
linux-hwe (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
== Justification ==
All the sub test cases in rtnetlink.sh from kselftests/net were using
the same variable "ret" to store the return value of their test result,
and it will be reset to 0 in the beginning of each test.
This will cause false-negative result if the last case has passed.
Also, the kci_test_encap() test in rtnetlink.sh is actually composed by
two different sub-tests, kci_test_
Therefore we should check the test result of these two to avoid
false-negative result for this test case.
== Fixes ==
* c2a4d2747996 ("selftests: rtnetlink: correct the final return value for the test")
* 72f70c159b53 ("selftests: rtnetlink: make kci_test_encap() return sub-test result")
This issue is affecting our kernels from B to G, there is no such test
in X thus it can be skipped.
The first patch can be cherry-picked for E/F/G, but needs to be
backported for B/D as they're missing some tests.
The second patch can be cherry-picked for all affected kernels.
== Test ==
Manually tested. The test will fail as expected:
$ sudo ./rtnetlink.sh
PASS: policy routing
PASS: route get
echo $?
PASS: preferred_lft addresses have expired
PASS: promote_secondaries complete
PASS: tc htb hierarchy
PASS: gre tunnel endpoint
PASS: gretap
PASS: ip6gretap
PASS: erspan
PASS: ip6erspan
PASS: bridge setup
PASS: ipv6 addrlabel
PASS: set ifalias a28e0b75-
PASS: vrf
PASS: vxlan
FAIL: can't add fou port 7777, skipping test
PASS: macsec
PASS: ipsec
PASS: ipsec_offload
PASS: bridge fdb get
PASS: neigh get
$ echo $?
1
== Regression Potential ==
Low, changes limited to testing tools. It's expected to see this test
failing after applying these patches, since it is reflecting the actual
test result.
== Original Bug Report ==
In this test, it uses ret to store the return value of each test.
However, this value will be reset to 0 in the beginning of each test.
In the end of this test, it will judge PASS/FAIL base on this value.
Thus this will cause false-negative in some cases.
Below is an example for the test on Bionic OEM-OSP1, test "ip6erspan", "erspan", "ip6gretap" failed with return value 255, but the return value will soon be overridden with 0 if following test passed without any issue (I made the test to print === RET $ret === line for debugging purpose):
PASS: policy routing
=== RET 0 ===
PASS: route get
=== RET 0 ===
PASS: preferred_lft addresses have expired
=== RET 0 ===
PASS: tc htb hierarchy
=== RET 0 ===
PASS: gre tunnel endpoint
=== RET 0 ===
PASS: gretap
=== RET 0 ===
Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]
Where: ADDR := IPV6_ADDRESS
TTL := { 0..255 } (default=64)
KEY := { DOTTED_QUAD | NUMBER }
ELIM := { none | 0..255 }(default=4)
TCLASS := { 0x0..0xff | inherit }
FLOWLABEL := { 0x0..0xfffff | inherit }
MARK := { 0x0..0xffffffff | inherit }
Cannot find device "ip6gretap00"
FAIL: ip6gretap
=== RET 255 ===
Usage: ... { gre | gretap | erspan } [ remote ADDR ]
Where: ADDR := { IP_ADDRESS | any }
TOS := { NUMBER | inherit }
TTL := { 1..255 | inherit }
KEY := { DOTTED_QUAD | NUMBER }
MARK := { 0x0..0xffffffff }
Cannot find device "erspan00"
Cannot find device "erspan00"
Cannot find device "erspan00"
Usage: ... { gre | gretap | erspan } [ remote ADDR ]
Where: ADDR := { IP_ADDRESS | any }
TOS := { NUMBER | inherit }
TTL := { 1..255 | inherit }
KEY := { DOTTED_QUAD | NUMBER }
MARK := { 0x0..0xffffffff }
Cannot find device "erspan00"
Cannot find device "erspan00"
Cannot find device "erspan00"
FAIL: erspan
=== RET 255 ===
Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]
Where: ADDR := IPV6_ADDRESS
TTL := { 0..255 } (default=64)
KEY := { DOTTED_QUAD | NUMBER }
ELIM := { none | 0..255 }(default=4)
TCLASS := { 0x0..0xff | inherit }
FLOWLABEL := { 0x0..0xfffff | inherit }
MARK := { 0x0..0xffffffff | inherit }
Cannot find device "ip6erspan00"
Cannot find device "ip6erspan00"
Cannot find device "ip6erspan00"
Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]
Where: ADDR := IPV6_ADDRESS
TTL := { 0..255 } (default=64)
KEY := { DOTTED_QUAD | NUMBER }
ELIM := { none | 0..255 }(default=4)
TCLASS := { 0x0..0xff | inherit }
FLOWLABEL := { 0x0..0xfffff | inherit }
MARK := { 0x0..0xffffffff | inherit }
Cannot find device "ip6erspan00"
Cannot find device "ip6erspan00"
Cannot find device "ip6erspan00"
Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]
Where: ADDR := IPV6_ADDRESS
TTL := { 0..255 } (default=64)
KEY := { DOTTED_QUAD | NUMBER }
ELIM := { none | 0..255 }(default=4)
TCLASS := { 0x0..0xff | inherit }
FLOWLABEL := { 0x0..0xfffff | inherit }
MARK := { 0x0..0xffffffff | inherit }
Cannot find device "ip6erspan00"
FAIL: ip6erspan
=== RET 255 ===
PASS: bridge setup
=== RET 0 ===
PASS: ipv6 addrlabel
=== RET 0 ===
PASS: set ifalias a1214e60-
=== RET 0 ===
PASS: vrf
=== RET 0 ===
PASS: vxlan
FAIL: can't add fou port 7777, skipping test
=== RET 0 ===
PASS: macsec
=== RET 0 ===
PASS: ipsec
=== RET 0 ===
PASS: ipsec_offload
=== RET 0 ===
SKIP: fdb get tests: iproute2 too old
=== RET 0 ===
SKIP: fdb get tests: iproute2 too old
=== RET 0 ===
=== RET 0 ===
CVE References
tags: | added: ubuntu-kernel-selftests |
tags: | added: sru-20200720 |
Changed in ubuntu-kernel-tests: | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
status: | New → In Progress |
summary: |
- Return value in rtnetlink.sh from kselftests/net will be overrided in - the last test + Return value in rtnetlink.sh from kselftests/net will be override in the + last test |
description: | updated |
description: | updated |
description: | updated |
Changed in linux (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
Changed in linux-hwe (Ubuntu): | |
status: | New → Invalid |
Changed in ubuntu-kernel-tests: | |
status: | In Progress → Fix Released |
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1890136
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.