]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfrm_user: return error pointer instead of NULL
authorMathias Krause <minipli@googlemail.com>
Thu, 13 Sep 2012 11:41:26 +0000 (11:41 +0000)
committerGuangyu Sun <guangyu.sun@oracle.com>
Wed, 17 Oct 2012 18:24:15 +0000 (11:24 -0700)
commit4df78ac9df186010becc4baff8e929fc931995ec
tree7b6611e132faff872665b26dd14c9668e8c18222
parent65ff6241463738b983360137953b7ece3593a462
xfrm_user: return error pointer instead of NULL

[ Upstream commit 864745d291b5ba80ea0bd0edcbe67273de368836 ]

When dump_one_state() returns an error, e.g. because of a too small
buffer to dump the whole xfrm state, xfrm_state_netlink() returns NULL
instead of an error pointer. But its callers expect an error pointer
and therefore continue to operate on a NULL skbuff.

This could lead to a privilege escalation (execution of user code in
kernel context) if the attacker has CAP_NET_ADMIN and is able to map
address 0.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
net/xfrm/xfrm_user.c