linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@zary.sk>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org
Subject: Re: [tip: x86/core] x86/iopl: Fake iopl(3) CLI/STI usage
Date: Tue, 21 Sep 2021 19:31:36 +0200	[thread overview]
Message-ID: <202109211931.37066.linux@zary.sk> (raw)
In-Reply-To: <YUnJe6rijGy6q1Cz@hirez.programming.kicks-ass.net>

On Tuesday 21 September 2021 14:00:59 Peter Zijlstra wrote:
> On Tue, Sep 21, 2021 at 01:09:26PM +0200, Ondrej Zary wrote:
> > On Tuesday 21 September 2021, tip-bot2 for Peter Zijlstra wrote:
> > > The following commit has been merged into the x86/core branch of tip:
> > > 
> > > Commit-ID:     32e1ae626f295152d1fc9a3375214133cbe62878
> > > Gitweb:        https://git.kernel.org/tip/32e1ae626f295152d1fc9a3375214133cbe62878
> > > Author:        Peter Zijlstra <peterz@infradead.org>
> > > AuthorDate:    Fri, 17 Sep 2021 11:20:04 +02:00
> > > Committer:     Peter Zijlstra <peterz@infradead.org>
> > > CommitterDate: Sat, 18 Sep 2021 12:18:32 +02:00
> > > 
> > > x86/iopl: Fake iopl(3) CLI/STI usage
> > > 
> > > Since commit c8137ace5638 ("x86/iopl: Restrict iopl() permission
> > > scope") it's possible to emulate iopl(3) using ioperm(), except for
> > > the CLI/STI usage.
> > > 
> > > Userspace CLI/STI usage is very dubious (read broken), since any
> > > exception taken during that window can lead to rescheduling anyway (or
> > > worse). The IOPL(2) manpage even states that usage of CLI/STI is highly
> > > discouraged and might even crash the system.
> > > 
> > > Of course, that won't stop people and HP has the dubious honour of
> > > being the first vendor to be found using this in their hp-health
> > > package.
> > > 
> > > In order to enable this 'software' to still 'work', have the #GP treat
> > > the CLI/STI instructions as NOPs when iopl(3). Warn the user that
> > > their program is doing dubious things.
> > > 
> > > Fixes: a24ca9976843 ("x86/iopl: Remove legacy IOPL option")
> > > Reported-by: Ondrej Zary <linux@zary.sk>
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> > > Link: https://lkml.kernel.org/r/20210918090641.GD5106@worktop.programming.kicks-ass.net
> > 
> > Could this be backported to 5.10 kernel so it can get into the recently released Debian 11?
> 
> Thomas also asked about a stable tag, so I'll rebase and force-push
> these commits and add:
> 
> Cc: stable@kernel.org # v5.5+
> 
> to it.
> 

Thank you very much for great work.

-- 
Ondrej Zary

  reply	other threads:[~2021-09-21 17:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 12:23 IOPL emulation breaks hpasmd (hp-health) needed by HP DL380 G4 servers Ondrej Zary
2021-09-16 17:09 ` Thomas Gleixner
2021-09-16 20:27   ` Ondrej Zary
2021-09-16 21:05     ` Peter Zijlstra
2021-09-17  8:11       ` Ondrej Zary
2021-09-17  9:20         ` [PATCH] x86/iopl: Fake iopl(3) CLI/STI usage Peter Zijlstra
2021-09-17 10:29           ` Ondrej Zary
2021-09-17 11:54             ` Peter Zijlstra
2021-09-17 12:33               ` Thomas Gleixner
2021-09-17 12:54                 ` Ondrej Zary
2021-09-17 10:40           ` Thomas Gleixner
2021-09-17 22:23           ` Linus Torvalds
2021-09-17 22:24             ` Linus Torvalds
2021-09-18  7:05               ` Peter Zijlstra
2021-09-18  9:06                 ` Peter Zijlstra
2021-09-18 15:53                   ` Ondrej Zary
2021-09-18 16:35                   ` Linus Torvalds
2021-09-21  7:28                   ` [tip: x86/core] " tip-bot2 for Peter Zijlstra
2021-09-21 11:09                     ` Ondrej Zary
2021-09-21 12:00                       ` Peter Zijlstra
2021-09-21 17:31                         ` Ondrej Zary [this message]
2021-09-21 12:41                   ` tip-bot2 for Peter Zijlstra
2021-09-21 21:01                 ` [PATCH] " Andy Lutomirski
2021-09-16 21:25     ` IOPL emulation breaks hpasmd (hp-health) needed by HP DL380 G4 servers Thomas Gleixner

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=202109211931.37066.linux@zary.sk \
    --to=linux@zary.sk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).