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] [day] [month] [year] [list]
Date:   Fri, 22 Sep 2017 12:06:10 +0200
From:   Boris Brezillon <boris.brezillon@...e-electrons.com>
To:     Miquel Raynal <miquel.raynal@...e-electrons.com>
Cc:     Richard Weinberger <richard@....at>, linux-mtd@...ts.infradead.org,
        Cyrille Pitchen <cyrille.pitchen@...ev4u.fr>,
        linux-kernel@...r.kernel.org, Marek Vasut <marek.vasut@...il.com>,
        Brian Norris <computersforpeace@...il.com>,
        David Woodhouse <dwmw2@...radead.org>
Subject: Re: [PATCH v5] mtd: nand: Use standard large page OOB layout when
 using NAND_ECC_NONE

On Sat, 26 Aug 2017 17:19:15 +0200
Miquel Raynal <miquel.raynal@...e-electrons.com> wrote:

> Use the core's large page OOB layout functions when not reserving any
> space for ECC bytes in the OOB layout. Fix ->nand_ooblayout_ecc_lp()
> to return -ERANGE instead of a zero length in this case.
> 

Applied.

Thanks,

Boris

> Signed-off-by: Miquel Raynal <miquel.raynal@...e-electrons.com>
> ---
>  drivers/mtd/nand/nand_base.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index c5221795a1e8..39894c3f0fd5 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -115,7 +115,7 @@ static int nand_ooblayout_ecc_lp(struct mtd_info *mtd, int section,
>  	struct nand_chip *chip = mtd_to_nand(mtd);
>  	struct nand_ecc_ctrl *ecc = &chip->ecc;
>  
> -	if (section)
> +	if (section || !ecc->total)
>  		return -ERANGE;
>  
>  	oobregion->length = ecc->total;
> @@ -4649,6 +4649,19 @@ int nand_scan_tail(struct mtd_info *mtd)
>  			mtd_set_ooblayout(mtd, &nand_ooblayout_lp_hamming_ops);
>  			break;
>  		default:
> +			/*
> +			 * Expose the whole OOB area to users if ECC_NONE
> +			 * is passed. We could do that for all kind of
> +			 * ->oobsize, but we must keep the old large/small
> +			 * page with ECC layout when ->oobsize <= 128 for
> +			 * compatibility reasons.
> +			 */
> +			if (ecc->mode == NAND_ECC_NONE) {
> +				mtd_set_ooblayout(mtd,
> +						&nand_ooblayout_lp_ops);
> +				break;
> +			}
> +
>  			WARN(1, "No oob scheme defined for oobsize %d\n",
>  				mtd->oobsize);
>  			ret = -EINVAL;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ