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]
Date:	Sat, 09 Feb 2013 13:58:42 +0000
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Thierry Reding <thierry.reding@...onic-design.de>,
	linux-kernel@...r.kernel.org
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Arnd Bergmann <arnd@...db.de>,
	Wolfram Sang <w.sang@...gutronix.de>
Subject: Re: [PATCH 00/33] Sanitize devm_request_and_ioremap()

On Mon, 21 Jan 2013 11:08:53 +0100, Thierry Reding <thierry.reding@...onic-design.de> wrote:
> Recent discussions about the lack of a meaningful error code returned by
> devm_request_and_ioremap() have triggered this patch series. One common
> issue is that the function returns NULL in all failure cases, making it
> impossible to determine what went wrong exactly. Another problem is that
> people can't seem to agree on what error code to return in case where
> the function fails. Both of these problems lead to inconsistent usage.
> 
> This series attempts to fix this by providing a replacement function,
> devm_ioremap_resource(), which returns a pointer to the remapped memory
> region on success and an ERR_PTR()-encoded error code on failure. Users
> can check for failure using the IS_ERR() macro and determine the exact
> cause by extracting the error code using PTR_ERR().
> 
> Patch 1 adds the new devm_ioremap_resource() function, which is really
> just a renamed version of devm_request_and_ioremap() that returns
> ERR_PTR()-encoded error codes on failure and makes the old function a
> wrapper around it, returning NULL in case of devm_ioremap_resource()
> failure. Furthermore the patch marks devm_request_and_ioremap() as a
> deprecated function to make it clear that it should no longer be used.
> A semantic patch is included that was used to convert the bulk of the
> existing calls to devm_request_and_ioremap() to the new API. The patch
> is far from perfect and a few occurrences had to be converted or fixed
> up manually.
> 
> The remaining patches convert each subsystem separately to use the new
> API.
> 
> Thierry

I know that this series has wide support and will probably be merged,
but I'm reply to this for the record. I do not think the ERR_PTR pattern
is a good idea because it goes against expectations of what is and is
not a valid pointer.

Nacked-by: Grant Likely <grant.likely@...retlab.ca>

Greg, if you're merging this series then don't let my objection inhibit
spi & gpio changes. I may not be happy, but I won't be an ass about it.

g.
--
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