linux-kernel.vger.kernel.org archive mirror
 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,
	syzbot+f583ce3d4ddf9836b27a@syzkaller.appspotmail.com,
	William Tu <u9012063@gmail.com>,
	Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
	Cong Wang <cong.wang@bytedance.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.19 29/77] erspan: fix version 1 check in gre_parse_header()
Date: Mon, 11 Jan 2021 14:01:38 +0100	[thread overview]
Message-ID: <20210111130037.802035875@linuxfoundation.org> (raw)
In-Reply-To: <20210111130036.414620026@linuxfoundation.org>

From: Cong Wang <cong.wang@bytedance.com>

[ Upstream commit 085c7c4e1c0e50d90b7d90f61a12e12b317a91e2 ]

Both version 0 and version 1 use ETH_P_ERSPAN, but version 0 does not
have an erspan header. So the check in gre_parse_header() is wrong,
we have to distinguish version 1 from version 0.

We can just check the gre header length like is_erspan_type1().

Fixes: cb73ee40b1b3 ("net: ip_gre: use erspan key field for tunnel lookup")
Reported-by: syzbot+f583ce3d4ddf9836b27a@syzkaller.appspotmail.com
Cc: William Tu <u9012063@gmail.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/gre_demux.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv4/gre_demux.c
+++ b/net/ipv4/gre_demux.c
@@ -133,7 +133,7 @@ int gre_parse_header(struct sk_buff *skb
 	 * to 0 and sets the configured key in the
 	 * inner erspan header field
 	 */
-	if (greh->protocol == htons(ETH_P_ERSPAN) ||
+	if ((greh->protocol == htons(ETH_P_ERSPAN) && hdr_len != 4) ||
 	    greh->protocol == htons(ETH_P_ERSPAN2)) {
 		struct erspan_base_hdr *ershdr;
 



  parent reply	other threads:[~2021-01-11 13:10 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 13:01 [PATCH 4.19 00/77] 4.19.167-rc1 review Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 01/77] kbuild: dont hardcode depmod path Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 02/77] workqueue: Kick a worker based on the actual activation of delayed works Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 03/77] scsi: ufs: Fix wrong print message in dev_err() Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 04/77] scsi: ufs-pci: Ensure UFS device is in PowerDown mode for suspend-to-disk ->poweroff() Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 05/77] scsi: ide: Do not set the RQF_PREEMPT flag for sense requests Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 06/77] scsi: scsi_transport_spi: Set RQF_PM for domain validation commands Greg Kroah-Hartman
2021-01-13 11:47   ` Pavel Machek
2021-01-14  1:43     ` Bart Van Assche
2021-01-11 13:01 ` [PATCH 4.19 07/77] lib/genalloc: fix the overflow when size is too big Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 08/77] depmod: handle the case of /sbin/depmod without /sbin in PATH Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 09/77] proc: change ->nlink under proc_subdir_lock Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 10/77] proc: fix lookup in /proc/net subdirectories after setns(2) Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 11/77] i40e: Fix Error I40E_AQ_RC_EINVAL when removing VFs Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 12/77] net: mvpp2: Add TCAM entry to drop flow control pause frames Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 13/77] net: mvpp2: prs: fix PPPoE with ipv6 packet parse Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 14/77] ethernet: ucc_geth: fix use-after-free in ucc_geth_remove() Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 15/77] ethernet: ucc_geth: set dev->max_mtu to 1518 Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 16/77] atm: idt77252: call pci_disable_device() on error path Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 17/77] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 18/77] qede: fix offload for IPIP tunnel packets Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 19/77] virtio_net: Fix recursive call to cpus_read_lock() Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 20/77] net: dcb: Validate netlink message in DCB handler Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 21/77] net/ncsi: Use real net-device for response handler Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 22/77] net: ethernet: Fix memleak in ethoc_probe Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 23/77] net-sysfs: take the rtnl lock when storing xps_cpus Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 24/77] net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 25/77] net: ethernet: ti: cpts: fix ethtool output when no ptp_clock registered Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 26/77] tun: fix return value when the number of iovs exceeds MAX_SKB_FRAGS Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 27/77] ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst() Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 28/77] net: hns: fix return value check in __lb_other_process() Greg Kroah-Hartman
2021-01-11 13:01 ` Greg Kroah-Hartman [this message]
2021-01-11 13:01 ` [PATCH 4.19 30/77] net: hdlc_ppp: Fix issues when mod_timer is called while timer is running Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 31/77] CDC-NCM: remove "connected" log message Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 32/77] net: usb: qmi_wwan: add Quectel EM160R-GL Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 33/77] r8169: work around power-saving bug on some chip versions Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 34/77] vhost_net: fix ubuf refcount incorrectly when sendmsg fails Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 35/77] net: sched: prevent invalid Scell_log shift count Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 36/77] net-sysfs: take the rtnl lock when storing xps_rxqs Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 37/77] net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 38/77] net: systemport: set dev->max_mtu to UMAC_MAX_MTU_SIZE Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 39/77] Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 40/77] video: hyperv_fb: Fix the mmap() regression for v5.4.y and older Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 41/77] crypto: ecdh - avoid buffer overflow in ecdh_set_secret() Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 42/77] staging: mt7621-dma: Fix a resource leak in an error handling path Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 43/77] usb: gadget: enable super speed plus Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 44/77] USB: cdc-acm: blacklist another IR Droid device Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 45/77] USB: cdc-wdm: Fix use after free in service_outstanding_interrupt() Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 46/77] usb: dwc3: ulpi: Use VStsDone to detect PHY regs access completion Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 47/77] usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data() Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 48/77] USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 49/77] usb: usbip: vhci_hcd: protect shift size Greg Kroah-Hartman
2021-01-11 13:01 ` [PATCH 4.19 50/77] usb: uas: Add PNY USB Portable SSD to unusual_uas Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 51/77] USB: serial: iuu_phoenix: fix DMA from stack Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 52/77] USB: serial: option: add LongSung M5710 module support Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 53/77] USB: serial: option: add Quectel EM160R-GL Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 54/77] USB: yurex: fix control-URB timeout handling Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 55/77] USB: usblp: fix DMA to stack Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 56/77] ALSA: usb-audio: Fix UBSAN warnings for MIDI jacks Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 57/77] usb: gadget: select CONFIG_CRC32 Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 58/77] usb: gadget: f_uac2: reset wMaxPacketSize Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 59/77] usb: gadget: function: printer: Fix a memory leak for interface descriptor Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 60/77] usb: gadget: u_ether: Fix MTU size mismatch with RX packet size Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 61/77] USB: gadget: legacy: fix return error code in acm_ms_bind() Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 62/77] usb: gadget: Fix spinlock lockup on usb_function_deactivate Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 63/77] usb: gadget: configfs: Preserve function ordering after bind failure Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 64/77] usb: gadget: configfs: Fix use-after-free issue with udc_name Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 65/77] USB: serial: keyspan_pda: remove unused variable Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 66/77] x86/mm: Fix leak of pmd ptlock Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 67/77] ALSA: hda/via: Fix runtime PM for Clevo W35xSS Greg Kroah-Hartman
2021-01-13 11:49   ` Pavel Machek
2021-01-13 11:54     ` Takashi Iwai
2021-01-11 13:02 ` [PATCH 4.19 68/77] ALSA: hda/conexant: add a new hda codec CX11970 Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 69/77] ALSA: hda/realtek - Fix speaker volume control on Lenovo C940 Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 70/77] btrfs: send: fix wrong file path when there is an inode with a pending rmdir Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 71/77] Revert "device property: Keep secondary firmware node secondary by type" Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 72/77] xen/pvh: correctly setup the PV EFI interface for dom0 Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 73/77] netfilter: x_tables: Update remaining dereference to RCU Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 74/77] netfilter: ipset: fix shift-out-of-bounds in htable_bits() Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 75/77] netfilter: xt_RATEEST: reject non-null terminated string from userspace Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 76/77] x86/mtrr: Correct the range check before performing MTRR type lookups Greg Kroah-Hartman
2021-01-11 13:02 ` [PATCH 4.19 77/77] KVM: x86: fix shift out of bounds reported by UBSAN Greg Kroah-Hartman
2021-01-11 16:24 ` [PATCH 4.19 00/77] 4.19.167-rc1 review Pavel Machek
2021-01-12 19:09   ` Greg Kroah-Hartman
2021-01-11 21:53 ` Guenter Roeck
2021-01-11 23:39 ` Shuah Khan
2021-01-12  7:31 ` Naresh Kamboju

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=20210111130037.802035875@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=cong.wang@bytedance.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+f583ce3d4ddf9836b27a@syzkaller.appspotmail.com \
    --cc=u9012063@gmail.com \
    /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).