[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <957d6884-f24b-0d40-7584-d4386d05af21@maciej.szmigiero.name>
Date: Tue, 12 Jun 2018 23:08:31 +0200
From: "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>
To: Borislav Petkov <bp@...en8.de>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 8/8] x86/microcode/AMD: Don't scan past the CPU
equivalence table data
On 05.06.2018 10:55, Borislav Petkov wrote:
> On Sun, May 20, 2018 at 12:07:22AM +0200, Maciej S. Szmigiero wrote:
>> Currently, the code scanning a CPU equivalence table read from a microcode
>> container file assumes that it actually contains a terminating zero entry,
>> but if does not then the code will continue the scan past its valid data.
>>
>> For the late loader this can be improved by always appending a terminating
>> zero entry to such table when loading it.
>> This way we don't need an extra global variable for holding the table size
>> and we don't have to reject such incomplete tables (for backward
>> compatibility with the existing code which didn't do so).
>>
>> For the early loader, since we can't allocate memory and have to work
>> in-place, let's pass an explicit size of this table to its scanning
>> functions so they will know when to stop.
>
> I don't like the difference between early and late here. Just pass
> explicit size to the late loader too.
That was the solution before this patch series version (6) - there was
a variable holding the CPU equivalence table size for the late loader,
but you didn't like it:> Instead of adding yet another global var which needs handling too,
> and touching so many places, just do all checks and preparations in
> install_equiv_cpu_table() so that the rest of the code can get what it
> expects: terminating zero entry and proper size.
And we would need to hold this explicit size somewhere since the
table scanning function in the late loader is on a different call
path than microcode file parsing.
Maciej
Powered by blists - more mailing lists