lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Jun 2014 23:43:44 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	eric.dumazet@...il.com
Cc:	dormando@...ia.net, netdev@...r.kernel.org,
	steffen.klassert@...unet.com
Subject: Re: [PATCH] ipv4: irq safe sk_dst_[re]set() and
 ipv4_sk_update_pmtu() fix

From: Eric Dumazet <eric.dumazet@...il.com>
Date: Mon, 30 Jun 2014 01:26:23 -0700

> From: Eric Dumazet <edumazet@...gle.com>
> 
> We have two different ways to handle changes to sk->sk_dst
> 
> First way (used by TCP) assumes socket lock is owned by caller, and use
> no extra lock : __sk_dst_set() & __sk_dst_reset()
> 
> Another way (used by UDP) uses sk_dst_lock because socket lock is not
> always taken. Note that sk_dst_lock is not softirq safe.
> 
> These ways are not inter changeable for a given socket type.
> 
> ipv4_sk_update_pmtu(), added in linux-3.8, added a race, as it used
> the socket lock as synchronization, but users might be UDP sockets.
> 
> Instead of converting sk_dst_lock to a softirq safe version, use xchg()
> as we did for sk_rx_dst in commit e47eb5dfb296b ("udp: ipv4: do not use
> sk_dst_lock from softirq context")
> 
> In a follow up patch, we probably can remove sk_dst_lock, as it is
> only used in IPv6.
> 
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Steffen Klassert <steffen.klassert@...unet.com>
> Fixes: 9cb3a50c5f63e ("ipv4: Invalidate the socket cached route on pmtu events if possible")

Applied, and queued up for -stable, thanks Eric.

That dst_check() sequence in ipv4_sk_update_pmtu() is superfluous if "!new",
in fact how can it trigger?

If new is true, we just got the route from ip_route_output_flow() and we
presume it to be ok.

If new is not true, we just did the odst->ops->check() and it returned
non-NULL.

Hmmm?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ