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:	Mon, 10 Feb 2014 11:53:38 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Michal Simek <michal.simek@...inx.com>
CC:	linux-kernel@...r.kernel.org, monstr@...str.eu,
	Arnd Bergmann <arnd@...db.de>, Mark Brown <broonie@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] regmap: Check readable regs in _regmap_read

On 02/10/2014 11:46 AM, Michal Simek wrote:
> Check if regs are readable.
>
> Signed-off-by: Michal Simek <michal.simek@...inx.com>
> ---
>
>   drivers/base/regmap/regmap.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
> index 6a19515..7569dfc 100644
> --- a/drivers/base/regmap/regmap.c
> +++ b/drivers/base/regmap/regmap.c
> @@ -1725,6 +1725,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
>   	int ret;
>   	void *context = _regmap_map_get_context(map);
>
> +	if (!regmap_readable(map, reg))
> +		return -EIO;
> +

This will cause issues with devices where registers are writable, but not 
readable, but we keep the register value in the cache.

>   	WARN_ON(!map->reg_read);
>
>   	if (!map->cache_bypass) {
> --
> 1.8.2.3
>

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