Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1278321 > unrolled thread

As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED]

Started by"Doug Smythies" <dsmythies@telus.net>
First post2015-11-26 17:30 +0100
Last post2015-11-27 17:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED] "Doug Smythies" <dsmythies@telus.net> - 2015-11-26 17:30 +0100
    Re: As of kernel 4.4-rc1 segmentation fault if msr module not  loaded. [REGRESSION][BISECTED] Borislav Petkov <bp@alien8.de> - 2015-11-26 19:10 +0100
      RE: As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED] "Doug Smythies" <dsmythies@telus.net> - 2015-11-27 17:20 +0100

#1278321 — As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED]

From"Doug Smythies" <dsmythies@telus.net>
Date2015-11-26 17:30 +0100
SubjectAs of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED]
Message-ID<qz7AK-7Bz-7@gated-at.bofh.it>
Hi,

This might be considered a minor issue, but I submit my
findings anyhow.

In some distros, the msr module is not loaded by default.
(I guess not built in by default, would be more correct.)
I often forget to load it before using "rdmsr" or "wrmsr".
It was never an issue before, but as of Kernel 4.4-rc1
it causes a segmentation fault crash. Example:

# rdmsr -a 0x19a
Segmentation fault (core dumped)

It could be argued that the msr-tools commands should
check if the module is loaded and abort with some error
message if not (or, and as turbostat now does, just load
the module). However, what I do not know is if there
might be other effected use cases.

The kernel was bisected, and this is the result:

9a2bc335f100a0f6ee6392b9f97ac4188d84db1d is the first bad commit
commit 9a2bc335f100a0f6ee6392b9f97ac4188d84db1d
Author: Borislav Petkov <bp@suse.de>
Date:   Tue Oct 20 11:54:44 2015 +0200

    x86/microcode: Unmodularize the microcode driver

    Make CONFIG_MICROCODE a bool. It was practically a bool already anyway,
    since early loader was forcing it to =y.
    ...

Since I sometimes mess up using git bisect, and end up at some random result,
the above was double checked manually:

9a2bc335f100a0f6ee6392b9f97ac4188d84db1d has the issue
81ffdcdd97d94110627caa81c23d5d780083731d (the previous commit) does not have the issue.

As a potentially interesting side note, the segmentation fault
does not occur if I use sudo instead. Example:

$ sudo rdmsr -a 0x19a
$

Of course, if I load the module then things work as expected:

# modprobe msr
# rdmsr -a 0x19a

0

0

0

0

0

0

0

0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1278376 — Re: As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED]

FromBorislav Petkov <bp@alien8.de>
Date2015-11-26 19:10 +0100
SubjectRe: As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED]
Message-ID<qz99w-gG-11@gated-at.bofh.it>
In reply to#1278321
On Thu, Nov 26, 2015 at 08:25:43AM -0800, Doug Smythies wrote:
> Hi,
> 
> This might be considered a minor issue, but I submit my
> findings anyhow.
> 
> In some distros, the msr module is not loaded by default.
> (I guess not built in by default, would be more correct.)
> I often forget to load it before using "rdmsr" or "wrmsr".
> It was never an issue before, but as of Kernel 4.4-rc1
> it causes a segmentation fault crash. Example:
> 
> # rdmsr -a 0x19a
> Segmentation fault (core dumped)

You can either cherrypick

http://git.kernel.org/tip/2d5be37d686c4dae8e60d20283d6f44ac2c44f65

or wait until it trickles upwards to Linus, most likely -rc3.

Thanks for the report. Good to know what else broke.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278873

From"Doug Smythies" <dsmythies@telus.net>
Date2015-11-27 17:20 +0100
Message-ID<qztUB-5dg-11@gated-at.bofh.it>
In reply to#1278376
On 2015.11.26 10:10 Borislav Petkov wrote:
> On Thu, Nov 26, 2015 at 08:25:43AM -0800, Doug Smythies wrote:
>>
>> In some distros, the msr module is not loaded by default.
>> (I guess not built in by default, would be more correct.)
>> I often forget to load it before using "rdmsr" or "wrmsr".
>> It was never an issue before, but as of Kernel 4.4-rc1
>> it causes a segmentation fault crash. Example:
>> 
>> # rdmsr -a 0x19a
>> Segmentation fault (core dumped)

> You can either cherrypick
> http://git.kernel.org/tip/2d5be37d686c4dae8e60d20283d6f44ac2c44f65

Just for completeness:
I confirm that the above commit fixes the issue raised herein.
Thanks.

... Doug


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web