From: bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r@public.gmane.org
To: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [Bug 99911] ioperm is kept on fork
Date: Tue, 16 Jun 2015 09:56:23 +0000 [thread overview]
Message-ID: <bug-99911-11311-2QiIscMXiF@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-99911-11311-3bo0kxnWaOQUvHkbgXJLS5sdmw4N0Rt+2LY78lusg7I@public.gmane.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=99911
Michael Kerrisk <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
--- Comment #1 from Michael Kerrisk <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> ---
(In reply to Alex Henrie from comment #0)
> Created attachment 179851 [details]
> fork-and-beep test program
>
> `man ioperm` currently states "Permissions are not inherited by the child
> created by fork(2); following a fork(2) the child must turn on those
> permissions that it needs." This is not true. I do not know if it was true
> at some point in the past, but ioperm is preserved across a fork at least as
> far back as Linux 2.6.26.
>
> A test program to demonstrate this behavior is attached.
So, there's two possibilities here. Either the man page has always been wrong,
or once it was right, and then in the distant past things changed. I suspect
that the latter is more likely, but I could be wrong. If the latter is the
case, then even if we can't easily work out when the change occurred, it would
probably be nice to have a note in the page saying that once upon a time the
behavior was different.
With that in mind, could I ask you a favor. Could you take a quick look at the
Linux 1.0 sources (https://www.kernel.org/pub/linux/kernel/v1.0/ ). If I am
reading them correctly, then indeed back then the man page text was true. I am
looking at sys_ioperm() in kernel/ioport.c:
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
{
...
set_bitmap((unsigned long *)current->tss.io_bitmap, from, num,
!turn_on);
return 0;
}
and sys_fork() in kernel/fork.c:
asmlinkage int sys_fork(struct pt_regs regs)
{
...
p->tss.bitmap = offsetof(struct tss_struct,io_bitmap);
for (i = 0; i < IO_BITMAP_SIZE+1 ; i++) /* IO bitmap is actually SIZE+1
*/
p->tss.io_bitmap[i] = ~0;
...
}
That latter piece code appears to be resetting the map in the child, but
perhaps I am misreading.
Thanks,
Michael
--
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-06-16 9:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-13 17:36 [Bug 99911] New: ioperm is kept on fork bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
[not found] ` <bug-99911-11311-3bo0kxnWaOQUvHkbgXJLS5sdmw4N0Rt+2LY78lusg7I@public.gmane.org/>
2015-06-16 9:56 ` bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r [this message]
2015-09-11 3:13 ` [Bug 99911] " bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
2016-03-15 3:37 ` bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
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=bug-99911-11311-2QiIscMXiF@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon-590eeb7gvniway/ihj7yzeb+6bgklq7r@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).