summaryrefslogtreecommitdiff
path: root/Documentation/tty/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorNikolay Ivchenko <nivchenko.dev@gmail.com>2026-06-20 20:06:03 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2026-06-29 16:42:42 +0200
commitae9d8058f13238cad5f5d16f676da91187684581 (patch)
tree44a9e69838a34a16f50ce50ed41d526315766961 /Documentation/tty/git@git.tavy.me:linux.git
parent97f9e509d839f7e5b9a32105ae322e5223c86786 (diff)
mtd: mtdpart: fix uninitialized erasesize on MTDPART_OFS_RETAIN error path
When parsing partition layouts, if a partition requested with MTDPART_OFS_RETAIN runs out of space, the allocator jumps directly to 'out_register' to preserve partition numbering. However, this jump bypasses child->erasesize initialization, leaving it at zero. When add_mtd_device() is later called on this child, the registration fails and triggers a WARN_ON() due to the zero ->erasesize. Fix this by zeroing out child->part.offset and child->part.size, and initializing child->erasesize to parent->erasesize. This is the exact same pattern already used just a few lines below in the "out of reach" error check (child->part.offset >= parent_size) to safely register a disabled partition. Reported-by: syzbot+3ae80219c633aca5431c@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3ae80219c633aca5431c Signed-off-by: Nikolay Ivchenko <nivchenko.dev@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'Documentation/tty/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions