[PATCH AUTOSEL 4.9 05/20] perf/ring_buffer: Fix exposing a temporarily decreased data_head

2019-06-08 Thread Sasha Levin
From: Yabin Cui [ Upstream commit 1b038c6e05ff70a1e66e3e571c2e6106bdb75f53 ] In perf_output_put_handle(), an IRQ/NMI can happen in below location and write records to the same ring buffer: ... local_dec_and_test(&rb->nest) ... <-- an IRQ/NMI can

[PATCH AUTOSEL 4.9 03/20] mISDN: make sure device name is NUL terminated

2019-06-08 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit ccfb62f27beb295103e9392462b20a6ed807d0ea ] The user can change the device_name with the IMSETDEVNAME ioctl, but we need to ensure that the user's name is NUL terminated. Otherwise it could result in a buffer overflow when we copy the name back to the user w

[PATCH AUTOSEL 4.9 16/20] net: sh_eth: fix mdio access in sh_eth_close() for R-Car Gen2 and RZ/A1 SoCs

2019-06-08 Thread Sasha Levin
From: Yoshihiro Shimoda [ Upstream commit 315ca92dd863fecbffc0bb52ae0ac11e0398726a ] The sh_eth_close() resets the MAC and then calls phy_stop() so that mdio read access result is incorrect without any error according to kernel trace like below: ifconfig-216 [003] .n.. 109.133124: mdio_acce

[PATCH AUTOSEL 4.9 19/20] scsi: libsas: delete sas port if expander discover failed

2019-06-08 Thread Sasha Levin
From: Jason Yan [ Upstream commit 3b0541791453fbe7f42867e310e0c9eb6295364d ] The sas_port(phy->port) allocated in sas_ex_discover_expander() will not be deleted when the expander failed to discover. This will cause resource leak and a further issue of kernel BUG like below: [159785.843156] por

[PATCH AUTOSEL 4.9 13/20] ia64: fix build errors by exporting paddr_to_nid()

2019-06-08 Thread Sasha Levin
From: Randy Dunlap [ Upstream commit 9a626c4a6326da4433a0d4d4a8a7d1571caf1ed3 ] Fix build errors on ia64 when DISCONTIGMEM=y and NUMA=y by exporting paddr_to_nid(). Fixes these build errors: ERROR: "paddr_to_nid" [sound/core/snd-pcm.ko] undefined! ERROR: "paddr_to_nid" [net/sunrpc/sunrpc.ko] u

[PATCH AUTOSEL 4.9 17/20] scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route()

2019-06-08 Thread Sasha Levin
From: Varun Prakash [ Upstream commit cc555759117e8349088e0c5d19f2f2a500bafdbd ] ip_dev_find() can return NULL so add a check for NULL pointer. Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/cxgbi/libcxgbi.c | 4 1 file change

[PATCH AUTOSEL 4.4 13/13] scsi: libsas: delete sas port if expander discover failed

2019-06-08 Thread Sasha Levin
From: Jason Yan [ Upstream commit 3b0541791453fbe7f42867e310e0c9eb6295364d ] The sas_port(phy->port) allocated in sas_ex_discover_expander() will not be deleted when the expander failed to discover. This will cause resource leak and a further issue of kernel BUG like below: [159785.843156] por

[PATCH AUTOSEL 4.4 09/13] ia64: fix build errors by exporting paddr_to_nid()

2019-06-08 Thread Sasha Levin
From: Randy Dunlap [ Upstream commit 9a626c4a6326da4433a0d4d4a8a7d1571caf1ed3 ] Fix build errors on ia64 when DISCONTIGMEM=y and NUMA=y by exporting paddr_to_nid(). Fixes these build errors: ERROR: "paddr_to_nid" [sound/core/snd-pcm.ko] undefined! ERROR: "paddr_to_nid" [net/sunrpc/sunrpc.ko] u

[PATCH AUTOSEL 4.4 11/13] net: sh_eth: fix mdio access in sh_eth_close() for R-Car Gen2 and RZ/A1 SoCs

2019-06-08 Thread Sasha Levin
From: Yoshihiro Shimoda [ Upstream commit 315ca92dd863fecbffc0bb52ae0ac11e0398726a ] The sh_eth_close() resets the MAC and then calls phy_stop() so that mdio read access result is incorrect without any error according to kernel trace like below: ifconfig-216 [003] .n.. 109.133124: mdio_acce

[PATCH AUTOSEL 4.4 01/13] mISDN: make sure device name is NUL terminated

2019-06-08 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit ccfb62f27beb295103e9392462b20a6ed807d0ea ] The user can change the device_name with the IMSETDEVNAME ioctl, but we need to ensure that the user's name is NUL terminated. Otherwise it could result in a buffer overflow when we copy the name back to the user w

[PATCH AUTOSEL 4.4 02/13] x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor

2019-06-08 Thread Sasha Levin
From: Frank van der Linden [ Upstream commit 2ac44ab608705948564791ce1d15d43ba81a1e38 ] For F17h AMD CPUs, the CPB capability ('Core Performance Boost') is forcibly set, because some versions of that chip incorrectly report that they do not have it. However, a hypervisor may filter out the CPB

[PATCH AUTOSEL 4.4 08/13] configfs: Fix use-after-free when accessing sd->s_dentry

2019-06-08 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit f6122ed2a4f9c9c1c073ddf6308d1b2ac10e0781 ] In the vfs_statx() context, during path lookup, the dentry gets added to sd->s_dentry via configfs_attach_attr(). In the end, vfs_statx() kills the dentry by calling path_put(), which invokes configfs_d_iput(). Id

[PATCH AUTOSEL 4.4 12/13] scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route()

2019-06-08 Thread Sasha Levin
From: Varun Prakash [ Upstream commit cc555759117e8349088e0c5d19f2f2a500bafdbd ] ip_dev_find() can return NULL so add a check for NULL pointer. Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/cxgbi/libcxgbi.c | 4 1 file change

[PATCH AUTOSEL 4.4 03/13] perf/ring_buffer: Fix exposing a temporarily decreased data_head

2019-06-08 Thread Sasha Levin
From: Yabin Cui [ Upstream commit 1b038c6e05ff70a1e66e3e571c2e6106bdb75f53 ] In perf_output_put_handle(), an IRQ/NMI can happen in below location and write records to the same ring buffer: ... local_dec_and_test(&rb->nest) ... <-- an IRQ/NMI can

[PATCH AUTOSEL 4.4 05/13] gpio: fix gpio-adp5588 build errors

2019-06-08 Thread Sasha Levin
From: Randy Dunlap [ Upstream commit e9646f0f5bb62b7d43f0968f39d536cfe7123b53 ] The gpio-adp5588 driver uses interfaces that are provided by GPIOLIB_IRQCHIP, so select that symbol in its Kconfig entry. Fixes these build errors: ../drivers/gpio/gpio-adp5588.c: In function ‘adp5588_irq_handler’:

[PATCH AUTOSEL 4.9 18/20] scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask

2019-06-08 Thread Sasha Levin
From: Lianbo Jiang [ Upstream commit 1d94f06e7f5df4064ef336b7b710f50143b64a53 ] When SME is enabled, the smartpqi driver won't work on the HP DL385 G10 machine, which causes the failure of kernel boot because it fails to allocate pqi error buffer. Please refer to the kernel log: [9.4317

[PATCH AUTOSEL 4.4 04/13] perf/ring_buffer: Add ordering to rb->nest increment

2019-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit 3f9fbe9bd86c534eba2faf5d840fd44c6049f50e ] Similar to how decrementing rb->next too early can cause data_head to (temporarily) be observed to go backward, so too can this happen when we increment too late. This barrier() ensures the rb->head load happens a

[PATCH AUTOSEL 4.9 14/20] KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list

2019-06-08 Thread Sasha Levin
From: Paul Mackerras [ Upstream commit 1659e27d2bc1ef47b6d031abe01b467f18cb72d9 ] Currently the Book 3S KVM code uses kvm->lock to synchronize access to the kvm->arch.rtas_tokens list. Because this list is scanned inside kvmppc_rtas_hcall(), which is called with the vcpu mutex held, taking kvm-

[PATCH AUTOSEL 4.4 06/13] net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE()

2019-06-08 Thread Sasha Levin
From: Kees Cook [ Upstream commit 3e66b7cc50ef921121babc91487e1fb98af1ba6e ] Building with Clang reports the redundant use of MODULE_DEVICE_TABLE(): drivers/net/ethernet/dec/tulip/de4x5.c:2110:1: error: redefinition of '__mod_eisa__de4x5_eisa_ids_device_table' MODULE_DEVICE_TABLE(eisa, de4x5_e

[PATCH AUTOSEL 4.4 10/13] KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list

2019-06-08 Thread Sasha Levin
From: Paul Mackerras [ Upstream commit 1659e27d2bc1ef47b6d031abe01b467f18cb72d9 ] Currently the Book 3S KVM code uses kvm->lock to synchronize access to the kvm->arch.rtas_tokens list. Because this list is scanned inside kvmppc_rtas_hcall(), which is called with the vcpu mutex held, taking kvm-

[PATCH AUTOSEL 4.9 20/20] mlxsw: spectrum: Prevent force of 56G

2019-06-08 Thread Sasha Levin
From: Amit Cohen [ Upstream commit 275e928f19117d22f6d26dee94548baf4041b773 ] Force of 56G is not supported by hardware in Ethernet devices. This configuration fails with a bad parameter error from firmware. Add check of this case. Instead of trying to set 56G with autoneg off, return a meaning

[PATCH AUTOSEL 4.4 07/13] i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr

2019-06-08 Thread Sasha Levin
From: Yingjoe Chen [ Upstream commit a0692f0eef91354b62c2b4c94954536536be5425 ] If I2C_M_RECV_LEN check failed, msgs[i].buf allocated by memdup_user will not be freed. Pump index up so it will be freed. Fixes: 838bfa6049fb ("i2c-dev: Add support for I2C_M_RECV_LEN") Signed-off-by: Yingjoe Chen

[PATCH AUTOSEL 4.9 11/20] perf data: Fix 'strncat may truncate' build failure with recent gcc

2019-06-08 Thread Sasha Levin
From: Shawn Landden [ Upstream commit 97acec7df172cd1e450f81f5e293c0aa145a2797 ] This strncat() is safe because the buffer was allocated with zalloc(), however gcc doesn't know that. Since the string always has 4 non-null bytes, just use memcpy() here. CC /home/shawn/linux/tools/perf/

[PATCH AUTOSEL 4.9 15/20] KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpu

2019-06-08 Thread Sasha Levin
From: Paul Mackerras [ Upstream commit 5a3f49364c3ffa1107bd88f8292406e98c5d206c ] Currently the HV KVM code takes the kvm->lock around calls to kvm_for_each_vcpu() and kvm_get_vcpu_by_id() (which can call kvm_for_each_vcpu() internally). However, that leads to a lock order inversion problem, be

[PATCH AUTOSEL 4.9 10/20] configfs: Fix use-after-free when accessing sd->s_dentry

2019-06-08 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit f6122ed2a4f9c9c1c073ddf6308d1b2ac10e0781 ] In the vfs_statx() context, during path lookup, the dentry gets added to sd->s_dentry via configfs_attach_attr(). In the end, vfs_statx() kills the dentry by calling path_put(), which invokes configfs_d_iput(). Id

[PATCH AUTOSEL 4.9 08/20] net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE()

2019-06-08 Thread Sasha Levin
From: Kees Cook [ Upstream commit 3e66b7cc50ef921121babc91487e1fb98af1ba6e ] Building with Clang reports the redundant use of MODULE_DEVICE_TABLE(): drivers/net/ethernet/dec/tulip/de4x5.c:2110:1: error: redefinition of '__mod_eisa__de4x5_eisa_ids_device_table' MODULE_DEVICE_TABLE(eisa, de4x5_e

[PATCH AUTOSEL 4.9 07/20] gpio: fix gpio-adp5588 build errors

2019-06-08 Thread Sasha Levin
From: Randy Dunlap [ Upstream commit e9646f0f5bb62b7d43f0968f39d536cfe7123b53 ] The gpio-adp5588 driver uses interfaces that are provided by GPIOLIB_IRQCHIP, so select that symbol in its Kconfig entry. Fixes these build errors: ../drivers/gpio/gpio-adp5588.c: In function ‘adp5588_irq_handler’:

[PATCH AUTOSEL 4.9 04/20] x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor

2019-06-08 Thread Sasha Levin
From: Frank van der Linden [ Upstream commit 2ac44ab608705948564791ce1d15d43ba81a1e38 ] For F17h AMD CPUs, the CPB capability ('Core Performance Boost') is forcibly set, because some versions of that chip incorrectly report that they do not have it. However, a hypervisor may filter out the CPB

[PATCH] staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work

2019-06-08 Thread Colin King
From: Colin Ian King In the default event case switchdev_work is being leaked because nothing is queued for work. Fix this by kfree'ing switchdev_work before returning NOTIFY_DONE. Addresses-Coverity: ("Resource leak") Fixes: 44baaa43d7cc ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet

[PATCH AUTOSEL 4.14 25/31] net: sh_eth: fix mdio access in sh_eth_close() for R-Car Gen2 and RZ/A1 SoCs

2019-06-08 Thread Sasha Levin
From: Yoshihiro Shimoda [ Upstream commit 315ca92dd863fecbffc0bb52ae0ac11e0398726a ] The sh_eth_close() resets the MAC and then calls phy_stop() so that mdio read access result is incorrect without any error according to kernel trace like below: ifconfig-216 [003] .n.. 109.133124: mdio_acce

[PATCH AUTOSEL 4.9 06/20] perf/ring_buffer: Add ordering to rb->nest increment

2019-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit 3f9fbe9bd86c534eba2faf5d840fd44c6049f50e ] Similar to how decrementing rb->next too early can cause data_head to (temporarily) be observed to go backward, so too can this happen when we increment too late. This barrier() ensures the rb->head load happens a

[PATCH AUTOSEL 4.9 09/20] i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr

2019-06-08 Thread Sasha Levin
From: Yingjoe Chen [ Upstream commit a0692f0eef91354b62c2b4c94954536536be5425 ] If I2C_M_RECV_LEN check failed, msgs[i].buf allocated by memdup_user will not be freed. Pump index up so it will be freed. Fixes: 838bfa6049fb ("i2c-dev: Add support for I2C_M_RECV_LEN") Signed-off-by: Yingjoe Chen

[PATCH AUTOSEL 4.14 17/31] i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr

2019-06-08 Thread Sasha Levin
From: Yingjoe Chen [ Upstream commit a0692f0eef91354b62c2b4c94954536536be5425 ] If I2C_M_RECV_LEN check failed, msgs[i].buf allocated by memdup_user will not be freed. Pump index up so it will be freed. Fixes: 838bfa6049fb ("i2c-dev: Add support for I2C_M_RECV_LEN") Signed-off-by: Yingjoe Chen

[PATCH AUTOSEL 4.14 26/31] net: phy: dp83867: Set up RGMII TX delay

2019-06-08 Thread Sasha Levin
From: Max Uvarov [ Upstream commit 2b892649254fec01678c64f16427622b41fa27f4 ] PHY_INTERFACE_MODE_RGMII_RXID is less then TXID so code to set tx delay is never called. Fixes: 2a10154abcb75 ("net: phy: dp83867: Add TI dp83867 phy") Signed-off-by: Max Uvarov Cc: Florian Fainelli Reviewed-by: Flo

[PATCH AUTOSEL 4.14 19/31] configfs: Fix use-after-free when accessing sd->s_dentry

2019-06-08 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit f6122ed2a4f9c9c1c073ddf6308d1b2ac10e0781 ] In the vfs_statx() context, during path lookup, the dentry gets added to sd->s_dentry via configfs_attach_attr(). In the end, vfs_statx() kills the dentry by calling path_put(), which invokes configfs_d_iput(). Id

[PATCH AUTOSEL 4.14 28/31] scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask

2019-06-08 Thread Sasha Levin
From: Lianbo Jiang [ Upstream commit 1d94f06e7f5df4064ef336b7b710f50143b64a53 ] When SME is enabled, the smartpqi driver won't work on the HP DL385 G10 machine, which causes the failure of kernel boot because it fails to allocate pqi error buffer. Please refer to the kernel log: [9.4317

[PATCH AUTOSEL 4.14 18/31] ALSA: hda - Force polling mode on CNL for fixing codec communication

2019-06-08 Thread Sasha Levin
From: Bard Liao [ Upstream commit fa763f1b2858752e615046886a1b7faffc82 ] We observed the same issue as reported by commit a8d7bde23e7130686b7662 ("ALSA: hda - Force polling mode on CFL for fixing codec communication") We don't have a better solution. So apply the same workaround to CNL. Sig

[PATCH AUTOSEL 4.14 24/31] KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpu

2019-06-08 Thread Sasha Levin
From: Paul Mackerras [ Upstream commit 5a3f49364c3ffa1107bd88f8292406e98c5d206c ] Currently the HV KVM code takes the kvm->lock around calls to kvm_for_each_vcpu() and kvm_get_vcpu_by_id() (which can call kvm_for_each_vcpu() internally). However, that leads to a lock order inversion problem, be

[PATCH AUTOSEL 4.14 14/31] net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE()

2019-06-08 Thread Sasha Levin
From: Kees Cook [ Upstream commit 3e66b7cc50ef921121babc91487e1fb98af1ba6e ] Building with Clang reports the redundant use of MODULE_DEVICE_TABLE(): drivers/net/ethernet/dec/tulip/de4x5.c:2110:1: error: redefinition of '__mod_eisa__de4x5_eisa_ids_device_table' MODULE_DEVICE_TABLE(eisa, de4x5_e

[PATCH AUTOSEL 4.14 09/31] x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor

2019-06-08 Thread Sasha Levin
From: Frank van der Linden [ Upstream commit 2ac44ab608705948564791ce1d15d43ba81a1e38 ] For F17h AMD CPUs, the CPB capability ('Core Performance Boost') is forcibly set, because some versions of that chip incorrectly report that they do not have it. However, a hypervisor may filter out the CPB

[PATCH AUTOSEL 4.14 12/31] perf/ring-buffer: Always use {READ,WRITE}_ONCE() for rb->user_page data

2019-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit 4d839dd9e4356bbacf3eb0ab13a549b83b008c21 ] We must use {READ,WRITE}_ONCE() on rb->user_page data such that concurrent usage will see whole values. A few key sites were missing this. Suggested-by: Yabin Cui Signed-off-by: Peter Zijlstra (Intel) Cc: Alexan

[PATCH AUTOSEL 4.14 15/31] PCI: PM: Avoid possible suspend-to-idle issue

2019-06-08 Thread Sasha Levin
From: "Rafael J. Wysocki" [ Upstream commit d491f2b75237ef37d8867830ab7fad8d9659e853 ] If a PCI driver leaves the device handled by it in D0 and calls pci_save_state() on the device in its ->suspend() or ->suspend_late() callback, it can expect the device to stay in D0 over the whole s2idle cycl

[PATCH AUTOSEL 4.14 23/31] KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list

2019-06-08 Thread Sasha Levin
From: Paul Mackerras [ Upstream commit 1659e27d2bc1ef47b6d031abe01b467f18cb72d9 ] Currently the Book 3S KVM code uses kvm->lock to synchronize access to the kvm->arch.rtas_tokens list. Because this list is scanned inside kvmppc_rtas_hcall(), which is called with the vcpu mutex held, taking kvm-

[PATCH AUTOSEL 4.14 03/31] netfilter: nf_queue: fix reinject verdict handling

2019-06-08 Thread Sasha Levin
From: Jagdish Motwani [ Upstream commit 946c0d8e6ed43dae6527e878d0077c1e11015db0 ] This patch fixes netfilter hook traversal when there are more than 1 hooks returning NF_QUEUE verdict. When the first queue reinjects the packet, 'nf_reinject' starts traversing hooks with a proper hook_index. How

[PATCH AUTOSEL 4.14 20/31] perf data: Fix 'strncat may truncate' build failure with recent gcc

2019-06-08 Thread Sasha Levin
From: Shawn Landden [ Upstream commit 97acec7df172cd1e450f81f5e293c0aa145a2797 ] This strncat() is safe because the buffer was allocated with zalloc(), however gcc doesn't know that. Since the string always has 4 non-null bytes, just use memcpy() here. CC /home/shawn/linux/tools/perf/

[PATCH AUTOSEL 5.1 60/70] blk-mq: Fix memory leak in error handling

2019-06-08 Thread Sasha Levin
From: Jes Sorensen [ Upstream commit 41de54c64811bf087c8464fdeb43c6ad8be2686b ] If blk_mq_init_allocated_queue() fails, make sure to free the poll stat callback struct allocated. Signed-off-by: Jes Sorensen Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-mq.c | 5 - 1

[PATCH AUTOSEL 4.14 11/31] perf/ring_buffer: Add ordering to rb->nest increment

2019-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit 3f9fbe9bd86c534eba2faf5d840fd44c6049f50e ] Similar to how decrementing rb->next too early can cause data_head to (temporarily) be observed to go backward, so too can this happen when we increment too late. This barrier() ensures the rb->head load happens a

[PATCH AUTOSEL 4.14 06/31] clk: ti: clkctrl: Fix clkdm_clk handling

2019-06-08 Thread Sasha Levin
From: Tony Lindgren [ Upstream commit 1cc54078d104f5b4d7e9f8d55362efa5a8daffdb ] We need to always call clkdm_clk_enable() and clkdm_clk_disable() even the clkctrl clock(s) enabled for the domain do not have any gate register bits. Otherwise clockdomains may never get enabled except when devices

[PATCH AUTOSEL 4.14 05/31] selftests: netfilter: missing error check when setting up veth interface

2019-06-08 Thread Sasha Levin
From: Jeffrin Jose T [ Upstream commit 82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43 ] A test for the basic NAT functionality uses ip command which needs veth device. There is a condition where the kernel support for veth is not compiled into the kernel and the test script breaks. This patch contains

[PATCH AUTOSEL 5.1 38/70] net: aquantia: fix LRO with FCS error

2019-06-08 Thread Sasha Levin
From: Dmitry Bogdanov [ Upstream commit eaeb3b7494ba9159323814a8ce8af06a9277d99b ] Driver stops producing skbs on ring if a packet with FCS error was coalesced into LRO session. Ring gets hang forever. Thats a logical error in driver processing descriptors: When rx_stat indicates MAC Error, nex

[PATCH AUTOSEL 5.1 42/70] configfs: Fix use-after-free when accessing sd->s_dentry

2019-06-08 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit f6122ed2a4f9c9c1c073ddf6308d1b2ac10e0781 ] In the vfs_statx() context, during path lookup, the dentry gets added to sd->s_dentry via configfs_attach_attr(). In the end, vfs_statx() kills the dentry by calling path_put(), which invokes configfs_d_iput(). Id

[PATCH AUTOSEL 5.1 40/70] i2c: mlxcpld: Fix wrong initialization order in probe

2019-06-08 Thread Sasha Levin
From: Vadim Pasternak [ Upstream commit 13067ef73f337336e3149f5bb9f3fd05fe7f87a0 ] Fix wrong order in probing routine initialization - field `base_addr' is used before it's initialized. Move assignment of 'priv->base_addr` to the beginning, prior the call to mlxcpld_i2c_read_comm(). Wrong order

[PATCH AUTOSEL 5.1 35/70] loop: Don't change loop device under exclusive opener

2019-06-08 Thread Sasha Levin
From: Jan Kara [ Upstream commit 33ec3e53e7b1869d7851e59e126bdb0fe0bd1982 ] Loop module allows calling LOOP_SET_FD while there are other openers of the loop device. Even exclusive ones. This can lead to weird consequences such as kernel deadlocks like: mount_bdev()lo

[PATCH AUTOSEL 5.1 43/70] perf data: Fix 'strncat may truncate' build failure with recent gcc

2019-06-08 Thread Sasha Levin
From: Shawn Landden [ Upstream commit 97acec7df172cd1e450f81f5e293c0aa145a2797 ] This strncat() is safe because the buffer was allocated with zalloc(), however gcc doesn't know that. Since the string always has 4 non-null bytes, just use memcpy() here. CC /home/shawn/linux/tools/perf/

[PATCH AUTOSEL 5.1 34/70] PCI: PM: Avoid possible suspend-to-idle issue

2019-06-08 Thread Sasha Levin
From: "Rafael J. Wysocki" [ Upstream commit d491f2b75237ef37d8867830ab7fad8d9659e853 ] If a PCI driver leaves the device handled by it in D0 and calls pci_save_state() on the device in its ->suspend() or ->suspend_late() callback, it can expect the device to stay in D0 over the whole s2idle cycl

[PATCH AUTOSEL 5.1 31/70] dpaa2-eth: Use PTR_ERR_OR_ZERO where appropriate

2019-06-08 Thread Sasha Levin
From: Ioana Radulescu [ Upstream commit bd8460fa4de46e9d6177af4fe33bf0763a7af4b7 ] Use PTR_ERR_OR_ZERO instead of PTR_ERR in cases where zero is a valid input. Reported by smatch. Signed-off-by: Ioana Radulescu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethern

[PATCH AUTOSEL 5.1 30/70] dpaa2-eth: Fix potential spectre issue

2019-06-08 Thread Sasha Levin
From: Ioana Radulescu [ Upstream commit 5a20a093d965560f632b2ec325f8876918f78165 ] Smatch reports a potential spectre vulnerability in the dpaa2-eth driver, where the value of rxnfc->fs.location (which is provided from user-space) is used as index in an array. Add a call to array_index_nospec()

[PATCH AUTOSEL 5.1 33/70] ACPI/PCI: PM: Add missing wakeup.flags.valid checks

2019-06-08 Thread Sasha Levin
From: "Rafael J. Wysocki" [ Upstream commit 9a51c6b1f9e0239a9435db036b212498a2a3b75c ] Both acpi_pci_need_resume() and acpi_dev_needs_resume() check if the current ACPI wakeup configuration of the device matches what is expected as far as system wakeup from sleep states is concerned, as reflecte

[PATCH AUTOSEL 5.1 26/70] net: stmmac: update rx tail pointer register to fix rx dma hang issue.

2019-06-08 Thread Sasha Levin
From: Biao Huang [ Upstream commit 4523a5611526709ec9b4e2574f1bb7818212651e ] Currently we will not update the receive descriptor tail pointer in stmmac_rx_refill. Rx dma will think no available descriptors and stop once received packets exceed DMA_RX_SIZE, so that the rx only test will fail. U

[PATCH AUTOSEL 5.1 20/70] x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor

2019-06-08 Thread Sasha Levin
From: Frank van der Linden [ Upstream commit 2ac44ab608705948564791ce1d15d43ba81a1e38 ] For F17h AMD CPUs, the CPB capability ('Core Performance Boost') is forcibly set, because some versions of that chip incorrectly report that they do not have it. However, a hypervisor may filter out the CPB

[PATCH AUTOSEL 5.1 28/70] net: stmmac: dwmac-mediatek: modify csr_clk value to fix mdio read/write fail

2019-06-08 Thread Sasha Levin
From: Biao Huang [ Upstream commit f4ca7a9260dfe700f2a16f0881825de625067515 ] 1. the frequency of csr clock is 66.5MHz, so the csr_clk value should be 0 other than 5. 2. the csr_clk can be got from device tree, so remove initialization here. Fixes: 9992f37e346b ("stmmac: dwmac-mediatek: add sup

[PATCH AUTOSEL 5.1 25/70] efi/x86/Add missing error handling to old_memmap 1:1 mapping code

2019-06-08 Thread Sasha Levin
From: Gen Zhang [ Upstream commit 4e78921ba4dd0aca1cc89168f45039add4183f8e ] The old_memmap flow in efi_call_phys_prolog() performs numerous memory allocations, and either does not check for failure at all, or it does but fails to propagate it back to the caller, which may end up calling into th

[PATCH AUTOSEL 5.1 23/70] perf/ring-buffer: Always use {READ,WRITE}_ONCE() for rb->user_page data

2019-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit 4d839dd9e4356bbacf3eb0ab13a549b83b008c21 ] We must use {READ,WRITE}_ONCE() on rb->user_page data such that concurrent usage will see whole values. A few key sites were missing this. Suggested-by: Yabin Cui Signed-off-by: Peter Zijlstra (Intel) Cc: Alexan

[PATCH AUTOSEL 5.1 29/70] io_uring: Fix __io_uring_register() false success

2019-06-08 Thread Sasha Levin
From: Pavel Begunkov [ Upstream commit a278682dad37fd2f8d2f30d8e84e376a856ab472 ] If io_copy_iov() fails, it will break the loop and report success, albeit partially completed operation. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io_uring.c | 2

[PATCH AUTOSEL 5.1 18/70] usb: xhci: Fix a potential null pointer dereference in xhci_debugfs_create_endpoint()

2019-06-08 Thread Sasha Levin
From: Jia-Ju Bai [ Upstream commit 5bce256f0b528624a34fe907db385133bb7be33e ] In xhci_debugfs_create_slot(), kzalloc() can fail and dev->debugfs_private will be NULL. In xhci_debugfs_create_endpoint(), dev->debugfs_private is used without any null-pointer check, and can cause a null pointer dere

[PATCH AUTOSEL 5.1 10/70] perf/x86/intel/ds: Fix EVENT vs. UEVENT PEBS constraints

2019-06-08 Thread Sasha Levin
From: Stephane Eranian [ Upstream commit 23e3983a466cd540ffdd2bbc6e0c51e31934f941 ] This patch fixes an bug revealed by the following commit: 6b89d4c1ae85 ("perf/x86/intel: Fix INTEL_FLAGS_EVENT_CONSTRAINT* masking") That patch modified INTEL_FLAGS_EVENT_CONSTRAINT() to only look at the even

[PATCH AUTOSEL 5.1 14/70] selftests: netfilter: missing error check when setting up veth interface

2019-06-08 Thread Sasha Levin
From: Jeffrin Jose T [ Upstream commit 82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43 ] A test for the basic NAT functionality uses ip command which needs veth device. There is a condition where the kernel support for veth is not compiled into the kernel and the test script breaks. This patch contains

[PATCH AUTOSEL 5.1 19/70] mISDN: make sure device name is NUL terminated

2019-06-08 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit ccfb62f27beb295103e9392462b20a6ed807d0ea ] The user can change the device_name with the IMSETDEVNAME ioctl, but we need to ensure that the user's name is NUL terminated. Otherwise it could result in a buffer overflow when we copy the name back to the user w

[PATCH AUTOSEL 5.1 16/70] clk: ti: clkctrl: Fix clkdm_clk handling

2019-06-08 Thread Sasha Levin
From: Tony Lindgren [ Upstream commit 1cc54078d104f5b4d7e9f8d55362efa5a8daffdb ] We need to always call clkdm_clk_enable() and clkdm_clk_disable() even the clkctrl clock(s) enabled for the domain do not have any gate register bits. Otherwise clockdomains may never get enabled except when devices

[PATCH AUTOSEL 5.1 22/70] perf/ring_buffer: Add ordering to rb->nest increment

2019-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit 3f9fbe9bd86c534eba2faf5d840fd44c6049f50e ] Similar to how decrementing rb->next too early can cause data_head to (temporarily) be observed to go backward, so too can this happen when we increment too late. This barrier() ensures the rb->head load happens a

[PATCH AUTOSEL 5.1 17/70] powerpc/powernv: Return for invalid IMC domain

2019-06-08 Thread Sasha Levin
From: Anju T Sudhakar [ Upstream commit b59bd3527fe3c1939340df558d7f9d568fc9f882 ] Currently init_imc_pmu() can fail either because we try to register an IMC unit with an invalid domain (i.e an IMC node not supported by the kernel) or something went wrong while registering a valid IMC unit. In b

[PATCH AUTOSEL 5.1 12/70] netfilter: nft_fib: Fix existence check support

2019-06-08 Thread Sasha Levin
From: Phil Sutter [ Upstream commit e633508a95289489d28faacb68b32c3e7e68ef6f ] NFTA_FIB_F_PRESENT flag was not always honored since eval functions did not call nft_fib_store_result in all cases. Given that in all callsites there is a struct net_device pointer available which holds the interface

[PATCH AUTOSEL 5.1 11/70] netfilter: nf_queue: fix reinject verdict handling

2019-06-08 Thread Sasha Levin
From: Jagdish Motwani [ Upstream commit 946c0d8e6ed43dae6527e878d0077c1e11015db0 ] This patch fixes netfilter hook traversal when there are more than 1 hooks returning NF_QUEUE verdict. When the first queue reinjects the packet, 'nf_reinject' starts traversing hooks with a proper hook_index. How

[PATCH AUTOSEL 5.1 08/70] pinctrl: intel: Clear interrupt status in mask/unmask callback

2019-06-08 Thread Sasha Levin
From: Kai-Heng Feng [ Upstream commit 670784fb4ebe54434e263837390e358405031d9e ] Commit a939bb57cd47 ("pinctrl: intel: implement gpio_irq_enable") was added because clearing interrupt status bit is required to avoid unexpected behavior. Turns out the unmask callback also needs the fix, which ca

[PATCH AUTOSEL 5.1 09/70] netfilter: nf_tables: fix oops during rule dump

2019-06-08 Thread Sasha Levin
From: Florian Westphal [ Upstream commit 2c82c7e724ff51cab78e1afd5c2aaa31994fe41e ] We can oops in nf_tables_fill_rule_info(). Its not possible to fetch previous element in rcu-protected lists when deletions are not prevented somehow: list_del_rcu poisons the ->prev pointer value. Before rcu-c

[PATCH AUTOSEL 5.1 07/70] staging: wilc1000: Fix some double unlock bugs in wilc_wlan_cleanup()

2019-06-08 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit fea69916360468e364a4988db25a5afa835f3406 ] If ->hif_read_reg() or ->hif_write_reg() fail then the code unlocks and keeps executing. It should just return. Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") Signed-off-by: Dan Carpenter S

[PATCH AUTOSEL 5.1 04/70] iio: adc: ti-ads8688: fix timestamp is not updated in buffer

2019-06-08 Thread Sasha Levin
From: Sean Nyekjaer [ Upstream commit e6d12298310fa1dc11f1d747e05b168016057fdd ] When using the hrtimer iio trigger timestamp isn't updated. If we use iio_get_time_ns it is updated correctly. Fixes: 2a86487786b5c ("iio: adc: ti-ads8688: add trigger and buffer support") Signed-off-by: Sean Nyekj

[PATCH AUTOSEL 5.1 03/70] iio: dac: ds4422/ds4424 fix chip verification

2019-06-08 Thread Sasha Levin
From: Ruslan Babayev [ Upstream commit 60f2208699ec08ff9fdf1f97639a661a92a18f1c ] The ds4424_get_value function takes channel number as it's 3rd argument and translates it internally into I2C address using DS4424_DAC_ADDR macro. The caller ds4424_verify_chip was passing an already translated I2C

Re: [PATCH v2] ipc/mqueue: Only perform resource calculation if user valid

2019-06-08 Thread Eric W. Biederman
Kees Cook writes: > Andreas Christoforou reported: > > UBSAN: Undefined behaviour in ipc/mqueue.c:414:49 signed integer overflow: > 9 * 2305843009213693951 cannot be represented in type 'long int' > ... > Call Trace: > __dump_stack lib/dump_stack.c:77 [inline] > dump_stack+0x11b/0x1fe lib/dump_

Re: Linux 4.9.180 build fails with gcc 9 and 'cleanup_module' specifies less restrictive attribute than its target …

2019-06-08 Thread Miguel Ojeda
On Thu, Jun 6, 2019 at 8:59 PM Greg KH wrote: > > "manually fixing it up" means "hacked it to pieces" to me, I have no > idea what the end result really was :) > > If someone wants to send me some patches I can actually apply, that > would be best... I will give it a go whenever I get some free t

Re: [PATCH 06/10] mfd / platform: cros_ec: Reorganize platform and mfd includes

2019-06-08 Thread Jonathan Cameron
On Tue, 4 Jun 2019 17:20:15 +0200 Enric Balletbo i Serra wrote: > There is a bit of mess between cros-ec mfd includes and platform > includes. For example, we have a linux/mfd/cros_ec.h include that > exports the interface implemented in platform/chrome/cros_ec_proto.c. Or > we have a linux/mfd/

[PATCH v4 net-next 01/17] net: dsa: Keep a pointer to the skb clone for TX timestamping

2019-06-08 Thread Vladimir Oltean
For drivers that use deferred_xmit for PTP frames (such as sja1105), there is no need to perform matching between PTP frames and their egress timestamps, since the sending process can be serialized. In that case, it makes sense to have the pointer to the skb clone that DSA made directly in the skb

[PATCH v4 net-next 00/17] PTP support for the SJA1105 DSA driver

2019-06-08 Thread Vladimir Oltean
This patchset adds the following: - A timecounter/cyclecounter based PHC for the free-running timestamping clock of this switch. - A state machine implemented in the DSA tagger for SJA1105, which keeps track of metadata follow-up Ethernet frames (the switch's way of transmitting RX tim

[PATCH v4 net-next 16/17] net: dsa: sja1105: Add a state machine for RX timestamping

2019-06-08 Thread Vladimir Oltean
Meta frame reception relies on the hardware keeping its promise that it will send no other traffic towards the CPU port between a link-local frame and a meta frame. Otherwise there is no other way to associate the meta frame with the link-local frame it's holding a timestamp of. The receive functi

[PATCH v4 net-next 07/17] net: dsa: sja1105: Export symbols for upcoming PTP driver

2019-06-08 Thread Vladimir Oltean
These are needed for the situation where the switch driver and the PTP driver are both built as modules. Signed-off-by: Vladimir Oltean --- Changes in v4: Patch is new. Fixes build errors reported by David Miller. drivers/net/dsa/sja1105/sja1105_spi.c | 2 ++ drivers/net/dsa/sja1105/

[PATCH v4 net-next 09/17] net: dsa: sja1105: Add logic for TX timestamping

2019-06-08 Thread Vladimir Oltean
On TX, timestamping is performed synchronously from the port_deferred_xmit worker thread. In management routes, the switch is requested to take egress timestamps (again partial), which are reconstructed and appended to a clone of the skb that was just sent. The cloning is done by DSA and we retrie

[PATCH v4 net-next 06/17] net: dsa: sja1105: Limit use of incl_srcpt to bridge+vlan mode

2019-06-08 Thread Vladimir Oltean
The incl_srcpt setting makes the switch mangle the destination MACs of multicast frames trapped to the CPU - a primitive tagging mechanism that works even when we cannot use the 802.1Q software features. The downside is that the two multicast MAC addresses that the switch traps for L2 PTP (01-80-C

[PATCH v4 net-next 12/17] net: dsa: sja1105: Make sja1105_is_link_local not match meta frames

2019-06-08 Thread Vladimir Oltean
Although meta frames are configured to be sent at SJA1105_META_DMAC (01-80-C2-00-00-0E) which is a multicast MAC address that would also be trapped by the switch to the CPU, were it to receive it on a front-panel port, meta frames are conceptually not link-local frames, they only carry their RX tim

[PATCH v4 net-next 14/17] net: dsa: sja1105: Add a global sja1105_tagger_data structure

2019-06-08 Thread Vladimir Oltean
This will be used to keep state for RX timestamping. It is global because the switch serializes timestampable and meta frames when trapping them towards the CPU port (lower port indices have higher priority) and therefore having one state machine per port would create unnecessary complications. Si

[PATCH v4 net-next 15/17] net: dsa: sja1105: Increase priority of CPU-trapped frames

2019-06-08 Thread Vladimir Oltean
Without noticing any particular issue, this patch ensures that management traffic is treated with the maximum priority on RX by the switch. This is generally desirable, as the driver keeps a state machine that waits for metadata follow-up frames as soon as a management frame is received. Increasi

[PATCH v4 net-next 13/17] net: dsa: sja1105: Receive and decode meta frames

2019-06-08 Thread Vladimir Oltean
This adds support in the tagger for understanding the source port and switch id of meta frames. Their timestamp is also extracted but not used yet - this needs to be done in a state machine that modifies the previously received timestampable frame - will be added in a follow-up patch. Also take t

[PATCH v4 net-next 17/17] net: dsa: sja1105: Expose PTP timestamping ioctls to userspace

2019-06-08 Thread Vladimir Oltean
This enables the PTP support towards userspace applications such as linuxptp. The switches can timestamp only trapped multicast MAC frames, and therefore only the profiles of 1588 over L2 are supported. TX timestamping can be enabled per port, but RX timestamping is enabled globally. As long as R

[PATCH v4 net-next 10/17] net: dsa: sja1105: Build a minimal understanding of meta frames

2019-06-08 Thread Vladimir Oltean
Meta frames are sent on the CPU port by the switch if RX timestamping is enabled. They contain a partial timestamp of the previous frame. They are Ethernet frames with the Ethernet header constructed out of: - SJA1105_META_DMAC - SJA1105_META_SMAC - ETH_P_SJA1105_META The Ethernet payload will b

[PATCH v4 net-next 04/17] net: dsa: sja1105: Move sja1105_change_tpid into sja1105_vlan_filtering

2019-06-08 Thread Vladimir Oltean
This is a cosmetic patch, pre-cursor to making another change to the General Parameters Table (incl_srcpt) which does not logically pertain to the sja1105_change_tpid function name, but not putting it there would otherwise create a need of resetting the switch twice. So simply move the existing co

[PATCH v4 net-next 11/17] net: dsa: sja1105: Add support for the AVB Parameters Table

2019-06-08 Thread Vladimir Oltean
This table is used to program the switch to emit "meta" follow-up Ethernet frames (which contain partial RX timestamps) after each link-local frame that was trapped to the CPU port through MAC filtering. This includes PTP frames. Signed-off-by: Vladimir Oltean --- Changes in v4: None. Changes i

[PATCH v4 net-next 08/17] net: dsa: sja1105: Add support for the PTP clock

2019-06-08 Thread Vladimir Oltean
The design of this PHC driver is influenced by the switch's behavior w.r.t. timestamping. It exposes two PTP counters, one free-running (PTPTSCLK) and the other offset- and frequency-corrected in hardware through PTPCLKVAL, PTPCLKADD and PTPCLKRATE. The MACs can sample either of these for frame t

[PATCH v4 net-next 03/17] net: dsa: tag_8021q: Create helper function for removing VLAN header

2019-06-08 Thread Vladimir Oltean
This removes the existing implementation from tag_sja1105, which was partially incorrect (it was not changing the MAC header offset, thereby leaving it to point 4 bytes earlier than it should have). This overwrites the VLAN tag by moving the Ethernet source and destination MACs 4 bytes to the righ

[PATCH v4 net-next 05/17] net: dsa: sja1105: Reverse TPID and TPID2

2019-06-08 Thread Vladimir Oltean
>From reading the P/Q/R/S user manual, it appears that TPID is used by the switch for detecting S-tags and TPID2 for C-tags. Their meaning is not clear from the E/T manual. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v4: None. Changes in v3: Patch is new. dr

[PATCH v4 net-next 02/17] net: dsa: Add teardown callback for drivers

2019-06-08 Thread Vladimir Oltean
This is helpful for e.g. draining per-driver (not per-port) tagger queues. Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- Changes in v4: None. Changes in v3: Moved after dsa_switch_unregister_notifier, which is symmetrical to where the setup callbac

Re: [PATCH 1/1] counter/ftm-quaddec: Add missing dependencies in Kconfig

2019-06-08 Thread Jonathan Cameron
On Wed, 5 Jun 2019 00:11:15 +0900 William Breathitt Gray wrote: > On Tue, Jun 04, 2019 at 04:03:26PM +0200, Patrick Havelange wrote: > > This driver uses devm_ioremap and of* functions. This fixes a > > linking failure with e.g. ARCH=um. > > > > Reported-by: kbuild test robot > > Signed-off-by:

<    1   2   3   4   5   >