Projects
Eulaceura:Factory
mdadm
_service:obs_scm:0007-DDF-Fix-NULL-pointer-dere...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0007-DDF-Fix-NULL-pointer-dereference-in-validate_geometr.patch of Package mdadm
From b016fbfdda1fc1c9ddc1e590d53da3fa86212f9c Mon Sep 17 00:00:00 2001 From: Logan Gunthorpe <logang@deltatee.com> Date: Wed, 22 Jun 2022 14:25:08 -0600 Subject: [PATCH] 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/super-ddf.c b/super-ddf.c index a592c5d..d4dd334 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -3340,9 +3340,6 @@ static int validate_geometry_ddf(struct supertype *st, * If given BVDs, we make an SVD, changing all the GUIDs in the process. */ - if (*chunk == UnSet) - *chunk = DEFAULT_CHUNK; - if (level == LEVEL_NONE) level = LEVEL_CONTAINER; if (level == LEVEL_CONTAINER) { @@ -3354,6 +3351,9 @@ static int validate_geometry_ddf(struct supertype *st, verbose); } + if (*chunk == UnSet) + *chunk = DEFAULT_CHUNK; + if (!dev) { mdu_array_info_t array = { .level = level, -- 2.14.3 (Apple Git-98)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2