]> git.baikalelectronics.ru Git - kernel.git/commit
udpv6: fix possible user after free in error handler
authorPaolo Abeni <pabeni@redhat.com>
Thu, 21 Feb 2019 16:43:59 +0000 (17:43 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Feb 2019 00:05:11 +0000 (16:05 -0800)
commitdc6d13165094894290375d972d3f994ce4df48e5
tree346f6616db687c22ad228fb260b4e6e47053e9e3
parent3f3d44cbccb54c5cdcc60d85df8c5bf2a633dd4b
udpv6: fix possible user after free in error handler

Before derefencing the encap pointer, commit 51baa94611d1 ("udp: Support
for error handlers of tunnels with arbitrary destination port") checks
for a NULL value, but the two fetch operation can race with removal.
Fix the above using a single access.
Also fix a couple of type annotations, to make sparse happy.

Fixes: 51baa94611d1 ("udp: Support for error handlers of tunnels with arbitrary destination port")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/udp.c