Kcalc Self Deadlock
Context kcalc is a calculator running directly in kernelspace. Achieved by loading as a Linux kernel module, and by exposing a character device /dev/kcalc_chardev to the userspace, supporting read, write operations. A process write the expression they want to evaluate to /dev/kcalc_chardev. That process then read from /dev/kcalc_chardev. The character device is locked whenever a process is writing to/reading from it via mutex_lock();. The kernel is tested using pytest, calls tee and cat for write and read operations respectively What Happened When running the pytest suite, the process hangs indefinitely, no cases is passed or failed. It is also unkillable. Opening btop reveals that the cat process is there hanging, and causing the pytest which calls cat as a subprocess hangs. The cat process is unkillable even with SIGKILL. ...