]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm_user: propagate sec ctx allocation errors
authorMathias Krause <minipli@googlemail.com>
Thu, 8 Sep 2016 16:09:57 +0000 (18:09 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 9 Sep 2016 07:02:08 +0000 (09:02 +0200)
commit820931cfbda3b3388d21bf8d3080553628c6232f
tree7602a1be11bed9830f738558048fd87b3aca0e4f
parent73ff61606b021f16028dbfb898f7a27867a15d7f
xfrm_user: propagate sec ctx allocation errors

When we fail to attach the security context in xfrm_state_construct()
we'll return 0 as error value which, in turn, will wrongly claim success
to userland when, in fact, we won't be adding / updating the XFRM state.

This is a regression introduced by commit 0d72aafa245d ("[XFRM] netlink:
Inline attach_encap_tmpl(), attach_sec_ctx(), and attach_one_addr()").

Fix it by propagating the error returned by security_xfrm_state_alloc()
in this case.

Fixes: 0d72aafa245d ("[XFRM] netlink: Inline attach_encap_tmpl()...")
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_user.c