diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-05-09 18:59:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-16 11:08:43 +0300 |
commit | f94eef3a4c9c4c17e910c1f35f79d4bcb580b73b (patch) | |
tree | 107509ca1e941acb0252c0510f8ac53ef14df80e /drivers/net/can/usb/kvaser_usb.c | |
parent | b2692091a9f418ed918ed00e97f31eeb11860f27 (diff) | |
download | linux-f94eef3a4c9c4c17e910c1f35f79d4bcb580b73b.tar.xz |
tracing: Fix regex_match_front() to not over compare the test string
commit dc432c3d7f9bceb3de6f5b44fb9c657c9810ed6d upstream.
The regex match function regex_match_front() in the tracing filter logic,
was fixed to test just the pattern length from testing the entire test
string. That is, it went from strncmp(str, r->pattern, len) to
strcmp(str, r->pattern, r->len).
The issue is that str is not guaranteed to be nul terminated, and if r->len
is greater than the length of str, it can access more memory than is
allocated.
The solution is to add a simple test if (len < r->len) return 0.
Cc: stable@vger.kernel.org
Fixes: 285caad415f45 ("tracing/filters: Fix MATCH_FRONT_ONLY filter matching")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/can/usb/kvaser_usb.c')
0 files changed, 0 insertions, 0 deletions