[LU-9077] New static analysis issues in v2_9_52_0-66-gec839d4 Created: 03/Feb/17  Updated: 30/Aug/23  Resolved: 22/Aug/17

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

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

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

 Description   

Found 11 new static analysis issues in v2_9_52_0-66-gec839d4:

  1. Null pointer may be passed to function that may dereference it
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_numa_range, Null pointer 'global' that comes from line 2701 may be passed to function and can be dereferenced there by passing argument 2 to function 'add_to_global' at line 2738.
  2. Result of function that may return NULL will be dereferenced
    • lnet/lnet/lib-move.c: in lnet_select_pathway, Pointer 'peer_net' returned from call to function 'lnet_peer_get_net_locked' at line 1583 may be NULL and will be dereferenced at line 1585.
  3. Pointer may be passed to function that can dereference it after it was positively checked for NULL
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_discovery, Pointer 'global' checked for NULL at line 2777 may be passed to function and may be dereferenced there by passing argument 2 to function 'add_to_global' at line 2792.
  4. Suspicious dereference of pointer in function call before NULL check
    • lnet/lnet/peer.c: in lnet_discover_peer_locked, Suspicious dereference of pointer 'lp' by passing argument 1 to function 'lnet_peer_clear_discovery_error' at line 1924 before NULL check at line 1965
  5. Result of function that can return NULL may be dereferenced
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_ping_nid, Pointer 'token' returned from call to function 'strtok' at line 465 may be NULL and may be dereferenced at line 486. Also there is one similar error on line 493.
  6. Result of function that can return NULL may be dereferenced
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_ping_nid, Pointer 'ping' returned from call to function 'calloc' at line 450 may be NULL and may be dereferenced at line 528.
  7. Null pointer may be passed to function that may dereference it
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_discovery, Null pointer 'global' that comes from line 2755 may be passed to function and can be dereferenced there by passing argument 2 to function 'add_to_global' at line 2792.
  8. Null pointer may be passed to function that may dereference it
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_max_intf, Null pointer 'global' that comes from line 2647 may be passed to function and can be dereferenced there by passing argument 2 to function 'add_to_global' at line 2684.
  9. Pointer may be passed to function that can dereference it after it was positively checked for NULL
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_max_intf, Pointer 'global' checked for NULL at line 2669 may be passed to function and may be dereferenced there by passing argument 2 to function 'add_to_global' at line 2684.
  10. Null pointer may be passed to function that may dereference it
    • lnet/lnet/peer.c: in lnet_peer_set_primary_data, Null pointer 'lp->lp_data' that comes from line 2349 may be passed to function and can be dereferenced there by passing argument 1 to function 'lnet_ping_buffer_decref' at line 2353.
  11. Pointer may be passed to function that can dereference it after it was positively checked for NULL
    • lnet/utils/lnetconfig/liblnetconfig.c: in lustre_lnet_show_numa_range, Pointer 'global' checked for NULL at line 2723 may be passed to function and may be dereferenced there by passing argument 2 to function 'add_to_global' at line 2738.

The list of commits since the previous build v2_9_52_0-35-g2c789d9:

ec839d4 LU-7734 lnet: add "lnetctl ping" command
1dd4352 LU-7734 lnet: add "lnetctl peer list"
e5ecfde LU-7734 lnet: add "lctl discover"
957dc16 LU-7734 lnet: implement Peer Discovery
1573f73 LU-7734 lnet: add the Push target
9a425b8 LU-7734 lnet: tune lnet_peer_discovery_enabled with lnetctl
9c92b12 LU-7734 lnet: add discovery thread
7353a8f LU-7734 lnet: add msg_type to lnet_event
a92a89e LU-7734 lnet: reference counts on lnet_peer/lnet_peer_net
3d74bda LU-7734 lnet: add LNET_PEER_CONFIGURED flag
d1f76f3 LU-7734 lnet: preferred NIs for non-Multi-Rail peers
dfc9e7c LU-7734 lnet: introduce LNET_PEER_MULTI_RAIL flag bit
d382b0a LU-7734 lnet: refactor lnet_add_peer_ni()
af21bbe LU-7734 lnet: refactor lnet_del_peer_ni()
20cde84 LU-7734 lnet: rename lnet_add/del_peer_ni_to/from_peer()
ba6b133 LU-7734 lnet: cleanup of lnet_peer_ni_addref/decref_locked()
70d331f LU-7734 lnet: add sanity checks on ping-related constants
1933470 LU-7734 lnet: add LNET_PING_FEAT_MULTI_RAIL bit
1c8776f LU-7734 lnet: use 'struct lnet_hdr' in wirecheck
0bae7f1 LU-7734 lnet: use 'struct lnet_magicversion' in wirecheck
c723dcd LU-7734 lnet: remove "struct' from generated comment
d1dabda LU-7734 lnet: whitespace cleanup for wirecheck.c
70112f9 LU-7734 lnet: automatic sizing of router pinger buffers
cd2d11b LU-7734 lnet: add struct lnet_ping_buffer
f70c1b6 LU-7734 lnet: cleanup debug code
7f21043 LU-7734 lnet: configure lnet_max_interfaces tunable from dlc
838a77b LU-7734 lnet: add lnet_max_interfaces tunable
9a1bb73 LU-7734 lnet: rename LNET_MAX_INTERFACES
96b352f LU-7734 lnet: loopback NID in lnet_select_pathway()
bf1e5e2 LU-7734 socklnd: propagate errors on send failure
745b5a0 LU-7734 lnet: fix lnet shutdown race


 Comments   
Comment by Joseph Gmitter (Inactive) [ 03/Feb/17 ]

Hi Sonia,

Would you be able to look at these issues?

Thanks.
Joe

Comment by Gerrit Updater [ 08/Feb/17 ]

Sonia Sharma (sonia.sharma@intel.com) uploaded a new patch: https://review.whamcloud.com/25339
Subject: LU-9077 lnet: fix for static analysis issues
Project: fs/lustre-release
Branch: multi-rail
Current Patch Set: 1
Commit: 99041e2d49328796afc57571189f65d20850196c

Comment by Gerrit Updater [ 03/Mar/17 ]

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

Comment by Gerrit Updater [ 03/Mar/17 ]

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

Comment by Peter Jones [ 26/Apr/17 ]

If I understand correctly, this issue never affected master and so is not relevant for the 2.10 releae. Please reopen if I have misunderstood

Comment by Gerrit Updater [ 22/Aug/17 ]

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

Comment by Peter Jones [ 22/Aug/17 ]

This fix went in along with the Dynamic Discovery work (LU-9480)

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