-
Notifications
You must be signed in to change notification settings - Fork 337
Closed
Description
Hi,
I am testing a simple patch to a syscall:
diff --git i/kernel/sys.c w/kernel/sys.c
index d325f3ab624a..ae31c7cd76cb 100644
--- i/kernel/sys.c
+++ w/kernel/sys.c
@@ -1266,7 +1266,7 @@ SYSCALL_DEFINE1(uname, struct old_utsname __user *, name)
return -EFAULT;
down_read(&uts_sem);
- memcpy(&tmp, utsname(), sizeof(tmp));
+ memcpy(&tmp, "hello", sizeof(tmp));
up_read(&uts_sem);
if (copy_to_user(name, &tmp, sizeof(tmp)))
return -EFAULT;
create-diff-object failed on this:
sys.o: function __do_sys_uname has no fentry/mcount call, unable to patch
which is true. On the other hand, we have __x64_sys_uname with proper fentry
(gdb) disassem __x64_sys_uname
Dump of assembler code for function __x64_sys_uname:
0xffffffff81482fb0 <+0>: callq 0xffffffff81201360 <__fentry__>
0xffffffff81482fb5 <+5>: mov 0x70(%rdi),%rdi
0xffffffff81482fb9 <+9>: jmpq 0xffffffff81482eb0 <__do_sys_uname>
So I guess we can just patch __x64_sys_uname instead?
Do we have better solution for this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels