Skip to content

Commit

Permalink
Explicitly stub some syscalls used by new versions of alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Oct 20, 2024
1 parent fc4ee06 commit 9830c54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ syscall_t syscall_table[] = {
[212] = (syscall_t) sys_chown32,
[213] = (syscall_t) sys_setuid,
[214] = (syscall_t) sys_setgid,
[215] = (syscall_t) syscall_stub, // setfsuid
[216] = (syscall_t) syscall_stub, // setfsgid
[219] = (syscall_t) sys_madvise,
[220] = (syscall_t) sys_getdents64,
[221] = (syscall_t) sys_fcntl,
Expand Down Expand Up @@ -246,6 +248,7 @@ syscall_t syscall_table[] = {
[377] = (syscall_t) sys_copy_file_range,
[383] = (syscall_t) syscall_silent_stub, // statx
[384] = (syscall_t) sys_arch_prctl,
[422] = (syscall_t) syscall_silent_stub, // futex_time64
[439] = (syscall_t) syscall_silent_stub, // faccessat2
};

Expand All @@ -259,7 +262,7 @@ void handle_interrupt(int interrupt) {
unsigned syscall_num = cpu->eax;
if (syscall_num >= NUM_SYSCALLS || syscall_table[syscall_num] == NULL) {
printk("%d(%s) missing syscall %d\n", current->pid, current->comm, syscall_num);
cpu->eax = syscall_stub();
cpu->eax = _ENOSYS;
} else {
if (syscall_table[syscall_num] == (syscall_t) syscall_stub) {
printk("%d(%s) stub syscall %d\n", current->pid, current->comm, syscall_num);
Expand Down

0 comments on commit 9830c54

Please sign in to comment.