From: Olaf Hering <olh@suse.de>
To: akpm@osdl.org, Vojtech Pavlik <vojtech@suse.cz>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] out of bounds access in hiddev_cleanup
Date: Wed, 19 May 2004 19:39:29 +0200 [thread overview]
Message-ID: <20040519173929.GA25589@suse.de> (raw)
hiddev_table[] is an array of pointers. the minor number is used as an
offset. hiddev minors start either with zero, or with 96.
If they start with 96, the offset must be reduced by HIDDEV_MINOR_BASE
because only 16 minors are available.
unplugging a hiddevice will zero data outside the hiddev_table array.
this was spotted by Takashi Iwai.
--- linux-2.6.5/drivers/usb/input/hiddev.c-dist 2004-05-16 17:16:20.260126241 +0200
+++ linux-2.6.5/drivers/usb/input/hiddev.c 2004-05-16 17:16:55.285207314 +0200
@@ -232,7 +232,7 @@ static int hiddev_fasync(int fd, struct
static struct usb_class_driver hiddev_class;
static void hiddev_cleanup(struct hiddev *hiddev)
{
- hiddev_table[hiddev->hid->minor] = NULL;
+ hiddev_table[hiddev->hid->minor - HIDDEV_MINOR_BASE] = NULL;
usb_deregister_dev(hiddev->hid->intf, &hiddev_class);
kfree(hiddev);
}
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
next reply other threads:[~2004-05-19 17:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-19 17:39 Olaf Hering [this message]
2004-05-20 10:15 ` [PATCH] out of bounds access in hiddev_cleanup Vojtech Pavlik
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=20040519173929.GA25589@suse.de \
--to=olh@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.cz \
/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