mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Block <bblock@linux.ibm.com>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: jejb@linux.ibm.com, martin.petersen@oracle.com,
	bvanassche@acm.org, hare@suse.de, axboe@kernel.dk,
	sconnor@purestorage.com, michael.christie@oracle.com,
	brian@purestorage.com, yukuai3@huawei.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH -next] scsi: scsi_dh_alua: fix memleak for 'qdata' in alua_activate()
Date: Wed, 15 Mar 2023 14:55:42 +0000	[thread overview]
Message-ID: <20230315145542.GI620522@t480-pf1aa2c2.fritz.box> (raw)
In-Reply-To: <20230315062154.668812-1-yukuai1@huaweicloud.com>

On Wed, Mar 15, 2023 at 02:21:54PM +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> If alua_rtpg_queue() failed from alua_activate(), then 'qdata' is not
> freed, which will cause following memleak:
> 
> unreferenced object 0xffff88810b2c6980 (size 32):
>   comm "kworker/u16:2", pid 635322, jiffies 4355801099 (age 1216426.076s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>     40 39 24 c1 ff ff ff ff 00 f8 ea 0a 81 88 ff ff  @9$.............
>   backtrace:
>     [<0000000098f3a26d>] alua_activate+0xb0/0x320
>     [<000000003b529641>] scsi_dh_activate+0xb2/0x140
>     [<000000007b296db3>] activate_path_work+0xc6/0xe0 [dm_multipath]
>     [<000000007adc9ace>] process_one_work+0x3c5/0x730
>     [<00000000c457a985>] worker_thread+0x93/0x650
>     [<00000000cb80e628>] kthread+0x1ba/0x210
>     [<00000000a1e61077>] ret_from_fork+0x22/0x30
> 
> Fix the problem by freeing 'qdata' in error path.
> 
> Fixes: 625fe857e4fa ("scsi: scsi_dh_alua: Check scsi_device_get() return value")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  drivers/scsi/device_handler/scsi_dh_alua.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 

Looks good to me.


Reviewed-by: Benjamin Block <bblock@linux.ibm.com>

-- 
Best Regards, Benjamin Block        /        Linux on IBM Z Kernel Development
IBM Deutschland Research & Development GmbH    /   https://www.ibm.com/privacy
Vors. Aufs.-R.: Gregor Pillen         /         Geschäftsführung: David Faller
Sitz der Ges.: Böblingen     /    Registergericht: AmtsG Stuttgart, HRB 243294

  reply	other threads:[~2023-03-15 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15  6:21 Yu Kuai
2023-03-15 14:55 ` Benjamin Block [this message]
2023-03-15 16:51 ` Bart Van Assche
2023-03-17  4:04 ` Martin K. Petersen

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=20230315145542.GI620522@t480-pf1aa2c2.fritz.box \
    --to=bblock@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=brian@purestorage.com \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=sconnor@purestorage.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®