Linux image contains buggy alternatives code

Bug #83716 reported by Michael
4
Affects Status Importance Assigned to Milestone
linux-source-2.6.15 (Ubuntu)
Fix Released
High
Kyle McMartin
linux-source-2.6.17 (Ubuntu)
Fix Released
High
Kyle McMartin

Bug Description

Binary package hint: linux-image-2.6.17-10-generic

The SMP alternatives code (dmesg: SMP alternatives: switching to ... code) present in this package is known to be buggy, and can potentially crash the kernel if an interrupt occurs during the alternatives patching. This does actually occur particularly often when the kernel is running on a virtual machine. This bug has been fixed in the mainline kernel (I believe somewhere around 2.6.18.3). Perhaps you could backport the fix?

Revision history for this message
Michael (michaeljt) wrote :
Revision history for this message
Cristian Aravena Romero (caravena) wrote :

Thanks for taking the time to report this bug. Unfortunately we can't fix it, because your description didn't include enough information.

Please include the following additional information, if you have not already done so (please pay attention to lspci's additional options), as required by the Ubuntu Kernel Team:

0. Pliss update you BIOS.
1. Please include the output of the command "uname -a" in your next response. It should be one, long line of text which includes the exact kernel version you're running, as well as the CPU architecture.
2. Please run the command "dmesg > dmesg.log" and attach the resulting file "dmesg.log" to this bug report.
3. Please run the command "lspci -vvnn > lspci-vvnn.log" and attach the resulting file "lspci-vvnn.log" to this bug report.
4. Please run the command "sudo dmidecode > dmidecode.log" and attach the resulting file "dmidecode.log" to this bug report.

For your reference, the full description of procedures for kernel-related bug reports is available here: <http://wiki.ubuntu.com/DebuggingKernelProblems> Thanks!

Revision history for this message
Cristian Aravena Romero (caravena) wrote :

Change status of Unconfirmed to Needs Info.

Changed in linux-source-2.6.17:
status: Unconfirmed → Needs Info
Revision history for this message
Michael (michaeljt) wrote :

I will post the information that you requested later. I am surprised, though that the information I provided was not sufficient. The link which I provided (http://lkml.org/lkml/2006/10/16/299) contains both the LKML discussion of the bug and the patch required to fix it. I have checked the Edgy kernel sources, and the patch clearly applies to them (there are no Ubuntu-specific changes to the affected function against vanilla 2.6.18, from whence the function was backported).

Revision history for this message
Michael (michaeljt) wrote :

Included below is the information you requested. uname -a says:

Linux test-desktop 2.6.17-10-generic #2 SMP Tue Dec 5 22:28:26 UTC 2006 i686 GNU/Linux

Note that:

1) The bug can be worked around by specifying the "noreplacement" kernel option
2) The bug has also been backported to the Dapper SMP kernel, but without the workaround
3) As I said, this is the patch to arch/i386/kernel/alternative.c which fixes the problem:

 void __init alternative_instructions(void)
 {
+ unsigned long flags;
  if (no_replacement) {
   printk(KERN_INFO "(SMP-)alternatives turned off\n");
   free_init_pages("SMP alternatives",
@@ -396,6 +397,8 @@ void __init alternative_instructions(voi
     (unsigned long)__smp_alt_end);
   return;
  }
+
+ local_irq_save(flags);
  apply_alternatives(__alt_instructions, __alt_instructions_end);

  /* switch to patch-once-at-boottime-only mode and free the
@@ -433,4 +436,5 @@ void __init alternative_instructions(voi
  alternatives_smp_switch(0);
 }
#endif
-}
+ local_irq_restore(flags);
+}

Revision history for this message
Michael (michaeljt) wrote :
Revision history for this message
Michael (michaeljt) wrote :
Revision history for this message
Michael (michaeljt) wrote :

Sorry, above patch was just cut and pasted and does not quite match the current Edgy kernel. The attached diff was against the Edgy kernel.

Revision history for this message
Kyle McMartin (kyle) wrote :

The information you posted was sufficient, Cristian is just using a cut & paste solution and not reading your report at all. Please ignore him, he doesn't know what he's doing.

Revision history for this message
Kyle McMartin (kyle) wrote :

Will fix this in the next security upload.

Changed in linux-source-2.6.17:
assignee: nobody → kyle
importance: Undecided → High
status: Needs Info → Confirmed
Changed in linux-source-2.6.15:
assignee: nobody → kyle
importance: Undecided → High
status: Unconfirmed → Confirmed
Kyle McMartin (kyle)
Changed in linux-source-2.6.15:
status: Confirmed → Fix Committed
Changed in linux-source-2.6.17:
status: Confirmed → Fix Committed
Revision history for this message
Michael (michaeljt) wrote :

Will this also get fixed on the installer CDs? It affects quite a few people installing to virtual machines.

Revision history for this message
Matt Zimmerman (mdz) wrote :

New CD images will be available next week with the release of 7.04, and will include this fix

Revision history for this message
Michael (michaeljt) wrote :

Will that include a new Dapper server image? I can see that the Edgy CD images will be less relevant after Feisty is released.

Changed in linux-source-2.6.17:
status: Fix Committed → Fix Released
Changed in linux-source-2.6.15:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.