msm: ipa: Null terminated interface name string argument

received from ioctl

WAN MTU IOCTL received NULL terminated the interface name
string to prevent out of bound memory access while printing
interface name.

Change-Id: I4ca8021e91689f2b1bf0bef7917a5fc7c2168aef
Signed-off-by: Avinash Kumar <quic_avku@quicinc.com>
(cherry picked from commit b639c459e4f7eedc361cee795489de3d379e7e0c)
This commit is contained in:
Avinash Kumar 2023-09-11 12:17:20 +05:30
commit 75044ebe4b

View file

@ -4950,6 +4950,10 @@ int rmnet_ipa3_get_wan_mtu(
int rmnet_index;
mux_channel = rmnet_ipa3_ctx->mux_channel;
/* prevent string buffer overflows */
data->if_name[IPA_RESOURCE_NAME_MAX-1] = '\0';
rmnet_index =
find_vchannel_name_index(data->if_name);