diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2023-09-15 13:01:23 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-09-18 09:36:20 +0100 |
commit | e22c6ea025013ae447fe269269753ffec763dde5 (patch) | |
tree | 8267685421254a304a45634013b3d5eccdf66664 /tools/testing/selftests/bpf/prog_tests/skb_load_bytes.c | |
parent | 74fa1a82386e0bc1095ae9d13962606612514df5 (diff) |
mlxsw: Use size_mul() in call to struct_size()
If, for any reason, the open-coded arithmetic causes a wraparound, the
protection that `struct_size()` adds against potential integer overflows
is defeated. Fix this by hardening call to `struct_size()` with `size_mul()`.
Fixes: 2285ec872d9d ("mlxsw: spectrum_acl_bloom_filter: use struct_size() in kzalloc()")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/skb_load_bytes.c')
0 files changed, 0 insertions, 0 deletions