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]
Message-ID: <20110405144651.GA20671@amit-x200.redhat.com>
Date:	Tue, 5 Apr 2011 20:16:51 +0530
From:	Amit Shah <amit.shah@...hat.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	linux-kernel@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
	"James E.J. Bottomley" <James.Bottomley@...e.de>,
	linux-scsi@...r.kernel.org, Markus Armbruster <armbru@...hat.com>,
	Stefan Hajnoczi <stefanha@...il.com>
Subject: Re: [PATCH] sr: Ensure disk is revalidated when media changes

On (Fri) 01 Apr 2011 [17:43:27], Tejun Heo wrote:
> Hello,
> 
> On Thu, Mar 31, 2011 at 11:50:04PM +0530, Amit Shah wrote:
> > After the first GET_EVENT_STATUS_NOTIFICATION command, any new media
> > notification is reset by the device.  The following is then noticed:
> > 
> > 1. insert a CD of a particular size
> > 2. mount it
> > 3. note /sys/block/sr0/size
> > 4. unmount cd
> > 5. replace cd with a size greater than previous one
> > 6. mount it
> > 7. /sys/block/sr0/size isn't updated
> > 8. copy all files from cd to somewhere; IO errors will pop up where the
> >    files lie beyond previous CD's geometry
> > 
> > The cause is:
> > 
> >  cdrom_open()
> >      open_for_data()
> >          cdo->drive_status() = sr_drive_status()
> >              cdrom_get_media_event()
> >              --> GPCMD_GET_EVENT_STATUS_NOTIFICATION
> >          --> med.media_present is true, return CDS_DISK_OK
> >      (success)
> >  check_disk_change()
> >     ... -> 2nd call to GPCMD_GET_EVENT_STATUS_NOTIFICATION
> > 
> > at this point the device has already reset the new media event and the
> > call to revalidate_disk() in check_disk_change() is never made.
> 
> Hmm... I see.  That's something I didn't expect.

...

> But I don't think this is the correct place to do it.  The problem
> happens because block layer consumes the event but doesn't remember it
> when the time for revalidation comes.  It should be done by block
> layer, not sr.

Hm, only the open call at the start of the call sequence is involved
from the block layer.  How to pass on such a pending event back?  Some
kind of an event array with helpers to modify it?

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