diff options
author | Kees Cook <[email protected]> | 2022-02-15 09:10:17 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2022-02-25 12:08:52 +0100 |
commit | 3bc93c7bded0cf361e58af160e9b23996c10a1a1 (patch) | |
tree | efc3d564307c36cdc2ec90b948c857d5c340a38c /tools/perf/scripts/python/netdev-times.py | |
parent | 77e861619baea5a7c934e47fda74b03c0b072aec (diff) |
comedi: drivers: ni_routes: Use strcmp() instead of memcmp()
The family and device comparisons were using memcmp(), but this could
lead to Out-of-bounds reads when the length was larger than the
buffers being compared. Since these appear to always be NUL-terminated
strings, just use strcmp() instead.
This was found with Clang under LTO:
[ 92.405851][ T1] kernel BUG at lib/string_helpers.c:980!
...
[ 92.409141][ T1] RIP: 0010:fortify_panic (fbdev.c:?)
...
[ 92.410056][ T1] ni_assign_device_routes (fbdev.c:?)
[ 92.410056][ T1] ? unittest_enter (fbdev.c:?)
[ 92.410056][ T1] ni_routes_unittest (ni_routes_test.c:?)
[ 92.410056][ T1] ? unittest_enter (fbdev.c:?)
[ 92.410056][ T1] __initstub__kmod_ni_routes_test__505_604_ni_routes_unittest6 (fbdev.c:?)
[ 92.410056][ T1] do_one_initcall (fbdev.c:?)
Link: https://lore.kernel.org/lkml/20220210072821.GD4074@xsang-OptiPlex-9020
Fixes: 4bb90c87abbe ("staging: comedi: add interface to ni routing table information")
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Spencer E. Olson <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Lee Jones <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reviewed-by: Ian Abbott <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/netdev-times.py')
0 files changed, 0 insertions, 0 deletions