netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes
@ 2014-11-26 23:22 Thomas Graf
  2014-11-29 17:53 ` John Fastabend
  2014-11-30  4:49 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Graf @ 2014-11-26 23:22 UTC (permalink / raw)
  To: davem; +Cc: netdev, Scott Feldman

Fixes: 7f28fa10 ("bonding: add arp_ip_target netlink support")
Reported-by: John Fastabend <john.fastabend@gmail.com>
Cc: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
---
 drivers/net/bonding/bond_netlink.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index c13d83e..45f09a6 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -225,7 +225,12 @@ static int bond_changelink(struct net_device *bond_dev,
 
 		bond_option_arp_ip_targets_clear(bond);
 		nla_for_each_nested(attr, data[IFLA_BOND_ARP_IP_TARGET], rem) {
-			__be32 target = nla_get_be32(attr);
+			__be32 target;
+
+			if (nla_len(attr) < sizeof(target))
+				return -EINVAL;
+
+			target = nla_get_be32(attr);
 
 			bond_opt_initval(&newval, (__force u64)target);
 			err = __bond_opt_set(bond, BOND_OPT_ARP_TARGETS,
-- 
1.9.3

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

* Re: [PATCH net] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes
  2014-11-26 23:22 [PATCH net] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Thomas Graf
@ 2014-11-29 17:53 ` John Fastabend
  2014-11-30  4:49 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: John Fastabend @ 2014-11-29 17:53 UTC (permalink / raw)
  To: Thomas Graf; +Cc: davem, netdev, Scott Feldman

On 11/26/2014 03:22 PM, Thomas Graf wrote:
> Fixes: 7f28fa10 ("bonding: add arp_ip_target netlink support")
> Reported-by: John Fastabend <john.fastabend@gmail.com>
> Cc: Scott Feldman <sfeldma@cumulusnetworks.com>
> Signed-off-by: Thomas Graf <tgraf@suug.ch>
> ---
>   drivers/net/bonding/bond_netlink.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>

Looks good thanks! For what its worth...

Acked-by: John Fastabend <john.r.fastabend@intel.com>

> diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
> index c13d83e..45f09a6 100644
> --- a/drivers/net/bonding/bond_netlink.c
> +++ b/drivers/net/bonding/bond_netlink.c
> @@ -225,7 +225,12 @@ static int bond_changelink(struct net_device *bond_dev,
>
>   		bond_option_arp_ip_targets_clear(bond);
>   		nla_for_each_nested(attr, data[IFLA_BOND_ARP_IP_TARGET], rem) {
> -			__be32 target = nla_get_be32(attr);
> +			__be32 target;
> +
> +			if (nla_len(attr) < sizeof(target))
> +				return -EINVAL;
> +
> +			target = nla_get_be32(attr);
>
>   			bond_opt_initval(&newval, (__force u64)target);
>   			err = __bond_opt_set(bond, BOND_OPT_ARP_TARGETS,
>


-- 
John Fastabend         Intel Corporation

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

* Re: [PATCH net] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes
  2014-11-26 23:22 [PATCH net] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Thomas Graf
  2014-11-29 17:53 ` John Fastabend
@ 2014-11-30  4:49 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-11-30  4:49 UTC (permalink / raw)
  To: tgraf; +Cc: netdev, sfeldma

From: Thomas Graf <tgraf@suug.ch>
Date: Thu, 27 Nov 2014 00:22:33 +0100

> Fixes: 7f28fa10 ("bonding: add arp_ip_target netlink support")
> Reported-by: John Fastabend <john.fastabend@gmail.com>
> Cc: Scott Feldman <sfeldma@cumulusnetworks.com>
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Applied, and queued up for -stable, thanks.

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

end of thread, other threads:[~2014-11-30  4:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-26 23:22 [PATCH net] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Thomas Graf
2014-11-29 17:53 ` John Fastabend
2014-11-30  4:49 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).