public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Thomas Piekarski <t.piekarski@deloquencia.de>
Cc: mtk.manpages@gmail.com, Thomas Gleixner <tglx@linutronix.de>,
	linux-man <linux-man@vger.kernel.org>,
	victorm007@yahoo.com
Subject: Re: [PATCH-v2] iopl.2: Updating description of permissions and disabling interrupts
Date: Mon, 29 Jun 2020 13:49:41 +0200	[thread overview]
Message-ID: <218262ac-089b-c23e-2b7c-e10bf9b64c96@gmail.com> (raw)
In-Reply-To: <47c9d9ae-37da-6eec-1040-d1f9b85dc109@deloquencia.de>

Hello Thomas,

On 6/26/20 10:29 PM, Thomas Piekarski wrote:
> Updating description of permissions for port-mapped I/O set per-thread 
> and not per-process. Mentioning iopl can not disable interrupts since 
> 5.5 anymore and is in general deprecated and only provided for legacy X 
> servers.
> 
> See https://bugzilla.kernel.org/show_bug.cgi?id=205317
> 
> Reported-by: victorm007@yahoo.com
> Signed-off-by: Thomas Piekarski <t.piekarski@deloquencia.de>

Thanks! I've applied this patch.

Cheers,

Michael

> ---
>   man2/iopl.2 | 34 ++++++++++++++--------------------
>   1 file changed, 14 insertions(+), 20 deletions(-)
> 
> diff --git a/man2/iopl.2 b/man2/iopl.2
> index e5b216a14..be9acfd1e 100644
> --- a/man2/iopl.2
> +++ b/man2/iopl.2
> @@ -39,29 +39,17 @@ iopl \- change I/O privilege level
>   .BI "int iopl(int " level );
>   .SH DESCRIPTION
>   .BR iopl ()
> -changes the I/O privilege level of the calling process,
> +changes the I/O privilege level of the calling thread,
>   as specified by the two least significant bits in
>   .IR level .
>   .PP
> -This call is necessary to allow 8514-compatible X servers to run under
> -Linux.
> -Since these X servers require access to all 65536 I/O ports, the
> -.BR ioperm (2)
> -call is not sufficient.
> +The I/O privilege level for a normal thread is 0.
> +Permissions are inherited from parents to children.
>   .PP
> -In addition to granting unrestricted I/O port access, running at a higher
> -I/O privilege level also allows the process to disable interrupts.
> -This will probably crash the system, and is not recommended.
> -.PP
> -Permissions are not inherited by the child process created by
> -.BR fork (2)
> -and are not preserved across
> -.BR execve (2)
> -(but see NOTES).
> -.PP
> -The I/O privilege level for a normal process is 0.
> -.PP
> -This call is mostly for the i386 architecture.
> +This call is deprecated, significantly slower than
> +.BR ioperm(2)
> +and is only provided for older X servers which require
> +access to all 65536 I/O ports. It is mostly for the i386 architecture.
>   On many other architectures it does not exist or will always
>   return an error.
>   .SH RETURN VALUE
> @@ -79,7 +67,7 @@ is greater than 3.
>   This call is unimplemented.
>   .TP
>   .B EPERM
> -The calling process has insufficient privilege to call
> +The calling thread has insufficient privilege to call
>   .BR iopl ();
>   the
>   .B CAP_SYS_RAWIO
> @@ -99,6 +87,12 @@ and in
>   .IR <sys/perm.h> .
>   Avoid the latter, it is available on i386 only.
>   .PP
> +Prior to Linux 5.5
> +.BR iopl ()
> +allowed the thread to disable interrupts while running
> +at a higher I/O privilege level. This will probably crash
> +the system, and is not recommended.
> +.PP
>   Prior to Linux 3.7,
>   on some architectures (such as i386), permissions
>   .I were
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

      reply	other threads:[~2020-06-29 21:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24 13:22 [PATCH] iopl.2: Changing description of permissions set per-process to per-thread Thomas Piekarski
2020-05-25 13:57 ` Michael Kerrisk (man-pages)
2020-05-28 13:22   ` Thomas Gleixner
2020-05-28 14:52     ` Thomas Piekarski
2020-06-24  9:53       ` Michael Kerrisk (man-pages)
2020-06-26 20:29         ` [PATCH-v2] iopl.2: Updating description of permissions and disabling interrupts Thomas Piekarski
2020-06-29 11:49           ` Michael Kerrisk (man-pages) [this message]

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=218262ac-089b-c23e-2b7c-e10bf9b64c96@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=t.piekarski@deloquencia.de \
    --cc=tglx@linutronix.de \
    --cc=victorm007@yahoo.com \
    /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