Skip to contentSkip to conversation

geneve: fix an uninitialized value in geneve_changelink()

PATCH In review Cong Wang 3 participants 3 messages Jul 23, 2020

Subsystems (2)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 geneve: fix an uninitialized value in geneve_changelink()

geneve_nl2info() sets 'df' conditionally, so we have to initialize it by copying the value from existing geneve device in geneve_changelink().

Fixes 56c09de347e4 ("geneve: allow changing DF behavior after creation")
Reported-by [email protected]
Cc Sabrina Dubroca <[email protected]>
---
 drivers/net/geneve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/geneve.c +1 -1
index 4661ef865807..dec52b763d50 100644
@@ -1615,11 +1615,11 @@ static int geneve_changelink(struct net_device *dev, struct nlattr *tb[],
 			     struct netlink_ext_ack *extack)
 {
 	struct geneve_dev *geneve = netdev_priv(dev);
+	enum ifla_geneve_df df = geneve->df;
 	struct geneve_sock *gs4, *gs6;
 	struct ip_tunnel_info info;
 	bool metadata;
 	bool use_udp6_rx_checksums;
-	enum ifla_geneve_df df;
 	bool ttl_inherit;
 	int err;
 
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Cong Wang

geneve_nl2info() sets 'df' conditionally, so we have to initialize it by copying the value from existing geneve device in geneve_changelink().

Fixes 56c09de347e4 ("geneve: allow changing DF behavior after creation")
Reported-by [email protected]
Cc Sabrina Dubroca <[email protected]>

Ouch. Thanks for fixing this.

This should only be needed in net/stable. In net-next, I removed this in commit 9e06e8596bc8 (which will conflict with this patch).

Signature · 1 line
Sabrina
maintainer
#2 lore raw
In reply to Cong Wang

From: Cong Wang <[email protected]>
Date: Wed, 22 Jul 2020 18:56:25 -0700

Quoted 8 lines

geneve_nl2info() sets 'df' conditionally, so we have to initialize it by copying the value from existing geneve device in geneve_changelink().

Fixes 56c09de347e4 ("geneve: allow changing DF behavior after creation")
Reported-by [email protected]
Cc Sabrina Dubroca <[email protected]>

Applied and queued up for -stable, thanks Cong.