Linus Torvalds warns: Watch out for this unusually nasty bug in Linux 5.12 rc1

Linux kernel creator warns the latest kernel is "double ungood".

Linus Torvalds has issued a warning to open-source developers to avoid the first release candidate (RC) of the Linux kernel 5.12. 

Linux kernel 5.12 was released on time despite the snow storms that lashed Oregon and knocked out power to Torvalds' home for the better part of a week. Torvalds and his thousands of contributors managed to get version 5.12 out on time, but he now says RC 5.12 is a "double ungood" that can have catastrophic consequences for a computer's filesystem. 

"This merge window, we had a very innocuous code cleanup and simplification that raised no red flags at all, but had a subtle and very nasty bug in it: swap files stopped working right. And they stopped working in a particularly bad way: the offset of the start of the swap file was lost. Swapping still happened, but it happened to the wrong part of the filesystem, with the obvious catastrophic end results," wrote Torvalds on the Linux kernel Mailing list.  

SEE: Hiring Kit: Computer Hardware Engineer (TechRepublic Premium)

Torvalds went on: "Yes, this is very unfortunate, but it really wasn't a very obvious bug, and it didn't even show up in normal testing, exactly because swapfiles just aren't normal. So I'm not blaming the developers in question, and it also wasn't due to the odd timing of the merge window, it was just simply an unusually nasty bug that did get caught and is fixed in the current tree."

He said he wanted devs to be aware because if the bug strikes: "you can end up with a filesystem that is essentially overwritten by random swap data. This is what we in the industry call 'double ungood'," he writes, nodding to George Orwell's newspeak language from the novel Nineteen Eighty-Four. 

It is, he cautions, an unusually bad bug – even for a first run of a release candidate that's expected to have bugs. 

"Yes, rc1 tends to be buggier than later rc's, we are all used to that, but honestly, most of the time the bugs are much smaller annoyances than this time," warns Torvalds. 

He also had some advice about the assumptions people make in industry when a system proves reliably stable over time, which can impact the safety of systems in the future. 

In this case, the bug regards swap partitions but he's also concerned that developers will assume because he's remedied the bug in code for distribution – via the Git versioning system – that code that's already been installed has been remedied too. He's worried about downstream projects, which could accidentally leave this bug in a project.     

"One additional reason for this note is that I want to not just warn people to not run this if you have a swapfile – even if you are personally not impacted (like I am, and probably most people are – swap partitions all around) – I want to make sure that nobody starts new topic branches using that 5.12-rc1 tag," wrote Torvalds.  

"I know a few developers tend to go "Ok, rc1 is out, I got all my development work into this merge window, I will now fast-forward to rc1 and use that as a base for the next release". Don't do it this time. It may work perfectly well for you because you have the common partition setup, but it can end up being a horrible base for anybody else that might end up bisecting into that area."

SEE: Developer: Rust programming language is being used for bigger projects

Otherwise Linux 5.12 is basically a spring-cleaning effort from Torvalds who's handled 10,982 non-merge commits from 1,500 people who contributed to this RC of the kernel. 

"Sorry for this mess," wrote Torvalds.