From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tobias Jungel Subject: [PATCH v2] bonding: fix length of actor system Date: Sun, 28 Oct 2018 12:54:10 +0100 Message-ID: <9e78727aaee4a775dbe3a4a9942a733a14f8a608.camel@gmail.com> References: <386.1540680344@nyx> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Veaceslav Falico , Andy Gospodarek , Eric Dumazet , netdev@vger.kernel.org To: Jay Vosburgh Return-path: Received: from mail-wr1-f65.google.com ([209.85.221.65]:35072 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbeJ1Uik (ORCPT ); Sun, 28 Oct 2018 16:38:40 -0400 Received: by mail-wr1-f65.google.com with SMTP id w5-v6so5664336wrt.2 for ; Sun, 28 Oct 2018 04:54:14 -0700 (PDT) In-Reply-To: <386.1540680344@nyx> Sender: netdev-owner@vger.kernel.org List-ID: 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: f87fda00b6ed2 ("bonding: prevent out of bound accesses") Signed-off-by: Tobias Jungel --- Changes in v2: - correct Fixes line drivers/net/bonding/bond_netlink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c index 9697977b80f0..6b9ad8673218 100644 --- a/drivers/net/bonding/bond_netlink.c +++ b/drivers/net/bonding/bond_netlink.c @@ -638,8 +638,7 @@ static int bond_fill_info(struct sk_buff *skb, goto nla_put_failure; if (nla_put(skb, IFLA_BOND_AD_ACTOR_SYSTEM, - sizeof(bond->params.ad_actor_system), - &bond->params.ad_actor_system)) + ETH_ALEN, &bond->params.ad_actor_system)) goto nla_put_failure; } if (!bond_3ad_get_active_agg_info(bond, &info)) {