[LU-8224] Possibly access of bad pointer in mdt_obd_connect() Created: 14/Mar/16  Updated: 13/Oct/21  Resolved: 13/Oct/21

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

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-8182 Suspicious code in mdt_obd_connect Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

In mdt_obd_connect we have:

        if ((data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
            !(data->ocd_connect_flags & OBD_CONNECT_LIGHTWEIGHT)) {
                atomic_inc(&mdt->mdt_mds_mds_conns);
                mdt_enable_slc(mdt);
        }
        if (!test_bit(MDT_FL_SYNCED, &mdt->mdt_state) && data != NULL &&

So it's either we should drop the data != NULL check or also check it above or do something els.e

Otherwise it just looks kind of bad and also confuses static code analyzers.



 Comments   
Comment by Andreas Dilger [ 01/Jun/16 ]

This was filed in the wrong project.

Comment by Andreas Dilger [ 13/Oct/21 ]

Fixed in patch http://review.whamcloud.com/20391 "LU-8182 mdt: check connection data properly"

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