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: <4995C66E.1000800@cisco.com>
Date:	Fri, 13 Feb 2009 11:13:50 -0800
From:	Joe Eykholt <jeykholt@...co.com>
To:	Randy Dunlap <randy.dunlap@...cle.com>
CC:	"Sachin P. Sant" <sachinp@...ibm.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
	linux-scsi <linux-scsi@...r.kernel.org>
Subject: Re: next Feb 13 drivers/scsi/aha1542.ko build break

Randy Dunlap wrote:
> Sachin P. Sant wrote:
>> Feb 13 next x86 allmodconfig build breaks with
>>
>> ERROR: "__udivdi3" [drivers/scsi/aha1542.ko] undefined!
>>
>> .config attached.
> 
> 
> I'm seeing that also.  I think that it's this line in aha1542.c:
> 
> 495:		mbo = (scsi2int(mb[mbi].ccbptr) - (SCSI_BUF_PA(&ccb[0]))) / sizeof(struct ccb);
> 
> since I can comment out the "/ sizeof(struct ccb)" and the driver builds successfully.
> 
> This may need a patch to use one of the div() macros (?).

In the above case, this problem might not occur if sizeof(struct ccb) happened to
be a power of 2, since the compiler generates a shift in that case.
Then later someone could increase the size of the struct and introduce this problem.

The kernel infrastructure should fix that without requiring the driver to change.
Drivers ought to be allowed to divide.

I've also seen this in another driver that divided a u64 by a constant.
I noticed that linux/math64.h provides div_u64(), but it seems awkward to call
that when the compiler generates a call to __udivdi3 (apparently).

Can't we just provide __udivdi3, since gcc generates that call?
Otherwise, problems like this will continue to crop up.

	Joe


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ