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]
Date:	Fri, 28 Oct 2011 14:15:00 +0200
From:	Mike Frysinger <vapier@...too.org>
To:	Russell King - ARM Linux <linux@....linux.org.uk>,
	Sekhar Nori <nsekhar@...com>, Kevin Hilman <khilman@...com>
Cc:	Grant Likely <grant.likely@...retlab.ca>,
	linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	davinci-linux-open-source@...ux.davincidsp.com
Subject: Re: [PATCH] asm-generic/gpio.h: merge basic gpiolib wrappers

On Thu, Oct 27, 2011 at 15:11, Russell King - ARM Linux wrote:
> This is extremely dangerous.  Consider for example this code
> (see ARM mach-davinci's gpio.h):

it's interesting you highlight davinci.  if i'm reading things
correctly, the current davinci code is broken today and my v2 proposed
patch actually fixes it.

let's see if i have this right:
arch/arm/include/asm/gpio.h:
...
#include <mach/gpio.h>
#ifndef __ARM_GPIOLIB_COMPLEX
/* The trivial gpiolib dispatchers */
#define gpio_get_value  __gpio_get_value
#define gpio_set_value  __gpio_set_value
#define gpio_cansleep   __gpio_cansleep
#endif
...

arch/arm/mach-davinci/include/mach/gpio.h:
...
#include <asm-generic/gpio.h>
...
static inline void gpio_set_value(unsigned gpio, int value)
{
    if (__builtin_constant_p(value) && gpio < davinci_soc_info.gpio_num) {
           ... do some SoC checking ...
    }
    __gpio_set_value(gpio, value);
}
... same thing for gpio_get_value and gpio_cansleep ...
...

since the davinci code doesn't define __ARM_GPIOLIB_COMPLEX, the
common arm gpio.h will rewrite these few gpio calls to the gpiolib
code all the time, and so all the inline funcs in the davinci header
always get ignored.

i noticed because when comparing the compiled
-mike
--
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