Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aarch64 unit tests #51

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mihails-strasuns
Copy link

Based on https://github.com/joe-lawrence/kpatch-unit-test-objs/tree/initial-aarch64

Adds 2 more unit tests on top of that using aarch64 regressions we have previously noticed/fixed internally at Amazon Linux.

joe-lawrence and others added 3 commits June 14, 2024 12:43
Add a snapshot of aarch64objfiles currently available in kpatch repo.

  compiler: gcc-11.2.1-9.1.el9
  kernel:   5.17.0-rc4+ (v13 with dropped STACK_VALIDATION dependency on
                         top of v5.17-rc4)

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Generated from 6.1.52-71.125 using the following patch:

```
diff --git a/kernel/sys.c b/kernel/sys.c
index c85e1abf7b7c..3aa9a596f840 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1296,13 +1296,15 @@ static int override_release(char __user *release, size_t len)
 	return ret;
 }

-SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
+#include "kpatch-syscall.h"
+KPATCH_SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
 {
 	struct new_utsname tmp;

 	down_read(&uts_sem);
 	memcpy(&tmp, utsname(), sizeof(tmp));
 	up_read(&uts_sem);
+       strcat(tmp.sysname, ".kpatch");
 	if (copy_to_user(name, &tmp, sizeof(tmp)))
 		return -EFAULT;

 ```

Regression test for the following fix in the aarch64 implementation
branch:

c4ddae0 kpatch-syscall.h: add aarch64 helper

Signed-off-by: Mihails Strasuns <mstrasun@amazon.com>
Generated on version 6.1.52-71.125 using the following patch:

---
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b6c16db86c71..07abdacab1d1 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -506,6 +506,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t
gfp_mask,
         */
        size = SKB_DATA_ALIGN(size);
        size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
+       printk("trigger");
        osize = kmalloc_size_roundup(size);
        data = kmalloc_reserve(osize, gfp_mask, node, &pfmemalloc);
        if (unlikely(!data))
---

Regression test for the following fix in the aarch64 implementation
branch:

46456da create-diff-object: Fix mapping symbol handling on aarch64

Signed-off-by: Mihails Strasuns <mstrasun@amazon.com>
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.

2 participants