lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 21 Oct 2015 09:40:40 +0200
From:	Jiri Pirko <jiri@...nulli.us>
To:	sfeldma@...il.com
Cc:	netdev@...r.kernel.org, siva.mannem.lnx@...il.com,
	vivien.didelot@...oirfairelinux.com
Subject: Re: [PATCH net-next 2/3] switchdev: fix: pass correct obj size when
 deferring obj add

Tue, Oct 20, 2015 at 09:36:38PM CEST, sfeldma@...il.com wrote:
>From: Scott Feldman <sfeldma@...il.com>
>
>Fixes: 0bc05d585d ("switchdev: allow caller to explicitly request attr_set as deferred")

This "fixes" is wrong. Should be:
4d429c5ddc5128fccd3048059ae26bb39f0d8284
"switchdev: introduce possibility to defer obj_add/del"


>Signed-off-by: Scott Feldman <sfeldma@...il.com>
>---
> net/switchdev/switchdev.c |   19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
>diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>index 56d8479..be8ced1 100644
>--- a/net/switchdev/switchdev.c
>+++ b/net/switchdev/switchdev.c
>@@ -489,7 +489,24 @@ static void switchdev_port_obj_del_deferred(struct net_device *dev,
> static int switchdev_port_obj_del_defer(struct net_device *dev,
> 					const struct switchdev_obj *obj)
> {
>-	return switchdev_deferred_enqueue(dev, obj, sizeof(*obj),
>+	size_t size = 0;
>+
>+	switch (obj->id) {
>+	case SWITCHDEV_OBJ_ID_PORT_VLAN:
>+		size = sizeof(struct switchdev_obj_port_vlan);
>+		break;
>+	case SWITCHDEV_OBJ_ID_IPV4_FIB:
>+		size = sizeof(struct switchdev_obj_ipv4_fib);
>+		break;
>+	case SWITCHDEV_OBJ_ID_PORT_FDB:
>+		size = sizeof(struct switchdev_obj_port_fdb);
>+		break;
>+	default:
>+		WARN_ON(!size);
>+		return -EINVAL;
>+	}
>+
>+	return switchdev_deferred_enqueue(dev, obj, size,
> 					  switchdev_port_obj_del_deferred);

we need this for add as well. Perhaps some generic helper to get size of
obj?


> }
> 
>-- 
>1.7.10.4
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ