Whamcloud - gitweb
LU-17797 lnet: avoid use after free of lnet ifaces 75/54975/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 1 May 2024 04:39:26 +0000 (11:39 +0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 21 May 2024 18:46:44 +0000 (18:46 +0000)
commit2f20dc3f7614b583fe7f125f42a28ac47b76b36e
tree9ad404855b84c9bbbbcbe69cbd7c66fda56521b5
parent8616409ce9bc7237d36183ca3be3e0c41225a596
LU-17797 lnet: avoid use after free of lnet ifaces

Durning inet4 / inet6 enumeration the array of nids can be
reallocated for freed.

When the array is freed the originating reference should be
nulled to avoid a possible use after free.

CoverityID: 425360 ("USE_AFTER_FREE")

Test-Parameters: trivial
Fixes: ab6c8bd18 ("LU-16822 lnet: always initialize IPv6 at start up")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Ifd751e0c2f0095b33f8b2cd8dd58cfd8572c5ff4
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54975
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/lnet/lib-socket.c