Hi Greg,
Kindly consider/review following net/sched fixes for stable 4.9.y.
This patchset is a follow-up of upstream fix
87b60cfacf9f ("net_sched: fix error recovery at qdisc creation")
cherry-picked on stable 4.9.y.
It fix null pointer dereferences due to uninitialized timer
(qdisc watchdog) or double frees due to ->destroy cleaning up a
second time. Here is the original submission
https://www.mail-archive.com/netdev@vger.kernel.org/msg186003.html
Cherry-picked and build tested on Linux 4.9.123 for ARCH=x86_64.
These fixes are applicable for stable 4.4.y kernel as well, but
one of the patches needed a minor rebasing, so I'm resending this
series for 4.4.y in a separate thread to avoid any confusion.
Regards,
Amit Pundir
Change since v1:
Rebased "sch_multiq: fix double free on init failure" patch
and fixed "unused variable" build warning.
Nikolay Aleksandrov (5):
sch_htb: fix crash on init failure
sch_multiq: fix double free on init failure
sch_hhf: fix null pointer dereference on init failure
sch_netem: avoid null pointer deref on init failure
sch_tbf: fix two null pointer dereferences on init failure
net/sched/sch_hhf.c | 3 +++
net/sched/sch_htb.c | 5 +++--
net/sched/sch_multiq.c | 9 ++-------
net/sched/sch_netem.c | 4 ++--
net/sched/sch_tbf.c | 5 +++--
5 files changed, 13 insertions(+), 13 deletions(-)
--
2.7.4
Hi,
This patch series fixes read-only issue when non-empty workdir occurred
in overlayfs, the non-empty workdir could be easily reproduced in
power-failure test during write operations.
These patches have passed basic test in unionmount-testsuite.
Antonio Murdaca (1):
ovl: override creds with the ones from the superblock mounter
Miklos Szeredi (2):
ovl: rename is_merge to is_lowest
ovl: proper cleanup of workdir
fs/overlayfs/copy_up.c | 26 +----------
fs/overlayfs/dir.c | 67 +++--------------------------
fs/overlayfs/overlayfs.h | 3 ++
fs/overlayfs/readdir.c | 93 +++++++++++++++++++++++++++++++---------
fs/overlayfs/super.c | 20 ++++++++-
5 files changed, 100 insertions(+), 109 deletions(-)
--
2.18.0
From: Hanjun Guo <hanjun.guo(a)linaro.org>
Hi Greg,
When I was migrating the kernel from 4.1 to 4.4, I found some irqchip (and one
genirq) bugfix patches are missing in 4.4, please take a look and consider
apply them.
Thanks
Hanjun
Marc Zyngier (3):
irqchip/gic-v3-its: Recompute the number of pages on page size change
irqchip/gic-v3: Add missing barrier to 32bit version of
gic_read_iar()
irqchip/gic: Make interrupt ID 1020 invalid
Shanker Donthineni (2):
irqchip/gicv3-its: Fix memory leak in its_free_tables()
irqchip/gicv3-its: Avoid cache flush beyond ITS_BASERn memory size
Sudeep Holla (1):
genirq: Delay incrementing interrupt count if it's disabled/pending
arch/arm/include/asm/arch_gicv3.h | 1 +
drivers/irqchip/irq-gic-v3-its.c | 34 ++++++++++++++++++++++------------
drivers/irqchip/irq-gic.c | 2 +-
kernel/irq/chip.c | 8 ++++----
4 files changed, 28 insertions(+), 17 deletions(-)
--
1.7.12.4
From: Kristian Evensen <kristian.evensen(a)gmail.com>
The Quectel EP06 (and EM06/EG06) LTE modem supports updating the USB
configuration, without the VID/PID or configuration number changing.
When the configuration is updated and interfaces are added/removed, the
interface numbers are updated. This causes our current code for matching
EP06 not to work as intended, as the assumption about reserved
interfaces no longer holds. If for example the diagnostic (first)
interface is removed, option will (try to) bind to the QMI interface.
This patch improves EP06 detection by replacing the current match with
two matches, and those matches check class, subclass and protocol as
well as VID and PID. The diag interface exports class, subclass and
protocol as 0xff. For the other serial interfaces, class is 0xff and
subclass and protocol are both 0x0.
The modem can export the following devices and always in this order:
diag, nmea, at, ppp. qmi and adb. This means that diag can only ever be
interface 0, and interface numbers 1-5 should be marked as reserved. The
three other serial devices can have interface numbers 0-3, but I have
not marked any interfaces as reserved. The reason is that the serial
devices are the only interfaces exported by the device where subclass
and protocol is 0x0.
QMI exports the same class, subclass and protocol values as the diag
interface. However, the two interfaces have different number of
endpoints, QMI has three and diag two. I have added a check for number
of interfaces if VID/PID matches the EP06, and we ignore the device if
number of interfaces equals three (and subclass is set).
Signed-off-by: Kristian Evensen <kristian.evensen(a)gmail.com>
Acked-by: Dan Williams <dcbw(a)redhat.com>
[ johan: drop uneeded RSVD(5) for ADB ]
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/usb/serial/option.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 0215b70c4efc..382feafbd127 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1081,8 +1081,9 @@ static const struct usb_device_id option_ids[] = {
.driver_info = RSVD(4) },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
.driver_info = RSVD(4) },
- { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06),
- .driver_info = RSVD(4) | RSVD(5) },
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),
+ .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) },
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
@@ -1985,6 +1986,7 @@ static int option_probe(struct usb_serial *serial,
{
struct usb_interface_descriptor *iface_desc =
&serial->interface->cur_altsetting->desc;
+ struct usb_device_descriptor *dev_desc = &serial->dev->descriptor;
unsigned long device_flags = id->driver_info;
/* Never bind to the CD-Rom emulation interface */
@@ -1999,6 +2001,18 @@ static int option_probe(struct usb_serial *serial,
if (device_flags & RSVD(iface_desc->bInterfaceNumber))
return -ENODEV;
+ /*
+ * Don't bind to the QMI device of the Quectel EP06/EG06/EM06. Class,
+ * subclass and protocol is 0xff for both the diagnostic port and the
+ * QMI interface, but the diagnostic port only has two endpoints (QMI
+ * has three).
+ */
+ if (dev_desc->idVendor == cpu_to_le16(QUECTEL_VENDOR_ID) &&
+ dev_desc->idProduct == cpu_to_le16(QUECTEL_PRODUCT_EP06) &&
+ iface_desc->bInterfaceSubClass && iface_desc->bNumEndpoints == 3) {
+ return -ENODEV;
+ }
+
/* Store the device flags so we can use them during attach. */
usb_set_serial_data(serial, (void *)device_flags);
--
2.19.0
When the LRW block counter overflows, the current implementation returns
128 as the index to the precomputed multiplication table, which has 128
entries. This patch fixes it to return the correct value (127).
Fixes: 64470f1b8510 ("[CRYPTO] lrw: Liskov Rivest Wagner, a tweakable narrow block cipher mode")
Cc: <stable(a)vger.kernel.org> # 2.6.20+
Reported-by: Eric Biggers <ebiggers(a)kernel.org>
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
---
crypto/lrw.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/crypto/lrw.c b/crypto/lrw.c
index 393a782679c7..5504d1325a56 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -143,7 +143,12 @@ static inline int get_index128(be128 *block)
return x + ffz(val);
}
- return x;
+ /*
+ * If we get here, then x == 128 and we are incrementing the counter
+ * from all ones to all zeros. This means we must return index 127, i.e.
+ * the one corresponding to key2*{ 1,...,1 }.
+ */
+ return 127;
}
static int post_crypt(struct skcipher_request *req)
--
2.17.1
Hi Greg,
I think we missed the commit 94a5d8790e79 ("arm64: cpu_errata: include
required headers"), could you please include it in next stable release?
Thanks,
Jisheng
The patch below was submitted to be applied to the 4.18-stable tree.
I fail to see how this patch meets the stable kernel rules as found at
Documentation/process/stable-kernel-rules.rst.
I could be totally wrong, and if so, please respond to
<stable(a)vger.kernel.org> and let me know why this patch should be
applied. Otherwise, it is now dropped from my patch queues, never to be
seen again.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 7288bde1f9df6c1475675419bdd7725ce84dec56 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd(a)arndb.de>
Date: Mon, 20 Aug 2018 23:37:50 +0200
Subject: [PATCH] x86: kvm: avoid unused variable warning
Removing one of the two accesses of the maxphyaddr variable led to
a harmless warning:
arch/x86/kvm/x86.c: In function 'kvm_set_mmio_spte_mask':
arch/x86/kvm/x86.c:6563:6: error: unused variable 'maxphyaddr' [-Werror=unused-variable]
Removing the #ifdef seems to be the nicest workaround, as it
makes the code look cleaner than adding another #ifdef.
Fixes: 28a1f3ac1d0c ("kvm: x86: Set highest physical address bits in non-present/reserved SPTEs")
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Cc: stable(a)vger.kernel.org # L1TF
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f7dff0457846..14ee9a814888 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6576,14 +6576,12 @@ static void kvm_set_mmio_spte_mask(void)
/* Set the present bit. */
mask |= 1ull;
-#ifdef CONFIG_X86_64
/*
* If reserved bit is not supported, clear the present bit to disable
* mmio page fault.
*/
- if (maxphyaddr == 52)
+ if (IS_ENABLED(CONFIG_X86_64) && maxphyaddr == 52)
mask &= ~1ull;
-#endif
kvm_mmu_set_mmio_spte_mask(mask, mask);
}
This is the start of the stable review cycle for the 4.4.154 release.
There are 80 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 Sep 5 16:49:18 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.154-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.4.154-rc1
Scott Bauer <scott.bauer(a)intel.com>
cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
Mike Christie <mchristi(a)redhat.com>
iscsi target: fix session creation failure handling
Bart Van Assche <bart.vanassche(a)wdc.com>
scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock
Bart Van Assche <bart.vanassche(a)wdc.com>
scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
Paul Burton <paul.burton(a)mips.com>
MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7
Maciej W. Rozycki <macro(a)mips.com>
MIPS: Correct the 64-bit DSP accumulator register size
Masami Hiramatsu <mhiramat(a)kernel.org>
kprobes: Make list and blacklist root user read only
Sebastian Ott <sebott(a)linux.ibm.com>
s390/pci: fix out of bounds access during irq setup
Julian Wiedmann <jwi(a)linux.ibm.com>
s390/qdio: reset old sbal_state flags
Martin Schwidefsky <schwidefsky(a)de.ibm.com>
s390: fix br_r1_trampoline for machines without exrl
Andi Kleen <ak(a)linux.intel.com>
x86/spectre: Add missing family 6 check to microcode check
Nick Desaulniers <ndesaulniers(a)google.com>
x86/irqflags: Mark native_restore_fl extern inline
Dan Carpenter <dan.carpenter(a)oracle.com>
pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
ASoC: sirf: Fix potential NULL pointer dereference
Jerome Brunet <jbrunet(a)baylibre.com>
ASoC: dpcm: don't merge format from invalid codec dai
Mikulas Patocka <mpatocka(a)redhat.com>
udl-kms: fix crash due to uninitialized memory
Mikulas Patocka <mpatocka(a)redhat.com>
udl-kms: handle allocation failure
Mikulas Patocka <mpatocka(a)redhat.com>
udl-kms: change down_interruptible to down
Kirill Tkhai <ktkhai(a)virtuozzo.com>
fuse: Add missed unlock_page() to fuse_readpages_fill()
Miklos Szeredi <mszeredi(a)redhat.com>
fuse: Fix oops at process_init_reply()
Miklos Szeredi <mszeredi(a)redhat.com>
fuse: umount should wait for all requests
Miklos Szeredi <mszeredi(a)redhat.com>
fuse: fix unlocked access to processing queue
Miklos Szeredi <mszeredi(a)redhat.com>
fuse: fix double request_end()
Andrey Ryabinin <aryabinin(a)virtuozzo.com>
fuse: Don't access pipe->buffers without pipe_lock()
Rian Hunter <rian(a)alum.mit.edu>
x86/process: Re-export start_thread()
Vlastimil Babka <vbabka(a)suse.cz>
x86/speculation/l1tf: Suggest what to do on systems with too much RAM
Vlastimil Babka <vbabka(a)suse.cz>
x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM
Vlastimil Babka <vbabka(a)suse.cz>
x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit
Punit Agrawal <punit.agrawal(a)arm.com>
KVM: arm/arm64: Skip updating PMD entry if no change
Punit Agrawal <punit.agrawal(a)arm.com>
KVM: arm/arm64: Skip updating PTE entry if no change
Greg Hackmann <ghackmann(a)android.com>
arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()
Eric Sandeen <sandeen(a)redhat.com>
ext4: reset error code in ext4_find_entry in fallback
Arnd Bergmann <arnd(a)arndb.de>
ext4: sysfs: print ext4_super_block fields as little-endian
Theodore Ts'o <tytso(a)mit.edu>
ext4: check for NUL characters in extended attribute's name
Claudio Imbrenda <imbrenda(a)linux.vnet.ibm.com>
s390/kvm: fix deadlock when killed by oom
Josef Bacik <josef(a)toxicpanda.com>
btrfs: don't leak ret from do_chunk_alloc
Steve French <stfrench(a)microsoft.com>
smb3: don't request leases in symlink creation and query
Steve French <stfrench(a)microsoft.com>
smb3: Do not send SMB3 SET_INFO if nothing changed
Nicholas Mc Guire <hofrat(a)osadl.org>
cifs: check kmalloc before use
Steve French <stfrench(a)microsoft.com>
cifs: add missing debug entries for kconfig options
jie@chenjie6@huwei.com <jie@chenjie6@huwei.com>
mm/memory.c: check return value of ioremap_prot
Jim Gill <jgill(a)vmware.com>
scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED
Johannes Thumshirn <jthumshirn(a)suse.de>
scsi: fcoe: drop frames in ELS LOGO error path
Colin Ian King <colin.king(a)canonical.com>
drivers: net: lmc: fix case value for target abort error
Randy Dunlap <rdunlap(a)infradead.org>
arc: fix type warnings in arc/mm/cache.c
Randy Dunlap <rdunlap(a)infradead.org>
arc: fix build errors in arc/include/asm/delay.h
Govindarajulu Varadarajan <gvaradar(a)cisco.com>
enic: handle mtu change for vf properly
Rafał Miłecki <rafal(a)milecki.pl>
Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum"
Calvin Walton <calvin.walton(a)kepstin.ca>
tools/power turbostat: Read extended processor family from CPUID
Li Wang <liwang(a)redhat.com>
zswap: re-check zswap_is_full() after do zswap_shrink()
Masami Hiramatsu <mhiramat(a)kernel.org>
selftests/ftrace: Add snapshot and tracing_on test case
Kiran Kumar Modukuri <kiran.modukuri(a)gmail.com>
cachefiles: Wait rather than BUG'ing on "Unexpected object collision"
Kiran Kumar Modukuri <kiran.modukuri(a)gmail.com>
cachefiles: Fix refcounting bug in backing-file read monitoring
Kiran Kumar Modukuri <kiran.modukuri(a)gmail.com>
fscache: Allow cancelled operations to be enqueued
Shubhrajyoti Datta <shubhrajyoti.datta(a)xilinx.com>
net: axienet: Fix double deregister of mdio
Sudarsana Reddy Kalluru <sudarsana.kalluru(a)cavium.com>
bnx2x: Fix invalid memory access in rss hash config path.
Guenter Roeck <linux(a)roeck-us.net>
media: staging: omap4iss: Include asm/cacheflush.h after generic includes
Alexander Sverdlin <alexander.sverdlin(a)nokia.com>
i2c: davinci: Avoid zero value of CLKH
Nicholas Mc Guire <hofrat(a)osadl.org>
can: mpc5xxx_can: check of_iomap return before use
Randy Dunlap <rdunlap(a)infradead.org>
net: prevent ISA drivers from building on PPC32
Florian Westphal <fw(a)strlen.de>
atl1c: reserve min skb headroom
Sudarsana Reddy Kalluru <sudarsana.kalluru(a)cavium.com>
qed: Fix possible race for the link state value.
YueHaibing <yuehaibing(a)huawei.com>
net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
Len Brown <len.brown(a)intel.com>
tools/power turbostat: fix -S on UP systems
Eugeniu Rosca <roscaeugeniu(a)gmail.com>
usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3'
Peter Senna Tschudin <peter.senna(a)gmail.com>
tools: usb: ffs-test: Fix build on big endian systems
Randy Dunlap <rdunlap(a)infradead.org>
usb/phy: fix PPC64 build errors in phy-fsl-usb.c
Jia-Ju Bai <baijiaju1990(a)gmail.com>
usb: gadget: r8a66597: Fix a possible sleep-in-atomic-context bugs in r8a66597_queue()
Jia-Ju Bai <baijiaju1990(a)gmail.com>
usb: gadget: r8a66597: Fix two possible sleep-in-atomic-context bugs in init_controller()
Lucas Stach <l.stach(a)pengutronix.de>
drm/imx: imx-ldb: check if channel is enabled before printing warning
Lucas Stach <l.stach(a)pengutronix.de>
drm/imx: imx-ldb: disable LDB on driver bind
Varun Prakash <varun(a)chelsio.com>
scsi: libiscsi: fix possible NULL pointer dereference in case of TMF
Sean Paul <seanpaul(a)chromium.org>
drm/bridge: adv7511: Reset registers on hotplug
Bernd Edlinger <bernd.edlinger(a)hotmail.de>
nl80211: Add a missing break in parse_station_flags
mpubbise(a)codeaurora.org <mpubbise(a)codeaurora.org>
mac80211: add stations tied to AP_VLANs during hw reconfig
Florian Westphal <fw(a)strlen.de>
xfrm: free skb if nlsk pointer is NULL
Tommi Rantala <tommi.t.rantala(a)nokia.com>
xfrm: fix missing dst_release() after policy blocking lbcast and multicast
Eyal Birger <eyal.birger(a)gmail.com>
vti6: fix PMTU caching and reporting on xmit
yujuan.qi <yujuan.qi(a)mediatek.com>
Cipso: cipso_v4_optptr enter infinite loop
Ethan Zhao <ethan.zhao(a)oracle.com>
sched/sysctl: Check user input value of sysctl_sched_time_avg
-------------
Diffstat:
Makefile | 4 +-
arch/arc/include/asm/delay.h | 3 +
arch/arc/mm/cache.c | 7 +-
arch/arm/kvm/mmu.c | 42 +++++++++---
arch/arm64/mm/init.c | 6 +-
arch/mips/bcm47xx/setup.c | 6 --
arch/mips/include/asm/mipsregs.h | 3 -
arch/mips/include/asm/processor.h | 2 +-
arch/mips/kernel/ptrace.c | 2 +-
arch/mips/kernel/ptrace32.c | 2 +-
arch/mips/lib/multi3.c | 6 +-
arch/s390/include/asm/qdio.h | 1 -
arch/s390/mm/fault.c | 2 +
arch/s390/net/bpf_jit_comp.c | 2 -
arch/s390/pci/pci.c | 2 +
arch/x86/include/asm/irqflags.h | 3 +-
arch/x86/include/asm/processor.h | 4 +-
arch/x86/kernel/cpu/bugs.c | 4 ++
arch/x86/kernel/cpu/intel.c | 3 +
arch/x86/kernel/process_64.c | 1 +
arch/x86/mm/init.c | 4 +-
arch/x86/mm/mmap.c | 2 +-
drivers/cdrom/cdrom.c | 2 +-
drivers/gpu/drm/i2c/adv7511.c | 12 ++++
drivers/gpu/drm/imx/imx-ldb.c | 9 ++-
drivers/gpu/drm/udl/udl_fb.c | 2 +-
drivers/gpu/drm/udl/udl_main.c | 35 +++++-----
drivers/i2c/busses/i2c-davinci.c | 8 ++-
drivers/net/can/mscan/mpc5xxx_can.c | 5 ++
drivers/net/ethernet/3com/Kconfig | 2 +-
drivers/net/ethernet/amd/Kconfig | 4 +-
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 1 +
.../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 13 +++-
drivers/net/ethernet/cirrus/Kconfig | 1 +
drivers/net/ethernet/cisco/enic/enic_main.c | 78 ++++++++--------------
drivers/net/ethernet/qlogic/qed/qed_mcp.c | 1 +
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 1 +
drivers/net/wan/lmc/lmc_main.c | 2 +-
drivers/pinctrl/freescale/pinctrl-imx1-core.c | 2 +-
drivers/s390/cio/qdio_main.c | 5 +-
drivers/scsi/fcoe/fcoe_ctlr.c | 4 +-
drivers/scsi/libiscsi.c | 12 ++--
drivers/scsi/scsi_sysfs.c | 20 +++++-
drivers/scsi/vmw_pvscsi.c | 11 ++-
drivers/staging/media/omap4iss/iss_video.c | 3 +-
drivers/target/iscsi/iscsi_target_login.c | 35 ++++++----
drivers/usb/gadget/function/f_uac2.c | 20 +++---
drivers/usb/gadget/udc/r8a66597-udc.c | 6 +-
drivers/usb/phy/phy-fsl-usb.c | 4 +-
fs/btrfs/extent-tree.c | 2 +-
fs/cachefiles/namei.c | 1 -
fs/cachefiles/rdwr.c | 17 +++--
fs/cifs/cifs_debug.c | 30 +++++++--
fs/cifs/inode.c | 2 +
fs/cifs/link.c | 4 +-
fs/cifs/sess.c | 6 ++
fs/cifs/smb2inode.c | 2 +-
fs/ext4/namei.c | 1 +
fs/ext4/sysfs.c | 13 +++-
fs/ext4/xattr.c | 2 +
fs/fscache/operation.c | 6 +-
fs/fuse/dev.c | 39 +++++++++--
fs/fuse/file.c | 1 +
fs/fuse/fuse_i.h | 1 +
fs/fuse/inode.c | 23 +++----
fs/sysfs/file.c | 44 ++++++++++++
include/linux/sysfs.h | 14 ++++
kernel/kprobes.c | 4 +-
kernel/sysctl.c | 3 +-
mm/memory.c | 3 +
mm/zswap.c | 9 +++
net/caif/caif_dev.c | 4 +-
net/ipv4/cipso_ipv4.c | 12 +++-
net/ipv6/ip6_vti.c | 11 +--
net/mac80211/util.c | 3 +-
net/wireless/nl80211.c | 1 +
net/xfrm/xfrm_policy.c | 3 +
net/xfrm/xfrm_user.c | 10 +--
sound/soc/sirf/sirf-usp.c | 7 +-
sound/soc/soc-pcm.c | 8 +++
tools/power/x86/turbostat/turbostat.c | 8 +--
.../selftests/ftrace/test.d/00basic/snapshot.tc | 28 ++++++++
tools/usb/ffs-test.c | 19 +++++-
83 files changed, 514 insertions(+), 236 deletions(-)
Hello - Two issues were reported to Ubuntu in the IRDA subsystem. IRDA is no
longer present in the upstream kernel as of 4.17 but the stable tree is
affected.
This patch set addresses the issues in 4.14 to 4.17.
Tyler
From: Randy Dunlap <rdunlap(a)infradead.org>
[ Upstream commit 914b087ff9e0e9a399a4927fa30793064afc0178 ]
When $DEPMOD is not found, only print a warning instead of exiting
with an error message and error status:
Warning: 'make modules_install' requires /sbin/depmod. Please install it.
This is probably in the kmod package.
Change the Error to a Warning because "not all build hosts for cross
compiling Linux are Linux systems and are able to provide a working
port of depmod, especially at the file patch /sbin/depmod."
I.e., "make modules_install" may be used to copy/install the
loadable modules files to a target directory on a build system and
then transferred to an embedded device where /sbin/depmod is run
instead of it being run on the build system.
Fixes: 934193a654c1 ("kbuild: verify that $DEPMOD is installed")
Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
Reported-by: H. Nikolaus Schaller <hns(a)goldelico.com>
Cc: stable(a)vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi(a)profusion.mobi>
Cc: Lucas De Marchi <lucas.de.marchi(a)gmail.com>
Cc: Michal Marek <michal.lkml(a)markovi.net>
Cc: Jessica Yu <jeyu(a)kernel.org>
Cc: Chih-Wei Huang <cwhuang(a)linux.org.tw>
Signed-off-by: Masahiro Yamada <yamada.masahiro(a)socionext.com>
Signed-off-by: Maxim Zhukov <mussitantesmortem(a)gmail.com>
---
scripts/depmod.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index ea1e96921e3b..baedaef53ca0 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -15,9 +15,9 @@ if ! test -r System.map ; then
fi
if [ -z $(command -v $DEPMOD) ]; then
- echo "'make modules_install' requires $DEPMOD. Please install it." >&2
+ echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
echo "This is probably in the kmod package." >&2
- exit 1
+ exit 0
fi
# older versions of depmod don't support -P <symbol-prefix>
--
2.19.0
From: Randy Dunlap <rdunlap(a)infradead.org>
[ Upstream commit 914b087ff9e0e9a399a4927fa30793064afc0178 ]
When $DEPMOD is not found, only print a warning instead of exiting
with an error message and error status:
Warning: 'make modules_install' requires /sbin/depmod. Please install it.
This is probably in the kmod package.
Change the Error to a Warning because "not all build hosts for cross
compiling Linux are Linux systems and are able to provide a working
port of depmod, especially at the file patch /sbin/depmod."
I.e., "make modules_install" may be used to copy/install the
loadable modules files to a target directory on a build system and
then transferred to an embedded device where /sbin/depmod is run
instead of it being run on the build system.
Fixes: 934193a654c1 ("kbuild: verify that $DEPMOD is installed")
Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
Reported-by: H. Nikolaus Schaller <hns(a)goldelico.com>
Cc: stable(a)vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi(a)profusion.mobi>
Cc: Lucas De Marchi <lucas.de.marchi(a)gmail.com>
Cc: Michal Marek <michal.lkml(a)markovi.net>
Cc: Jessica Yu <jeyu(a)kernel.org>
Cc: Chih-Wei Huang <cwhuang(a)linux.org.tw>
Signed-off-by: Masahiro Yamada <yamada.masahiro(a)socionext.com>
Signed-off-by: Maxim Zhukov <mussitantesmortem(a)gmail.com>
---
scripts/depmod.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index ea1e96921e3b..baedaef53ca0 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -15,9 +15,9 @@ if ! test -r System.map ; then
fi
if [ -z $(command -v $DEPMOD) ]; then
- echo "'make modules_install' requires $DEPMOD. Please install it." >&2
+ echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
echo "This is probably in the kmod package." >&2
- exit 1
+ exit 0
fi
# older versions of depmod don't support -P <symbol-prefix>
--
2.19.0
From: Randy Dunlap <rdunlap(a)infradead.org>
[ Upstream commit 914b087ff9e0e9a399a4927fa30793064afc0178 ]
When $DEPMOD is not found, only print a warning instead of exiting
with an error message and error status:
Warning: 'make modules_install' requires /sbin/depmod. Please install it.
This is probably in the kmod package.
Change the Error to a Warning because "not all build hosts for cross
compiling Linux are Linux systems and are able to provide a working
port of depmod, especially at the file patch /sbin/depmod."
I.e., "make modules_install" may be used to copy/install the
loadable modules files to a target directory on a build system and
then transferred to an embedded device where /sbin/depmod is run
instead of it being run on the build system.
Fixes: 934193a654c1 ("kbuild: verify that $DEPMOD is installed")
Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
Reported-by: H. Nikolaus Schaller <hns(a)goldelico.com>
Cc: stable(a)vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi(a)profusion.mobi>
Cc: Lucas De Marchi <lucas.de.marchi(a)gmail.com>
Cc: Michal Marek <michal.lkml(a)markovi.net>
Cc: Jessica Yu <jeyu(a)kernel.org>
Cc: Chih-Wei Huang <cwhuang(a)linux.org.tw>
Signed-off-by: Masahiro Yamada <yamada.masahiro(a)socionext.com>
Signed-off-by: Maxim Zhukov <mussitantesmortem(a)gmail.com>
---
scripts/depmod.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index ea1e96921e3b..baedaef53ca0 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -15,9 +15,9 @@ if ! test -r System.map ; then
fi
if [ -z $(command -v $DEPMOD) ]; then
- echo "'make modules_install' requires $DEPMOD. Please install it." >&2
+ echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
echo "This is probably in the kmod package." >&2
- exit 1
+ exit 0
fi
# older versions of depmod don't support -P <symbol-prefix>
--
2.19.0
From: Randy Dunlap <rdunlap(a)infradead.org>
[ Upstream commit 914b087ff9e0e9a399a4927fa30793064afc0178 ]
When $DEPMOD is not found, only print a warning instead of exiting
with an error message and error status:
Warning: 'make modules_install' requires /sbin/depmod. Please install it.
This is probably in the kmod package.
Change the Error to a Warning because "not all build hosts for cross
compiling Linux are Linux systems and are able to provide a working
port of depmod, especially at the file patch /sbin/depmod."
I.e., "make modules_install" may be used to copy/install the
loadable modules files to a target directory on a build system and
then transferred to an embedded device where /sbin/depmod is run
instead of it being run on the build system.
Fixes: 934193a654c1 ("kbuild: verify that $DEPMOD is installed")
Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
Reported-by: H. Nikolaus Schaller <hns(a)goldelico.com>
Cc: stable(a)vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi(a)profusion.mobi>
Cc: Lucas De Marchi <lucas.de.marchi(a)gmail.com>
Cc: Michal Marek <michal.lkml(a)markovi.net>
Cc: Jessica Yu <jeyu(a)kernel.org>
Cc: Chih-Wei Huang <cwhuang(a)linux.org.tw>
Signed-off-by: Masahiro Yamada <yamada.masahiro(a)socionext.com>
Signed-off-by: Maxim Zhukov <mussitantesmortem(a)gmail.com>
---
scripts/depmod.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index f41b0a4b575c..cf5b2b24b3cf 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -16,9 +16,9 @@ if ! test -r System.map ; then
fi
if [ -z $(command -v $DEPMOD) ]; then
- echo "'make modules_install' requires $DEPMOD. Please install it." >&2
+ echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
echo "This is probably in the kmod package." >&2
- exit 1
+ exit 0
fi
# older versions of depmod don't support -P <symbol-prefix>
--
2.19.0
The ceph_ioctl function is used both for files and directories, but only
the files support doing that in 32-bit compat mode.
For consistency, add the same compat handler to the dir operations
as well.
Cc: stable(a)vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
---
fs/ceph/dir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 82928cea0209..da73f29d7faa 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -1489,6 +1489,7 @@ const struct file_operations ceph_dir_fops = {
.open = ceph_open,
.release = ceph_release,
.unlocked_ioctl = ceph_ioctl,
+ .compat_ioctl = ceph_ioctl,
.fsync = ceph_fsync,
.lock = ceph_lock,
.flock = ceph_flock,
--
2.18.0
A transparent huge page is represented by a single entry on an LRU list.
Therefore, we can only make unevictable an entire compound page, not
individual subpages.
If a user tries to mlock() part of a huge page, we want the rest of the
page to be reclaimable.
We handle this by keeping PTE-mapped huge pages on normal LRU lists: the
PMD on border of VM_LOCKED VMA will be split into PTE table.
Introduction of THP migration breaks the rules around mlocking THP
pages. If we had a single PMD mapping of the page in mlocked VMA, the
page will get mlocked, regardless of PTE mappings of the page.
For tmpfs/shmem it's easy to fix by checking PageDoubleMap() in
remove_migration_pmd().
Anon THP pages can only be shared between processes via fork(). Mlocked
page can only be shared if parent mlocked it before forking, otherwise
CoW will be triggered on mlock().
For Anon-THP, we can fix the issue by munlocking the page on removing PTE
migration entry for the page. PTEs for the page will always come after
mlocked PMD: rmap walks VMAs from oldest to newest.
Test-case:
#include <unistd.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <linux/mempolicy.h>
#include <numaif.h>
int main(void)
{
unsigned long nodemask = 4;
void *addr;
addr = mmap((void *)0x20000000UL, 2UL << 20, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_LOCKED, -1, 0);
if (fork()) {
wait(NULL);
return 0;
}
mlock(addr, 4UL << 10);
mbind(addr, 2UL << 20, MPOL_PREFERRED | MPOL_F_RELATIVE_NODES,
&nodemask, 4, MPOL_MF_MOVE | MPOL_MF_MOVE_ALL);
return 0;
}
Signed-off-by: Kirill A. Shutemov <kirill.shutemov(a)linux.intel.com>
Reported-by: Vegard Nossum <vegard.nossum(a)gmail.com>
Fixes: 616b8371539a ("mm: thp: enable thp migration in generic path")
Cc: <stable(a)vger.kernel.org> [v4.14+]
Cc: Zi Yan <zi.yan(a)cs.rutgers.edu>
Cc: Naoya Horiguchi <n-horiguchi(a)ah.jp.nec.com>
Cc: Vlastimil Babka <vbabka(a)suse.cz>
Cc: Andrea Arcangeli <aarcange(a)redhat.com>
---
mm/huge_memory.c | 2 +-
mm/migrate.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 533f9b00147d..00704060b7f7 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2931,7 +2931,7 @@ void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
else
page_add_file_rmap(new, true);
set_pmd_at(mm, mmun_start, pvmw->pmd, pmde);
- if (vma->vm_flags & VM_LOCKED)
+ if ((vma->vm_flags & VM_LOCKED) && !PageDoubleMap(new))
mlock_vma_page(new);
update_mmu_cache_pmd(vma, address, pvmw->pmd);
}
diff --git a/mm/migrate.c b/mm/migrate.c
index d6a2e89b086a..01dad96b25b5 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -275,6 +275,9 @@ static bool remove_migration_pte(struct page *page, struct vm_area_struct *vma,
if (vma->vm_flags & VM_LOCKED && !PageTransCompound(new))
mlock_vma_page(new);
+ if (PageTransCompound(new) && PageMlocked(page))
+ clear_page_mlock(page);
+
/* No need to invalidate - it was non-present before */
update_mmu_cache(vma, pvmw.address, pvmw.pte);
}
--
2.18.0
Upstream commit f7c90c2aa4004808dff777ba6ae2c7294dd06851
("x86/xen: don't write ptes directly in 32-bit PV guests") should be
considered for stable kernels from 4.14 up (I'll send backports for
older kernels when I know you are taking the patch).
The patch avoids 32-bit Xen PV guests creating intermediate L1TF
vulnerable PTEs.
Juergen
Upstream commit b2d7a075a1ccef2fb321d595802190c8e9b39004
("x86/pae: use 64 bit atomic xchg function in
native_ptep_get_and_clear") should be considered for stable kernels from
4.17 up (I'll send backports for older kernels when I know you are
taking the patch).
The patch seems not only to avoid intermediate L1TF vulnerable PTEs,
but there are reports of it fixing the issue mentioned in
https://bugzilla.kernel.org/show_bug.cgi?id=198497
Juergen
From: Adrian Hunter <adrian.hunter(a)intel.com>
Commit 1c5aae7710bb ("perf machine: Create maps for x86 PTI entry
trampolines") revealed a problem with maps__find_symbol_by_name() that
resulted in probes not being found e.g.
$ sudo perf probe xsk_mmap
xsk_mmap is out of .text, skip it.
Probe point 'xsk_mmap' not found.
Error: Failed to add events.
maps__find_symbol_by_name() can optionally return the map of the found
symbol. It can get the map wrong because, in fact, the symbol is found
on the map's dso, not allowing for the possibility that the dso has more
than one map. Fix by always checking the map contains the symbol.
Reported-by: Björn Töpel <bjorn.topel(a)intel.com>
Signed-off-by: Adrian Hunter <adrian.hunter(a)intel.com>
Tested-by: Björn Töpel <bjorn.topel(a)intel.com>
Cc: Jiri Olsa <jolsa(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: 1c5aae7710bb ("perf machine: Create maps for x86 PTI entry trampolines")
Link: http://lkml.kernel.org/r/20180907085116.25782-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme(a)redhat.com>
---
tools/perf/util/map.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 36d0763311ef..6a6929f208b4 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -576,6 +576,13 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg,
return NULL;
}
+static bool map__contains_symbol(struct map *map, struct symbol *sym)
+{
+ u64 ip = map->unmap_ip(map, sym->start);
+
+ return ip >= map->start && ip < map->end;
+}
+
struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
struct map **mapp)
{
@@ -591,6 +598,10 @@ struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
if (sym == NULL)
continue;
+ if (!map__contains_symbol(pos, sym)) {
+ sym = NULL;
+ continue;
+ }
if (mapp != NULL)
*mapp = pos;
goto out;
--
2.14.4
This is the start of the stable review cycle for the 4.4.143 release.
There are 31 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun Jul 22 12:13:28 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.143-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.4.143-rc1
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
net/nfc: Avoid stalls when nfc_alloc_send_skb() returned NULL.
Santosh Shilimkar <santosh.shilimkar(a)oracle.com>
rds: avoid unenecessary cong_update in loop transport
Eric Biggers <ebiggers(a)google.com>
KEYS: DNS: fix parsing multiple options
Florian Westphal <fw(a)strlen.de>
netfilter: ebtables: reject non-bridge targets
Paul Burton <paul.burton(a)mips.com>
MIPS: Use async IPIs for arch_trigger_cpumask_backtrace()
Paul Burton <paul.burton(a)mips.com>
MIPS: Call dump_stack() from show_regs()
Ping-Ke Shih <pkshih(a)realtek.com>
rtlwifi: rtl8821ae: fix firmware is not ready to run
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
net: cxgb3_main: fix potential Spectre v1
Alex Vesker <valex(a)mellanox.com>
net/mlx5: Fix command interface race in polling mode
Konstantin Khlebnikov <khlebnikov(a)yandex-team.ru>
net_sched: blackhole: tell upper qdisc about dropped packets
Jason Wang <jasowang(a)redhat.com>
vhost_net: validate sock before trying to put its fd
Ilpo Järvinen <ilpo.jarvinen(a)helsinki.fi>
tcp: prevent bogus FRTO undos with non-SACK flows
Yuchung Cheng <ycheng(a)google.com>
tcp: fix Fast Open key endianness
Jiri Slaby <jslaby(a)suse.cz>
r8152: napi hangup fix after disconnect
Sudarsana Reddy Kalluru <sudarsana.kalluru(a)cavium.com>
qed: Limit msix vectors in kdump kernel to the minimum required count.
Eric Dumazet <edumazet(a)google.com>
net: sungem: fix rx checksum support
Alex Vesker <valex(a)mellanox.com>
net/mlx5: Fix incorrect raw command length parsing
Eric Dumazet <edumazet(a)google.com>
net: dccp: switch rx_tstamp_last_feedback to monotonic clock
Eric Dumazet <edumazet(a)google.com>
net: dccp: avoid crash in ccid3_hc_rx_send_feedback()
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
atm: zatm: Fix potential Spectre v1
Christian Lamparter <chunkeey(a)googlemail.com>
crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak
Christian Lamparter <chunkeey(a)googlemail.com>
crypto: crypto4xx - remove bad list_del
Jonas Gorski <jonas.gorski(a)gmail.com>
bcm63xx_enet: do not write to random DMA channel on BCM6345
Jonas Gorski <jonas.gorski(a)gmail.com>
bcm63xx_enet: correct clock usage
alex chen <alex.chen(a)huawei.com>
ocfs2: subsystem.su_mutex is required while accessing the item->ci_parent
David S. Miller <davem(a)davemloft.net>
Revert "sit: reload iphdr in ipip6_rcv"
H. Peter Anvin <hpa(a)linux.intel.com>
x86/asm: Add _ASM_ARG* constants for argument registers to <asm/asm.h>
Nick Desaulniers <ndesaulniers(a)google.com>
compiler-gcc.h: Add __attribute__((gnu_inline)) to all inline declarations
David Rientjes <rientjes(a)google.com>
compiler, clang: always inline when CONFIG_OPTIMIZE_INLINING is disabled
Linus Torvalds <torvalds(a)linux-foundation.org>
compiler, clang: properly override 'inline' for clang
David Rientjes <rientjes(a)google.com>
compiler, clang: suppress warning for unused static inline functions
-------------
Diffstat:
Makefile | 4 +-
arch/mips/kernel/process.c | 31 +++++++++++-
arch/mips/kernel/traps.c | 1 +
arch/x86/include/asm/asm.h | 59 +++++++++++++++++++++++
drivers/atm/zatm.c | 2 +
drivers/crypto/amcc/crypto4xx_core.c | 23 +++++----
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 34 +++++++++----
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 +
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 8 ++--
drivers/net/ethernet/qlogic/qed/qed_main.c | 9 ++++
drivers/net/ethernet/sun/sungem.c | 22 +++++----
drivers/net/usb/r8152.c | 3 +-
drivers/net/wireless/realtek/rtlwifi/core.c | 1 -
drivers/vhost/net.c | 3 +-
fs/ocfs2/cluster/nodemanager.c | 63 +++++++++++++++++++++----
include/linux/compiler-gcc.h | 35 ++++++++++----
net/bridge/netfilter/ebtables.c | 13 +++++
net/dccp/ccids/ccid3.c | 16 ++++---
net/dns_resolver/dns_key.c | 28 ++++++-----
net/ipv4/sysctl_net_ipv4.c | 18 +++++--
net/ipv4/tcp_input.c | 9 ++++
net/ipv6/sit.c | 1 -
net/nfc/llcp_commands.c | 9 ++--
net/rds/loop.c | 1 +
net/rds/rds.h | 5 ++
net/rds/recv.c | 5 ++
net/sched/sch_blackhole.c | 2 +-
27 files changed, 320 insertions(+), 87 deletions(-)
Hi stable kernel maintainers,
please squash these amdgpu fixes together and backport them to all
applicable stable branches:
15e6b76880e65be24250e30986084b5569b7a06f "drm/amdgpu: Warn and update
pin_size values when
destroying a pinned BO"
456607d816d89a442a3d5ec98b02c8bc950b5228 "drm/amdgpu: Don't warn on
destroying a pinned BO"
(These depend on commits a5ccfe5c20740f2fbf00291490cdf8d2373ec255 and
ddc21af4d0f37f42b33c54cb69b215997fe5b082, which already have Cc: stable)
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
Subject: x86/tsc: Prevent result truncation on 32 bit
From: Chuanhua Lei <chuanhua.lei(a)linux.intel.com>
Date: Thu Sep 6 18:03:23 2018 +0800
From: Chuanhua Lei <chuanhua.lei(a)linux.intel.com>
Commit 17f6bac2249356c795339e03a0742cd79be3cab8 upstream.
Loops per jiffy is calculated by multiplying tsc_khz with 1e3 and then
dividing it by HZ.
Both tsc_khz and the temporary variable holding the multiplication result
are of type unsigned long, so on 32bit the result is truncated to the lower
32bit.
Use u64 as type for the temporary variable and cast tsc_khz to it before
multiplying.
[ tglx: Backport to stable. Due to massive code changes is the upstream
commit not applicable anymore. The issue has gone unnoticed in
kernels pre 4.19 because the bogus LPJ value gets fixed up in a
later stage of early boot, but it still might cause subtle and hard
to debug issues between these two points. ]
Fixes: dd759d93f4dd ("x86/timers: Add simple udelay calibration")
Signed-off-by: Chuanhua Lei <chuanhua.lei(a)linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: yixin.zhu(a)linux.intel.com
Cc: "H. Peter Anvin" <hpa(a)zytor.com>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Len Brown <len.brown(a)intel.com>
Cc: Pavel Tatashin <pavel.tatashin(a)microsoft.com>
Cc: Rajvi Jingar <rajvi.jingar(a)intel.com>
Cc: Dou Liyang <douly.fnst(a)cn.fujitsu.com>
Cc: Ville Syrjala <ville.syrjala(a)linux.intel.com>
Link: https://lkml.kernel.org/r/1536228203-18701-1-git-send-email-chuanhua.lei@li…
---
arch/x86/kernel/tsc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1343,7 +1343,7 @@ device_initcall(init_tsc_clocksource);
void __init tsc_early_delay_calibrate(void)
{
- unsigned long lpj;
+ u64 lpj;
if (!boot_cpu_has(X86_FEATURE_TSC))
return;
@@ -1355,7 +1355,7 @@ void __init tsc_early_delay_calibrate(vo
if (!tsc_khz)
return;
- lpj = tsc_khz * 1000;
+ lpj = (u64)tsc_khz * 1000;
do_div(lpj, HZ);
loops_per_jiffy = lpj;
}
commit 6209c285e7a5e68dbcdf8fd2456c6dd68433806b upstream.
Since Haswell we have no color range indication either in the pipe or
port registers for DP. Instead, there's a separate register for setting
the DP Main Stream Attributes (MSA) directly. The MSA register
definition makes no references to colorimetry, just a vague reference to
the DP spec. The connection to the color range was lost.
Apparently we've failed to set the proper MSA bit for limited, or CEA,
range ever since the first DDI platforms. We've started setting other
MSA parameters since commit dae847991a43 ("drm/i915: add
intel_ddi_set_pipe_settings").
Without the crucial bit of information, the DP sink has no way of
knowing the source is actually transmitting limited range RGB, leading
to "washed out" colors. With the colorimetry information, compliant
sinks should be able to handle the limited range properly. Native
(i.e. non-LSPCON) HDMI was not affected because we do pass the color
range via AVI infoframes.
Though not the root cause, the problem was made worse for DDI platforms
with commit 55bc60db5988 ("drm/i915: Add "Automatic" mode for the
"Broadcast RGB" property"), which selects limited range RGB
automatically based on the mode, as per the DP, HDMI and CEA specs.
After all these years, the fix boils down to flipping one bit.
[Per testing reports, this fixes DP sinks, but not the LSPCON. My
educated guess is that the LSPCON fails to turn the CEA range MSA into
AVI infoframes for HDMI.]
Reported-by: Michał Kopeć <mkopec12(a)gmail.com>
Reported-by: N. W. <nw9165-3201(a)yahoo.com>
Reported-by: Nicholas Stommel <nicholas.stommel(a)gmail.com>
Reported-by: Tom Yan <tom.ty89(a)gmail.com>
Tested-by: Nicholas Stommel <nicholas.stommel(a)gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=100023
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107476
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94921
Cc: Paulo Zanoni <paulo.r.zanoni(a)intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Cc: Ville Syrjälä <ville.syrjala(a)linux.intel.com>
Cc: <stable(a)vger.kernel.org> # v3.9+
Reviewed-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Signed-off-by: Jani Nikula <jani.nikula(a)intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180814060001.18224-1-jani.n…
(cherry picked from commit dc5977da99ea28094b8fa4e9bacbd29bedc41de5)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
---
drivers/gpu/drm/i915/i915_reg.h | 1 +
drivers/gpu/drm/i915/intel_ddi.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 7720569f2024..6e048ee88e3f 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -8825,6 +8825,7 @@ enum skl_power_gate {
#define TRANS_MSA_10_BPC (2<<5)
#define TRANS_MSA_12_BPC (3<<5)
#define TRANS_MSA_16_BPC (4<<5)
+#define TRANS_MSA_CEA_RANGE (1<<3)
/* LCPLL Control */
#define LCPLL_CTL _MMIO(0x130040)
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index fed26d6e4e27..e195c287c263 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1659,6 +1659,10 @@ void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state)
WARN_ON(transcoder_is_dsi(cpu_transcoder));
temp = TRANS_MSA_SYNC_CLK;
+
+ if (crtc_state->limited_color_range)
+ temp |= TRANS_MSA_CEA_RANGE;
+
switch (crtc_state->pipe_bpp) {
case 18:
temp |= TRANS_MSA_6_BPC;
--
2.11.0
The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 6209c285e7a5e68dbcdf8fd2456c6dd68433806b Mon Sep 17 00:00:00 2001
From: Jani Nikula <jani.nikula(a)intel.com>
Date: Tue, 14 Aug 2018 09:00:01 +0300
Subject: [PATCH] drm/i915: set DP Main Stream Attribute for color range on DDI
platforms
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since Haswell we have no color range indication either in the pipe or
port registers for DP. Instead, there's a separate register for setting
the DP Main Stream Attributes (MSA) directly. The MSA register
definition makes no references to colorimetry, just a vague reference to
the DP spec. The connection to the color range was lost.
Apparently we've failed to set the proper MSA bit for limited, or CEA,
range ever since the first DDI platforms. We've started setting other
MSA parameters since commit dae847991a43 ("drm/i915: add
intel_ddi_set_pipe_settings").
Without the crucial bit of information, the DP sink has no way of
knowing the source is actually transmitting limited range RGB, leading
to "washed out" colors. With the colorimetry information, compliant
sinks should be able to handle the limited range properly. Native
(i.e. non-LSPCON) HDMI was not affected because we do pass the color
range via AVI infoframes.
Though not the root cause, the problem was made worse for DDI platforms
with commit 55bc60db5988 ("drm/i915: Add "Automatic" mode for the
"Broadcast RGB" property"), which selects limited range RGB
automatically based on the mode, as per the DP, HDMI and CEA specs.
After all these years, the fix boils down to flipping one bit.
[Per testing reports, this fixes DP sinks, but not the LSPCON. My
educated guess is that the LSPCON fails to turn the CEA range MSA into
AVI infoframes for HDMI.]
Reported-by: Michał Kopeć <mkopec12(a)gmail.com>
Reported-by: N. W. <nw9165-3201(a)yahoo.com>
Reported-by: Nicholas Stommel <nicholas.stommel(a)gmail.com>
Reported-by: Tom Yan <tom.ty89(a)gmail.com>
Tested-by: Nicholas Stommel <nicholas.stommel(a)gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=100023
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107476
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94921
Cc: Paulo Zanoni <paulo.r.zanoni(a)intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Cc: Ville Syrjälä <ville.syrjala(a)linux.intel.com>
Cc: <stable(a)vger.kernel.org> # v3.9+
Reviewed-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Signed-off-by: Jani Nikula <jani.nikula(a)intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180814060001.18224-1-jani.n…
(cherry picked from commit dc5977da99ea28094b8fa4e9bacbd29bedc41de5)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 91e7483228e1..08ec7446282e 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -9201,6 +9201,7 @@ enum skl_power_gate {
#define TRANS_MSA_10_BPC (2 << 5)
#define TRANS_MSA_12_BPC (3 << 5)
#define TRANS_MSA_16_BPC (4 << 5)
+#define TRANS_MSA_CEA_RANGE (1 << 3)
/* LCPLL Control */
#define LCPLL_CTL _MMIO(0x130040)
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 39d66f8493fa..8761513f3532 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1685,6 +1685,10 @@ void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state)
WARN_ON(transcoder_is_dsi(cpu_transcoder));
temp = TRANS_MSA_SYNC_CLK;
+
+ if (crtc_state->limited_color_range)
+ temp |= TRANS_MSA_CEA_RANGE;
+
switch (crtc_state->pipe_bpp) {
case 18:
temp |= TRANS_MSA_6_BPC;
Building x86_64:tools/perf ... failed
--------------
Error log:
tools/perf/util/python.c:
In function ‘get_md’:
tools/perf/util/python.c:987:9: error: ‘struct perf_mmap’ has no member named ‘cpu’
At top level:
cc1: error: unrecognized command line option ‘-Wno-cast-function-type’ [-Werror]
cc1: all warnings being treated as errors error: command 'gcc' failed with exit status 1
Guenter
On Tue, Sep 11, 2018 at 12:14:30PM +0200, gregkh(a)linuxfoundation.org wrote:
>
> This is a note to let you know that I've just added the patch titled
>
> tracing: Handle CC_FLAGS_FTRACE more accurately
>
> to the 4.14-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
...
> to the 4.18-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
...
> to the 4.4-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
...
> to the 4.9-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
>
I believe there is no need to backport this patch in neither of stable
branches listed above. This patch is the first one in the patch series:
http://lkml.kernel.org/r/cover.thread-aa7b8d.your-ad-here.call-01533557518-…
The patch series adds s390 support for utilizing newly available for s390
in gcc 9 flags -fentry -mrecord-mcount and -mnop-mcount, and adds generic
-mnop-mcount support. And there is no benefit in backporting just the
first one.
Moreover this patch cause kernel recompile for intdeb-pkg and tar%pkg
targets (i.e. make targz-pkg), because those targets call make recursively
(they do extra "make modules_install"), and exported variable cause
duplicated build flags in sub-make.
There is a potential fix:
https://www.spinics.net/lists/linux-kbuild/msg19297.html
> The filename of the patch is:
> tracing-handle-cc_flags_ftrace-more-accurately.patch
> and it can be found in the queue-4.9 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable(a)vger.kernel.org> know about it.
>
>
> From foo@baz Tue Sep 11 12:09:55 CEST 2018
> From: Vasily Gorbik <gor(a)linux.ibm.com>
> Date: Mon, 6 Aug 2018 15:17:42 +0200
> Subject: tracing: Handle CC_FLAGS_FTRACE more accurately
>
> From: Vasily Gorbik <gor(a)linux.ibm.com>
>
> [ Upstream commit f28bc3c32c059ab4d13f52155fabd3e20f477f65 ]
>
> CC_FLAGS_FTRACE is exported and later used to remove ftrace relevant
> build flags from files which should be built without ftrace support.
> For that reason add -mfentry to CC_FLAGS_FTRACE as well. That fixes
> a problem with vdso32 build on s390, where -mfentry could not be used
> together with -m31 flag.
>
> At the same time flags like -pg and -mfentry are not relevant for asm
> files, so avoid adding them to KBUILD_AFLAGS.
>
> Introduce CC_FLAGS_USING instead of CC_USING_FENTRY to collect
> -DCC_USING_FENTRY (and future alike) which are relevant for both
> KBUILD_CFLAGS and KBUILD_AFLAGS.
>
> Link: http://lkml.kernel.org/r/patch-1.thread-aa7b8d.git-42971afe87de.your-ad-her…
>
> Signed-off-by: Vasily Gorbik <gor(a)linux.ibm.com>
> Signed-off-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
> Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
> ---
> Makefile | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> --- a/Makefile
> +++ b/Makefile
> @@ -760,12 +760,15 @@ ifdef CONFIG_FUNCTION_TRACER
> ifndef CC_FLAGS_FTRACE
> CC_FLAGS_FTRACE := -pg
> endif
> -export CC_FLAGS_FTRACE
> ifdef CONFIG_HAVE_FENTRY
> -CC_USING_FENTRY := $(call cc-option, -mfentry -DCC_USING_FENTRY)
> + ifeq ($(call cc-option-yn, -mfentry),y)
> + CC_FLAGS_FTRACE += -mfentry
> + CC_FLAGS_USING += -DCC_USING_FENTRY
> + endif
> endif
> -KBUILD_CFLAGS += $(CC_FLAGS_FTRACE) $(CC_USING_FENTRY)
> -KBUILD_AFLAGS += $(CC_USING_FENTRY)
> +export CC_FLAGS_FTRACE
> +KBUILD_CFLAGS += $(CC_FLAGS_FTRACE) $(CC_FLAGS_USING)
> +KBUILD_AFLAGS += $(CC_FLAGS_USING)
> ifdef CONFIG_DYNAMIC_FTRACE
> ifdef CONFIG_HAVE_C_RECORDMCOUNT
> BUILD_C_RECORDMCOUNT := y
>
>
> Patches currently in stable-queue which might be from gor(a)linux.ibm.com are
>
> queue-4.9/tracing-handle-cc_flags_ftrace-more-accurately.patch
>
The nr_dentry_unused per-cpu counter tracks dentries in both the
LRU lists and the shrink lists where the DCACHE_LRU_LIST bit is set.
The shrink_dcache_sb() function moves dentries from the LRU list to a
shrink list and subtracts the dentry count from nr_dentry_unused. This
is incorrect as the nr_dentry_unused count Will also be decremented in
shrink_dentry_list() via d_shrink_del(). To fix this double decrement,
the decrement in the shrink_dcache_sb() function is taken out.
Fixes: 4e717f5c1083 ("list_lru: remove special case function list_lru_dispose_all."
Cc: stable(a)vger.kernel.org
Signed-off-by: Waiman Long <longman(a)redhat.com>
Reviewed-by: Dave Chinner <dchinner(a)redhat.com>
---
fs/dcache.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index 2e7e8d8..cb515f1 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1202,15 +1202,11 @@ static enum lru_status dentry_lru_isolate_shrink(struct list_head *item,
*/
void shrink_dcache_sb(struct super_block *sb)
{
- long freed;
-
do {
LIST_HEAD(dispose);
- freed = list_lru_walk(&sb->s_dentry_lru,
+ list_lru_walk(&sb->s_dentry_lru,
dentry_lru_isolate_shrink, &dispose, 1024);
-
- this_cpu_sub(nr_dentry_unused, freed);
shrink_dentry_list(&dispose);
} while (list_lru_count(&sb->s_dentry_lru) > 0);
}
--
1.8.3.1
The patch below does not apply to the 4.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From b2b599fb54f90ae395ddc51f0d49e4f28244a8f8 Mon Sep 17 00:00:00 2001
From: Hang Yuan <hang.yuan(a)linux.intel.com>
Date: Wed, 29 Aug 2018 17:15:56 +0800
Subject: [PATCH] drm/i915/gvt: move intel_runtime_pm_get out of spin_lock in
stop_schedule
pm_runtime_get_sync in intel_runtime_pm_get might sleep if i915
device is not active. When stop vgpu schedule, the device may be
inactive. So need to move runtime_pm_get out of spin_lock/unlock.
Fixes: b24881e0b0b6("drm/i915/gvt: Add runtime_pm_get/put into gvt_switch_mmio
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Hang Yuan <hang.yuan(a)linux.intel.com>
Signed-off-by: Xiong Zhang <xiong.y.zhang(a)intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw(a)linux.intel.com>
diff --git a/drivers/gpu/drm/i915/gvt/mmio_context.c b/drivers/gpu/drm/i915/gvt/mmio_context.c
index 42e1e6bdcc2c..e872f4847fbe 100644
--- a/drivers/gpu/drm/i915/gvt/mmio_context.c
+++ b/drivers/gpu/drm/i915/gvt/mmio_context.c
@@ -562,11 +562,9 @@ void intel_gvt_switch_mmio(struct intel_vgpu *pre,
* performace for batch mmio read/write, so we need
* handle forcewake mannually.
*/
- intel_runtime_pm_get(dev_priv);
intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
switch_mmio(pre, next, ring_id);
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
- intel_runtime_pm_put(dev_priv);
}
/**
diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c
index 09d7bb72b4ff..985fe81794dd 100644
--- a/drivers/gpu/drm/i915/gvt/sched_policy.c
+++ b/drivers/gpu/drm/i915/gvt/sched_policy.c
@@ -426,6 +426,7 @@ void intel_vgpu_stop_schedule(struct intel_vgpu *vgpu)
&vgpu->gvt->scheduler;
int ring_id;
struct vgpu_sched_data *vgpu_data = vgpu->sched_data;
+ struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
if (!vgpu_data->active)
return;
@@ -444,6 +445,7 @@ void intel_vgpu_stop_schedule(struct intel_vgpu *vgpu)
scheduler->current_vgpu = NULL;
}
+ intel_runtime_pm_get(dev_priv);
spin_lock_bh(&scheduler->mmio_context_lock);
for (ring_id = 0; ring_id < I915_NUM_ENGINES; ring_id++) {
if (scheduler->engine_owner[ring_id] == vgpu) {
@@ -452,5 +454,6 @@ void intel_vgpu_stop_schedule(struct intel_vgpu *vgpu)
}
}
spin_unlock_bh(&scheduler->mmio_context_lock);
+ intel_runtime_pm_put(dev_priv);
mutex_unlock(&vgpu->gvt->sched_lock);
}
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 6209c285e7a5e68dbcdf8fd2456c6dd68433806b Mon Sep 17 00:00:00 2001
From: Jani Nikula <jani.nikula(a)intel.com>
Date: Tue, 14 Aug 2018 09:00:01 +0300
Subject: [PATCH] drm/i915: set DP Main Stream Attribute for color range on DDI
platforms
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since Haswell we have no color range indication either in the pipe or
port registers for DP. Instead, there's a separate register for setting
the DP Main Stream Attributes (MSA) directly. The MSA register
definition makes no references to colorimetry, just a vague reference to
the DP spec. The connection to the color range was lost.
Apparently we've failed to set the proper MSA bit for limited, or CEA,
range ever since the first DDI platforms. We've started setting other
MSA parameters since commit dae847991a43 ("drm/i915: add
intel_ddi_set_pipe_settings").
Without the crucial bit of information, the DP sink has no way of
knowing the source is actually transmitting limited range RGB, leading
to "washed out" colors. With the colorimetry information, compliant
sinks should be able to handle the limited range properly. Native
(i.e. non-LSPCON) HDMI was not affected because we do pass the color
range via AVI infoframes.
Though not the root cause, the problem was made worse for DDI platforms
with commit 55bc60db5988 ("drm/i915: Add "Automatic" mode for the
"Broadcast RGB" property"), which selects limited range RGB
automatically based on the mode, as per the DP, HDMI and CEA specs.
After all these years, the fix boils down to flipping one bit.
[Per testing reports, this fixes DP sinks, but not the LSPCON. My
educated guess is that the LSPCON fails to turn the CEA range MSA into
AVI infoframes for HDMI.]
Reported-by: Michał Kopeć <mkopec12(a)gmail.com>
Reported-by: N. W. <nw9165-3201(a)yahoo.com>
Reported-by: Nicholas Stommel <nicholas.stommel(a)gmail.com>
Reported-by: Tom Yan <tom.ty89(a)gmail.com>
Tested-by: Nicholas Stommel <nicholas.stommel(a)gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=100023
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107476
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94921
Cc: Paulo Zanoni <paulo.r.zanoni(a)intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Cc: Ville Syrjälä <ville.syrjala(a)linux.intel.com>
Cc: <stable(a)vger.kernel.org> # v3.9+
Reviewed-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Signed-off-by: Jani Nikula <jani.nikula(a)intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180814060001.18224-1-jani.n…
(cherry picked from commit dc5977da99ea28094b8fa4e9bacbd29bedc41de5)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 91e7483228e1..08ec7446282e 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -9201,6 +9201,7 @@ enum skl_power_gate {
#define TRANS_MSA_10_BPC (2 << 5)
#define TRANS_MSA_12_BPC (3 << 5)
#define TRANS_MSA_16_BPC (4 << 5)
+#define TRANS_MSA_CEA_RANGE (1 << 3)
/* LCPLL Control */
#define LCPLL_CTL _MMIO(0x130040)
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 39d66f8493fa..8761513f3532 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1685,6 +1685,10 @@ void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state)
WARN_ON(transcoder_is_dsi(cpu_transcoder));
temp = TRANS_MSA_SYNC_CLK;
+
+ if (crtc_state->limited_color_range)
+ temp |= TRANS_MSA_CEA_RANGE;
+
switch (crtc_state->pipe_bpp) {
case 18:
temp |= TRANS_MSA_6_BPC;
The patch below does not apply to the 4.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 6209c285e7a5e68dbcdf8fd2456c6dd68433806b Mon Sep 17 00:00:00 2001
From: Jani Nikula <jani.nikula(a)intel.com>
Date: Tue, 14 Aug 2018 09:00:01 +0300
Subject: [PATCH] drm/i915: set DP Main Stream Attribute for color range on DDI
platforms
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since Haswell we have no color range indication either in the pipe or
port registers for DP. Instead, there's a separate register for setting
the DP Main Stream Attributes (MSA) directly. The MSA register
definition makes no references to colorimetry, just a vague reference to
the DP spec. The connection to the color range was lost.
Apparently we've failed to set the proper MSA bit for limited, or CEA,
range ever since the first DDI platforms. We've started setting other
MSA parameters since commit dae847991a43 ("drm/i915: add
intel_ddi_set_pipe_settings").
Without the crucial bit of information, the DP sink has no way of
knowing the source is actually transmitting limited range RGB, leading
to "washed out" colors. With the colorimetry information, compliant
sinks should be able to handle the limited range properly. Native
(i.e. non-LSPCON) HDMI was not affected because we do pass the color
range via AVI infoframes.
Though not the root cause, the problem was made worse for DDI platforms
with commit 55bc60db5988 ("drm/i915: Add "Automatic" mode for the
"Broadcast RGB" property"), which selects limited range RGB
automatically based on the mode, as per the DP, HDMI and CEA specs.
After all these years, the fix boils down to flipping one bit.
[Per testing reports, this fixes DP sinks, but not the LSPCON. My
educated guess is that the LSPCON fails to turn the CEA range MSA into
AVI infoframes for HDMI.]
Reported-by: Michał Kopeć <mkopec12(a)gmail.com>
Reported-by: N. W. <nw9165-3201(a)yahoo.com>
Reported-by: Nicholas Stommel <nicholas.stommel(a)gmail.com>
Reported-by: Tom Yan <tom.ty89(a)gmail.com>
Tested-by: Nicholas Stommel <nicholas.stommel(a)gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=100023
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107476
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94921
Cc: Paulo Zanoni <paulo.r.zanoni(a)intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Cc: Ville Syrjälä <ville.syrjala(a)linux.intel.com>
Cc: <stable(a)vger.kernel.org> # v3.9+
Reviewed-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Signed-off-by: Jani Nikula <jani.nikula(a)intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180814060001.18224-1-jani.n…
(cherry picked from commit dc5977da99ea28094b8fa4e9bacbd29bedc41de5)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 91e7483228e1..08ec7446282e 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -9201,6 +9201,7 @@ enum skl_power_gate {
#define TRANS_MSA_10_BPC (2 << 5)
#define TRANS_MSA_12_BPC (3 << 5)
#define TRANS_MSA_16_BPC (4 << 5)
+#define TRANS_MSA_CEA_RANGE (1 << 3)
/* LCPLL Control */
#define LCPLL_CTL _MMIO(0x130040)
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 39d66f8493fa..8761513f3532 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1685,6 +1685,10 @@ void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state)
WARN_ON(transcoder_is_dsi(cpu_transcoder));
temp = TRANS_MSA_SYNC_CLK;
+
+ if (crtc_state->limited_color_range)
+ temp |= TRANS_MSA_CEA_RANGE;
+
switch (crtc_state->pipe_bpp) {
case 18:
temp |= TRANS_MSA_6_BPC;
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 05c72e77ccda89ff624108b1b59a0fc43843f343 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala(a)linux.intel.com>
Date: Tue, 17 Jul 2018 20:42:14 +0300
Subject: [PATCH] drm/i915: Nuke the LVDS lid notifier
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We broke the LVDS notifier resume thing in (presumably) commit
e2c8b8701e2d ("drm/i915: Use atomic helpers for suspend, v2.") as
we no longer duplicate the current state in the LVDS notifier and
thus we never resume it properly either.
Instead of trying to fix it again let's just kill off the lid
notifier entirely. None of the machines tested thus far have
apparently needed it. Originally the lid notifier was added to
work around cases where the VBIOS was clobbering some of the
hardware state behind the driver's back, mostly on Thinkpads.
We now have a few report of Thinkpads working just fine without
the notifier. So maybe it was misdiagnosed originally, or
something else has changed (ACPI video stuff perhaps?).
If we do end up finding a machine where the VBIOS is still causing
problems I would suggest that we first try setting various bits in
the VBIOS scratch registers. There are several to choose from that
may instruct the VBIOS to steer clear.
With the notifier gone we'll also stop looking at the panel status
in ->detect().
v2: Nuke enum modeset_restore (Rodrigo)
Cc: stable(a)vger.kernel.org
Cc: Wolfgang Draxinger <wdraxinger.maillist(a)draxit.de>
Cc: Vito Caputo <vcaputo(a)pengaru.com>
Cc: kitsunyan <kitsunyan(a)airmail.cc>
Cc: Joonas Saarinen <jza(a)saunalahti.fi>
Tested-by: Vito Caputo <vcaputo(a)pengaru.com> # Thinkapd X61s
Tested-by: kitsunyan <kitsunyan(a)airmail.cc> # ThinkPad X200
Tested-by: Joonas Saarinen <jza(a)saunalahti.fi> # Fujitsu Siemens U9210
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105902
References: https://lists.freedesktop.org/archives/intel-gfx/2018-June/169315.html
References: https://bugs.freedesktop.org/show_bug.cgi?id=21230
Fixes: e2c8b8701e2d ("drm/i915: Use atomic helpers for suspend, v2.")
Signed-off-by: Ville Syrjälä <ville.syrjala(a)linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180717174216.22252-1-ville.…
Reviewed-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 337b1aad5212..343e79a44abd 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -900,7 +900,6 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
spin_lock_init(&dev_priv->uncore.lock);
mutex_init(&dev_priv->sb_lock);
- mutex_init(&dev_priv->modeset_restore_lock);
mutex_init(&dev_priv->av_mutex);
mutex_init(&dev_priv->wm.wm_mutex);
mutex_init(&dev_priv->pps_mutex);
@@ -1570,11 +1569,6 @@ static int i915_drm_suspend(struct drm_device *dev)
struct pci_dev *pdev = dev_priv->drm.pdev;
pci_power_t opregion_target_state;
- /* ignore lid events during suspend */
- mutex_lock(&dev_priv->modeset_restore_lock);
- dev_priv->modeset_restore = MODESET_SUSPENDED;
- mutex_unlock(&dev_priv->modeset_restore_lock);
-
disable_rpm_wakeref_asserts(dev_priv);
/* We do a lot of poking in a lot of registers, make sure they work
@@ -1770,10 +1764,6 @@ static int i915_drm_resume(struct drm_device *dev)
intel_fbdev_set_suspend(dev, FBINFO_STATE_RUNNING, false);
- mutex_lock(&dev_priv->modeset_restore_lock);
- dev_priv->modeset_restore = MODESET_DONE;
- mutex_unlock(&dev_priv->modeset_restore_lock);
-
intel_opregion_notify_adapter(dev_priv, PCI_D0);
enable_rpm_wakeref_asserts(dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 08d4303abb14..995656f51b57 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1002,12 +1002,6 @@ struct i915_gem_mm {
#define I915_ENGINE_WEDGED_TIMEOUT (60 * HZ) /* Reset but no recovery? */
-enum modeset_restore {
- MODESET_ON_LID_OPEN,
- MODESET_DONE,
- MODESET_SUSPENDED,
-};
-
#define DP_AUX_A 0x40
#define DP_AUX_B 0x10
#define DP_AUX_C 0x20
@@ -1730,8 +1724,6 @@ struct drm_i915_private {
unsigned long quirks;
- enum modeset_restore modeset_restore;
- struct mutex modeset_restore_lock;
struct drm_atomic_state *modeset_restore_state;
struct drm_modeset_acquire_ctx reset_ctx;
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index bb06744d28a4..a35404119257 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -44,8 +44,6 @@
/* Private structure for the integrated LVDS support */
struct intel_lvds_connector {
struct intel_connector base;
-
- struct notifier_block lid_notifier;
};
struct intel_lvds_pps {
@@ -452,26 +450,9 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder,
return true;
}
-/*
- * Detect the LVDS connection.
- *
- * Since LVDS doesn't have hotlug, we use the lid as a proxy. Open means
- * connected and closed means disconnected. We also send hotplug events as
- * needed, using lid status notification from the input layer.
- */
static enum drm_connector_status
intel_lvds_detect(struct drm_connector *connector, bool force)
{
- struct drm_i915_private *dev_priv = to_i915(connector->dev);
- enum drm_connector_status status;
-
- DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
- connector->base.id, connector->name);
-
- status = intel_panel_detect(dev_priv);
- if (status != connector_status_unknown)
- return status;
-
return connector_status_connected;
}
@@ -496,117 +477,6 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
return 1;
}
-static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
-{
- DRM_INFO("Skipping forced modeset for %s\n", id->ident);
- return 1;
-}
-
-/* The GPU hangs up on these systems if modeset is performed on LID open */
-static const struct dmi_system_id intel_no_modeset_on_lid[] = {
- {
- .callback = intel_no_modeset_on_lid_dmi_callback,
- .ident = "Toshiba Tecra A11",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"),
- },
- },
-
- { } /* terminating entry */
-};
-
-/*
- * Lid events. Note the use of 'modeset':
- * - we set it to MODESET_ON_LID_OPEN on lid close,
- * and set it to MODESET_DONE on open
- * - we use it as a "only once" bit (ie we ignore
- * duplicate events where it was already properly set)
- * - the suspend/resume paths will set it to
- * MODESET_SUSPENDED and ignore the lid open event,
- * because they restore the mode ("lid open").
- */
-static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
- void *unused)
-{
- struct intel_lvds_connector *lvds_connector =
- container_of(nb, struct intel_lvds_connector, lid_notifier);
- struct drm_connector *connector = &lvds_connector->base.base;
- struct drm_device *dev = connector->dev;
- struct drm_i915_private *dev_priv = to_i915(dev);
-
- if (dev->switch_power_state != DRM_SWITCH_POWER_ON)
- return NOTIFY_OK;
-
- mutex_lock(&dev_priv->modeset_restore_lock);
- if (dev_priv->modeset_restore == MODESET_SUSPENDED)
- goto exit;
- /*
- * check and update the status of LVDS connector after receiving
- * the LID nofication event.
- */
- connector->status = connector->funcs->detect(connector, false);
-
- /* Don't force modeset on machines where it causes a GPU lockup */
- if (dmi_check_system(intel_no_modeset_on_lid))
- goto exit;
- if (!acpi_lid_open()) {
- /* do modeset on next lid open event */
- dev_priv->modeset_restore = MODESET_ON_LID_OPEN;
- goto exit;
- }
-
- if (dev_priv->modeset_restore == MODESET_DONE)
- goto exit;
-
- /*
- * Some old platform's BIOS love to wreak havoc while the lid is closed.
- * We try to detect this here and undo any damage. The split for PCH
- * platforms is rather conservative and a bit arbitrary expect that on
- * those platforms VGA disabling requires actual legacy VGA I/O access,
- * and as part of the cleanup in the hw state restore we also redisable
- * the vga plane.
- */
- if (!HAS_PCH_SPLIT(dev_priv))
- intel_display_resume(dev);
-
- dev_priv->modeset_restore = MODESET_DONE;
-
-exit:
- mutex_unlock(&dev_priv->modeset_restore_lock);
- return NOTIFY_OK;
-}
-
-static int
-intel_lvds_connector_register(struct drm_connector *connector)
-{
- struct intel_lvds_connector *lvds = to_lvds_connector(connector);
- int ret;
-
- ret = intel_connector_register(connector);
- if (ret)
- return ret;
-
- lvds->lid_notifier.notifier_call = intel_lid_notify;
- if (acpi_lid_notifier_register(&lvds->lid_notifier)) {
- DRM_DEBUG_KMS("lid notifier registration failed\n");
- lvds->lid_notifier.notifier_call = NULL;
- }
-
- return 0;
-}
-
-static void
-intel_lvds_connector_unregister(struct drm_connector *connector)
-{
- struct intel_lvds_connector *lvds = to_lvds_connector(connector);
-
- if (lvds->lid_notifier.notifier_call)
- acpi_lid_notifier_unregister(&lvds->lid_notifier);
-
- intel_connector_unregister(connector);
-}
-
/**
* intel_lvds_destroy - unregister and free LVDS structures
* @connector: connector to free
@@ -639,8 +509,8 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = {
.fill_modes = drm_helper_probe_single_connector_modes,
.atomic_get_property = intel_digital_connector_atomic_get_property,
.atomic_set_property = intel_digital_connector_atomic_set_property,
- .late_register = intel_lvds_connector_register,
- .early_unregister = intel_lvds_connector_unregister,
+ .late_register = intel_connector_register,
+ .early_unregister = intel_connector_unregister,
.destroy = intel_lvds_destroy,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
.atomic_duplicate_state = intel_digital_connector_duplicate_state,
@@ -1114,8 +984,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
* 2) check for VBT data
* 3) check to see if LVDS is already on
* if none of the above, no panel
- * 4) make sure lid is open
- * if closed, act like it's not there for now
*/
/*
This is a note to let you know that I've just added the patch titled
vmbus: don't return values for uninitalized channels
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 6712cc9c22117a8af9f3df272b4a44fd2e4201cd Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen(a)networkplumber.org>
Date: Mon, 20 Aug 2018 21:16:40 +0000
Subject: vmbus: don't return values for uninitalized channels
For unsupported device types, the vmbus channel ringbuffer is never
initialized, and therefore reading the sysfs files will return garbage
or cause a kernel OOPS.
Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info")
Signed-off-by: Stephen Hemminger <sthemmin(a)microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys(a)microsoft.com>
Cc: <stable(a)vger.kernel.org> # 4.15
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/hv/vmbus_drv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index b1b548a21f91..c71cc857b649 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1291,6 +1291,9 @@ static ssize_t vmbus_chan_attr_show(struct kobject *kobj,
if (!attribute->show)
return -EIO;
+ if (chan->state != CHANNEL_OPENED_STATE)
+ return -EINVAL;
+
return attribute->show(chan, buf);
}
--
2.18.0
This is a note to let you know that I've just added the patch titled
Tools: hv: Fix a bug in the key delete code
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 86503bd35dec0ce363e9fdbf5299927422ed3899 Mon Sep 17 00:00:00 2001
From: "K. Y. Srinivasan" <kys(a)microsoft.com>
Date: Fri, 10 Aug 2018 23:06:07 +0000
Subject: Tools: hv: Fix a bug in the key delete code
Fix a bug in the key delete code - the num_records range
from 0 to num_records-1.
Signed-off-by: K. Y. Srinivasan <kys(a)microsoft.com>
Reported-by: David Binderman <dcb314(a)hotmail.com>
Cc: <stable(a)vger.kernel.org>
Reviewed-by: Michael Kelley <mikelley(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
tools/hv/hv_kvp_daemon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index dbf6e8bd98ba..bbb2a8ef367c 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -286,7 +286,7 @@ static int kvp_key_delete(int pool, const __u8 *key, int key_size)
* Found a match; just move the remaining
* entries up.
*/
- if (i == num_records) {
+ if (i == (num_records - 1)) {
kvp_file_info[pool].num_records--;
kvp_update_file(pool);
return 0;
--
2.18.0
This is a note to let you know that I've just added the patch titled
misc: ibmvsm: Fix wrong assignment of return code
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From c55e9318871cd06e4aa10f5023cc2dcdfbb08577 Mon Sep 17 00:00:00 2001
From: "Bryant G. Ly" <bryantly(a)linux.ibm.com>
Date: Mon, 6 Aug 2018 08:31:00 -0500
Subject: misc: ibmvsm: Fix wrong assignment of return code
Currently the assignment is flipped and rc is always 0.
Signed-off-by: Bryant G. Ly <bryantly(a)linux.ibm.com>
Fixes: 0eca353e7ae7 ("misc: IBM Virtual Management Channel Driver (VMC)")
Reviewed-by: Bradley Warrum <bwarrum(a)us.ibm.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/misc/ibmvmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c
index 8f82bb9d11e2..b8aaa684c397 100644
--- a/drivers/misc/ibmvmc.c
+++ b/drivers/misc/ibmvmc.c
@@ -2131,7 +2131,7 @@ static int ibmvmc_init_crq_queue(struct crq_server_adapter *adapter)
retrc = plpar_hcall_norets(H_REG_CRQ,
vdev->unit_address,
queue->msg_token, PAGE_SIZE);
- retrc = rc;
+ rc = retrc;
if (rc == H_RESOURCE)
rc = ibmvmc_reset_crq_queue(adapter);
--
2.18.0
This is a note to let you know that I've just added the patch titled
android: binder: fix the race mmap and alloc_new_buf_locked
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From da1b9564e85b1d7baf66cbfabcab27e183a1db63 Mon Sep 17 00:00:00 2001
From: Minchan Kim <minchan(a)kernel.org>
Date: Thu, 23 Aug 2018 14:29:56 +0900
Subject: android: binder: fix the race mmap and alloc_new_buf_locked
There is RaceFuzzer report like below because we have no lock to close
below the race between binder_mmap and binder_alloc_new_buf_locked.
To close the race, let's use memory barrier so that if someone see
alloc->vma is not NULL, alloc->vma_vm_mm should be never NULL.
(I didn't add stable mark intentionallybecause standard android
userspace libraries that interact with binder (libbinder & libhwbinder)
prevent the mmap/ioctl race. - from Todd)
"
Thread interleaving:
CPU0 (binder_alloc_mmap_handler) CPU1 (binder_alloc_new_buf_locked)
===== =====
// drivers/android/binder_alloc.c
// #L718 (v4.18-rc3)
alloc->vma = vma;
// drivers/android/binder_alloc.c
// #L346 (v4.18-rc3)
if (alloc->vma == NULL) {
...
// alloc->vma is not NULL at this point
return ERR_PTR(-ESRCH);
}
...
// #L438
binder_update_page_range(alloc, 0,
(void *)PAGE_ALIGN((uintptr_t)buffer->data),
end_page_addr);
// In binder_update_page_range() #L218
// But still alloc->vma_vm_mm is NULL here
if (need_mm && mmget_not_zero(alloc->vma_vm_mm))
alloc->vma_vm_mm = vma->vm_mm;
Crash Log:
==================================================================
BUG: KASAN: null-ptr-deref in __atomic_add_unless include/asm-generic/atomic-instrumented.h:89 [inline]
BUG: KASAN: null-ptr-deref in atomic_add_unless include/linux/atomic.h:533 [inline]
BUG: KASAN: null-ptr-deref in mmget_not_zero include/linux/sched/mm.h:75 [inline]
BUG: KASAN: null-ptr-deref in binder_update_page_range+0xece/0x18e0 drivers/android/binder_alloc.c:218
Write of size 4 at addr 0000000000000058 by task syz-executor0/11184
CPU: 1 PID: 11184 Comm: syz-executor0 Not tainted 4.18.0-rc3 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x16e/0x22c lib/dump_stack.c:113
kasan_report_error mm/kasan/report.c:352 [inline]
kasan_report+0x163/0x380 mm/kasan/report.c:412
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x140/0x1a0 mm/kasan/kasan.c:267
kasan_check_write+0x14/0x20 mm/kasan/kasan.c:278
__atomic_add_unless include/asm-generic/atomic-instrumented.h:89 [inline]
atomic_add_unless include/linux/atomic.h:533 [inline]
mmget_not_zero include/linux/sched/mm.h:75 [inline]
binder_update_page_range+0xece/0x18e0 drivers/android/binder_alloc.c:218
binder_alloc_new_buf_locked drivers/android/binder_alloc.c:443 [inline]
binder_alloc_new_buf+0x467/0xc30 drivers/android/binder_alloc.c:513
binder_transaction+0x125b/0x4fb0 drivers/android/binder.c:2957
binder_thread_write+0xc08/0x2770 drivers/android/binder.c:3528
binder_ioctl_write_read.isra.39+0x24f/0x8e0 drivers/android/binder.c:4456
binder_ioctl+0xa86/0xf34 drivers/android/binder.c:4596
vfs_ioctl fs/ioctl.c:46 [inline]
do_vfs_ioctl+0x154/0xd40 fs/ioctl.c:686
ksys_ioctl+0x94/0xb0 fs/ioctl.c:701
__do_sys_ioctl fs/ioctl.c:708 [inline]
__se_sys_ioctl fs/ioctl.c:706 [inline]
__x64_sys_ioctl+0x43/0x50 fs/ioctl.c:706
do_syscall_64+0x167/0x4b0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
"
Signed-off-by: Todd Kjos <tkjos(a)google.com>
Signed-off-by: Minchan Kim <minchan(a)kernel.org>
Reviewed-by: Martijn Coenen <maco(a)android.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/android/binder_alloc.c | 43 +++++++++++++++++++++++++++-------
1 file changed, 35 insertions(+), 8 deletions(-)
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index 3f3b7b253445..64fd96eada31 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -332,6 +332,35 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate,
return vma ? -ENOMEM : -ESRCH;
}
+
+static inline void binder_alloc_set_vma(struct binder_alloc *alloc,
+ struct vm_area_struct *vma)
+{
+ if (vma)
+ alloc->vma_vm_mm = vma->vm_mm;
+ /*
+ * If we see alloc->vma is not NULL, buffer data structures set up
+ * completely. Look at smp_rmb side binder_alloc_get_vma.
+ * We also want to guarantee new alloc->vma_vm_mm is always visible
+ * if alloc->vma is set.
+ */
+ smp_wmb();
+ alloc->vma = vma;
+}
+
+static inline struct vm_area_struct *binder_alloc_get_vma(
+ struct binder_alloc *alloc)
+{
+ struct vm_area_struct *vma = NULL;
+
+ if (alloc->vma) {
+ /* Look at description in binder_alloc_set_vma */
+ smp_rmb();
+ vma = alloc->vma;
+ }
+ return vma;
+}
+
static struct binder_buffer *binder_alloc_new_buf_locked(
struct binder_alloc *alloc,
size_t data_size,
@@ -348,7 +377,7 @@ static struct binder_buffer *binder_alloc_new_buf_locked(
size_t size, data_offsets_size;
int ret;
- if (alloc->vma == NULL) {
+ if (!binder_alloc_get_vma(alloc)) {
binder_alloc_debug(BINDER_DEBUG_USER_ERROR,
"%d: binder_alloc_buf, no vma\n",
alloc->pid);
@@ -723,9 +752,7 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc,
buffer->free = 1;
binder_insert_free_buffer(alloc, buffer);
alloc->free_async_space = alloc->buffer_size / 2;
- barrier();
- alloc->vma = vma;
- alloc->vma_vm_mm = vma->vm_mm;
+ binder_alloc_set_vma(alloc, vma);
mmgrab(alloc->vma_vm_mm);
return 0;
@@ -754,10 +781,10 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)
int buffers, page_count;
struct binder_buffer *buffer;
- BUG_ON(alloc->vma);
-
buffers = 0;
mutex_lock(&alloc->mutex);
+ BUG_ON(alloc->vma);
+
while ((n = rb_first(&alloc->allocated_buffers))) {
buffer = rb_entry(n, struct binder_buffer, rb_node);
@@ -900,7 +927,7 @@ int binder_alloc_get_allocated_count(struct binder_alloc *alloc)
*/
void binder_alloc_vma_close(struct binder_alloc *alloc)
{
- WRITE_ONCE(alloc->vma, NULL);
+ binder_alloc_set_vma(alloc, NULL);
}
/**
@@ -935,7 +962,7 @@ enum lru_status binder_alloc_free_page(struct list_head *item,
index = page - alloc->pages;
page_addr = (uintptr_t)alloc->buffer + index * PAGE_SIZE;
- vma = alloc->vma;
+ vma = binder_alloc_get_vma(alloc);
if (vma) {
if (!mmget_not_zero(alloc->vma_vm_mm))
goto err_mmget;
--
2.18.0
This is a note to let you know that I've just added the patch titled
mei: bus: need to unlink client before freeing
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 34f1166afd67f9f48a08c52f36180048908506a4 Mon Sep 17 00:00:00 2001
From: Tomas Winkler <tomas.winkler(a)intel.com>
Date: Mon, 27 Aug 2018 22:40:16 +0300
Subject: mei: bus: need to unlink client before freeing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In case a client fails to connect in mei_cldev_enable(), the
caller won't call the mei_cldev_disable leaving the client
in a linked stated. Upon driver unload the client structure
will be freed in mei_cl_bus_dev_release(), leaving a stale pointer
on a fail_list. This will eventually end up in crash
during power down flow in mei_cl_set_disonnected().
RIP: mei_cl_set_disconnected+0x5/0x260[mei]
Call trace:
mei_cl_all_disconnect+0x22/0x30
mei_reset+0x194/0x250
__synchronize_hardirq+0x43/0x50
_cond_resched+0x15/0x30
mei_me_intr_clear+0x20/0x100
mei_stop+0x76/0xb0
mei_me_shutdown+0x3f/0x80
pci_device_shutdown+0x34/0x60
kernel_restart+0x0e/0x30
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200455
Fixes: 'c110cdb17148 ("mei: bus: make a client pointer always available")'
Cc: <stable(a)vger.kernel.org> 4.10+
Tested-by: Georg Müller <georgmueller(a)gmx.net>
Signed-off-by: Tomas Winkler <tomas.winkler(a)intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/misc/mei/bus.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 13c6c9a2248a..fc3872fe7b25 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -521,17 +521,15 @@ int mei_cldev_enable(struct mei_cl_device *cldev)
cl = cldev->cl;
+ mutex_lock(&bus->device_lock);
if (cl->state == MEI_FILE_UNINITIALIZED) {
- mutex_lock(&bus->device_lock);
ret = mei_cl_link(cl);
- mutex_unlock(&bus->device_lock);
if (ret)
- return ret;
+ goto out;
/* update pointers */
cl->cldev = cldev;
}
- mutex_lock(&bus->device_lock);
if (mei_cl_is_connected(cl)) {
ret = 0;
goto out;
@@ -875,12 +873,13 @@ static void mei_cl_bus_dev_release(struct device *dev)
mei_me_cl_put(cldev->me_cl);
mei_dev_bus_put(cldev->bus);
+ mei_cl_unlink(cldev->cl);
kfree(cldev->cl);
kfree(cldev);
}
static const struct device_type mei_cl_device_type = {
- .release = mei_cl_bus_dev_release,
+ .release = mei_cl_bus_dev_release,
};
/**
--
2.18.0
This is a note to let you know that I've just added the patch titled
mei: bus: fix hw module get/put balance
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 69bf5313035926b0b6a6578de4f3168a8f5c19b8 Mon Sep 17 00:00:00 2001
From: Tomas Winkler <tomas.winkler(a)intel.com>
Date: Mon, 27 Aug 2018 22:40:15 +0300
Subject: mei: bus: fix hw module get/put balance
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In case the device is not connected it doesn't 'get'
hw module and hence should not 'put' it on disable.
Cc: <stable(a)vger.kernel.org> 4.16+
Fixes:'commit 257355a44b99 ("mei: make module referencing local to the bus.c")'
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200455
Tested-by: Georg Müller <georgmueller(a)gmx.net>
Signed-off-by: Tomas Winkler <tomas.winkler(a)intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/misc/mei/bus.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 7bba62a72921..13c6c9a2248a 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -616,9 +616,8 @@ int mei_cldev_disable(struct mei_cl_device *cldev)
if (err < 0)
dev_err(bus->dev, "Could not disconnect from the ME client\n");
-out:
mei_cl_bus_module_put(cldev);
-
+out:
/* Flush queues and remove any pending read */
mei_cl_flush_queues(cl, NULL);
mei_cl_unlink(cl);
--
2.18.0
This is a note to let you know that I've just added the patch titled
mei: ignore not found client in the enumeration
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 8d2d8935d30cc2acc57a3196dc10dfa8d5cbcdab Mon Sep 17 00:00:00 2001
From: Alexander Usyskin <alexander.usyskin(a)intel.com>
Date: Mon, 6 Aug 2018 17:47:33 +0300
Subject: mei: ignore not found client in the enumeration
Some of the ME clients are available only for BIOS operation and are
removed during hand off to an OS. However the removal is not instant.
A client may be visible on the client list when the mei driver requests
for enumeration, while the subsequent request for properties will be
answered with client not found error value. The default behavior
for an error is to perform client reset while this error is harmless and
the link reset should be prevented. This issue started to be visible due to
suspend/resume timing changes. Currently reported only on the Haswell
based system.
Fixes:
[33.564957] mei_me 0000:00:16.0: hbm: properties response: wrong status = 1 CLIENT_NOT_FOUND
[33.564978] mei_me 0000:00:16.0: mei_irq_read_handler ret = -71.
[33.565270] mei_me 0000:00:16.0: unexpected reset: dev_state = INIT_CLIENTS fw status = 1E000255 60002306 00000200 00004401 00000000 00000010
Cc: <stable(a)vger.kernel.org>
Reported-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin(a)intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler(a)intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/misc/mei/hbm.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index 09e233d4c0de..e56f3e72d57a 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -1161,15 +1161,18 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
props_res = (struct hbm_props_response *)mei_msg;
- if (props_res->status) {
+ if (props_res->status == MEI_HBMS_CLIENT_NOT_FOUND) {
+ dev_dbg(dev->dev, "hbm: properties response: %d CLIENT_NOT_FOUND\n",
+ props_res->me_addr);
+ } else if (props_res->status) {
dev_err(dev->dev, "hbm: properties response: wrong status = %d %s\n",
props_res->status,
mei_hbm_status_str(props_res->status));
return -EPROTO;
+ } else {
+ mei_hbm_me_cl_add(dev, props_res);
}
- mei_hbm_me_cl_add(dev, props_res);
-
/* request property for the next client */
if (mei_hbm_prop_req(dev, props_res->me_addr + 1))
return -EIO;
--
2.18.0
On 9/11/18 4:20 PM, Thomas Gleixner wrote:
> On Tue, 11 Sep 2018, Boris Ostrovsky wrote:
>
>> For unprivileged Xen PV guests this is normal memory and ioremap will
>> not be able to properly map it.
>>
>> While at it, since ioremap may return NULL, add a test for pointer's
>> validity.
> I assume this goes back to very dead kernels, so that should go with a Cc
> stable, right?
>
Yes, I forgot to add those (and now I did), thanks for pointing this out.
It has to go at least all the way back to 4.13 since before
f7eaf6e00fd58 ("x86/boot: Move EISA setup to a separate file"), just by
luck, early_ioremap() worked for the guests.
-boris
Hi Doug and Jason,
Here are two patches that should probably land in the RC. The first one ensures
we don't index beyond the end of an array. The other is more subtle but arguably
more important. The bug it fixes results in incorrect IRQ bits to be set and the
result is we do not get an interrupt for an error and have to wait for another
interrupt to fire to see said error.
---
Dennis Dalessandro (1):
IB/hfi1: Ensure ucast_dlid access doesnt exceed bounds
Michael J. Ruhl (1):
IB/hfi1: set_intr_bits uses incorrect source for register modification
drivers/infiniband/hw/hfi1/chip.c | 2 +-
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
--
-Denny
With commit 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of
of_find_node_by_phandle()"), a G3 PowerMac fails to boot. The root cause
is the DT for this system has no phandle properties when booted with
BootX. of_populate_phandle_cache() does not handle the case of no
phandles correctly. The problem is roundup_pow_of_two() for 0 is
undefined. The implementation subtracts 1 underflowing and then things
are in the weeds.
Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()")
Cc: stable(a)vger.kernel.org # 4.17+
Reported-by: Finn Thain <fthain(a)telegraphics.com.au>
Tested-by: Stan Johnson <userm57(a)yahoo.com>
Cc: Frank Rowand <frowand.list(a)gmail.com>
Cc: Benjamin Herrenschmidt <benh(a)kernel.crashing.org>
Signed-off-by: Rob Herring <robh(a)kernel.org>
---
Here's a formal patch of what Stan tested. Will send to Linus this week.
Rob
drivers/of/base.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index a055cd1ef96d..17ae594b7014 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -140,6 +140,9 @@ void of_populate_phandle_cache(void)
if (np->phandle && np->phandle != OF_PHANDLE_ILLEGAL)
phandles++;
+ if (!phandles)
+ goto out;
+
cache_entries = roundup_pow_of_two(phandles);
phandle_cache_mask = cache_entries - 1;
--
2.17.1
Hi all,
Three fixes that worth to have in the @stable, as we've hit them on v4.9
stable.
And for linux-next - adding lockdep asserts for line discipline changing
code, verifying that write ldisc sem will be held forthwith.
The last patch is optional and probably, timeout can be dropped for
read_lock(). I'll do it if everyone agrees.
Rong Chen, could you kindly re-run this version to see if the lockup
from v1 still happens? I wasn't able to reproduce it..
Thanks,
Dima
Changes since v2:
- Added reviewed-by tags
- Hopefully, fixed reported by 0-day issue.
- Added optional fix for wait_readers decrement
Changes since v1:
- Added tested-by/reported-by tags
- Dropped 3/4 (locking tty pair for lockdep sake),
Because of that - not adding lockdep_assert_held() in tty_ldisc_open()
- Added 4/4 cleanup to inc tty->count only on success of
tty_ldisc_reinit()
- lock ldisc without (5*HZ) timeout in tty_reopen()
v1 link:
lkml.kernel.org/r/<20180829022353.23568-1-dima(a)arista.com>
Huuge cc list:
Cc: Daniel Axtens <dja(a)axtens.net>
Cc: Dmitry Vyukov <dvyukov(a)google.com>
Cc: Michael Neuling <mikey(a)neuling.org>
Cc: Mikulas Patocka <mpatocka(a)redhat.com>
Cc: Nathan March <nathan(a)gt.net>
Cc: Pasi Kärkkäinen <pasik(a)iki.fi>
Cc: Peter Hurley <peter(a)hurleysoftware.com>
Cc: "Rong, Chen" <rong.a.chen(a)intel.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work(a)gmail.com>
Cc: Tan Xiaojun <tanxiaojun(a)huawei.com>
Cc: Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
(please, ignore if I Cc'ed you mistakenly)
Dmitry Safonov (6):
tty: Drop tty->count on tty_reopen() failure
tty/ldsem: Update waiter->task before waking up reader
tty: Hold tty_ldisc_lock() during tty_reopen()
tty/lockdep: Add ldisc_sem asserts
tty: Simplify tty->count math in tty_reopen()
tty/ldsem: Decrement wait_readers on timeouted down_read()
drivers/tty/tty_io.c | 12 ++++++++----
drivers/tty/tty_ldisc.c | 5 +++++
drivers/tty/tty_ldsem.c | 5 ++++-
3 files changed, 17 insertions(+), 5 deletions(-)
--
2.13.6
Hi,
If you have photos for editing, please send email to: hansrekan(a)outlook.com
We have 12 in house image editors and we can help you for cutting out your
photos, or path the photos.
Includes retouching if needed.
Used for products photos or portrait photos, catalog photos.
You may drop us one photo, we can send you the testing work.
Thanks,
Aaron Williams
Email: hansrekan(a)outlook.com
Hi,
If you have photos for editing, please send email to: hansrekan(a)outlook.com
We have 12 in house image editors and we can help you for cutting out your
photos, or path the photos.
Includes retouching if needed.
Used for products photos or portrait photos, catalog photos.
You may drop us one photo, we can send you the testing work.
Thanks,
Aaron Williams
Email: hansrekan(a)outlook.com
Hi,
If you have photos for editing, please send email to: hansrekan(a)outlook.com
We have 12 in house image editors and we can help you for cutting out your
photos, or path the photos.
Includes retouching if needed.
Used for products photos or portrait photos, catalog photos.
You may drop us one photo, we can send you the testing work.
Thanks,
Aaron Williams
Email: hansrekan(a)outlook.com
Two fixes for potential and real issues.
Looks worth to have in stables as we've hit it on v4.9 stable.
And for linux-next - adding lockdep asserts for line discipline changing
code, verifying that write ldisc sem will be held forthwith.
I couldn't verify that holding write lock fixes the issue as we've hit
it only once and I've failed in reproducing it.
But searching in lkml, Cc'ing here people who probably had the same
crash (and in hope someone of them could give tested-by):
Cc: Daniel Axtens <dja(a)axtens.net>
Cc: Dmitry Vyukov <dvyukov(a)google.com>
Cc: Michael Neuling <mikey(a)neuling.org>
Cc: Mikulas Patocka <mpatocka(a)redhat.com>
Cc: Pasi Kärkkäinen <pasik(a)iki.fi>
Cc: Peter Hurley <peter(a)hurleysoftware.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work(a)gmail.com>
Cc: Tan Xiaojun <tanxiaojun(a)huawei.com>
(please, ignore if I Cc'ed you mistakenly)
Dmitry Safonov (4):
tty: Drop tty->count on tty_reopen() failure
tty: Hold tty_ldisc_lock() during tty_reopen()
tty: Lock tty pair in tty_init_dev()
tty/lockdep: Add ldisc_sem asserts
drivers/tty/tty_io.c | 21 +++++++++++++++------
drivers/tty/tty_ldisc.c | 12 ++++++++----
include/linux/tty.h | 4 ++++
3 files changed, 27 insertions(+), 10 deletions(-)
--
2.13.6
This is a note to let you know that I've just added the patch titled
Revert "cdc-acm: implement put_char() and flush_chars()"
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From df3aa13c7bbb307e172c37f193f9a7aa058d4739 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum(a)suse.com>
Date: Wed, 5 Sep 2018 17:56:46 +0200
Subject: Revert "cdc-acm: implement put_char() and flush_chars()"
This reverts commit a81cf9799ad7299b03a4dff020d9685f9ac5f3e0.
The patch causes a regression, which I cannot find the reason for.
So let's revert for now, as a revert hurts only performance.
Original report:
I was trying to resolve the problem with Oliver but we don't get any conclusion
for 5 months, so I am now sending this to mail list and cdc_acm authors.
I am using simple request-response protocol to obtain the boiller parameters
in constant intervals.
A simple one transaction is:
1. opening the /dev/ttyACM0
2. sending the following 10-bytes request to the device:
unsigned char req[] = {0x02, 0xfe, 0x01, 0x05, 0x08, 0x02, 0x01, 0x69, 0xab, 0x03};
3. reading response (frame of 74 bytes length).
4. closing the descriptor
I am doing this transaction with 5 seconds intervals.
Before the bad commit everything was working correctly: I've got a requests and
a responses in a timely manner.
After the bad commit more time I am using the kernel module, more problems I have.
The graph [2] is showing the problem.
As you can see after module load all seems fine but after about 30 minutes I've got
a plenty of EAGAINs when doing read()'s and trying to read back the data.
When I rmmod and insmod the cdc_acm module again, then the situation is starting
over again: running ok shortly after load, and more time it is running, more EAGAINs
I have when calling read().
As a bonus I can see the problem on the device itself:
The device is configured as you can see here on this screen [3].
It has two transmision LEDs: TX and RX. Blink duration is set for 100ms.
This is a recording before the bad commit when all is working fine: [4]
And this is with the bad commit: [5]
As you can see the TX led is blinking wrongly long (indicating transmission?)
and I have problems doing read() calls (EAGAIN).
Reported-by: Mariusz Bialonczyk <manio(a)skyboo.net>
Signed-off-by: Oliver Neukum <oneukum(a)suse.com>
Fixes: a81cf9799ad7 ("cdc-acm: implement put_char() and flush_chars()")
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/class/cdc-acm.c | 73 -------------------------------------
drivers/usb/class/cdc-acm.h | 1 -
2 files changed, 74 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 27346d69f393..f9b40a9dc4d3 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -780,20 +780,9 @@ static int acm_tty_write(struct tty_struct *tty,
}
if (acm->susp_count) {
- if (acm->putbuffer) {
- /* now to preserve order */
- usb_anchor_urb(acm->putbuffer->urb, &acm->delayed);
- acm->putbuffer = NULL;
- }
usb_anchor_urb(wb->urb, &acm->delayed);
spin_unlock_irqrestore(&acm->write_lock, flags);
return count;
- } else {
- if (acm->putbuffer) {
- /* at this point there is no good way to handle errors */
- acm_start_wb(acm, acm->putbuffer);
- acm->putbuffer = NULL;
- }
}
stat = acm_start_wb(acm, wb);
@@ -804,66 +793,6 @@ static int acm_tty_write(struct tty_struct *tty,
return count;
}
-static void acm_tty_flush_chars(struct tty_struct *tty)
-{
- struct acm *acm = tty->driver_data;
- struct acm_wb *cur;
- int err;
- unsigned long flags;
-
- spin_lock_irqsave(&acm->write_lock, flags);
-
- cur = acm->putbuffer;
- if (!cur) /* nothing to do */
- goto out;
-
- acm->putbuffer = NULL;
- err = usb_autopm_get_interface_async(acm->control);
- if (err < 0) {
- cur->use = 0;
- acm->putbuffer = cur;
- goto out;
- }
-
- if (acm->susp_count)
- usb_anchor_urb(cur->urb, &acm->delayed);
- else
- acm_start_wb(acm, cur);
-out:
- spin_unlock_irqrestore(&acm->write_lock, flags);
- return;
-}
-
-static int acm_tty_put_char(struct tty_struct *tty, unsigned char ch)
-{
- struct acm *acm = tty->driver_data;
- struct acm_wb *cur;
- int wbn;
- unsigned long flags;
-
-overflow:
- cur = acm->putbuffer;
- if (!cur) {
- spin_lock_irqsave(&acm->write_lock, flags);
- wbn = acm_wb_alloc(acm);
- if (wbn >= 0) {
- cur = &acm->wb[wbn];
- acm->putbuffer = cur;
- }
- spin_unlock_irqrestore(&acm->write_lock, flags);
- if (!cur)
- return 0;
- }
-
- if (cur->len == acm->writesize) {
- acm_tty_flush_chars(tty);
- goto overflow;
- }
-
- cur->buf[cur->len++] = ch;
- return 1;
-}
-
static int acm_tty_write_room(struct tty_struct *tty)
{
struct acm *acm = tty->driver_data;
@@ -1987,8 +1916,6 @@ static const struct tty_operations acm_ops = {
.cleanup = acm_tty_cleanup,
.hangup = acm_tty_hangup,
.write = acm_tty_write,
- .put_char = acm_tty_put_char,
- .flush_chars = acm_tty_flush_chars,
.write_room = acm_tty_write_room,
.ioctl = acm_tty_ioctl,
.throttle = acm_tty_throttle,
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index eacc116e83da..ca06b20d7af9 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -96,7 +96,6 @@ struct acm {
unsigned long read_urbs_free;
struct urb *read_urbs[ACM_NR];
struct acm_rb read_buffers[ACM_NR];
- struct acm_wb *putbuffer; /* for acm_tty_put_char() */
int rx_buflimit;
spinlock_t read_lock;
u8 *notification_buffer; /* to reassemble fragmented notifications */
--
2.18.0
We need that to adjust the len of the 2nd transfer (called data in
spi-mem) if it's too long to fit in a SPI message or SPI transfer.
Fixes: c36ff266dc82 ("spi: Extend the core to ease integration of SPI memory controllers")
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Chuanhua Han <chuanhua.han(a)nxp.com>
Reviewed-by: Boris Brezillon <boris.brezillon(a)bootlin.com>
---
Changes in v5:
-Add the validation check after the op->data.nbytes assignment
-Assign the "len" variable after defining it
-Remove the brackets on both sides of "opt-> data.nbytes"
Changes in v4:
-Rename variable name "opcode_addr_dummy_sum" to "len"
-The comparison of "spi_max_message_size(mem->spi)" and "len" was removed
-Adjust their order when comparing the sizes of "spi_max_message_size(mem->spi)" and "len"
-Changing the "unsigned long" type in the code to "size_t"
Changes in v3:
-Rename variable name "val" to "opcode_addr_dummy_sum"
-Place the legitimacy of the transfer size(i.e., "spi_max_message_size(mem->spi)" and
"opcode_addr_dummy_sum") into "if (! ctlr - > mem_ops | |! ctlr-> mem_ops->exec_op) {"
structure and add "spi_max_transfer_size(mem->spi) and opcode_addr_dummy_sum"
-Adjust the formatting alignment of the code
-"(unsigned long)op->data.nbytes" was modified to "(unsigned long)(op->data.nbytes)"
Changes in v2:
-Place the adjusted transfer bytes code in spi_mem_adjust_op_size() and check
spi_max_message_size(mem->spi) value before subtracting opcode, addr and dummy bytes
-Change the code from fsl-espi controller to generic code(The adjustment of spi transmission
length was originally modified in the "drivers/spi/spi-fsl-espi.c" file, and now the adjustment
of transfer length is made in the "drivers/spi/spi-mem.c" file)
drivers/spi/spi-mem.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index e43842c..eb72dba 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -346,10 +346,25 @@ EXPORT_SYMBOL_GPL(spi_mem_get_name);
int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op)
{
struct spi_controller *ctlr = mem->spi->controller;
+ size_t len;
+
+ len = sizeof(op->cmd.opcode) + op->addr.nbytes + op->dummy.nbytes;
if (ctlr->mem_ops && ctlr->mem_ops->adjust_op_size)
return ctlr->mem_ops->adjust_op_size(mem, op);
+ if (!ctlr->mem_ops || !ctlr->mem_ops->exec_op) {
+ if (len > spi_max_transfer_size(mem->spi))
+ return -EINVAL;
+
+ op->data.nbytes = min3((size_t)op->data.nbytes,
+ spi_max_transfer_size(mem->spi),
+ spi_max_message_size(mem->spi) -
+ len);
+ if (!op->data.nbytes)
+ return -EINVAL;
+ }
+
return 0;
}
EXPORT_SYMBOL_GPL(spi_mem_adjust_op_size);
--
2.7.4
This is the start of the stable review cycle for the 4.18.7 release.
There are 145 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun Sep 9 21:08:26 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.18.7-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.18.7-rc1
James Morse <james.morse(a)arm.com>
arm64: mm: always enable CONFIG_HOLES_IN_ZONE
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
cpuidle: menu: Retain tick when shallow state is selected
Jan Kara <jack(a)suse.cz>
udf: Fix mounting of Win7 created UDF filesystems
Jeremy Cline <jcline(a)redhat.com>
fs/quota: Fix spectre gadget in do_quotactl
Horia Geantă <horia.geanta(a)nxp.com>
crypto: caam/qi - fix error path in xts setkey
Horia Geantă <horia.geanta(a)nxp.com>
crypto: caam/jr - fix descriptor DMA unmapping
Horia Geantă <horia.geanta(a)nxp.com>
crypto: caam - fix DMA mapping direction for RSA forms 2 & 3
Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
crypto: arm64/sm4-ce - check for the right CPU feature bit
Dave Watson <davejwatson(a)fb.com>
crypto: aesni - Use unaligned loads from gcm_context_data
Ondrej Mosnacek <omosnace(a)redhat.com>
crypto: vmx - Fix sleep-in-atomic bugs
Adrian Hunter <adrian.hunter(a)intel.com>
perf auxtrace: Fix queue resize
Dan Williams <dan.j.williams(a)intel.com>
mm, dev_pagemap: Do not clear ->mapping on final put
Eddie.Horng <eddie.horng(a)mediatek.com>
cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias()
Masahiro Yamada <yamada.masahiro(a)socionext.com>
kconfig: fix "Can't open ..." in parallel build
Shan Hai <shan.hai(a)oracle.com>
bcache: release dc->writeback_lock properly in bch_writeback_thread()
Vishal Verma <vishal.l.verma(a)intel.com>
libnvdimm: fix ars_status output length calculation
Keith Busch <keith.busch(a)intel.com>
libnvdimm: Use max contiguous area for namespace size
Christian Brauner <christian(a)brauner.io>
getxattr: use correct xattr length
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: set line_length in dlfb_ops_set_par
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: handle allocation failure
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: make a local copy of fb_ops
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: set optimal write delay
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: don't switch if we are switching to the same videomode
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: fix display corruption of the last line
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: fix semaphore value leak
Mikulas Patocka <mpatocka(a)redhat.com>
fb: fix lost console when the user unplugs a USB adapter
Vignesh R <vigneshr(a)ti.com>
pwm: tiehrpwm: Fix disabling of output of PWMs
Vignesh R <vigneshr(a)ti.com>
pwm: tiehrpwm: Don't use emulation mode bits to control PWM output
Richard Weinberger <richard(a)nod.at>
ubifs: Fix synced_i_size calculation for xattr inodes
Richard Weinberger <richard(a)nod.at>
ubifs: Fix directory size calculation for symlinks
Richard Weinberger <richard(a)nod.at>
ubifs: xattr: Don't operate on deleted inodes
Richard Weinberger <richard(a)nod.at>
ubifs: Check data node size before truncate
Richard Weinberger <richard(a)nod.at>
Revert "UBIFS: Fix potential integer overflow in allocation"
Richard Weinberger <richard(a)nod.at>
ubifs: Fix memory leak in lprobs self-check
Jann Horn <jannh(a)google.com>
userns: move user access out of the mutex
Jann Horn <jannh(a)google.com>
sys: don't hold uts_sem while accessing userspace memory
Jacob Pan <jacob.jun.pan(a)linux.intel.com>
iommu/vt-d: Fix dev iotlb pfsid use
Jacob Pan <jacob.jun.pan(a)linux.intel.com>
iommu/vt-d: Add definitions for PFSID
Dmitry Osipenko <digetx(a)gmail.com>
iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA
Peter Zijlstra <peterz(a)infradead.org>
mm/tlb: Remove tlb_remove_table() non-concurrent condition
David Rivshin <DRivshin(a)allworx.com>
pwm: omap-dmtimer: Return -EPROBE_DEFER if no dmtimer platform data
Roger Quadros <rogerq(a)ti.com>
ARM: dts: am57xx-idk: Enable dual role for USB2 port
Jon Hunter <jonathanh(a)nvidia.com>
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Trond Myklebust <trondmy(a)gmail.com>
NFSv4: Fix a sleep in atomic context in nfs4_callback_sequence()
Trond Myklebust <trondmy(a)gmail.com>
NFSv4: Fix locking in pnfs_generic_recover_commit_reqs
Bill Baker <Bill.Baker(a)Oracle.com>
NFSv4 client live hangs after live data migration recovery
Amir Goldstein <amir73il(a)gmail.com>
nfsd: fix leaked file lock with nfs exported overlayfs
Dan Carpenter <dan.carpenter(a)oracle.com>
pnfs/blocklayout: off by one in bl_map_stripe()
Maciej S. Szmigiero <mail(a)maciej.szmigiero.name>
block, bfq: return nbytes and not zero from struct cftype .write() method
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: increase ranges in ___invalidate_{i,d}cache_all
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: limit offsets in __loop_cache_{all,page}
Paul Mackerras <paulus(a)ozlabs.org>
KVM: PPC: Book3S: Fix guest DMA when guest partially backed by THP pages
Paolo Bonzini <pbonzini(a)redhat.com>
KVM: VMX: fixes for vmentry_l1d_flush module parameter
Hans de Goede <hdegoede(a)redhat.com>
i2c: designware: Re-init controllers with pm_disabled set on resume
Lihua Yao <ylhuajnu(a)163.com>
ALSA: ac97: fix unbalanced pm_runtime_enable
Lihua Yao <ylhuajnu(a)163.com>
ALSA: ac97: fix check of pm_runtime_get_sync failure
Lihua Yao <ylhuajnu(a)163.com>
ALSA: ac97: fix device initialization in the compat layer
zhangyi (F) <yi.zhang(a)huawei.com>
PM / sleep: wakeup: Fix build error caused by missing SRCU support
Henry Willard <henry.willard(a)oracle.com>
cpufreq: governor: Avoid accessing invalid governor_data
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
cpuidle: menu: Handle stopped tick more aggressively
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
sched: idle: Avoid retaining the tick when it has been stopped
Peter Kalauskas <peskal(a)google.com>
drivers/block/zram/zram_drv.c: fix bug storing backing_dev
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPICA: Clear status of all events when entering sleep states
Erik Schmauss <erik.schmauss(a)intel.com>
ACPICA: AML Parser: skip opcodes that open a scope upon parse failure
Amir Goldstein <amir73il(a)gmail.com>
ovl: fix wrong use of impure dir cache in ovl_iterate()
Rafael David Tinoco <rafael.tinoco(a)linaro.org>
mfd: hi655x: Fix regmap area declared size for hi655x
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
uprobes: Use synchronize_rcu() not synchronize_sched()
Kamalesh Babulal <kamalesh(a)linux.vnet.ibm.com>
livepatch: Validate module/old func name length
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
printk/tracing: Do not trace printk_nmi_enter()
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing/blktrace: Fix to allow setting same value
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Do not call start/stop() functions when tracing_on does not change
Johan Hovold <johan(a)kernel.org>
rtc: omap: fix potential crash on power off
Johan Hovold <johan(a)kernel.org>
rtc: omap: fix resource leak in registration error path
Nadav Amit <namit(a)vmware.com>
vmw_balloon: fix VMCI use when balloon built into kernel
Nadav Amit <namit(a)vmware.com>
vmw_balloon: VMCI_DOORBELL_SET does not check status
Nadav Amit <namit(a)vmware.com>
vmw_balloon: do not use 2MB without batching
Nadav Amit <namit(a)vmware.com>
vmw_balloon: fix inflation of 64-bit GFNs
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
eventpoll.h: wrap casts in () properly
Chanwoo Choi <cw00.choi(a)samsung.com>
extcon: Release locking when sending the notification of connector state
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix return value for ad952x_store()
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix displayed phase
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
iio: sca3000: Fix missing return in switch
Dexuan Cui <decui(a)microsoft.com>
Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind()
Dexuan Cui <decui(a)microsoft.com>
Drivers: hv: vmbus: Fix the offer_in_progress in vmbus_process_offer()
Tycho Andersen <tycho(a)tycho.ws>
uart: fix race between uart_put_char() and uart_shutdown()
Mikulas Patocka <mpatocka(a)redhat.com>
dm writecache: fix a crash due to reading past end of dirty_bitmap
Mikulas Patocka <mpatocka(a)redhat.com>
dm crypt: don't decrease device limits
Ilya Dryomov <idryomov(a)gmail.com>
dm cache metadata: set dirty on all cache blocks after a crash
Mike Snitzer <snitzer(a)redhat.com>
dm cache metadata: save in-core policy_hint_size to on-disk superblock
Hou Tao <houtao1(a)huawei.com>
dm thin: stop no_space_timeout worker when switching to write-mode
Mikulas Patocka <mpatocka(a)redhat.com>
dm integrity: change 'suspending' variable from bool to int
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/client.c: version pointer uninitialized
jiangyiwen <jiangyiwen(a)huawei.com>
9p/virtio: fix off-by-one error in sg list bounds check
piaojun <piaojun(a)huawei.com>
fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
Tomas Bortoli <tomasbortoli(a)gmail.com>
9p: fix multiple NULL-pointer-dereferences
Bart Van Assche <bart.vanassche(a)wdc.com>
RDMA/rxe: Set wqe->status correctly if an unexpected response is received
Bart Van Assche <bart.vanassche(a)wdc.com>
ib_srpt: Fix a use-after-free in __srpt_close_all_ch()
Bart Van Assche <bart.vanassche(a)wdc.com>
ib_srpt: Fix a use-after-free in srpt_close_ch()
Leon Romanovsky <leon(a)kernel.org>
RDMA/mlx5: Fix shift overflow in mlx5_ib_create_wq
Jason Gunthorpe <jgg(a)ziepe.ca>
overflow.h: Add arithmetic shift helper
Bart Van Assche <bart.vanassche(a)wdc.com>
IB/srpt: Support HCAs with more than two ports
Bart Van Assche <bart.vanassche(a)wdc.com>
IB/srpt: Fix srpt_cm_req_recv() error path (2/2)
Bart Van Assche <bart.vanassche(a)wdc.com>
IB/srpt: Fix srpt_cm_req_recv() error path (1/2)
Jason Gunthorpe <jgg(a)ziepe.ca>
IB/mlx5: Fix leaking stack memory to userspace
Parav Pandit <parav(a)mellanox.com>
IB/mlx5: Honor cnt_set_id_valid flag instead of set_id
Frederic Barrat <fbarrat(a)linux.ibm.com>
ocxl: Fix page fault handler in case of fault on dying process
Vaibhav Jain <vaibhav(a)linux.ibm.com>
cxl: Fix wrong comparison in cxl_adapter_context_get()
Benjamin Herrenschmidt <benh(a)kernel.crashing.org>
powerpc/powernv/pci: Work around races in PCI bridge enabling
Luke Dashjr <luke(a)dashjr.org>
powerpc64/ftrace: Include ftrace.h needed for enable/disable calls
Christophe Leroy <christophe.leroy(a)c-s.fr>
powerpc/nohash: fix pte_access_permitted()
Ram Pai <linuxram(a)us.ibm.com>
powerpc/pkeys: Preallocate execute-only key
Ram Pai <linuxram(a)us.ibm.com>
powerpc/pkeys: Fix calculation of total pkeys.
Ram Pai <linuxram(a)us.ibm.com>
powerpc/pkeys: Save the pkey registers before fork
Ram Pai <linuxram(a)us.ibm.com>
powerpc/pkeys: key allocation/deallocation must not change pkey registers
Ram Pai <linuxram(a)us.ibm.com>
powerpc/pkeys: Deny read/write/execute by default
Ram Pai <linuxram(a)us.ibm.com>
powerpc/pkeys: Give all threads control of their key permissions
Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
Nicholas Piggin <npiggin(a)gmail.com>
powerpc/64s: Fix page table fragment refcount race vs speculative references
Hari Bathini <hbathini(a)linux.ibm.com>
powerpc/fadump: handle crash memory ranges array index overflow
Yannik Sembritzki <yannik(a)sembritzki.me>
Fix kexec forbidding kernels signed with keys in the secondary keyring to boot
Yannik Sembritzki <yannik(a)sembritzki.me>
Replace magic for trusting the secondary keyring with #define
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
mailbox: xgene-slimpro: Fix potential NULL pointer dereference
Javier Martinez Canillas <javierm(a)redhat.com>
media: Revert "[media] tvp5150: fix pad format frame height"
Daniel Mack <daniel(a)zonque.org>
libertas: fix suspend and resume for SDIO connected cards
Michel Dänzer <michel.daenzer(a)amd.com>
dma-buf: Move BUG_ON from _add_shared_fence to _add_shared_inplace
John Johansen <john.johansen(a)canonical.com>
apparmor: fix bad debug check in apparmor_secid_to_secctx()
Bart Van Assche <bart.vanassche(a)wdc.com>
block: Ensure that a request queue is dissociated from the cgroup controller
Bart Van Assche <bart.vanassche(a)wdc.com>
block: Introduce blk_exit_queue()
Bart Van Assche <bart.vanassche(a)wdc.com>
blkcg: Introduce blkg_root_lookup()
Ming Lei <ming.lei(a)redhat.com>
block: really disable runtime-pm for blk-mq
xiao jin <jin.xiao(a)intel.com>
block: blk_init_allocated_queue() set q->fq as NULL in the fail case
Mikulas Patocka <mpatocka(a)redhat.com>
block: fix infinite loop if the device loses discard capability
Markus Stockhausen <stockhausen(a)collogia.de>
readahead: stricter check for bdi io_pages
Sergei Shtylyov <sergei.shtylyov(a)cogentembedded.com>
mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS
Sergei Shtylyov <sergei.shtylyov(a)cogentembedded.com>
mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts
Adrian Hunter <adrian.hunter(a)intel.com>
mmc: block: Fix unsupported parallel dispatch of requests
Janek Kotas <jank(a)cadence.com>
spi: cadence: Change usleep_range() to udelay(), for atomic context
Krzysztof Kozlowski <krzk(a)kernel.org>
spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe
Mika Westerberg <mika.westerberg(a)linux.intel.com>
spi: pxa2xx: Add support for Intel Ice Lake
Bartosz Golaszewski <bgolaszewski(a)baylibre.com>
spi: davinci: fix a NULL pointer dereference
Chirantan Ekbote <chirantan(a)chromium.org>
9p/net: Fix zero-copy path in the 9p virtio transport
Alexander Aring <aring(a)mojatatu.com>
net: mac802154: tx: expand tailroom if necessary
Alexander Aring <aring(a)mojatatu.com>
net: 6lowpan: fix reserved space for single frames
Boqun Feng <boqun.feng(a)gmail.com>
rcu: Make expedited GPs handle CPU 0 being offline
-------------
Diffstat:
Makefile | 4 +-
arch/alpha/kernel/osf_sys.c | 51 +++++----
arch/arm/boot/dts/am571x-idk.dts | 4 -
arch/arm/boot/dts/am572x-idk-common.dtsi | 4 -
arch/arm/boot/dts/am57xx-idk-common.dtsi | 7 +-
arch/arm/boot/dts/tegra30-cardhu.dtsi | 1 +
arch/arm64/Kconfig | 1 -
arch/arm64/crypto/sm4-ce-glue.c | 2 +-
arch/powerpc/include/asm/fadump.h | 3 -
arch/powerpc/include/asm/nohash/pgtable.h | 9 +-
arch/powerpc/include/asm/pkeys.h | 11 --
arch/powerpc/kernel/fadump.c | 91 +++++++++++++---
arch/powerpc/kernel/process.c | 1 +
arch/powerpc/kvm/book3s_hv.c | 1 +
arch/powerpc/mm/mmu_context_book3s64.c | 8 +-
arch/powerpc/mm/mmu_context_iommu.c | 17 +--
arch/powerpc/mm/pgtable-book3s64.c | 17 +--
arch/powerpc/mm/pkeys.c | 134 ++++++++----------------
arch/powerpc/platforms/powernv/pci-ioda.c | 37 +++++++
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/sparc/kernel/sys_sparc_32.c | 22 ++--
arch/sparc/kernel/sys_sparc_64.c | 20 ++--
arch/x86/crypto/aesni-intel_asm.S | 66 ++++++------
arch/x86/kernel/kexec-bzimage64.c | 2 +-
arch/x86/kvm/vmx.c | 26 +++--
arch/xtensa/include/asm/cacheasm.h | 69 +++++++-----
block/bfq-cgroup.c | 3 +-
block/blk-core.c | 61 ++++++-----
block/blk-lib.c | 10 ++
block/blk-sysfs.c | 15 +++
block/blk.h | 1 +
certs/system_keyring.c | 3 +-
crypto/asymmetric_keys/pkcs7_key_type.c | 2 +-
drivers/acpi/acpica/hwsleep.c | 11 +-
drivers/acpi/acpica/psloop.c | 17 +--
drivers/block/zram/zram_drv.c | 7 +-
drivers/cpufreq/cpufreq_governor.c | 12 ++-
drivers/cpuidle/governors/menu.c | 47 ++++++---
drivers/crypto/caam/caamalg_qi.c | 6 +-
drivers/crypto/caam/caampkc.c | 20 ++--
drivers/crypto/caam/jr.c | 3 +-
drivers/crypto/vmx/aes_cbc.c | 30 +++---
drivers/crypto/vmx/aes_xts.c | 21 ++--
drivers/dma-buf/reservation.c | 6 +-
drivers/extcon/extcon.c | 3 +-
drivers/hv/channel.c | 40 ++++---
drivers/hv/channel_mgmt.c | 10 +-
drivers/i2c/busses/i2c-designware-master.c | 1 -
drivers/i2c/busses/i2c-designware-platdrv.c | 7 +-
drivers/iio/accel/sca3000.c | 1 +
drivers/iio/frequency/ad9523.c | 4 +-
drivers/infiniband/hw/mlx5/main.c | 2 +-
drivers/infiniband/hw/mlx5/qp.c | 6 +-
drivers/infiniband/sw/rxe/rxe_comp.c | 1 +
drivers/infiniband/ulp/srpt/ib_srpt.c | 34 ++++--
drivers/infiniband/ulp/srpt/ib_srpt.h | 4 +-
drivers/iommu/dmar.c | 6 +-
drivers/iommu/intel-iommu.c | 18 +++-
drivers/iommu/ipmmu-vmsa.c | 7 ++
drivers/mailbox/mailbox-xgene-slimpro.c | 6 +-
drivers/md/bcache/writeback.c | 4 +-
drivers/md/dm-cache-metadata.c | 13 ++-
drivers/md/dm-crypt.c | 10 +-
drivers/md/dm-integrity.c | 6 +-
drivers/md/dm-thin.c | 2 +
drivers/md/dm-writecache.c | 2 +-
drivers/media/i2c/tvp5150.c | 2 +-
drivers/mfd/hi655x-pmic.c | 2 +-
drivers/misc/cxl/main.c | 2 +-
drivers/misc/ocxl/link.c | 24 +++--
drivers/misc/vmw_balloon.c | 67 +++++++-----
drivers/mmc/core/queue.c | 12 ++-
drivers/mmc/core/queue.h | 1 +
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 10 +-
drivers/net/wireless/marvell/libertas/dev.h | 1 +
drivers/net/wireless/marvell/libertas/if_sdio.c | 30 ++++--
drivers/nvdimm/bus.c | 4 +-
drivers/nvdimm/dimm_devs.c | 31 ++++++
drivers/nvdimm/namespace_devs.c | 6 +-
drivers/nvdimm/nd-core.h | 8 ++
drivers/nvdimm/region_devs.c | 24 +++++
drivers/pwm/pwm-omap-dmtimer.c | 5 +-
drivers/pwm/pwm-tiehrpwm.c | 14 +--
drivers/rtc/rtc-omap.c | 18 ++--
drivers/spi/spi-cadence.c | 2 +-
drivers/spi/spi-davinci.c | 2 +-
drivers/spi/spi-fsl-dspi.c | 24 ++---
drivers/spi/spi-pxa2xx.c | 4 +
drivers/tty/serial/serial_core.c | 17 ++-
drivers/video/fbdev/core/fbmem.c | 38 +++++--
drivers/video/fbdev/udlfb.c | 105 ++++++++++---------
fs/9p/xattr.c | 6 +-
fs/lockd/clntlock.c | 2 +-
fs/lockd/clntproc.c | 2 +-
fs/lockd/svclock.c | 16 +--
fs/lockd/svcsubs.c | 4 +-
fs/nfs/blocklayout/dev.c | 2 +-
fs/nfs/callback_proc.c | 14 ++-
fs/nfs/nfs4proc.c | 9 +-
fs/nfs/pnfs_nfs.c | 16 ++-
fs/nfsd/nfs4state.c | 2 +-
fs/overlayfs/readdir.c | 19 +++-
fs/quota/quota.c | 2 +
fs/ubifs/dir.c | 5 +-
fs/ubifs/journal.c | 21 +++-
fs/ubifs/lprops.c | 8 +-
fs/ubifs/xattr.c | 24 +++++
fs/udf/super.c | 31 +++---
fs/xattr.c | 2 +-
include/linux/blk-cgroup.h | 18 ++++
include/linux/hyperv.h | 2 +
include/linux/intel-iommu.h | 8 +-
include/linux/lockd/lockd.h | 4 +-
include/linux/mm_types.h | 5 +-
include/linux/overflow.h | 31 ++++++
include/linux/sunrpc/clnt.h | 1 +
include/linux/verification.h | 6 ++
include/uapi/linux/eventpoll.h | 8 +-
include/video/udlfb.h | 5 +-
kernel/livepatch/core.c | 6 ++
kernel/memremap.c | 1 -
kernel/power/Kconfig | 1 +
kernel/printk/printk_safe.c | 4 +-
kernel/rcu/tree_exp.h | 9 +-
kernel/sched/idle.c | 2 +-
kernel/sys.c | 95 ++++++++---------
kernel/trace/blktrace.c | 4 +
kernel/trace/trace.c | 4 +-
kernel/trace/trace_uprobe.c | 2 +-
kernel/user_namespace.c | 24 ++---
kernel/utsname_sysctl.c | 41 +++++---
mm/hmm.c | 2 +
mm/memory.c | 9 --
mm/readahead.c | 12 ++-
net/9p/client.c | 2 +-
net/9p/trans_fd.c | 7 +-
net/9p/trans_rdma.c | 3 +
net/9p/trans_virtio.c | 13 ++-
net/9p/trans_xen.c | 3 +
net/ieee802154/6lowpan/tx.c | 21 +++-
net/mac802154/tx.c | 15 ++-
net/sunrpc/clnt.c | 28 +++--
scripts/kconfig/Makefile | 5 +-
security/apparmor/secid.c | 1 -
security/commoncap.c | 2 +-
sound/ac97/bus.c | 4 +-
sound/ac97/snd_ac97_compat.c | 19 +++-
tools/perf/util/auxtrace.c | 3 +
148 files changed, 1374 insertions(+), 766 deletions(-)
This is the start of the stable review cycle for the 4.14.69 release.
There are 89 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun Sep 9 21:08:28 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.69-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.14.69-rc1
James Morse <james.morse(a)arm.com>
arm64: mm: always enable CONFIG_HOLES_IN_ZONE
Jeremy Cline <jcline(a)redhat.com>
fs/quota: Fix spectre gadget in do_quotactl
Horia Geantă <horia.geanta(a)nxp.com>
crypto: caam/qi - fix error path in xts setkey
Horia Geantă <horia.geanta(a)nxp.com>
crypto: caam/jr - fix descriptor DMA unmapping
Horia Geantă <horia.geanta(a)nxp.com>
crypto: caam - fix DMA mapping direction for RSA forms 2 & 3
Ondrej Mosnacek <omosnace(a)redhat.com>
crypto: vmx - Fix sleep-in-atomic bugs
Adrian Hunter <adrian.hunter(a)intel.com>
perf auxtrace: Fix queue resize
Eddie.Horng <eddie.horng(a)mediatek.com>
cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias()
Shan Hai <shan.hai(a)oracle.com>
bcache: release dc->writeback_lock properly in bch_writeback_thread()
Vishal Verma <vishal.l.verma(a)intel.com>
libnvdimm: fix ars_status output length calculation
Christian Brauner <christian(a)brauner.io>
getxattr: use correct xattr length
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: set optimal write delay
Mikulas Patocka <mpatocka(a)redhat.com>
fb: fix lost console when the user unplugs a USB adapter
Vignesh R <vigneshr(a)ti.com>
pwm: tiehrpwm: Fix disabling of output of PWMs
Vignesh R <vigneshr(a)ti.com>
pwm: tiehrpwm: Don't use emulation mode bits to control PWM output
Richard Weinberger <richard(a)nod.at>
ubifs: Fix synced_i_size calculation for xattr inodes
Richard Weinberger <richard(a)nod.at>
ubifs: xattr: Don't operate on deleted inodes
Richard Weinberger <richard(a)nod.at>
ubifs: Check data node size before truncate
Richard Weinberger <richard(a)nod.at>
Revert "UBIFS: Fix potential integer overflow in allocation"
Richard Weinberger <richard(a)nod.at>
ubifs: Fix memory leak in lprobs self-check
Jann Horn <jannh(a)google.com>
userns: move user access out of the mutex
Jann Horn <jannh(a)google.com>
sys: don't hold uts_sem while accessing userspace memory
Jacob Pan <jacob.jun.pan(a)linux.intel.com>
iommu/vt-d: Fix dev iotlb pfsid use
Jacob Pan <jacob.jun.pan(a)linux.intel.com>
iommu/vt-d: Add definitions for PFSID
Peter Zijlstra <peterz(a)infradead.org>
mm/tlb: Remove tlb_remove_table() non-concurrent condition
Jon Hunter <jonathanh(a)nvidia.com>
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Trond Myklebust <trondmy(a)gmail.com>
NFSv4: Fix a sleep in atomic context in nfs4_callback_sequence()
Trond Myklebust <trondmy(a)gmail.com>
NFSv4: Fix locking in pnfs_generic_recover_commit_reqs
Bill Baker <Bill.Baker(a)Oracle.com>
NFSv4 client live hangs after live data migration recovery
Dan Carpenter <dan.carpenter(a)oracle.com>
pnfs/blocklayout: off by one in bl_map_stripe()
Maciej S. Szmigiero <mail(a)maciej.szmigiero.name>
block, bfq: return nbytes and not zero from struct cftype .write() method
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: increase ranges in ___invalidate_{i,d}cache_all
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: limit offsets in __loop_cache_{all,page}
Paul Mackerras <paulus(a)ozlabs.org>
KVM: PPC: Book3S: Fix guest DMA when guest partially backed by THP pages
Paolo Bonzini <pbonzini(a)redhat.com>
KVM: VMX: fixes for vmentry_l1d_flush module parameter
zhangyi (F) <yi.zhang(a)huawei.com>
PM / sleep: wakeup: Fix build error caused by missing SRCU support
Henry Willard <henry.willard(a)oracle.com>
cpufreq: governor: Avoid accessing invalid governor_data
Peter Kalauskas <peskal(a)google.com>
drivers/block/zram/zram_drv.c: fix bug storing backing_dev
Amir Goldstein <amir73il(a)gmail.com>
ovl: fix wrong use of impure dir cache in ovl_iterate()
Rafael David Tinoco <rafael.tinoco(a)linaro.org>
mfd: hi655x: Fix regmap area declared size for hi655x
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
uprobes: Use synchronize_rcu() not synchronize_sched()
Kamalesh Babulal <kamalesh(a)linux.vnet.ibm.com>
livepatch: Validate module/old func name length
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
printk/tracing: Do not trace printk_nmi_enter()
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing/blktrace: Fix to allow setting same value
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Do not call start/stop() functions when tracing_on does not change
Johan Hovold <johan(a)kernel.org>
rtc: omap: fix potential crash on power off
Nadav Amit <namit(a)vmware.com>
vmw_balloon: fix VMCI use when balloon built into kernel
Nadav Amit <namit(a)vmware.com>
vmw_balloon: VMCI_DOORBELL_SET does not check status
Nadav Amit <namit(a)vmware.com>
vmw_balloon: do not use 2MB without batching
Nadav Amit <namit(a)vmware.com>
vmw_balloon: fix inflation of 64-bit GFNs
Chanwoo Choi <cw00.choi(a)samsung.com>
extcon: Release locking when sending the notification of connector state
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix return value for ad952x_store()
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix displayed phase
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
iio: sca3000: Fix missing return in switch
Dexuan Cui <decui(a)microsoft.com>
Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind()
Tycho Andersen <tycho(a)tycho.ws>
uart: fix race between uart_put_char() and uart_shutdown()
Mikulas Patocka <mpatocka(a)redhat.com>
dm crypt: don't decrease device limits
Ilya Dryomov <idryomov(a)gmail.com>
dm cache metadata: set dirty on all cache blocks after a crash
Mike Snitzer <snitzer(a)redhat.com>
dm cache metadata: save in-core policy_hint_size to on-disk superblock
Hou Tao <houtao1(a)huawei.com>
dm thin: stop no_space_timeout worker when switching to write-mode
Mikulas Patocka <mpatocka(a)redhat.com>
dm integrity: change 'suspending' variable from bool to int
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/client.c: version pointer uninitialized
jiangyiwen <jiangyiwen(a)huawei.com>
9p/virtio: fix off-by-one error in sg list bounds check
piaojun <piaojun(a)huawei.com>
fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
Tomas Bortoli <tomasbortoli(a)gmail.com>
9p: fix multiple NULL-pointer-dereferences
Bart Van Assche <bart.vanassche(a)wdc.com>
RDMA/rxe: Set wqe->status correctly if an unexpected response is received
Bart Van Assche <bart.vanassche(a)wdc.com>
ib_srpt: Fix a use-after-free in srpt_close_ch()
Vaibhav Jain <vaibhav(a)linux.ibm.com>
cxl: Fix wrong comparison in cxl_adapter_context_get()
Benjamin Herrenschmidt <benh(a)kernel.crashing.org>
powerpc/powernv/pci: Work around races in PCI bridge enabling
Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
Hari Bathini <hbathini(a)linux.ibm.com>
powerpc/fadump: handle crash memory ranges array index overflow
Yannik Sembritzki <yannik(a)sembritzki.me>
Fix kexec forbidding kernels signed with keys in the secondary keyring to boot
Yannik Sembritzki <yannik(a)sembritzki.me>
Replace magic for trusting the secondary keyring with #define
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
mailbox: xgene-slimpro: Fix potential NULL pointer dereference
Javier Martinez Canillas <javierm(a)redhat.com>
media: Revert "[media] tvp5150: fix pad format frame height"
Daniel Mack <daniel(a)zonque.org>
libertas: fix suspend and resume for SDIO connected cards
Matthew Auld <matthew.auld(a)intel.com>
drm/i915/userptr: reject zero user_size
Ming Lei <ming.lei(a)redhat.com>
block: really disable runtime-pm for blk-mq
xiao jin <jin.xiao(a)intel.com>
block: blk_init_allocated_queue() set q->fq as NULL in the fail case
Markus Stockhausen <stockhausen(a)collogia.de>
readahead: stricter check for bdi io_pages
Sergei Shtylyov <sergei.shtylyov(a)cogentembedded.com>
mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS
Janek Kotas <jank(a)cadence.com>
spi: cadence: Change usleep_range() to udelay(), for atomic context
Krzysztof Kozlowski <krzk(a)kernel.org>
spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe
Mika Westerberg <mika.westerberg(a)linux.intel.com>
spi: pxa2xx: Add support for Intel Ice Lake
Bartosz Golaszewski <bgolaszewski(a)baylibre.com>
spi: davinci: fix a NULL pointer dereference
Chirantan Ekbote <chirantan(a)chromium.org>
9p/net: Fix zero-copy path in the 9p virtio transport
Alexander Aring <aring(a)mojatatu.com>
net: mac802154: tx: expand tailroom if necessary
Alexander Aring <aring(a)mojatatu.com>
net: 6lowpan: fix reserved space for single frames
-------------
Diffstat:
Makefile | 4 +-
arch/alpha/kernel/osf_sys.c | 51 +++++++------
arch/arm/boot/dts/tegra30-cardhu.dtsi | 1 +
arch/arm64/Kconfig | 1 -
arch/powerpc/include/asm/fadump.h | 3 -
arch/powerpc/kernel/fadump.c | 91 +++++++++++++++++++----
arch/powerpc/mm/mmu_context_iommu.c | 17 +++--
arch/powerpc/platforms/powernv/pci-ioda.c | 37 ++++++++++
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/sparc/kernel/sys_sparc_32.c | 22 +++---
arch/sparc/kernel/sys_sparc_64.c | 20 +++---
arch/x86/kernel/kexec-bzimage64.c | 2 +-
arch/x86/kvm/vmx.c | 26 ++++---
arch/xtensa/include/asm/cacheasm.h | 69 +++++++++++-------
block/bfq-cgroup.c | 3 +-
block/blk-core.c | 7 +-
certs/system_keyring.c | 3 +-
crypto/asymmetric_keys/pkcs7_key_type.c | 2 +-
drivers/block/zram/zram_drv.c | 7 +-
drivers/cpufreq/cpufreq_governor.c | 12 +++-
drivers/crypto/caam/caamalg_qi.c | 6 +-
drivers/crypto/caam/caampkc.c | 20 +++---
drivers/crypto/caam/jr.c | 3 +-
drivers/crypto/vmx/aes_cbc.c | 30 ++++----
drivers/crypto/vmx/aes_xts.c | 21 ++++--
drivers/extcon/extcon.c | 3 +-
drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +
drivers/hv/channel.c | 40 ++++++-----
drivers/hv/channel_mgmt.c | 6 ++
drivers/iio/accel/sca3000.c | 1 +
drivers/iio/frequency/ad9523.c | 4 +-
drivers/infiniband/sw/rxe/rxe_comp.c | 1 +
drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +-
drivers/iommu/dmar.c | 6 +-
drivers/iommu/intel-iommu.c | 18 ++++-
drivers/mailbox/mailbox-xgene-slimpro.c | 6 +-
drivers/md/bcache/writeback.c | 4 +-
drivers/md/dm-cache-metadata.c | 13 ++--
drivers/md/dm-crypt.c | 10 +--
drivers/md/dm-integrity.c | 6 +-
drivers/md/dm-thin.c | 2 +
drivers/media/i2c/tvp5150.c | 2 +-
drivers/mfd/hi655x-pmic.c | 2 +-
drivers/misc/cxl/main.c | 2 +-
drivers/misc/vmw_balloon.c | 67 ++++++++++-------
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 2 +-
drivers/net/wireless/marvell/libertas/dev.h | 1 +
drivers/net/wireless/marvell/libertas/if_sdio.c | 30 ++++++--
drivers/nvdimm/bus.c | 4 +-
drivers/pwm/pwm-tiehrpwm.c | 14 +---
drivers/rtc/rtc-omap.c | 14 ++--
drivers/spi/spi-cadence.c | 2 +-
drivers/spi/spi-davinci.c | 2 +-
drivers/spi/spi-fsl-dspi.c | 24 +++----
drivers/spi/spi-pxa2xx.c | 4 ++
drivers/tty/serial/serial_core.c | 17 +++--
drivers/video/fbdev/core/fbmem.c | 38 ++++++++--
fs/9p/xattr.c | 6 +-
fs/nfs/blocklayout/dev.c | 2 +-
fs/nfs/callback_proc.c | 14 ++--
fs/nfs/nfs4proc.c | 9 ++-
fs/nfs/pnfs_nfs.c | 16 ++---
fs/overlayfs/readdir.c | 19 ++++-
fs/quota/quota.c | 2 +
fs/ubifs/journal.c | 21 ++++--
fs/ubifs/lprops.c | 8 +--
fs/ubifs/xattr.c | 24 +++++++
fs/xattr.c | 2 +-
include/linux/hyperv.h | 2 +
include/linux/intel-iommu.h | 8 ++-
include/linux/sunrpc/clnt.h | 1 +
include/linux/verification.h | 6 ++
include/video/udlfb.h | 2 +-
kernel/livepatch/core.c | 6 ++
kernel/power/Kconfig | 1 +
kernel/printk/printk_safe.c | 4 +-
kernel/sys.c | 95 ++++++++++++-------------
kernel/trace/blktrace.c | 4 ++
kernel/trace/trace.c | 4 +-
kernel/trace/trace_uprobe.c | 2 +-
kernel/user_namespace.c | 24 +++----
kernel/utsname_sysctl.c | 41 ++++++-----
mm/memory.c | 9 ---
mm/readahead.c | 12 +++-
net/9p/client.c | 2 +-
net/9p/trans_fd.c | 7 +-
net/9p/trans_rdma.c | 3 +
net/9p/trans_virtio.c | 13 +++-
net/9p/trans_xen.c | 3 +
net/ieee802154/6lowpan/tx.c | 21 +++++-
net/mac802154/tx.c | 15 +++-
net/sunrpc/clnt.c | 28 +++++---
security/commoncap.c | 2 +-
tools/perf/util/auxtrace.c | 3 +
94 files changed, 831 insertions(+), 421 deletions(-)
The patch below was submitted to be applied to the 4.18-stable tree.
I fail to see how this patch meets the stable kernel rules as found at
Documentation/process/stable-kernel-rules.rst.
I could be totally wrong, and if so, please respond to
<stable(a)vger.kernel.org> and let me know why this patch should be
applied. Otherwise, it is now dropped from my patch queues, never to be
seen again.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From d806afa495e2e2a1a726e26c5e44f27818e804c1 Mon Sep 17 00:00:00 2001
From: Yi Wang <wang.yi59(a)zte.com.cn>
Date: Thu, 16 Aug 2018 13:42:39 +0800
Subject: [PATCH] x86/kvm/vmx: Fix coding style in vmx_setup_l1d_flush()
Substitute spaces with tab. No functional changes.
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
Reviewed-by: Jiang Biao <jiang.biao2(a)zte.com.cn>
Message-Id: <1534398159-48509-1-git-send-email-wang.yi59(a)zte.com.cn>
Cc: stable(a)vger.kernel.org # L1TF
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 1519f030fd73..31e90e83fdd6 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -219,15 +219,15 @@ static int vmx_setup_l1d_flush(enum vmx_l1d_flush_state l1tf)
return 0;
}
- if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES)) {
- u64 msr;
-
- rdmsrl(MSR_IA32_ARCH_CAPABILITIES, msr);
- if (msr & ARCH_CAP_SKIP_VMENTRY_L1DFLUSH) {
- l1tf_vmx_mitigation = VMENTER_L1D_FLUSH_NOT_REQUIRED;
- return 0;
- }
- }
+ if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES)) {
+ u64 msr;
+
+ rdmsrl(MSR_IA32_ARCH_CAPABILITIES, msr);
+ if (msr & ARCH_CAP_SKIP_VMENTRY_L1DFLUSH) {
+ l1tf_vmx_mitigation = VMENTER_L1D_FLUSH_NOT_REQUIRED;
+ return 0;
+ }
+ }
/* If set to auto use the default l1tf mitigation method */
if (l1tf == VMENTER_L1D_FLUSH_AUTO) {
This is the start of the stable review cycle for the 4.9.126 release.
There are 63 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun Sep 9 21:09:58 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.126-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.126-rc1
Jeremy Cline <jcline(a)redhat.com>
fs/quota: Fix spectre gadget in do_quotactl
Horia Geantă <horia.geanta(a)nxp.com>
crypto: caam/jr - fix descriptor DMA unmapping
Ondrej Mosnacek <omosnace(a)redhat.com>
crypto: vmx - Fix sleep-in-atomic bugs
Adrian Hunter <adrian.hunter(a)intel.com>
perf auxtrace: Fix queue resize
Shan Hai <shan.hai(a)oracle.com>
bcache: release dc->writeback_lock properly in bch_writeback_thread()
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
printk/tracing: Do not trace printk_nmi_enter()
Vishal Verma <vishal.l.verma(a)intel.com>
libnvdimm: fix ars_status output length calculation
Christian Brauner <christian(a)brauner.io>
getxattr: use correct xattr length
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: set optimal write delay
Mikulas Patocka <mpatocka(a)redhat.com>
fb: fix lost console when the user unplugs a USB adapter
Vignesh R <vigneshr(a)ti.com>
pwm: tiehrpwm: Fix disabling of output of PWMs
Richard Weinberger <richard(a)nod.at>
ubifs: Fix synced_i_size calculation for xattr inodes
Richard Weinberger <richard(a)nod.at>
ubifs: Check data node size before truncate
Richard Weinberger <richard(a)nod.at>
Revert "UBIFS: Fix potential integer overflow in allocation"
Richard Weinberger <richard(a)nod.at>
ubifs: Fix memory leak in lprobs self-check
Jann Horn <jannh(a)google.com>
userns: move user access out of the mutex
Jann Horn <jannh(a)google.com>
sys: don't hold uts_sem while accessing userspace memory
Al Viro <viro(a)zeniv.linux.org.uk>
osf_getdomainname(): use copy_to_user()
Jacob Pan <jacob.jun.pan(a)linux.intel.com>
iommu/vt-d: Fix dev iotlb pfsid use
Jacob Pan <jacob.jun.pan(a)linux.intel.com>
iommu/vt-d: Add definitions for PFSID
Peter Zijlstra <peterz(a)infradead.org>
mm/tlb: Remove tlb_remove_table() non-concurrent condition
Yannik Sembritzki <yannik(a)sembritzki.me>
Fix kexec forbidding kernels signed with keys in the secondary keyring to boot
Yannik Sembritzki <yannik(a)sembritzki.me>
Replace magic for trusting the secondary keyring with #define
Jon Hunter <jonathanh(a)nvidia.com>
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Bill Baker <Bill.Baker(a)Oracle.com>
NFSv4 client live hangs after live data migration recovery
Dan Carpenter <dan.carpenter(a)oracle.com>
pnfs/blocklayout: off by one in bl_map_stripe()
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: increase ranges in ___invalidate_{i,d}cache_all
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: limit offsets in __loop_cache_{all,page}
Paolo Bonzini <pbonzini(a)redhat.com>
KVM: VMX: fixes for vmentry_l1d_flush module parameter
zhangyi (F) <yi.zhang(a)huawei.com>
PM / sleep: wakeup: Fix build error caused by missing SRCU support
Tomas Bortoli <tomasbortoli(a)gmail.com>
9p: fix multiple NULL-pointer-dereferences
Rafael David Tinoco <rafael.tinoco(a)linaro.org>
mfd: hi655x: Fix regmap area declared size for hi655x
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
uprobes: Use synchronize_rcu() not synchronize_sched()
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing/blktrace: Fix to allow setting same value
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Do not call start/stop() functions when tracing_on does not change
Johan Hovold <johan(a)kernel.org>
rtc: omap: fix potential crash on power off
Nadav Amit <namit(a)vmware.com>
vmw_balloon: fix VMCI use when balloon built into kernel
Nadav Amit <namit(a)vmware.com>
vmw_balloon: VMCI_DOORBELL_SET does not check status
Nadav Amit <namit(a)vmware.com>
vmw_balloon: do not use 2MB without batching
Nadav Amit <namit(a)vmware.com>
vmw_balloon: fix inflation of 64-bit GFNs
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix return value for ad952x_store()
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix displayed phase
Tycho Andersen <tycho(a)tycho.ws>
uart: fix race between uart_put_char() and uart_shutdown()
Mike Snitzer <snitzer(a)redhat.com>
dm cache metadata: save in-core policy_hint_size to on-disk superblock
Hou Tao <houtao1(a)huawei.com>
dm thin: stop no_space_timeout worker when switching to write-mode
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/client.c: version pointer uninitialized
jiangyiwen <jiangyiwen(a)huawei.com>
9p/virtio: fix off-by-one error in sg list bounds check
piaojun <piaojun(a)huawei.com>
fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
Bart Van Assche <bart.vanassche(a)wdc.com>
RDMA/rxe: Set wqe->status correctly if an unexpected response is received
Bart Van Assche <bart.vanassche(a)wdc.com>
ib_srpt: Fix a use-after-free in srpt_close_ch()
Vaibhav Jain <vaibhav(a)linux.ibm.com>
cxl: Fix wrong comparison in cxl_adapter_context_get()
Benjamin Herrenschmidt <benh(a)kernel.crashing.org>
powerpc/powernv/pci: Work around races in PCI bridge enabling
Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
Hari Bathini <hbathini(a)linux.ibm.com>
powerpc/fadump: handle crash memory ranges array index overflow
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
mailbox: xgene-slimpro: Fix potential NULL pointer dereference
Daniel Mack <daniel(a)zonque.org>
libertas: fix suspend and resume for SDIO connected cards
Matthew Auld <matthew.auld(a)intel.com>
drm/i915/userptr: reject zero user_size
Krzysztof Kozlowski <krzk(a)kernel.org>
spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe
Bartosz Golaszewski <bgolaszewski(a)baylibre.com>
spi: davinci: fix a NULL pointer dereference
Chirantan Ekbote <chirantan(a)chromium.org>
9p/net: Fix zero-copy path in the 9p virtio transport
Alexander Aring <aring(a)mojatatu.com>
net: mac802154: tx: expand tailroom if necessary
Alexander Aring <aring(a)mojatatu.com>
net: 6lowpan: fix reserved space for single frames
-------------
Diffstat:
Makefile | 4 +-
arch/alpha/kernel/osf_sys.c | 64 ++++++++---------
arch/arm/boot/dts/tegra30-cardhu.dtsi | 1 +
arch/powerpc/include/asm/fadump.h | 3 -
arch/powerpc/kernel/fadump.c | 91 +++++++++++++++++++----
arch/powerpc/platforms/powernv/pci-ioda.c | 37 ++++++++++
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/sparc/kernel/sys_sparc_32.c | 22 +++---
arch/sparc/kernel/sys_sparc_64.c | 20 +++---
arch/x86/kernel/kexec-bzimage64.c | 2 +-
arch/x86/kvm/vmx.c | 26 ++++---
arch/xtensa/include/asm/cacheasm.h | 69 +++++++++++-------
certs/system_keyring.c | 3 +-
crypto/asymmetric_keys/pkcs7_key_type.c | 2 +-
drivers/crypto/caam/jr.c | 3 +-
drivers/crypto/vmx/aes_cbc.c | 30 ++++----
drivers/crypto/vmx/aes_xts.c | 21 ++++--
drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +
drivers/iio/frequency/ad9523.c | 4 +-
drivers/infiniband/sw/rxe/rxe_comp.c | 1 +
drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +-
drivers/iommu/dmar.c | 6 +-
drivers/iommu/intel-iommu.c | 18 ++++-
drivers/mailbox/mailbox-xgene-slimpro.c | 6 +-
drivers/md/bcache/writeback.c | 4 +-
drivers/md/dm-cache-metadata.c | 3 +-
drivers/md/dm-thin.c | 2 +
drivers/mfd/hi655x-pmic.c | 2 +-
drivers/misc/cxl/main.c | 2 +-
drivers/misc/vmw_balloon.c | 67 ++++++++++-------
drivers/net/wireless/marvell/libertas/dev.h | 1 +
drivers/net/wireless/marvell/libertas/if_sdio.c | 30 ++++++--
drivers/nvdimm/bus.c | 4 +-
drivers/pwm/pwm-tiehrpwm.c | 2 +
drivers/rtc/rtc-omap.c | 14 ++--
drivers/spi/spi-davinci.c | 2 +-
drivers/spi/spi-fsl-dspi.c | 24 +++----
drivers/tty/serial/serial_core.c | 17 +++--
drivers/video/fbdev/core/fbmem.c | 38 ++++++++--
fs/9p/xattr.c | 6 +-
fs/nfs/blocklayout/dev.c | 2 +-
fs/nfs/nfs4proc.c | 9 ++-
fs/quota/quota.c | 2 +
fs/ubifs/journal.c | 18 ++++-
fs/ubifs/lprops.c | 8 +--
fs/xattr.c | 2 +-
include/linux/intel-iommu.h | 8 ++-
include/linux/sunrpc/clnt.h | 1 +
include/linux/verification.h | 6 ++
include/video/udlfb.h | 2 +-
kernel/power/Kconfig | 1 +
kernel/printk/nmi.c | 4 +-
kernel/sys.c | 95 ++++++++++++-------------
kernel/trace/blktrace.c | 4 ++
kernel/trace/trace.c | 4 +-
kernel/trace/trace_uprobe.c | 2 +-
kernel/user_namespace.c | 24 +++----
kernel/utsname_sysctl.c | 41 ++++++-----
mm/memory.c | 9 ---
net/9p/client.c | 2 +-
net/9p/trans_fd.c | 7 +-
net/9p/trans_rdma.c | 3 +
net/9p/trans_virtio.c | 13 +++-
net/ieee802154/6lowpan/tx.c | 21 +++++-
net/mac802154/tx.c | 15 +++-
net/sunrpc/clnt.c | 28 +++++---
tools/perf/util/auxtrace.c | 3 +
67 files changed, 653 insertions(+), 340 deletions(-)
This is the start of the stable review cycle for the 4.4.155 release.
There are 47 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun Sep 9 21:08:44 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.155-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.4.155-rc1
Dave Airlie <airlied(a)redhat.com>
drm/drivers: add support for using the arch wc mapping API.
Dave Airlie <airlied(a)redhat.com>
x86/io: add interface to reserve io memtype for a resource range. (v1.1)
Jeremy Cline <jcline(a)redhat.com>
fs/quota: Fix spectre gadget in do_quotactl
Adrian Hunter <adrian.hunter(a)intel.com>
perf auxtrace: Fix queue resize
Shan Hai <shan.hai(a)oracle.com>
bcache: release dc->writeback_lock properly in bch_writeback_thread()
Christian Brauner <christian(a)brauner.io>
getxattr: use correct xattr length
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: set optimal write delay
Mikulas Patocka <mpatocka(a)redhat.com>
fb: fix lost console when the user unplugs a USB adapter
Vignesh R <vigneshr(a)ti.com>
pwm: tiehrpwm: Fix disabling of output of PWMs
Richard Weinberger <richard(a)nod.at>
ubifs: Fix synced_i_size calculation for xattr inodes
Richard Weinberger <richard(a)nod.at>
ubifs: Check data node size before truncate
Richard Weinberger <richard(a)nod.at>
Revert "UBIFS: Fix potential integer overflow in allocation"
Richard Weinberger <richard(a)nod.at>
ubifs: Fix memory leak in lprobs self-check
Jann Horn <jannh(a)google.com>
userns: move user access out of the mutex
Jann Horn <jannh(a)google.com>
sys: don't hold uts_sem while accessing userspace memory
Al Viro <viro(a)zeniv.linux.org.uk>
osf_getdomainname(): use copy_to_user()
Jacob Pan <jacob.jun.pan(a)linux.intel.com>
iommu/vt-d: Fix dev iotlb pfsid use
Jacob Pan <jacob.jun.pan(a)linux.intel.com>
iommu/vt-d: Add definitions for PFSID
Peter Zijlstra <peterz(a)infradead.org>
mm/tlb: Remove tlb_remove_table() non-concurrent condition
Jon Hunter <jonathanh(a)nvidia.com>
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Dan Carpenter <dan.carpenter(a)oracle.com>
pnfs/blocklayout: off by one in bl_map_stripe()
zhangyi (F) <yi.zhang(a)huawei.com>
PM / sleep: wakeup: Fix build error caused by missing SRCU support
Tomas Bortoli <tomasbortoli(a)gmail.com>
9p: fix multiple NULL-pointer-dereferences
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
uprobes: Use synchronize_rcu() not synchronize_sched()
Snild Dolkow <snild(a)sony.com>
kthread, tracing: Don't expose half-written comm when creating kthreads
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing/blktrace: Fix to allow setting same value
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Do not call start/stop() functions when tracing_on does not change
Nadav Amit <namit(a)vmware.com>
vmw_balloon: fix VMCI use when balloon built into kernel
Nadav Amit <namit(a)vmware.com>
vmw_balloon: VMCI_DOORBELL_SET does not check status
Nadav Amit <namit(a)vmware.com>
vmw_balloon: do not use 2MB without batching
Nadav Amit <namit(a)vmware.com>
vmw_balloon: fix inflation of 64-bit GFNs
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix return value for ad952x_store()
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix displayed phase
Mike Snitzer <snitzer(a)redhat.com>
dm cache metadata: save in-core policy_hint_size to on-disk superblock
Jiri Slaby <jslaby(a)suse.cz>
x86/mm/pat: Fix L1TF stable backport for CPA, 2nd call
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/client.c: version pointer uninitialized
jiangyiwen <jiangyiwen(a)huawei.com>
9p/virtio: fix off-by-one error in sg list bounds check
piaojun <piaojun(a)huawei.com>
fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
Hari Bathini <hbathini(a)linux.ibm.com>
powerpc/fadump: handle crash memory ranges array index overflow
Matthew Auld <matthew.auld(a)intel.com>
drm/i915/userptr: reject zero user_size
Bartosz Golaszewski <bgolaszewski(a)baylibre.com>
spi: davinci: fix a NULL pointer dereference
Ben Hutchings <ben.hutchings(a)codethink.co.uk>
net: lan78xx: Fix misplaced tasklet_schedule() call
Chirantan Ekbote <chirantan(a)chromium.org>
9p/net: Fix zero-copy path in the 9p virtio transport
Alexander Aring <aring(a)mojatatu.com>
net: mac802154: tx: expand tailroom if necessary
Alexander Aring <aring(a)mojatatu.com>
net: 6lowpan: fix reserved space for single frames
-------------
Diffstat:
Makefile | 4 +-
arch/alpha/kernel/osf_sys.c | 64 +++++++++-----------
arch/arm/boot/dts/tegra30-cardhu.dtsi | 1 +
arch/powerpc/include/asm/fadump.h | 3 -
arch/powerpc/kernel/fadump.c | 91 +++++++++++++++++++++++-----
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/sparc/kernel/sys_sparc_32.c | 22 ++++---
arch/sparc/kernel/sys_sparc_64.c | 20 ++++---
arch/x86/include/asm/io.h | 6 ++
arch/x86/mm/pageattr.c | 2 +-
arch/x86/mm/pat.c | 14 +++++
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 ++
drivers/gpu/drm/ast/ast_ttm.c | 6 ++
drivers/gpu/drm/cirrus/cirrus_ttm.c | 7 +++
drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +
drivers/gpu/drm/mgag200/mgag200_ttm.c | 7 +++
drivers/gpu/drm/nouveau/nouveau_ttm.c | 8 +++
drivers/gpu/drm/radeon/radeon_object.c | 5 ++
drivers/iio/frequency/ad9523.c | 4 +-
drivers/iommu/dmar.c | 6 +-
drivers/iommu/intel-iommu.c | 18 +++++-
drivers/md/bcache/writeback.c | 4 +-
drivers/md/dm-cache-metadata.c | 3 +-
drivers/misc/vmw_balloon.c | 67 +++++++++++++--------
drivers/net/usb/lan78xx.c | 4 +-
drivers/pwm/pwm-tiehrpwm.c | 2 +
drivers/spi/spi-davinci.c | 2 +-
drivers/video/fbdev/core/fbmem.c | 38 ++++++++++--
fs/9p/xattr.c | 6 +-
fs/nfs/blocklayout/dev.c | 2 +-
fs/quota/quota.c | 2 +
fs/ubifs/journal.c | 18 +++++-
fs/ubifs/lprops.c | 8 +--
fs/xattr.c | 2 +-
include/linux/intel-iommu.h | 8 ++-
include/linux/io.h | 22 +++++++
include/video/udlfb.h | 2 +-
kernel/kthread.c | 8 ++-
kernel/power/Kconfig | 1 +
kernel/sys.c | 95 ++++++++++++++----------------
kernel/trace/blktrace.c | 4 ++
kernel/trace/trace.c | 4 +-
kernel/trace/trace_uprobe.c | 2 +-
kernel/user_namespace.c | 22 ++++---
kernel/utsname_sysctl.c | 41 ++++++++-----
mm/memory.c | 9 ---
net/9p/client.c | 2 +-
net/9p/trans_fd.c | 7 ++-
net/9p/trans_rdma.c | 3 +
net/9p/trans_virtio.c | 13 +++-
net/ieee802154/6lowpan/tx.c | 21 ++++++-
net/mac802154/tx.c | 15 ++++-
tools/perf/util/auxtrace.c | 3 +
53 files changed, 510 insertions(+), 228 deletions(-)
This is the start of the stable review cycle for the 3.18.122 release.
There are 29 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun Sep 9 21:08:52 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.122-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 3.18.122-rc1
Shan Hai <shan.hai(a)oracle.com>
bcache: release dc->writeback_lock properly in bch_writeback_thread()
Christian Brauner <christian(a)brauner.io>
getxattr: use correct xattr length
Mikulas Patocka <mpatocka(a)redhat.com>
udlfb: set optimal write delay
Mikulas Patocka <mpatocka(a)redhat.com>
fb: fix lost console when the user unplugs a USB adapter
Vignesh R <vigneshr(a)ti.com>
pwm: tiehrpwm: Fix disabling of output of PWMs
Richard Weinberger <richard(a)nod.at>
ubifs: Fix synced_i_size calculation for xattr inodes
Richard Weinberger <richard(a)nod.at>
Revert "UBIFS: Fix potential integer overflow in allocation"
Richard Weinberger <richard(a)nod.at>
ubifs: Fix memory leak in lprobs self-check
Jann Horn <jannh(a)google.com>
userns: move user access out of the mutex
Eric W. Biederman <ebiederm(a)xmission.com>
userns; Correct the comment in map_write
Jann Horn <jannh(a)google.com>
sys: don't hold uts_sem while accessing userspace memory
Al Viro <viro(a)zeniv.linux.org.uk>
osf_getdomainname(): use copy_to_user()
Peter Zijlstra <peterz(a)infradead.org>
mm/tlb: Remove tlb_remove_table() non-concurrent condition
Jon Hunter <jonathanh(a)nvidia.com>
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Dan Carpenter <dan.carpenter(a)oracle.com>
pnfs/blocklayout: off by one in bl_map_stripe()
Tomas Bortoli <tomasbortoli(a)gmail.com>
9p: fix multiple NULL-pointer-dereferences
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
uprobes: Use synchronize_rcu() not synchronize_sched()
Snild Dolkow <snild(a)sony.com>
kthread, tracing: Don't expose half-written comm when creating kthreads
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing/blktrace: Fix to allow setting same value
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Do not call start/stop() functions when tracing_on does not change
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix return value for ad952x_store()
Lars-Peter Clausen <lars(a)metafoo.de>
iio: ad9523: Fix displayed phase
Mike Snitzer <snitzer(a)redhat.com>
dm cache metadata: save in-core policy_hint_size to on-disk superblock
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/client.c: version pointer uninitialized
jiangyiwen <jiangyiwen(a)huawei.com>
9p/virtio: fix off-by-one error in sg list bounds check
Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
Hari Bathini <hbathini(a)linux.ibm.com>
powerpc/fadump: handle crash memory ranges array index overflow
Bartosz Golaszewski <bgolaszewski(a)baylibre.com>
spi: davinci: fix a NULL pointer dereference
-------------
Diffstat:
Makefile | 4 +-
arch/alpha/kernel/osf_sys.c | 64 +++++++++++------------
arch/arm/boot/dts/tegra30-cardhu.dtsi | 1 +
arch/powerpc/include/asm/fadump.h | 3 --
arch/powerpc/kernel/fadump.c | 91 +++++++++++++++++++++++++++------
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/sparc/kernel/sys_sparc_32.c | 22 ++++----
arch/sparc/kernel/sys_sparc_64.c | 20 +++++---
drivers/iio/frequency/ad9523.c | 4 +-
drivers/md/bcache/writeback.c | 4 +-
drivers/md/dm-cache-metadata.c | 3 +-
drivers/pwm/pwm-tiehrpwm.c | 2 +
drivers/spi/spi-davinci.c | 2 +-
drivers/video/fbdev/core/fbmem.c | 38 +++++++++++---
fs/nfs/blocklayout/dev.c | 2 +-
fs/ubifs/journal.c | 7 ++-
fs/ubifs/lprops.c | 8 +--
fs/xattr.c | 2 +-
include/video/udlfb.h | 2 +-
kernel/kthread.c | 8 ++-
kernel/sys.c | 95 +++++++++++++++++------------------
kernel/trace/blktrace.c | 4 ++
kernel/trace/trace.c | 4 +-
kernel/trace/trace_uprobe.c | 2 +-
kernel/user_namespace.c | 22 ++++----
kernel/utsname_sysctl.c | 41 +++++++++------
mm/memory.c | 9 ----
net/9p/client.c | 2 +-
net/9p/trans_fd.c | 7 ++-
net/9p/trans_rdma.c | 3 ++
net/9p/trans_virtio.c | 6 ++-
31 files changed, 299 insertions(+), 185 deletions(-)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi Greg,
Pleae pull commits for Linux 3.18 .
I've sent a review request for all commits over a week ago and all
comments were addressed.
Thanks,
Sasha
=====
The following changes since commit a5f9be3576c3f9dd871f68eaf482278c0b3a6df2:
Linux 3.18.120 (2018-08-28 07:21:37 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git tags/for-greg-3.18-10092018
for you to fetch changes up to 0941bb2358f61b4d3c1eb989bffadbb4aae2dc5c:
btrfs: Don't remove block group that still has pinned down bytes (2018-08-30 10:40:46 -0400)
- ----------------------------------------------------------------
for-greg-3.18-10092018
- ----------------------------------------------------------------
Aleh Filipovich (1):
platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360
Andrey Ryabinin (1):
mm/fadvise.c: fix signed overflow UBSAN complaint
Arnd Bergmann (1):
reiserfs: change j_timestamp type to time64_t
Breno Leitao (1):
selftests/powerpc: Kill child processes on SIGINT
Dan Carpenter (2):
powerpc: Fix size calculation using resource_size()
scsi: aic94xx: fix an error code in aic94xx_init()
Ernesto A. Fernández (1):
hfs: prevent crash on exit from failed search
Guenter Roeck (1):
mfd: sm501: Set coherent_dma_mask when creating subdevices
Ian Abbott (1):
staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice
Jann Horn (1):
fork: don't copy inconsistent signal handler state to child
Jean-Philippe Brucker (1):
net/9p: fix error path of p9_virtio_probe
John Pittman (1):
dm kcopyd: avoid softlockup in run_complete_job
Mahesh Salgaonkar (1):
powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
Misono Tomohiro (1):
btrfs: replace: Reset on-disk dev stats value after replace
OGAWA Hirofumi (1):
fat: validate ->i_start before using
Qu Wenruo (2):
btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized
btrfs: Don't remove block group that still has pinned down bytes
Randy Dunlap (1):
scripts: modpost: check memory allocation results
Ronnie Sahlberg (1):
cifs: check if SMB2 PDU size has been padded and suppress the warning
Stefan Haberland (1):
s390/dasd: fix hanging offline processing due to canceled worker
Steve French (2):
smb3: fix reset of bytes read and written stats
SMB3: Number of requests sent should be displayed for SMB3 not just CIFS
Tan Hu (1):
ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest()
Tetsuo Handa (1):
hfsplus: don't return 0 when fill_super() failed
Thomas Petazzoni (1):
PCI: mvebu: Fix I/O space end address calculation
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/powerpc/sysdev/mpic_msgr.c | 2 +-
drivers/md/dm-kcopyd.c | 2 ++
drivers/mfd/sm501.c | 1 +
drivers/pci/host/pci-mvebu.c | 2 +-
drivers/platform/x86/asus-nb-wmi.c | 1 +
drivers/s390/block/dasd_eckd.c | 7 +++++--
drivers/scsi/aic94xx/aic94xx_init.c | 4 +++-
drivers/staging/comedi/drivers/ni_mio_common.c | 3 ++-
fs/btrfs/dev-replace.c | 6 ++++++
fs/btrfs/extent-tree.c | 2 +-
fs/btrfs/relocation.c | 23 ++++++++++++-----------
fs/cifs/cifs_debug.c | 8 ++++++++
fs/cifs/smb2misc.c | 7 +++++++
fs/cifs/smb2pdu.c | 2 +-
fs/fat/cache.c | 19 ++++++++++++-------
fs/fat/fat.h | 5 +++++
fs/fat/fatent.c | 6 +++---
fs/hfs/brec.c | 7 ++++---
fs/hfsplus/super.c | 4 +++-
fs/reiserfs/reiserfs.h | 2 +-
kernel/fork.c | 2 ++
mm/fadvise.c | 8 ++++++--
net/9p/trans_virtio.c | 3 ++-
net/netfilter/ipvs/ip_vs_core.c | 15 +++++++++++----
scripts/mod/modpost.c | 8 ++++----
tools/testing/selftests/powerpc/harness.c | 18 ++++++++++++------
27 files changed, 117 insertions(+), 52 deletions(-)
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAluWf4wACgkQ3qZv95d3
LNw2mw//czETmy7MjuRhH3z4KEh29RvoKJ0kTJ/hIGDleoy6MhHx603vBiT7mtcI
v35sXHjCT77mUE3PkoRoWwrLtFiGxCZ6txZ1Zutwz8lCUem9gaw40KehjCxdGH/U
jejRP+sgYYKuVNgXn7pPk97GINNIqytc3B5lDwAz0VgWGX6fpITtAr9xSrbc+fuP
Zc+DBs0YUxtfj2KTCgYN+73fUZOPauubowxPX+UVfIwtxUcgejJO1JyNi0uIhqbj
ebpkUiozS37+loouRKR46vfKcSohU9ZWW9I+hO6nx47i6LqtARjyDV99glgX8zaE
9bt8kWKPVx6AAcY1jQwMvx2VeRaTouPfG9u9kUlMHvzNbnRQ2xnRpmXLMqcHFyQG
Wgf6EIXT1o9HG08B4pAAELTY1UacnVeHH0+GxhU9hhcU969Mu5H0e3sVymgyWZBm
TOF650ITUjTAT+BtfMf/A7/jGmRoVV6Vl0372ePXkgIG6Kwq3AgwMJRzR8FCX8M0
ualLK0A1BS+eaC70+paAkhakrzYH224Yrbb+nXm3p3Mho1UCU26VMTz59Z7Rgvr6
dsLIvyOCHFiXHeKtyjbZ9mW6O64yiTHqO3SdctgkrYfm9BSAtRZZivGYd9IwflWB
6oz4fUFH7jmVyjbEg9cgEWttLNVROcSrGLYEIFDXv9SlhOWxTfA=
=NY7H
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi Greg,
Pleae pull commits for Linux 4.4 .
I've sent a review request for all commits over a week ago and all
comments were addressed.
Thanks,
Sasha
=====
The following changes since commit 577189c37a844243359afce1c3c94418259fe696:
Linux 4.4.153 (2018-08-28 07:23:44 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git tags/for-greg-4.4-10092018
for you to fetch changes up to 230b9c234e619e3c62b68c12a57c4fa35983c7bc:
btrfs: Don't remove block group that still has pinned down bytes (2018-08-31 15:34:12 -0400)
- ----------------------------------------------------------------
for-greg-4.4-10092018
- ----------------------------------------------------------------
Aleh Filipovich (1):
platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360
Andrey Ryabinin (1):
mm/fadvise.c: fix signed overflow UBSAN complaint
Arnd Bergmann (1):
reiserfs: change j_timestamp type to time64_t
Breno Leitao (1):
selftests/powerpc: Kill child processes on SIGINT
Dan Carpenter (2):
powerpc: Fix size calculation using resource_size()
scsi: aic94xx: fix an error code in aic94xx_init()
Ernesto A. Fernández (2):
hfs: prevent crash on exit from failed search
hfsplus: fix NULL dereference in hfsplus_lookup()
Guenter Roeck (1):
mfd: sm501: Set coherent_dma_mask when creating subdevices
Ian Abbott (1):
staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice
Jann Horn (1):
fork: don't copy inconsistent signal handler state to child
Jean-Philippe Brucker (1):
net/9p: fix error path of p9_virtio_probe
John Pittman (1):
dm kcopyd: avoid softlockup in run_complete_job
Jonas Gorski (1):
irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP
Mahesh Salgaonkar (1):
powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
Misono Tomohiro (1):
btrfs: replace: Reset on-disk dev stats value after replace
OGAWA Hirofumi (1):
fat: validate ->i_start before using
Qu Wenruo (2):
btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized
btrfs: Don't remove block group that still has pinned down bytes
Randy Dunlap (1):
scripts: modpost: check memory allocation results
Ronnie Sahlberg (1):
cifs: check if SMB2 PDU size has been padded and suppress the warning
Stefan Haberland (1):
s390/dasd: fix hanging offline processing due to canceled worker
Steve French (2):
smb3: fix reset of bytes read and written stats
SMB3: Number of requests sent should be displayed for SMB3 not just CIFS
Tan Hu (1):
ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest()
Tetsuo Handa (2):
hfsplus: don't return 0 when fill_super() failed
fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot()
Thomas Petazzoni (1):
PCI: mvebu: Fix I/O space end address calculation
Vasily Gorbik (1):
tracing: Handle CC_FLAGS_FTRACE more accurately
Makefile | 11 +++++++----
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/powerpc/sysdev/mpic_msgr.c | 2 +-
drivers/irqchip/irq-bcm7038-l1.c | 4 ++++
drivers/md/dm-kcopyd.c | 2 ++
drivers/mfd/sm501.c | 1 +
drivers/pci/host/pci-mvebu.c | 2 +-
drivers/platform/x86/asus-nb-wmi.c | 1 +
drivers/s390/block/dasd_eckd.c | 7 +++++--
drivers/scsi/aic94xx/aic94xx_init.c | 4 +++-
drivers/staging/comedi/drivers/ni_mio_common.c | 3 ++-
fs/btrfs/dev-replace.c | 6 ++++++
fs/btrfs/extent-tree.c | 2 +-
fs/btrfs/relocation.c | 23 ++++++++++++-----------
fs/cifs/cifs_debug.c | 8 ++++++++
fs/cifs/smb2misc.c | 7 +++++++
fs/cifs/smb2pdu.c | 2 +-
fs/dcache.c | 3 ++-
fs/fat/cache.c | 19 ++++++++++++-------
fs/fat/fat.h | 5 +++++
fs/fat/fatent.c | 6 +++---
fs/hfs/brec.c | 7 ++++---
fs/hfsplus/dir.c | 4 ++--
fs/hfsplus/super.c | 4 +++-
fs/reiserfs/reiserfs.h | 2 +-
kernel/fork.c | 2 ++
mm/fadvise.c | 8 ++++++--
net/9p/trans_virtio.c | 3 ++-
net/netfilter/ipvs/ip_vs_core.c | 15 +++++++++++----
scripts/mod/modpost.c | 8 ++++----
tools/testing/selftests/powerpc/harness.c | 18 ++++++++++++------
31 files changed, 132 insertions(+), 59 deletions(-)
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAluWf4QACgkQ3qZv95d3
LNxoaBAAkTmVEYo2cxE6cWtH48DHvSmVW/8aS6lpyxaQK9c9Dr3xPMRqVO7FYne4
CquCmbsJzmMouimtn2hn+QAXwLdaAjgZDMIoiBs1vFho6komQ52i83wWTAJEMhKL
uvWyZosKpGgNztgaU2ZZI1lax85sTscTGq/H46bV8S2RJWKGxiMaIPOSbKS3+GN1
FCTHGy05Hy3gQnmNCpV03n10zeEGSHQ2vDRz9g9OgFWlXcHmL0oyp+G+StnGiKMc
wmHXJBSq5aFsf+nOflBNl7ngZUU5KkbQfdZOh/1aPgfoR08JRVV7DNivj7C9DCpV
RoxxmDKizPvV4bOgn39MVNs/yQUW8Q9HT1QnKoCvDZeaVHKwW9KMX4ax2lvHlYjS
woYwJ5Rz0qKxcZBxQAg+QHN1Y61WLDp3QukxALtXDdCswDD2oByVtfwn5S7+pwZj
R3kACK7DZihBcIrNR6wPA0LgOzauwSRYc2wP8DwxQ5zpEgbQXZyMvFU2uQsA10Ac
z0Y03alRobEnAbQB0ogkGhXUWG2935cSxBbsd0j0vzC1KQoPkL+pSytDpC8p1tuy
6PR/u6i/DHGcKemSpMASbN1LB88mKAQPSdnkTw6w3DygVHF6KMz+nXAcNhkleENy
aAy1k4GaQcopFkAycesQ9KX9jGnP2XHhmZZxcL1f5qoiMsf6DY4=
=X/I+
-----END PGP SIGNATURE-----
Commit-ID: 02e184476eff848273826c1d6617bb37e5bcc7ad
Gitweb: https://git.kernel.org/tip/02e184476eff848273826c1d6617bb37e5bcc7ad
Author: Yabin Cui <yabinc(a)google.com>
AuthorDate: Thu, 23 Aug 2018 15:59:35 -0700
Committer: Ingo Molnar <mingo(a)kernel.org>
CommitDate: Mon, 10 Sep 2018 14:01:46 +0200
perf/core: Force USER_DS when recording user stack data
Perf can record user stack data in response to a synchronous request, such
as a tracepoint firing. If this happens under set_fs(KERNEL_DS), then we
end up reading user stack data using __copy_from_user_inatomic() under
set_fs(KERNEL_DS). I think this conflicts with the intention of using
set_fs(KERNEL_DS). And it is explicitly forbidden by hardware on ARM64
when both CONFIG_ARM64_UAO and CONFIG_ARM64_PAN are used.
So fix this by forcing USER_DS when recording user stack data.
Signed-off-by: Yabin Cui <yabinc(a)google.com>
Acked-by: Peter Zijlstra (Intel) <peterz(a)infradead.org>
Cc: <stable(a)vger.kernel.org>
Cc: Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme(a)kernel.org>
Cc: Jiri Olsa <jolsa(a)redhat.com>
Cc: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: Namhyung Kim <namhyung(a)kernel.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Fixes: 88b0193d9418 ("perf/callchain: Force USER_DS when invoking perf_callchain_user()")
Link: http://lkml.kernel.org/r/20180823225935.27035-1-yabinc@google.com
Signed-off-by: Ingo Molnar <mingo(a)kernel.org>
---
kernel/events/core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index abaed4f8bb7f..c80549bf82c6 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5943,6 +5943,7 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
unsigned long sp;
unsigned int rem;
u64 dyn_size;
+ mm_segment_t fs;
/*
* We dump:
@@ -5960,7 +5961,10 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
/* Data. */
sp = perf_user_stack_pointer(regs);
+ fs = get_fs();
+ set_fs(USER_DS);
rem = __output_copy_user(handle, (void *) sp, dump_size);
+ set_fs(fs);
dyn_size = dump_size - rem;
perf_output_skip(handle, rem);
This is the start of the stable review cycle for the 4.4.148 release.
There are 43 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu Aug 16 17:14:59 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.148-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.4.148-rc1
Guenter Roeck <linux(a)roeck-us.net>
x86/speculation/l1tf: Fix up CPU feature flags
Andi Kleen <ak(a)linux.intel.com>
x86/mm/kmmio: Make the tracer robust against L1TF
Andi Kleen <ak(a)linux.intel.com>
x86/mm/pat: Make set_memory_np() L1TF safe
Andi Kleen <ak(a)linux.intel.com>
x86/speculation/l1tf: Make pmd/pud_mknotpresent() invert
Andi Kleen <ak(a)linux.intel.com>
x86/speculation/l1tf: Invert all not present mappings
Michal Hocko <mhocko(a)suse.cz>
x86/speculation/l1tf: Fix up pte->pfn conversion for PAE
Vlastimil Babka <vbabka(a)suse.cz>
x86/speculation/l1tf: Protect PAE swap entries against L1TF
Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
x86/cpufeatures: Add detection of L1D cache flush support.
Vlastimil Babka <vbabka(a)suse.cz>
x86/speculation/l1tf: Extend 64bit swap file size limit
Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
x86/bugs: Move the l1tf function and define pr_fmt properly
Andi Kleen <ak(a)linux.intel.com>
x86/speculation/l1tf: Limit swap file size to MAX_PA/2
Andi Kleen <ak(a)linux.intel.com>
x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings
Dan Williams <dan.j.williams(a)intel.com>
mm: fix cache mode tracking in vm_insert_mixed()
Andy Lutomirski <luto(a)kernel.org>
mm: Add vm_insert_pfn_prot()
Andi Kleen <ak(a)linux.intel.com>
x86/speculation/l1tf: Add sysfs reporting for l1tf
Andi Kleen <ak(a)linux.intel.com>
x86/speculation/l1tf: Make sure the first page is always reserved
Andi Kleen <ak(a)linux.intel.com>
x86/speculation/l1tf: Protect PROT_NONE PTEs against speculation
Linus Torvalds <torvalds(a)linux-foundation.org>
x86/speculation/l1tf: Protect swap entries against L1TF
Linus Torvalds <torvalds(a)linux-foundation.org>
x86/speculation/l1tf: Change order of offset/type in swap entry
Naoya Horiguchi <n-horiguchi(a)ah.jp.nec.com>
mm: x86: move _PAGE_SWP_SOFT_DIRTY from bit 7 to bit 1
Dave Hansen <dave.hansen(a)linux.intel.com>
x86/mm: Fix swap entry comment and macro
Dave Hansen <dave.hansen(a)linux.intel.com>
x86/mm: Move swap offset/type up in PTE to work around erratum
Andi Kleen <ak(a)linux.intel.com>
x86/speculation/l1tf: Increase 32bit PAE __PHYSICAL_PAGE_SHIFT
Nick Desaulniers <ndesaulniers(a)google.com>
x86/irqflags: Provide a declaration for native_save_fl
Masami Hiramatsu <mhiramat(a)kernel.org>
kprobes/x86: Fix %p uses in error messages
Jiri Kosina <jkosina(a)suse.cz>
x86/speculation: Protect against userspace-userspace spectreRSB
Peter Zijlstra <peterz(a)infradead.org>
x86/paravirt: Fix spectre-v2 mitigations for paravirt guests
Oleksij Rempel <o.rempel(a)pengutronix.de>
ARM: dts: imx6sx: fix irq for pcie bridge
Michael Mera <dev(a)michaelmera.com>
IB/ocrdma: fix out of bounds access to local buffer
Jack Morgenstein <jackm(a)dev.mellanox.co.il>
IB/mlx4: Mark user MR as writable if actual virtual memory is writable
Jack Morgenstein <jackm(a)dev.mellanox.co.il>
IB/core: Make testing MR flags for writability a static inline function
Al Viro <viro(a)zeniv.linux.org.uk>
fix __legitimize_mnt()/mntput() race
Al Viro <viro(a)zeniv.linux.org.uk>
fix mntput/mntput race
Al Viro <viro(a)zeniv.linux.org.uk>
root dentries need RCU-delayed freeing
Bart Van Assche <bart.vanassche(a)wdc.com>
scsi: sr: Avoid that opening a CD-ROM hangs with runtime power management enabled
Hans de Goede <hdegoede(a)redhat.com>
ACPI / LPSS: Add missing prv_offset setting for byt/cht PWM devices
Juergen Gross <jgross(a)suse.com>
xen/netfront: don't cache skb_shinfo()
John David Anglin <dave.anglin(a)bell.net>
parisc: Define mb() and add memory barriers to assembler unlock sequences
Helge Deller <deller(a)gmx.de>
parisc: Enable CONFIG_MLONGCALLS by default
Kees Cook <keescook(a)chromium.org>
fork: unconditionally clear stack on fork
Thomas Egerer <hakke_007(a)gmx.de>
ipv4+ipv6: Make INET*_ESP select CRYPTO_ECHAINIV
Tadeusz Struk <tadeusz.struk(a)intel.com>
tpm: fix race condition in tpm_common_write()
Theodore Ts'o <tytso(a)mit.edu>
ext4: fix check to prevent initializing reserved inodes
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/imx6sx.dtsi | 2 +-
arch/parisc/Kconfig | 2 +-
arch/parisc/include/asm/barrier.h | 32 +++++++++++
arch/parisc/kernel/entry.S | 2 +
arch/parisc/kernel/pacache.S | 1 +
arch/parisc/kernel/syscall.S | 4 ++
arch/x86/include/asm/cpufeatures.h | 10 ++--
arch/x86/include/asm/irqflags.h | 2 +
arch/x86/include/asm/page_32_types.h | 9 +++-
arch/x86/include/asm/pgtable-2level.h | 17 ++++++
arch/x86/include/asm/pgtable-3level.h | 37 ++++++++++++-
arch/x86/include/asm/pgtable-invert.h | 32 +++++++++++
arch/x86/include/asm/pgtable.h | 84 +++++++++++++++++++++++------
arch/x86/include/asm/pgtable_64.h | 54 +++++++++++++++----
arch/x86/include/asm/pgtable_types.h | 10 ++--
arch/x86/include/asm/processor.h | 5 ++
arch/x86/kernel/cpu/bugs.c | 81 +++++++++++++++++-----------
arch/x86/kernel/cpu/common.c | 20 +++++++
arch/x86/kernel/kprobes/core.c | 4 +-
arch/x86/kernel/paravirt.c | 14 +++--
arch/x86/kernel/setup.c | 6 +++
arch/x86/mm/init.c | 23 ++++++++
arch/x86/mm/kmmio.c | 25 +++++----
arch/x86/mm/mmap.c | 21 ++++++++
arch/x86/mm/pageattr.c | 8 +--
drivers/acpi/acpi_lpss.c | 2 +
drivers/base/cpu.c | 8 +++
drivers/char/tpm/tpm-dev.c | 43 +++++++--------
drivers/infiniband/core/umem.c | 11 +---
drivers/infiniband/hw/mlx4/mr.c | 50 ++++++++++++++---
drivers/infiniband/hw/ocrdma/ocrdma_stats.c | 2 +-
drivers/net/xen-netfront.c | 8 +--
drivers/scsi/sr.c | 29 +++++++---
fs/dcache.c | 6 ++-
fs/ext4/ialloc.c | 5 +-
fs/ext4/super.c | 8 +--
fs/namespace.c | 28 +++++++++-
include/asm-generic/pgtable.h | 12 +++++
include/linux/cpu.h | 2 +
include/linux/mm.h | 2 +
include/linux/swapfile.h | 2 +
include/linux/thread_info.h | 6 +--
include/rdma/ib_verbs.h | 14 +++++
mm/memory.c | 62 +++++++++++++++++----
mm/mprotect.c | 49 +++++++++++++++++
mm/swapfile.c | 46 ++++++++++------
net/ipv4/Kconfig | 1 +
net/ipv6/Kconfig | 1 +
49 files changed, 714 insertions(+), 192 deletions(-)
When executing 'fw_run_transaction()' with 'TCODE_WRITE_BLOCK_REQUEST',
an address of 'payload' argument is used for streaming DMA mapping by
'firewire_ohci' module if 'size' argument is larger than 8 byte.
Although in this case the address should not be on kernel stack, current
implementation of ALSA bebob driver uses data in kernel stack for a cue
to boot M-Audio devices. This often brings unexpected result, especially
for a case of CONFIG_VMAP_STACK=y.
This commit fixes the bug.
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=201021
Reference: https://forum.manjaro.org/t/firewire-m-audio-410-driver-wont-load-firmware/…
Fixes: a2b2a7798fb6('ALSA: bebob: Send a cue to load firmware for M-Audio Firewire series')
Cc: <stable(a)vger.kernel.org> # v3.16+
Signed-off-by: Takashi Sakamoto <o-takashi(a)sakamocchi.jp>
---
sound/firewire/bebob/bebob_maudio.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/sound/firewire/bebob/bebob_maudio.c b/sound/firewire/bebob/bebob_maudio.c
index bd55620c6a47..0c5a4cbb99ba 100644
--- a/sound/firewire/bebob/bebob_maudio.c
+++ b/sound/firewire/bebob/bebob_maudio.c
@@ -96,17 +96,13 @@ int snd_bebob_maudio_load_firmware(struct fw_unit *unit)
struct fw_device *device = fw_parent_device(unit);
int err, rcode;
u64 date;
- __le32 cues[3] = {
- cpu_to_le32(MAUDIO_BOOTLOADER_CUE1),
- cpu_to_le32(MAUDIO_BOOTLOADER_CUE2),
- cpu_to_le32(MAUDIO_BOOTLOADER_CUE3)
- };
+ __le32 *cues;
/* check date of software used to build */
err = snd_bebob_read_block(unit, INFO_OFFSET_SW_DATE,
&date, sizeof(u64));
if (err < 0)
- goto end;
+ return err;
/*
* firmware version 5058 or later has date later than "20070401", but
* 'date' is not null-terminated.
@@ -114,20 +110,28 @@ int snd_bebob_maudio_load_firmware(struct fw_unit *unit)
if (date < 0x3230303730343031LL) {
dev_err(&unit->device,
"Use firmware version 5058 or later\n");
- err = -ENOSYS;
- goto end;
+ return -ENXIO;
}
+ cues = kmalloc_array(3, sizeof(*cues), GFP_KERNEL);
+ if (!cues)
+ return -ENOMEM;
+
+ cues[0] = cpu_to_le32(MAUDIO_BOOTLOADER_CUE1);
+ cues[1] = cpu_to_le32(MAUDIO_BOOTLOADER_CUE2);
+ cues[2] = cpu_to_le32(MAUDIO_BOOTLOADER_CUE3);
+
rcode = fw_run_transaction(device->card, TCODE_WRITE_BLOCK_REQUEST,
device->node_id, device->generation,
device->max_speed, BEBOB_ADDR_REG_REQ,
- cues, sizeof(cues));
+ cues, 3 * sizeof(*cues));
+ kfree(cues);
if (rcode != RCODE_COMPLETE) {
dev_err(&unit->device,
"Failed to send a cue to load firmware\n");
err = -EIO;
}
-end:
+
return err;
}
--
2.17.1
I'm announcing the release of the 3.18.122 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2
arch/alpha/kernel/osf_sys.c | 64 ++++++++++------------
arch/arm/boot/dts/tegra30-cardhu.dtsi | 1
arch/powerpc/include/asm/fadump.h | 3 -
arch/powerpc/kernel/fadump.c | 92 +++++++++++++++++++++++++++-----
arch/powerpc/platforms/pseries/ras.c | 2
arch/sparc/kernel/sys_sparc_32.c | 22 ++++---
arch/sparc/kernel/sys_sparc_64.c | 20 ++++---
drivers/iio/frequency/ad9523.c | 4 -
drivers/md/bcache/writeback.c | 4 +
drivers/md/dm-cache-metadata.c | 3 -
drivers/pwm/pwm-tiehrpwm.c | 2
drivers/spi/spi-davinci.c | 2
drivers/video/fbdev/core/fbmem.c | 38 +++++++++++--
fs/nfs/blocklayout/dev.c | 2
fs/ubifs/journal.c | 7 ++
fs/ubifs/lprops.c | 8 +-
fs/xattr.c | 2
include/video/udlfb.h | 2
kernel/kthread.c | 8 ++
kernel/sys.c | 95 ++++++++++++++++------------------
kernel/trace/blktrace.c | 4 +
kernel/trace/trace.c | 4 +
kernel/trace/trace_uprobe.c | 2
kernel/user_namespace.c | 39 ++++++-------
kernel/utsname_sysctl.c | 41 ++++++++------
mm/memory.c | 9 ---
net/9p/client.c | 2
net/9p/trans_fd.c | 7 ++
net/9p/trans_rdma.c | 3 +
net/9p/trans_virtio.c | 6 +-
31 files changed, 308 insertions(+), 192 deletions(-)
Al Viro (1):
osf_getdomainname(): use copy_to_user()
Bartosz Golaszewski (1):
spi: davinci: fix a NULL pointer dereference
Christian Brauner (1):
getxattr: use correct xattr length
Dan Carpenter (1):
pnfs/blocklayout: off by one in bl_map_stripe()
Eric W. Biederman (1):
userns; Correct the comment in map_write
Greg Kroah-Hartman (1):
Linux 3.18.122
Hari Bathini (1):
powerpc/fadump: handle crash memory ranges array index overflow
Jann Horn (2):
sys: don't hold uts_sem while accessing userspace memory
userns: move user access out of the mutex
Jon Hunter (1):
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Lars-Peter Clausen (2):
iio: ad9523: Fix displayed phase
iio: ad9523: Fix return value for ad952x_store()
Mahesh Salgaonkar (1):
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
Mike Snitzer (1):
dm cache metadata: save in-core policy_hint_size to on-disk superblock
Mikulas Patocka (2):
fb: fix lost console when the user unplugs a USB adapter
udlfb: set optimal write delay
Peter Zijlstra (1):
mm/tlb: Remove tlb_remove_table() non-concurrent condition
Richard Weinberger (3):
ubifs: Fix memory leak in lprobs self-check
Revert "UBIFS: Fix potential integer overflow in allocation"
ubifs: Fix synced_i_size calculation for xattr inodes
Shan Hai (1):
bcache: release dc->writeback_lock properly in bch_writeback_thread()
Snild Dolkow (1):
kthread, tracing: Don't expose half-written comm when creating kthreads
Steven Rostedt (VMware) (3):
tracing: Do not call start/stop() functions when tracing_on does not change
tracing/blktrace: Fix to allow setting same value
uprobes: Use synchronize_rcu() not synchronize_sched()
Tomas Bortoli (3):
net/9p/client.c: version pointer uninitialized
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
9p: fix multiple NULL-pointer-dereferences
Vignesh R (1):
pwm: tiehrpwm: Fix disabling of output of PWMs
jiangyiwen (1):
9p/virtio: fix off-by-one error in sg list bounds check
From: Al Viro <viro(a)zeniv.linux.org.uk>
cls_u32.c misuses refcounts for struct tc_u_hnode - it counts references via
->hlist and via ->tp_root together. u32_destroy() drops the former and, in
case when there had been links, leaves the sucker on the list. As the result,
there's nothing to protect it from getting freed once links are dropped.
That also makes the "is it busy" check incapable of catching the root hnode -
it *is* busy (there's a reference from tp), but we don't see it as something
separate. "Is it our root?" check partially covers that, but the problem
exists for others' roots as well.
AFAICS, the minimal fix preserving the existing behaviour (where it doesn't
include oopsen, that is) would be this:
* count tp->root and tp_c->hlist as separate references. I.e.
have u32_init() set refcount to 2, not 1.
* in u32_destroy() we always drop the former; in u32_destroy_hnode() -
the latter.
That way we have *all* references contributing to refcount. List
removal happens in u32_destroy_hnode() (called only when ->refcnt is 1)
an in u32_destroy() in case of tc_u_common going away, along with everything
reachable from it. IOW, that way we know that u32_destroy_key() won't
free something still on the list (or pointed to by someone's ->root).
Cc: stable(a)vger.kernel.org
Signed-off-by: Al Viro <viro(a)zeniv.linux.org.uk>
---
net/sched/cls_u32.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index f218ccf1e2d9..b2c3406a2cf2 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -398,6 +398,7 @@ static int u32_init(struct tcf_proto *tp)
rcu_assign_pointer(tp_c->hlist, root_ht);
root_ht->tp_c = tp_c;
+ root_ht->refcnt++;
rcu_assign_pointer(tp->root, root_ht);
tp->data = tp_c;
return 0;
@@ -610,7 +611,7 @@ static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
struct tc_u_hnode __rcu **hn;
struct tc_u_hnode *phn;
- WARN_ON(ht->refcnt);
+ WARN_ON(--ht->refcnt);
u32_clear_hnode(tp, ht, extack);
@@ -649,7 +650,7 @@ static void u32_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
WARN_ON(root_ht == NULL);
- if (root_ht && --root_ht->refcnt == 0)
+ if (root_ht && --root_ht->refcnt == 1)
u32_destroy_hnode(tp, root_ht, extack);
if (--tp_c->refcnt == 0) {
@@ -698,7 +699,6 @@ static int u32_delete(struct tcf_proto *tp, void *arg, bool *last,
}
if (ht->refcnt == 1) {
- ht->refcnt--;
u32_destroy_hnode(tp, ht, extack);
} else {
NL_SET_ERR_MSG_MOD(extack, "Can not delete in-use filter");
@@ -708,11 +708,11 @@ static int u32_delete(struct tcf_proto *tp, void *arg, bool *last,
out:
*last = true;
if (root_ht) {
- if (root_ht->refcnt > 1) {
+ if (root_ht->refcnt > 2) {
*last = false;
goto ret;
}
- if (root_ht->refcnt == 1) {
+ if (root_ht->refcnt == 2) {
if (!ht_empty(root_ht)) {
*last = false;
goto ret;
--
2.11.0
I'm announcing the release of the 4.18.7 kernel.
All users of the 4.18 kernel series must upgrade.
The updated 4.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2
arch/alpha/kernel/osf_sys.c | 51 ++++-----
arch/arm/boot/dts/am571x-idk.dts | 4
arch/arm/boot/dts/am572x-idk-common.dtsi | 4
arch/arm/boot/dts/am57xx-idk-common.dtsi | 7 +
arch/arm/boot/dts/tegra30-cardhu.dtsi | 1
arch/arm64/Kconfig | 1
arch/arm64/crypto/sm4-ce-glue.c | 2
arch/powerpc/include/asm/fadump.h | 3
arch/powerpc/include/asm/nohash/pgtable.h | 9 -
arch/powerpc/include/asm/pkeys.h | 11 -
arch/powerpc/kernel/fadump.c | 91 +++++++++++++---
arch/powerpc/kernel/process.c | 1
arch/powerpc/kvm/book3s_hv.c | 1
arch/powerpc/mm/mmu_context_book3s64.c | 8 -
arch/powerpc/mm/mmu_context_iommu.c | 17 +--
arch/powerpc/mm/pgtable-book3s64.c | 17 +--
arch/powerpc/mm/pkeys.c | 134 +++++++-----------------
arch/powerpc/platforms/powernv/pci-ioda.c | 37 ++++++
arch/powerpc/platforms/pseries/ras.c | 2
arch/sparc/kernel/sys_sparc_32.c | 22 ++-
arch/sparc/kernel/sys_sparc_64.c | 20 ++-
arch/x86/crypto/aesni-intel_asm.S | 66 +++++------
arch/x86/kernel/kexec-bzimage64.c | 2
arch/x86/kvm/vmx.c | 26 ++--
arch/xtensa/include/asm/cacheasm.h | 69 +++++++-----
block/bfq-cgroup.c | 3
block/blk-core.c | 61 ++++++----
block/blk-lib.c | 10 +
block/blk-sysfs.c | 15 ++
block/blk.h | 1
certs/system_keyring.c | 3
crypto/asymmetric_keys/pkcs7_key_type.c | 2
drivers/acpi/acpica/hwsleep.c | 11 -
drivers/acpi/acpica/psloop.c | 17 +--
drivers/block/zram/zram_drv.c | 7 +
drivers/cpufreq/cpufreq_governor.c | 12 +-
drivers/cpuidle/governors/menu.c | 47 ++++++--
drivers/crypto/caam/caamalg_qi.c | 6 -
drivers/crypto/caam/caampkc.c | 20 +--
drivers/crypto/caam/jr.c | 3
drivers/crypto/vmx/aes_cbc.c | 30 ++---
drivers/crypto/vmx/aes_xts.c | 21 ++-
drivers/dma-buf/reservation.c | 6 -
drivers/extcon/extcon.c | 3
drivers/hv/channel.c | 40 ++++---
drivers/hv/channel_mgmt.c | 10 +
drivers/i2c/busses/i2c-designware-master.c | 1
drivers/i2c/busses/i2c-designware-platdrv.c | 7 +
drivers/iio/accel/sca3000.c | 1
drivers/iio/frequency/ad9523.c | 4
drivers/infiniband/hw/mlx5/main.c | 2
drivers/infiniband/hw/mlx5/qp.c | 6 -
drivers/infiniband/sw/rxe/rxe_comp.c | 1
drivers/infiniband/ulp/srpt/ib_srpt.c | 34 ++++--
drivers/infiniband/ulp/srpt/ib_srpt.h | 4
drivers/iommu/dmar.c | 6 -
drivers/iommu/intel-iommu.c | 18 +++
drivers/iommu/ipmmu-vmsa.c | 7 +
drivers/mailbox/mailbox-xgene-slimpro.c | 6 -
drivers/md/bcache/writeback.c | 4
drivers/md/dm-cache-metadata.c | 13 +-
drivers/md/dm-crypt.c | 10 -
drivers/md/dm-integrity.c | 6 -
drivers/md/dm-thin.c | 2
drivers/md/dm-writecache.c | 2
drivers/media/i2c/tvp5150.c | 2
drivers/mfd/hi655x-pmic.c | 2
drivers/misc/cxl/main.c | 2
drivers/misc/ocxl/link.c | 24 ++--
drivers/misc/vmw_balloon.c | 67 +++++++-----
drivers/mmc/core/queue.c | 12 +-
drivers/mmc/core/queue.h | 1
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 10 +
drivers/net/wireless/marvell/libertas/dev.h | 1
drivers/net/wireless/marvell/libertas/if_sdio.c | 30 ++++-
drivers/nvdimm/bus.c | 4
drivers/nvdimm/dimm_devs.c | 31 +++++
drivers/nvdimm/namespace_devs.c | 6 -
drivers/nvdimm/nd-core.h | 8 +
drivers/nvdimm/region_devs.c | 24 ++++
drivers/pwm/pwm-omap-dmtimer.c | 5
drivers/pwm/pwm-tiehrpwm.c | 14 --
drivers/rtc/rtc-omap.c | 18 +--
drivers/spi/spi-cadence.c | 2
drivers/spi/spi-davinci.c | 2
drivers/spi/spi-fsl-dspi.c | 24 ++--
drivers/spi/spi-pxa2xx.c | 4
drivers/tty/serial/serial_core.c | 17 ++-
drivers/video/fbdev/core/fbmem.c | 38 +++++-
drivers/video/fbdev/udlfb.c | 105 ++++++++++--------
fs/9p/xattr.c | 6 -
fs/lockd/clntlock.c | 2
fs/lockd/clntproc.c | 2
fs/lockd/svclock.c | 16 +-
fs/lockd/svcsubs.c | 4
fs/nfs/blocklayout/dev.c | 2
fs/nfs/callback_proc.c | 14 +-
fs/nfs/nfs4proc.c | 9 +
fs/nfs/pnfs_nfs.c | 16 +-
fs/nfsd/nfs4state.c | 2
fs/overlayfs/readdir.c | 19 +++
fs/quota/quota.c | 2
fs/ubifs/dir.c | 5
fs/ubifs/journal.c | 21 +++
fs/ubifs/lprops.c | 8 -
fs/ubifs/xattr.c | 24 ++++
fs/udf/super.c | 31 +++--
fs/xattr.c | 2
include/linux/blk-cgroup.h | 18 +++
include/linux/hyperv.h | 2
include/linux/intel-iommu.h | 8 -
include/linux/lockd/lockd.h | 4
include/linux/mm_types.h | 5
include/linux/overflow.h | 31 +++++
include/linux/sunrpc/clnt.h | 1
include/linux/verification.h | 6 +
include/uapi/linux/eventpoll.h | 8 -
include/video/udlfb.h | 5
kernel/livepatch/core.c | 6 +
kernel/memremap.c | 1
kernel/power/Kconfig | 1
kernel/printk/printk_safe.c | 4
kernel/rcu/tree_exp.h | 9 +
kernel/sched/idle.c | 2
kernel/sys.c | 95 ++++++++---------
kernel/trace/blktrace.c | 4
kernel/trace/trace.c | 4
kernel/trace/trace_uprobe.c | 2
kernel/user_namespace.c | 24 +---
kernel/utsname_sysctl.c | 41 ++++---
mm/hmm.c | 2
mm/memory.c | 9 -
mm/readahead.c | 12 +-
net/9p/client.c | 2
net/9p/trans_fd.c | 7 +
net/9p/trans_rdma.c | 3
net/9p/trans_virtio.c | 13 ++
net/9p/trans_xen.c | 3
net/ieee802154/6lowpan/tx.c | 21 +++
net/mac802154/tx.c | 15 ++
net/sunrpc/clnt.c | 28 +++--
scripts/kconfig/Makefile | 5
security/apparmor/secid.c | 1
security/commoncap.c | 2
sound/ac97/bus.c | 4
sound/ac97/snd_ac97_compat.c | 19 +++
tools/perf/util/auxtrace.c | 3
148 files changed, 1373 insertions(+), 765 deletions(-)
Adrian Hunter (2):
mmc: block: Fix unsupported parallel dispatch of requests
perf auxtrace: Fix queue resize
Alexander Aring (2):
net: 6lowpan: fix reserved space for single frames
net: mac802154: tx: expand tailroom if necessary
Amir Goldstein (2):
ovl: fix wrong use of impure dir cache in ovl_iterate()
nfsd: fix leaked file lock with nfs exported overlayfs
Ard Biesheuvel (1):
crypto: arm64/sm4-ce - check for the right CPU feature bit
Bart Van Assche (9):
blkcg: Introduce blkg_root_lookup()
block: Introduce blk_exit_queue()
block: Ensure that a request queue is dissociated from the cgroup controller
IB/srpt: Fix srpt_cm_req_recv() error path (1/2)
IB/srpt: Fix srpt_cm_req_recv() error path (2/2)
IB/srpt: Support HCAs with more than two ports
ib_srpt: Fix a use-after-free in srpt_close_ch()
ib_srpt: Fix a use-after-free in __srpt_close_all_ch()
RDMA/rxe: Set wqe->status correctly if an unexpected response is received
Bartosz Golaszewski (1):
spi: davinci: fix a NULL pointer dereference
Benjamin Herrenschmidt (1):
powerpc/powernv/pci: Work around races in PCI bridge enabling
Bill Baker (1):
NFSv4 client live hangs after live data migration recovery
Boqun Feng (1):
rcu: Make expedited GPs handle CPU 0 being offline
Chanwoo Choi (1):
extcon: Release locking when sending the notification of connector state
Chirantan Ekbote (1):
9p/net: Fix zero-copy path in the 9p virtio transport
Christian Brauner (1):
getxattr: use correct xattr length
Christophe Leroy (1):
powerpc/nohash: fix pte_access_permitted()
Dan Carpenter (1):
pnfs/blocklayout: off by one in bl_map_stripe()
Dan Williams (1):
mm, dev_pagemap: Do not clear ->mapping on final put
Daniel Mack (1):
libertas: fix suspend and resume for SDIO connected cards
Dave Watson (1):
crypto: aesni - Use unaligned loads from gcm_context_data
David Rivshin (1):
pwm: omap-dmtimer: Return -EPROBE_DEFER if no dmtimer platform data
Dexuan Cui (2):
Drivers: hv: vmbus: Fix the offer_in_progress in vmbus_process_offer()
Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind()
Dmitry Osipenko (1):
iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA
Eddie.Horng (1):
cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias()
Erik Schmauss (1):
ACPICA: AML Parser: skip opcodes that open a scope upon parse failure
Frederic Barrat (1):
ocxl: Fix page fault handler in case of fault on dying process
Greg Kroah-Hartman (2):
eventpoll.h: wrap casts in () properly
Linux 4.18.7
Gustavo A. R. Silva (2):
mailbox: xgene-slimpro: Fix potential NULL pointer dereference
iio: sca3000: Fix missing return in switch
Hans de Goede (1):
i2c: designware: Re-init controllers with pm_disabled set on resume
Hari Bathini (1):
powerpc/fadump: handle crash memory ranges array index overflow
Henry Willard (1):
cpufreq: governor: Avoid accessing invalid governor_data
Horia Geantă (3):
crypto: caam - fix DMA mapping direction for RSA forms 2 & 3
crypto: caam/jr - fix descriptor DMA unmapping
crypto: caam/qi - fix error path in xts setkey
Hou Tao (1):
dm thin: stop no_space_timeout worker when switching to write-mode
Ilya Dryomov (1):
dm cache metadata: set dirty on all cache blocks after a crash
Jacob Pan (2):
iommu/vt-d: Add definitions for PFSID
iommu/vt-d: Fix dev iotlb pfsid use
James Morse (1):
arm64: mm: always enable CONFIG_HOLES_IN_ZONE
Jan Kara (1):
udf: Fix mounting of Win7 created UDF filesystems
Janek Kotas (1):
spi: cadence: Change usleep_range() to udelay(), for atomic context
Jann Horn (2):
sys: don't hold uts_sem while accessing userspace memory
userns: move user access out of the mutex
Jason Gunthorpe (2):
IB/mlx5: Fix leaking stack memory to userspace
overflow.h: Add arithmetic shift helper
Javier Martinez Canillas (1):
media: Revert "[media] tvp5150: fix pad format frame height"
Jeremy Cline (1):
fs/quota: Fix spectre gadget in do_quotactl
Johan Hovold (2):
rtc: omap: fix resource leak in registration error path
rtc: omap: fix potential crash on power off
John Johansen (1):
apparmor: fix bad debug check in apparmor_secid_to_secctx()
Jon Hunter (1):
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Kamalesh Babulal (1):
livepatch: Validate module/old func name length
Keith Busch (1):
libnvdimm: Use max contiguous area for namespace size
Krzysztof Kozlowski (1):
spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe
Lars-Peter Clausen (2):
iio: ad9523: Fix displayed phase
iio: ad9523: Fix return value for ad952x_store()
Leon Romanovsky (1):
RDMA/mlx5: Fix shift overflow in mlx5_ib_create_wq
Lihua Yao (3):
ALSA: ac97: fix device initialization in the compat layer
ALSA: ac97: fix check of pm_runtime_get_sync failure
ALSA: ac97: fix unbalanced pm_runtime_enable
Luke Dashjr (1):
powerpc64/ftrace: Include ftrace.h needed for enable/disable calls
Maciej S. Szmigiero (1):
block, bfq: return nbytes and not zero from struct cftype .write() method
Mahesh Salgaonkar (1):
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
Markus Stockhausen (1):
readahead: stricter check for bdi io_pages
Masahiro Yamada (1):
kconfig: fix "Can't open ..." in parallel build
Max Filippov (2):
xtensa: limit offsets in __loop_cache_{all,page}
xtensa: increase ranges in ___invalidate_{i,d}cache_all
Michel Dänzer (1):
dma-buf: Move BUG_ON from _add_shared_fence to _add_shared_inplace
Mika Westerberg (1):
spi: pxa2xx: Add support for Intel Ice Lake
Mike Snitzer (1):
dm cache metadata: save in-core policy_hint_size to on-disk superblock
Mikulas Patocka (12):
block: fix infinite loop if the device loses discard capability
dm integrity: change 'suspending' variable from bool to int
dm crypt: don't decrease device limits
dm writecache: fix a crash due to reading past end of dirty_bitmap
fb: fix lost console when the user unplugs a USB adapter
udlfb: fix semaphore value leak
udlfb: fix display corruption of the last line
udlfb: don't switch if we are switching to the same videomode
udlfb: set optimal write delay
udlfb: make a local copy of fb_ops
udlfb: handle allocation failure
udlfb: set line_length in dlfb_ops_set_par
Ming Lei (1):
block: really disable runtime-pm for blk-mq
Nadav Amit (4):
vmw_balloon: fix inflation of 64-bit GFNs
vmw_balloon: do not use 2MB without batching
vmw_balloon: VMCI_DOORBELL_SET does not check status
vmw_balloon: fix VMCI use when balloon built into kernel
Nicholas Piggin (1):
powerpc/64s: Fix page table fragment refcount race vs speculative references
Ondrej Mosnacek (1):
crypto: vmx - Fix sleep-in-atomic bugs
Paolo Bonzini (1):
KVM: VMX: fixes for vmentry_l1d_flush module parameter
Parav Pandit (1):
IB/mlx5: Honor cnt_set_id_valid flag instead of set_id
Paul Mackerras (1):
KVM: PPC: Book3S: Fix guest DMA when guest partially backed by THP pages
Peter Kalauskas (1):
drivers/block/zram/zram_drv.c: fix bug storing backing_dev
Peter Zijlstra (1):
mm/tlb: Remove tlb_remove_table() non-concurrent condition
Rafael David Tinoco (1):
mfd: hi655x: Fix regmap area declared size for hi655x
Rafael J. Wysocki (4):
ACPICA: Clear status of all events when entering sleep states
sched: idle: Avoid retaining the tick when it has been stopped
cpuidle: menu: Handle stopped tick more aggressively
cpuidle: menu: Retain tick when shallow state is selected
Ram Pai (6):
powerpc/pkeys: Give all threads control of their key permissions
powerpc/pkeys: Deny read/write/execute by default
powerpc/pkeys: key allocation/deallocation must not change pkey registers
powerpc/pkeys: Save the pkey registers before fork
powerpc/pkeys: Fix calculation of total pkeys.
powerpc/pkeys: Preallocate execute-only key
Richard Weinberger (6):
ubifs: Fix memory leak in lprobs self-check
Revert "UBIFS: Fix potential integer overflow in allocation"
ubifs: Check data node size before truncate
ubifs: xattr: Don't operate on deleted inodes
ubifs: Fix directory size calculation for symlinks
ubifs: Fix synced_i_size calculation for xattr inodes
Roger Quadros (1):
ARM: dts: am57xx-idk: Enable dual role for USB2 port
Sergei Shtylyov (2):
mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts
mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS
Shan Hai (1):
bcache: release dc->writeback_lock properly in bch_writeback_thread()
Steven Rostedt (VMware) (4):
tracing: Do not call start/stop() functions when tracing_on does not change
tracing/blktrace: Fix to allow setting same value
printk/tracing: Do not trace printk_nmi_enter()
uprobes: Use synchronize_rcu() not synchronize_sched()
Tomas Bortoli (3):
9p: fix multiple NULL-pointer-dereferences
net/9p/client.c: version pointer uninitialized
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
Trond Myklebust (2):
NFSv4: Fix locking in pnfs_generic_recover_commit_reqs
NFSv4: Fix a sleep in atomic context in nfs4_callback_sequence()
Tycho Andersen (1):
uart: fix race between uart_put_char() and uart_shutdown()
Vaibhav Jain (1):
cxl: Fix wrong comparison in cxl_adapter_context_get()
Vignesh R (2):
pwm: tiehrpwm: Don't use emulation mode bits to control PWM output
pwm: tiehrpwm: Fix disabling of output of PWMs
Vishal Verma (1):
libnvdimm: fix ars_status output length calculation
Yannik Sembritzki (2):
Replace magic for trusting the secondary keyring with #define
Fix kexec forbidding kernels signed with keys in the secondary keyring to boot
jiangyiwen (1):
9p/virtio: fix off-by-one error in sg list bounds check
piaojun (1):
fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
xiao jin (1):
block: blk_init_allocated_queue() set q->fq as NULL in the fail case
zhangyi (F) (1):
PM / sleep: wakeup: Fix build error caused by missing SRCU support
From: Al Viro <viro(a)zeniv.linux.org.uk>
cls_u32.c misuses refcounts for struct tc_u_hnode - it counts references via
->hlist and via ->tp_root together. u32_destroy() drops the former and, in
case when there had been links, leaves the sucker on the list. As the result,
there's nothing to protect it from getting freed once links are dropped.
That also makes the "is it busy" check incapable of catching the root hnode -
it *is* busy (there's a reference from tp), but we don't see it as something
separate. "Is it our root?" check partially covers that, but the problem
exists for others' roots as well.
AFAICS, the minimal fix preserving the existing behaviour (where it doesn't
include oopsen, that is) would be this:
* count tp->root and tp_c->hlist as separate references. I.e.
have u32_init() set refcount to 2, not 1.
* in u32_destroy() we always drop the former; in u32_destroy_hnode() -
the latter.
That way we have *all* references contributing to refcount. List
removal happens in u32_destroy_hnode() (called only when ->refcnt is 1)
an in u32_destroy() in case of tc_u_common going away, along with everything
reachable from it. IOW, that way we know that u32_destroy_key() won't
free something still on the list (or pointed to by someone's ->root).
Cc: stable(a)vger.kernel.org
Signed-off-by: Al Viro <viro(a)zeniv.linux.org.uk>
---
net/sched/cls_u32.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index f218ccf1e2d9..3f985f29ef30 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -398,6 +398,7 @@ static int u32_init(struct tcf_proto *tp)
rcu_assign_pointer(tp_c->hlist, root_ht);
root_ht->tp_c = tp_c;
+ root_ht->refcnt++;
rcu_assign_pointer(tp->root, root_ht);
tp->data = tp_c;
return 0;
@@ -610,7 +611,7 @@ static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
struct tc_u_hnode __rcu **hn;
struct tc_u_hnode *phn;
- WARN_ON(ht->refcnt);
+ WARN_ON(--ht->refcnt);
u32_clear_hnode(tp, ht, extack);
@@ -649,7 +650,7 @@ static void u32_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
WARN_ON(root_ht == NULL);
- if (root_ht && --root_ht->refcnt == 0)
+ if (root_ht && --root_ht->refcnt == 1)
u32_destroy_hnode(tp, root_ht, extack);
if (--tp_c->refcnt == 0) {
@@ -698,7 +699,6 @@ static int u32_delete(struct tcf_proto *tp, void *arg, bool *last,
}
if (ht->refcnt == 1) {
- ht->refcnt--;
u32_destroy_hnode(tp, ht, extack);
} else {
NL_SET_ERR_MSG_MOD(extack, "Can not delete in-use filter");
--
2.11.0
Hi,
I would like to check if you have received my email from last week?
We are a team of 11 image editors who can help you for cutting out, your
photos, also add retouching.
Editing is for your products photos or portrait photos, catalog photos.
Let me know if you have interests, we can send you testing work.
Thanks,
Denis Jones
Commit 822fb18a82aba ("xen-netfront: wait xenbus state change when load
module manually") added a new wait queue to wait on for a state change
when the module is loaded manually. Unfortunately there is no wakeup
anywhere to stop that waiting.
Instead of introducing a new wait queue rename the existing
module_unload_q to module_wq and use it for both purposes (loading and
unloading).
As any state change of the backend might be intended to stop waiting
do the wake_up_all() in any case when netback_changed() is called.
Fixes: 822fb18a82aba ("xen-netfront: wait xenbus state change when load module manually")
Cc: <stable(a)vger.kernel.org> #4.18
Signed-off-by: Juergen Gross <jgross(a)suse.com>
---
drivers/net/xen-netfront.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 73f596a90c69..9407acbd19a9 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -87,8 +87,7 @@ struct netfront_cb {
/* IRQ name is queue name with "-tx" or "-rx" appended */
#define IRQ_NAME_SIZE (QUEUE_NAME_SIZE + 3)
-static DECLARE_WAIT_QUEUE_HEAD(module_load_q);
-static DECLARE_WAIT_QUEUE_HEAD(module_unload_q);
+static DECLARE_WAIT_QUEUE_HEAD(module_wq);
struct netfront_stats {
u64 packets;
@@ -1332,11 +1331,11 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
netif_carrier_off(netdev);
xenbus_switch_state(dev, XenbusStateInitialising);
- wait_event(module_load_q,
- xenbus_read_driver_state(dev->otherend) !=
- XenbusStateClosed &&
- xenbus_read_driver_state(dev->otherend) !=
- XenbusStateUnknown);
+ wait_event(module_wq,
+ xenbus_read_driver_state(dev->otherend) !=
+ XenbusStateClosed &&
+ xenbus_read_driver_state(dev->otherend) !=
+ XenbusStateUnknown);
return netdev;
exit:
@@ -2010,15 +2009,14 @@ static void netback_changed(struct xenbus_device *dev,
dev_dbg(&dev->dev, "%s\n", xenbus_strstate(backend_state));
+ wake_up_all(&module_wq);
+
switch (backend_state) {
case XenbusStateInitialising:
case XenbusStateInitialised:
case XenbusStateReconfiguring:
case XenbusStateReconfigured:
- break;
-
case XenbusStateUnknown:
- wake_up_all(&module_unload_q);
break;
case XenbusStateInitWait:
@@ -2034,12 +2032,10 @@ static void netback_changed(struct xenbus_device *dev,
break;
case XenbusStateClosed:
- wake_up_all(&module_unload_q);
if (dev->state == XenbusStateClosed)
break;
/* Missed the backend's CLOSING state -- fallthrough */
case XenbusStateClosing:
- wake_up_all(&module_unload_q);
xenbus_frontend_closed(dev);
break;
}
@@ -2147,14 +2143,14 @@ static int xennet_remove(struct xenbus_device *dev)
if (xenbus_read_driver_state(dev->otherend) != XenbusStateClosed) {
xenbus_switch_state(dev, XenbusStateClosing);
- wait_event(module_unload_q,
+ wait_event(module_wq,
xenbus_read_driver_state(dev->otherend) ==
XenbusStateClosing ||
xenbus_read_driver_state(dev->otherend) ==
XenbusStateUnknown);
xenbus_switch_state(dev, XenbusStateClosed);
- wait_event(module_unload_q,
+ wait_event(module_wq,
xenbus_read_driver_state(dev->otherend) ==
XenbusStateClosed ||
xenbus_read_driver_state(dev->otherend) ==
--
2.16.4
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 50229128727f7e11840ca1b2b501f880818d56b6 Mon Sep 17 00:00:00 2001
From: Dexuan Cui <decui(a)microsoft.com>
Date: Tue, 5 Jun 2018 13:37:52 -0700
Subject: [PATCH] Drivers: hv: vmbus: Fix the offer_in_progress in
vmbus_process_offer()
I didn't really hit a real bug, but just happened to spot the bug:
we have decreased the counter at the beginning of vmbus_process_offer(),
so we mustn't decrease it again.
Fixes: 6f3d791f3006 ("Drivers: hv: vmbus: Fix rescind handling issues")
Signed-off-by: Dexuan Cui <decui(a)microsoft.com>
Cc: stable(a)vger.kernel.org
Cc: Stephen Hemminger <sthemmin(a)microsoft.com>
Cc: K. Y. Srinivasan <kys(a)microsoft.com>
Cc: Stable <stable(a)vger.kernel.org> # 4.14 and above
Signed-off-by: K. Y. Srinivasan <kys(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index ecc2bd275a73..f3b551a50653 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -527,10 +527,8 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
struct hv_device *dev
= newchannel->primary_channel->device_obj;
- if (vmbus_add_channel_kobj(dev, newchannel)) {
- atomic_dec(&vmbus_connection.offer_in_progress);
+ if (vmbus_add_channel_kobj(dev, newchannel))
goto err_free_chan;
- }
if (channel->sc_creation_callback != NULL)
channel->sc_creation_callback(newchannel);
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From d1c392c9e2a301f38998a353f467f76414e38725 Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (VMware)" <rostedt(a)goodmis.org>
Date: Wed, 5 Sep 2018 16:29:49 -0400
Subject: [PATCH] printk/tracing: Do not trace printk_nmi_enter()
I hit the following splat in my tests:
------------[ cut here ]------------
IRQs not enabled as expected
WARNING: CPU: 3 PID: 0 at kernel/time/tick-sched.c:982 tick_nohz_idle_enter+0x44/0x8c
Modules linked in: ip6t_REJECT nf_reject_ipv6 ip6table_filter ip6_tables ipv6
CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.19.0-rc2-test+ #2
Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 02/22/2014
EIP: tick_nohz_idle_enter+0x44/0x8c
Code: ec 05 00 00 00 75 26 83 b8 c0 05 00 00 00 75 1d 80 3d d0 36 3e c1 00
75 14 68 94 63 12 c1 c6 05 d0 36 3e c1 01 e8 04 ee f8 ff <0f> 0b 58 fa bb a0
e5 66 c1 e8 25 0f 04 00 64 03 1d 28 31 52 c1 8b
EAX: 0000001c EBX: f26e7f8c ECX: 00000006 EDX: 00000007
ESI: f26dd1c0 EDI: 00000000 EBP: f26e7f40 ESP: f26e7f38
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010296
CR0: 80050033 CR2: 0813c6b0 CR3: 2f342000 CR4: 001406f0
Call Trace:
do_idle+0x33/0x202
cpu_startup_entry+0x61/0x63
start_secondary+0x18e/0x1ed
startup_32_smp+0x164/0x168
irq event stamp: 18773830
hardirqs last enabled at (18773829): [<c040150c>] trace_hardirqs_on_thunk+0xc/0x10
hardirqs last disabled at (18773830): [<c040151c>] trace_hardirqs_off_thunk+0xc/0x10
softirqs last enabled at (18773824): [<c0ddaa6f>] __do_softirq+0x25f/0x2bf
softirqs last disabled at (18773767): [<c0416bbe>] call_on_stack+0x45/0x4b
---[ end trace b7c64aa79e17954a ]---
After a bit of debugging, I found what was happening. This would trigger
when performing "perf" with a high NMI interrupt rate, while enabling and
disabling function tracer. Ftrace uses breakpoints to convert the nops at
the start of functions to calls to the function trampolines. The breakpoint
traps disable interrupts and this makes calls into lockdep via the
trace_hardirqs_off_thunk in the entry.S code. What happens is the following:
do_idle {
[interrupts enabled]
<interrupt> [interrupts disabled]
TRACE_IRQS_OFF [lockdep says irqs off]
[...]
TRACE_IRQS_IRET
test if pt_regs say return to interrupts enabled [yes]
TRACE_IRQS_ON [lockdep says irqs are on]
<nmi>
nmi_enter() {
printk_nmi_enter() [traced by ftrace]
[ hit ftrace breakpoint ]
<breakpoint exception>
TRACE_IRQS_OFF [lockdep says irqs off]
[...]
TRACE_IRQS_IRET [return from breakpoint]
test if pt_regs say interrupts enabled [no]
[iret back to interrupt]
[iret back to code]
tick_nohz_idle_enter() {
lockdep_assert_irqs_enabled() [lockdep say no!]
Although interrupts are indeed enabled, lockdep thinks it is not, and since
we now do asserts via lockdep, it gives a false warning. The issue here is
that printk_nmi_enter() is called before lockdep_off(), which disables
lockdep (for this reason) in NMIs. By simply not allowing ftrace to see
printk_nmi_enter() (via notrace annotation) we keep lockdep from getting
confused.
Cc: stable(a)vger.kernel.org
Fixes: 42a0bb3f71383 ("printk/nmi: generic solution for safe printk in NMI")
Acked-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
Acked-by: Petr Mladek <pmladek(a)suse.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c
index a0a74c533e4b..0913b4d385de 100644
--- a/kernel/printk/printk_safe.c
+++ b/kernel/printk/printk_safe.c
@@ -306,12 +306,12 @@ static __printf(1, 0) int vprintk_nmi(const char *fmt, va_list args)
return printk_safe_log_store(s, fmt, args);
}
-void printk_nmi_enter(void)
+void notrace printk_nmi_enter(void)
{
this_cpu_or(printk_context, PRINTK_NMI_CONTEXT_MASK);
}
-void printk_nmi_exit(void)
+void notrace printk_nmi_exit(void)
{
this_cpu_and(printk_context, ~PRINTK_NMI_CONTEXT_MASK);
}
The patch below does not apply to the 3.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 95a22d2084d72ea067d8323cc85677dba5d97cae Mon Sep 17 00:00:00 2001
From: Richard Weinberger <richard(a)nod.at>
Date: Sun, 1 Jul 2018 23:20:51 +0200
Subject: [PATCH] ubifs: Check data node size before truncate
Check whether the size is within bounds before using it.
If the size is not correct, abort and dump the bad data node.
Cc: Kees Cook <keescook(a)chromium.org>
Cc: Silvio Cesare <silvio.cesare(a)gmail.com>
Cc: stable(a)vger.kernel.org
Fixes: 1e51764a3c2ac ("UBIFS: add new flash file system")
Reported-by: Silvio Cesare <silvio.cesare(a)gmail.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
Reviewed-by: Kees Cook <keescook(a)chromium.org>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index 1406765c3ef9..cef0d76d490a 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -1393,7 +1393,16 @@ int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,
else if (err)
goto out_free;
else {
- if (le32_to_cpu(dn->size) <= dlen)
+ int dn_len = le32_to_cpu(dn->size);
+
+ if (dn_len <= 0 || dn_len > UBIFS_BLOCK_SIZE) {
+ ubifs_err(c, "bad data node (block %u, inode %lu)",
+ blk, inode->i_ino);
+ ubifs_dump_node(c, dn);
+ goto out_free;
+ }
+
+ if (dn_len <= dlen)
dlen = 0; /* Nothing to do */
else {
err = truncate_data_node(c, inode, blk, dn, &dlen);
From: Marc Zyngier <marc.zyngier(a)arm.com>
If trapping FPSIMD in the context of an AArch32 guest, it is critical
to set FPEXC32_EL2.EN to 1 so that the trapping is taken to EL2 and
not EL1.
Conversely, it is just as critical *not* to set FPEXC32_EL2.EN to 1
if we're not going to trap FPSIMD, as we then corrupt the existing
VFP state.
Moving the call to __activate_traps_fpsimd32 to the point where we
know for sure that we are going to trap ensures that we don't set that
bit spuriously.
Fixes: e6b673b741ea ("KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing")
Cc: stable(a)vger.kernel.org # v4.18
Cc: Dave Martin <dave.martin(a)arm.com>
Reported-by: Alexander Graf <agraf(a)suse.de>
Tested-by: Alexander Graf <agraf(a)suse.de>
Signed-off-by: Marc Zyngier <marc.zyngier(a)arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall(a)arm.com>
---
arch/arm64/kvm/hyp/switch.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
index d496ef579859..ca46153d7915 100644
--- a/arch/arm64/kvm/hyp/switch.c
+++ b/arch/arm64/kvm/hyp/switch.c
@@ -98,8 +98,10 @@ static void activate_traps_vhe(struct kvm_vcpu *vcpu)
val = read_sysreg(cpacr_el1);
val |= CPACR_EL1_TTA;
val &= ~CPACR_EL1_ZEN;
- if (!update_fp_enabled(vcpu))
+ if (!update_fp_enabled(vcpu)) {
val &= ~CPACR_EL1_FPEN;
+ __activate_traps_fpsimd32(vcpu);
+ }
write_sysreg(val, cpacr_el1);
@@ -114,8 +116,10 @@ static void __hyp_text __activate_traps_nvhe(struct kvm_vcpu *vcpu)
val = CPTR_EL2_DEFAULT;
val |= CPTR_EL2_TTA | CPTR_EL2_TZ;
- if (!update_fp_enabled(vcpu))
+ if (!update_fp_enabled(vcpu)) {
val |= CPTR_EL2_TFP;
+ __activate_traps_fpsimd32(vcpu);
+ }
write_sysreg(val, cptr_el2);
}
@@ -129,7 +133,6 @@ static void __hyp_text __activate_traps(struct kvm_vcpu *vcpu)
if (cpus_have_const_cap(ARM64_HAS_RAS_EXTN) && (hcr & HCR_VSE))
write_sysreg_s(vcpu->arch.vsesr_el2, SYS_VSESR_EL2);
- __activate_traps_fpsimd32(vcpu);
if (has_vhe())
activate_traps_vhe(vcpu);
else
--
2.18.0
From: Marc Zyngier <marc.zyngier(a)arm.com>
When triggering a CoW, we unmap the RO page via an MMU notifier
(invalidate_range_start), and then populate the new PTE using another
one (change_pte). In the meantime, we'll have copied the old page
into the new one.
The problem is that the data for the new page is sitting in the
cache, and should the guest have an uncached mapping to that page
(or its MMU off), following accesses will bypass the cache.
In a way, this is similar to what happens on a translation fault:
We need to clean the page to the PoC before mapping it. So let's just
do that.
This fixes a KVM unit test regression observed on a HiSilicon platform,
and subsequently reproduced on Seattle.
Fixes: a9c0e12ebee5 ("KVM: arm/arm64: Only clean the dcache on translation fault")
Cc: stable(a)vger.kernel.org # v4.16+
Reported-by: Mike Galbraith <efault(a)gmx.de>
Signed-off-by: Marc Zyngier <marc.zyngier(a)arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall(a)arm.com>
---
virt/kvm/arm/mmu.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
index 91aaf73b00df..111a660be3be 100644
--- a/virt/kvm/arm/mmu.c
+++ b/virt/kvm/arm/mmu.c
@@ -1860,13 +1860,20 @@ static int kvm_set_spte_handler(struct kvm *kvm, gpa_t gpa, u64 size, void *data
void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
{
unsigned long end = hva + PAGE_SIZE;
+ kvm_pfn_t pfn = pte_pfn(pte);
pte_t stage2_pte;
if (!kvm->arch.pgd)
return;
trace_kvm_set_spte_hva(hva);
- stage2_pte = pfn_pte(pte_pfn(pte), PAGE_S2);
+
+ /*
+ * We've moved a page around, probably through CoW, so let's treat it
+ * just like a translation fault and clean the cache to the PoC.
+ */
+ clean_dcache_guest_page(pfn, PAGE_SIZE);
+ stage2_pte = pfn_pte(pfn, PAGE_S2);
handle_hva_to_gpa(kvm, hva, end, &kvm_set_spte_handler, &stage2_pte);
}
--
2.18.0
The patch below does not apply to the 3.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From aa49d628f6e016bcec8c6f8e704b9b18ee697329 Mon Sep 17 00:00:00 2001
From: Vignesh R <vigneshr(a)ti.com>
Date: Mon, 11 Jun 2018 11:39:55 +0530
Subject: [PATCH] pwm: tiehrpwm: Don't use emulation mode bits to control PWM
output
As per AM335x TRM SPRUH73P "15.2.2.11 ePWM Behavior During Emulation",
TBCTL[15:14] only have effect during emulation suspend events (IOW,
to stop PWM when debugging using a debugger). These bits have no effect
on PWM output during normal running of system. Hence, remove code
accessing these bits as they have no role in enabling/disabling PWMs.
Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM")
Cc: stable(a)vger.kernel.org
Signed-off-by: Vignesh R <vigneshr(a)ti.com>
Signed-off-by: Thierry Reding <thierry.reding(a)gmail.com>
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 4c22cb395040..768176f54d5e 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -33,10 +33,6 @@
#define TBCTL 0x00
#define TBPRD 0x0A
-#define TBCTL_RUN_MASK (BIT(15) | BIT(14))
-#define TBCTL_STOP_NEXT 0
-#define TBCTL_STOP_ON_CYCLE BIT(14)
-#define TBCTL_FREE_RUN (BIT(15) | BIT(14))
#define TBCTL_PRDLD_MASK BIT(3)
#define TBCTL_PRDLD_SHDW 0
#define TBCTL_PRDLD_IMDT BIT(3)
@@ -360,7 +356,7 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
/* Channels polarity can be configured from action qualifier module */
configure_polarity(pc, pwm->hwpwm);
- /* Enable TBCLK before enabling PWM device */
+ /* Enable TBCLK */
ret = clk_enable(pc->tbclk);
if (ret) {
dev_err(chip->dev, "Failed to enable TBCLK for %s: %d\n",
@@ -368,9 +364,6 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
return ret;
}
- /* Enable time counter for free_run */
- ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_FREE_RUN);
-
return 0;
}
@@ -400,9 +393,6 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
/* Disabling TBCLK on PWM disable */
clk_disable(pc->tbclk);
- /* Stop Time base counter */
- ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_STOP_NEXT);
-
/* Disable clock on PWM disable */
pm_runtime_put_sync(chip->dev);
}
The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From aa49d628f6e016bcec8c6f8e704b9b18ee697329 Mon Sep 17 00:00:00 2001
From: Vignesh R <vigneshr(a)ti.com>
Date: Mon, 11 Jun 2018 11:39:55 +0530
Subject: [PATCH] pwm: tiehrpwm: Don't use emulation mode bits to control PWM
output
As per AM335x TRM SPRUH73P "15.2.2.11 ePWM Behavior During Emulation",
TBCTL[15:14] only have effect during emulation suspend events (IOW,
to stop PWM when debugging using a debugger). These bits have no effect
on PWM output during normal running of system. Hence, remove code
accessing these bits as they have no role in enabling/disabling PWMs.
Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM")
Cc: stable(a)vger.kernel.org
Signed-off-by: Vignesh R <vigneshr(a)ti.com>
Signed-off-by: Thierry Reding <thierry.reding(a)gmail.com>
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 4c22cb395040..768176f54d5e 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -33,10 +33,6 @@
#define TBCTL 0x00
#define TBPRD 0x0A
-#define TBCTL_RUN_MASK (BIT(15) | BIT(14))
-#define TBCTL_STOP_NEXT 0
-#define TBCTL_STOP_ON_CYCLE BIT(14)
-#define TBCTL_FREE_RUN (BIT(15) | BIT(14))
#define TBCTL_PRDLD_MASK BIT(3)
#define TBCTL_PRDLD_SHDW 0
#define TBCTL_PRDLD_IMDT BIT(3)
@@ -360,7 +356,7 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
/* Channels polarity can be configured from action qualifier module */
configure_polarity(pc, pwm->hwpwm);
- /* Enable TBCLK before enabling PWM device */
+ /* Enable TBCLK */
ret = clk_enable(pc->tbclk);
if (ret) {
dev_err(chip->dev, "Failed to enable TBCLK for %s: %d\n",
@@ -368,9 +364,6 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
return ret;
}
- /* Enable time counter for free_run */
- ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_FREE_RUN);
-
return 0;
}
@@ -400,9 +393,6 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
/* Disabling TBCLK on PWM disable */
clk_disable(pc->tbclk);
- /* Stop Time base counter */
- ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_STOP_NEXT);
-
/* Disable clock on PWM disable */
pm_runtime_put_sync(chip->dev);
}
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From aa49d628f6e016bcec8c6f8e704b9b18ee697329 Mon Sep 17 00:00:00 2001
From: Vignesh R <vigneshr(a)ti.com>
Date: Mon, 11 Jun 2018 11:39:55 +0530
Subject: [PATCH] pwm: tiehrpwm: Don't use emulation mode bits to control PWM
output
As per AM335x TRM SPRUH73P "15.2.2.11 ePWM Behavior During Emulation",
TBCTL[15:14] only have effect during emulation suspend events (IOW,
to stop PWM when debugging using a debugger). These bits have no effect
on PWM output during normal running of system. Hence, remove code
accessing these bits as they have no role in enabling/disabling PWMs.
Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM")
Cc: stable(a)vger.kernel.org
Signed-off-by: Vignesh R <vigneshr(a)ti.com>
Signed-off-by: Thierry Reding <thierry.reding(a)gmail.com>
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 4c22cb395040..768176f54d5e 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -33,10 +33,6 @@
#define TBCTL 0x00
#define TBPRD 0x0A
-#define TBCTL_RUN_MASK (BIT(15) | BIT(14))
-#define TBCTL_STOP_NEXT 0
-#define TBCTL_STOP_ON_CYCLE BIT(14)
-#define TBCTL_FREE_RUN (BIT(15) | BIT(14))
#define TBCTL_PRDLD_MASK BIT(3)
#define TBCTL_PRDLD_SHDW 0
#define TBCTL_PRDLD_IMDT BIT(3)
@@ -360,7 +356,7 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
/* Channels polarity can be configured from action qualifier module */
configure_polarity(pc, pwm->hwpwm);
- /* Enable TBCLK before enabling PWM device */
+ /* Enable TBCLK */
ret = clk_enable(pc->tbclk);
if (ret) {
dev_err(chip->dev, "Failed to enable TBCLK for %s: %d\n",
@@ -368,9 +364,6 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
return ret;
}
- /* Enable time counter for free_run */
- ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_FREE_RUN);
-
return 0;
}
@@ -400,9 +393,6 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
/* Disabling TBCLK on PWM disable */
clk_disable(pc->tbclk);
- /* Stop Time base counter */
- ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_STOP_NEXT);
-
/* Disable clock on PWM disable */
pm_runtime_put_sync(chip->dev);
}
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From ea93102f32244e3f45c8b26260be77ed0cc1d16c Mon Sep 17 00:00:00 2001
From: Yannik Sembritzki <yannik(a)sembritzki.me>
Date: Thu, 16 Aug 2018 14:05:23 +0100
Subject: [PATCH] Fix kexec forbidding kernels signed with keys in the
secondary keyring to boot
The split of .system_keyring into .builtin_trusted_keys and
.secondary_trusted_keys broke kexec, thereby preventing kernels signed by
keys which are now in the secondary keyring from being kexec'd.
Fix this by passing VERIFY_USE_SECONDARY_KEYRING to
verify_pefile_signature().
Fixes: d3bfe84129f6 ("certs: Add a secondary system keyring that can be added to dynamically")
Signed-off-by: Yannik Sembritzki <yannik(a)sembritzki.me>
Signed-off-by: David Howells <dhowells(a)redhat.com>
Cc: kexec(a)lists.infradead.org
Cc: keyrings(a)vger.kernel.org
Cc: linux-security-module(a)vger.kernel.org
Cc: stable(a)kernel.org
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index 7326078eaa7a..278cd07228dd 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -532,7 +532,7 @@ static int bzImage64_cleanup(void *loader_data)
static int bzImage64_verify_sig(const char *kernel, unsigned long kernel_len)
{
return verify_pefile_signature(kernel, kernel_len,
- NULL,
+ VERIFY_USE_SECONDARY_KEYRING,
VERIFYING_KEXEC_PE_SIGNATURE);
}
#endif
On Wed, Sep 05, 2018 at 01:35:15PM +0200, Valentin Vidic wrote:
> > AFAICT, this will cause the backend to never switch to 'Closed' state
> > until the toolstack sets online to 0, which is not good IMO.
> >
> > If for example a frontend decides to close a device, the backend will
> > stay in state 'Closing' until the toolstack actually removes the disk
> > by setting online to 0.
> >
> > This will prevent resetting blk connections, as blkback will refuse to
> > switch to state XenbusStateInitWait unless it's at XenbusStateClosed
> > (see the XenbusStateInitialising case in frontend_changed), which will
> > never be reached with your patch.
Would it be possible to call xen_vbd_free before the state change?
case XenbusStateClosed:
xen_blkif_disconnect(be->blkif);
xen_vbd_free(&be->blkif->vbd);
xenbus_switch_state(dev, XenbusStateClosed);
--
Valentin
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 2a3eb51e30b9ac66fe1b75877627a7e4aaeca24a Mon Sep 17 00:00:00 2001
From: Henry Willard <henry.willard(a)oracle.com>
Date: Tue, 14 Aug 2018 17:01:02 -0700
Subject: [PATCH] cpufreq: governor: Avoid accessing invalid governor_data
If cppc_cpufreq.ko is deleted at the same time that tuned-adm is
changing profiles, there is a small chance that a race can occur
between cpufreq_dbs_governor_exit() and cpufreq_dbs_governor_limits()
resulting in a system failure when the latter tries to use
policy->governor_data that has been freed by the former.
This patch uses gov_dbs_data_mutex to synchronize access.
Fixes: e788892ba3cc (cpufreq: governor: Get rid of governor events)
Signed-off-by: Henry Willard <henry.willard(a)oracle.com>
[ rjw: Subject, minor white space adjustment ]
Cc: 4.8+ <stable(a)vger.kernel.org> # 4.8+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 1d50e97d49f1..6d53f7d9fc7a 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -555,12 +555,20 @@ EXPORT_SYMBOL_GPL(cpufreq_dbs_governor_stop);
void cpufreq_dbs_governor_limits(struct cpufreq_policy *policy)
{
- struct policy_dbs_info *policy_dbs = policy->governor_data;
+ struct policy_dbs_info *policy_dbs;
+
+ /* Protect gov->gdbs_data against cpufreq_dbs_governor_exit() */
+ mutex_lock(&gov_dbs_data_mutex);
+ policy_dbs = policy->governor_data;
+ if (!policy_dbs)
+ goto out;
mutex_lock(&policy_dbs->update_mutex);
cpufreq_policy_apply_limits(policy);
gov_update_sample_delay(policy_dbs, 0);
-
mutex_unlock(&policy_dbs->update_mutex);
+
+out:
+ mutex_unlock(&gov_dbs_data_mutex);
}
EXPORT_SYMBOL_GPL(cpufreq_dbs_governor_limits);
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 817aef260037f33ee0f44c17fe341323d3aebd6d Mon Sep 17 00:00:00 2001
From: Yannik Sembritzki <yannik(a)sembritzki.me>
Date: Thu, 16 Aug 2018 14:05:10 +0100
Subject: [PATCH] Replace magic for trusting the secondary keyring with #define
Replace the use of a magic number that indicates that verify_*_signature()
should use the secondary keyring with a symbol.
Signed-off-by: Yannik Sembritzki <yannik(a)sembritzki.me>
Signed-off-by: David Howells <dhowells(a)redhat.com>
Cc: keyrings(a)vger.kernel.org
Cc: linux-security-module(a)vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
diff --git a/certs/system_keyring.c b/certs/system_keyring.c
index 6251d1b27f0c..81728717523d 100644
--- a/certs/system_keyring.c
+++ b/certs/system_keyring.c
@@ -15,6 +15,7 @@
#include <linux/cred.h>
#include <linux/err.h>
#include <linux/slab.h>
+#include <linux/verification.h>
#include <keys/asymmetric-type.h>
#include <keys/system_keyring.h>
#include <crypto/pkcs7.h>
@@ -230,7 +231,7 @@ int verify_pkcs7_signature(const void *data, size_t len,
if (!trusted_keys) {
trusted_keys = builtin_trusted_keys;
- } else if (trusted_keys == (void *)1UL) {
+ } else if (trusted_keys == VERIFY_USE_SECONDARY_KEYRING) {
#ifdef CONFIG_SECONDARY_TRUSTED_KEYRING
trusted_keys = secondary_trusted_keys;
#else
diff --git a/crypto/asymmetric_keys/pkcs7_key_type.c b/crypto/asymmetric_keys/pkcs7_key_type.c
index e284d9cb9237..5b2f6a2b5585 100644
--- a/crypto/asymmetric_keys/pkcs7_key_type.c
+++ b/crypto/asymmetric_keys/pkcs7_key_type.c
@@ -63,7 +63,7 @@ static int pkcs7_preparse(struct key_preparsed_payload *prep)
return verify_pkcs7_signature(NULL, 0,
prep->data, prep->datalen,
- (void *)1UL, usage,
+ VERIFY_USE_SECONDARY_KEYRING, usage,
pkcs7_view_content, prep);
}
diff --git a/include/linux/verification.h b/include/linux/verification.h
index a10549a6c7cd..cfa4730d607a 100644
--- a/include/linux/verification.h
+++ b/include/linux/verification.h
@@ -12,6 +12,12 @@
#ifndef _LINUX_VERIFICATION_H
#define _LINUX_VERIFICATION_H
+/*
+ * Indicate that both builtin trusted keys and secondary trusted keys
+ * should be used.
+ */
+#define VERIFY_USE_SECONDARY_KEYRING ((struct key *)1UL)
+
/*
* The use to which an asymmetric key is being put.
*/
I didn't receive any replies on this, and it doesn't seem to have made
it into the latest 3.18 or 4.4 releases. Previously sent on Aug 23rd:
https://lists.linaro.org/pipermail/linux-stable-mirror/2018-August/056347.h…
I assume I sent it wrong; maybe missing keywords or recipients? If
anyone can tell me what I missed, I'd appreciate it.
Trivial backport of commit 3e536e222f293053; newer kernels have simply
moved the vararg macros.
Testing: 3.18 and 4.4 booted OK in qemu.
>8------------------------------------------------------8<
[backport of commit 3e536e222f293053 from mainline]
There is a window for racing when printing directly to task->comm,
allowing other threads to see a non-terminated string. The vsnprintf
function fills the buffer, counts the truncated chars, then finally
writes the \0 at the end.
creator other
vsnprintf:
fill (not terminated)
count the rest trace_sched_waking(p):
... memcpy(comm, p->comm, TASK_COMM_LEN)
write \0
The consequences depend on how 'other' uses the string. In our case,
it was copied into the tracing system's saved cmdlines, a buffer of
adjacent TASK_COMM_LEN-byte buffers (note the 'n' where 0 should be):
crash-arm64> x/1024s savedcmd->saved_cmdlines | grep 'evenk'
0xffffffd5b3818640: "irq/497-pwr_evenkworker/u16:12"
...and a strcpy out of there would cause stack corruption:
[224761.522292] Kernel panic - not syncing: stack-protector:
Kernel stack is corrupted in: ffffff9bf9783c78
crash-arm64> kbt | grep 'comm\|trace_print_context'
#6 0xffffff9bf9783c78 in trace_print_context+0x18c(+396)
comm (char [16]) = "irq/497-pwr_even"
crash-arm64> rd 0xffffffd4d0e17d14 8
ffffffd4d0e17d14: 2f71726900000000 5f7277702d373934 ....irq/497-pwr_
ffffffd4d0e17d24: 726f776b6e657665 3a3631752f72656b evenkworker/u16:
ffffffd4d0e17d34: f9780248ff003231 cede60e0ffffff9b 12..H.x......`..
ffffffd4d0e17d44: cede60c8ffffffd4 00000fffffffffd4 .....`..........
The workaround in e09e28671 (use strlcpy in __trace_find_cmdline) was
likely needed because of this same bug.
Solved by vsnprintf:ing to a local buffer, then using set_task_comm().
This way, there won't be a window where comm is not terminated.
Cc: stable(a)vger.kernel.org
Fixes: bc0c38d139ec7 ("ftrace: latency tracer infrastructure")
Reviewed-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
[backported to 3.18 / 4.4 by Snild]
Signed-off-by: Snild Dolkow <snild(a)sony.com>
---
kernel/kthread.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 850b255..ac6849e 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -313,10 +313,16 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
task = create->result;
if (!IS_ERR(task)) {
static const struct sched_param param = { .sched_priority = 0 };
+ char name[TASK_COMM_LEN];
va_list args;
va_start(args, namefmt);
- vsnprintf(task->comm, sizeof(task->comm), namefmt, args);
+ /*
+ * task is already visible to other tasks, so updating
+ * COMM must be protected.
+ */
+ vsnprintf(name, sizeof(name), namefmt, args);
+ set_task_comm(task, name);
va_end(args);
/*
* root may have changed our (kthreadd's) priority or CPU mask.
--
2.7.4
Trivial backport of commit 3e536e222f293053; newer kernels have simply
moved the vararg macros.
Testing: 3.18 and 4.4 booted OK in qemu.
>8------------------------------------------------------8<
[backport of commit 3e536e222f293053 from mainline]
There is a window for racing when printing directly to task->comm,
allowing other threads to see a non-terminated string. The vsnprintf
function fills the buffer, counts the truncated chars, then finally
writes the \0 at the end.
creator other
vsnprintf:
fill (not terminated)
count the rest trace_sched_waking(p):
... memcpy(comm, p->comm, TASK_COMM_LEN)
write \0
The consequences depend on how 'other' uses the string. In our case,
it was copied into the tracing system's saved cmdlines, a buffer of
adjacent TASK_COMM_LEN-byte buffers (note the 'n' where 0 should be):
crash-arm64> x/1024s savedcmd->saved_cmdlines | grep 'evenk'
0xffffffd5b3818640: "irq/497-pwr_evenkworker/u16:12"
...and a strcpy out of there would cause stack corruption:
[224761.522292] Kernel panic - not syncing: stack-protector:
Kernel stack is corrupted in: ffffff9bf9783c78
crash-arm64> kbt | grep 'comm\|trace_print_context'
#6 0xffffff9bf9783c78 in trace_print_context+0x18c(+396)
comm (char [16]) = "irq/497-pwr_even"
crash-arm64> rd 0xffffffd4d0e17d14 8
ffffffd4d0e17d14: 2f71726900000000 5f7277702d373934 ....irq/497-pwr_
ffffffd4d0e17d24: 726f776b6e657665 3a3631752f72656b evenkworker/u16:
ffffffd4d0e17d34: f9780248ff003231 cede60e0ffffff9b 12..H.x......`..
ffffffd4d0e17d44: cede60c8ffffffd4 00000fffffffffd4 .....`..........
The workaround in e09e28671 (use strlcpy in __trace_find_cmdline) was
likely needed because of this same bug.
Solved by vsnprintf:ing to a local buffer, then using set_task_comm().
This way, there won't be a window where comm is not terminated.
Cc: stable(a)vger.kernel.org
Fixes: bc0c38d139ec7 ("ftrace: latency tracer infrastructure")
Reviewed-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
[backported to 3.18 / 4.4 by Snild]
Signed-off-by: Snild Dolkow <snild(a)sony.com>
---
kernel/kthread.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 850b255..ac6849e 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -313,10 +313,16 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
task = create->result;
if (!IS_ERR(task)) {
static const struct sched_param param = { .sched_priority = 0 };
+ char name[TASK_COMM_LEN];
va_list args;
va_start(args, namefmt);
- vsnprintf(task->comm, sizeof(task->comm), namefmt, args);
+ /*
+ * task is already visible to other tasks, so updating
+ * COMM must be protected.
+ */
+ vsnprintf(name, sizeof(name), namefmt, args);
+ set_task_comm(task, name);
va_end(args);
/*
* root may have changed our (kthreadd's) priority or CPU mask.
--
2.7.4
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 8a9dbb779fe882325b9a0238494a7afaff2eb444 Mon Sep 17 00:00:00 2001
From: Chanwoo Choi <cw00.choi(a)samsung.com>
Date: Thu, 14 Jun 2018 11:16:29 +0900
Subject: [PATCH] extcon: Release locking when sending the notification of
connector state
Previously, extcon used the spinlock before calling the notifier_call_chain
to prevent the scheduled out of task and to prevent the notification delay.
When spinlock is locked for sending the notification, deadlock issue
occured on the side of extcon consumer device. To fix this issue,
extcon consumer device should always use the work. it is always not
reasonable to use work.
To fix this issue on extcon consumer device, release locking when sending
the notification of connector state.
Fixes: ab11af049f88 ("extcon: Add the synchronization extcon APIs to support the notification")
Cc: stable(a)vger.kernel.org
Cc: Roger Quadros <rogerq(a)ti.com>
Cc: Kishon Vijay Abraham I <kishon(a)ti.com>
Signed-off-by: Chanwoo Choi <cw00.choi(a)samsung.com>
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index af83ad58819c..b9d27c8fe57e 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -433,8 +433,8 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
return index;
spin_lock_irqsave(&edev->lock, flags);
-
state = !!(edev->state & BIT(index));
+ spin_unlock_irqrestore(&edev->lock, flags);
/*
* Call functions in a raw notifier chain for the specific one
@@ -448,6 +448,7 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
*/
raw_notifier_call_chain(&edev->nh_all, state, edev);
+ spin_lock_irqsave(&edev->lock, flags);
/* This could be in interrupt handler */
prop_buf = (char *)get_zeroed_page(GFP_ATOMIC);
if (!prop_buf) {
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 5b1fe7bec8a8d0cc547a22e7ddc2bd59acd67de4 Mon Sep 17 00:00:00 2001
From: Ilya Dryomov <idryomov(a)gmail.com>
Date: Thu, 9 Aug 2018 12:38:28 +0200
Subject: [PATCH] dm cache metadata: set dirty on all cache blocks after a
crash
Quoting Documentation/device-mapper/cache.txt:
The 'dirty' state for a cache block changes far too frequently for us
to keep updating it on the fly. So we treat it as a hint. In normal
operation it will be written when the dm device is suspended. If the
system crashes all cache blocks will be assumed dirty when restarted.
This got broken in commit f177940a8091 ("dm cache metadata: switch to
using the new cursor api for loading metadata") in 4.9, which removed
the code that consulted cmd->clean_when_opened (CLEAN_SHUTDOWN on-disk
flag) when loading cache blocks. This results in data corruption on an
unclean shutdown with dirty cache blocks on the fast device. After the
crash those blocks are considered clean and may get evicted from the
cache at any time. This can be demonstrated by doing a lot of reads
to trigger individual evictions, but uncache is more predictable:
### Disable auto-activation in lvm.conf to be able to do uncache in
### time (i.e. see uncache doing flushing) when the fix is applied.
# xfs_io -d -c 'pwrite -b 4M -S 0xaa 0 1G' /dev/vdb
# vgcreate vg_cache /dev/vdb /dev/vdc
# lvcreate -L 1G -n lv_slowdev vg_cache /dev/vdb
# lvcreate -L 512M -n lv_cachedev vg_cache /dev/vdc
# lvcreate -L 256M -n lv_metadev vg_cache /dev/vdc
# lvconvert --type cache-pool --cachemode writeback vg_cache/lv_cachedev --poolmetadata vg_cache/lv_metadev
# lvconvert --type cache vg_cache/lv_slowdev --cachepool vg_cache/lv_cachedev
# xfs_io -d -c 'pwrite -b 4M -S 0xbb 0 512M' /dev/mapper/vg_cache-lv_slowdev
# xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2
0fe00000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
0fe00010: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
# dmsetup status vg_cache-lv_slowdev
0 2097152 cache 8 27/65536 128 8192/8192 1 100 0 0 0 8192 7065 2 metadata2 writeback 2 migration_threshold 2048 smq 0 rw -
^^^^
7065 * 64k = 441M yet to be written to the slow device
# echo b >/proc/sysrq-trigger
# vgchange -ay vg_cache
# xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2
0fe00000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
0fe00010: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
# lvconvert --uncache vg_cache/lv_slowdev
Flushing 0 blocks for cache vg_cache/lv_slowdev.
Logical volume "lv_cachedev" successfully removed
Logical volume vg_cache/lv_slowdev is not cached.
# xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2
0fe00000: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0fe00010: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
This is the case with both v1 and v2 cache pool metatata formats.
After applying this patch:
# vgchange -ay vg_cache
# xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2
0fe00000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
0fe00010: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
# lvconvert --uncache vg_cache/lv_slowdev
Flushing 3724 blocks for cache vg_cache/lv_slowdev.
...
Flushing 71 blocks for cache vg_cache/lv_slowdev.
Logical volume "lv_cachedev" successfully removed
Logical volume vg_cache/lv_slowdev is not cached.
# xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2
0fe00000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
0fe00010: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
Cc: stable(a)vger.kernel.org
Fixes: f177940a8091 ("dm cache metadata: switch to using the new cursor api for loading metadata")
Signed-off-by: Ilya Dryomov <idryomov(a)gmail.com>
Signed-off-by: Mike Snitzer <snitzer(a)redhat.com>
diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index 1a449105b007..69dddeab124c 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -1323,6 +1323,7 @@ static int __load_mapping_v1(struct dm_cache_metadata *cmd,
dm_oblock_t oblock;
unsigned flags;
+ bool dirty = true;
dm_array_cursor_get_value(mapping_cursor, (void **) &mapping_value_le);
memcpy(&mapping, mapping_value_le, sizeof(mapping));
@@ -1333,8 +1334,10 @@ static int __load_mapping_v1(struct dm_cache_metadata *cmd,
dm_array_cursor_get_value(hint_cursor, (void **) &hint_value_le);
memcpy(&hint, hint_value_le, sizeof(hint));
}
+ if (cmd->clean_when_opened)
+ dirty = flags & M_DIRTY;
- r = fn(context, oblock, to_cblock(cb), flags & M_DIRTY,
+ r = fn(context, oblock, to_cblock(cb), dirty,
le32_to_cpu(hint), hints_valid);
if (r) {
DMERR("policy couldn't load cache block %llu",
@@ -1362,7 +1365,7 @@ static int __load_mapping_v2(struct dm_cache_metadata *cmd,
dm_oblock_t oblock;
unsigned flags;
- bool dirty;
+ bool dirty = true;
dm_array_cursor_get_value(mapping_cursor, (void **) &mapping_value_le);
memcpy(&mapping, mapping_value_le, sizeof(mapping));
@@ -1373,8 +1376,9 @@ static int __load_mapping_v2(struct dm_cache_metadata *cmd,
dm_array_cursor_get_value(hint_cursor, (void **) &hint_value_le);
memcpy(&hint, hint_value_le, sizeof(hint));
}
+ if (cmd->clean_when_opened)
+ dirty = dm_bitset_cursor_get_value(dirty_cursor);
- dirty = dm_bitset_cursor_get_value(dirty_cursor);
r = fn(context, oblock, to_cblock(cb), dirty,
le32_to_cpu(hint), hints_valid);
if (r) {
The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 75294442d896f2767be34f75aca7cc2b0d01301f Mon Sep 17 00:00:00 2001
From: Hou Tao <houtao1(a)huawei.com>
Date: Thu, 2 Aug 2018 16:18:24 +0800
Subject: [PATCH] dm thin: stop no_space_timeout worker when switching to
write-mode
Now both check_for_space() and do_no_space_timeout() will read & write
pool->pf.error_if_no_space. If these functions run concurrently, as
shown in the following case, the default setting of "queue_if_no_space"
can get lost.
precondition:
* error_if_no_space = false (aka "queue_if_no_space")
* pool is in Out-of-Data-Space (OODS) mode
* no_space_timeout worker has been queued
CPU 0: CPU 1:
// delete a thin device
process_delete_mesg()
// check_for_space() invoked by commit()
set_pool_mode(pool, PM_WRITE)
pool->pf.error_if_no_space = \
pt->requested_pf.error_if_no_space
// timeout, pool is still in OODS mode
do_no_space_timeout
// "queue_if_no_space" config is lost
pool->pf.error_if_no_space = true
pool->pf.mode = new_mode
Fix it by stopping no_space_timeout worker when switching to write mode.
Fixes: bcc696fac11f ("dm thin: stay in out-of-data-space mode once no_space_timeout expires")
Cc: stable(a)vger.kernel.org
Signed-off-by: Hou Tao <houtao1(a)huawei.com>
Signed-off-by: Mike Snitzer <snitzer(a)redhat.com>
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 5997d6808b57..7bd60a150f8f 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -2503,6 +2503,8 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode)
case PM_WRITE:
if (old_mode != new_mode)
notify_of_pool_mode_change(pool, "write");
+ if (old_mode == PM_OUT_OF_DATA_SPACE)
+ cancel_delayed_work_sync(&pool->no_space_timeout);
pool->out_of_data_space = false;
pool->pf.error_if_no_space = pt->requested_pf.error_if_no_space;
dm_pool_metadata_read_write(pool->pmd);
The patch below does not apply to the 4.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 05f58ceba123bdb420cf44c6ea04b6db467edd1c Mon Sep 17 00:00:00 2001
From: Leon Romanovsky <leonro(a)mellanox.com>
Date: Sun, 8 Jul 2018 13:50:21 +0300
Subject: [PATCH] RDMA/mlx5: Check that supplied blue flame index doesn't
overflow
User's supplied index is checked again total number of system pages, but
this number already includes num_static_sys_pages, so addition of that
value to supplied index causes to below error while trying to access
sys_pages[].
BUG: KASAN: slab-out-of-bounds in bfregn_to_uar_index+0x34f/0x400
Read of size 4 at addr ffff880065561904 by task syz-executor446/314
CPU: 0 PID: 314 Comm: syz-executor446 Not tainted 4.18.0-rc1+ #256
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014
Call Trace:
dump_stack+0xef/0x17e
print_address_description+0x83/0x3b0
kasan_report+0x18d/0x4d0
bfregn_to_uar_index+0x34f/0x400
create_user_qp+0x272/0x227d
create_qp_common+0x32eb/0x43e0
mlx5_ib_create_qp+0x379/0x1ca0
create_qp.isra.5+0xc94/0x22d0
ib_uverbs_create_qp+0x21b/0x2a0
ib_uverbs_write+0xc2c/0x1010
vfs_write+0x1b0/0x550
ksys_write+0xc6/0x1a0
do_syscall_64+0xa7/0x590
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x433679
Code: fd ff 48 81 c4 80 00 00 00 e9 f1 fe ff ff 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 3b 91 fd ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff2b3d8e48 EFLAGS: 00000217 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000004002f8 RCX: 0000000000433679
RDX: 0000000000000040 RSI: 0000000020000240 RDI: 0000000000000003
RBP: 00000000006d4018 R08: 00000000004002f8 R09: 00000000004002f8
R10: 00000000004002f8 R11: 0000000000000217 R12: 0000000000000000
R13: 000000000040cb00 R14: 000000000040cb90 R15: 0000000000000006
Allocated by task 314:
kasan_kmalloc+0xa0/0xd0
__kmalloc+0x1a9/0x510
mlx5_ib_alloc_ucontext+0x966/0x2620
ib_uverbs_get_context+0x23f/0xa60
ib_uverbs_write+0xc2c/0x1010
__vfs_write+0x10d/0x720
vfs_write+0x1b0/0x550
ksys_write+0xc6/0x1a0
do_syscall_64+0xa7/0x590
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Freed by task 1:
__kasan_slab_free+0x12e/0x180
kfree+0x159/0x630
kvfree+0x37/0x50
single_release+0x8e/0xf0
__fput+0x2d8/0x900
task_work_run+0x102/0x1f0
exit_to_usermode_loop+0x159/0x1c0
do_syscall_64+0x408/0x590
entry_SYSCALL_64_after_hwframe+0x49/0xbe
The buggy address belongs to the object at ffff880065561100
which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 2052 bytes inside of
4096-byte region [ffff880065561100, ffff880065562100)
The buggy address belongs to the page:
page:ffffea0001955800 count:1 mapcount:0 mapping:ffff88006c402480 index:0x0 compound_mapcount: 0
flags: 0x4000000000008100(slab|head)
raw: 4000000000008100 ffffea0001a7c000 0000000200000002 ffff88006c402480
raw: 0000000000000000 0000000080070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff880065561800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff880065561880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff880065561900: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff880065561980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff880065561a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
Cc: <stable(a)vger.kernel.org> # 4.15
Fixes: 1ee47ab3e8d8 ("IB/mlx5: Enable QP creation with a given blue flame index")
Reported-by: Noa Osherovich <noaos(a)mellanox.com>
Signed-off-by: Leon Romanovsky <leonro(a)mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg(a)mellanox.com>
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 93087409f4b8..04a5d82c9cf3 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -1330,6 +1330,6 @@ unsigned long mlx5_ib_get_xlt_emergency_page(void);
void mlx5_ib_put_xlt_emergency_page(void);
int bfregn_to_uar_index(struct mlx5_ib_dev *dev,
- struct mlx5_bfreg_info *bfregi, int bfregn,
+ struct mlx5_bfreg_info *bfregi, u32 bfregn,
bool dyn_bfreg);
#endif /* MLX5_IB_H */
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 51e68ca20215..d4414015b64f 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -631,22 +631,23 @@ static void mlx5_ib_unlock_cqs(struct mlx5_ib_cq *send_cq,
struct mlx5_ib_cq *recv_cq);
int bfregn_to_uar_index(struct mlx5_ib_dev *dev,
- struct mlx5_bfreg_info *bfregi, int bfregn,
+ struct mlx5_bfreg_info *bfregi, u32 bfregn,
bool dyn_bfreg)
{
- int bfregs_per_sys_page;
- int index_of_sys_page;
- int offset;
+ unsigned int bfregs_per_sys_page;
+ u32 index_of_sys_page;
+ u32 offset;
bfregs_per_sys_page = get_uars_per_sys_page(dev, bfregi->lib_uar_4k) *
MLX5_NON_FP_BFREGS_PER_UAR;
index_of_sys_page = bfregn / bfregs_per_sys_page;
- if (index_of_sys_page >= bfregi->num_sys_pages)
- return -EINVAL;
-
if (dyn_bfreg) {
index_of_sys_page += bfregi->num_static_sys_pages;
+
+ if (index_of_sys_page >= bfregi->num_sys_pages)
+ return -EINVAL;
+
if (bfregn > bfregi->num_dyn_bfregs ||
bfregi->sys_pages[index_of_sys_page] == MLX5_IB_INVALID_UAR_INDEX) {
mlx5_ib_dbg(dev, "Invalid dynamic uar index\n");
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 94675cceacaec27a30eefb142c4c59a9d3131742 Mon Sep 17 00:00:00 2001
From: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
Date: Wed, 4 Jul 2018 23:27:21 +0530
Subject: [PATCH] powerpc/pseries: Defer the logging of rtas error to irq work
queue.
rtas_log_buf is a buffer to hold RTAS event data that are communicated
to kernel by hypervisor. This buffer is then used to pass RTAS event
data to user through proc fs. This buffer is allocated from
vmalloc (non-linear mapping) area.
On Machine check interrupt, register r3 points to RTAS extended event
log passed by hypervisor that contains the MCE event. The pseries
machine check handler then logs this error into rtas_log_buf. The
rtas_log_buf is a vmalloc-ed (non-linear) buffer we end up taking up a
page fault (vector 0x300) while accessing it. Since machine check
interrupt handler runs in NMI context we can not afford to take any
page fault. Page faults are not honored in NMI context and causes
kernel panic. Apart from that, as Nick pointed out,
pSeries_log_error() also takes a spin_lock while logging error which
is not safe in NMI context. It may endup in deadlock if we get another
MCE before releasing the lock. Fix this by deferring the logging of
rtas error to irq work queue.
Current implementation uses two different buffers to hold rtas error
log depending on whether extended log is provided or not. This makes
bit difficult to identify which buffer has valid data that needs to
logged later in irq work. Simplify this using single buffer, one per
paca, and copy rtas log to it irrespective of whether extended log is
provided or not. Allocate this buffer below RMA region so that it can
be accessed in real mode mce handler.
Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt")
Cc: stable(a)vger.kernel.org # v4.14+
Reviewed-by: Nicholas Piggin <npiggin(a)gmail.com>
Signed-off-by: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe(a)ellerman.id.au>
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 4e9cede5a7e7..ad4f16164619 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -247,6 +247,9 @@ struct paca_struct {
void *rfi_flush_fallback_area;
u64 l1d_flush_size;
#endif
+#ifdef CONFIG_PPC_PSERIES
+ u8 *mce_data_buf; /* buffer to hold per cpu rtas errlog */
+#endif /* CONFIG_PPC_PSERIES */
} ____cacheline_aligned;
extern void copy_mm_to_paca(struct mm_struct *mm);
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index ef104144d4bc..14a46b07ab2f 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -22,6 +22,7 @@
#include <linux/of.h>
#include <linux/fs.h>
#include <linux/reboot.h>
+#include <linux/irq_work.h>
#include <asm/machdep.h>
#include <asm/rtas.h>
@@ -32,11 +33,13 @@
static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX];
static DEFINE_SPINLOCK(ras_log_buf_lock);
-static char global_mce_data_buf[RTAS_ERROR_LOG_MAX];
-static DEFINE_PER_CPU(__u64, mce_data_buf);
-
static int ras_check_exception_token;
+static void mce_process_errlog_event(struct irq_work *work);
+static struct irq_work mce_errlog_process_work = {
+ .func = mce_process_errlog_event,
+};
+
#define EPOW_SENSOR_TOKEN 9
#define EPOW_SENSOR_INDEX 0
@@ -330,16 +333,20 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
((((A) >= 0x7000) && ((A) < 0x7ff0)) || \
(((A) >= rtas.base) && ((A) < (rtas.base + rtas.size - 16))))
+static inline struct rtas_error_log *fwnmi_get_errlog(void)
+{
+ return (struct rtas_error_log *)local_paca->mce_data_buf;
+}
+
/*
* Get the error information for errors coming through the
* FWNMI vectors. The pt_regs' r3 will be updated to reflect
* the actual r3 if possible, and a ptr to the error log entry
* will be returned if found.
*
- * If the RTAS error is not of the extended type, then we put it in a per
- * cpu 64bit buffer. If it is the extended type we use global_mce_data_buf.
+ * Use one buffer mce_data_buf per cpu to store RTAS error.
*
- * The global_mce_data_buf does not have any locks or protection around it,
+ * The mce_data_buf does not have any locks or protection around it,
* if a second machine check comes in, or a system reset is done
* before we have logged the error, then we will get corruption in the
* error log. This is preferable over holding off on calling
@@ -349,7 +356,7 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
{
unsigned long *savep;
- struct rtas_error_log *h, *errhdr = NULL;
+ struct rtas_error_log *h;
/* Mask top two bits */
regs->gpr[3] &= ~(0x3UL << 62);
@@ -362,22 +369,20 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
savep = __va(regs->gpr[3]);
regs->gpr[3] = savep[0]; /* restore original r3 */
- /* If it isn't an extended log we can use the per cpu 64bit buffer */
h = (struct rtas_error_log *)&savep[1];
+ /* Use the per cpu buffer from paca to store rtas error log */
+ memset(local_paca->mce_data_buf, 0, RTAS_ERROR_LOG_MAX);
if (!rtas_error_extended(h)) {
- memcpy(this_cpu_ptr(&mce_data_buf), h, sizeof(__u64));
- errhdr = (struct rtas_error_log *)this_cpu_ptr(&mce_data_buf);
+ memcpy(local_paca->mce_data_buf, h, sizeof(__u64));
} else {
int len, error_log_length;
error_log_length = 8 + rtas_error_extended_log_length(h);
len = min_t(int, error_log_length, RTAS_ERROR_LOG_MAX);
- memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX);
- memcpy(global_mce_data_buf, h, len);
- errhdr = (struct rtas_error_log *)global_mce_data_buf;
+ memcpy(local_paca->mce_data_buf, h, len);
}
- return errhdr;
+ return (struct rtas_error_log *)local_paca->mce_data_buf;
}
/* Call this when done with the data returned by FWNMI_get_errinfo.
@@ -422,6 +427,17 @@ int pSeries_system_reset_exception(struct pt_regs *regs)
return 0; /* need to perform reset */
}
+/*
+ * Process MCE rtas errlog event.
+ */
+static void mce_process_errlog_event(struct irq_work *work)
+{
+ struct rtas_error_log *err;
+
+ err = fwnmi_get_errlog();
+ log_error((char *)err, ERR_TYPE_RTAS_LOG, 0);
+}
+
/*
* See if we can recover from a machine check exception.
* This is only called on power4 (or above) and only via
@@ -466,7 +482,8 @@ static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err)
recovered = 1;
}
- log_error((char *)err, ERR_TYPE_RTAS_LOG, 0);
+ /* Queue irq work to log this rtas event later. */
+ irq_work_queue(&mce_errlog_process_work);
return recovered;
}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 9948ad16f788..b411a74b861d 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -41,6 +41,7 @@
#include <linux/root_dev.h>
#include <linux/of.h>
#include <linux/of_pci.h>
+#include <linux/memblock.h>
#include <asm/mmu.h>
#include <asm/processor.h>
@@ -102,6 +103,9 @@ static void pSeries_show_cpuinfo(struct seq_file *m)
static void __init fwnmi_init(void)
{
unsigned long system_reset_addr, machine_check_addr;
+ u8 *mce_data_buf;
+ unsigned int i;
+ int nr_cpus = num_possible_cpus();
int ibm_nmi_register = rtas_token("ibm,nmi-register");
if (ibm_nmi_register == RTAS_UNKNOWN_SERVICE)
@@ -115,6 +119,18 @@ static void __init fwnmi_init(void)
if (0 == rtas_call(ibm_nmi_register, 2, 1, NULL, system_reset_addr,
machine_check_addr))
fwnmi_active = 1;
+
+ /*
+ * Allocate a chunk for per cpu buffer to hold rtas errorlog.
+ * It will be used in real mode mce handler, hence it needs to be
+ * below RMA.
+ */
+ mce_data_buf = __va(memblock_alloc_base(RTAS_ERROR_LOG_MAX * nr_cpus,
+ RTAS_ERROR_LOG_MAX, ppc64_rma_size));
+ for_each_possible_cpu(i) {
+ paca_ptrs[i]->mce_data_buf = mce_data_buf +
+ (RTAS_ERROR_LOG_MAX * i);
+ }
}
static void pseries_8259_cascade(struct irq_desc *desc)
The patch below does not apply to the 4.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 94675cceacaec27a30eefb142c4c59a9d3131742 Mon Sep 17 00:00:00 2001
From: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
Date: Wed, 4 Jul 2018 23:27:21 +0530
Subject: [PATCH] powerpc/pseries: Defer the logging of rtas error to irq work
queue.
rtas_log_buf is a buffer to hold RTAS event data that are communicated
to kernel by hypervisor. This buffer is then used to pass RTAS event
data to user through proc fs. This buffer is allocated from
vmalloc (non-linear mapping) area.
On Machine check interrupt, register r3 points to RTAS extended event
log passed by hypervisor that contains the MCE event. The pseries
machine check handler then logs this error into rtas_log_buf. The
rtas_log_buf is a vmalloc-ed (non-linear) buffer we end up taking up a
page fault (vector 0x300) while accessing it. Since machine check
interrupt handler runs in NMI context we can not afford to take any
page fault. Page faults are not honored in NMI context and causes
kernel panic. Apart from that, as Nick pointed out,
pSeries_log_error() also takes a spin_lock while logging error which
is not safe in NMI context. It may endup in deadlock if we get another
MCE before releasing the lock. Fix this by deferring the logging of
rtas error to irq work queue.
Current implementation uses two different buffers to hold rtas error
log depending on whether extended log is provided or not. This makes
bit difficult to identify which buffer has valid data that needs to
logged later in irq work. Simplify this using single buffer, one per
paca, and copy rtas log to it irrespective of whether extended log is
provided or not. Allocate this buffer below RMA region so that it can
be accessed in real mode mce handler.
Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt")
Cc: stable(a)vger.kernel.org # v4.14+
Reviewed-by: Nicholas Piggin <npiggin(a)gmail.com>
Signed-off-by: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe(a)ellerman.id.au>
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 4e9cede5a7e7..ad4f16164619 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -247,6 +247,9 @@ struct paca_struct {
void *rfi_flush_fallback_area;
u64 l1d_flush_size;
#endif
+#ifdef CONFIG_PPC_PSERIES
+ u8 *mce_data_buf; /* buffer to hold per cpu rtas errlog */
+#endif /* CONFIG_PPC_PSERIES */
} ____cacheline_aligned;
extern void copy_mm_to_paca(struct mm_struct *mm);
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index ef104144d4bc..14a46b07ab2f 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -22,6 +22,7 @@
#include <linux/of.h>
#include <linux/fs.h>
#include <linux/reboot.h>
+#include <linux/irq_work.h>
#include <asm/machdep.h>
#include <asm/rtas.h>
@@ -32,11 +33,13 @@
static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX];
static DEFINE_SPINLOCK(ras_log_buf_lock);
-static char global_mce_data_buf[RTAS_ERROR_LOG_MAX];
-static DEFINE_PER_CPU(__u64, mce_data_buf);
-
static int ras_check_exception_token;
+static void mce_process_errlog_event(struct irq_work *work);
+static struct irq_work mce_errlog_process_work = {
+ .func = mce_process_errlog_event,
+};
+
#define EPOW_SENSOR_TOKEN 9
#define EPOW_SENSOR_INDEX 0
@@ -330,16 +333,20 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
((((A) >= 0x7000) && ((A) < 0x7ff0)) || \
(((A) >= rtas.base) && ((A) < (rtas.base + rtas.size - 16))))
+static inline struct rtas_error_log *fwnmi_get_errlog(void)
+{
+ return (struct rtas_error_log *)local_paca->mce_data_buf;
+}
+
/*
* Get the error information for errors coming through the
* FWNMI vectors. The pt_regs' r3 will be updated to reflect
* the actual r3 if possible, and a ptr to the error log entry
* will be returned if found.
*
- * If the RTAS error is not of the extended type, then we put it in a per
- * cpu 64bit buffer. If it is the extended type we use global_mce_data_buf.
+ * Use one buffer mce_data_buf per cpu to store RTAS error.
*
- * The global_mce_data_buf does not have any locks or protection around it,
+ * The mce_data_buf does not have any locks or protection around it,
* if a second machine check comes in, or a system reset is done
* before we have logged the error, then we will get corruption in the
* error log. This is preferable over holding off on calling
@@ -349,7 +356,7 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
{
unsigned long *savep;
- struct rtas_error_log *h, *errhdr = NULL;
+ struct rtas_error_log *h;
/* Mask top two bits */
regs->gpr[3] &= ~(0x3UL << 62);
@@ -362,22 +369,20 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
savep = __va(regs->gpr[3]);
regs->gpr[3] = savep[0]; /* restore original r3 */
- /* If it isn't an extended log we can use the per cpu 64bit buffer */
h = (struct rtas_error_log *)&savep[1];
+ /* Use the per cpu buffer from paca to store rtas error log */
+ memset(local_paca->mce_data_buf, 0, RTAS_ERROR_LOG_MAX);
if (!rtas_error_extended(h)) {
- memcpy(this_cpu_ptr(&mce_data_buf), h, sizeof(__u64));
- errhdr = (struct rtas_error_log *)this_cpu_ptr(&mce_data_buf);
+ memcpy(local_paca->mce_data_buf, h, sizeof(__u64));
} else {
int len, error_log_length;
error_log_length = 8 + rtas_error_extended_log_length(h);
len = min_t(int, error_log_length, RTAS_ERROR_LOG_MAX);
- memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX);
- memcpy(global_mce_data_buf, h, len);
- errhdr = (struct rtas_error_log *)global_mce_data_buf;
+ memcpy(local_paca->mce_data_buf, h, len);
}
- return errhdr;
+ return (struct rtas_error_log *)local_paca->mce_data_buf;
}
/* Call this when done with the data returned by FWNMI_get_errinfo.
@@ -422,6 +427,17 @@ int pSeries_system_reset_exception(struct pt_regs *regs)
return 0; /* need to perform reset */
}
+/*
+ * Process MCE rtas errlog event.
+ */
+static void mce_process_errlog_event(struct irq_work *work)
+{
+ struct rtas_error_log *err;
+
+ err = fwnmi_get_errlog();
+ log_error((char *)err, ERR_TYPE_RTAS_LOG, 0);
+}
+
/*
* See if we can recover from a machine check exception.
* This is only called on power4 (or above) and only via
@@ -466,7 +482,8 @@ static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err)
recovered = 1;
}
- log_error((char *)err, ERR_TYPE_RTAS_LOG, 0);
+ /* Queue irq work to log this rtas event later. */
+ irq_work_queue(&mce_errlog_process_work);
return recovered;
}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 9948ad16f788..b411a74b861d 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -41,6 +41,7 @@
#include <linux/root_dev.h>
#include <linux/of.h>
#include <linux/of_pci.h>
+#include <linux/memblock.h>
#include <asm/mmu.h>
#include <asm/processor.h>
@@ -102,6 +103,9 @@ static void pSeries_show_cpuinfo(struct seq_file *m)
static void __init fwnmi_init(void)
{
unsigned long system_reset_addr, machine_check_addr;
+ u8 *mce_data_buf;
+ unsigned int i;
+ int nr_cpus = num_possible_cpus();
int ibm_nmi_register = rtas_token("ibm,nmi-register");
if (ibm_nmi_register == RTAS_UNKNOWN_SERVICE)
@@ -115,6 +119,18 @@ static void __init fwnmi_init(void)
if (0 == rtas_call(ibm_nmi_register, 2, 1, NULL, system_reset_addr,
machine_check_addr))
fwnmi_active = 1;
+
+ /*
+ * Allocate a chunk for per cpu buffer to hold rtas errorlog.
+ * It will be used in real mode mce handler, hence it needs to be
+ * below RMA.
+ */
+ mce_data_buf = __va(memblock_alloc_base(RTAS_ERROR_LOG_MAX * nr_cpus,
+ RTAS_ERROR_LOG_MAX, ppc64_rma_size));
+ for_each_possible_cpu(i) {
+ paca_ptrs[i]->mce_data_buf = mce_data_buf +
+ (RTAS_ERROR_LOG_MAX * i);
+ }
}
static void pseries_8259_cascade(struct irq_desc *desc)
The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 4231aba000f5a4583dd9f67057aadb68c3eca99d Mon Sep 17 00:00:00 2001
From: Nicholas Piggin <npiggin(a)gmail.com>
Date: Fri, 27 Jul 2018 21:48:17 +1000
Subject: [PATCH] powerpc/64s: Fix page table fragment refcount race vs
speculative references
The page table fragment allocator uses the main page refcount racily
with respect to speculative references. A customer observed a BUG due
to page table page refcount underflow in the fragment allocator. This
can be caused by the fragment allocator set_page_count stomping on a
speculative reference, and then the speculative failure handler
decrements the new reference, and the underflow eventually pops when
the page tables are freed.
Fix this by using a dedicated field in the struct page for the page
table fragment allocator.
Fixes: 5c1f6ee9a31c ("powerpc: Reduce PTE table memory wastage")
Cc: stable(a)vger.kernel.org # v3.10+
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin(a)gmail.com>
Signed-off-by: Michael Ellerman <mpe(a)ellerman.id.au>
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
index 8b24168ea8c4..4a892d894a0f 100644
--- a/arch/powerpc/mm/mmu_context_book3s64.c
+++ b/arch/powerpc/mm/mmu_context_book3s64.c
@@ -200,9 +200,9 @@ static void pte_frag_destroy(void *pte_frag)
/* drop all the pending references */
count = ((unsigned long)pte_frag & ~PAGE_MASK) >> PTE_FRAG_SIZE_SHIFT;
/* We allow PTE_FRAG_NR fragments from a PTE page */
- if (page_ref_sub_and_test(page, PTE_FRAG_NR - count)) {
+ if (atomic_sub_and_test(PTE_FRAG_NR - count, &page->pt_frag_refcount)) {
pgtable_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
@@ -215,9 +215,9 @@ static void pmd_frag_destroy(void *pmd_frag)
/* drop all the pending references */
count = ((unsigned long)pmd_frag & ~PAGE_MASK) >> PMD_FRAG_SIZE_SHIFT;
/* We allow PTE_FRAG_NR fragments from a PTE page */
- if (page_ref_sub_and_test(page, PMD_FRAG_NR - count)) {
+ if (atomic_sub_and_test(PMD_FRAG_NR - count, &page->pt_frag_refcount)) {
pgtable_pmd_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c
index 4afbfbb64bfd..78d0b3d5ebad 100644
--- a/arch/powerpc/mm/pgtable-book3s64.c
+++ b/arch/powerpc/mm/pgtable-book3s64.c
@@ -270,6 +270,8 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
return NULL;
}
+ atomic_set(&page->pt_frag_refcount, 1);
+
ret = page_address(page);
/*
* if we support only one fragment just return the
@@ -285,7 +287,7 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
* count.
*/
if (likely(!mm->context.pmd_frag)) {
- set_page_count(page, PMD_FRAG_NR);
+ atomic_set(&page->pt_frag_refcount, PMD_FRAG_NR);
mm->context.pmd_frag = ret + PMD_FRAG_SIZE;
}
spin_unlock(&mm->page_table_lock);
@@ -308,9 +310,10 @@ void pmd_fragment_free(unsigned long *pmd)
{
struct page *page = virt_to_page(pmd);
- if (put_page_testzero(page)) {
+ BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
+ if (atomic_dec_and_test(&page->pt_frag_refcount)) {
pgtable_pmd_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
@@ -352,6 +355,7 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
return NULL;
}
+ atomic_set(&page->pt_frag_refcount, 1);
ret = page_address(page);
/*
@@ -367,7 +371,7 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
* count.
*/
if (likely(!mm->context.pte_frag)) {
- set_page_count(page, PTE_FRAG_NR);
+ atomic_set(&page->pt_frag_refcount, PTE_FRAG_NR);
mm->context.pte_frag = ret + PTE_FRAG_SIZE;
}
spin_unlock(&mm->page_table_lock);
@@ -390,10 +394,11 @@ void pte_fragment_free(unsigned long *table, int kernel)
{
struct page *page = virt_to_page(table);
- if (put_page_testzero(page)) {
+ BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
+ if (atomic_dec_and_test(&page->pt_frag_refcount)) {
if (!kernel)
pgtable_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 99ce070e7dcb..22651e124071 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -139,7 +139,10 @@ struct page {
unsigned long _pt_pad_1; /* compound_head */
pgtable_t pmd_huge_pte; /* protected by page->ptl */
unsigned long _pt_pad_2; /* mapping */
- struct mm_struct *pt_mm; /* x86 pgds only */
+ union {
+ struct mm_struct *pt_mm; /* x86 pgds only */
+ atomic_t pt_frag_refcount; /* powerpc */
+ };
#if ALLOC_SPLIT_PTLOCKS
spinlock_t *ptl;
#else
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 4231aba000f5a4583dd9f67057aadb68c3eca99d Mon Sep 17 00:00:00 2001
From: Nicholas Piggin <npiggin(a)gmail.com>
Date: Fri, 27 Jul 2018 21:48:17 +1000
Subject: [PATCH] powerpc/64s: Fix page table fragment refcount race vs
speculative references
The page table fragment allocator uses the main page refcount racily
with respect to speculative references. A customer observed a BUG due
to page table page refcount underflow in the fragment allocator. This
can be caused by the fragment allocator set_page_count stomping on a
speculative reference, and then the speculative failure handler
decrements the new reference, and the underflow eventually pops when
the page tables are freed.
Fix this by using a dedicated field in the struct page for the page
table fragment allocator.
Fixes: 5c1f6ee9a31c ("powerpc: Reduce PTE table memory wastage")
Cc: stable(a)vger.kernel.org # v3.10+
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin(a)gmail.com>
Signed-off-by: Michael Ellerman <mpe(a)ellerman.id.au>
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
index 8b24168ea8c4..4a892d894a0f 100644
--- a/arch/powerpc/mm/mmu_context_book3s64.c
+++ b/arch/powerpc/mm/mmu_context_book3s64.c
@@ -200,9 +200,9 @@ static void pte_frag_destroy(void *pte_frag)
/* drop all the pending references */
count = ((unsigned long)pte_frag & ~PAGE_MASK) >> PTE_FRAG_SIZE_SHIFT;
/* We allow PTE_FRAG_NR fragments from a PTE page */
- if (page_ref_sub_and_test(page, PTE_FRAG_NR - count)) {
+ if (atomic_sub_and_test(PTE_FRAG_NR - count, &page->pt_frag_refcount)) {
pgtable_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
@@ -215,9 +215,9 @@ static void pmd_frag_destroy(void *pmd_frag)
/* drop all the pending references */
count = ((unsigned long)pmd_frag & ~PAGE_MASK) >> PMD_FRAG_SIZE_SHIFT;
/* We allow PTE_FRAG_NR fragments from a PTE page */
- if (page_ref_sub_and_test(page, PMD_FRAG_NR - count)) {
+ if (atomic_sub_and_test(PMD_FRAG_NR - count, &page->pt_frag_refcount)) {
pgtable_pmd_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c
index 4afbfbb64bfd..78d0b3d5ebad 100644
--- a/arch/powerpc/mm/pgtable-book3s64.c
+++ b/arch/powerpc/mm/pgtable-book3s64.c
@@ -270,6 +270,8 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
return NULL;
}
+ atomic_set(&page->pt_frag_refcount, 1);
+
ret = page_address(page);
/*
* if we support only one fragment just return the
@@ -285,7 +287,7 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
* count.
*/
if (likely(!mm->context.pmd_frag)) {
- set_page_count(page, PMD_FRAG_NR);
+ atomic_set(&page->pt_frag_refcount, PMD_FRAG_NR);
mm->context.pmd_frag = ret + PMD_FRAG_SIZE;
}
spin_unlock(&mm->page_table_lock);
@@ -308,9 +310,10 @@ void pmd_fragment_free(unsigned long *pmd)
{
struct page *page = virt_to_page(pmd);
- if (put_page_testzero(page)) {
+ BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
+ if (atomic_dec_and_test(&page->pt_frag_refcount)) {
pgtable_pmd_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
@@ -352,6 +355,7 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
return NULL;
}
+ atomic_set(&page->pt_frag_refcount, 1);
ret = page_address(page);
/*
@@ -367,7 +371,7 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
* count.
*/
if (likely(!mm->context.pte_frag)) {
- set_page_count(page, PTE_FRAG_NR);
+ atomic_set(&page->pt_frag_refcount, PTE_FRAG_NR);
mm->context.pte_frag = ret + PTE_FRAG_SIZE;
}
spin_unlock(&mm->page_table_lock);
@@ -390,10 +394,11 @@ void pte_fragment_free(unsigned long *table, int kernel)
{
struct page *page = virt_to_page(table);
- if (put_page_testzero(page)) {
+ BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
+ if (atomic_dec_and_test(&page->pt_frag_refcount)) {
if (!kernel)
pgtable_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 99ce070e7dcb..22651e124071 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -139,7 +139,10 @@ struct page {
unsigned long _pt_pad_1; /* compound_head */
pgtable_t pmd_huge_pte; /* protected by page->ptl */
unsigned long _pt_pad_2; /* mapping */
- struct mm_struct *pt_mm; /* x86 pgds only */
+ union {
+ struct mm_struct *pt_mm; /* x86 pgds only */
+ atomic_t pt_frag_refcount; /* powerpc */
+ };
#if ALLOC_SPLIT_PTLOCKS
spinlock_t *ptl;
#else
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 4231aba000f5a4583dd9f67057aadb68c3eca99d Mon Sep 17 00:00:00 2001
From: Nicholas Piggin <npiggin(a)gmail.com>
Date: Fri, 27 Jul 2018 21:48:17 +1000
Subject: [PATCH] powerpc/64s: Fix page table fragment refcount race vs
speculative references
The page table fragment allocator uses the main page refcount racily
with respect to speculative references. A customer observed a BUG due
to page table page refcount underflow in the fragment allocator. This
can be caused by the fragment allocator set_page_count stomping on a
speculative reference, and then the speculative failure handler
decrements the new reference, and the underflow eventually pops when
the page tables are freed.
Fix this by using a dedicated field in the struct page for the page
table fragment allocator.
Fixes: 5c1f6ee9a31c ("powerpc: Reduce PTE table memory wastage")
Cc: stable(a)vger.kernel.org # v3.10+
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin(a)gmail.com>
Signed-off-by: Michael Ellerman <mpe(a)ellerman.id.au>
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
index 8b24168ea8c4..4a892d894a0f 100644
--- a/arch/powerpc/mm/mmu_context_book3s64.c
+++ b/arch/powerpc/mm/mmu_context_book3s64.c
@@ -200,9 +200,9 @@ static void pte_frag_destroy(void *pte_frag)
/* drop all the pending references */
count = ((unsigned long)pte_frag & ~PAGE_MASK) >> PTE_FRAG_SIZE_SHIFT;
/* We allow PTE_FRAG_NR fragments from a PTE page */
- if (page_ref_sub_and_test(page, PTE_FRAG_NR - count)) {
+ if (atomic_sub_and_test(PTE_FRAG_NR - count, &page->pt_frag_refcount)) {
pgtable_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
@@ -215,9 +215,9 @@ static void pmd_frag_destroy(void *pmd_frag)
/* drop all the pending references */
count = ((unsigned long)pmd_frag & ~PAGE_MASK) >> PMD_FRAG_SIZE_SHIFT;
/* We allow PTE_FRAG_NR fragments from a PTE page */
- if (page_ref_sub_and_test(page, PMD_FRAG_NR - count)) {
+ if (atomic_sub_and_test(PMD_FRAG_NR - count, &page->pt_frag_refcount)) {
pgtable_pmd_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c
index 4afbfbb64bfd..78d0b3d5ebad 100644
--- a/arch/powerpc/mm/pgtable-book3s64.c
+++ b/arch/powerpc/mm/pgtable-book3s64.c
@@ -270,6 +270,8 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
return NULL;
}
+ atomic_set(&page->pt_frag_refcount, 1);
+
ret = page_address(page);
/*
* if we support only one fragment just return the
@@ -285,7 +287,7 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
* count.
*/
if (likely(!mm->context.pmd_frag)) {
- set_page_count(page, PMD_FRAG_NR);
+ atomic_set(&page->pt_frag_refcount, PMD_FRAG_NR);
mm->context.pmd_frag = ret + PMD_FRAG_SIZE;
}
spin_unlock(&mm->page_table_lock);
@@ -308,9 +310,10 @@ void pmd_fragment_free(unsigned long *pmd)
{
struct page *page = virt_to_page(pmd);
- if (put_page_testzero(page)) {
+ BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
+ if (atomic_dec_and_test(&page->pt_frag_refcount)) {
pgtable_pmd_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
@@ -352,6 +355,7 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
return NULL;
}
+ atomic_set(&page->pt_frag_refcount, 1);
ret = page_address(page);
/*
@@ -367,7 +371,7 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
* count.
*/
if (likely(!mm->context.pte_frag)) {
- set_page_count(page, PTE_FRAG_NR);
+ atomic_set(&page->pt_frag_refcount, PTE_FRAG_NR);
mm->context.pte_frag = ret + PTE_FRAG_SIZE;
}
spin_unlock(&mm->page_table_lock);
@@ -390,10 +394,11 @@ void pte_fragment_free(unsigned long *table, int kernel)
{
struct page *page = virt_to_page(table);
- if (put_page_testzero(page)) {
+ BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
+ if (atomic_dec_and_test(&page->pt_frag_refcount)) {
if (!kernel)
pgtable_page_dtor(page);
- free_unref_page(page);
+ __free_page(page);
}
}
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 99ce070e7dcb..22651e124071 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -139,7 +139,10 @@ struct page {
unsigned long _pt_pad_1; /* compound_head */
pgtable_t pmd_huge_pte; /* protected by page->ptl */
unsigned long _pt_pad_2; /* mapping */
- struct mm_struct *pt_mm; /* x86 pgds only */
+ union {
+ struct mm_struct *pt_mm; /* x86 pgds only */
+ atomic_t pt_frag_refcount; /* powerpc */
+ };
#if ALLOC_SPLIT_PTLOCKS
spinlock_t *ptl;
#else
From: Andi Kleen <ak(a)linux.intel.com>
Mostly recycling the commit log from adaba23ccd7d which fixed
populate_pmd, but did not fix populate_pud. The same problem exists
there.
Stable trees reverted the following patch:
Revert "x86/mm/pat: Ensure cpa->pfn only contains page frame numbers"
This reverts commit 87e2bd898d3a79a8c609f183180adac47879a2a4 which is
commit edc3b9129cecd0f0857112136f5b8b1bc1d45918 upstream.
but the L1TF patch 02ff2769edbc backported here
x86/mm/pat: Make set_memory_np() L1TF safe
commit 958f79b9ee55dfaf00c8106ed1c22a2919e0028b upstream
set_memory_np() is used to mark kernel mappings not present, but it has
it's own open coded mechanism which does not have the L1TF protection of
inverting the address bits.
assumed that cpa->pfn contains a PFN. With the above patch reverted
it does not, which causes the PUD to be set to an incorrect address
shifted by 12 bits, which can cause various failures.
Convert the address to a PFN before passing it to pud_pfn().
This is a 4.4 stable only patch to fix the L1TF patches backport there.
Cc: stable(a)vger.kernel.org # 4.4-only
Cc: Andi Kleen <ak(a)linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby(a)suse.cz>
---
arch/x86/mm/pageattr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 1007fa80f5a6..0e1dd7d47f05 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -1079,7 +1079,7 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd,
* Map everything starting from the Gb boundary, possibly with 1G pages
*/
while (end - start >= PUD_SIZE) {
- set_pud(pud, pud_mkhuge(pfn_pud(cpa->pfn,
+ set_pud(pud, pud_mkhuge(pfn_pud(cpa->pfn >> PAGE_SHIFT,
canon_pgprot(pud_pgprot))));
start += PUD_SIZE;
--
2.18.0
The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 7444a8092906ed44c09459780c56ba57043e39b1 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel(a)zonque.org>
Date: Wed, 27 Jun 2018 20:58:45 +0200
Subject: [PATCH] libertas: fix suspend and resume for SDIO connected cards
Prior to commit 573185cc7e64 ("mmc: core: Invoke sdio func driver's PM
callbacks from the sdio bus"), the MMC core used to call into the power
management functions of SDIO clients itself and removed the card if the
return code was non-zero. IOW, the mmc handled errors gracefully and didn't
upchain them to the pm core.
Since this change, the mmc core relies on generic power management
functions which treat all errors as a reason to cancel the suspend
immediately. This causes suspend attempts to fail when the libertas
driver is loaded.
To fix this, power down the card explicitly in if_sdio_suspend() when we
know we're about to lose power and return success. Also set a flag in these
cases, and power up the card again in if_sdio_resume().
Fixes: 573185cc7e64 ("mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus")
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Daniel Mack <daniel(a)zonque.org>
Reviewed-by: Chris Ball <chris(a)printf.net>
Reviewed-by: Ulf Hansson <ulf.hansson(a)linaro.org>
Signed-off-by: Kalle Valo <kvalo(a)codeaurora.org>
diff --git a/drivers/net/wireless/marvell/libertas/dev.h b/drivers/net/wireless/marvell/libertas/dev.h
index dd1ee1f0af48..469134930026 100644
--- a/drivers/net/wireless/marvell/libertas/dev.h
+++ b/drivers/net/wireless/marvell/libertas/dev.h
@@ -104,6 +104,7 @@ struct lbs_private {
u8 fw_ready;
u8 surpriseremoved;
u8 setup_fw_on_resume;
+ u8 power_up_on_resume;
int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
void (*reset_card) (struct lbs_private *priv);
int (*power_save) (struct lbs_private *priv);
diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c
index 2300e796c6ab..43743c26c071 100644
--- a/drivers/net/wireless/marvell/libertas/if_sdio.c
+++ b/drivers/net/wireless/marvell/libertas/if_sdio.c
@@ -1290,15 +1290,23 @@ static void if_sdio_remove(struct sdio_func *func)
static int if_sdio_suspend(struct device *dev)
{
struct sdio_func *func = dev_to_sdio_func(dev);
- int ret;
struct if_sdio_card *card = sdio_get_drvdata(func);
+ struct lbs_private *priv = card->priv;
+ int ret;
mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
+ priv->power_up_on_resume = false;
/* If we're powered off anyway, just let the mmc layer remove the
* card. */
- if (!lbs_iface_active(card->priv))
- return -ENOSYS;
+ if (!lbs_iface_active(priv)) {
+ if (priv->fw_ready) {
+ priv->power_up_on_resume = true;
+ if_sdio_power_off(card);
+ }
+
+ return 0;
+ }
dev_info(dev, "%s: suspend: PM flags = 0x%x\n",
sdio_func_id(func), flags);
@@ -1306,9 +1314,14 @@ static int if_sdio_suspend(struct device *dev)
/* If we aren't being asked to wake on anything, we should bail out
* and let the SD stack power down the card.
*/
- if (card->priv->wol_criteria == EHS_REMOVE_WAKEUP) {
+ if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
dev_info(dev, "Suspend without wake params -- powering down card\n");
- return -ENOSYS;
+ if (priv->fw_ready) {
+ priv->power_up_on_resume = true;
+ if_sdio_power_off(card);
+ }
+
+ return 0;
}
if (!(flags & MMC_PM_KEEP_POWER)) {
@@ -1321,7 +1334,7 @@ static int if_sdio_suspend(struct device *dev)
if (ret)
return ret;
- ret = lbs_suspend(card->priv);
+ ret = lbs_suspend(priv);
if (ret)
return ret;
@@ -1336,6 +1349,11 @@ static int if_sdio_resume(struct device *dev)
dev_info(dev, "%s: resume: we're back\n", sdio_func_id(func));
+ if (card->priv->power_up_on_resume) {
+ if_sdio_power_on(card);
+ wait_event(card->pwron_waitq, card->priv->fw_ready);
+ }
+
ret = lbs_resume(card->priv);
return ret;
Hello,
Tested without any problem so please picked up this.
From: Matthew Auld
[ Upstream commit c11c7bfd213495784b22ef82a69b6489f8d0092f ]
Operating on a zero sized GEM userptr object will lead to explosions.
Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into
video memory (userptr) ioctl")
Testcase: igt/gem_userptr_blits/input-checking
Signed-off-by: Matthew Auld <matthew.auld(a)intel.com>
Cc: Chris Wilson <chris(a)chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris(a)chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris(a)chris-wilson.co.uk>
Link:
https://patchwork.freedesktop.org/patch/msgid/20180502195021.30900-1-matthe…
---
drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c
b/drivers/gpu/drm/i915/i915_gem_userptr.c
index d596a8302ca3c..854bd51b9478a 100644
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -778,6 +778,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev,
I915_USERPTR_UNSYNCHRONIZED))
return -EINVAL;
+ if (!args->user_size)
+ return -EINVAL;
+
if (offset_in_page(args->user_ptr | args->user_size))
return -EINVAL;
--
2.17.1
The MTK xHCI controller use some reserved bytes in endpoint context for
bandwidth scheduling, so need keep them in xhci_endpoint_copy();
The issue is introduced by:
commit f5249461b504 ("xhci: Clear the host side toggle manually when
endpoint is soft reset")
It resets endpoints and will drop bandwidth scheduling parameters used
by interrupt or isochronous endpoints on MTK xHCI controller.
Fixes: f5249461b504 ("xhci: Clear the host side toggle manually when
endpoint is soft reset")
Cc: stable(a)vger.kernel.org
Signed-off-by: Chunfeng Yun <chunfeng.yun(a)mediatek.com>
Tested-by: Sean Wang <sean.wang(a)mediatek.com>
---
v2: add fix tag, Cc and Tested-by
---
drivers/usb/host/xhci-mem.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index ef350c3..b1f27aa 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1613,6 +1613,10 @@ void xhci_endpoint_copy(struct xhci_hcd *xhci,
in_ep_ctx->ep_info2 = out_ep_ctx->ep_info2;
in_ep_ctx->deq = out_ep_ctx->deq;
in_ep_ctx->tx_info = out_ep_ctx->tx_info;
+ if (xhci->quirks & XHCI_MTK_HOST) {
+ in_ep_ctx->reserved[0] = out_ep_ctx->reserved[0];
+ in_ep_ctx->reserved[1] = out_ep_ctx->reserved[1];
+ }
}
/* Copy output xhci_slot_ctx to the input xhci_slot_ctx.
--
1.9.1
The patch below does not apply to the 4.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From ea8c5356d39048bc94bae068228f51ddbecc6b89 Mon Sep 17 00:00:00 2001
From: Coly Li <colyli(a)suse.de>
Date: Thu, 9 Aug 2018 15:48:49 +0800
Subject: [PATCH] bcache: set max writeback rate when I/O request is idle
Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle")
allows the writeback rate to be faster if there is no I/O request on a
bcache device. It works well if there is only one bcache device attached
to the cache set. If there are many bcache devices attached to a cache
set, it may introduce performance regression because multiple faster
writeback threads of the idle bcache devices will compete the btree level
locks with the bcache device who have I/O requests coming.
This patch fixes the above issue by only permitting fast writebac when
all bcache devices attached on the cache set are idle. And if one of the
bcache devices has new I/O request coming, minimized all writeback
throughput immediately and let PI controller __update_writeback_rate()
to decide the upcoming writeback rate for each bcache device.
Also when all bcache devices are idle, limited wrieback rate to a small
number is wast of thoughput, especially when backing devices are slower
non-rotation devices (e.g. SATA SSD). This patch sets a max writeback
rate for each backing device if the whole cache set is idle. A faster
writeback rate in idle time means new I/Os may have more available space
for dirty data, and people may observe a better write performance then.
Please note bcache may change its cache mode in run time, and this patch
still works if the cache mode is switched from writeback mode and there
is still dirty data on cache.
Fixes: Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle")
Cc: stable(a)vger.kernel.org #4.16+
Signed-off-by: Coly Li <colyli(a)suse.de>
Tested-by: Kai Krakow <kai(a)kaishome.de>
Tested-by: Stefan Priebe <s.priebe(a)profihost.ag>
Cc: Michael Lyle <mlyle(a)lyle.org>
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index b393b3fd06b6..05f82ff6f016 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -328,13 +328,6 @@ struct cached_dev {
*/
atomic_t has_dirty;
- /*
- * Set to zero by things that touch the backing volume-- except
- * writeback. Incremented by writeback. Used to determine when to
- * accelerate idle writeback.
- */
- atomic_t backing_idle;
-
struct bch_ratelimit writeback_rate;
struct delayed_work writeback_rate_update;
@@ -515,6 +508,8 @@ struct cache_set {
struct cache_accounting accounting;
unsigned long flags;
+ atomic_t idle_counter;
+ atomic_t at_max_writeback_rate;
struct cache_sb sb;
@@ -524,6 +519,7 @@ struct cache_set {
struct bcache_device **devices;
unsigned devices_max_used;
+ atomic_t attached_dev_nr;
struct list_head cached_devs;
uint64_t cached_dev_sectors;
atomic_long_t flash_dev_dirty_sectors;
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 914d501ad1e0..7dbe8b6316a0 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -1103,6 +1103,44 @@ static void detached_dev_do_request(struct bcache_device *d, struct bio *bio)
generic_make_request(bio);
}
+static void quit_max_writeback_rate(struct cache_set *c,
+ struct cached_dev *this_dc)
+{
+ int i;
+ struct bcache_device *d;
+ struct cached_dev *dc;
+
+ /*
+ * mutex bch_register_lock may compete with other parallel requesters,
+ * or attach/detach operations on other backing device. Waiting to
+ * the mutex lock may increase I/O request latency for seconds or more.
+ * To avoid such situation, if mutext_trylock() failed, only writeback
+ * rate of current cached device is set to 1, and __update_write_back()
+ * will decide writeback rate of other cached devices (remember now
+ * c->idle_counter is 0 already).
+ */
+ if (mutex_trylock(&bch_register_lock)) {
+ for (i = 0; i < c->devices_max_used; i++) {
+ if (!c->devices[i])
+ continue;
+
+ if (UUID_FLASH_ONLY(&c->uuids[i]))
+ continue;
+
+ d = c->devices[i];
+ dc = container_of(d, struct cached_dev, disk);
+ /*
+ * set writeback rate to default minimum value,
+ * then let update_writeback_rate() to decide the
+ * upcoming rate.
+ */
+ atomic_long_set(&dc->writeback_rate.rate, 1);
+ }
+ mutex_unlock(&bch_register_lock);
+ } else
+ atomic_long_set(&this_dc->writeback_rate.rate, 1);
+}
+
/* Cached devices - read & write stuff */
static blk_qc_t cached_dev_make_request(struct request_queue *q,
@@ -1120,8 +1158,25 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q,
return BLK_QC_T_NONE;
}
- atomic_set(&dc->backing_idle, 0);
- generic_start_io_acct(q, bio_op(bio), bio_sectors(bio), &d->disk->part0);
+ if (likely(d->c)) {
+ if (atomic_read(&d->c->idle_counter))
+ atomic_set(&d->c->idle_counter, 0);
+ /*
+ * If at_max_writeback_rate of cache set is true and new I/O
+ * comes, quit max writeback rate of all cached devices
+ * attached to this cache set, and set at_max_writeback_rate
+ * to false.
+ */
+ if (unlikely(atomic_read(&d->c->at_max_writeback_rate) == 1)) {
+ atomic_set(&d->c->at_max_writeback_rate, 0);
+ quit_max_writeback_rate(d->c, dc);
+ }
+ }
+
+ generic_start_io_acct(q,
+ bio_op(bio),
+ bio_sectors(bio),
+ &d->disk->part0);
bio_set_dev(bio, dc->bdev);
bio->bi_iter.bi_sector += dc->sb.data_offset;
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 1e85cbb4c159..55a37641aa95 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -696,6 +696,8 @@ static void bcache_device_detach(struct bcache_device *d)
{
lockdep_assert_held(&bch_register_lock);
+ atomic_dec(&d->c->attached_dev_nr);
+
if (test_bit(BCACHE_DEV_DETACHING, &d->flags)) {
struct uuid_entry *u = d->c->uuids + d->id;
@@ -1144,6 +1146,7 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
bch_cached_dev_run(dc);
bcache_device_link(&dc->disk, c, "bdev");
+ atomic_inc(&c->attached_dev_nr);
/* Allow the writeback thread to proceed */
up_write(&dc->writeback_lock);
@@ -1696,6 +1699,7 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
c->block_bits = ilog2(sb->block_size);
c->nr_uuids = bucket_bytes(c) / sizeof(struct uuid_entry);
c->devices_max_used = 0;
+ atomic_set(&c->attached_dev_nr, 0);
c->btree_pages = bucket_pages(c);
if (c->btree_pages > BTREE_MAX_PAGES)
c->btree_pages = max_t(int, c->btree_pages / 4,
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 3e9d3459a224..6e88142514fb 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -171,7 +171,8 @@ SHOW(__bch_cached_dev)
var_printf(writeback_running, "%i");
var_print(writeback_delay);
var_print(writeback_percent);
- sysfs_hprint(writeback_rate, wb ? dc->writeback_rate.rate << 9 : 0);
+ sysfs_hprint(writeback_rate,
+ wb ? atomic_long_read(&dc->writeback_rate.rate) << 9 : 0);
sysfs_hprint(io_errors, atomic_read(&dc->io_errors));
sysfs_printf(io_error_limit, "%i", dc->error_limit);
sysfs_printf(io_disable, "%i", dc->io_disable);
@@ -193,7 +194,9 @@ SHOW(__bch_cached_dev)
* Except for dirty and target, other values should
* be 0 if writeback is not running.
*/
- bch_hprint(rate, wb ? dc->writeback_rate.rate << 9 : 0);
+ bch_hprint(rate,
+ wb ? atomic_long_read(&dc->writeback_rate.rate) << 9
+ : 0);
bch_hprint(dirty, bcache_dev_sectors_dirty(&dc->disk) << 9);
bch_hprint(target, dc->writeback_rate_target << 9);
bch_hprint(proportional,
@@ -261,8 +264,12 @@ STORE(__cached_dev)
sysfs_strtoul_clamp(writeback_percent, dc->writeback_percent, 0, 40);
- sysfs_strtoul_clamp(writeback_rate,
- dc->writeback_rate.rate, 1, INT_MAX);
+ if (attr == &sysfs_writeback_rate) {
+ int v;
+
+ sysfs_strtoul_clamp(writeback_rate, v, 1, INT_MAX);
+ atomic_long_set(&dc->writeback_rate.rate, v);
+ }
sysfs_strtoul_clamp(writeback_rate_update_seconds,
dc->writeback_rate_update_seconds,
diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
index fc479b026d6d..b15256bcf0e7 100644
--- a/drivers/md/bcache/util.c
+++ b/drivers/md/bcache/util.c
@@ -200,7 +200,7 @@ uint64_t bch_next_delay(struct bch_ratelimit *d, uint64_t done)
{
uint64_t now = local_clock();
- d->next += div_u64(done * NSEC_PER_SEC, d->rate);
+ d->next += div_u64(done * NSEC_PER_SEC, atomic_long_read(&d->rate));
/* Bound the time. Don't let us fall further than 2 seconds behind
* (this prevents unnecessary backlog that would make it impossible
diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
index cced87f8eb27..f7b0133c9d2f 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
@@ -442,7 +442,7 @@ struct bch_ratelimit {
* Rate at which we want to do work, in units per second
* The units here correspond to the units passed to bch_next_delay()
*/
- uint32_t rate;
+ atomic_long_t rate;
};
static inline void bch_ratelimit_reset(struct bch_ratelimit *d)
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 912e969fedba..481d4cf38ac0 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -104,11 +104,56 @@ static void __update_writeback_rate(struct cached_dev *dc)
dc->writeback_rate_proportional = proportional_scaled;
dc->writeback_rate_integral_scaled = integral_scaled;
- dc->writeback_rate_change = new_rate - dc->writeback_rate.rate;
- dc->writeback_rate.rate = new_rate;
+ dc->writeback_rate_change = new_rate -
+ atomic_long_read(&dc->writeback_rate.rate);
+ atomic_long_set(&dc->writeback_rate.rate, new_rate);
dc->writeback_rate_target = target;
}
+static bool set_at_max_writeback_rate(struct cache_set *c,
+ struct cached_dev *dc)
+{
+ /*
+ * Idle_counter is increased everytime when update_writeback_rate() is
+ * called. If all backing devices attached to the same cache set have
+ * identical dc->writeback_rate_update_seconds values, it is about 6
+ * rounds of update_writeback_rate() on each backing device before
+ * c->at_max_writeback_rate is set to 1, and then max wrteback rate set
+ * to each dc->writeback_rate.rate.
+ * In order to avoid extra locking cost for counting exact dirty cached
+ * devices number, c->attached_dev_nr is used to calculate the idle
+ * throushold. It might be bigger if not all cached device are in write-
+ * back mode, but it still works well with limited extra rounds of
+ * update_writeback_rate().
+ */
+ if (atomic_inc_return(&c->idle_counter) <
+ atomic_read(&c->attached_dev_nr) * 6)
+ return false;
+
+ if (atomic_read(&c->at_max_writeback_rate) != 1)
+ atomic_set(&c->at_max_writeback_rate, 1);
+
+ atomic_long_set(&dc->writeback_rate.rate, INT_MAX);
+
+ /* keep writeback_rate_target as existing value */
+ dc->writeback_rate_proportional = 0;
+ dc->writeback_rate_integral_scaled = 0;
+ dc->writeback_rate_change = 0;
+
+ /*
+ * Check c->idle_counter and c->at_max_writeback_rate agagain in case
+ * new I/O arrives during before set_at_max_writeback_rate() returns.
+ * Then the writeback rate is set to 1, and its new value should be
+ * decided via __update_writeback_rate().
+ */
+ if ((atomic_read(&c->idle_counter) <
+ atomic_read(&c->attached_dev_nr) * 6) ||
+ !atomic_read(&c->at_max_writeback_rate))
+ return false;
+
+ return true;
+}
+
static void update_writeback_rate(struct work_struct *work)
{
struct cached_dev *dc = container_of(to_delayed_work(work),
@@ -136,13 +181,20 @@ static void update_writeback_rate(struct work_struct *work)
return;
}
- down_read(&dc->writeback_lock);
-
- if (atomic_read(&dc->has_dirty) &&
- dc->writeback_percent)
- __update_writeback_rate(dc);
+ if (atomic_read(&dc->has_dirty) && dc->writeback_percent) {
+ /*
+ * If the whole cache set is idle, set_at_max_writeback_rate()
+ * will set writeback rate to a max number. Then it is
+ * unncessary to update writeback rate for an idle cache set
+ * in maximum writeback rate number(s).
+ */
+ if (!set_at_max_writeback_rate(c, dc)) {
+ down_read(&dc->writeback_lock);
+ __update_writeback_rate(dc);
+ up_read(&dc->writeback_lock);
+ }
+ }
- up_read(&dc->writeback_lock);
/*
* CACHE_SET_IO_DISABLE might be set via sysfs interface,
@@ -422,27 +474,6 @@ static void read_dirty(struct cached_dev *dc)
delay = writeback_delay(dc, size);
- /* If the control system would wait for at least half a
- * second, and there's been no reqs hitting the backing disk
- * for awhile: use an alternate mode where we have at most
- * one contiguous set of writebacks in flight at a time. If
- * someone wants to do IO it will be quick, as it will only
- * have to contend with one operation in flight, and we'll
- * be round-tripping data to the backing disk as quickly as
- * it can accept it.
- */
- if (delay >= HZ / 2) {
- /* 3 means at least 1.5 seconds, up to 7.5 if we
- * have slowed way down.
- */
- if (atomic_inc_return(&dc->backing_idle) >= 3) {
- /* Wait for current I/Os to finish */
- closure_sync(&cl);
- /* And immediately launch a new set. */
- delay = 0;
- }
- }
-
while (!kthread_should_stop() &&
!test_bit(CACHE_SET_IO_DISABLE, &dc->disk.c->flags) &&
delay) {
@@ -741,7 +772,7 @@ void bch_cached_dev_writeback_init(struct cached_dev *dc)
dc->writeback_running = true;
dc->writeback_percent = 10;
dc->writeback_delay = 30;
- dc->writeback_rate.rate = 1024;
+ atomic_long_set(&dc->writeback_rate.rate, 1024);
dc->writeback_rate_minimum = 8;
dc->writeback_rate_update_seconds = WRITEBACK_RATE_UPDATE_SECS_DEFAULT;
The patch below was submitted to be applied to the 4.18-stable tree.
I fail to see how this patch meets the stable kernel rules as found at
Documentation/process/stable-kernel-rules.rst.
I could be totally wrong, and if so, please respond to
<stable(a)vger.kernel.org> and let me know why this patch should be
applied. Otherwise, it is now dropped from my patch queues, never to be
seen again.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 78ac2107176baa0daf65b0fb8e561d2ed14c83ca Mon Sep 17 00:00:00 2001
From: Coly Li <colyli(a)suse.de>
Date: Thu, 9 Aug 2018 15:48:42 +0800
Subject: [PATCH] bcache: do not check return value of debugfs_create_dir()
Greg KH suggests that normal code should not care about debugfs. Therefore
no matter successful or failed of debugfs_create_dir() execution, it is
unncessary to check its return value.
There are two functions called debugfs_create_dir() and check the return
value, which are bch_debug_init() and closure_debug_init(). This patch
changes these two functions from int to void type, and ignore return values
of debugfs_create_dir().
This patch does not fix exact bug, just makes things work as they should.
Signed-off-by: Coly Li <colyli(a)suse.de>
Suggested-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: stable(a)vger.kernel.org
Cc: Kai Krakow <kai(a)kaishome.de>
Cc: Kent Overstreet <kent.overstreet(a)gmail.com>
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 872ef4d67711..0a3e82b0876d 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -1001,7 +1001,7 @@ void bch_open_buckets_free(struct cache_set *);
int bch_cache_allocator_start(struct cache *ca);
void bch_debug_exit(void);
-int bch_debug_init(struct kobject *);
+void bch_debug_init(struct kobject *kobj);
void bch_request_exit(void);
int bch_request_init(void);
diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c
index 0e14969182c6..618253683d40 100644
--- a/drivers/md/bcache/closure.c
+++ b/drivers/md/bcache/closure.c
@@ -199,11 +199,16 @@ static const struct file_operations debug_ops = {
.release = single_release
};
-int __init closure_debug_init(void)
+void __init closure_debug_init(void)
{
- closure_debug = debugfs_create_file("closures",
- 0400, bcache_debug, NULL, &debug_ops);
- return IS_ERR_OR_NULL(closure_debug);
+ if (!IS_ERR_OR_NULL(bcache_debug))
+ /*
+ * it is unnecessary to check return value of
+ * debugfs_create_file(), we should not care
+ * about this.
+ */
+ closure_debug = debugfs_create_file(
+ "closures", 0400, bcache_debug, NULL, &debug_ops);
}
#endif
diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h
index 71427eb5fdae..7c2c5bc7c88b 100644
--- a/drivers/md/bcache/closure.h
+++ b/drivers/md/bcache/closure.h
@@ -186,13 +186,13 @@ static inline void closure_sync(struct closure *cl)
#ifdef CONFIG_BCACHE_CLOSURES_DEBUG
-int closure_debug_init(void);
+void closure_debug_init(void);
void closure_debug_create(struct closure *cl);
void closure_debug_destroy(struct closure *cl);
#else
-static inline int closure_debug_init(void) { return 0; }
+static inline void closure_debug_init(void) {}
static inline void closure_debug_create(struct closure *cl) {}
static inline void closure_debug_destroy(struct closure *cl) {}
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index 04d146711950..12034c07257b 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -252,11 +252,12 @@ void bch_debug_exit(void)
debugfs_remove_recursive(bcache_debug);
}
-int __init bch_debug_init(struct kobject *kobj)
+void __init bch_debug_init(struct kobject *kobj)
{
- if (!IS_ENABLED(CONFIG_DEBUG_FS))
- return 0;
-
+ /*
+ * it is unnecessary to check return value of
+ * debugfs_create_file(), we should not care
+ * about this.
+ */
bcache_debug = debugfs_create_dir("bcache", NULL);
- return IS_ERR_OR_NULL(bcache_debug);
}
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index e0a92104ca23..c7ffa6ef3f82 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -2345,10 +2345,12 @@ static int __init bcache_init(void)
goto err;
if (bch_request_init() ||
- bch_debug_init(bcache_kobj) || closure_debug_init() ||
sysfs_create_files(bcache_kobj, files))
goto err;
+ bch_debug_init(bcache_kobj);
+ closure_debug_init();
+
return 0;
err:
bcache_exit();
The patch below does not apply to the 3.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 54648cf1ec2d7f4b6a71767799c45676a138ca24 Mon Sep 17 00:00:00 2001
From: xiao jin <jin.xiao(a)intel.com>
Date: Mon, 30 Jul 2018 14:11:12 +0800
Subject: [PATCH] block: blk_init_allocated_queue() set q->fq as NULL in the
fail case
We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.
Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function called with error return, it will
run into the fail case to free the q->fq.
Then the __blk_drain_queue() uses the same memory after the free
of the q->fq, it will lead to the unpredictable event.
The patch is to set q->fq as NULL in the fail case of
blk_init_allocated_queue().
Fixes: commit 7c94e1c157a2 ("block: introduce blk_flush_queue to drive flush machinery")
Cc: <stable(a)vger.kernel.org>
Reviewed-by: Ming Lei <ming.lei(a)redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche(a)wdc.com>
Signed-off-by: xiao jin <jin.xiao(a)intel.com>
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/block/blk-core.c b/block/blk-core.c
index 03a4ea93a5f3..23cd1b7770e7 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1184,6 +1184,7 @@ int blk_init_allocated_queue(struct request_queue *q)
q->exit_rq_fn(q, q->fq->flush_rq);
out_free_flush_queue:
blk_free_flush_queue(q->fq);
+ q->fq = NULL;
return -ENOMEM;
}
EXPORT_SYMBOL(blk_init_allocated_queue);
The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 54648cf1ec2d7f4b6a71767799c45676a138ca24 Mon Sep 17 00:00:00 2001
From: xiao jin <jin.xiao(a)intel.com>
Date: Mon, 30 Jul 2018 14:11:12 +0800
Subject: [PATCH] block: blk_init_allocated_queue() set q->fq as NULL in the
fail case
We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.
Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function called with error return, it will
run into the fail case to free the q->fq.
Then the __blk_drain_queue() uses the same memory after the free
of the q->fq, it will lead to the unpredictable event.
The patch is to set q->fq as NULL in the fail case of
blk_init_allocated_queue().
Fixes: commit 7c94e1c157a2 ("block: introduce blk_flush_queue to drive flush machinery")
Cc: <stable(a)vger.kernel.org>
Reviewed-by: Ming Lei <ming.lei(a)redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche(a)wdc.com>
Signed-off-by: xiao jin <jin.xiao(a)intel.com>
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/block/blk-core.c b/block/blk-core.c
index 03a4ea93a5f3..23cd1b7770e7 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1184,6 +1184,7 @@ int blk_init_allocated_queue(struct request_queue *q)
q->exit_rq_fn(q, q->fq->flush_rq);
out_free_flush_queue:
blk_free_flush_queue(q->fq);
+ q->fq = NULL;
return -ENOMEM;
}
EXPORT_SYMBOL(blk_init_allocated_queue);
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 54648cf1ec2d7f4b6a71767799c45676a138ca24 Mon Sep 17 00:00:00 2001
From: xiao jin <jin.xiao(a)intel.com>
Date: Mon, 30 Jul 2018 14:11:12 +0800
Subject: [PATCH] block: blk_init_allocated_queue() set q->fq as NULL in the
fail case
We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.
Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function called with error return, it will
run into the fail case to free the q->fq.
Then the __blk_drain_queue() uses the same memory after the free
of the q->fq, it will lead to the unpredictable event.
The patch is to set q->fq as NULL in the fail case of
blk_init_allocated_queue().
Fixes: commit 7c94e1c157a2 ("block: introduce blk_flush_queue to drive flush machinery")
Cc: <stable(a)vger.kernel.org>
Reviewed-by: Ming Lei <ming.lei(a)redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche(a)wdc.com>
Signed-off-by: xiao jin <jin.xiao(a)intel.com>
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/block/blk-core.c b/block/blk-core.c
index 03a4ea93a5f3..23cd1b7770e7 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1184,6 +1184,7 @@ int blk_init_allocated_queue(struct request_queue *q)
q->exit_rq_fn(q, q->fq->flush_rq);
out_free_flush_queue:
blk_free_flush_queue(q->fq);
+ q->fq = NULL;
return -ENOMEM;
}
EXPORT_SYMBOL(blk_init_allocated_queue);
The default mid-level PLL bias current setting interferes with sigma
delta modulation. This manifests as decreased audio quality at lower
sampling rates, which sounds like radio broadcast quality, and
distortion noises at sampling rates at 48 kHz or above.
Changing the bias current settings to the lowest gets rid of the
noise.
Fixes: de3448519194 ("clk: sunxi-ng: sun4i: Use sigma-delta modulation
for audio PLL")
Cc: <stable(a)vger.kernel.org> # 4.15.x
Signed-off-by: Chen-Yu Tsai <wens(a)csie.org>
---
drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/sunxi-ng/ccu-sun4i-a10.c b/drivers/clk/sunxi-ng/ccu-sun4i-a10.c
index ffa5dac221e4..129ebd2588fd 100644
--- a/drivers/clk/sunxi-ng/ccu-sun4i-a10.c
+++ b/drivers/clk/sunxi-ng/ccu-sun4i-a10.c
@@ -1434,8 +1434,16 @@ static void __init sun4i_ccu_init(struct device_node *node,
return;
}
- /* Force the PLL-Audio-1x divider to 1 */
val = readl(reg + SUN4I_PLL_AUDIO_REG);
+
+ /*
+ * Force VCO and PLL bias current to lowest setting. Higher
+ * settings interfere with sigma-delta modulation and result
+ * in audible noise and distortions when using SPDIF or I2S.
+ */
+ val &= ~GENMASK(25, 16);
+
+ /* Force the PLL-Audio-1x divider to 1 */
val &= ~GENMASK(29, 26);
writel(val | (1 << 26), reg + SUN4I_PLL_AUDIO_REG);
--
2.19.0.rc1
Hello!
Please apply the following commit to the v4.18 -stable tree:
rcu: Make expedited GPs handle CPU 0 being offline
fcc63543650150629c8a873cbef3578770acecd9
This patch fixes a v4.18 regression that is causing the RISC-V people
(CCed) some trouble. It is a small patch and has been tested in the
failing situation running v4.18 by Atish Patra and Andreas Schwab
(both CCed).
Please let me know if more information is required.
Thanx, Paul
Commit 136f55f66019 ("net: lan78xx: fix rx handling before first
packet is send") was not correctly backported to 4.4. The call to
tasklet_schedule() belongs in lan78xx_link_reset().
Fixes: d1fc12d8475c ("net: lan78xx: fix rx handling before first packet is send")
Signed-off-by: Ben Hutchings <ben.hutchings(a)codethink.co.uk>
---
This is for 4.4 only; the backports to other stable branches look OK.
I didn't test the driver on any branch though.
Ben.
drivers/net/usb/lan78xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index acec4b565511..1aede726052c 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -902,6 +902,8 @@ static int lan78xx_link_reset(struct lan78xx_net *dev)
ret = lan78xx_update_flowcontrol(dev, ecmd.duplex, ladv, radv);
netif_carrier_on(dev->net);
+
+ tasklet_schedule(&dev->bh);
}
return ret;
@@ -1361,8 +1363,6 @@ static void lan78xx_init_mac_address(struct lan78xx_net *dev)
netif_dbg(dev, ifup, dev->net,
"MAC address set to random addr");
}
-
- tasklet_schedule(&dev->bh);
}
ret = lan78xx_write_reg(dev, MAF_LO(0), addr_lo);
--
Ben Hutchings, Software Developer Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
Manchester, M1 2HF, United Kingdom
From: "Steven Rostedt (VMware)" <rostedt(a)goodmis.org>
I hit the following splat in my tests:
------------[ cut here ]------------
IRQs not enabled as expected
WARNING: CPU: 3 PID: 0 at kernel/time/tick-sched.c:982 tick_nohz_idle_enter+0x44/0x8c
Modules linked in: ip6t_REJECT nf_reject_ipv6 ip6table_filter ip6_tables ipv6
CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.19.0-rc2-test+ #2
Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 02/22/2014
EIP: tick_nohz_idle_enter+0x44/0x8c
Code: ec 05 00 00 00 75 26 83 b8 c0 05 00 00 00 75 1d 80 3d d0 36 3e c1 00
75 14 68 94 63 12 c1 c6 05 d0 36 3e c1 01 e8 04 ee f8 ff <0f> 0b 58 fa bb a0
e5 66 c1 e8 25 0f 04 00 64 03 1d 28 31 52 c1 8b
EAX: 0000001c EBX: f26e7f8c ECX: 00000006 EDX: 00000007
ESI: f26dd1c0 EDI: 00000000 EBP: f26e7f40 ESP: f26e7f38
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010296
CR0: 80050033 CR2: 0813c6b0 CR3: 2f342000 CR4: 001406f0
Call Trace:
do_idle+0x33/0x202
cpu_startup_entry+0x61/0x63
start_secondary+0x18e/0x1ed
startup_32_smp+0x164/0x168
irq event stamp: 18773830
hardirqs last enabled at (18773829): [<c040150c>] trace_hardirqs_on_thunk+0xc/0x10
hardirqs last disabled at (18773830): [<c040151c>] trace_hardirqs_off_thunk+0xc/0x10
softirqs last enabled at (18773824): [<c0ddaa6f>] __do_softirq+0x25f/0x2bf
softirqs last disabled at (18773767): [<c0416bbe>] call_on_stack+0x45/0x4b
---[ end trace b7c64aa79e17954a ]---
After a bit of debugging, I found what was happening. This would trigger
when performing "perf" with a high NMI interrupt rate, while enabling and
disabling function tracer. Ftrace uses breakpoints to convert the nops at
the start of functions to calls to the function trampolines. The breakpoint
traps disable interrupts and this makes calls into lockdep via the
trace_hardirqs_off_thunk in the entry.S code. What happens is the following:
do_idle {
[interrupts enabled]
<interrupt> [interrupts disabled]
TRACE_IRQS_OFF [lockdep says irqs off]
[...]
TRACE_IRQS_IRET
test if pt_regs say return to interrupts enabled [yes]
TRACE_IRQS_ON [lockdep says irqs are on]
<nmi>
nmi_enter() {
printk_nmi_enter() [traced by ftrace]
[ hit ftrace breakpoint ]
<breakpoint exception>
TRACE_IRQS_OFF [lockdep says irqs off]
[...]
TRACE_IRQS_IRET [return from breakpoint]
test if pt_regs say interrupts enabled [no]
[iret back to interrupt]
[iret back to code]
tick_nohz_idle_enter() {
lockdep_assert_irqs_enabled() [lockdep say no!]
Although interrupts are indeed enabled, lockdep thinks it is not, and since
we now do asserts via lockdep, it gives a false warning. The issue here is
that printk_nmi_enter() is called before lockdep_off(), which disables
lockdep (for this reason) in NMIs. By simply not allowing ftrace to see
printk_nmi_enter() (via notrace annotation) we keep lockdep from getting
confused.
Cc: stable(a)vger.kernel.org
Fixes: 42a0bb3f71383 ("printk/nmi: generic solution for safe printk in NMI")
Acked-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
Acked-by: Petr Mladek <pmladek(a)suse.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
---
kernel/printk/printk_safe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c
index a0a74c533e4b..0913b4d385de 100644
--- a/kernel/printk/printk_safe.c
+++ b/kernel/printk/printk_safe.c
@@ -306,12 +306,12 @@ static __printf(1, 0) int vprintk_nmi(const char *fmt, va_list args)
return printk_safe_log_store(s, fmt, args);
}
-void printk_nmi_enter(void)
+void notrace printk_nmi_enter(void)
{
this_cpu_or(printk_context, PRINTK_NMI_CONTEXT_MASK);
}
-void printk_nmi_exit(void)
+void notrace printk_nmi_exit(void)
{
this_cpu_and(printk_context, ~PRINTK_NMI_CONTEXT_MASK);
}
--
2.18.0
From: Chas Williams <chas3(a)att.com>
Commit 3c226c637b69 ("mm: numa: avoid waiting on freed migrated pages")
was an incomplete backport of the upstream commit. It is necessary to
always reset page_nid before attempting any early exit.
---
mm/huge_memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 9efe88ef9702..e4c6c3edaf6a 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1259,12 +1259,12 @@ int do_huge_pmd_numa_page(struct fault_env *fe, pmd_t pmd)
/* Migration could have started since the pmd_trans_migrating check */
if (!page_locked) {
+ page_nid = -1;
if (!get_page_unless_zero(page))
goto out_unlock;
spin_unlock(fe->ptl);
wait_on_page_locked(page);
put_page(page);
- page_nid = -1;
goto out;
}
--
2.14.4
This is a note to let you know that I've just added the patch titled
usb: gadget: udc: renesas_usb3: fix maxpacket size of ep0
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From dfe1a51d2a36647f74cbad478801efa7cf394376 Mon Sep 17 00:00:00 2001
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh(a)renesas.com>
Date: Fri, 3 Aug 2018 12:12:46 +0900
Subject: usb: gadget: udc: renesas_usb3: fix maxpacket size of ep0
This patch fixes an issue that maxpacket size of ep0 is incorrect
for SuperSpeed. Otherwise, CDC NCM class with SuperSpeed doesn't
work correctly on this driver because its control read data size
is more than 64 bytes.
Reported-by: Junki Kato <junki.kato.xk(a)renesas.com>
Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Cc: <stable(a)vger.kernel.org> # v4.5+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh(a)renesas.com>
Tested-by: Junki Kato <junki.kato.xk(a)renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi(a)linux.intel.com>
---
drivers/usb/gadget/udc/renesas_usb3.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index 1f879b3f2c96..e1656f361e08 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -812,12 +812,15 @@ static void usb3_irq_epc_int_1_speed(struct renesas_usb3 *usb3)
switch (speed) {
case USB_STA_SPEED_SS:
usb3->gadget.speed = USB_SPEED_SUPER;
+ usb3->gadget.ep0->maxpacket = USB3_EP0_SS_MAX_PACKET_SIZE;
break;
case USB_STA_SPEED_HS:
usb3->gadget.speed = USB_SPEED_HIGH;
+ usb3->gadget.ep0->maxpacket = USB3_EP0_HSFS_MAX_PACKET_SIZE;
break;
case USB_STA_SPEED_FS:
usb3->gadget.speed = USB_SPEED_FULL;
+ usb3->gadget.ep0->maxpacket = USB3_EP0_HSFS_MAX_PACKET_SIZE;
break;
default:
usb3->gadget.speed = USB_SPEED_UNKNOWN;
@@ -2513,7 +2516,7 @@ static int renesas_usb3_init_ep(struct renesas_usb3 *usb3, struct device *dev,
/* for control pipe */
usb3->gadget.ep0 = &usb3_ep->ep;
usb_ep_set_maxpacket_limit(&usb3_ep->ep,
- USB3_EP0_HSFS_MAX_PACKET_SIZE);
+ USB3_EP0_SS_MAX_PACKET_SIZE);
usb3_ep->ep.caps.type_control = true;
usb3_ep->ep.caps.dir_in = true;
usb3_ep->ep.caps.dir_out = true;
--
2.18.0
This is a note to let you know that I've just added the patch titled
USB: net2280: Fix erroneous synchronization change
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From dec3c23c9aa1815f07d98ae0375b4cbc10971e13 Mon Sep 17 00:00:00 2001
From: Alan Stern <stern(a)rowland.harvard.edu>
Date: Wed, 8 Aug 2018 11:20:39 -0400
Subject: USB: net2280: Fix erroneous synchronization change
Commit f16443a034c7 ("USB: gadgetfs, dummy-hcd, net2280: fix locking
for callbacks") was based on a serious misunderstanding. It
introduced regressions into both the dummy-hcd and net2280 drivers.
The problem in dummy-hcd was fixed by commit 7dbd8f4cabd9 ("USB:
dummy-hcd: Fix erroneous synchronization change"), but the problem in
net2280 remains. Namely: the ->disconnect(), ->suspend(), ->resume(),
and ->reset() callbacks must be invoked without the private lock held;
otherwise a deadlock will occur when the callback routine tries to
interact with the UDC driver.
This patch largely is a reversion of the relevant parts of
f16443a034c7. It also drops the private lock around the calls to
->suspend() and ->resume() (something the earlier patch forgot to do).
This is safe from races with device interrupts because it occurs
within the interrupt handler.
Finally, the patch changes where the ->disconnect() callback is
invoked when net2280_pullup() turns the pullup off. Rather than
making the callback from within stop_activity() at a time when dropping
the private lock could be unsafe, the callback is moved to a point
after the lock has already been dropped.
Signed-off-by: Alan Stern <stern(a)rowland.harvard.edu>
Fixes: f16443a034c7 ("USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks")
Reported-by: D. Ziesche <dziesche(a)zes.com>
Tested-by: D. Ziesche <dziesche(a)zes.com>
CC: <stable(a)vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi(a)linux.intel.com>
---
drivers/usb/gadget/udc/net2280.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index 318246d8b2e2..b02ab2a8d927 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -1545,11 +1545,14 @@ static int net2280_pullup(struct usb_gadget *_gadget, int is_on)
writel(tmp | BIT(USB_DETECT_ENABLE), &dev->usb->usbctl);
} else {
writel(tmp & ~BIT(USB_DETECT_ENABLE), &dev->usb->usbctl);
- stop_activity(dev, dev->driver);
+ stop_activity(dev, NULL);
}
spin_unlock_irqrestore(&dev->lock, flags);
+ if (!is_on && dev->driver)
+ dev->driver->disconnect(&dev->gadget);
+
return 0;
}
@@ -2466,8 +2469,11 @@ static void stop_activity(struct net2280 *dev, struct usb_gadget_driver *driver)
nuke(&dev->ep[i]);
/* report disconnect; the driver is already quiesced */
- if (driver)
+ if (driver) {
+ spin_unlock(&dev->lock);
driver->disconnect(&dev->gadget);
+ spin_lock(&dev->lock);
+ }
usb_reinit(dev);
}
@@ -3341,6 +3347,8 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
BIT(PCI_RETRY_ABORT_INTERRUPT))
static void handle_stat1_irqs(struct net2280 *dev, u32 stat)
+__releases(dev->lock)
+__acquires(dev->lock)
{
struct net2280_ep *ep;
u32 tmp, num, mask, scratch;
@@ -3381,12 +3389,14 @@ static void handle_stat1_irqs(struct net2280 *dev, u32 stat)
if (disconnect || reset) {
stop_activity(dev, dev->driver);
ep0_start(dev);
+ spin_unlock(&dev->lock);
if (reset)
usb_gadget_udc_reset
(&dev->gadget, dev->driver);
else
(dev->driver->disconnect)
(&dev->gadget);
+ spin_lock(&dev->lock);
return;
}
}
@@ -3405,6 +3415,7 @@ static void handle_stat1_irqs(struct net2280 *dev, u32 stat)
tmp = BIT(SUSPEND_REQUEST_CHANGE_INTERRUPT);
if (stat & tmp) {
writel(tmp, &dev->regs->irqstat1);
+ spin_unlock(&dev->lock);
if (stat & BIT(SUSPEND_REQUEST_INTERRUPT)) {
if (dev->driver->suspend)
dev->driver->suspend(&dev->gadget);
@@ -3415,6 +3426,7 @@ static void handle_stat1_irqs(struct net2280 *dev, u32 stat)
dev->driver->resume(&dev->gadget);
/* at high speed, note erratum 0133 */
}
+ spin_lock(&dev->lock);
stat &= ~tmp;
}
--
2.18.0
Hello,
First, thank you for maintaining so many kernel versions so well!
I recently tested the v4.9 version and I had this warning:
[ 8.004728] ------------[ cut here ]------------
[ 8.005169] WARNING: CPU: 0 PID: 0 at
/home/jenkins/slave/workspace/kernel_v4.9.x/kernelspace/kernel/softirq.c:165
__local_bh_enable_ip+0x66/0x80
[ 8.006397] Modules linked in:
[ 8.006738] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.123 #2
[ 8.007297] Hardware name: Red Hat KVM, BIOS 1.11.0-2.el7 04/01/2014
[ 8.007841] ffff88001fc03a90 ffffffff811c9935 0000000000000000
0000000000000000
[ 8.008519] ffff88001fc03ad0 ffffffff81046d27 000000a50ca87c00
0000000000000200
[ 8.009186] ffff88000ca87c00 ffff88000f200000 ffff88000c5007c0
ffff88000b47f24e
[ 8.009813] Call Trace:
[ 8.010033] <IRQ> [ 8.010195] [<ffffffff811c9935>]
dump_stack+0x63/0x8e
[ 8.010636] [<ffffffff81046d27>] __warn+0xc7/0xf0
[ 8.011039] [<ffffffff81046e08>] warn_slowpath_null+0x18/0x20
[ 8.011503] [<ffffffff8104a686>] __local_bh_enable_ip+0x66/0x80
[ 8.012044] [<ffffffff814f8d55>] _raw_spin_unlock_bh+0x15/0x20
[ 8.012515] [<ffffffff8146ee87>] jtcp_rcv_established+0x227/0x2b0
[ 8.013050] [<ffffffff81444963>] tcp_v4_do_rcv+0x163/0x1f0
[ 8.013493] [<ffffffff81447b25>] tcp_v4_rcv+0xe85/0x10a0
[ 8.013957] [<ffffffff8146b23c>] ? nf_nat_ipv4_fn+0x19c/0x1e0
[ 8.014431] [<ffffffff8146e8b0>] ? iptable_nat_ipv4_fn+0x20/0x20
[ 8.015013] [<ffffffff8141fa8f>] ip_local_deliver_finish+0x9f/0x140
[ 8.015517] [<ffffffff81420090>] ip_local_deliver+0xc0/0xd0
[ 8.016027] [<ffffffff8141f9f0>] ? inet_del_offload+0x40/0x40
[ 8.016490] [<ffffffff8141fccb>] ip_rcv_finish+0x19b/0x350
[ 8.017028] [<ffffffff81420353>] ip_rcv+0x2b3/0x460
[ 8.017425] [<ffffffff8141fb30>] ? ip_local_deliver_finish+0x140/0x140
[ 8.017990] [<ffffffff813b5bde>] __netif_receive_skb_core+0x47e/0x840
[ 8.018508] [<ffffffff8144cff1>] ? tcp4_gro_receive+0x131/0x1b0
[ 8.019029] [<ffffffff8145c2b1>] ? inet_gro_receive+0x231/0x2a0
[ 8.019507] [<ffffffff813b8258>] __netif_receive_skb+0x18/0x60
[ 8.020053] [<ffffffff813b82c8>] netif_receive_skb_internal+0x28/0x90
[ 8.020570] [<ffffffff813b8b48>] napi_gro_receive+0x78/0xa0
[ 8.021064] [<ffffffff81332c28>] virtnet_receive+0x1f8/0x890
[ 8.021520] [<ffffffff813333b8>] virtnet_poll+0x18/0x80
[ 8.021986] [<ffffffff813b9cc6>] net_rx_action+0xf6/0x2c0
[ 8.022422] [<ffffffff8104a44c>] __do_softirq+0xcc/0x1e0
[ 8.022874] [<ffffffff8104a767>] irq_exit+0x67/0x70
[ 8.023290] [<ffffffff81019be1>] do_IRQ+0x51/0xe0
[ 8.023695] [<ffffffff814f99d6>] common_interrupt+0x96/0x96
[ 8.024189] <EOI> [ 8.024351] [<ffffffff814f8b30>] ?
__sched_text_end+0x3/0x3
[ 8.024830] [<ffffffff814f8bc6>] ? native_safe_halt+0x6/0x10
[ 8.025307] [<ffffffff814f8b39>] default_idle+0x9/0x10
[ 8.025742] [<ffffffff81021210>] arch_cpu_idle+0x10/0x20
[ 8.026190] [<ffffffff814f8c4e>] default_idle_call+0x1e/0x30
[ 8.026813] [<ffffffff81077621>] cpu_startup_entry+0xe1/0x1d0
[ 8.027397] [<ffffffff814f453d>] rest_init+0x6d/0x70
[ 8.027832] [<ffffffff8188f0dc>] start_kernel+0x4d0/0x4dd
[ 8.028360] [<ffffffff8188e9fa>] ? set_init_arg+0x55/0x55
[ 8.028821] [<ffffffff8188e120>] ? early_idt_handler_array+0x120/0x120
[ 8.029372] [<ffffffff8188e599>] x86_64_start_reservations+0x2a/0x2c
[ 8.029910] [<ffffffff8188e681>] x86_64_start_kernel+0xe6/0xf3
[ 8.030412] ---[ end trace 5826c2ad94ee574a ]---
After a quick search, Christoph found that this kind of call trace had
already been reported by Intel's kernel test bot:
https://lkml.org/lkml/2017/2/19/251
According to this bot, it seems that the following commit caused the
warning:
e70ac171658679ecf6bea4bbd9e9325cd6079d2b (tcp: tcp_probe: use
spin_lock_bh())
Note that this commit has been backported from v4.10 to v4.9.33.
The next day, Eric Dumazet, the author of the first patch, proposed a
second one which "simply" reverts this commit:
29869d66870a715177bfb505f66a7e0e8bcc89c3 (tcp: Revert "tcp:
tcp_probe: use spin_lock_bh()")
You can find the discussions about this patch here, including a question
from Eric not being sure why it is not needed:
https://patchwork.ozlabs.org/patch/730560/
After having applied this patch (the reverted commit - 29869d66870a) on
the v4.9 tree, I confirm I no longer have the warning mentioned at the
beginning of this email.
I don't think many people are still using tcp probe -- recently removed
in v4.16 -- but it could be nice if someone could backport the commit
29869d66870a in v4.9.y tree to avoid extra warnings.
Again, thank you for your very nice work!
Best regards,
Matt
--
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
The patch titled
Subject: mm: shmem.c: Correctly annotate new inodes for lockdep
has been added to the -mm tree. Its filename is
mm-shmem-correctly-annotate-new-inodes-for-lockdep.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-shmem-correctly-annotate-new-in…
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-shmem-correctly-annotate-new-in…
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: "Joel Fernandes (Google)" <joel(a)joelfernandes.org>
Subject: mm: shmem.c: Correctly annotate new inodes for lockdep
Directories and inodes don't necessarily need to be in the same lockdep
class. For ex, hugetlbfs splits them out too to prevent false positives
in lockdep. Annotate correctly after new inode creation. If its a
directory inode, it will be put into a different class.
This should fix a lockdep splat reported by syzbot:
> ======================================================
> WARNING: possible circular locking dependency detected
> 4.18.0-rc8-next-20180810+ #36 Not tainted
> ------------------------------------------------------
> syz-executor900/4483 is trying to acquire lock:
> 00000000d2bfc8fe (&sb->s_type->i_mutex_key#9){++++}, at: inode_lock
> include/linux/fs.h:765 [inline]
> 00000000d2bfc8fe (&sb->s_type->i_mutex_key#9){++++}, at:
> shmem_fallocate+0x18b/0x12e0 mm/shmem.c:2602
>
> but task is already holding lock:
> 0000000025208078 (ashmem_mutex){+.+.}, at: ashmem_shrink_scan+0xb4/0x630
> drivers/staging/android/ashmem.c:448
>
> which lock already depends on the new lock.
>
> -> #2 (ashmem_mutex){+.+.}:
> __mutex_lock_common kernel/locking/mutex.c:925 [inline]
> __mutex_lock+0x171/0x1700 kernel/locking/mutex.c:1073
> mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1088
> ashmem_mmap+0x55/0x520 drivers/staging/android/ashmem.c:361
> call_mmap include/linux/fs.h:1844 [inline]
> mmap_region+0xf27/0x1c50 mm/mmap.c:1762
> do_mmap+0xa10/0x1220 mm/mmap.c:1535
> do_mmap_pgoff include/linux/mm.h:2298 [inline]
> vm_mmap_pgoff+0x213/0x2c0 mm/util.c:357
> ksys_mmap_pgoff+0x4da/0x660 mm/mmap.c:1585
> __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline]
> __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline]
> __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91
> do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
> entry_SYSCALL_64_after_hwframe+0x49/0xbe
>
> -> #1 (&mm->mmap_sem){++++}:
> __might_fault+0x155/0x1e0 mm/memory.c:4568
> _copy_to_user+0x30/0x110 lib/usercopy.c:25
> copy_to_user include/linux/uaccess.h:155 [inline]
> filldir+0x1ea/0x3a0 fs/readdir.c:196
> dir_emit_dot include/linux/fs.h:3464 [inline]
> dir_emit_dots include/linux/fs.h:3475 [inline]
> dcache_readdir+0x13a/0x620 fs/libfs.c:193
> iterate_dir+0x48b/0x5d0 fs/readdir.c:51
> __do_sys_getdents fs/readdir.c:231 [inline]
> __se_sys_getdents fs/readdir.c:212 [inline]
> __x64_sys_getdents+0x29f/0x510 fs/readdir.c:212
> do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
> entry_SYSCALL_64_after_hwframe+0x49/0xbe
>
> -> #0 (&sb->s_type->i_mutex_key#9){++++}:
> lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924
> down_write+0x8f/0x130 kernel/locking/rwsem.c:70
> inode_lock include/linux/fs.h:765 [inline]
> shmem_fallocate+0x18b/0x12e0 mm/shmem.c:2602
> ashmem_shrink_scan+0x236/0x630 drivers/staging/android/ashmem.c:455
> ashmem_ioctl+0x3ae/0x13a0 drivers/staging/android/ashmem.c:797
> vfs_ioctl fs/ioctl.c:46 [inline]
> file_ioctl fs/ioctl.c:501 [inline]
> do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685
> ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702
> __do_sys_ioctl fs/ioctl.c:709 [inline]
> __se_sys_ioctl fs/ioctl.c:707 [inline]
> __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707
> do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
> entry_SYSCALL_64_after_hwframe+0x49/0xbe
>
> other info that might help us debug this:
>
> Chain exists of:
> &sb->s_type->i_mutex_key#9 --> &mm->mmap_sem --> ashmem_mutex
>
> Possible unsafe locking scenario:
>
> CPU0 CPU1
> ---- ----
> lock(ashmem_mutex);
> lock(&mm->mmap_sem);
> lock(ashmem_mutex);
> lock(&sb->s_type->i_mutex_key#9);
>
> *** DEADLOCK ***
>
> 1 lock held by syz-executor900/4483:
> #0: 0000000025208078 (ashmem_mutex){+.+.}, at:
> ashmem_shrink_scan+0xb4/0x630 drivers/staging/android/ashmem.c:448
Link: http://lkml.kernel.org/r/20180821231835.166639-1-joel@joelfernandes.org
Signed-off-by: Joel Fernandes (Google) <joel(a)joelfernandes.org>
Reported-by: syzbot <syzkaller(a)googlegroups.com>
Reviewed-by: NeilBrown <neilb(a)suse.com>
Suggested-by: NeilBrown <neilb(a)suse.com>
Cc: Matthew Wilcox <willy(a)infradead.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Hugh Dickins <hughd(a)google.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
mm/shmem.c | 2 ++
1 file changed, 2 insertions(+)
--- a/mm/shmem.c~mm-shmem-correctly-annotate-new-inodes-for-lockdep
+++ a/mm/shmem.c
@@ -2227,6 +2227,8 @@ static struct inode *shmem_get_inode(str
mpol_shared_policy_init(&info->policy, NULL);
break;
}
+
+ lockdep_annotate_inode_mutex_key(inode);
} else
shmem_free_inode(sb);
return inode;
_
Patches currently in -mm which might be from joel(a)joelfernandes.org are
mm-shmem-correctly-annotate-new-inodes-for-lockdep.patch
Good day,
I have an interesting business offer for you which will be of immense benefit to you. Although this may be hard to believe and thought of as one of the numerous online scam but
Please grant me the benefit of doubt and write me to know what this entails, am sure you wont regret it. You stand to gain 50% of $27,500,000.00 million USD from this.
All conformable documents to back up the claims will be made available to you prior to your acceptance.
Thanks,
Diana Cesar.
This is the start of the stable review cycle for the 4.9.95 release.
There are 66 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu Apr 19 15:56:27 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.95-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.95-rc1
Phil Elwell <phil(a)raspberrypi.org>
lan78xx: Correctly indicate invalid OTP
Stefan Hajnoczi <stefanha(a)redhat.com>
vhost: fix vhost_vq_access_ok() log check
Tejaswi Tanikella <tejaswit(a)codeaurora.org>
slip: Check if rstate is initialized before uncompressing
Ka-Cheong Poon <ka-cheong.poon(a)oracle.com>
rds: MP-RDS may use an invalid c_path
Bassem Boubaker <bassem.boubaker(a)actia.fr>
cdc_ether: flag the Cinterion AHS8 modem by gemalto as WWAN
Marek Szyprowski <m.szyprowski(a)samsung.com>
hwmon: (ina2xx) Fix access to uninitialized mutex
Sudhir Sreedharan <ssreedharan(a)mvista.com>
rtl8187: Fix NULL pointer dereference in priv->conf_mutex
Szymon Janc <szymon.janc(a)codecoup.pl>
Bluetooth: Fix connection if directed advertising and privacy is used
Al Viro <viro(a)zeniv.linux.org.uk>
getname_kernel() needs to make sure that ->name != ->iname in long case
Vasily Gorbik <gor(a)linux.ibm.com>
s390/ipl: ensure loadparm valid flag is set
Julian Wiedmann <jwi(a)linux.vnet.ibm.com>
s390/qdio: don't merge ERROR output buffers
Julian Wiedmann <jwi(a)linux.vnet.ibm.com>
s390/qdio: don't retry EQBS after CCQ 96
Dan Williams <dan.j.williams(a)intel.com>
nfit: fix region registration vs block-data-window ranges
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
block/loop: fix deadlock after loop_set_status
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "perf tests: Decompress kernel module before objdump"
Eric Biggers <ebiggers(a)google.com>
sunrpc: remove incorrect HMAC request initialization
Mark Rutland <mark.rutland(a)arm.com>
arm64: Kill PSCI_GET_VERSION as a variant-2 workaround
Mark Rutland <mark.rutland(a)arm.com>
arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: smccc: Implement SMCCC v1.1 inline primitive
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: smccc: Make function identifiers an unsigned quantity
Mark Rutland <mark.rutland(a)arm.com>
firmware/psci: Expose SMCCC version through psci_ops
Mark Rutland <mark.rutland(a)arm.com>
firmware/psci: Expose PSCI conduit
Mark Rutland <mark.rutland(a)arm.com>
arm64: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling
Mark Rutland <mark.rutland(a)arm.com>
arm64: KVM: Report SMCCC_ARCH_WORKAROUND_1 BP hardening support
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: KVM: Turn kvm_psci_version into a static inline
Mark Rutland <mark.rutland(a)arm.com>
arm64: KVM: Make PSCI_VERSION a fast path
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: KVM: Advertise SMCCC v1.1
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: KVM: Implement PSCI 1.0 support
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: KVM: Add smccc accessors to PSCI code
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: KVM: Add PSCI_VERSION helper
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: KVM: Consolidate the PSCI include files
Mark Rutland <mark.rutland(a)arm.com>
arm64: KVM: Increment PC after handling an SMC trap
Mark Rutland <mark.rutland(a)arm.com>
arm64: Branch predictor hardening for Cavium ThunderX2
Mark Rutland <mark.rutland(a)arm.com>
arm64: Implement branch predictor hardening for affected Cortex-A CPUs
Mark Rutland <mark.rutland(a)arm.com>
arm64: cpu_errata: Allow an erratum to be match for all revisions of a core
Mark Rutland <mark.rutland(a)arm.com>
arm64: cputype: Add missing MIDR values for Cortex-A72 and Cortex-A75
Mark Rutland <mark.rutland(a)arm.com>
arm64: entry: Apply BP hardening for suspicious interrupts from EL0
Mark Rutland <mark.rutland(a)arm.com>
arm64: entry: Apply BP hardening for high-priority synchronous exceptions
Mark Rutland <mark.rutland(a)arm.com>
arm64: KVM: Use per-CPU vector when BP hardening is enabled
Mark Rutland <mark.rutland(a)arm.com>
mm: Introduce lm_alias
Mark Rutland <mark.rutland(a)arm.com>
arm64: Move BP hardening to check_and_switch_context
Mark Rutland <mark.rutland(a)arm.com>
arm64: Add skeleton to harden the branch predictor against aliasing attacks
Mark Rutland <mark.rutland(a)arm.com>
arm64: Move post_ttbr_update_workaround to C code
Mark Rutland <mark.rutland(a)arm.com>
arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro
Mark Rutland <mark.rutland(a)arm.com>
drivers/firmware: Expose psci_get_version through psci_ops structure
Mark Rutland <mark.rutland(a)arm.com>
arm64: cpufeature: Pass capability structure to ->enable callback
Mark Rutland <mark.rutland(a)arm.com>
arm64: Run enable method for errata work arounds on late CPUs
Mark Rutland <mark.rutland(a)arm.com>
arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early
Mark Rutland <mark.rutland(a)arm.com>
arm64: uaccess: Mask __user pointers for __arch_{clear, copy_*}_user
Mark Rutland <mark.rutland(a)arm.com>
arm64: uaccess: Don't bother eliding access_ok checks in __{get, put}_user
Mark Rutland <mark.rutland(a)arm.com>
arm64: uaccess: Prevent speculative use of the current addr_limit
Mark Rutland <mark.rutland(a)arm.com>
arm64: entry: Ensure branch through syscall table is bounded under speculation
Mark Rutland <mark.rutland(a)arm.com>
arm64: Use pointer masking to limit uaccess speculation
Mark Rutland <mark.rutland(a)arm.com>
arm64: Make USER_DS an inclusive limit
Mark Rutland <mark.rutland(a)arm.com>
arm64: move TASK_* definitions to <asm/processor.h>
Mark Rutland <mark.rutland(a)arm.com>
arm64: Implement array_index_mask_nospec()
Mark Rutland <mark.rutland(a)arm.com>
arm64: barrier: Add CSDB macros to control data-value prediction
Arnd Bergmann <arnd(a)arndb.de>
radeon: hide pointless #warning when compile testing
Prashant Bhole <bhole_prashant_q7(a)lab.ntt.co.jp>
perf/core: Fix use-after-free in uprobe_perf_close()
Adrian Hunter <adrian.hunter(a)intel.com>
perf intel-pt: Fix timestamp following overflow
Adrian Hunter <adrian.hunter(a)intel.com>
perf intel-pt: Fix error recovery from missing TIP packet
Adrian Hunter <adrian.hunter(a)intel.com>
perf intel-pt: Fix sync_switch
Adrian Hunter <adrian.hunter(a)intel.com>
perf intel-pt: Fix overlap detection to identify consecutive buffers correctly
Dexuan Cui <decui(a)microsoft.com>
Drivers: hv: vmbus: do not mark HV_PCIE as perf_device
Helge Deller <deller(a)gmx.de>
parisc: Fix out of array access in match_pci_device()
Mauro Carvalho Chehab <mchehab(a)kernel.org>
media: v4l2-compat-ioctl32: don't oops on overlay
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/kvm_host.h | 6 +
arch/arm/include/asm/kvm_mmu.h | 10 +
arch/arm/include/asm/kvm_psci.h | 27 -
arch/arm/kvm/arm.c | 11 +-
arch/arm/kvm/handle_exit.c | 4 +-
arch/arm/kvm/psci.c | 143 +-
arch/arm64/Kconfig | 17 +
arch/arm64/crypto/sha256-core.S | 2061 ++++++++++++++++++++
arch/arm64/crypto/sha512-core.S | 1085 +++++++++++
arch/arm64/include/asm/assembler.h | 19 +
arch/arm64/include/asm/barrier.h | 23 +
arch/arm64/include/asm/cpucaps.h | 3 +-
arch/arm64/include/asm/cputype.h | 6 +
arch/arm64/include/asm/kvm_host.h | 5 +
arch/arm64/include/asm/kvm_mmu.h | 38 +
arch/arm64/include/asm/kvm_psci.h | 27 -
arch/arm64/include/asm/memory.h | 15 -
arch/arm64/include/asm/mmu.h | 39 +
arch/arm64/include/asm/processor.h | 24 +
arch/arm64/include/asm/sysreg.h | 2 +
arch/arm64/include/asm/uaccess.h | 153 +-
arch/arm64/kernel/Makefile | 4 +
arch/arm64/kernel/arm64ksyms.c | 4 +-
arch/arm64/kernel/bpi.S | 75 +
arch/arm64/kernel/cpu_errata.c | 189 +-
arch/arm64/kernel/cpufeature.c | 10 +-
arch/arm64/kernel/entry.S | 25 +-
arch/arm64/kvm/handle_exit.c | 16 +-
arch/arm64/kvm/hyp/hyp-entry.S | 20 +-
arch/arm64/kvm/hyp/switch.c | 5 +-
arch/arm64/lib/clear_user.S | 6 +-
arch/arm64/lib/copy_in_user.S | 4 +-
arch/arm64/mm/context.c | 12 +
arch/arm64/mm/fault.c | 34 +-
arch/arm64/mm/proc.S | 7 +-
arch/parisc/kernel/drivers.c | 4 +
arch/s390/kernel/ipl.c | 1 +
drivers/acpi/nfit/core.c | 22 +-
drivers/block/loop.c | 12 +-
drivers/firmware/psci.c | 57 +-
drivers/gpu/drm/radeon/radeon_object.c | 3 +-
drivers/hv/channel_mgmt.c | 2 +-
drivers/hwmon/ina2xx.c | 3 +-
drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 4 +-
drivers/net/slip/slhc.c | 5 +
drivers/net/usb/cdc_ether.c | 6 +
drivers/net/usb/lan78xx.c | 3 +-
drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c | 2 +-
drivers/s390/cio/qdio_main.c | 42 +-
drivers/vhost/vhost.c | 8 +-
fs/namei.c | 3 +-
include/kvm/arm_psci.h | 51 +
include/linux/arm-smccc.h | 165 +-
include/linux/mm.h | 4 +
include/linux/psci.h | 14 +
include/net/bluetooth/hci_core.h | 2 +-
include/net/slhc_vj.h | 1 +
include/uapi/linux/psci.h | 3 +
kernel/events/core.c | 6 +
net/bluetooth/hci_conn.c | 29 +-
net/bluetooth/hci_event.c | 15 +-
net/bluetooth/l2cap_core.c | 2 +-
net/rds/send.c | 15 +-
net/sunrpc/auth_gss/gss_krb5_crypto.c | 3 -
tools/perf/tests/code-reading.c | 20 +-
.../perf/util/intel-pt-decoder/intel-pt-decoder.c | 64 +-
.../perf/util/intel-pt-decoder/intel-pt-decoder.h | 2 +-
tools/perf/util/intel-pt.c | 37 +-
69 files changed, 4423 insertions(+), 320 deletions(-)
The patch titled
Subject: uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name
has been removed from the -mm tree. Its filename was
uapi-linux-keyctlh-dont-use-c-reserved-keyword-as-a-struct-member-name.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Randy Dunlap <rdunlap(a)infradead.org>
Subject: uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name
Since this header is in "include/uapi/linux/", apparently people want to
use it in userspace programs -- even in C++ ones. However, the header
uses a C++ reserved keyword ("private"), so change that to "dh_private"
instead to allow the header file to be used in C++ userspace.
Fixes https://bugzilla.kernel.org/show_bug.cgi?id=191051
Link: http://lkml.kernel.org/r/0db6c314-1ef4-9bfa-1baa-7214dd2ee061@infradead.org
Fixes: ddbb41148724 ("KEYS: Add KEYCTL_DH_COMPUTE command")
Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
Reviewed-by: Andrew Morton <akpm(a)linux-foundation.org>
Cc: David Howells <dhowells(a)redhat.com>
Cc: James Morris <jmorris(a)namei.org>
Cc: "Serge E. Hallyn" <serge(a)hallyn.com>
Cc: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
include/uapi/linux/keyctl.h | 2 +-
security/keys/dh.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/include/uapi/linux/keyctl.h~uapi-linux-keyctlh-dont-use-c-reserved-keyword-as-a-struct-member-name
+++ a/include/uapi/linux/keyctl.h
@@ -65,7 +65,7 @@
/* keyctl structures */
struct keyctl_dh_params {
- __s32 private;
+ __s32 dh_private;
__s32 prime;
__s32 base;
};
--- a/security/keys/dh.c~uapi-linux-keyctlh-dont-use-c-reserved-keyword-as-a-struct-member-name
+++ a/security/keys/dh.c
@@ -300,7 +300,7 @@ long __keyctl_dh_compute(struct keyctl_d
}
dh_inputs.g_size = dlen;
- dlen = dh_data_from_key(pcopy.private, &dh_inputs.key);
+ dlen = dh_data_from_key(pcopy.dh_private, &dh_inputs.key);
if (dlen < 0) {
ret = dlen;
goto out2;
_
Patches currently in -mm which might be from rdunlap(a)infradead.org are
The patch titled
Subject: memory_hotplug: fix kernel_panic on offline page processing
has been removed from the -mm tree. Its filename was
memory_hotplug-fix-kernel_panic-on-offline-page-processing.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Mikhail Zaslonko <zaslonko(a)linux.ibm.com>
Subject: memory_hotplug: fix kernel_panic on offline page processing
Within show_valid_zones() the function test_pages_in_a_zone() should be
called for online memory blocks only. Otherwise it might lead to the
VM_BUG_ON due to uninitialized struct pages (when CONFIG_DEBUG_VM_PGFLAGS
kernel option is set):
page dumped because: VM_BUG_ON_PAGE(PagePoisoned(p))
------------[ cut here ]------------
Call Trace:
([<000000000038f91e>] test_pages_in_a_zone+0xe6/0x168)
[<0000000000923472>] show_valid_zones+0x5a/0x1a8
[<0000000000900284>] dev_attr_show+0x3c/0x78
[<000000000046f6f0>] sysfs_kf_seq_show+0xd0/0x150
[<00000000003ef662>] seq_read+0x212/0x4b8
[<00000000003bf202>] __vfs_read+0x3a/0x178
[<00000000003bf3ca>] vfs_read+0x8a/0x148
[<00000000003bfa3a>] ksys_read+0x62/0xb8
[<0000000000bc2220>] system_call+0xdc/0x2d8
That VM_BUG_ON was triggered by the page poisoning introduced in
mm/sparse.c with the git commit d0dc12e86b31 ("mm/memory_hotplug: optimize
memory hotplug") With the same commit the new 'nid' field has been added
to the struct memory_block in order to store and later on derive the node
id for offline pages (instead of accessing struct page which might be
uninitialized). But one reference to nid in show_valid_zones() function
has been overlooked. Fixed with current commit. Also, nr_pages will not
be used any more after test_pages_in_a_zone() call, do not update it.
Link: http://lkml.kernel.org/r/20180828090539.41491-1-zaslonko@linux.ibm.com
Fixes: d0dc12e86b31 ("mm/memory_hotplug: optimize memory hotplug")
Signed-off-by: Mikhail Zaslonko <zaslonko(a)linux.ibm.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Reviewed-by: Pavel Tatashin <pavel.tatashin(a)microsoft.com>
Cc: <stable(a)vger.kernel.org> [4.17+]
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
drivers/base/memory.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
--- a/drivers/base/memory.c~memory_hotplug-fix-kernel_panic-on-offline-page-processing
+++ a/drivers/base/memory.c
@@ -417,25 +417,23 @@ static ssize_t show_valid_zones(struct d
int nid;
/*
- * The block contains more than one zone can not be offlined.
- * This can happen e.g. for ZONE_DMA and ZONE_DMA32
- */
- if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages, &valid_start_pfn, &valid_end_pfn))
- return sprintf(buf, "none\n");
-
- start_pfn = valid_start_pfn;
- nr_pages = valid_end_pfn - start_pfn;
-
- /*
* Check the existing zone. Make sure that we do that only on the
* online nodes otherwise the page_zone is not reliable
*/
if (mem->state == MEM_ONLINE) {
+ /*
+ * The block contains more than one zone can not be offlined.
+ * This can happen e.g. for ZONE_DMA and ZONE_DMA32
+ */
+ if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages,
+ &valid_start_pfn, &valid_end_pfn))
+ return sprintf(buf, "none\n");
+ start_pfn = valid_start_pfn;
strcat(buf, page_zone(pfn_to_page(start_pfn))->name);
goto out;
}
- nid = pfn_to_nid(start_pfn);
+ nid = mem->nid;
default_zone = zone_for_pfn_range(MMOP_ONLINE_KEEP, nid, start_pfn, nr_pages);
strcat(buf, default_zone->name);
_
Patches currently in -mm which might be from zaslonko(a)linux.ibm.com are
The patch titled
Subject: mm/hugetlb: filter out hugetlb pages if HUGEPAGE migration is not supported.
has been removed from the -mm tree. Its filename was
mm-hugetlb-filter-out-hugetlb-pages-if-hugepage-migration-is-not-supported.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: "Aneesh Kumar K.V" <aneesh.kumar(a)linux.ibm.com>
Subject: mm/hugetlb: filter out hugetlb pages if HUGEPAGE migration is not supported.
When scanning for movable pages, filter out Hugetlb pages if hugepage
migration is not supported. Without this we hit infinte loop in
__offline_pages() where we do
pfn = scan_movable_pages(start_pfn, end_pfn);
if (pfn) { /* We have movable pages */
ret = do_migrate_range(pfn, end_pfn);
goto repeat;
}
Fix this by checking hugepage_migration_supported both in
has_unmovable_pages which is the primary backoff mechanism for page
offlining and for consistency reasons also into scan_movable_pages because
it doesn't make any sense to return a pfn to non-migrateable huge page.
This issue was revealed by, but not caused by 72b39cfc4d75 ("mm,
memory_hotplug: do not fail offlining too early").
Link: http://lkml.kernel.org/r/20180824063314.21981-1-aneesh.kumar@linux.ibm.com
Fixes: 72b39cfc4d75 ("mm, memory_hotplug: do not fail offlining too early")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
Reported-by: Haren Myneni <haren(a)linux.vnet.ibm.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi(a)ah.jp.nec.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
mm/memory_hotplug.c | 3 ++-
mm/page_alloc.c | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
--- a/mm/memory_hotplug.c~mm-hugetlb-filter-out-hugetlb-pages-if-hugepage-migration-is-not-supported
+++ a/mm/memory_hotplug.c
@@ -1333,7 +1333,8 @@ static unsigned long scan_movable_pages(
if (__PageMovable(page))
return pfn;
if (PageHuge(page)) {
- if (page_huge_active(page))
+ if (hugepage_migration_supported(page_hstate(page)) &&
+ page_huge_active(page))
return pfn;
else
pfn = round_up(pfn + 1,
--- a/mm/page_alloc.c~mm-hugetlb-filter-out-hugetlb-pages-if-hugepage-migration-is-not-supported
+++ a/mm/page_alloc.c
@@ -7708,6 +7708,10 @@ bool has_unmovable_pages(struct zone *zo
* handle each tail page individually in migration.
*/
if (PageHuge(page)) {
+
+ if (!hugepage_migration_supported(page_hstate(page)))
+ goto unmovable;
+
iter = round_up(iter + 1, 1<<compound_order(page)) - 1;
continue;
}
_
Patches currently in -mm which might be from aneesh.kumar(a)linux.ibm.com are
The patch titled
Subject: mm: respect arch_dup_mmap() return value
has been removed from the -mm tree. Its filename was
mm-respect-arch_dup_mmap-return-value.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Nadav Amit <namit(a)vmware.com>
Subject: mm: respect arch_dup_mmap() return value
d70f2a14b72a4 ("include/linux/sched/mm.h: uninline mmdrop_async(), etc")
ignored the return value of arch_dup_mmap(). As a result, on x86, a
failure to duplicate the LDT (e.g., due to memory allocation error), would
leave the duplicated memory mapping in an inconsistent state.
Fix by regarding the return value, as it was before the change.
Link: http://lkml.kernel.org/r/20180823051229.211856-1-namit@vmware.com
Fixes: d70f2a14b72a4 ("include/linux/sched/mm.h: uninline mmdrop_async(), etc")
Signed-off-by: Nadav Amit <namit(a)vmware.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
kernel/fork.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/kernel/fork.c~mm-respect-arch_dup_mmap-return-value
+++ a/kernel/fork.c
@@ -550,8 +550,7 @@ static __latent_entropy int dup_mmap(str
goto out;
}
/* a new mm has just been created */
- arch_dup_mmap(oldmm, mm);
- retval = 0;
+ retval = arch_dup_mmap(oldmm, mm);
out:
up_write(&mm->mmap_sem);
flush_tlb_mm(oldmm);
_
Patches currently in -mm which might be from namit(a)vmware.com are
We should only iomap the area of the chip that is memory mapped.
Otherwise we could be mapping devices beyond the memory space or that
belong to other devices.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda(a)gmail.com>
Fixes: ebd71e3a4861 ("mtd: maps: gpio-addr-flash: fix warnings and make more portable")
Cc: <stable(a)vger.kernel.org>
---
Changelog v2:
>From Boris Brezillon:
-Add Fixes and cc:stable
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
index 17be47f72973..6de16e81994c 100644
--- a/drivers/mtd/maps/gpio-addr-flash.c
+++ b/drivers/mtd/maps/gpio-addr-flash.c
@@ -234,7 +234,7 @@ static int gpio_flash_probe(struct platform_device *pdev)
state->map.copy_to = gf_copy_to;
state->map.bankwidth = pdata->width;
state->map.size = state->win_size * (1 << state->gpio_count);
- state->map.virt = ioremap_nocache(memory->start, state->map.size);
+ state->map.virt = ioremap_nocache(memory->start, state->win_size);
if (!state->map.virt)
return -ENOMEM;
--
2.18.0
This is a note to let you know that I've just added the patch titled
USB: serial: ti_usb_3410_5052: fix array underflow in completion
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 5dfdd24eb3d39d815bc952ae98128e967c9bba49 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan(a)kernel.org>
Date: Tue, 21 Aug 2018 11:59:53 +0200
Subject: USB: serial: ti_usb_3410_5052: fix array underflow in completion
handler
Similarly to a recently reported bug in io_ti, a malicious USB device
could set port_number to a negative value and we would underflow the
port array in the interrupt completion handler.
As these devices only have one or two ports, fix this by making sure we
only consider the seventh bit when determining the port number (and
ignore bits 0xb0 which are typically set to 0x30).
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/usb/serial/ti_usb_3410_5052.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 3010878f7f8e..e3c5832337e0 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1119,7 +1119,7 @@ static void ti_break(struct tty_struct *tty, int break_state)
static int ti_get_port_from_code(unsigned char code)
{
- return (code >> 4) - 3;
+ return (code >> 6) & 0x01;
}
static int ti_get_func_from_code(unsigned char code)
--
2.18.0
This is a note to let you know that I've just added the patch titled
USB: serial: io_ti: fix array underflow in completion handler
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 691a03cfe8ca483f9c48153b869d354e4ae3abef Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan(a)kernel.org>
Date: Tue, 21 Aug 2018 11:59:52 +0200
Subject: USB: serial: io_ti: fix array underflow in completion handler
As reported by Dan Carpenter, a malicious USB device could set
port_number to a negative value and we would underflow the port array in
the interrupt completion handler.
As these devices only have one or two ports, fix this by making sure we
only consider the seventh bit when determining the port number (and
ignore bits 0xb0 which are typically set to 0x30).
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable(a)vger.kernel.org>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/usb/serial/io_ti.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/io_ti.h b/drivers/usb/serial/io_ti.h
index e53c68261017..9bbcee37524e 100644
--- a/drivers/usb/serial/io_ti.h
+++ b/drivers/usb/serial/io_ti.h
@@ -173,7 +173,7 @@ struct ump_interrupt {
} __attribute__((packed));
-#define TIUMP_GET_PORT_FROM_CODE(c) (((c) >> 4) - 3)
+#define TIUMP_GET_PORT_FROM_CODE(c) (((c) >> 6) & 0x01)
#define TIUMP_GET_FUNC_FROM_CODE(c) ((c) & 0x0f)
#define TIUMP_INTERRUPT_CODE_LSR 0x03
#define TIUMP_INTERRUPT_CODE_MSR 0x04
--
2.18.0
I'm announcing the release of the 4.4.154 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2
arch/arc/include/asm/delay.h | 3
arch/arc/mm/cache.c | 7 -
arch/arm/kvm/mmu.c | 42 +++++--
arch/arm64/mm/init.c | 6 -
arch/mips/bcm47xx/setup.c | 6 -
arch/mips/include/asm/mipsregs.h | 3
arch/mips/include/asm/processor.h | 2
arch/mips/kernel/ptrace.c | 2
arch/mips/kernel/ptrace32.c | 2
arch/mips/lib/multi3.c | 6 -
arch/s390/include/asm/qdio.h | 1
arch/s390/mm/fault.c | 2
arch/s390/net/bpf_jit_comp.c | 2
arch/s390/pci/pci.c | 2
arch/x86/include/asm/irqflags.h | 3
arch/x86/include/asm/processor.h | 4
arch/x86/kernel/cpu/bugs.c | 4
arch/x86/kernel/cpu/intel.c | 3
arch/x86/kernel/process_64.c | 1
arch/x86/mm/init.c | 4
arch/x86/mm/mmap.c | 2
drivers/cdrom/cdrom.c | 2
drivers/gpu/drm/i2c/adv7511.c | 12 ++
drivers/gpu/drm/imx/imx-ldb.c | 9 +
drivers/gpu/drm/udl/udl_fb.c | 2
drivers/gpu/drm/udl/udl_main.c | 35 +++---
drivers/i2c/busses/i2c-davinci.c | 8 +
drivers/net/can/mscan/mpc5xxx_can.c | 5
drivers/net/ethernet/3com/Kconfig | 2
drivers/net/ethernet/amd/Kconfig | 4
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 13 +-
drivers/net/ethernet/cirrus/Kconfig | 1
drivers/net/ethernet/cisco/enic/enic_main.c | 78 ++++----------
drivers/net/ethernet/qlogic/qed/qed_mcp.c | 1
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 1
drivers/net/wan/lmc/lmc_main.c | 2
drivers/pinctrl/freescale/pinctrl-imx1-core.c | 2
drivers/s390/cio/qdio_main.c | 5
drivers/scsi/fcoe/fcoe_ctlr.c | 4
drivers/scsi/libiscsi.c | 12 +-
drivers/scsi/scsi_sysfs.c | 20 +++
drivers/scsi/vmw_pvscsi.c | 11 +
drivers/staging/media/omap4iss/iss_video.c | 3
drivers/target/iscsi/iscsi_target_login.c | 35 +++---
drivers/usb/gadget/function/f_uac2.c | 20 +--
drivers/usb/gadget/udc/r8a66597-udc.c | 6 -
drivers/usb/phy/phy-fsl-usb.c | 4
fs/btrfs/extent-tree.c | 2
fs/cachefiles/namei.c | 1
fs/cachefiles/rdwr.c | 17 ++-
fs/cifs/cifs_debug.c | 30 ++++-
fs/cifs/inode.c | 2
fs/cifs/link.c | 4
fs/cifs/sess.c | 6 +
fs/cifs/smb2inode.c | 2
fs/ext4/namei.c | 1
fs/ext4/sysfs.c | 13 +-
fs/ext4/xattr.c | 2
fs/fscache/operation.c | 6 -
fs/fuse/dev.c | 39 +++++--
fs/fuse/file.c | 1
fs/fuse/fuse_i.h | 1
fs/fuse/inode.c | 23 +---
fs/sysfs/file.c | 44 +++++++
include/linux/sysfs.h | 14 ++
kernel/kprobes.c | 4
kernel/sysctl.c | 3
mm/memory.c | 3
mm/zswap.c | 9 +
net/caif/caif_dev.c | 4
net/ipv4/cipso_ipv4.c | 12 +-
net/ipv6/ip6_vti.c | 11 +
net/mac80211/util.c | 3
net/wireless/nl80211.c | 1
net/xfrm/xfrm_policy.c | 3
net/xfrm/xfrm_user.c | 10 +
sound/soc/sirf/sirf-usp.c | 7 -
sound/soc/soc-pcm.c | 8 +
tools/power/x86/turbostat/turbostat.c | 8 -
tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc | 28 +++++
tools/usb/ffs-test.c | 19 ++-
83 files changed, 513 insertions(+), 235 deletions(-)
Alexander Sverdlin (1):
i2c: davinci: Avoid zero value of CLKH
Andi Kleen (1):
x86/spectre: Add missing family 6 check to microcode check
Andrey Ryabinin (1):
fuse: Don't access pipe->buffers without pipe_lock()
Arnd Bergmann (1):
ext4: sysfs: print ext4_super_block fields as little-endian
Bart Van Assche (2):
scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock
Bernd Edlinger (1):
nl80211: Add a missing break in parse_station_flags
Calvin Walton (1):
tools/power turbostat: Read extended processor family from CPUID
Claudio Imbrenda (1):
s390/kvm: fix deadlock when killed by oom
Colin Ian King (1):
drivers: net: lmc: fix case value for target abort error
Dan Carpenter (1):
pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
Eric Sandeen (1):
ext4: reset error code in ext4_find_entry in fallback
Ethan Zhao (1):
sched/sysctl: Check user input value of sysctl_sched_time_avg
Eugeniu Rosca (1):
usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3'
Eyal Birger (1):
vti6: fix PMTU caching and reporting on xmit
Florian Westphal (2):
xfrm: free skb if nlsk pointer is NULL
atl1c: reserve min skb headroom
Govindarajulu Varadarajan (1):
enic: handle mtu change for vf properly
Greg Hackmann (1):
arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()
Greg Kroah-Hartman (1):
Linux 4.4.154
Guenter Roeck (1):
media: staging: omap4iss: Include asm/cacheflush.h after generic includes
Gustavo A. R. Silva (1):
ASoC: sirf: Fix potential NULL pointer dereference
Jerome Brunet (1):
ASoC: dpcm: don't merge format from invalid codec dai
Jia-Ju Bai (2):
usb: gadget: r8a66597: Fix two possible sleep-in-atomic-context bugs in init_controller()
usb: gadget: r8a66597: Fix a possible sleep-in-atomic-context bugs in r8a66597_queue()
Jim Gill (1):
scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED
Johannes Thumshirn (1):
scsi: fcoe: drop frames in ELS LOGO error path
Josef Bacik (1):
btrfs: don't leak ret from do_chunk_alloc
Julian Wiedmann (1):
s390/qdio: reset old sbal_state flags
Kiran Kumar Modukuri (3):
fscache: Allow cancelled operations to be enqueued
cachefiles: Fix refcounting bug in backing-file read monitoring
cachefiles: Wait rather than BUG'ing on "Unexpected object collision"
Kirill Tkhai (1):
fuse: Add missed unlock_page() to fuse_readpages_fill()
Len Brown (1):
tools/power turbostat: fix -S on UP systems
Li Wang (1):
zswap: re-check zswap_is_full() after do zswap_shrink()
Lucas Stach (2):
drm/imx: imx-ldb: disable LDB on driver bind
drm/imx: imx-ldb: check if channel is enabled before printing warning
Maciej W. Rozycki (1):
MIPS: Correct the 64-bit DSP accumulator register size
Martin Schwidefsky (1):
s390: fix br_r1_trampoline for machines without exrl
Masami Hiramatsu (2):
selftests/ftrace: Add snapshot and tracing_on test case
kprobes: Make list and blacklist root user read only
Mike Christie (1):
iscsi target: fix session creation failure handling
Miklos Szeredi (4):
fuse: fix double request_end()
fuse: fix unlocked access to processing queue
fuse: umount should wait for all requests
fuse: Fix oops at process_init_reply()
Mikulas Patocka (3):
udl-kms: change down_interruptible to down
udl-kms: handle allocation failure
udl-kms: fix crash due to uninitialized memory
Nicholas Mc Guire (2):
can: mpc5xxx_can: check of_iomap return before use
cifs: check kmalloc before use
Nick Desaulniers (1):
x86/irqflags: Mark native_restore_fl extern inline
Paul Burton (1):
MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7
Peter Senna Tschudin (1):
tools: usb: ffs-test: Fix build on big endian systems
Punit Agrawal (2):
KVM: arm/arm64: Skip updating PTE entry if no change
KVM: arm/arm64: Skip updating PMD entry if no change
Rafał Miłecki (1):
Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum"
Randy Dunlap (4):
usb/phy: fix PPC64 build errors in phy-fsl-usb.c
net: prevent ISA drivers from building on PPC32
arc: fix build errors in arc/include/asm/delay.h
arc: fix type warnings in arc/mm/cache.c
Rian Hunter (1):
x86/process: Re-export start_thread()
Scott Bauer (1):
cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
Sean Paul (1):
drm/bridge: adv7511: Reset registers on hotplug
Sebastian Ott (1):
s390/pci: fix out of bounds access during irq setup
Shubhrajyoti Datta (1):
net: axienet: Fix double deregister of mdio
Steve French (3):
cifs: add missing debug entries for kconfig options
smb3: Do not send SMB3 SET_INFO if nothing changed
smb3: don't request leases in symlink creation and query
Sudarsana Reddy Kalluru (2):
qed: Fix possible race for the link state value.
bnx2x: Fix invalid memory access in rss hash config path.
Theodore Ts'o (1):
ext4: check for NUL characters in extended attribute's name
Tommi Rantala (1):
xfrm: fix missing dst_release() after policy blocking lbcast and multicast
Varun Prakash (1):
scsi: libiscsi: fix possible NULL pointer dereference in case of TMF
Vlastimil Babka (3):
x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit
x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM
x86/speculation/l1tf: Suggest what to do on systems with too much RAM
YueHaibing (1):
net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
jie@chenjie6@huwei.com (1):
mm/memory.c: check return value of ioremap_prot
mpubbise(a)codeaurora.org (1):
mac80211: add stations tied to AP_VLANs during hw reconfig
yujuan.qi (1):
Cipso: cipso_v4_optptr enter infinite loop
This is a note to let you know that I've just added the patch titled
usb: cdc-wdm: Fix a sleep-in-atomic-context bug in
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 6e22e3af7bb3a7b9dc53cb4687659f6e63fca427 Mon Sep 17 00:00:00 2001
From: Jia-Ju Bai <baijiaju1990(a)gmail.com>
Date: Sat, 1 Sep 2018 16:12:10 +0800
Subject: usb: cdc-wdm: Fix a sleep-in-atomic-context bug in
service_outstanding_interrupt()
wdm_in_callback() is a completion handler function for the USB driver.
So it should not sleep. But it calls service_outstanding_interrupt(),
which calls usb_submit_urb() with GFP_KERNEL.
To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool DSAC.
Signed-off-by: Jia-Ju Bai <baijiaju1990(a)gmail.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/class/cdc-wdm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index bec581fb7c63..656d247819c9 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -460,7 +460,7 @@ static int service_outstanding_interrupt(struct wdm_device *desc)
set_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irq(&desc->iuspin);
- rv = usb_submit_urb(desc->response, GFP_KERNEL);
+ rv = usb_submit_urb(desc->response, GFP_ATOMIC);
spin_lock_irq(&desc->iuspin);
if (rv) {
dev_err(&desc->intf->dev,
--
2.18.0
This is a note to let you know that I've just added the patch titled
usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 6d4f268fa132742fe96dad22307c68d237356d88 Mon Sep 17 00:00:00 2001
From: Jia-Ju Bai <baijiaju1990(a)gmail.com>
Date: Sat, 1 Sep 2018 17:23:47 +0800
Subject: usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in
u132_get_frame()
i_usX2Y_subs_startup in usbusx2yaudio.c is a completion handler function
for the USB driver. So it should not sleep, but it is can sleep
according to the function call paths (from bottom to top) in Linux-4.16.
[FUNC] msleep
drivers/usb/host/u132-hcd.c, 2558:
msleep in u132_get_frame
drivers/usb/core/hcd.c, 2231:
[FUNC_PTR]u132_get_frame in usb_hcd_get_frame_number
drivers/usb/core/usb.c, 822:
usb_hcd_get_frame_number in usb_get_current_frame_number
sound/usb/usx2y/usbusx2yaudio.c, 303:
usb_get_current_frame_number in i_usX2Y_urb_complete
sound/usb/usx2y/usbusx2yaudio.c, 366:
i_usX2Y_urb_complete in i_usX2Y_subs_startup
Note that [FUNC_PTR] means a function pointer call is used.
To fix this bug, msleep() is replaced with mdelay().
This bug is found by my static analysis tool DSAC.
Signed-off-by: Jia-Ju Bai <baijiaju1990(a)gmail.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/host/u132-hcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 072bd5d5738e..5b8a3d9530c4 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -2555,7 +2555,7 @@ static int u132_get_frame(struct usb_hcd *hcd)
} else {
int frame = 0;
dev_err(&u132->platform_dev->dev, "TODO: u132_get_frame\n");
- msleep(100);
+ mdelay(100);
return frame;
}
}
--
2.18.0
This is a note to let you know that I've just added the patch titled
usb: misc: uss720: Fix two sleep-in-atomic-context bugs
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From bc8acc214d3f1cafebcbcd101a695bbac716595d Mon Sep 17 00:00:00 2001
From: Jia-Ju Bai <baijiaju1990(a)gmail.com>
Date: Sat, 1 Sep 2018 16:25:08 +0800
Subject: usb: misc: uss720: Fix two sleep-in-atomic-context bugs
async_complete() in uss720.c is a completion handler function for the
USB driver. So it should not sleep, but it is can sleep according to the
function call paths (from bottom to top) in Linux-4.16.
[FUNC] set_1284_register(GFP_KERNEL)
drivers/usb/misc/uss720.c, 372:
set_1284_register in parport_uss720_frob_control
drivers/parport/ieee1284.c, 560:
[FUNC_PTR]parport_uss720_frob_control in parport_ieee1284_ack_data_avail
drivers/parport/ieee1284.c, 577:
parport_ieee1284_ack_data_avail in parport_ieee1284_interrupt
./include/linux/parport.h, 474:
parport_ieee1284_interrupt in parport_generic_irq
drivers/usb/misc/uss720.c, 116:
parport_generic_irq in async_complete
[FUNC] get_1284_register(GFP_KERNEL)
drivers/usb/misc/uss720.c, 382:
get_1284_register in parport_uss720_read_status
drivers/parport/ieee1284.c, 555:
[FUNC_PTR]parport_uss720_read_status in parport_ieee1284_ack_data_avail
drivers/parport/ieee1284.c, 577:
parport_ieee1284_ack_data_avail in parport_ieee1284_interrupt
./include/linux/parport.h, 474:
parport_ieee1284_interrupt in parport_generic_irq
drivers/usb/misc/uss720.c, 116:
parport_generic_irq in async_complete
Note that [FUNC_PTR] means a function pointer call is used.
To fix these bugs, GFP_KERNEL is replaced with GFP_ATOMIC.
These bugs are found by my static analysis tool DSAC.
Signed-off-by: Jia-Ju Bai <baijiaju1990(a)gmail.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/misc/uss720.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c
index 82f220631bd7..b5d661644263 100644
--- a/drivers/usb/misc/uss720.c
+++ b/drivers/usb/misc/uss720.c
@@ -369,7 +369,7 @@ static unsigned char parport_uss720_frob_control(struct parport *pp, unsigned ch
mask &= 0x0f;
val &= 0x0f;
d = (priv->reg[1] & (~mask)) ^ val;
- if (set_1284_register(pp, 2, d, GFP_KERNEL))
+ if (set_1284_register(pp, 2, d, GFP_ATOMIC))
return 0;
priv->reg[1] = d;
return d & 0xf;
@@ -379,7 +379,7 @@ static unsigned char parport_uss720_read_status(struct parport *pp)
{
unsigned char ret;
- if (get_1284_register(pp, 1, &ret, GFP_KERNEL))
+ if (get_1284_register(pp, 1, &ret, GFP_ATOMIC))
return 0;
return ret & 0xf8;
}
--
2.18.0
This is a note to let you know that I've just added the patch titled
usb: Avoid use-after-free by flushing endpoints early in
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From f9a5b4f58b280c1d26255376713c132f93837621 Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Date: Mon, 3 Sep 2018 15:44:16 +0300
Subject: usb: Avoid use-after-free by flushing endpoints early in
usb_set_interface()
The steps taken by usb core to set a new interface is very different from
what is done on the xHC host side.
xHC hardware will do everything in one go. One command is used to set up
new endpoints, free old endpoints, check bandwidth, and run the new
endpoints.
All this is done by xHC when usb core asks the hcd to check for
available bandwidth. At this point usb core has not yet flushed the old
endpoints, which will cause use-after-free issues in xhci driver as
queued URBs are cancelled on a re-allocated endpoint.
To resolve this add a call to usb_disable_interface() which will flush
the endpoints before calling usb_hcd_alloc_bandwidth()
Additional checks in xhci driver will also be implemented to gracefully
handle stale URB cancel on freed and re-allocated endpoints
Cc: <stable(a)vger.kernel.org>
Reported-by: Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Acked-by: Alan Stern <stern(a)rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/core/message.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 228672f2c4a1..bfa5eda0cc26 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1341,6 +1341,11 @@ void usb_enable_interface(struct usb_device *dev,
* is submitted that needs that bandwidth. Some other operating systems
* allocate bandwidth early, when a configuration is chosen.
*
+ * xHCI reserves bandwidth and configures the alternate setting in
+ * usb_hcd_alloc_bandwidth(). If it fails the original interface altsetting
+ * may be disabled. Drivers cannot rely on any particular alternate
+ * setting being in effect after a failure.
+ *
* This call is synchronous, and may not be used in an interrupt context.
* Also, drivers must not change altsettings while urbs are scheduled for
* endpoints in that interface; all such urbs must first be completed
@@ -1376,6 +1381,12 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
alternate);
return -EINVAL;
}
+ /*
+ * usb3 hosts configure the interface in usb_hcd_alloc_bandwidth,
+ * including freeing dropped endpoint ring buffers.
+ * Make sure the interface endpoints are flushed before that
+ */
+ usb_disable_interface(dev, iface, false);
/* Make sure we have enough bandwidth for this alternate interface.
* Remove the current alt setting and add the new alt setting.
--
2.18.0
This is a note to let you know that I've just added the patch titled
usb: Don't die twice if PCI xhci host is not responding in resume
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From f3dc41c5d22b2ca14a0802a65d8cdc33a3882d4e Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Date: Tue, 4 Sep 2018 17:35:16 +0300
Subject: usb: Don't die twice if PCI xhci host is not responding in resume
usb_hc_died() should only be called once, and with the primary HCD
as parameter. It will mark both primary and secondary hcd's dead.
Remove the extra call to usb_cd_died with the shared hcd as parameter.
Fixes: ff9d78b36f76 ("USB: Set usb_hcd->state and flags for shared roothubs")
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Cc: stable <stable(a)vger.kernel.org>
Acked-by: Alan Stern <stern(a)rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/core/hcd-pci.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 66fe1b78d952..03432467b05f 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -515,8 +515,6 @@ static int resume_common(struct device *dev, int event)
event == PM_EVENT_RESTORE);
if (retval) {
dev_err(dev, "PCI post-resume error %d!\n", retval);
- if (hcd->shared_hcd)
- usb_hc_died(hcd->shared_hcd);
usb_hc_died(hcd);
}
}
--
2.18.0
The patch
spi: sh-msiof: Fix invalid SPI use during system suspend
has been applied to the spi tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From ffa69d6a16f686efe45269342474e421f2aa58b2 Mon Sep 17 00:00:00 2001
From: Gaku Inami <gaku.inami.xw(a)bp.renesas.com>
Date: Wed, 5 Sep 2018 10:49:36 +0200
Subject: [PATCH] spi: sh-msiof: Fix invalid SPI use during system suspend
If the SPI queue is running during system suspend, the system may lock
up.
Fix this by stopping/restarting the queue during system suspend/resume
by calling spi_master_suspend()/spi_master_resume() from the PM
callbacks. In-kernel users will receive an -ESHUTDOWN error while
system suspend/resume is in progress.
Signed-off-by: Gaku Inami <gaku.inami.xw(a)bp.renesas.com>
Signed-off-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym(a)renesas.com>
[geert: Cleanup, reword]
Signed-off-by: Geert Uytterhoeven <geert+renesas(a)glider.be>
Signed-off-by: Mark Brown <broonie(a)kernel.org>
Cc: stable(a)vger.kernel.org
---
drivers/spi/spi-sh-msiof.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 539d6d1a277a..bfe4e6d4f7bf 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -1426,12 +1426,37 @@ static const struct platform_device_id spi_driver_ids[] = {
};
MODULE_DEVICE_TABLE(platform, spi_driver_ids);
+#ifdef CONFIG_PM_SLEEP
+static int sh_msiof_spi_suspend(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev);
+
+ return spi_master_suspend(p->master);
+}
+
+static int sh_msiof_spi_resume(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev);
+
+ return spi_master_resume(p->master);
+}
+
+static SIMPLE_DEV_PM_OPS(sh_msiof_spi_pm_ops, sh_msiof_spi_suspend,
+ sh_msiof_spi_resume);
+#define DEV_PM_OPS &sh_msiof_spi_pm_ops
+#else
+#define DEV_PM_OPS NULL
+#endif /* CONFIG_PM_SLEEP */
+
static struct platform_driver sh_msiof_spi_drv = {
.probe = sh_msiof_spi_probe,
.remove = sh_msiof_spi_remove,
.id_table = spi_driver_ids,
.driver = {
.name = "spi_sh_msiof",
+ .pm = DEV_PM_OPS,
.of_match_table = of_match_ptr(sh_msiof_match),
},
};
--
2.19.0.rc1
The patch
spi: sh-msiof: Fix handling of write value for SISTR register
has been applied to the spi tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 31a5fae4c5a009898da6d177901d5328051641ff Mon Sep 17 00:00:00 2001
From: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym(a)renesas.com>
Date: Wed, 5 Sep 2018 10:49:37 +0200
Subject: [PATCH] spi: sh-msiof: Fix handling of write value for SISTR register
This patch changes writing to the SISTR register according to the H/W
user's manual.
The TDREQ bit and RDREQ bits of SISTR are read-only, and must be written
their initial values of zero.
Signed-off-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym(a)renesas.com>
[geert: reword]
Signed-off-by: Geert Uytterhoeven <geert+renesas(a)glider.be>
Signed-off-by: Mark Brown <broonie(a)kernel.org>
Cc: stable(a)vger.kernel.org
---
drivers/spi/spi-sh-msiof.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index bfe4e6d4f7bf..101cd6aae2ea 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -397,7 +397,8 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p,
static void sh_msiof_reset_str(struct sh_msiof_spi_priv *p)
{
- sh_msiof_write(p, STR, sh_msiof_read(p, STR));
+ sh_msiof_write(p, STR,
+ sh_msiof_read(p, STR) & ~(STR_TDREQ | STR_RDREQ));
}
static void sh_msiof_spi_write_fifo_8(struct sh_msiof_spi_priv *p,
--
2.19.0.rc1
The patch
spi: rspi: Fix invalid SPI use during system suspend
has been applied to the spi tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From c1ca59c22c56930b377a665fdd1b43351887830b Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven <geert+renesas(a)glider.be>
Date: Wed, 5 Sep 2018 10:49:38 +0200
Subject: [PATCH] spi: rspi: Fix invalid SPI use during system suspend
If the SPI queue is running during system suspend, the system may lock
up.
Fix this by stopping/restarting the queue during system suspend/resume,
by calling spi_master_suspend()/spi_master_resume() from the PM
callbacks. In-kernel users will receive an -ESHUTDOWN error while
system suspend/resume is in progress.
Based on a patch for sh-msiof by Gaku Inami.
Signed-off-by: Geert Uytterhoeven <geert+renesas(a)glider.be>
Signed-off-by: Mark Brown <broonie(a)kernel.org>
Cc: stable(a)vger.kernel.org
---
drivers/spi/spi-rspi.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 95dc4d78618d..f93a4587e3fb 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -1350,12 +1350,36 @@ static const struct platform_device_id spi_driver_ids[] = {
MODULE_DEVICE_TABLE(platform, spi_driver_ids);
+#ifdef CONFIG_PM_SLEEP
+static int rspi_suspend(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct rspi_data *rspi = platform_get_drvdata(pdev);
+
+ return spi_master_suspend(rspi->master);
+}
+
+static int rspi_resume(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct rspi_data *rspi = platform_get_drvdata(pdev);
+
+ return spi_master_resume(rspi->master);
+}
+
+static SIMPLE_DEV_PM_OPS(rspi_pm_ops, rspi_suspend, rspi_resume);
+#define DEV_PM_OPS &rspi_pm_ops
+#else
+#define DEV_PM_OPS NULL
+#endif /* CONFIG_PM_SLEEP */
+
static struct platform_driver rspi_driver = {
.probe = rspi_probe,
.remove = rspi_remove,
.id_table = spi_driver_ids,
.driver = {
.name = "renesas_spi",
+ .pm = DEV_PM_OPS,
.of_match_table = of_match_ptr(rspi_of_match),
},
};
--
2.19.0.rc1
The patch
spi: rspi: Fix interrupted DMA transfers
has been applied to the spi tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 8dbbaa47b96f6ea5f09f922b4effff3c505cd8cf Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven <geert+renesas(a)glider.be>
Date: Wed, 5 Sep 2018 10:49:39 +0200
Subject: [PATCH] spi: rspi: Fix interrupted DMA transfers
When interrupted, wait_event_interruptible_timeout() returns
-ERESTARTSYS, and the SPI transfer in progress will fail, as expected:
m25p80 spi0.0: SPI transfer failed: -512
spi_master spi0: failed to transfer one message from queue
However, as the underlying DMA transfers may not have completed, all
subsequent SPI transfers may start to fail:
spi_master spi0: receive timeout
qspi_transfer_out_in() returned -110
m25p80 spi0.0: SPI transfer failed: -110
spi_master spi0: failed to transfer one message from queue
Fix this by calling dmaengine_terminate_all() not only for timeouts, but
also for errors.
This can be reproduced on r8a7991/koelsch, using "hd /dev/mtd0" followed
by CTRL-C.
Signed-off-by: Geert Uytterhoeven <geert+renesas(a)glider.be>
Signed-off-by: Mark Brown <broonie(a)kernel.org>
Cc: stable(a)vger.kernel.org
---
drivers/spi/spi-rspi.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index f93a4587e3fb..b37de1d991d6 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -598,11 +598,13 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx,
ret = wait_event_interruptible_timeout(rspi->wait,
rspi->dma_callbacked, HZ);
- if (ret > 0 && rspi->dma_callbacked)
+ if (ret > 0 && rspi->dma_callbacked) {
ret = 0;
- else if (!ret) {
- dev_err(&rspi->master->dev, "DMA timeout\n");
- ret = -ETIMEDOUT;
+ } else {
+ if (!ret) {
+ dev_err(&rspi->master->dev, "DMA timeout\n");
+ ret = -ETIMEDOUT;
+ }
if (tx)
dmaengine_terminate_all(rspi->master->dma_tx);
if (rx)
--
2.19.0.rc1
commit 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs")
broke mounting of cgroup2 under older SELinux policies which lacked
a genfscon rule for cgroup2. This prevents mounting of cgroup2 even
when SELinux is permissive.
Change the handling when there is no genfscon rule in policy to
just mark the inode unlabeled and not return an error to the caller.
This permits mounting and access if allowed by policy, e.g. to
unconfined domains.
I also considered changing the behavior of security_genfs_sid() to
never return -ENOENT, but the current behavior is relied upon by
other callers to perform caller-specific handling.
Fixes: 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs")
CC: <stable(a)vger.kernel.org>
Reported-by: Dmitry Vyukov <dvyukov(a)google.com>
Reported-by: Waiman Long <longman(a)redhat.com>
Signed-off-by: Stephen Smalley <sds(a)tycho.nsa.gov>
---
security/selinux/hooks.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f78318af8254..58fee382a3bb 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1508,6 +1508,11 @@ static int selinux_genfs_get_sid(struct dentry *dentry,
}
rc = security_genfs_sid(&selinux_state, sb->s_type->name,
path, tclass, sid);
+ if (rc == -ENOENT) {
+ /* No match in policy, mark as unlabeled. */
+ *sid = SECINITSID_UNLABELED;
+ rc = 0;
+ }
}
free_page((unsigned long)buffer);
return rc;
--
2.14.4
This is a note to let you know that I've just added the patch titled
USB: Add quirk to support DJI CineSSD
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From f45681f9becaa65111ed0a691ccf080a0cd5feb8 Mon Sep 17 00:00:00 2001
From: Tim Anderson <tsa(a)biglakesoftware.com>
Date: Thu, 9 Aug 2018 14:55:34 -0700
Subject: USB: Add quirk to support DJI CineSSD
This device does not correctly handle the LPM operations.
Also, the device cannot handle ATA pass-through commands
and locks up when attempted while running in super speed.
This patch adds the equivalent quirk logic as found in uas.
Signed-off-by: Tim Anderson <tsa(a)biglakesoftware.com>
Acked-by: Alan Stern <stern(a)rowland.harvard.edu>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/core/quirks.c | 3 +++
drivers/usb/storage/scsiglue.c | 9 +++++++++
drivers/usb/storage/unusual_devs.h | 7 +++++++
3 files changed, 19 insertions(+)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 689a6c65bc5c..e77dfe5ed5ec 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -410,6 +410,9 @@ static const struct usb_device_id usb_quirk_list[] = {
{ USB_DEVICE(0x2040, 0x7200), .driver_info =
USB_QUIRK_CONFIG_INTF_STRINGS },
+ /* DJI CineSSD */
+ { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
+
/* INTEL VALUE SSD */
{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index c267f2812a04..e227bb5b794f 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -376,6 +376,15 @@ static int queuecommand_lck(struct scsi_cmnd *srb,
return 0;
}
+ if ((us->fflags & US_FL_NO_ATA_1X) &&
+ (srb->cmnd[0] == ATA_12 || srb->cmnd[0] == ATA_16)) {
+ memcpy(srb->sense_buffer, usb_stor_sense_invalidCDB,
+ sizeof(usb_stor_sense_invalidCDB));
+ srb->result = SAM_STAT_CHECK_CONDITION;
+ done(srb);
+ return 0;
+ }
+
/* enqueue the command and wake up the control thread */
srb->scsi_done = done;
us->srb = srb;
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 22fcfccf453a..f7f83b21dc74 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -2288,6 +2288,13 @@ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999,
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_GO_SLOW ),
+/* Reported-by: Tim Anderson <tsa(a)biglakesoftware.com> */
+UNUSUAL_DEV( 0x2ca3, 0x0031, 0x0000, 0x9999,
+ "DJI",
+ "CineSSD",
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+ US_FL_NO_ATA_1X),
+
/*
* Reported by Frederic Marchal <frederic.marchal(a)wowcompany.com>
* Mio Moov 330
--
2.18.0
This is a note to let you know that I've just added the patch titled
usb: uas: add support for more quirk flags
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 42d1c6d4a06a77b3ab206a919b9050c3080f3a71 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum(a)suse.com>
Date: Thu, 9 Aug 2018 16:03:37 +0200
Subject: usb: uas: add support for more quirk flags
The hope that UAS devices would be less broken than old style storage
devices has turned out to be unfounded. Make UAS support more of the
quirk flags of the old driver.
Signed-off-by: Oliver Neukum <oneukum(a)suse.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/storage/uas.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 9e9de5452860..1f7b401c4d04 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -842,6 +842,27 @@ static int uas_slave_configure(struct scsi_device *sdev)
sdev->skip_ms_page_8 = 1;
sdev->wce_default_on = 1;
}
+
+ /*
+ * Some disks return the total number of blocks in response
+ * to READ CAPACITY rather than the highest block number.
+ * If this device makes that mistake, tell the sd driver.
+ */
+ if (devinfo->flags & US_FL_FIX_CAPACITY)
+ sdev->fix_capacity = 1;
+
+ /*
+ * Some devices don't like MODE SENSE with page=0x3f,
+ * which is the command used for checking if a device
+ * is write-protected. Now that we tell the sd driver
+ * to do a 192-byte transfer with this command the
+ * majority of devices work fine, but a few still can't
+ * handle it. The sd driver will simply assume those
+ * devices are write-enabled.
+ */
+ if (devinfo->flags & US_FL_NO_WP_DETECT)
+ sdev->skip_ms_page_3f = 1;
+
scsi_change_queue_depth(sdev, devinfo->qdepth - 2);
return 0;
}
--
2.18.0
This is a note to let you know that I've just added the patch titled
usb: mtu3: fix error of xhci port id when enable U3 dual role
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 78af87b8bbbbcaa613f1a7d8f14472fe9a7dc622 Mon Sep 17 00:00:00 2001
From: Chunfeng Yun <chunfeng.yun(a)mediatek.com>
Date: Wed, 29 Aug 2018 10:36:49 +0800
Subject: usb: mtu3: fix error of xhci port id when enable U3 dual role
If dual role mode is enabled, when switch u3port0 to device mode,
it will affect port id calculation of host(xHCI), specially when
host supports multi U2 ports or U3 ports, so need enable its dual
role mode, and fix it here.
Signed-off-by: Chunfeng Yun <chunfeng.yun(a)mediatek.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/mtu3/mtu3_core.c | 6 +++++-
drivers/usb/mtu3/mtu3_hw_regs.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
index eecfd0671362..d045d8458f81 100644
--- a/drivers/usb/mtu3/mtu3_core.c
+++ b/drivers/usb/mtu3/mtu3_core.c
@@ -107,8 +107,12 @@ static int mtu3_device_enable(struct mtu3 *mtu)
(SSUSB_U2_PORT_DIS | SSUSB_U2_PORT_PDN |
SSUSB_U2_PORT_HOST_SEL));
- if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG)
+ if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) {
mtu3_setbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_OTG_SEL);
+ if (mtu->is_u3_ip)
+ mtu3_setbits(ibase, SSUSB_U3_CTRL(0),
+ SSUSB_U3_PORT_DUAL_MODE);
+ }
return ssusb_check_clocks(mtu->ssusb, check_clk);
}
diff --git a/drivers/usb/mtu3/mtu3_hw_regs.h b/drivers/usb/mtu3/mtu3_hw_regs.h
index 6ee371478d89..a45bb253939f 100644
--- a/drivers/usb/mtu3/mtu3_hw_regs.h
+++ b/drivers/usb/mtu3/mtu3_hw_regs.h
@@ -459,6 +459,7 @@
/* U3D_SSUSB_U3_CTRL_0P */
#define SSUSB_U3_PORT_SSP_SPEED BIT(9)
+#define SSUSB_U3_PORT_DUAL_MODE BIT(7)
#define SSUSB_U3_PORT_HOST_SEL BIT(2)
#define SSUSB_U3_PORT_PDN BIT(1)
#define SSUSB_U3_PORT_DIS BIT(0)
--
2.18.0
This is a note to let you know that I've just added the patch titled
xhci: Fix use after free for URB cancellation on a reallocated
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 4937213ba7fafa13f30496b3965ffe93970d8b53 Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Date: Fri, 31 Aug 2018 17:24:43 +0300
Subject: xhci: Fix use after free for URB cancellation on a reallocated
endpoint
Make sure the cancelled URB is on the current endpoint ring.
If the endpoint ring has been reallocated since the URB was enqueued
then the URB may contain TD and TRB pointers to a already freed ring.
In this the case return the URB without touching any of the freed ring
structure data.
Don't try to stop the ring. It would be useless.
This can occur if endpoint is not flushed before it is dropped and
re-added, which is the case in usb_set_interface() as xhci does
things in an odd order.
Cc: <stable(a)vger.kernel.org>
Tested-by: Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/host/xhci.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 61f48b17e57b..0420eefa647a 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -37,6 +37,21 @@ static unsigned long long quirks;
module_param(quirks, ullong, S_IRUGO);
MODULE_PARM_DESC(quirks, "Bit flags for quirks to be enabled as default");
+static bool td_on_ring(struct xhci_td *td, struct xhci_ring *ring)
+{
+ struct xhci_segment *seg = ring->first_seg;
+
+ if (!td || !td->start_seg)
+ return false;
+ do {
+ if (seg == td->start_seg)
+ return true;
+ seg = seg->next;
+ } while (seg && seg != ring->first_seg);
+
+ return false;
+}
+
/* TODO: copied from ehci-hcd.c - can this be refactored? */
/*
* xhci_handshake - spin reading hc until handshake completes or fails
@@ -1571,6 +1586,21 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
goto done;
}
+ /*
+ * check ring is not re-allocated since URB was enqueued. If it is, then
+ * make sure none of the ring related pointers in this URB private data
+ * are touched, such as td_list, otherwise we overwrite freed data
+ */
+ if (!td_on_ring(&urb_priv->td[0], ep_ring)) {
+ xhci_err(xhci, "Canceled URB td not found on endpoint ring");
+ for (i = urb_priv->num_tds_done; i < urb_priv->num_tds; i++) {
+ td = &urb_priv->td[i];
+ if (!list_empty(&td->cancelled_td_list))
+ list_del_init(&td->cancelled_td_list);
+ }
+ goto err_giveback;
+ }
+
if (xhci->xhc_state & XHCI_STATE_HALTED) {
xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
"HC halted, freeing TD manually.");
--
2.18.0
This is a note to let you know that I've just added the patch titled
USB: add quirk for WORLDE Controller KS49 or Prodipe MIDI 49C USB
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 9b83a1c301ad6d24988a128c69b42cbaaf537d82 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Maxence=20Dupr=C3=A8s?= <xpros64(a)hotmail.fr>
Date: Wed, 8 Aug 2018 23:56:33 +0000
Subject: USB: add quirk for WORLDE Controller KS49 or Prodipe MIDI 49C USB
controller
WORLDE Controller KS49 or Prodipe MIDI 49C USB controller
cause a -EPROTO error, a communication restart and loop again.
This issue has already been fixed for KS25.
https://lore.kernel.org/patchwork/patch/753077/
I just add device 201 for KS49 in quirks.c to get it works.
Signed-off-by: Laurent Roux <xpros64(a)hotmail.fr>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/core/quirks.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 097057d2eacf..689a6c65bc5c 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -178,6 +178,10 @@ static const struct usb_device_id usb_quirk_list[] = {
/* CBM - Flash disk */
{ USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
+ /* WORLDE Controller KS49 or Prodipe MIDI 49C USB controller */
+ { USB_DEVICE(0x0218, 0x0201), .driver_info =
+ USB_QUIRK_CONFIG_INTF_STRINGS },
+
/* WORLDE easy key (easykey.25) MIDI controller */
{ USB_DEVICE(0x0218, 0x0401), .driver_info =
USB_QUIRK_CONFIG_INTF_STRINGS },
--
2.18.0
During IPS disabling the current 42ms timeout value leads to occasional
timeouts, increase it to 100ms which seems to get rid of the problem.
References: https://bugs.freedesktop.org/show_bug.cgi?id=107494
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107562
Reported-by: Diego Viola <diego.viola(a)gmail.com>
Tested-by: Diego Viola <diego.viola(a)gmail.com>
Cc: Diego Viola <diego.viola(a)gmail.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Imre Deak <imre.deak(a)intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a85a83f31979..1bd14c61dab5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5082,10 +5082,14 @@ void hsw_disable_ips(const struct intel_crtc_state *crtc_state)
mutex_lock(&dev_priv->pcu_lock);
WARN_ON(sandybridge_pcode_write(dev_priv, DISPLAY_IPS_CONTROL, 0));
mutex_unlock(&dev_priv->pcu_lock);
- /* wait for pcode to finish disabling IPS, which may take up to 42ms */
+ /*
+ * Wait for PCODE to finish disabling IPS. The BSpec specified
+ * 42ms timeout value leads to occasional timeouts so use 100ms
+ * instead.
+ */
if (intel_wait_for_register(dev_priv,
IPS_CTL, IPS_ENABLE, 0,
- 42))
+ 100))
DRM_ERROR("Timed out waiting for IPS disable\n");
} else {
I915_WRITE(IPS_CTL, 0);
--
2.13.2
On Wed, Sep 05, 2018 at 05:23:28AM -0400, Chas Williams wrote:
> On Wed, Sep 5, 2018 at 5:18 AM Nathan Chancellor <natechancellor(a)gmail.com>
> wrote:
>
> > On Wed, Sep 05, 2018 at 11:05:15AM +0200, Greg KH wrote:
> > > On Wed, Sep 05, 2018 at 04:58:52AM -0400, Chas Williams wrote:
> > > > From: Chas Williams <chas3(a)att.com>
> > > >
> > > > Commit 3c226c637b69 ("mm: numa: avoid waiting on freed migrated pages")
> > > > was an incomplete backport of the upstream commit. It is necessary to
> > > > always reset page_nid before attempting any early exit.
> > > > ---
> > > > mm/huge_memory.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > >
> > > <formletter>
> > >
> > > This is not the correct way to submit patches for inclusion in the
> > > stable kernel tree. Please read:
> > >
> > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> > > for how to do this properly.
> > >
> > > </formletter>
> >
> > This is an issue with the 4.9 tree, not mainline. The hash is
> > incorrect but the problem appears valid.
> >
>
> Unfortunately, this issue doesn't fit into option 1, 2 or 3. I could
> only do option 4.
Ok, but if so, you need to at least sign-off on your patch, right? :)
Also, call it out explicitly what you are trying to do here, and why the
patch is not upstream, so I know what is going on.
thanks,
greg k-h
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.
Cc: <stable(a)vger.kernel.org> # 2.6.36+
Signed-off-by: Huacai Chen <chenhc(a)lemote.com>
---
arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
index 37fe58c..542c3ed 100644
--- a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
+++ b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
@@ -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);
--
2.7.0
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From d814a49198eafa6163698bdd93961302f3a877a4 Mon Sep 17 00:00:00 2001
From: Ethan Lien <ethanlien(a)synology.com>
Date: Mon, 2 Jul 2018 15:44:58 +0800
Subject: [PATCH] btrfs: use correct compare function of dirty_metadata_bytes
We use customized, nodesize batch value to update dirty_metadata_bytes.
We should also use batch version of compare function or we will easily
goto fast path and get false result from percpu_counter_compare().
Fixes: e2d845211eda ("Btrfs: use percpu counter for dirty metadata count")
CC: stable(a)vger.kernel.org # 4.4+
Signed-off-by: Ethan Lien <ethanlien(a)synology.com>
Reviewed-by: Nikolay Borisov <nborisov(a)suse.com>
Signed-off-by: David Sterba <dsterba(a)suse.com>
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 6023eed3e805..e3858b2fe014 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -959,8 +959,9 @@ static int btree_writepages(struct address_space *mapping,
fs_info = BTRFS_I(mapping->host)->root->fs_info;
/* this is a bit racy, but that's ok */
- ret = percpu_counter_compare(&fs_info->dirty_metadata_bytes,
- BTRFS_DIRTY_METADATA_THRESH);
+ ret = __percpu_counter_compare(&fs_info->dirty_metadata_bytes,
+ BTRFS_DIRTY_METADATA_THRESH,
+ fs_info->dirty_metadata_batch);
if (ret < 0)
return 0;
}
@@ -4134,8 +4135,9 @@ static void __btrfs_btree_balance_dirty(struct btrfs_fs_info *fs_info,
if (flush_delayed)
btrfs_balance_delayed_items(fs_info);
- ret = percpu_counter_compare(&fs_info->dirty_metadata_bytes,
- BTRFS_DIRTY_METADATA_THRESH);
+ ret = __percpu_counter_compare(&fs_info->dirty_metadata_bytes,
+ BTRFS_DIRTY_METADATA_THRESH,
+ fs_info->dirty_metadata_batch);
if (ret > 0) {
balance_dirty_pages_ratelimited(fs_info->btree_inode->i_mapping);
}
The page migration code employs try_to_unmap() to try and unmap the
source page. This is accomplished by using rmap_walk to find all
vmas where the page is mapped. This search stops when page mapcount
is zero. For shared PMD huge pages, the page map count is always 1
no matter the number of mappings. Shared mappings are tracked via
the reference count of the PMD page. Therefore, try_to_unmap stops
prematurely and does not completely unmap all mappings of the source
page.
This problem can result is data corruption as writes to the original
source page can happen after contents of the page are copied to the
target page. Hence, data is lost.
This problem was originally seen as DB corruption of shared global
areas after a huge page was soft offlined due to ECC memory errors.
DB developers noticed they could reproduce the issue by (hotplug)
offlining memory used to back huge pages. A simple testcase can
reproduce the problem by creating a shared PMD mapping (note that
this must be at least PUD_SIZE in size and PUD_SIZE aligned (1GB on
x86)), and using migrate_pages() to migrate process pages between
nodes while continually writing to the huge pages being migrated.
To fix, have the try_to_unmap_one routine check for huge PMD sharing
by calling huge_pmd_unshare for hugetlbfs huge pages. If it is a
shared mapping it will be 'unshared' which removes the page table
entry and drops the reference on the PMD page. After this, flush
caches and TLB.
mmu notifiers are called before locking page tables, but we can not
be sure of PMD sharing until page tables are locked. Therefore,
check for the possibility of PMD sharing before locking so that
notifiers can prepare for the worst possible case.
Fixes: 39dde65c9940 ("shared page table for hugetlb page")
Cc: stable(a)vger.kernel.org
Signed-off-by: Mike Kravetz <mike.kravetz(a)oracle.com>
---
include/linux/hugetlb.h | 14 ++++++++++++++
mm/hugetlb.c | 40 +++++++++++++++++++++++++++++++++++++--
mm/rmap.c | 42 ++++++++++++++++++++++++++++++++++++++---
3 files changed, 91 insertions(+), 5 deletions(-)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 36fa6a2a82e3..4ee95d8c8413 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -140,6 +140,8 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
pte_t *huge_pte_offset(struct mm_struct *mm,
unsigned long addr, unsigned long sz);
int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep);
+void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
+ unsigned long *start, unsigned long *end);
struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
int write);
struct page *follow_huge_pd(struct vm_area_struct *vma,
@@ -170,6 +172,18 @@ static inline unsigned long hugetlb_total_pages(void)
return 0;
}
+static inline int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr,
+ pte_t *ptep)
+{
+ return 0;
+}
+
+static inline void adjust_range_if_pmd_sharing_possible(
+ struct vm_area_struct *vma,
+ unsigned long *start, unsigned long *end)
+{
+}
+
#define follow_hugetlb_page(m,v,p,vs,a,b,i,w,n) ({ BUG(); 0; })
#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 3103099f64fd..a73c5728e961 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4548,6 +4548,9 @@ static unsigned long page_table_shareable(struct vm_area_struct *svma,
return saddr;
}
+#define _range_in_vma(vma, start, end) \
+ ((vma)->vm_start <= (start) && (end) <= (vma)->vm_end)
+
static bool vma_shareable(struct vm_area_struct *vma, unsigned long addr)
{
unsigned long base = addr & PUD_MASK;
@@ -4556,12 +4559,40 @@ static bool vma_shareable(struct vm_area_struct *vma, unsigned long addr)
/*
* check on proper vm_flags and page table alignment
*/
- if (vma->vm_flags & VM_MAYSHARE &&
- vma->vm_start <= base && end <= vma->vm_end)
+ if (vma->vm_flags & VM_MAYSHARE && _range_in_vma(vma, base, end))
return true;
return false;
}
+/*
+ * Determine if start,end range within vma could be mapped by shared pmd.
+ * If yes, adjust start and end to cover range associated with possible
+ * shared pmd mappings.
+ */
+void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
+ unsigned long *start, unsigned long *end)
+{
+ unsigned long check_addr = *start;
+
+ if (!(vma->vm_flags & VM_MAYSHARE))
+ return;
+
+ for (check_addr = *start; check_addr < *end; check_addr += PUD_SIZE) {
+ unsigned long a_start = check_addr & PUD_MASK;
+ unsigned long a_end = a_start + PUD_SIZE;
+
+ /*
+ * If sharing is possible, adjust start/end if necessary.
+ */
+ if (_range_in_vma(vma, a_start, a_end)) {
+ if (a_start < *start)
+ *start = a_start;
+ if (a_end > *end)
+ *end = a_end;
+ }
+ }
+}
+
/*
* Search for a shareable pmd page for hugetlb. In any case calls pmd_alloc()
* and returns the corresponding pte. While this is not necessary for the
@@ -4659,6 +4690,11 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
{
return 0;
}
+
+void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
+ unsigned long *start, unsigned long *end)
+{
+}
#define want_pmd_share() (0)
#endif /* CONFIG_ARCH_WANT_HUGE_PMD_SHARE */
diff --git a/mm/rmap.c b/mm/rmap.c
index eb477809a5c0..1e79fac3186b 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1362,11 +1362,21 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
}
/*
- * We have to assume the worse case ie pmd for invalidation. Note that
- * the page can not be free in this function as call of try_to_unmap()
- * must hold a reference on the page.
+ * For THP, we have to assume the worse case ie pmd for invalidation.
+ * For hugetlb, it could be much worse if we need to do pud
+ * invalidation in the case of pmd sharing.
+ *
+ * Note that the page can not be free in this function as call of
+ * try_to_unmap() must hold a reference on the page.
*/
end = min(vma->vm_end, start + (PAGE_SIZE << compound_order(page)));
+ if (PageHuge(page)) {
+ /*
+ * If sharing is possible, start and end will be adjusted
+ * accordingly.
+ */
+ adjust_range_if_pmd_sharing_possible(vma, &start, &end);
+ }
mmu_notifier_invalidate_range_start(vma->vm_mm, start, end);
while (page_vma_mapped_walk(&pvmw)) {
@@ -1409,6 +1419,32 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
subpage = page - page_to_pfn(page) + pte_pfn(*pvmw.pte);
address = pvmw.address;
+ if (PageHuge(page)) {
+ if (huge_pmd_unshare(mm, &address, pvmw.pte)) {
+ /*
+ * huge_pmd_unshare unmapped an entire PMD
+ * page. There is no way of knowing exactly
+ * which PMDs may be cached for this mm, so
+ * we must flush them all. start/end were
+ * already adjusted above to cover this range.
+ */
+ flush_cache_range(vma, start, end);
+ flush_tlb_range(vma, start, end);
+ mmu_notifier_invalidate_range(mm, start, end);
+
+ /*
+ * The ref count of the PMD page was dropped
+ * which is part of the way map counting
+ * is done for shared PMDs. Return 'true'
+ * here. When there is no other sharing,
+ * huge_pmd_unshare returns false and we will
+ * unmap the actual page and drop map count
+ * to zero.
+ */
+ page_vma_mapped_walk_done(&pvmw);
+ break;
+ }
+ }
if (IS_ENABLED(CONFIG_MIGRATION) &&
(flags & TTU_MIGRATION) &&
--
2.17.1
Use the new of_get_compatible_child() helper to lookup the slot child
node instead of using of_find_compatible_node(), which searches the
entire tree from a given start node and thus can return an unrelated
(i.e. non-child) node.
This also addresses a potential use-after-free (e.g. after probe
deferral) as the tree-wide helper drops a reference to its first
argument (i.e. the node of the device being probed).
While at it, also fix up the related slot-node reference leak.
Fixes: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs")
Cc: stable <stable(a)vger.kernel.org> # 4.15
Cc: Carlo Caione <carlo(a)endlessm.com>
Cc: Martin Blumenstingl <martin.blumenstingl(a)googlemail.com>
Cc: Ulf Hansson <ulf.hansson(a)linaro.org>
Acked-by: Martin Blumenstingl <martin.blumenstingl(a)googlemail.com>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/mmc/host/meson-mx-sdio.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/meson-mx-sdio.c b/drivers/mmc/host/meson-mx-sdio.c
index 09cb89645d06..2cfec33178c1 100644
--- a/drivers/mmc/host/meson-mx-sdio.c
+++ b/drivers/mmc/host/meson-mx-sdio.c
@@ -517,19 +517,23 @@ static struct mmc_host_ops meson_mx_mmc_ops = {
static struct platform_device *meson_mx_mmc_slot_pdev(struct device *parent)
{
struct device_node *slot_node;
+ struct platform_device *pdev;
/*
* TODO: the MMC core framework currently does not support
* controllers with multiple slots properly. So we only register
* the first slot for now
*/
- slot_node = of_find_compatible_node(parent->of_node, NULL, "mmc-slot");
+ slot_node = of_get_compatible_child(parent->of_node, "mmc-slot");
if (!slot_node) {
dev_warn(parent, "no 'mmc-slot' sub-node found\n");
return ERR_PTR(-ENOENT);
}
- return of_platform_device_create(slot_node, NULL, parent);
+ pdev = of_platform_device_create(slot_node, NULL, parent);
+ of_node_put(slot_node);
+
+ return pdev;
}
static int meson_mx_mmc_add_host(struct meson_mx_mmc_host *host)
--
2.18.0
xen_swiotlb_{alloc,free}_coherent() actually allocate/free size by order
but used the required size to check if address is physical contiguous,
if first pages are physical contiguous also passed
range_straddles_page_boundary() check, but others were not it will
lead kernel panic.
Signed-off-by: Joe Jin <joe.jin(a)oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
---
drivers/xen/swiotlb-xen.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index a6f9ba85dc4b..aa081f806728 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -303,6 +303,9 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
*/
flags &= ~(__GFP_DMA | __GFP_HIGHMEM);
+ /* Convert the size to actually allocated. */
+ size = 1UL << (order + XEN_PAGE_SHIFT);
+
/* On ARM this function returns an ioremap'ped virtual address for
* which virt_to_phys doesn't return the corresponding physical
* address. In fact on ARM virt_to_phys only works for kernel direct
@@ -351,6 +354,9 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
* physical address */
phys = xen_bus_to_phys(dev_addr);
+ /* Convert the size to actually allocated. */
+ size = 1UL << (order + XEN_PAGE_SHIFT);
+
if (((dev_addr + size - 1 <= dma_mask)) ||
range_straddles_page_boundary(phys, size))
xen_destroy_contiguous_region(phys, order);
--
2.15.2 (Apple Git-101.1)
This is the start of the stable review cycle for the 3.18.121 release.
There are 56 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 Sep 5 16:49:09 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.121-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 3.18.121-rc1
Scott Bauer <scott.bauer(a)intel.com>
cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
Bart Van Assche <bart.vanassche(a)wdc.com>
scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock
Bart Van Assche <bart.vanassche(a)wdc.com>
scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
Maciej W. Rozycki <macro(a)mips.com>
MIPS: Correct the 64-bit DSP accumulator register size
Masami Hiramatsu <mhiramat(a)kernel.org>
kprobes: Make list and blacklist root user read only
Sebastian Ott <sebott(a)linux.ibm.com>
s390/pci: fix out of bounds access during irq setup
Julian Wiedmann <jwi(a)linux.ibm.com>
s390/qdio: reset old sbal_state flags
Dan Carpenter <dan.carpenter(a)oracle.com>
pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
ASoC: sirf: Fix potential NULL pointer dereference
Mikulas Patocka <mpatocka(a)redhat.com>
udl-kms: fix crash due to uninitialized memory
Mikulas Patocka <mpatocka(a)redhat.com>
udl-kms: handle allocation failure
Mikulas Patocka <mpatocka(a)redhat.com>
udl-kms: change down_interruptible to down
Kirill Tkhai <ktkhai(a)virtuozzo.com>
fuse: Add missed unlock_page() to fuse_readpages_fill()
Andrey Ryabinin <aryabinin(a)virtuozzo.com>
fuse: Don't access pipe->buffers without pipe_lock()
Rian Hunter <rian(a)alum.mit.edu>
x86/process: Re-export start_thread()
Punit Agrawal <punit.agrawal(a)arm.com>
KVM: arm/arm64: Skip updating PMD entry if no change
Punit Agrawal <punit.agrawal(a)arm.com>
KVM: arm/arm64: Skip updating PTE entry if no change
Greg Hackmann <ghackmann(a)android.com>
arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()
Eric Sandeen <sandeen(a)redhat.com>
ext4: reset error code in ext4_find_entry in fallback
Claudio Imbrenda <imbrenda(a)linux.vnet.ibm.com>
s390/kvm: fix deadlock when killed by oom
Josef Bacik <josef(a)toxicpanda.com>
btrfs: don't leak ret from do_chunk_alloc
jie@chenjie6@huwei.com <jie@chenjie6@huwei.com>
mm/memory.c: check return value of ioremap_prot
Jim Gill <jgill(a)vmware.com>
scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED
Johannes Thumshirn <jthumshirn(a)suse.de>
scsi: fcoe: drop frames in ELS LOGO error path
Colin Ian King <colin.king(a)canonical.com>
drivers: net: lmc: fix case value for target abort error
Randy Dunlap <rdunlap(a)infradead.org>
arc: fix type warnings in arc/mm/cache.c
Randy Dunlap <rdunlap(a)infradead.org>
arc: fix build errors in arc/include/asm/delay.h
Govindarajulu Varadarajan <gvaradar(a)cisco.com>
enic: handle mtu change for vf properly
Rafał Miłecki <rafal(a)milecki.pl>
Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum"
Calvin Walton <calvin.walton(a)kepstin.ca>
tools/power turbostat: Read extended processor family from CPUID
Li Wang <liwang(a)redhat.com>
zswap: re-check zswap_is_full() after do zswap_shrink()
Masami Hiramatsu <mhiramat(a)kernel.org>
selftests/ftrace: Add snapshot and tracing_on test case
Kiran Kumar Modukuri <kiran.modukuri(a)gmail.com>
cachefiles: Wait rather than BUG'ing on "Unexpected object collision"
Kiran Kumar Modukuri <kiran.modukuri(a)gmail.com>
cachefiles: Fix refcounting bug in backing-file read monitoring
Kiran Kumar Modukuri <kiran.modukuri(a)gmail.com>
fscache: Allow cancelled operations to be enqueued
Shubhrajyoti Datta <shubhrajyoti.datta(a)xilinx.com>
net: axienet: Fix double deregister of mdio
Sudarsana Reddy Kalluru <sudarsana.kalluru(a)cavium.com>
bnx2x: Fix invalid memory access in rss hash config path.
Guenter Roeck <linux(a)roeck-us.net>
media: staging: omap4iss: Include asm/cacheflush.h after generic includes
Nicholas Mc Guire <hofrat(a)osadl.org>
can: mpc5xxx_can: check of_iomap return before use
Florian Westphal <fw(a)strlen.de>
atl1c: reserve min skb headroom
YueHaibing <yuehaibing(a)huawei.com>
net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
Len Brown <len.brown(a)intel.com>
tools/power turbostat: fix -S on UP systems
Eugeniu Rosca <roscaeugeniu(a)gmail.com>
usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3'
Peter Senna Tschudin <peter.senna(a)gmail.com>
tools: usb: ffs-test: Fix build on big endian systems
Randy Dunlap <rdunlap(a)infradead.org>
usb/phy: fix PPC64 build errors in phy-fsl-usb.c
Jia-Ju Bai <baijiaju1990(a)gmail.com>
usb: gadget: r8a66597: Fix a possible sleep-in-atomic-context bugs in r8a66597_queue()
Jia-Ju Bai <baijiaju1990(a)gmail.com>
usb: gadget: r8a66597: Fix two possible sleep-in-atomic-context bugs in init_controller()
Lucas Stach <l.stach(a)pengutronix.de>
drm/imx: imx-ldb: check if channel is enabled before printing warning
Lucas Stach <l.stach(a)pengutronix.de>
drm/imx: imx-ldb: disable LDB on driver bind
Varun Prakash <varun(a)chelsio.com>
scsi: libiscsi: fix possible NULL pointer dereference in case of TMF
Bernd Edlinger <bernd.edlinger(a)hotmail.de>
nl80211: Add a missing break in parse_station_flags
mpubbise(a)codeaurora.org <mpubbise(a)codeaurora.org>
mac80211: add stations tied to AP_VLANs during hw reconfig
Florian Westphal <fw(a)strlen.de>
xfrm: free skb if nlsk pointer is NULL
Tommi Rantala <tommi.t.rantala(a)nokia.com>
xfrm: fix missing dst_release() after policy blocking lbcast and multicast
yujuan.qi <yujuan.qi(a)mediatek.com>
Cipso: cipso_v4_optptr enter infinite loop
Ethan Zhao <ethan.zhao(a)oracle.com>
sched/sysctl: Check user input value of sysctl_sched_time_avg
-------------
Diffstat:
Makefile | 4 +-
arch/arc/include/asm/delay.h | 3 +
arch/arc/mm/cache_arc700.c | 7 +-
arch/arm/kvm/mmu.c | 42 +++++++++---
arch/arm64/mm/init.c | 6 +-
arch/mips/bcm47xx/setup.c | 6 --
arch/mips/include/asm/mipsregs.h | 3 -
arch/mips/include/asm/processor.h | 2 +-
arch/mips/kernel/ptrace.c | 2 +-
arch/mips/kernel/ptrace32.c | 2 +-
arch/s390/include/asm/qdio.h | 1 -
arch/s390/mm/fault.c | 2 +
arch/s390/pci/pci.c | 2 +
arch/x86/kernel/process_64.c | 1 +
drivers/cdrom/cdrom.c | 2 +-
drivers/gpu/drm/udl/udl_fb.c | 2 +-
drivers/gpu/drm/udl/udl_main.c | 35 +++++-----
drivers/net/can/mscan/mpc5xxx_can.c | 5 ++
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 1 +
.../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 13 +++-
drivers/net/ethernet/cisco/enic/enic_main.c | 78 ++++++++--------------
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 1 +
drivers/net/wan/lmc/lmc_main.c | 2 +-
drivers/pinctrl/freescale/pinctrl-imx1-core.c | 2 +-
drivers/s390/cio/qdio_main.c | 5 +-
drivers/scsi/fcoe/fcoe_ctlr.c | 4 +-
drivers/scsi/libiscsi.c | 12 ++--
drivers/scsi/scsi_sysfs.c | 20 +++++-
drivers/scsi/vmw_pvscsi.c | 11 ++-
drivers/staging/imx-drm/imx-ldb.c | 9 ++-
drivers/staging/media/omap4iss/iss_video.c | 3 +-
drivers/usb/gadget/function/f_uac2.c | 20 +++---
drivers/usb/gadget/udc/r8a66597-udc.c | 6 +-
drivers/usb/phy/phy-fsl-usb.c | 4 +-
fs/btrfs/extent-tree.c | 2 +-
fs/cachefiles/namei.c | 1 -
fs/cachefiles/rdwr.c | 17 +++--
fs/ext4/namei.c | 1 +
fs/fscache/operation.c | 6 +-
fs/fuse/dev.c | 7 +-
fs/fuse/file.c | 1 +
fs/sysfs/file.c | 44 ++++++++++++
include/linux/sysfs.h | 14 ++++
kernel/kprobes.c | 4 +-
kernel/sysctl.c | 3 +-
mm/memory.c | 3 +
mm/zswap.c | 9 +++
net/caif/caif_dev.c | 4 +-
net/ipv4/cipso_ipv4.c | 12 +++-
net/mac80211/util.c | 3 +-
net/wireless/nl80211.c | 1 +
net/xfrm/xfrm_policy.c | 3 +
net/xfrm/xfrm_user.c | 10 +--
sound/soc/sirf/sirf-usp.c | 7 +-
tools/power/x86/turbostat/turbostat.c | 8 +--
.../selftests/ftrace/test.d/00basic/snapshot.tc | 28 ++++++++
tools/usb/ffs-test.c | 19 +++++-
57 files changed, 354 insertions(+), 171 deletions(-)
From: Randy Dunlap <rdunlap(a)infradead.org>
Subject: uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name
Since this header is in "include/uapi/linux/", apparently people want to
use it in userspace programs -- even in C++ ones. However, the header
uses a C++ reserved keyword ("private"), so change that to "dh_private"
instead to allow the header file to be used in C++ userspace.
Fixes https://bugzilla.kernel.org/show_bug.cgi?id=191051
Link: http://lkml.kernel.org/r/0db6c314-1ef4-9bfa-1baa-7214dd2ee061@infradead.org
Fixes: ddbb41148724 ("KEYS: Add KEYCTL_DH_COMPUTE command")
Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
Reviewed-by: Andrew Morton <akpm(a)linux-foundation.org>
Cc: David Howells <dhowells(a)redhat.com>
Cc: James Morris <jmorris(a)namei.org>
Cc: "Serge E. Hallyn" <serge(a)hallyn.com>
Cc: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
include/uapi/linux/keyctl.h | 2 +-
security/keys/dh.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/include/uapi/linux/keyctl.h~uapi-linux-keyctlh-dont-use-c-reserved-keyword-as-a-struct-member-name
+++ a/include/uapi/linux/keyctl.h
@@ -65,7 +65,7 @@
/* keyctl structures */
struct keyctl_dh_params {
- __s32 private;
+ __s32 dh_private;
__s32 prime;
__s32 base;
};
--- a/security/keys/dh.c~uapi-linux-keyctlh-dont-use-c-reserved-keyword-as-a-struct-member-name
+++ a/security/keys/dh.c
@@ -300,7 +300,7 @@ long __keyctl_dh_compute(struct keyctl_d
}
dh_inputs.g_size = dlen;
- dlen = dh_data_from_key(pcopy.private, &dh_inputs.key);
+ dlen = dh_data_from_key(pcopy.dh_private, &dh_inputs.key);
if (dlen < 0) {
ret = dlen;
goto out2;
_
From: Mikhail Zaslonko <zaslonko(a)linux.ibm.com>
Subject: memory_hotplug: fix kernel_panic on offline page processing
Within show_valid_zones() the function test_pages_in_a_zone() should be
called for online memory blocks only. Otherwise it might lead to the
VM_BUG_ON due to uninitialized struct pages (when CONFIG_DEBUG_VM_PGFLAGS
kernel option is set):
page dumped because: VM_BUG_ON_PAGE(PagePoisoned(p))
------------[ cut here ]------------
Call Trace:
([<000000000038f91e>] test_pages_in_a_zone+0xe6/0x168)
[<0000000000923472>] show_valid_zones+0x5a/0x1a8
[<0000000000900284>] dev_attr_show+0x3c/0x78
[<000000000046f6f0>] sysfs_kf_seq_show+0xd0/0x150
[<00000000003ef662>] seq_read+0x212/0x4b8
[<00000000003bf202>] __vfs_read+0x3a/0x178
[<00000000003bf3ca>] vfs_read+0x8a/0x148
[<00000000003bfa3a>] ksys_read+0x62/0xb8
[<0000000000bc2220>] system_call+0xdc/0x2d8
That VM_BUG_ON was triggered by the page poisoning introduced in
mm/sparse.c with the git commit d0dc12e86b31 ("mm/memory_hotplug: optimize
memory hotplug") With the same commit the new 'nid' field has been added
to the struct memory_block in order to store and later on derive the node
id for offline pages (instead of accessing struct page which might be
uninitialized). But one reference to nid in show_valid_zones() function
has been overlooked. Fixed with current commit. Also, nr_pages will not
be used any more after test_pages_in_a_zone() call, do not update it.
Link: http://lkml.kernel.org/r/20180828090539.41491-1-zaslonko@linux.ibm.com
Fixes: d0dc12e86b31 ("mm/memory_hotplug: optimize memory hotplug")
Signed-off-by: Mikhail Zaslonko <zaslonko(a)linux.ibm.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Reviewed-by: Pavel Tatashin <pavel.tatashin(a)microsoft.com>
Cc: <stable(a)vger.kernel.org> [4.17+]
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
drivers/base/memory.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
--- a/drivers/base/memory.c~memory_hotplug-fix-kernel_panic-on-offline-page-processing
+++ a/drivers/base/memory.c
@@ -417,25 +417,23 @@ static ssize_t show_valid_zones(struct d
int nid;
/*
- * The block contains more than one zone can not be offlined.
- * This can happen e.g. for ZONE_DMA and ZONE_DMA32
- */
- if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages, &valid_start_pfn, &valid_end_pfn))
- return sprintf(buf, "none\n");
-
- start_pfn = valid_start_pfn;
- nr_pages = valid_end_pfn - start_pfn;
-
- /*
* Check the existing zone. Make sure that we do that only on the
* online nodes otherwise the page_zone is not reliable
*/
if (mem->state == MEM_ONLINE) {
+ /*
+ * The block contains more than one zone can not be offlined.
+ * This can happen e.g. for ZONE_DMA and ZONE_DMA32
+ */
+ if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages,
+ &valid_start_pfn, &valid_end_pfn))
+ return sprintf(buf, "none\n");
+ start_pfn = valid_start_pfn;
strcat(buf, page_zone(pfn_to_page(start_pfn))->name);
goto out;
}
- nid = pfn_to_nid(start_pfn);
+ nid = mem->nid;
default_zone = zone_for_pfn_range(MMOP_ONLINE_KEEP, nid, start_pfn, nr_pages);
strcat(buf, default_zone->name);
_
From: "Aneesh Kumar K.V" <aneesh.kumar(a)linux.ibm.com>
Subject: mm/hugetlb: filter out hugetlb pages if HUGEPAGE migration is not supported.
When scanning for movable pages, filter out Hugetlb pages if hugepage
migration is not supported. Without this we hit infinte loop in
__offline_pages() where we do
pfn = scan_movable_pages(start_pfn, end_pfn);
if (pfn) { /* We have movable pages */
ret = do_migrate_range(pfn, end_pfn);
goto repeat;
}
Fix this by checking hugepage_migration_supported both in
has_unmovable_pages which is the primary backoff mechanism for page
offlining and for consistency reasons also into scan_movable_pages because
it doesn't make any sense to return a pfn to non-migrateable huge page.
This issue was revealed by, but not caused by 72b39cfc4d75 ("mm,
memory_hotplug: do not fail offlining too early").
Link: http://lkml.kernel.org/r/20180824063314.21981-1-aneesh.kumar@linux.ibm.com
Fixes: 72b39cfc4d75 ("mm, memory_hotplug: do not fail offlining too early")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
Reported-by: Haren Myneni <haren(a)linux.vnet.ibm.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi(a)ah.jp.nec.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
mm/memory_hotplug.c | 3 ++-
mm/page_alloc.c | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
--- a/mm/memory_hotplug.c~mm-hugetlb-filter-out-hugetlb-pages-if-hugepage-migration-is-not-supported
+++ a/mm/memory_hotplug.c
@@ -1333,7 +1333,8 @@ static unsigned long scan_movable_pages(
if (__PageMovable(page))
return pfn;
if (PageHuge(page)) {
- if (page_huge_active(page))
+ if (hugepage_migration_supported(page_hstate(page)) &&
+ page_huge_active(page))
return pfn;
else
pfn = round_up(pfn + 1,
--- a/mm/page_alloc.c~mm-hugetlb-filter-out-hugetlb-pages-if-hugepage-migration-is-not-supported
+++ a/mm/page_alloc.c
@@ -7708,6 +7708,10 @@ bool has_unmovable_pages(struct zone *zo
* handle each tail page individually in migration.
*/
if (PageHuge(page)) {
+
+ if (!hugepage_migration_supported(page_hstate(page)))
+ goto unmovable;
+
iter = round_up(iter + 1, 1<<compound_order(page)) - 1;
continue;
}
_