From patchwork Mon Jun 5 08:11:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13267058 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A55E611CB0 for ; Mon, 5 Jun 2023 08:11:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C694AC433D2; Mon, 5 Jun 2023 08:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685952716; bh=4yhT8ATcjwYSiYGvqw870WXf5D97ke75n3XoIG+Bt3Q=; h=From:To:Cc:Subject:Date:From; b=NTXrKF87Ms85ThHMArS3ddBAfnpYoLIBlkioPq1FaUUHEbrk8RcIXpZISF99aeXtj mnRdUbjOe9hndpYSdqaz7xAE3dMtadyyf+8HtdU+yd46d1peDt1p6mwxz60K/j46Ca 8lqZOKfCdqggV0WYzrHltQGP8asCfbGEmBqZWkJK5l4VQzQX8G2w1NXmCvB2PqYjJD DBxoD6MeCBQgKgzRUTb994FwvbkPW/Cxw2M4bTvrRtO9VH3je6ZBtfn740daypu75f NGnZEAbZPCo4vddZ1yiBVuR562gwBqkEpQxt9rQi50bCSz/TAlzO0R2VaolUnFOhqk 1BMuaAT5xNE1Q== From: Leon Romanovsky To: Steffen Klassert Cc: Leon Romanovsky , "David S. Miller" , Eric Dumazet , Herbert Xu , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH ipsec-next] xfrm: delete not-needed clear to zero of encap_oa Date: Mon, 5 Jun 2023 11:11:51 +0300 Message-Id: <1ed3e00428a0036bdea14eb4f5a45706a89f11eb.1685952635.git.leon@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Leon Romanovsky 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 --- net/key/af_key.c | 1 - net/xfrm/xfrm_user.c | 1 - 2 files changed, 2 deletions(-) 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); diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index c34a2a06ca94..ec713db148f3 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1077,7 +1077,6 @@ static int copy_to_user_encap(struct xfrm_encap_tmpl *ep, struct sk_buff *skb) uep->encap_type = ep->encap_type; uep->encap_sport = ep->encap_sport; uep->encap_dport = ep->encap_dport; - uep->encap_oa = ep->encap_oa; return 0; }