]> git.neil.brown.name Git - mdadm.git/commit
DDF: Fix NULL pointer dereference in validate_geometry_ddf()
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 22 Jun 2022 20:25:08 +0000 (14:25 -0600)
committerJes Sorensen <jes@trained-monkey.org>
Sun, 7 Aug 2022 20:27:59 +0000 (16:27 -0400)
commit2b93288a5650bb811932836f67f30d63c5ddcfbd
tree79638716ccc3ce218dde0cfbd24036a9c5113819
parent679bd9508a30b2a0a1baecc9a21dd6c7d8d8d7dc
DDF: Fix NULL pointer dereference in validate_geometry_ddf()

A relatively recent patch added a call to validate_geometry() in
Manage_add() that has level=LEVEL_CONTAINER and chunk=NULL.

This causes some ddf tests to segfault which aborts the test suite.

To fix this, avoid dereferencing chunk when the level is
LEVEL_CONTAINER or LEVEL_NONE.

Fixes: 1f5d54a06df0 ("Manage: Call validate_geometry when adding drive to external container")
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
super-ddf.c