lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071104140552.GA25915@1wt.eu>
Date:	Sun, 4 Nov 2007 15:05:52 +0100
From:	Willy Tarreau <w@....eu>
To:	vitalivanov@...il.com
Cc:	Pete Zaitcev <zaitcev@...hat.com>,
	linux-usb-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [2.4 patch] Port of adutux driver from 2.6 kernel to 2.4.

On Mon, Oct 22, 2007 at 08:45:39PM -0700, Pete Zaitcev wrote:
> On Fri, 19 Oct 2007 20:40:35 +0300, Vitaliy Ivanov <vitalivanov@...il.com> wrote:
> 
> Hi, Vitaly, I added you on cc: for the 2.6 cleanup. Please double-check
> what I'm doing there and use it for your 2.4 version. I hope my intentions
> get clearer with an example. Now, about the specific question:
> 
> > Static lock minor_table_mutex is used for minor table structure.
> > And dev->sem for dev manipulations and that's why for open_count.
> > If you will simply browse /drivers/usb dir for 2.4 you will see that
> > such approach is widely used there.
> > What's not right?
> 
> The fundamental reason why you cannot lock a free-able structure with
> an in-structure lock is this. Imagine thread A locks in order to process
> a disconnect. Thread B wants to open and waits for the lock. Notice that
> the struct is not open, so thread A frees it. At this point, thread B
> is using a freed memory.
> 
> The solution is to lock the instance struct dev with dev->mtx, except
> for the open count, which is locked by a static lock (I'm ignoring
> interrupts here, which cannot use mutexes).
> 
> I'm sorry to say, you're quite right: a number of drivers in 2.4 got
> it wrong, and some (like adutux) carried it through 2.6.23.

Vitaly,

I'm planning on issuing a new 2.4.36 prerelease soon. Have you made any
progress on your code after Pete's recommendations ?

Thanks,
Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ