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-next>] [day] [month] [year] [list]
Date:   Tue, 24 Oct 2017 12:42:57 +0200
From:   Paolo Abeni <pabeni@...hat.com>
To:     netdev@...r.kernel.org
Cc:     "David S. Miller" <davem@...emloft.net>,
        Wei Wang <weiwan@...gle.com>, Martin KaFai Lau <kafai@...com>,
        Hannes Frederic Sowa <hannes@...essinduktion.org>
Subject: [PATCH net-next] ipv6: update use count on dst_check()

Currently, the dst 'lastuse' field is not updated in a reliable way
for dst entries only accessed via socket cache.

This may fool the ipv6 dst gc, especially since we really age out unused
entries, either via the commit 1859bac04fb6 ("ipv6: remove from fib tree
aged out RTF_CACHE dst") or via the commit 1e2ea8ad37be ("ipv6: set
dst.obsolete when a cached route has expired").

Updating such field is now very cheap, thanks to commit 0da4af00b2ed
("ipv6: only update __use and lastusetime once per jiffy at most"),
so we can address the issue updating 'lastuse' in ip6_dst_check(),
if successful.

Fixes: 1859bac04fb6 ("ipv6: remove from fib tree aged out RTF_CACHE dst")
Fixes: 1e2ea8ad37be ("ipv6: set dst.obsolete when a cached route has expired")
Signed-off-by: Paolo Abeni <pabeni@...hat.com>
---
 net/ipv6/route.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 87a15cbd0e8b..8f8c7fb83b9b 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1952,6 +1952,7 @@ static struct dst_entry *rt6_check(struct rt6_info *rt, u32 cookie)
 	if (rt6_check_expired(rt))
 		return NULL;
 
+	dst_use_noref(&rt->dst, jiffies);
 	return &rt->dst;
 }
 
-- 
2.13.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ