]> git.baikalelectronics.ru Git - kernel.git/commit
gcc-plugins/stackleak: Exactly match strings instead of prefixes
authorKees Cook <keescook@chromium.org>
Sun, 6 Feb 2022 17:08:20 +0000 (09:08 -0800)
committerKees Cook <keescook@chromium.org>
Sun, 6 Feb 2022 18:55:03 +0000 (10:55 -0800)
commitcd0ed8f1e83d28929b826380fef2bd2d7e50fee9
tree918848ab170d5af3f4efb9b2def57b8e1a7d545e
parentf406b13352f3a2af5ce094ad1c15ec9806ee925b
gcc-plugins/stackleak: Exactly match strings instead of prefixes

Since STRING_CST may not be NUL terminated, strncmp() was used for check
for equality. However, this may lead to mismatches for longer section
names where the start matches the tested-for string. Test for exact
equality by checking for the presences of NUL termination.

Cc: Alexander Popov <alex.popov@linux.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
scripts/gcc-plugins/stackleak_plugin.c