We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.
Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function called with error return, it will
run into the fail case to free the q->fq.
Then the __blk_drain_queue() uses the same memory after the free
of the q->fq, it will lead to the unpredictable event.
The patch is to set q->fq as NULL in the fail case of
blk_init_allocated_queue().
Fixes: commit 7c94e1c157a2 ("block: introduce blk_flush_queue to drive flush machinery")
Signed-off-by: xiao jin <jin.xiao(a)intel.com>
Cc: Ming Lei <ming.lei(a)redhat.com>
Cc: Bart Van Assche <bart.vanassche(a)wdc.com>
Cc: <stable(a)vger.kernel.org>
---
block/blk-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/blk-core.c b/block/blk-core.c
index b888175..52635e2 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1072,6 +1072,7 @@ int blk_init_allocated_queue(struct request_queue *q)
q->exit_rq_fn(q, q->fq->flush_rq);
out_free_flush_queue:
blk_free_flush_queue(q->fq);
+ q->fq = NULL;
return -ENOMEM;
}
EXPORT_SYMBOL(blk_init_allocated_queue);
--
1.7.9.5
Greg,
building for corgi with gcc7 I notice this single warning:
/drivers/dma/pxa_dma.c:1324:34: warning: duplicate 'const' declaration
specifier [-Wduplicate-decl-specifier] static const struct
of_device_id const pxad_dt_ids[] ...
There was a wrong backport of one patch and pxa_dma was fixed by 4.4.90.
Unfortunately the patch "4e0def8 dmaengine: pxa_dma: remove duplicate
const qualifier" was forgotten.
Thanks
Andrea
This is the start of the stable review cycle for the 4.17.11 release.
There are 66 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun Jul 29 09:37:38 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.17.11-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.17.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.17.11-rc1
Roman Fietze <roman.fietze(a)telemotive.de>
can: m_can.c: fix setup of CCCR register: clear CCCR NISO bit before checking can.ctrlmode
Faiz Abbas <faiz_abbas(a)ti.com>
can: m_can: Fix runtime resume call
Stephane Grosjean <s.grosjean(a)peak-system.com>
can: peak_canfd: fix firmware < v3.3.0: limit allocation to 32-bit DMA addr only
Anssi Hannula <anssi.hannula(a)bitwise.fi>
can: xilinx_can: fix RX overflow interrupt not being enabled
Anssi Hannula <anssi.hannula(a)bitwise.fi>
can: xilinx_can: fix incorrect clear of non-processed interrupts
Anssi Hannula <anssi.hannula(a)bitwise.fi>
can: xilinx_can: keep only 1-2 frames in TX FIFO to fix TX accounting
Anssi Hannula <anssi.hannula(a)bitwise.fi>
can: xilinx_can: fix device dropping off bus on RX overrun
Anssi Hannula <anssi.hannula(a)bitwise.fi>
can: xilinx_can: fix recovery from error states not being propagated
Anssi Hannula <anssi.hannula(a)bitwise.fi>
can: xilinx_can: fix power management handling
Anssi Hannula <anssi.hannula(a)bitwise.fi>
can: xilinx_can: fix RX loop if RXNEMP is asserted without RXOK
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
driver core: Partially revert "driver core: correct device's shutdown order"
Schmauss, Erik <erik.schmauss(a)intel.com>
ACPICA: AML Parser: ignore dispatcher error status during table load
Jerry Zhang <zhangjerry(a)google.com>
usb: gadget: f_fs: Only return delayed status when len is 0
Benjamin Herrenschmidt <benh(a)kernel.crashing.org>
usb: gadget: Fix OS descriptors support
Zheng Xiaowei <zhengxiaowei(a)ruijie.com.cn>
usb: xhci: Fix memory leak in xhci_endpoint_reset()
Antti Seppälä <a.seppala(a)gmail.com>
usb: dwc2: Fix DMA alignment to start at allocated boundary
Bin Liu <b-liu(a)ti.com>
usb: core: handle hub C_PORT_OVER_CURRENT condition
Lubomir Rintel <lkundrak(a)v3.sk>
usb: cdc_acm: Add quirk for Castles VEGA3000
Samuel Thibault <samuel.thibault(a)ens-lyon.org>
staging: speakup: fix wraparound in uaccess length check
Hans de Goede <hdegoede(a)redhat.com>
Revert "staging:r8188eu: Use lib80211 to support TKIP"
Eric Dumazet <edumazet(a)google.com>
tcp: add tcp_ooo_try_coalesce() helper
Eric Dumazet <edumazet(a)google.com>
tcp: call tcp_drop() from tcp_data_queue_ofo()
Eric Dumazet <edumazet(a)google.com>
tcp: detect malicious patterns in tcp_collapse_ofo_queue()
Eric Dumazet <edumazet(a)google.com>
tcp: avoid collapses in tcp_prune_queue() if possible
Eric Dumazet <edumazet(a)google.com>
tcp: free batches of packets in tcp_prune_ofo_queue()
Roopa Prabhu <roopa(a)cumulusnetworks.com>
vxlan: fix default fdb entry netlink notify ordering during netdev create
Roopa Prabhu <roopa(a)cumulusnetworks.com>
vxlan: make netlink notify in vxlan_fdb_destroy optional
Roopa Prabhu <roopa(a)cumulusnetworks.com>
vxlan: add new fdb alloc and create helpers
Roopa Prabhu <roopa(a)cumulusnetworks.com>
rtnetlink: add rtnl_link_state check in rtnl_configure_link
Ariel Levkovich <lariel(a)mellanox.com>
net/mlx5: Adjust clock overflow work period
Eran Ben Elisha <eranbe(a)mellanox.com>
net/mlx5e: Fix quota counting in aRFS expire flow
Eran Ben Elisha <eranbe(a)mellanox.com>
net/mlx5e: Don't allow aRFS for encapsulated packets
David Ahern <dsahern(a)gmail.com>
net/ipv6: Fix linklocal to global address with VRF
Hangbin Liu <liuhangbin(a)gmail.com>
multicast: do not restore deleted record source filter mode to new one
Heiner Kallweit <hkallweit1(a)gmail.com>
net: phy: consider PHY_IGNORE_INTERRUPT in phy_start_aneg_priv
Daniel Borkmann <daniel(a)iogearbox.net>
sock: fix sg page frag coalescing in sk_alloc_sg
John Hurley <john.hurley(a)netronome.com>
nfp: flower: ensure dead neighbour entries are not offloaded
Shay Agroskin <shayag(a)mellanox.com>
net/mlx5e: Refine ets validation function
Roi Dayan <roid(a)mellanox.com>
net/mlx5e: Only allow offloading decap egress (egdev) flows
Or Gerlitz <ogerlitz(a)mellanox.com>
net/mlx5e: Add ingress/egress indication for offloaded TC flows
Doron Roberts-Kedes <doronrk(a)fb.com>
tls: check RCV_SHUTDOWN in tls_wait_data
Heiner Kallweit <hkallweit1(a)gmail.com>
r8169: restore previous behavior to accept BIOS WoL settings
Saeed Mahameed <saeedm(a)mellanox.com>
net/mlx5: E-Switch, UBSAN fix undefined behavior in mlx5_eswitch_mode
Yuchung Cheng <ycheng(a)google.com>
tcp: do not delay ACK in DCTCP upon CE status change
Yuchung Cheng <ycheng(a)google.com>
tcp: do not cancel delay-AcK on DCTCP special ACK
Yuchung Cheng <ycheng(a)google.com>
tcp: helpers to send special DCTCP ack
Yuchung Cheng <ycheng(a)google.com>
tcp: fix dctcp delayed ACK schedule
Eric Dumazet <edumazet(a)google.com>
net: skb_segment() should not return NULL
Zhao Chen <zhaochen6(a)huawei.com>
net-next/hinic: fix a problem in hinic_xmit_frame()
Jack Morgenstein <jackm(a)dev.mellanox.co.il>
net/mlx4_core: Save the qpn from the input modifier in RST2INIT wrapper
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
net: dsa: mv88e6xxx: fix races between lock and irq freeing
Willem de Bruijn <willemb(a)google.com>
ip: in cmsg IP(V6)_ORIGDSTADDR call pskb_may_pull
Paolo Abeni <pabeni(a)redhat.com>
ip: hash fragments consistently
Jarod Wilson <jarod(a)redhat.com>
bonding: set default miimon value for non-arp modes if not set
Neil Armstrong <narmstrong(a)baylibre.com>
clk: meson-gxbb: set fclk_div2 as CLK_IS_CRITICAL
Lyude Paul <lyude(a)redhat.com>
drm/nouveau: Set DRIVER_ATOMIC cap earlier to fix debugfs
Lyude Paul <lyude(a)redhat.com>
drm/nouveau/drm/nouveau: Fix runtime PM leak in nv50_disp_atomic_commit()
Alexey Kardashevskiy <aik(a)ozlabs.ru>
KVM: PPC: Check if IOMMU page is contained in the pinned physical page
Boris Ostrovsky <boris.ostrovsky(a)oracle.com>
xen/PVH: Set up GS segment for stack canary
Joel Stanley <joel(a)jms.id.au>
clk: aspeed: Support HPLL strapping on ast2400
Joel Stanley <joel(a)jms.id.au>
clk: aspeed: Mark bclk (PCIe) and dclk (VGA) as critical
Gregory CLEMENT <gregory.clement(a)bootlin.com>
clk: mvebu: armada-37xx-periph: Fix switching CPU rate from 300Mhz to 1.2GHz
Paul Burton <paul.burton(a)mips.com>
MIPS: Fix off-by-one in pci_resource_to_user()
Felix Fietkau <nbd(a)nbd.name>
MIPS: ath79: fix register address in ath79_ddr_wb_flush()
Christoph Hellwig <hch(a)lst.de>
Revert "iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up intel_{alloc,free}_coherent()"
Paolo Bonzini <pbonzini(a)redhat.com>
KVM: VMX: support MSR_IA32_ARCH_CAPABILITIES as a feature MSR
-------------
Diffstat:
Makefile | 4 +-
arch/mips/ath79/common.c | 2 +-
arch/mips/pci/pci.c | 2 +-
arch/powerpc/include/asm/mmu_context.h | 4 +-
arch/powerpc/kvm/book3s_64_vio.c | 2 +-
arch/powerpc/kvm/book3s_64_vio_hv.c | 6 +-
arch/powerpc/mm/mmu_context_iommu.c | 37 +-
arch/x86/kvm/x86.c | 4 +-
arch/x86/xen/xen-pvh.S | 26 +-
drivers/acpi/acpica/psloop.c | 26 ++
drivers/base/dd.c | 8 -
drivers/clk/clk-aspeed.c | 46 ++-
drivers/clk/meson/gxbb.c | 1 +
drivers/clk/mvebu/armada-37xx-periph.c | 38 ++
drivers/gpu/drm/nouveau/dispnv04/disp.c | 3 +
drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +
drivers/gpu/drm/nouveau/nv50_display.c | 8 +-
drivers/iommu/Kconfig | 1 -
drivers/iommu/intel-iommu.c | 62 +++-
drivers/net/bonding/bond_options.c | 23 +-
drivers/net/can/m_can/m_can.c | 11 +-
drivers/net/can/peak_canfd/peak_pciefd_main.c | 19 +
drivers/net/can/xilinx_can.c | 392 +++++++++++++++------
drivers/net/dsa/mv88e6xxx/chip.c | 21 +-
drivers/net/ethernet/huawei/hinic/hinic_tx.c | 1 +
.../net/ethernet/mellanox/mlx4/resource_tracker.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en.h | 3 -
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 7 +-
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 17 +-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 15 +-
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 32 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 42 ++-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.h | 13 +-
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 +-
.../net/ethernet/mellanox/mlx5/core/lib/clock.c | 12 +-
.../ethernet/netronome/nfp/flower/tunnel_conf.c | 2 +-
drivers/net/ethernet/realtek/r8169.c | 3 +-
drivers/net/phy/phy.c | 2 +-
drivers/net/vxlan.c | 126 +++++--
drivers/staging/rtl8188eu/Kconfig | 1 -
drivers/staging/rtl8188eu/core/rtw_recv.c | 161 ++++++---
drivers/staging/rtl8188eu/core/rtw_security.c | 92 ++---
drivers/staging/speakup/speakup_soft.c | 6 +-
drivers/usb/class/cdc-acm.c | 3 +
drivers/usb/core/hub.c | 8 +-
drivers/usb/dwc2/hcd.c | 44 +--
drivers/usb/gadget/composite.c | 1 -
drivers/usb/gadget/function/f_fs.c | 2 +-
drivers/usb/host/xhci.c | 1 +
drivers/vfio/vfio_iommu_spapr_tce.c | 2 +-
include/net/tcp.h | 7 +
net/core/rtnetlink.c | 9 +-
net/core/skbuff.c | 10 +-
net/core/sock.c | 6 +-
net/ipv4/igmp.c | 3 +-
net/ipv4/ip_output.c | 2 +
net/ipv4/ip_sockglue.c | 7 +-
net/ipv4/tcp_dctcp.c | 50 +--
net/ipv4/tcp_input.c | 65 +++-
net/ipv4/tcp_output.c | 33 +-
net/ipv6/datagram.c | 7 +-
net/ipv6/icmp.c | 5 +-
net/ipv6/ip6_output.c | 2 +
net/ipv6/mcast.c | 3 +-
net/ipv6/tcp_ipv6.c | 6 +-
net/tls/tls_sw.c | 3 +
66 files changed, 1097 insertions(+), 474 deletions(-)