diff options
author | Petr Mladek <pmladek@suse.com> | 2019-02-04 16:56:52 +0300 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2019-02-06 13:01:57 +0300 |
commit | 49ee4dd2e753cd13d157361d4bd28b548e3d0ee7 (patch) | |
tree | 282f204261746a62ef583584cc0e5e66a2283a4a /kernel/livepatch/core.c | |
parent | 86e43f23c17126e32820a1b37d747d06f3056570 (diff) | |
download | linux-49ee4dd2e753cd13d157361d4bd28b548e3d0ee7.tar.xz |
livepatch: Proper error handling in the shadow variables selftest
Add proper error handling when allocating or getting shadow variables
in the selftest. It prevents an invalid pointer access in some situations.
It shows the good programming practice in the others.
The error codes are just the best guess and specific for this particular
test. In general, klp_shadow_alloc() returns NULL also when the given
shadow variable has already been allocated. In addition, both
klp_shadow_alloc() and klp_shadow_get_or_alloc() might fail from
other reasons when the constructor fails.
Note, that the error code is not really important even in the real life.
The use of shadow variables should be transparent for the original
livepatched code.
Acked-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'kernel/livepatch/core.c')
0 files changed, 0 insertions, 0 deletions