[LU-5495] osd-ldiskfs: Null pointer may be passed to function that may dereference it Created: 15/Aug/14  Updated: 12/Jan/18  Resolved: 12/Jan/18

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

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

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

 Description   

Null pointer 'hlock' that comes from line 3617 may be passed to function and can be dereferenced there by passing argument 4 to function 'ldiskfs_find_entry' at line 3648.

Null pointer 'hlock' that comes from line 4151 may be passed to function and can be dereferenced there by passing argument 4 to function 'ldiskfs_find_entry' at line 4169.

Null pointer 'hlock' that comes from line 4009 may be passed to function and can be dereferenced there by passing argument 6 to function '__osd_ea_add_rec' at line 4037. Also there is one similar error on line 4040.

TRACEBACK
osd_handler.c:3617: 'hlock' has been assigned a NULL value.
osd_handler.c:3640: obj->oo_hl_head!= ( (void* )0) is false
osd_handler.c:3648: 'hlock' is dereferenced by passing argument 4 to function 'ldiskfs_find_entry'.
namei.c:1230: 'lck' is passed to function 'ldiskfs_find_entry'.
namei.c:1251: 'lck' is dereferenced by passing argument 4 to function 'ldiskfs_dx_find_entry'.
namei.c:1342: 'lck' is passed to function 'ldiskfs_dx_find_entry'.
namei.c:1358: 'lck' is dereferenced by passing argument 5 to function 'dx_probe'.
namei.c:609: 'lck' is passed to function 'dx_probe'.
namei.c:633: hinfo->hash_version<=2 is true
namei.c:705: 0 is false
namei.c:742: ldiskfs_htree_node_locked(lck, LDISKFS_LB_DX) is false
namei.c:751: 'lck' is dereferenced by passing argument 1 to function 'dx_probe_hash_collision'.
namei.c:581: 'lck' is passed to function 'dx_probe_hash_collision'.
namei.c:585: 'lck' is explicitly dereferenced.



 Comments   
Comment by Li Xi (Inactive) [ 05/Mar/15 ]

Following line is very interesting, because when lck is NULL, that function should always return true.

'namei.c:742: ldiskfs_htree_node_locked(lck, LDISKFS_LB_DX) is false'

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