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)
diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
index d663da6..5b9218b 100644
--- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
@@ -6302,6 +6302,10 @@
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);