<p>kGraft allows to patch kernel at runtime. It implements a consistency model that allows to modify semantic of functions. e.g. fix lock order. For this, we need to find a safe place when a process/thread might start using the new code.</p>

<p>Userspace tasks are switched on the kernel boundary when syscall is called/returns or when a signal is proceed.</p>

<p>The situation is more complicated with kthreads. They do not leave kernel at any time. They are usually implemented as an infinite loop that processes some data from time to time. Some kthreads are trivial. Some do a lot of work in each cycle. The safe to start using the new code usually is at the end of each cycle.</p>

<p>Each kthread already defines check points for an exit flag, freezing, parking, and even signal handling. But nothing is standardized. We could add yet another check for patching but a better approach might be to enforce some reasonable structure by a new API. It would define functions that are called pre, in each iteration, and post the main cycle. Then the cycle might be implemented a standard way and all the check points maintained on a single location.</p>

<p>Note that we could not reuse the checkpoint for freezer because the safe place for freezer need not be safe for live patching. Freezer expects the same code semantic on the return from the fridge.</p>


Comments

Be the first to comment!

Similar Projects

This project is one of its kind!