From: Brian Gerst <bgerst@quark.didntduck.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, dave_matthew@yahoo.com
Subject: Re: [Bug 703] New: Security vulnerability in "ioperm" system call
Date: Mon, 12 May 2003 08:39:15 -0400 [thread overview]
Message-ID: <3EBF95F3.1090507@quark.didntduck.org> (raw)
In-Reply-To: <17400000.1052708613@[10.10.2.4]>
[-- Attachment #1: Type: text/plain, Size: 772 bytes --]
Martin J. Bligh wrote:
> http://bugme.osdl.org/show_bug.cgi?id=703
>
> Summary: Security vulnerability in "ioperm" system call
> Kernel Version: 2.5.69
> Status: NEW
> Severity: low
> Owner: mbligh@aracnet.com
> Submitter: dave_matthew@yahoo.com
>
>
> Problem Description:
> The "ioperm" system call allows an unprivileged user to gain read and write
> access to I/O ports on the system. When used by a privileged process, the
> "ioperm" system call also fails to properly restrict privileges.
This patch makes sure that the ioperm bitmap in the TSS is correctly set
up during the first ioperm() call. Without this the TSS bitmap contains
random garbage until the next context switch.
--
Brian Gerst
[-- Attachment #2: iobitmap-1 --]
[-- Type: text/plain, Size: 890 bytes --]
diff -urN linux-2.5.64-bk5/arch/i386/kernel/ioport.c linux/arch/i386/kernel/ioport.c
--- linux-2.5.64-bk5/arch/i386/kernel/ioport.c 2003-02-24 14:59:03.000000000 -0500
+++ linux/arch/i386/kernel/ioport.c 2003-03-14 10:19:48.000000000 -0500
@@ -84,15 +84,17 @@
t->ts_io_bitmap = bitmap;
}
- tss = init_tss + get_cpu();
- if (bitmap)
- tss->bitmap = IO_BITMAP_OFFSET; /* Activate it in the TSS */
-
/*
* do it in the per-thread copy and in the TSS ...
*/
set_bitmap(t->ts_io_bitmap, from, num, !turn_on);
- set_bitmap(tss->io_bitmap, from, num, !turn_on);
+ tss = init_tss + get_cpu();
+ if (tss->bitmap == IO_BITMAP_OFFSET) { /* already active? */
+ set_bitmap(tss->io_bitmap, from, num, !turn_on);
+ } else {
+ memcpy(tss->io_bitmap, t->ts_io_bitmap, IO_BITMAP_BYTES);
+ tss->bitmap = IO_BITMAP_OFFSET; /* Activate it in the TSS */
+ }
put_cpu();
out:
return ret;
prev parent reply other threads:[~2003-05-12 12:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-12 3:03 Martin J. Bligh
2003-05-12 12:39 ` Brian Gerst [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=3EBF95F3.1090507@quark.didntduck.org \
--to=bgerst@quark.didntduck.org \
--cc=dave_matthew@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®