From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
"Eric W. Biederman" <ebiederm@xmission.com>,
Martin KaFai Lau <kafai@fb.com>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.2 17/54] ipv6: Dont call with rt6_uncached_list_flush_dev
Date: Fri, 23 Oct 2015 10:44:53 -0700 [thread overview]
Message-ID: <20151023174519.612645335@linuxfoundation.org> (raw)
In-Reply-To: <20151023174519.086915553@linuxfoundation.org>
4.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Eric W. Biederman" <ebiederm@xmission.com>
[ Upstream commit e332bc67cf5e5e5b71a1aec9750d0791aac65183 ]
As originally written rt6_uncached_list_flush_dev makes no sense when
called with dev == NULL as it attempts to flush all uncached routes
regardless of network namespace when dev == NULL. Which is simply
incorrect behavior.
Furthermore at the point rt6_ifdown is called with dev == NULL no more
network devices exist in the network namespace so even if the code in
rt6_uncached_list_flush_dev were to attempt something sensible it
would be meaningless.
Therefore remove support in rt6_uncached_list_flush_dev for handling
network devices where dev == NULL, and only call rt6_uncached_list_flush_dev
when rt6_ifdown is called with a network device.
Fixes: 8d0b94afdca8 ("ipv6: Keep track of DST_NOCACHE routes in case of iface down/unregister")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Reviewed-by: Martin KaFai Lau <kafai@fb.com>
Tested-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/route.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -139,6 +139,9 @@ static void rt6_uncached_list_flush_dev(
struct net_device *loopback_dev = net->loopback_dev;
int cpu;
+ if (dev == loopback_dev)
+ return;
+
for_each_possible_cpu(cpu) {
struct uncached_list *ul = per_cpu_ptr(&rt6_uncached_list, cpu);
struct rt6_info *rt;
@@ -148,14 +151,12 @@ static void rt6_uncached_list_flush_dev(
struct inet6_dev *rt_idev = rt->rt6i_idev;
struct net_device *rt_dev = rt->dst.dev;
- if (rt_idev && (rt_idev->dev == dev || !dev) &&
- rt_idev->dev != loopback_dev) {
+ if (rt_idev->dev == dev) {
rt->rt6i_idev = in6_dev_get(loopback_dev);
in6_dev_put(rt_idev);
}
- if (rt_dev && (rt_dev == dev || !dev) &&
- rt_dev != loopback_dev) {
+ if (rt_dev == dev) {
rt->dst.dev = loopback_dev;
dev_hold(rt->dst.dev);
dev_put(rt_dev);
@@ -2577,7 +2578,8 @@ void rt6_ifdown(struct net *net, struct
fib6_clean_all(net, fib6_ifdown, &adn);
icmp6_clean_all(fib6_ifdown, &adn);
- rt6_uncached_list_flush_dev(net, dev);
+ if (dev)
+ rt6_uncached_list_flush_dev(net, dev);
}
struct rt6_mtu_change_arg {
next prev parent reply other threads:[~2015-10-23 17:44 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-23 17:44 [PATCH 4.2 00/54] 4.2.5-stable review Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 01/54] net/ibm/emac: bump version numbers for correct work with ethtool Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 02/54] l2tp: protect tunnel->del_work by ref_count Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 03/54] af_unix: Convert the unix_sk macro to an inline function for type safety Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 04/54] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 05/54] net/unix: fix logic about sk_peek_offset Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 06/54] skbuff: Fix skb checksum flag on skb pull Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 07/54] skbuff: Fix skb checksum partial check Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 08/54] net: dsa: fix preparation of a port STP update Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 09/54] inet: fix races in reqsk_queue_hash_req() Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 10/54] net: add pfmemalloc check in sk_add_backlog() Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 11/54] ppp: dont override sk->sk_state in pppoe_flush_dev() Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 12/54] inet: fix race in reqsk_queue_unlink() Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 13/54] bpf: fix panic in SO_GET_FILTER with native ebpf programs Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 14/54] ovs: do not allocate memory from offline numa node Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 15/54] act_mirred: clear sender cpu before sending to tx Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 16/54] bpf: clear sender_cpu before xmit Greg Kroah-Hartman
2015-10-23 17:44 ` Greg Kroah-Hartman [this message]
2015-10-23 17:44 ` [PATCH 4.2 18/54] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 19/54] tipc: move fragment importance field to new header position Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 20/54] netlink: Trim skb to alloc size to avoid MSG_TRUNC Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 21/54] drm: Fix locking for sysfs dpms file Greg Kroah-Hartman
2015-10-23 17:44 ` [PATCH 4.2 22/54] crypto: sparc - initialize blkcipher.ivsize Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 24/54] crypto: ahash - ensure statesize is non-zero Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 25/54] memcg: convert threshold to bytes Greg Kroah-Hartman
2015-10-24 5:46 ` Ben Hutchings
2015-10-25 16:32 ` Michal Hocko
2015-10-27 10:31 ` Michal Hocko
2015-10-23 17:45 ` [PATCH 4.2 26/54] btrfs: check unsupported filters in balance arguments Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 27/54] btrfs: fix use after free iterating extrefs Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 28/54] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 29/54] ARM: ux500: simplify secondary CPU boot Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 30/54] nfsd/blocklayout: accept any minlength Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 31/54] mfd: max77843: Fix max77843_chg_init() return on error Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 32/54] i2c: rcar: enable RuntimePM before registering to the core Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 33/54] i2c: s3c2410: " Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 34/54] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 35/54] i2c: designware-platdrv: enable RuntimePM before registering to the core Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 36/54] workqueue: make sure delayed work run in local cpu Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 38/54] KVM: x86: fix SMI to halted VCPU Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 39/54] KVM: x86: fix RSM into 64-bit protected mode Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 40/54] drm/qxl: fix framebuffer dirty rectangle tracking Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 41/54] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Greg Kroah-Hartman
2015-10-24 6:12 ` Ben Hutchings
2015-10-23 17:45 ` [PATCH 4.2 42/54] drm/dp/mst: make mst i2c transfer code more robust Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 43/54] drm/radeon: attach tile property to mst connector Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 44/54] drm/radeon: add pm sysfs files late Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 45/54] drm/amdgpu: " Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 46/54] drm/amdgpu: fix num_crtc on CZ Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 49/54] dm thin: fix missing pool reference count decrement in pool_ctr error path Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 50/54] rbd: fix double free on rbd_dev->header_name Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 51/54] timekeeping: Increment clock_was_set_seq in timekeeping_init() Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 53/54] arm64: Fix THP protection change logic Greg Kroah-Hartman
2015-10-23 17:45 ` [PATCH 4.2 54/54] svcrdma: handle rdma read with a non-zero initial page offset Greg Kroah-Hartman
2015-10-23 21:54 ` [PATCH 4.2 00/54] 4.2.5-stable review Shuah Khan
2015-10-23 23:22 ` Greg Kroah-Hartman
2015-10-24 2:04 ` Guenter Roeck
2015-10-24 13:20 ` Greg Kroah-Hartman
[not found] ` <562ba038.8608b40a.39b42.ffffbb49@mx.google.com>
2015-10-24 15:18 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151023174519.612645335@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).