Skip to content

Commit 8a86509

Browse files
toanjugregkh
authored andcommitted
bonding: fix length of actor system
[ Upstream commit 414dd6f ] The attribute IFLA_BOND_AD_ACTOR_SYSTEM is sent to user space having the length of sizeof(bond->params.ad_actor_system) which is 8 byte. This patch aligns the length to ETH_ALEN to have the same MAC address exposed as using sysfs. Fixes: f87fda0 ("bonding: prevent out of bound accesses") Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 95c3376 commit 8a86509

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/net/bonding/bond_netlink.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,7 @@ static int bond_fill_info(struct sk_buff *skb,
638638
goto nla_put_failure;
639639

640640
if (nla_put(skb, IFLA_BOND_AD_ACTOR_SYSTEM,
641-
sizeof(bond->params.ad_actor_system),
642-
&bond->params.ad_actor_system))
641+
ETH_ALEN, &bond->params.ad_actor_system))
643642
goto nla_put_failure;
644643
}
645644
if (!bond_3ad_get_active_agg_info(bond, &info)) {

0 commit comments

Comments
 (0)