4.9.149-stable review
Subsystems (3)
Greg Kroah-Hartman
maintainercover 4.9.149-stable review
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. 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.149-rc1.gz
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 <[email protected]>
Linux 4.9.149-rc1
Tomas Winkler <[email protected]>
tpm: tpm_i2c_nuvoton: use correct command duration for TPM 2.x
Maciej W. Rozycki <[email protected]>
rtc: m41t80: Correct alarm month range with RTC reads
Will Deacon <[email protected]>
arm64: KVM: Avoid setting the upper 32 bits of VTCR_EL2 to 1
Vitaly Kuznetsov <[email protected]>
x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested
Georgy A Bystrenin <[email protected]>
CIFS: Fix error mapping for SMB2_LOCK command which caused OFD lock problem
Aaro Koskinen <[email protected]>
MIPS: OCTEON: mark RGMII interface disabled on OCTEON III
Huacai Chen <[email protected]>
MIPS: Align kernel load address to 64KB
Huacai Chen <[email protected]>
MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()
Hans Verkuil <[email protected]>
media: v4l2-tpg: array index could become negative
Hans Verkuil <[email protected]>
media: vivid: free bitmap_cap when updating std/timings/etc.
Nava kishore Manne <[email protected]>
serial: uartps: Fix interrupt mask issue to handle the RX interrupts properly
Martin Blumenstingl <[email protected]>
f2fs: fix validation of the block count in sanity_check_raw_super
Breno Leitao <[email protected]>
powerpc/tm: Set MSR[TS] just prior to recheckpoint
Josef Bacik <[email protected]>
btrfs: run delayed items before dropping the snapshot
Filipe Manana <[email protected]>
Btrfs: fix fsync of files with multiple hard links in new directories
Macpaul Lin <[email protected]>
cdc-acm: fix abnormal DATA RX issue for Mediatek Preloader.
Johan Jonker <[email protected]>
clk: rockchip: fix typo in rk3188 spdif_frac parent
Lukas Wunner <[email protected]>
spi: bcm2835: Avoid finishing transfer prematurely in IRQ mode
Lukas Wunner <[email protected]>
spi: bcm2835: Fix book-keeping of DMA termination
Lukas Wunner <[email protected]>
spi: bcm2835: Fix race on DMA termination
Theodore Ts'o <[email protected]>
ext4: check for shutdown and r/o file system in ext4_write_inode()
Theodore Ts'o <[email protected]>
ext4: force inode writes when nfsd calls commit_metadata()
Theodore Ts'o <[email protected]>
ext4: include terminating u32 in size of xattr entries when expanding inodes
ruippan (潘睿) <[email protected]>
ext4: fix EXT4_IOC_GROUP_ADD ioctl
Maurizio Lombardi <[email protected]>
ext4: missing unlock/put_page() in ext4_try_to_write_inline_data()
Pan Bian <[email protected]>
ext4: fix possible use after free in ext4_quota_enable
Ben Hutchings <[email protected]>
perf pmu: Suppress potential format-truncation warning
Miquel Raynal <[email protected]>
platform-msi: Free descriptors in platform_msi_domain_free()
Sean Christopherson <[email protected]>
KVM: x86: Use jmp to invoke kvm_spurious_fault() from .fixup
Patrick Dreyer <[email protected]>
Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G
Bjørn Mork <[email protected]>
qmi_wwan: apply SET_DTR quirk to the SIMCOM shared device ID
Colin Ian King <[email protected]>
staging: wilc1000: fix missing read_write setting when reading data
Jia-Ju Bai <[email protected]>
usb: r8a66597: Fix a possible concurrency use-after-free bug in r8a66597_endpoint_disable()
Jörgen Storvist <[email protected]>
USB: serial: option: add Fibocom NL678 series
Scott Chen <[email protected]>
USB: serial: pl2303: add ids for Hewlett-Packard HP POS pole displays
Sameer Pujar <[email protected]>
ALSA: hda/tegra: clear pending irq handlers
Mantas Mikulėnas <[email protected]>
ALSA: hda: add mute LED support for HP EliteBook 840 G4
Arnd Bergmann <[email protected]>
mtd: atmel-quadspi: disallow building on ebsa110
Gustavo A. R. Silva <[email protected]>
ALSA: emux: Fix potential Spectre v1 vulnerabilities
Gustavo A. R. Silva <[email protected]>
ALSA: pcm: Fix potential Spectre v1 vulnerability
Gustavo A. R. Silva <[email protected]>
ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities
Gustavo A. R. Silva <[email protected]>
ALSA: rme9652: Fix potential Spectre v1 vulnerability
Cong Wang <[email protected]>
ptr_ring: wrap back ->producer in __ptr_ring_swap_queue()
Deepa Dinamani <[email protected]>
sock: Make sock->sk_stamp thread-safe
Yuval Avnery <[email protected]>
net/mlx5: Typo fix in del_sw_hw_rule
Alaa Hleihel <[email protected]>
net/mlx5e: Remove the false indication of software timestamping support
Lorenzo Bianconi <[email protected]>
gro_cell: add napi_disable in gro_cells_destroy
Cong Wang <[email protected]>
tipc: compare remote and local protocols in tipc_udp_enable()
Cong Wang <[email protected]>
tipc: use lock_sock() in tipc_sk_reinit()
Juergen Gross <[email protected]>
xen/netfront: tolerate frags with no data
Jorgen Hansen <[email protected]>
VSOCK: Send reset control packet when socket is partially bound
Jason Wang <[email protected]>
vhost: make sure used idx is seen before log in vhost_add_used_n()
Cong Wang <[email protected]>
tipc: fix a double kfree_skb()
Xin Long <[email protected]>
sctp: initialize sin6_flowinfo for ipv6 addrs in sctp_inet6addr_event
Willem de Bruijn <[email protected]>
packet: validate address length if non-zero
Willem de Bruijn <[email protected]>
packet: validate address length
Cong Wang <[email protected]>
net/wan: fix a double free in x25_asy_open_tty()
Cong Wang <[email protected]>
netrom: fix locking in nr_find_socket()
Kunihiko Hayashi <[email protected]>
net: phy: Fix the issue that netif always links up after resuming
Michal Kubecek <[email protected]>
net: ipv4: do not handle duplicate fragments as overlapping
Eric Dumazet <[email protected]>
isdn: fix kernel-infoleak in capi_unlocked_ioctl
Eric Dumazet <[email protected]>
ipv6: tunnels: fix two use-after-free
Cong Wang <[email protected]>
ipv6: explicitly initialize udp6_addr in udp_sock_create6()
Willem de Bruijn <[email protected]>
ieee802154: lowpan_header_create check must check daddr
Tyrel Datwyler <[email protected]>
ibmveth: fix DMA unmap error in ibmveth_xmit_start error path
Cong Wang <[email protected]>
ax25: fix a use-after-free in ax25_fillin_cb()
Gustavo A. R. Silva <[email protected]>
phonet: af_phonet: Fix Spectre v1 vulnerability
Gustavo A. R. Silva <[email protected]>
net: core: Fix Spectre v1 vulnerability
Gustavo A. R. Silva <[email protected]>
ipv4: Fix potential Spectre v1 vulnerability
Gustavo A. R. Silva <[email protected]>
ip6mr: Fix potential Spectre v1 vulnerability
Guenter Roeck <[email protected]>
NFC: nxp-nci: Include unaligned.h instead of access_ok.h
-------------
Diffstat:
Makefile | 4 +- arch/arm64/include/asm/kvm_arm.h | 2 +- arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 7 ++- arch/mips/cavium-octeon/executive/cvmx-helper.c | 3 +- arch/mips/include/asm/pgtable-64.h | 5 ++ arch/powerpc/kernel/signal_32.c | 20 ++++++- arch/powerpc/kernel/signal_64.c | 44 +++++++++----- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 19 +++++- arch/x86/kvm/x86.c | 3 +- drivers/base/platform-msi.c | 6 +- drivers/char/tpm/tpm_i2c_nuvoton.c | 11 ++-- drivers/clk/rockchip/clk-rk3188.c | 2 +- drivers/input/mouse/elan_i2c_core.c | 1 + drivers/isdn/capi/kcapi.c | 4 +- drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 2 +- drivers/media/platform/vivid/vivid-vid-cap.c | 2 + drivers/mtd/spi-nor/Kconfig | 2 +- drivers/net/ethernet/ibm/ibmveth.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 11 +--- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +- drivers/net/phy/phy_device.c | 7 +-- drivers/net/usb/qmi_wwan.c | 2 +- drivers/net/wan/x25_asy.c | 2 + drivers/net/xen-netfront.c | 2 +- drivers/nfc/nxp-nci/firmware.c | 2 +- drivers/nfc/nxp-nci/i2c.c | 2 +- drivers/rtc/rtc-m41t80.c | 2 +- drivers/spi/spi-bcm2835.c | 14 ++--- drivers/staging/wilc1000/wilc_sdio.c | 1 + drivers/tty/serial/xilinx_uartps.c | 4 +- drivers/usb/class/cdc-acm.c | 10 ++++ drivers/usb/class/cdc-acm.h | 1 + drivers/usb/host/r8a66597-hcd.c | 5 +- drivers/usb/serial/option.c | 4 ++ drivers/usb/serial/pl2303.c | 5 ++ drivers/usb/serial/pl2303.h | 5 ++ drivers/vhost/vhost.c | 2 + fs/btrfs/btrfs_inode.h | 6 ++ fs/btrfs/extent-tree.c | 4 ++ fs/btrfs/inode.c | 17 ++++++ fs/btrfs/tree-log.c | 16 ++++++ fs/cifs/smb2maperror.c | 4 +- fs/ext4/inline.c | 5 +- fs/ext4/inode.c | 9 ++- fs/ext4/resize.c | 2 +- fs/ext4/super.c | 13 ++++- fs/ext4/xattr.c | 2 +- fs/f2fs/super.c | 6 +- include/linux/msi.h | 2 + include/linux/ptr_ring.h | 2 + include/net/gro_cells.h | 1 + include/net/sock.h | 36 +++++++++++- include/trace/events/ext4.h | 20 +++++++ net/ax25/af_ax25.c | 11 +++- net/ax25/ax25_dev.c | 2 + net/compat.c | 15 +++-- net/core/filter.c | 2 + net/core/sock.c | 3 + net/ieee802154/6lowpan/tx.c | 3 + net/ipv4/ip_fragment.c | 18 ++++-- net/ipv4/ipmr.c | 3 + net/ipv6/ip6_tunnel.c | 1 + net/ipv6/ip6_udp_tunnel.c | 3 +- net/ipv6/ip6_vti.c | 1 + net/ipv6/ip6mr.c | 4 ++ net/netrom/af_netrom.c | 15 +++-- net/packet/af_packet.c | 8 ++- net/phonet/af_phonet.c | 3 + net/sctp/ipv6.c | 1 + net/sunrpc/svcsock.c | 2 +- net/tipc/socket.c | 8 ++- net/tipc/udp_media.c | 9 ++- net/vmw_vsock/vmci_transport.c | 67 ++++++++++++++++------ sound/core/pcm.c | 2 + sound/pci/emu10k1/emufx.c | 5 ++ sound/pci/hda/hda_tegra.c | 2 + sound/pci/hda/patch_conexant.c | 1 + sound/pci/rme9652/hdsp.c | 10 ++-- sound/synth/emux/emux_hwdep.c | 7 ++- tools/perf/util/pmu.c | 8 +-- 81 files changed, 451 insertions(+), 136 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/71 NFC: nxp-nci: Include unaligned.h instead of access_ok.h
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit 2eee74b7e2a496dea49847c36fd09320505f45b7 upstream.
Directly including access_ok.h can result in the following compile errors if an architecture such as ia64 does not support direct unaligned accesses.
include/linux/unaligned/access_ok.h:7:19: error:
redefinition of 'get_unaligned_le16'include/linux/unaligned/le_struct.h:6:19: note:
previous definition of 'get_unaligned_le16' was hereinclude/linux/unaligned/access_ok.h:12:19: error:
redefinition of 'get_unaligned_le32'include/linux/unaligned/le_struct.h:11:19: note:
previous definition of 'get_unaligned_le32' was here
Include asm/unaligned.h instead and let the architecture decide which access functions to use.
--- drivers/nfc/nxp-nci/firmware.c | 2 +- drivers/nfc/nxp-nci/i2c.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/nfc/nxp-nci/firmware.c +1 -1
@@ -24,7 +24,7 @@#include <linux/completion.h> #include <linux/firmware.h> #include <linux/nfc.h> -#include <linux/unaligned/access_ok.h> +#include <asm/unaligned.h> #include "nxp-nci.h"
drivers/nfc/nxp-nci/i2c.c +1 -1
@@ -36,7 +36,7 @@#include <linux/of_gpio.h> #include <linux/of_irq.h> #include <linux/platform_data/nxp-nci.h> -#include <linux/unaligned/access_ok.h> +#include <asm/unaligned.h> #include <net/nfc/nfc.h>
Greg Kroah-Hartman
maintainerPATCH 2/71 ip6mr: Fix potential Spectre v1 vulnerability
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Gustavo A. R. Silva" <[email protected]>
[ Upstream commit 69d2c86766da2ded2b70281f1bf242cb0d58a778 ]
vr.mifi is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
net/ipv6/ip6mr.c:1845 ip6mr_ioctl() warn: potential spectre issue 'mrt->vif_table' [r] (local cap) net/ipv6/ip6mr.c:1919 ip6mr_compat_ioctl() warn: potential spectre issue 'mrt->vif_table' [r] (local cap)
Fix this by sanitizing vr.mifi before using it to index mrt->vif_table'
Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
--- net/ipv6/ip6mr.c | 4 ++++ 1 file changed, 4 insertions(+)
net/ipv6/ip6mr.c +4 -0
@@ -72,6 +72,8 @@ struct mr6_table {#endif }; +#include <linux/nospec.h> +struct ip6mr_rule {struct fib_rule common; };
@@ -1873,6 +1875,7 @@ int ip6mr_ioctl(struct sock *sk, int cmdreturn -EFAULT ;if (vr.mifi >= mrt->maxvif)return -EINVAL ; + vr.mifi =array_index_nospec (vr.mifi, mrt->maxvif);read_lock (&mrt_lock); vif = &mrt->vif6_table[vr.mifi];if (MIF_EXISTS (mrt, vr.mifi)) {
@@ -1947,6 +1950,7 @@ int ip6mr_compat_ioctl(struct sock *sk,return -EFAULT ;if (vr.mifi >= mrt->maxvif)return -EINVAL ; + vr.mifi =array_index_nospec (vr.mifi, mrt->maxvif);read_lock (&mrt_lock); vif = &mrt->vif6_table[vr.mifi];if (MIF_EXISTS (mrt, vr.mifi)) {
Greg Kroah-Hartman
maintainerPATCH 3/71 ipv4: Fix potential Spectre v1 vulnerability
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Gustavo A. R. Silva" <[email protected]>
[ Upstream commit 5648451e30a0d13d11796574919a359025d52cce ]
vr.vifi is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
net/ipv4/ipmr.c:1616 ipmr_ioctl() warn: potential spectre issue 'mrt->vif_table' [r] (local cap) net/ipv4/ipmr.c:1690 ipmr_compat_ioctl() warn: potential spectre issue 'mrt->vif_table' [r] (local cap)
Fix this by sanitizing vr.vifi before using it to index mrt->vif_table'
Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
--- net/ipv4/ipmr.c | 3 +++ 1 file changed, 3 insertions(+)
net/ipv4/ipmr.c +3 -0
@@ -68,6 +68,8 @@#include <linux/netconf.h> #include <net/nexthop.h> +#include <linux/nospec.h> +struct ipmr_rule {struct fib_rule common; };
@@ -1562,6 +1564,7 @@ int ipmr_compat_ioctl(struct sock *sk, ureturn -EFAULT ;if (vr.vifi >= mrt->maxvif)return -EINVAL ; + vr.vifi =array_index_nospec (vr.vifi, mrt->maxvif);read_lock (&mrt_lock); vif = &mrt->vif_table[vr.vifi];if (VIF_EXISTS (mrt, vr.vifi)) {
Greg Kroah-Hartman
maintainerPATCH 4/71 net: core: Fix Spectre v1 vulnerability
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Gustavo A. R. Silva" <[email protected]>
[ Upstream commit 50d5258634aee2e62832aa086d2fb0de00e72b91 ]
flen is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
net/core/filter.c:1101 bpf_check_classic() warn: potential spectre issue 'filter' [w]
Fix this by sanitizing flen before using it to index filter at line 1101:
switch (filter[flen - 1].code) {and through pc at line 1040:
const struct sock_filter *ftest = &filter[pc];
Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
--- net/core/filter.c | 2 ++ 1 file changed, 2 insertions(+)
net/core/filter.c +2 -0
@@ -51,6 +51,7 @@#include <net/dst_metadata.h> #include <net/dst.h> #include <net/sock_reuseport.h> +#include <linux/nospec.h> /** * sk_filter_trim_cap - run a packet through a socket filter
@@ -786,6 +787,7 @@ static int bpf_check_classic(const strucbool anc_found;int pc; + flen =array_index_nospec (flen,BPF_MAXINSNS +1 );/* Check the filter code now */ for (pc =0 ; pc < flen; pc++) {const struct sock_filter *ftest = &filter[pc];
Greg Kroah-Hartman
maintainerPATCH 5/71 phonet: af_phonet: Fix Spectre v1 vulnerability
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Gustavo A. R. Silva" <[email protected]>
[ Upstream commit d686026b1e6ed4ea27d630d8f54f9a694db088b2 ]
protocol is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
net/phonet/af_phonet.c:48 phonet_proto_get() warn: potential spectre issue 'proto_tab' [w] (local cap)
Fix this by sanitizing protocol before using it to index proto_tab.
Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
--- net/phonet/af_phonet.c | 3 +++ 1 file changed, 3 insertions(+)
net/phonet/af_phonet.c +3 -0
@@ -34,6 +34,8 @@#include <net/phonet/phonet.h> #include <net/phonet/pn_dev.h> +#include <linux/nospec.h> +/* Transport protocol registration */ static struct phonet_protocol *proto_tab[PHONET_NPROTO ]__read_mostly ;
@@ -43,6 +45,7 @@ static struct phonet_protocol *phonet_prif (protocol >=PHONET_NPROTO )return NULL ; + protocol =array_index_nospec (protocol,PHONET_NPROTO );rcu_read_lock (); pp =rcu_dereference (proto_tab[protocol]);
Greg Kroah-Hartman
maintainerPATCH 6/71 ax25: fix a use-after-free in ax25_fillin_cb()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit c433570458e49bccea5c551df628d058b3526289 ]
There are multiple issues here:
1. After freeing dev->ax25_ptr, we need to set it to NULL otherwise we may use a dangling pointer.
2. There is a race between ax25_setsockopt() and device notifier as reported by syzbot. Close it by holding RTNL lock.
3. We need to test if dev->ax25_ptr is NULL before using it.
--- net/ax25/af_ax25.c | 11 +++++++++-- net/ax25/ax25_dev.c | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-)
net/ax25/af_ax25.c +9 -2
@@ -654,15 +654,22 @@ static int ax25_setsockopt(struct socketbreak ; } - dev =dev_get_by_name (&init_net, devname); +rtnl_lock (); + dev =__dev_get_by_name (&init_net, devname);if (!dev) { +rtnl_unlock (); res = -ENODEV ;break ; } ax25->ax25_dev =ax25_dev_ax25dev (dev); +if (!ax25->ax25_dev) { +rtnl_unlock (); + res = -ENODEV ; +break ; + }ax25_fillin_cb (ax25, ax25->ax25_dev); -dev_put (dev); +rtnl_unlock ();break ;default :
net/ax25/ax25_dev.c +2 -0
@@ -116,6 +116,7 @@ void ax25_dev_device_down(struct net_devif ((s = ax25_dev_list) == ax25_dev) { ax25_dev_list = s->next;spin_unlock_bh (&ax25_dev_lock); + dev->ax25_ptr =NULL ;dev_put (dev);kfree (ax25_dev);return ;
@@ -125,6 +126,7 @@ void ax25_dev_device_down(struct net_devif (s->next == ax25_dev) { s->next = ax25_dev->next;spin_unlock_bh (&ax25_dev_lock); + dev->ax25_ptr =NULL ;dev_put (dev);kfree (ax25_dev);return ;
Greg Kroah-Hartman
maintainerPATCH 7/71 ibmveth: fix DMA unmap error in ibmveth_xmit_start error path
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyrel Datwyler <[email protected]>
[ Upstream commit 756af9c642329d54f048bac2a62f829b391f6944 ]
Commit 33a48ab105a7 ("ibmveth: Fix DMA unmap error") fixed an issue in the normal code path of ibmveth_xmit_start() that was originally introduced by Commit 6e8ab30ec677 ("ibmveth: Add scatter-gather support"). This original fix missed the error path where dma_unmap_page is wrongly called on the header portion in descs[0] which was mapped with dma_map_single. As a result a failure to DMA map any of the frags results in a dmesg warning when CONFIG_DMA_API_DEBUG is enabled.
------------[ cut here ]------------ DMA-API: ibmveth 30000002: device driver frees DMA memory with wrong function [device address=0x000000000a430000] [size=172 bytes] [mapped as page] [unmapped as single] WARNING: CPU: 1 PID: 8426 at kernel/dma/debug.c:1085 check_unmap+0x4fc/0xe10
...
<snip>
...
DMA-API: Mapped at:
ibmveth_start_xmit+0x30c/0xb60 dev_hard_start_xmit+0x100/0x450 sch_direct_xmit+0x224/0x490 __qdisc_run+0x20c/0x980 __dev_queue_xmit+0x1bc/0xf20
This fixes the API misuse by unampping descs[0] with dma_unmap_single.
--- drivers/net/ethernet/ibm/ibmveth.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmveth.c +5 -1
@@ -1162,11 +1162,15 @@ out: map_failed_frags: last = i+1 ; -for (i =0 ; i < last; i++) +for (i =1 ; i < last; i++)dma_unmap_page (&adapter->vdev->dev, descs[i].fields.address, descs[i].fields.flags_len &IBMVETH_BUF_LEN_MASK ,DMA_TO_DEVICE ); +dma_unmap_single (&adapter->vdev->dev, + descs[0 ].fields.address, + descs[0 ].fields.flags_len &IBMVETH_BUF_LEN_MASK , +DMA_TO_DEVICE ); map_failed:if (!firmware_has_feature (FW_FEATURE_CMO ))netdev_err (netdev,"tx: unable to map xmit buffer\n" );
Greg Kroah-Hartman
maintainerPATCH 8/71 ieee802154: lowpan_header_create check must check daddr
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
[ Upstream commit 40c3ff6d5e0809505a067dd423c110c5658c478c ]
Packet sockets may call dev_header_parse with NULL daddr. Make lowpan_header_ops.create fail.
--- net/ieee802154/6lowpan/tx.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/6lowpan/tx.c +3 -0
@@ -48,6 +48,9 @@ int lowpan_header_create(struct sk_buffconst struct ipv6hdr *hdr =ipv6_hdr (skb);struct neighbour *n; +if (!daddr) +return -EINVAL ; +/* TODO: * if this package isn't ipv6 one, where should it be routed? */
Greg Kroah-Hartman
maintainerPATCH 9/71 ipv6: explicitly initialize udp6_addr in udp_sock_create6()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit fb24274546310872eeeaf3d1d53799d8414aa0f2 ]
syzbot reported the use of uninitialized udp6_addr::sin6_scope_id. We can just set ::sin6_scope_id to zero, as tunnels are unlikely to use an IPv6 address that needs a scope id and there is no interface to bind in this context.
For net-next, it looks different as we have cfg->bind_ifindex there so we can probably call ipv6_iface_scope_id().
Same for ::sin6_flowinfo, tunnels don't use it.
--- net/ipv6/ip6_udp_tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/ip6_udp_tunnel.c +2 -1
@@ -15,7 +15,7 @@int udp_sock_create6 (struct net *net,struct udp_port_cfg *cfg,struct socket **sockp) { -struct sockaddr_in6 udp6_addr; +struct sockaddr_in6 udp6_addr = {};int err;struct socket *sock =NULL ;
@@ -42,6 +42,7 @@ int udp_sock_create6(struct net *net, st goto error;if (cfg->peer_udp_port) { +memset (&udp6_addr,0 ,sizeof (udp6_addr)); udp6_addr.sin6_family =AF_INET6 ;memcpy (&udp6_addr.sin6_addr, &cfg->peer_ip6,sizeof (udp6_addr.sin6_addr));
Greg Kroah-Hartman
maintainerPATCH 10/71 ipv6: tunnels: fix two use-after-free
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit cbb49697d5512ce9e61b45ce75d3ee43d7ea5524 ]
xfrm6_policy_check() might have re-allocated skb->head, we need to reload ipv6 header pointer.
sysbot reported :
BUG: KASAN: use-after-free in __ipv6_addr_type+0x302/0x32f net/ipv6/addrconf_core.c:40 Read of size 4 at addr ffff888191b8cb70 by task syz-executor2/1304 CPU: 0 PID: 1304 Comm: syz-executor2 Not tainted 4.20.0-rc7+ #356 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: <IRQ> __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 __ipv6_addr_type+0x302/0x32f net/ipv6/addrconf_core.c:40 ipv6_addr_type include/net/ipv6.h:403 [inline] ip6_tnl_get_cap+0x27/0x190 net/ipv6/ip6_tunnel.c:727 ip6_tnl_rcv_ctl+0xdb/0x2a0 net/ipv6/ip6_tunnel.c:757 vti6_rcv+0x336/0x8f3 net/ipv6/ip6_vti.c:321 xfrm6_ipcomp_rcv+0x1a5/0x3a0 net/ipv6/xfrm6_protocol.c:132 ip6_protocol_deliver_rcu+0x372/0x1940 net/ipv6/ip6_input.c:394 ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:434 NF_HOOK include/linux/netfilter.h:289 [inline] ip6_input+0xe9/0x600 net/ipv6/ip6_input.c:443 IPVS: ftp: loaded support on port[0] = 21 ip6_mc_input+0x514/0x11c0 net/ipv6/ip6_input.c:537 dst_input include/net/dst.h:450 [inline] ip6_rcv_finish+0x17a/0x330 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] ipv6_rcv+0x115/0x640 net/ipv6/ip6_input.c:272 __netif_receive_skb_one_core+0x14d/0x200 net/core/dev.c:4973 __netif_receive_skb+0x2c/0x1e0 net/core/dev.c:5083 process_backlog+0x24e/0x7a0 net/core/dev.c:5923 napi_poll net/core/dev.c:6346 [inline] net_rx_action+0x7fa/0x19b0 net/core/dev.c:6412 __do_softirq+0x308/0xb7e kernel/softirq.c:292 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1027 </IRQ> do_softirq.part.14+0x126/0x160 kernel/softirq.c:337 do_softirq+0x19/0x20 kernel/softirq.c:340 netif_rx_ni+0x521/0x860 net/core/dev.c:4569 dev_loopback_xmit+0x287/0x8c0 net/core/dev.c:3576 NF_HOOK include/linux/netfilter.h:289 [inline] ip6_finish_output2+0x193a/0x2930 net/ipv6/ip6_output.c:84 ip6_fragment+0x2b06/0x3850 net/ipv6/ip6_output.c:727 ip6_finish_output+0x6b7/0xc50 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x232/0x9d0 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:444 [inline] ip6_local_out+0xc5/0x1b0 net/ipv6/output_core.c:176 ip6_send_skb+0xbc/0x340 net/ipv6/ip6_output.c:1727 ip6_push_pending_frames+0xc5/0xf0 net/ipv6/ip6_output.c:1747 rawv6_push_pending_frames net/ipv6/raw.c:615 [inline] rawv6_sendmsg+0x3a3e/0x4b40 net/ipv6/raw.c:945
kobject: 'queues' (0000000089e6eea2): kobject_add_internal: parent: 'tunl0', set: '<NULL>'
kobject: 'queues' (0000000089e6eea2): kobject_uevent_env
inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798
kobject: 'queues' (0000000089e6eea2): kobject_uevent_env: filter function caused the event to drop!
sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 sock_write_iter+0x35e/0x5c0 net/socket.c:900 call_write_iter include/linux/fs.h:1857 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 kobject: 'rx-0' (00000000e2d902d9): kobject_add_internal: parent: 'queues', set: 'queues' kobject: 'rx-0' (00000000e2d902d9): kobject_uevent_env vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 kobject: 'rx-0' (00000000e2d902d9): fill_kobj_path: path = '/devices/virtual/net/tunl0/queues/rx-0' __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 kobject: 'tx-0' (00000000443b70ac): kobject_add_internal: parent: 'queues', set: 'queues' entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457669 Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9bd200bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457669 RDX: 000000000000058f RSI: 00000000200033c0 RDI: 0000000000000003
kobject: 'tx-0' (00000000443b70ac): kobject_uevent_env
RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9bd200c6d4
R13: 00000000004c2dcc R14: 00000000004da398 R15: 00000000ffffffff
Allocated by task 1304: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3684 [inline] __kmalloc_node_track_caller+0x50/0x70 mm/slab.c:3698 __kmalloc_reserve.isra.41+0x41/0xe0 net/core/skbuff.c:140 __alloc_skb+0x155/0x760 net/core/skbuff.c:208 kobject: 'tx-0' (00000000443b70ac): fill_kobj_path: path = '/devices/virtual/net/tunl0/queues/tx-0' alloc_skb include/linux/skbuff.h:1011 [inline] __ip6_append_data.isra.49+0x2f1a/0x3f50 net/ipv6/ip6_output.c:1450 ip6_append_data+0x1bc/0x2d0 net/ipv6/ip6_output.c:1619 rawv6_sendmsg+0x15ab/0x4b40 net/ipv6/raw.c:938 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2116 __sys_sendmsg+0x11d/0x280 net/socket.c:2154 __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg net/socket.c:2161 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2161 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe
kobject: 'gre0' (00000000cb1b2d7b): kobject_add_internal: parent: 'net', set: 'devices'
Freed by task 1304: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 skb_free_head+0x93/0xb0 net/core/skbuff.c:553 pskb_expand_head+0x3b2/0x10d0 net/core/skbuff.c:1498 __pskb_pull_tail+0x156/0x18a0 net/core/skbuff.c:1896 pskb_may_pull include/linux/skbuff.h:2188 [inline] _decode_session6+0xd11/0x14d0 net/ipv6/xfrm6_policy.c:150 __xfrm_decode_session+0x71/0x140 net/xfrm/xfrm_policy.c:3272 kobject: 'gre0' (00000000cb1b2d7b): kobject_uevent_env __xfrm_policy_check+0x380/0x2c40 net/xfrm/xfrm_policy.c:3322 __xfrm_policy_check2 include/net/xfrm.h:1170 [inline] xfrm_policy_check include/net/xfrm.h:1175 [inline] xfrm6_policy_check include/net/xfrm.h:1185 [inline] vti6_rcv+0x4bd/0x8f3 net/ipv6/ip6_vti.c:316 xfrm6_ipcomp_rcv+0x1a5/0x3a0 net/ipv6/xfrm6_protocol.c:132 ip6_protocol_deliver_rcu+0x372/0x1940 net/ipv6/ip6_input.c:394 ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:434 NF_HOOK include/linux/netfilter.h:289 [inline] ip6_input+0xe9/0x600 net/ipv6/ip6_input.c:443 ip6_mc_input+0x514/0x11c0 net/ipv6/ip6_input.c:537 dst_input include/net/dst.h:450 [inline] ip6_rcv_finish+0x17a/0x330 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] ipv6_rcv+0x115/0x640 net/ipv6/ip6_input.c:272 __netif_receive_skb_one_core+0x14d/0x200 net/core/dev.c:4973 __netif_receive_skb+0x2c/0x1e0 net/core/dev.c:5083 process_backlog+0x24e/0x7a0 net/core/dev.c:5923 kobject: 'gre0' (00000000cb1b2d7b): fill_kobj_path: path = '/devices/virtual/net/gre0' napi_poll net/core/dev.c:6346 [inline] net_rx_action+0x7fa/0x19b0 net/core/dev.c:6412 __do_softirq+0x308/0xb7e kernel/softirq.c:292 The buggy address belongs to the object at ffff888191b8cac0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 176 bytes inside of 512-byte region [ffff888191b8cac0, ffff888191b8ccc0) The buggy address belongs to the page: page:ffffea000646e300 count:1 mapcount:0 mapping:ffff8881da800940 index:0x0 flags: 0x2fffc0000000200(slab) raw: 02fffc0000000200 ffffea0006eaaa48 ffffea00065356c8 ffff8881da800940 raw: 0000000000000000 ffff888191b8c0c0 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected
kobject: 'queues' (000000005fd6226e): kobject_add_internal: parent: 'gre0', set: '<NULL>'
Memory state around the buggy address:
ffff888191b8ca00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888191b8ca80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff888191b8cb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888191b8cb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888191b8cc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb--- net/ipv6/ip6_tunnel.c | 1 + net/ipv6/ip6_vti.c | 1 + 2 files changed, 2 insertions(+)
net/ipv6/ip6_tunnel.c +1 -0
@@ -907,6 +907,7 @@ static int ipxip6_rcv(struct sk_buff *sk goto drop;if (!xfrm6_policy_check (NULL ,XFRM_POLICY_IN , skb)) goto drop; + ipv6h =ipv6_hdr (skb);if (!ip6_tnl_rcv_ctl (t, &ipv6h->daddr, &ipv6h->saddr)) goto drop;if (iptunnel_pull_header (skb,0 , tpi->proto, false))
net/ipv6/ip6_vti.c +1 -0
@@ -318,6 +318,7 @@ static int vti6_rcv(struct sk_buff *skb)return 0 ; } + ipv6h =ipv6_hdr (skb);if (!ip6_tnl_rcv_ctl (t, &ipv6h->daddr, &ipv6h->saddr)) { t->dev->stats.rx_dropped++;rcu_read_unlock ();
Greg Kroah-Hartman
maintainerPATCH 11/71 isdn: fix kernel-infoleak in capi_unlocked_ioctl
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit d63967e475ae10f286dbd35e189cb241e0b1f284 ]
Since capi_ioctl() copies 64 bytes after calling capi20_get_manufacturer() we need to ensure to not leak information to user.
BUG: KMSAN: kernel-infoleak in _copy_to_user+0x16b/0x1f0 lib/usercopy.c:32 CPU: 0 PID: 11245 Comm: syz-executor633 Not tainted 4.20.0-rc7+ #2 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x173/0x1d0 lib/dump_stack.c:113 kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:613 kmsan_internal_check_memory+0x9d4/0xb00 mm/kmsan/kmsan.c:704 kmsan_copy_to_user+0xab/0xc0 mm/kmsan/kmsan_hooks.c:601 _copy_to_user+0x16b/0x1f0 lib/usercopy.c:32 capi_ioctl include/linux/uaccess.h:177 [inline] capi_unlocked_ioctl+0x1a0b/0x1bf0 drivers/isdn/capi/capi.c:939 do_vfs_ioctl+0xebd/0x2bf0 fs/ioctl.c:46 ksys_ioctl fs/ioctl.c:713 [inline] __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl+0x1da/0x270 fs/ioctl.c:718 __x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:718 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x440019 Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffdd4659fb8 EFLAGS: 00000213 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440019 RDX: 0000000020000080 RSI: 00000000c0044306 RDI: 0000000000000003 RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8 R10: 0000000000000000 R11: 0000000000000213 R12: 00000000004018a0 R13: 0000000000401930 R14: 0000000000000000 R15: 0000000000000000
Local variable description: ----data.i@capi_unlocked_ioctl Variable was created at:
capi_ioctl drivers/isdn/capi/capi.c:747 [inline] capi_unlocked_ioctl+0x82/0x1bf0 drivers/isdn/capi/capi.c:939 do_vfs_ioctl+0xebd/0x2bf0 fs/ioctl.c:46
Bytes 12-63 of 64 are uninitialized
Memory access of size 64 starts at ffff88807ac5fce8 Data copied to user address 0000000020000080
--- drivers/isdn/capi/kcapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/isdn/capi/kcapi.c +2 -2
@@ -851,7 +851,7 @@ u16 capi20_get_manufacturer(u32 contr, uu16 ret;if (contr ==0 ) { -strlcpy (buf, capi_manufakturer,CAPI_MANUFACTURER_LEN ); +strncpy (buf, capi_manufakturer,CAPI_MANUFACTURER_LEN );return CAPI_NOERROR ; }
@@ -859,7 +859,7 @@ u16 capi20_get_manufacturer(u32 contr, u ctr =get_capi_ctr_by_nr (contr);if (ctr && ctr->state ==CAPI_CTR_RUNNING ) { -strlcpy (buf, ctr->manu,CAPI_MANUFACTURER_LEN ); +strncpy (buf, ctr->manu,CAPI_MANUFACTURER_LEN ); ret =CAPI_NOERROR ; }else ret =CAPI_REGNOTINSTALLED ;
Greg Kroah-Hartman
maintainerPATCH 12/71 net: ipv4: do not handle duplicate fragments as overlapping
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Kubecek <[email protected]>
[ Upstream commit ade446403bfb79d3528d56071a84b15351a139ad ]
Since commit 7969e5c40dfd ("ip: discard IPv4 datagrams with overlapping segments.") IPv4 reassembly code drops the whole queue whenever an overlapping fragment is received. However, the test is written in a way which detects duplicate fragments as overlapping so that in environments with many duplicate packets, fragmented packets may be undeliverable.
Add an extra test and for (potentially) duplicate fragment, only drop the new fragment rather than the whole queue. Only starting offset and length are checked, not the contents of the fragments as that would be too expensive. For similar reason, linear list ("run") of a rbtree node is not iterated, we only check if the new fragment is a subset of the interval covered by existing consecutive fragments.
v2: instead of an exact check iterating through linear list of an rbtree node, only check if the new fragment is subset of the "run" (suggested by Eric Dumazet)
--- net/ipv4/ip_fragment.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
net/ipv4/ip_fragment.c +12 -6
@@ -345,10 +345,10 @@ static int ip_frag_queue(struct ipq *qp, struct net *net = container_of(qp->q.net, struct net, ipv4.frags);struct rb_node **rbn, *parent;struct sk_buff *skb1, *prev_tail; +int ihl, end, skb1_run_end;struct net_device *dev;unsigned int fragsize;int flags, offset; -int ihl, end;int err = -ENOENT ;u8 ecn;
@@ -418,7 +418,9 @@ static int ip_frag_queue(struct ipq *qp,* overlapping fragment, the entire datagram (and any constituent * fragments) MUST be silently discarded. * -* We do the same here for IPv4 (and increment an snmp counter). +* We do the same here for IPv4 (and increment an snmp counter) but +* we do not want to drop the whole queue in response to a duplicate +* fragment. */ /* Find out where to put this fragment. */
@@ -442,13 +444,17 @@ static int ip_frag_queue(struct ipq *qp,do { parent = *rbn; skb1 =rb_to_skb (parent); + skb1_run_end = skb1->ip_defrag_offset + +FRAG_CB (skb1)->frag_run_len;if (end <= skb1->ip_defrag_offset) rbn = &parent->rb_left; -else if (offset >= skb1->ip_defrag_offset + -FRAG_CB (skb1)->frag_run_len) +else if (offset >= skb1_run_end) rbn = &parent->rb_right; -else /* Found an overlap with skb1. */ - goto discard_qp; +else if (offset >= skb1->ip_defrag_offset && + end <= skb1_run_end) + goto err;/* No new data, potential duplicate */ +else + goto discard_qp;/* Found an overlap */ }while (*rbn);/* Here we have parent properly set, and rbn pointing to * one of its NULL left/right children. Insert skb.
Greg Kroah-Hartman
maintainerPATCH 13/71 net: phy: Fix the issue that netif always links up after resuming
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kunihiko Hayashi <[email protected]>
[ Upstream commit 8742beb50f2db903d3b6d69ddd81d67ce9914453 ]
Even though the link is down before entering hibernation,
there is an issue that the network interface always links up after resuming from hibernation.
If the link is still down before enabling the network interface, and after resuming from hibernation, the phydev->state is forcibly set to PHY_UP in mdio_bus_phy_restore(), and the link becomes up.
In suspend sequence, only if the PHY is attached, mdio_bus_phy_suspend() calls phy_stop_machine(), and mdio_bus_phy_resume() calls phy_start_machine().
In resume sequence, it's enough to do the same as mdio_bus_phy_resume() because the state has been preserved.
This patch fixes the issue by calling phy_start_machine() in mdio_bus_phy_restore() in the same way as mdio_bus_phy_resume().
--- drivers/net/phy/phy_device.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/phy/phy_device.c +2 -5
@@ -163,11 +163,8 @@ static int mdio_bus_phy_restore(struct dif (ret <0 )return ret; -/* The PHY needs to renegotiate. */ - phydev->link =0 ; - phydev->state =PHY_UP ; - -phy_start_machine (phydev); +if (phydev->attached_dev && phydev->adjust_link) +phy_start_machine (phydev);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 14/71 netrom: fix locking in nr_find_socket()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 7314f5480f3e37e570104dc5e0f28823ef849e72 ]
nr_find_socket(), nr_find_peer() and nr_find_listener() lock the sock after finding it in the global list. However, the call path requires BH disabled for the sock lock consistently.
Actually the locking is unnecessary at this point, we can just hold the sock refcnt to make sure it is not gone after we unlock the global list, and lock it later only when needed.
--- net/netrom/af_netrom.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
net/netrom/af_netrom.c +10 -5
@@ -153,7 +153,7 @@ static struct sock *nr_find_listener(ax2sk_for_each (s, &nr_list)if (!ax25cmp (&nr_sk (s)->source_addr, addr) && s->sk_state ==TCP_LISTEN ) { -bh_lock_sock (s); +sock_hold (s); goto found; } s =NULL ;
@@ -174,7 +174,7 @@ static struct sock *nr_find_socket(unsigstruct nr_sock *nr =nr_sk (s);if (nr->my_index == index && nr->my_id == id) { -bh_lock_sock (s); +sock_hold (s); goto found; } }
@@ -198,7 +198,7 @@ static struct sock *nr_find_peer(unsigneif (nr->your_index == index && nr->your_id == id && !ax25cmp (&nr->dest_addr, dest)) { -bh_lock_sock (s); +sock_hold (s); goto found; } }
@@ -224,7 +224,7 @@ static unsigned short nr_find_next_circuif (i !=0 && j !=0 ) {if ((sk=nr_find_socket (i, j)) ==NULL )break ; -bh_unlock_sock (sk); +sock_put (sk); } id++;
@@ -918,6 +918,7 @@ int nr_rx_frame(struct sk_buff *skb, str }if (sk !=NULL ) { +bh_lock_sock (sk);skb_reset_transport_header (skb);if (frametype ==NR_CONNACK && skb->len ==22 )
@@ -927,6 +928,7 @@ int nr_rx_frame(struct sk_buff *skb, str ret =nr_process_rx_frame (sk, skb);bh_unlock_sock (sk); +sock_put (sk);return ret; }
@@ -958,10 +960,12 @@ int nr_rx_frame(struct sk_buff *skb, str (make = nr_make_new(sk)) == NULL) {nr_transmit_refusal (skb,0 );if (sk) -bh_unlock_sock (sk); +sock_put (sk);return 0 ; } +bh_lock_sock (sk); + window = skb->data[20 ]; skb->sk = make;
@@ -1014,6 +1018,7 @@ int nr_rx_frame(struct sk_buff *skb, str sk->sk_data_ready (sk);bh_unlock_sock (sk); +sock_put (sk);nr_insert_socket (make);
Greg Kroah-Hartman
maintainerPATCH 15/71 net/wan: fix a double free in x25_asy_open_tty()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit d5c7c745f254c6cb98b3b3f15fe789b8bd770c72 ]
When x25_asy_open() fails, it already cleans up by itself, so its caller doesn't need to free the memory again.
It seems we still have to call x25_asy_free() to clear the SLF_INUSE bit, so just set these pointers to NULL after kfree().
--- drivers/net/wan/x25_asy.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wan/x25_asy.c +2 -0
@@ -488,8 +488,10 @@ static int x25_asy_open(struct net_devic/* Cleanup */ kfree (sl->xbuff); + sl->xbuff =NULL ; noxbuff:kfree (sl->rbuff); + sl->rbuff =NULL ; norbuff:return -ENOMEM ; }
Greg Kroah-Hartman
maintainerPATCH 16/71 packet: validate address length
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
[ Upstream commit 99137b7888f4058087895d035d81c6b2d31015c5 ]
Packet sockets with SOCK_DGRAM may pass an address for use in dev_hard_header. Ensure that it is of sufficient length.
--- net/packet/af_packet.c | 4 ++++ 1 file changed, 4 insertions(+)
net/packet/af_packet.c +4 -0
@@ -2662,6 +2662,8 @@ static int tpacket_snd(struct packet_soc proto = saddr->sll_protocol; addr = saddr->sll_addr; dev =dev_get_by_index (sock_net (&po->sk), saddr->sll_ifindex); +if (addr && dev && saddr->sll_halen < dev->addr_len) + goto out; } err = -ENXIO ;
@@ -2859,6 +2861,8 @@ static int packet_snd(struct socket *soc proto = saddr->sll_protocol; addr = saddr->sll_addr; dev =dev_get_by_index (sock_net (sk), saddr->sll_ifindex); +if (addr && dev && saddr->sll_halen < dev->addr_len) + goto out; } err = -ENXIO ;
Greg Kroah-Hartman
maintainerPATCH 17/71 packet: validate address length if non-zero
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
[ Upstream commit 6b8d95f1795c42161dc0984b6863e95d6acf24ed ]
Validate packet socket address length if a length is given. Zero length is equivalent to not setting an address.
--- net/packet/af_packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/packet/af_packet.c +2 -2
@@ -2660,7 +2660,7 @@ static int tpacket_snd(struct packet_soc sll_addr))) goto out; proto = saddr->sll_protocol; - addr = saddr->sll_addr; + addr = saddr->sll_halen ? saddr->sll_addr :NULL ; dev =dev_get_by_index (sock_net (&po->sk), saddr->sll_ifindex);if (addr && dev && saddr->sll_halen < dev->addr_len) goto out;
@@ -2859,7 +2859,7 @@ static int packet_snd(struct socket *socif (msg->msg_namelen < (saddr->sll_halen + offsetof(struct sockaddr_ll , sll_addr))) goto out; proto = saddr->sll_protocol; - addr = saddr->sll_addr; + addr = saddr->sll_halen ? saddr->sll_addr :NULL ; dev =dev_get_by_index (sock_net (sk), saddr->sll_ifindex);if (addr && dev && saddr->sll_halen < dev->addr_len) goto out;
Greg Kroah-Hartman
maintainerPATCH 18/71 sctp: initialize sin6_flowinfo for ipv6 addrs in sctp_inet6addr_event
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xin Long <[email protected]>
[ Upstream commit 4a2eb0c37b4759416996fbb4c45b932500cf06d3 ]
syzbot reported a kernel-infoleak, which is caused by an uninitialized field(sin6_flowinfo) of addr->a.v6 in sctp_inet6addr_event(). The call trace is as below:
BUG: KMSAN: kernel-infoleak in _copy_to_user+0x19a/0x230 lib/usercopy.c:33
CPU: 1 PID: 8164 Comm: syz-executor2 Not tainted 4.20.0-rc3+ #95
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x32d/0x480 lib/dump_stack.c:113
kmsan_report+0x12c/0x290 mm/kmsan/kmsan.c:683
kmsan_internal_check_memory+0x32a/0xa50 mm/kmsan/kmsan.c:743
kmsan_copy_to_user+0x78/0xd0 mm/kmsan/kmsan_hooks.c:634
_copy_to_user+0x19a/0x230 lib/usercopy.c:33
copy_to_user include/linux/uaccess.h:183 [inline]
sctp_getsockopt_local_addrs net/sctp/socket.c:5998 [inline]
sctp_getsockopt+0x15248/0x186f0 net/sctp/socket.c:7477
sock_common_getsockopt+0x13f/0x180 net/core/sock.c:2937
__sys_getsockopt+0x489/0x550 net/socket.c:1939
__do_sys_getsockopt net/socket.c:1950 [inline]
__se_sys_getsockopt+0xe1/0x100 net/socket.c:1947
__x64_sys_getsockopt+0x62/0x80 net/socket.c:1947
do_syscall_64+0xcf/0x110 arch/x86/entry/common.c:291
entry_SYSCALL_64_after_hwframe+0x63/0xe7sin6_flowinfo is not really used by SCTP, so it will be fixed by simply setting it to 0.
The issue exists since very beginning.
Thanks Alexander for the reproducer provided.
--- net/sctp/ipv6.c | 1 + 1 file changed, 1 insertion(+)
net/sctp/ipv6.c +1 -0
@@ -101,6 +101,7 @@ static int sctp_inet6addr_event(struct nif (addr) { addr->a.v6.sin6_family =AF_INET6 ; addr->a.v6.sin6_port =0 ; + addr->a.v6.sin6_flowinfo =0 ; addr->a.v6.sin6_addr = ifa->addr; addr->a.v6.sin6_scope_id = ifa->idev->dev->ifindex; addr->valid =1 ;
Greg Kroah-Hartman
maintainerPATCH 19/71 tipc: fix a double kfree_skb()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit acb4a33e9856d5fa3384b87d3d8369229be06d31 ]
tipc_udp_xmit() drops the packet on error, there is no need to drop it again.
--- net/tipc/udp_media.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/tipc/udp_media.c +1 -3
@@ -243,10 +243,8 @@ static int tipc_udp_send_msg(struct net } err =tipc_udp_xmit (net, _skb, ub, src, &rcast->addr); -if (err) { -kfree_skb (_skb); +if (err) goto out; - } } err =0 ; out:
Greg Kroah-Hartman
maintainerPATCH 20/71 vhost: make sure used idx is seen before log in vhost_add_used_n()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wang <[email protected]>
[ Upstream commit 841df922417eb82c835e93d4b93eb6a68c99d599 ]
We miss a write barrier that guarantees used idx is updated and seen before log. This will let userspace sync and copy used ring before used idx is update. Fix this by adding a barrier before log_write().
--- drivers/vhost/vhost.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/vhost/vhost.c +2 -0
@@ -2145,6 +2145,8 @@ int vhost_add_used_n(struct vhost_virtqureturn -EFAULT ; }if (unlikely (vq->log_used)) { +/* Make sure used idx is seen before log. */ +smp_wmb ();/* Log used index update. */ log_write(vq->log_base, vq->log_addr + offsetof(struct vring_used, idx),
Greg Kroah-Hartman
maintainerPATCH 21/71 VSOCK: Send reset control packet when socket is partially bound
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jorgen Hansen <[email protected]>
[ Upstream commit a915b982d8f5e4295f64b8dd37ce753874867e88 ]
If a server side socket is bound to an address, but not in the listening state yet, incoming connection requests should receive a reset control packet in response. However, the function used to send the reset silently drops the reset packet if the sending socket isn't bound to a remote address (as is the case for a bound socket not yet in the listening state). This change fixes this by using the src of the incoming packet as destination for the reset packet in this case.
--- net/vmw_vsock/vmci_transport.c | 67 ++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 17 deletions(-)
net/vmw_vsock/vmci_transport.c +50 -17
@@ -273,6 +273,31 @@ vmci_transport_send_control_pkt_bh(struc }static int +vmci_transport_alloc_send_control_pkt (struct sockaddr_vm *src, +struct sockaddr_vm *dst, +enum vmci_transport_packet_type type, +u64 size, +u64 mode, +struct vmci_transport_waiting_info *wait, +u16 proto, +struct vmci_handle handle) +{ +struct vmci_transport_packet *pkt; +int err; + + pkt =kmalloc (sizeof (*pkt),GFP_KERNEL ); +if (!pkt) +return -ENOMEM ; + + err =__vmci_transport_send_control_pkt (pkt, src, dst, type, size, + mode, wait, proto, handle, + true); +kfree (pkt); + +return err; +} + +static int vmci_transport_send_control_pkt(struct sock *sk, enum vmci_transport_packet_type type, u64 size,
@@ -281,9 +306,7 @@ vmci_transport_send_control_pkt(struct s u16 proto, struct vmci_handle handle) { -struct vmci_transport_packet *pkt;struct vsock_sock *vsk; -int err; vsk =vsock_sk (sk);
@@ -293,17 +316,10 @@ vmci_transport_send_control_pkt(struct sif (!vsock_addr_bound (&vsk->remote_addr))return -EINVAL ; - pkt =kmalloc (sizeof (*pkt),GFP_KERNEL ); -if (!pkt) -return -ENOMEM ; - - err =__vmci_transport_send_control_pkt (pkt, &vsk->local_addr, - &vsk->remote_addr, type, size, - mode, wait, proto, handle, - true); -kfree (pkt); - -return err; +return vmci_transport_alloc_send_control_pkt (&vsk->local_addr, + &vsk->remote_addr, + type, size, mode, + wait, proto, handle); } static int vmci_transport_send_reset_bh(struct sockaddr_vm *dst,
@@ -321,12 +337,29 @@ static int vmci_transport_send_reset_bh(static int vmci_transport_send_reset (struct sock *sk,struct vmci_transport_packet *pkt) { +struct sockaddr_vm *dst_ptr; +struct sockaddr_vm dst; +struct vsock_sock *vsk; +if (pkt->type ==VMCI_TRANSPORT_PACKET_TYPE_RST )return 0 ; -return vmci_transport_send_control_pkt (sk, -VMCI_TRANSPORT_PACKET_TYPE_RST , -0 ,0 ,NULL ,VSOCK_PROTO_INVALID , -VMCI_INVALID_HANDLE ); + + vsk =vsock_sk (sk); + +if (!vsock_addr_bound (&vsk->local_addr)) +return -EINVAL ; + +if (vsock_addr_bound (&vsk->remote_addr)) { + dst_ptr = &vsk->remote_addr; + }else { +vsock_addr_init (&dst, pkt->dg.src.context, + pkt->src_port); + dst_ptr = &dst; + } +return vmci_transport_alloc_send_control_pkt (&vsk->local_addr, dst_ptr, +VMCI_TRANSPORT_PACKET_TYPE_RST , +0 ,0 ,NULL ,VSOCK_PROTO_INVALID , +VMCI_INVALID_HANDLE ); }static int vmci_transport_send_negotiate (struct sock *sk,size_t size)
Greg Kroah-Hartman
maintainerPATCH 22/71 xen/netfront: tolerate frags with no data
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Juergen Gross <[email protected]>
[ Upstream commit d81c5054a5d1d4999c7cdead7636b6cd4af83d36 ]
At least old Xen net backends seem to send frags with no real data sometimes. In case such a fragment happens to occur with the frag limit already reached the frontend will BUG currently even if this situation is easily recoverable.
Modify the BUG_ON() condition accordingly.
--- drivers/net/xen-netfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/xen-netfront.c +1 -1
@@ -903,7 +903,7 @@ static RING_IDX xennet_fill_frags(structif (skb_shinfo (skb)->nr_frags ==MAX_SKB_FRAGS ) {unsigned int pull_to =NETFRONT_SKB_CB (skb)->pull_to; -BUG_ON (pull_to <=skb_headlen (skb)); +BUG_ON (pull_to <skb_headlen (skb));__pskb_pull_tail (skb, pull_to -skb_headlen (skb)); }if (unlikely (skb_shinfo (skb)->nr_frags >=MAX_SKB_FRAGS )) {
Greg Kroah-Hartman
maintainerPATCH 23/71 tipc: use lock_sock() in tipc_sk_reinit()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 15ef70e286176165d28b0b8a969b422561a68dfc ]
lock_sock() must be used in process context to be race-free with other lock_sock() callers, for example, tipc_release(). Otherwise using the spinlock directly can't serialize a parallel tipc_release().
As it is blocking, we have to hold the sock refcnt before rhashtable_walk_stop() and release it after rhashtable_walk_start().
--- net/tipc/socket.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/tipc/socket.c +6 -2
@@ -2281,11 +2281,15 @@ void tipc_sk_reinit(struct net *net) goto walk_stop;while ((tsk =rhashtable_walk_next (&iter)) && !IS_ERR (tsk)) { -spin_lock_bh (&tsk->sk.sk_lock.slock); +sock_hold (&tsk->sk); +rhashtable_walk_stop (&iter); +lock_sock (&tsk->sk); msg = &tsk->phdr;msg_set_prevnode (msg, tn->own_addr);msg_set_orignode (msg, tn->own_addr); -spin_unlock_bh (&tsk->sk.sk_lock.slock); +release_sock (&tsk->sk); +rhashtable_walk_start (&iter); +sock_put (&tsk->sk); } walk_stop:rhashtable_walk_stop (&iter);
Greg Kroah-Hartman
maintainerPATCH 24/71 tipc: compare remote and local protocols in tipc_udp_enable()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit fb83ed496b9a654f60cd1d58a0e1e79ec5694808 ]
When TIPC_NLA_UDP_REMOTE is an IPv6 mcast address but TIPC_NLA_UDP_LOCAL is an IPv4 address, a NULL-ptr deref is triggered as the UDP tunnel sock is initialized to IPv4 or IPv6 sock merely based on the protocol in local address.
We should just error out when the remote address and local address have different protocols.
--- net/tipc/udp_media.c | 5 +++++ 1 file changed, 5 insertions(+)
net/tipc/udp_media.c +5 -0
@@ -674,6 +674,11 @@ static int tipc_udp_enable(struct net *nif (err) goto err; +if (remote.proto != local.proto) { + err = -EINVAL ; + goto err; + } + b->bcast_addr.media_id =TIPC_MEDIA_TYPE_UDP ; b->bcast_addr.broadcast =1 ;rcu_assign_pointer (b->media_ptr, ub);
Greg Kroah-Hartman
maintainerPATCH 25/71 gro_cell: add napi_disable in gro_cells_destroy
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <[email protected]>
[ Upstream commit 8e1da73acded4751a93d4166458a7e640f37d26c ]
Add napi_disable routine in gro_cells_destroy since starting from commit c42858eaf492 ("gro_cells: remove spinlock protecting receive queues") gro_cell_poll and gro_cells_destroy can run concurrently on napi_skbs list producing a kernel Oops if the tunnel interface is removed while gro_cell_poll is running. The following Oops has been triggered removing a vxlan device while the interface is receiving traffic
[ 5628.948853] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 [ 5628.949981] PGD 0 P4D 0 [ 5628.950308] Oops: 0002 [#1] SMP PTI [ 5628.950748] CPU: 0 PID: 9 Comm: ksoftirqd/0 Not tainted 4.20.0-rc6+ #41 [ 5628.952940] RIP: 0010:gro_cell_poll+0x49/0x80 [ 5628.955615] RSP: 0018:ffffc9000004fdd8 EFLAGS: 00010202 [ 5628.956250] RAX: 0000000000000000 RBX: ffffe8ffffc08150 RCX: 0000000000000000 [ 5628.957102] RDX: 0000000000000000 RSI: ffff88802356bf00 RDI: ffffe8ffffc08150 [ 5628.957940] RBP: 0000000000000026 R08: 0000000000000000 R09: 0000000000000000 [ 5628.958803] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000040 [ 5628.959661] R13: ffffe8ffffc08100 R14: 0000000000000000 R15: 0000000000000040 [ 5628.960682] FS: 0000000000000000(0000) GS:ffff88803ea00000(0000) knlGS:0000000000000000 [ 5628.961616] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5628.962359] CR2: 0000000000000008 CR3: 000000000221c000 CR4: 00000000000006b0 [ 5628.963188] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 5628.964034] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 5628.964871] Call Trace: [ 5628.965179] net_rx_action+0xf0/0x380 [ 5628.965637] __do_softirq+0xc7/0x431 [ 5628.966510] run_ksoftirqd+0x24/0x30 [ 5628.966957] smpboot_thread_fn+0xc5/0x160 [ 5628.967436] kthread+0x113/0x130 [ 5628.968283] ret_from_fork+0x3a/0x50 [ 5628.968721] Modules linked in: [ 5628.969099] CR2: 0000000000000008 [ 5628.969510] ---[ end trace 9d9dedc7181661fe ]--- [ 5628.970073] RIP: 0010:gro_cell_poll+0x49/0x80 [ 5628.972965] RSP: 0018:ffffc9000004fdd8 EFLAGS: 00010202 [ 5628.973611] RAX: 0000000000000000 RBX: ffffe8ffffc08150 RCX: 0000000000000000 [ 5628.974504] RDX: 0000000000000000 RSI: ffff88802356bf00 RDI: ffffe8ffffc08150 [ 5628.975462] RBP: 0000000000000026 R08: 0000000000000000 R09: 0000000000000000 [ 5628.976413] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000040 [ 5628.977375] R13: ffffe8ffffc08100 R14: 0000000000000000 R15: 0000000000000040 [ 5628.978296] FS: 0000000000000000(0000) GS:ffff88803ea00000(0000) knlGS:0000000000000000 [ 5628.979327] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5628.980044] CR2: 0000000000000008 CR3: 000000000221c000 CR4: 00000000000006b0 [ 5628.980929] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 5628.981736] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 5628.982409] Kernel panic - not syncing: Fatal exception in interrupt [ 5628.983307] Kernel Offset: disabled
--- include/net/gro_cells.h | 1 + 1 file changed, 1 insertion(+)
include/net/gro_cells.h +1 -0
@@ -86,6 +86,7 @@ static inline void gro_cells_destroy(strfor_each_possible_cpu (i) {struct gro_cell *cell =per_cpu_ptr (gcells->cells, i); +napi_disable (&cell->napi);netif_napi_del (&cell->napi);__skb_queue_purge (&cell->napi_skbs); }
Greg Kroah-Hartman
maintainerPATCH 26/71 net/mlx5e: Remove the false indication of software timestamping support
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alaa Hleihel <[email protected]>
[ Upstream commit 4765420439e758bfa4808392d18b0a4cb6f06065 ]
mlx5 driver falsely advertises support of software timestamping. Fix it by removing the false indication.
--- drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +3 -8
@@ -1167,11 +1167,6 @@ static int mlx5e_get_ts_info(struct net_ struct ethtool_ts_info *info) {struct mlx5e_priv *priv =netdev_priv (dev); -int ret; - - ret =ethtool_op_get_ts_info (dev, info); -if (ret) -return ret; info->phc_index = priv->tstamp.ptp ?ptp_clock_index (priv->tstamp.ptp) :-1 ;
@@ -1179,9 +1174,9 @@ static int mlx5e_get_ts_info(struct net_if (!MLX5_CAP_GEN (priv->mdev, device_frequency_khz))return 0 ; - info->so_timestamping |=SOF_TIMESTAMPING_TX_HARDWARE | -SOF_TIMESTAMPING_RX_HARDWARE | -SOF_TIMESTAMPING_RAW_HARDWARE ; + info->so_timestamping =SOF_TIMESTAMPING_TX_HARDWARE | +SOF_TIMESTAMPING_RX_HARDWARE | +SOF_TIMESTAMPING_RAW_HARDWARE ; info->tx_types =BIT (HWTSTAMP_TX_OFF ) |BIT (HWTSTAMP_TX_ON );
Greg Kroah-Hartman
maintainerPATCH 27/71 net/mlx5: Typo fix in del_sw_hw_rule
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuval Avnery <[email protected]>
[ Upstream commit f0337889147c956721696553ffcc97212b0948fe ]
Expression terminated with "," instead of ";", resulted in set_fte getting bad value for modify_enable_mask field.
--- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +1 -1
@@ -390,7 +390,7 @@ static void del_rule(struct fs_node *nod }if ((fte->action &MLX5_FLOW_CONTEXT_ACTION_FWD_DEST ) && --fte->dests_size) { - modify_mask =BIT (MLX5_SET_FTE_MODIFY_ENABLE_MASK_DESTINATION_LIST ), + modify_mask =BIT (MLX5_SET_FTE_MODIFY_ENABLE_MASK_DESTINATION_LIST ); err = mlx5_cmd_update_fte(dev, ft, fg->id, modify_mask,
Greg Kroah-Hartman
maintainerPATCH 28/71 sock: Make sock->sk_stamp thread-safe
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepa Dinamani <[email protected]>
[ Upstream commit 3a0ed3e9619738067214871e9cb826fa23b2ddb9 ]
Al Viro mentioned (Message-ID <[email protected]>) that there is probably a race condition lurking in accesses of sk_stamp on 32-bit machines.
sock->sk_stamp is of type ktime_t which is always an s64. On a 32 bit architecture, we might run into situations of unsafe access as the access to the field becomes non atomic.
Use seqlocks for synchronization.
This allows us to avoid using spinlocks for readers as readers do not need mutual exclusion.
Another approach to solve this is to require sk_lock for all modifications of the timestamps. The current approach allows for timestamps to have their own lock: sk_stamp_lock. This allows for the patch to not compete with already existing critical sections, and side effects are limited to the paths in the patch.
The addition of the new field maintains the data locality optimizations from
commit 9115e8cd2a0c ("net: reorganize struct sock for better data locality")
Note that all the instances of the sk_stamp accesses are either through the ioctl or the syscall recvmsg.
--- include/net/sock.h | 36 ++++++++++++++++++++++++++++++++++-- net/compat.c | 15 +++++++++------ net/core/sock.c | 3 +++ net/sunrpc/svcsock.c | 2 +- 4 files changed, 47 insertions(+), 9 deletions(-)
include/net/sock.h +34 -2
@@ -284,6 +284,7 @@ struct sock_common {* @sk_filter: socket filtering instructions * @sk_timer: sock cleanup timer * @sk_stamp: time stamp of last packet received +* @sk_stamp_seq: lock for accessing sk_stamp on 32 bit architectures only * @sk_tsflags: SO_TIMESTAMPING socket options * @sk_tskey: counter to disambiguate concurrent tstamp requests * @sk_socket: Identd and reporting IO signals
@@ -425,6 +426,9 @@ struct sock {long sk_sndtimeo;struct timer_list sk_timer;ktime_t sk_stamp; +#if BITS_PER_LONG ==32 +seqlock_t sk_stamp_seq; +#endif u16 sk_tsflags;u8 sk_shutdown;u32 sk_tskey;
@@ -2114,6 +2118,34 @@ static inline void sk_drops_add(struct satomic_add (segs, &sk->sk_drops); } +static inline ktime_t sock_read_timestamp (struct sock *sk) +{ +#if BITS_PER_LONG ==32 +unsigned int seq; +ktime_t kt; + +do { + seq =read_seqbegin (&sk->sk_stamp_seq); + kt = sk->sk_stamp; + }while (read_seqretry (&sk->sk_stamp_seq, seq)); + +return kt; +#else +return sk->sk_stamp; +#endif +} + +static inline void sock_write_timestamp (struct sock *sk,ktime_t kt) +{ +#if BITS_PER_LONG ==32 +write_seqlock (&sk->sk_stamp_seq); + sk->sk_stamp = kt; +write_sequnlock (&sk->sk_stamp_seq); +#else + sk->sk_stamp = kt; +#endif +} +void __sock_recv_timestamp (struct msghdr *msg,struct sock *sk,struct sk_buff *skb); void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
@@ -2138,7 +2170,7 @@ sock_recv_timestamp(struct msghdr *msg, (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE)))__sock_recv_timestamp (msg, sk, skb); else - sk->sk_stamp = kt; +sock_write_timestamp (sk ,kt );if (sock_flag (sk,SOCK_WIFI_STATUS ) && skb->wifi_acked_valid)__sock_recv_wifi_status (msg, sk, skb);
@@ -2158,7 +2190,7 @@ static inline void sock_recv_ts_and_dropif (sk->sk_flags &FLAGS_TS_OR_DROPS || sk->sk_tsflags &TSFLAGS_ANY )__sock_recv_ts_and_drops (msg, sk, skb);else - sk->sk_stamp = skb->tstamp; +sock_write_timestamp (sk, skb->tstamp); }void __sock_tx_timestamp (__u16 tsflags,__u8 *tx_flags);
net/compat.c +9 -6
@@ -457,12 +457,14 @@ int compat_sock_get_timestamp(struct soc err = -ENOENT ;if (!sock_flag (sk,SOCK_TIMESTAMP ))sock_enable_timestamp (sk,SOCK_TIMESTAMP ); - tv =ktime_to_timeval (sk->sk_stamp); + tv =ktime_to_timeval (sock_read_timestamp (sk)); +if (tv.tv_sec ==-1 )return err;if (tv.tv_sec ==0 ) { - sk->sk_stamp =ktime_get_real (); - tv =ktime_to_timeval (sk->sk_stamp); +ktime_t kt =ktime_get_real (); +sock_write_timestamp (sk, kt); + tv =ktime_to_timeval (kt); } err =0 ; if (put_user(tv.tv_sec, &ctv->tv_sec) ||
@@ -485,12 +487,13 @@ int compat_sock_get_timestampns(struct s err = -ENOENT ;if (!sock_flag (sk,SOCK_TIMESTAMP ))sock_enable_timestamp (sk,SOCK_TIMESTAMP ); - ts =ktime_to_timespec (sk->sk_stamp); + ts =ktime_to_timespec (sock_read_timestamp (sk));if (ts.tv_sec ==-1 )return err;if (ts.tv_sec ==0 ) { - sk->sk_stamp =ktime_get_real (); - ts =ktime_to_timespec (sk->sk_stamp); +ktime_t kt =ktime_get_real (); +sock_write_timestamp (sk, kt); + ts =ktime_to_timespec (kt); } err =0 ; if (put_user(ts.tv_sec, &ctv->tv_sec) ||
net/core/sock.c +3 -0
@@ -2467,6 +2467,9 @@ void sock_init_data(struct socket *sock, sk->sk_sndtimeo =MAX_SCHEDULE_TIMEOUT ; sk->sk_stamp =ktime_set (-1L ,0 ); +#if BITS_PER_LONG ==32 +seqlock_init (&sk->sk_stamp_seq); +#endif #ifdef CONFIG_NET_RX_BUSY_POLL sk->sk_napi_id =0 ;
net/sunrpc/svcsock.c +1 -1
@@ -572,7 +572,7 @@ static int svc_udp_recvfrom(struct svc_r/* Don't enable netstamp, sunrpc doesn't need that much accuracy */ } - svsk->sk_sk->sk_stamp = skb->tstamp; +sock_write_timestamp (svsk->sk_sk, skb->tstamp);set_bit (XPT_DATA , &svsk->sk_xprt.xpt_flags);/* there may be more data... */ len = skb->len;
Greg Kroah-Hartman
maintainerPATCH 29/71 ptr_ring: wrap back ->producer in __ptr_ring_swap_queue()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit aff6db454599d62191aabc208930e891748e4322 ]
__ptr_ring_swap_queue() tries to move pointers from the old ring to the new one, but it forgets to check if ->producer is beyond the new size at the end of the operation. This leads to an out-of-bound access in __ptr_ring_produce() as reported by syzbot.
--- include/linux/ptr_ring.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/ptr_ring.h +2 -0
@@ -384,6 +384,8 @@ static inline void **__ptr_ring_swap_queelse if (destroy)destroy (ptr); +if (producer >= size) + producer =0 ; r->size = size; r->producer = producer; r->consumer =0 ;
Greg Kroah-Hartman
maintainerPATCH 30/71 ALSA: rme9652: Fix potential Spectre v1 vulnerability
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo A. R. Silva <[email protected]>
commit 0b84304ef5da92add8dc75a1b07879c5374cdb05 upstream.
info->channel is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
sound/pci/rme9652/hdsp.c:4100 snd_hdsp_channel_info() warn: potential spectre issue 'hdsp->channel_map' [r] (local cap)
Fix this by sanitizing info->channel before using it to index hdsp->channel_map
Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].
Also, notice that I refactored the code a bit in order to get rid of the following checkpatch warning:
ERROR: do not use assignment in if condition
FILE: sound/pci/rme9652/hdsp.c:4103:
if ((mapped_channel = hdsp->channel_map[info->channel]) < 0)
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
--- sound/pci/rme9652/hdsp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
sound/pci/rme9652/hdsp.c +6 -4
@@ -30,6 +30,7 @@#include <linux/math64.h> #include <linux/vmalloc.h> #include <linux/io.h> +#include <linux/nospec.h> #include <sound/core.h> #include <sound/control.h>
@@ -4065,15 +4066,16 @@ static int snd_hdsp_channel_info(struct struct snd_pcm_channel_info *info) {struct hdsp *hdsp =snd_pcm_substream_chip (substream); -int mapped_channel; +unsigned int channel = info->channel; -if (snd_BUG_ON (info->channel >= hdsp->max_channels)) +if (snd_BUG_ON (channel >= hdsp->max_channels))return -EINVAL ; + channel =array_index_nospec (channel, hdsp->max_channels); -if ((mapped_channel = hdsp->channel_map[info->channel]) <0 ) +if (hdsp->channel_map[channel] <0 )return -EINVAL ; - info->offset = mapped_channel *HDSP_CHANNEL_BUFFER_BYTES ; + info->offset = hdsp->channel_map[channel] *HDSP_CHANNEL_BUFFER_BYTES ; info->first =0 ; info->step =32 ;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 31/71 ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo A. R. Silva <[email protected]>
commit 5ae4f61f012a097df93de2285070ec8e34716d29 upstream.
ipcm->substream is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
sound/pci/emu10k1/emufx.c:1031 snd_emu10k1_ipcm_poke() warn: potential spectre issue 'emu->fx8010.pcm' [r] (local cap) sound/pci/emu10k1/emufx.c:1075 snd_emu10k1_ipcm_peek() warn: potential spectre issue 'emu->fx8010.pcm' [r] (local cap)
Fix this by sanitizing ipcm->substream before using it to index emu->fx8010.pcm
Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
--- sound/pci/emu10k1/emufx.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/pci/emu10k1/emufx.c +5 -0
@@ -36,6 +36,7 @@#include <linux/init.h> #include <linux/mutex.h> #include <linux/moduleparam.h> +#include <linux/nospec.h> #include <sound/core.h> #include <sound/tlv.h>
@@ -1000,6 +1001,8 @@ static int snd_emu10k1_ipcm_poke(structif (ipcm->substream >=EMU10K1_FX8010_PCM_COUNT )return -EINVAL ; + ipcm->substream =array_index_nospec (ipcm->substream, +EMU10K1_FX8010_PCM_COUNT );if (ipcm->channels >32 )return -EINVAL ; pcm = &emu->fx8010.pcm[ipcm->substream];
@@ -1046,6 +1049,8 @@ static int snd_emu10k1_ipcm_peek(structif (ipcm->substream >=EMU10K1_FX8010_PCM_COUNT )return -EINVAL ; + ipcm->substream =array_index_nospec (ipcm->substream, +EMU10K1_FX8010_PCM_COUNT ); pcm = &emu->fx8010.pcm[ipcm->substream];mutex_lock (&emu->fx8010.lock);spin_lock_irq (&emu->reg_lock);
Greg Kroah-Hartman
maintainerPATCH 32/71 ALSA: pcm: Fix potential Spectre v1 vulnerability
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo A. R. Silva <[email protected]>
commit 94ffb030b6d31ec840bb811be455dd2e26a4f43e upstream.
stream is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
sound/core/pcm.c:140 snd_pcm_control_ioctl() warn: potential spectre issue 'pcm->streams' [r] (local cap)
Fix this by sanitizing stream before using it to index pcm->streams
Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
--- sound/core/pcm.c | 2 ++ 1 file changed, 2 insertions(+)
sound/core/pcm.c +2 -0
@@ -25,6 +25,7 @@#include <linux/time.h> #include <linux/mutex.h> #include <linux/device.h> +#include <linux/nospec.h> #include <sound/core.h> #include <sound/minors.h> #include <sound/pcm.h>
@@ -125,6 +126,7 @@ static int snd_pcm_control_ioctl(structreturn -EFAULT ;if (stream <0 || stream >1 )return -EINVAL ; + stream =array_index_nospec (stream,2 );if (get_user (subdevice, &info->subdevice))return -EFAULT ;mutex_lock (®ister_mutex);
Greg Kroah-Hartman
maintainerPATCH 33/71 ALSA: emux: Fix potential Spectre v1 vulnerabilities
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo A. R. Silva <[email protected]>
commit 4aea96f4237cea0c51a8bc87c0db31f0f932f1f0 upstream.
info.mode and info.port are indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
These issues were detected with the help of Smatch:
sound/synth/emux/emux_hwdep.c:72 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs[i]->ctrls' [w] (local cap) sound/synth/emux/emux_hwdep.c:75 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs' [w] (local cap) sound/synth/emux/emux_hwdep.c:75 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs[info.port]->ctrls' [w] (local cap)
Fix this by sanitizing both info.mode and info.port before using them to index emu->portptrs[i]->ctrls, emu->portptrs[info.port]->ctrls and emu->portptrs.
Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
--- sound/synth/emux/emux_hwdep.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
sound/synth/emux/emux_hwdep.c +5 -2
@@ -22,9 +22,9 @@#include <sound/core.h> #include <sound/hwdep.h> #include <linux/uaccess.h> +#include <linux/nospec.h> #include "emux_voice.h" -#define TMP_CLIENT_ID 0x1001/*
@@ -66,13 +66,16 @@ snd_emux_hwdep_misc_mode(struct snd_emuxreturn -EFAULT ;if (info.mode <0 || info.mode >=EMUX_MD_END )return -EINVAL ; + info.mode =array_index_nospec (info.mode,EMUX_MD_END );if (info.port <0 ) {for (i =0 ; i < emu->num_ports; i++) emu->portptrs[i]->ctrls[info.mode] = info.value; }else { -if (info.port < emu->num_ports) +if (info.port < emu->num_ports) { + info.port =array_index_nospec (info.port, emu->num_ports); emu->portptrs[info.port]->ctrls[info.mode] = info.value; + } }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 34/71 mtd: atmel-quadspi: disallow building on ebsa110
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 2a9d92fb3a1282a4659f1bb6d5684018846537b7 upstream.
I ran into a link-time error with the atmel-quadspi driver on the EBSA110 platform:
drivers/mtd/built-in.o: In function `atmel_qspi_run_command':
:(.text+0x1ee3c): undefined reference to _memcpy_toio' :(.text+0x1ee48): undefined reference to _memcpy_fromio'
The problem is that _memcpy_toio/_memcpy_fromio are not available on that platform, and we have to prevent building the driver there.
In case we want to backport this to older kernels: between linux-4.8 and linux-4.20, the Kconfig entry was in drivers/mtd/spi-nor/Kconfig but had the same problem.
--- drivers/mtd/spi-nor/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/Kconfig +1 -1
@@ -31,7 +31,7 @@ config MTD_SPI_NOR_USE_4K_SECTORS config SPI_ATMEL_QUADSPI tristate "Atmel Quad SPI Controller" - depends on ARCH_AT91 || (ARM && COMPILE_TEST) + depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110) depends on OF && HAS_IOMEM help This enables support for the Quad SPI controller in master mode.
Greg Kroah-Hartman
maintainerPATCH 35/71 ALSA: hda: add mute LED support for HP EliteBook 840 G4
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mantas Mikulėnas <[email protected]>
commit 40906ebe3af6a48457151b3c6726b480f6a6cb13 upstream.
Tested with 4.19.9.
v2: Changed from CXT_FIXUP_MUTE_LED_GPIO to CXT_FIXUP_HP_DOCK because
that's what the existing fixups for EliteBooks use.
--- sound/pci/hda/patch_conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_conexant.c +1 -0
@@ -853,6 +853,7 @@ static const struct snd_pci_quirk cxt506SND_PCI_QUIRK (0x103c ,0x8079 ,"HP EliteBook 840 G3" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x807C ,"HP EliteBook 820 G3" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x80FD ,"HP ProBook 640 G2" ,CXT_FIXUP_HP_DOCK ), +SND_PCI_QUIRK (0x103c ,0x828c ,"HP EliteBook 840 G4" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x83b3 ,"HP EliteBook 830 G5" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x83d3 ,"HP ProBook 640 G4" ,CXT_FIXUP_HP_DOCK ), SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE),
Greg Kroah-Hartman
maintainerPATCH 36/71 ALSA: hda/tegra: clear pending irq handlers
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sameer Pujar <[email protected]>
commit 63d2a9ec310d8bcc955574220d4631aa55c1a80c upstream.
Even after disabling interrupts on the module, it could be possible that irq handlers are still running. System hang is seen during suspend path. It was found that, there were pending writes on the HDA bus and clock was disabled by that time.
Above mentioned issue is fixed by clearing any pending irq handlers before disabling clocks and returning from hda suspend.
--- sound/pci/hda/hda_tegra.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/hda_tegra.c +2 -0
@@ -249,10 +249,12 @@ static int hda_tegra_suspend(struct devistruct snd_card *card =dev_get_drvdata (dev);struct azx *chip = card->private_data; struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip); +struct hdac_bus *bus =azx_bus (chip);snd_power_change_state (card, SNDRV_CTL_POWER_D3hot);azx_stop_chip (chip); +synchronize_irq (bus->irq);azx_enter_link_reset (chip);hda_tegra_disable_clocks (hda);
Greg Kroah-Hartman
maintainerPATCH 37/71 USB: serial: pl2303: add ids for Hewlett-Packard HP POS pole displays
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Scott Chen <[email protected]>
commit 8d503f206c336677954160ac62f0c7d9c219cd89 upstream.
Add device ids to pl2303 for the HP POS pole displays:
LM920: 03f0:026b TD620: 03f0:0956 LD960TA: 03f0:4439 LD220TA: 03f0:4349 LM940: 03f0:5039
--- drivers/usb/serial/pl2303.c | 5 +++++ drivers/usb/serial/pl2303.h | 5 +++++ 2 files changed, 10 insertions(+)
drivers/usb/serial/pl2303.c +5 -0
@@ -86,9 +86,14 @@ static const struct usb_device_id id_tab { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) }, { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LCM960_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LM920_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LM940_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_TD620_PRODUCT_ID) }, { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, { USB_DEVICE(ZEAGLE_VENDOR_ID, ZEAGLE_N2ITION3_PRODUCT_ID) }, { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
drivers/usb/serial/pl2303.h +5 -0
@@ -123,10 +123,15 @@/* Hewlett-Packard POS Pole Displays */ #define HP_VENDOR_ID 0x03f0 +#define HP_LM920_PRODUCT_ID 0x026b +#define HP_TD620_PRODUCT_ID 0x0956#define HP_LD960_PRODUCT_ID 0x0b39#define HP_LCM220_PRODUCT_ID 0x3139#define HP_LCM960_PRODUCT_ID 0x3239#define HP_LD220_PRODUCT_ID 0x3524 +#define HP_LD220TA_PRODUCT_ID 0x4349 +#define HP_LD960TA_PRODUCT_ID 0x4439 +#define HP_LM940_PRODUCT_ID 0x5039/* Cressi Edy (diving computer) PC interface */ #define CRESSI_VENDOR_ID 0x04b8
Greg Kroah-Hartman
maintainerPATCH 38/71 USB: serial: option: add Fibocom NL678 series
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jörgen Storvist <[email protected]>
commit 4b2c01ad902ec02fa962b233decd2f14be3714ba upstream.
Added USB serial option driver support for Fibocom NL678 series cellular
module: VID 2cb7 and PIDs 0x0104 and 0x0105.
Reserved network and ADB interfaces.
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0104 Rev=03.10 S: Manufacturer=Fibocom S: Product=Fibocom NL678-E Modem S: SerialNumber=12345678 C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0105 Rev=03.10 S: Manufacturer=Fibocom S: Product=Fibocom NL678-E Modem S: SerialNumber=12345678 C: #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether I: If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
--- drivers/usb/serial/option.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/option.c +4 -0
@@ -1956,6 +1956,10 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x1b) }, { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 */ .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, + { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */ + .driver_info = RSVD(4) | RSVD(5) }, + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ + .driver_info = RSVD(6) }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
Greg Kroah-Hartman
maintainerPATCH 39/71 usb: r8a66597: Fix a possible concurrency use-after-free bug in r8a66597_endpoint_disable()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia-Ju Bai <[email protected]>
commit c85400f886e3d41e69966470879f635a2b50084c upstream.
The function r8a66597_endpoint_disable() and r8a66597_urb_enqueue() may be concurrently executed.
The two functions both access a possible shared variable "hep->hcpriv".
This shared variable is freed by r8a66597_endpoint_disable() via the call path:r8a66597_endpoint_disable
kfree(hep->hcpriv) (line 1995 in Linux-4.19)
This variable is read by r8a66597_urb_enqueue() via the call path:r8a66597_urb_enqueue
spin_lock_irqsave(&r8a66597->lock)
init_pipe_info
enable_r8a66597_pipe
pipe = hep->hcpriv (line 802 in Linux-4.19)The read operation is protected by a spinlock, but the free operation is not protected by this spinlock, thus a concurrency use-after-free bug may occur.
To fix this bug, the spin-lock and spin-unlock function calls in r8a66597_endpoint_disable() are moved to protect the free operation.
--- drivers/usb/host/r8a66597-hcd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/host/r8a66597-hcd.c +4 -1
@@ -1990,6 +1990,8 @@ static int r8a66597_urb_dequeue(struct ustatic void r8a66597_endpoint_disable (struct usb_hcd *hcd,struct usb_host_endpoint *hep) +__acquires(r8a66597->lock) +__releases(r8a66597->lock) {struct r8a66597 *r8a66597 =hcd_to_r8a66597 (hcd);struct r8a66597_pipe *pipe = (struct r8a66597_pipe *)hep->hcpriv;
@@ -2002,13 +2004,14 @@ static void r8a66597_endpoint_disable(streturn ; pipenum = pipe->info.pipenum; +spin_lock_irqsave (&r8a66597->lock, flags);if (pipenum ==0 ) {kfree (hep->hcpriv); hep->hcpriv =NULL ; +spin_unlock_irqrestore (&r8a66597->lock, flags);return ; } -spin_lock_irqsave (&r8a66597->lock, flags);pipe_stop (r8a66597, pipe);pipe_irq_disable (r8a66597, pipenum);disable_irq_empty (r8a66597, pipenum);
Greg Kroah-Hartman
maintainerPATCH 40/71 staging: wilc1000: fix missing read_write setting when reading data
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <[email protected]>
commit c58eef061dda7d843dcc0ad6fea7e597d4c377c0 upstream.
Currently the cmd.read_write setting is not initialized so it contains garbage from the stack. Fix this by setting it to 0 to indicate a read is required.
Detected by CoverityScan, CID#1357925 ("Uninitialized scalar variable")
--- drivers/staging/wilc1000/wilc_sdio.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/wilc1000/wilc_sdio.c +1 -0
@@ -830,6 +830,7 @@ static int sdio_read_int(struct wilc *wiif (!g_sdio.irq_gpio) {int i; + cmd.read_write =0 ; cmd.function =1 ; cmd.address =0x04 ; cmd.data =0 ;
Greg Kroah-Hartman
maintainerPATCH 41/71 qmi_wwan: apply SET_DTR quirk to the SIMCOM shared device ID
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit 102cd909635612c0be784a519651954a7924c786 upstream.
SIMCOM are reusing a single device ID for many (all of their?) different modems, based on different chipsets and firmwares. Newer Qualcomm chipset generations require setting DTR to wake the QMI function. The SIM7600E modem is using such a chipset, making it fail to work with this driver despite the device ID match.
Fix by unconditionally enabling the SET_DTR quirk for all SIMCOM modems using this specific device ID. This is similar to what we already have done for another case of device IDs recycled over multiple chipset generations: 14cf4a771b30 ("drivers: net: usb:qmi_wwan: add QMI_QUIRK_SET_DTR for Telit PID 0x1201")
Initial testing on an older SIM7100 modem shows no immediate side effects.
--- drivers/net/usb/qmi_wwan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/qmi_wwan.c +1 -1
@@ -951,7 +951,7 @@ static const struct usb_device_id produc {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */ {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */ - {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */ + {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */
Greg Kroah-Hartman
maintainerPATCH 42/71 Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrick Dreyer <[email protected]>
commit 7db54c89f0b30a101584e09d3729144e6170059d upstream.
This adds ELAN0501 to the ACPI table to support Elan touchpad found in ASUS Aspire F5-573G.
--- drivers/input/mouse/elan_i2c_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/elan_i2c_core.c +1 -0
@@ -1240,6 +1240,7 @@ MODULE_DEVICE_TABLE(i2c, elan_id);static const struct acpi_device_id elan_acpi_id[] = { {"ELAN0000" ,0 }, {"ELAN0100" ,0 }, + {"ELAN0501" ,0 }, {"ELAN0600" ,0 }, {"ELAN0602" ,0 }, {"ELAN0605" ,0 },
Greg Kroah-Hartman
maintainerPATCH 43/71 KVM: x86: Use jmp to invoke kvm_spurious_fault() from .fixup
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
commit e81434995081fd7efb755fd75576b35dbb0850b1 upstream.
____kvm_handle_fault_on_reboot() provides a generic exception fixup handler that is used to cleanly handle faults on VMX/SVM instructions during reboot (or at least try to). If there isn't a reboot in progress, ____kvm_handle_fault_on_reboot() treats any exception as fatal to KVM and invokes kvm_spurious_fault(), which in turn generates a BUG() to get a stack trace and die.
When it was originally added by commit 4ecac3fd6dc2 ("KVM: Handle virtualization instruction #UD faults during reboot"), the "call" to kvm_spurious_fault() was handcoded as PUSH+JMP, where the PUSH'd value is the RIP of the faulting instructing.
The PUSH+JMP trickery is necessary because the exception fixup handler code lies outside of its associated function, e.g. right after the function. An actual CALL from the .fixup code would show a slightly bogus stack trace, e.g. an extra "random" function would be inserted into the trace, as the return RIP on the stack would point to no known function (and the unwinder will likely try to guess who owns the RIP).
Unfortunately, the JMP was replaced with a CALL when the macro was reworked to not spin indefinitely during reboot (commit b7c4145ba2eb "KVM: Don't spin on virt instruction faults during reboot"). This causes the aforementioned behavior where a bogus function is inserted into the stack trace, e.g. my builds like to blame free_kvm_area().
Revert the CALL back to a JMP. The changelog for commit b7c4145ba2eb ("KVM: Don't spin on virt instruction faults during reboot") contains nothing that indicates the switch to CALL was deliberate. This is backed up by the fact that the PUSH <insn RIP> was left intact.
Note that an alternative to the PUSH+JMP magic would be to JMP back to the "real" code and CALL from there, but that would require adding a JMP in the non-faulting path to avoid calling kvm_spurious_fault() and would add no value, i.e. the stack trace would be the same.
Using CALL:
------------[ cut here ]------------ kernel BUG at /home/sean/go/src/kernel.org/linux/arch/x86/kvm/x86.c:356! invalid opcode: 0000 [#1] SMP CPU: 4 PID: 1057 Comm: qemu-system-x86 Not tainted 4.20.0-rc6+ #75 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:kvm_spurious_fault+0x5/0x10 [kvm] Code: <0f> 0b 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 49 89 fd 41 RSP: 0018:ffffc900004bbcc8 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffffffffffff RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff888273fd8000 R08: 00000000000003e8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000784 R12: ffffc90000371fb0 R13: 0000000000000000 R14: 000000026d763cf4 R15: ffff888273fd8000 FS: 00007f3d69691700(0000) GS:ffff888277800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055f89bc56fe0 CR3: 0000000271a5a001 CR4: 0000000000362ee0 Call Trace: free_kvm_area+0x1044/0x43ea [kvm_intel] ? vmx_vcpu_run+0x156/0x630 [kvm_intel] ? kvm_arch_vcpu_ioctl_run+0x447/0x1a40 [kvm] ? kvm_vcpu_ioctl+0x368/0x5c0 [kvm] ? kvm_vcpu_ioctl+0x368/0x5c0 [kvm] ? __set_task_blocked+0x38/0x90 ? __set_current_blocked+0x50/0x60 ? __fpu__restore_sig+0x97/0x490 ? do_vfs_ioctl+0xa1/0x620 ? __x64_sys_futex+0x89/0x180 ? ksys_ioctl+0x66/0x70 ? __x64_sys_ioctl+0x16/0x20 ? do_syscall_64+0x4f/0x100 ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 Modules linked in: vhost_net vhost tap kvm_intel kvm irqbypass bridge stp llc ---[ end trace 9775b14b123b1713 ]---
Using JMP:
------------[ cut here ]------------ kernel BUG at /home/sean/go/src/kernel.org/linux/arch/x86/kvm/x86.c:356! invalid opcode: 0000 [#1] SMP CPU: 6 PID: 1067 Comm: qemu-system-x86 Not tainted 4.20.0-rc6+ #75 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:kvm_spurious_fault+0x5/0x10 [kvm] Code: <0f> 0b 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 49 89 fd 41 RSP: 0018:ffffc90000497cd0 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffffffffffff RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff88827058bd40 R08: 00000000000003e8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000784 R12: ffffc90000369fb0 R13: 0000000000000000 R14: 00000003c8fc6642 R15: ffff88827058bd40 FS: 00007f3d7219e700(0000) GS:ffff888277900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f3d64001000 CR3: 0000000271c6b004 CR4: 0000000000362ee0 Call Trace: vmx_vcpu_run+0x156/0x630 [kvm_intel] ? kvm_arch_vcpu_ioctl_run+0x447/0x1a40 [kvm] ? kvm_vcpu_ioctl+0x368/0x5c0 [kvm] ? kvm_vcpu_ioctl+0x368/0x5c0 [kvm] ? __set_task_blocked+0x38/0x90 ? __set_current_blocked+0x50/0x60 ? __fpu__restore_sig+0x97/0x490 ? do_vfs_ioctl+0xa1/0x620 ? __x64_sys_futex+0x89/0x180 ? ksys_ioctl+0x66/0x70 ? __x64_sys_ioctl+0x16/0x20 ? do_syscall_64+0x4f/0x100 ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 Modules linked in: vhost_net vhost tap kvm_intel kvm irqbypass bridge stp llc ---[ end trace f9daedb85ab3ddba ]---
--- arch/x86/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/kvm_host.h +1 -1
@@ -1324,7 +1324,7 @@ asmlinkage void kvm_spurious_fault(void)"cmpb $0, kvm_rebooting \n\t" \"jne 668b \n\t" \ __ASM_SIZE(push) " $666b \n\t" \ -"call kvm_spurious_fault \n\t" \ +"jmp kvm_spurious_fault \n\t" \".popsection \n\t" \ _ASM_EXTABLE(666b ,667b )
Greg Kroah-Hartman
maintainerPATCH 44/71 platform-msi: Free descriptors in platform_msi_domain_free()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miquel Raynal <[email protected]>
commit 81b1e6e6a8590a19257e37a1633bec098d499c57 upstream.
Since the addition of platform MSI support, there were two helpers supposed to allocate/free IRQs for a device:
platform_msi_domain_alloc_irqs()
platform_msi_domain_free_irqs()
In these helpers, IRQ descriptors are allocated in the "alloc" routine while they are freed in the "free" one.
Later, two other helpers have been added to handle IRQ domains on top of MSI domains:
platform_msi_domain_alloc()
platform_msi_domain_free()
Seen from the outside, the logic is pretty close with the former helpers and people used it with the same logic as before: a platform_msi_domain_alloc() call should be balanced with a platform_msi_domain_free() call. While this is probably what was intended to do, the platform_msi_domain_free() does not remove/free the IRQ descriptor(s) created/inserted in platform_msi_domain_alloc().
One effect of such situation is that removing a module that requested an IRQ will let one orphaned IRQ descriptor (with an allocated MSI entry) in the device descriptors list. Next time the module will be inserted back, one will observe that the allocation will happen twice in the MSI domain, one time for the remaining descriptor, one time for the new one. It also has the side effect to quickly overshoot the maximum number of allocated MSI and then prevent any module requesting an interrupt in the same domain to be inserted anymore.
This situation has been met with loops of insertion/removal of the mvpp2.ko module (requesting 15 MSIs each time).
--- drivers/base/platform-msi.c | 6 ++++-- include/linux/msi.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/base/platform-msi.c +4 -2
@@ -375,14 +375,16 @@ void platform_msi_domain_free(struct irq unsigned int nvec) {struct platform_msi_priv_data *data = domain->host_data; -struct msi_desc *desc; -for_each_msi_entry (desc, data->dev) { +struct msi_desc *desc, *tmp; +for_each_msi_entry_safe (desc, tmp, data->dev) {if (WARN_ON (!desc->irq || desc->nvec_used !=1 ))return ;if (!(desc->irq >= virq && desc->irq < (virq + nvec)))continue ;irq_domain_free_irqs_common (domain, desc->irq,1 ); +list_del (&desc->list); +free_msi_entry (desc); } }
include/linux/msi.h +2 -0
@@ -108,6 +108,8 @@ struct msi_desc { list_first_entry(dev_to_msi_list((dev)), struct msi_desc, list)#define for_each_msi_entry (desc, dev) \ list_for_each_entry((desc), dev_to_msi_list((dev)), list) +#define for_each_msi_entry_safe (desc, tmp, dev) \ + list_for_each_entry_safe((desc), (tmp), dev_to_msi_list((dev)), list)#ifdef CONFIG_PCI_MSI #define first_pci_msi_entry (pdev) first_msi_entry(&(pdev)->dev)
Greg Kroah-Hartman
maintainerPATCH 45/71 perf pmu: Suppress potential format-truncation warning
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 11a64a05dc649815670b1be9fe63d205cb076401 upstream.
Depending on which functions are inlined in util/pmu.c, the snprintf() calls in perf_pmu__parse_{scale,unit,per_pkg,snapshot}() might trigger a warning:
util/pmu.c: In function 'pmu_aliases':
util/pmu.c:178:31: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(path, PATH_MAX, "%s/%s.unit", dir, name);
^~I found this when trying to build perf from Linux 3.16 with gcc 8. However I can reproduce the problem in mainline if I force __perf_pmu__new_alias() to be inlined.
Suppress this by using scnprintf() as has been done elsewhere in perf.
--- tools/perf/util/pmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/perf/util/pmu.c +4 -4
@@ -103,7 +103,7 @@ static int perf_pmu__parse_scale(structchar path[PATH_MAX ];char *lc; -snprintf (path,PATH_MAX ,"%s/%s.scale" , dir, name); +scnprintf (path,PATH_MAX ,"%s/%s.scale" , dir, name); fd =open (path,O_RDONLY );if (fd ==-1 )
@@ -163,7 +163,7 @@ static int perf_pmu__parse_unit(struct pssize_t sret;int fd; -snprintf (path,PATH_MAX ,"%s/%s.unit" , dir, name); +scnprintf (path,PATH_MAX ,"%s/%s.unit" , dir, name); fd =open (path,O_RDONLY );if (fd ==-1 )
@@ -193,7 +193,7 @@ perf_pmu__parse_per_pkg(struct perf_pmu_char path[PATH_MAX ];int fd; -snprintf (path,PATH_MAX ,"%s/%s.per-pkg" , dir, name); +scnprintf (path,PATH_MAX ,"%s/%s.per-pkg" , dir, name); fd =open (path,O_RDONLY );if (fd ==-1 )
@@ -211,7 +211,7 @@ static int perf_pmu__parse_snapshot(struchar path[PATH_MAX ];int fd; -snprintf (path,PATH_MAX ,"%s/%s.snapshot" , dir, name); +scnprintf (path,PATH_MAX ,"%s/%s.snapshot" , dir, name); fd =open (path,O_RDONLY );if (fd ==-1 )
Greg Kroah-Hartman
maintainerPATCH 46/71 ext4: fix possible use after free in ext4_quota_enable
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pan Bian <[email protected]>
commit 61157b24e60fb3cd1f85f2c76a7b1d628f970144 upstream.
The function frees qf_inode via iput but then pass qf_inode to lockdep_set_quota_inode on the failure path. This may result in a use-after-free bug. The patch frees df_inode only when it is never used.
--- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
@@ -5425,9 +5425,9 @@ static int ext4_quota_enable(struct supe qf_inode->i_flags |=S_NOQUOTA ;lockdep_set_quota_inode (qf_inode,I_DATA_SEM_QUOTA ); err =dquot_enable (qf_inode, type, format_id, flags); -iput (qf_inode);if (err)lockdep_set_quota_inode (qf_inode,I_DATA_SEM_NORMAL ); +iput (qf_inode);return err; }
Greg Kroah-Hartman
maintainerPATCH 47/71 ext4: missing unlock/put_page() in ext4_try_to_write_inline_data()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maurizio Lombardi <[email protected]>
commit 132d00becb31e88469334e1e62751c81345280e0 upstream.
In case of error, ext4_try_to_write_inline_data() should unlock and release the page it holds.
--- fs/ext4/inline.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/ext4/inline.c +4 -1
@@ -702,8 +702,11 @@ int ext4_try_to_write_inline_data(structif (!PageUptodate (page)) { ret =ext4_read_inline_page (inode, page); -if (ret <0 ) +if (ret <0 ) { +unlock_page (page); +put_page (page); goto out_up_read; + } } ret =1 ;
Greg Kroah-Hartman
maintainerPATCH 48/71 ext4: fix EXT4_IOC_GROUP_ADD ioctl
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: ruippan (潘睿) <[email protected]>
commit e647e29196b7f802f8242c39ecb7cc937f5ef217 upstream.
Commit e2b911c53584 ("ext4: clean up feature test macros with predicate functions") broke the EXT4_IOC_GROUP_ADD ioctl. This was not noticed since only very old versions of resize2fs (before e2fsprogs 1.42) use this ioctl. However, using a new kernel with an enterprise Linux userspace will cause attempts to use online resize to fail with "No reserved GDT blocks".
--- fs/ext4/resize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/resize.c +1 -1
@@ -1600,7 +1600,7 @@ int ext4_group_add(struct super_block *s }if (reserved_gdb || gdb_off ==0 ) { -if (ext4_has_feature_resize_inode (sb) || +if (!ext4_has_feature_resize_inode (sb) || !le16_to_cpu (es->s_reserved_gdt_blocks)) {ext4_warning (sb,"No reserved GDT blocks, can't resize" );
Greg Kroah-Hartman
maintainerPATCH 49/71 ext4: include terminating u32 in size of xattr entries when expanding inodes
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit a805622a757b6d7f65def4141d29317d8e37b8a1 upstream.
In ext4_expand_extra_isize_ea(), we calculate the total size of the xattr header, plus the xattr entries so we know how much of the beginning part of the xattrs to move when expanding the inode extra size. We need to include the terminating u32 at the end of the xattr entries, or else if there is uninitialized, non-zero bytes after the xattr entries and before the xattr values, the list of xattr entries won't be properly terminated.
--- fs/ext4/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/xattr.c +1 -1
@@ -1499,7 +1499,7 @@ retry: base =IFIRST (header); end = (void *)raw_inode +EXT4_SB (inode->i_sb)->s_inode_size; min_offs = end - base; - total_ino =sizeof (struct ext4_xattr_ibody_header ); + total_ino =sizeof (struct ext4_xattr_ibody_header ) +sizeof (u32); error =xattr_check_inode (inode, header, end);if (error)
Greg Kroah-Hartman
maintainerPATCH 50/71 ext4: force inode writes when nfsd calls commit_metadata()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit fde872682e175743e0c3ef939c89e3c6008a1529 upstream.
Some time back, nfsd switched from calling vfs_fsync() to using a new commit_metadata() hook in export_operations(). If the file system did not provide a commit_metadata() hook, it fell back to using sync_inode_metadata(). Unfortunately doesn't work on all file systems. In particular, it doesn't work on ext4 due to how the inode gets journalled --- the VFS writeback code will not always call ext4_write_inode().
So we need to provide our own ext4_nfs_commit_metdata() method which calls ext4_write_inode() directly.
Google-Bug-Id: 121195940
--- fs/ext4/super.c | 11 +++++++++++ include/trace/events/ext4.h | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+)
fs/ext4/super.c +11 -0
@@ -1076,6 +1076,16 @@ static struct dentry *ext4_fh_to_parent( ext4_nfs_get_inode); } +static int ext4_nfs_commit_metadata (struct inode *inode) +{ +struct writeback_control wbc = { + .sync_mode =WB_SYNC_ALL + }; + +trace_ext4_nfs_commit_metadata (inode); +return ext4_write_inode (inode, &wbc); +} +/* * Try to release metadata pages (indirect blocks, directories) which are * mapped via the block device. Since these pages could have journal heads
@@ -1258,6 +1268,7 @@ static const struct export_operations ex .fh_to_dentry = ext4_fh_to_dentry, .fh_to_parent = ext4_fh_to_parent, .get_parent = ext4_get_parent, + .commit_metadata = ext4_nfs_commit_metadata, };enum {
include/trace/events/ext4.h +20 -0
@@ -223,6 +223,26 @@ TRACE_EVENT(ext4_drop_inode, (unsigned long) __entry->ino, __entry->drop) ); +TRACE_EVENT (ext4_nfs_commit_metadata, + TP_PROTO(struct inode *inode), + +TP_ARGS (inode), + +TP_STRUCT__entry ( + __field( dev_t, dev ) +__field ( ino_t, ino ) + ), + +TP_fast_assign ( + __entry->dev = inode->i_sb->s_dev; + __entry->ino = inode->i_ino; + ), + +TP_printk ("dev %d,%d ino %lu" , +MAJOR (__entry->dev),MINOR (__entry->dev), + (unsigned long ) __entry->ino) +); + TRACE_EVENT(ext4_mark_inode_dirty, TP_PROTO(struct inode *inode, unsigned long IP),
Greg Kroah-Hartman
maintainerPATCH 51/71 ext4: check for shutdown and r/o file system in ext4_write_inode()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit 18f2c4fcebf2582f96cbd5f2238f4f354a0e4847 upstream.
If the file system has been shut down or is read-only, then ext4_write_inode() needs to bail out early.
Also use jbd2_complete_transaction() instead of ext4_force_commit() so we only force a commit if it is needed.
--- fs/ext4/inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/ext4/inode.c +7 -2
@@ -5014,9 +5014,13 @@ int ext4_write_inode(struct inode *inode {int err; -if (WARN_ON_ONCE (current->flags &PF_MEMALLOC )) +if (WARN_ON_ONCE (current->flags &PF_MEMALLOC ) || +sb_rdonly (inode->i_sb))return 0 ; +if (unlikely (ext4_forced_shutdown (EXT4_SB (inode->i_sb)))) +return -EIO ; +if (EXT4_SB (inode->i_sb)->s_journal) {if (ext4_journal_current_handle ()) {jbd_debug (1 ,"called recursively, non-PF_MEMALLOC!\n" );
@@ -5032,7 +5036,8 @@ int ext4_write_inode(struct inode *inodeif (wbc->sync_mode !=WB_SYNC_ALL || wbc->for_sync)return 0 ; - err =ext4_force_commit (inode->i_sb); + err =jbd2_complete_transaction (EXT4_SB (inode->i_sb)->s_journal, +EXT4_I (inode)->i_sync_tid); }else {struct ext4_iloc iloc;
Greg Kroah-Hartman
maintainerPATCH 52/71 spi: bcm2835: Fix race on DMA termination
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Wunner <[email protected]>
commit e82b0b3828451c1cd331d9f304c6078fcd43b62e upstream.
If a DMA transfer finishes orderly right when spi_transfer_one_message() determines that it has timed out, the callbacks bcm2835_spi_dma_done() and bcm2835_spi_handle_err() race to call dmaengine_terminate_all(), potentially leading to double termination.
Prevent by atomically changing the dma_pending flag before calling dmaengine_terminate_all().
--- drivers/spi/spi-bcm2835.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/spi/spi-bcm2835.c +4 -6
@@ -233,10 +233,9 @@ static void bcm2835_spi_dma_done(void *d* is called the tx-dma must have finished - can't get to this * situation otherwise... */ -dmaengine_terminate_all (master->dma_tx); - -/* mark as no longer pending */ - bs->dma_pending =0 ; +if (cmpxchg (&bs->dma_pending, true, false)) { +dmaengine_terminate_all (master->dma_tx); + }/* and mark as completed */ ;complete (&master->xfer_completion);
@@ -617,10 +616,9 @@ static void bcm2835_spi_handle_err(strucstruct bcm2835_spi *bs =spi_master_get_devdata (master);/* if an error occurred and we have an active dma, then terminate */ -if (bs->dma_pending) { +if (cmpxchg (&bs->dma_pending, true, false)) {dmaengine_terminate_all (master->dma_tx);dmaengine_terminate_all (master->dma_rx); - bs->dma_pending =0 ; }/* and reset */ bcm2835_spi_reset_hw (master);
Greg Kroah-Hartman
maintainerPATCH 53/71 spi: bcm2835: Fix book-keeping of DMA termination
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Wunner <[email protected]>
commit dbc944115eed48af110646992893dc43321368d8 upstream.
If submission of a DMA TX transfer succeeds but submission of the corresponding RX transfer does not, the BCM2835 SPI driver terminates the TX transfer but neglects to reset the dma_pending flag to false.
Thus, if the next transfer uses interrupt mode (because it is shorter than BCM2835_SPI_DMA_MIN_LENGTH) and runs into a timeout, dmaengine_terminate_all() will be called both for TX (once more) and for RX (which was never started in the first place). Fix it.
--- drivers/spi/spi-bcm2835.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-bcm2835.c +1 -0
@@ -341,6 +341,7 @@ static int bcm2835_spi_transfer_one_dma(if (ret) {/* need to reset on errors */ dmaengine_terminate_all (master->dma_tx); + bs->dma_pending = false;bcm2835_spi_reset_hw (master);return ret; }
Greg Kroah-Hartman
maintainerPATCH 54/71 spi: bcm2835: Avoid finishing transfer prematurely in IRQ mode
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Wunner <[email protected]>
commit 56c1723426d3cfd4723bfbfce531d7b38bae6266 upstream.
The IRQ handler bcm2835_spi_interrupt() first reads as much as possible from the RX FIFO, then writes as much as possible to the TX FIFO. Afterwards it decides whether the transfer is finished by checking if the TX FIFO is empty.
If very few bytes were written to the TX FIFO, they may already have been transmitted by the time the FIFO's emptiness is checked. As a result, the transfer will be declared finished and the chip will be reset without reading the corresponding received bytes from the RX FIFO.
The odds of this happening increase with a high clock frequency (such that the TX FIFO drains quickly) and either passing "threadirqs" on the command line or enabling CONFIG_PREEMPT_RT_BASE (such that the IRQ handler may be preempted between filling the TX FIFO and checking its emptiness).
Fix by instead checking whether rx_len has reached zero, which means that the transfer has been received in full. This is also more efficient as it avoids one bus read access per interrupt. Note that bcm2835_spi_transfer_one_poll() likewise uses rx_len to determine whether the transfer has finished.
--- drivers/spi/spi-bcm2835.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/spi/spi-bcm2835.c +1 -2
@@ -155,8 +155,7 @@ static irqreturn_t bcm2835_spi_interrupt/* Write as many bytes as possible to FIFO */ bcm2835_wr_fifo (bs); -/* based on flags decide if we can finish the transfer */ -if (bcm2835_rd (bs,BCM2835_SPI_CS ) &BCM2835_SPI_CS_DONE ) { +if (!bs->rx_len) {/* Transfer complete - reset SPI HW */ bcm2835_spi_reset_hw (master);/* wake up the framework */
Greg Kroah-Hartman
maintainerPATCH 55/71 clk: rockchip: fix typo in rk3188 spdif_frac parent
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Jonker <[email protected]>
commit 8b19faf6fae2867e2c177212c541e8ae36aa4d32 upstream.
Fix typo in common_clk_branches.
Make spdif_pre parent of spdif_frac.
--- drivers/clk/rockchip/clk-rk3188.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3188.c +1 -1
@@ -381,7 +381,7 @@ static struct rockchip_clk_branch commonCOMPOSITE_NOMUX (0 ,"spdif_pre" ,"i2s_src" ,0 ,RK2928_CLKSEL_CON (5 ),0 ,7 ,DFLAGS ,RK2928_CLKGATE_CON (0 ),13 ,GFLAGS ), -COMPOSITE_FRACMUX (0 ,"spdif_frac" ,"spdif_pll" ,CLK_SET_RATE_PARENT , +COMPOSITE_FRACMUX (0 ,"spdif_frac" ,"spdif_pre" ,CLK_SET_RATE_PARENT ,RK2928_CLKSEL_CON (9 ),0 ,RK2928_CLKGATE_CON (0 ),14 ,GFLAGS , &common_spdif_fracmux),
Greg Kroah-Hartman
maintainerPATCH 56/71 cdc-acm: fix abnormal DATA RX issue for Mediatek Preloader.
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Macpaul Lin <[email protected]>
commit eafb27fa5283599ce6c5492ea18cf636a28222bb upstream.
Mediatek Preloader is a proprietary embedded boot loader for loading Little Kernel and Linux into device DRAM.
This boot loader also handle firmware update. Mediatek Preloader will be enumerated as a virtual COM port when the device is connected to Windows or Linux OS via CDC-ACM class driver. When the USB enumeration has been done, Mediatek Preloader will send out handshake command "READY" to PC actively instead of waiting command from the download tool.
Since Linux 4.12, the commit "tty: reset termios state on device registration" (93857edd9829e144acb6c7e72d593f6e01aead66) causes Mediatek Preloader receiving some abnoraml command like "READYXX" as it sent. This will be recognized as an incorrect response. The behavior change also causes the download handshake fail. This change only affects subsequent connects if the reconnected device happens to get the same minor number.
By disabling the ECHO termios flag could avoid this problem. However, it cannot be done by user space configuration when download tool open /dev/ttyACM0. This is because the device running Mediatek Preloader will send handshake command "READY" immediately once the CDC-ACM driver is ready.
This patch wants to fix above problem by introducing "DISABLE_ECHO" property in driver_info. When Mediatek Preloader is connected, the CDC-ACM driver could disable ECHO flag in termios to avoid the problem.
--- drivers/usb/class/cdc-acm.c | 10 ++++++++++ drivers/usb/class/cdc-acm.h | 1 + 2 files changed, 11 insertions(+)
drivers/usb/class/cdc-acm.c +10 -0
@@ -502,6 +502,13 @@ static int acm_tty_install(struct tty_drif (retval) goto error_init_termios; +/* +* Suppress initial echoing for some devices which might send data +* immediately after acm driver has been installed. +*/ +if (acm->quirks &DISABLE_ECHO ) + tty->termios.c_lflag &= ~ECHO ; + tty->driver_data = acm;return 0 ;
@@ -1620,6 +1627,9 @@ static const struct usb_device_id acm_id { USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; [email protected] */ .driver_info =NO_UNION_NORMAL ,/* has no union descriptor */ }, + { USB_DEVICE(0x0e8d, 0x2000), /* MediaTek Inc Preloader */ + .driver_info = DISABLE_ECHO, /* DISABLE ECHO in termios flag */ + }, { USB_DEVICE(0x0e8d, 0x3329), /* MediaTek Inc GPS */ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ },
drivers/usb/class/cdc-acm.h +1 -0
@@ -134,3 +134,4 @@ struct acm {#define QUIRK_CONTROL_LINE_STATE BIT(6)#define CLEAR_HALT_CONDITIONS BIT(7)#define SEND_ZERO_PACKET BIT(8) +#define DISABLE_ECHO BIT(9)
Greg Kroah-Hartman
maintainerPATCH 57/71 Btrfs: fix fsync of files with multiple hard links in new directories
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
commit 41bd60676923822de1df2c50b3f9a10171f4338a upstream.
The log tree has a long standing problem that when a file is fsync'ed we only check for new ancestors, created in the current transaction, by following only the hard link for which the fsync was issued. We follow the ancestors using the VFS' dget_parent() API. This means that if we create a new link for a file in a directory that is new (or in an any other new ancestor directory) and then fsync the file using an old hard link, we end up not logging the new ancestor, and on log replay that new hard link and ancestor do not exist. In some cases, involving renames, the file will not exist at all.
Example:
mkfs.btrfs -f /dev/sdb
mount /dev/sdb /mnt
mkdir /mnt/A
touch /mnt/foo
ln /mnt/foo /mnt/A/bar
xfs_io -c fsync /mnt/foo
<power failure>
In this example after log replay only the hard link named 'foo' exists and directory A does not exist, which is unexpected. In other major linux filesystems, such as ext4, xfs and f2fs for example, both hard links exist and so does directory A after mounting again the filesystem.
Checking if any new ancestors are new and need to be logged was added in 2009 by commit 12fcfd22fe5b ("Btrfs: tree logging unlink/rename fixes"), however only for the ancestors of the hard link (dentry) for which the fsync was issued, instead of checking for all ancestors for all of the inode's hard links.
So fix this by tracking the id of the last transaction where a hard link was created for an inode and then on fsync fallback to a full transaction commit when an inode has more than one hard link and at least one new hard link was created in the current transaction. This is the simplest solution since this is not a common use case (adding frequently hard links for which there's an ancestor created in the current transaction and then fsync the file). In case it ever becomes a common use case, a solution that consists of iterating the fs/subvol btree for each hard link and check if any ancestor is new, could be implemented.
This solves many unexpected scenarios reported by Jayashree Mohan and Vijay Chidambaram, and for which there is a new test case for fstests under review.
--- fs/btrfs/btrfs_inode.h | 6 ++++++ fs/btrfs/inode.c | 17 +++++++++++++++++ fs/btrfs/tree-log.c | 16 ++++++++++++++++ 3 files changed, 39 insertions(+)
fs/btrfs/btrfs_inode.h +6 -0
@@ -154,6 +154,12 @@ struct btrfs_inode {u64 last_unlink_trans;/* +* Track the transaction id of the last transaction used to create a +* hard link for the inode. This is used by the log tree (fsync). +*/ +u64 last_link_trans; + +/* * Number of bytes outstanding that are going to need csums. This is * used in ENOSPC accounting. */
fs/btrfs/inode.c +17 -0
@@ -3805,6 +3805,21 @@ cache_index:* inode is not a directory, logging its parent unnecessarily. */ BTRFS_I (inode)->last_unlink_trans =BTRFS_I (inode)->last_trans; +/* +* Similar reasoning for last_link_trans, needs to be set otherwise +* for a case like the following: +* +* mkdir A +* touch foo +* ln foo A/bar +* echo 2 > /proc/sys/vm/drop_caches +* fsync foo +* <power failure> +* +* Would result in link bar and directory A not existing after the power +* failure. +*/ +BTRFS_I (inode)->last_link_trans =BTRFS_I (inode)->last_trans; path->slots[0 ]++; if (inode->i_nlink != 1 ||
@@ -6670,6 +6685,7 @@ static int btrfs_link(struct dentry *oldif (err) goto fail; } +BTRFS_I (inode)->last_link_trans = trans->transid;d_instantiate (dentry, inode);btrfs_log_new_name (trans, inode,NULL , parent); }
@@ -9383,6 +9399,7 @@ struct inode *btrfs_alloc_inode(struct s ei->index_cnt = (u64)-1 ; ei->dir_index =0 ; ei->last_unlink_trans =0 ; + ei->last_link_trans =0 ; ei->last_log_commit =0 ; ei->delayed_iput_count =0 ;
fs/btrfs/tree-log.c +16 -0
@@ -5549,6 +5549,22 @@ static int btrfs_log_inode_parent(struct goto end_trans; } +/* +* If a new hard link was added to the inode in the current transaction +* and its link count is now greater than 1, we need to fallback to a +* transaction commit, otherwise we can end up not logging all its new +* parents for all the hard links. Here just from the dentry used to +* fsync, we can not visit the ancestor inodes for all the other hard +* links to figure out if any is new, so we fallback to a transaction +* commit (instead of adding a lot of complexity of scanning a btree, +* since this scenario is not a common use case). +*/ +if (inode->vfs_inode.i_nlink >1 && + inode->last_link_trans > last_committed) { + ret = -EMLINK ; + goto end_trans; + } +while (1 ) {if (!parent ||d_really_is_negative (parent) || sb != parent->d_sb)break ;
Greg Kroah-Hartman
maintainerPATCH 58/71 btrfs: run delayed items before dropping the snapshot
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
commit 0568e82dbe2510fc1fa664f58e5c997d3f1e649e upstream.
With my delayed refs patches in place we started seeing a large amount of aborts in __btrfs_free_extent:
BTRFS error (device sdb1): unable to find ref byte nr 91947008 parent 0 root 35964 owner 1 offset 0
Call Trace: ? btrfs_merge_delayed_refs+0xaf/0x340 __btrfs_run_delayed_refs+0x6ea/0xfc0 ? btrfs_set_path_blocking+0x31/0x60 btrfs_run_delayed_refs+0xeb/0x180 btrfs_commit_transaction+0x179/0x7f0 ? btrfs_check_space_for_delayed_refs+0x30/0x50 ? should_end_transaction.isra.19+0xe/0x40 btrfs_drop_snapshot+0x41c/0x7c0 btrfs_clean_one_deleted_snapshot+0xb5/0xd0 cleaner_kthread+0xf6/0x120 kthread+0xf8/0x130 ? btree_invalidatepage+0x90/0x90 ? kthread_bind+0x10/0x10 ret_from_fork+0x35/0x40
This was because btrfs_drop_snapshot depends on the root not being modified while it's dropping the snapshot. It will unlock the root node (and really every node) as it walks down the tree, only to re-lock it when it needs to do something. This is a problem because if we modify the tree we could cow a block in our path, which frees our reference to that block. Then once we get back to that shared block we'll free our reference to it again, and get ENOENT when trying to lookup our extent reference to that block in __btrfs_free_extent.
This is ultimately happening because we have delayed items left to be processed for our deleted snapshot _after_ all of the inodes are closed for the snapshot. We only run the delayed inode item if we're deleting the inode, and even then we do not run the delayed insertions or delayed removals. These can be run at any point after our final inode does its last iput, which is what triggers the snapshot deletion. We can end up with the snapshot deletion happening and then have the delayed items run on that file system, resulting in the above problem.
This problem has existed forever, however my patches made it much easier to hit as I wake up the cleaner much more often to deal with delayed iputs, which made us more likely to start the snapshot dropping work before the transaction commits, which is when the delayed items would generally be run. Before, generally speaking, we would run the delayed items, commit the transaction, and wakeup the cleaner thread to start deleting snapshots, which means we were less likely to hit this problem. You could still hit it if you had multiple snapshots to be deleted and ended up with lots of delayed items, but it was definitely harder.
Fix for now by simply running all the delayed items before starting to drop the snapshot. We could make this smarter in the future by making the delayed items per-root, and then simply drop any delayed items for roots that we are going to delete. But for now just a quick and easy solution is the safest.
--- fs/btrfs/extent-tree.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/btrfs/extent-tree.c +4 -0
@@ -9252,6 +9252,10 @@ int btrfs_drop_snapshot(struct btrfs_roo goto out_free; } + err =btrfs_run_delayed_items (trans); +if (err) + goto out_end_trans; +if (block_rsv) trans->block_rsv = block_rsv;
Greg Kroah-Hartman
maintainerPATCH 59/71 powerpc/tm: Set MSR[TS] just prior to recheckpoint
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <[email protected]>
commit e1c3743e1a20647c53b719dbf28b48f45d23f2cd upstream.
On a signal handler return, the user could set a context with MSR[TS] bits set, and these bits would be copied to task regs->msr.
At restore_tm_sigcontexts(), after current task regs->msr[TS] bits are set, several __get_user() are called and then a recheckpoint is executed.
This is a problem since a page fault (in kernel space) could happen when calling __get_user(). If it happens, the process MSR[TS] bits were already set, but recheckpoint was not executed, and SPRs are still invalid.
The page fault can cause the current process to be de-scheduled, with MSR[TS] active and without tm_recheckpoint() being called. More importantly, without TEXASR[FS] bit set also.
Since TEXASR might not have the FS bit set, and when the process is scheduled back, it will try to reclaim, which will be aborted because of the CPU is not in the suspended state, and, then, recheckpoint. This recheckpoint will restore thread->texasr into TEXASR SPR, which might be zero, hitting a BUG_ON().
kernel BUG at /build/linux-sf3Co9/linux-4.9.30/arch/powerpc/kernel/tm.S:434! cpu 0xb: Vector: 700 (Program Check) at [c00000041f1576d0] pc: c000000000054550: restore_gprs+0xb0/0x180 lr: 0000000000000000 sp: c00000041f157950 msr: 8000000100021033 current = 0xc00000041f143000 paca = 0xc00000000fb86300 softe: 0 irq_happened: 0x01 pid = 1021, comm = kworker/11:1 kernel BUG at /build/linux-sf3Co9/linux-4.9.30/arch/powerpc/kernel/tm.S:434! Linux version 4.9.0-3-powerpc64le ([email protected]) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) enter ? for help [c00000041f157b30] c00000000001bc3c tm_recheckpoint.part.11+0x6c/0xa0 [c00000041f157b70] c00000000001d184 __switch_to+0x1e4/0x4c0 [c00000041f157bd0] c00000000082eeb8 __schedule+0x2f8/0x990 [c00000041f157cb0] c00000000082f598 schedule+0x48/0xc0 [c00000041f157ce0] c0000000000f0d28 worker_thread+0x148/0x610 [c00000041f157d80] c0000000000f96b0 kthread+0x120/0x140 [c00000041f157e30] c00000000000c0e0 ret_from_kernel_thread+0x5c/0x7c
This patch simply delays the MSR[TS] set, so, if there is any page fault in the __get_user() section, it does not have regs->msr[TS] set, since the TM structures are still invalid, thus avoiding doing TM operations for in-kernel exceptions and possible process reschedule.
With this patch, the MSR[TS] will only be set just before recheckpointing and setting TEXASR[FS] = 1, thus avoiding an interrupt with TM registers in invalid state.
Other than that, if CONFIG_PREEMPT is set, there might be a preemption just after setting MSR[TS] and before tm_recheckpoint(), thus, this block must be atomic from a preemption perspective, thus, calling preempt_disable/enable() on this code.
It is not possible to move tm_recheckpoint to happen earlier, because it is required to get the checkpointed registers from userspace, with __get_user(), thus, the only way to avoid this undesired behavior is delaying the MSR[TS] set.
The 32-bits signal handler seems to be safe this current issue, but, it might be exposed to the preemption issue, thus, disabling preemption in this chunk of code.
Changes from v2:
* Run the critical section with preempt_disable.
--- arch/powerpc/kernel/signal_32.c | 20 +++++++++++++++++- arch/powerpc/kernel/signal_64.c | 44 +++++++++++++++++++++++++++------------- 2 files changed, 49 insertions(+), 15 deletions(-)
arch/powerpc/kernel/signal_32.c +19 -1
@@ -866,7 +866,23 @@ static long restore_tm_user_regs(struct/* If TM bits are set to the reserved value, it's an invalid context */ if (MSR_TM_RESV (msr_hi))return 1 ; -/* Pull in the MSR TM bits from the user context */ + +/* +* Disabling preemption, since it is unsafe to be preempted +* with MSR[TS] set without recheckpointing. +*/ +preempt_disable (); + +/* +* CAUTION: +* After regs->MSR[TS] being updated, make sure that get_user(), +* put_user() or similar functions are *not* called. These +* functions can generate page faults which will cause the process +* to be de-scheduled with MSR[TS] set but without calling +* tm_recheckpoint(). This can cause a bug. +* +* Pull in the MSR TM bits from the user context +*/ regs->msr = (regs->msr & ~MSR_TS_MASK ) | (msr_hi &MSR_TS_MASK );/* Now, recheckpoint. This loads up all of the checkpointed (older) * registers, including FP and V[S]Rs. After recheckpointing, the
@@ -891,6 +907,8 @@ static long restore_tm_user_regs(struct }#endif +preempt_enable (); +return 0 ; }#endif
arch/powerpc/kernel/signal_64.c +30 -14
62 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 60/71 f2fs: fix validation of the block count in sanity_check_raw_super
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Blumenstingl <[email protected]>
commit 88960068f25fcc3759455d85460234dcc9d43fef upstream.
Treat "block_count" from struct f2fs_super_block as 64-bit little endian value in sanity_check_raw_super() because struct f2fs_super_block declares "block_count" as "__le64".
This fixes a bug where the superblock validation fails on big endian devices with the following error:
F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) F2FS-fs (sda1): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) F2FS-fs (sda1): Can't find valid F2FS filesystem in 2th superblock
As result of this the partition cannot be mounted.
With this patch applied the superblock validation works fine and the partition can be mounted again:
F2FS-fs (sda1): Mounted with checkpoint version = 7c84
My little endian x86-64 hardware was able to mount the partition without this fix.
To confirm that mounting f2fs filesystems works on big endian machines again I tested this on a 32-bit MIPS big endian (lantiq) device.
--- fs/f2fs/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/f2fs/super.c +3 -3
@@ -1427,10 +1427,10 @@ static int sanity_check_raw_super(structreturn 1 ; } -if (segment_count > (le32_to_cpu (raw_super->block_count) >>9 )) { +if (segment_count > (le64_to_cpu (raw_super->block_count) >>9 )) {f2fs_msg (sb,KERN_INFO , -"Wrong segment_count / block_count (%u > %u)" , - segment_count,le32_to_cpu (raw_super->block_count)); +"Wrong segment_count / block_count (%u > %llu)" , + segment_count,le64_to_cpu (raw_super->block_count));return 1 ; }
Greg Kroah-Hartman
maintainerPATCH 61/71 serial: uartps: Fix interrupt mask issue to handle the RX interrupts properly
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nava kishore Manne <[email protected]>
commit 260683137ab5276113fc322fdbbc578024185fee upstream.
This patch Correct the RX interrupt mask value to handle the RX interrupts properly.
--- drivers/tty/serial/xilinx_uartps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/xilinx_uartps.c +2 -2
@@ -128,7 +128,7 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout#define CDNS_UART_IXR_RXTRIG 0x00000001/* RX FIFO trigger interrupt */ #define CDNS_UART_IXR_RXFULL 0x00000004/* RX FIFO full interrupt. */ #define CDNS_UART_IXR_RXEMPTY 0x00000002/* RX FIFO empty interrupt. */ -#define CDNS_UART_IXR_MASK 0x00001FFF/* Valid bit mask */ +#define CDNS_UART_IXR_RXMASK 0x000021e7/* Valid RX bit mask */ /* * Do not enable parity error interrupt for the following
@@ -362,7 +362,7 @@ static irqreturn_t cdns_uart_isr(int irqcdns_uart_handle_tx (dev_id); isrstatus &= ~CDNS_UART_IXR_TXEMPTY ; } -if (isrstatus &CDNS_UART_IXR_MASK ) +if (isrstatus &CDNS_UART_IXR_RXMASK )cdns_uart_handle_rx (dev_id, isrstatus);spin_unlock (&port->lock);
Greg Kroah-Hartman
maintainerPATCH 62/71 media: vivid: free bitmap_cap when updating std/timings/etc.
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans Verkuil <[email protected]>
commit 560ccb75c2caa6b1039dec1a53cd2ef526f5bf03 upstream.
When vivid_update_format_cap() is called it should free any overlay bitmap since the compose size will change.
--- drivers/media/platform/vivid/vivid-vid-cap.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/platform/vivid/vivid-vid-cap.c +2 -0
@@ -452,6 +452,8 @@ void vivid_update_format_cap(struct vivitpg_s_rgb_range (&dev->tpg,v4l2_ctrl_g_ctrl (dev->rgb_range_cap));break ; } +vfree (dev->bitmap_cap); + dev->bitmap_cap =NULL ;vivid_update_quality (dev);tpg_reset_source (&dev->tpg, dev->src_rect.width, dev->src_rect.height, dev->field_cap); dev->crop_cap = dev->src_rect;
Greg Kroah-Hartman
maintainerPATCH 63/71 media: v4l2-tpg: array index could become negative
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans Verkuil <[email protected]>
commit e5f71a27fa12c1a1b02ad478a568e76260f1815e upstream.
text[s] is a signed char, so using that as index into the font8x16 array can result in negative indices. Cast it to u8 to be safe.
--- drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/common/v4l2-tpg/v4l2-tpg-core.c +1 -1
@@ -1618,7 +1618,7 @@ typedef struct { u16 __; u8 _; } __packeunsigned s; \ \for (s =0 ; s < len; s++) { \ -u8 chr = font8x16[text[s] *16 + line]; \ +u8 chr = font8x16[(u8 )text[s] *16 + line]; \ \if (hdiv ==2 && tpg->hflip) { \ pos[3 ] = (chr & (0x01 <<6 ) ? fg : bg); \
Greg Kroah-Hartman
maintainerPATCH 64/71 MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit 92aa0718c9fa5160ad2f0e7b5bffb52f1ea1e51a upstream.
This patch is borrowed from ARM64 to ensure pmd_present() returns false after pmd_mknotpresent(). This is needed for THP.
References: 5bb1cc0ff9a6 ("arm64: Ensure pmd_present() returns false after pmd_mknotpresent()")
Patchwork: https://patchwork.linux-mips.org/patch/21135/
--- arch/mips/include/asm/pgtable-64.h | 5 +++++ 1 file changed, 5 insertions(+)
arch/mips/include/asm/pgtable-64.h +5 -0
@@ -193,6 +193,11 @@ static inline int pmd_bad(pmd_t pmd)static inline int pmd_present (pmd_t pmd) { +#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT +if (unlikely (pmd_val (pmd) & _PAGE_HUGE)) +return pmd_val (pmd) & _PAGE_PRESENT; +#endif +return pmd_val (pmd) != (unsigned long ) invalid_pte_table; }
Greg Kroah-Hartman
maintainerPATCH 65/71 MIPS: Align kernel load address to 64KB
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit bec0de4cfad21bd284dbddee016ed1767a5d2823 upstream.
KEXEC needs the new kernel's load address to be aligned on a page boundary (see sanity_check_segment_list()), but on MIPS the default vmlinuz load address is only explicitly aligned to 16 bytes.
Since the largest PAGE_SIZE supported by MIPS kernels is 64KB, increase the alignment calculated by calc_vmlinuz_load_addr to 64KB.
Patchwork: https://patchwork.linux-mips.org/patch/21131/
--- arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/mips/boot/compressed/calc_vmlinuz_load_addr.c +4 -3
@@ -13,6 +13,7 @@#include <stdint.h> #include <stdio.h> #include <stdlib.h> +#include "../../../../include/linux/sizes.h" int main (int argc,char *argv[]) {
@@ -45,11 +46,11 @@ int main(int argc, char *argv[]) vmlinuz_load_addr = vmlinux_load_addr + vmlinux_size;/* -* Align with 16 bytes: "greater than that used for any standard data -* types by a MIPS compiler." -- See MIPS Run Linux (Second Edition). +* Align with 64KB: KEXEC needs load sections to be aligned to PAGE_SIZE, +* which may be as large as 64KB depending on the kernel configuration. */ - vmlinuz_load_addr += (16 - vmlinux_size %16 ); + vmlinuz_load_addr += (SZ_64K - vmlinux_size %SZ_64K );printf ("0x%llx\n" , vmlinuz_load_addr);
Greg Kroah-Hartman
maintainerPATCH 66/71 MIPS: OCTEON: mark RGMII interface disabled on OCTEON III
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaro Koskinen <[email protected]>
commit edefae94b7b9f10d5efe32dece5a36e9d9ecc29e upstream.
Commit 885872b722b7 ("MIPS: Octeon: Add Octeon III CN7xxx interface detection") added RGMII interface detection for OCTEON III, but it results in the following logs:
[ 7.165984] ERROR: Unsupported Octeon model in __cvmx_helper_rgmii_probe [ 7.173017] ERROR: Unsupported Octeon model in __cvmx_helper_rgmii_probe
The current RGMII routines are valid only for older OCTEONS that use GMX/ASX hardware blocks. On later chips AGL should be used, but support for that is missing in the mainline. Until that is added, mark the interface as disabled.
--- arch/mips/cavium-octeon/executive/cvmx-helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/cavium-octeon/executive/cvmx-helper.c +2 -1
@@ -290,7 +290,8 @@ static cvmx_helper_interface_mode_t __cvcase 3 :return CVMX_HELPER_INTERFACE_MODE_LOOP ;case 4 : -return CVMX_HELPER_INTERFACE_MODE_RGMII ; +/* TODO: Implement support for AGL (RGMII). */ +return CVMX_HELPER_INTERFACE_MODE_DISABLED ;default :return CVMX_HELPER_INTERFACE_MODE_DISABLED ; }
Greg Kroah-Hartman
maintainerPATCH 67/71 CIFS: Fix error mapping for SMB2_LOCK command which caused OFD lock problem
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georgy A Bystrenin <[email protected]>
commit 9a596f5b39593414c0ec80f71b94a226286f084e upstream.
While resolving a bug with locks on samba shares found a strange behavior. When a file locked by one node and we trying to lock it from another node it fail with errno 5 (EIO) but in that case errno must be set to (EACCES | EAGAIN).
This isn't happening when we try to lock file second time on same node. In this case it returns EACCES as expected.
Also this issue not reproduces when we use SMB1 protocol (vers=1.0 in mount options).
Further investigation showed that the mapping from status_to_posix_error is different for SMB1 and SMB2+ implementations.
For SMB1 mapping is [NT_STATUS_LOCK_NOT_GRANTED to ERRlock] (See fs/cifs/netmisc.c line 66)
but for SMB2+ mapping is [STATUS_LOCK_NOT_GRANTED to -EIO] (see fs/cifs/smb2maperror.c line 383)
Quick changes in SMB2+ mapping from EIO to EACCES has fixed issue.
BUG: https://bugzilla.kernel.org/show_bug.cgi?id=201971
--- fs/cifs/smb2maperror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/smb2maperror.c +2 -2
@@ -377,8 +377,8 @@ static const struct status_to_posix_erro {STATUS_NONEXISTENT_EA_ENTRY, -EIO, "STATUS_NONEXISTENT_EA_ENTRY"}, {STATUS_NO_EAS_ON_FILE, -ENODATA, "STATUS_NO_EAS_ON_FILE"}, {STATUS_EA_CORRUPT_ERROR, -EIO, "STATUS_EA_CORRUPT_ERROR"}, - {STATUS_FILE_LOCK_CONFLICT, -EIO, "STATUS_FILE_LOCK_CONFLICT"}, - {STATUS_LOCK_NOT_GRANTED, -EIO, "STATUS_LOCK_NOT_GRANTED"}, + {STATUS_FILE_LOCK_CONFLICT, -EACCES, "STATUS_FILE_LOCK_CONFLICT"}, + {STATUS_LOCK_NOT_GRANTED, -EACCES, "STATUS_LOCK_NOT_GRANTED"}, {STATUS_DELETE_PENDING, -ENOENT, "STATUS_DELETE_PENDING"}, {STATUS_CTL_FILE_NOT_SUPPORTED, -ENOSYS, "STATUS_CTL_FILE_NOT_SUPPORTED"},
Greg Kroah-Hartman
maintainerPATCH 68/71 x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vitaly Kuznetsov <[email protected]>
commit d391f1207067268261add0485f0f34503539c5b0 upstream.
I was investigating an issue with seabios >= 1.10 which stopped working for nested KVM on Hyper-V. The problem appears to be in handle_ept_violation() function: when we do fast mmio we need to skip the instruction so we do kvm_skip_emulated_instruction(). This, however, depends on VM_EXIT_INSTRUCTION_LEN field being set correctly in VMCS. However, this is not the case.
Intel's manual doesn't mandate VM_EXIT_INSTRUCTION_LEN to be set when EPT MISCONFIG occurs. While on real hardware it was observed to be set, some hypervisors follow the spec and don't set it; we end up advancing IP with some random value.
I checked with Microsoft and they confirmed they don't fill VM_EXIT_INSTRUCTION_LEN on EPT MISCONFIG.
Fix the issue by doing instruction skip through emulator when running nested.
--- arch/x86/kvm/vmx.c | 19 +++++++++++++++++-- arch/x86/kvm/x86.c | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-)
arch/x86/kvm/vmx.c +17 -2
@@ -6548,9 +6548,24 @@ static int handle_ept_misconfig(struct k gpa =vmcs_read64 (GUEST_PHYSICAL_ADDRESS );if (!kvm_io_bus_write (vcpu,KVM_FAST_MMIO_BUS , gpa,0 ,NULL )) { -skip_emulated_instruction (vcpu);trace_kvm_fast_mmio (gpa); -return 1 ; +/* +* Doing kvm_skip_emulated_instruction() depends on undefined +* behavior: Intel's manual doesn't mandate +* VM_EXIT_INSTRUCTION_LEN to be set in VMCS when EPT MISCONFIG +* occurs and while on real hardware it was observed to be set, +* other hypervisors (namely Hyper-V) don't set it, we end up +* advancing IP with some random value. Disable fast mmio when +* running nested and keep it for real hardware in hope that +* VM_EXIT_INSTRUCTION_LEN will always be set correctly. +*/ +if (!static_cpu_has (X86_FEATURE_HYPERVISOR )) { +skip_emulated_instruction (vcpu); +return 1 ; + } +else +return x86_emulate_instruction (vcpu, gpa,EMULTYPE_SKIP , +NULL ,0 ) ==EMULATE_DONE ; } ret =handle_mmio_page_fault (vcpu, gpa, true);
arch/x86/kvm/x86.c +2 -1
@@ -5707,7 +5707,8 @@ int x86_emulate_instruction(struct kvm_v* handle watchpoints yet, those would be handled in * the emulate_ops. */ -if (kvm_vcpu_check_breakpoint (vcpu, &r)) +if (!(emulation_type &EMULTYPE_SKIP ) && +kvm_vcpu_check_breakpoint (vcpu, &r))return r; ctxt->interruptibility =0 ;
Greg Kroah-Hartman
maintainerPATCH 69/71 arm64: KVM: Avoid setting the upper 32 bits of VTCR_EL2 to 1
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit df655b75c43fba0f2621680ab261083297fd6d16 upstream.
Although bit 31 of VTCR_EL2 is RES1, we inadvertently end up setting all of the upper 32 bits to 1 as well because we define VTCR_EL2_RES1 as signed, which is sign-extended when assigning to kvm->arch.vtcr.
Lucky for us, the architecture currently treats these upper bits as RES0 so, whilst we've been naughty, we haven't set fire to anything yet.
--- arch/arm64/include/asm/kvm_arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/kvm_arm.h +1 -1
@@ -99,7 +99,7 @@ TCR_EL2_ORGN0_MASK | TCR_EL2_IRGN0_MASK | TCR_EL2_T0SZ_MASK)/* VTCR_EL2 Registers bits */ -#define VTCR_EL2_RES1 (1 << 31) +#define VTCR_EL2_RES1 (1U << 31)#define VTCR_EL2_HD (1 << 22)#define VTCR_EL2_HA (1 << 21)#define VTCR_EL2_PS_MASK TCR_EL2_PS_MASK
Greg Kroah-Hartman
maintainerPATCH 70/71 rtc: m41t80: Correct alarm month range with RTC reads
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej W. Rozycki <[email protected]>
commit 3cc9ffbb1f51eb4320575a48e4805a8f52e0e26b upstream.
Add the missing adjustment of the month range on alarm reads from the RTC, correcting an issue coming from commit 9c6dfed92c3e ("rtc: m41t80:
add alarm functionality"). The range is 1-12 for hardware and 0-11 for `struct rtc_time', and is already correctly handled on alarm writes to the RTC.
It was correct up until commit 48e9766726eb ("drivers/rtc/rtc-m41t80.c:
remove disabled alarm functionality") too, which removed the previous implementation of alarm support.
References: 48e9766726eb ("drivers/rtc/rtc-m41t80.c: remove disabled alarm functionality")
--- drivers/rtc/rtc-m41t80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-m41t80.c +1 -1
@@ -333,7 +333,7 @@ static int m41t80_read_alarm(struct devi alrm->time.tm_min =bcd2bin (alarmvals[3 ] &0x7f ); alrm->time.tm_hour =bcd2bin (alarmvals[2 ] &0x3f ); alrm->time.tm_mday =bcd2bin (alarmvals[1 ] &0x3f ); - alrm->time.tm_mon =bcd2bin (alarmvals[0 ] &0x3f ); + alrm->time.tm_mon =bcd2bin (alarmvals[0 ] &0x3f ) -1 ; alrm->enabled = !!(alarmvals[0 ] &M41T80_ALMON_AFE ); alrm->pending = (flags &M41T80_FLAGS_AF ) && alrm->enabled;
Greg Kroah-Hartman
maintainerPATCH 71/71 tpm: tpm_i2c_nuvoton: use correct command duration for TPM 2.x
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomas Winkler <[email protected]>
commit 2ba5780ce30549cf57929b01d8cba6fe656e31c5 upstream.
tpm_i2c_nuvoton calculated commands duration using TPM 1.x values via tpm_calc_ordinal_duration() also for TPM 2.x chips. Call tpm2_calc_ordinal_duration() for retrieving ordinal duration for TPM 2.X chips.
--- drivers/char/tpm/tpm_i2c_nuvoton.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/char/tpm/tpm_i2c_nuvoton.c +7 -4
@@ -369,6 +369,7 @@ static int i2c_nuvoton_send(struct tpm_cstruct device *dev = chip->dev.parent;struct i2c_client *client =to_i2c_client (dev);u32 ordinal; +unsigned long duration;size_t count =0 ;int burst_count, bytes2write, retries, rc = -EIO ;
@@ -455,10 +456,12 @@ static int i2c_nuvoton_send(struct tpm_creturn rc; } ordinal =be32_to_cpu (*((__be32 *) (buf +6 ))); - rc =i2c_nuvoton_wait_for_data_avail (chip, -tpm_calc_ordinal_duration (chip, - ordinal), - &priv->read_queue); +if (chip->flags &TPM_CHIP_FLAG_TPM2 ) + duration =tpm2_calc_ordinal_duration (chip, ordinal); +else + duration =tpm_calc_ordinal_duration (chip, ordinal); + + rc =i2c_nuvoton_wait_for_data_avail (chip, duration, &priv->read_queue);if (rc) {dev_err (dev,"%s() timeout command duration\n" , __func__);i2c_nuvoton_ready (chip);
Hello!
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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.
With 4.9, we get this build error:
| /srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:
In function 'ext4_write_inode':
| /srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:5018:6:
error: implicit declaration of function 'sb_rdonly' [-Werror=implicit-function-declaration]
| sb_rdonly(inode->i_sb)) | ^~~~~~~~~ | CC drivers/char/virtio_console.o | In file included from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/linkage.h:4:0,
| from/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/fs.h:4,
| from/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:21:
| /srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:5021:15:
error: implicit declaration of function 'ext4_forced_shutdown'; did
you mean 'ext4_force_commit'? [-Werror=implicit-function-declaration]
| if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) | ^ | /srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/compiler.h:168:42:
note: in definition of macro 'unlikely'
| # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
Greetings!
Daniel Díaz
[email protected]
Quoted 321 lines
Responses should be made by Wed Jan 9 10:53:04 UTC 2019. 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.149-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 4.9.149-rc1Tomas Winkler <[email protected]>
tpm:tpm_i2c_nuvoton: use correct command duration for TPM 2.xMaciej W. Rozycki <[email protected]>
rtc: m41t80: Correct alarm month range with RTC readsWill Deacon <[email protected]>
arm64: KVM: Avoid setting the upper 32 bits ofVTCR_EL2to 1Vitaly Kuznetsov <[email protected]>
x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nestedGeorgy A Bystrenin <[email protected]>
CIFS: Fix error mapping forSMB2_LOCKcommand which caused OFD lock problemAaro Koskinen <[email protected]>
MIPS: OCTEON: mark RGMII interface disabled on OCTEON IIIHuacai Chen <[email protected]>
MIPS: Align kernel load address to 64KBHuacai Chen <[email protected]>
MIPS: Ensurepmd_present()returns false afterpmd_mknotpresent()Hans Verkuil <[email protected]>
media: v4l2-tpg: array index could become negativeHans Verkuil <[email protected]>
media: vivid: freebitmap_capwhen updating std/timings/etc.Nava kishore Manne <[email protected]>
serial: uartps: Fix interrupt mask issue to handle the RX interrupts properlyMartin Blumenstingl <[email protected]>
f2fs: fix validation of the block count insanity_check_raw_superBreno Leitao <[email protected]>
powerpc/tm: Set MSR[TS] just prior to recheckpointJosef Bacik <[email protected]>
btrfs: run delayed items before dropping the snapshotFilipe Manana <[email protected]>
Btrfs: fix fsync of files with multiple hard links in new directoriesMacpaul Lin <[email protected]>
cdc-acm: fix abnormal DATA RX issue for Mediatek Preloader.Johan Jonker <[email protected]>
clk: rockchip: fix typo in rk3188spdif_fracparentLukas Wunner <[email protected]>
spi: bcm2835: Avoid finishing transfer prematurely in IRQ modeLukas Wunner <[email protected]>
spi: bcm2835: Fix book-keeping of DMA terminationLukas Wunner <[email protected]>
spi: bcm2835: Fix race on DMA terminationTheodore Ts'o <[email protected]>
ext4: check for shutdown and r/o file system inext4_write_inode()Theodore Ts'o <[email protected]>
ext4: force inode writes when nfsd callscommit_metadata()Theodore Ts'o <[email protected]>
ext4: include terminating u32 in size of xattr entries when expanding inodesruippan (潘睿) <[email protected]>
ext4: fixEXT4_IOC_GROUP_ADDioctlMaurizio Lombardi <[email protected]>
ext4: missing unlock/put_page() inext4_try_to_write_inline_data()Pan Bian <[email protected]>
ext4: fix possible use after free inext4_quota_enableBen Hutchings <[email protected]>
perf pmu: Suppress potential format-truncation warningMiquel Raynal <[email protected]>
platform-msi: Free descriptors inplatform_msi_domain_free()Sean Christopherson <[email protected]>
KVM: x86: Use jmp to invokekvm_spurious_fault()from .fixupPatrick Dreyer <[email protected]>
Input:elan_i2c- add ACPI ID for touchpad in ASUS Aspire F5-573GBjørn Mork <[email protected]>
qmi_wwan: applySET_DTRquirk to the SIMCOM shared device IDColin Ian King <[email protected]>
staging: wilc1000: fix missingread_writesetting when reading dataJia-Ju Bai <[email protected]>
usb: r8a66597: Fix a possible concurrency use-after-free bug inr8a66597_endpoint_disable()Jörgen Storvist <[email protected]>
USB: serial: option: add Fibocom NL678 seriesScott Chen <[email protected]>
USB: serial: pl2303: add ids for Hewlett-Packard HP POS pole displaysSameer Pujar <[email protected]>
ALSA: hda/tegra: clear pending irq handlersMantas Mikulėnas <[email protected]>
ALSA: hda: add mute LED support for HP EliteBook 840 G4Arnd Bergmann <[email protected]>
mtd: atmel-quadspi: disallow building on ebsa110Gustavo A. R. Silva <[email protected]>
ALSA: emux: Fix potential Spectre v1 vulnerabilitiesGustavo A. R. Silva <[email protected]>
ALSA: pcm: Fix potential Spectre v1 vulnerabilityGustavo A. R. Silva <[email protected]>
ALSA: emu10k1: Fix potential Spectre v1 vulnerabilitiesGustavo A. R. Silva <[email protected]>
ALSA: rme9652: Fix potential Spectre v1 vulnerabilityCong Wang <[email protected]>
ptr_ring: wrap back ->producer in __ptr_ring_swap_queue()Deepa Dinamani <[email protected]>
sock: Make sock->sk_stamp thread-safeYuval Avnery <[email protected]>
net/mlx5: Typo fix indel_sw_hw_ruleAlaa Hleihel <[email protected]>
net/mlx5e: Remove the false indication of software timestamping supportLorenzo Bianconi <[email protected]>
gro_cell: addnapi_disableingro_cells_destroyCong Wang <[email protected]>
tipc: compare remote and local protocols intipc_udp_enable()Cong Wang <[email protected]>
tipc: uselock_sock()intipc_sk_reinit()Juergen Gross <[email protected]>
xen/netfront: tolerate frags with no dataJorgen Hansen <[email protected]>
VSOCK: Send reset control packet when socket is partially boundJason Wang <[email protected]>
vhost: make sure used idx is seen before log invhost_add_used_n()Cong Wang <[email protected]>
tipc: fix a doublekfree_skb()Xin Long <[email protected]>
sctp: initializesin6_flowinfofor ipv6 addrs insctp_inet6addr_eventWillem de Bruijn <[email protected]>
packet: validate address length if non-zeroWillem de Bruijn <[email protected]>
packet: validate address lengthCong Wang <[email protected]>
net/wan: fix a double free inx25_asy_open_tty()Cong Wang <[email protected]>
netrom: fix locking innr_find_socket()Kunihiko Hayashi <[email protected]>
net: phy: Fix the issue that netif always links up after resumingMichal Kubecek <[email protected]>
net: ipv4: do not handle duplicate fragments as overlappingEric Dumazet <[email protected]>
isdn: fix kernel-infoleak incapi_unlocked_ioctlEric Dumazet <[email protected]>
ipv6: tunnels: fix two use-after-freeCong Wang <[email protected]>
ipv6: explicitly initializeudp6_addrinudp_sock_create6()Willem de Bruijn <[email protected]>
ieee802154:lowpan_header_createcheck must check daddrTyrel Datwyler <[email protected]>
ibmveth: fix DMA unmap error inibmveth_xmit_starterror pathCong Wang <[email protected]>
ax25: fix a use-after-free inax25_fillin_cb()Gustavo A. R. Silva <[email protected]>
phonet:af_phonet: Fix Spectre v1 vulnerabilityGustavo A. R. Silva <[email protected]>
net: core: Fix Spectre v1 vulnerabilityGustavo A. R. Silva <[email protected]>
ipv4: Fix potential Spectre v1 vulnerabilityGustavo A. R. Silva <[email protected]>
ip6mr: Fix potential Spectre v1 vulnerabilityGuenter Roeck <[email protected]>
NFC: nxp-nci: Includeunaligned.hinstead ofaccess_ok.h-------------
Diffstat:
Makefile | 4 +- arch/arm64/include/asm/kvm_arm.h | 2 +- arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 7 ++- arch/mips/cavium-octeon/executive/cvmx-helper.c | 3 +- arch/mips/include/asm/pgtable-64.h | 5 ++ arch/powerpc/kernel/signal_32.c | 20 ++++++- arch/powerpc/kernel/signal_64.c | 44 +++++++++----- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 19 +++++- arch/x86/kvm/x86.c | 3 +- drivers/base/platform-msi.c | 6 +- drivers/char/tpm/tpm_i2c_nuvoton.c | 11 ++-- drivers/clk/rockchip/clk-rk3188.c | 2 +- drivers/input/mouse/elan_i2c_core.c | 1 + drivers/isdn/capi/kcapi.c | 4 +- drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 2 +- drivers/media/platform/vivid/vivid-vid-cap.c | 2 + drivers/mtd/spi-nor/Kconfig | 2 +- drivers/net/ethernet/ibm/ibmveth.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 11 +--- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +- drivers/net/phy/phy_device.c | 7 +-- drivers/net/usb/qmi_wwan.c | 2 +- drivers/net/wan/x25_asy.c | 2 + drivers/net/xen-netfront.c | 2 +- drivers/nfc/nxp-nci/firmware.c | 2 +- drivers/nfc/nxp-nci/i2c.c | 2 +- drivers/rtc/rtc-m41t80.c | 2 +- drivers/spi/spi-bcm2835.c | 14 ++--- drivers/staging/wilc1000/wilc_sdio.c | 1 + drivers/tty/serial/xilinx_uartps.c | 4 +- drivers/usb/class/cdc-acm.c | 10 ++++ drivers/usb/class/cdc-acm.h | 1 + drivers/usb/host/r8a66597-hcd.c | 5 +- drivers/usb/serial/option.c | 4 ++ drivers/usb/serial/pl2303.c | 5 ++ drivers/usb/serial/pl2303.h | 5 ++ drivers/vhost/vhost.c | 2 + fs/btrfs/btrfs_inode.h | 6 ++ fs/btrfs/extent-tree.c | 4 ++ fs/btrfs/inode.c | 17 ++++++ fs/btrfs/tree-log.c | 16 ++++++ fs/cifs/smb2maperror.c | 4 +- fs/ext4/inline.c | 5 +- fs/ext4/inode.c | 9 ++- fs/ext4/resize.c | 2 +- fs/ext4/super.c | 13 ++++- fs/ext4/xattr.c | 2 +- fs/f2fs/super.c | 6 +- include/linux/msi.h | 2 + include/linux/ptr_ring.h | 2 + include/net/gro_cells.h | 1 + include/net/sock.h | 36 +++++++++++- include/trace/events/ext4.h | 20 +++++++ net/ax25/af_ax25.c | 11 +++- net/ax25/ax25_dev.c | 2 + net/compat.c | 15 +++-- net/core/filter.c | 2 + net/core/sock.c | 3 + net/ieee802154/6lowpan/tx.c | 3 + net/ipv4/ip_fragment.c | 18 ++++-- net/ipv4/ipmr.c | 3 + net/ipv6/ip6_tunnel.c | 1 + net/ipv6/ip6_udp_tunnel.c | 3 +- net/ipv6/ip6_vti.c | 1 + net/ipv6/ip6mr.c | 4 ++ net/netrom/af_netrom.c | 15 +++-- net/packet/af_packet.c | 8 ++- net/phonet/af_phonet.c | 3 + net/sctp/ipv6.c | 1 + net/sunrpc/svcsock.c | 2 +- net/tipc/socket.c | 8 ++- net/tipc/udp_media.c | 9 ++- net/vmw_vsock/vmci_transport.c | 67 ++++++++++++++++------ sound/core/pcm.c | 2 + sound/pci/emu10k1/emufx.c | 5 ++ sound/pci/hda/hda_tegra.c | 2 + sound/pci/hda/patch_conexant.c | 1 + sound/pci/rme9652/hdsp.c | 10 ++-- sound/synth/emux/emux_hwdep.c | 7 ++- tools/perf/util/pmu.c | 8 +-- 81 files changed, 451 insertions(+), 136 deletions(-)
Greg Kroah-Hartman
maintainerQuoted 27 lines · Daniel Díaz
Hello!
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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.
With 4.9, we get this build error:
|/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:
In function 'ext4_write_inode':
|/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:5018:6:
error: implicit declaration of function 'sb_rdonly' [-Werror=implicit-function-declaration]| sb_rdonly(inode->i_sb)) | ^~~~~~~~~ | CC drivers/char/virtio_console.o | In file included from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/linkage.h:4:0,
| from/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/fs.h:4,
| from/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:21:
|/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:5021:15:
error: implicit declaration of function 'ext4_forced_shutdown'; did
you mean 'ext4_force_commit'? [-Werror=implicit-function-declaration]
Quoted 6 lines
| if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) | ^ | /srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/compiler.h:168:42:note: in definition of macro 'unlikely'
| # define unlikely(x)__builtin_expect(!!(x), 0)
| ^
Ugh, wow. Ok, something is really wrong with my build systems to not find this either, let me go see what is up...
Greg Kroah-Hartman
maintainerQuoted 35 lines · Greg Kroah-Hartman
Quoted 27 lines · Daniel Díaz
Hello!
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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.
With 4.9, we get this build error:
|/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:
In function 'ext4_write_inode':
|/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:5018:6:
error: implicit declaration of function 'sb_rdonly' [-Werror=implicit-function-declaration]| sb_rdonly(inode->i_sb)) | ^~~~~~~~~ | CC drivers/char/virtio_console.o | In file included from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/linkage.h:4:0,
| from/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/fs.h:4,
| from/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:21:
|/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/fs/ext4/inode.c:5021:15:
error: implicit declaration of function 'ext4_forced_shutdown'; did
you mean 'ext4_force_commit'? [-Werror=implicit-function-declaration]Quoted 6 lines
| if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) | ^ | /srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/compiler.h:168:42:note: in definition of macro 'unlikely'
| # define unlikely(x)__builtin_expect(!!(x), 0)
| ^
Quoted 2 lines
Ugh, wow. Ok, something is really wrong with my build systems to not find this either, let me go see what is up...
Ok, builder problem fixed (my fault, hadn't updated the kernel tree there...) Let me run it through that testing before I push out a -rc3 to make sure I really fix all of these issues.
thanks for pointing these out, it must be monday...
greg k-h
Greg Kroah-Hartman
maintainerQuoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. 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.149-rc1.gz
-rc2 is out to fix a build issue:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc2.gz
Greg Kroah-Hartman
maintainerQuoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. 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.149-rc1.gz
Ok, hopefully this is better, at least it builds on x86-64 properly now, -rc3:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc3.gz
Quoted 10 lines · Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. Anything received after that time might be too late.
Quoted 6 lines
Quoted 2 lines
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.149-rc1.gzOk, hopefully this is better, at least it builds on x86-64 properly now, -rc3:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc3.gz
Test results report of 4.9.149-rc3,
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 4.9.149-rc3
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.9.y
git commit: d1d800b1ed7ab74a26df74ce1f95d5f49f36d717
git describe: v4.9.148-69-gd1d800b1ed7a
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.9-oe/build/v4.9.148-69-gd1d800b1ed7a
No regressions (compared to build v4.9.148)
No fixes (compared to build v4.9.148)
Ran 19740 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c - arm64
- hi6220-hikey - arm64
- i386
- juno-r2 - arm64
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15 - arm
- x86_64
Test Suites
-----------
* boot
* install-android-platform-tools-r2600
* kselftest
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-containers-tests
* ltp-cpuhotplug-tests
* ltp-cve-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-timers-tests
* spectre-meltdown-checker-test
* ltp-open-posix-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 16 lines · shuah
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. 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.149-rc1.gzor 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.
Quoted 7 lines
Quoted 4 lines
thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
These results are for 4.9.149-rc3
thanks,
-- Shuah
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. Anything received after that time might be too late.
For v4.9.148-69-gd1d800b1ed7a:
Build results:
total: 171 pass: 165 fail: 6
Failed builds:
arm:allmodconfig
mips:allmodconfig
parisc:allmodconfig
powerpc:allmodconfig
sparc64:allmodconfig
xtensa:allmodconfig
Qemu test results:
total: 305 pass: 305 fail: 0
Failures as reported earlier for other releases.
Guenter
Greg Kroah-Hartman
maintainerQuoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. 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.149-rc1.gz
-rc4 is now out, hopefully this is the last one...
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc1.gz
Greg Kroah-Hartman
maintainerQuoted 12 lines · Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. 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.149-rc1.gz
Review
Quoted 2 lines
(quoted diff) +0
-1-rc4 is now out, hopefully this is the last one... https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc1.gz
And here's the real url:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc4.gz
Jon Hunter
maintainerQuoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. 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.149-rc1.gz
Quoted 6 lines
Review
Quoted 2 lines
(quoted diff) +0
-1-rc4 is now out, hopefully this is the last one... https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc1.gzAnd here's the real url:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.149-rc4.gz
All tests are passing for Tegra ...
Test results for stable-v4.9:
8 builds: 8 pass, 0 fail
16 boots: 16 pass, 0 fail
14 tests: 14 pass, 0 failLinux version: 4.9.149-rc4-g8af94cd
Boards tested: tegra124-jetson-tk1, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04
Cheers
Jon
Signature · 1 line
nvpublic
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.149 release. There are 71 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 Wed Jan 9 10:53:04 UTC 2019. Anything received after that time might be too late.
For v4.9.148-68-g8af94cd8ec70:
Build results:
total: 171 pass: 171 fail: 0 Qemu test results: total: 305 pass: 305 fail: 0
Guenter