Commit d3e599c
bnxt: Do not read past the end of test names
Test names were being concatenated based on a offset beyond the end of
the first name, which tripped the buffer overflow detection logic:
detected buffer overflow in strnlen
[...]
Call Trace:
bnxt_ethtool_init.cold+0x18/0x18
Refactor struct hwrm_selftest_qlist_output to use an actual array,
and adjust the concatenation to use snprintf() rather than a series of
strncat() calls.
Reported-by: Niklas Cassel <[email protected]>
Link: https://lore.kernel.org/lkml/Y8F%2F1w1AZTvLglFX@x1-carbon/
Tested-by: Niklas Cassel <[email protected]>
Fixes: eb51365 ("bnxt_en: Add basic ethtool -t selftest support.")
Cc: Michael Chan <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Michael Chan <[email protected]>
Reviewed-by: Niklas Cassel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>1 parent fdfc76a commit d3e599c
File tree
2 files changed
+5
-17
lines changed- drivers/net/ethernet/broadcom/bnxt
2 files changed
+5
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3969 | 3969 | | |
3970 | 3970 | | |
3971 | 3971 | | |
3972 | | - | |
| 3972 | + | |
3973 | 3973 | | |
3974 | 3974 | | |
3975 | 3975 | | |
| |||
3980 | 3980 | | |
3981 | 3981 | | |
3982 | 3982 | | |
3983 | | - | |
3984 | | - | |
3985 | | - | |
3986 | | - | |
3987 | | - | |
3988 | | - | |
3989 | | - | |
3990 | | - | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
3991 | 3986 | | |
3992 | 3987 | | |
3993 | 3988 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10249 | 10249 | | |
10250 | 10250 | | |
10251 | 10251 | | |
10252 | | - | |
10253 | | - | |
10254 | | - | |
10255 | | - | |
10256 | | - | |
10257 | | - | |
10258 | | - | |
10259 | | - | |
| 10252 | + | |
10260 | 10253 | | |
10261 | 10254 | | |
10262 | 10255 | | |
| |||
0 commit comments