mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	jj@chaosbits.net, tigran@aivazian.fsnet.co.uk,
	tglx@linutronix.de, shaohua.li@intel.com, mingo@elte.hu
Subject: Re: [tip:x86/urgent] x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree()
Date: Tue, 28 Dec 2010 00:28:20 -0200	[thread overview]
Message-ID: <20101228022820.GA24251@khazad-dum.debian.net> (raw)
In-Reply-To: <tip-5cdd2de0a76d0ac47f107c8a7b32d75d25768dc1@git.kernel.org>

On Mon, 27 Dec 2010, tip-bot for Jesper Juhl wrote:
> In arch/x86/kernel/microcode_intel.c::generic_load_microcode()
> we have  this:
> 
> 	while (leftover) {
> 		...
> 		if (get_ucode_data(mc, ucode_ptr, mc_size) ||
> 		    microcode_sanity_check(mc) < 0) {
> 			vfree(mc);
> 			break;
> 		}
> 		...
> 	}
> 
> 	if (mc)
> 		vfree(mc);

Which is trivial to trigger from userspace, fortunately limited to root in
any sane distro (and by default).

Please send it to -stable after it gets merged in mainline and is deemed
safe...

The Intel microcode driver will also accept a bogus microcode which has a
valid header, but all zeros for the cyphertext.  This is a design defect on
the current Intel microcode format, but can be worked around by the driver
if one assumes such a cyphertext will never be valid (seems like a safe
assumption).  I sure hope the processors will reject that kind of bogosity
even if the kernel doesn't and tries to upload it, though...  I was not
crazy enough to try.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

      reply	other threads:[~2010-12-28  2:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-25 18:57 [PATCH] Intel CPU Microcode Update Driver: " Jesper Juhl
     [not found] ` <AANLkTimPTSwpyj-uNJ9TpDwGjWaodAupr_7VA_Oe1=m4@mail.gmail.com>
2010-12-27 13:30   ` Ingo Molnar
2010-12-27 14:16 ` [tip:x86/urgent] x86/microcode: " tip-bot for Jesper Juhl
2010-12-28  2:28   ` Henrique de Moraes Holschuh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101228022820.GA24251@khazad-dum.debian.net \
    --to=hmh@hmh.eng.br \
    --cc=hpa@zytor.com \
    --cc=jj@chaosbits.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=shaohua.li@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tigran@aivazian.fsnet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome