Enlarge /. Penguins are not all equally trustworthy.
In a message posted to the Linux kernel mailing list yesterday, founding developer Linus Torvalds warned the world not to use the 5.12 rc1 kernel in its public Git tree.
Hey look – some of you may have noticed that in my public git tree the "v5.12-rc1" tag was magically renamed to "v5.12-rc1-dontuse". It's still the same object, it still says "v5.12-rc1" internally and it's still signed by me, but the user-visible name of the tag has changed.
It turns out Linus Torvalds means business when he's not using code – the problem with this 5.12 release candidate interrupted swapfile handling in a very uncomfortable way. In particular, the updated code would lose the correct offset pointing to the beginning of the paging file. Again, in Torvald's own words, "the swap still happened, but it happened to the wrong part of the filesystem, with the obvious disastrous end results."
If your imagination is insufficient, it means that when the kernel swaps the contents of memory to disk, the data ends up on random pieces of the same disk and partitioned the swap file … not as files, mind you, but as junk directly spat on raw sectors on the hard drive. This means that not only data in existing files will be overwritten, but also large chunks of metadata, the damage of which would likely render the entire file system unmountable and unusable.
Torvalds points out that if you didn't use swap at all, this problem wouldn't bite you. And if you use swap partitions instead of swap files, you are not affected either. Unfortunately, he then reminds us that while he knows a lot about the kernel, he is not necessarily familiar with all of the installations that a normal end-user deals with:
And as far as I know, all normal distros set up things with swap partitions, not files, since swap files tend to be slower, frankly, and have various other complexity issues.
Many distributions swap partitions instead of files by default. But Ubuntu – perhaps the most widely used Linux distribution in the world – has been installing swap files by default for more than four years. If you are an Ubuntu user (or a user of an Ubuntu-derived distribution like Mint) you likely have a swap file, and this error would likely toss your entire root filesystem in the trash.
However, Torvalds' warning plays a role beyond what individual users could do with a Release Candidate kernel. It is even more important that kernel developers do not base their own work on this version and potentially carry one very nasty bug down the line.
I want to make sure no one starts new topic branches with this 12/5 rc1 day. I know some developers have a tendency to say, "Ok, rc1 is out, I've put all of my development work into this merge window. I'm going to fast-forward to rc1 now and use that as the basis for the next version." Don't do it this time. It may work perfectly for you given the usual partition setup, but it can be a terrible base for anyone else who could cut themselves in half into that range.
This also leads to one of my pretty frequent warnings to other Linux users: don't blindly jump into cowboy code that hasn't been adequately tested. Linux kernel release candidates are usually very, very solid, and it's tempting to dive into new features as early as possible – but doing so can have very, very ugly consequences. Many of these consequences could have been avoided by waiting for the code to go into production in the first place.