Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
filesystems
lustre_2_15
0005-LU-0000-nodemap-avoid-NULL-deref.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0005-LU-0000-nodemap-avoid-NULL-deref.patch of Package lustre_2_15
From 662539c39c7977771e40d08d2402d6ed94aced77 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown <neilb@suse.de> Date: Wed, 30 Nov 2022 10:03:00 +1100 Subject: [PATCH 05/30] LU-0000 nodemap: avoid NULL deref Setting ncf_obj to NULL can cause null-pointer-deref, especially if we get a failure and leave it there. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I04988eaef49fcb8304fe27b91b29e4a09b8ca15e --- lustre/ptlrpc/nodemap_storage.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lustre/ptlrpc/nodemap_storage.c b/lustre/ptlrpc/nodemap_storage.c index de60d0f5e649..f86ed9669399 100644 --- a/lustre/ptlrpc/nodemap_storage.c +++ b/lustre/ptlrpc/nodemap_storage.c @@ -1133,16 +1133,14 @@ static void nodemap_save_all_caches(void) struct obd_device *obd = ncf->ncf_obj->do_lu.lo_dev->ld_obd; struct dt_object *o; - /* put current config file so save conf can rewrite it */ - dt_object_put_nocache(&env, ncf->ncf_obj); - ncf->ncf_obj = NULL; - o = nodemap_save_config_cache(&env, dev, ncf->ncf_los); if (IS_ERR(o)) - CWARN("%s: error writing to nodemap config: rc = %d\n", - obd->obd_name, rc); - else + CWARN("%s: error writing to nodemap config: rc = %ld\n", + obd->obd_name, PTR_ERR(o)); + else { + dt_object_put_nocache(&env, ncf->ncf_obj); ncf->ncf_obj = o; + } } mutex_unlock(&ncf_list_lock); -- 2.38.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor