]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: Fix null pointer dereference when decoding sessions
authorSteffen Klassert <steffen.klassert@secunet.com>
Wed, 30 Oct 2013 10:16:28 +0000 (11:16 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 1 Nov 2013 06:08:46 +0000 (07:08 +0100)
commit67c23485374df03400ff04931661528e94c099dd
tree5c9ac913180be97c15453a4e79384f18fae50410
parent320e0a5ec416e0d51b719f14236cfae29f0aff9f
xfrm: Fix null pointer dereference when decoding sessions

On some codepaths the skb does not have a dst entry
when xfrm_decode_session() is called. So check for
a valid skb_dst() before dereferencing the device
interface index. We use 0 as the device index if
there is no valid skb_dst(), or at reverse decoding
we use skb_iif as device interface index.

Bug was introduced with git commit 704f410220
("xfrm: Decode sessions with output interface.").

Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/xfrm4_policy.c
net/ipv6/xfrm6_policy.c