tipc: fix link name length check
Subsystems (3)
From: John Rutherford <[email protected]>
In commit 4f07b80c9733 ("tipc: check msg->req data len in tipc_nl_compat_bearer_disable") the same patch code was copied into
routines: tipc_nl_compat_bearer_disable(), tipc_nl_compat_link_stat_dump() and tipc_nl_compat_link_reset_stats(). The two link routine occurrences should have been modified to check the maximum link name length and not bearer name length.
--- net/tipc/netlink_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/tipc/netlink_compat.c +2 -2
@@ -550,7 +550,7 @@ static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg,if (len <=0 )return -EINVAL ; - len =min_t (int, len,TIPC_MAX_BEARER_NAME ); + len =min_t (int, len,TIPC_MAX_LINK_NAME );if (!string_is_valid (name, len))return -EINVAL ;
@@ -822,7 +822,7 @@ static int tipc_nl_compat_link_reset_stats(struct tipc_nl_compat_cmd_doit *cmd,if (len <=0 )return -EINVAL ; - len =min_t (int, len,TIPC_MAX_BEARER_NAME ); + len =min_t (int, len,TIPC_MAX_LINK_NAME );if (!string_is_valid (name, len))return -EINVAL ;
Signature · 1 line
2.11.0
From: [email protected]
Date: Tue, 26 Nov 2019 13:52:55 +1100
Quoted 9 lines
From: John Rutherford <[email protected]>
In commit
4f07b80c9733("tipc: checkmsg->reqdata len intipc_nl_compat_bearer_disable") the same patch code was copied into
routines:tipc_nl_compat_bearer_disable(),tipc_nl_compat_link_stat_dump()andtipc_nl_compat_link_reset_stats(). The two link routine occurrences should have been modified to check the maximum link name length and not bearer name length.
Quoted 3 lines
Fixes 4f07b80c9733 ("tipc: check msg->reg data len in tipc_nl_compat_bearer_disable")Signed-off-by John Rutherford <[email protected]>Acked-by Jon Maloy <[email protected]>
Applied.