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: <20220623165552.38645-1-logang@deltatee.com>
Date:   Thu, 23 Jun 2022 10:55:52 -0600
From:   Logan Gunthorpe <logang@...tatee.com>
To:     linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
        Song Liu <song@...nel.org>
Cc:     Logan Gunthorpe <logang@...tatee.com>,
        kernel test robot <lkp@...el.com>
Subject: [PATCH] md/raid5: Fix divide type in raid5_make_request()

0day reports a build failure on the hexagon architecture:

  ld.lld: error: undefined symbol: __hexagon_udivdi3
     referenced by raid5.c
        md/raid5.o:(raid5_make_request) in archive drivers/built-in.a
     referenced by raid5.c
        md/raid5.o:(raid5_make_request) in archive drivers/built-in.a
     did you mean: __hexagon_udivsi3
        defined in: arch/hexagon/built-in.a(lib/udivsi3.o)

This is caused by using DIV_ROUND_UP on a sector_t type.

The actual value is known to be less than 256 so a wide 64bit divide
here is not desirable. Thus cast the argument to an int to ensure it
uses a 32bit divide.

Fixes: 681fb14a7100 ("md/raid5: Pivot raid5_make_request()")
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
---
 drivers/md/raid5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 5723a497108a..9d25696b793d 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -6091,7 +6091,7 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
 	bi->bi_next = NULL;
 
 	bitmap_set(ctx.sectors_to_do, 0,
-		   DIV_ROUND_UP(ctx.last_sector - logical_sector,
+		   DIV_ROUND_UP((int)(ctx.last_sector - logical_sector),
 				RAID5_STRIPE_SECTORS(conf)));
 
 	pr_debug("raid456: %s, logical %llu to %llu\n", __func__,

base-commit: 57c19f921f8081c1a9444dc7f3f6b3ea43fe612e
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ