[LU-6507] Unsaf use of import connection at lprocfs_import_seq_show Created: 27/Apr/15  Updated: 28/May/15  Resolved: 28/May/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.8.0

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-6070 provide separate buffers for libcfs_*... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

smatch highlighted this bit of code in lprocfs_import_seq_show that does look a bit strange:

        libcfs_nid2str_r(imp->imp_connection->c_peer.nid,
                         nidstr, sizeof(nidstr));
        seq_printf(m, " ]\n"
                      "       current_connection: %s\n"
                      "       connection_attempts: %u\n"
                      "       generation: %u\n"
                      "       in-progress_invalidations: %u\n",
                      imp->imp_connection == NULL ? "<none>" : nidstr,

So if imp->imp_connection really could be NULL, we better check for it before dereferencing it in taht call to libcfs_nid2str_r.

This was introduced as part of LU-6070 patch hash 907a321c9b9e2cd5f5ccf488cc516ba05dee0ad8 by Dmitry.



 Comments   
Comment by Gerrit Updater [ 14/May/15 ]

Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14808
Subject: LU-6507 obdclass: Fix possible NULL pointer dereference
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: bff41e687f7329f6e95a67bebf3f879e87d1e3d5

Comment by Gerrit Updater [ 28/May/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14808/
Subject: LU-6507 obdclass: Fix possible NULL pointer dereference
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: d47f00d5a420b594b49564b2e00efca4602c3fb5

Comment by Peter Jones [ 28/May/15 ]

Landed for 2.8

Generated at Sat Feb 10 02:00:49 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.