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, 14 Jun 2014 16:41:20 +0100
From:	Jonathan Cameron <jic23@...nel.org>
To:	Himangi Saraogi <himangi774@...il.com>, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org
CC:	julia.lawall@...6.fr
Subject: Re: [PATCH] iio: adc: at91_adc: Correct call to input_free_device

On 13/06/14 18:11, Himangi Saraogi wrote:
> This error handling code can be reached before st->ts_input is
> initialized, so it is safer to always use the original name, input_dev.
>
> A simplified version of the semantic match that finds this problem is:
>
> // <smpl>
> @r exists@
> local idexpression struct input_dev * x;
> expression ra,rr;
> @@
>
> * x = input_allocate_device(...)
> ...  when != x = rr
>       when != input_free_device(x,...)
>       when != if (...) { ... input_free_device(x,...) ...}
> if(...) { ... when != x = ra
>       when forall
> *     when != input_free_device(x,...)
>   \(return <+...x...+>; \| return...; \) }
>
> // </smpl>
>
> Signed-off-by: Himangi Saraogi <himangi774@...il.com>
The error handling in this function has been completely rewritten so the
bug is no longer there and this no longer applies.

Thanks,

Jonathan
> ---
>   drivers/iio/adc/at91_adc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> index 3b5bacd..73b2bb5 100644
> --- a/drivers/iio/adc/at91_adc.c
> +++ b/drivers/iio/adc/at91_adc.c
> @@ -1114,7 +1114,7 @@ static int at91_ts_register(struct at91_adc_state *st,
>   	return ret;
>
>   err:
> -	input_free_device(st->ts_input);
> +	input_free_device(input);
>   	return ret;
>   }
>
>

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