Thread (7 messages) 7 messages, 4 authors, 2020-07-29

Re: [Linux-kernel-mentees] [PATCH v2] net: ipv6: fix use-after-free Read in __xfrm6_tunnel_spi_lookup

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: 2020-07-27 09:50:48
Also in: lkml, netdev

On Sat, Jul 25, 2020 at 10:35:12PM -0700, Cong Wang wrote:
On Sat, Jul 25, 2020 at 8:09 PM B K Karthik [off-list ref] wrote:
quoted
@@ -103,10 +103,10 @@ static int __xfrm6_tunnel_spi_check(struct net *net, u32 spi)
 {
        struct xfrm6_tunnel_net *xfrm6_tn = xfrm6_tunnel_pernet(net);
        struct xfrm6_tunnel_spi *x6spi;
-       int index = xfrm6_tunnel_spi_hash_byspi(spi);
+       int index = xfrm6_tunnel_spi_hash_byaddr((const xfrm_address_t *)spi);

        hlist_for_each_entry(x6spi,
-                            &xfrm6_tn->spi_byspi[index],
+                            &xfrm6_tn->spi_byaddr[index],
                             list_byspi) {
                if (x6spi->spi == spi)
How did you convince yourself this is correct? This lookup is still
using spi. :)
This can not be correct, it takes a u32 spi value and casts it to a
pointer to an IP address.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help