提交 2f479651 编写于 作者: H Hyunwoo Kim 提交者: David S. Miller

af_key: Fix heap information leak

Since x->encap of pfkey_msg2xfrm_state() is not
initialized to 0, kernel heap data can be leaked.

Fix with kzalloc() to prevent this.
Signed-off-by: NHyunwoo Kim <v4bel@theori.io>
Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: NSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 20ab8432
...@@ -1261,7 +1261,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, ...@@ -1261,7 +1261,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
const struct sadb_x_nat_t_type* n_type; const struct sadb_x_nat_t_type* n_type;
struct xfrm_encap_tmpl *natt; struct xfrm_encap_tmpl *natt;
x->encap = kmalloc(sizeof(*x->encap), GFP_KERNEL); x->encap = kzalloc(sizeof(*x->encap), GFP_KERNEL);
if (!x->encap) { if (!x->encap) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册