[LU-5870] New static analysis issues in llite Created: 05/Nov/14  Updated: 30/Aug/23  Resolved: 11/Dec/14

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

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

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

 Description   

After commit b6e3612d845cf506e977f49aa85ddd1e709fd194 the 'ln.ln_name' and 'ln.ln_namelen' might be used uninitialized in this function.

TRACEBACK:

  • llite_lib.c:2823: 'ln.ln_namelen' is declared.
  • llite_lib.c:2837: Not entering loop, because ldata->ld_lee!= ( (void* )0) is false
  • llite_lib.c:2850: 'ln.ln_namelen' is used, but is uninitialized.
  • llite_lib.c:2854: 'ln.ln_name' is used, but is uninitialized.


 Comments   
Comment by Andreas Dilger [ 05/Nov/14 ]

This code was added in the "LU-3613 llite: Add ioctl to get parent fids from link EA" patch. Thomas or Henri, could you please provide a patch?

Comment by Henri Doreau (Inactive) [ 05/Nov/14 ]

There's already a patch aiming at cleaning up this code (for other reasons). It is tracked as LU-5837 and is currently being reviewed at http://review.whamcloud.com/#/c/12527/. The reported pattern has been replaced by something cleaner.

This said, it looks like a false positive to me. Provided ldata is consistent, the idx/linkno checks should prevent from using ln uninitialized.

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

Patch landed to Master.

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