All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Doug Smythies" <dsmythies@telus.net>
To: "'Borislav Petkov'" <bp@alien8.de>
Cc: "Doug Smythies" <dsmythies@telus.net>,
	"'Borislav Petkov'" <bp@suse.de>, <linux-kernel@vger.kernel.org>
Subject: As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED]
Date: Thu, 26 Nov 2015 08:25:43 -0800	[thread overview]
Message-ID: <000301d12867$19ba3030$4d2e9090$@net> (raw)

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



             reply	other threads:[~2015-11-26 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 16:25 Doug Smythies [this message]
2015-11-26 18:09 ` As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED] Borislav Petkov
2015-11-27 16:12   ` Doug Smythies

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='000301d12867$19ba3030$4d2e9090$@net' \
    --to=dsmythies@telus.net \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.