All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Olaf Hering <olh@suse.de>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] out of bounds access in hiddev_cleanup
Date: Thu, 20 May 2004 12:15:48 +0200	[thread overview]
Message-ID: <20040520101548.GD425@ucw.cz> (raw)
In-Reply-To: <20040519173929.GA25589@suse.de>

On Wed, May 19, 2004 at 07:39:29PM +0200, Olaf Hering wrote:
> 
> 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);
>  }
 
Already applied to my tree, thanks for forwarding it anyway.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

      reply	other threads:[~2004-05-20 10:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19 17:39 [PATCH] out of bounds access in hiddev_cleanup Olaf Hering
2004-05-20 10:15 ` Vojtech Pavlik [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=20040520101548.GD425@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olh@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.