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: <56F3B217.8040206@metafoo.de>
Date:	Thu, 24 Mar 2016 10:23:35 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Irina Tirdea <irina.tirdea@...el.com>,
	Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Hartmut Knaack <knaack.h@....de>,
	Peter Meerwald <pmeerw@...erw.net>,
	Octavian Purdila <octavian.purdila@...el.com>
Subject: Re: [PATCH 1/1] iio: fix config watermark initial value

On 03/24/2016 10:09 AM, Irina Tirdea wrote:
> config structure is set to 0 when updating the buffers, so by
> default config->watermark will be 0. When computing the minimum
> between config->watermark and the buffer->watermark or
> insert_buffer-watermark, this will always be 0 regardless of the
> value set by the user for the buffer.
> 
> Set as initial value for config->watermark the maximum allowed
> value so that the minimum value will always be set from one of the
> buffers.
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>

Looks good. This bug was my fault, sorry.

Fixes: f0566c0c405d ("iio: Set device watermark based on watermark of all
attached buffers")

> ---
>  drivers/iio/industrialio-buffer.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index b976332..90462fc 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -653,6 +653,7 @@ static int iio_verify_update(struct iio_dev *indio_dev,
>  	unsigned int modes;
>  
>  	memset(config, 0, sizeof(*config));
> +	config->watermark = ~0;
>  
>  	/*
>  	 * If there is just one buffer and we are removing it there is nothing
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ