Live patching for Linux 3.20
lkml.iu.edu
lkml.iu.edu
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux....
We might finally get live updates on distros. (No thanks to Oracle, of course.)
Wonder if we can also do it that well in userspace? (How does systemd behave with patching, actually?)
After this was all done the team got acquihired by Oracle. I was actually amazed that the team was allowed to keep the service up for some non-Oracle distro's.
But very happy to see a broader adoption of this kind of technology, it is essential for all these unmanned systems out there in the cloud that they can be patched whilst running.
I'm not clear what they actually cover, and can't look them up right now, but I'd thought they were specific on how KSplice in particular operates, both applying hotpatches and analysing the source to create them. I don't know whether they'd apply to anything else, or whether there is prior art, but they're an obvious landmine to be aware of and to avoid. So a simple fork wouldn't do unless it'd change the way it actually worked. A fresh approach was needed, and we seem to have two fresh approaches here.
I'm trusting they've been avoided here. They probably have, as this is much more general? The concept of hot patches are of course fine, people have been doing that for decades, and you can't patent concepts.
The lesson here: please don't patent stuff jn your open-source software, in case you wake up one day and got acquihired by Evil™.
Or use a a license with a patent grant, like Apache 2.0 or GPL 3.
Of course the time they were granted (to Oracle, after Ksplice were bought) the applications became nigh-impenetrable patentese that really need a US-qualified patent attorney to interpret, so I'm absolutely not going to try and I'm just going to post what I found here.
Application: https://www.google.co.uk/patents/US20100269105 became patent https://www.google.co.uk/patents/US8612951 (B2) "Method of determining which computer program functions are changed by an arbitrary source code modification". (They've also cited a patent for a… coffeepot. OK, I'm pretty sure that bit's a typo. <g>)
Application: https://www.google.co.uk/patents/US20100083224 seems to have become patent https://www.google.co.uk/patents/US8261247 (B2) "Method of modifying code of a running computer program based on symbol values discovered from comparison of running code to corresponding object code".
Application: https://www.google.co.uk/patents/US20100269106 does not seem to have been granted directly, but then there's patent https://www.google.co.uk/patents/US8607208 "System and methods for object code hot updates" which I think is a continuation-in-part of it and oh I've gone cross-eyed, get a professional.
(Note: from May 2014)
From https://lkml.org , "In case you haven't read the titlebar of your web browser's window: this site is the (unofficial) Linux Kernel Mailing List archive."
Maybe they forgot to keep the "unofficial" in the title?
Does anyone know if any other OSs have live kernel patching?
It is kind of a niche feature, really.
Not sure I'd call it niche, but yes, somewhat specialized.
[1] https://technet.microsoft.com/en-us/library/cc781109%28v=ws....
I don't think it can do arbitrary changes, it "only" applies specially prepared changes to the running system by replacing function call targets while tasks are sleeping. The biggest limitation to changes probably is that old and new code runs in parallel, so you can only do changes to data structures that won't confuse the old code. "Simplest" use case might be adding guards against exploits to syscalls.
I can't tell how viable it would be for the new code to build an entire parallel structure and to only switch to this after everything is migrated, or how deep into the kernel these changes could go. Could one fix a file system driver while using the file system?
It looks like, however, because kernel modules seem to be in elf format (Don't quote me on that, just going from the code), elf format includes a 'relocation table', which is basically a table that says "this function is located here, and this next function is located here, and ..." for every function in the module. Ignoring why that is actually there, they can take advantage of the relocation table and replace a functions location with the location of the replacement function, effectively overwriting the old one. Even if it's still in memory (I can't tell if it gets removed or not) the code will never be called again.
From there, the discussion mostly seems to be around how to 'stop' the kernel enough to be able to replace the function without resulting in a mess because something was trying to use that function at the same time that you replaced it.