Skip to content

Commit 9027552

Browse files
committed
Revert "scope-minimized manual hooks v1.7"
This reverts commit bd238d6.
1 parent 0c5cf14 commit 9027552

File tree

6 files changed

+0
-63
lines changed

6 files changed

+0
-63
lines changed

drivers/input/input.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -436,22 +436,11 @@ static void input_handle_event(struct input_dev *dev,
436436
* to 'seed' initial state of a switch or initial position of absolute
437437
* axis, etc.
438438
*/
439-
#ifdef CONFIG_KSU
440-
extern bool ksu_input_hook __read_mostly;
441-
extern __attribute__((cold)) int ksu_handle_input_handle_event(
442-
unsigned int *type, unsigned int *code, int *value);
443-
#endif
444-
445439
void input_event(struct input_dev *dev,
446440
unsigned int type, unsigned int code, int value)
447441
{
448442
unsigned long flags;
449443

450-
#ifdef CONFIG_KSU
451-
if (unlikely(ksu_input_hook))
452-
ksu_handle_input_handle_event(&type, &code, &value);
453-
#endif
454-
455444
if (is_event_supported(type, dev->evbit, EV_MAX)) {
456445

457446
spin_lock_irqsave(&dev->event_lock, flags);

fs/exec.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,21 +1837,12 @@ static int do_execveat_common(int fd, struct filename *filename,
18371837
return retval;
18381838
}
18391839

1840-
#ifdef CONFIG_KSU
1841-
__attribute__((hot))
1842-
extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr,
1843-
void *argv, void *envp, int *flags);
1844-
#endif
1845-
18461840
int do_execve(struct filename *filename,
18471841
const char __user *const __user *__argv,
18481842
const char __user *const __user *__envp)
18491843
{
18501844
struct user_arg_ptr argv = { .ptr.native = __argv };
18511845
struct user_arg_ptr envp = { .ptr.native = __envp };
1852-
#ifdef CONFIG_KSU
1853-
ksu_handle_execveat((int *)AT_FDCWD, &filename, &argv, &envp, 0);
1854-
#endif
18551846
return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
18561847
}
18571848

@@ -1879,9 +1870,6 @@ static int compat_do_execve(struct filename *filename,
18791870
.is_compat = true,
18801871
.ptr.compat = __envp,
18811872
};
1882-
#ifdef CONFIG_KSU // 32-bit ksud and 32-on-64 support
1883-
ksu_handle_execveat((int *)AT_FDCWD, &filename, &argv, &envp, 0);
1884-
#endif
18851873
return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
18861874
}
18871875

fs/open.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,6 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
355355
return error;
356356
}
357357

358-
#ifdef CONFIG_KSU
359-
__attribute__((hot))
360-
extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user,
361-
int *mode, int *flags);
362-
#endif
363-
364358
/*
365359
* access() needs to use the real uid/gid, not the effective uid/gid.
366360
* We do this by temporarily clearing all FS-related capabilities and
@@ -376,10 +370,6 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
376370
int res;
377371
unsigned int lookup_flags = LOOKUP_FOLLOW;
378372

379-
#ifdef CONFIG_KSU
380-
ksu_handle_faccessat(&dfd, &filename, &mode, NULL);
381-
#endif
382-
383373
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
384374
return -EINVAL;
385375

fs/stat.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,22 +287,13 @@ SYSCALL_DEFINE2(newlstat, const char __user *, filename,
287287
return cp_new_stat(&stat, statbuf);
288288
}
289289

290-
#ifdef CONFIG_KSU
291-
__attribute__((hot))
292-
extern int ksu_handle_stat(int *dfd, const char __user **filename_user,
293-
int *flags);
294-
#endif
295-
296290
#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
297291
SYSCALL_DEFINE4(newfstatat, int, dfd, const char __user *, filename,
298292
struct stat __user *, statbuf, int, flag)
299293
{
300294
struct kstat stat;
301295
int error;
302296

303-
#ifdef CONFIG_KSU
304-
ksu_handle_stat(&dfd, &filename, &flag);
305-
#endif
306297
error = vfs_fstatat(dfd, filename, &stat, flag);
307298
if (error)
308299
return error;
@@ -445,9 +436,6 @@ SYSCALL_DEFINE4(fstatat64, int, dfd, const char __user *, filename,
445436
struct kstat stat;
446437
int error;
447438

448-
#ifdef CONFIG_KSU // 32-bit su
449-
ksu_handle_stat(&dfd, &filename, &flag);
450-
#endif
451439
error = vfs_fstatat(dfd, filename, &stat, flag);
452440
if (error)
453441
return error;

kernel/reboot.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,21 +277,13 @@ static DEFINE_MUTEX(reboot_mutex);
277277
*
278278
* reboot doesn't sync: do that yourself before calling this.
279279
*/
280-
281-
#ifdef CONFIG_KSU
282-
extern int ksu_handle_sys_reboot(int magic1, int magic2, unsigned int cmd, void __user **arg);
283-
#endif
284-
285280
SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
286281
void __user *, arg)
287282
{
288283
struct pid_namespace *pid_ns = task_active_pid_ns(current);
289284
char buffer[256];
290285
int ret = 0;
291286

292-
#ifdef CONFIG_KSU
293-
ksu_handle_sys_reboot(magic1, magic2, cmd, &arg);
294-
#endif
295287
/* We only trust the superuser with rebooting the system. */
296288
if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT))
297289
return -EPERM;

security/selinux/hooks.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,11 +2314,6 @@ static u32 ptrace_parent_sid(struct task_struct *task)
23142314
return sid;
23152315
}
23162316

2317-
#ifdef CONFIG_KSU
2318-
extern bool is_ksu_transition(const struct task_security_struct *old_tsec,
2319-
const struct task_security_struct *new_tsec);
2320-
#endif
2321-
23222317
static int check_nnp_nosuid(const struct linux_binprm *bprm,
23232318
const struct task_security_struct *old_tsec,
23242319
const struct task_security_struct *new_tsec)
@@ -2333,11 +2328,6 @@ static int check_nnp_nosuid(const struct linux_binprm *bprm,
23332328
if (new_tsec->sid == old_tsec->sid)
23342329
return 0; /* No change in credentials */
23352330

2336-
#ifdef CONFIG_KSU
2337-
if (is_ksu_transition(old_tsec, new_tsec))
2338-
return 0;
2339-
#endif
2340-
23412331
/*
23422332
* The only transitions we permit under NNP or nosuid
23432333
* are transitions to bounded SIDs, i.e. SIDs that are

0 commit comments

Comments
 (0)