[LU-5320] Use after free, double lock found by coccinelle Created: 10/Jul/14  Updated: 19/Aug/15  Resolved: 11/Jul/14

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

Type: Bug Priority: Critical
Reporter: Frank Zago (Inactive) Assignee: Jodi Levi (Inactive)
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Related
is related to LU-2753 Tracking bug for static code analysis... Resolved
Severity: 3
Rank (Obsolete): 14857

 Description   

When coccinelle (a static analyser) is run on the Lustre code, with the current Linux kernel scripts, it finds, amongst other things, the following errors:

  
lustre/include/obd_support.h:792:19-22: ERROR: reference preceded by free on line 791
lustre/ptlrpc/nrs_tbf.c:312:2-8: preceding lock on line 307
lustre/fid/fid_handler.c:73:43-51: ERROR: cli is NULL but dereferenced.
lustre/lfsck/lfsck_lib.c:1564:1-10: second lock on line 1571


 Comments   
Comment by Frank Zago (Inactive) [ 10/Jul/14 ]

http://review.whamcloud.com/11047

Comment by Frank Zago (Inactive) [ 10/Jul/14 ]

lustre/include/obd_support.h:792:19-22 is a false positive.

Comment by John Hammond [ 10/Jul/14 ]

Hi Frank,

I'm curious. Which version of coccinelle are you using? I used it some it a while ago but had too many issues with it. How well do you find it to work? Perhaps I should try it again.

Comment by Frank Zago (Inactive) [ 10/Jul/14 ]

I'm running it from Ubuntu. I installed the PPA then coccinelle (http://coccinelle.lip6.fr/download.php). It's the latest version (1.0.0-rc21).

I then run it from a linux kernel tree:

make coccicheck -j7 M=<path to lustre>/lustre-release
Comment by Peter Jones [ 11/Jul/14 ]

Landed for 2.6

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