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: <46306ea4.nlqf3c05IYBhob1c%Joerg.Schilling@fokus.fraunhofer.de>
Date:	Thu, 26 Apr 2007 11:19:32 +0200
From:	Joerg.Schilling@...us.fraunhofer.de (Joerg Schilling)
To:	stern@...land.harvard.edu, dougg@...que.net
Cc:	linux-kernel@...r.kernel.org, jens.axboe@...cle.com,
	James.Bottomley@...eleye.com
Subject: Re: [PATCH] Block layer: separate out queue-oriented ioctls

Any chance to that this bug will be fixed anytime soon?

The Bug has been reported February 2004 but is still not fixed in sg.c
Is Linux development really sooooo slow?


Douglas Gilbert <dougg@...que.net> wrote:

> Alan,
> The SG_GET_RESERVED_SIZE ioctl is also defined in
> the block layer, see block/scsi_ioctl.c .
> I suspect it is just a kludge to fool cdrecord that it
> is talking to a sg device. [One of many kludges in the
> block SG_IO ioctl implementation to that end.]
> So perhaps the block layer versions of SG_SET_RESERVED_SIZE
> and SG_GET_RESERVED_SIZE need to be similarly capped.
> Actually I think that I would default SG_GET_RESERVED_SIZE to
> request_queue->max_sectors * 512 in the block layer
> implementation (as there is no "reserve buffer" associated
> with a block device).
>
>
> <aside>
> The idea of a reserved buffer may live on in bsg as experience
> with sg has shown that it is the fastest way to do (mmap-ed) IO.
> Having one reserved buffer per file descriptor means not
> having to create and tear down a scatter gather list
> per IO. [Having a pool of such lists would be even better.]
> Until optical storage needs 10 times its current datarates
> then cdrecord will not need this mechanism.
> </aside>
>
> Doug Gilbert
>
>
> > Index: usb-2.6/drivers/scsi/sg.c
> > ===================================================================
> > --- usb-2.6.orig/drivers/scsi/sg.c
> > +++ usb-2.6/drivers/scsi/sg.c
> > @@ -917,6 +917,8 @@ sg_ioctl(struct inode *inode, struct fil
> >  			return result;
> >                  if (val < 0)
> >                          return -EINVAL;
> > +		if (val > sdp->device->request_queue->max_sectors * 512)
> > +			return -EOVERFLOW;
> >  		if (val != sfp->reserve.bufflen) {
> >  			if (sg_res_in_use(sfp) || sfp->mmap_called)
> >  				return -EBUSY;
> > @@ -925,7 +927,8 @@ sg_ioctl(struct inode *inode, struct fil
> >  		}
> >  		return 0;
> >  	case SG_GET_RESERVED_SIZE:
> > -		val = (int) sfp->reserve.bufflen;
> > +		val = min_t(int, sfp->reserve.bufflen,
> > +				sdp->device->request_queue->max_sectors * 512);
> >  		return put_user(val, ip);
> >  	case SG_SET_COMMAND_Q:
> >  		result = get_user(val, ip);
> > 

Jörg

-- 
 EMail:joerg@...ily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@...tu-berlin.de                (uni)  
       schilling@...us.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
-
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