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]
Message-ID: <OFCD61AB38.41A2EFE7-ON4825863B.0006C241-4825863B.000765F3@mxic.com.tw>
Date:   Fri, 11 Dec 2020 09:20:48 +0800
From:   ycllin@...c.com.tw
To:     "Miquel Raynal" <miquel.raynal@...tlin.com>
Cc:     juliensu@...c.com.tw, linux-kernel@...r.kernel.org,
        linux-mtd@...ts.infradead.org, vigneshr@...com
Subject: Re: [PATCH 1/2] mtd: nand: ecc-bch: Fix the size of calc_buf/code_buf of
 the BCH


Hi Miquel,
> "Miquel Raynal" <miquel.raynal@...tlin.com> 
> 
> Re: [PATCH 1/2] mtd: nand: ecc-bch: Fix the size of calc_buf/code_buf of 
the BCH
> 
> Hi YouChing,
> 
> YouChing Lin <ycllin@...c.com.tw> wrote on Thu, 10 Dec 2020 11:22:08
> +0800:
> 
(deleted)
> > The root cause is that the size of calc_buf/code_buf is limited to 64
> > bytes, although sizeof(mtd->oobsize) returns 4, kzalloc() will 
allocate
> > 64 bytes (cache size alignment).
> > 
> > So we correct the size of calc_buf/code_buf to mtd->oobsize.
> > 
> > Signed-off-by: YouChing Lin <ycllin@...c.com.tw>
> > ---
> >  drivers/mtd/nand/ecc-sw-bch.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/ecc-sw-bch.c 
b/drivers/mtd/nand/ecc-sw-bch.c
> > index 4d8a979..0a0ac11 100644
> > --- a/drivers/mtd/nand/ecc-sw-bch.c
> > +++ b/drivers/mtd/nand/ecc-sw-bch.c
> > @@ -237,8 +237,8 @@ int nand_ecc_sw_bch_init_ctx(struct nand_device 
*nand)
> > 
> >     engine_conf->code_size = code_size;
> >     engine_conf->nsteps = nsteps;
> > -   engine_conf->calc_buf = kzalloc(sizeof(mtd->oobsize), GFP_KERNEL);
> > -   engine_conf->code_buf = kzalloc(sizeof(mtd->oobsize), GFP_KERNEL);
> > +   engine_conf->calc_buf = kzalloc(mtd->oobsize, GFP_KERNEL);
> > +   engine_conf->code_buf = kzalloc(mtd->oobsize, GFP_KERNEL);
> 
> Very nice catch! If you don't mind I will merge this fix with the
> faulty commit (still in next) and I will also bring the fix to Hamming
> which will suffer from the same error.
> 
> Then I will apply the second patch.
 
No problem, thank you for your help.


Thanks,
Youching.


CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information 
and/or personal data, which is protected by applicable laws. Please be 
reminded that duplication, disclosure, distribution, or use of this e-mail 
(and/or its attachments) or any part thereof is prohibited. If you receive 
this e-mail in error, please notify us immediately and delete this mail as 
well as its attachment(s) from your system. In addition, please be 
informed that collection, processing, and/or use of personal data is 
prohibited unless expressly permitted by personal data protection laws. 
Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================



============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ