lkml.org 
[lkml]   [2022]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 2/4] mtd: always initialize 'stats' in struct mtd_oob_ops
Date
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

\
 
 \ /
  Last update: 2022-09-21 10:43    [W:0.421 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site