Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-12 Thread Borislav Petkov
On Sun, Apr 11, 2021 at 04:21:21PM -0700, Andy Lutomirski wrote: > https://bugs.winehq.org/show_bug.cgi?id=33275#c19 > > I sure hope no one is still doing this. Aha, IRET with rFLAGS.NT set. At least it is only an ad-hoc program to fix this particular issue and I hope too it hasn't propagated

Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-11 Thread Andy Lutomirski
On Sun, Apr 11, 2021 at 10:04 AM Borislav Petkov wrote: > > On Sun, Apr 11, 2021 at 09:57:20AM -0700, Andy Lutomirski wrote: > > Working around a kernel bug. The workaround only worked on AMD > > systems. The correct solution was to fix the kernel bug, not poke > > MSRs. > > Do you remember which

Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-11 Thread Borislav Petkov
On Sun, Apr 11, 2021 at 09:57:20AM -0700, Andy Lutomirski wrote: > Working around a kernel bug. The workaround only worked on AMD > systems. The correct solution was to fix the kernel bug, not poke > MSRs. Do you remember which program(s) and where I can get them to have a look? --

Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-11 Thread Andy Lutomirski
> On Apr 11, 2021, at 9:43 AM, Andi Kleen wrote: > >  >> >> I have actually seen real user programs poke MSR_SYSCALL_MASK. > > Hmm, what was the use case? > > Working around a kernel bug. The workaround only worked on AMD systems. The correct solution was to fix the kernel bug, not

Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-11 Thread Andi Kleen
> I have actually seen real user programs poke MSR_SYSCALL_MASK. Hmm, what was the use case? -Andi

Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-11 Thread Andy Lutomirski
On Sat, Apr 10, 2021 at 11:52 AM Andi Kleen wrote: > > Borislav Petkov writes: > > > From: Borislav Petkov > > Date: Sat, 10 Apr 2021 14:08:13 +0200 > > > > There are a bunch of MSRs which luserspace has no business poking at, > > whatsoever. Add a ban list and put the TSC-related MSRs in

Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-11 Thread Borislav Petkov
On Sat, Apr 10, 2021 at 11:52:17AM -0700, Andi Kleen wrote: > Have you ever seen any user programs actually write those MSRs? > I don't see why they ever would, it's not that they have any motivation > to do it (unlike SMM), and I don't know of any examples. You'd be surprised how much motivation

Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-10 Thread Andi Kleen
Borislav Petkov writes: > From: Borislav Petkov > Date: Sat, 10 Apr 2021 14:08:13 +0200 > > There are a bunch of MSRs which luserspace has no business poking at, > whatsoever. Add a ban list and put the TSC-related MSRs in there. Issue > a big juicy splat to catch offenders. Have you ever seen

Re: [PATCH] x86/msr: Block writes to certain MSRs unconditionally

2021-04-10 Thread Andy Lutomirski
> On Apr 10, 2021, at 5:11 AM, Borislav Petkov wrote: > > From: Borislav Petkov > Date: Sat, 10 Apr 2021 14:08:13 +0200 > > There are a bunch of MSRs which luserspace has no business poking at, > whatsoever. Add a ban list and put the TSC-related MSRs in there. Issue > a big juicy splat to