mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vitaliy Ivanov <vitalivanov@gmail.com>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: Willy Tarreau <w@1wt.eu>,
	gregkh@suse.de, linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [2.4 patch] Port of adutux driver from 2.6 kernel to 2.4.
Date: Tue, 16 Oct 2007 16:48:54 +0300	[thread overview]
Message-ID: <1192542533.29039.58.camel@dell1.softservecom.com> (raw)
In-Reply-To: <20071015103033.65b47dea.zaitcev@redhat.com>

Pete,

On Mon, 2007-10-15 at 20:30, Pete Zaitcev wrote:

> > +	in_end_size = le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize);
> > +	out_end_size = le16_to_cpu(dev->interrupt_out_endpoint->wMaxPacketSize);
> 
> Did you verify if this works? We use pre-swapped descriptors in 2.4.
> I suspect you allocate 256 times more memory than necessary.

Just checked. Seems to be OK. At least printk shows shows it.

> 
> > +static void adu_delete(struct adu_device *dev)
> > +	kfree(dev);
> 
> > +static int adu_release_internal(struct adu_device *dev)
> > +	if (dev->udev == NULL) {
> > +		adu_delete(dev);
> 
> > +static int adu_open(struct inode *inode, struct file *file)
> > +	retval = adu_release_internal(dev);
> > +	up(&dev->sem);
> 
> The above very clearly is a use-after-free, in case the device was
> open across a disconnect. Solution: Use minor_table_mutex to lock
> dev->open_count instead of dev->sem. There's no rule that the lock
> has to live inside the same structure with members it locks.

Yeah. You are right. Found similar issue in adu_release also. 
It's a problem with 2.6 kernel driver.
So, I've got a material to create some fixes in 2.6 driver too.
I've reworked the code to avoid this issue.

Sending final patch as a reply to Willy's mail. Please check it.


Vitaliy


  parent reply	other threads:[~2007-10-16 13:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-14 17:37 Vitaliy Ivanov
2007-10-14 18:25 ` Willy Tarreau
2007-10-14 20:45   ` Vitaliy Ivanov
2007-10-14 22:39     ` Willy Tarreau
2007-10-16 13:54       ` Vitaliy Ivanov
2007-10-16 15:41         ` Willy Tarreau
2007-10-16 17:56           ` Pete Zaitcev
2007-10-16 18:22             ` Vitaliy Ivanov
2007-10-16 18:24             ` Willy Tarreau
2007-10-16 18:24           ` Vitaliy Ivanov
2007-10-17 18:12             ` Vitaliy Ivanov
2007-10-19 15:26               ` Vitaliy Ivanov
2007-10-19 16:53                 ` Pete Zaitcev
2007-10-19 17:40                   ` Vitaliy Ivanov
2007-10-23  3:45                     ` Pete Zaitcev
2007-11-04 14:05                       ` Willy Tarreau
2007-11-05  9:32                         ` Vitaliy Ivanov
2007-11-05  9:36                           ` Willy Tarreau
2007-10-16 17:52         ` Pete Zaitcev
2007-10-15 17:30     ` Pete Zaitcev
2007-10-15 20:04       ` Vitaliy Ivanov
2007-10-16 13:48       ` Vitaliy Ivanov [this message]
2007-10-16 14:59         ` Greg KH

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=1192542533.29039.58.camel@dell1.softservecom.com \
    --to=vitalivanov@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=w@1wt.eu \
    --cc=zaitcev@redhat.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®