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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 29 Apr 2011 10:15:49 +0200
From:	Tejun Heo <tj@...nel.org>
To:	Jens Axboe <axboe@...nel.dk>, Amit Shah <amit.shah@...hat.com>
Cc:	David Zeuthen <zeuthen@...il.com>,
	Martin Pitt <martin.pitt@...ntu.com>,
	Kay Sievers <kay.sievers@...y.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] cdrom: always check_disk_change() on open

On Fri, Apr 29, 2011 at 12:27:18PM +0530, Amit Shah wrote:
> On (Wed) 06 Apr 2011 [05:20:09], Tejun Heo wrote:
> > cdrom_open() called check_disk_change() after the rest of open path
> > succeeded which leads to the following bizarre behavior.
> > 
> > * After media change, if the device opened without O_NONBLOCK,
> >   open_for_data() naturally fails with -ENOMEDIA and
> >   check_disk_change() is never called.  The media is known to be gone
> >   and the open failure makes it obvious to the userland but device
> >   invalidation never happens.
> > 
> > * But if the device is opened with O_NONBLOCK, all the checks are
> >   bypassed and cdrom_open() doesn't notice that the media is not there
> >   and check_disk_change() is called and invalidation happens.
> > 
> > There's nothing to be gained by avoiding calling check_disk_change()
> > on open failure.  Common cases end up calling check_disk_change()
> > anyway.  All we get is inconsistent behavior.
> > 
> > Fix it by moving check_disk_change() invocation to the top of
> > cdrom_open() so that it always gets called regardless of how the rest
> > of open proceeds.
> > 
> > Signed-off-by: Tejun Heo <tj@...nel.org>
> > Reported-by: Amit Shah <amit.shah@...hat.com>
> > Tested-by: Amit Shah <amit.shah@...hat.com>
> 
> Ping?
> 
> Also, please mark this for stable-2.6.38.

Jens?

-- 
tejun
--
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