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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAC5umygbe7Z4qvKC+rUub8Dfwe8hMnVynYKittO6BNZBmRftsA@mail.gmail.com>
Date:	Tue, 6 Oct 2015 08:50:47 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	Christoph Hellwig <hch@....de>
Cc:	LKML <linux-kernel@...r.kernel.org>, Jens Axboe <axboe@...nel.dk>,
	Ming Lei <tom.leiming@...il.com>
Subject: Re: [PATCH v4 3/7] blk-mq: Fix use after of free q->mq_map

2015-09-29 15:52 GMT+09:00 Christoph Hellwig <hch@....de>:
> Looks good,
>
> Reviewed-by: Christoph Hellwig <hch@....de>
>
> Can you also add a patch that renames blk_mq_free_queue to
> blk_mq_cleaup_queue and adds a comment that we should not free any memory
> here?  We had  way too many bugs of this kinds unfortunately.

Renaming blk_mq_free_queue to blk_mq_cleaup_queue sounds good because
it is called from blk_cleanup_queue().

How about adding comment like below?

/*
 * The resources allocated by blk_mq_init_allocated_queue() are released
 * by blk_mq_cleanup_queue() and blk_mq_release().
 *
 * blk_mq_cleanup_queue() is called from blk_cleanup_queue(), so
 * the resources which may be used after blk_cleanup_queue() shouldn't
 * be released here.  Instead, those should be released by blk_mq_release()
 * which is called from blk_release_queue().
 *
 * For example, loop and md drivers call del_gendisk() after
 * blk_cleanup_queue(), so the resources used when accessing sysfs entries
 * for blk-mq shouldn't be released by blk_mq_cleanup_queue() as these sysfs
 * entries can be accessible before del_gendisk() is called.
 */
--
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