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, Li Shuang <shuali@redhat.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Xin Long <lucien.xin@gmail.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	Florian Westphal <fw@strlen.de>,
	"Sasha Levin (Microsoft)" <sashal@kernel.org>
Subject: [PATCH 5.0 024/101] netfilter: bridge: set skb transport_header before entering NF_INET_PRE_ROUTING
Date: Thu,  2 May 2019 17:20:26 +0200	[thread overview]
Message-ID: <20190502143341.423182462@linuxfoundation.org> (raw)
In-Reply-To: <20190502143339.434882399@linuxfoundation.org>

[ Upstream commit e166e4fdaced850bee3d5ee12a5740258fb30587 ]

Since Commit 21d1196a35f5 ("ipv4: set transport header earlier"),
skb->transport_header has been always set before entering INET
netfilter. This patch is to set skb->transport_header for bridge
before entering INET netfilter by bridge-nf-call-iptables.

It also fixes an issue that sctp_error() couldn't compute a right
csum due to unset skb->transport_header.

Fixes: e6d8b64b34aa ("net: sctp: fix and consolidate SCTP checksumming code")
Reported-by: Li Shuang <shuali@redhat.com>
Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
---
 net/bridge/br_netfilter_hooks.c | 1 +
 net/bridge/br_netfilter_ipv6.c  | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
index 40d058378b52..fc605758323b 100644
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -502,6 +502,7 @@ static unsigned int br_nf_pre_routing(void *priv,
 	nf_bridge->ipv4_daddr = ip_hdr(skb)->daddr;
 
 	skb->protocol = htons(ETH_P_IP);
+	skb->transport_header = skb->network_header + ip_hdr(skb)->ihl * 4;
 
 	NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING, state->net, state->sk, skb,
 		skb->dev, NULL,
diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c
index 564710f88f93..e88d6641647b 100644
--- a/net/bridge/br_netfilter_ipv6.c
+++ b/net/bridge/br_netfilter_ipv6.c
@@ -235,6 +235,8 @@ unsigned int br_nf_pre_routing_ipv6(void *priv,
 	nf_bridge->ipv6_daddr = ipv6_hdr(skb)->daddr;
 
 	skb->protocol = htons(ETH_P_IPV6);
+	skb->transport_header = skb->network_header + sizeof(struct ipv6hdr);
+
 	NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING, state->net, state->sk, skb,
 		skb->dev, NULL,
 		br_nf_pre_routing_finish_ipv6);
-- 
2.19.1




  parent reply	other threads:[~2019-05-02 15:40 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 15:20 [PATCH 5.0 000/101] 5.0.12-stable review Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 001/101] selinux: use kernel linux/socket.h for genheaders and mdp Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 002/101] Revert "ACPICA: Clear status of GPEs before enabling them" Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 003/101] drm/i915: Do not enable FEC without DSC Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 004/101] mm: make page ref count overflow check tighter and more explicit Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 005/101] mm: add try_get_page() helper function Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 006/101] mm: prevent get_user_pages() from overflowing page refcount Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 007/101] fs: prevent page refcount overflow in pipe_buf_get Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 008/101] arm64: dts: renesas: r8a77990: Fix SCIF5 DMA channels Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 009/101] ARM: dts: bcm283x: Fix hdmi hpd gpio pull Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 010/101] s390: limit brk randomization to 32MB Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 011/101] mt76x02: fix hdr pointer in write txwi for USB Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 012/101] mt76: mt76x2: fix external LNA gain settings Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 013/101] mt76: mt76x2: fix 2.4 GHz channel " Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 014/101] net: ieee802154: fix a potential NULL pointer dereference Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 015/101] ieee802154: hwsim: propagate genlmsg_reply return code Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 016/101] Btrfs: fix file corruption after snapshotting due to mix of buffered/DIO writes Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 017/101] net: stmmac: dont set own bit too early for jumbo frames Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 018/101] net: stmmac: fix jumbo frame sending with non-linear skbs Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 019/101] qlcnic: Avoid potential NULL pointer dereference Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 020/101] xsk: fix umem memory leak on cleanup Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 021/101] staging: axis-fifo: add CONFIG_OF dependency Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 022/101] staging, mt7621-pci: fix build without pci support Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 023/101] netfilter: nft_set_rbtree: check for inactive element after flag mismatch Greg Kroah-Hartman
2019-05-02 15:20 ` Greg Kroah-Hartman [this message]
2019-05-02 15:20 ` [PATCH 5.0 025/101] netfilter: fix NETFILTER_XT_TARGET_TEE dependencies Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 026/101] netfilter: ip6t_srh: fix NULL pointer dereferences Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 027/101] s390/qeth: fix race when initializing the IP address table Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 028/101] ARM: imx51: fix a leaked reference by adding missing of_node_put Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 029/101] sc16is7xx: missing unregister/delete driver on error in sc16is7xx_init() Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 030/101] serial: ar933x_uart: Fix build failure with disabled console Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 031/101] KVM: arm64: Reset the PMU in preemptible context Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 032/101] arm64: KVM: Always set ICH_HCR_EL2.EN if GICv4 is enabled Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 033/101] KVM: arm/arm64: vgic-its: Take the srcu lock when writing to guest memory Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 034/101] KVM: arm/arm64: vgic-its: Take the srcu lock when parsing the memslots Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 035/101] usb: dwc3: pci: add support for Comet Lake PCH ID Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 036/101] usb: gadget: net2280: Fix overrun of OUT messages Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 037/101] usb: gadget: net2280: Fix net2280_dequeue() Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 038/101] usb: gadget: net2272: Fix net2272_dequeue() Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 039/101] ARM: dts: pfla02: increase phy reset duration Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 040/101] i2c: i801: Add support for Intel Comet Lake Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 041/101] KVM: arm/arm64: Fix handling of stage2 huge mappings Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 042/101] net: ks8851: Dequeue RX packets explicitly Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 043/101] net: ks8851: Reassert reset pin if chip ID check fails Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 044/101] net: ks8851: Delay requesting IRQ until opened Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 045/101] net: ks8851: Set initial carrier state to down Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 046/101] staging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 047/101] staging: rtlwifi: rtl8822b: fix to avoid potential NULL pointer dereference Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 048/101] staging: rtl8712: uninitialized memory in read_bbreg_hdl() Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 049/101] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 050/101] net: phy: Add DP83825I to the DP83822 driver Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 051/101] net: macb: Add null check for PCLK and HCLK Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 052/101] net/sched: dont dereference a->goto_chain to read the chain index Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 053/101] ARM: dts: imx6qdl: Fix typo in imx6qdl-icore-rqs.dtsi Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 054/101] drm/tegra: hub: Fix dereference before check Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 055/101] NFS: Fix a typo in nfs_init_timeout_values() Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 056/101] net: xilinx: fix possible object reference leak Greg Kroah-Hartman
2019-05-02 15:20 ` [PATCH 5.0 057/101] net: ibm: " Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 058/101] net: ethernet: ti: " Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 059/101] drm: Fix drm_release() and device unplug Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 060/101] gpio: aspeed: fix a potential NULL pointer dereference Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 061/101] drm/meson: Fix invalid pointer in meson_drv_unbind() Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 062/101] drm/meson: Uninstall IRQ handler Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 063/101] ARM: davinci: fix build failure with allnoconfig Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 064/101] sbitmap: order READ/WRITE freed instance and setting clear bit Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 065/101] staging: vc04_services: Fix an error code in vchiq_probe() Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 066/101] scsi: mpt3sas: Fix kernel panic during expander reset Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 067/101] scsi: aacraid: Insure we dont access PCIe space during AER/EEH Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 068/101] scsi: qla4xxx: fix a potential NULL pointer dereference Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 069/101] usb: usb251xb: fix to avoid " Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 070/101] leds: trigger: netdev: fix refcnt leak on interface rename Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 071/101] SUNRPC: fix uninitialized variable warning Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 072/101] x86/realmode: Dont leak the trampoline kernel address Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 073/101] usb: u132-hcd: fix resource leak Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 074/101] ceph: fix use-after-free on symlink traversal Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 075/101] scsi: zfcp: reduce flood of fcrscn1 trace records on multi-element RSCN Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 076/101] x86/mm: Dont exceed the valid physical address space Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 077/101] libata: fix using DMA buffers on stack Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 078/101] kbuild: skip parsing pre sub-make code for recursion Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 079/101] afs: Fix StoreData op marshalling Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 080/101] gpio: of: Check propname before applying "cs-gpios" quirks Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 081/101] gpio: of: Check for "spi-cs-high" in child instead of parent node Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 082/101] KVM: nVMX: Do not inherit quadrant and invalid for the root shadow EPT Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 083/101] KVM: SVM: Workaround errata#1096 (insn_len maybe zero on SMAP violation) Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 084/101] kvm/x86: Move MSR_IA32_ARCH_CAPABILITIES to array emulated_msrs Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 085/101] x86/kvm/hyper-v: avoid spurious pending stimer on vCPU init Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 086/101] KVM: selftests: assert on exit reason in CR4/cpuid sync test Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 087/101] KVM: selftests: explicitly disable PIE for tests Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 088/101] KVM: selftests: disable stack protector for all KVM tests Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 089/101] KVM: selftests: complete IO before migrating guest state Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 090/101] gpio: of: Fix of_gpiochip_add() error path Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 091/101] nvme-multipath: relax ANA state check Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 092/101] nvmet: fix building bvec from sg list Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 093/101] nvmet: fix error flow during ns enable Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 094/101] perf cs-etm: Add missing case value Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 095/101] perf machine: Update kernel map address and re-order properly Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 096/101] kconfig/[mn]conf: handle backspace (^H) key Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 097/101] iommu/amd: Reserve exclusion range in iova-domain Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 098/101] kasan: fix variable tag set but not used warning Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 099/101] ptrace: take into account saved_sigmask in PTRACE{GET,SET}SIGMASK Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 100/101] leds: pca9532: fix a potential NULL pointer dereference Greg Kroah-Hartman
2019-05-06  8:21   ` Geert Uytterhoeven
2019-05-06  8:34     ` Greg Kroah-Hartman
2019-05-02 15:21 ` [PATCH 5.0 101/101] leds: trigger: netdev: use memcpy in device_name_store Greg Kroah-Hartman
2019-05-02 19:46 ` [PATCH 5.0 000/101] 5.0.12-stable review kernelci.org bot
2019-05-03  6:49 ` Naresh Kamboju
2019-05-03  7:32   ` Greg Kroah-Hartman
2019-05-03  9:27 ` Jon Hunter
2019-05-04  6:47   ` Greg Kroah-Hartman
2019-05-03 17:16 ` Guenter Roeck
2019-05-04  6:47   ` Greg Kroah-Hartman
2019-05-03 21:19 ` shuah
2019-05-04  6:46   ` Greg Kroah-Hartman
2019-05-04  1:28 ` Kelsey Skunberg
2019-05-04  6:47   ` 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=20190502143341.423182462@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=fw@strlen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=nhorman@tuxdriver.com \
    --cc=pablo@netfilter.org \
    --cc=sashal@kernel.org \
    --cc=shuali@redhat.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;
as well as URLs for NNTP newsgroup(s).