public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	H Peter Anvin <hpa@zytor.com>, Fenghua Yu <fenghua.yu@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: BUG: early intel microcode update violating alignment rules
Date: Mon, 11 Aug 2014 14:52:39 -0400	[thread overview]
Message-ID: <53E910F7.1040806@tmr.com> (raw)
In-Reply-To: <20140811140057.GA21693@pd.tnic>

Borislav Petkov wrote:
> On Mon, Aug 11, 2014 at 10:16:13AM -0300, Henrique de Moraes Holschuh wrote:
>> On Mon, 11 Aug 2014, Borislav Petkov wrote:
>>> On Sat, Aug 09, 2014 at 08:19:11PM -0300, Henrique de Moraes Holschuh wrote:
>>>> Is there a way to fix this in the kernel for the BSP?
>>>
>>> I think you're looking at this the wrong way around. :-) The thing that
>>> needs fixing is the SDM since some CPUs seem to accept 16-byte unaligned
>>> microcode just fine.
>>
>> I often wonder how much of the Intel SDM is really a fairy tale...  it
>> certainly has enough legends from times long past inside ;-)  But just like
>> old stories, should you forget all about them, they sometimes grow fangs
>> back and get you when you're least prepared.
>>
>> Now, seriously, we're neither aligning the thing, nor checking any of it for
>> alignment, so userspace can mess with us at will.  Unless it is trying to be
>> actively malicious, we'll get 4-byte alignment out of userspace for the data
>> inside the early initramfs (assuming the use of the common cpio tools: GNU
>> cpio and GNU pax), but that's it.
>>
>> I can easily propose fixes to reject incorrectly aligned data (and will do
>> so), but you *really* don't want to know the kind of crap I came up with to
>> try to align the microcode update for the BSP: Standard Lovecraftian Mythos
>> Safety Procedures apply!  So I am turning to you for ideas...
>
> It seems to me you're looking for issues where there are none. We simply
> have to ask Intel people what's with the 16-byte alignment and fix
> the SDM, apparently. If the processor accepts the non-16-byte-aligned
> update, why do you care?
>
Because if the requirement is enforced in some future revision, and updates then 
fail in some insane way, the vendor is justified in claiming "I told you so."

Don't suppose you have anything in memory right after the microcode which you 
could put on the stack (15 bytes) slide the image up into alignment, load it, 
and put everything back. Haven't looked at the code or data, just tossing out an 
idea I used for something else back when.

-- 
Bill Davidsen <davidsen@tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

  parent reply	other threads:[~2014-08-11 18:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-09 23:19 BUG: early intel microcode update violating alignment rules Henrique de Moraes Holschuh
2014-08-11 10:22 ` Borislav Petkov
2014-08-11 13:16   ` Henrique de Moraes Holschuh
2014-08-11 14:00     ` Borislav Petkov
2014-08-11 14:50       ` H. Peter Anvin
2014-08-11 18:52       ` Bill Davidsen [this message]
2014-08-11 19:15         ` Borislav Petkov
2014-08-14 13:12         ` Henrique de Moraes Holschuh
2014-08-11 14:51 ` H. Peter Anvin
2014-08-11 18:18   ` Henrique de Moraes Holschuh
2014-08-11 18:48     ` H. Peter Anvin
2014-08-31 19:45 ` early microcode: how to disable at runtime? Henrique de Moraes Holschuh
2014-08-31 19:48   ` H. Peter Anvin
2014-08-31 20:11     ` Henrique de Moraes Holschuh
2014-09-01  5:13       ` Borislav Petkov
2014-09-01 10:19         ` Henrique de Moraes Holschuh
2014-09-01 16:35         ` H. Peter Anvin
2014-09-01 17:43           ` Henrique de Moraes Holschuh
2014-09-01 18:48             ` H. Peter Anvin
2014-09-01 19:59               ` Henrique de Moraes Holschuh
2014-09-02  6:33                 ` Borislav Petkov
2014-09-02 13:16                   ` Henrique de Moraes Holschuh
2014-09-03  6:40                     ` Borislav Petkov
2014-09-03 12:43                       ` Henrique de Moraes Holschuh
2014-09-04 15:42                         ` Borislav Petkov
2014-09-04 17:45                           ` Henrique de Moraes Holschuh
2014-09-05  8:50                             ` Borislav Petkov
2014-09-05 14:23                               ` Henrique de Moraes Holschuh
2014-09-04 18:37                           ` Yu, Fenghua
2014-09-05  8:52                             ` Borislav Petkov

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=53E910F7.1040806@tmr.com \
    --to=davidsen@tmr.com \
    --cc=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=hmh@hmh.eng.br \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /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