Skip to content

Commit bd6a6e7

Browse files
committed
kernel: remove unused wrapper for
1 parent bc35239 commit bd6a6e7

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

kernel/kernel_compat.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
#include "klog.h" // IWYU pragma: keep
99
#include "kernel_compat.h"
1010

11-
long ksu_strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
12-
long count)
13-
{
14-
return strncpy_from_user_nofault(dst, unsafe_addr, count);
15-
}
16-
1711
struct action_cache {
1812
DECLARE_BITMAP(allow_native, SECCOMP_ARCH_NATIVE_NR);
1913
#ifdef SECCOMP_ARCH_COMPAT

kernel/kernel_compat.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
#include <linux/fs.h>
55
#include <linux/version.h>
66

7-
extern long ksu_strncpy_from_user_nofault(char *dst,
8-
const void __user *unsafe_addr,
9-
long count);
10-
117
extern void ksu_seccomp_clear_cache(struct seccomp_filter *filter, int nr);
128
extern void ksu_seccomp_allow_cache(struct seccomp_filter *filter, int nr);
139

kernel/ksud.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
199199
const char __user *p = get_user_arg_ptr(*argv, 1);
200200
if (p && !IS_ERR(p)) {
201201
char first_arg[16];
202-
ksu_strncpy_from_user_nofault(first_arg, p, sizeof(first_arg));
202+
strncpy_from_user_nofault(first_arg, p, sizeof(first_arg));
203203
pr_info("/system/bin/init first arg: %s\n", first_arg);
204204
if (!strcmp(first_arg, "second_stage")) {
205205
pr_info("/system/bin/init second_stage executed\n");
@@ -221,7 +221,7 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
221221
const char __user *p = get_user_arg_ptr(*argv, 1);
222222
if (p && !IS_ERR(p)) {
223223
char first_arg[16];
224-
ksu_strncpy_from_user_nofault(first_arg, p, sizeof(first_arg));
224+
strncpy_from_user_nofault(first_arg, p, sizeof(first_arg));
225225
pr_info("/init first arg: %s\n", first_arg);
226226
if (!strcmp(first_arg, "--second-stage")) {
227227
pr_info("/init second_stage executed\n");
@@ -243,7 +243,7 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
243243
}
244244
char env[256];
245245
// Reading environment variable strings from user space
246-
if (ksu_strncpy_from_user_nofault(env, p, sizeof(env)) < 0)
246+
if (strncpy_from_user_nofault(env, p, sizeof(env)) < 0)
247247
continue;
248248
// Parsing environment variable names and values
249249
char *env_name = env;
@@ -488,7 +488,7 @@ static int sys_execve_handler_pre(struct kprobe *p, struct pt_regs *regs)
488488
return 0;
489489

490490
memset(path, 0, sizeof(path));
491-
ksu_strncpy_from_user_nofault(path, *filename_user, 32);
491+
strncpy_from_user_nofault(path, *filename_user, 32);
492492
filename_in.name = path;
493493

494494
filename_p = &filename_in;

kernel/sucompat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static int ksu_handle_faccessat(int *dfd, const char __user **filename_user,
149149

150150
char path[sizeof(su) + 1];
151151
memset(path, 0, sizeof(path));
152-
ksu_strncpy_from_user_nofault(path, *filename_user, sizeof(path));
152+
strncpy_from_user_nofault(path, *filename_user, sizeof(path));
153153

154154
if (unlikely(!memcmp(path, su, sizeof(su)))) {
155155
pr_info("faccessat su->sh!\n");
@@ -189,7 +189,7 @@ static int ksu_handle_stat(int *dfd, const char __user **filename_user,
189189
pr_info("vfs_statx su->sh!\n");
190190
memcpy((void *)filename->name, sh, sizeof(sh));
191191
#else
192-
ksu_strncpy_from_user_nofault(path, *filename_user, sizeof(path));
192+
strncpy_from_user_nofault(path, *filename_user, sizeof(path));
193193

194194
if (unlikely(!memcmp(path, su, sizeof(su)))) {
195195
pr_info("newfstatat su->sh!\n");
@@ -211,7 +211,7 @@ int ksu_handle_execve_sucompat(int *fd, const char __user **filename_user,
211211
return 0;
212212

213213
memset(path, 0, sizeof(path));
214-
ksu_strncpy_from_user_nofault(path, *filename_user, sizeof(path));
214+
strncpy_from_user_nofault(path, *filename_user, sizeof(path));
215215

216216
if (likely(memcmp(path, su, sizeof(su))))
217217
return 0;

0 commit comments

Comments
 (0)