[LU-7947] Suspicious dereference of pointer before NULL check in llog_cancel_rec() Created: 29/Mar/16  Updated: 15/Mar/18  Resolved: 15/Mar/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.9.0
Fix Version/s: Lustre 2.11.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 'loghandle' before NULL check at line 218

  • An event which alters the program's state, leading to the defect
    llog.c:202: 'loghandle' is dereferenced.
  • An event which alters the program's state, leading to the defect
    llog.c:218: 'loghandle' is checked for NULL.
197		int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
198				    int index)
199		{
200			struct llog_thread_info *lgi = llog_info(env);
201			struct dt_device	*dt;
202			struct llog_log_hdr	*llh = loghandle->lgh_hdr;
203			struct thandle		*th;
204			int			 rc;
205			int rc1;
206			bool subtract_count = false;
207		 
208			ENTRY;
209		 
210			CDEBUG(D_RPCTRACE, "Canceling %d in log "DOSTID"\n", index,
211			       POSTID(&loghandle->lgh_id.lgl_oi));
212		 
213			if (index == 0) {...}
217		 
218			LASSERT(loghandle != NULL);


 Comments   
Comment by Gerrit Updater [ 01/Jan/17 ]

Arshad Hussain (arshad.hussain@seagate.com) uploaded a new patch: https://review.whamcloud.com/24561
Subject: LU-7947 obdclass: Move assignment below LASSERT()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: ffade7f23b66b91b95f68b541f9b4ef1d3aa9227

Comment by Gerrit Updater [ 15/Mar/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/24561/
Subject: LU-7947 obdclass: Move assignment below LASSERT()
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: bed1cbb3db18e01b933f1a799b4f4fd4ff707cfa

Comment by Peter Jones [ 15/Mar/18 ]

Landed for 2.11

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