integration/centos-7: fix shadow-newpid.patch warnings

When quickly loading/unloading this patch multiple times it is possible
to hit "Duplicate shadow variable" warnings since the patch doesn't have
any cleanup hooks on unload.
Switch to klp_shadow_get_or_alloc to ignore these.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
This commit is contained in:
Artem Savkov 2019-01-28 17:19:45 +01:00
parent 9999608062
commit 56be80720a

View File

@ -63,7 +63,7 @@ Index: src/kernel/fork.c
+ int *newpid;
+ static int ctr = 0;
+
+ newpid = klp_shadow_alloc(p, 0, sizeof(*newpid),
+ newpid = klp_shadow_get_or_alloc(p, 0, sizeof(*newpid),
+ GFP_KERNEL, NULL, NULL);
+ if (newpid)
+ *newpid = ctr++;