Use the new of_get_compatible_child() helper to lookup the usb sibling
node instead of using of_find_compatible_node(), which searches the
entire tree and thus can return an unrelated (non-sibling) 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 parent device node).
While at it, also fix the related phy-node reference leak.
Fixes: f5e4edb8c888 ("power: twl4030_charger: find associated phy by more reliable means.")
Cc: stable <stable(a)vger.kernel.org> # 4.2
Cc: NeilBrown <neilb(a)suse.de>
Cc: Felipe Balbi <balbi(a)ti.com>
Cc: Sebastian Reichel <sre(a)kernel.org>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/power/supply/twl4030_charger.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/twl4030_charger.c
index bbcaee56db9d..b6a7d9f74cf3 100644
--- a/drivers/power/supply/twl4030_charger.c
+++ b/drivers/power/supply/twl4030_charger.c
@@ -996,12 +996,13 @@ static int twl4030_bci_probe(struct platform_device *pdev)
if (bci->dev->of_node) {
struct device_node *phynode;
- phynode = of_find_compatible_node(bci->dev->of_node->parent,
- NULL, "ti,twl4030-usb");
+ phynode = of_get_compatible_child(bci->dev->of_node->parent,
+ "ti,twl4030-usb");
if (phynode) {
bci->usb_nb.notifier_call = twl4030_bci_usb_ncb;
bci->transceiver = devm_usb_get_phy_by_node(
bci->dev, phynode, &bci->usb_nb);
+ of_node_put(phynode);
if (IS_ERR(bci->transceiver)) {
ret = PTR_ERR(bci->transceiver);
if (ret == -EPROBE_DEFER)
--
2.18.0
Various mips64 and ppc64 qemu tests crash as follows
in v4.14.y and v4.17.y (the log is from ppc64).
------------[ cut here ]------------
kernel BUG at kernel/time/hrtimer.c:1673!
Oops: Exception in kernel mode, sig: 5 [#1]
BE NUMA CoreNet Generic
Modules linked in:
CPU: 0 PID: 1 Comm: init Not tainted 4.17.19-rc1-00309-g8fe1830 #1
NIP: c000000000085d6c LR: c00000000089d840 CTR: c00000000000cd00
REGS: c00000003e1e7990 TRAP: 0700 Not tainted (4.17.19-rc1-00309-g8fe1830)
MSR: 000000008002b000 <CE,EE,FP,ME> CR: 48000284 XER: 00000000
SOFTE: 0
GPR00: c00000000089d7ec c00000003e1e7c10 c000000000cb9c00 c00000003e1e8238
GPR04: c00000003e1e7c80 ffffffffffffffff 000000003b9aca00 0000000000000000
GPR08: 0000000031012c01 0000000031012c01 0000000000000002 0000000031012c01
GPR12: 0000000028000482 c000000000d35000 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR24: 0000000000000000 0000000000000000 0000000000000016 00000000ffff9008
GPR28: c00000003e1e7e10 c00000003e1e8000 0000000000000000 000000009336eabb
NIP [c000000000085d6c] .nanosleep_copyout+0x4c/0x50
LR [c00000000089d840] .do_nanosleep+0x160/0x190
Call Trace:
[c00000003e1e7c10] [c00000000089d7ec] .do_nanosleep+0x10c/0x190 (unreliable)
[c00000003e1e7cc0] [c000000000085e78] .hrtimer_nanosleep+0x108/0x1d0
[c00000003e1e7da0] [c000000000086068] .__se_compat_sys_nanosleep+0x78/0xb0
[c00000003e1e7e30] [c000000000000618] system_call+0x58/0x64
Instruction dump:
7c832378 e8890010 4bffbadd 60000000 38210070 e8010010 2fa30000 3940fff2
3860fdfc 7c63579e 7c0803a6 4e800020 <0fe00000> 7c0802a6 fb81ffe0 fbc1fff0
---[ end trace 15c7fbc119007c42 ]---
I started to bisect, but abandoned it after finding commit 62d7ce7f40a9
("posix-timers: Fix nanosleep_copyout() for CONFIG_COMPAT_32BIT_TIME")
in both branches. Since there is no "config COMPAT_32BIT_TIME" in v4.14.y
or v4.17.y, some relevant code is commented out by the commit, which in
turn results in the crash.
Guenter
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 1204e35bedf4e5015cda559ed8c84789a6dae24e Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas(a)wunner.de>
Date: Thu, 19 Jul 2018 17:27:34 -0500
Subject: [PATCH] PCI: pciehp: Fix unprotected list iteration in IRQ handler
Commit b440bde74f04 ("PCI: Add pci_ignore_hotplug() to ignore hotplug
events for a device") iterates over the devices on a hotplug port's
subordinate bus in pciehp's IRQ handler without acquiring pci_bus_sem.
It is thus possible for a user to cause a crash by concurrently
manipulating the device list, e.g. by disabling slot power via sysfs
on a different CPU or by initiating a remove/rescan via sysfs.
This can't be fixed by acquiring pci_bus_sem because it may sleep.
The simplest fix is to avoid the list iteration altogether and just
check the ignore_hotplug flag on the port itself. This works because
pci_ignore_hotplug() sets the flag both on the device as well as on its
parent bridge.
We do lose the ability to print the name of the device blocking hotplug
in the debug message, but that's probably bearable.
Fixes: b440bde74f04 ("PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device")
Signed-off-by: Lukas Wunner <lukas(a)wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas(a)google.com>
Cc: stable(a)vger.kernel.org
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 84b3d421c083..aff191b4552c 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -539,8 +539,6 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id)
{
struct controller *ctrl = (struct controller *)dev_id;
struct pci_dev *pdev = ctrl_dev(ctrl);
- struct pci_bus *subordinate = pdev->subordinate;
- struct pci_dev *dev;
struct slot *slot = ctrl->slot;
u16 status, events;
u8 present;
@@ -588,14 +586,9 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id)
wake_up(&ctrl->queue);
}
- if (subordinate) {
- list_for_each_entry(dev, &subordinate->devices, bus_list) {
- if (dev->ignore_hotplug) {
- ctrl_dbg(ctrl, "ignoring hotplug event %#06x (%s requested no hotplug)\n",
- events, pci_name(dev));
- return IRQ_HANDLED;
- }
- }
+ if (pdev->ignore_hotplug) {
+ ctrl_dbg(ctrl, "ignoring hotplug event %#06x\n", events);
+ return IRQ_HANDLED;
}
/* Check Attention Button Pressed */
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 91a2968e245d6ba616db37001fa1a043078b1a65 Mon Sep 17 00:00:00 2001
From: Zachary Zhang <zhangzg(a)marvell.com>
Date: Fri, 29 Jun 2018 11:16:19 +0200
Subject: [PATCH] PCI: aardvark: Size bridges before resources allocation
The PCIE I/O and MEM resource allocation mechanism is that root bus
goes through the following steps:
1. Check PCI bridges' range and computes I/O and Mem base/limits.
2. Sort all subordinate devices I/O and MEM resource requirements and
allocate the resources and writes/updates subordinate devices'
requirements to PCI bridges I/O and Mem MEM/limits registers.
Currently, PCI Aardvark driver only handles the second step and lacks
the first step, so there is an I/O and MEM resource allocation failure
when using a PCI switch. This commit fixes that by sizing bridges
before doing the resource allocation.
Fixes: 8c39d710363c1 ("PCI: aardvark: Add Aardvark PCI host controller
driver")
Signed-off-by: Zachary Zhang <zhangzg(a)marvell.com>
[Thomas: edit commit log.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni(a)bootlin.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
Cc: <stable(a)vger.kernel.org>
diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index c9c72595bd20..10543ed7b500 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -906,6 +906,7 @@ static int advk_pcie_probe(struct platform_device *pdev)
bus = bridge->bus;
+ pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
list_for_each_entry(child, &bus->children, node)
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 91a2968e245d6ba616db37001fa1a043078b1a65 Mon Sep 17 00:00:00 2001
From: Zachary Zhang <zhangzg(a)marvell.com>
Date: Fri, 29 Jun 2018 11:16:19 +0200
Subject: [PATCH] PCI: aardvark: Size bridges before resources allocation
The PCIE I/O and MEM resource allocation mechanism is that root bus
goes through the following steps:
1. Check PCI bridges' range and computes I/O and Mem base/limits.
2. Sort all subordinate devices I/O and MEM resource requirements and
allocate the resources and writes/updates subordinate devices'
requirements to PCI bridges I/O and Mem MEM/limits registers.
Currently, PCI Aardvark driver only handles the second step and lacks
the first step, so there is an I/O and MEM resource allocation failure
when using a PCI switch. This commit fixes that by sizing bridges
before doing the resource allocation.
Fixes: 8c39d710363c1 ("PCI: aardvark: Add Aardvark PCI host controller
driver")
Signed-off-by: Zachary Zhang <zhangzg(a)marvell.com>
[Thomas: edit commit log.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni(a)bootlin.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
Cc: <stable(a)vger.kernel.org>
diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index c9c72595bd20..10543ed7b500 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -906,6 +906,7 @@ static int advk_pcie_probe(struct platform_device *pdev)
bus = bridge->bus;
+ pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
list_for_each_entry(child, &bus->children, node)
The patch below does not apply to the 4.17-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 91a2968e245d6ba616db37001fa1a043078b1a65 Mon Sep 17 00:00:00 2001
From: Zachary Zhang <zhangzg(a)marvell.com>
Date: Fri, 29 Jun 2018 11:16:19 +0200
Subject: [PATCH] PCI: aardvark: Size bridges before resources allocation
The PCIE I/O and MEM resource allocation mechanism is that root bus
goes through the following steps:
1. Check PCI bridges' range and computes I/O and Mem base/limits.
2. Sort all subordinate devices I/O and MEM resource requirements and
allocate the resources and writes/updates subordinate devices'
requirements to PCI bridges I/O and Mem MEM/limits registers.
Currently, PCI Aardvark driver only handles the second step and lacks
the first step, so there is an I/O and MEM resource allocation failure
when using a PCI switch. This commit fixes that by sizing bridges
before doing the resource allocation.
Fixes: 8c39d710363c1 ("PCI: aardvark: Add Aardvark PCI host controller
driver")
Signed-off-by: Zachary Zhang <zhangzg(a)marvell.com>
[Thomas: edit commit log.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni(a)bootlin.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
Cc: <stable(a)vger.kernel.org>
diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index c9c72595bd20..10543ed7b500 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -906,6 +906,7 @@ static int advk_pcie_probe(struct platform_device *pdev)
bus = bridge->bus;
+ pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
list_for_each_entry(child, &bus->children, node)
Hi Greg,
Kindly consider/review following net/sched fixes for stable 4.4.y.
This patchset is a follow-up of upstream fix
87b60cfacf9f ("net_sched: fix error recovery at qdisc creation")
cherry-picked on stable 4.4.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.4.151 for ARCH=x86_64.
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
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>
Suggested-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 | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 990770d..6184fa1 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -328,10 +328,26 @@ EXPORT_SYMBOL_GPL(spi_mem_exec_op);
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
From: Shan Hai <shan.hai(a)oracle.com>
The writeback thread would exit with a lock held when the cache device is
detached via sysfs interface, fix it by releasing the held lock before exiting
the while-loop.
Fixes: fadd94e05c02 (bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set)
Signed-off-by: Shan Hai <shan.hai(a)oracle.com>
Signed-off-by: Coly Li <colyli(a)suse.de>
Tested-by: Shenghui Wang <shhuiw(a)foxmail.com>
Cc: stable(a)vger.kernel.org #4.17+
---
Changelog:
v2: add Fixes tag by Coly Li.
v1: initial patch from Shan Hai.
drivers/md/bcache/writeback.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 6be05bd7ca67..08c3a9f9676c 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -685,8 +685,10 @@ static int bch_writeback_thread(void *arg)
* data on cache. BCACHE_DEV_DETACHING flag is set in
* bch_cached_dev_detach().
*/
- if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags))
+ if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)) {
+ up_write(&dc->writeback_lock);
break;
+ }
}
up_write(&dc->writeback_lock);
--
2.18.0
Two bug fixes:
1) missing entries in the l1d_param array; this can cause a host crash
if an access attempts to reach the missing entry. Future-proof the get
function against any overflows as well. However, the two entries
VMENTER_L1D_FLUSH_EPT_DISABLED and VMENTER_L1D_FLUSH_NOT_REQUIRED must
not be accepted by the parse function, so disable them there.
2) invalid values must be rejected even if the CPU does not have the
bug, so test for them before checking boot_cpu_has(X86_BUG_L1TF)
... and a small refactoring, since the .cmd field is redundant with
the index in the array.
Reported-by: Bandan Das <bsd(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: a7b9020b06ec6d7c3f3b0d4ef1a9eba12654f4f7
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
arch/x86/kvm/vmx.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index c76ca8c4befa..8dae47e7267a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -198,12 +198,14 @@
static const struct {
const char *option;
- enum vmx_l1d_flush_state cmd;
+ bool for_parse;
} vmentry_l1d_param[] = {
- {"auto", VMENTER_L1D_FLUSH_AUTO},
- {"never", VMENTER_L1D_FLUSH_NEVER},
- {"cond", VMENTER_L1D_FLUSH_COND},
- {"always", VMENTER_L1D_FLUSH_ALWAYS},
+ [VMENTER_L1D_FLUSH_AUTO] = {"auto", true},
+ [VMENTER_L1D_FLUSH_NEVER] = {"never", true},
+ [VMENTER_L1D_FLUSH_COND] = {"cond", true},
+ [VMENTER_L1D_FLUSH_ALWAYS] = {"always", true},
+ [VMENTER_L1D_FLUSH_EPT_DISABLED] = {"EPT disabled", false},
+ [VMENTER_L1D_FLUSH_NOT_REQUIRED] = {"not required", false},
};
#define L1D_CACHE_ORDER 4
@@ -287,8 +289,9 @@ static int vmentry_l1d_flush_parse(const char *s)
if (s) {
for (i = 0; i < ARRAY_SIZE(vmentry_l1d_param); i++) {
- if (sysfs_streq(s, vmentry_l1d_param[i].option))
- return vmentry_l1d_param[i].cmd;
+ if (vmentry_l1d_param[i].for_parse &&
+ sysfs_streq(s, vmentry_l1d_param[i].option))
+ return i;
}
}
return -EINVAL;
@@ -298,13 +301,13 @@ static int vmentry_l1d_flush_set(const char *s, const struct kernel_param *kp)
{
int l1tf, ret;
- if (!boot_cpu_has(X86_BUG_L1TF))
- return 0;
-
l1tf = vmentry_l1d_flush_parse(s);
if (l1tf < 0)
return l1tf;
+ if (!boot_cpu_has(X86_BUG_L1TF))
+ return 0;
+
/*
* Has vmx_init() run already? If not then this is the pre init
* parameter parsing. In that case just store the value and let
@@ -324,6 +327,9 @@ static int vmentry_l1d_flush_set(const char *s, const struct kernel_param *kp)
static int vmentry_l1d_flush_get(char *s, const struct kernel_param *kp)
{
+ if (WARN_ON_ONCE(l1tf_vmx_mitigation >= ARRAY_SIZE(vmentry_l1d_param)))
+ return sprintf(s, "???\n");
+
return sprintf(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option);
}
--
1.8.3.1
v4.4.y, v4.9.y:
Building mips:cavium_octeon_defconfig ... failed
--------------
Error log:
/opt/buildbot/slave/stable-queue-4.4/build/drivers/net/ethernet/octeon/octeon_mgmt.c: In function 'octeon_mgmt_change_mtu':
/opt/buildbot/slave/stable-queue-4.4/build/drivers/net/ethernet/octeon/octeon_mgmt.c:652:6: error: 'size_without_fcs' undeclared
v4.9.y, v4.14.y:
Building i386:tools/perf ... failed
Building x86_64:tools/perf ... failed
--------------
Error log:
PERF_VERSION = 4.9.123.g5175d5
tests/parse-events.c: In function ‘test_event’:
tests/parse-events.c:1681:3: error: implicit declaration of function ‘parse_events_print_error’ [-Werror=implicit-function-declaration]
parse_events_print_error(&err, e->name);
^
tests/parse-events.c:1681:3: error: nested extern declaration of ‘parse_events_print_error’
This is just a snapshot; builds are still ongoing. I'll send another e-mail later
if more errors are reported after the build is complete.
Guenter
From: Shan Hai <shan.hai(a)oracle.com>
The writeback thread would exit with a lock held when the cache device is
detached via sysfs interface, fix it by releasing the held lock before exiting
the while-loop.
Signed-off-by: Shan Hai <shan.hai(a)oracle.com>
Signed-off-by: Coly Li <colyli(a)suse.de>
Tested-by: Shenghui Wang <shhuiw(a)foxmail.com>
Cc: stable(a)vger.kernel.org #4.17+
---
drivers/md/bcache/writeback.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 6be05bd7ca67..08c3a9f9676c 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -685,8 +685,10 @@ static int bch_writeback_thread(void *arg)
* data on cache. BCACHE_DEV_DETACHING flag is set in
* bch_cached_dev_detach().
*/
- if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags))
+ if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)) {
+ up_write(&dc->writeback_lock);
break;
+ }
}
up_write(&dc->writeback_lock);
--
2.18.0
'type' is user-controlled, so sanitize it after the bounds check to
avoid using it in speculative execution. This covers the following
potential gadgets detected with the help of smatch:
* fs/ext4/super.c:5741 ext4_quota_read() warn: potential spectre issue
'sb_dqopt(sb)->files' [r]
* fs/ext4/super.c:5778 ext4_quota_write() warn: potential spectre issue
'sb_dqopt(sb)->files' [r]
* fs/f2fs/super.c:1552 f2fs_quota_read() warn: potential spectre issue
'sb_dqopt(sb)->files' [r]
* fs/f2fs/super.c:1608 f2fs_quota_write() warn: potential spectre issue
'sb_dqopt(sb)->files' [r]
* fs/quota/dquot.c:412 mark_info_dirty() warn: potential spectre issue
'sb_dqopt(sb)->info' [w]
* fs/quota/dquot.c:933 dqinit_needed() warn: potential spectre issue
'dquots' [r]
* fs/quota/dquot.c:2112 dquot_commit_info() warn: potential spectre
issue 'dqopt->ops' [r]
* fs/quota/dquot.c:2362 vfs_load_quota_inode() warn: potential spectre
issue 'dqopt->files' [w] (local cap)
* fs/quota/dquot.c:2369 vfs_load_quota_inode() warn: potential spectre
issue 'dqopt->ops' [w] (local cap)
* fs/quota/dquot.c:2370 vfs_load_quota_inode() warn: potential spectre
issue 'dqopt->info' [w] (local cap)
* fs/quota/quota.c:110 quota_getfmt() warn: potential spectre issue
'sb_dqopt(sb)->info' [r]
* fs/quota/quota_v2.c:84 v2_check_quota_file() warn: potential spectre
issue 'quota_magics' [w]
* fs/quota/quota_v2.c:85 v2_check_quota_file() warn: potential spectre
issue 'quota_versions' [w]
* fs/quota/quota_v2.c:96 v2_read_file_info() warn: potential spectre
issue 'dqopt->info' [r]
* fs/quota/quota_v2.c:172 v2_write_file_info() warn: potential spectre
issue 'dqopt->info' [r]
Additionally, a quick inspection indicates there are array accesses with
'type' in quota_on() and quota_off() functions which are also addressed
by this.
Cc: Josh Poimboeuf <jpoimboe(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Jeremy Cline <jcline(a)redhat.com>
---
This patch isn't going to cleanly apply to stable without the "fs/quota:
Replace XQM_MAXQUOTAS usage with MAXQUOTAS" patch, but I'm not sure that
patch is really stable material and XQM_MAXQUOTAS has been 3 since
pre-v4.4 so the end result will be the same even if that patch isn't
backported.
fs/quota/quota.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index d403392d8a0f..f0cbf58ad4da 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -18,6 +18,7 @@
#include <linux/quotaops.h>
#include <linux/types.h>
#include <linux/writeback.h>
+#include <linux/nospec.h>
static int check_quotactl_permission(struct super_block *sb, int type, int cmd,
qid_t id)
@@ -701,6 +702,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
if (type >= MAXQUOTAS)
return -EINVAL;
+ type = array_index_nospec(type, MAXQUOTAS);
/*
* Quota not supported on this fs? Check this before s_quota_types
* since they needn't be set if quota is not supported at all.
--
2.17.1
Use the new of_get_compatible_child() helper to lookup the legacy
pwrlevels child node instead of using of_find_compatible_node(), which
searches the entire tree 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 probed device's node).
While at it, also fix the related child-node reference leak.
Fixes: e2af8b6b0ca1 ("drm/msm: gpu: Use OPP tables if we can")
Cc: stable <stable(a)vger.kernel.org> # 4.12
Cc: Jordan Crouse <jcrouse(a)codeaurora.org>
Cc: Rob Clark <robdclark(a)gmail.com>
Cc: David Airlie <airlied(a)linux.ie>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/gpu/drm/msm/adreno/adreno_gpu.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index da1363a0c54d..93d70f4a2154 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -633,8 +633,7 @@ static int adreno_get_legacy_pwrlevels(struct device *dev)
struct device_node *child, *node;
int ret;
- node = of_find_compatible_node(dev->of_node, NULL,
- "qcom,gpu-pwrlevels");
+ node = of_get_compatible_child(dev->of_node, "qcom,gpu-pwrlevels");
if (!node) {
dev_err(dev, "Could not find the GPU powerlevels\n");
return -ENXIO;
@@ -655,6 +654,8 @@ static int adreno_get_legacy_pwrlevels(struct device *dev)
dev_pm_opp_add(dev, val, 0);
}
+ of_node_put(node);
+
return 0;
}
--
2.18.0
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 3b885ac1dc35b87a39ee176a6c7e2af9c789d8b8 Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin(a)bell.net>
Date: Sun, 12 Aug 2018 16:31:17 -0400
Subject: [PATCH] parisc: Remove unnecessary barriers from spinlock.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Now that mb() is an instruction barrier, it will slow performance if we issue
unnecessary barriers.
The spinlock defines have a number of unnecessary barriers. The __ldcw()
define is both a hardware and compiler barrier. The mb() barriers in the
routines using __ldcw() serve no purpose.
The only barrier needed is the one in arch_spin_unlock(). We need to ensure
all accesses are complete prior to releasing the lock.
Signed-off-by: John David Anglin <dave.anglin(a)bell.net>
Cc: stable(a)vger.kernel.org # 4.0+
Signed-off-by: Helge Deller <deller(a)gmx.de>
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h
index 6f84b6acc86e..8a63515f03bf 100644
--- a/arch/parisc/include/asm/spinlock.h
+++ b/arch/parisc/include/asm/spinlock.h
@@ -20,7 +20,6 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
{
volatile unsigned int *a;
- mb();
a = __ldcw_align(x);
while (__ldcw(a) == 0)
while (*a == 0)
@@ -30,17 +29,16 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
local_irq_disable();
} else
cpu_relax();
- mb();
}
#define arch_spin_lock_flags arch_spin_lock_flags
static inline void arch_spin_unlock(arch_spinlock_t *x)
{
volatile unsigned int *a;
- mb();
+
a = __ldcw_align(x);
- *a = 1;
mb();
+ *a = 1;
}
static inline int arch_spin_trylock(arch_spinlock_t *x)
@@ -48,10 +46,8 @@ static inline int arch_spin_trylock(arch_spinlock_t *x)
volatile unsigned int *a;
int ret;
- mb();
a = __ldcw_align(x);
ret = __ldcw(a) != 0;
- mb();
return ret;
}
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 3b885ac1dc35b87a39ee176a6c7e2af9c789d8b8 Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin(a)bell.net>
Date: Sun, 12 Aug 2018 16:31:17 -0400
Subject: [PATCH] parisc: Remove unnecessary barriers from spinlock.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Now that mb() is an instruction barrier, it will slow performance if we issue
unnecessary barriers.
The spinlock defines have a number of unnecessary barriers. The __ldcw()
define is both a hardware and compiler barrier. The mb() barriers in the
routines using __ldcw() serve no purpose.
The only barrier needed is the one in arch_spin_unlock(). We need to ensure
all accesses are complete prior to releasing the lock.
Signed-off-by: John David Anglin <dave.anglin(a)bell.net>
Cc: stable(a)vger.kernel.org # 4.0+
Signed-off-by: Helge Deller <deller(a)gmx.de>
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h
index 6f84b6acc86e..8a63515f03bf 100644
--- a/arch/parisc/include/asm/spinlock.h
+++ b/arch/parisc/include/asm/spinlock.h
@@ -20,7 +20,6 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
{
volatile unsigned int *a;
- mb();
a = __ldcw_align(x);
while (__ldcw(a) == 0)
while (*a == 0)
@@ -30,17 +29,16 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
local_irq_disable();
} else
cpu_relax();
- mb();
}
#define arch_spin_lock_flags arch_spin_lock_flags
static inline void arch_spin_unlock(arch_spinlock_t *x)
{
volatile unsigned int *a;
- mb();
+
a = __ldcw_align(x);
- *a = 1;
mb();
+ *a = 1;
}
static inline int arch_spin_trylock(arch_spinlock_t *x)
@@ -48,10 +46,8 @@ static inline int arch_spin_trylock(arch_spinlock_t *x)
volatile unsigned int *a;
int ret;
- mb();
a = __ldcw_align(x);
ret = __ldcw(a) != 0;
- mb();
return ret;
}
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 3b885ac1dc35b87a39ee176a6c7e2af9c789d8b8 Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin(a)bell.net>
Date: Sun, 12 Aug 2018 16:31:17 -0400
Subject: [PATCH] parisc: Remove unnecessary barriers from spinlock.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Now that mb() is an instruction barrier, it will slow performance if we issue
unnecessary barriers.
The spinlock defines have a number of unnecessary barriers. The __ldcw()
define is both a hardware and compiler barrier. The mb() barriers in the
routines using __ldcw() serve no purpose.
The only barrier needed is the one in arch_spin_unlock(). We need to ensure
all accesses are complete prior to releasing the lock.
Signed-off-by: John David Anglin <dave.anglin(a)bell.net>
Cc: stable(a)vger.kernel.org # 4.0+
Signed-off-by: Helge Deller <deller(a)gmx.de>
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h
index 6f84b6acc86e..8a63515f03bf 100644
--- a/arch/parisc/include/asm/spinlock.h
+++ b/arch/parisc/include/asm/spinlock.h
@@ -20,7 +20,6 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
{
volatile unsigned int *a;
- mb();
a = __ldcw_align(x);
while (__ldcw(a) == 0)
while (*a == 0)
@@ -30,17 +29,16 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
local_irq_disable();
} else
cpu_relax();
- mb();
}
#define arch_spin_lock_flags arch_spin_lock_flags
static inline void arch_spin_unlock(arch_spinlock_t *x)
{
volatile unsigned int *a;
- mb();
+
a = __ldcw_align(x);
- *a = 1;
mb();
+ *a = 1;
}
static inline int arch_spin_trylock(arch_spinlock_t *x)
@@ -48,10 +46,8 @@ static inline int arch_spin_trylock(arch_spinlock_t *x)
volatile unsigned int *a;
int ret;
- mb();
a = __ldcw_align(x);
ret = __ldcw(a) != 0;
- mb();
return ret;
}
Use the new of_get_compatible_child() helper to lookup the nfc child
node instead of using of_find_compatible_node(), which searches the
entire tree 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 parent node).
Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver")
Fixes: d8e018c0b321 ("NFC: nfcmrvl: update device tree bindings for Marvell NFC")
Cc: stable <stable(a)vger.kernel.org> # 4.2
Cc: Vincent Cuissard <cuissard(a)marvell.com>
Cc: Samuel Ortiz <sameo(a)linux.intel.com>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/nfc/nfcmrvl/uart.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/nfc/nfcmrvl/uart.c b/drivers/nfc/nfcmrvl/uart.c
index 91162f8e0366..9a22056e8d9e 100644
--- a/drivers/nfc/nfcmrvl/uart.c
+++ b/drivers/nfc/nfcmrvl/uart.c
@@ -73,10 +73,9 @@ static int nfcmrvl_uart_parse_dt(struct device_node *node,
struct device_node *matched_node;
int ret;
- matched_node = of_find_compatible_node(node, NULL, "marvell,nfc-uart");
+ matched_node = of_get_compatible_child(node, "marvell,nfc-uart");
if (!matched_node) {
- matched_node = of_find_compatible_node(node, NULL,
- "mrvl,nfc-uart");
+ matched_node = of_get_compatible_child(node, "mrvl,nfc-uart");
if (!matched_node)
return -ENODEV;
}
--
2.18.0
Use the new of_get_compatible_child() helper to lookup the mdio child
node instead of using of_find_compatible_node(), which searches the
entire tree 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).
Fixes: aa09677cba42 ("net: bcmgenet: add MDIO routines")
Cc: stable <stable(a)vger.kernel.org> # 3.15
Cc: Florian Fainelli <f.fainelli(a)gmail.com>
Cc: David S. Miller <davem(a)davemloft.net>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 5333274a283c..87fc65560ceb 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -333,7 +333,7 @@ static struct device_node *bcmgenet_mii_of_find_mdio(struct bcmgenet_priv *priv)
if (!compat)
return NULL;
- priv->mdio_dn = of_find_compatible_node(dn, NULL, compat);
+ priv->mdio_dn = of_get_compatible_child(dn, compat);
kfree(compat);
if (!priv->mdio_dn) {
dev_err(kdev, "unable to find MDIO bus node\n");
--
2.18.0
Use the new of_get_compatible_child() helper to lookup the nfc child
node instead of using of_find_compatible_node(), which searches the
entire tree 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 a related nfc-node reference leak.
Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: stable <stable(a)vger.kernel.org> # 4.11
Cc: Nicolas Ferre <nicolas.ferre(a)microchip.com>
Cc: Josh Wu <rainyfeeling(a)outlook.com>
Cc: Boris Brezillon <boris.brezillon(a)bootlin.com>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/mtd/nand/raw/atmel/nand-controller.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index a068b214ebaa..d3dfe63956ac 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -2061,8 +2061,7 @@ atmel_hsmc_nand_controller_legacy_init(struct atmel_hsmc_nand_controller *nc)
int ret;
nand_np = dev->of_node;
- nfc_np = of_find_compatible_node(dev->of_node, NULL,
- "atmel,sama5d3-nfc");
+ nfc_np = of_get_compatible_child(dev->of_node, "atmel,sama5d3-nfc");
nc->clk = of_clk_get(nfc_np, 0);
if (IS_ERR(nc->clk)) {
@@ -2472,15 +2471,19 @@ static int atmel_nand_controller_probe(struct platform_device *pdev)
}
if (caps->legacy_of_bindings) {
+ struct device_node *nfc_node;
u32 ale_offs = 21;
/*
* If we are parsing legacy DT props and the DT contains a
* valid NFC node, forward the request to the sama5 logic.
*/
- if (of_find_compatible_node(pdev->dev.of_node, NULL,
- "atmel,sama5d3-nfc"))
+ nfc_node = of_get_compatible_child(pdev->dev.of_node,
+ "atmel,sama5d3-nfc");
+ if (nfc_node) {
caps = &atmel_sama5_nand_caps;
+ of_node_put(nfc_node);
+ }
/*
* Even if the compatible says we are dealing with an
--
2.18.0
Use the new of_get_compatible_child() helper to lookup the sibling
instead of using of_find_compatible_node(), which searches the entire
tree and thus can return an unrelated (i.e. non-sibling) 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 parent device node).
While at it, also fix the related cec-node reference leak.
Fixes: 8f83f26891e1 ("drm/mediatek: Add HDMI support")
Cc: stable <stable(a)vger.kernel.org> # 4.8
Cc: Jie Qiu <jie.qiu(a)mediatek.com>
Cc: Junzhi Zhao <junzhi.zhao(a)mediatek.com>
Cc: Philipp Zabel <p.zabel(a)pengutronix.de>
Cc: CK Hu <ck.hu(a)mediatek.com>
Cc: David Airlie <airlied(a)linux.ie>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/gpu/drm/mediatek/mtk_hdmi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 2d45d1dd9554..643f5edd68fe 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -1446,8 +1446,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
}
/* The CEC module handles HDMI hotplug detection */
- cec_np = of_find_compatible_node(np->parent, NULL,
- "mediatek,mt8173-cec");
+ cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec");
if (!cec_np) {
dev_err(dev, "Failed to find CEC node\n");
return -EINVAL;
@@ -1457,8 +1456,10 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
if (!cec_pdev) {
dev_err(hdmi->dev, "Waiting for CEC device %pOF\n",
cec_np);
+ of_node_put(cec_np);
return -EPROBE_DEFER;
}
+ of_node_put(cec_np);
hdmi->cec_dev = &cec_pdev->dev;
/*
--
2.18.0
Do you have needs for mobile apps design? We are the one who can help you.
We are an India based software company.
What we focus is mobile apps development.
We have 125 staffs in office and have created over 350 apps so far.
We work on many different platforms, such as iOS, Android and others.
Please reply if interested, we will send you our portfolios.
Thanks,
Ray Charles
Do you have needs for mobile apps design? We are the one who can help you.
We are an India based software company.
What we focus is mobile apps development.
We have 125 staffs in office and have created over 350 apps so far.
We work on many different platforms, such as iOS, Android and others.
Please reply if interested, we will send you our portfolios.
Thanks,
Ray Charles
Do you have needs for mobile apps design? We are the one who can help you.
We are an India based software company.
What we focus is mobile apps development.
We have 125 staffs in office and have created over 350 apps so far.
We work on many different platforms, such as iOS, Android and others.
Please reply if interested, we will send you our portfolios.
Thanks,
Ray Charles
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>
Suggested-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 | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 990770d..6184fa1 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -328,10 +328,26 @@ EXPORT_SYMBOL_GPL(spi_mem_exec_op);
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
The patch below does not apply to the 4.17-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 c40a56a7818cfe735fc93a69e1875f8bba834483 Mon Sep 17 00:00:00 2001
From: Dave Hansen <dave.hansen(a)linux.intel.com>
Date: Thu, 2 Aug 2018 15:58:31 -0700
Subject: [PATCH] x86/mm/init: Remove freed kernel image areas from alias
mapping
The kernel image is mapped into two places in the virtual address space
(addresses without KASLR, of course):
1. The kernel direct map (0xffff880000000000)
2. The "high kernel map" (0xffffffff81000000)
We actually execute out of #2. If we get the address of a kernel symbol,
it points to #2, but almost all physical-to-virtual translations point to
Parts of the "high kernel map" alias are mapped in the userspace page
tables with the Global bit for performance reasons. The parts that we map
to userspace do not (er, should not) have secrets. When PTI is enabled then
the global bit is usually not set in the high mapping and just used to
compensate for poor performance on systems which lack PCID.
This is fine, except that some areas in the kernel image that are adjacent
to the non-secret-containing areas are unused holes. We free these holes
back into the normal page allocator and reuse them as normal kernel memory.
The memory will, of course, get *used* via the normal map, but the alias
mapping is kept.
This otherwise unused alias mapping of the holes will, by default keep the
Global bit, be mapped out to userspace, and be vulnerable to Meltdown.
Remove the alias mapping of these pages entirely. This is likely to
fracture the 2M page mapping the kernel image near these areas, but this
should affect a minority of the area.
The pageattr code changes *all* aliases mapping the physical pages that it
operates on (by default). We only want to modify a single alias, so we
need to tweak its behavior.
This unmapping behavior is currently dependent on PTI being in place.
Going forward, we should at least consider doing this for all
configurations. Having an extra read-write alias for memory is not exactly
ideal for debugging things like random memory corruption and this does
undercut features like DEBUG_PAGEALLOC or future work like eXclusive Page
Frame Ownership (XPFO).
Before this patch:
current_kernel:---[ High Kernel Mapping ]---
current_kernel-0xffffffff80000000-0xffffffff81000000 16M pmd
current_kernel-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd
current_kernel-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte
current_kernel-0xffffffff81e11000-0xffffffff82000000 1980K RW NX pte
current_kernel-0xffffffff82000000-0xffffffff82600000 6M ro PSE GLB NX pmd
current_kernel-0xffffffff82600000-0xffffffff82c00000 6M RW PSE NX pmd
current_kernel-0xffffffff82c00000-0xffffffff82e00000 2M RW NX pte
current_kernel-0xffffffff82e00000-0xffffffff83200000 4M RW PSE NX pmd
current_kernel-0xffffffff83200000-0xffffffffa0000000 462M pmd
current_user:---[ High Kernel Mapping ]---
current_user-0xffffffff80000000-0xffffffff81000000 16M pmd
current_user-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd
current_user-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte
current_user-0xffffffff81e11000-0xffffffff82000000 1980K RW NX pte
current_user-0xffffffff82000000-0xffffffff82600000 6M ro PSE GLB NX pmd
current_user-0xffffffff82600000-0xffffffffa0000000 474M pmd
After this patch:
current_kernel:---[ High Kernel Mapping ]---
current_kernel-0xffffffff80000000-0xffffffff81000000 16M pmd
current_kernel-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd
current_kernel-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte
current_kernel-0xffffffff81e11000-0xffffffff82000000 1980K pte
current_kernel-0xffffffff82000000-0xffffffff82400000 4M ro PSE GLB NX pmd
current_kernel-0xffffffff82400000-0xffffffff82488000 544K ro NX pte
current_kernel-0xffffffff82488000-0xffffffff82600000 1504K pte
current_kernel-0xffffffff82600000-0xffffffff82c00000 6M RW PSE NX pmd
current_kernel-0xffffffff82c00000-0xffffffff82c0d000 52K RW NX pte
current_kernel-0xffffffff82c0d000-0xffffffff82dc0000 1740K pte
current_user:---[ High Kernel Mapping ]---
current_user-0xffffffff80000000-0xffffffff81000000 16M pmd
current_user-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd
current_user-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte
current_user-0xffffffff81e11000-0xffffffff82000000 1980K pte
current_user-0xffffffff82000000-0xffffffff82400000 4M ro PSE GLB NX pmd
current_user-0xffffffff82400000-0xffffffff82488000 544K ro NX pte
current_user-0xffffffff82488000-0xffffffff82600000 1504K pte
current_user-0xffffffff82600000-0xffffffffa0000000 474M pmd
[ tglx: Do not unmap on 32bit as there is only one mapping ]
Fixes: 0f561fce4d69 ("x86/pti: Enable global pages for shared areas")
Signed-off-by: Dave Hansen <dave.hansen(a)linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Kees Cook <keescook(a)google.com>
Cc: Andrea Arcangeli <aarcange(a)redhat.com>
Cc: Juergen Gross <jgross(a)suse.com>
Cc: Josh Poimboeuf <jpoimboe(a)redhat.com>
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Hugh Dickins <hughd(a)google.com>
Cc: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: Borislav Petkov <bp(a)alien8.de>
Cc: Andy Lutomirski <luto(a)kernel.org>
Cc: Andi Kleen <ak(a)linux.intel.com>
Cc: Joerg Roedel <jroedel(a)suse.de>
Link: https://lkml.kernel.org/r/20180802225831.5F6A2BFC@viggo.jf.intel.com
diff --git a/arch/x86/include/asm/set_memory.h b/arch/x86/include/asm/set_memory.h
index bd090367236c..34cffcef7375 100644
--- a/arch/x86/include/asm/set_memory.h
+++ b/arch/x86/include/asm/set_memory.h
@@ -46,6 +46,7 @@ int set_memory_np(unsigned long addr, int numpages);
int set_memory_4k(unsigned long addr, int numpages);
int set_memory_encrypted(unsigned long addr, int numpages);
int set_memory_decrypted(unsigned long addr, int numpages);
+int set_memory_np_noalias(unsigned long addr, int numpages);
int set_memory_array_uc(unsigned long *addr, int addrinarray);
int set_memory_array_wc(unsigned long *addr, int addrinarray);
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index bc11dedffc45..74b157ac078d 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -780,8 +780,30 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
*/
void free_kernel_image_pages(void *begin, void *end)
{
- free_init_pages("unused kernel image",
- (unsigned long)begin, (unsigned long)end);
+ unsigned long begin_ul = (unsigned long)begin;
+ unsigned long end_ul = (unsigned long)end;
+ unsigned long len_pages = (end_ul - begin_ul) >> PAGE_SHIFT;
+
+
+ free_init_pages("unused kernel image", begin_ul, end_ul);
+
+ /*
+ * PTI maps some of the kernel into userspace. For performance,
+ * this includes some kernel areas that do not contain secrets.
+ * Those areas might be adjacent to the parts of the kernel image
+ * being freed, which may contain secrets. Remove the "high kernel
+ * image mapping" for these freed areas, ensuring they are not even
+ * potentially vulnerable to Meltdown regardless of the specific
+ * optimizations PTI is currently using.
+ *
+ * The "noalias" prevents unmapping the direct map alias which is
+ * needed to access the freed pages.
+ *
+ * This is only valid for 64bit kernels. 32bit has only one mapping
+ * which can't be treated in this way for obvious reasons.
+ */
+ if (IS_ENABLED(CONFIG_X86_64) && cpu_feature_enabled(X86_FEATURE_PTI))
+ set_memory_np_noalias(begin_ul, len_pages);
}
void __ref free_initmem(void)
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index c04153796f61..0a74996a1149 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -53,6 +53,7 @@ static DEFINE_SPINLOCK(cpa_lock);
#define CPA_FLUSHTLB 1
#define CPA_ARRAY 2
#define CPA_PAGES_ARRAY 4
+#define CPA_NO_CHECK_ALIAS 8 /* Do not search for aliases */
#ifdef CONFIG_PROC_FS
static unsigned long direct_pages_count[PG_LEVEL_NUM];
@@ -1486,6 +1487,9 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
/* No alias checking for _NX bit modifications */
checkalias = (pgprot_val(mask_set) | pgprot_val(mask_clr)) != _PAGE_NX;
+ /* Has caller explicitly disabled alias checking? */
+ if (in_flag & CPA_NO_CHECK_ALIAS)
+ checkalias = 0;
ret = __change_page_attr_set_clr(&cpa, checkalias);
@@ -1772,6 +1776,15 @@ int set_memory_np(unsigned long addr, int numpages)
return change_page_attr_clear(&addr, numpages, __pgprot(_PAGE_PRESENT), 0);
}
+int set_memory_np_noalias(unsigned long addr, int numpages)
+{
+ int cpa_flags = CPA_NO_CHECK_ALIAS;
+
+ return change_page_attr_set_clr(&addr, numpages, __pgprot(0),
+ __pgprot(_PAGE_PRESENT), 0,
+ cpa_flags, NULL);
+}
+
int set_memory_4k(unsigned long addr, int numpages)
{
return change_page_attr_set_clr(&addr, numpages, __pgprot(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>
Suggested-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 | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 990770d..6184fa1 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -328,10 +328,26 @@ EXPORT_SYMBOL_GPL(spi_mem_exec_op);
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
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.116 for ARCH=arm/arm64.
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
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 | 7 +------
net/sched/sch_netem.c | 4 ++--
net/sched/sch_tbf.c | 5 +++--
5 files changed, 12 insertions(+), 12 deletions(-)
--
2.7.4
commit b3681dd548d06deb2e1573890829dff4b15abf46 upstream.
This version applies to v4.9.
>From Andy Lutomirski, original author:
error_entry and error_exit communicate the user vs kernel status of
the frame using %ebx. This is unnecessary -- the information is in
regs->cs. Just use regs->cs.
This makes error_entry simpler and makes error_exit more robust.
It also fixes a nasty bug. Before all the Spectre nonsense, The
xen_failsafe_callback entry point returned like this:
ALLOC_PT_GPREGS_ON_STACK
SAVE_C_REGS
SAVE_EXTRA_REGS
ENCODE_FRAME_POINTER
jmp error_exit
And it did not go through error_entry. This was bogus: RBX
contained garbage, and error_exit expected a flag in RBX.
Fortunately, it generally contained *nonzero* garbage, so the
correct code path was used. As part of the Spectre fixes, code was
added to clear RBX to mitigate certain speculation attacks. Now,
depending on kernel configuration, RBX got zeroed and, when running
some Wine workloads, the kernel crashes. This was introduced by:
commit 3ac6d8c787b8 ("x86/entry/64: Clear registers for
exceptions/interrupts, to reduce speculation attack surface")
With this patch applied, RBX is no longer needed as a flag, and the
problem goes away.
I suspect that malicious userspace could use this bug to crash the
kernel even without the offending patch applied, though.
[Historical note: I wrote this patch as a cleanup before I was aware
of the bug it fixed.]
[Note to stable maintainers: this should probably get applied to all
kernels.]
Cc: Brian Gerst <brgerst(a)gmail.com>
Cc: Borislav Petkov <bp(a)alien8.de>
Cc: Dominik Brodowski <linux(a)dominikbrodowski.net>
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: "H. Peter Anvin" <hpa(a)zytor.com>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Boris Ostrovsky <boris.ostrovsky(a)oracle.com>
Cc: Juergen Gross <jgross(a)suse.com>
Cc: xen-devel(a)lists.xenproject.org
Cc: x86(a)kernel.org
Cc: stable(a)vger.kernel.org
Cc: Andy Lutomirski <luto(a)kernel.org>
Fixes: 3ac6d8c787b8 ("x86/entry/64: Clear registers for exceptions/interrupts, to reduce speculation attack surface")
Reported-and-tested-by: "M. Vefa Bicakci" <m.v.b(a)runbox.com>
Signed-off-by: Andy Lutomirski <luto(a)kernel.org>
Signed-off-by: Sarah Newman <srn(a)prgmr.com>
---
arch/x86/entry/entry_64.S | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index d58d8dc..76c1d85e 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -774,7 +774,7 @@ ENTRY(\sym)
call \do_sym
- jmp error_exit /* %ebx: no swapgs flag */
+ jmp error_exit
.endif
END(\sym)
.endm
@@ -1043,7 +1043,6 @@ END(paranoid_exit)
/*
* Save all registers in pt_regs, and switch gs if needed.
- * Return: EBX=0: came from user mode; EBX=1: otherwise
*/
ENTRY(error_entry)
cld
@@ -1056,7 +1055,6 @@ ENTRY(error_entry)
* the kernel CR3 here.
*/
SWITCH_KERNEL_CR3
- xorl %ebx, %ebx
testb $3, CS+8(%rsp)
jz .Lerror_kernelspace
@@ -1087,7 +1085,6 @@ ENTRY(error_entry)
* for these here too.
*/
.Lerror_kernelspace:
- incl %ebx
leaq native_irq_return_iret(%rip), %rcx
cmpq %rcx, RIP+8(%rsp)
je .Lerror_bad_iret
@@ -1119,28 +1116,19 @@ ENTRY(error_entry)
/*
* Pretend that the exception came from user mode: set up pt_regs
- * as if we faulted immediately after IRET and clear EBX so that
- * error_exit knows that we will be returning to user mode.
+ * as if we faulted immediately after IRET.
*/
mov %rsp, %rdi
call fixup_bad_iret
mov %rax, %rsp
- decl %ebx
jmp .Lerror_entry_from_usermode_after_swapgs
END(error_entry)
-
-/*
- * On entry, EBX is a "return to kernel mode" flag:
- * 1: already in kernel mode, don't need SWAPGS
- * 0: user gsbase is loaded, we need SWAPGS and standard preparation for return to usermode
- */
ENTRY(error_exit)
- movl %ebx, %eax
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
- testl %eax, %eax
- jnz retint_kernel
+ testb $3, CS(%rsp)
+ jz retint_kernel
jmp retint_user
END(error_exit)
--
1.9.1
From: Jann Horn <jannh(a)google.com>
Subject: reiserfs: fix broken xattr handling (heap corruption, bad retval)
This fixes the following issues:
- When a buffer size is supplied to reiserfs_listxattr() such that each
individual name fits, but the concatenation of all names doesn't fit,
reiserfs_listxattr() overflows the supplied buffer. This leads to a
kernel heap overflow (verified using KASAN) followed by an out-of-bounds
usercopy and is therefore a security bug.
- When a buffer size is supplied to reiserfs_listxattr() such that a
name doesn't fit, -ERANGE should be returned. But reiserfs instead just
truncates the list of names; I have verified that if the only xattr on a
file has a longer name than the supplied buffer length, listxattr()
incorrectly returns zero.
With my patch applied, -ERANGE is returned in both cases and the memory
corruption doesn't happen anymore.
Credit for making me clean this code up a bit goes to Al Viro, who pointed
out that the ->actor calling convention is suboptimal and should be
changed.
Link: http://lkml.kernel.org/r/20180802151539.5373-1-jannh@google.com
Fixes: 48b32a3553a5 ("reiserfs: use generic xattr handlers")
Signed-off-by: Jann Horn <jannh(a)google.com>
Acked-by: Jeff Mahoney <jeffm(a)suse.com>
Cc: Eric Biggers <ebiggers(a)google.com>
Cc: Al Viro <viro(a)zeniv.linux.org.uk>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
fs/reiserfs/xattr.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/reiserfs/xattr.c~reiserfs-fix-broken-xattr-handling-heap-corruption-bad-retval
+++ a/fs/reiserfs/xattr.c
@@ -792,8 +792,10 @@ static int listxattr_filler(struct dir_c
return 0;
size = namelen + 1;
if (b->buf) {
- if (size > b->size)
+ if (b->pos + size > b->size) {
+ b->pos = -ERANGE;
return -ERANGE;
+ }
memcpy(b->buf + b->pos, name, namelen);
b->buf[b->pos + namelen] = 0;
}
_
From: Peter Kalauskas <peskal(a)google.com>
Subject: drivers/block/zram/zram_drv.c: fix bug storing backing_dev
The call to strlcpy in backing_dev_store is incorrect. It should take
the size of the destination buffer instead of the size of the source
buffer. Additionally, ignore the newline character (\n) when reading
the new file_name buffer. This makes it possible to set the backing_dev
as follows:
echo /dev/sdX > /sys/block/zram0/backing_dev
The reason it worked before was the fact that strlcpy() copies 'len - 1'
bytes, which is strlen(buf) - 1 in our case, so it accidentally didn't
copy the trailing new line symbol. Which also means that "echo -n
/dev/sdX" most likely was broken.
Signed-off-by: Peter Kalauskas <peskal(a)google.com>
Link: http://lkml.kernel.org/r/20180813061623.GC64836@rodete-desktop-imager.corp.…
Acked-by: Minchan Kim <minchan(a)kernel.org>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
Cc: <stable(a)vger.kernel.org> [4.14+]
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
drivers/block/zram/zram_drv.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/block/zram/zram_drv.c~zram-fix-bug-storing-backing_dev
+++ a/drivers/block/zram/zram_drv.c
@@ -337,6 +337,7 @@ static ssize_t backing_dev_store(struct
struct device_attribute *attr, const char *buf, size_t len)
{
char *file_name;
+ size_t sz;
struct file *backing_dev = NULL;
struct inode *inode;
struct address_space *mapping;
@@ -357,7 +358,11 @@ static ssize_t backing_dev_store(struct
goto out;
}
- strlcpy(file_name, buf, len);
+ strlcpy(file_name, buf, PATH_MAX);
+ /* ignore trailing newline */
+ sz = strlen(file_name);
+ if (sz > 0 && file_name[sz - 1] == '\n')
+ file_name[sz - 1] = 0x00;
backing_dev = filp_open(file_name, O_RDWR|O_LARGEFILE, 0);
if (IS_ERR(backing_dev)) {
_
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>
Suggested-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
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 | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 990770d..6184fa1 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -328,10 +328,26 @@ EXPORT_SYMBOL_GPL(spi_mem_exec_op);
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.4.151 release.
There are 22 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 23 05:51:31 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.151-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.151-rc1
Kees Cook <keescook(a)chromium.org>
isdn: Disable IIOCDBGVAR
Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Bluetooth: avoid killing an already killed socket
Tom Lendacky <thomas.lendacky(a)amd.com>
x86/mm: Simplify p[g4um]d_page() macros
Chen Hu <hu1.chen(a)intel.com>
serial: 8250_dw: always set baud rate in dw8250_set_termios
Willy Tarreau <w(a)1wt.eu>
ACPI / PM: save NVS memory for ASUS 1025C laptop
Zhang Rui <rui.zhang(a)intel.com>
ACPI: save NVS memory for Lenovo G50-45
Aleksander Morgado <aleksander(a)aleksander.es>
USB: option: add support for DW5821e
John Ogness <john.ogness(a)linutronix.de>
USB: serial: sierra: fix potential deadlock at close
Takashi Iwai <tiwai(a)suse.de>
ALSA: vxpocket: Fix invalid endian conversions
Takashi Iwai <tiwai(a)suse.de>
ALSA: memalloc: Don't exceed over the requested size
Hans de Goede <hdegoede(a)redhat.com>
ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry
Takashi Iwai <tiwai(a)suse.de>
ALSA: cs5535audio: Fix invalid endian conversion
Takashi Iwai <tiwai(a)suse.de>
ALSA: virmidi: Fix too long output trigger loop
Takashi Iwai <tiwai(a)suse.de>
ALSA: vx222: Fix invalid endian conversions
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Turn CX8200 into D3 as well upon reboot
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: fix NULL pointer dereference when delete tcindex filter
Cong Wang <xiyou.wangcong(a)gmail.com>
vsock: split dwork to avoid reinitializations
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: Fix missing res info when create new tc_index filter
Cong Wang <xiyou.wangcong(a)gmail.com>
llc: use refcount_inc_not_zero() for llc_sap_find()
Wei Wang <weiwan(a)google.com>
l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache
Alexey Kodanev <alexey.kodanev(a)oracle.com>
dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart()
-------------
Diffstat:
Makefile | 4 ++--
arch/x86/include/asm/pgtable.h | 13 ++++++++-----
drivers/acpi/sleep.c | 27 +++++++++++++++++++++++++++
drivers/isdn/i4l/isdn_common.c | 8 +-------
drivers/tty/serial/8250/8250_dw.c | 2 +-
drivers/usb/serial/option.c | 4 ++++
drivers/usb/serial/sierra.c | 4 ++--
include/net/af_vsock.h | 4 ++--
include/net/llc.h | 5 +++++
net/bluetooth/sco.c | 3 ++-
net/dccp/ccids/ccid2.c | 6 ++++--
net/l2tp/l2tp_core.c | 2 +-
net/llc/llc_core.c | 4 ++--
net/sched/cls_tcindex.c | 8 +++-----
net/vmw_vsock/af_vsock.c | 15 ++++++++-------
net/vmw_vsock/vmci_transport.c | 3 +--
sound/core/memalloc.c | 8 ++------
sound/core/seq/seq_virmidi.c | 10 ++++++++++
sound/pci/cs5535audio/cs5535audio.h | 6 +++---
sound/pci/cs5535audio/cs5535audio_pcm.c | 4 ++--
sound/pci/hda/hda_intel.c | 2 +-
sound/pci/hda/patch_conexant.c | 4 +++-
sound/pci/vx222/vx222_ops.c | 8 ++++----
sound/pcmcia/vx/vxp_ops.c | 10 +++++-----
24 files changed, 103 insertions(+), 61 deletions(-)
This is the start of the stable review cycle for the 4.9.123 release.
There are 25 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 23 05:51:15 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.123-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.123-rc1
Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Bluetooth: avoid killing an already killed socket
Tom Lendacky <thomas.lendacky(a)amd.com>
x86/mm: Simplify p[g4um]d_page() macros
Srinath Mannam <srinath.mannam(a)broadcom.com>
serial: 8250_dw: Add ACPI support for uart on Broadcom SoC
Chen Hu <hu1.chen(a)intel.com>
serial: 8250_dw: always set baud rate in dw8250_set_termios
Mark <dmarkh(a)cfl.rr.com>
tty: serial: 8250: Revert NXP SC16C2552 workaround
Willy Tarreau <w(a)1wt.eu>
ACPI / PM: save NVS memory for ASUS 1025C laptop
Aleksander Morgado <aleksander(a)aleksander.es>
USB: option: add support for DW5821e
John Ogness <john.ogness(a)linutronix.de>
USB: serial: sierra: fix potential deadlock at close
Hangbin Liu <liuhangbin(a)gmail.com>
cls_matchall: fix tcf_unbind_filter missing
Kees Cook <keescook(a)chromium.org>
isdn: Disable IIOCDBGVAR
Takashi Iwai <tiwai(a)suse.de>
ALSA: vxpocket: Fix invalid endian conversions
Takashi Iwai <tiwai(a)suse.de>
ALSA: memalloc: Don't exceed over the requested size
Hans de Goede <hdegoede(a)redhat.com>
ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry
Takashi Iwai <tiwai(a)suse.de>
ALSA: cs5535audio: Fix invalid endian conversion
Takashi Iwai <tiwai(a)suse.de>
ALSA: virmidi: Fix too long output trigger loop
Takashi Iwai <tiwai(a)suse.de>
ALSA: vx222: Fix invalid endian conversions
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Turn CX8200 into D3 as well upon reboot
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: fix NULL pointer dereference when delete tcindex filter
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: Fix missing res info when create new tc_index filter
Xin Long <lucien.xin(a)gmail.com>
ip6_tunnel: use the right value for ipv4 min mtu check in ip6_tnl_xmit
Cong Wang <xiyou.wangcong(a)gmail.com>
vsock: split dwork to avoid reinitializations
Cong Wang <xiyou.wangcong(a)gmail.com>
llc: use refcount_inc_not_zero() for llc_sap_find()
Wei Wang <weiwan(a)google.com>
l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache
Alexey Kodanev <alexey.kodanev(a)oracle.com>
dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart()
-------------
Diffstat:
Makefile | 4 ++--
arch/x86/include/asm/pgtable.h | 13 ++++++++-----
drivers/acpi/sleep.c | 8 ++++++++
drivers/isdn/i4l/isdn_common.c | 8 +-------
drivers/tty/serial/8250/8250_dw.c | 3 ++-
drivers/tty/serial/8250/8250_port.c | 3 +--
drivers/usb/serial/option.c | 4 ++++
drivers/usb/serial/sierra.c | 4 ++--
include/net/af_vsock.h | 4 ++--
include/net/llc.h | 5 +++++
net/bluetooth/sco.c | 3 ++-
net/dccp/ccids/ccid2.c | 6 ++++--
net/ipv6/ip6_tunnel.c | 8 ++------
net/l2tp/l2tp_core.c | 2 +-
net/llc/llc_core.c | 4 ++--
net/sched/cls_matchall.c | 2 ++
net/sched/cls_tcindex.c | 8 +++-----
net/vmw_vsock/af_vsock.c | 15 ++++++++-------
net/vmw_vsock/vmci_transport.c | 3 +--
sound/core/memalloc.c | 8 ++------
sound/core/seq/seq_virmidi.c | 10 ++++++++++
sound/pci/cs5535audio/cs5535audio.h | 6 +++---
sound/pci/cs5535audio/cs5535audio_pcm.c | 4 ++--
sound/pci/hda/hda_intel.c | 2 +-
sound/pci/hda/patch_conexant.c | 4 +++-
sound/pci/vx222/vx222_ops.c | 8 ++++----
sound/pcmcia/vx/vxp_ops.c | 10 +++++-----
27 files changed, 90 insertions(+), 69 deletions(-)
Userspace can cause the kref to handles to increment
arbitrarily high. Ensure it does not overflow.
Signed-off-by: Daniel Rosenberg <drosen(a)google.com>
---
v2: Fixed patch corruption :(
This patch is against 4.4. It does not apply to master due to a large
rework of ion in 4.12 which removed the affected functions altogther.
4c23cbff073f3b9b ("staging: android: ion: Remove import interface")
It applies from 3.18 to 4.11, although with a trivial conflict resolution
for the later branches.
drivers/staging/android/ion/ion.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 374f840f31a48..47cb163da9a07 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -15,6 +15,7 @@
*
*/
+#include <linux/atomic.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/file.h>
@@ -387,6 +388,16 @@ static void ion_handle_get(struct ion_handle *handle)
kref_get(&handle->ref);
}
+/* Must hold the client lock */
+static struct ion_handle *ion_handle_get_check_overflow(
+ struct ion_handle *handle)
+{
+ if (atomic_read(&handle->ref.refcount) + 1 == 0)
+ return ERR_PTR(-EOVERFLOW);
+ ion_handle_get(handle);
+ return handle;
+}
+
static int ion_handle_put_nolock(struct ion_handle *handle)
{
int ret;
@@ -433,9 +444,9 @@ static struct ion_handle *ion_handle_get_by_id_nolock(struct ion_client *client,
handle = idr_find(&client->idr, id);
if (handle)
- ion_handle_get(handle);
+ return ion_handle_get_check_overflow(handle);
- return handle ? handle : ERR_PTR(-EINVAL);
+ return ERR_PTR(-EINVAL);
}
struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
@@ -1202,7 +1213,7 @@ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd)
/* if a handle exists for this buffer just take a reference to it */
handle = ion_handle_lookup(client, buffer);
if (!IS_ERR(handle)) {
- ion_handle_get(handle);
+ handle = ion_handle_get_check_overflow(handle);
mutex_unlock(&client->lock);
goto end;
}
--
2.18.0.865.gffc8e1a3cd6-goog
This is the start of the stable review cycle for the 4.18.4 release.
There are 35 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 23 05:50:07 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.4-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.4-rc1
Hangbin Liu <liuhangbin(a)gmail.com>
cls_matchall: fix tcf_unbind_filter missing
Jisheng Zhang <Jisheng.Zhang(a)synaptics.com>
net: mvneta: fix mvneta_config_rss on armada 3700
Andrew Lunn <andrew(a)lunn.ch>
net: ethernet: mvneta: Fix napi structure mixup on armada 3700
Haishuang Yan <yanhaishuang(a)cmss.chinamobile.com>
ip_vti: fix a null pointer deferrence when create vti fallback tunnel
Jian-Hong Pan <jian-hong(a)endlessm.com>
r8169: don't use MSI-X on RTL8106e
Takashi Iwai <tiwai(a)suse.de>
hv/netvsc: Fix NULL dereference at single queue mode fallback
Jeremy Cline <jcline(a)redhat.com>
net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd()
Kees Cook <keescook(a)chromium.org>
isdn: Disable IIOCDBGVAR
Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Bluetooth: avoid killing an already killed socket
Xiubo Li <xiubli(a)redhat.com>
Revert "uio: use request_threaded_irq instead"
Johan Hovold <johan(a)kernel.org>
misc: sram: fix resource leaks in probe error path
Hailong Liu <liu.hailong6(a)zte.com.cn>
uio: fix wrong return value from uio_mmap()
Srinath Mannam <srinath.mannam(a)broadcom.com>
serial: 8250_dw: Add ACPI support for uart on Broadcom SoC
Chen Hu <hu1.chen(a)intel.com>
serial: 8250_dw: always set baud rate in dw8250_set_termios
Aaron Sierra <asierra(a)xes-inc.com>
serial: 8250_exar: Read INT0 from slave device, too
Mark <dmarkh(a)cfl.rr.com>
tty: serial: 8250: Revert NXP SC16C2552 workaround
Willy Tarreau <w(a)1wt.eu>
ACPI / PM: save NVS memory for ASUS 1025C laptop
Aleksander Morgado <aleksander(a)aleksander.es>
USB: option: add support for DW5821e
Movie Song <MovieSong(a)aten-itlab.cn>
USB: serial: pl2303: add a new device id for ATEN
John Ogness <john.ogness(a)linutronix.de>
USB: serial: sierra: fix potential deadlock at close
Mika Båtsman <mika.batsman(a)gmail.com>
media: gl861: fix probe of dvb_usb_gl861
Takashi Iwai <tiwai(a)suse.de>
ALSA: seq: Fix poll() error return
Takashi Iwai <tiwai(a)suse.de>
ALSA: vxpocket: Fix invalid endian conversions
Takashi Iwai <tiwai(a)suse.de>
ALSA: memalloc: Don't exceed over the requested size
Hans de Goede <hdegoede(a)redhat.com>
ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry
Takashi Sakamoto <o-takashi(a)sakamocchi.jp>
ALSA: dice: fix wrong copy to rx parameters for Alesis iO26
Takashi Iwai <tiwai(a)suse.de>
ALSA: cs5535audio: Fix invalid endian conversion
Takashi Iwai <tiwai(a)suse.de>
ALSA: virmidi: Fix too long output trigger loop
Takashi Iwai <tiwai(a)suse.de>
ALSA: vx222: Fix invalid endian conversions
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Turn CX8200 into D3 as well upon reboot
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs
Heiner Kallweit <hkallweit1(a)gmail.com>
r8169: don't use MSI-X on RTL8168g
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: Fix missing res info when create new tc_index filter
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: fix NULL pointer dereference when delete tcindex filter
Wei Wang <weiwan(a)google.com>
l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache
-------------
Diffstat:
Makefile | 4 +--
drivers/acpi/sleep.c | 8 +++++
drivers/isdn/i4l/isdn_common.c | 8 +----
drivers/media/usb/dvb-usb-v2/gl861.c | 21 +++++++------
drivers/misc/sram.c | 9 +++++-
drivers/net/ethernet/marvell/mvneta.c | 53 ++++++++++++++++++++-------------
drivers/net/ethernet/realtek/r8169.c | 12 ++++++--
drivers/net/hyperv/rndis_filter.c | 2 +-
drivers/tty/serial/8250/8250_dw.c | 3 +-
drivers/tty/serial/8250/8250_exar.c | 6 +++-
drivers/tty/serial/8250/8250_port.c | 3 +-
drivers/uio/uio.c | 10 ++-----
drivers/usb/serial/option.c | 4 +++
drivers/usb/serial/pl2303.c | 2 ++
drivers/usb/serial/pl2303.h | 1 +
drivers/usb/serial/sierra.c | 4 +--
net/bluetooth/sco.c | 3 +-
net/core/sock_diag.c | 2 ++
net/ipv4/ip_vti.c | 3 +-
net/l2tp/l2tp_core.c | 2 +-
net/sched/cls_matchall.c | 2 ++
net/sched/cls_tcindex.c | 8 ++---
net/socket.c | 3 +-
sound/core/memalloc.c | 8 ++---
sound/core/seq/oss/seq_oss.c | 2 +-
sound/core/seq/seq_clientmgr.c | 2 +-
sound/core/seq/seq_virmidi.c | 10 +++++++
sound/firewire/dice/dice-alesis.c | 2 +-
sound/pci/cs5535audio/cs5535audio.h | 6 ++--
sound/pci/cs5535audio/cs5535audio_pcm.c | 4 +--
sound/pci/hda/hda_intel.c | 2 +-
sound/pci/hda/patch_conexant.c | 4 ++-
sound/pci/vx222/vx222_ops.c | 8 ++---
sound/pcmcia/vx/vxp_ops.c | 10 +++----
34 files changed, 138 insertions(+), 93 deletions(-)
This is the start of the stable review cycle for the 4.14.66 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 Thu Aug 23 05:50: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.14.66-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.66-rc1
Hangbin Liu <liuhangbin(a)gmail.com>
cls_matchall: fix tcf_unbind_filter missing
Kees Cook <keescook(a)chromium.org>
isdn: Disable IIOCDBGVAR
Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Bluetooth: avoid killing an already killed socket
Johan Hovold <johan(a)kernel.org>
misc: sram: fix resource leaks in probe error path
Srinath Mannam <srinath.mannam(a)broadcom.com>
serial: 8250_dw: Add ACPI support for uart on Broadcom SoC
Chen Hu <hu1.chen(a)intel.com>
serial: 8250_dw: always set baud rate in dw8250_set_termios
Aaron Sierra <asierra(a)xes-inc.com>
serial: 8250_exar: Read INT0 from slave device, too
Mark <dmarkh(a)cfl.rr.com>
tty: serial: 8250: Revert NXP SC16C2552 workaround
Willy Tarreau <w(a)1wt.eu>
ACPI / PM: save NVS memory for ASUS 1025C laptop
Aleksander Morgado <aleksander(a)aleksander.es>
USB: option: add support for DW5821e
Movie Song <MovieSong(a)aten-itlab.cn>
USB: serial: pl2303: add a new device id for ATEN
John Ogness <john.ogness(a)linutronix.de>
USB: serial: sierra: fix potential deadlock at close
Takashi Iwai <tiwai(a)suse.de>
ALSA: vxpocket: Fix invalid endian conversions
Takashi Iwai <tiwai(a)suse.de>
ALSA: memalloc: Don't exceed over the requested size
Hans de Goede <hdegoede(a)redhat.com>
ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry
Takashi Iwai <tiwai(a)suse.de>
ALSA: cs5535audio: Fix invalid endian conversion
Takashi Iwai <tiwai(a)suse.de>
ALSA: virmidi: Fix too long output trigger loop
Takashi Iwai <tiwai(a)suse.de>
ALSA: vx222: Fix invalid endian conversions
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Turn CX8200 into D3 as well upon reboot
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs
Dmitry Bogdanov <dmitry.bogdanov(a)aquantia.com>
net: aquantia: Fix IFF_ALLMULTI flag functionality
Xin Long <lucien.xin(a)gmail.com>
ip6_tunnel: use the right value for ipv4 min mtu check in ip6_tnl_xmit
Jason Wang <jasowang(a)redhat.com>
vhost: reset metadata cache when initializing new IOTLB
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: Fix missing res info when create new tc_index filter
Cong Wang <xiyou.wangcong(a)gmail.com>
vsock: split dwork to avoid reinitializations
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: fix NULL pointer dereference when delete tcindex filter
Cong Wang <xiyou.wangcong(a)gmail.com>
llc: use refcount_inc_not_zero() for llc_sap_find()
Wei Wang <weiwan(a)google.com>
l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache
Alexey Kodanev <alexey.kodanev(a)oracle.com>
dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart()
-------------
Diffstat:
Makefile | 4 ++--
drivers/acpi/sleep.c | 8 ++++++++
drivers/isdn/i4l/isdn_common.c | 8 +-------
drivers/misc/sram.c | 9 ++++++++-
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 2 +-
drivers/tty/serial/8250/8250_dw.c | 3 ++-
drivers/tty/serial/8250/8250_exar.c | 6 +++++-
drivers/tty/serial/8250/8250_port.c | 3 +--
drivers/usb/serial/option.c | 4 ++++
drivers/usb/serial/pl2303.c | 2 ++
drivers/usb/serial/pl2303.h | 1 +
drivers/usb/serial/sierra.c | 4 ++--
drivers/vhost/vhost.c | 9 ++++++---
include/net/af_vsock.h | 4 ++--
include/net/llc.h | 5 +++++
net/bluetooth/sco.c | 3 ++-
net/dccp/ccids/ccid2.c | 6 ++++--
net/ipv6/ip6_tunnel.c | 8 ++------
net/l2tp/l2tp_core.c | 2 +-
net/llc/llc_core.c | 4 ++--
net/sched/cls_matchall.c | 2 ++
net/sched/cls_tcindex.c | 8 +++-----
net/vmw_vsock/af_vsock.c | 15 ++++++++-------
net/vmw_vsock/vmci_transport.c | 3 +--
sound/core/memalloc.c | 8 ++------
sound/core/seq/seq_virmidi.c | 10 ++++++++++
sound/pci/cs5535audio/cs5535audio.h | 6 +++---
sound/pci/cs5535audio/cs5535audio_pcm.c | 4 ++--
sound/pci/hda/hda_intel.c | 2 +-
sound/pci/hda/patch_conexant.c | 4 +++-
sound/pci/vx222/vx222_ops.c | 8 ++++----
sound/pcmcia/vx/vxp_ops.c | 10 +++++-----
32 files changed, 105 insertions(+), 70 deletions(-)
This is the start of the stable review cycle for the 4.17.18 release.
There are 42 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 23 05:50:04 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.17.18-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.17.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.17.18-rc1
Jisheng Zhang <Jisheng.Zhang(a)synaptics.com>
net: mvneta: fix mvneta_config_rss on armada 3700
Andrew Lunn <andrew(a)lunn.ch>
net: ethernet: mvneta: Fix napi structure mixup on armada 3700
Hangbin Liu <liuhangbin(a)gmail.com>
cls_matchall: fix tcf_unbind_filter missing
Haishuang Yan <yanhaishuang(a)cmss.chinamobile.com>
ip_vti: fix a null pointer deferrence when create vti fallback tunnel
Jian-Hong Pan <jian-hong(a)endlessm.com>
r8169: don't use MSI-X on RTL8106e
Jeremy Cline <jcline(a)redhat.com>
net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd()
Kees Cook <keescook(a)chromium.org>
isdn: Disable IIOCDBGVAR
Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Bluetooth: avoid killing an already killed socket
Johan Hovold <johan(a)kernel.org>
misc: sram: fix resource leaks in probe error path
Srinath Mannam <srinath.mannam(a)broadcom.com>
serial: 8250_dw: Add ACPI support for uart on Broadcom SoC
Chen Hu <hu1.chen(a)intel.com>
serial: 8250_dw: always set baud rate in dw8250_set_termios
Aaron Sierra <asierra(a)xes-inc.com>
serial: 8250_exar: Read INT0 from slave device, too
Mark <dmarkh(a)cfl.rr.com>
tty: serial: 8250: Revert NXP SC16C2552 workaround
Willy Tarreau <w(a)1wt.eu>
ACPI / PM: save NVS memory for ASUS 1025C laptop
Aleksander Morgado <aleksander(a)aleksander.es>
USB: option: add support for DW5821e
Movie Song <MovieSong(a)aten-itlab.cn>
USB: serial: pl2303: add a new device id for ATEN
John Ogness <john.ogness(a)linutronix.de>
USB: serial: sierra: fix potential deadlock at close
Takashi Iwai <tiwai(a)suse.de>
ALSA: seq: Fix poll() error return
Takashi Iwai <tiwai(a)suse.de>
ALSA: vxpocket: Fix invalid endian conversions
Takashi Iwai <tiwai(a)suse.de>
ALSA: memalloc: Don't exceed over the requested size
Hans de Goede <hdegoede(a)redhat.com>
ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry
Takashi Iwai <tiwai(a)suse.de>
ALSA: cs5535audio: Fix invalid endian conversion
Takashi Iwai <tiwai(a)suse.de>
ALSA: virmidi: Fix too long output trigger loop
Takashi Iwai <tiwai(a)suse.de>
ALSA: vx222: Fix invalid endian conversions
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Turn CX8200 into D3 as well upon reboot
Park Ju Hyung <qkrwngud825(a)gmail.com>
ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs
David Howells <dhowells(a)redhat.com>
rxrpc: Fix the keepalive generator [ver #2]
Heiner Kallweit <hkallweit1(a)gmail.com>
r8169: don't use MSI-X on RTL8168g
Or Gerlitz <ogerlitz(a)mellanox.com>
net/mlx5e: Properly check if hairpin is possible between two functions
Nir Dotan <nird(a)mellanox.com>
mlxsw: core_acl_flex_actions: Remove redundant mirror resource destruction
Nir Dotan <nird(a)mellanox.com>
mlxsw: core_acl_flex_actions: Remove redundant counter destruction
Nir Dotan <nird(a)mellanox.com>
mlxsw: core_acl_flex_actions: Remove redundant resource destruction
Xin Long <lucien.xin(a)gmail.com>
ip6_tunnel: use the right value for ipv4 min mtu check in ip6_tnl_xmit
Dmitry Bogdanov <dmitry.bogdanov(a)aquantia.com>
net: aquantia: Fix IFF_ALLMULTI flag functionality
Nir Dotan <nird(a)mellanox.com>
mlxsw: core_acl_flex_actions: Return error for conflicting actions
Jason Wang <jasowang(a)redhat.com>
vhost: reset metadata cache when initializing new IOTLB
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: Fix missing res info when create new tc_index filter
Cong Wang <xiyou.wangcong(a)gmail.com>
vsock: split dwork to avoid reinitializations
Hangbin Liu <liuhangbin(a)gmail.com>
net_sched: fix NULL pointer dereference when delete tcindex filter
Cong Wang <xiyou.wangcong(a)gmail.com>
llc: use refcount_inc_not_zero() for llc_sap_find()
Wei Wang <weiwan(a)google.com>
l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache
Alexey Kodanev <alexey.kodanev(a)oracle.com>
dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart()
-------------
Diffstat:
Makefile | 4 +-
drivers/acpi/sleep.c | 8 ++
drivers/isdn/i4l/isdn_common.c | 8 +-
drivers/misc/sram.c | 9 +-
.../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 2 +-
drivers/net/ethernet/marvell/mvneta.c | 53 ++++---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 8 +-
.../mellanox/mlxsw/core_acl_flex_actions.c | 51 ++++---
drivers/net/ethernet/realtek/r8169.c | 12 +-
drivers/tty/serial/8250/8250_dw.c | 3 +-
drivers/tty/serial/8250/8250_exar.c | 6 +-
drivers/tty/serial/8250/8250_port.c | 3 +-
drivers/usb/serial/option.c | 4 +
drivers/usb/serial/pl2303.c | 2 +
drivers/usb/serial/pl2303.h | 1 +
drivers/usb/serial/sierra.c | 4 +-
drivers/vhost/vhost.c | 9 +-
include/net/af_vsock.h | 4 +-
include/net/llc.h | 5 +
net/bluetooth/sco.c | 3 +-
net/core/sock_diag.c | 2 +
net/dccp/ccids/ccid2.c | 6 +-
net/ipv4/ip_vti.c | 3 +-
net/ipv6/ip6_tunnel.c | 8 +-
net/l2tp/l2tp_core.c | 2 +-
net/llc/llc_core.c | 4 +-
net/rxrpc/ar-internal.h | 8 +-
net/rxrpc/conn_event.c | 4 +-
net/rxrpc/net_ns.c | 6 +-
net/rxrpc/output.c | 12 +-
net/rxrpc/peer_event.c | 156 ++++++++++++---------
net/rxrpc/peer_object.c | 8 +-
net/rxrpc/rxkad.c | 4 +-
net/sched/cls_matchall.c | 2 +
net/sched/cls_tcindex.c | 8 +-
net/socket.c | 3 +-
net/vmw_vsock/af_vsock.c | 15 +-
net/vmw_vsock/vmci_transport.c | 3 +-
sound/core/memalloc.c | 8 +-
sound/core/seq/oss/seq_oss.c | 2 +-
sound/core/seq/seq_clientmgr.c | 2 +-
sound/core/seq/seq_virmidi.c | 10 ++
sound/pci/cs5535audio/cs5535audio.h | 6 +-
sound/pci/cs5535audio/cs5535audio_pcm.c | 4 +-
sound/pci/hda/hda_intel.c | 2 +-
sound/pci/hda/patch_conexant.c | 4 +-
sound/pci/vx222/vx222_ops.c | 8 +-
sound/pcmcia/vx/vxp_ops.c | 10 +-
48 files changed, 296 insertions(+), 213 deletions(-)
Some versions of GCC suboptimally generate calls to the __multi3()
intrinsic for MIPS64r6 builds, resulting in link failures due to the
missing function:
LD vmlinux.o
MODPOST vmlinux.o
kernel/bpf/verifier.o: In function `kmalloc_array':
include/linux/slab.h:631: undefined reference to `__multi3'
fs/select.o: In function `kmalloc_array':
include/linux/slab.h:631: undefined reference to `__multi3'
...
We already have a workaround for this in which we provide the
instrinsic, but we do so selectively for GCC 7 only. Unfortunately the
issue occurs with older GCC versions too - it has been observed with
both GCC 5.4.0 & GCC 6.4.0.
MIPSr6 support was introduced in GCC 5, so all major GCC versions prior
to GCC 8 are affected and we extend our workaround accordingly to all
MIPS64r6 builds using GCC versions older than GCC 8.
Signed-off-by: Paul Burton <paul.burton(a)mips.com>
Reported-by: Vladimir Kondratiev <vladimir.kondratiev(a)intel.com>
Fixes: ebabcf17bcd7 ("MIPS: Implement __multi3 for GCC7 MIPS64r6 builds")
Cc: James Hogan <jhogan(a)kernel.org>
Cc: Ralf Baechle <ralf(a)linux-mips.org>
Cc: linux-mips(a)linux-mips.org
Cc: stable(a)vger.kernel.org # 4.15+
---
arch/mips/lib/multi3.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/mips/lib/multi3.c b/arch/mips/lib/multi3.c
index 111ad475aa0c..4c2483f410c2 100644
--- a/arch/mips/lib/multi3.c
+++ b/arch/mips/lib/multi3.c
@@ -4,12 +4,12 @@
#include "libgcc.h"
/*
- * GCC 7 suboptimally generates __multi3 calls for mips64r6, so for that
- * specific case only we'll implement it here.
+ * GCC 7 & older can suboptimally generate __multi3 calls for mips64r6, so for
+ * that specific case only we implement that intrinsic here.
*
* See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82981
*/
-#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ == 7)
+#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 8)
/* multiply 64-bit values, low 64-bits returned */
static inline long long notrace dmulu(long long a, long long b)
--
2.18.0
Just like how the P50 will occasionally leave the disp's core channel on
before nouveau starts initializing, it will occasionally do the same
thing with the rest of the dmac channel in addition to the core channel.
Example:
[ 1.604375] nouveau 0000:01:00.0: disp: outp 04:0006:0f81: no heads (0 3 4)
[ 1.604858] nouveau 0000:01:00.0: disp: outp 04:0006:0f81: aux power -> always
[ 1.605354] nouveau 0000:01:00.0: disp: outp 04:0006:0f81: aux power -> demand
[ 1.605815] nouveau 0000:01:00.0: disp: outp 05:0002:0f81: no heads (0 3 2)
[ 1.607289] nouveau 0000:01:00.0: disp: chid 0 mthd 0000 data 00000400 00001000 00000002
[ 1.608818] nouveau 0000:01:00.0: disp: chid 1 mthd 0000 data 00000400 00001000 00000002
[ 1.609500] nouveau 0000:01:00.0: disp: chid 2 mthd 0000 data 00000400 00001000 00000002
Which of course, later causes other parts of the card to start timing
out and failing. Closer inspection shows the same thing happening as
with our core channel; 0x610490 + (ctrl * 0x10) always has the same
unknown 0x000a0000 mask set when the phantom mthd failures start
appearing.
So, implement the same workaround we use for the core disp channel to
the rest of the disp channels.
This along with the previous patch fix random initialization failures
observed with the Thinkpad P50.
Signed-off-by: Lyude Paul <lyude(a)redhat.com>
Cc: Karol Herbst <karolherbst(a)gmail.com>
Cc: stable(a)vger.kernel.org
---
.../drm/nouveau/nvkm/engine/disp/dmacgf119.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c
index edf7dd0d931d..7bc91f260e27 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c
@@ -35,8 +35,8 @@ gf119_disp_dmac_bind(struct nv50_disp_chan *chan,
chan->chid.user << 27 | 0x00000001);
}
-void
-gf119_disp_dmac_fini(struct nv50_disp_chan *chan)
+static bool
+gf119_disp_dmac_deactivate(struct nv50_disp_chan *chan)
{
struct nvkm_subdev *subdev = &chan->disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
@@ -52,7 +52,16 @@ gf119_disp_dmac_fini(struct nv50_disp_chan *chan)
) < 0) {
nvkm_error(subdev, "ch %d fini: %08x\n", user,
nvkm_rd32(device, 0x610490 + (ctrl * 0x10)));
+ return false;
}
+
+ return true;
+}
+
+void
+gf119_disp_dmac_fini(struct nv50_disp_chan *chan)
+{
+ gf119_disp_dmac_deactivate(chan);
}
static int
@@ -63,6 +72,12 @@ gf119_disp_dmac_init(struct nv50_disp_chan *chan)
int ctrl = chan->chid.ctrl;
int user = chan->chid.user;
+ /* shut down the channel if it was left on, probably by the VBIOS */
+ if ((nvkm_rd32(device, 0x610490 + (ctrl * 0x10)) & 0x000a0000) == 0x000a0000 &&
+ WARN_ON(!gf119_disp_dmac_deactivate(chan))) {
+ return -EBUSY;
+ }
+
/* initialise channel for dma command submission */
nvkm_wr32(device, 0x610494 + (ctrl * 0x0010), chan->push);
nvkm_wr32(device, 0x610498 + (ctrl * 0x0010), 0x00010000);
--
2.17.1
bad_mode() handler is called for invalid or undefined
instruction in el1 level or when irq,fiq,sync or error
situation happen in el1 or el0 level.
As per latest code, above abnormal situation may not result in
panic always due to die() call if user mode is determined at
that moment. That will just result in kill of current process
and panic will be avoided which it must not.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=200637
Signed-off-by: Hari Vyas <hari.vyas(a)broadcom.com>
---
arch/arm64/kernel/traps.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index d399d45..716ee73 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -621,7 +621,6 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
handler[reason], smp_processor_id(), esr,
esr_get_class_string(esr));
- die("Oops - bad mode", regs, 0);
local_daif_mask();
panic("bad mode");
}
--
1.9.1
As reported by Dan Carpenter, a malicious USB device could set
port_number to -3 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
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: Boris Brezillon <boris.brezillon(a)bootlin.com>
Signed-off-by: Chuanhua Han <chuanhua.han(a)nxp.com>
---
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 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 990770d..5374606 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -328,10 +328,23 @@ EXPORT_SYMBOL_GPL(spi_mem_exec_op);
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 = 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);
+ }
+
return 0;
}
EXPORT_SYMBOL_GPL(spi_mem_adjust_op_size);
--
2.7.4
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: Boris Brezillon <boris.brezillon(a)bootlin.com>
Signed-off-by: Chuanhua Han <chuanhua.han(a)nxp.com>
---
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 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 990770d..5374606 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -328,10 +328,23 @@ EXPORT_SYMBOL_GPL(spi_mem_exec_op);
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 = 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);
+ }
+
return 0;
}
EXPORT_SYMBOL_GPL(spi_mem_adjust_op_size);
--
2.7.4
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: Boris Brezillon <boris.brezillon(a)bootlin.com>
Signed-off-by: Chuanhua Han <chuanhua.han(a)nxp.com>
---
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 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 990770d..5374606 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -328,10 +328,23 @@ EXPORT_SYMBOL_GPL(spi_mem_exec_op);
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 = 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);
+ }
+
return 0;
}
EXPORT_SYMBOL_GPL(spi_mem_adjust_op_size);
--
2.7.4
Hi Greg,
My build is failing with v4.14.65 + stable queue patches.
It fails with the error:
sound/core/seq/seq_clientmgr.c: In function ‘snd_seq_poll’:
sound/core/seq/seq_clientmgr.c:1100:10: error: ‘EPOLLERR’ undeclared (first use in this function)
return EPOLLERR;
^~~~~~~~
--
Regards
Sudip
Hi Greg,
This was not marked for stable but should be in stable. Please apply to
your queue of 4.14-stable. Actually this should be applied to all stable
trees.
--
Regards
Sudip
There was a report that syzkaller can causes crashes in 4.4 and 4.9
stable with the L1TF patches applied.
In my tests this is fixed with applying the following backport
from mainline too, as suggested by Michael Hocko.
Userspace can cause the kref to handles to increment
arbitrarily high. Ensure it does not overflow.
Signed-off-by: Daniel Rosenberg <drosen(a)google.com>
---
This patch is against 4.4. It does not apply to master due to a large
rework of ion in 4.12 which removed the affected functions altogther.
It applies from 3.18 to 4.11, although with a trivial conflict resolution
for the later branches.
4c23cbff073f3b9b ("staging: android: ion: Remove import interface")
drivers/staging/android/ion/ion.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 374f840f31a48..11f93a6314fdb 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -15,6 +15,7 @@
*
*/
+#include <linux/atomic.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/file.h>
@@ -387,6 +388,15 @@ static void ion_handle_get(struct ion_handle *handle)
kref_get(&handle->ref);
}
+/* Must hold the client lock */
+static struct ion_handle *ion_handle_get_check_overflow(
+ struct ion_handle *handle)
+{
+ if (atomic_read(&handle->ref.refcount) + 1 == 0)
+ return ERR_PTR(-EOVERFLOW);
+ ion_handle_get(handle);
+ return handle;
+}
+
static int ion_handle_put_nolock(struct ion_handle *handle)
{
int ret;
@@ -433,9 +443,9 @@ static struct ion_handle *ion_handle_get_by_id_nolock(struct ion_client *client,
handle = idr_find(&client->idr, id);
if (handle)
- ion_handle_get(handle);
+ return ion_handle_get_check_overflow(handle);
- return handle ? handle : ERR_PTR(-EINVAL);
+ return ERR_PTR(-EINVAL);
}
struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
@@ -1202,7 +1212,7 @@ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd)
/* if a handle exists for this buffer just take a reference to it */
handle = ion_handle_lookup(client, buffer);
if (!IS_ERR(handle)) {
- ion_handle_get(handle);
+ handle = ion_handle_get_check_overflow(handle);
mutex_unlock(&client->lock);
goto end;
}
--
2.18.0.865.gffc8e1a3cd6-goog
Commit 67a3ba25aa95 ("MIPS: Fix incorrect mem=X@Y handling") introduced a new
issue for rt288x where "PHYS_OFFSET" is 0x0 but the calculated "ramstart" is
not. As the prerequisite of custom memory map has been removed, this results
in the full memory range of 0x0 - 0x8000000 to be marked as reserved for this
platform.
This patch adds the originally intended prerequisite again.
Signed-off-by: Tobias Wolf <dev-NTEO(a)vplace.de>
---
arch/mips/kernel/setup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 563188ac6fa2..c3ca55128926 100644
v2: Correctly compare that usermem is not null.
v3: Added/changed position of changelog and fixed sender address.
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -371,6 +371,8 @@ static unsigned long __init bootmap_bytes(unsigned long
pages)
return ALIGN(bytes, sizeof(long));
}
+static int usermem __initdata;
+
static void __init bootmem_init(void)
{
unsigned long reserved_end;
@@ -444,7 +446,7 @@ static void __init bootmem_init(void)
/*
* Reserve any memory between the start of RAM and PHYS_OFFSET
*/
- if (ramstart > PHYS_OFFSET)
+ if (usermem && ramstart > PHYS_OFFSET)
add_memory_region(PHYS_OFFSET, ramstart - PHYS_OFFSET,
BOOT_MEM_RESERVED);
@@ -654,8 +656,6 @@ static void __init bootmem_init(void)
* initialization hook for anything else was introduced.
*/
-static int usermem __initdata;
-
static int __init early_parse_mem(char *p)
{
phys_addr_t start, size;
From: Tom Lendacky <thomas.lendacky(a)amd.com>
[backport of fd7e315988b78 from mainline for stable to fix stable crashes
suggested by Michael Hocko. Should be applied to 4.9 and 4.4.]
Create a pgd_pfn() macro similar to the p[4um]d_pfn() macros and then
use the p[g4um]d_pfn() macros in the p[g4um]d_page() macros instead of
duplicating the code.
Signed-off-by: Tom Lendacky <thomas.lendacky(a)amd.com>
Reviewed-by: Thomas Gleixner <tglx(a)linutronix.de>
Reviewed-by: Borislav Petkov <bp(a)suse.de>
Cc: Alexander Potapenko <glider(a)google.com>
Cc: Andrey Ryabinin <aryabinin(a)virtuozzo.com>
Cc: Andy Lutomirski <luto(a)kernel.org>
Cc: Arnd Bergmann <arnd(a)arndb.de>
Cc: Borislav Petkov <bp(a)alien8.de>
Cc: Brijesh Singh <brijesh.singh(a)amd.com>
Cc: Dave Young <dyoung(a)redhat.com>
Cc: Dmitry Vyukov <dvyukov(a)google.com>
Cc: Jonathan Corbet <corbet(a)lwn.net>
Cc: Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
Cc: Larry Woodman <lwoodman(a)redhat.com>
Cc: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: Matt Fleming <matt(a)codeblueprint.co.uk>
Cc: Michael S. Tsirkin <mst(a)redhat.com>
Cc: Paolo Bonzini <pbonzini(a)redhat.com>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Radim Krčmář <rkrcmar(a)redhat.com>
Cc: Rik van Riel <riel(a)redhat.com>
Cc: Toshimitsu Kani <toshi.kani(a)hpe.com>
Cc: kasan-dev(a)googlegroups.com
Cc: kvm(a)vger.kernel.org
Cc: linux-arch(a)vger.kernel.org
Cc: linux-doc(a)vger.kernel.org
Cc: linux-efi(a)vger.kernel.org
Cc: linux-mm(a)kvack.org
Link: http://lkml.kernel.org/r/e61eb533a6d0aac941db2723d8aa63ef6b882dee.150031921…
[Backported to 4.9 stable by AK, suggested by Michael Hocko]
Signed-off-by: Ingo Molnar <mingo(a)kernel.org>
Signed-off-by: Andi Kleen <ak(a)linux.intel.com>
---
arch/x86/include/asm/pgtable.h | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 4de6c282c02a..68a55273ce0f 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -173,6 +173,11 @@ static inline unsigned long pud_pfn(pud_t pud)
return (pfn & pud_pfn_mask(pud)) >> PAGE_SHIFT;
}
+static inline unsigned long pgd_pfn(pgd_t pgd)
+{
+ return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT;
+}
+
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
static inline int pmd_large(pmd_t pte)
@@ -578,8 +583,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
* Currently stuck as a macro due to indirect forward reference to
* linux/mmzone.h's __section_mem_map_addr() definition:
*/
-#define pmd_page(pmd) \
- pfn_to_page((pmd_val(pmd) & pmd_pfn_mask(pmd)) >> PAGE_SHIFT)
+#define pmd_page(pmd) pfn_to_page(pmd_pfn(pmd))
/*
* the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
@@ -647,8 +651,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
* Currently stuck as a macro due to indirect forward reference to
* linux/mmzone.h's __section_mem_map_addr() definition:
*/
-#define pud_page(pud) \
- pfn_to_page((pud_val(pud) & pud_pfn_mask(pud)) >> PAGE_SHIFT)
+#define pud_page(pud) pfn_to_page(pud_pfn(pud))
/* Find an entry in the second-level page table.. */
static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
@@ -688,7 +691,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
* Currently stuck as a macro due to indirect forward reference to
* linux/mmzone.h's __section_mem_map_addr() definition:
*/
-#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT)
+#define pgd_page(pgd) pfn_to_page(pgd_pfn(pgd))
/* to find an entry in a page-table-directory. */
static inline unsigned long pud_index(unsigned long address)
--
2.17.1
I've been experiencing a rather strange looking bug on the P50 I've got
for work. After a number of reboots, nouveau will fail to initialize the
dedicated GPU on the system at boot properly. Things start off with
this disp mthd failure:
...
[ 2.088505] nouveau 0000:01:00.0: disp: outp 04:0006:0f81: aux power -> demand
[ 2.088516] nouveau 0000:01:00.0: disp: outp 05:0002:0f81: no heads (0 3 2)
[ 2.088620] nouveau 0000:01:00.0: disp: init completed in 329us
[ 2.088957] nouveau 0000:01:00.0: disp: chid 0 mthd 0000 data 00000400 00001000 00000002
the failure ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2.151517] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 2.151517] [drm] Driver supports precise vblank timestamp query.
[ 2.151521] 0088 1 core507d_init
[ 2.151522] f0000000
After the error happens, parts of the card start timing out and
eventually the GR fails to hold it's golden context and starts timing
out:
[ 10.163137] ------------[ cut here ]------------
[ 10.163169] nouveau 0000:01:00.0: timeout
[ 10.163218] WARNING: CPU: 4 PID: 98 at drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c:181 gf119_disp_core_fini+0xe6/0x140 [nouveau]
[ 10.163246] Modules linked in: joydev vfat fat intel_rapl iTCO_wdt x86_pkg_temp_thermal coretemp crc32_pclmul psmouse wmi_bmof i2c_i801 mei_me tpm_tis mei tpm_tis_core tpm thinkpad_acpi pcc_cpufreq ax88179_178a usbnet mii nouveau mxm_wmi i915 ttm i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops crc32c_intel serio_raw xhci_pci drm xhci_hcd i2c_core wmi video
[ 10.163330] CPU: 4 PID: 98 Comm: kworker/4:1 Kdump: loaded Not tainted 4.18.0-rc8Lyude-Test+ #7
[ 10.163349] Hardware name: LENOVO 20EQS64N0B/20EQS64N0B, BIOS N1EET78W (1.51 ) 05/18/2018
[ 10.163370] Workqueue: pm pm_runtime_work
[ 10.163404] RIP: 0010:gf119_disp_core_fini+0xe6/0x140 [nouveau]
[ 10.163418] Code: 5e 41 5f 5d c3 49 8b 7c 24 10 48 8b 5f 50 48 85 db 74 5f e8 1c 5b 0f e1 48 89 da 48 c7 c7 b3 b2 4e a0 48 89 c6 e8 5c bf c8 e0 <0f> 0b 41 8b 47 50 85 c0 74 c6 49 8b 7c 24 78 48 81 c7 90 04 61 00
[ 10.163476] RSP: 0018:ffffc90000a83b00 EFLAGS: 00010286
[ 10.163489] RAX: 0000000000000000 RBX: ffff8808773c6bd0 RCX: 0000000000000006
[ 10.163506] RDX: 0000000000000007 RSI: 0000000000000096 RDI: ffff88089b515570
[ 10.163523] RBP: ffffc90000a83b28 R08: 0000000000000000 R09: 0000000000aaaaaa
[ 10.163539] R10: 0000000000000000 R11: 0000000000000001 R12: ffff8808715b2c00
[ 10.163556] R13: ffff88087779d780 R14: 00000001e68f0200 R15: ffff88086f91b000
[ 10.163573] FS: 0000000000000000(0000) GS:ffff88089b500000(0000) knlGS:0000000000000000
[ 10.163591] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 10.163605] CR2: 00007f3d7953d180 CR3: 000000000200a003 CR4: 00000000003606e0
[ 10.163622] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 10.163639] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 10.163655] Call Trace:
[ 10.163686] nv50_disp_chan_fini+0x23/0x40 [nouveau]
[ 10.163711] nvkm_object_fini+0xbf/0x150 [nouveau]
[ 10.163735] nvkm_object_fini+0x76/0x150 [nouveau]
[ 10.163759] nvkm_object_fini+0x76/0x150 [nouveau]
[ 10.163783] nvkm_object_fini+0x76/0x150 [nouveau]
[ 10.163807] nvkm_object_fini+0x76/0x150 [nouveau]
[ 10.163840] nvkm_client_suspend+0x13/0x20 [nouveau]
[ 10.163864] nvif_client_suspend+0x1d/0x20 [nouveau]
[ 10.163898] nouveau_do_suspend+0x113/0x310 [nouveau]
[ 10.163931] nouveau_pmops_runtime_suspend+0x57/0xe0 [nouveau]
[ 10.163947] ? pci_has_legacy_pm_support+0x70/0x70
[ 10.163960] pci_pm_runtime_suspend+0x6b/0x180
[ 10.163972] ? pci_has_legacy_pm_support+0x70/0x70
[ 10.163985] ? pci_has_legacy_pm_support+0x70/0x70
[ 10.163997] __rpm_callback+0xcc/0x1e0
[ 10.164009] ? __switch_to_asm+0x40/0x70
[ 10.164020] ? pci_has_legacy_pm_support+0x70/0x70
[ 10.164033] rpm_callback+0x24/0x80
[ 10.164043] ? pci_has_legacy_pm_support+0x70/0x70
[ 10.164055] rpm_suspend+0x142/0x600
[ 10.164066] ? __switch_to_asm+0x40/0x70
[ 10.164100] pm_runtime_work+0x79/0x90
[ 10.164112] process_one_work+0x1b2/0x370
[ 10.164140] worker_thread+0x37/0x3a0
[ 10.164150] kthread+0x120/0x140
[ 10.164160] ? wq_update_unbound_numa+0x10/0x10
[ 10.164172] ? kthread_create_worker_on_cpu+0x70/0x70
[ 10.164186] ret_from_fork+0x35/0x40
[ 10.164196] ---[ end trace d5c556c207f0c26b ]---
You'll notice from those traces that the very first evo kick happens
/after/ the mthd failure on the display channel, not before.
Additionally, there is no point at this part of the initialization
process where we actually call mthd 0000 from nouveau.
Upon closer inspection, I discovered that this mysterious phantom disp
failure seems to be the result of someone else (probably the VBIOS or
the BIOS of the P50) leaving the disp core channel enabled by the time
nouveau begins to start initializing it. This was confirmed by observing
that the 0x610490 register holds a value of 0x490a009b when the card is
in this broken state, as opposed to the usual 0x48070088 or 0x48000088
observed on most cards pre-init.
It appears we can fix this by checking for the unknown mask 0x000a0000,
and simply shutting down the channel like we normally would on suspend
or driver unload before we start trying to initialize it. This appears
to be close to what nouveau does for older cards, as a similar
workaround can be seen in nv50_disp_core_init().
Unfortunately, I'm still not entirely clear on what conditions actually
cause this problem to be reproduced. Everyone else I've talked to so far
with a P50 doesn't report ever having hit this issue. As well, I haven't
managed to find a clear reproducer for this besides rebooting the
machine until the bug happens, while alternating between booting while
docked and while on battery every so often.
This fixes most random initialization errors on my ThinkPad P50 with a
GM107 GPU.
Signed-off-by: Lyude Paul <lyude(a)redhat.com>
Cc: Karol Herbst <kherbst(a)redhat.com>
Cc: stable(a)vger.kernel.org
---
.../drm/nouveau/nvkm/engine/disp/coregf119.c | 21 +++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c
index d162b9cf4eac..7534b5e9246f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c
@@ -166,8 +166,8 @@ gf119_disp_core_mthd = {
}
};
-void
-gf119_disp_core_fini(struct nv50_disp_chan *chan)
+static bool
+gf119_disp_core_deactivate(struct nv50_disp_chan *chan)
{
struct nvkm_subdev *subdev = &chan->disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
@@ -181,7 +181,16 @@ gf119_disp_core_fini(struct nv50_disp_chan *chan)
) < 0) {
nvkm_error(subdev, "core fini: %08x\n",
nvkm_rd32(device, 0x610490));
+ return false;
}
+
+ return true;
+}
+
+void
+gf119_disp_core_fini(struct nv50_disp_chan *chan)
+{
+ gf119_disp_core_deactivate(chan);
}
static int
@@ -190,6 +199,14 @@ gf119_disp_core_init(struct nv50_disp_chan *chan)
struct nvkm_subdev *subdev = &chan->disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
+ /* attempt to unstick the channel from some unknown state */
+ if ((nvkm_rd32(device, 0x610490) & 0x000a0000) == 0x000a0000 &&
+ WARN_ON(!gf119_disp_core_deactivate(chan))) {
+
+ nvkm_error(subdev, "core won't shut down, aborting\n");
+ return -EBUSY;
+ }
+
/* initialise channel for dma command submission */
nvkm_wr32(device, 0x610494, chan->push);
nvkm_wr32(device, 0x610498, 0x00010000);
--
2.17.1
Hi Greg, hi Thomas,
I noticed /sys/devices/system/cpu/smt dir is missing on 4.4.148 and
4.14.63, default setting.
Tried stable/master branch 31130a16d459 ("Merge tag
'for-linus-4.19-rc1-tag' of
git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip")
It's the same there.
When boot with 'nosmt' kernel paramter kernel 4.14.63 panic during
boot, 4.4.148 boot fine.
The call trace seem irq related, is it known bug?
Thanks
--
Jack Wang
Linux Kernel Developer
ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin
Tel: +49 30 577 008 042
Fax: +49 30 577 008 299
Email: jinpu.wang(a)profitbricks.com
URL: https://www.profitbricks.de
Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B
Geschäftsführer: Achim Weiss, Matthias Steinberg, Christoph Steffens
acpi_gsb_i2c_write_bytes() returns i2c_transfer()'s return value, which
is the number of transfers executed on success, so 1.
The ACPI code expects us to store 0 in gsb->status for success, not 1.
Specifically this breaks the following code in the Thinkpad 8 DSDT:
ECWR = I2CW = ECWR /* \_SB_.I2C1.BAT0.ECWR */
If ((ECST == Zero))
{
ECRD = I2CR /* \_SB_.I2C1.I2CR */
}
Before this commit we set ECST to 1, causing the read to never happen
breaking battery monitoring on the Thinkpad 8.
This commit makes acpi_gsb_i2c_write_bytes() return 0 when i2c_transfer()
returns 1, so the single write transfer completed successfully, and
makes it return -EIO on for other (unexpected) return values >= 0.
Cc: stable(a)vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
---
Changes in v2:
-Modify the value which acpi_gsb_i2c_write_bytes() returns instead of
checking + modifying the return value in its caller
---
drivers/i2c/i2c-core-acpi.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
index 7c3b4740b94b..b8f303dea305 100644
--- a/drivers/i2c/i2c-core-acpi.c
+++ b/drivers/i2c/i2c-core-acpi.c
@@ -482,11 +482,16 @@ static int acpi_gsb_i2c_write_bytes(struct i2c_client *client,
msgs[0].buf = buffer;
ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
- if (ret < 0)
- dev_err(&client->adapter->dev, "i2c write failed\n");
kfree(buffer);
- return ret;
+
+ if (ret < 0) {
+ dev_err(&client->adapter->dev, "i2c write failed: %d\n", ret);
+ return ret;
+ }
+
+ /* 1 transfer must have completed successfully */
+ return (ret == 1) ? 0 : -EIO;
}
static acpi_status
--
2.18.0
100 ms is not enough time for the LSPCON adapter on Intel NUC devices to
settle. This causes dropped display modes at boot or screen reconfiguration.
Empirical testing can reproduce the error up to a timeout of 190 ms. Basic
boot and stress testing at 200 ms has not (yet) failed.
Increase timeout to 400 ms to get some margin of error.
Changes from v1:
The initial suggestion of 1000 ms was lowered due to concerns about delaying
valid timeout cases.
Update patch metadata.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107503
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1570392
Fixes: 357c0ae9198a ("drm/i915/lspcon: Wait for expected LSPCON mode to settle")
Cc: Shashank Sharma <shashank.sharma(a)intel.com>
Cc: Imre Deak <imre.deak(a)intel.com>
Cc: Jani Nikula <jani.nikula(a)intel.com>
Cc: <stable(a)vger.kernel.org> # v4.11+
Reviewed-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Signed-off-by: Fredrik Schön <fredrik.schon(a)gmail.com>
---
drivers/gpu/drm/i915/intel_lspcon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
index 8ae8f42f430a..6b6758419fb3 100644
--- a/drivers/gpu/drm/i915/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/intel_lspcon.c
@@ -74,7 +74,7 @@ static enum drm_lspcon_mode lspcon_wait_mode(struct intel_lspcon *lspcon,
DRM_DEBUG_KMS("Waiting for LSPCON mode %s to settle\n",
lspcon_mode_name(mode));
- wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode, 100);
+ wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode, 400);
if (current_mode != mode)
DRM_ERROR("LSPCON mode hasn't settled\n");
--
2.17.1
I changed the way mac80211 updates the PM state of the peer.
I forgot that we could also have multicast frames from the
peer and that those frame should of course not change the
PM state of the peer: A peer goes to power save when it
needs to scan, but it won't send the broadcast Probe Request
with the PM bit set.
This made us mark the peer as awake when it wasn't and then
Intel's firmware would fail to transmit because the peer is
asleep according to its database. The driver warned about
this and it looked like this:
WARNING: CPU: 0 PID: 184 at /usr/src/linux-4.16.14/drivers/net/wireless/intel/iwlwifi/mvm/tx.c:1369 iwl_mvm_rx_tx_cmd+0x53b/0x860
CPU: 0 PID: 184 Comm: irq/124-iwlwifi Not tainted 4.16.14 #1
RIP: 0010:iwl_mvm_rx_tx_cmd+0x53b/0x860
Call Trace:
iwl_pcie_rx_handle+0x220/0x880
iwl_pcie_irq_handler+0x6c9/0xa20
? irq_forced_thread_fn+0x60/0x60
? irq_thread_dtor+0x90/0x90
The relevant code that spits the WARNING is:
case TX_STATUS_FAIL_DEST_PS:
/* the FW should have stopped the queue and not
* return this status
*/
WARN_ON(1);
info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=199967.
Fixes: 9fef65443388 ("mac80211: always update the PM state of a peer on MGMT / DATA frames")
Cc: <stable(a)vger.kernel.org> #4.16+
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach(a)intel.com>
---
net/mac80211/rx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a16ba56..3cf6027 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1728,6 +1728,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
*/
if (!ieee80211_hw_check(&sta->local->hw, AP_LINK_PS) &&
!ieee80211_has_morefrags(hdr->frame_control) &&
+ !is_multicast_ether_addr(hdr->addr1) &&
(ieee80211_is_mgmt(hdr->frame_control) ||
ieee80211_is_data(hdr->frame_control)) &&
!(status->rx_flags & IEEE80211_RX_DEFERRED_RELEASE) &&
--
2.7.4
It seems the arizona-ldo1 ldoena fix hasn't made it into 4.18. It
was added to 4.19/mainline, though:
commit a9191579ba1086d91842199263e6fe6bb5eec1ba
Author: Charles Keepax <ckeepax(a)opensource.cirrus.com>
Date: Tue Jun 19 16:10:00 2018 +0100
regulator: arizona-ldo1: Use correct device to get enable GPIO
Could you please add this commit to the 4.18 stable queue?
Without this fix LDO control via GPIO is broken and Arizona devices
can't be used as no power is applied.
I tested locally with a WM5102 (Cirrus Logic Audio Card on RPi),
with stock 4.18 tree device detection fails:
[ 6.075981] arizona spi0.1: Unknown device ID: 0
with this commit added to 4.18 the WM5102 is detected fine:
[ 6.060887] arizona spi0.1: WM5102 revision C
so long & thanks,
Hias
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 48db0089bff6f9154f6bd98ce7a6ae3786fa8ebe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mika=20B=C3=A5tsman?= <mika.batsman(a)gmail.com>
Date: Wed, 16 May 2018 16:32:19 -0400
Subject: [PATCH] media: gl861: fix probe of dvb_usb_gl861
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Probe of dvb_usb_gl861 was working at least with v4.4. Noticed the issue
with v4.13 but according to similar issues the problem started with v4.9.
[ 15.288065] transfer buffer not dma capable
[ 15.288090] WARNING: CPU: 2 PID: 493 at drivers/usb/core/hcd.c:1595 usb_hcd_map_urb_for_dma+0x4e2/0x640
...CUT...
[ 15.288791] dvb_usb_gl861: probe of 3-7:1.0 failed with error -5
Tested with MSI Mega Sky 580 DVB-T Tuner [GL861]
[mchehab+samsung(a)kernel.org: rebased on the top of upstream]
Cc: stable(a)vger.kernel.org
Signed-off-by: Mika Båtsman <mika.batsman(a)gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung(a)kernel.org>
diff --git a/drivers/media/usb/dvb-usb-v2/gl861.c b/drivers/media/usb/dvb-usb-v2/gl861.c
index 9d154fdae45b..fee4b30df778 100644
--- a/drivers/media/usb/dvb-usb-v2/gl861.c
+++ b/drivers/media/usb/dvb-usb-v2/gl861.c
@@ -26,10 +26,14 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
if (wo) {
req = GL861_REQ_I2C_WRITE;
type = GL861_WRITE;
+ buf = kmemdup(wbuf, wlen, GFP_KERNEL);
} else { /* rw */
req = GL861_REQ_I2C_READ;
type = GL861_READ;
+ buf = kmalloc(rlen, GFP_KERNEL);
}
+ if (!buf)
+ return -ENOMEM;
switch (wlen) {
case 1:
@@ -42,24 +46,19 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
default:
dev_err(&d->udev->dev, "%s: wlen=%d, aborting\n",
KBUILD_MODNAME, wlen);
+ kfree(buf);
return -EINVAL;
}
- buf = NULL;
- if (rlen > 0) {
- buf = kmalloc(rlen, GFP_KERNEL);
- if (!buf)
- return -ENOMEM;
- }
+
usleep_range(1000, 2000); /* avoid I2C errors */
ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type,
value, index, buf, rlen, 2000);
- if (rlen > 0) {
- if (ret > 0)
- memcpy(rbuf, buf, rlen);
- kfree(buf);
- }
+ if (!wo && ret > 0)
+ memcpy(rbuf, buf, rlen);
+
+ kfree(buf);
return ret;
}
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 48db0089bff6f9154f6bd98ce7a6ae3786fa8ebe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mika=20B=C3=A5tsman?= <mika.batsman(a)gmail.com>
Date: Wed, 16 May 2018 16:32:19 -0400
Subject: [PATCH] media: gl861: fix probe of dvb_usb_gl861
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Probe of dvb_usb_gl861 was working at least with v4.4. Noticed the issue
with v4.13 but according to similar issues the problem started with v4.9.
[ 15.288065] transfer buffer not dma capable
[ 15.288090] WARNING: CPU: 2 PID: 493 at drivers/usb/core/hcd.c:1595 usb_hcd_map_urb_for_dma+0x4e2/0x640
...CUT...
[ 15.288791] dvb_usb_gl861: probe of 3-7:1.0 failed with error -5
Tested with MSI Mega Sky 580 DVB-T Tuner [GL861]
[mchehab+samsung(a)kernel.org: rebased on the top of upstream]
Cc: stable(a)vger.kernel.org
Signed-off-by: Mika Båtsman <mika.batsman(a)gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung(a)kernel.org>
diff --git a/drivers/media/usb/dvb-usb-v2/gl861.c b/drivers/media/usb/dvb-usb-v2/gl861.c
index 9d154fdae45b..fee4b30df778 100644
--- a/drivers/media/usb/dvb-usb-v2/gl861.c
+++ b/drivers/media/usb/dvb-usb-v2/gl861.c
@@ -26,10 +26,14 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
if (wo) {
req = GL861_REQ_I2C_WRITE;
type = GL861_WRITE;
+ buf = kmemdup(wbuf, wlen, GFP_KERNEL);
} else { /* rw */
req = GL861_REQ_I2C_READ;
type = GL861_READ;
+ buf = kmalloc(rlen, GFP_KERNEL);
}
+ if (!buf)
+ return -ENOMEM;
switch (wlen) {
case 1:
@@ -42,24 +46,19 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
default:
dev_err(&d->udev->dev, "%s: wlen=%d, aborting\n",
KBUILD_MODNAME, wlen);
+ kfree(buf);
return -EINVAL;
}
- buf = NULL;
- if (rlen > 0) {
- buf = kmalloc(rlen, GFP_KERNEL);
- if (!buf)
- return -ENOMEM;
- }
+
usleep_range(1000, 2000); /* avoid I2C errors */
ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type,
value, index, buf, rlen, 2000);
- if (rlen > 0) {
- if (ret > 0)
- memcpy(rbuf, buf, rlen);
- kfree(buf);
- }
+ if (!wo && ret > 0)
+ memcpy(rbuf, buf, rlen);
+
+ kfree(buf);
return ret;
}
The patch below does not apply to the 4.17-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 48db0089bff6f9154f6bd98ce7a6ae3786fa8ebe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mika=20B=C3=A5tsman?= <mika.batsman(a)gmail.com>
Date: Wed, 16 May 2018 16:32:19 -0400
Subject: [PATCH] media: gl861: fix probe of dvb_usb_gl861
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Probe of dvb_usb_gl861 was working at least with v4.4. Noticed the issue
with v4.13 but according to similar issues the problem started with v4.9.
[ 15.288065] transfer buffer not dma capable
[ 15.288090] WARNING: CPU: 2 PID: 493 at drivers/usb/core/hcd.c:1595 usb_hcd_map_urb_for_dma+0x4e2/0x640
...CUT...
[ 15.288791] dvb_usb_gl861: probe of 3-7:1.0 failed with error -5
Tested with MSI Mega Sky 580 DVB-T Tuner [GL861]
[mchehab+samsung(a)kernel.org: rebased on the top of upstream]
Cc: stable(a)vger.kernel.org
Signed-off-by: Mika Båtsman <mika.batsman(a)gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung(a)kernel.org>
diff --git a/drivers/media/usb/dvb-usb-v2/gl861.c b/drivers/media/usb/dvb-usb-v2/gl861.c
index 9d154fdae45b..fee4b30df778 100644
--- a/drivers/media/usb/dvb-usb-v2/gl861.c
+++ b/drivers/media/usb/dvb-usb-v2/gl861.c
@@ -26,10 +26,14 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
if (wo) {
req = GL861_REQ_I2C_WRITE;
type = GL861_WRITE;
+ buf = kmemdup(wbuf, wlen, GFP_KERNEL);
} else { /* rw */
req = GL861_REQ_I2C_READ;
type = GL861_READ;
+ buf = kmalloc(rlen, GFP_KERNEL);
}
+ if (!buf)
+ return -ENOMEM;
switch (wlen) {
case 1:
@@ -42,24 +46,19 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
default:
dev_err(&d->udev->dev, "%s: wlen=%d, aborting\n",
KBUILD_MODNAME, wlen);
+ kfree(buf);
return -EINVAL;
}
- buf = NULL;
- if (rlen > 0) {
- buf = kmalloc(rlen, GFP_KERNEL);
- if (!buf)
- return -ENOMEM;
- }
+
usleep_range(1000, 2000); /* avoid I2C errors */
ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type,
value, index, buf, rlen, 2000);
- if (rlen > 0) {
- if (ret > 0)
- memcpy(rbuf, buf, rlen);
- kfree(buf);
- }
+ if (!wo && ret > 0)
+ memcpy(rbuf, buf, rlen);
+
+ kfree(buf);
return ret;
}
Hi,
It's commit d77a4b4a5b0b2ebcbc9840995d91311ef28302ab
and f59cf9a0551dd954ad8b752461cf19d9789f4b1d,
both which are already merged in Linus's tree.
I can't think of a reason why you would have missed this
other than the fact that I've used "Cc: <stable(a)vger.kernel.org>"
instead of "Cc: stable(a)vger.kernel.org".
I doubt it, but would this be the reason?
Thanks,
On Sat, Aug 18, 2018 at 11:38 PM Greg KH <gregkh(a)linuxfoundation.org> wrote:
>
> On Sat, Aug 18, 2018 at 11:29:11PM +0900, Ju Hyung Park wrote:
> > Hi, Greg.
> >
> > I'd like to know if there's a reason on why these ALSA patches(2 in
> > total) aren't brought to linux-stable yet.
>
> What specific patches are you referring to here? I do not see anything
> in this email :(
>
> What is the git commit id in Linus's tree? What stable tree(s) do you
> want them applied to?
>
> > I see a lot of patches merged to linux-stable and stable-queue that
> > are much newer than those patches.
> >
> > I'd appreciate it if you can merge those ASAP.
>
> Have you read:
> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> for how to do this properly?
>
> If not, please do so.
>
> thanks,
>
> greg k-h
Oh, and I forgot to add:
this would better be applied to every stable trees, if applicable
(probably by checking if the commit
f6b28e4ded45bb91bc4cd115d55e35badedfce5f is already merged).
Thanks again.
On Sat, Aug 18, 2018 at 11:38 PM Greg KH <gregkh(a)linuxfoundation.org> wrote:
>
> On Sat, Aug 18, 2018 at 11:29:11PM +0900, Ju Hyung Park wrote:
> > Hi, Greg.
> >
> > I'd like to know if there's a reason on why these ALSA patches(2 in
> > total) aren't brought to linux-stable yet.
>
> What specific patches are you referring to here? I do not see anything
> in this email :(
>
> What is the git commit id in Linus's tree? What stable tree(s) do you
> want them applied to?
>
> > I see a lot of patches merged to linux-stable and stable-queue that
> > are much newer than those patches.
> >
> > I'd appreciate it if you can merge those ASAP.
>
> Have you read:
> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> for how to do this properly?
>
> If not, please do so.
>
> thanks,
>
> greg k-h
This is the start of the stable review cycle for the 4.4.149 release.
There are 13 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 Sat Aug 18 17:16:16 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.149-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.149-rc1
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Add TLB purge to free pmd/pte page interfaces
Chintan Pandya <cpandya(a)codeaurora.org>
ioremap: Update pgtable free interfaces with addr
Mark Salyzyn <salyzyn(a)android.com>
Bluetooth: hidp: buffer overflow in hidp_process_report
Thierry Escande <thierry.escande(a)collabora.com>
ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization
Eric Biggers <ebiggers(a)google.com>
crypto: ablkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: blkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - separate tfm and request context
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - require a block cipher with 128-bit block size
Randy Dunlap <rdunlap(a)infradead.org>
kbuild: verify that $DEPMOD is installed
Liwei Song <liwei.song(a)windriver.com>
i2c: ismt: fix wrong device address when unmap the data buffer
Andrey Konovalov <andreyknvl(a)google.com>
kasan: don't emit builtin calls when sanitization is off
Takashi Iwai <tiwai(a)suse.de>
tcp: Fix missing range_truesize enlargement in the backport
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Disable ioremap free page handling on x86-PAE
-------------
Diffstat:
Documentation/Changes | 17 +-
Makefile | 7 +-
arch/arm64/mm/mmu.c | 4 +-
arch/x86/mm/pgtable.c | 61 +++-
crypto/ablkcipher.c | 57 ++--
crypto/blkcipher.c | 54 ++--
crypto/vmac.c | 412 ++++++++++++---------------
drivers/i2c/busses/i2c-ismt.c | 2 +-
include/asm-generic/pgtable.h | 8 +-
include/crypto/vmac.h | 63 ----
lib/ioremap.c | 4 +-
net/bluetooth/hidp/core.c | 4 +-
net/ipv4/tcp_input.c | 1 +
scripts/Makefile.kasan | 3 +
scripts/Makefile.lib | 2 +-
scripts/depmod.sh | 8 +-
sound/soc/intel/boards/cht_bsw_max98090_ti.c | 45 ++-
17 files changed, 354 insertions(+), 398 deletions(-)
This is the start of the stable review cycle for the 4.18.2 release.
There are 22 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 Sat Aug 18 17:15: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.18.2-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.2-rc1
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Add TLB purge to free pmd/pte page interfaces
Chintan Pandya <cpandya(a)codeaurora.org>
ioremap: Update pgtable free interfaces with addr
Mark Salyzyn <salyzyn(a)android.com>
Bluetooth: hidp: buffer overflow in hidp_process_report
Eric Biggers <ebiggers(a)google.com>
crypto: skcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: skcipher - fix aligning block size in skcipher_copy_iv()
Eric Biggers <ebiggers(a)google.com>
crypto: ablkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: blkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - separate tfm and request context
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - require a block cipher with 128-bit block size
Eric Biggers <ebiggers(a)google.com>
crypto: x86/sha256-mb - fix digest copy in sha256_mb_mgr_get_comp_job_avx2()
Tom Lendacky <thomas.lendacky(a)amd.com>
crypto: ccp - Fix command completion detection race
Tom Lendacky <thomas.lendacky(a)amd.com>
crypto: ccp - Check for NULL PSP pointer at module unload
Gilad Ben-Yossef <gilad(a)benyossef.com>
crypto: ccree - fix iv handling
Hadar Gat <hadar.gat(a)arm.com>
crypto: ccree - fix finup
Randy Dunlap <rdunlap(a)infradead.org>
kbuild: verify that $DEPMOD is installed
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Disable ioremap free page handling on x86-PAE
M. Vefa Bicakci <m.v.b(a)runbox.com>
xen/pv: Call get_cpu_address_sizes to set x86_virt/phys_bits
Dave Hansen <dave.hansen(a)linux.intel.com>
x86/mm/pti: Clear Global bit more aggressively
Dou Liyang <douly.fnst(a)cn.fujitsu.com>
x86/platform/UV: Mark memblock related init code and data correctly
Vitaly Kuznetsov <vkuznets(a)redhat.com>
x86/hyper-v: Check for VP_INVAL in hyperv_flush_tlb_others()
Guenter Roeck <linux(a)roeck-us.net>
x86: i8259: Add missing include file
Guenter Roeck <linux(a)roeck-us.net>
x86/l1tf: Fix build error seen if CONFIG_KVM_INTEL is disabled
-------------
Diffstat:
Documentation/process/changes.rst | 19 +-
Makefile | 4 +-
arch/arm64/mm/mmu.c | 4 +-
.../crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S | 2 +-
arch/x86/hyperv/mmu.c | 5 +
arch/x86/include/asm/i8259.h | 1 +
arch/x86/kernel/apic/x2apic_uv_x.c | 4 +-
arch/x86/kernel/cpu/bugs.c | 3 +-
arch/x86/kernel/cpu/common.c | 2 +-
arch/x86/kernel/cpu/cpu.h | 1 +
arch/x86/mm/pageattr.c | 6 +
arch/x86/mm/pgtable.c | 61 ++-
arch/x86/mm/pti.c | 34 +-
arch/x86/xen/enlighten_pv.c | 3 +
crypto/ablkcipher.c | 57 ++-
crypto/blkcipher.c | 54 ++-
crypto/skcipher.c | 55 +--
crypto/vmac.c | 412 +++++++++------------
drivers/crypto/ccp/psp-dev.c | 7 +-
drivers/crypto/ccree/cc_cipher.c | 111 ++++--
drivers/crypto/ccree/cc_hash.c | 81 +---
include/asm-generic/pgtable.h | 8 +-
include/crypto/vmac.h | 63 ----
lib/ioremap.c | 4 +-
net/bluetooth/hidp/core.c | 4 +-
scripts/depmod.sh | 8 +-
26 files changed, 494 insertions(+), 519 deletions(-)
This is the start of the stable review cycle for the 4.9.121 release.
There are 15 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 Sat Aug 18 17:16:11 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.121-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.121-rc1
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Add TLB purge to free pmd/pte page interfaces
Chintan Pandya <cpandya(a)codeaurora.org>
ioremap: Update pgtable free interfaces with addr
Mark Salyzyn <salyzyn(a)android.com>
Bluetooth: hidp: buffer overflow in hidp_process_report
Thierry Escande <thierry.escande(a)collabora.com>
ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization
Eric Biggers <ebiggers(a)google.com>
crypto: ablkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: blkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - separate tfm and request context
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - require a block cipher with 128-bit block size
Eric Biggers <ebiggers(a)google.com>
crypto: x86/sha256-mb - fix digest copy in sha256_mb_mgr_get_comp_job_avx2()
Randy Dunlap <rdunlap(a)infradead.org>
kbuild: verify that $DEPMOD is installed
Liwei Song <liwei.song(a)windriver.com>
i2c: ismt: fix wrong device address when unmap the data buffer
Andrey Konovalov <andreyknvl(a)google.com>
kasan: don't emit builtin calls when sanitization is off
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Disable ioremap free page handling on x86-PAE
Guenter Roeck <linux(a)roeck-us.net>
x86: i8259: Add missing include file
Guenter Roeck <linux(a)roeck-us.net>
x86/l1tf: Fix build error seen if CONFIG_KVM_INTEL is disabled
-------------
Diffstat:
Documentation/Changes | 19 +-
Makefile | 7 +-
arch/arm64/mm/mmu.c | 4 +-
.../crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S | 2 +-
arch/x86/include/asm/i8259.h | 1 +
arch/x86/kernel/cpu/bugs.c | 3 +-
arch/x86/mm/pgtable.c | 61 ++-
crypto/ablkcipher.c | 57 ++-
crypto/blkcipher.c | 54 ++-
crypto/vmac.c | 412 +++++++++------------
drivers/i2c/busses/i2c-ismt.c | 2 +-
include/asm-generic/pgtable.h | 8 +-
include/crypto/vmac.h | 63 ----
lib/ioremap.c | 4 +-
net/bluetooth/hidp/core.c | 4 +-
scripts/Makefile.kasan | 3 +
scripts/Makefile.lib | 2 +-
scripts/depmod.sh | 8 +-
sound/soc/intel/boards/cht_bsw_max98090_ti.c | 45 ++-
19 files changed, 357 insertions(+), 402 deletions(-)
Hi, Greg.
I'd like to know if there's a reason on why these ALSA patches(2 in
total) aren't brought to linux-stable yet.
I see a lot of patches merged to linux-stable and stable-queue that
are much newer than those patches.
I'd appreciate it if you can merge those ASAP.
Thanks,
On Sat, Aug 18, 2018 at 6:17 AM Takashi Iwai <tiwai(a)suse.de> wrote:
>
> On Fri, 17 Aug 2018 22:40:02 +0200,
> Ju Hyung Park wrote:
> >
> > Hi, I'm still a bit confused.
> >
> > Can I ask why are these patches still yet to appear in linux-stable
> > and stable-queue?
> > I see those are already merged in Torvalds' tree.
>
> Greg has been also busy due to so many patches, give him some time.
> If the patch is still missing in the next release, feel free to ping
> him.
>
>
> Takashi
>
> >
> > Thanks,
> >
> > On Wed, Aug 1, 2018 at 10:14 PM Takashi Iwai <tiwai(a)suse.de> wrote:
> > >
> > > On Wed, 01 Aug 2018 15:13:21 +0200,
> > > Ju Hyung Park wrote:
> > > >
> > > > On Wed, Aug 1, 2018 at 10:09 PM, Takashi Iwai <tiwai(a)suse.de> wrote:
> > > > >
> > > > > It's likely postponed to 4.19 unless any critical issue comes up.
> > > > > If it were before rc5, I could push for 4.18, but it's already in a
> > > > > too late stage. These are no new breakage in 4.18-rc, after all.
> > > >
> > > > Makes sense, but I'd like to see these being pushed to linux-stable ASAP.
> > > >
> > > > Would I have to wait for 4.19-rc1 before that happens?
> > >
> > > Yes.
> > >
> > >
> > > Takashi
> > >
> > > > Thanks.
> > > >
> > > > >
> > > > >
> > > > > thanks,
> > > > >
> > > > > Takashi
> > > > >
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > On Sun, Jul 29, 2018 at 1:58 AM, Takashi Iwai <tiwai(a)suse.de> wrote:
> > > > > >
> > > > > > > On Fri, 27 Jul 2018 20:16:21 +0200,
> > > > > > > Park Ju Hyung wrote:
> > > > > > > >
> > > > > > > > As an equivalent codec with CX20724,
> > > > > > > > CX8200 is also subject to the reboot bug.
> > > > > > > >
> > > > > > > > Late 2017 and 2018 LG Gram and some HP Spectre laptops are known victims
> > > > > > > > to this issue, causing extremely loud noises upon reboot.
> > > > > > > >
> > > > > > > > Now that we know that this bug is subject to multiple codecs,
> > > > > > > > fix the comment as well.
> > > > > > > >
> > > > > > > > Signed-off-by: Park Ju Hyung <qkrwngud825(a)gmail.com>
> > > > > > > > Cc: <stable(a)vger.kernel.org>
> > > > > > >
> > > > > > > Applied, thanks.
> > > > > > >
> > > > > > >
> > > > > > > Takashi
> > > > > > >
> > > > > > [2 <text/html; UTF-8 (quoted-printable)>]
> > > > > >
> > > >
> >
This is the start of the stable review cycle for the 4.14.64 release.
There are 22 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 Sat Aug 18 17:16:07 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.64-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.64-rc1
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Add TLB purge to free pmd/pte page interfaces
Chintan Pandya <cpandya(a)codeaurora.org>
ioremap: Update pgtable free interfaces with addr
Mark Salyzyn <salyzyn(a)android.com>
Bluetooth: hidp: buffer overflow in hidp_process_report
Thierry Escande <thierry.escande(a)collabora.com>
ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization
Jean-François Têtu <jean-francois.tetu(a)savoirfairelinux.com>
ASoC: msm8916-wcd-digital: fix RX2 MIX1 and RX3 MIX1
Paolo Valente <paolo.valente(a)linaro.org>
block, bfq: fix wrong init of saved start time for weight raising
Alexander Syring <alex(a)asyring.de>
clk: sunxi-ng: Fix missing CLK_SET_RATE_PARENT in ccu-sun4i-a10.c
Kuninori Morimoto <kuninori.morimoto.gx(a)renesas.com>
ASoC: rsnd: fix ADG flags
Marc-André Lureau <marcandre.lureau(a)redhat.com>
fw_cfg: fix driver remove
Thomas Gleixner <tglx(a)linutronix.de>
sched/debug: Fix task state recording/printout
James Morse <james.morse(a)arm.com>
ACPI / APEI: Remove ghes_ioremap_area
Eric Biggers <ebiggers(a)google.com>
crypto: skcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: skcipher - fix aligning block size in skcipher_copy_iv()
Eric Biggers <ebiggers(a)google.com>
crypto: ablkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: blkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - separate tfm and request context
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - require a block cipher with 128-bit block size
Eric Biggers <ebiggers(a)google.com>
crypto: x86/sha256-mb - fix digest copy in sha256_mb_mgr_get_comp_job_avx2()
Randy Dunlap <rdunlap(a)infradead.org>
kbuild: verify that $DEPMOD is installed
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Disable ioremap free page handling on x86-PAE
Guenter Roeck <linux(a)roeck-us.net>
x86: i8259: Add missing include file
Guenter Roeck <linux(a)roeck-us.net>
x86/l1tf: Fix build error seen if CONFIG_KVM_INTEL is disabled
-------------
Diffstat:
Documentation/process/changes.rst | 19 +-
Makefile | 4 +-
arch/arm64/mm/mmu.c | 4 +-
.../crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S | 2 +-
arch/x86/include/asm/i8259.h | 1 +
arch/x86/kernel/cpu/bugs.c | 3 +-
arch/x86/mm/pgtable.c | 61 ++-
block/bfq-iosched.c | 50 ++-
crypto/ablkcipher.c | 57 ++-
crypto/blkcipher.c | 54 ++-
crypto/skcipher.c | 51 +--
crypto/vmac.c | 412 +++++++++------------
drivers/acpi/apei/ghes.c | 39 +-
drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 2 +-
drivers/firmware/qemu_fw_cfg.c | 3 +-
include/asm-generic/pgtable.h | 8 +-
include/crypto/vmac.h | 63 ----
include/trace/events/sched.h | 6 +-
lib/ioremap.c | 4 +-
net/bluetooth/hidp/core.c | 4 +-
scripts/depmod.sh | 8 +-
sound/soc/codecs/msm8916-wcd-digital.c | 4 +-
sound/soc/intel/boards/cht_bsw_max98090_ti.c | 45 ++-
sound/soc/sh/rcar/adg.c | 4 +-
24 files changed, 419 insertions(+), 489 deletions(-)
This is the start of the stable review cycle for the 4.17.16 release.
There are 21 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 Sat Aug 18 17:16:02 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.17.16-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.17.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.17.16-rc1
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Add TLB purge to free pmd/pte page interfaces
Chintan Pandya <cpandya(a)codeaurora.org>
ioremap: Update pgtable free interfaces with addr
Mark Salyzyn <salyzyn(a)android.com>
Bluetooth: hidp: buffer overflow in hidp_process_report
Eric Biggers <ebiggers(a)google.com>
crypto: skcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: skcipher - fix aligning block size in skcipher_copy_iv()
Eric Biggers <ebiggers(a)google.com>
crypto: ablkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: blkcipher - fix crash flushing dcache in error path
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - separate tfm and request context
Eric Biggers <ebiggers(a)google.com>
crypto: vmac - require a block cipher with 128-bit block size
Eric Biggers <ebiggers(a)google.com>
crypto: x86/sha256-mb - fix digest copy in sha256_mb_mgr_get_comp_job_avx2()
Tom Lendacky <thomas.lendacky(a)amd.com>
crypto: ccp - Fix command completion detection race
Tom Lendacky <thomas.lendacky(a)amd.com>
crypto: ccp - Check for NULL PSP pointer at module unload
Gilad Ben-Yossef <gilad(a)benyossef.com>
crypto: ccree - fix iv handling
Hadar Gat <hadar.gat(a)arm.com>
crypto: ccree - fix finup
Randy Dunlap <rdunlap(a)infradead.org>
kbuild: verify that $DEPMOD is installed
Toshi Kani <toshi.kani(a)hpe.com>
x86/mm: Disable ioremap free page handling on x86-PAE
M. Vefa Bicakci <m.v.b(a)runbox.com>
xen/pv: Call get_cpu_address_sizes to set x86_virt/phys_bits
Dave Hansen <dave.hansen(a)linux.intel.com>
x86/mm/pti: Clear Global bit more aggressively
Dou Liyang <douly.fnst(a)cn.fujitsu.com>
x86/platform/UV: Mark memblock related init code and data correctly
Guenter Roeck <linux(a)roeck-us.net>
x86: i8259: Add missing include file
Guenter Roeck <linux(a)roeck-us.net>
x86/l1tf: Fix build error seen if CONFIG_KVM_INTEL is disabled
-------------
Diffstat:
Documentation/process/changes.rst | 19 +-
Makefile | 4 +-
arch/arm64/mm/mmu.c | 4 +-
.../crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S | 2 +-
arch/x86/include/asm/i8259.h | 1 +
arch/x86/kernel/apic/x2apic_uv_x.c | 4 +-
arch/x86/kernel/cpu/bugs.c | 3 +-
arch/x86/kernel/cpu/common.c | 2 +-
arch/x86/kernel/cpu/cpu.h | 1 +
arch/x86/mm/pageattr.c | 6 +
arch/x86/mm/pgtable.c | 61 ++-
arch/x86/mm/pti.c | 34 +-
arch/x86/xen/enlighten_pv.c | 3 +
crypto/ablkcipher.c | 57 ++-
crypto/blkcipher.c | 54 ++-
crypto/skcipher.c | 55 +--
crypto/vmac.c | 412 +++++++++------------
drivers/crypto/ccp/psp-dev.c | 7 +-
drivers/crypto/ccree/cc_cipher.c | 111 ++++--
drivers/crypto/ccree/cc_hash.c | 81 +---
include/asm-generic/pgtable.h | 8 +-
include/crypto/vmac.h | 63 ----
lib/ioremap.c | 4 +-
net/bluetooth/hidp/core.c | 4 +-
scripts/depmod.sh | 8 +-
25 files changed, 489 insertions(+), 519 deletions(-)