All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: dsa: drop some VLAs in switch.c
@ 2018-03-13 19:50 Salvatore Mesoraca
  2018-03-13 19:58   ` Vivien Didelot
  0 siblings, 1 reply; 12+ messages in thread
From: Salvatore Mesoraca @ 2018-03-13 19:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-hardening, netdev, David S. Miller, Andrew Lunn,
	Florian Fainelli, Kees Cook, Salvatore Mesoraca, Vivien Didelot

dsa_switch's num_ports is currently fixed to DSA_MAX_PORTS. So we avoid
2 VLAs[1] by using DSA_MAX_PORTS instead of ds->num_ports.

[1] https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Salvatore Mesoraca <s.mesoraca16@gmail.com>
---
 net/dsa/switch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/dsa/switch.c b/net/dsa/switch.c
index b935117..78e9897 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -136,7 +136,7 @@ static int dsa_switch_mdb_add(struct dsa_switch *ds,
 {
 	const struct switchdev_obj_port_mdb *mdb = info->mdb;
 	struct switchdev_trans *trans = info->trans;
-	DECLARE_BITMAP(group, ds->num_ports);
+	DECLARE_BITMAP(group, DSA_MAX_PORTS);
 	int port;
 
 	/* Build a mask of Multicast group members */
@@ -204,7 +204,7 @@ static int dsa_switch_vlan_add(struct dsa_switch *ds,
 {
 	const struct switchdev_obj_port_vlan *vlan = info->vlan;
 	struct switchdev_trans *trans = info->trans;
-	DECLARE_BITMAP(members, ds->num_ports);
+	DECLARE_BITMAP(members, DSA_MAX_PORTS);
 	int port;
 
 	/* Build a mask of VLAN members */
-- 
1.9.1

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

end of thread, other threads:[~2018-05-05 18:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 19:50 [PATCH] net: dsa: drop some VLAs in switch.c Salvatore Mesoraca
2018-03-13 19:58 ` Vivien Didelot
2018-03-13 19:58   ` Vivien Didelot
2018-03-13 20:06   ` Florian Fainelli
2018-05-05 10:36     ` Salvatore Mesoraca
2018-05-05 15:39       ` Andrew Lunn
2018-05-05 18:22         ` Kees Cook
2018-05-05 18:51           ` Andrew Lunn
2018-03-13 22:01   ` Salvatore Mesoraca
2018-03-14 11:24     ` David Laight
2018-03-14 12:48       ` Salvatore Mesoraca
2018-03-18 14:08         ` Salvatore Mesoraca

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.