From: Greg Kroah-Hartman Date: Wed, 7 Feb 2018 23:18:11 +0000 (-0600) Subject: 3.18-stable patches X-Git-Tag: v4.15.3~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=553daf7b171d87d66244f67c8a9e6dc22a1591e3;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: ipv4-map-neigh-lookup-keys-in-__ipv4_neigh_lookup_noref.patch --- diff --git a/queue-3.18/ipv4-map-neigh-lookup-keys-in-__ipv4_neigh_lookup_noref.patch b/queue-3.18/ipv4-map-neigh-lookup-keys-in-__ipv4_neigh_lookup_noref.patch new file mode 100644 index 00000000000..21a02545352 --- /dev/null +++ b/queue-3.18/ipv4-map-neigh-lookup-keys-in-__ipv4_neigh_lookup_noref.patch @@ -0,0 +1,47 @@ +From wanghan1995315@gmail.com Wed Feb 7 17:17:43 2018 +From: Wang Han +Date: Fri, 2 Feb 2018 23:06:51 +0800 +Subject: ipv4: Map neigh lookup keys in __ipv4_neigh_lookup_noref() +To: stable@vger.kernel.org +Message-ID: <20180202224114.00002fd9@gmail.com> + +From: Wang Han + +Commit 6c16fa957e84 is an incorrect backport as we map the keys in +struct __ipv4_neigh_lookup(), but the correct place to add the +code is struct __ipv4_neigh_lookup_noref(), compared to upstream. + +Fix it by moving the code, or fewer cases will be covered as +__ipv4_neigh_lookup_noref() will be called unconditionally from +__ipv4_neigh_lookup(), and it can be called from other places +such as ip_output.c. + +Fixes: 6c16fa957e84 (ipv4: Make neigh lookup keys for loopback/point-to-point devices be INADDR_ANY) +Signed-off-by: Wang Han +Signed-off-by: Greg Kroah-Hartman +--- + include/net/arp.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/include/net/arp.h ++++ b/include/net/arp.h +@@ -22,6 +22,9 @@ static inline struct neighbour *__ipv4_n + struct neighbour *n; + u32 hash_val; + ++ if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) ++ key = INADDR_ANY; ++ + hash_val = arp_hashfn(key, dev, nht->hash_rnd[0]) >> (32 - nht->hash_shift); + for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); + n != NULL; +@@ -37,9 +40,6 @@ static inline struct neighbour *__ipv4_n + { + struct neighbour *n; + +- if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) +- key = INADDR_ANY; +- + rcu_read_lock_bh(); + n = __ipv4_neigh_lookup_noref(dev, key); + if (n && !atomic_inc_not_zero(&n->refcnt)) diff --git a/queue-3.18/series b/queue-3.18/series index f1f75bca9d2..05033e53de2 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -7,3 +7,4 @@ tcp-release-sk_frag.page-in-tcp_disconnect.patch arm-exynos_defconfig-enable-options-to-mount-a-rootfs-via-nfs.patch arm-exynos_defconfig-enable-nfsv4-client.patch keys-encrypted-fix-buffer-overread-in-valid_master_desc.patch +ipv4-map-neigh-lookup-keys-in-__ipv4_neigh_lookup_noref.patch