Skip to contentSkip to conversation

xfrm: delete not-needed clear to zero of encap_oa

PATCH Applied Leon Romanovsky 3 participants 3 messages Jun 6, 2023 – Jun 12, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfrm: delete not-needed clear to zero of encap_oa

From: Leon Romanovsky <[email protected]>

After commit 2f4796518315 ("af_key: Fix heap information leak"), there is no need to clear encap_oa again as it is already initialized to zero.

---
Changelog:
v1:
* Restored "uep->encap_oa = ep->encap_oa;" hunk in copy_to_user_encap()
v0: https://lore.kernel.org/all/1ed3e00428a0036bdea14eb4f5a45706a89f11eb.1685952635.git.leon@kernel.org

---
 net/key/af_key.c | 1 -
 1 file changed, 1 deletion(-)
net/key/af_key.c +0 -1
index 31ab12fd720a..14e891ebde61 100644
@@ -1281,7 +1281,6 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
 				ext_hdrs[SADB_X_EXT_NAT_T_DPORT-1];
 			natt->encap_dport = n_port->sadb_x_nat_t_port_port;
 		}
-		memset(&natt->encap_oa, 0, sizeof(natt->encap_oa));
 	}
 
 	err = xfrm_init_state(x);
Signature · 1 line
2.40.1