]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ipv6: fix possible UAF in ip6_finish_output2()
authorEric Dumazet <edumazet@google.com>
Tue, 20 Aug 2024 16:08:58 +0000 (16:08 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 22 Aug 2024 00:35:49 +0000 (17:35 -0700)
commitda273b377ae0d9bd255281ed3c2adb228321687b
tree93eb1d8a41e18154d4ca37d010815fe762e98fe0
parentfaa389b2fbaaec7fd27a390b4896139f9da662e3
ipv6: fix possible UAF in ip6_finish_output2()

If skb_expand_head() returns NULL, skb has been freed
and associated dst/idev could also have been freed.

We need to hold rcu_read_lock() to make sure the dst and
associated idev are alive.

Fixes: 5796015fa968 ("ipv6: allocate enough headroom in ip6_finish_output2()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Vasily Averin <vasily.averin@linux.dev>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20240820160859.3786976-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/ip6_output.c