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, Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.9 04/59] net-gro: reset skb->pkt_type in napi_reuse_skb()
Date: Wed, 21 Nov 2018 20:06:19 +0100	[thread overview]
Message-ID: <20181121183508.428748099@linuxfoundation.org> (raw)
In-Reply-To: <20181121183508.262873520@linuxfoundation.org>

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

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

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 33d9a2c72f086cbf1087b2fd2d1a15aa9df14a7f ]

eth_type_trans() assumes initial value for skb->pkt_type
is PACKET_HOST.

This is indeed the value right after a fresh skb allocation.

However, it is possible that GRO merged a packet with a different
value (like PACKET_OTHERHOST in case macvlan is used), so
we need to make sure napi->skb will have pkt_type set back to
PACKET_HOST.

Otherwise, valid packets might be dropped by the stack because
their pkt_type is not PACKET_HOST.

napi_reuse_skb() was added in commit 96e93eab2033 ("gro: Add
internal interfaces for VLAN"), but this bug always has
been there.

Fixes: 96e93eab2033 ("gro: Add internal interfaces for VLAN")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/dev.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4756,6 +4756,10 @@ static void napi_reuse_skb(struct napi_s
 	skb->vlan_tci = 0;
 	skb->dev = napi->dev;
 	skb->skb_iif = 0;
+
+	/* eth_type_trans() assumes pkt_type is PACKET_HOST */
+	skb->pkt_type = PACKET_HOST;
+
 	skb->encapsulation = 0;
 	skb_shinfo(skb)->gso_type = 0;
 	skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));



  parent reply	other threads:[~2018-11-21 19:10 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 19:06 [PATCH 4.9 00/59] 4.9.139-stable review Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 01/59] flow_dissector: do not dissect l4 ports for fragments Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 02/59] ibmvnic: fix accelerated VLAN handling Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 03/59] ip_tunnel: dont force DF when MTU is locked Greg Kroah-Hartman
2018-11-21 19:06 ` Greg Kroah-Hartman [this message]
2018-11-21 19:06 ` [PATCH 4.9 05/59] sctp: not allow to set asoc prsctp_enable by sockopt Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 06/59] tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 07/59] usbnet: smsc95xx: disable carrier check while suspending Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 08/59] inet: frags: better deal with smp races Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 09/59] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 10/59] kbuild: Add better clang cross build support Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 11/59] kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 12/59] kbuild: Consolidate header generation from ASM offset information Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 13/59] kbuild: consolidate redundant sed script ASM offset generation Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 14/59] kbuild: fix asm-offset generation to work with clang Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 15/59] kbuild: drop -Wno-unknown-warning-option from clang options Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 16/59] kbuild, LLVMLinux: Add -Werror to cc-option to support clang Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 17/59] kbuild: use -Oz instead of -Os when using clang Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 18/59] kbuild: Add support to generate LLVM assembly files Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 19/59] modules: mark __inittest/__exittest as __maybe_unused Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 20/59] x86/kbuild: Use cc-option to enable -falign-{jumps/loops} Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 21/59] crypto, x86: aesni - fix token pasting for clang Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 22/59] kbuild: Add __cc-option macro Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 23/59] x86/build: Use __cc-option for boot code compiler options Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 24/59] x86/build: Specify stack alignment for clang Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 25/59] kbuild: clang: Disable address-of-packed-member warning Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 26/59] crypto: arm64/sha - avoid non-standard inline asm tricks Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 27/59] x86/boot: #undef memcpy() et al in string.c Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 28/59] efi/libstub/arm64: Use hidden attribute for struct screen_info reference Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 29/59] efi/libstub/arm64: Force hidden visibility for section markers Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 30/59] efi/libstub: Preserve .debug sections after absolute relocation check Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 31/59] efi/libstub/arm64: Set -fpie when building the EFI stub Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 32/59] x86/build: Fix stack alignment for CLang Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 33/59] x86/build: Use cc-option to validate stack alignment parameter Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 34/59] Kbuild: use -fshort-wchar globally Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 35/59] arm64: uaccess: suppress spurious clang warning Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 36/59] ARM: add more CPU part numbers for Cortex and Brahma B15 CPUs Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 37/59] ARM: bugs: prepare processor bug infrastructure Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 38/59] ARM: bugs: hook processor bug checking into SMP and suspend paths Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 39/59] ARM: bugs: add support for per-processor bug checking Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 40/59] ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 41/59] ARM: spectre-v2: harden branch predictor on context switches Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 42/59] ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 43/59] ARM: spectre-v2: harden user aborts in kernel space Greg Kroah-Hartman
2018-11-21 19:06 ` [PATCH 4.9 44/59] ARM: spectre-v2: add firmware based hardening Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 45/59] ARM: spectre-v2: warn about incorrect context switching functions Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 46/59] ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17 Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 47/59] ARM: KVM: invalidate icache on guest exit for Cortex-A15 Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 48/59] ARM: spectre-v2: KVM: invalidate icache on guest exit for Brahma B15 Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 49/59] ARM: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 50/59] ARM: KVM: report support for SMCCC_ARCH_WORKAROUND_1 Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 51/59] ARM: spectre-v1: add speculation barrier (csdb) macros Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 52/59] ARM: spectre-v1: add array_index_mask_nospec() implementation Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 53/59] ARM: spectre-v1: fix syscall entry Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 54/59] ARM: signal: copy registers using __copy_from_user() Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 55/59] ARM: vfp: use __copy_from_user() when restoring VFP state Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 56/59] ARM: oabi-compat: copy semops using __copy_from_user() Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 57/59] ARM: use __inttype() in get_user() Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 58/59] ARM: spectre-v1: use get_user() for __get_user() Greg Kroah-Hartman
2018-11-21 19:07 ` [PATCH 4.9 59/59] ARM: spectre-v1: mitigate user accesses Greg Kroah-Hartman
2018-11-22  4:58 ` [PATCH 4.9 00/59] 4.9.139-stable review kernelci.org bot
2018-11-22 16:33 ` Guenter Roeck
2018-11-22 18:07   ` Murilo Fossa Vicentini
2018-11-22 19:49     ` Guenter Roeck
2018-11-22 20:16       ` Murilo Fossa Vicentini
2018-11-23  7:15       ` Greg Kroah-Hartman
2018-11-23  7:16 ` Naresh Kamboju
2018-11-23  7:28   ` Greg Kroah-Hartman
2018-11-23  9:57 ` Jon Hunter

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=20181121183508.428748099@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.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).