linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] Yet another scsi_cmnd leak?
@ 2005-09-29 20:02 Alan Stern
  2005-09-29 20:28 ` Mike Christie
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Stern @ 2005-09-29 20:02 UTC (permalink / raw)
  To: James Bottomley; +Cc: SCSI development list

James:

This report is based on 2.6.14-rc2-git6.  The code in your scsi-misc-2.6 
git tree is somewhat different (and I don't know which is more current), 
but it still contains the same bug.


In scsi_prep_fn, a request can get deferred if scsi_init_io fails to 
allocate an sg table.  When this happens, the scsi_cmnd isn't released and 
the request is not marked DONTPREP.

Then when scsi_prep_fn is called again, the request may be killed for 
a number of reasons.  The code branches to the kill: label near the end of 
the routine, which returns BLKPREP_KILL.

Isn't it true that when this happens, the scsi_cmnd allocated during the
original prep will never be released?

It appears that scsi_prep_fn is undecided about whether or not the request
is allowed to have a scsi_cmnd already.  The jumps to kill: seem to assume
that it isn't, but the code for allocating a new scsi_cmnd tests for an
existing one first.

Alan Stern


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-10-14 15:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-29 20:02 [BUG] Yet another scsi_cmnd leak? Alan Stern
2005-09-29 20:28 ` Mike Christie
2005-09-29 20:31   ` Mike Christie
2005-10-03 15:34   ` Alan Stern
2005-10-04 15:51     ` Mike Christie
2005-10-14 15:23       ` [PATCH] Fix leak of Scsi_Cmnds Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).