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: <TYAPR01MB4189C6A8BFFF81A47F6FE92792270@TYAPR01MB4189.jpnprd01.prod.outlook.com>
Date:   Fri, 19 Apr 2019 07:13:40 +0000
From:   <nobuhiro1.iwamatsu@...hiba.co.jp>
To:     <gregkh@...uxfoundation.org>, <stable@...r.kernel.org>
CC:     <rdunlap@...radead.org>, <axboe@...nel.dk>, <sashal@...nel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5.0 18/93] paride/pf: cleanup queues when detection fails

Hi,

> [ Upstream commit 6ce59025f1182125e75c8d121daf44056b65dd1f ]
>
> The driver allocates queues for all the units it potentially
> supports. But if we fail to detect any drives, then we fail
> loading the module without cleaning up those queues. This is
> now evident with the switch to blk-mq, though the bug has
> been there forever as far as I can tell.
>
> Also fix cleanup through regular module exit.
>
> Reported-by: Randy Dunlap <rdunlap@...radead.org>
> Tested-by: Randy Dunlap <rdunlap@...radead.org>
> Signed-off-by: Jens Axboe <axboe@...nel.dk>
> Signed-off-by: Sasha Levin <sashal@...nel.org>

This commit causes a new problem. And the commit that made the fix
is 58ccd2d31e502c37e108b285bf3d343eb00c235b.
I think this commit needs to be applied together.

Best regards,
  Nobuhiro

________________________________________
差出人: linux-kernel-owner@...r.kernel.org <linux-kernel-owner@...r.kernel.org> が Greg Kroah-Hartman <gregkh@...uxfoundation.org> の代理で送信
送信日時: 2019年4月19日 2:56
宛先: linux-kernel@...r.kernel.org
CC: Greg Kroah-Hartman; stable@...r.kernel.org; Randy Dunlap; Jens Axboe; Sasha Levin
件名: [PATCH 5.0 18/93] paride/pf: cleanup queues when detection fails

[ Upstream commit 6ce59025f1182125e75c8d121daf44056b65dd1f ]

The driver allocates queues for all the units it potentially
supports. But if we fail to detect any drives, then we fail
loading the module without cleaning up those queues. This is
now evident with the switch to blk-mq, though the bug has
been there forever as far as I can tell.

Also fix cleanup through regular module exit.

Reported-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org>
Signed-off-by: Jens Axboe <axboe@...nel.dk>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
 drivers/block/paride/pf.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index e92e7a8eeeb2..103b617cdc31 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -761,8 +761,12 @@ static int pf_detect(void)
                return 0;

        printk("%s: No ATAPI disk detected\n", name);
-       for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++)
+       for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) {
+               blk_cleanup_queue(pf->disk->queue);
+               pf->disk->queue = NULL;
+               blk_mq_free_tag_set(&pf->tag_set);
                put_disk(pf->disk);
+       }
        pi_unregister_driver(par_drv);
        return -1;
 }
@@ -1047,13 +1051,15 @@ static void __exit pf_exit(void)
        int unit;
        unregister_blkdev(major, name);
        for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) {
-               if (!pf->present)
-                       continue;
-               del_gendisk(pf->disk);
+               if (pf->present)
+                       del_gendisk(pf->disk);
+
                blk_cleanup_queue(pf->disk->queue);
                blk_mq_free_tag_set(&pf->tag_set);
                put_disk(pf->disk);
-               pi_release(pf->pi);
+
+               if (pf->present)
+                       pi_release(pf->pi);
        }
 }

--
2.19.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ