[LU-7949] Suspicious dereference of pointer before NULL check in osd_declare_qid() Created: 29/Mar/16  Updated: 21/Sep/16  Resolved: 21/Sep/16

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

Type: Bug Priority: Minor
Reporter: Dmitry Eremin (Inactive) Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: kw

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Suspicious dereference of pointer 'oh' before NULL check at line 515

  • An event which alters the program's state, leading to the defect
    osd_quota.c:508: 'oh' is dereferenced.
  • An event which alters the program's state, leading to the defect
    osd_quota.c:515: 'oh' is checked for NULL.
504		int osd_declare_qid(const struct lu_env *env, struct osd_thandle *oh,
505				    struct lquota_id_info *qi, struct osd_object *obj,
506				    bool enforce, int *flags)
507		{
508			struct osd_device       *dev = osd_dt_dev(oh->ot_super.th_dev);
509			struct qsd_instance     *qsd = dev->od_quota_slave;
510			struct inode		*inode = NULL;
511			int                      i, rc = 0, crd;
512			bool                     found = false;
513			ENTRY;
514		 
515			LASSERT(oh != NULL);


 Comments   
Comment by Gerrit Updater [ 10/Sep/16 ]

Arshad Hussain (arshad.hussain@seagate.com) uploaded a new patch: http://review.whamcloud.com/22428
Subject: LU-7949 osd: Move assignment below LASSERT()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 66bde872b96b4aba4e552f51ac36003126c28204

Comment by Gerrit Updater [ 21/Sep/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/22428/
Subject: LU-7949 osd: Move assignment below LASSERT()
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 34092ff5ae44c997918f970f100b46727c684855

Comment by Peter Jones [ 21/Sep/16 ]

Landed for 2.9

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