[LU-5869] New static analysis issues in osc Created: 05/Nov/14  Updated: 30/Aug/23  Resolved: 21/Apr/17

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

Type: Bug Priority: Major
Reporter: Dmitry Eremin (Inactive) Assignee: Zhenyu Xu
Resolution: Won't Fix Votes: 0
Labels: kw

Issue Links:
Related
is related to LU-4629 Issues found by static analysis tools Resolved
Severity: 3
Rank (Obsolete): 16418

 Description   

Pointer 'matched' returned from call to function 'ldlm_handle2lock' at line 2312 may be NULL and will be dereferenced at line 2318. Also there are 2 similar errors on line(s) 2327, 2331.

TRACEBACK:

  • osc_request.c:2312: 'matched' is assigned the return value from function 'ldlm_handle2lock'.
    • lustre_dlm.h:1254: '_ldlm_handle2lock(h, 0)' is assigned the return value from function '_ldlm_handle2lock'.
      • ldlm_lock.c:606: '__ldlm_handle2lock' explicitly returns a NULL value.
    • lustre_dlm.h:1254: '__ldlm_handle2lock(h, 0)' is returned by 'ldlm_handle2lock'.
  • osc_request.c:2318: 'matched' is dereferenced by passing argument 1 to function 'ldlm_lock_put'.
    • ldlm_lock.c:201: 'lock' is passed to function 'ldlm_lock_put'.
    • ldlm_lock.c:205: 'lock' is explicitly dereferenced.


 Comments   
Comment by Jodi Levi (Inactive) [ 11/Dec/14 ]

BobiJam,
Can you take a look at this one?
Thank you!

Comment by Gerrit Updater [ 12/Dec/14 ]

Bobi Jam (bobijam@gmail.com) uploaded a new patch: http://review.whamcloud.com/13042
Subject: LU-5869 osc: handle ldlm_handle2lock() static analysis issue
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 963c63b93325f19c053c285a38091cbda1874d89

Comment by Oleg Drokin [ 16/Jan/15 ]

So writing a patch that trades one crash for another is bad practice.
We really should try and recover from this situation instead!

Comment by Peter Jones [ 21/Apr/17 ]

As per discussion on the triage call this hypothetical issue is not an actual bug

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