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-next>] [day] [month] [year] [list]
Message-Id: <20231021185832.25592-1-richard@nod.at>
Date:   Sat, 21 Oct 2023 20:58:32 +0200
From:   Richard Weinberger <richard@....at>
To:     linux-mtd@...ts.infradead.org
Cc:     linux-kernel@...r.kernel.org, vigneshr@...com, richard@....at,
        miquel.raynal@...tlin.com, joern@...ybastard.org,
        Christoph Hellwig <hch@....de>, stable@...r.kernel.org
Subject: [PATCH] mtd: block2mtd: Add a valid holder to blkdev_put()

Since commit 2736e8eeb0ccd ("block: use the holder as indication for exclusive opens")
blkdev_put() requires a valid holder argument.
So, do so also in block2mtd to unbreak bdev->bd_holder refcounting.

Cc: Christoph Hellwig <hch@....de>
Cc: stable@...r.kernel.org
Fixes: 2736e8eeb0ccd ("block: use the holder as indication for exclusive opens")
Signed-off-by: Richard Weinberger <richard@....at>
---
 drivers/mtd/devices/block2mtd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index be106dc20ff3c..8c37650bbce45 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -209,7 +209,7 @@ static void block2mtd_free_device(struct block2mtd_dev *dev)
 	if (dev->blkdev) {
 		invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping,
 					0, -1);
-		blkdev_put(dev->blkdev, NULL);
+		blkdev_put(dev->blkdev, dev);
 	}
 
 	kfree(dev);
-- 
2.35.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ