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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230616092532.3307719-1-arnd@kernel.org>
Date:   Fri, 16 Jun 2023 11:24:48 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     Song Liu <song@...nel.org>, Yu Kuai <yukuai3@...wei.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
        Jens Axboe <axboe@...nel.dk>,
        Johannes Thumshirn <johannes.thumshirn@....com>,
        linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] md/raid1-10: shut up randstruct warning again

From: Arnd Bergmann <arnd@...db.de>

A code reorganization brought back a warning when structure randomization
is enabled:

drivers/md/raid1-10.c:119:25: error: casting from randomized structure pointer type 'struct block_device *' to 'struct md_rdev *'
        struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev;
                               ^

Before the rework, this used a (void*) cast, so go back to that in order
to avoid the warning. Casting between pointers to incompatible types is
clearly something that is dangerous, but this driver has always done so,
and it's not made any worse by the struct randomization in this case.

Fixes: 8295efbe68c08 ("md/raid1-10: factor out a helper to submit normal write")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/md/raid1-10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c
index 169ebe296f2d0..3f22edec70e78 100644
--- a/drivers/md/raid1-10.c
+++ b/drivers/md/raid1-10.c
@@ -116,7 +116,7 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp,
 
 static inline void raid1_submit_write(struct bio *bio)
 {
-	struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev;
+	struct md_rdev *rdev = (void *)bio->bi_bdev;
 
 	bio->bi_next = NULL;
 	bio_set_dev(bio, rdev->bdev);
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ