public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Cong Wang <amwang@redhat.com>,
	Pravin B Shelar <pshelar@nicira.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [ 07/79] gre: fix a regression in ioctl
Date: Fri, 26 Jul 2013 13:46:57 -0700	[thread overview]
Message-ID: <20130726204722.712616246@linuxfoundation.org> (raw)
In-Reply-To: <20130726204721.849052763@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

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

From: Cong Wang <amwang@redhat.com>

[ Upstream commit 6c734fb8592f6768170e48e7102cb2f0a1bb9759 ]

When testing GRE tunnel, I got:

 # ip tunnel show
 get tunnel gre0 failed: Invalid argument
 get tunnel gre1 failed: Invalid argument

This is a regression introduced by commit c54419321455631079c7d
("GRE: Refactor GRE tunneling code.") because previously we
only check the parameters for SIOCADDTUNNEL and SIOCCHGTUNNEL,
after that commit, the check is moved for all commands.

So, just check for SIOCADDTUNNEL and SIOCCHGTUNNEL.

After this patch I got:

 # ip tunnel show
 gre0: gre/ip  remote any  local any  ttl inherit  nopmtudisc
 gre1: gre/ip  remote 192.168.122.101  local 192.168.122.45  ttl inherit

Signed-off-by: Cong Wang <amwang@redhat.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/ip_gre.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -503,10 +503,11 @@ static int ipgre_tunnel_ioctl(struct net
 
 	if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p)))
 		return -EFAULT;
-	if (p.iph.version != 4 || p.iph.protocol != IPPROTO_GRE ||
-	    p.iph.ihl != 5 || (p.iph.frag_off&htons(~IP_DF)) ||
-	    ((p.i_flags|p.o_flags)&(GRE_VERSION|GRE_ROUTING))) {
-		return -EINVAL;
+	if (cmd == SIOCADDTUNNEL || cmd == SIOCCHGTUNNEL) {
+		if (p.iph.version != 4 || p.iph.protocol != IPPROTO_GRE ||
+		    p.iph.ihl != 5 || (p.iph.frag_off&htons(~IP_DF)) ||
+		    ((p.i_flags|p.o_flags)&(GRE_VERSION|GRE_ROUTING)))
+			return -EINVAL;
 	}
 	p.i_flags = gre_flags_to_tnl_flags(p.i_flags);
 	p.o_flags = gre_flags_to_tnl_flags(p.o_flags);



  parent reply	other threads:[~2013-07-26 21:43 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 20:46 [ 00/79] 3.10.4-stable review Greg Kroah-Hartman
2013-07-26 20:46 ` [ 01/79] writeback: Fix periodic writeback after fs mount Greg Kroah-Hartman
2013-07-26 20:46 ` [ 02/79] sparc32: vm_area_struct access for old Sun SPARCs Greg Kroah-Hartman
2013-07-27 15:39   ` Ben Hutchings
2013-07-26 20:46 ` [ 03/79] ipv6: only apply anti-spoofing checks to not-pointopoint tunnels Greg Kroah-Hartman
2013-07-26 20:46 ` [ 04/79] neighbour: fix a race in neigh_destroy() Greg Kroah-Hartman
2013-07-26 20:46 ` [ 05/79] x25: Fix broken locking in ioctl error paths Greg Kroah-Hartman
2013-07-26 20:46 ` [ 06/79] net: Swap ver and type in pppoe_hdr Greg Kroah-Hartman
2013-07-27 15:58   ` Ben Hutchings
2013-07-28  0:55     ` David Miller
2013-07-28  3:14       ` Ben Hutchings
2013-07-28  4:16         ` Greg KH
2013-07-28  4:39           ` David Miller
2013-07-28 18:29             ` Greg KH
2013-07-26 20:46 ` Greg Kroah-Hartman [this message]
2013-07-26 20:46 ` [ 08/79] vti: remove duplicated code to fix a memory leak Greg Kroah-Hartman
2013-07-26 20:46 ` [ 09/79] ipv6,mcast: always hold idev->lock before mca_lock Greg Kroah-Hartman
2013-07-26 20:47 ` [ 10/79] ip_tunnels: Use skb-len to PMTU check Greg Kroah-Hartman
2013-07-26 20:47 ` [ 11/79] l2tp: add missing .owner to struct pppox_proto Greg Kroah-Hartman
2013-07-26 20:47 ` [ 12/79] ipip: fix a regression in ioctl Greg Kroah-Hartman
2013-07-26 20:47 ` [ 13/79] ipv6: call udp_push_pending_frames when uncorking a socket with AF_INET pending data Greg Kroah-Hartman
2013-07-26 20:47 ` [ 14/79] ipv6: ip6_append_data_mtu did not care about pmtudisc and frag_size Greg Kroah-Hartman
2013-07-26 20:47 ` [ 15/79] ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available Greg Kroah-Hartman
2013-07-26 20:47 ` [ 16/79] sfc: Fix memory leak when discarding scattered packets Greg Kroah-Hartman
2013-07-26 20:47 ` [ 17/79] net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit Greg Kroah-Hartman
2013-07-26 20:47 ` [ 18/79] virtio: support unlocked queue poll Greg Kroah-Hartman
2013-07-26 20:47 ` [ 19/79] virtio_net: fix race in RX VQ processing Greg Kroah-Hartman
2013-07-26 20:47 ` [ 20/79] vhost-net: fix use-after-free in vhost_net_flush Greg Kroah-Hartman
2013-07-26 20:47 ` [ 21/79] sunvnet: vnet_port_remove must call unregister_netdev Greg Kroah-Hartman
2013-07-26 20:47 ` [ 22/79] ifb: fix rcu_sched self-detected stalls Greg Kroah-Hartman
2013-07-26 20:47 ` [ 23/79] tuntap: correctly linearize skb when zerocopy is used Greg Kroah-Hartman
2013-07-26 20:47 ` [ 24/79] macvtap: " Greg Kroah-Hartman
2013-07-26 20:47 ` [ 25/79] ipv6: in case of link failure remove route directly instead of letting it expire Greg Kroah-Hartman
2013-07-26 20:47 ` [ 26/79] 9p: fix off by one causing access violations and memory corruption Greg Kroah-Hartman
2013-07-26 20:47 ` [ 27/79] alx: fix lockdep annotation Greg Kroah-Hartman
2013-07-26 20:47 ` [ 28/79] ipv6: fix route selection if kernel is not compiled with CONFIG_IPV6_ROUTER_PREF Greg Kroah-Hartman
2013-07-26 20:47 ` [ 29/79] dummy: fix oops when loading the dummy failed Greg Kroah-Hartman
2013-07-26 20:47 ` [ 30/79] ifb: fix oops when loading the ifb failed Greg Kroah-Hartman
2013-07-26 20:47 ` [ 31/79] gre: Fix MTU sizing check for gretap tunnels Greg Kroah-Hartman
2013-07-26 20:47 ` [ 32/79] ipv6: only static routes qualify for equal cost multipathing Greg Kroah-Hartman
2013-07-26 20:47 ` [ 33/79] atl1e: fix dma mapping warnings Greg Kroah-Hartman
2013-07-26 20:47 ` [ 34/79] atl1e: unmap partially mapped skb on dma error and free skb Greg Kroah-Hartman
2013-07-26 20:47 ` [ 35/79] ipv4: set transport header earlier Greg Kroah-Hartman
2013-07-26 20:47 ` [ 36/79] be2net: Fix to avoid hardware workaround when not needed Greg Kroah-Hartman
2013-07-26 20:47 ` [ 37/79] hyperv: Fix the NETIF_F_SG flag setting in netvsc Greg Kroah-Hartman
2013-07-26 20:47 ` [ 38/79] pkt_sched: sch_qfq: remove a source of high packet delay/jitter Greg Kroah-Hartman
2013-07-26 20:47 ` [ 39/79] tuntap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS Greg Kroah-Hartman
2013-07-26 20:47 ` [ 40/79] macvtap: " Greg Kroah-Hartman
2013-07-26 20:47 ` [ 41/79] vlan: mask vlan prio bits Greg Kroah-Hartman
2013-07-26 20:47 ` [ 42/79] vlan: fix a race in egress prio management Greg Kroah-Hartman
2013-07-27 16:55   ` Ben Hutchings
2013-07-27 17:38     ` Eric Dumazet
2013-07-27 17:58       ` Ben Hutchings
2013-07-26 20:47 ` [ 43/79] MIPS: Oceton: Fix build error Greg Kroah-Hartman
2013-07-26 20:47 ` [ 44/79] RAPIDIO: IDT_GEN2: " Greg Kroah-Hartman
2013-07-26 20:47 ` [ 45/79] fuse: readdirplus: fix dentry leak Greg Kroah-Hartman
2013-07-26 20:47 ` [ 46/79] fuse: readdirplus: fix instantiate Greg Kroah-Hartman
2013-07-26 20:47 ` [ 47/79] fuse: readdirplus: sanity checks Greg Kroah-Hartman
2013-07-26 20:47 ` [ 48/79] bcache: Fix a dumb race Greg Kroah-Hartman
2013-07-26 20:47 ` [ 49/79] bcache: Advertise that flushes are supported Greg Kroah-Hartman
2013-07-26 20:47 ` [ 50/79] bcache: Shutdown fix Greg Kroah-Hartman
2013-07-26 20:47 ` [ 51/79] bcache: Fix a sysfs splat on shutdown Greg Kroah-Hartman
2013-07-26 20:47 ` [ 52/79] bcache: Fix GC_SECTORS_USED() calculation Greg Kroah-Hartman
2013-07-26 20:47 ` [ 53/79] bcache: Journal replay fix Greg Kroah-Hartman
2013-07-26 20:47 ` [ 54/79] EDAC: Fix lockdep splat Greg Kroah-Hartman
2013-07-26 20:47 ` [ 55/79] SCSI: mpt3sas: Infinite loops can occur if MPI2_IOCSTATUS_CONFIG_INVALID_PAGE is not returned Greg Kroah-Hartman
2013-07-26 20:47 ` [ 56/79] SCSI: mpt3sas: fix for kernel panic when driver loads with HBA conected to non LUN 0 configured expander Greg Kroah-Hartman
2013-07-26 20:47 ` [ 57/79] SCSI: megaraid_sas: fix memory leak if SGL has zero length entries Greg Kroah-Hartman
2013-07-26 20:47 ` [ 58/79] lib/Kconfig.debug: Restrict FRAME_POINTER for MIPS Greg Kroah-Hartman
2013-07-26 20:47 ` [ 59/79] usb: serial: option: blacklist ONDA MT689DC QMI interface Greg Kroah-Hartman
2013-07-26 20:47 ` [ 60/79] usb: option: add TP-LINK MA260 Greg Kroah-Hartman
2013-07-26 20:47 ` [ 61/79] usb: serial: option: add Olivetti Olicard 200 Greg Kroah-Hartman
2013-07-26 20:47 ` [ 62/79] usb: serial: option.c: remove ONDA MT825UP product ID fromdriver Greg Kroah-Hartman
2013-07-26 20:47 ` [ 63/79] USB: option: append Petatel NP10T device to GSM modems list Greg Kroah-Hartman
2013-07-26 20:47 ` [ 64/79] USB: option: add D-Link DWM-152/C1 and DWM-156/C1 Greg Kroah-Hartman
2013-07-26 20:47 ` [ 65/79] usb: serial: option: Add ONYX 3G device support Greg Kroah-Hartman
2013-07-26 20:47 ` [ 66/79] ARM: S3C24XX: Add missing clkdev entries for s3c2440 UART Greg Kroah-Hartman
2013-07-26 20:47 ` [ 67/79] ARM: footbridge: fix overlapping PCI mappings Greg Kroah-Hartman
2013-07-26 20:47 ` [ 68/79] usb: serial: cp210x: Add USB ID for Netgear Switches embedded serial adapter Greg Kroah-Hartman
2013-07-26 20:47 ` [ 69/79] USB: cp210x: add MMB and PI ZigBee USB Device Support Greg Kroah-Hartman
2013-07-26 20:48 ` [ 70/79] usb: cp210x support SEL C662 Vendor/Device Greg Kroah-Hartman
2013-07-26 20:48 ` [ 71/79] ext4: fix error handling in ext4_ext_truncate() Greg Kroah-Hartman
2013-07-27 21:33   ` Ben Hutchings
2013-07-28 11:40     ` Theodore Ts'o
2013-07-28 18:27       ` Greg Kroah-Hartman
2013-07-28 21:15       ` Ben Hutchings
2013-07-26 20:48 ` [ 72/79] PM / Sleep: avoid autosleep in shutdown progress Greg Kroah-Hartman
2013-07-26 20:48 ` [ 73/79] media: saa7134: Fix unlocked snd_pcm_stop() call Greg Kroah-Hartman
2013-07-26 20:48 ` [ 74/79] media: dmxdev: remove dvb_ringbuffer_flush() on writer side Greg Kroah-Hartman
2013-07-26 20:48 ` [ 75/79] lockd: protect nlm_blocked access in nlmsvc_retry_blocked Greg Kroah-Hartman
2013-07-26 20:48 ` [ 76/79] hrtimers: Move SMP function call to thread context Greg Kroah-Hartman
2013-07-26 20:48 ` [ 77/79] ALSA: hda - Remove NO_PRESENCE bit override for Dell 1420n Laptop Greg Kroah-Hartman
2013-07-26 20:48 ` [ 78/79] ALSA: usb-audio: 6fire: return correct XRUN indication Greg Kroah-Hartman
2013-07-26 20:48 ` [ 79/79] ALSA: hda - Fix EAPD GPIO control for Sigmatel codecs Greg Kroah-Hartman
2013-07-27  0:19 ` [ 00/79] 3.10.4-stable review Shuah Khan
2013-07-27  0:57   ` Greg Kroah-Hartman
2013-07-28  0:48 ` linux
2013-07-28 18:26   ` Greg Kroah-Hartman

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=20130726204722.712616246@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=amwang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --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