diff mbox series

[ipsec-next,v1] xfrm: delete not-needed clear to zero of encap_oa

Message ID 1cd4aeb4a84ecb26171dbb90dc8300a0d71e0921.1686046811.git.leon@kernel.org (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [ipsec-next,v1] xfrm: delete not-needed clear to zero of encap_oa | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Leon Romanovsky June 6, 2023, 10:23 a.m. UTC
From: Leon Romanovsky <leonro@nvidia.com>

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.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
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(-)

Comments

Simon Horman June 6, 2023, 2:43 p.m. UTC | #1
On Tue, Jun 06, 2023 at 01:23:06PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> 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.
> 
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Steffen Klassert June 12, 2023, 11:48 a.m. UTC | #2
On Tue, Jun 06, 2023 at 01:23:06PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> 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.
> 
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

Applied, thanks Leon!
diff mbox series

Patch

diff --git a/net/key/af_key.c b/net/key/af_key.c
index 31ab12fd720a..14e891ebde61 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -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);