4.4.91-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 4.4.91-stable review
This is the start of the stable review cycle for the 4.4.91 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Oct 8 08:36:32 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.91-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.4.91-rc1
Arnd Bergmann <[email protected]>
ttpci: address stringop overflow warning
Arnd Bergmann <[email protected]>
ALSA: au88x0: avoid theoretical uninitialized access
Arnd Bergmann <[email protected]>
ARM: remove duplicate 'const' annotations'
Arnd Bergmann <[email protected]>
IB/qib: fix false-postive maybe-uninitialized warning
Jisheng Zhang <[email protected]>
drivers: firmware: psci: drop duplicate const from psci_of_match
Gwendal Grignou <[email protected]>
libata: transport: Remove circular dependency at free time
Darrick J. Wong <[email protected]>
xfs: remove kmem_zalloc_greedy
Heiner Kallweit <[email protected]>
i2c: meson: fix wrong variable usage in meson_i2c_put_data
Shaohua Li <[email protected]>
md/raid10: submit bio directly to replacement disk
Zhu Yanjun <[email protected]>
rds: ib: add error handle
Oleksandr Tyshchenko <[email protected]>
iommu/io-pgtable-arm: Check for leaf entry before dereferencing it
Arvind Yadav <[email protected]>
parisc: perf: Fix potential NULL pointer dereference
Liping Zhang <[email protected]>
netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max
Thibault Saunier <[email protected]>
exynos-gsc: Do not swap cb/cr for semi planar formats
Matt Redfearn <[email protected]>
MIPS: IRQ Stack: Unwind IRQ stack onto task stack
Liping Zhang <[email protected]>
netfilter: invoke synchronize_rcu after set the _hook_ to NULL
Ido Schimmel <[email protected]>
bridge: netlink: register netdevice before executing changelink
Heiner Kallweit <[email protected]>
mmc: sdio: fix alignment issue in struct sdio_func
Roman Spychała <[email protected]>
usb: plusb: Add support for PL-27A1
Pan Bian <[email protected]>
team: fix memory leaks
Alexander Potapenko <[email protected]>
net/packet: check length in getsockopt() called with PACKET_HDRLEN
Myungho Jung <[email protected]>
net: core: Prevent from dereferencing null pointer when releasing SKB
Arnd Bergmann <[email protected]>
MIPS: Lantiq: Fix another request_mem_region() return code check
Linus Walleij <[email protected]>
ASoC: dapm: fix some pointer error handling
Peter Chen <[email protected]>
usb: chipidea: vbus event may exist before starting gadget
Richard Guy Briggs <[email protected]>
audit: log 32-bit socketcalls
Linus Walleij <[email protected]>
ASoC: dapm: handle probe deferrals
Alden Tondettar <[email protected]>
partitions/efi: Fix integer overflow in GPT size calculation
Markus Elfring <[email protected]>
pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show()
Johan Hovold <[email protected]>
USB: serial: mos7840: fix control-message error handling
Johan Hovold <[email protected]>
USB: serial: mos7720: fix control-message error handling
Pan Bian <[email protected]>
drm/amdkfd: fix improper return value on error
Feras Daoud <[email protected]>
IB/ipoib: Replace list_del of the neigh->list with list_del_init
Feras Daoud <[email protected]>
IB/ipoib: rtnl_unlock can not come after free_netdev
Feras Daoud <[email protected]>
IB/ipoib: Fix deadlock over vlan_mutex
Christophe JAILLET <[email protected]>
tty: goldfish: Fix a parameter of a call to free_irq
Afzal Mohammed <[email protected]>
ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM
Andreas Klinger <[email protected]>
iio: adc: hx711: Add DT binding for avia,hx711
Hans de Goede <[email protected]>
iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
Guenter Roeck <[email protected]>
hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes
Niklas Söderlund <[email protected]>
sh_eth: use correct name for ECMR_MPDE bit
Hans de Goede <[email protected]>
extcon: axp288: Use vbus-valid instead of -present to determine cable presence
Guilherme G Piccoli <[email protected]>
igb: re-assign hw address pointer on reset after PCI error
Colin Ian King <[email protected]>
MIPS: ralink: Fix incorrect assignment on ralink_soc
Paul Burton <[email protected]>
MIPS: Ensure bss section ends on a long-aligned address
Simon Horman <[email protected]>
ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes
Santosh Shilimkar <[email protected]>
RDS: RDMA: Fix the composite message user notification
Dan Carpenter <[email protected]>
GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
Bartosz Golaszewski <[email protected]>
drm: bridge: add DT bindings for TI ths8135
Kristian H. Kristensen <[email protected]>
drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define
-------------
Diffstat:
.../bindings/display/bridge/ti,ths8135.txt | 46 +++++++++++ .../devicetree/bindings/iio/adc/avia-hx711.txt | 18 +++++ .../devicetree/bindings/vendor-prefixes.txt | 1 + Makefile | 4 +- arch/arm/Kconfig-nommu | 3 +- arch/arm/boot/dts/r8a7790.dtsi | 12 ++- arch/arm/mach-at91/pm.c | 2 +- arch/arm/mach-bcm/bcm_kona_smc.c | 2 +- arch/arm/mach-cns3xxx/core.c | 2 +- arch/arm/mach-omap2/prm_common.c | 2 +- arch/arm/mach-omap2/vc.c | 2 +- arch/arm/mach-spear/time.c | 2 +- arch/mips/include/asm/irq.h | 15 ++++ arch/mips/kernel/asm-offsets.c | 1 + arch/mips/kernel/genex.S | 8 +- arch/mips/kernel/process.c | 56 ++++++++----- arch/mips/kernel/vmlinux.lds.S | 2 +- arch/mips/lantiq/xway/sysctrl.c | 4 +- arch/mips/ralink/rt3883.c | 2 +- arch/parisc/kernel/perf.c | 94 +++++++++++----------- block/partitions/efi.c | 17 ++-- drivers/ata/libata-transport.c | 9 +-- drivers/extcon/extcon-axp288.c | 2 +- drivers/firmware/psci.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 4 +- drivers/hwmon/gl520sm.c | 25 +++--- drivers/i2c/busses/i2c-meson.c | 2 +- drivers/iio/adc/axp288_adc.c | 32 +------- drivers/infiniband/hw/qib/qib_iba7322.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 +- drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 10 ++- drivers/iommu/io-pgtable-arm.c | 6 +- drivers/md/raid10.c | 19 ++++- drivers/media/pci/ttpci/av7110_hw.c | 8 +- drivers/media/pci/ttpci/av7110_hw.h | 12 +-- drivers/media/platform/exynos-gsc/gsc-core.c | 2 - drivers/mmc/core/sdio_bus.c | 12 ++- drivers/net/ethernet/intel/igb/igb_main.c | 5 ++ drivers/net/ethernet/renesas/sh_eth.h | 2 +- drivers/net/team/team.c | 8 +- drivers/net/usb/Kconfig | 2 +- drivers/net/usb/plusb.c | 15 +++- drivers/pinctrl/mvebu/pinctrl-mvebu.c | 9 ++- drivers/tty/goldfish.c | 2 +- drivers/usb/chipidea/otg.c | 17 ++-- drivers/usb/serial/mos7720.c | 9 ++- drivers/usb/serial/mos7840.c | 19 ++++- fs/gfs2/glock.c | 12 +-- fs/xfs/kmem.c | 18 ----- fs/xfs/kmem.h | 2 - fs/xfs/xfs_itable.c | 6 +- include/linux/audit.h | 20 +++++ include/linux/mmc/sdio_func.h | 2 +- include/uapi/drm/drm_fourcc.h | 1 + net/bridge/br_netlink.c | 7 +- net/compat.c | 17 +++- net/core/dev.c | 3 + net/ipv4/netfilter/nf_nat_snmp_basic.c | 1 + net/netfilter/nf_conntrack_ecache.c | 2 + net/netfilter/nf_conntrack_netlink.c | 1 + net/netfilter/nf_nat_core.c | 2 + net/netfilter/nfnetlink_cthelper.c | 20 ++--- net/netfilter/nfnetlink_cttimeout.c | 2 +- net/packet/af_packet.c | 2 + net/rds/ib_cm.c | 47 ++++++++--- net/rds/ib_send.c | 25 +++--- net/rds/rdma.c | 10 +++ net/rds/rds.h | 1 + net/rds/send.c | 4 +- sound/pci/au88x0/au88x0_core.c | 3 + sound/soc/soc-dapm.c | 62 ++++++++++++++ sound/soc/soc-topology.c | 9 +++ 72 files changed, 565 insertions(+), 252 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/50 drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Kristian H. Kristensen" <[email protected]>
[ Upstream commit af913418261d6d3e7a29f06cf35f04610ead667c ]
We need to define DRM_FORMAT_MOD_VENDOR_NONE for the fourcc_mod_code() macro to work correctly.
--- include/uapi/drm/drm_fourcc.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/drm/drm_fourcc.h +1 -0
@@ -150,6 +150,7 @@/* Vendor Ids: */ #define DRM_FORMAT_MOD_NONE 0 +#define DRM_FORMAT_MOD_VENDOR_NONE 0#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01#define DRM_FORMAT_MOD_VENDOR_AMD 0x02#define DRM_FORMAT_MOD_VENDOR_NV 0x03
Greg Kroah-Hartman
maintainerPATCH 2/50 drm: bridge: add DT bindings for TI ths8135
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
[ Upstream commit 2e644be30fcc08c736f66b60f4898d274d4873ab ]
THS8135 is a configurable video DAC. Add DT bindings for this chip.
--- Documentation/devicetree/bindings/display/bridge/ti,ths8135.txt | 46 ++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,ths8135.txt
Documentation/devicetree/bindings/display/bridge/ti,ths8135.txt new file +46 -0
@@ -0,0 +1,46 @@ +THS8135 Video DAC +----------------- + +This is the binding for Texas Instruments THS8135 Video DAC bridge. + +Required properties: + +- compatible: Must be "ti,ths8135" + +Required nodes: + +This device has two video ports. Their connections are modelled using the OF +graph bindings specified in Documentation/devicetree/bindings/graph.txt. + +- Video port 0 for RGB input +- Video port 1 for VGA output + +Example +------- + +vga-bridge { + compatible = "ti,ths8135"; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + vga_bridge_in: endpoint { + remote-endpoint = <&lcdc_out_vga>; + }; + }; + + port@1 { + reg = <1>; + + vga_bridge_out: endpoint { + remote-endpoint = <&vga_con_in>; + }; + }; + }; +};
Re: [PATCH 4.4 02/50] drm: bridge: add DT bindings for TI ths8135
Quoted 11 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
[ Upstream commit
2e644be30fcc08c736f66b60f4898d274d4873ab]THS8135 is a configurable video DAC. Add DT bindings for this chip.
[...]
Why would we do that, with no driver or device trees referring to it?
Ben.
Signature · 2 lines
Ben Hutchings Software Developer, Codethink Ltd.
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 02/50] drm: bridge: add DT bindings for TI ths8135
Quoted 9 lines · Ben Hutchings
Quoted 8 lines · Greg Kroah-Hartman
4.4-stable review patch.��If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
Quoted 6 lines
Quoted 3 lines
[ Upstream commit
2e644be30fcc08c736f66b60f4898d274d4873ab]THS8135 is a configurable video DAC. Add DT bindings for this chip.
[...]
Why would we do that, with no driver or device trees referring to it?
Good question :)
Sasha, I can revert this, right?
thanks,
greg k-h
Re: [PATCH 4.4 02/50] drm: bridge: add DT bindings for TI ths8135
Quoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Ben Hutchings
Quoted 10 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
[ Upstream commit
2e644be30fcc08c736f66b60f4898d274d4873ab]
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
THS8135 is a configurable video DAC. Add DT bindings for this chip.
[...]
Why would we do that, with no driver or device trees referring to it?
Good question :)
Sasha, I can revert this, right?
Yes, please.
After Ben's comment I tried to automate this check and forgot to reply :)
Signature · 2 lines
Thanks, Sasha
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 02/50] drm: bridge: add DT bindings for TI ths8135
Quoted 18 lines · Alexander (Sasha Levin)
Quoted 17 lines · Greg Kroah-Hartman
Quoted 15 lines · Ben Hutchings
Quoted 11 lines · Greg Kroah-Hartman
4.4-stable review patch.��If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
[ Upstream commit
2e644be30fcc08c736f66b60f4898d274d4873ab]THS8135 is a configurable video DAC. Add DT bindings for this chip.
[...]
Why would we do that, with no driver or device trees referring to it?
Quoted 7 lines
Quoted 3 lines
Good question :)
Sasha, I can revert this, right?
Yes, please.
After Ben's comment I tried to automate this check and forgot to reply :)
Great, now reverted.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 3/50 GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 14d37564fa3dc4e5d4c6828afcd26ac14e6796c5 ]
This patch fixes a place where function gfs2_glock_iter_next can reference an invalid error pointer.
--- fs/gfs2/glock.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
fs/gfs2/glock.c +7 -5
@@ -1798,16 +1798,18 @@ void gfs2_glock_exit(void)static void gfs2_glock_iter_next (struct gfs2_glock_iter *gi) { -do { - gi->gl =rhashtable_walk_next (&gi->hti); +while ((gi->gl =rhashtable_walk_next (&gi->hti))) {if (IS_ERR (gi->gl)) {if (PTR_ERR (gi->gl) == -EAGAIN )continue ; gi->gl =NULL ; +return ; } -/* Skip entries for other sb and dead entries */ - }while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) || -__lockref_is_dead (&gi->gl->gl_lockref))); +/* Skip entries for other sb and dead entries */ +if (gi->sdp == gi->gl->gl_name.ln_sbd && + !__lockref_is_dead (&gi->gl->gl_lockref)) +return ; + } }static void *gfs2_glock_seq_start (struct seq_file *seq,loff_t *pos)
Greg Kroah-Hartman
maintainerPATCH 4/50 RDS: RDMA: Fix the composite message user notification
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Santosh Shilimkar <[email protected]>
[ Upstream commit 941f8d55f6d613a460a5e080d25a38509f45eb75 ]
When application sends an RDS RDMA composite message consist of RDMA transfer to be followed up by non RDMA payload, it expect to be notified *only* when the full message gets delivered. RDS RDMA notification doesn't behave this way though.
Thanks to Venkat for debug and root casuing the issue where only first part of the message(RDMA) was successfully delivered but remainder payload delivery failed. In that case, application should not be notified with a false positive of message delivery success.
Fix this case by making sure the user gets notified only after the full message delivery.
--- net/rds/ib_send.c | 25 +++++++++++++++---------- net/rds/rdma.c | 10 ++++++++++ net/rds/rds.h | 1 + net/rds/send.c | 4 +++- 4 files changed, 29 insertions(+), 11 deletions(-)
net/rds/ib_send.c +15 -10
@@ -68,16 +68,6 @@ static void rds_ib_send_complete(structcomplete (rm, notify_status); } -static void rds_ib_send_unmap_data (struct rds_ib_connection *ic, -struct rm_data_op *op, -int wc_status) -{ -if (op->op_nents) -ib_dma_unmap_sg (ic->i_cm_id->device, - op->op_sg, op->op_nents, -DMA_TO_DEVICE ); -} -static void rds_ib_send_unmap_rdma (struct rds_ib_connection *ic,struct rm_rdma_op *op,int wc_status)
@@ -138,6 +128,21 @@ static void rds_ib_send_unmap_atomic(strrds_ib_stats_inc (s_ib_atomic_fadd); } +static void rds_ib_send_unmap_data (struct rds_ib_connection *ic, +struct rm_data_op *op, +int wc_status) +{ + struct rds_message *rm = container_of(op, struct rds_message, data); + +if (op->op_nents) +ib_dma_unmap_sg (ic->i_cm_id->device, + op->op_sg, op->op_nents, +DMA_TO_DEVICE ); + +if (rm->rdma.op_active && rm->data.op_notify) +rds_ib_send_unmap_rdma (ic, &rm->rdma, wc_status); +} +/* * Unmap the resources associated with a struct send_work. *
net/rds/rdma.c +10 -0
@@ -626,6 +626,16 @@ int rds_cmsg_rdma_args(struct rds_sock * } op->op_notifier->n_user_token = args->user_token; op->op_notifier->n_status =RDS_RDMA_SUCCESS ; + +/* Enable rmda notification on data operation for composite +* rds messages and make sure notification is enabled only +* for the data operation which follows it so that application +* gets notified only after full message gets delivered. +*/ +if (rm->data.op_sg) { + rm->rdma.op_notify =0 ; + rm->data.op_notify = !!(args->flags &RDS_RDMA_NOTIFY_ME ); + } }/* The cookie contains the R_Key of the remote memory region, and
net/rds/rds.h +1 -0
@@ -378,6 +378,7 @@ struct rds_message { } rdma;struct rm_data_op {unsigned int op_active:1 ; +unsigned int op_notify:1 ;unsigned int op_nents;unsigned int op_count;unsigned int op_dmasg;
net/rds/send.c +3 -1
@@ -467,12 +467,14 @@ void rds_rdma_send_complete(struct rds_mstruct rm_rdma_op *ro;struct rds_notifier *notifier;unsigned long flags; +unsigned int notify =0 ;spin_lock_irqsave (&rm->m_rs_lock, flags); + notify = rm->rdma.op_notify | rm->data.op_notify; ro = &rm->rdma;if (test_bit (RDS_MSG_ON_SOCK , &rm->m_flags) && - ro->op_active && ro->op_notify && ro->op_notifier) { + ro->op_active && notify && ro->op_notifier) { notifier = ro->op_notifier; rs = rm->m_rs;sock_hold (rds_rs_to_sk (rs));
Greg Kroah-Hartman
maintainerPATCH 5/50 ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Horman <[email protected]>
[ Upstream commit 654450baf2afba86cf328e1849ccac61ec4630af ]
Use recently added R-Car Gen 2 fallback binding for msiof nodes in DT for r8a7790 SoC.
This has no run-time effect for the current driver as the initialisation sequence is the same for the SoC-specific binding for r8a7790 and the fallback binding for R-Car Gen 2.
--- arch/arm/boot/dts/r8a7790.dtsi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
arch/arm/boot/dts/r8a7790.dtsi +8 -4
@@ -1409,7 +1409,8 @@ }; msiof0: spi@e6e20000 { - compatible = "renesas,msiof-r8a7790"; + compatible = "renesas,msiof-r8a7790", + "renesas,rcar-gen2-msiof"; reg = <0 0xe6e20000 0 0x0064>; interrupts = <0 156 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp0_clks R8A7790_CLK_MSIOF0>;
@@ -1422,7 +1423,8 @@ }; msiof1: spi@e6e10000 { - compatible = "renesas,msiof-r8a7790"; + compatible = "renesas,msiof-r8a7790", + "renesas,rcar-gen2-msiof"; reg = <0 0xe6e10000 0 0x0064>; interrupts = <0 157 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp2_clks R8A7790_CLK_MSIOF1>;
@@ -1435,7 +1437,8 @@ }; msiof2: spi@e6e00000 { - compatible = "renesas,msiof-r8a7790"; + compatible = "renesas,msiof-r8a7790", + "renesas,rcar-gen2-msiof"; reg = <0 0xe6e00000 0 0x0064>; interrupts = <0 158 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp2_clks R8A7790_CLK_MSIOF2>;
@@ -1448,7 +1451,8 @@ }; msiof3: spi@e6c90000 { - compatible = "renesas,msiof-r8a7790"; + compatible = "renesas,msiof-r8a7790", + "renesas,rcar-gen2-msiof"; reg = <0 0xe6c90000 0 0x0064>; interrupts = <0 159 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp2_clks R8A7790_CLK_MSIOF3>;
Greg Kroah-Hartman
maintainerPATCH 6/50 MIPS: Ensure bss section ends on a long-aligned address
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Burton <[email protected]>
[ Upstream commit 3f00f4d8f083bc61005d0a1ef592b149f5c88bbd ]
When clearing the .bss section in kernel_entry we do so using LONG_S instructions, and branch whilst the current write address doesn't equal the end of the .bss section minus the size of a long integer. The .bss section always begins at a long-aligned address and we always increment the write pointer by the size of a long integer - we therefore rely upon the .bss section ending at a long-aligned address. If this is not the case then the long-aligned write address can never be equal to the non-long-aligned end address & we will continue to increment past the end of the .bss section, attempting to zero the rest of memory.
Despite this requirement that .bss end at a long-aligned address we pass 0 as the end alignment requirement to the BSS_SECTION macro and thus don't guarantee any particular alignment, allowing us to hit the error condition described above.
Fix this by instead passing 8 bytes as the end alignment argument to the BSS_SECTION macro, ensuring that the end of the .bss section is always at least long-aligned.
Patchwork: https://patchwork.linux-mips.org/patch/14526/
--- arch/mips/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/kernel/vmlinux.lds.S +1 -1
@@ -159,7 +159,7 @@ SECTIONS * Force .bss to 64K alignment so that .bss..swapper_pg_dir * gets that alignment. .sbss should be empty, so there will be * no holes after __init_end. */ - BSS_SECTION(0, 0x10000, 0) + BSS_SECTION(0, 0x10000, 8) _end = . ;
Greg Kroah-Hartman
maintainerPATCH 7/50 MIPS: ralink: Fix incorrect assignment on ralink_soc
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <[email protected]>
[ Upstream commit 08d90c81b714482dceb5323d14f6617bcf55ee61 ]
ralink_soc sould be assigned to RT3883_SOC, replace incorrect comparision with assignment.
Patchwork: https://patchwork.linux-mips.org/patch/14903/
--- arch/mips/ralink/rt3883.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/ralink/rt3883.c +1 -1
@@ -144,5 +144,5 @@ void prom_soc_init(struct ralink_soc_inf rt2880_pinmux_data = rt3883_pinmux_data; - ralink_soc ==RT3883_SOC ; + ralink_soc =RT3883_SOC ; }
Greg Kroah-Hartman
maintainerPATCH 8/50 igb: re-assign hw address pointer on reset after PCI error
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guilherme G Piccoli <[email protected]>
[ Upstream commit 69b97cf6dbce7403845a28bbc75d57f5be7b12ac ]
Whenever the igb driver detects the result of a read operation returns a value composed only by F's (like 0xFFFFFFFF), it will detach the net_device, clear the hw_addr pointer and warn to the user that adapter's link is lost - those steps happen on igb_rd32().
In case a PCI error happens on Power architecture, there's a recovery mechanism called EEH, that will reset the PCI slot and call driver's handlers to reset the adapter and network functionality as well.
We observed that once hw_addr is NULL after the error is detected on igb_rd32(), it's never assigned back, so in the process of resetting the network functionality we got a NULL pointer dereference in both igb_configure_tx_ring() and igb_configure_rx_ring(). In order to avoid such bug, this patch re-assigns the hw_addr value in the slot_reset handler.
--- drivers/net/ethernet/intel/igb/igb_main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/igb/igb_main.c +5 -0
@@ -7658,6 +7658,11 @@ static pci_ers_result_t igb_io_slot_resepci_enable_wake (pdev, PCI_D3hot,0 );pci_enable_wake (pdev, PCI_D3cold,0 ); +/* In case of PCI error, adapter lose its HW address +* so we should re-assign it here. +*/ + hw->hw_addr = adapter->io_addr; +igb_reset (adapter);wr32 (E1000_WUS , ~0 ); result =PCI_ERS_RESULT_RECOVERED ;
Greg Kroah-Hartman
maintainerPATCH 9/50 extcon: axp288: Use vbus-valid instead of -present to determine cable presence
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 5757aca10146061befd168dab37fb0db1ccd8f73 ]
The vbus-present bit in the power status register also gets set to 1 when a usb-host cable (id-pin shorted to ground) is plugged in and a 5v boost converter is supplying 5v to the otg usb bus.
This causes a "disconnect or unknown or ID event" warning in dmesg as well as the extcon device to report the last detected charger cable type as being connected even though none is connected.
This commit switches to checking the vbus-valid bit instead, which is only 1 when both vbus is present and the vbus-path is enabled in the vbus-path control register (the vbus-path gets disabled when a usb-host cable is detected, to avoid the pmic drawing power from the 5v boost converter).
--- drivers/extcon/extcon-axp288.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-axp288.c +1 -1
@@ -168,7 +168,7 @@ static int axp288_handle_chrg_det_event(return ret; } - vbus_attach = (pwr_stat &PS_STAT_VBUS_PRESENT ); + vbus_attach = (pwr_stat &PS_STAT_VBUS_VALID );if (!vbus_attach) goto notify_otg;
Greg Kroah-Hartman
maintainerPATCH 11/50 hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit 87cdfa9d60f4f40e6d71b04b10b36d9df3c89282 ]
Writes into limit attributes can overflow due to multplications and additions with unbound input values. Writing into fan limit attributes can result in a crash with a division by zero if very large values are written and the fan divider is larger than 1.
--- drivers/hwmon/gl520sm.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
drivers/hwmon/gl520sm.c +17 -10
@@ -208,11 +208,13 @@ static ssize_t get_cpu_vid(struct device } static DEVICE_ATTR(cpu0_vid, S_IRUGO, get_cpu_vid, NULL); -#define VDD_FROM_REG (val) (((val) * 95 + 2) / 4) -#define VDD_TO_REG (val) clamp_val((((val) * 4 + 47) / 95), 0, 255) - -#define IN_FROM_REG (val) ((val) * 19) -#define IN_TO_REG (val) clamp_val((((val) + 9) / 19), 0, 255) +#define VDD_FROM_REG (val) DIV_ROUND_CLOSEST((val) * 95, 4) +#define VDD_CLAMP (val) clamp_val(val, 0, 255 * 95 / 4) +#define VDD_TO_REG (val) DIV_ROUND_CLOSEST(VDD_CLAMP(val) * 4, 95) + +#define IN_FROM_REG (val) ((val) * 19) +#define IN_CLAMP (val) clamp_val(val, 0, 255 * 19) +#define IN_TO_REG (val) DIV_ROUND_CLOSEST(IN_CLAMP(val), 19)static ssize_t get_in_input (struct device *dev,struct device_attribute *attr,char *buf)
@@ -349,8 +351,13 @@ static SENSOR_DEVICE_ATTR(in4_max, S_IRU#define DIV_FROM_REG (val) (1 << (val))#define FAN_FROM_REG (val, div) ((val) == 0 ? 0 : (480000 / ((val) << (div)))) -#define FAN_TO_REG (val, div) ((val) <= 0 ? 0 : \ - clamp_val((480000 + ((val) << ((div)-1))) / ((val) << (div)), 1, 255)) + +#define FAN_BASE (div) (480000 >> (div)) +#define FAN_CLAMP (val, div) clamp_val(val, FAN_BASE(div) / 255, \ + FAN_BASE(div)) +#define FAN_TO_REG (val, div) ((val) == 0 ? 0 : \ + DIV_ROUND_CLOSEST(480000, \ + FAN_CLAMP(val, div) << (div)))static ssize_t get_fan_input (struct device *dev,struct device_attribute *attr,char *buf)
@@ -513,9 +520,9 @@ static SENSOR_DEVICE_ATTR(fan2_div, S_IR static DEVICE_ATTR(fan1_off, S_IRUGO | S_IWUSR, get_fan_off, set_fan_off); -#define TEMP_FROM_REG (val) (((val) - 130) * 1000) -#define TEMP_TO_REG (val) clamp_val(((((val) < 0 ? \ - (val) - 500 : (val) + 500) / 1000) + 130), 0, 255) +#define TEMP_FROM_REG (val) (((val) - 130) * 1000) +#define TEMP_CLAMP (val) clamp_val(val, -130000, 125000) +#define TEMP_TO_REG (val) (DIV_ROUND_CLOSEST(TEMP_CLAMP(val), 1000) + 130)static ssize_t get_temp_input (struct device *dev,struct device_attribute *attr,char *buf)
Greg Kroah-Hartman
maintainerPATCH 12/50 iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit fa2849e9649b5180ffc4cb3c3b005261c403093a ]
For some reason the axp288_adc driver was modifying the AXP288_ADC_TS_PIN_CTRL register, changing bits 0-1 depending on whether the GP_ADC channel or another channel was written.
These bits control when a bias current is send to the TS_PIN, the GP_ADC has its own pin and a separate bit in another register to control the bias current.
Not only does changing when to enable the TS_PIN bias current (always or only when sampling) when reading the GP_ADC make no sense at all, the code is modifying these bits is writing the entire register, assuming that all the other bits have their default value.
So if the firmware has configured a different bias-current for either pin, then that change gets clobbered by the write, likewise if the firmware has set bit 2 to indicate that the battery has no thermal sensor, this will get clobbered by the write.
This commit fixes all this, by simply removing all writes to the AXP288_ADC_TS_PIN_CTRL register, they are not needed to read the GP_ADC pin, and can actually be harmful.
--- drivers/iio/adc/axp288_adc.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-)
drivers/iio/adc/axp288_adc.c +1 -31
@@ -28,8 +28,6 @@#include <linux/iio/driver.h> #define AXP288_ADC_EN_MASK 0xF1 -#define AXP288_ADC_TS_PIN_GPADC 0xF2 -#define AXP288_ADC_TS_PIN_ON 0xF3enum axp288_adc_id {AXP288_ADC_TS ,
@@ -123,16 +121,6 @@ static int axp288_adc_read_channel(int *return IIO_VAL_INT ; } -static int axp288_adc_set_ts (struct regmap *regmap,unsigned int mode, -unsigned long address) -{ -/* channels other than GPADC do not need to switch TS pin */ -if (address !=AXP288_GP_ADC_H ) -return 0 ; - -return regmap_write (regmap,AXP288_ADC_TS_PIN_CTRL , mode); -} -static int axp288_adc_read_raw (struct iio_dev *indio_dev,struct iio_chan_spec const *chan,int *val,int *val2,long mask)
@@ -143,16 +131,7 @@ static int axp288_adc_read_raw(struct iimutex_lock (&indio_dev->mlock);switch (mask) {case IIO_CHAN_INFO_RAW : -if (axp288_adc_set_ts (info->regmap,AXP288_ADC_TS_PIN_GPADC , - chan->address)) { -dev_err (&indio_dev->dev,"GPADC mode\n" ); - ret = -EINVAL ; -break ; - } ret =axp288_adc_read_channel (val, chan->address, info->regmap); -if (axp288_adc_set_ts (info->regmap,AXP288_ADC_TS_PIN_ON , - chan->address)) -dev_err (&indio_dev->dev,"TS pin restore\n" );break ;default : ret = -EINVAL ;
@@ -162,15 +141,6 @@ static int axp288_adc_read_raw(struct iireturn ret; } -static int axp288_adc_set_state (struct regmap *regmap) -{ -/* ADC should be always enabled for internal FG to function */ -if (regmap_write (regmap,AXP288_ADC_TS_PIN_CTRL ,AXP288_ADC_TS_PIN_ON )) -return -EIO ; - -return regmap_write (regmap,AXP20X_ADC_EN1 ,AXP288_ADC_EN_MASK ); -} -static const struct iio_info axp288_adc_iio_info = { .read_raw = &axp288_adc_read_raw, .driver_module =THIS_MODULE ,
@@ -199,7 +169,7 @@ static int axp288_adc_probe(struct platf* Set ADC to enabled state at all time, including system suspend. * otherwise internal fuel gauge functionality may be affected. */ - ret =axp288_adc_set_state (axp20x->regmap); + ret =regmap_write (info->regmap,AXP20X_ADC_EN1 ,AXP288_ADC_EN_MASK );if (ret) {dev_err (&pdev->dev,"unable to enable ADC device\n" );return ret;
Greg Kroah-Hartman
maintainerPATCH 13/50 iio: adc: hx711: Add DT binding for avia,hx711
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Klinger <[email protected]>
[ Upstream commit ff1293f67734da68e23fecb6ecdae7112b8c43f9 ]
Add DT bindings for avia,hx711
Add vendor avia to vendor list
--- Documentation/devicetree/bindings/iio/adc/avia-hx711.txt | 18 +++++++++++++++ Documentation/devicetree/bindings/vendor-prefixes.txt | 1 2 files changed, 19 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/avia-hx711.txt
Documentation/devicetree/bindings/iio/adc/avia-hx711.txt new file +18 -0
@@ -0,0 +1,18 @@ +* AVIA HX711 ADC chip for weight cells + Bit-banging driver + +Required properties: + - compatible: Should be "avia,hx711" + - sck-gpios: Definition of the GPIO for the clock + - dout-gpios: Definition of the GPIO for data-out + See Documentation/devicetree/bindings/gpio/gpio.txt + - avdd-supply: Definition of the regulator used as analog supply + +Example: +weight@0 { + compatible = "avia,hx711"; + sck-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>; + dout-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + avdd-suppy = <&avdd>; +}; +
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -31,6 +31,7 @@ asahi-kasei Asahi Kasei Corp. atmel Atmel Corporation auo AU Optronics Corporation avago Avago Technologies +avia avia semiconductor avic Shanghai AVIC Optoelectronics Co., Ltd. axis Axis Communications AB bosch Bosch Sensortec GmbH
Greg Kroah-Hartman
maintainerPATCH 14/50 ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Afzal Mohammed <[email protected]>
[ Upstream commit 8a792e9afbce84a0fdaf213fe42bb97382487094 ]
REMAP_VECTORS_TO_RAM depends on DRAM_BASE, but since DRAM_BASE is a hex, REMAP_VECTORS_TO_RAM could never get enabled. Also depending on DRAM_BASE is redundant as whenever REMAP_VECTORS_TO_RAM makes itself available to Kconfig, DRAM_BASE also is available as the Kconfig gets sourced on !MMU.
--- arch/arm/Kconfig-nommu | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/Kconfig-nommu +1 -2
@@ -34,8 +34,7 @@ config PROCESSOR_ID used instead of the auto-probing which utilizes the register. config REMAP_VECTORS_TO_RAM - bool 'Install vectors to the beginning of RAM' if DRAM_BASE - depends on DRAM_BASE + bool 'Install vectors to the beginning of RAM' help The kernel needs to change the hardware exception vectors. In nommu mode, the hardware exception vectors are normally
Greg Kroah-Hartman
maintainerPATCH 15/50 tty: goldfish: Fix a parameter of a call to free_irq
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 1a5c2d1de7d35f5eb9793266237903348989502b ]
'request_irq()' and 'free_irq()' should be called with the same dev_id.
--- drivers/tty/goldfish.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/goldfish.c +1 -1
@@ -293,7 +293,7 @@ static int goldfish_tty_probe(struct plareturn 0 ; err_tty_register_device_failed: -free_irq (irq, pdev); +free_irq (irq, qtty); err_request_irq_failed: goldfish_tty_current_line_count--;if (goldfish_tty_current_line_count ==0 )
Re: [PATCH 4.4 15/50] tty: goldfish: Fix a parameter of a call to free_irq
Quoted 5 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 7 lines
From: Christophe JAILLET <[email protected]>
[ Upstream commit
1a5c2d1de7d35f5eb9793266237903348989502b]'
request_irq()' and 'free_irq()' should be called with the samedev_id.
[...]
This fixes a bug introduced in 4.6 by commit 465893e18878 "tty:
goldfish: support platform_device with id -1". For earlier kernel versions, it *introduces* a bug.
Please revert from the 3.18 and 4.4 branches.
Ben.
Signature · 2 lines
Ben Hutchings Software Developer, Codethink Ltd.
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 15/50] tty: goldfish: Fix a parameter of a call to free_irq
Quoted 13 lines · Ben Hutchings
Quoted 5 lines · Greg Kroah-Hartman
4.4-stable review patch.��If anyone has any objections, please let me know.
------------------
Quoted 7 lines
From: Christophe JAILLET <[email protected]>
[ Upstream commit
1a5c2d1de7d35f5eb9793266237903348989502b]'
request_irq()' and 'free_irq()' should be called with the samedev_id.
Quoted 7 lines
[...]
This fixes a bug introduced in 4.6 by commit
465893e18878"tty:
goldfish: supportplatform_devicewith id -1". For earlier kernel versions, it *introduces* a bug.Please revert from the 3.18 and 4.4 branches.
Ugh, the goldfish drivers are a pain lately...
I'll go revert this, luckily no one actually runs them in the tree :)
thanks,
greg k-h
Greg Kroah-Hartman
maintainerPATCH 16/50 IB/ipoib: Fix deadlock over vlan_mutex
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feras Daoud <[email protected]>
[ Upstream commit 1c3098cdb05207e740715857df7b0998e372f527 ]
This patch fixes Deadlock while executing ipoib_vlan_delete.
The function takes the vlan_rwsem semaphore and calls unregister_netdevice. The later function calls ipoib_mcast_stop_thread that cause workqueue flush.
When the queue has one of the ipoib_ib_dev_flush_xxx events, a deadlock occur because these events also tries to catch the same vlan_rwsem semaphore.
To fix, unregister_netdevice should be called after releasing the semaphore.
--- drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +5 -1
@@ -185,7 +185,6 @@ int ipoib_vlan_delete(struct net_devicelist_for_each_entry_safe (priv, tpriv, &ppriv->child_intfs, list) {if (priv->pkey == pkey && priv->child_type ==IPOIB_LEGACY_CHILD ) { -unregister_netdevice (priv->dev);list_del (&priv->list); dev = priv->dev;break ;
@@ -193,6 +192,11 @@ int ipoib_vlan_delete(struct net_device }up_write (&ppriv->vlan_rwsem); +if (dev) { +ipoib_dbg (ppriv,"delete child vlan %s\n" , dev->name); +unregister_netdevice (dev); + } +rtnl_unlock ();if (dev) {
Greg Kroah-Hartman
maintainerPATCH 17/50 IB/ipoib: rtnl_unlock can not come after free_netdev
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feras Daoud <[email protected]>
[ Upstream commit 89a3987ab7a923c047c6dec008e60ad6f41fac22 ]
The ipoib_vlan_add function calls rtnl_unlock after free_netdev, rtnl_unlock not only releases the lock, but also calls netdev_run_todo. The latter function browses the net_todo_list array and completes the unregistration of all its net_device instances. If we call free_netdev before rtnl_unlock, then netdev_run_todo call over the freed device causes panic.
To fix, move rtnl_unlock call before free_netdev call.
--- drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +2 -2
@@ -160,11 +160,11 @@ int ipoib_vlan_add(struct net_device *pd out:up_write (&ppriv->vlan_rwsem); +rtnl_unlock (); +if (result)free_netdev (priv->dev); -rtnl_unlock (); -return result; }
Greg Kroah-Hartman
maintainerPATCH 18/50 IB/ipoib: Replace list_del of the neigh->list with list_del_init
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feras Daoud <[email protected]>
[ Upstream commit c586071d1dc8227a7182179b8e50ee92cc43f6d2 ]
In order to resolve a situation where a few process delete the same list element in sequence and cause panic, list_del is replaced with list_del_init. In this case if the first process that calls list_del releases the lock before acquiring it again, other processes who can acquire the lock will call list_del_init.
--- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +4 -4
@@ -1239,7 +1239,7 @@ static void __ipoib_reap_neigh(struct iprcu_dereference_protected (neigh->hnext, lockdep_is_held(&priv->lock)));/* remove from path/mc list */ -list_del (&neigh->list); +list_del_init (&neigh->list);call_rcu (&neigh->rcu, ipoib_neigh_reclaim); }else { np = &neigh->hnext;
@@ -1406,7 +1406,7 @@ void ipoib_neigh_free(struct ipoib_neighrcu_dereference_protected (neigh->hnext, lockdep_is_held(&priv->lock)));/* remove from parent list */ -list_del (&neigh->list); +list_del_init (&neigh->list);call_rcu (&neigh->rcu, ipoib_neigh_reclaim);return ; }else {
@@ -1491,7 +1491,7 @@ void ipoib_del_neighs_by_gid(struct net_rcu_dereference_protected (neigh->hnext, lockdep_is_held(&priv->lock)));/* remove from parent list */ -list_del (&neigh->list); +list_del_init (&neigh->list);call_rcu (&neigh->rcu, ipoib_neigh_reclaim); }else { np = &neigh->hnext;
@@ -1533,7 +1533,7 @@ static void ipoib_flush_neighs(struct iprcu_dereference_protected (neigh->hnext, lockdep_is_held(&priv->lock)));/* remove from path/mc list */ -list_del (&neigh->list); +list_del_init (&neigh->list);call_rcu (&neigh->rcu, ipoib_neigh_reclaim); } }
Greg Kroah-Hartman
maintainerPATCH 19/50 drm/amdkfd: fix improper return value on error
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pan Bian <[email protected]>
[ Upstream commit 8bf793883da213864efc50c274d2b38ec0ca58b2 ]
In function kfd_wait_on_events(), when the call to copy_from_user() fails, the value of return variable ret is 0. 0 indicates success, which is inconsistent with the execution status. This patch fixes the bug by assigning "-EFAULT" to ret when copy_from_user() returns an unexpected value.
--- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_events.c +3 -1
@@ -739,8 +739,10 @@ int kfd_wait_on_events(struct kfd_processtruct kfd_event_data event_data;if (copy_from_user (&event_data, &events[i], -sizeof (struct kfd_event_data ))) +sizeof (struct kfd_event_data ))) { + ret = -EFAULT ; goto fail; + } ret =init_event_waiter (p, &event_waiters[i], event_data.event_id, i);
Greg Kroah-Hartman
maintainerPATCH 20/50 USB: serial: mos7720: fix control-message error handling
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 0d130367abf582e7cbf60075c2a7ab53817b1d14 ]
Make sure to log an error on short transfers when reading a device register.
Also clear the provided buffer (which if often an uninitialised automatic variable) on errors as the driver currently does not bother to check for errors.
--- drivers/usb/serial/mos7720.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/usb/serial/mos7720.c +7 -2
@@ -234,11 +234,16 @@ static int read_mos_reg(struct usb_seria status =usb_control_msg (usbdev, pipe, request, requesttype, value, index, buf,1 ,MOS_WDR_TIMEOUT ); -if (status ==1 ) +if (status ==1 ) { *data = *buf; -else if (status <0 ) + }else {dev_err (&usbdev->dev,"mos7720: usb_control_msg() failed: %d\n" , status); +if (status >=0 ) + status = -EIO ; + *data =0 ; + } +kfree (buf);return status;
Greg Kroah-Hartman
maintainerPATCH 21/50 USB: serial: mos7840: fix control-message error handling
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit cd8db057e93ddaacbec025b567490555d2bca280 ]
Make sure to detect short transfers when reading a device register.
The modem-status handling had sufficient error checks in place, but move handling of short transfers into the register accessor function itself for consistency.
--- drivers/usb/serial/mos7840.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/usb/serial/mos7840.c +15 -4
@@ -285,9 +285,15 @@ static int mos7840_get_reg_sync(struct u ret =usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ),MCS_RDREQ ,MCS_RD_RTYPE ,0 , reg, buf,VENDOR_READ_LENGTH ,MOS_WDR_TIMEOUT ); +if (ret <VENDOR_READ_LENGTH ) { +if (ret >=0 ) + ret = -EIO ; + goto out; + } + *val = buf[0 ];dev_dbg (&port->dev,"%s offset is %x, return val %x\n" , __func__, reg, *val); - +out:kfree (buf);return ret; }
@@ -353,8 +359,13 @@ static int mos7840_get_uart_reg(struct u ret =usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ),MCS_RDREQ ,MCS_RD_RTYPE , Wval, reg, buf,VENDOR_READ_LENGTH ,MOS_WDR_TIMEOUT ); +if (ret <VENDOR_READ_LENGTH ) { +if (ret >=0 ) + ret = -EIO ; + goto out; + } *val = buf[0 ]; - +out:kfree (buf);return ret; }
@@ -1490,10 +1501,10 @@ static int mos7840_tiocmget(struct tty_sreturn -ENODEV ; status =mos7840_get_uart_reg (port,MODEM_STATUS_REGISTER , &msr); -if (status !=1 ) +if (status <0 )return -EIO ; status =mos7840_get_uart_reg (port,MODEM_CONTROL_REGISTER , &mcr); -if (status !=1 ) +if (status <0 )return -EIO ; result = ((mcr &MCR_DTR ) ?TIOCM_DTR :0 ) | ((mcr &MCR_RTS ) ?TIOCM_RTS :0 )
Greg Kroah-Hartman
maintainerPATCH 22/50 pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Markus Elfring <[email protected]>
[ Upstream commit 420dc61642920849d824a0de2aa853db59f5244f ]
Strings which did not contain data format specifications should be put into a sequence. Thus use the corresponding function "seq_puts".
This issue was detected by using the Coccinelle software.
--- drivers/pinctrl/mvebu/pinctrl-mvebu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/pinctrl/mvebu/pinctrl-mvebu.c +5 -4
@@ -195,11 +195,12 @@ static void mvebu_pinconf_group_dbg_showseq_printf (s,"o" );seq_printf (s,")" ); } - }else -seq_printf (s,"current: UNKNOWN" ); + }else { +seq_puts (s,"current: UNKNOWN" ); + }if (grp->num_settings >1 ) { -seq_printf (s,", available = [" ); +seq_puts (s,", available = [" );for (n =0 ; n < grp->num_settings; n++) {if (curr == &grp->settings[n])continue ;
@@ -222,7 +223,7 @@ static void mvebu_pinconf_group_dbg_showseq_printf (s,")" ); } } -seq_printf (s," ]" ); +seq_puts (s," ]" ); }return ; }
Re: [PATCH 4.4 22/50] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show()
Quoted 1 line · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
I hope this patch is just to make porting some other patch easier.
Otherwise, this has no place in stable as it has no change in functionality and is a completely trivial savings in cpu only.
Quoted 49 lines
------------------
From: Markus Elfring <[email protected]>
[ Upstream commit
420dc61642920849d824a0de2aa853db59f5244f]Strings which did not contain data format specifications should be put into a sequence. Thus use the corresponding function "
seq_puts".This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>Signed-off-by Linus Walleij <[email protected]>Signed-off-by Sasha Levin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/pinctrl/mvebu/pinctrl-mvebu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/pinctrl/mvebu/pinctrl-mvebu.c +5
-4@@ -195,11 +195,12 @@ static void mvebu_pinconf_group_dbg_showseq_printf (s,"o" );seq_printf (s,")" ); } - }else -seq_printf (s,"current: UNKNOWN" ); + }else { +seq_puts (s,"current: UNKNOWN" ); + }if (grp->num_settings >1 ) { -seq_printf (s,", available = [" ); +seq_puts (s,", available = [" );for (n =0 ; n < grp->num_settings; n++) {if (curr == &grp->settings[n])continue ;@@ -222,7 +223,7 @@ static void mvebu_pinconf_group_dbg_showseq_printf (s,")" ); } } -seq_printf (s," ]" ); +seq_puts (s," ]" ); }return ; }
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 22/50] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show()
Quoted 7 lines · Joe Perches
Quoted 1 line · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
I hope this patch is just to make porting some other patch easier.
Otherwise, this has no place in stable as it has no change in functionality and is a completely trivial savings in cpu only.
I thought that was the case when I was reviewing them, but I don't see any other patch touching this area anymore. I'll go drop this from the 4.4 and 4.9 queues, sorry for missing this.
Sasha, be more careful please :)
thanks,
greg k-h
Re: [PATCH 4.4 22/50] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show()
Quoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Joe Perches
Quoted 1 line · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
I hope this patch is just to make porting some other patch easier.
Quoted 8 lines
Quoted 2 lines
Otherwise, this has no place in stable as it has no change in functionality and is a completely trivial savings in cpu only.
I thought that was the case when I was reviewing them, but I don't see any other patch touching this area anymore. I'll go drop this from the 4.4 and 4.9 queues, sorry for missing this.
Sasha, be more careful please :)
Sorry for this.
I appriciate the input and reviews, I look into each "fuck up" and try to figure out why both myself and AI considered it stable and try to learn from it.
Signature · 2 lines
Thanks, Sasha
Greg Kroah-Hartman
maintainerPATCH 23/50 partitions/efi: Fix integer overflow in GPT size calculation
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alden Tondettar <[email protected]>
[ Upstream commit c5082b70adfe8e1ea1cf4a8eff92c9f260e364d2 ]
If a GUID Partition Table claims to have more than 2**25 entries, the calculation of the partition table size in alloc_read_gpt_entries() will overflow a 32-bit integer and not enough space will be allocated for the table.
Nothing seems to get written out of bounds, but later efi_partition() will read up to 32768 bytes from a 128 byte buffer, possibly OOPSing or exposing information to /proc/partitions and uevents.
The problem exists on both 64-bit and 32-bit platforms.
Fix the overflow and also print a meaningful debug message if the table size is too large.
--- block/partitions/efi.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
block/partitions/efi.c +12 -5
@@ -293,7 +293,7 @@ static gpt_entry *alloc_read_gpt_entriesif (!gpt)return NULL ; - count =le32_to_cpu (gpt->num_partition_entries) * + count = (size_t )le32_to_cpu (gpt->num_partition_entries) *le32_to_cpu (gpt->sizeof_partition_entry);if (!count)return NULL ;
@@ -352,7 +352,7 @@ static int is_gpt_valid(struct parsed_pa gpt_header **gpt, gpt_entry **ptes) {u32 crc, origcrc; -u64 lastlba; +u64 lastlba, pt_size;if (!ptes)return 0 ;
@@ -434,13 +434,20 @@ static int is_gpt_valid(struct parsed_pa goto fail; } +/* Sanity check partition table size */ + pt_size = (u64 )le32_to_cpu ((*gpt)->num_partition_entries) * +le32_to_cpu ((*gpt)->sizeof_partition_entry); +if (pt_size >KMALLOC_MAX_SIZE ) { +pr_debug ("GUID Partition Table is too large: %llu > %lu bytes\n" , + (unsigned long long )pt_size,KMALLOC_MAX_SIZE ); + goto fail; + } +if (!(*ptes =alloc_read_gpt_entries (state, *gpt))) goto fail;/* Check the GUID Partition Entry Array CRC */ - crc =efi_crc32 ((const unsigned char *) (*ptes), -le32_to_cpu ((*gpt)->num_partition_entries) * -le32_to_cpu ((*gpt)->sizeof_partition_entry)); + crc =efi_crc32 ((const unsigned char *) (*ptes), pt_size);if (crc !=le32_to_cpu ((*gpt)->partition_entry_array_crc32)) {pr_debug ("GUID Partitition Entry Array CRC check failed.\n" );
Greg Kroah-Hartman
maintainerPATCH 24/50 ASoC: dapm: handle probe deferrals
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit 37e1df8c95e2c8a57c77eafc097648f6e40a60ff ]
This starts to handle probe deferrals on regulators and clocks on the ASoC DAPM.
I came to this patch after audio stopped working on Ux500 ages ago and I finally looked into it to see what is wrong. I had messages like this in the console since a while back:
ab8500-codec.0: ASoC: Failed to request audioclk: -517 ab8500-codec.0: ASoC: Failed to create DAPM control audioclk ab8500-codec.0: Failed to create new controls -12 snd-soc-mop500.0: ASoC: failed to instantiate card -12 snd-soc-mop500.0: Error: snd_soc_register_card failed (-12)!
snd-soc-mop500: probe of snd-soc-mop500.0 failed with error -12
Apparently because the widget table for the codec looks like this (sound/soc/codecs/ab8500-codec.c):
static const struct snd_soc_dapm_widget ab8500_dapm_widgets[] = {
/* Clocks */
SND_SOC_DAPM_CLOCK_SUPPLY("audioclk"),
/* Regulators */
SND_SOC_DAPM_REGULATOR_SUPPLY("V-AUD", 0, 0),
SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC1", 0, 0),
SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC2", 0, 0),
SND_SOC_DAPM_REGULATOR_SUPPLY("V-DMIC", 0, 0),So when we call snd_soc_register_codec() and any of these widgets get a deferred probe we do not get an -EPROBE_DEFER (-517) back as we should and instead we just fail. Apparently the code assumes that clocks and regulators must be available at this point and not defer.
After this patch it rather looks like this:
ab8500-codec.0: Failed to create new controls -517 snd-soc-mop500.0: ASoC: failed to instantiate card -517 snd-soc-mop500.0: Error: snd_soc_register_card failed (-517)! (...)
abx500-clk.0: registered clocks for ab850x snd-soc-mop500.0: ab8500-codec-dai.0 <-> ux500-msp-i2s.1 mapping ok snd-soc-mop500.0: ab8500-codec-dai.1 <-> ux500-msp-i2s.3 mapping ok
I'm pretty happy about the patch as it it, but I'm a bit uncertain on how to proceed: there are a lot of users of the external functions snd_soc_dapm_new_control() (111 sites) and that will now return an occassional error pointer, which is not handled in the calling sites.
I want an indication from the maintainers whether I should just go in and augment all these call sites, or if deferred probe is frowned upon when it leads to this much overhead.
--- sound/soc/soc-dapm.c | 42 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/soc-topology.c | 9 +++++++++ 2 files changed, 51 insertions(+)
sound/soc/soc-dapm.c +42 -0
@@ -358,6 +358,10 @@ static int dapm_kcontrol_data_alloc(strusnd_soc_dapm_new_control_unlocked (widget->dapm, &template);kfree (name); +if (IS_ERR (data->widget)) { + ret =PTR_ERR (data->widget); + goto err_data; + }if (!data->widget) { ret = -ENOMEM ; goto err_data;
@@ -392,6 +396,10 @@ static int dapm_kcontrol_data_alloc(stru data->widget =snd_soc_dapm_new_control_unlocked ( widget->dapm, &template);kfree (name); +if (IS_ERR (data->widget)) { + ret =PTR_ERR (data->widget); + goto err_data; + }if (!data->widget) { ret = -ENOMEM ; goto err_data;
@@ -3278,11 +3286,22 @@ snd_soc_dapm_new_control(struct snd_soc_mutex_lock_nested (&dapm->card->dapm_mutex,SND_SOC_DAPM_CLASS_RUNTIME ); w =snd_soc_dapm_new_control_unlocked (dapm, widget); +/* Do not nag about probe deferrals */ +if (IS_ERR (w)) { +int ret =PTR_ERR (w); + +if (ret != -EPROBE_DEFER ) +dev_err (dapm->dev, +"ASoC: Failed to create DAPM control %s (%d)\n" , + widget->name, ret); + goto out_unlock; + }if (!w)dev_err (dapm->dev,"ASoC: Failed to create DAPM control %s\n" , widget->name); +out_unlock:mutex_unlock (&dapm->card->dapm_mutex);return w; }
@@ -3304,6 +3323,8 @@ snd_soc_dapm_new_control_unlocked(struct w->regulator =devm_regulator_get (dapm->dev, w->name);if (IS_ERR (w->regulator)) { ret =PTR_ERR (w->regulator); +if (ret == -EPROBE_DEFER ) +return ERR_PTR (ret);dev_err (dapm->dev,"ASoC: Failed to request %s: %d\n" , w->name, ret);return NULL ;
@@ -3322,6 +3343,8 @@ snd_soc_dapm_new_control_unlocked(struct w->clk =devm_clk_get (dapm->dev, w->name);if (IS_ERR (w->clk)) { ret =PTR_ERR (w->clk); +if (ret == -EPROBE_DEFER ) +return ERR_PTR (ret);dev_err (dapm->dev,"ASoC: Failed to request %s: %d\n" , w->name, ret);return NULL ;
@@ -3435,6 +3458,16 @@ int snd_soc_dapm_new_controls(struct sndmutex_lock_nested (&dapm->card->dapm_mutex,SND_SOC_DAPM_CLASS_INIT );for (i =0 ; i < num; i++) { w =snd_soc_dapm_new_control_unlocked (dapm, widget); +if (IS_ERR (w)) { + ret =PTR_ERR (w); +/* Do not nag about probe deferrals */ +if (ret == -EPROBE_DEFER ) +break ; +dev_err (dapm->dev, +"ASoC: Failed to create DAPM control %s (%d)\n" , + widget->name, ret); +break ; + }if (!w) { dev_err(dapm->dev, "ASoC: Failed to create DAPM control %s\n",
@@ -3701,6 +3734,15 @@ int snd_soc_dapm_new_pcm(struct snd_soc_dev_dbg (card->dev,"ASoC: adding %s widget\n" , link_name); w =snd_soc_dapm_new_control_unlocked (&card->dapm, &template); +if (IS_ERR (w)) { + ret =PTR_ERR (w); +/* Do not nag about probe deferrals */ +if (ret != -EPROBE_DEFER ) +dev_err (card->dev, +"ASoC: Failed to create %s widget (%d)\n" , + link_name, ret); + goto outfree_kcontrol_news; + }if (!w) {dev_err (card->dev,"ASoC: Failed to create %s widget\n" , link_name);
sound/soc/soc-topology.c +9 -0
@@ -1481,6 +1481,15 @@ widget: widget =snd_soc_dapm_new_control (dapm, &template); else widget =snd_soc_dapm_new_control_unlocked (dapm, &template); +if (IS_ERR (widget)) { + ret =PTR_ERR (widget); +/* Do not nag about probe deferrals */ +if (ret != -EPROBE_DEFER ) +dev_err (tplg->dev, +"ASoC: failed to create widget %s controls (%d)\n" , + w->name, ret); + goto hdr_err; + }if (widget ==NULL ) {dev_err (tplg->dev,"ASoC: failed to create widget %s controls\n" , w->name);
Greg Kroah-Hartman
maintainerPATCH 25/50 audit: log 32-bit socketcalls
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Guy Briggs <[email protected]>
[ Upstream commit 62bc306e2083436675e33b5bdeb6a77907d35971 ]
32-bit socketcalls were not being logged by audit on x86_64 systems. Log them. This is basically a duplicate of the call from net/socket.c:sys_socketcall(), but it addresses the impedance mismatch between 32-bit userspace process and 64-bit kernel audit.
See: https://github.com/linux-audit/audit-kernel/issues/14
--- include/linux/audit.h | 20 ++++++++++++++++++++ net/compat.c | 17 ++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-)
include/linux/audit.h +20 -0
@@ -281,6 +281,20 @@ static inline int audit_socketcall(int nreturn __audit_socketcall (nargs, args);return 0 ; } + +static inline int audit_socketcall_compat (int nargs,u32 *args) +{ +unsigned long a[AUDITSC_ARGS ]; +int i; + +if (audit_dummy_context ()) +return 0 ; + +for (i =0 ; i < nargs; i++) + a[i] = (unsigned long )args[i]; +return __audit_socketcall (nargs, a); +} +static inline int audit_sockaddr (int len,void *addr) {if (unlikely (!audit_dummy_context ()))
@@ -407,6 +421,12 @@ static inline int audit_socketcall(int n {return 0 ; } + +static inline int audit_socketcall_compat (int nargs,u32 *args) +{ +return 0 ; +} +static inline void audit_fd_pair (int fd1,int fd2) { }static inline int audit_sockaddr (int len,void *addr)
net/compat.c +14 -3
@@ -22,6 +22,7 @@#include <linux/filter.h> #include <linux/compat.h> #include <linux/security.h> +#include <linux/audit.h> #include <linux/export.h> #include <net/scm.h>
@@ -767,14 +768,24 @@ COMPAT_SYSCALL_DEFINE5(recvmmsg, int, fd COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args) { -int ret; -u32 a[6 ]; +u32 a[AUDITSC_ARGS ]; +unsigned int len;u32 a0, a1; +int ret;if (call <SYS_SOCKET || call >SYS_SENDMMSG )return -EINVAL ; -if (copy_from_user (a, args, nas[call])) + len = nas[call]; +if (len >sizeof (a)) +return -EINVAL ; + +if (copy_from_user (a, args, len))return -EFAULT ; + + ret =audit_socketcall_compat (len /sizeof (a[0 ]), a); +if (ret) +return ret; + a0 = a[0 ]; a1 = a[1 ];
Greg Kroah-Hartman
maintainerPATCH 26/50 usb: chipidea: vbus event may exist before starting gadget
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chen <[email protected]>
[ Upstream commit c3b674a04b8ab62a1d35e86714d466af0a0ecc18 ]
At some situations, the vbus may already be there before starting gadget. So we need to check vbus event after switching to gadget in order to handle missing vbus event. The typical use cases are plugging vbus cable before driver load or the vbus has already been there after stopping host but before starting gadget.
--- drivers/usb/chipidea/otg.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/usb/chipidea/otg.c +12 -5
@@ -134,9 +134,9 @@ void ci_handle_vbus_change(struct ci_hdrif (!ci->is_otg)return ; -if (hw_read_otgsc (ci,OTGSC_BSV )) +if (hw_read_otgsc (ci,OTGSC_BSV ) && !ci->vbus_active)usb_gadget_vbus_connect (&ci->gadget); -else +else if (!hw_read_otgsc (ci,OTGSC_BSV ) && ci->vbus_active)usb_gadget_vbus_disconnect (&ci->gadget); }
@@ -175,14 +175,21 @@ static void ci_handle_id_switch(struct cci_role_stop (ci); -if (role ==CI_ROLE_GADGET ) +if (role ==CI_ROLE_GADGET && +IS_ERR (ci->platdata->vbus_extcon.edev))/* -* wait vbus lower than OTGSC_BSV before connecting -* to host +* Wait vbus lower than OTGSC_BSV before connecting +* to host. If connecting status is from an external +* connector instead of register, we don't need to +* care vbus on the board, since it will not affect +* external connector status. */ hw_wait_vbus_lower_bsv (ci);ci_role_start (ci, role); +/* vbus change may have already occurred */ +if (role ==CI_ROLE_GADGET ) +ci_handle_vbus_change (ci); } }/**
Greg Kroah-Hartman
maintainerPATCH 27/50 ASoC: dapm: fix some pointer error handling
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit 639467c8f26d834c934215e8b59129ce442475fe ]
commit 66feeec9322132689d42723df2537d60f96f8e44 "RFC: ASoC: dapm: handle probe deferrals" forgot a to update some two sites where the call was used. The static codechecks quickly found them.
--- sound/soc/soc-dapm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
sound/soc/soc-dapm.c +20 -0
@@ -3794,6 +3794,16 @@ int snd_soc_dapm_new_dai_widgets(struct template.name); w =snd_soc_dapm_new_control_unlocked (dapm, &template); +if (IS_ERR (w)) { +int ret =PTR_ERR (w); + +/* Do not nag about probe deferrals */ +if (ret != -EPROBE_DEFER ) +dev_err (dapm->dev, +"ASoC: Failed to create %s widget (%d)\n" , + dai->driver->playback.stream_name, ret); +return ret; + }if (!w) {dev_err (dapm->dev,"ASoC: Failed to create %s widget\n" , dai->driver->playback.stream_name);
@@ -3813,6 +3823,16 @@ int snd_soc_dapm_new_dai_widgets(struct template.name); w =snd_soc_dapm_new_control_unlocked (dapm, &template); +if (IS_ERR (w)) { +int ret =PTR_ERR (w); + +/* Do not nag about probe deferrals */ +if (ret != -EPROBE_DEFER ) +dev_err (dapm->dev, +"ASoC: Failed to create %s widget (%d)\n" , + dai->driver->playback.stream_name, ret); +return ret; + }if (!w) {dev_err (dapm->dev,"ASoC: Failed to create %s widget\n" , dai->driver->capture.stream_name);
Greg Kroah-Hartman
maintainerPATCH 28/50 MIPS: Lantiq: Fix another request_mem_region() return code check
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 98ea51cb0c8ce009d9da1fd7b48f0ff1d7a9bbb0 ]
Hauke already fixed a couple of them, but one instance remains that checks for a negative integer when it should check for a NULL pointer:
arch/mips/lantiq/xway/sysctrl.c: In function 'ltq_soc_init':arch/mips/lantiq/xway/sysctrl.c:473:19: error: ordered comparison of pointer with integer zero [-Werror=extra]
Patchwork: https://patchwork.linux-mips.org/patch/15043/
--- arch/mips/lantiq/xway/sysctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/lantiq/xway/sysctrl.c +2 -2
@@ -469,8 +469,8 @@ void __init ltq_soc_init(void)panic ("Failed to load xbar nodes from devicetree" );if (of_address_to_resource (np_xbar,0 , &res_xbar))panic ("Failed to get xbar resources" ); -if (request_mem_region (res_xbar.start,resource_size (&res_xbar), - res_xbar.name) <0 ) +if (!request_mem_region (res_xbar.start,resource_size (&res_xbar), + res_xbar.name))panic ("Failed to get xbar resources" ); ltq_xbar_membase = ioremap_nocache(res_xbar.start,
Greg Kroah-Hartman
maintainerPATCH 29/50 net: core: Prevent from dereferencing null pointer when releasing SKB
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myungho Jung <[email protected]>
[ Upstream commit 9899886d5e8ec5b343b1efe44f185a0e68dc6454 ]
Added NULL check to make __dev_kfree_skb_irq consistent with kfree family of functions.
--- net/core/dev.c | 3 +++ 1 file changed, 3 insertions(+)
net/core/dev.c +3 -0
@@ -2338,6 +2338,9 @@ void __dev_kfree_skb_irq(struct sk_buff {unsigned long flags; +if (unlikely (!skb)) +return ; +if (likely (atomic_read (&skb->users) ==1 )) {smp_rmb ();atomic_set (&skb->users,0 );
Greg Kroah-Hartman
maintainerPATCH 30/50 net/packet: check length in getsockopt() called with PACKET_HDRLEN
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Potapenko <[email protected]>
[ Upstream commit fd2c83b35752f0a8236b976978ad4658df14a59f ]
In the case getsockopt() is called with PACKET_HDRLEN and optlen < 4 |val| remains uninitialized and the syscall may behave differently depending on its value, and even copy garbage to userspace on certain architectures. To fix this we now return -EINVAL if optlen is too small.
This bug has been detected with KMSAN.
--- net/packet/af_packet.c | 2 ++ 1 file changed, 2 insertions(+)
net/packet/af_packet.c +2 -0
@@ -3802,6 +3802,8 @@ static int packet_getsockopt(struct sockcase PACKET_HDRLEN :if (len >sizeof (int )) len =sizeof (int ); +if (len <sizeof (int )) +return -EINVAL ;if (copy_from_user (&val, optval, len))return -EFAULT ;switch (val) {
Greg Kroah-Hartman
maintainerPATCH 31/50 team: fix memory leaks
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pan Bian <[email protected]>
[ Upstream commit 72ec0bc64b9a5d8e0efcb717abfc757746b101b7 ]
In functions team_nl_send_port_list_get() and team_nl_send_options_get(), pointer skb keeps the return value of nlmsg_new(). When the call to genlmsg_put() fails, the memory is not freed(). This will result in memory leak bugs.
--- drivers/net/team/team.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/team/team.c +6 -2
@@ -2343,8 +2343,10 @@ start_again: hdr =genlmsg_put (skb, portid, seq, &team_nl_family, flags |NLM_F_MULTI ,TEAM_CMD_OPTIONS_GET ); -if (!hdr) +if (!hdr) { +nlmsg_free (skb);return -EMSGSIZE ; + }if (nla_put_u32 (skb,TEAM_ATTR_TEAM_IFINDEX , team->dev->ifindex)) goto nla_put_failure;
@@ -2611,8 +2613,10 @@ start_again: hdr =genlmsg_put (skb, portid, seq, &team_nl_family, flags |NLM_F_MULTI ,TEAM_CMD_PORT_LIST_GET ); -if (!hdr) +if (!hdr) { +nlmsg_free (skb);return -EMSGSIZE ; + }if (nla_put_u32 (skb,TEAM_ATTR_TEAM_IFINDEX , team->dev->ifindex)) goto nla_put_failure;
Greg Kroah-Hartman
maintainerPATCH 33/50 mmc: sdio: fix alignment issue in struct sdio_func
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiner Kallweit <[email protected]>
[ Upstream commit 5ef1ecf060f28ecef313b5723f1fd39bf5a35f56 ]
Certain 64-bit systems (e.g. Amlogic Meson GX) require buffers to be used for DMA to be 8-byte-aligned. struct sdio_func has an embedded small DMA buffer not meeting this requirement.
When testing switching to descriptor chain mode in meson-gx driver SDIO is broken therefore. Fix this by allocating the small DMA buffer separately as kmalloc ensures that the returned memory area is properly aligned for every basic data type.
--- drivers/mmc/core/sdio_bus.c | 12 +++++++++++- include/linux/mmc/sdio_func.h | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-)
drivers/mmc/core/sdio_bus.c +11 -1
@@ -266,7 +266,7 @@ static void sdio_release_func(struct devsdio_free_func_cis (func);kfree (func->info); - +kfree (func->tmpbuf);kfree (func); }
@@ -281,6 +281,16 @@ struct sdio_func *sdio_alloc_func(structif (!func)return ERR_PTR (-ENOMEM ); +/* +* allocate buffer separately to make sure it's properly aligned for +* DMA usage (incl. 64 bit DMA) +*/ + func->tmpbuf =kmalloc (4 ,GFP_KERNEL ); +if (!func->tmpbuf) { +kfree (func); +return ERR_PTR (-ENOMEM ); + } + func->card = card;device_initialize (&func->dev);
include/linux/mmc/sdio_func.h +1 -1
@@ -53,7 +53,7 @@ struct sdio_func {unsigned int state;/* function state */ #define SDIO_STATE_PRESENT (1<<0)/* present in sysfs */ -u8 tmpbuf[4 ];/* DMA:able scratch buffer */ +u8 *tmpbuf;/* DMA:able scratch buffer */ unsigned num_info;/* number of info strings */ const char **info;/* info strings */
Greg Kroah-Hartman
maintainerPATCH 34/50 bridge: netlink: register netdevice before executing changelink
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 5b8d5429daa05bebef6ffd3297df3b502cc6f184 ]
Peter reported a kernel oops when executing the following command:
$ ip link add name test type bridge vlan_default_pvid 1
[13634.939408] BUG: unable to handle kernel NULL pointer dereference at 0000000000000190 [13634.939436] IP: __vlan_add+0x73/0x5f0 [...] [13634.939783] Call Trace: [13634.939791] ? pcpu_next_unpop+0x3b/0x50 [13634.939801] ? pcpu_alloc+0x3d2/0x680 [13634.939810] ? br_vlan_add+0x135/0x1b0 [13634.939820] ? __br_vlan_set_default_pvid.part.28+0x204/0x2b0 [13634.939834] ? br_changelink+0x120/0x4e0 [13634.939844] ? br_dev_newlink+0x50/0x70 [13634.939854] ? rtnl_newlink+0x5f5/0x8a0 [13634.939864] ? rtnl_newlink+0x176/0x8a0 [13634.939874] ? mem_cgroup_commit_charge+0x7c/0x4e0 [13634.939886] ? rtnetlink_rcv_msg+0xe1/0x220 [13634.939896] ? lookup_fast+0x52/0x370 [13634.939905] ? rtnl_newlink+0x8a0/0x8a0 [13634.939915] ? netlink_rcv_skb+0xa1/0xc0 [13634.939925] ? rtnetlink_rcv+0x24/0x30 [13634.939934] ? netlink_unicast+0x177/0x220 [13634.939944] ? netlink_sendmsg+0x2fe/0x3b0 [13634.939954] ? _copy_from_user+0x39/0x40 [13634.939964] ? sock_sendmsg+0x30/0x40 [13634.940159] ? ___sys_sendmsg+0x29d/0x2b0 [13634.940326] ? __alloc_pages_nodemask+0xdf/0x230 [13634.940478] ? mem_cgroup_commit_charge+0x7c/0x4e0 [13634.940592] ? mem_cgroup_try_charge+0x76/0x1a0 [13634.940701] ? __handle_mm_fault+0xdb9/0x10b0 [13634.940809] ? __sys_sendmsg+0x51/0x90 [13634.940917] ? entry_SYSCALL_64_fastpath+0x1e/0xad
The problem is that the bridge's VLAN group is created after setting the default PVID, when registering the netdevice and executing its ndo_init().
Fix this by changing the order of both operations, so that br_changelink() is only processed after the netdevice is registered, when the VLAN group is already initialized.
--- net/bridge/br_netlink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/bridge/br_netlink.c +5 -2
@@ -1073,11 +1073,14 @@ static int br_dev_newlink(struct net *srspin_unlock_bh (&br->lock); } - err =br_changelink (dev, tb, data); + err =register_netdevice (dev);if (err)return err; -return register_netdevice (dev); + err =br_changelink (dev, tb, data); +if (err) +unregister_netdevice (dev); +return err; }static size_t br_get_size (const struct net_device *brdev)
Greg Kroah-Hartman
maintainerPATCH 35/50 netfilter: invoke synchronize_rcu after set the _hook_ to NULL
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liping Zhang <[email protected]>
[ Upstream commit 3b7dabf029478bb80507a6c4500ca94132a2bc0b ]
Otherwise, another CPU may access the invalid pointer. For example:
CPU0 CPU1
- rcu_read_lock();
- pfunc = _hook_;
_hook_ = NULL; -
mod unload -
- pfunc(); // invalid, panic
- rcu_read_unlock();
So we must call synchronize_rcu() to wait the rcu reader to finish.
Also note, in nf_nat_snmp_basic_fini, synchronize_rcu() will be invoked by later nf_conntrack_helper_unregister, but I'm inclined to add a explicit synchronize_rcu after set the nf_nat_snmp_hook to NULL. Depend on such obscure assumptions is not a good idea.
Last, in nfnetlink_cttimeout, we use kfree_rcu to free the time object, so in cttimeout_exit, invoking rcu_barrier() is not necessary at all, remove it too.
--- net/ipv4/netfilter/nf_nat_snmp_basic.c | 1 + net/netfilter/nf_conntrack_ecache.c | 2 ++ net/netfilter/nf_conntrack_netlink.c | 1 + net/netfilter/nf_nat_core.c | 2 ++ net/netfilter/nfnetlink_cttimeout.c | 2 +- 5 files changed, 7 insertions(+), 1 deletion(-)
net/ipv4/netfilter/nf_nat_snmp_basic.c +1 -0
@@ -1304,6 +1304,7 @@ static int __init nf_nat_snmp_basic_init static void __exit nf_nat_snmp_basic_fini(void) {RCU_INIT_POINTER (nf_nat_snmp_hook,NULL ); +synchronize_rcu ();nf_conntrack_helper_unregister (&snmp_trap_helper); }
net/netfilter/nf_conntrack_ecache.c +2 -0
@@ -200,6 +200,7 @@ void nf_conntrack_unregister_notifier(stBUG_ON (notify != new);RCU_INIT_POINTER (net->ct.nf_conntrack_event_cb,NULL );mutex_unlock (&nf_ct_ecache_mutex); +/* synchronize_rcu() is called from ctnetlink_exit. */ }EXPORT_SYMBOL_GPL (nf_conntrack_unregister_notifier);
@@ -236,6 +237,7 @@ void nf_ct_expect_unregister_notifier(stBUG_ON (notify != new);RCU_INIT_POINTER (net->ct.nf_expect_event_cb,NULL );mutex_unlock (&nf_ct_ecache_mutex); +/* synchronize_rcu() is called from ctnetlink_exit. */ }EXPORT_SYMBOL_GPL (nf_ct_expect_unregister_notifier);
net/netfilter/nf_conntrack_netlink.c +1 -0
@@ -3415,6 +3415,7 @@ static void __exit ctnetlink_exit(void)#ifdef CONFIG_NETFILTER_NETLINK_GLUE_CT RCU_INIT_POINTER (nfnl_ct_hook,NULL );#endif +synchronize_rcu (); }module_init (ctnetlink_init);
net/netfilter/nf_nat_core.c +2 -0
@@ -892,6 +892,8 @@ static void __exit nf_nat_cleanup(void)#ifdef CONFIG_XFRM RCU_INIT_POINTER (nf_nat_decode_session_hook,NULL );#endif +synchronize_rcu (); +for (i =0 ; i <NFPROTO_NUMPROTO ; i++)kfree (nf_nat_l4protos[i]);synchronize_net ();
net/netfilter/nfnetlink_cttimeout.c +1 -1
@@ -611,8 +611,8 @@ static void __exit cttimeout_exit(void)#ifdef CONFIG_NF_CONNTRACK_TIMEOUT RCU_INIT_POINTER (nf_ct_timeout_find_get_hook,NULL );RCU_INIT_POINTER (nf_ct_timeout_put_hook,NULL ); +synchronize_rcu ();#endif /* CONFIG_NF_CONNTRACK_TIMEOUT */ -rcu_barrier (); }module_init (cttimeout_init);
Greg Kroah-Hartman
maintainerPATCH 36/50 MIPS: IRQ Stack: Unwind IRQ stack onto task stack
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Redfearn <[email protected]>
[ Upstream commit db8466c581cca1a08b505f1319c3ecd246f16fa8 ]
When the separate IRQ stack was introduced, stack unwinding only proceeded as far as the top of the IRQ stack, leading to kernel backtraces being less useful, lacking the trace of what was interrupted.
Fix this by providing a means for the kernel to unwind the IRQ stack onto the interrupted task stack. The processor state is saved to the kernel task stack on interrupt. The IRQ_STACK_START macro reserves an unsigned long at the top of the IRQ stack where the interrupted task stack pointer can be saved. After the active stack is switched to the IRQ stack, save the interrupted tasks stack pointer to the reserved location.
Fix the stack unwinding code to look for the frame being the top of the IRQ stack and if so get the next frame from the saved location. The existing test does not work with the separate stack since the ra is no longer pointed at ret_from_{irq,exception}.
The test to stop unwinding the stack 32 bytes from the top of a stack must be modified to allow unwinding to continue up to the location of the saved task stack pointer when on the IRQ stack. The low / high marks of the stack are set depending on whether the sp is on an irq stack or not.
Patchwork: https://patchwork.linux-mips.org/patch/15788/
--- arch/mips/include/asm/irq.h | 15 ++++++++++ arch/mips/kernel/asm-offsets.c | 1 arch/mips/kernel/genex.S | 8 ++++- arch/mips/kernel/process.c | 56 +++++++++++++++++++++++++++-------------- 4 files changed, 60 insertions(+), 20 deletions(-)
arch/mips/include/asm/irq.h +15 -0
@@ -18,9 +18,24 @@#include <irq.h> #define IRQ_STACK_SIZE THREAD_SIZE +#define IRQ_STACK_START (IRQ_STACK_SIZE - sizeof(unsigned long))extern void *irq_stack[NR_CPUS ]; +/* +* The highest address on the IRQ stack contains a dummy frame put down in +* genex.S (handle_int & except_vec_vi_handler) which is structured as follows: +* +* top ------------ +* | task sp | <- irq_stack[cpu] + IRQ_STACK_START +* ------------ +* | | <- First frame of IRQ context +* ------------ +* +* task sp holds a copy of the task stack pointer where the struct pt_regs +* from exception entry can be found. +*/ +static inline bool on_irq_stack (int cpu,unsigned long sp) {unsigned long low = (unsigned long )irq_stack[cpu];
arch/mips/kernel/asm-offsets.c +1 -0
@@ -102,6 +102,7 @@ void output_thread_info_defines(void)DEFINE (_THREAD_SIZE,THREAD_SIZE );DEFINE (_THREAD_MASK,THREAD_MASK );DEFINE (_IRQ_STACK_SIZE,IRQ_STACK_SIZE ); +DEFINE (_IRQ_STACK_START,IRQ_STACK_START );BLANK (); }
arch/mips/kernel/genex.S +6 -2
@@ -216,9 +216,11 @@ NESTED(handle_int, PT_SIZE, sp) beq t0, t1, 2f /* Switch to IRQ stack */ - li t1, _IRQ_STACK_SIZE + li t1, _IRQ_STACK_START PTR_ADD sp, t0, t1 + /* Save task's sp on IRQ stack so that unwinding can follow it */ + LONG_S s1, 0(sp) 2: jal plat_irq_dispatch
@@ -326,9 +328,11 @@ NESTED(except_vec_vi_handler, 0, sp) beq t0, t1, 2f /* Switch to IRQ stack */ - li t1, _IRQ_STACK_SIZE + li t1, _IRQ_STACK_START PTR_ADD sp, t0, t1 + /* Save task's sp on IRQ stack so that unwinding can follow it */ + LONG_S s1, 0(sp) 2: jalr v0
arch/mips/kernel/process.c +38 -18
77 lines not on this page · raw message
Re: [PATCH 4.4 36/50] MIPS: IRQ Stack: Unwind IRQ stack onto task stack
Quoted 8 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Redfearn <[email protected]>
[ Upstream commit
db8466c581cca1a08b505f1319c3ecd246f16fa8]
[...]
There was a follow-up to this which I suspect is also needed on the 4.4 and 4.9 branches: commit 5fdc66e04620 ("MIPS: Fix minimum alignment requirement of IRQ stack").
Ben.
Signature · 2 lines
Ben Hutchings Software Developer, Codethink Ltd.
Re: [PATCH 4.4 36/50] MIPS: IRQ Stack: Unwind IRQ stack onto task stack
Quoted 8 lines · Ben Hutchings
Quoted 7 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Redfearn <[email protected]>
Quoted 9 lines
Quoted 1 line
[ Upstream commit
db8466c581cca1a08b505f1319c3ecd246f16fa8][...]
There was a follow-up to this which I suspect is also needed on the 4.4 and 4.9 branches: commit
5fdc66e04620("MIPS: Fix minimum alignment requirement of IRQ stack").Ben.
Hi Ben,
Yes you are correct, I missed tagging that one for stable. Please apply it.
Thanks,
Matt
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 36/50] MIPS: IRQ Stack: Unwind IRQ stack onto task stack
Quoted 18 lines · Matt Redfearn
Quoted 15 lines · Ben Hutchings
Quoted 8 lines · Greg Kroah-Hartman
4.4-stable review patch.��If anyone has any objections, please let me know.
------------------
From: Matt Redfearn <[email protected]>
[ Upstream commit
db8466c581cca1a08b505f1319c3ecd246f16fa8][...]
There was a follow-up to this which I suspect is also needed on the 4.4 and 4.9 branches: commit
5fdc66e04620("MIPS: Fix minimum alignment requirement of IRQ stack").
Quoted 5 lines
Quoted 2 lines
Ben.
Hi Ben,
Yes you are correct, I missed tagging that one for stable. Please apply it.
Thanks for letting me know, now queued up.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 37/50 exynos-gsc: Do not swap cb/cr for semi planar formats
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thibault Saunier <[email protected]>
[ Upstream commit d7f3e33df4fbdc9855fb151f4a328ec46447e3ba ]
In the case of semi planar formats cb and cr are in the same plane in memory, meaning that will be set to 'cb' whatever the format is, and whatever the (packed) order of those components are.
--- drivers/media/platform/exynos-gsc/gsc-core.c | 2 -- 1 file changed, 2 deletions(-)
drivers/media/platform/exynos-gsc/gsc-core.c +0 -2
@@ -849,9 +849,7 @@ int gsc_prepare_addr(struct gsc_ctx *ctxif ((frame->fmt->pixelformat ==V4L2_PIX_FMT_VYUY ) || (frame->fmt->pixelformat ==V4L2_PIX_FMT_YVYU ) || - (frame->fmt->pixelformat ==V4L2_PIX_FMT_NV61 ) || (frame->fmt->pixelformat ==V4L2_PIX_FMT_YVU420 ) || - (frame->fmt->pixelformat ==V4L2_PIX_FMT_NV21 ) || (frame->fmt->pixelformat ==V4L2_PIX_FMT_YVU420M ))swap (addr->cb, addr->cr);
Greg Kroah-Hartman
maintainerPATCH 38/50 netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liping Zhang <[email protected]>
[ Upstream commit ae5c682113f9f94cc5e76f92cf041ee624c173ee ]
The helper->expect_class_max must be set to the total number of expect_policy minus 1, since we will use the statement "if (class > helper->expect_class_max)" to validate the CTA_EXPECT_CLASS attr in ctnetlink_alloc_expect.
So for compatibility, set the helper->expect_class_max to the NFCTH_POLICY_SET_NUM attr's value minus 1.
Also: it's invalid when the NFCTH_POLICY_SET_NUM attr's value is zero.
1. this will result "expect_policy = kzalloc(0, GFP_KERNEL);";
2. we cannot set the helper->expect_class_max to a proper value.
So if nla_get_be32(tb[NFCTH_POLICY_SET_NUM]) is zero, report -EINVAL to the userspace.
--- net/netfilter/nfnetlink_cthelper.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
net/netfilter/nfnetlink_cthelper.c +11 -9
@@ -161,6 +161,7 @@ nfnl_cthelper_parse_expect_policy(structint i, ret;struct nf_conntrack_expect_policy *expect_policy;struct nlattr *tb[NFCTH_POLICY_SET_MAX +1 ]; +unsigned int class_max; ret =nla_parse_nested (tb,NFCTH_POLICY_SET_MAX , attr, nfnl_cthelper_expect_policy_set);
@@ -170,19 +171,18 @@ nfnl_cthelper_parse_expect_policy(structif (!tb[NFCTH_POLICY_SET_NUM ])return -EINVAL ; - helper->expect_class_max = -ntohl (nla_get_be32 (tb[NFCTH_POLICY_SET_NUM ])); - -if (helper->expect_class_max !=0 && - helper->expect_class_max >NF_CT_MAX_EXPECT_CLASSES ) + class_max =ntohl (nla_get_be32 (tb[NFCTH_POLICY_SET_NUM ])); +if (class_max ==0 ) +return -EINVAL ; +if (class_max >NF_CT_MAX_EXPECT_CLASSES )return -EOVERFLOW ; expect_policy =kzalloc (sizeof (struct nf_conntrack_expect_policy ) * - helper->expect_class_max,GFP_KERNEL ); + class_max,GFP_KERNEL );if (expect_policy ==NULL )return -ENOMEM ; -for (i=0 ; i<helper->expect_class_max; i++) { +for (i =0 ; i < class_max; i++) {if (!tb[NFCTH_POLICY_SET +i]) goto err;
@@ -191,6 +191,8 @@ nfnl_cthelper_parse_expect_policy(structif (ret <0 ) goto err; } + + helper->expect_class_max = class_max -1 ; helper->expect_policy = expect_policy;return 0 ; err:
@@ -377,10 +379,10 @@ nfnl_cthelper_dump_policy(struct sk_buff goto nla_put_failure;if (nla_put_be32 (skb,NFCTH_POLICY_SET_NUM , -htonl (helper->expect_class_max))) +htonl (helper->expect_class_max +1 ))) goto nla_put_failure; -for (i=0 ; i<helper->expect_class_max; i++) { +for (i =0 ; i < helper->expect_class_max +1 ; i++) { nest_parms2 =nla_nest_start (skb, (NFCTH_POLICY_SET +i) |NLA_F_NESTED );if (nest_parms2 ==NULL )
Greg Kroah-Hartman
maintainerPATCH 39/50 parisc: perf: Fix potential NULL pointer dereference
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arvind Yadav <[email protected]>
[ Upstream commit 74e3f6e63da6c8e8246fba1689e040bc926b4a1a ]
Fix potential NULL pointer dereference and clean up coding style errors (code indent, trailing whitespaces).
--- arch/parisc/kernel/perf.c | 94 +++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 45 deletions(-)
arch/parisc/kernel/perf.c +49 -45
@@ -39,7 +39,7 @@* the PDC INTRIGUE calls. This is done to eliminate bugs introduced * in various PDC revisions. The code is much more maintainable * and reliable this way vs having to debug on every version of PDC -* on every box. +* on every box. */ #include <linux/capability.h>
@@ -195,8 +195,8 @@ static int perf_config(uint32_t *image_pstatic int perf_release (struct inode *inode,struct file *file);static int perf_open (struct inode *inode,struct file *file);static ssize_t perf_read (struct file *file,char __user *buf,size_t cnt,loff_t *ppos); -static ssize_t perf_write (struct file *file,const char __user *buf,size_t count, -loff_t *ppos); +static ssize_t perf_write (struct file *file,const char __user *buf, +size_t count,loff_t *ppos);static long perf_ioctl (struct file *file,unsigned int cmd,unsigned long arg);static void perf_start_counters (void );static int perf_stop_counters (uint32_t *raddr);
@@ -222,7 +222,7 @@ extern void perf_intrigue_disable_perf_c/* * configure: * -* Configure the cpu with a given data image. First turn off the counters, +* Configure the cpu with a given data image. First turn off the counters, * then download the image, then turn the counters back on. */ static int perf_config (uint32_t *image_ptr)
@@ -234,7 +234,7 @@ static int perf_config(uint32_t *image_p error =perf_stop_counters (raddr);if (error !=0 ) {printk ("perf_config: perf_stop_counters = %ld\n" , error); -return -EINVAL ; +return -EINVAL ; }printk ("Preparing to write image\n" );
@@ -242,7 +242,7 @@ printk("Preparing to write image\n"); error =perf_write_image ((uint64_t *)image_ptr);if (error !=0 ) {printk ("perf_config: DOWNLOAD = %ld\n" , error); -return -EINVAL ; +return -EINVAL ; }printk ("Preparing to start counters\n" );
@@ -254,7 +254,7 @@ printk("Preparing to start counters\n"); }/* -* Open the device and initialize all of its memory. The device is only +* Open the device and initialize all of its memory. The device is only * opened once, but can be "queried" by multiple processes that know its * file descriptor. */
@@ -298,8 +298,8 @@ static ssize_t perf_read(struct file *fi* called on the processor that the download should happen * on. */ -static ssize_t perf_write (struct file *file,const char __user *buf,size_t count, -loff_t *ppos) +static ssize_t perf_write (struct file *file,const char __user *buf, +size_t count,loff_t *ppos) {int err;size_t image_size;
@@ -307,11 +307,11 @@ static ssize_t perf_write(struct file *fuint32_t interface_type;uint32_t test; -if (perf_processor_interface ==ONYX_INTF ) +if (perf_processor_interface ==ONYX_INTF ) image_size =PCXU_IMAGE_SIZE ; -else if (perf_processor_interface ==CUDA_INTF ) +else if (perf_processor_interface ==CUDA_INTF ) image_size =PCXW_IMAGE_SIZE ; -else +else return -EFAULT ;if (!capable (CAP_SYS_ADMIN ))
@@ -331,22 +331,22 @@ static ssize_t perf_write(struct file *f/* First check the machine type is correct for the requested image */ -if (((perf_processor_interface ==CUDA_INTF ) && - (interface_type !=CUDA_INTF )) || - ((perf_processor_interface ==ONYX_INTF ) && - (interface_type !=ONYX_INTF ))) +if (((perf_processor_interface ==CUDA_INTF ) && + (interface_type !=CUDA_INTF )) || + ((perf_processor_interface ==ONYX_INTF ) && + (interface_type !=ONYX_INTF )))return -EINVAL ;/* Next check to make sure the requested image is valid */ -if (((interface_type ==CUDA_INTF ) && +if (((interface_type ==CUDA_INTF ) && (test >=MAX_CUDA_IMAGES )) || - ((interface_type ==ONYX_INTF ) && - (test >=MAX_ONYX_IMAGES ))) + ((interface_type ==ONYX_INTF ) && + (test >=MAX_ONYX_IMAGES )))return -EINVAL ;/* Copy the image into the processor */ -if (interface_type ==CUDA_INTF ) +if (interface_type ==CUDA_INTF )return perf_config (cuda_images[test]);else return perf_config (onyx_images[test]);
@@ -360,7 +360,7 @@ static ssize_t perf_write(struct file *fstatic void perf_patch_images (void ) {#if 0 /* FIXME!! */ -/* +/* * NOTE: this routine is VERY specific to the current TLB image. * If the image is changed, this routine might also need to be changed. */
@@ -368,9 +368,9 @@ static void perf_patch_images(void)extern void $i_dtlb_miss_2_0 ();extern void PA2_0_iva (); -/* +/* * We can only use the lower 32-bits, the upper 32-bits should be 0 -* anyway given this is in the kernel +* anyway given this is in the kernel */ uint32_t itlb_addr = (uint32_t )&($i_itlb_miss_2_0);uint32_t dtlb_addr = (uint32_t )&($i_dtlb_miss_2_0);
@@ -378,21 +378,21 @@ static void perf_patch_images(void)if (perf_processor_interface ==ONYX_INTF ) {/* clear last 2 bytes */ - onyx_images[TLBMISS ][15 ] &=0xffffff00 ; + onyx_images[TLBMISS ][15 ] &=0xffffff00 ;/* set 2 bytes */ onyx_images[TLBMISS ][15 ] |= (0x000000ff &((dtlb_addr) >>24 )); onyx_images[TLBMISS ][16 ] = (dtlb_addr <<8 )&0xffffff00 ; onyx_images[TLBMISS ][17 ] = itlb_addr;/* clear last 2 bytes */ - onyx_images[TLBHANDMISS ][15 ] &=0xffffff00 ; + onyx_images[TLBHANDMISS ][15 ] &=0xffffff00 ;/* set 2 bytes */ onyx_images[TLBHANDMISS ][15 ] |= (0x000000ff &((dtlb_addr) >>24 )); onyx_images[TLBHANDMISS ][16 ] = (dtlb_addr <<8 )&0xffffff00 ; onyx_images[TLBHANDMISS ][17 ] = itlb_addr;/* clear last 2 bytes */ - onyx_images[BIG_CPI ][15 ] &=0xffffff00 ; + onyx_images[BIG_CPI ][15 ] &=0xffffff00 ;/* set 2 bytes */ onyx_images[BIG_CPI ][15 ] |= (0x000000ff &((dtlb_addr) >>24 )); onyx_images[BIG_CPI ][16 ] = (dtlb_addr <<8 )&0xffffff00 ;
@@ -405,24 +405,24 @@ static void perf_patch_images(void) }else if (perf_processor_interface ==CUDA_INTF ) {/* Cuda interface */ - cuda_images[TLBMISS ][16 ] = + cuda_images[TLBMISS ][16 ] = (cuda_images[TLBMISS ][16 ]&0xffff0000 ) | ((dtlb_addr >>8 )&0x0000ffff ); - cuda_images[TLBMISS ][17 ] = + cuda_images[TLBMISS ][17 ] = ((dtlb_addr <<24 )&0xff000000 ) | ((itlb_addr >>16 )&0x000000ff ); cuda_images[TLBMISS ][18 ] = (itlb_addr <<16 )&0xffff0000 ; - cuda_images[TLBHANDMISS ][16 ] = + cuda_images[TLBHANDMISS ][16 ] = (cuda_images[TLBHANDMISS ][16 ]&0xffff0000 ) | ((dtlb_addr >>8 )&0x0000ffff ); - cuda_images[TLBHANDMISS ][17 ] = + cuda_images[TLBHANDMISS ][17 ] = ((dtlb_addr <<24 )&0xff000000 ) | ((itlb_addr >>16 )&0x000000ff ); cuda_images[TLBHANDMISS ][18 ] = (itlb_addr <<16 )&0xffff0000 ; - cuda_images[BIG_CPI ][16 ] = + cuda_images[BIG_CPI ][16 ] = (cuda_images[BIG_CPI ][16 ]&0xffff0000 ) | ((dtlb_addr >>8 )&0x0000ffff ); - cuda_images[BIG_CPI ][17 ] = + cuda_images[BIG_CPI ][17 ] = ((dtlb_addr <<24 )&0xff000000 ) | ((itlb_addr >>16 )&0x000000ff ); cuda_images[BIG_CPI ][18 ] = (itlb_addr <<16 )&0xffff0000 ; }else {
@@ -434,7 +434,7 @@ static void perf_patch_images(void)/* * ioctl routine -* All routines effect the processor that they are executed on. Thus you +* All routines effect the processor that they are executed on. Thus you * must be running on the processor that you wish to change. */
@@ -460,7 +460,7 @@ static long perf_ioctl(struct file *file }/* copy out the Counters */ -if (copy_to_user ((void __user *)arg, raddr, +if (copy_to_user ((void __user *)arg, raddr,sizeof (raddr)) !=0 ) { error = -EFAULT ;break ;
@@ -488,7 +488,7 @@ static const struct file_operations perf .open = perf_open, .release = perf_release }; - +static struct miscdevice perf_dev = {MISC_DYNAMIC_MINOR ,PA_PERF_DEV ,
@@ -596,7 +596,7 @@ static int perf_stop_counters(uint32_t */* OR sticky2 (bit 1496) to counter2 bit 32 */ tmp64 |= (userbuf[23 ] >>8 ) &0x0000000080000000 ; raddr[2 ] = (uint32_t )tmp64; - +/* Counter3 is bits 1497 to 1528 */ tmp64 = (userbuf[23 ] >>7 ) &0x00000000ffffffff ;/* OR sticky3 (bit 1529) to counter3 bit 32 */
@@ -618,7 +618,7 @@ static int perf_stop_counters(uint32_t * userbuf[22 ] =0 ; userbuf[23 ] =0 ; -/* +/* * Write back the zeroed bytes + the image given * the read was destructive. */
@@ -626,13 +626,13 @@ static int perf_stop_counters(uint32_t * }else {/* -* Read RDR-15 which contains the counters and sticky bits +* Read RDR-15 which contains the counters and sticky bits */ if (!perf_rdr_read_ubuf (15 , userbuf)) {return -13 ; } -/* +/* * Clear out the counters */ perf_rdr_clear (15 );
@@ -645,7 +645,7 @@ static int perf_stop_counters(uint32_t * raddr[2 ] = (uint32_t )((userbuf[1 ] >>32 ) &0x00000000ffffffffUL ); raddr[3 ] = (uint32_t )(userbuf[1 ] &0x00000000ffffffffUL ); } - +return 0 ; }
@@ -683,7 +683,7 @@ static int perf_rdr_read_ubuf(uint32_t r i = tentry->num_words;while (i--) { buffer[i] =0 ; - } + }/* Check for bits an even number of 64 */ if ((xbits = width &0x03f ) !=0 ) {
@@ -809,18 +809,22 @@ static int perf_write_image(uint64_t *me } runway =ioremap_nocache (cpu_device->hpa.start,4096 ); +if (!runway) { +pr_err ("perf_write_image: ioremap failed!\n" ); +return -ENOMEM ; + }/* Merge intrigue bits into Runway STATUS 0 */ tmp64 =__raw_readq (runway +RUNWAY_STATUS ) &0xffecfffffffffffful ; -__raw_writeq (tmp64 | (*memaddr++ &0x0013000000000000ul ), +__raw_writeq (tmp64 | (*memaddr++ &0x0013000000000000ul ), runway +RUNWAY_STATUS ); - +/* Write RUNWAY DEBUG registers */ for (i =0 ; i <8 ; i++) {__raw_writeq (*memaddr++, runway +RUNWAY_DEBUG ); } -return 0 ; +return 0 ; }/*
@@ -844,7 +848,7 @@ printk("perf_rdr_write\n");perf_rdr_shift_out_U (rdr_num, buffer[i]); }else {perf_rdr_shift_out_W (rdr_num, buffer[i]); - } + } }printk ("perf_rdr_write done\n" ); }
Greg Kroah-Hartman
maintainerPATCH 40/50 iommu/io-pgtable-arm: Check for leaf entry before dereferencing it
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleksandr Tyshchenko <[email protected]>
[ Upstream commit ed46e66cc1b3d684042f92dfa2ab15ee917b4cac ]
Do a check for already installed leaf entry at the current level before dereferencing it in order to avoid walking the page table down with wrong pointer to the next level.
--- drivers/iommu/io-pgtable-arm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +5 -1
@@ -335,8 +335,12 @@ static int __arm_lpae_map(struct arm_lpaif (cfg->quirks &IO_PGTABLE_QUIRK_ARM_NS ) pte |=ARM_LPAE_PTE_NSTABLE ;__arm_lpae_set_pte (ptep, pte, cfg); - }else { + }else if (!iopte_leaf (pte, lvl)) { cptep =iopte_deref (pte, data); + }else { +/* We require an unmap first */ +WARN_ON (!selftest_running); +return -EEXIST ; }/* Rinse, repeat */
Greg Kroah-Hartman
maintainerPATCH 41/50 rds: ib: add error handle
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhu Yanjun <[email protected]>
[ Upstream commit 3b12f73a5c2977153f28a224392fd4729b50d1dc ]
In the function rds_ib_setup_qp, the error handle is missing. When some error occurs, it is possible that memory leak occurs. As such, error handle is added.
--- net/rds/ib_cm.c | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-)
net/rds/ib_cm.c +36 -11
@@ -381,7 +381,7 @@ static int rds_ib_setup_qp(struct rds_co ret =PTR_ERR (ic->i_send_cq); ic->i_send_cq =NULL ;rdsdebug ("ib_create_cq send failed: %d\n" , ret); - goto out; + goto rds_ibdev_out; } cq_attr.cqe = ic->i_recv_ring.w_nr;
@@ -392,19 +392,19 @@ static int rds_ib_setup_qp(struct rds_co ret =PTR_ERR (ic->i_recv_cq); ic->i_recv_cq =NULL ;rdsdebug ("ib_create_cq recv failed: %d\n" , ret); - goto out; + goto send_cq_out; } ret =ib_req_notify_cq (ic->i_send_cq,IB_CQ_NEXT_COMP );if (ret) {rdsdebug ("ib_req_notify_cq send failed: %d\n" , ret); - goto out; + goto recv_cq_out; } ret =ib_req_notify_cq (ic->i_recv_cq,IB_CQ_SOLICITED );if (ret) {rdsdebug ("ib_req_notify_cq recv failed: %d\n" , ret); - goto out; + goto recv_cq_out; }/* XXX negotiate max send/recv with remote? */
@@ -428,7 +428,7 @@ static int rds_ib_setup_qp(struct rds_co ret =rdma_create_qp (ic->i_cm_id, ic->i_pd, &attr);if (ret) {rdsdebug ("rdma_create_qp failed: %d\n" , ret); - goto out; + goto recv_cq_out; } ic->i_send_hdrs = ib_dma_alloc_coherent(dev,
@@ -438,7 +438,7 @@ static int rds_ib_setup_qp(struct rds_coif (!ic->i_send_hdrs) { ret = -ENOMEM ;rdsdebug ("ib_dma_alloc_coherent send failed\n" ); - goto out; + goto qp_out; } ic->i_recv_hdrs = ib_dma_alloc_coherent(dev,
@@ -448,7 +448,7 @@ static int rds_ib_setup_qp(struct rds_coif (!ic->i_recv_hdrs) { ret = -ENOMEM ;rdsdebug ("ib_dma_alloc_coherent recv failed\n" ); - goto out; + goto send_hdrs_dma_out; } ic->i_ack = ib_dma_alloc_coherent(dev, sizeof(struct rds_header),
@@ -456,7 +456,7 @@ static int rds_ib_setup_qp(struct rds_coif (!ic->i_ack) { ret = -ENOMEM ;rdsdebug ("ib_dma_alloc_coherent ack failed\n" ); - goto out; + goto recv_hdrs_dma_out; } ic->i_sends = vzalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work),
@@ -464,7 +464,7 @@ static int rds_ib_setup_qp(struct rds_coif (!ic->i_sends) { ret = -ENOMEM ;rdsdebug ("send allocation failed\n" ); - goto out; + goto ack_dma_out; } ic->i_recvs = vzalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work),
@@ -472,7 +472,7 @@ static int rds_ib_setup_qp(struct rds_coif (!ic->i_recvs) { ret = -ENOMEM ;rdsdebug ("recv allocation failed\n" ); - goto out; + goto sends_out; }rds_ib_recv_init_ack (ic);
@@ -480,8 +480,33 @@ static int rds_ib_setup_qp(struct rds_cordsdebug ("conn %p pd %p cq %p %p\n" , conn, ic->i_pd, ic->i_send_cq, ic->i_recv_cq); -out: +return ret; + +sends_out: +vfree (ic->i_sends); +ack_dma_out: +ib_dma_free_coherent (dev,sizeof (struct rds_header ), + ic->i_ack, ic->i_ack_dma); +recv_hdrs_dma_out: +ib_dma_free_coherent (dev, ic->i_recv_ring.w_nr * +sizeof (struct rds_header ), + ic->i_recv_hdrs, ic->i_recv_hdrs_dma); +send_hdrs_dma_out: +ib_dma_free_coherent (dev, ic->i_send_ring.w_nr * +sizeof (struct rds_header ), + ic->i_send_hdrs, ic->i_send_hdrs_dma); +qp_out: +rdma_destroy_qp (ic->i_cm_id); +recv_cq_out: +if (!ib_destroy_cq (ic->i_recv_cq)) + ic->i_recv_cq =NULL ; +send_cq_out: +if (!ib_destroy_cq (ic->i_send_cq)) + ic->i_send_cq =NULL ; +rds_ibdev_out: +rds_ib_remove_conn (rds_ibdev, conn);rds_ib_dev_put (rds_ibdev); +return ret; }
Greg Kroah-Hartman
maintainerPATCH 42/50 md/raid10: submit bio directly to replacement disk
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shaohua Li <[email protected]>
[ Upstream commit 6d399783e9d4e9bd44931501948059d24ad96ff8 ]
Commit 57c67df(md/raid10: submit IO from originating thread instead of md thread) submits bio directly for normal disks but not for replacement disks. There is no point we shouldn't do this for replacement disks.
--- drivers/md/raid10.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/md/raid10.c +16 -3
@@ -1414,11 +1414,24 @@ retry_write: mbio->bi_private = r10_bio;atomic_inc (&r10_bio->remaining); + + cb =blk_check_plugged (raid10_unplug, mddev, +sizeof (*plug)); +if (cb) + plug = container_of(cb, struct raid10_plug_cb, + cb); +else + plug =NULL ;spin_lock_irqsave (&conf->device_lock, flags); -bio_list_add (&conf->pending_bio_list, mbio); - conf->pending_count++; +if (plug) { +bio_list_add (&plug->pending, mbio); + plug->pending_cnt++; + }else { +bio_list_add (&conf->pending_bio_list, mbio); + conf->pending_count++; + }spin_unlock_irqrestore (&conf->device_lock, flags); -if (!mddev_check_plugged (mddev)) +if (!plug)md_wakeup_thread (mddev->thread); } }
Greg Kroah-Hartman
maintainerPATCH 43/50 i2c: meson: fix wrong variable usage in meson_i2c_put_data
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiner Kallweit <[email protected]>
[ Upstream commit 3b0277f198ac928f323c42e180680d2f79aa980d ]
Most likely a copy & paste error.
--- drivers/i2c/busses/i2c-meson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-meson.c +1 -1
@@ -175,7 +175,7 @@ static void meson_i2c_put_data(struct me wdata1 |= *buf++ << ((i -4 ) *8 );writel (wdata0, i2c->regs +REG_TOK_WDATA0 ); -writel (wdata0, i2c->regs +REG_TOK_WDATA1 ); +writel (wdata1, i2c->regs +REG_TOK_WDATA1 );dev_dbg (i2c->dev,"%s: data %08x %08x len %d\n" , __func__, wdata0, wdata1, len);
Greg Kroah-Hartman
maintainerPATCH 44/50 xfs: remove kmem_zalloc_greedy
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Darrick J. Wong" <[email protected]>
[ Upstream commit 08b005f1333154ae5b404ca28766e0ffb9f1c150 ]
The sole remaining caller of kmem_zalloc_greedy is bulkstat, which uses it to grab 1-4 pages for staging of inobt records. The infinite loop in the greedy allocation function is causing hangs[1] in generic/269, so just get rid of the greedy allocator in favor of kmem_zalloc_large. This makes bulkstat somewhat more likely to ENOMEM if there's really no pages to spare, but eliminates a source of hangs.
[1] http://lkml.kernel.org/r/20170301044634.rgidgdqqiiwsmfpj%40XZHOUW.usersys.redhat.com
---
v2: remove single-page fallback
--- fs/xfs/kmem.c | 18 ------------------ fs/xfs/kmem.h | 2 -- fs/xfs/xfs_itable.c | 6 ++---- 3 files changed, 2 insertions(+), 24 deletions(-)
fs/xfs/kmem.c +0 -18
@@ -24,24 +24,6 @@#include "kmem.h" #include "xfs_message.h" -/* -* Greedy allocation. May fail and may return vmalloced memory. -*/ -void * -kmem_zalloc_greedy (size_t *size,size_t minsize,size_t maxsize) -{ -void *ptr; -size_t kmsize = maxsize; - -while (!(ptr =vzalloc (kmsize))) { -if ((kmsize >>=1 ) <= minsize) - kmsize = minsize; - } -if (ptr) - *size = kmsize; -return ptr; -} -void *kmem_alloc (size_t size,xfs_km_flags_t flags) {
fs/xfs/kmem.h +0 -2
@@ -69,8 +69,6 @@ static inline void kmem_free(const void } -extern void *kmem_zalloc_greedy (size_t *,size_t ,size_t ); -static inline void *kmem_zalloc (size_t size,xfs_km_flags_t flags) {
fs/xfs/xfs_itable.c +2 -4
@@ -351,7 +351,6 @@ xfs_bulkstat(xfs_agino_t agino;/* inode # in allocation group */ xfs_agnumber_t agno;/* allocation group number */ xfs_btree_cur_t *cur;/* btree cursor for ialloc btree */ -size_t irbsize;/* size of irec buffer in bytes */ xfs_inobt_rec_incore_t *irbuf;/* start of irec buffer */ int nirbuf;/* size of irbuf */ int ubcount;/* size of user's buffer */
@@ -378,11 +377,10 @@ xfs_bulkstat( *ubcountp =0 ; *done =0 ; - irbuf =kmem_zalloc_greedy (&irbsize,PAGE_SIZE ,PAGE_SIZE *4 ); + irbuf =kmem_zalloc_large (PAGE_SIZE *4 ,KM_SLEEP );if (!irbuf)return -ENOMEM ; - - nirbuf = irbsize /sizeof (*irbuf); + nirbuf = (PAGE_SIZE *4 ) /sizeof (*irbuf);/* * Loop over the allocation groups, starting from the last
Greg Kroah-Hartman
maintainerPATCH 45/50 libata: transport: Remove circular dependency at free time
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gwendal Grignou <[email protected]>
[ Upstream commit d85fc67dd11e9a32966140677d4d6429ca540b25 ]
Without this patch, failed probe would not free resources like irq.
ata port tdev object currently hold a reference to the ata port object. Therefore the ata port object release function will not get called until the ata_tport_release is called. But that would never happen, releasing the last reference of ata port dev is done by scsi_host_release, which is called by ata_host_release when the ata port object is released.
The ata device objects actually do not need to explicitly hold a reference to their real counterpart, given the transport objects are the children of these objects and device_add() is call for each child. We know the parent will not be deleted until we call the child's device_del().
--- drivers/ata/libata-transport.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/ata/libata-transport.c +3 -6
@@ -224,7 +224,6 @@ static DECLARE_TRANSPORT_CLASS(ata_port_static void ata_tport_release (struct device *dev) { -put_device (dev->parent); }/**
@@ -284,7 +283,7 @@ int ata_tport_add(struct device *parent,device_initialize (dev); dev->type = &ata_port_type; - dev->parent =get_device (parent); + dev->parent = parent; dev->release = ata_tport_release;dev_set_name (dev,"ata%d" , ap->print_id);transport_setup_device (dev);
@@ -348,7 +347,6 @@ static DECLARE_TRANSPORT_CLASS(ata_link_static void ata_tlink_release (struct device *dev) { -put_device (dev->parent); }/**
@@ -410,7 +408,7 @@ int ata_tlink_add(struct ata_link *link)int error;device_initialize (dev); - dev->parent =get_device (&ap->tdev); + dev->parent = &ap->tdev; dev->release = ata_tlink_release;if (ata_is_host_link (link))dev_set_name (dev,"link%d" , ap->print_id);
@@ -588,7 +586,6 @@ static DECLARE_TRANSPORT_CLASS(ata_dev_cstatic void ata_tdev_release (struct device *dev) { -put_device (dev->parent); }/**
@@ -661,7 +658,7 @@ static int ata_tdev_add(struct ata_devicint error;device_initialize (dev); - dev->parent =get_device (&link->tdev); + dev->parent = &link->tdev; dev->release = ata_tdev_release;if (ata_is_host_link (link))dev_set_name (dev,"dev%d.%d" , ap->print_id,ata_dev->devno);
Greg Kroah-Hartman
maintainerPATCH 46/50 drivers: firmware: psci: drop duplicate const from psci_of_match
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jisheng Zhang <[email protected]>
commit 1d2d8de44a6c20af262b4c3d3b93ef7ec3c5488e upstream.
This is to fix below sparse warning:
drivers/firmware/psci.c:mmm:nn: warning: duplicate const
--- drivers/firmware/psci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/psci.c +1 -1
@@ -424,7 +424,7 @@ out_put_node:return err; } -static const struct of_device_id const psci_of_match[]__initconst = { +static const struct of_device_id psci_of_match[]__initconst = { { .compatible ="arm,psci" , .data = psci_0_1_init}, { .compatible ="arm,psci-0.2" , .data = psci_0_2_init}, { .compatible ="arm,psci-1.0" , .data = psci_0_2_init},
Greg Kroah-Hartman
maintainerPATCH 47/50 IB/qib: fix false-postive maybe-uninitialized warning
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit f6aafac184a3e46e919769dd4faa8bf0dc436534 upstream.
aarch64-linux-gcc-7 complains about code it doesn't fully understand:
drivers/infiniband/hw/qib/qib_iba7322.c: In function 'qib_7322_txchk_change':include/asm-generic/bitops/non-atomic.h:105:35: error: 'shadow' may be used uninitialized in this function [-Werror=maybe-uninitialized]
The code is right, and despite trying hard, I could not come up with a version that I liked better than just adding a fake initialization here to shut up the warning.
--- drivers/infiniband/hw/qib/qib_iba7322.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qib/qib_iba7322.c +1 -1
@@ -7097,7 +7097,7 @@ static void qib_7322_txchk_change(structunsigned long flags;while (wait) { -unsigned long shadow; +unsigned long shadow =0 ;int cstart, previ =-1 ;/*
Greg Kroah-Hartman
maintainerPATCH 49/50 ALSA: au88x0: avoid theoretical uninitialized access
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 13f99ebdd602ebdafb909e15ec6ffb1e34690167 upstream.
The latest gcc-7.0.1 snapshot points out that we if nr_ch is zero, we never initialize some variables:
sound/pci/au88x0/au88x0_core.c: In function 'vortex_adb_allocroute':sound/pci/au88x0/au88x0_core.c:2304:68: error: 'mix[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] sound/pci/au88x0/au88x0_core.c:2305:58: error: 'src[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
I assume this can never happen in practice, but adding a check here doesn't hurt either and avoids the warning. The code has been unchanged since the start of git history.
--- sound/pci/au88x0/au88x0_core.c | 3 +++ 1 file changed, 3 insertions(+)
sound/pci/au88x0/au88x0_core.c +3 -0
@@ -2279,6 +2279,9 @@ vortex_adb_allocroute(vortex_t *vortex, } else { int src[2], mix[2]; + if (nr_ch < 1) + return -EINVAL; + /* Get SRC and MIXER hardware resources. */ for (i = 0; i < nr_ch; i++) { if ((mix[i] =
Greg Kroah-Hartman
maintainerPATCH 50/50 ttpci: address stringop overflow warning
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 69d3973af1acd4c0989ec8218c05f12d303cd7cf upstream.
gcc-7.0.1 warns about old code in ttpci:
In file included from drivers/media/pci/ttpci/av7110.c:63:0:
In function 'irdebi.isra.2',
inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3,
inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:659:3:
drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
memcpy(av7110->debi_virt, (char *) &res, count);
In function 'irdebi.isra.2',
inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3,
inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:668:3:drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
memcpy(av7110->debi_virt, (char *) &res, count);
Apparently, 'count' can be negative here, which will then get turned into a giant size argument for memcpy. Changing the sizes to 'unsigned int' instead seems safe as we already check for maximum sizes, and it also simplifies the code a bit.
--- drivers/media/pci/ttpci/av7110_hw.c | 8 ++++---- drivers/media/pci/ttpci/av7110_hw.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/media/pci/ttpci/av7110_hw.c +4 -4
@@ -56,11 +56,11 @@by Nathan Laredo <[email protected]> */ int av7110_debiwrite (struct av7110 *av7110,u32 config, -int addr,u32 val,int count) +int addr,u32 val,unsigned int count) {struct saa7146_dev *dev = av7110->dev; -if (count <=0 || count >32764 ) { +if (count >32764 ) {printk ("%s: invalid count %d\n" , __func__, count);return -1 ; }
@@ -78,12 +78,12 @@ int av7110_debiwrite(struct av7110 *av71return 0 ; } -u32 av7110_debiread (struct av7110 *av7110,u32 config,int addr,int count) +u32 av7110_debiread (struct av7110 *av7110,u32 config,int addr,unsigned int count) {struct saa7146_dev *dev = av7110->dev;u32 result =0 ; -if (count >32764 || count <=0 ) { +if (count >32764 ) {printk ("%s: invalid count %d\n" , __func__, count);return 0 ; }
drivers/media/pci/ttpci/av7110_hw.h +6 -6
@@ -377,14 +377,14 @@ extern int av7110_fw_request(struct av71/* DEBI (saa7146 data extension bus interface) access */ extern int av7110_debiwrite (struct av7110 *av7110,u32 config, -int addr,u32 val,int count); +int addr,u32 val,unsigned int count);extern u32 av7110_debiread (struct av7110 *av7110,u32 config, -int addr,int count); +int addr,unsigned int count);/* DEBI during interrupt */ /* single word writes */ -static inline void iwdebi (struct av7110 *av7110,u32 config,int addr,u32 val,int count) +static inline void iwdebi (struct av7110 *av7110,u32 config,int addr,u32 val,unsigned int count) {av7110_debiwrite (av7110, config, addr, val, count); }
@@ -397,7 +397,7 @@ static inline void mwdebi(struct av7110av7110_debiwrite (av7110, config, addr,0 , count); } -static inline u32 irdebi (struct av7110 *av7110,u32 config,int addr,u32 val,int count) +static inline u32 irdebi (struct av7110 *av7110,u32 config,int addr,u32 val,unsigned int count) {u32 res;
@@ -408,7 +408,7 @@ static inline u32 irdebi(struct av7110 * }/* DEBI outside interrupts, only for count <= 4! */ -static inline void wdebi (struct av7110 *av7110,u32 config,int addr,u32 val,int count) +static inline void wdebi (struct av7110 *av7110,u32 config,int addr,u32 val,unsigned int count) {unsigned long flags;
@@ -417,7 +417,7 @@ static inline void wdebi(struct av7110 *spin_unlock_irqrestore (&av7110->debilock, flags); } -static inline u32 rdebi (struct av7110 *av7110,u32 config,int addr,u32 val,int count) +static inline u32 rdebi (struct av7110 *av7110,u32 config,int addr,u32 val,unsigned int count) {unsigned long flags;u32 res;
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.91 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Oct 8 08:36:32 UTC 2017. Anything received after that time might be too late.
Build results:
total: 145 pass: 145 fail: 0 Qemu test results: total: 116 pass: 116 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 9 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.91 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Oct 8 08:36:32 UTC 2017. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 145 pass: 145 fail: 0 Qemu test results: total: 116 pass: 116 fail: 0Details are available at http://kerneltests.org/builders.
Yeah, I got one tree right! :)
thanks for letting me know.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.91 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Oct 8 08:36:32 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.91-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions. No regressions in selftest run (non-root tests only) compared to 4.4.90 run with 4.14-rc3 selftests.
thanks,
-- Shuah
Quoted 17 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.91 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Oct 8 08:36:32 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.91-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.4.y
and the diffstat can be found below.
Quoted 5 lines
thanks,
greg k-h
-------------
From Linaro’s validation farm we have the following test results. TI's 32 bit arm board the X15 is a new addition. More of LTP is being run. There is triage to do and you’ll notice that I’m differentiating between ‘known failures’ and ‘failures’ in the data below. The later obviously will get looked at so we can graduate failures to known failures/fixes and improve finding regressions. (Anyone want to help?) In summary I wouldn’t hold up 4.4.91 based on the failures below, but likewise we shouldn’t get these sit. Given it’s a Sat, the Mrs has plans, I’ve no time to dig until later.
kernel: 4.4.91-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.4.y
git commit: 033261bc663341dfd35771aac2eca2614d6921ea
git describe: v4.4.90-51-g033261bc6633
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.4-oe/build/v4.4.90-51-g033261bc6633
No regressions (compared to build v4.4.90)
Boards, architectures and test suites:
-------------------------------------
juno-r2 - arm64
* boot - 1 pass
* kselftest - 32 pass - 1 skip - 21 known failures
* libhugetlbfs - 90 pass - 1 skip
* ltp-cap_bounds-tests - 2 pass
* ltp-commands-tests - 25 pass - 13 skip - 6 fail
* ltp-containers-tests - 27 pass - 36 skip - 18 fail
* ltp-fcntl-locktests-tests - 2 pass
* ltp-filecaps-tests - 2 pass
* ltp-fs-tests - 59 pass - 3 fail
* ltp-fs_bind-tests - 2 pass
* ltp-fs_perms_simple-tests - 19 pass
* ltp-fsx-tests - 2 pass
* ltp-hugetlb-tests - 22 pass
* ltp-io-tests - 3 pass
* ltp-ipc-tests - 9 pass
* ltp-math-tests - 11 pass
* ltp-nptl-tests - 2 pass
* ltp-pty-tests - 4 pass
* ltp-sched-tests - 13 pass
* ltp-securebits-tests - 4 pass
* ltp-timers-tests - 13 pass
x15 - arm
* boot - 1 pass
* kselftest - 31 pass - 1 skip - 21 fail
* ltp-syscalls-tests - 1018 pass - 80 skip - 2 fail
dell-poweredge-r200 - x86_64
* boot - 1 pass
* kselftest - 44 pass - 24 known failures
* libhugetlbfs - 76 pass - 1 skip
* ltp-cap_bounds-tests - 2 pass
* ltp-commands-tests - 23 pass - 13 skip - 8 fail
* ltp-containers-tests - 63 pass - 18 fail
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests - 2 pass
* ltp-fs-tests - 59 pass - 3 fail
* ltp-fs_bind-tests - 2 pass
* ltp-fs_perms_simple-tests - 19 pass
* ltp-fsx-tests - 2 pass
* ltp-hugetlb-tests - 22 tests
* ltp-io-tests - 3 pass
* ltp-ipc-tests - 9 pass
* ltp-math-tests - 11 pass
* ltp-nptl-tests - 2 pass
* ltp-pty-tests - 4 pass
* ltp-securebits-tests - 4 pass
* ltp-syscalls-tests - 941 pass - 175 skip - 11 known failures
* ltp-timers-tests - 13 pass
Documentation - https://collaborate.linaro.org/display/LKFT/Email+Reports