Generic protection fault type kernel panic is observed when user
performs soft(ordered) HBA unplug operation while IOs are running
on drives connected to HBA.
When user performs ordered HBA removal operation then kernel calls
PCI device's .remove() call back function where driver is flushing out
all the outstanding SCSI IO commands with DID_NO_CONNECT host byte and
also un-maps sg buffers allocated for these IO commands.
But in the ordered HBA removal case (unlike of real HBA hot unplug)
HBA device is still alive and hence HBA hardware is performing the
DMA operations to those buffers on the system memory which are already
unmapped while flushing out the outstanding SCSI IO commands
and this leads to Kernel panic.
This bug got introduced from below commit,
commit c666d3be99c000bb889a33353e9be0fa5808d3de
("scsi: mpt3sas: wait for and flush running commands on shutdown/unload")
Fix:
Don't flush out the outstanding IOs from .remove() path in case of
ordered HBA removal since HBA will be still alive in this case and
it can complete the outstanding IOs. Flush out the outstanding IOs
only in case physical HBA hot unplug where their won't be any
communication with the HBA.
During shutdown also it is possible that HBA hardware can perform
DMA operations on those outstanding IO buffers which are completed
with DID_NO_CONNECT by the driver from .shutdown(). So same above fix
is applied in shutdown path as well.
Cc: stable(a)vger.kernel.org
Signed-off-by: Sreekanth Reddy <sreekanth.reddy(a)broadcom.com>
---
v1:
Update the patch description.
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 778d5e6..04a40af 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -9908,8 +9908,8 @@ static void scsih_remove(struct pci_dev *pdev)
ioc->remove_host = 1;
- mpt3sas_wait_for_commands_to_complete(ioc);
- _scsih_flush_running_cmds(ioc);
+ if (!pci_device_is_present(pdev))
+ _scsih_flush_running_cmds(ioc);
_scsih_fw_event_cleanup_queue(ioc);
@@ -9992,8 +9992,8 @@ static void scsih_remove(struct pci_dev *pdev)
ioc->remove_host = 1;
- mpt3sas_wait_for_commands_to_complete(ioc);
- _scsih_flush_running_cmds(ioc);
+ if (!pci_device_is_present(pdev))
+ _scsih_flush_running_cmds(ioc);
_scsih_fw_event_cleanup_queue(ioc);
--
1.8.3.1
This is a note to let you know that I've just added the patch titled
serial: sprd: Fix a dereference warning
to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-next branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release
during the merge window.
If you have any questions about this process, please let me know.
>From efc176929a3505a30c3993ddd393b40893649bd2 Mon Sep 17 00:00:00 2001
From: Lanqing Liu <liuhhome(a)gmail.com>
Date: Mon, 16 Mar 2020 11:13:33 +0800
Subject: serial: sprd: Fix a dereference warning
We should validate if the 'sup' is NULL or not before freeing DMA
memory, to fix below warning.
"drivers/tty/serial/sprd_serial.c:1141 sprd_remove()
error: we previously assumed 'sup' could be null (see line 1132)"
Fixes: f4487db58eb7 ("serial: sprd: Add DMA mode support")
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
Signed-off-by: Lanqing Liu <liuhhome(a)gmail.com>
Cc: stable <stable(a)vger.kernel.org>
Link: https://lore.kernel.org/r/e2bd92691538e95b04a2c2a728f3292e1617018f.15843259…
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/tty/serial/sprd_serial.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index 914862844790..509781ee26bf 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -1132,14 +1132,13 @@ static int sprd_remove(struct platform_device *dev)
if (sup) {
uart_remove_one_port(&sprd_uart_driver, &sup->port);
sprd_port[sup->port.line] = NULL;
+ sprd_rx_free_buf(sup);
sprd_ports_num--;
}
if (!sprd_ports_num)
uart_unregister_driver(&sprd_uart_driver);
- sprd_rx_free_buf(sup);
-
return 0;
}
--
2.25.1
This is the start of the stable review cycle for the 5.4.26 release.
There are 123 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 Thu, 19 Mar 2020 10:31:16 +0000.
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/v5.x/stable-review/patch-5.4.26-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.26-rc1
Karsten Graul <kgraul(a)linux.ibm.com>
net/smc: cancel event worker during device removal
Karsten Graul <kgraul(a)linux.ibm.com>
net/smc: check for valid ib_client_data
Eric Dumazet <edumazet(a)google.com>
ipv6: restrict IPV6_ADDRFORM operation
Suravee Suthikulpanit <suravee.suthikulpanit(a)amd.com>
iommu/amd: Fix IOMMU AVIC not properly update the is_run bit in IRTE
Wolfram Sang <wsa+renesas(a)sang-engineering.com>
i2c: acpi: put device when verifying client fails
Daniel Drake <drake(a)endlessm.com>
iommu/vt-d: Ignore devices with out-of-spec domain number
Zhenzhong Duan <zhenzhong.duan(a)gmail.com>
iommu/vt-d: Fix the wrong printing in RHSA parsing
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_chain_nat: inet family is missing module ownership
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: dump NFTA_CHAIN_FLAGS attribute
Jakub Kicinski <kuba(a)kernel.org>
netfilter: nft_tunnel: add missing attribute validation for tunnels
Jakub Kicinski <kuba(a)kernel.org>
netfilter: nft_payload: add missing attribute validation for payload csum flags
Jakub Kicinski <kuba(a)kernel.org>
netfilter: cthelper: add missing attribute validation for cthelper
Tommi Rantala <tommi.t.rantala(a)nokia.com>
perf bench futex-wake: Restore thread count default to online CPU count
Jakub Kicinski <kuba(a)kernel.org>
nl80211: add missing attribute validation for channel switch
Jakub Kicinski <kuba(a)kernel.org>
nl80211: add missing attribute validation for beacon report scanning
Jakub Kicinski <kuba(a)kernel.org>
nl80211: add missing attribute validation for critical protocol indication
Hamish Martin <hamish.martin(a)alliedtelesis.co.nz>
i2c: gpio: suppress error on probe defer
Qian Cai <cai(a)lca.pw>
iommu/vt-d: Fix RCU-list bugs in intel_iommu_init()
Christoph Hellwig <hch(a)lst.de>
driver code: clarify and fix platform device DMA mask allocation
Zhenyu Wang <zhenyuw(a)linux.intel.com>
drm/i915/gvt: Fix unnecessary schedule timer when no vGPU exits
Charles Keepax <ckeepax(a)opensource.cirrus.com>
pinctrl: core: Remove extra kref_get which blocks hogs being freed
Tina Zhang <tina.zhang(a)intel.com>
drm/i915/gvt: Fix dma-buf display blur issue on CFL
Suman Anna <s-anna(a)ti.com>
virtio_ring: Fix mem leak with vring_new_virtqueue()
Leonard Crestez <leonard.crestez(a)nxp.com>
pinctrl: imx: scu: Align imx sc msg structs to 4
Nicolas Belin <nbelin(a)baylibre.com>
pinctrl: meson-gxl: fix GPIOX sdio pins
Anson Huang <Anson.Huang(a)nxp.com>
clk: imx8mn: Fix incorrect clock defines
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Don't schedule OGM for disabled interface
Yonghyun Hwang <yonghyun(a)google.com>
iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page
Amol Grover <frextrite(a)gmail.com>
iommu/vt-d: Fix RCU list debugging warnings
Hans de Goede <hdegoede(a)redhat.com>
iommu/vt-d: dmar: replace WARN_TAINT with pr_warn + add_taint
Marc Zyngier <maz(a)kernel.org>
iommu/dma: Fix MSI reservation allocation
Tony Luck <tony.luck(a)intel.com>
x86/mce: Fix logic and comments around MSR_PPIN_CTL
Kim Phillips <kim.phillips(a)amd.com>
perf/amd/uncore: Replace manual sampling check with CAP_NO_INTERRUPT flag
Felix Fietkau <nbd(a)nbd.name>
mt76: fix array overflow on receiving too many fragments for a packet
Jarkko Nikula <jarkko.nikula(a)linux.intel.com>
i2c: designware-pci: Fix BUG_ON during device removal
Vladis Dronov <vdronov(a)redhat.com>
efi: Add a sanity check to efivar_store_raw()
Vladis Dronov <vdronov(a)redhat.com>
efi: Fix a race and a buffer overflow while reading efivars via sysfs
Tom Lendacky <thomas.lendacky(a)amd.com>
x86/ioremap: Map EFI runtime services data as encrypted for SEV
Wolfram Sang <wsa(a)the-dreams.de>
macintosh: windfarm: fix MODINFO regression
Eric Biggers <ebiggers(a)google.com>
fscrypt: don't evict dirty inodes after removing key
Tejun Heo <tj(a)kernel.org>
blk-iocost: fix incorrect vtime comparison in iocg_is_idle()
Takashi Iwai <tiwai(a)suse.de>
ipmi_si: Avoid spurious errors for optional IRQs
Stefan Haberland <sth(a)linux.ibm.com>
s390/dasd: fix data corruption for thin provisioned devices
Miklos Szeredi <mszeredi(a)redhat.com>
fuse: fix stack use after return
Eugeniy Paltsev <Eugeniy.Paltsev(a)synopsys.com>
ARC: define __ALIGN_STR and __ALIGN symbols for ARC
Vitaly Kuznetsov <vkuznets(a)redhat.com>
KVM: nVMX: avoid NULL pointer dereference with incorrect EVMCS GPAs
Vitaly Kuznetsov <vkuznets(a)redhat.com>
KVM: x86: clear stale x86_emulate_ctxt->intercept value
Al Viro <viro(a)zeniv.linux.org.uk>
gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache
Al Viro <viro(a)zeniv.linux.org.uk>
cifs_atomic_open(): fix double-put on late allocation failure
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
ktest: Add timeout for ssh sync testing
Mathias Kresin <dev(a)kresin.me>
pinctrl: falcon: fix syntax error
Ben Chuang <ben.chuang(a)genesyslogic.com.tw>
mmc: sdhci-pci-gli: Enable MSI interrupt for GL975x
Chris Wilson <chris(a)chris-wilson.co.uk>
drm/i915: Defer semaphore priority bumping to a workqueue
Matthew Auld <matthew.auld(a)intel.com>
drm/i915: be more solid in checking the alignment
Colin Ian King <colin.king(a)canonical.com>
drm/amd/display: remove duplicated assignment to grph_obj_type
Hillf Danton <hdanton(a)sina.com>
workqueue: don't use wq_select_unbound_cpu() for bound works
Vasily Averin <vvs(a)virtuozzo.com>
netfilter: x_tables: xt_mttg_seq_next should increase position index
Vasily Averin <vvs(a)virtuozzo.com>
netfilter: xt_recent: recent_seq_next should increase position index
Vasily Averin <vvs(a)virtuozzo.com>
netfilter: synproxy: synproxy_cpu_seq_next should increase position index
Vasily Averin <vvs(a)virtuozzo.com>
netfilter: nf_conntrack: ct_cpu_seq_next should increase position index
Hans de Goede <hdegoede(a)redhat.com>
iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint
Halil Pasic <pasic(a)linux.ibm.com>
virtio-blk: fix hw_queue stopped on arbitrary error
Dan Moulding <dmoulding(a)me.com>
iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: fix infinite loop when expr is not available
Michal Koutný <mkoutny(a)suse.com>
cgroup: Iterate tasks that did not finish do_exit()
Vasily Averin <vvs(a)virtuozzo.com>
cgroup: cgroup_procs_next should increase position index
Florian Fainelli <f.fainelli(a)gmail.com>
net: phy: Avoid multiple suspends
Andrew Lunn <andrew(a)lunn.ch>
net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed
Hangbin Liu <liuhangbin(a)gmail.com>
selftests/net/fib_tests: update addr_metric_test for peer route testing
Hangbin Liu <liuhangbin(a)gmail.com>
net/ipv6: remove the old peer route if change it to a new one
Hangbin Liu <liuhangbin(a)gmail.com>
net/ipv6: need update peer route when modify metric
Heiner Kallweit <hkallweit1(a)gmail.com>
net: phy: fix MDIO bus PM PHY resuming
Heiner Kallweit <hkallweit1(a)gmail.com>
net: phy: avoid clearing PHY interrupts twice in irq handler
Jakub Kicinski <kuba(a)kernel.org>
nfc: add missing attribute validation for vendor subcommand
Jakub Kicinski <kuba(a)kernel.org>
nfc: add missing attribute validation for deactivate target
Jakub Kicinski <kuba(a)kernel.org>
nfc: add missing attribute validation for SE API
Jakub Kicinski <kuba(a)kernel.org>
tipc: add missing attribute validation for MTU property
Jakub Kicinski <kuba(a)kernel.org>
team: add missing attribute validation for array index
Jakub Kicinski <kuba(a)kernel.org>
team: add missing attribute validation for port ifindex
Jakub Kicinski <kuba(a)kernel.org>
net: taprio: add missing attribute validation for txtime delay
Jakub Kicinski <kuba(a)kernel.org>
net: fq: add missing attribute validation for orphan mask
Jakub Kicinski <kuba(a)kernel.org>
macsec: add missing attribute validation for port
Jakub Kicinski <kuba(a)kernel.org>
can: add missing attribute validation for termination
Jakub Kicinski <kuba(a)kernel.org>
nl802154: add missing attribute validation for dev_type
Jakub Kicinski <kuba(a)kernel.org>
nl802154: add missing attribute validation
Jakub Kicinski <kuba(a)kernel.org>
fib: add missing attribute validation for tun_id
Jakub Kicinski <kuba(a)kernel.org>
devlink: validate length of region addr/len
Jakub Kicinski <kuba(a)kernel.org>
devlink: validate length of param values
Eric Dumazet <edumazet(a)google.com>
net: memcg: fix lockdep splat in inet_csk_accept()
Shakeel Butt <shakeelb(a)google.com>
net: memcg: late association of sock to memcg
Shakeel Butt <shakeelb(a)google.com>
cgroup: memcg: net: do not associate sock with unrelated cgroup
Edwin Peer <edwin.peer(a)broadcom.com>
bnxt_en: fix error handling when flashing from file
Vasundhara Volam <vasundhara-v.volam(a)broadcom.com>
bnxt_en: reinitialize IRQs when MTU is modified
Eric Dumazet <edumazet(a)google.com>
bonding/alb: make sure arp header is pulled before accessing it
Vinicius Costa Gomes <vinicius.gomes(a)intel.com>
taprio: Fix sending packets without dequeueing them
Eric Dumazet <edumazet(a)google.com>
slip: make slhc_compress() more robust against malicious packets
Edward Cree <ecree(a)solarflare.com>
sfc: detach from cb_page in efx_copy_channel()
You-Sheng Yang <vicamo.yang(a)canonical.com>
r8152: check disconnect status after long sleep
Colin Ian King <colin.king(a)canonical.com>
net: systemport: fix index check to avoid an array out of bounds access
Remi Pommarel <repk(a)triplefau.lt>
net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
Jonas Gorski <jonas.gorski(a)gmail.com>
net: phy: bcm63xx: fix OOPS due to missing driver name
Willem de Bruijn <willemb(a)google.com>
net/packet: tpacket_rcv: do not increment ring index on drop
Dan Carpenter <dan.carpenter(a)oracle.com>
net: nfc: fix bounds checking bugs on "pipe"
Dmitry Bogdanov <dbogdanov(a)marvell.com>
net: macsec: update SCI upon MAC address change.
Pablo Neira Ayuso <pablo(a)netfilter.org>
netlink: Use netlink header as base to calculate bad attribute offset
Hangbin Liu <liuhangbin(a)gmail.com>
net/ipv6: use configured metric when add peer route
Jian Shen <shenjian15(a)huawei.com>
net: hns3: fix a not link up issue when fibre port supports autoneg
Jakub Kicinski <kuba(a)kernel.org>
net: fec: validate the new settings in fec_enet_set_coalesce()
Russell King <rmk+kernel(a)armlinux.org.uk>
net: dsa: mv88e6xxx: fix lockup on warm boot
Russell King <rmk+kernel(a)armlinux.org.uk>
net: dsa: fix phylink_start()/phylink_stop() calls
Mahesh Bandewar <maheshb(a)google.com>
macvlan: add cond_resched() during multicast processing
Mahesh Bandewar <maheshb(a)google.com>
ipvlan: don't deref eth hdr before checking it's set
Eric Dumazet <edumazet(a)google.com>
ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast()
Jiri Wiesner <jwiesner(a)suse.com>
ipvlan: do not add hardware address of master to its unicast filter list
Mahesh Bandewar <maheshb(a)google.com>
ipvlan: add cond_resched_rcu() while processing muticast backlog
Hangbin Liu <liuhangbin(a)gmail.com>
ipv6/addrconf: call ipv6_mc_up() for non-Ethernet interface
Dmitry Yakunin <zeil(a)yandex-team.ru>
inet_diag: return classid for all socket types
Eric Dumazet <edumazet(a)google.com>
gre: fix uninit-value in __iptunnel_pull_header
Dmitry Yakunin <zeil(a)yandex-team.ru>
cgroup, netclassid: periodically release file_lock on classid updating
Kailang Yang <kailang(a)realtek.com>
ALSA: hda/realtek - Fixed one of HP ALC671 platform Headset Mic supported
Kailang Yang <kailang(a)realtek.com>
ALSA: hda/realtek - Add Headset Mic supported for HP cPC
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda/realtek - More constifications
Nathan Chancellor <natechancellor(a)gmail.com>
virtio_balloon: Adjust label in virtballoon_probe
-------------
Diffstat:
Documentation/filesystems/porting.rst | 8 +
Makefile | 4 +-
arch/arc/include/asm/linkage.h | 2 +
arch/x86/events/amd/uncore.c | 17 +--
arch/x86/kernel/cpu/mce/intel.c | 9 +-
arch/x86/kvm/emulate.c | 1 +
arch/x86/kvm/vmx/nested.c | 5 +-
arch/x86/mm/ioremap.c | 18 +++
block/blk-iocost.c | 2 +-
drivers/base/platform.c | 25 +---
drivers/block/virtio_blk.c | 8 +-
drivers/char/ipmi/ipmi_si_platform.c | 4 +-
drivers/firmware/efi/efivars.c | 32 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 3 +-
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 3 +-
drivers/gpu/drm/i915/gvt/display.c | 3 +-
drivers/gpu/drm/i915/gvt/vgpu.c | 12 +-
drivers/gpu/drm/i915/i915_request.c | 22 ++-
drivers/gpu/drm/i915/i915_request.h | 2 +
drivers/gpu/drm/i915/i915_utils.h | 5 +
drivers/i2c/busses/i2c-designware-pcidrv.c | 1 +
drivers/i2c/busses/i2c-gpio.c | 2 +-
drivers/i2c/i2c-core-acpi.c | 10 +-
drivers/iommu/amd_iommu.c | 4 +-
drivers/iommu/dma-iommu.c | 16 +-
drivers/iommu/dmar.c | 21 ++-
drivers/iommu/intel-iommu.c | 18 ++-
drivers/macintosh/windfarm_ad7417_sensor.c | 7 +
drivers/macintosh/windfarm_fcu_controls.c | 7 +
drivers/macintosh/windfarm_lm75_sensor.c | 16 +-
drivers/macintosh/windfarm_lm87_sensor.c | 7 +
drivers/macintosh/windfarm_max6690_sensor.c | 7 +
drivers/macintosh/windfarm_smu_sat.c | 7 +
drivers/mmc/host/sdhci-pci-gli.c | 17 +++
drivers/net/bonding/bond_alb.c | 20 +--
drivers/net/can/dev.c | 1 +
drivers/net/dsa/mv88e6xxx/global2.c | 8 +-
drivers/net/ethernet/broadcom/bcmsysport.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 24 ++-
drivers/net/ethernet/freescale/fec_main.c | 6 +-
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +-
drivers/net/ethernet/sfc/efx.c | 1 +
.../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 3 +-
drivers/net/ipvlan/ipvlan_core.c | 19 ++-
drivers/net/ipvlan/ipvlan_main.c | 5 +-
drivers/net/macsec.c | 12 +-
drivers/net/macvlan.c | 2 +
drivers/net/phy/bcm63xx.c | 1 +
drivers/net/phy/phy.c | 3 +-
drivers/net/phy/phy_device.c | 11 +-
drivers/net/slip/slhc.c | 14 +-
drivers/net/team/team.c | 2 +
drivers/net/usb/r8152.c | 8 +
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 3 +-
drivers/net/wireless/mediatek/mt76/dma.c | 9 +-
drivers/pinctrl/core.c | 1 -
drivers/pinctrl/freescale/pinctrl-scu.c | 4 +-
drivers/pinctrl/meson/pinctrl-meson-gxl.c | 4 +-
drivers/pinctrl/pinctrl-falcon.c | 2 +-
drivers/s390/block/dasd.c | 27 +++-
drivers/s390/block/dasd_eckd.c | 163 ++++++++++++++++++++-
drivers/s390/block/dasd_int.h | 15 +-
drivers/virtio/virtio_balloon.c | 2 +-
drivers/virtio/virtio_ring.c | 4 +-
fs/cifs/dir.c | 1 -
fs/crypto/keysetup.c | 9 ++
fs/fuse/dev.c | 6 +-
fs/fuse/fuse_i.h | 2 +
fs/gfs2/inode.c | 2 +-
fs/open.c | 3 -
include/dt-bindings/clock/imx8mn-clock.h | 4 +-
include/linux/cgroup.h | 1 +
include/linux/dmar.h | 8 +-
include/linux/inet_diag.h | 18 ++-
include/linux/phy.h | 3 +
include/linux/platform_device.h | 2 +-
include/net/fib_rules.h | 1 +
kernel/cgroup/cgroup.c | 37 +++--
kernel/workqueue.c | 14 +-
mm/memcontrol.c | 14 +-
net/batman-adv/bat_iv_ogm.c | 4 +
net/core/devlink.c | 33 +++--
net/core/netclassid_cgroup.c | 47 ++++--
net/core/sock.c | 5 +-
net/dsa/dsa_priv.h | 2 +
net/dsa/port.c | 44 ++++--
net/dsa/slave.c | 8 +-
net/ieee802154/nl_policy.c | 6 +
net/ipv4/gre_demux.c | 12 +-
net/ipv4/inet_connection_sock.c | 20 +++
net/ipv4/inet_diag.c | 44 +++---
net/ipv4/raw_diag.c | 5 +-
net/ipv4/udp_diag.c | 5 +-
net/ipv6/addrconf.c | 51 +++++--
net/ipv6/ipv6_sockglue.c | 10 +-
net/netfilter/nf_conntrack_standalone.c | 2 +-
net/netfilter/nf_synproxy_core.c | 2 +-
net/netfilter/nf_tables_api.c | 15 +-
net/netfilter/nfnetlink_cthelper.c | 2 +
net/netfilter/nft_chain_nat.c | 1 +
net/netfilter/nft_payload.c | 1 +
net/netfilter/nft_tunnel.c | 2 +
net/netfilter/x_tables.c | 6 +-
net/netfilter/xt_recent.c | 2 +-
net/netlink/af_netlink.c | 2 +-
net/nfc/hci/core.c | 19 ++-
net/nfc/netlink.c | 4 +
net/packet/af_packet.c | 13 +-
net/sched/sch_fq.c | 1 +
net/sched/sch_taprio.c | 13 +-
net/sctp/diag.c | 8 +-
net/smc/smc_ib.c | 3 +
net/tipc/netlink.c | 1 +
net/wireless/nl80211.c | 5 +
sound/pci/hda/patch_realtek.c | 163 +++++++++++++--------
tools/perf/bench/futex-wake.c | 4 +-
tools/testing/ktest/ktest.pl | 2 +-
tools/testing/selftests/net/fib_tests.sh | 34 ++++-
119 files changed, 1038 insertions(+), 397 deletions(-)
This enables the sampling check in kernel/events/core.c's
perf_event_open, which returns the more appropriate -EOPNOTSUPP.
BEFORE:
$ sudo perf record -a -e instructions,l3_request_g1.caching_l3_cache_accesses true
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (l3_request_g1.caching_l3_cache_accesses).
/bin/dmesg | grep -i perf may provide additional information.
With nothing relevant in dmesg.
AFTER:
$ sudo perf record -a -e instructions,l3_request_g1.caching_l3_cache_accesses true
Error:
l3_request_g1.caching_l3_cache_accesses: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'
Signed-off-by: Kim Phillips <kim.phillips(a)amd.com>
Cc: Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme(a)kernel.org>
Cc: Borislav Petkov <bp(a)alien8.de>
Cc: "H. Peter Anvin" <hpa(a)zytor.com>
Cc: Ingo Molnar <mingo(a)kernel.org>
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: Jiri Olsa <jolsa(a)redhat.com>
Cc: Mark Rutland <mark.rutland(a)arm.com>
Cc: Michael Petlan <mpetlan(a)redhat.com>
Cc: Namhyung Kim <namhyung(a)kernel.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: linux-kernel(a)vger.kernel.org
Cc: x86(a)kernel.org
Cc: stable(a)vger.kernel.org
Fixes: c43ca5091a37 ("perf/x86/amd: Add support for AMD NB and L2I "uncore" counters")
---
RESEND. No changes since original submission 19 Feb 2020:
https://lkml.org/lkml/2020/2/19/1194
arch/x86/events/amd/uncore.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index a6ea07f2aa84..4d867a752f0e 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -190,15 +190,12 @@ static int amd_uncore_event_init(struct perf_event *event)
/*
* NB and Last level cache counters (MSRs) are shared across all cores
- * that share the same NB / Last level cache. Interrupts can be directed
- * to a single target core, however, event counts generated by processes
- * running on other cores cannot be masked out. So we do not support
- * sampling and per-thread events.
+ * that share the same NB / Last level cache. On family 16h and below,
+ * Interrupts can be directed to a single target core, however, event
+ * counts generated by processes running on other cores cannot be masked
+ * out. So we do not support sampling and per-thread events via
+ * CAP_NO_INTERRUPT, and we do not enable counter overflow interrupts:
*/
- if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
- return -EINVAL;
-
- /* and we do not enable counter overflow interrupts */
hwc->config = event->attr.config & AMD64_RAW_EVENT_MASK_NB;
hwc->idx = -1;
@@ -306,7 +303,7 @@ static struct pmu amd_nb_pmu = {
.start = amd_uncore_start,
.stop = amd_uncore_stop,
.read = amd_uncore_read,
- .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
+ .capabilities = PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_NO_INTERRUPT,
};
static struct pmu amd_llc_pmu = {
@@ -317,7 +314,7 @@ static struct pmu amd_llc_pmu = {
.start = amd_uncore_start,
.stop = amd_uncore_stop,
.read = amd_uncore_read,
- .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
+ .capabilities = PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_NO_INTERRUPT,
};
static struct amd_uncore *amd_uncore_alloc(unsigned int cpu)
--
2.25.1
This is a note to let you know that I've just added the patch titled
USB: cdc-acm: fix rounding error in TIOCSSERIAL
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From b401f8c4f492cbf74f3f59c9141e5be3071071bb Mon Sep 17 00:00:00 2001
From: Anthony Mallet <anthony.mallet(a)laas.fr>
Date: Thu, 12 Mar 2020 14:31:01 +0100
Subject: USB: cdc-acm: fix rounding error in TIOCSSERIAL
By default, tty_port_init() initializes those parameters to a multiple
of HZ. For instance in line 69 of tty_port.c:
port->close_delay = (50 * HZ) / 100;
https://github.com/torvalds/linux/blob/master/drivers/tty/tty_port.c#L69
With e.g. CONFIG_HZ = 250 (as this is the case for Ubuntu 18.04
linux-image-4.15.0-37-generic), the default setting for close_delay is
thus 125.
When ioctl(fd, TIOCGSERIAL, &s) is executed, the setting returned in
user space is '12' (125/10). When ioctl(fd, TIOCSSERIAL, &s) is then
executed with the same setting '12', the value is interpreted as '120'
which is different from the current setting and a EPERM error may be
raised by set_serial_info() if !CAP_SYS_ADMIN.
https://github.com/torvalds/linux/blob/master/drivers/usb/class/cdc-acm.c#L…
Fixes: ba2d8ce9db0a6 ("cdc-acm: implement TIOCSSERIAL to avoid blocking close(2)")
Signed-off-by: Anthony Mallet <anthony.mallet(a)laas.fr>
Cc: stable <stable(a)vger.kernel.org>
Link: https://lore.kernel.org/r/20200312133101.7096-2-anthony.mallet@laas.fr
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/class/cdc-acm.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index da619176deca..47f09a6ce7bd 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -907,6 +907,7 @@ static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
{
struct acm *acm = tty->driver_data;
unsigned int closing_wait, close_delay;
+ unsigned int old_closing_wait, old_close_delay;
int retval = 0;
close_delay = msecs_to_jiffies(ss->close_delay * 10);
@@ -914,18 +915,24 @@ static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
ASYNC_CLOSING_WAIT_NONE :
msecs_to_jiffies(ss->closing_wait * 10);
+ /* we must redo the rounding here, so that the values match */
+ old_close_delay = jiffies_to_msecs(acm->port.close_delay) / 10;
+ old_closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
+ ASYNC_CLOSING_WAIT_NONE :
+ jiffies_to_msecs(acm->port.closing_wait) / 10;
+
mutex_lock(&acm->port.mutex);
- if (!capable(CAP_SYS_ADMIN)) {
- if ((close_delay != acm->port.close_delay) ||
- (closing_wait != acm->port.closing_wait))
+ if ((ss->close_delay != old_close_delay) ||
+ (ss->closing_wait != old_closing_wait)) {
+ if (!capable(CAP_SYS_ADMIN))
retval = -EPERM;
- else
- retval = -EOPNOTSUPP;
- } else {
- acm->port.close_delay = close_delay;
- acm->port.closing_wait = closing_wait;
- }
+ else {
+ acm->port.close_delay = close_delay;
+ acm->port.closing_wait = closing_wait;
+ }
+ } else
+ retval = -EOPNOTSUPP;
mutex_unlock(&acm->port.mutex);
return retval;
--
2.25.1
This is a note to let you know that I've just added the patch titled
USB: cdc-acm: fix close_delay and closing_wait units in TIOCSSERIAL
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 633e2b2ded739a34bd0fb1d8b5b871f7e489ea29 Mon Sep 17 00:00:00 2001
From: Anthony Mallet <anthony.mallet(a)laas.fr>
Date: Thu, 12 Mar 2020 14:31:00 +0100
Subject: USB: cdc-acm: fix close_delay and closing_wait units in TIOCSSERIAL
close_delay and closing_wait are specified in hundredth of a second but stored
internally in jiffies. Use the jiffies_to_msecs() and msecs_to_jiffies()
functions to convert from each other.
Signed-off-by: Anthony Mallet <anthony.mallet(a)laas.fr>
Cc: stable <stable(a)vger.kernel.org>
Link: https://lore.kernel.org/r/20200312133101.7096-1-anthony.mallet@laas.fr
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/class/cdc-acm.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 62f4fb9b362f..da619176deca 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -896,10 +896,10 @@ static int get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
ss->xmit_fifo_size = acm->writesize;
ss->baud_base = le32_to_cpu(acm->line.dwDTERate);
- ss->close_delay = acm->port.close_delay / 10;
+ ss->close_delay = jiffies_to_msecs(acm->port.close_delay) / 10;
ss->closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
ASYNC_CLOSING_WAIT_NONE :
- acm->port.closing_wait / 10;
+ jiffies_to_msecs(acm->port.closing_wait) / 10;
return 0;
}
@@ -909,9 +909,10 @@ static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
unsigned int closing_wait, close_delay;
int retval = 0;
- close_delay = ss->close_delay * 10;
+ close_delay = msecs_to_jiffies(ss->close_delay * 10);
closing_wait = ss->closing_wait == ASYNC_CLOSING_WAIT_NONE ?
- ASYNC_CLOSING_WAIT_NONE : ss->closing_wait * 10;
+ ASYNC_CLOSING_WAIT_NONE :
+ msecs_to_jiffies(ss->closing_wait * 10);
mutex_lock(&acm->port.mutex);
--
2.25.1
This is a note to let you know that I've just added the patch titled
usb: chipidea: udc: fix sleeping function called from invalid context
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 7368760d1bcdabf515c41a502568b489de3da683 Mon Sep 17 00:00:00 2001
From: Peter Chen <peter.chen(a)nxp.com>
Date: Mon, 16 Mar 2020 11:10:34 +0800
Subject: usb: chipidea: udc: fix sleeping function called from invalid context
The code calls pm_runtime_get_sync with irq disabled, it causes below
warning:
BUG: sleeping function called from invalid context at
wer/runtime.c:1075
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid:
er/u8:1
CPU: 1 PID: 37 Comm: kworker/u8:1 Not tainted
20200304-00181-gbebfd2a5be98 #1588
Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
Workqueue: ci_otg ci_otg_work
[<c010e8bd>] (unwind_backtrace) from [<c010a315>]
1/0x14)
[<c010a315>] (show_stack) from [<c0987d29>]
5/0x94)
[<c0987d29>] (dump_stack) from [<c013e77f>]
+0xeb/0x118)
[<c013e77f>] (___might_sleep) from [<c052fa1d>]
esume+0x75/0x78)
[<c052fa1d>] (__pm_runtime_resume) from [<c0627a33>]
0x23/0x74)
[<c0627a33>] (ci_udc_pullup) from [<c062fb93>]
nect+0x2b/0xcc)
[<c062fb93>] (usb_gadget_connect) from [<c062769d>]
_connect+0x59/0x104)
[<c062769d>] (ci_hdrc_gadget_connect) from [<c062778b>]
ssion+0x43/0x48)
[<c062778b>] (ci_udc_vbus_session) from [<c062f997>]
s_connect+0x17/0x9c)
[<c062f997>] (usb_gadget_vbus_connect) from [<c062634d>]
bd/0x128)
[<c062634d>] (ci_otg_work) from [<c0134719>]
rk+0x149/0x404)
[<c0134719>] (process_one_work) from [<c0134acb>]
0xf7/0x3bc)
[<c0134acb>] (worker_thread) from [<c0139433>]
x118)
[<c0139433>] (kthread) from [<c01010bd>]
(ret_from_fork+0x11/0x34)
Tested-by: Dmitry Osipenko <digetx(a)gmail.com>
Cc: <stable(a)vger.kernel.org> #v5.5
Fixes: 72dc8df7920f ("usb: chipidea: udc: protect usb interrupt enable")
Reported-by: Dmitry Osipenko <digetx(a)gmail.com>
Signed-off-by: Peter Chen <peter.chen(a)nxp.com>
Link: https://lore.kernel.org/r/20200316031034.17847-2-peter.chen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/chipidea/udc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index ffaf46f5d062..4c4ac30db498 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1530,18 +1530,19 @@ static const struct usb_ep_ops usb_ep_ops = {
static void ci_hdrc_gadget_connect(struct usb_gadget *_gadget, int is_active)
{
struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
- unsigned long flags;
if (is_active) {
pm_runtime_get_sync(&_gadget->dev);
hw_device_reset(ci);
- spin_lock_irqsave(&ci->lock, flags);
+ spin_lock_irq(&ci->lock);
if (ci->driver) {
hw_device_state(ci, ci->ep0out->qh.dma);
usb_gadget_set_state(_gadget, USB_STATE_POWERED);
+ spin_unlock_irq(&ci->lock);
usb_udc_vbus_handler(_gadget, true);
+ } else {
+ spin_unlock_irq(&ci->lock);
}
- spin_unlock_irqrestore(&ci->lock, flags);
} else {
usb_udc_vbus_handler(_gadget, false);
if (ci->driver)
--
2.25.1