Messages in this thread | | | From | Miquel Raynal <> | Subject | Re: [PATCH v4 2/4] mtd: always initialize 'stats' in struct mtd_oob_ops | Date | Wed, 21 Sep 2022 10:41:11 +0200 |
| |
On Wed, 2022-06-29 at 12:57:35 UTC, =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= wrote: > As the 'stats' field in struct mtd_oob_ops is used in conditional > expressions, ensure it is always zero-initialized in all such structures > to prevent random stack garbage from being interpreted as a pointer. > > Strictly speaking, this problem currently only needs to be fixed for > struct mtd_oob_ops structures subsequently passed to mtd_read_oob(). > However, this commit goes a step further and makes all instances of > struct mtd_oob_ops in the tree zero-initialized, in hope of preventing > future problems, e.g. if struct mtd_req_stats gets extended with write > statistics at some point. > > Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
| |