Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 0 additions & 137 deletions .github/workflows/avd-kernel.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/workflows/build-kernel-arcvm.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
name: Build Kernel - ChromeOS ARCVM
on:
push:
branches: ["main", "ci", "checkci"]
paths:
- ".github/workflows/build-kernel-arcvm.yml"
- "kernel/**"
pull_request:
branches: ["main"]
paths:
- ".github/workflows/build-kernel-arcvm.yml"
- "kernel/**"
workflow_call:
workflow_dispatch:

Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/build-kernel-avd.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/build-kernel-wsa.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
name: Build Kernel - WSA
on:
push:
branches: ["main", "ci", "checkci"]
paths:
- ".github/workflows/build-kernel-wsa.yml"
- ".github/workflows/wsa-kernel.yml"
- "kernel/**"
pull_request:
branches: ["main"]
paths:
- ".github/workflows/build-kernel-wsa.yml"
- ".github/workflows/wsa-kernel.yml"
- "kernel/**"
workflow_call:
workflow_dispatch:

Expand Down
10 changes: 9 additions & 1 deletion kernel/core_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,21 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)

if (ksu_get_manager_uid() == new_uid.val) {
pr_info("install fd for: %d\n", new_uid.val);
spin_lock_irq(&current->sighand->siglock);
ksu_install_fd();
spin_lock_irq(&current->sighand->siglock);
ksu_seccomp_allow_cache(current->seccomp.filter, __NR_reboot);
spin_unlock_irq(&current->sighand->siglock);
return 0;
}

if (ksu_is_allow_uid(new_uid.val)) {
if (current->seccomp.mode == SECCOMP_MODE_FILTER && current->seccomp.filter) {
spin_lock_irq(&current->sighand->siglock);
ksu_seccomp_allow_cache(current->seccomp.filter, __NR_reboot);
spin_unlock_irq(&current->sighand->siglock);
}
}

// this hook is used for umounting overlayfs for some uid, if there isn't any module mounted, just ignore it!
if (!ksu_module_mounted) {
return 0;
Expand Down
10 changes: 9 additions & 1 deletion userspace/ksud/src/ksucalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,22 @@ fn init_driver_fd() -> Option<RawFd> {
}
}

#[cfg(not(any(target_os = "linux", target_os = "android")))]
fn init_driver_fd() -> Option<RawFd> {
None
}

// ioctl wrapper using libc
#[cfg(any(target_os = "linux", target_os = "android"))]
fn ksuctl<T>(request: u32, arg: *mut T) -> std::io::Result<i32> {
use std::io;

let fd = *DRIVER_FD.get_or_init(|| init_driver_fd().unwrap_or(-1));
unsafe {
let ret = libc::ioctl(fd as libc::c_int, request as libc::c_int, arg);
#[cfg(target_os = "android")]
let ret = libc::ioctl(fd as libc::c_int, request as i32, arg);
#[cfg(not(target_os = "android"))]
let ret = libc::ioctl(fd as libc::c_int, request as u64, arg);
if ret < 0 {
Err(io::Error::last_os_error())
} else {
Expand Down