Skip to content

Conversation

@jpoimboe
Copy link
Member

The patching of jump label affected functions isn't actually supported
by the upstream kernel. So kpatch-build will warn if a function uses
jump labels.

Copy convert-global-local test to be a failing test case, since it
already fails for this reason. And then hex edit the original version
to remove the jump table references to make it pass.

FWIW, I believe the original objects were created with the following
patch, originally for dynup/kpatch#658.

diff -Nupr src.orig/mm/slub.c src/mm/slub.c
--- src.orig/mm/slub.c 2017-11-17 15:58:51.157211972 -0500
+++ src/mm/slub.c 2017-11-17 15:58:56.808211972 -0500
@@ -3731,6 +3731,9 @@ void *__kmalloc(size_t size, gfp_t flags
struct kmem_cache *s;
void *ret;

  • if (!jiffies)
  •   printk("kpatch kmalloc\n");
    
  • if (unlikely(size > KMALLOC_MAX_CACHE_SIZE))
    return kmalloc_large(size, flags);

Signed-off-by: Josh Poimboeuf jpoimboe@redhat.com

The patching of jump label affected functions isn't actually supported
by the upstream kernel.  So kpatch-build will warn if a function uses
jump labels.

Copy convert-global-local test to be a failing test case, since it
already fails for this reason.  And then hex edit the original version
to remove the jump table references to make it pass.

FWIW, I believe the original objects were created with the following
patch, originally for dynup/kpatch#658.

diff -Nupr src.orig/mm/slub.c src/mm/slub.c
--- src.orig/mm/slub.c	2017-11-17 15:58:51.157211972 -0500
+++ src/mm/slub.c	2017-11-17 15:58:56.808211972 -0500
@@ -3731,6 +3731,9 @@ void *__kmalloc(size_t size, gfp_t flags
 	struct kmem_cache *s;
 	void *ret;

+	if (!jiffies)
+		printk("kpatch kmalloc\n");
+
 	if (unlikely(size > KMALLOC_MAX_CACHE_SIZE))
 		return kmalloc_large(size, flags);

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
@jpoimboe jpoimboe merged commit bf2b013 into dynup:master Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant