All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bonding: fix length of actor system
@ 2018-10-27 13:31 Tobias Jungel
  2018-10-27 22:45 ` Jay Vosburgh
  0 siblings, 1 reply; 4+ messages in thread
From: Tobias Jungel @ 2018-10-27 13:31 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek; +Cc: Eric Dumazet, netdev

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

Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>
---
 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)) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] bonding: fix length of actor system
  2018-10-27 13:31 [PATCH] bonding: fix length of actor system Tobias Jungel
@ 2018-10-27 22:45 ` Jay Vosburgh
  2018-10-28 11:54   ` [PATCH v2] " Tobias Jungel
  0 siblings, 1 reply; 4+ messages in thread
From: Jay Vosburgh @ 2018-10-27 22:45 UTC (permalink / raw)
  To: Tobias Jungel; +Cc: Veaceslav Falico, Andy Gospodarek, Eric Dumazet, netdev

Tobias Jungel <tobias.jungel@gmail.com> wrote:

>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
>
>Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>

	The patch looks fine to me, but the "fixes" line is not
formatted properly.  Please format it according to

Documentation/process/submitting-patches.rst

	and resubmit your patch as V2.

	-J

>---
> 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)) {
>

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] bonding: fix length of actor system
  2018-10-27 22:45 ` Jay Vosburgh
@ 2018-10-28 11:54   ` Tobias Jungel
  2018-10-30  3:41     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Tobias Jungel @ 2018-10-28 11:54 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: Veaceslav Falico, Andy Gospodarek, Eric Dumazet, netdev

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 <tobias.jungel@gmail.com>
---
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)) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] bonding: fix length of actor system
  2018-10-28 11:54   ` [PATCH v2] " Tobias Jungel
@ 2018-10-30  3:41     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-10-30  3:41 UTC (permalink / raw)
  To: tobias.jungel; +Cc: jay.vosburgh, vfalico, andy, edumazet, netdev

From: Tobias Jungel <tobias.jungel@gmail.com>
Date: Sun, 28 Oct 2018 12:54:10 +0100

> 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")
> 

Please do not put empty lines between "Fixes:" and other tags, keep
all the tags together in one uninterrupted group.

> Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>

Applied and queued up for -stable, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-30 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-27 13:31 [PATCH] bonding: fix length of actor system Tobias Jungel
2018-10-27 22:45 ` Jay Vosburgh
2018-10-28 11:54   ` [PATCH v2] " Tobias Jungel
2018-10-30  3:41     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.