WSL2-Linux-Kernel/kernel/livepatch
Kamalesh Babulal a36e2aa905 livepatch: Validate module/old func name length
commit 6e9df95b76 upstream.

livepatch module author can pass module name/old function name with more
than the defined character limit. With obj->name length greater than
MODULE_NAME_LEN, the livepatch module gets loaded but waits forever on
the module specified by obj->name to be loaded. It also populates a /sys
directory with an untruncated object name.

In the case of funcs->old_name length greater then KSYM_NAME_LEN, it
would not match against any of the symbol table entries. Instead loop
through the symbol table comparing them against a nonexisting function,
which can be avoided.

The same issues apply, to misspelled/incorrect names. At least gatekeep
the modules with over the limit string length, by checking for their
length during livepatch module registration.

Cc: stable@vger.kernel.org
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-09 19:55:58 +02:00
..
Kconfig livepatch: Make livepatch dependent on !TRIM_UNUSED_KSYMS 2017-05-27 00:27:37 +02:00
Makefile livepatch: change to a per-task consistency model 2017-03-08 09:36:21 +01:00
core.c livepatch: Validate module/old func name length 2018-09-09 19:55:58 +02:00
core.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
patch.c livepatch: Fix stacking of patches with respect to RCU 2017-06-20 10:42:19 +02:00
patch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
transition.c livepatch: Fix stacking of patches with respect to RCU 2017-06-20 10:42:19 +02:00
transition.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00