Whamcloud - gitweb
LU-18769 lnet: lnetctl memory corruption because of buffer overflow 88/58288/4
authorManish Regmi <mregmi@ddn.com>
Mon, 3 Mar 2025 23:22:00 +0000 (15:22 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Mar 2025 23:31:26 +0000 (23:31 +0000)
commit5b195e87aca9705b0f49c90bc06763951ba93ef7
treed7ece77d80be9f3cd9c2a52cdb38efffe538b942
parent4a14a51a8e000e05e6a3c0dae7bf64b8d43f8254
LU-18769 lnet: lnetctl memory corruption because of buffer overflow

Sometimes the the user passed name is larger than the size of
lnet_dlc_intf_descr.intf_name. Add proper validation checks before
strncpy and strcpy so that the buffer does not overflow.

Test-Parameters: trivial
Signed-off-by: Manish Regmi <mregmi@ddn.com>
Change-Id: Ifa867cd60ded64fcefe0a6b948f34e9f542e6e04
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58288
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/utils/lnetconfig/liblnetconfig.c