Patching of scheduler functions

Session information has not yet been published for this event.

*

One Line Summary

Describe one of the livepatch limitations - patching of scheduler functions - and try to come up with a feasible solution.

Abstract

From the livepatch documentation:

“The switch_to macro is inlined into __schedule(). It switches the context between two processes in the middle of the macro. It does not save RIP in x86_64 version (contrary to 32-bit version). Instead, the currently used schedule()/switchto() handles both processes.

Now, let’s have two different tasks. One calls the original __schedule(), its registers are stored in a defined order and it goes to sleep in the switch_to macro and some other task is restored using the original schedule(). Then there is the second task which calls patchedschedule(), it goes to sleep there and the first task is picked by the patched__schedule(). Its RSP is restored and now the registers should be restored as well. But the order is different in the new patched__schedule(), so…"

The ground has been slightly changed recently (thanks to Brian Gerst, Andy Lutomirski and others) but the problem persists. The talk tries to come up with a feasible solution.

Presentation Materials

slides

Speaker

  • Biography

    Miroslav is Linux kernel developer at SUSE, where he is responsible for development and release of kGraft patches, and an upstream co-maintainer of livepatch.