[LU-9057] New static analysis issues in v2_9_52_0-35-ge0e9ea6 Created: 27/Jan/17  Updated: 30/Aug/23  Resolved: 08/Jul/17

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

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

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

 Description   

Found 17 new static analysis issues in v2_9_52_0-35-ge0e9ea6:

  1. Suspicious dereference of pointer before NULL check
    • lnet/lnet/lib-move.c: in lnet_select_pathway, Suspicious dereference of pointer 'best_gw' before NULL check at line 1672
  2. Null pointer may be dereferenced
    • lnet/utils/lnetctl.c: in jt_add_peer_nid, Null pointer 'nids' that comes from line 1091 may be dereferenced at line 1136.
  3. Null pointer will be dereferenced
    • lnet/utils/lnetconfig/liblnetconfig.c: in handle_yaml_del_ni, Null pointer '...?&nw_descr (void* )0)' that comes from line 2768 will be dereferenced at line 2768.
  4. Null pointer may be dereferenced
    • lnet/lnet/lib-move.c: in lnet_select_pathway, Null pointer 'best_ni' that comes from line 1414 may be dereferenced at line 1560.
  5. Pointer may be passed to function that can dereference it after it was positively checked for NULL
    • lnet/lnet/lib-move.c: in lnet_select_pathway, Pointer 'best_ni' checked for NULL at line 1469 may be passed to function and may be dereferenced there by passing argument 1 to function 'lnet_ni_addref_locked' at line 1559.
  6. Suspicious dereference of pointer before NULL check
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_del_ni, Suspicious dereference of pointer 'nw_descr' before NULL check at line 1447
  7. Result of function that can return NULL may be dereferenced
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_numa_range, Pointer 'root' returned from call to function 'cYAML_create_object' at line 2257 may be NULL and may be dereferenced at line 2278.
  8. Null pointer may be passed to function that may dereference it
    • lnet/lnet/lib-move.c: in lnet_select_pathway, Null pointer 'best_ni' that comes from line 1414 may be passed to function and can be dereferenced there by passing argument 1 to function 'lnet_ni_addref_locked' at line 1559.
  9. Uninitialized Variable - possible
    • lnet/lnet/peer.c: in lnet_add_prim_lpni, 'rc' might be used uninitialized in this function.
  10. Null pointer may be dereferenced
    • lnet/utils/lnetctl.c: in jt_del_peer_nid, Null pointer 'nids' that comes from line 1150 may be dereferenced at line 1188.
  11. Uninitialized Variable - possible
    • lnet/utils/lnetconfig/liblnetconfig.c: in handle_yaml_config_ni, 'nw_descr.nw_id' might be used uninitialized in this function.
  12. Result of function that may return NULL will be dereferenced
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_config_ni, Pointer 'conf' returned from call to function 'calloc' at line 1336 may be NULL and will be dereferenced at line 1342.
  13. Result of function that may return NULL will be dereferenced
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_ioctl_config_ni, Pointer 'conf' returned from call to function 'calloc' at line 1192 may be NULL and will be dereferenced at line 1198.
  14. Resource leak
    • lnet/utils/lnetconfig/liblnetconfig.c: in socket_intf_query, Resource acquired to 'sockfd' at line 914 may be lost here. Also there is one similar error on line 923.
  15. Pointer may be dereferenced after it was positively checked for NULL
    • lnet/lnet/lib-move.c: in lnet_select_pathway, Pointer 'best_ni' checked for NULL at line 1469 may be dereferenced at line 1560.
  16. Pointer may be dereferenced after it was positively checked for NULL
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_numa_range, Pointer 'root' checked for NULL at line 2258 may be dereferenced at line 2278.
  17. Null pointer may be dereferenced
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_numa_range, Null pointer 'root' that comes from line 2240 may be dereferenced at line 2278.

The list of commits since the previous build v2_9_52_0-0-gbd197db:

e0e9ea6 LU-7734 lnet: multi-rail feature
97b5d13 LU-7734 lnet: Fix setting numa range
f3a8c0f LU-7734 lnet: Update lnetctl usage
c14ef7b LU-7734 lnet: cpt locking
4d2ad7d LU-7734 lnet: rename peer key_nid to prim_nid
9ff3b40 LU-7734 lnet: Enhance DLC ip2nets
f85f1cd LU-7734 lnet: fix NULL access in lnet_peer_aliveness_enabled
b38eb0b LU-7734 lnet: set primary NID in ptlrpc_connection_get()
f285d82 LU-7734 lnet: fix string.h header inclusion
003ff68 LU-7734 lnet: minor fixes
b9880b8 LU-7734 lnet: double free in lnet_add_net_common()
c9d48ea LU-7734 lnet: Fix crash in router_proc.c
76adbed LU-7734 lnet: fix routing selection
e6f4713 LU-7734 lnet: power8 compile fix
b704f1b LU-7734 lnet: Routing fixes part 2
376633a LU-7734 lnet: Routing fixes part 1
a52d11f LU-7734 lnet: fix lnet_select_pathway()
c906ab9 LU-7734 lnet: configuration fixes
baf1a98 LU-7734 lnet: fix lnet_peer_table_cleanup_locked()
63c3e51 LU-7734 lnet: Fix lnet_msg_free()
2d12c15 LU-7734 lnet: simplify and fix lnet_select_pathway()
e1526ef LU-7734 lnet: protect peer_ni credits
362e52e LU-7734 lnet: proper cpt locking
fa8b4e6 LU-7734 lnet: peer/peer_ni handling adjustments
d704b0e LU-7734 lnet: Add peer_ni and NI stats for DLC
d8792a7 LU-7734 lnet: rename LND peer to peer_ni
fa72765 LU-7734 lnet: handle N NIs to 1 LND peer
f016fea LU-7734 lnet: handle non-MR peers
8db1193 LU-7734 lnet: Primary NID and traffic distribution
def25e9 LU-7734 lnet: NUMA support
973a106 LU-7734 lnet: configure local NI from DLC
3c62efb LU-7734 lnet: configure peers from DLC
24b1bba LU-7734 lnet: Multi-Rail local_ni/peer_ni selection
58091af LU-7734 lnet: Multi-Rail peer split
8cbb8cd LU-7734 lnet: Multi-Rail local NI split


 Comments   
Comment by Amir Shehata (Inactive) [ 02/Feb/17 ]

Is this static analysis tool part of the gerrit tool set? does it run automatically? It's nice to be able to run it on the code so we can address these issues earlier. Can we make it available to run on the multi-rail branch? I'll address the above issues in a cleanup patch for master

Comment by Dmitry Eremin (Inactive) [ 02/Feb/17 ]

Amir, Unfortunately this is not automated tool. I run it manually time to time and provide feedback to tracker. Of cause I can run it with special version or branch, but there are many false positives can be if I run it from scratch. I suppress many of them for master branch and now I can see only new issues which also can be false positives.

 

P.S. this tool checks the licence online and should have an access to Intel IntraNetwork. It can not work in our Lab in Rio Rancho by default. It will require a special configuration of Intel Firewall which I was not able to request a few time ago.

 

Comment by Gerrit Updater [ 03/Feb/17 ]

Amir Shehata (amir.shehata@intel.com) uploaded a new patch: https://review.whamcloud.com/25228
Subject: LU-9057 lnet: fix static analysis issues
Project: fs/lustre-release
Branch: multi-rail
Current Patch Set: 1
Commit: 82009b4387a2b6407c41cc050b0a965e5bca255b

Comment by Gerrit Updater [ 07/Feb/17 ]

Amir Shehata (amir.shehata@intel.com) merged in patch https://review.whamcloud.com/25228/
Subject: LU-9057 lnet: fix static analysis issues
Project: fs/lustre-release
Branch: multi-rail
Current Patch Set:
Commit: 04059b252187383960130f03ed5b17fa97106e74

Comment by Gerrit Updater [ 07/Feb/17 ]

Amir Shehata (amir.shehata@intel.com) uploaded a new patch: https://review.whamcloud.com/25309
Subject: LU-9057 lnet: fix static analysis issues
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: dfb371ba5ff016e400af07c0429b98e3f5e09f1c

Comment by Gerrit Updater [ 03/Mar/17 ]

Amir Shehata (amir.shehata@intel.com) uploaded a new patch: https://review.whamcloud.com/25765
Subject: LU-9057 lnet: fix static analysis issues
Project: fs/lustre-release
Branch: multi-rail
Current Patch Set: 1
Commit: 82f7c52ec3e782d6c4527ef60f275a15d530ecc1

Comment by Gerrit Updater [ 18/Apr/17 ]

Amir Shehata (amir.shehata@intel.com) uploaded a new patch: https://review.whamcloud.com/26687
Subject: LU-9057 lnet: fix static analysis issues
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1cc81d6b169aae1228624f53627a17a5ca1049e2

Comment by Gerrit Updater [ 01/May/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/26687/
Subject: LU-9057 lnet: fix static analysis issues
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: f4e3a8239c520606032aa38f7c114cd9600385f3

Comment by Joseph Gmitter (Inactive) [ 08/Jul/17 ]

Fix has landed to master for 2.10.0

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