All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Cc: Anirban Chakraborty <anirban.chakraborty@qlogic.com>,
	Andrew Vasquez <andrew.vasquez@qlogic.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] qla2xxx: double free bug in qla2x00_probe_one
Date: Sun, 18 Jan 2009 19:22:13 -0600	[thread overview]
Message-ID: <1232328133.3247.66.camel@localhost.localdomain> (raw)
In-Reply-To: <6.0.0.20.2.20090119094611.06ce0720@172.19.0.2>

On Mon, 2009-01-19 at 09:59 +0900, Hisashi Hifumi wrote:
> At 01:56 09/01/17, Anirban Chakraborty wrote:
> 
> >On Jan 15, 2009, at 7:13 PM, Hisashi Hifumi wrote:
> >
> >>Hi.
> >>
> >>I got double free bug at qla2x00_probe_one's error path and
> >>kernel was panicked.
> >>qla2x00_probe_one's probe_failed path is as follows:
> >>
> >>qla2x00_free_que(ha, req, rsp);
> >>qla2x00_free_device(base_vha);
> >>
> >>qla2x00_free_device calls qla2x00_free_que through qla2x00_free_queues.
> >>qla2x00_free_device frees the same pointer of req and rsp that is already 
> >>freed by qla2x00_free_que.
> >>
> >>Following patch fixes this problem.
> >>Thanks.
> >This has been fixed as a part of the ISP restart bug fix. <http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-rc-fixes-2.6.git;a=commit;h=29bdccbee69c199910b2b39377e66ee5c33f241c>http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-rc-fixes-2.6.git;a=commit;h=29bdccbee69c199910b2b39377e66ee5c33f241c
> >Thanks,
> >Anirban
> 
> Your patch is as follows:
> 
>  probe_failed:
> -       qla2x00_free_que(ha, req, rsp);
>         qla2x00_free_device(base_vha);
> 
> 
> I think just removing qla2x00_free_que here is wrong, because when qla2x00_request_irqs or
> qla2x00_alloc_queues fails, no one frees rsp and req.

Aren't these freed by

qla2x00_free_device()
qla2x00_free_queues()
qla2x00_free_que()

along that path?

James



  reply	other threads:[~2009-01-19  1:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16  3:13 [PATCH] qla2xxx: double free bug in qla2x00_probe_one Hisashi Hifumi
2009-01-16 17:04 ` Anirban Chakraborty
     [not found] ` <A80C85DE-E35D-46A3-AA9F-2D790CAED442@qlogic.com>
2009-01-19  0:59   ` Hisashi Hifumi
2009-01-19  1:22     ` James Bottomley [this message]
2009-01-19  1:50       ` Hisashi Hifumi
2009-01-19  3:14         ` Anirban Chakraborty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1232328133.3247.66.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=anirban.chakraborty@qlogic.com \
    --cc=hifumi.hisashi@oss.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.