syscall: Increase bpf fake uname to 5.4.299

Signed-off-by: Naveen <133593113+elohim-etz@users.noreply.github.com>
This commit is contained in:
Tim Zimmermann
2023-10-06 05:32:56 +02:00
committed by Ansh
parent 7f11ef316a
commit 5f89a2e6ff

View File

@@ -1191,6 +1191,15 @@ SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
down_read(&uts_sem);
memcpy(&tmp, utsname(), sizeof(tmp));
if (!strncmp(current->comm, "bpfloader", 9) ||
!strncmp(current->comm, "netbpfload", 10) ||
!strncmp(current->comm, "netd", 4)) {
if (current_uid().val == 0) {
strcpy(tmp.release, "5.4.299");
pr_debug("fake uname: %s/%d release=%s\n",
current->comm, current->pid, tmp.release);
}
}
up_read(&uts_sem);
if (copy_to_user(name, &tmp, sizeof(tmp)))
return -EFAULT;