public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Julian Anastasov <ja@ssi.bg>,
	"David S. Miller" <davem@davemloft.net>
Subject: [45/90] ipv4: fix the reusing of routing cache entries
Date: Fri, 12 Aug 2011 14:04:30 -0700	[thread overview]
Message-ID: <20110812210556.055971663@clark.kroah.org> (raw)
In-Reply-To: <20110812210626.GA4725@kroah.com>

3.0-stable review patch.  If anyone has any objections, please let us know.

------------------


From: Julian Anastasov <ja@ssi.bg>

[ Upstream commit d547f727df86059104af2234804fdd538e112015 ]

	compare_keys and ip_route_input_common rely on
rt_oif for distinguishing of input and output routes
with same keys values. But sometimes the input route has
also same hash chain (keyed by iif != 0) with the output
routes (keyed by orig_oif=0). Problem visible if running
with small number of rhash_entries.

	Fix them to use rt_route_iif instead. By this way
input route can not be returned to users that request
output route.

	The patch fixes the ip_rt_bug errors that were
reported in ip_local_out context, mostly for 255.255.255.255
destinations.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/ipv4/route.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -726,6 +726,7 @@ static inline int compare_keys(struct rt
 		((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) |
 		(rt1->rt_mark ^ rt2->rt_mark) |
 		(rt1->rt_key_tos ^ rt2->rt_key_tos) |
+		(rt1->rt_route_iif ^ rt2->rt_route_iif) |
 		(rt1->rt_oif ^ rt2->rt_oif) |
 		(rt1->rt_iif ^ rt2->rt_iif)) == 0;
 }
@@ -2282,8 +2283,8 @@ int ip_route_input_common(struct sk_buff
 		if ((((__force u32)rth->rt_key_dst ^ (__force u32)daddr) |
 		     ((__force u32)rth->rt_key_src ^ (__force u32)saddr) |
 		     (rth->rt_iif ^ iif) |
-		     rth->rt_oif |
 		     (rth->rt_key_tos ^ tos)) == 0 &&
+		    rt_is_input_route(rth) &&
 		    rth->rt_mark == skb->mark &&
 		    net_eq(dev_net(rth->dst.dev), net) &&
 		    !rt_is_expired(rth)) {



  parent reply	other threads:[~2011-08-14 16:08 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12 21:06 [00/90] 3.0.2-stable review Greg KH
2011-08-12 21:03 ` [01/90] cris: fix a build error in kernel/fork.c Greg KH
2011-08-12 21:03 ` [02/90] cris: fix a build error in sync_serial_open() Greg KH
2011-08-12 21:03 ` [03/90] cris: fix the prototype of sync_serial_ioctl() Greg KH
2011-08-12 21:03 ` [04/90] cris: add missing declaration of kgdb_init() and breakpoint() Greg KH
2011-08-12 21:03 ` [05/90] futex: Fix regression with read only mappings Greg KH
2011-08-12 21:03 ` [06/90] [PARISC] wire up sendmmsg syscall Greg KH
2011-08-12 21:03 ` [07/90] [PARISC] Fix futex support Greg KH
2011-08-12 21:03 ` [08/90] [PARISC] fix return type of __atomic64_add_return Greg KH
2011-08-12 21:03 ` [09/90] rt2x00: rt2800: fix zeroing skb structure Greg KH
2011-08-12 21:03 ` [10/90] rt2x00: fix usage of NULL queue Greg KH
2011-08-12 21:03 ` [11/90] rtlwifi: Fix kernel oops on ARM SOC Greg KH
2011-08-12 21:03 ` [12/90] iwlegacy: set tx power after rxon_assoc Greg KH
2011-08-12 21:03 ` [13/90] ath9k: initialize tx chainmask before testing channel tx power values Greg KH
2011-08-12 21:03 ` [14/90] ath9k: skip ->config_pci_powersave() if PCIe port has ASPM disabled Greg KH
2011-08-12 21:04 ` [15/90] net: sendmmsg should only return an error if no messages were sent Greg KH
2011-08-12 21:04 ` [16/90] net: Cap number of elements for sendmmsg Greg KH
2011-08-12 21:04 ` [17/90] net: Fix security_socket_sendmsg() bypass problem Greg KH
2011-08-12 21:04 ` [18/90] xen: allow enable use of VGA console on dom0 Greg KH
2011-08-12 21:04 ` [19/90] drm: Separate EDID Header Check from EDID Block Check Greg KH
2011-08-12 21:04 ` [20/90] drm/radeon: Extended DDC Probing for Connectors with Improperly Wired DDC Lines (here: Asus M2A-VM HDMI) Greg KH
2011-08-12 21:04 ` [21/90] drm/radeon: Extended DDC Probing for ECS A740GM-M DVI-D Connector Greg KH
2011-08-12 21:04 ` [22/90] drm/radeon: Log Subsystem Vendor and Device Information Greg KH
2011-08-12 21:04 ` [23/90] drm/i915/pch: Fix integer math bugs in panel fitting Greg KH
2011-08-12 21:04 ` [24/90] drm/i915: load the LUT before pipe enable on ILK+ Greg KH
2011-08-12 21:04 ` [25/90] drm/i915: Fix typo in DRM_I915_OVERLAY_PUT_IMAGE ioctl define Greg KH
2011-08-12 21:04 ` [26/90] drm/i915: Initialize RCS ring status page address in intel_render_ring_init_dri Greg KH
2011-08-12 21:04 ` [27/90] drm/i915: Hold mode_config->mutex during hotplug processing Greg KH
2011-08-12 21:04 ` [28/90] drm/i915: Fixup for Hold mode_config->mutex during hotplug Greg KH
2011-08-12 21:04 ` [29/90] crypto: Move md5_transform to lib/md5.c Greg KH
2011-08-12 21:04 ` [30/90] net: Compute protocol sequence numbers and fragment IDs using MD5 Greg KH
2011-08-12 21:04 ` [31/90] asus-wmi: fix hwmon/pwm1 Greg KH
2011-08-12 21:04 ` [32/90] asus-wmi: return proper value in store_cpufv() Greg KH
2011-08-12 21:04 ` [33/90] CIFS: Fix missing a decrement of inFlight value Greg KH
2011-08-12 21:04 ` [34/90] cifs: cope with negative dentries in cifs_get_root Greg KH
2011-08-12 21:04 ` [35/90] cifs: convert prefixpath delimiters in Greg KH
2011-08-12 21:04 ` [36/90] ASoC: sgtl5000: fix cache handling Greg KH
2011-08-12 21:04 ` [37/90] ALSA: timer - Fix Oops at closing slave timer Greg KH
2011-08-12 21:04 ` [38/90] ALSA: snd-usb-caiaq: Fix keymap for RigKontrol3 Greg KH
2011-08-12 21:04 ` [39/90] ALSA: snd-usb: avoid dividing by zero on invalid input Greg KH
2011-08-12 21:04 ` [40/90] ALSA: snd-usb: operate on given mixer interface only Greg KH
2011-08-12 21:04 ` [41/90] ALSA: snd-usb: Accept UAC2 FORMAT_TYPE descriptors with Greg KH
2011-08-12 21:04 ` [42/90] ipv6: make fragment identifications less predictable Greg KH
2011-08-12 21:04 ` [43/90] icmp: Fix regression in nexthop resolution during replies Greg KH
2011-08-12 21:04 ` [44/90] ipv4: Constrain UFO fragment sizes to multiples of 8 bytes Greg KH
2011-08-12 21:04 ` Greg KH [this message]
2011-08-12 21:04 ` [46/90] IPVS: Free resources on module removal Greg KH
2011-08-12 21:04 ` [47/90] net: adjust array index Greg KH
2011-08-12 21:04 ` [48/90] drivers/net/niu.c: " Greg KH
2011-08-12 21:04 ` [49/90] sch_sfq: fix sfq_enqueue() Greg KH
2011-08-12 21:04 ` [50/90] IPv4: Send gratuitous ARP for secondary IP addresses also Greg KH
2011-08-12 21:04 ` [51/90] net: add IFF_SKB_TX_SHARED flag to priv_flags Greg KH
2011-08-12 21:04 ` [52/90] net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared Greg KH
2011-08-12 21:04 ` [53/90] bonding: fix string comparison errors Greg KH
2011-08-12 21:04 ` [54/90] Fix cdc-phonet build Greg KH
2011-08-12 21:04 ` [55/90] xfrm: Fix key lengths for rfc3686(ctr(aes)) Greg KH
2011-08-12 21:04 ` [56/90] sis190: Rx filter init is needed for MAC address change Greg KH
2011-08-12 21:04 ` [57/90] r8169: Add support for D-Link 530T rev C1 (Kernel Bug 38862) Greg KH
2011-08-12 21:04 ` [58/90] net: allow netif_carrier to be called safely from IRQ Greg KH
2011-08-12 21:04 ` [59/90] ipv4: use RT_TOS after some rt_tos conversions Greg KH
2011-08-12 21:04 ` [60/90] gre: fix improper error handling Greg KH
2011-08-12 21:04 ` [61/90] iwlagn: 5000 do not support idle mode Greg KH
2011-08-12 21:04 ` [62/90] [SCSI] mpt2sas: Fixed Big Indian Issues on 32 bit PPC Greg KH
2011-08-12 21:04 ` [63/90] sparc: Dont leave sparc_pmu_type NULL on sun4v Greg KH
2011-08-12 21:04 ` [64/90] sparc: Add T3 sun4v cpu type and hypervisor group defines Greg KH
2011-08-12 21:04 ` [65/90] sparc: Dont do expensive hypervisor PCR write unless necessary Greg KH
2011-08-12 21:04 ` [66/90] sparc: Detect and handle UltraSPARC-T3 cpu types Greg KH
2011-08-12 21:04 ` [67/90] sparc: Sanitize cpu feature detection and reporting Greg KH
2011-08-12 21:04 ` [68/90] sparc: Minor tweaks to Niagara page copy/clear Greg KH
2011-08-12 21:04 ` [69/90] sparc: Use popc if possible for hweight routines Greg KH
2011-08-12 21:04 ` [70/90] sparc: Use hweight64() in popc emulation Greg KH
2011-08-12 21:04 ` [71/90] sparc: Add some missing hypervisor API groups Greg KH
2011-08-12 21:04 ` [72/90] sparc: Set reboot-cmd using reboot data hypervisor call if available Greg KH
2011-08-12 21:04 ` [73/90] sparc: Use popc when possible for ffs/__ffs/ffz Greg KH
2011-08-12 21:04 ` [74/90] sparc: Access kernel TSB using physical addressing when possible Greg KH
2011-08-12 21:05 ` [75/90] sparc: Size mondo queues more sanely Greg KH
2011-08-12 21:05 ` [76/90] sparc: Fix build with DEBUG_PAGEALLOC enabled Greg KH
2011-08-12 21:05 ` [77/90] Ecryptfs: Add mount option to check uid of device being Greg KH
2011-08-12 21:05 ` [78/90] eCryptfs: Return error when lower file pointer is NULL Greg KH
2011-08-12 21:05 ` [79/90] powerpc/pseries: Fix kexec on recent firmware versions Greg KH
2011-08-12 21:05 ` [80/90] powerpc: Fix device tree claim code Greg KH
2011-08-12 21:05 ` [81/90] powerpc: pseries: Fix kexec on machines with more than 4TB of RAM Greg KH
2011-08-12 21:05 ` [82/90] ext3: Properly count journal credits for long symlinks Greg KH
2011-08-12 21:05 ` [83/90] ext4: " Greg KH
2011-08-12 21:05 ` [84/90] e1000e: alternate MAC address does not work on device id 0x1060 Greg KH
2011-08-12 21:05 ` [85/90] gianfar: fix fiper alignment after resetting the time Greg KH
2011-08-12 21:05 ` [86/90] dp83640: increase receive time stamp buffer size Greg KH
2011-08-12 21:05 ` [87/90] ath9k_hw: Fix incorrect Tx control power in AR9003 template Greg KH
2011-08-12 21:05 ` [88/90] ath9k: fix a misprint which leads to incorrect calibration Greg KH
2011-08-12 21:05 ` [89/90] sparc: Dont do hypervisor calls on non-sun4v in DS driver Greg KH
2011-08-12 21:05 ` [90/90] mm: Fix fixup_user_fault() for MMU=n Greg KH
2011-08-14 10:31 ` [00/90] 3.0.2-stable review Jiri Slaby
2011-08-14 16:18   ` Greg KH
2011-08-15 20:56     ` Dave Jones
2011-08-16  1:24       ` Greg KH
2011-08-16 17:46 ` Arnaud Lacombe
2011-08-16 17:59   ` Greg KH
2011-08-16 18:10     ` Linus Torvalds
2011-08-16 21:11       ` H. Peter Anvin

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=20110812210556.055971663@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davem@davemloft.net \
    --cc=ja@ssi.bg \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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