diff options
author | Cong Wang <[email protected]> | 2020-02-02 21:14:35 -0800 |
---|---|---|
committer | David S. Miller <[email protected]> | 2020-02-04 11:41:36 +0100 |
commit | 599be01ee567b61f4471ee8078870847d0a11e8e (patch) | |
tree | 62799958894ec43c807a2da72a1a93d0471fc7ee /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 83b43045308ea0600099830292955f18818f8d5e (diff) |
net_sched: fix an OOB access in cls_tcindex
As Eric noticed, tcindex_alloc_perfect_hash() uses cp->hash
to compute the size of memory allocation, but cp->hash is
set again after the allocation, this caused an out-of-bound
access.
So we have to move all cp->hash initialization and computation
before the memory allocation. Move cp->mask and cp->shift together
as cp->hash may need them for computation too.
Reported-and-tested-by: [email protected]
Fixes: 331b72922c5f ("net: sched: RCU cls_tcindex")
Cc: Eric Dumazet <[email protected]>
Cc: John Fastabend <[email protected]>
Cc: Jamal Hadi Salim <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions