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: <alpine.LFD.2.00.0912201026570.3712@localhost.localdomain>
Date:	Sun, 20 Dec 2009 10:33:05 -0800 (PST)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Dominik Brodowski <linux@...inikbrodowski.net>
cc:	Bjorn Helgaas <bjorn.helgaas@...com>,
	Yinghai Lu <yhlu.kernel@...il.com>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] resources: fix call to alignf() in allocate_resource()



On Sun, 20 Dec 2009, Dominik Brodowski wrote:
>
> The second parameter to alignf() in allocate_resource() must
> reflect what new resource is attempted to be allocated, else
> functions like pcibios_align_resource() (at least on x86) or
> pcmcia_align() can't work correctly.
> 
> Commit 1e5ad9679016275d422e36b12a98b0927d76f556 broke this by
> setting the "new" resource until we're about to return success.
> To keep the resource untouched when allocate_resource() fails,
> a "tmp" resource is introduced.

Ack. That was subtle. 

That said, maybe a nicer fix to this would be to actually return 'start' 
from the 'alignf' macro. That "modify the resource inside the alignment 
function" thing was always pretty ugly.

And then we'd pass in 'start' instead of 'size' (I have _no_ idea why we 
pass in 'size' to the alignment function, but whatever).

We'd still need to pass in the 'struct resource', but that would be so 
that it can figure out 'flags' (and 'size' if it really needs it) from it, 
but now it would be for reading only. So we could mark it 'const'.

Comments?

But Dominik's patch is ok too - the problem is not his patch, it's our 
longstanding horrible sh*t-for-brains calling convention (for which you 
can probably blame me - mea culpa).

		Linus
--
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