Re: [PATCH] x86/msr: Filter msr write by X86_IOC_WRMSR_REGS ioctl

From: Borislav Petkov
Date: Wed Jan 27 2021 - 09:32:53 EST


On Wed, Jan 27, 2021 at 09:24:56PM +0900, Misono Tomohiro wrote:
> commit a7e1f67ed29f ("x86/msr: Filter MSR writes") introduces a
> module parameter to disable writing to msr device file (and add_taint()
> upon writing). As msr register can be written by X86_IOC_WRMSR_REGS
> ioctl too, they should be applied to the ioctl as well.

Blergh, I missed that. :-\

> Fixes: a7e1f67ed29f ("x86/msr: Filter MSR writes")
> Signed-off-by: Misono Tomohiro <misono.tomohiro@xxxxxxxxxxxxxx>
> ---
> Hello,
>
> I just noticed this when I read the code.
> I'm not sure if anyone uses ioctl interface now, but I tested this
> by resetting IA32_MPERF by X86_IOC_WRMSR_REGS ioctl.

Yeah, I'm sure once this hits people's kernels, someone will complain.

In any case, good catch, thanks!

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette