Make sure that KVM uses vmcb01 before freeing nested state, and warn if
that is not the case.
This is a minimal fix for CVE-2022-3344 making the kernel print a warning
instead of a kernel panic.
Cc: stable(a)vger.kernel.org
Signed-off-by: Maxim Levitsky <mlevitsk(a)redhat.com>
---
arch/x86/kvm/svm/nested.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index b258d6988f5dde..b74da40c1fc40c 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -1126,6 +1126,9 @@ void svm_free_nested(struct vcpu_svm *svm)
if (!svm->nested.initialized)
return;
+ if (WARN_ON_ONCE(svm->vmcb != svm->vmcb01.ptr))
+ svm_switch_vmcb(svm, &svm->vmcb01);
+
svm_vcpu_free_msrpm(svm->nested.msrpm);
svm->nested.msrpm = NULL;
--
2.34.3
If the VM was terminated while nested, we free the nested state
while the vCPU still is in nested mode.
Soon a warning will be added for this condition.
Cc: stable(a)vger.kernel.org
Signed-off-by: Maxim Levitsky <mlevitsk(a)redhat.com>
---
arch/x86/kvm/svm/svm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index d22a809d923339..e9cec1b692051c 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -1440,6 +1440,7 @@ static void svm_vcpu_free(struct kvm_vcpu *vcpu)
*/
svm_clear_current_vmcb(svm->vmcb);
+ svm_leave_nested(vcpu);
svm_free_nested(svm);
sev_free_vcpu(vcpu);
--
2.34.3
This is the start of the stable review cycle for the 5.4.223 release.
There are 64 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 Fri, 04 Nov 2022 02:20:38 +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.223-rc…
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.223-rc1
Biju Das <biju.das.jz(a)bp.renesas.com>
can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive
Vladimir Oltean <vladimir.oltean(a)nxp.com>
net: enetc: survive memory pressure without crashing
Tariq Toukan <tariqt(a)nvidia.com>
net/mlx5: Fix possible use-after-free in async command interface
Hyong Youb Kim <hyonkim(a)cisco.com>
net/mlx5e: Do not increment ESN when updating IPsec ESN state
Nicolas Dichtel <nicolas.dichtel(a)6wind.com>
nh: fix scope used to find saddr when adding non gw nh
Yang Yingliang <yangyingliang(a)huawei.com>
net: ehea: fix possible memory leak in ehea_register_port()
Aaron Conole <aconole(a)redhat.com>
openvswitch: switch from WARN to pr_warn
Takashi Iwai <tiwai(a)suse.de>
ALSA: aoa: Fix I2S device accounting
Yang Yingliang <yangyingliang(a)huawei.com>
ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev()
Sudeep Holla <sudeep.holla(a)arm.com>
PM: domains: Fix handling of unavailable/disabled idle states
Yang Yingliang <yangyingliang(a)huawei.com>
net: ksz884x: fix missing pci_disable_device() on error in pcidev_init()
Slawomir Laba <slawomirx.laba(a)intel.com>
i40e: Fix flow-type by setting GL_HASH_INSET registers
Sylwester Dziedziuch <sylwesterx.dziedziuch(a)intel.com>
i40e: Fix VF hang when reset is triggered on another VF
Slawomir Laba <slawomirx.laba(a)intel.com>
i40e: Fix ethtool rx-flow-hash setting for X722
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: videodev2.h: V4L2_DV_BT_BLANKING_HEIGHT should check 'interlaced'
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: v4l2-dv-timings: add sanity checks for blanking values
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: dev->bitmap_cap wasn't freed in all cases
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: s_fbuf: add more sanity checks
Mario Limonciello <mario.limonciello(a)amd.com>
PM: hibernate: Allow hybrid sleep to work with s2idle
Dongliang Mu <dzm91(a)hust.edu.cn>
can: mscan: mpc5xxx: mpc5xxx_can_probe(): add missing put_clock() in error path
Neal Cardwell <ncardwell(a)google.com>
tcp: fix indefinite deferral of RTO with SACK reneging
Zhang Changzhong <zhangchangzhong(a)huawei.com>
net: lantiq_etop: don't free skb when returning NETDEV_TX_BUSY
Zhengchao Shao <shaozhengchao(a)huawei.com>
net: fix UAF issue in nfqnl_nf_hook_drop() when ops_init() failed
Eric Dumazet <edumazet(a)google.com>
kcm: annotate data-races around kcm->rx_wait
Eric Dumazet <edumazet(a)google.com>
kcm: annotate data-races around kcm->rx_psock
Raju Rangoju <Raju.Rangoju(a)amd.com>
amd-xgbe: add the bit rate quirk for Molex cables
Raju Rangoju <Raju.Rangoju(a)amd.com>
amd-xgbe: fix the SFP compliance codes check for DAC cables
Chen Zhongjin <chenzhongjin(a)huawei.com>
x86/unwind/orc: Fix unreliable stack dump with gcov
Yang Yingliang <yangyingliang(a)huawei.com>
net: netsec: fix error handling in netsec_register_mdio()
Xin Long <lucien.xin(a)gmail.com>
tipc: fix a null-ptr-deref in tipc_topsrv_accept
Yang Yingliang <yangyingliang(a)huawei.com>
ALSA: ac97: fix possible memory leak in snd_ac97_dev_register()
Randy Dunlap <rdunlap(a)infradead.org>
arc: iounmap() arg is volatile
Nathan Huckleberry <nhuck(a)google.com>
drm/msm: Fix return type of mdp4_lvds_connector_mode_valid
Alexander Stein <alexander.stein(a)ew.tq-group.com>
media: v4l2: Fix v4l2_i2c_subdev_set_name function documentation
Wei Yongjun <weiyongjun1(a)huawei.com>
net: ieee802154: fix error return code in dgram_bind()
Rik van Riel <riel(a)surriel.com>
mm,hugetlb: take hugetlb_lock before decrementing h->resv_huge_pages
Chen Zhou <chenzhou10(a)huawei.com>
cgroup-v1: add disabled controller check in cgroup1_parse_param()
M. Vefa Bicakci <m.v.b(a)runbox.com>
xen/gntdev: Prevent leaking grants
Jan Beulich <jbeulich(a)suse.com>
Xen/gntdev: don't ignore kernel unmapping error
Chandan Babu R <chandan.babu(a)oracle.com>
xfs: force the log after remapping a synchronous-writes file
Chandan Babu R <chandan.babu(a)oracle.com>
xfs: clear XFS_DQ_FREEING if we can't lock the dquot buffer to flush
Chandan Babu R <chandan.babu(a)oracle.com>
xfs: finish dfops on every insert range shift iteration
Heiko Carstens <hca(a)linux.ibm.com>
s390/pci: add missing EX_TABLE entries to __pcistg_mio_inuser()/__pcilg_mio_inuser()
Heiko Carstens <hca(a)linux.ibm.com>
s390/futex: add missing EX_TABLE entry to __futex_atomic_op()
Adrian Hunter <adrian.hunter(a)intel.com>
perf auxtrace: Fix address filter symbol name match for modules
Christian A. Ehrhardt <lk(a)c--e.de>
kernfs: fix use-after-free in __kernfs_remove
Matthew Ma <mahongwei(a)zeku.com>
mmc: core: Fix kernel panic when remove non-standard SDIO card
Johan Hovold <johan+linaro(a)kernel.org>
drm/msm/hdmi: fix memory corruption with too many bridges
Johan Hovold <johan+linaro(a)kernel.org>
drm/msm/dsi: fix memory corruption with too many bridges
Miquel Raynal <miquel.raynal(a)bootlin.com>
mac802154: Fix LQI recording
Hyunwoo Kim <imv4bel(a)gmail.com>
fbdev: smscufx: Fix several use-after-free bugs
Shreeya Patel <shreeya.patel(a)collabora.com>
iio: light: tsl2583: Fix module unloading
Matti Vaittinen <mazziesaccount(a)gmail.com>
tools: iio: iio_utils: fix digit calculation
Mathias Nyman <mathias.nyman(a)linux.intel.com>
xhci: Remove device endpoints from bandwidth list when freeing the device
Tony O'Brien <tony.obrien(a)alliedtelesis.co.nz>
mtd: rawnand: marvell: Use correct logic for nand-keep-config
Jens Glathe <jens.glathe(a)oldschoolsolutions.biz>
usb: xhci: add XHCI_SPURIOUS_SUCCESS to ASM1042 despite being a V0.96 controller
Justin Chen <justinpopo6(a)gmail.com>
usb: bdc: change state when port disconnected
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Don't set IMI for no_interrupt
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Stop processing more requests on IMI
Hannu Hartikainen <hannu(a)hrtk.in>
USB: add RESET_RESUME quirk for NVIDIA Jetson devices in RCM
Jason A. Donenfeld <Jason(a)zx2c4.com>
ALSA: au88x0: use explicitly signed char
Steven Rostedt (Google) <rostedt(a)goodmis.org>
ALSA: Use del_timer_sync() before freeing timer
Anssi Hannula <anssi.hannula(a)bitwise.fi>
can: kvaser_usb: Fix possible completions during init_completion
Yang Yingliang <yangyingliang(a)huawei.com>
can: j1939: transport: j1939_session_skb_drop_old(): spin_unlock_irqrestore() before kfree_skb()
-------------
Diffstat:
Makefile | 4 +-
arch/arc/include/asm/io.h | 2 +-
arch/arc/mm/ioremap.c | 2 +-
arch/s390/include/asm/futex.h | 3 +-
arch/s390/pci/pci_mmio.c | 8 +-
arch/x86/kernel/unwind_orc.c | 2 +-
drivers/base/power/domain.c | 4 +
.../gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c | 5 +-
drivers/gpu/drm/msm/dsi/dsi.c | 6 ++
drivers/gpu/drm/msm/hdmi/hdmi.c | 5 ++
drivers/iio/light/tsl2583.c | 2 +-
drivers/media/platform/vivid/vivid-core.c | 22 +++++
drivers/media/platform/vivid/vivid-core.h | 2 +
drivers/media/platform/vivid/vivid-vid-cap.c | 27 ++++--
drivers/media/v4l2-core/v4l2-dv-timings.c | 14 +++
drivers/mmc/core/sdio_bus.c | 3 +-
drivers/mtd/nand/raw/marvell_nand.c | 2 +-
drivers/net/can/mscan/mpc5xxx_can.c | 8 +-
drivers/net/can/rcar/rcar_canfd.c | 6 +-
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 4 +-
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 4 +-
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 17 ++--
drivers/net/ethernet/freescale/enetc/enetc.c | 5 ++
drivers/net/ethernet/ibm/ehea/ehea_main.c | 1 +
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 100 ++++++++++++---------
drivers/net/ethernet/intel/i40e/i40e_type.h | 4 +
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 43 ++++++---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 1 +
drivers/net/ethernet/lantiq_etop.c | 1 -
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 10 +--
.../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 3 -
drivers/net/ethernet/micrel/ksz884x.c | 2 +-
drivers/net/ethernet/socionext/netsec.c | 2 +
drivers/usb/core/quirks.c | 9 ++
drivers/usb/dwc3/gadget.c | 8 +-
drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +
drivers/usb/host/xhci-mem.c | 20 +++--
drivers/usb/host/xhci-pci.c | 8 +-
drivers/video/fbdev/smscufx.c | 55 ++++++------
drivers/xen/gntdev.c | 30 +++++--
fs/kernfs/dir.c | 5 +-
fs/xfs/xfs_bmap_util.c | 2 +-
fs/xfs/xfs_file.c | 17 +++-
fs/xfs/xfs_qm.c | 1 +
include/linux/mlx5/driver.h | 2 +-
include/media/v4l2-common.h | 3 +-
include/uapi/linux/videodev2.h | 3 +-
kernel/cgroup/cgroup-v1.c | 3 +
kernel/power/hibernate.c | 2 +-
mm/hugetlb.c | 2 +-
net/can/j1939/transport.c | 4 +-
net/core/net_namespace.c | 7 ++
net/ieee802154/socket.c | 4 +-
net/ipv4/nexthop.c | 2 +-
net/ipv4/tcp_input.c | 3 +-
net/kcm/kcmsock.c | 23 +++--
net/mac802154/rx.c | 5 +-
net/openvswitch/datapath.c | 3 +-
net/tipc/topsrv.c | 16 +++-
sound/aoa/soundbus/i2sbus/core.c | 7 +-
sound/pci/ac97/ac97_codec.c | 1 +
sound/pci/au88x0/au88x0.h | 6 +-
sound/pci/au88x0/au88x0_core.c | 2 +-
sound/synth/emux/emux.c | 7 +-
tools/iio/iio_utils.c | 4 +
tools/perf/util/auxtrace.c | 10 ++-
66 files changed, 423 insertions(+), 176 deletions(-)
This is the start of the stable review cycle for the 4.9.332 release.
There are 44 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 Fri, 04 Nov 2022 02:20:38 +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/v4.x/stable-review/patch-4.9.332-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.9.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.9.332-rc1
Biju Das <biju.das.jz(a)bp.renesas.com>
can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive
Yang Yingliang <yangyingliang(a)huawei.com>
net: ehea: fix possible memory leak in ehea_register_port()
Aaron Conole <aconole(a)redhat.com>
openvswitch: switch from WARN to pr_warn
Takashi Iwai <tiwai(a)suse.de>
ALSA: aoa: Fix I2S device accounting
Yang Yingliang <yangyingliang(a)huawei.com>
ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev()
Yang Yingliang <yangyingliang(a)huawei.com>
net: ksz884x: fix missing pci_disable_device() on error in pcidev_init()
Slawomir Laba <slawomirx.laba(a)intel.com>
i40e: Fix ethtool rx-flow-hash setting for X722
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: videodev2.h: V4L2_DV_BT_BLANKING_HEIGHT should check 'interlaced'
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: v4l2-dv-timings: add sanity checks for blanking values
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: dev->bitmap_cap wasn't freed in all cases
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: s_fbuf: add more sanity checks
Dongliang Mu <dzm91(a)hust.edu.cn>
can: mscan: mpc5xxx: mpc5xxx_can_probe(): add missing put_clock() in error path
Neal Cardwell <ncardwell(a)google.com>
tcp: fix indefinite deferral of RTO with SACK reneging
Zhang Changzhong <zhangchangzhong(a)huawei.com>
net: lantiq_etop: don't free skb when returning NETDEV_TX_BUSY
Eric Dumazet <edumazet(a)google.com>
kcm: annotate data-races around kcm->rx_wait
Eric Dumazet <edumazet(a)google.com>
kcm: annotate data-races around kcm->rx_psock
Yang Yingliang <yangyingliang(a)huawei.com>
ALSA: ac97: fix possible memory leak in snd_ac97_dev_register()
Randy Dunlap <rdunlap(a)infradead.org>
arc: iounmap() arg is volatile
Nathan Huckleberry <nhuck(a)google.com>
drm/msm: Fix return type of mdp4_lvds_connector_mode_valid
Wei Yongjun <weiyongjun1(a)huawei.com>
net: ieee802154: fix error return code in dgram_bind()
Rik van Riel <riel(a)surriel.com>
mm,hugetlb: take hugetlb_lock before decrementing h->resv_huge_pages
M. Vefa Bicakci <m.v.b(a)runbox.com>
xen/gntdev: Prevent leaking grants
Jan Beulich <jbeulich(a)suse.com>
Xen/gntdev: don't ignore kernel unmapping error
Heiko Carstens <hca(a)linux.ibm.com>
s390/futex: add missing EX_TABLE entry to __futex_atomic_op()
Christian A. Ehrhardt <lk(a)c--e.de>
kernfs: fix use-after-free in __kernfs_remove
Matthew Ma <mahongwei(a)zeku.com>
mmc: core: Fix kernel panic when remove non-standard SDIO card
Johan Hovold <johan+linaro(a)kernel.org>
drm/msm/hdmi: fix memory corruption with too many bridges
Miquel Raynal <miquel.raynal(a)bootlin.com>
mac802154: Fix LQI recording
Hyunwoo Kim <imv4bel(a)gmail.com>
fbdev: smscufx: Fix several use-after-free bugs
Matti Vaittinen <mazziesaccount(a)gmail.com>
tools: iio: iio_utils: fix digit calculation
Mathias Nyman <mathias.nyman(a)linux.intel.com>
xhci: Remove device endpoints from bandwidth list when freeing the device
Justin Chen <justinpopo6(a)gmail.com>
usb: bdc: change state when port disconnected
Hannu Hartikainen <hannu(a)hrtk.in>
USB: add RESET_RESUME quirk for NVIDIA Jetson devices in RCM
Jason A. Donenfeld <Jason(a)zx2c4.com>
ALSA: au88x0: use explicitly signed char
Steven Rostedt (Google) <rostedt(a)goodmis.org>
ALSA: Use del_timer_sync() before freeing timer
Werner Sembach <wse(a)tuxedocomputers.com>
ACPI: video: Force backlight native for more TongFang devices
Yang Yingliang <yangyingliang(a)huawei.com>
net: hns: fix possible memory leak in hnae_ae_register()
Xiaobo Liu <cppcoffee(a)gmail.com>
net/atm: fix proc_mpc_write incorrect return value
José Expósito <jose.exposito89(a)gmail.com>
HID: magicmouse: Do not set BTN_MOUSE on double report
James Morse <james.morse(a)arm.com>
arm64: errata: Remove AES hwcap for COMPAT tasks
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
ata: ahci: Match EM_MAX_SLOTS with SATA_PMP_MAX_PORTS
Alexander Stein <alexander.stein(a)ew.tq-group.com>
ata: ahci-imx: Fix MODULE_ALIAS
Joseph Qi <joseph.qi(a)linux.alibaba.com>
ocfs2: fix BUG when iput after ocfs2_mknod fails
Joseph Qi <joseph.qi(a)linux.alibaba.com>
ocfs2: clear dinode links count in case of error
-------------
Diffstat:
Documentation/arm64/silicon-errata.txt | 2 +
Makefile | 4 +-
arch/arc/include/asm/io.h | 2 +-
arch/arc/mm/ioremap.c | 2 +-
arch/arm64/Kconfig | 16 ++++++
arch/arm64/include/asm/cpucaps.h | 3 +-
arch/arm64/kernel/cpu_errata.c | 16 ++++++
arch/arm64/kernel/cpufeature.c | 13 ++++-
arch/s390/include/asm/futex.h | 3 +-
drivers/acpi/video_detect.c | 64 ++++++++++++++++++++++
drivers/ata/ahci.h | 2 +-
drivers/ata/ahci_imx.c | 2 +-
drivers/gpu/drm/msm/hdmi/hdmi.c | 5 ++
drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c | 5 +-
drivers/hid/hid-magicmouse.c | 2 +-
drivers/media/platform/vivid/vivid-core.c | 22 ++++++++
drivers/media/platform/vivid/vivid-core.h | 2 +
drivers/media/platform/vivid/vivid-vid-cap.c | 27 +++++++--
drivers/media/v4l2-core/v4l2-dv-timings.c | 14 +++++
drivers/mmc/core/sdio_bus.c | 3 +-
drivers/net/can/mscan/mpc5xxx_can.c | 8 ++-
drivers/net/can/rcar/rcar_canfd.c | 6 +-
drivers/net/ethernet/hisilicon/hns/hnae.c | 4 +-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 1 +
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 31 ++++++++---
drivers/net/ethernet/intel/i40e/i40e_type.h | 4 ++
drivers/net/ethernet/lantiq_etop.c | 1 -
drivers/net/ethernet/micrel/ksz884x.c | 2 +-
drivers/usb/core/quirks.c | 9 +++
drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +
drivers/usb/host/xhci-mem.c | 20 ++++---
drivers/video/fbdev/smscufx.c | 55 ++++++++++---------
drivers/xen/gntdev.c | 30 ++++++++--
fs/kernfs/dir.c | 5 +-
fs/ocfs2/namei.c | 23 ++++----
include/uapi/linux/videodev2.h | 3 +-
mm/hugetlb.c | 2 +-
net/atm/mpoa_proc.c | 3 +-
net/ieee802154/socket.c | 4 +-
net/ipv4/tcp_input.c | 3 +-
net/kcm/kcmsock.c | 23 +++++---
net/mac802154/rx.c | 5 +-
net/openvswitch/datapath.c | 3 +-
sound/aoa/soundbus/i2sbus/core.c | 7 ++-
sound/pci/ac97/ac97_codec.c | 1 +
sound/pci/au88x0/au88x0.h | 6 +-
sound/pci/au88x0/au88x0_core.c | 2 +-
sound/synth/emux/emux.c | 7 +--
tools/iio/iio_utils.c | 4 ++
49 files changed, 369 insertions(+), 113 deletions(-)
This is the start of the stable review cycle for the 4.14.298 release.
There are 60 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 Fri, 04 Nov 2022 02:20:38 +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/v4.x/stable-review/patch-4.14.298-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.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.14.298-rc1
Biju Das <biju.das.jz(a)bp.renesas.com>
can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive
Yang Yingliang <yangyingliang(a)huawei.com>
net: ehea: fix possible memory leak in ehea_register_port()
Aaron Conole <aconole(a)redhat.com>
openvswitch: switch from WARN to pr_warn
Takashi Iwai <tiwai(a)suse.de>
ALSA: aoa: Fix I2S device accounting
Yang Yingliang <yangyingliang(a)huawei.com>
ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev()
Sudeep Holla <sudeep.holla(a)arm.com>
PM: domains: Fix handling of unavailable/disabled idle states
Yang Yingliang <yangyingliang(a)huawei.com>
net: ksz884x: fix missing pci_disable_device() on error in pcidev_init()
Slawomir Laba <slawomirx.laba(a)intel.com>
i40e: Fix flow-type by setting GL_HASH_INSET registers
Slawomir Laba <slawomirx.laba(a)intel.com>
i40e: Fix ethtool rx-flow-hash setting for X722
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: videodev2.h: V4L2_DV_BT_BLANKING_HEIGHT should check 'interlaced'
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: v4l2-dv-timings: add sanity checks for blanking values
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: dev->bitmap_cap wasn't freed in all cases
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: s_fbuf: add more sanity checks
Mario Limonciello <mario.limonciello(a)amd.com>
PM: hibernate: Allow hybrid sleep to work with s2idle
Dongliang Mu <dzm91(a)hust.edu.cn>
can: mscan: mpc5xxx: mpc5xxx_can_probe(): add missing put_clock() in error path
Neal Cardwell <ncardwell(a)google.com>
tcp: fix indefinite deferral of RTO with SACK reneging
Zhang Changzhong <zhangchangzhong(a)huawei.com>
net: lantiq_etop: don't free skb when returning NETDEV_TX_BUSY
Eric Dumazet <edumazet(a)google.com>
kcm: annotate data-races around kcm->rx_wait
Eric Dumazet <edumazet(a)google.com>
kcm: annotate data-races around kcm->rx_psock
Raju Rangoju <Raju.Rangoju(a)amd.com>
amd-xgbe: add the bit rate quirk for Molex cables
Raju Rangoju <Raju.Rangoju(a)amd.com>
amd-xgbe: fix the SFP compliance codes check for DAC cables
Chen Zhongjin <chenzhongjin(a)huawei.com>
x86/unwind/orc: Fix unreliable stack dump with gcov
Yang Yingliang <yangyingliang(a)huawei.com>
ALSA: ac97: fix possible memory leak in snd_ac97_dev_register()
Randy Dunlap <rdunlap(a)infradead.org>
arc: iounmap() arg is volatile
Nathan Huckleberry <nhuck(a)google.com>
drm/msm: Fix return type of mdp4_lvds_connector_mode_valid
Wei Yongjun <weiyongjun1(a)huawei.com>
net: ieee802154: fix error return code in dgram_bind()
Rik van Riel <riel(a)surriel.com>
mm,hugetlb: take hugetlb_lock before decrementing h->resv_huge_pages
M. Vefa Bicakci <m.v.b(a)runbox.com>
xen/gntdev: Prevent leaking grants
Jan Beulich <jbeulich(a)suse.com>
Xen/gntdev: don't ignore kernel unmapping error
Heiko Carstens <hca(a)linux.ibm.com>
s390/futex: add missing EX_TABLE entry to __futex_atomic_op()
Christian A. Ehrhardt <lk(a)c--e.de>
kernfs: fix use-after-free in __kernfs_remove
Matthew Ma <mahongwei(a)zeku.com>
mmc: core: Fix kernel panic when remove non-standard SDIO card
Johan Hovold <johan+linaro(a)kernel.org>
drm/msm/hdmi: fix memory corruption with too many bridges
Miquel Raynal <miquel.raynal(a)bootlin.com>
mac802154: Fix LQI recording
Hyunwoo Kim <imv4bel(a)gmail.com>
fbdev: smscufx: Fix several use-after-free bugs
Shreeya Patel <shreeya.patel(a)collabora.com>
iio: light: tsl2583: Fix module unloading
Matti Vaittinen <mazziesaccount(a)gmail.com>
tools: iio: iio_utils: fix digit calculation
Mathias Nyman <mathias.nyman(a)linux.intel.com>
xhci: Remove device endpoints from bandwidth list when freeing the device
Jens Glathe <jens.glathe(a)oldschoolsolutions.biz>
usb: xhci: add XHCI_SPURIOUS_SUCCESS to ASM1042 despite being a V0.96 controller
Justin Chen <justinpopo6(a)gmail.com>
usb: bdc: change state when port disconnected
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Don't set IMI for no_interrupt
Hannu Hartikainen <hannu(a)hrtk.in>
USB: add RESET_RESUME quirk for NVIDIA Jetson devices in RCM
Jason A. Donenfeld <Jason(a)zx2c4.com>
ALSA: au88x0: use explicitly signed char
Steven Rostedt (Google) <rostedt(a)goodmis.org>
ALSA: Use del_timer_sync() before freeing timer
Werner Sembach <wse(a)tuxedocomputers.com>
ACPI: video: Force backlight native for more TongFang devices
Chen-Yu Tsai <wenst(a)chromium.org>
media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls
Jerry Snitselaar <jsnitsel(a)redhat.com>
iommu/vt-d: Clean up si_domain in the init_dmars() error path
Yang Yingliang <yangyingliang(a)huawei.com>
net: hns: fix possible memory leak in hnae_ae_register()
Xiaobo Liu <cppcoffee(a)gmail.com>
net/atm: fix proc_mpc_write incorrect return value
José Expósito <jose.exposito89(a)gmail.com>
HID: magicmouse: Do not set BTN_MOUSE on double report
Tony Luck <tony.luck(a)intel.com>
ACPI: extlog: Handle multiple records
Filipe Manana <fdmanana(a)suse.com>
btrfs: fix processing of delayed data refs during backref walking
Jean-Francois Le Fillatre <jflf_kernel(a)gmx.com>
r8152: add PID for the Lenovo OneLink+ Dock
James Morse <james.morse(a)arm.com>
arm64: errata: Remove AES hwcap for COMPAT tasks
Eric Ren <renzhengeek(a)gmail.com>
KVM: arm64: vgic: Fix exit condition in scan_its_table()
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
ata: ahci: Match EM_MAX_SLOTS with SATA_PMP_MAX_PORTS
Alexander Stein <alexander.stein(a)ew.tq-group.com>
ata: ahci-imx: Fix MODULE_ALIAS
Borislav Petkov <bp(a)suse.de>
x86/microcode/AMD: Apply the patch early on every logical thread
Joseph Qi <joseph.qi(a)linux.alibaba.com>
ocfs2: fix BUG when iput after ocfs2_mknod fails
Joseph Qi <joseph.qi(a)linux.alibaba.com>
ocfs2: clear dinode links count in case of error
-------------
Diffstat:
Documentation/arm64/silicon-errata.txt | 2 +
Makefile | 4 +-
arch/arc/include/asm/io.h | 2 +-
arch/arc/mm/ioremap.c | 2 +-
arch/arm64/Kconfig | 16 ++++
arch/arm64/include/asm/cpucaps.h | 3 +-
arch/arm64/kernel/cpu_errata.c | 16 ++++
arch/arm64/kernel/cpufeature.c | 13 ++-
arch/s390/include/asm/futex.h | 3 +-
arch/x86/kernel/cpu/microcode/amd.c | 16 +++-
arch/x86/kernel/unwind_orc.c | 2 +-
drivers/acpi/acpi_extlog.c | 33 ++++---
drivers/acpi/video_detect.c | 64 +++++++++++++
drivers/ata/ahci.h | 2 +-
drivers/ata/ahci_imx.c | 2 +-
drivers/base/power/domain.c | 4 +
drivers/gpu/drm/msm/hdmi/hdmi.c | 5 ++
drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c | 5 +-
drivers/hid/hid-magicmouse.c | 2 +-
drivers/iio/light/tsl2583.c | 2 +-
drivers/iommu/intel-iommu.c | 5 ++
drivers/media/platform/vivid/vivid-core.c | 22 +++++
drivers/media/platform/vivid/vivid-core.h | 2 +
drivers/media/platform/vivid/vivid-vid-cap.c | 27 ++++--
drivers/media/v4l2-core/v4l2-dv-timings.c | 14 +++
drivers/media/v4l2-core/v4l2-mem2mem.c | 62 +++++++++----
drivers/mmc/core/sdio_bus.c | 3 +-
drivers/net/can/mscan/mpc5xxx_can.c | 8 +-
drivers/net/can/rcar/rcar_canfd.c | 6 +-
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 17 ++--
drivers/net/ethernet/hisilicon/hns/hnae.c | 4 +-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 1 +
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 100 ++++++++++++---------
drivers/net/ethernet/intel/i40e/i40e_type.h | 4 +
drivers/net/ethernet/lantiq_etop.c | 1 -
drivers/net/ethernet/micrel/ksz884x.c | 2 +-
drivers/net/usb/cdc_ether.c | 7 ++
drivers/net/usb/r8152.c | 1 +
drivers/usb/core/quirks.c | 9 ++
drivers/usb/dwc3/gadget.c | 4 +-
drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +
drivers/usb/host/xhci-mem.c | 20 +++--
drivers/usb/host/xhci-pci.c | 8 +-
drivers/video/fbdev/smscufx.c | 55 ++++++------
drivers/xen/gntdev.c | 30 +++++--
fs/btrfs/backref.c | 33 +++++--
fs/kernfs/dir.c | 5 +-
fs/ocfs2/namei.c | 23 +++--
include/uapi/linux/videodev2.h | 3 +-
kernel/power/hibernate.c | 2 +-
mm/hugetlb.c | 2 +-
net/atm/mpoa_proc.c | 3 +-
net/ieee802154/socket.c | 4 +-
net/ipv4/tcp_input.c | 3 +-
net/kcm/kcmsock.c | 23 +++--
net/mac802154/rx.c | 5 +-
net/openvswitch/datapath.c | 3 +-
sound/aoa/soundbus/i2sbus/core.c | 7 +-
sound/pci/ac97/ac97_codec.c | 1 +
sound/pci/au88x0/au88x0.h | 6 +-
sound/pci/au88x0/au88x0_core.c | 2 +-
sound/synth/emux/emux.c | 7 +-
tools/iio/iio_utils.c | 4 +
virt/kvm/arm/vgic/vgic-its.c | 5 +-
64 files changed, 553 insertions(+), 199 deletions(-)
From: Thomas Gleixner <tglx(a)linutronix.de>
v4.19.255-rt114-rc2 stable review patch.
If anyone has any objections, please let me know.
-----------
Upstream commit bb7262b295472eb6858b5c49893954794027cd84
syzbot reported KCSAN data races vs. timer_base::timer_running being set to
NULL without holding base::lock in expire_timers().
This looks innocent and most reads are clearly not problematic, but
Frederic identified an issue which is:
int data = 0;
void timer_func(struct timer_list *t)
{
data = 1;
}
CPU 0 CPU 1
------------------------------ --------------------------
base = lock_timer_base(timer, &flags); raw_spin_unlock(&base->lock);
if (base->running_timer != timer) call_timer_fn(timer, fn, baseclk);
ret = detach_if_pending(timer, base, true); base->running_timer = NULL;
raw_spin_unlock_irqrestore(&base->lock, flags); raw_spin_lock(&base->lock);
x = data;
If the timer has previously executed on CPU 1 and then CPU 0 can observe
base->running_timer == NULL and returns, assuming the timer has completed,
but it's not guaranteed on all architectures. The comment for
del_timer_sync() makes that guarantee. Moving the assignment under
base->lock prevents this.
For non-RT kernel it's performance wise completely irrelevant whether the
store happens before or after taking the lock. For an RT kernel moving the
store under the lock requires an extra unlock/lock pair in the case that
there is a waiter for the timer, but that's not the end of the world.
Reported-by: syzbot+aa7c2385d46c5eba0b89(a)syzkaller.appspotmail.com
Reported-by: syzbot+abea4558531bae1ba9fe(a)syzkaller.appspotmail.com
Fixes: 030dcdd197d7 ("timers: Prepare support for PREEMPT_RT")
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Tested-by: Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
Link: https://lore.kernel.org/r/87lfea7gw8.fsf@nanos.tec.linutronix.de
Cc: stable(a)vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
Signed-off-by: Daniel Wagner <wagi(a)monom.org>
---
kernel/time/timer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index b859ecf6424b..603985720f54 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1282,8 +1282,10 @@ static inline void timer_base_unlock_expiry(struct timer_base *base)
static void timer_sync_wait_running(struct timer_base *base)
{
if (atomic_read(&base->timer_waiters)) {
+ raw_spin_unlock_irq(&base->lock);
spin_unlock(&base->expiry_lock);
spin_lock(&base->expiry_lock);
+ raw_spin_lock_irq(&base->lock);
}
}
@@ -1458,14 +1460,14 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head)
if (timer->flags & TIMER_IRQSAFE) {
raw_spin_unlock(&base->lock);
call_timer_fn(timer, fn);
- base->running_timer = NULL;
raw_spin_lock(&base->lock);
+ base->running_timer = NULL;
} else {
raw_spin_unlock_irq(&base->lock);
call_timer_fn(timer, fn);
+ raw_spin_lock_irq(&base->lock);
base->running_timer = NULL;
timer_sync_wait_running(base);
- raw_spin_lock_irq(&base->lock);
}
}
}
--
2.38.0
From: Roberto Sassu <roberto.sassu(a)huawei.com>
Commit f3cc6b25dcc5 ("ima: always measure and audit files in policy") lets
measurement or audit happen even if the file digest cannot be calculated.
As a result, iint->ima_hash could have been allocated despite
ima_collect_measurement() returning an error.
Since ima_hash belongs to a temporary inode metadata structure, declared
at the beginning of __ima_inode_hash(), just add a kfree() call if
ima_collect_measurement() returns an error different from -ENOMEM (in that
case, ima_hash should not have been allocated).
Cc: stable(a)vger.kernel.org
Fixes: 280fe8367b0d ("ima: Always return a file measurement in ima_file_hash()")
Signed-off-by: Roberto Sassu <roberto.sassu(a)huawei.com>
---
security/integrity/ima/ima_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 040b03ddc1c7..4a207a3ef7ef 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -542,8 +542,13 @@ static int __ima_inode_hash(struct inode *inode, struct file *file, char *buf,
rc = ima_collect_measurement(&tmp_iint, file, NULL, 0,
ima_hash_algo, NULL);
- if (rc < 0)
+ if (rc < 0) {
+ /* ima_hash could be allocated in case of failure. */
+ if (rc != -ENOMEM)
+ kfree(tmp_iint.ima_hash);
+
return -EOPNOTSUPP;
+ }
iint = &tmp_iint;
mutex_lock(&iint->mutex);
--
2.25.1