this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Prevent closing the special LKM fd

Fixes #987

+7
+1
src/kernel/emulation/linux/mach/lkm.h
··· 4 4 void mach_driver_init(const char** applep); 5 5 int lkm_call(int call_nr, void* arg); 6 6 int lkm_call_raw(int call_nr, void* arg); // w/o errno translation 7 + int mach_driver_get_fd(void); 7 8 8 9 #endif 9 10
+6
src/kernel/emulation/linux/unistd/close.c
··· 5 5 #include "../bsdthread/cancelable.h" 6 6 #include "../mach/lkm.h" 7 7 #include <lkm/api.h> 8 + #include "../simple.h" 8 9 9 10 long sys_close(int fd) 10 11 { ··· 15 16 long sys_close_nocancel(int fd) 16 17 { 17 18 int ret; 19 + 20 + if (fd == mach_driver_get_fd()) { 21 + __simple_kprintf("*** Someone tried to close the special LKM fd! ***"); 22 + return 0; 23 + } 18 24 19 25 struct closing_descriptor_args args = { 20 26 .fd = fd,