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: <c26dfdf9ce56e92d23530a09db386b283e62845d.1638289204.git.geert+renesas@glider.be>
Date:   Tue, 30 Nov 2021 17:23:46 +0100
From:   Geert Uytterhoeven <geert+renesas@...der.be>
To:     Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Richard Weinberger <richard@....at>,
        Vignesh Raghavendra <vigneshr@...com>,
        Tudor Ambarus <tudor.ambarus@...rochip.com>
Cc:     Michael Walle <michael@...le.cc>, Pratyush Yadav <p.yadav@...com>,
        linux-mtd@...ts.infradead.org, linux-block@...r.kernel.org,
        linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
        Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH/RFC -nxt] mtd_blkdevs: Set GENHD_FL_NO_PART

When DT declares the partitions of an spi-nor device using
"fixed-partitions", the individual mtdblockN partitions are now scanned
for partitition tables, which should not happen.

Fix this by setting the GENHD_FL_NO_PART flag in the MTD block layer
interface.

Fixes: 1ebe2e5f9d68e94c ("block: remove GENHD_FL_EXT_DEVT")
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
Seen with e.g. arch/arm/boot/dts/r8a7791-koelsch.dts.
I only noticed because I have debug code to measure QSPI performance,
which informed me about 8 x 512 bytes being read from each partition
detected.

RFC as I'm not sure this is correct in all cases.
I did verify that in the absence of "fixed-partitions", the spi-nor
device is not scanned for partitions before and after commit
1ebe2e5f9d68e94c.
---
 drivers/mtd/mtd_blkdevs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 113f86df76038575..95c84faa794d22c6 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -345,6 +345,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
 	gd->first_minor = (new->devnum) << tr->part_bits;
 	gd->minors = 1 << tr->part_bits;
 	gd->fops = &mtd_block_ops;
+	gd->flags |= GENHD_FL_NO_PART;
 
 	if (tr->part_bits)
 		if (new->devnum < 26)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ