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:	Thu, 26 Sep 2013 09:22:11 +0200
From:	Richard Genoud <richard.genoud@...il.com>
To:	Richard Weinberger <richard@....at>
CC:	dedekind1@...il.com, dwmw2@...radead.org,
	linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] UBI: Call scan_all() with correct offset in error
 case

On 25/09/2013 22:32, Richard Weinberger wrote:
> If we find an invalid fastmap we have to scan from the very beginning.
> Otherwise we leak the first 64 PEBs.
> 
> Reported-by: Richard Genoud <richard.genoud@...il.com>
> Signed-off-by: Richard Weinberger <richard@....at>
> ---
>  drivers/mtd/ubi/attach.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
> index c071d41..03b32b0 100644
> --- a/drivers/mtd/ubi/attach.c
> +++ b/drivers/mtd/ubi/attach.c
> @@ -1417,9 +1417,11 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
>  				ai = alloc_ai("ubi_aeb_slab_cache2");
>  				if (!ai)
>  					return -ENOMEM;
> -			}
>  
> -			err = scan_all(ubi, ai, UBI_FM_MAX_START);
> +				err = scan_all(ubi, ai, 0);
> +			} else {
> +				err = scan_all(ubi, ai, UBI_FM_MAX_START);
> +			}
>  		}
>  	}
>  #else
> 

Works great, the assert is not triggered anymore.

Tested-by: Richard Genoud <richard.genoud@...il.com>
--
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