update-intel-microcode does not find latest available microcode update

Bug #569488 reported by Moritz Naumann
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
microcode.ctl (Debian)
Fix Released
Unknown
microcode.ctl (Ubuntu)
Fix Released
Undecided
Unassigned
Declined for Karmic by Fabrice Coutadeur
Declined for Lucid by Fabrice Coutadeur

Bug Description

Binary package hint: microcode.ctl

When I run update-intel-microcode on this Ubuntu Karmic x86_64 system I get to see this:

$ sudo update-intel-microcode
Local version: 20090927
Remote version:
No need to download a new microcode
$

Apparently no 'remote' (supposedly this means 'hosted on *.intel.com') microsode update is detected at all.

However, a newer suitable microcode update is available:
http://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=18683

The documentation (README.Debian) coming with the package also points to an older microcode update available from this website:
http://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=14303

However, update-intel-microcode does not seem to detect this either.

This is probably because the RSS feed this script uses is not suitable / does not (or no longer) report the availability of this microcode update. I am unable to find another suitable RSS feed to provide such information. Some of the RSS feeds Intels' downloadcenter provides are listed at http://www.intel.com/intel/rss.htm?iid=ftr+rss but none of them seems suitable.

The search result at http://downloadcenter.intel.com/downloadcenter/Product_Search.aspx?Prod_nm=linux%20microcode does provide a list of available microcode updates, but results are listed per CPU family, and the output format the search generates is HTML, not RSS.

I assume that unless Intel can provide some help here microcode update availability must be manually tracked and update-intel-microcode is of no use at this time.

ProblemType: Bug
Architecture: amd64
Date: Sat Apr 24 18:43:06 2010
DistroRelease: Ubuntu 9.10
Package: microcode.ctl 1.17-11
ProcEnviron:
 LANGUAGE=de_DE.UTF-8
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-20.58-generic
SourcePackage: microcode.ctl
Uname: Linux 2.6.31-20-generic x86_64

Revision history for this message
Moritz Naumann (mnaumann) wrote :
Revision history for this message
Moritz Naumann (mnaumann) wrote :
Revision history for this message
Moritz Naumann (mnaumann) wrote :

This very dirty bash snippet works (currently):

#!/bin/sh
JSON=$(wget -qO- 'http://downloadcenter.intel.com/JSONDataProvider.aspx?sort=Date&sortDir=descending&Hits=1&keyword="Linux microcode "&lang=eng&refresh=filters&dataType=json')
VERSION=$(echo $JSON | sed 's/^.*,"version":"\([^"]*\).*$/\1/')
DOWNLOADID=$(echo $JSON |sed 's/^.*,"downloadid":"\([^"]*\).*$/\1/')
wget "http://downloadmirror.intel.com/${DOWNLOADID}/eng/microcode-${VERSION}.tgz"

It's obviously incorrect to run sed on serialized data, though. And this example will fail on marginal changes.

Better ways of parsing JSON (such as using python) are discussed at
http://stackoverflow.com/questions/1955505/parsing-json-with-sed-and-awk

Revision history for this message
Daniel J Blueman (danielblueman) wrote :
Changed in microcode.ctl (Ubuntu):
assignee: nobody → Daniel J Blueman (daniel-blueman)
status: New → Fix Committed
Changed in microcode.ctl (Ubuntu):
status: Fix Committed → Confirmed
Changed in microcode.ctl (Debian):
status: Unknown → New
Changed in microcode.ctl (Ubuntu):
assignee: Daniel J Blueman (daniel-blueman) → Stefano Rivera (stefanor)
status: Confirmed → In Progress
Revision history for this message
Stefano Rivera (stefanor) wrote :

I can't say I'm mad about eval()ing data from a web site, as root.
Also, rename won't work across mounts, why not just use the Python tarfile module?
Lintian threw a remote_fs error on build.

How's this patch?

Changed in microcode.ctl (Ubuntu):
assignee: Stefano Rivera (stefanor) → Daniel J Blueman (daniel-blueman)
status: In Progress → Incomplete
Revision history for this message
Stefano Rivera (stefanor) wrote :
tags: added: patch
Revision history for this message
Daniel J Blueman (danielblueman) wrote :

Hi Stefano - your changes are indeed good and resolve the potential security problem of using eval, which I don't like either.

Thanks for the help! Daniel

Revision history for this message
Stefano Rivera (stefanor) wrote :

Uploaded. Seems like a reasonable candidate for an SRU (if we care about multiverse that much)

Changed in microcode.ctl (Ubuntu):
assignee: Daniel J Blueman (daniel-blueman) → nobody
status: Incomplete → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package microcode.ctl - 1.17-13ubuntu1

---------------
microcode.ctl (1.17-13ubuntu1) maverick; urgency=low

  [ Daniel J Blueman ]
  * Rewrote update-intel-microcode script to robustly parse and
    download updated microcode correctly (LP: #569488)

  [ Stefano Rivera ]
  * update-intel-microcode: Do not eval() code from the Internet, and use
    Python's built in tarfile library rather than a temporary directory.
  * debian/microcode.ctl.init: Depend on $remote_fs.
 -- Daniel J Blueman <email address hidden> Wed, 12 May 2010 14:10:06 +0100

Changed in microcode.ctl (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Moritz Naumann (mnaumann) wrote :

Since this package is currently broken in Lucid (10.04), which is a https://wiki.ubuntu.com/LTS release, and since this update also fixes a possible security issue (as Stefano pointed out in his 'Do not eval() code from the Internet' changelog statement), I would assume this qualifies for https://wiki.ubuntu.com/StableReleaseUpdates and would appreciate one taking place.

Revision history for this message
Moritz Naumann (mnaumann) wrote :

Actually the 'Do not eval() code from the Internet' changelog statement refers to a previous version of this patch, not to the version currently in Lucid, sorry.

Revision history for this message
Giacomo Catenazzi (cate) wrote : Re: [Bug 569488] Re: update-intel-microcode does not find latest available microcode update

On 11.08.2010 09:27, Moritz Naumann wrote:
> Since this package is currently broken in Lucid (10.04), which is a
> https://wiki.ubuntu.com/LTS release, and since this update also fixes a
> possible security issue (as Stefano pointed out in his 'Do not eval()
> code from the Internet' changelog statement), I would assume this
> qualifies for https://wiki.ubuntu.com/StableReleaseUpdates and would
> appreciate one taking place.

I've heard about 'Do not eval() code from the Internet'", but there are
not such eval and unsecure things.
The shell code was designed to be safe, and I've not yet seen problems.
It do the same things as the python code, probably using the same code
(C library to do the core things), with the same security.

BTW I plan to push the ubuntu python code also in Debian package, and
asking for a unblock (python code is somewhat more manageable
than shell, considering that Intel cannot really have a stable
method to release new firmware).

PS: and done correctly, e.g. the ubuntu patch lacked of python
dependency.

ciao
 cate

Revision history for this message
Stefano Rivera (stefanor) wrote :

> I've heard about 'Do not eval() code from the Internet'", but there are
> not such eval and unsecure things.

Those were modifications I made to the first python version of this script, which used eval instead of a json parser. See the patch above.

Changed in microcode.ctl (Debian):
status: New → 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.