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] [day] [month] [year] [list]
Date:	Thu, 13 Mar 2008 15:16:53 -0500
From:	James Bottomley <James.Bottomley@...senPartnership.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Boaz Harrosh <bharrosh@...asas.com>, stern@...land.harvard.edu,
	mdharm-usb@...-eyed-alien.net, svens@...ckframe.org,
	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	fujita.tomonori@....ntt.co.jp
Subject: Re: [PATCH ver3] isd200: Allocate sense_buffer for hacked up
	scsi_cmnd

On Thu, 2008-03-13 at 13:01 -0700, Andrew Morton wrote:
> On Wed, 12 Mar 2008 19:20:09 +0200
> Boaz Harrosh <bharrosh@...asas.com> wrote:
> 
> > 
> > Since the separation of sense_buffer from scsi_cmnd, Drivers that hack their
> > own struct scsi_cmnd like here isd200, must also take care of their own
> > sense_buffer.
> > 
> > Signed-off-by: Boaz Harrosh <bharrosh@...asas.com>
> > ---
> >  drivers/usb/storage/isd200.c |    5 ++++-
> >  1 files changed, 4 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
> > index 4f2d143..971d13d 100644
> > --- a/drivers/usb/storage/isd200.c
> > +++ b/drivers/usb/storage/isd200.c
> > @@ -1470,6 +1470,7 @@ static void isd200_free_info_ptrs(void *info_)
> >  	if (info) {
> >  		kfree(info->id);
> >  		kfree(info->RegsBuf);
> > +		kfree(info->srb.sense_buffer);
> >  	}
> >  }
> >  
> > @@ -1495,7 +1496,9 @@ static int isd200_init_info(struct us_data *us)
> >  				kzalloc(sizeof(struct hd_driveid), GFP_KERNEL);
> >  		info->RegsBuf = (unsigned char *)
> >  				kmalloc(sizeof(info->ATARegs), GFP_KERNEL);
> > -		if (!info->id || !info->RegsBuf) {
> > +		info->srb.sense_buffer =
> > +				kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
> > +		if (!info->id || !info->RegsBuf || !info->srb.sense_buffer) {
> >  			isd200_free_info_ptrs(info);
> >  			kfree(info);
> >  			retStatus = ISD200_ERROR;
> 
> I've thoroughly lost the plot here.

Don't worry ... that's why life gave us SCSI maintainers ...

>   Is this needed in 2.6.25?  If so, why?

Yes.  Because the changes that separate the sense buffer from the
commmand allocation which cause this bug went in in the merge window for
2.6.25

James


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