diff options
author | 2019-07-01 19:15:46 -0700 | |
---|---|---|
committer | 2019-07-01 19:15:46 -0700 | |
commit | 8a534f8fb0dc44694a437b575060499efd1c91de (patch) | |
tree | 88f7b417e9a8c7061b04e7ba0a77c3884b4f018b /tools | |
parent | Merge branch 'vsock-virtio-fixes' (diff) | |
parent | selftests: add a test case for cls_lower handle overflow (diff) | |
download | linux-dev-8a534f8fb0dc44694a437b575060499efd1c91de.tar.xz linux-dev-8a534f8fb0dc44694a437b575060499efd1c91de.zip |
Merge branch 'idr-fix-overflow-cases-on-32-bit-CPU'
Cong Wang says:
====================
idr: fix overflow cases on 32-bit CPU
idr_get_next_ul() is problematic by design, it can't handle
the following overflow case well on 32-bit CPU:
u32 id = UINT_MAX;
idr_alloc_u32(&id);
while (idr_get_next_ul(&id) != NULL)
id++;
when 'id' overflows and becomes 0 after UINT_MAX, the loop
goes infinite.
Fix this by eliminating external users of idr_get_next_ul()
and migrating them to idr_for_each_entry_continue_ul(). And
add an additional parameter for these iteration macros to detect
overflow properly.
Please merge this through networking tree, as all the users
are in networking subsystem.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/tc-testing/tc-tests/filters/tests.json | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json index e2f92cefb8d5..16559c436f21 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json +++ b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json @@ -39,6 +39,25 @@ ] }, { + "id": "2ff3", + "name": "Add flower with max handle and then dump it", + "category": [ + "filter", + "flower" + ], + "setup": [ + "$TC qdisc add dev $DEV2 ingress" + ], + "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 parent ffff: handle 0xffffffff flower action ok", + "expExitCode": "0", + "verifyCmd": "$TC filter show dev $DEV2 ingress", + "matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff", + "matchCount": "1", + "teardown": [ + "$TC qdisc del dev $DEV2 ingress" + ] + }, + { "id": "d052", "name": "Add 1M filters with the same action", "category": [ |