icmp_redirect from selftests fails on F/kvm (unary operator expected)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
Focal |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
Hirsute |
Won't Fix
|
Undecided
|
Po-Hsu Lin | ||
Impish |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
Jammy |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
linux-oem-5.10 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Won't Fix
|
Undecided
|
Unassigned | ||
Hirsute |
Invalid
|
Undecided
|
Unassigned | ||
Impish |
Invalid
|
Undecided
|
Unassigned | ||
Jammy |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[Impact]
If any sub-test in this icmp_redirect.sh is failing but not expected
to fail. The script will complain:
./icmp_
This is because when the sub-test is not expected to fail, we won't
pass any value for the xfail local variable in log_test() and thus
it's empty. Fix this by passing 0 as the 4th variable to log_test()
for non-xfail cases.
This issue can be found on our KVM kernel with SRU tests, they're
failing because of missing some kernel configs.
[Fix]
* 39d8622c72 "selftests: icmp_redirect: pass xfail=0 to log_test()"
This patch can be cherry-picked into all of the affected kernels.
[Test Plan]
Run the patched icmp_redirect.sh script with a KVM kernel (e.g. F/kvm),
and this "unary operator expected" error message should no longer exist.
[Where problems could occur]
Change limited to test script, it won't have any impact to real kernel
function. And this issue is most likely specific to KVM kernels.
== Original Bug Report ==
icmp_redirect from selftect is failing on F/kvm 5.4.0-1045.47
# selftests: net: icmp_redirect.sh
#
# #######
# Legacy routing
# #######
#
# TEST: IPv4: redirect exception [ OK ]
# TEST: IPv6: redirect exception [ OK ]
# TEST: IPv4: redirect exception plus mtu [ OK ]
# TEST: IPv6: redirect exception plus mtu [ OK ]
# TEST: IPv4: routing reset [ OK ]
# TEST: IPv6: routing reset [ OK ]
# TEST: IPv4: mtu exception [ OK ]
# TEST: IPv6: mtu exception [ OK ]
# TEST: IPv4: mtu exception plus redirect [ OK ]
# TEST: IPv6: mtu exception plus redirect [XFAIL]
#
# #######
# Legacy routing with VRF
# #######
#
# Error: Unknown device type.
# Cannot find device "red"
# Error: argument "red" is wrong: Invalid VRF
#
# Error: argument "red" is wrong: Invalid VRF
#
# Cannot find device "red"
# Cannot find device "red"
# Error: argument "red" is wrong: Not a valid VRF name
#
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: redirect exception [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: redirect exception [XFAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: redirect exception plus mtu [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: redirect exception plus mtu [XFAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: routing reset [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: routing reset [XFAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: mtu exception [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: mtu exception [XFAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: mtu exception plus redirect [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: mtu exception plus redirect [XFAIL]
#
# #######
# Routing with nexthop objects
# #######
#
# TEST: IPv4: redirect exception [ OK ]
# TEST: IPv6: redirect exception [ OK ]
# TEST: IPv4: redirect exception plus mtu [ OK ]
# TEST: IPv6: redirect exception plus mtu [ OK ]
# TEST: IPv4: routing reset [ OK ]
# TEST: IPv6: routing reset [ OK ]
# TEST: IPv4: mtu exception [ OK ]
# TEST: IPv6: mtu exception [ OK ]
# TEST: IPv4: mtu exception plus redirect [ OK ]
# TEST: IPv6: mtu exception plus redirect [XFAIL]
#
# #######
# Routing with nexthop objects and VRF
# #######
#
# Error: Unknown device type.
# Cannot find device "red"
# Error: argument "red" is wrong: Invalid VRF
#
# Error: argument "red" is wrong: Invalid VRF
#
# Cannot find device "red"
# Cannot find device "red"
# Error: argument "red" is wrong: Not a valid VRF name
#
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: redirect exception [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: redirect exception [XFAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: redirect exception plus mtu [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: redirect exception plus mtu [XFAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: routing reset [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: routing reset [XFAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: mtu exception [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: mtu exception [XFAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# ./icmp_redirect.sh: line 71: [: 1: unary operator expected
# TEST: IPv4: mtu exception plus redirect [FAIL]
# Error: argument "red" is wrong: Invalid VRF
#
# TEST: IPv6: mtu exception plus redirect [XFAIL]
#
# Tests passed: 18
# Tests failed: 10
# Tests xfailed: 12
not ok 35 selftests: net: icmp_redirect.sh # exit=1
CVE References
Changed in ubuntu-kernel-tests: | |
status: | New → In Progress |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
description: | updated |
Changed in linux (Ubuntu Focal): | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
Changed in linux (Ubuntu Hirsute): | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
Changed in linux (Ubuntu Impish): | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
Changed in linux (Ubuntu Jammy): | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
Changed in linux (Ubuntu Focal): | |
status: | New → In Progress |
Changed in linux (Ubuntu Hirsute): | |
status: | New → In Progress |
Changed in linux (Ubuntu Impish): | |
status: | New → In Progress |
Changed in linux (Ubuntu Jammy): | |
status: | Incomplete → In Progress |
description: | updated |
Changed in linux (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Impish): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Hirsute): | |
status: | In Progress → Fix Committed |
Changed in linux-oem-5.10 (Ubuntu Focal): | |
status: | New → Fix Committed |
Changed in linux-oem-5.10 (Ubuntu Hirsute): | |
status: | New → Invalid |
Changed in linux-oem-5.10 (Ubuntu Impish): | |
status: | New → Invalid |
Changed in linux-oem-5.10 (Ubuntu Jammy): | |
status: | New → Invalid |
Changed in ubuntu-kernel-tests: | |
status: | In Progress → Fix Released |
Found on Focal ibm 5.4.0-1007.8