4.4.249-rc1 review
Subsystems (4)
Greg Kroah-Hartman
maintainercover 4.4.249-rc1 review
This is the start of the stable review cycle for the 4.4.249 release. There are 132 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 30 Dec 2020 12:48:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.249-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.249-rc1
Jubin Zhong <[email protected]>
PCI: Fix pci_slot_release() NULL pointer dereference
SeongJae Park <[email protected]>
xenbus/xenbus_backend: Disallow pending watch messages
SeongJae Park <[email protected]>
xen/xenbus: Count pending messages for each watch
SeongJae Park <[email protected]>
xen/xenbus/xen_bus_type: Support will_handle watch callback
SeongJae Park <[email protected]>
xen/xenbus: Add 'will_handle' callback support in xenbus_watch_path()
SeongJae Park <[email protected]>
xen/xenbus: Allow watches discard events before queueing
Jonathan Cameron <[email protected]>
iio:pressure:mpl3115: Force alignment of buffer
Qinglang Miao <[email protected]>
iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
Sven Eckelmann <[email protected]>
mtd: parser: cmdline: Fix parsing of part-names with colons
Lukas Wunner <[email protected]>
spi: rb4xx: Don't leak SPI master in probe error path
Dave Kleikamp <[email protected]>
jfs: Fix array index bounds check in dbAdjTree
Zhe Li <[email protected]>
jffs2: Fix GC exit abnormally
Luis Henriques <[email protected]>
ceph: fix race in concurrent __ceph_remove_cap invocations
Chunguang Xu <[email protected]>
ext4: fix a memory leak of ext4_free_data
Pavel Machek <[email protected]>
btrfs: fix return value mixup in btrfs_get_extent
Filipe Manana <[email protected]>
Btrfs: fix selftests failure due to uninitialized i_mode in test inodes
Qu Wenruo <[email protected]>
btrfs: scrub: Don't use inode page cache in scrub_handle_errored_block()
Qu Wenruo <[email protected]>
btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix write unthrottling
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix tx-unthrottle use-after-free
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix write-wakeup use-after-free
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix stalled writes
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix write deadlock
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix dropped unthrottle interrupts
Johan Hovold <[email protected]>
USB: serial: mos7720: fix parallel-port state restore
Athira Rajeev <[email protected]>
powerpc/perf: Exclude kernel samples while counting events in user space.
Ian Abbott <[email protected]>
staging: comedi: mf6x4: Fix AI end-of-conversion detection
Stefan Haberland <[email protected]>
s390/dasd: fix list corruption of lcu list
Stefan Haberland <[email protected]>
s390/dasd: fix list corruption of pavgroup group list
Takashi Iwai <[email protected]>
ALSA: pcm: oss: Fix a few more UBSAN fixes
Hui Wang <[email protected]>
ACPI: PNP: compare the string length in the matching_id()
Daniel Scally <[email protected]>
Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
Arnd Bergmann <[email protected]>
Input: cyapa_gen6 - fix out-of-bounds stack access
Lukas Wunner <[email protected]>
media: netup_unidvb: Don't leak SPI master in probe error path
Sean Young <[email protected]>
media: sunxi-cir: ensure IR is handled when it is continuous
Alan Stern <[email protected]>
media: gspca: Fix memory leak in probe
Simon Beginn <[email protected]>
Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
Dmitry Torokhov <[email protected]>
Input: cros_ec_keyb - send 'scancodes' in addition to key events
Sara Sharon <[email protected]>
cfg80211: initialize rekey_data
Christophe JAILLET <[email protected]>
clk: s2mps11: Fix a resource leak in error handling paths in the probe function
Dan Carpenter <[email protected]>
qlcnic: Fix error code in probe
Zheng Zengkai <[email protected]>
perf record: Fix memory leak when using '--user-regs=?' to list registers
Zhang Qilong <[email protected]>
clk: ti: Fix memleak in ti_fapll_synth_setup
Vincent Stehlé <[email protected]>
net: korina: fix return value
Christophe JAILLET <[email protected]>
net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
Christophe JAILLET <[email protected]>
net: bcmgenet: Fix a resource leak in an error handling path in the probe functin
Dwaipayan Ray <[email protected]>
checkpatch: fix unescaped left brace
Vincent Stehlé <[email protected]>
powerpc/ps3: use dma_mapping_error()
Bongsu Jeon <[email protected]>
nfc: s3fwrn5: Release the nfc firmware
Anton Ivanov <[email protected]>
um: chan_xterm: Fix fd leak
Dan Carpenter <[email protected]>
ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
Marek Szyprowski <[email protected]>
extcon: max77693: Fix modalias string
Masami Hiramatsu <[email protected]>
x86/kprobes: Restore BTF if the single-stepping is cancelled
Cheng Lin <[email protected]>
nfs_common: need lock during iterate through the list
Yang Yingliang <[email protected]>
speakup: fix uninitialized flush_lock
Zhang Qilong <[email protected]>
usb: oxu210hp-hcd: Fix memory leak in oxu_create
Zhang Qilong <[email protected]>
usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
Nathan Lynch <[email protected]>
powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
Zhang Changzhong <[email protected]>
scsi: fnic: Fix error return code in fnic_probe()
Arnd Bergmann <[email protected]>
seq_buf: Avoid type mismatch for seq_buf_init
Zhang Qilong <[email protected]>
scsi: pm80xx: Fix error return in pm8001_pci_probe()
Pali Rohár <[email protected]>
cpufreq: scpi: Add missing MODULE_ALIAS
Pali Rohár <[email protected]>
cpufreq: loongson1: Add missing MODULE_ALIAS
Pali Rohár <[email protected]>
cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
Keqian Zhu <[email protected]>
clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI
Qinglang Miao <[email protected]>
dm ioctl: fix error return code in target_message
Chuhong Yuan <[email protected]>
ASoC: jz4740-i2s: add missed checks for clk_get()
Jing Xiangfeng <[email protected]>
memstick: r592: Fix error return in r592_probe()
Yu Kuai <[email protected]>
pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
Dan Carpenter <[email protected]>
media: saa7146: fix array overflow in vidioc_s_audio()
NeilBrown <[email protected]>
NFS: switch nfsiod to be an UNBOUND workqueue.
Calum Mackay <[email protected]>
lockd: don't use interval-based rebinding over TCP
Olga Kornievskaia <[email protected]>
NFSv4.2: condition READDIR's mask for security label based on LSM state
Qinglang Miao <[email protected]>
mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
Qinglang Miao <[email protected]>
cw1200: fix missing destroy_workqueue() on error in cw1200_init_common
Sebastian Andrzej Siewior <[email protected]>
orinoco: Move context allocation after processing the skb
Cristian Birsan <[email protected]>
ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host
Cristian Birsan <[email protected]>
ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host
Qinglang Miao <[email protected]>
memstick: fix a double-free bug in memstick_check
Zhihao Cheng <[email protected]>
drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe
Zhang Qilong <[email protected]>
soc: ti: Fix reference imbalance in knav_dma_probe
Zhang Qilong <[email protected]>
soc: ti: knav_qmss: fix reference leak in knav_queue_probe
Christophe Leroy <[email protected]>
powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
Dmitry Torokhov <[email protected]>
Input: ads7846 - fix unaligned access on 7845
Oleksij Rempel <[email protected]>
Input: ads7846 - fix integer overflow on Rt calculation
Yang Yingliang <[email protected]>
drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
Qinglang Miao <[email protected]>
media: solo6x10: fix missing snd_card_free in error handling case
Necip Fazil Yildiran <[email protected]>
MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA
Arnd Bergmann <[email protected]>
RDMa/mthca: Work around -Wenum-conversion warning
Vincent Bernat <[email protected]>
net: evaluate net.ipv4.conf.all.proxy_arp_pvlan
Vincent Bernat <[email protected]>
net: evaluate net.ipvX.conf.all.ignore_routes_with_linkdown
Zhang Qilong <[email protected]>
spi: tegra114: fix reference leak in tegra spi ops
Zhang Qilong <[email protected]>
spi: tegra20-sflash: fix reference leak in tegra_sflash_resume
Zhang Qilong <[email protected]>
spi: tegra20-slink: fix reference leak in slink ops of tegra20
Zhang Qilong <[email protected]>
spi: spi-ti-qspi: fix reference leak in ti_qspi_setup
Anmol Karn <[email protected]>
Bluetooth: Fix null pointer dereference in hci_event_packet()
Cezary Rojewski <[email protected]>
ASoC: pcm: DRAIN support reactivation
Zhang Qilong <[email protected]>
spi: img-spfi: fix reference leak in img_spfi_resume
Christophe Leroy <[email protected]>
crypto: talitos - Fix return type of current_desc_hdr()
Ard Biesheuvel <[email protected]>
ARM: p2v: fix handling of LPAE translation in BE mode
Tom Rix <[email protected]>
drm/gma500: fix double free of gma_connector
Peilin Ye <[email protected]>
Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()
Antti Palosaari <[email protected]>
media: msi2500: assign SPI bus number dynamically
Fabio Estevam <[email protected]>
usb: chipidea: ci_hdrc_imx: Pass DISABLE_DEVICE_STREAMING flag to imx6ul
Will McVicker <[email protected]>
USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
Johan Hovold <[email protected]>
USB: serial: option: add interface-number sanity check to flag handling
Nicolin Chen <[email protected]>
soc/tegra: fuse: Fix index bug in get_process_id
Thomas Gleixner <[email protected]>
dm table: Remove BUG_ON(in_interrupt())
Leon Romanovsky <[email protected]>
RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait
Zhang Qilong <[email protected]>
can: softing: softing_netdev_open(): fix error handling
Randy Dunlap <[email protected]>
scsi: bnx2i: Requires MMU
Brant Merryman <[email protected]>
USB: serial: cp210x: enable usb generic throttle/unthrottle
Alexander Sverdlin <[email protected]>
serial: 8250_omap: Avoid FIFO corruption caused by MDR1 access
Takashi Iwai <[email protected]>
ALSA: pcm: oss: Fix potential out-of-bounds shift
Thomas Gleixner <[email protected]>
USB: sisusbvga: Make console support depend on BROKEN
Li Jun <[email protected]>
xhci: Give USB2 ports time to enter U3 in bus suspend
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix control 'access overflow' errors from chmap
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix potential out-of-bounds shift
Oliver Neukum <[email protected]>
USB: add RESET_RESUME quirk for Snapscan 1212
Bui Quang Minh <[email protected]>
USB: dummy-hcd: Fix uninitialized array use in init()
Zhang Changzhong <[email protected]>
net: bridge: vlan: fix error return code in __vlan_add()
Fugang Duan <[email protected]>
net: stmmac: delete the eee_ctrl_timer after napi disabled
Neal Cardwell <[email protected]>
tcp: fix cwnd-limited bug for TSO deferral where we send nothing
Moshe Shemesh <[email protected]>
net/mlx4_en: Avoid scheduling restart task if it is already running
Lukas Wunner <[email protected]>
spi: Prevent adding devices below an unregistering controller
Coiby Xu <[email protected]>
pinctrl: amd: remove debounce filter setting in IRQ type setting
Chris Chiu <[email protected]>
Input: i8042 - add Acer laptops to the i8042 reset list
Dmitry Torokhov <[email protected]>
Input: cm109 - do not stomp on control URB
Timo Witte <[email protected]>
platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
Vineet Gupta <[email protected]>
ARC: stack unwinding: don't assume non-current task is sleeping
Nathan Chancellor <[email protected]>
spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe
Lukas Wunner <[email protected]>
spi: bcm2835aux: Fix use-after-free on unbind
-------------
Diffstat:
Documentation/networking/ip-sysctl.txt | 3 ++ Makefile | 4 +- arch/arc/kernel/stacktrace.c | 23 ++++++--- arch/arm/boot/dts/at91-sama5d3_xplained.dts | 7 +++ arch/arm/boot/dts/at91-sama5d4_xplained.dts | 7 +++ arch/arm/kernel/head.S | 6 +-- arch/mips/bcm47xx/Kconfig | 1 + arch/powerpc/include/asm/cputable.h | 5 -- arch/powerpc/perf/core-book3s.c | 10 ++++ arch/powerpc/platforms/pseries/suspend.c | 1 - arch/um/drivers/xterm.c | 5 ++ arch/x86/kernel/kprobes/core.c | 5 ++ drivers/acpi/acpi_pnp.c | 3 ++ drivers/acpi/resource.c | 2 +- drivers/block/xen-blkback/xenbus.c | 3 +- drivers/bus/mips_cdmm.c | 4 +- drivers/clk/clk-s2mps11.c | 1 + drivers/clk/ti/fapll.c | 11 +++- drivers/clocksource/arm_arch_timer.c | 23 ++++++--- drivers/cpufreq/highbank-cpufreq.c | 7 +++ drivers/cpufreq/ls1x-cpufreq.c | 1 + drivers/cpufreq/scpi-cpufreq.c | 1 + drivers/crypto/talitos.c | 6 +-- drivers/extcon/extcon-max77693.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 + drivers/iio/adc/rockchip_saradc.c | 2 +- drivers/iio/pressure/mpl3115.c | 9 +++- drivers/infiniband/core/cm.c | 2 + drivers/infiniband/hw/mthca/mthca_cq.c | 2 +- drivers/infiniband/hw/mthca/mthca_dev.h | 1 - drivers/input/keyboard/cros_ec_keyb.c | 1 + drivers/input/misc/cm109.c | 7 ++- drivers/input/mouse/cyapa_gen6.c | 2 +- drivers/input/serio/i8042-x86ia64io.h | 42 +++++++++++++++ drivers/input/touchscreen/ads7846.c | 8 +-- drivers/input/touchscreen/goodix.c | 12 +++++ drivers/md/dm-ioctl.c | 1 + drivers/md/dm-table.c | 6 --- drivers/media/pci/netup_unidvb/netup_unidvb_spi.c | 5 +- drivers/media/pci/saa7146/mxb.c | 19 +++---- drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +- drivers/media/rc/sunxi-cir.c | 2 + drivers/media/usb/gspca/gspca.c | 1 + drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/memstick/core/memstick.c | 1 - drivers/memstick/host/r592.c | 12 +++-- drivers/mtd/cmdlinepart.c | 14 ++++- drivers/net/can/softing/softing_main.c | 9 +++- drivers/net/ethernet/allwinner/sun4i-emac.c | 7 ++- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +- drivers/net/ethernet/korina.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 17 +++--- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 7 ++- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 +++-- drivers/net/wireless/cw1200/main.c | 2 + drivers/net/wireless/orinoco/orinoco_usb.c | 14 ++--- drivers/net/xen-netback/xenbus.c | 4 +- drivers/nfc/s3fwrn5/firmware.c | 4 +- drivers/pci/slot.c | 6 +-- drivers/pinctrl/pinctrl-amd.c | 7 --- drivers/pinctrl/pinctrl-falcon.c | 14 +++-- drivers/platform/x86/acer-wmi.c | 1 + drivers/ps3/ps3stor_lib.c | 2 +- drivers/s390/block/dasd_alias.c | 3 +- drivers/scsi/bnx2i/Kconfig | 1 + drivers/scsi/fnic/fnic_main.c | 1 + drivers/scsi/pm8001/pm8001_init.c | 3 +- drivers/soc/tegra/fuse/speedo-tegra210.c | 2 +- drivers/soc/ti/knav_dma.c | 13 ++++- drivers/soc/ti/knav_qmss_queue.c | 4 +- drivers/spi/Kconfig | 3 ++ drivers/spi/spi-bcm2835aux.c | 17 +++--- drivers/spi/spi-img-spfi.c | 4 +- drivers/spi/spi-rb4xx.c | 2 +- drivers/spi/spi-tegra114.c | 2 + drivers/spi/spi-tegra20-sflash.c | 1 + drivers/spi/spi-tegra20-slink.c | 2 + drivers/spi/spi-ti-qspi.c | 1 + drivers/spi/spi.c | 21 +++++++- drivers/staging/comedi/drivers/mf6x4.c | 3 +- drivers/staging/speakup/speakup_dectlk.c | 2 +- drivers/tty/serial/8250/8250_omap.c | 5 -- drivers/usb/chipidea/ci_hdrc_imx.c | 3 +- drivers/usb/core/quirks.c | 3 ++ drivers/usb/gadget/function/f_rndis.c | 4 +- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- drivers/usb/host/ehci-omap.c | 1 + drivers/usb/host/oxu210hp-hcd.c | 4 +- drivers/usb/host/xhci-hub.c | 4 ++ drivers/usb/misc/sisusbvga/Kconfig | 2 +- drivers/usb/serial/cp210x.c | 2 + drivers/usb/serial/keyspan_pda.c | 63 ++++++++++++----------- drivers/usb/serial/mos7720.c | 2 + drivers/usb/serial/option.c | 23 ++++++++- drivers/xen/xen-pciback/xenbus.c | 2 +- drivers/xen/xenbus/xenbus_client.c | 8 ++- drivers/xen/xenbus/xenbus_probe.c | 1 + drivers/xen/xenbus/xenbus_probe.h | 2 + drivers/xen/xenbus/xenbus_probe_backend.c | 7 +++ drivers/xen/xenbus/xenbus_xs.c | 38 +++++++++----- fs/btrfs/inode.c | 2 +- fs/btrfs/qgroup.c | 4 +- fs/btrfs/scrub.c | 17 +++--- fs/btrfs/tests/btrfs-tests.c | 8 ++- fs/ceph/caps.c | 11 +++- fs/ext4/mballoc.c | 1 + fs/jffs2/readinode.c | 16 ++++++ fs/jfs/jfs_dmap.h | 2 +- fs/lockd/host.c | 20 +++---- fs/nfs/inode.c | 2 +- fs/nfs/nfs4proc.c | 10 +++- fs/nfs_common/grace.c | 6 ++- include/linux/inetdevice.h | 4 +- include/linux/seq_buf.h | 2 +- include/linux/trace_seq.h | 4 +- include/xen/xenbus.h | 15 +++++- net/bluetooth/hci_event.c | 17 +++--- net/bridge/br_vlan.c | 4 +- net/ipv4/tcp_output.c | 9 ++-- net/wireless/nl80211.c | 2 +- scripts/checkpatch.pl | 2 +- sound/core/oss/pcm_oss.c | 28 ++++++---- sound/soc/codecs/wm_adsp.c | 5 +- sound/soc/jz4740/jz4740-i2s.c | 4 ++ sound/soc/soc-pcm.c | 2 + sound/usb/format.c | 2 + sound/usb/stream.c | 6 +-- tools/perf/util/parse-regs-options.c | 2 +- 130 files changed, 624 insertions(+), 255 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/132 spi: bcm2835aux: Fix use-after-free on unbind
From: Lukas Wunner <[email protected]>
[ Upstream commit e13ee6cc4781edaf8c7321bee19217e3702ed481 ]
bcm2835aux_spi_remove() accesses the driver's private data after calling spi_unregister_master() even though that function releases the last reference on the spi_master and thereby frees the private data.
Fix by switching over to the new devm_spi_alloc_master() helper which keeps the private data accessible until the driver has unbound.
--- drivers/spi/spi-bcm2835aux.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/spi/spi-bcm2835aux.c +6 -12
@@ -381,7 +381,7 @@ static int bcm2835aux_spi_probe(struct punsigned long clk_hz;int err; - master =spi_alloc_master (&pdev->dev,sizeof (*bs)); + master =devm_spi_alloc_master (&pdev->dev,sizeof (*bs));if (!master) {dev_err (&pdev->dev,"spi_alloc_master() failed\n" );return -ENOMEM ;
@@ -411,30 +411,26 @@ static int bcm2835aux_spi_probe(struct p/* the main area */ res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); bs->regs =devm_ioremap_resource (&pdev->dev, res); -if (IS_ERR (bs->regs)) { - err =PTR_ERR (bs->regs); - goto out_master_put; - } +if (IS_ERR (bs->regs)) +return PTR_ERR (bs->regs); bs->clk =devm_clk_get (&pdev->dev,NULL );if ((!bs->clk) || (IS_ERR (bs->clk))) { - err =PTR_ERR (bs->clk);dev_err (&pdev->dev,"could not get clk: %d\n" , err); - goto out_master_put; +return PTR_ERR (bs->clk); } bs->irq =platform_get_irq (pdev,0 );if (bs->irq <=0 ) {dev_err (&pdev->dev,"could not get IRQ: %d\n" , bs->irq); - err = bs->irq ? bs->irq : -ENODEV ; - goto out_master_put; +return bs->irq ? bs->irq : -ENODEV ; }/* this also enables the HW block */ err =clk_prepare_enable (bs->clk);if (err) {dev_err (&pdev->dev,"could not prepare clock: %d\n" , err); - goto out_master_put; +return err; }/* just checking if the clock returns a sane value */
@@ -467,8 +463,6 @@ static int bcm2835aux_spi_probe(struct p out_clk_disable:clk_disable_unprepare (bs->clk); -out_master_put: -spi_master_put (master);return err; }
Greg Kroah-Hartman
maintainerPATCH 2/132 spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit d853b3406903a7dc5b14eb5bada3e8cd677f66a2 ]
Clang warns:
drivers/spi/spi-bcm2835aux.c:532:50: warning: variable 'err' is uninitialized when used here [-Wuninitialized]
dev_err(&pdev->dev, "could not get clk: %d\n", err);
^~~
./include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
drivers/spi/spi-bcm2835aux.c:495:9: note: initialize the variable 'err'
to silence this warning
int err;
^
= 01 warning generated.
Restore the assignment so that the error value can be used in the dev_err statement and there is no uninitialized memory being leaked.
--- drivers/spi/spi-bcm2835aux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-bcm2835aux.c +2 -1
@@ -416,8 +416,9 @@ static int bcm2835aux_spi_probe(struct p bs->clk =devm_clk_get (&pdev->dev,NULL );if ((!bs->clk) || (IS_ERR (bs->clk))) { + err =PTR_ERR (bs->clk);dev_err (&pdev->dev,"could not get clk: %d\n" , err); -return PTR_ERR (bs->clk); +return err; } bs->irq =platform_get_irq (pdev,0 );
Greg Kroah-Hartman
maintainerPATCH 3/132 ARC: stack unwinding: dont assume non-current task is sleeping
In reply to Greg Kroah-HartmanFrom: Vineet Gupta <[email protected]>
[ Upstream commit e42404fa10fd11fe72d0a0e149a321d10e577715 ]
To start stack unwinding (SP, PC and BLINK) are needed. When the explicit execution context (pt_regs etc) is not available, unwinder assumes the task is sleeping (in __switch_to()) and fetches SP and BLINK from kernel mode stack.
But this assumption is not true, specially in a SMP system, when top runs on 1 core, there may be active running processes on all cores.
So when unwinding non courrent tasks, ensure they are NOT running.
And while at it, handle the self unwinding case explicitly.
This came out of investigation of a customer reported hang with rcutorture+top
--- arch/arc/kernel/stacktrace.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
arch/arc/kernel/stacktrace.c +15 -8
@@ -39,15 +39,15 @@#ifdef CONFIG_ARC_DW2_UNWIND -static void seed_unwind_frame_info (struct task_struct *tsk, -struct pt_regs *regs, -struct unwind_frame_info *frame_info) +static int +seed_unwind_frame_info (struct task_struct *tsk,struct pt_regs *regs, +struct unwind_frame_info *frame_info) {/* * synchronous unwinding (e.g. dump_stack) * - uses current values of SP and friends */ -if (tsk ==NULL && regs ==NULL ) { +if (regs ==NULL && (tsk ==NULL || tsk == current)) {unsigned long fp, sp, blink, ret; frame_info->task = current;
@@ -66,11 +66,15 @@ static void seed_unwind_frame_info(struct task_struct *tsk, frame_info->call_frame =0 ; }else if (regs ==NULL ) {/* -* Asynchronous unwinding of sleeping task -* - Gets SP etc from task's pt_regs (saved bottom of kernel -* mode stack of task) +* Asynchronous unwinding of a likely sleeping task +* - first ensure it is actually sleeping +* - if so, it will be in __switch_to, kernel mode SP of task +* is safe-kept and BLINK at a well known location in there */ +if (tsk->state ==TASK_RUNNING ) +return -1 ; + frame_info->task = tsk; frame_info->regs.r27 =TSK_K_FP (tsk);
@@ -104,6 +108,8 @@ static void seed_unwind_frame_info(struct task_struct *tsk, frame_info->regs.r63 = regs->ret; frame_info->call_frame = 0; } + +return 0 ; }#endif
@@ -117,7 +123,8 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,unsigned int address;struct unwind_frame_info frame_info; -seed_unwind_frame_info (tsk, regs, &frame_info); +if (seed_unwind_frame_info (tsk, regs, &frame_info)) +return 0 ;while (1 ) { address =UNW_PC (&frame_info);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 4/132 platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
In reply to Greg Kroah-HartmanFrom: Timo Witte <[email protected]>
[ Upstream commit 9e7a005ad56aa7d6ea5830c5ffcc60bf35de380b ]
Got a dmesg message on my AMD Renoir based Acer laptop:
"acer_wmi: Unknown key number - 0x84" when toggling keyboard background light
--- drivers/platform/x86/acer-wmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/acer-wmi.c +1 -0
@@ -124,6 +124,7 @@ static const struct key_entry acer_wmi_keymap[] __initconst = { {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */ {KE_IGNORE, 0x81, {KEY_SLEEP} }, {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad Toggle */ + {KE_IGNORE, 0x84, {KEY_KBDILLUMTOGGLE} }, /* Automatic Keyboard background light toggle */ {KE_KEY, KEY_TOUCHPAD_ON, {KEY_TOUCHPAD_ON} }, {KE_KEY, KEY_TOUCHPAD_OFF, {KEY_TOUCHPAD_OFF} }, {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 5/132 Input: cm109 - do not stomp on control URB
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
commit 82e06090473289ce63e23fdeb8737aad59b10645 upstream.
We need to make sure we are not stomping on the control URB that was issued when opening the device when attempting to toggle buzzer. To do that we need to mark it as pending in cm109_open().
--- drivers/input/misc/cm109.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/input/misc/cm109.c +5 -2
@@ -546,12 +546,15 @@ static int cm109_input_open(struct input dev->ctl_data->byte[HID_OR2 ] = dev->keybit; dev->ctl_data->byte[HID_OR3 ] =0x00 ; + dev->ctl_urb_pending =1 ; error =usb_submit_urb (dev->urb_ctl,GFP_KERNEL ); -if (error) +if (error) { + dev->ctl_urb_pending =0 ;dev_err (&dev->intf->dev,"%s: usb_submit_urb (urb_ctl) failed %d\n" , __func__, error); -else + }else { dev->open =1 ; + }mutex_unlock (&dev->pm_mutex);
Greg Kroah-Hartman
maintainerPATCH 6/132 Input: i8042 - add Acer laptops to the i8042 reset list
In reply to Greg Kroah-HartmanFrom: Chris Chiu <[email protected]>
commit ce6520b0eafad5962ffc21dc47cd7bd3250e9045 upstream.
The touchpad operates in Basic Mode by default in the Acer BIOS setup, but some Aspire/TravelMate models require the i8042 to be reset in order to be correctly detected.
--- drivers/input/serio/i8042-x86ia64io.h | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +42 -0
@@ -688,6 +688,48 @@ static const struct dmi_system_id __init }, }, { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"), + }, + }, + {/* Advent 4211 */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
Greg Kroah-Hartman
maintainerPATCH 7/132 pinctrl: amd: remove debounce filter setting in IRQ type setting
In reply to Greg Kroah-HartmanFrom: Coiby Xu <[email protected]>
commit 47a0001436352c9853d72bf2071e85b316d688a2 upstream.
Debounce filter setting should be independent from IRQ type setting because according to the ACPI specs, there are separate arguments for specifying debounce timeout and IRQ type in GpioIo() and GpioInt().
Together with commit 06abe8291bc31839950f7d0362d9979edc88a666 ("pinctrl: amd: fix incorrect way to disable debounce filter") and Andy's patch "gpiolib: acpi: Take into account debounce settings" [1], this will fix broken touchpads for laptops whose BIOS set the debounce timeout to a relatively large value. For example, the BIOS of Lenovo AMD gaming laptops including Legion-5 15ARH05 (R7000), Legion-5P (R7000P) and IdeaPad Gaming 3 15ARH05, set the debounce timeout to 124.8ms. This led to the kernel receiving only ~7 HID reports per second from the Synaptics touchpad
(MSFT0001:00 06CB:7F28).
Existing touchpads like [2][3] are not troubled by this bug because the debounce timeout has been set to 0 by the BIOS before enabling the debounce filter in setting IRQ type.
[1] https://lore.kernel.org/linux-gpio/[email protected]/
8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings")
[2] https://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582
[3] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28
--- drivers/pinctrl/pinctrl-amd.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/pinctrl/pinctrl-amd.c +0 -7
@@ -399,7 +399,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT (LEVEL_TRIG_OFF ); pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=ACTIVE_HIGH <<ACTIVE_LEVEL_OFF ; - pin_reg |=DB_TYPE_REMOVE_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_edge_irq);break ;
@@ -407,7 +406,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT (LEVEL_TRIG_OFF ); pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=ACTIVE_LOW <<ACTIVE_LEVEL_OFF ; - pin_reg |=DB_TYPE_REMOVE_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_edge_irq);break ;
@@ -415,7 +413,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT (LEVEL_TRIG_OFF ); pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=BOTH_EADGE <<ACTIVE_LEVEL_OFF ; - pin_reg |=DB_TYPE_REMOVE_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_edge_irq);break ;
@@ -423,8 +420,6 @@ static int amd_gpio_irq_set_type(struct pin_reg |=LEVEL_TRIGGER <<LEVEL_TRIG_OFF ; pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=ACTIVE_HIGH <<ACTIVE_LEVEL_OFF ; - pin_reg &= ~(DB_CNTRl_MASK <<DB_CNTRL_OFF ); - pin_reg |=DB_TYPE_PRESERVE_LOW_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_level_irq);break ;
@@ -432,8 +427,6 @@ static int amd_gpio_irq_set_type(struct pin_reg |=LEVEL_TRIGGER <<LEVEL_TRIG_OFF ; pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=ACTIVE_LOW <<ACTIVE_LEVEL_OFF ; - pin_reg &= ~(DB_CNTRl_MASK <<DB_CNTRL_OFF ); - pin_reg |=DB_TYPE_PRESERVE_HIGH_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_level_irq);break ;
Greg Kroah-Hartman
maintainerPATCH 8/132 spi: Prevent adding devices below an unregistering controller
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit ddf75be47ca748f8b12d28ac64d624354fddf189 upstream
CONFIG_OF_DYNAMIC and CONFIG_ACPI allow adding SPI devices at runtime using a DeviceTree overlay or DSDT patch. CONFIG_SPI_SLAVE allows the same via sysfs.
But there are no precautions to prevent adding a device below a controller that's being removed. Such a device is unusable and may not even be able to unbind cleanly as it becomes inaccessible once the controller has been torn down. E.g. it is then impossible to quiesce the device's interrupt.
of_spi_notify() and acpi_spi_notify() do hold a ref on the controller, but otherwise run lockless against spi_unregister_controller().
Fix by holding the spi_add_lock in spi_unregister_controller() and bailing out of spi_add_device() if the controller has been unregistered concurrently.
--- drivers/spi/Kconfig | 3 +++ drivers/spi/spi.c | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-)
drivers/spi/Kconfig +3 -0
@@ -706,4 +706,7 @@ endif # SPI_MASTER # (slave support would go here) +config SPI_DYNAMIC + def_bool ACPI || OF_DYNAMIC || SPI_SLAVE + endif # SPI
drivers/spi/spi.c +20 -1
@@ -418,6 +418,12 @@ static LIST_HEAD(spi_master_list);*/ static DEFINE_MUTEX (board_lock); +/* +* Prevents addition of devices with same chip select and +* addition of devices below an unregistering controller. +*/ +static DEFINE_MUTEX (spi_add_lock); +/** * spi_alloc_device - Allocate a new SPI device * @master: Controller to which device is connected
@@ -496,7 +502,6 @@ static int spi_dev_check(struct device **/ int spi_add_device (struct spi_device *spi) { -static DEFINE_MUTEX (spi_add_lock);struct spi_master *master = spi->master;struct device *dev = master->dev.parent;int status;
@@ -525,6 +530,13 @@ int spi_add_device(struct spi_device *sp goto done; } +/* Controller may unregister concurrently */ +if (IS_ENABLED (CONFIG_SPI_DYNAMIC ) && + !device_is_registered (&master->dev)) { + status = -ENODEV ; + goto done; + } +if (master->cs_gpios) spi->cs_gpio = master->cs_gpios[spi->chip_select];
@@ -1962,6 +1974,10 @@ static int __unregister(struct device *d*/ void spi_unregister_master (struct spi_master *master) { +/* Prevent addition of new devices, unregister existing ones */ +if (IS_ENABLED (CONFIG_SPI_DYNAMIC )) +mutex_lock (&spi_add_lock); +device_for_each_child (&master->dev,NULL , __unregister);if (master->queued) {
@@ -1981,6 +1997,9 @@ void spi_unregister_master(struct spi_maif (!devres_find (master->dev.parent, devm_spi_release_master, devm_spi_match_master, master))put_device (&master->dev); + +if (IS_ENABLED (CONFIG_SPI_DYNAMIC )) +mutex_unlock (&spi_add_lock); }EXPORT_SYMBOL_GPL (spi_unregister_master);
Greg Kroah-Hartman
maintainerPATCH 9/132 net/mlx4_en: Avoid scheduling restart task if it is already running
In reply to Greg Kroah-HartmanFrom: Moshe Shemesh <[email protected]>
[ Upstream commit fed91613c9dd455dd154b22fa8e11b8526466082 ]
Add restarting state flag to avoid scheduling another restart task while such task is already running. Change task name from watchdog_task to restart_task to better fit the task role.
--- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 17 +++++++++++------ drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 7 ++++++- 2 files changed, 17 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +11 -6
@@ -1313,8 +1313,10 @@ static void mlx4_en_tx_timeout(struct ne } priv->port_stats.tx_timeout++; -en_dbg (DRV , priv,"Scheduling watchdog\n" ); -queue_work (mdev->workqueue, &priv->watchdog_task); +if (!test_and_set_bit (MLX4_EN_STATE_FLAG_RESTARTING , &priv->state)) { +en_dbg (DRV , priv,"Scheduling port restart\n" ); +queue_work (mdev->workqueue, &priv->restart_task); + } }
@@ -1730,6 +1732,7 @@ int mlx4_en_start_port(struct net_devicelocal_bh_enable (); } +clear_bit (MLX4_EN_STATE_FLAG_RESTARTING , &priv->state);netif_tx_start_all_queues (dev);netif_device_attach (dev);
@@ -1891,7 +1894,7 @@ void mlx4_en_stop_port(struct net_devicestatic void mlx4_en_restart (struct work_struct *work) { struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, - watchdog_task); + restart_task);struct mlx4_en_dev *mdev = priv->mdev;struct net_device *dev = priv->dev;
@@ -2121,7 +2124,7 @@ static int mlx4_en_change_mtu(struct netif (netif_running (dev)) {mutex_lock (&mdev->state_lock);if (!mdev->device_up) { -/* NIC is probably restarting - let watchdog task reset +/* NIC is probably restarting - let restart task reset * the port */ en_dbg (DRV , priv,"Change MTU called with card down!?\n" ); }else {
@@ -2130,7 +2133,9 @@ static int mlx4_en_change_mtu(struct netif (err) {en_err (priv,"Failed restarting port:%d\n" , priv->port); -queue_work (mdev->workqueue, &priv->watchdog_task); +if (!test_and_set_bit (MLX4_EN_STATE_FLAG_RESTARTING , + &priv->state)) +queue_work (mdev->workqueue, &priv->restart_task); } }mutex_unlock (&mdev->state_lock);
@@ -2850,7 +2855,7 @@ int mlx4_en_init_netdev(struct mlx4_en_d priv->counter_index =MLX4_SINK_COUNTER_INDEX (mdev->dev);spin_lock_init (&priv->stats_lock);INIT_WORK (&priv->rx_mode_task, mlx4_en_do_set_rx_mode); -INIT_WORK (&priv->watchdog_task, mlx4_en_restart); +INIT_WORK (&priv->restart_task, mlx4_en_restart);INIT_WORK (&priv->linkstate_task, mlx4_en_linkstate);INIT_DELAYED_WORK (&priv->stats_task, mlx4_en_do_get_stats);INIT_DELAYED_WORK (&priv->service_task, mlx4_en_service_task);
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +6 -1
@@ -495,6 +495,10 @@ struct mlx4_en_stats_bitmap {struct mutex mutex;/* for mutual access to stats bitmap */ }; +enum { +MLX4_EN_STATE_FLAG_RESTARTING , +}; +struct mlx4_en_priv {struct mlx4_en_dev *mdev;struct mlx4_en_port_profile *prof;
@@ -560,7 +564,7 @@ struct mlx4_en_priv {struct mlx4_en_cq *rx_cq[MAX_RX_RINGS ];struct mlx4_qp drop_qp;struct work_struct rx_mode_task; -struct work_struct watchdog_task; +struct work_struct restart_task;struct work_struct linkstate_task;struct delayed_work stats_task;struct delayed_work service_task;
@@ -605,6 +609,7 @@ struct mlx4_en_priv {u32 pflags;u8 rss_key[MLX4_EN_RSS_KEY_SIZE ];u8 rss_hash_fn; +unsigned long state; };enum mlx4_en_wol {
Greg Kroah-Hartman
maintainerPATCH 10/132 tcp: fix cwnd-limited bug for TSO deferral where we send nothing
In reply to Greg Kroah-HartmanFrom: Neal Cardwell <[email protected]>
[ Upstream commit 299bcb55ecd1412f6df606e9dc0912d55610029e ]
When cwnd is not a multiple of the TSO skb size of N*MSS, we can get into persistent scenarios where we have the following sequence:
(1) ACK for full-sized skb of N*MSS arrives
-> tcp_write_xmit() transmit full-sized skb with N*MSS -> move pacing release time forward
-> exit tcp_write_xmit() because pacing time is in the future
(2) TSQ callback or TCP internal pacing timer fires
-> try to transmit next skb, but TSO deferral finds remainder of
available cwnd is not big enough to trigger an immediate send now, so we defer sending until the next ACK.
(3) repeat...
So we can get into a case where we never mark ourselves as cwnd-limited for many seconds at a time, even with bulk/infinite-backlog senders, because:
o In case (1) above, every time in tcp_write_xmit() we have enough cwnd to send a full-sized skb, we are not fully using the cwnd (because cwnd is not a multiple of the TSO skb size). So every time we send data, we are not cwnd limited, and so in the cwnd-limited tracking code in tcp_cwnd_validate() we mark ourselves as not cwnd-limited.
o In case (2) above, every time in tcp_write_xmit() that we try to transmit the "remainder" of the cwnd but defer, we set the local variable is_cwnd_limited to true, but we do not send any packets, so sent_pkts is zero, so we don't call the cwnd-limited logic to update tp->is_cwnd_limited.
--- net/ipv4/tcp_output.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/ipv4/tcp_output.c +6 -3
@@ -1501,7 +1501,8 @@ static void tcp_cwnd_validate(struct soc* window, and remember whether we were cwnd-limited then. */ if (!before (tp->snd_una, tp->max_packets_seq) || - tp->packets_out > tp->max_packets_out) { + tp->packets_out > tp->max_packets_out || + is_cwnd_limited) { tp->max_packets_out = tp->packets_out; tp->max_packets_seq = tp->snd_nxt; tp->is_cwnd_limited = is_cwnd_limited;
@@ -2172,6 +2173,10 @@ repair:break ; } + is_cwnd_limited |= (tcp_packets_in_flight (tp) >= tp->snd_cwnd); +if (likely (sent_pkts || is_cwnd_limited)) +tcp_cwnd_validate (sk, is_cwnd_limited); +if (likely (sent_pkts)) {if (tcp_in_cwnd_reduction (sk)) tp->prr_out += sent_pkts;
@@ -2179,8 +2184,6 @@ repair:/* Send one loss probe per tail loss episode. */ if (push_one !=2 )tcp_schedule_loss_probe (sk); - is_cwnd_limited |= (tcp_packets_in_flight (tp) >= tp->snd_cwnd); -tcp_cwnd_validate (sk, is_cwnd_limited);return false; }return !tp->packets_out &&tcp_send_head (sk);
Greg Kroah-Hartman
maintainerPATCH 11/132 net: stmmac: delete the eee_ctrl_timer after napi disabled
In reply to Greg Kroah-HartmanFrom: Fugang Duan <[email protected]>
[ Upstream commit 5f58591323bf3f342920179f24515935c4b5fd60 ]
There have chance to re-enable the eee_ctrl_timer and fire the timer in napi callback after delete the timer in .stmmac_release(), which introduces to access eee registers in the timer function after clocks are disabled then causes system hang. Found this issue when do suspend/resume and reboot stress test.
It is safe to delete the timer after napi disabled and disable lpi mode.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +10 -3
@@ -1897,9 +1897,6 @@ static int stmmac_release(struct net_dev {struct stmmac_priv *priv =netdev_priv (dev); -if (priv->eee_enabled) -del_timer_sync (&priv->eee_ctrl_timer); -/* Stop and disconnect the PHY */ if (priv->phydev) {phy_stop (priv->phydev);
@@ -1920,6 +1917,11 @@ static int stmmac_release(struct net_devif (priv->lpi_irq >0 )free_irq (priv->lpi_irq, dev); +if (priv->eee_enabled) { + priv->tx_path_in_lpi_mode = false; +del_timer_sync (&priv->eee_ctrl_timer); + } +/* Stop TX/RX DMA and clear the descriptors */ priv->hw->dma->stop_tx (priv->ioaddr); priv->hw->dma->stop_rx (priv->ioaddr);
@@ -3068,6 +3070,11 @@ int stmmac_suspend(struct net_device *ndnapi_disable (&priv->napi); +if (priv->eee_enabled) { + priv->tx_path_in_lpi_mode = false; +del_timer_sync (&priv->eee_ctrl_timer); + } +/* Stop TX/RX DMA */ priv->hw->dma->stop_tx (priv->ioaddr); priv->hw->dma->stop_rx (priv->ioaddr);
Greg Kroah-Hartman
maintainerPATCH 12/132 net: bridge: vlan: fix error return code in __vlan_add()
In reply to Greg Kroah-HartmanFrom: Zhang Changzhong <[email protected]>
[ Upstream commit ee4f52a8de2c6f78b01f10b4c330867d88c1653a ]
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- net/bridge/br_vlan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/bridge/br_vlan.c +3 -1
@@ -225,8 +225,10 @@ static int __vlan_add(struct net_bridge_ } masterv =br_vlan_get_master (br, v->vid); -if (!masterv) +if (!masterv) { + err = -ENOMEM ; goto out_filt; + } v->brvlan = masterv; }
Greg Kroah-Hartman
maintainerPATCH 13/132 USB: dummy-hcd: Fix uninitialized array use in init()
In reply to Greg Kroah-HartmanFrom: Bui Quang Minh <[email protected]>
commit e90cfa813da7a527785033a0b247594c2de93dd8 upstream.
This error path
err_add_pdata: for (i = 0; i < mod_data.num; i++) kfree(dum[i]);
can be triggered when not all dum's elements are initialized.
Fix this by initializing all dum's elements to NULL.
--- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/dummy_hcd.c +1 -1
@@ -2741,7 +2741,7 @@ static int __init init(void) {int retval = -ENOMEM ;int i; -struct dummy *dum[MAX_NUM_UDC ]; +struct dummy *dum[MAX_NUM_UDC ] = {};if (usb_disabled ())return -ENODEV ;
Greg Kroah-Hartman
maintainerPATCH 14/132 USB: add RESET_RESUME quirk for Snapscan 1212
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit 08a02f954b0def3ada8ed6d4b2c7bcb67e885e9c upstream.
I got reports that some models of this old scanner need this when using runtime PM.
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -189,6 +189,9 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x06a3, 0x0006), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, + /* Agfa SNAPSCAN 1212U */ + { USB_DEVICE(0x06bd, 0x0001), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Guillemot Webcam Hercules Dualpix Exchange (2nd ID) */ { USB_DEVICE(0x06f8, 0x0804), .driver_info = USB_QUIRK_RESET_RESUME },
Greg Kroah-Hartman
maintainerPATCH 15/132 ALSA: usb-audio: Fix potential out-of-bounds shift
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 43d5ca88dfcd35e43010fdd818e067aa9a55f5ba upstream.
syzbot spotted a potential out-of-bounds shift in the USB-audio format parser that receives the arbitrary shift value from the USB descriptor.
Add a range check for avoiding the undefined behavior.
--- sound/usb/format.c | 2 ++ 1 file changed, 2 insertions(+)
sound/usb/format.c +2 -0
@@ -52,6 +52,8 @@ static u64 parse_audio_format_i_type(strcase UAC_VERSION_1 :default : {struct uac_format_type_i_discrete_descriptor *fmt = _fmt; +if (format >=64 ) +return 0 ;/* invalid format */ sample_width = fmt->bBitResolution; sample_bytes = fmt->bSubframeSize; format =1 << format;
Greg Kroah-Hartman
maintainerPATCH 16/132 ALSA: usb-audio: Fix control access overflow errors from chmap
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit c6dde8ffd071aea9d1ce64279178e470977b235c upstream.
The current channel-map control implementation in USB-audio driver may lead to an error message like
"control 3:0:0:Playback Channel Map:0: access overflow"
when CONFIG_SND_CTL_VALIDATION is set. It's because the chmap get callback clears the whole array no matter which count is set, and rather the false-positive detection.
This patch fixes the problem by clearing only the needed array range at usb_chmap_ctl_get().
--- sound/usb/stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/usb/stream.c +3 -3
@@ -187,16 +187,16 @@ static int usb_chmap_ctl_get(struct snd_struct snd_pcm_chmap *info =snd_kcontrol_chip (kcontrol);struct snd_usb_substream *subs = info->private_data;struct snd_pcm_chmap_elem *chmap =NULL ; -int i; +int i =0 ; -memset (ucontrol->value.integer.value,0 , -sizeof (ucontrol->value.integer.value));if (subs->cur_audiofmt) chmap = subs->cur_audiofmt->chmap;if (chmap) {for (i =0 ; i < chmap->channels; i++) ucontrol->value.integer.value[i] = chmap->map[i]; } +for (; i < subs->channels_max; i++) + ucontrol->value.integer.value[i] =0 ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 17/132 xhci: Give USB2 ports time to enter U3 in bus suspend
In reply to Greg Kroah-HartmanFrom: Li Jun <[email protected]>
commit c1373f10479b624fb6dba0805d673e860f1b421d upstream.
If a USB2 device wakeup is not enabled/supported the link state may still be in U0 in xhci_bus_suspend(), where it's then manually put to suspended U3 state.
Just as with selective suspend the device needs time to enter U3 suspend before continuing with further suspend operations (e.g. system suspend), otherwise we may enter system suspend with link state in U0.
[commit message rewording -Mathias]
--- drivers/usb/host/xhci-hub.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/host/xhci-hub.c +4 -0
@@ -1400,6 +1400,10 @@ int xhci_bus_suspend(struct usb_hcd *hcd hcd->state =HC_STATE_SUSPENDED ; bus_state->next_statechange = jiffies +msecs_to_jiffies (10 );spin_unlock_irqrestore (&xhci->lock, flags); + +if (bus_state->bus_suspended) +usleep_range (5000 ,10000 ); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 18/132 USB: sisusbvga: Make console support depend on BROKEN
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
commit 862ee699fefe1e6d6f2c1518395f0b999b8beb15 upstream.
The console part of sisusbvga is broken vs. printk(). It uses in_atomic() to detect contexts in which it cannot sleep despite the big fat comment in preempt.h which says: Do not use in_atomic() in driver code.
in_atomic() does not work on kernels with CONFIG_PREEMPT_COUNT=n which means that spin/rw_lock held regions are not detected by it.
There is no way to make this work by handing context information through to the driver and this only can be solved once the core printk infrastructure supports sleepable console drivers.
Make it depend on BROKEN for now.
--- drivers/usb/misc/sisusbvga/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/misc/sisusbvga/Kconfig +1 -1
@@ -15,7 +15,7 @@ config USB_SISUSBVGA config USB_SISUSBVGA_CON bool "Text console and mode switching support" if USB_SISUSBVGA - depends on VT + depends on VT && BROKEN select FONT_8x16 ---help--- Say Y here if you want a VGA text console via the USB dongle or
Greg Kroah-Hartman
maintainerPATCH 19/132 ALSA: pcm: oss: Fix potential out-of-bounds shift
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 175b8d89fe292796811fdee87fa39799a5b6b87a upstream.
syzbot spotted a potential out-of-bounds shift in the PCM OSS layer where it calculates the buffer size with the arbitrary shift value given via an ioctl.
Add a range check for avoiding the undefined behavior.
As the value can be treated by a signed integer, the max shift should be 30.
--- sound/core/oss/pcm_oss.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/core/oss/pcm_oss.c +5 -1
@@ -2000,11 +2000,15 @@ static int snd_pcm_oss_set_subdivide(strstatic int snd_pcm_oss_set_fragment1 (struct snd_pcm_substream *substream,unsigned int val) {struct snd_pcm_runtime *runtime; +int fragshift; runtime = substream->runtime;if (runtime->oss.subdivision || runtime->oss.fragshift)return -EINVAL ; - runtime->oss.fragshift = val &0xffff ; + fragshift = val &0xffff ; +if (fragshift >=31 ) +return -EINVAL ; + runtime->oss.fragshift = fragshift; runtime->oss.maxfrags = (val >>16 ) &0xffff ;if (runtime->oss.fragshift <4 )/* < 16 */ runtime->oss.fragshift =4 ;
Greg Kroah-Hartman
maintainerPATCH 20/132 serial: 8250_omap: Avoid FIFO corruption caused by MDR1 access
In reply to Greg Kroah-HartmanFrom: Alexander Sverdlin <[email protected]>
commit d96f04d347e4011977abdbb4da5d8f303ebd26f8 upstream.
It has been observed that once per 300-1300 port openings the first transmitted byte is being corrupted on AM3352 ("v" written to FIFO appeared as "e" on the wire). It only happened if single byte has been transmitted right after port open, which means, DMA is not used for this transfer and the corruption never happened afterwards.
Therefore I've carefully re-read the MDR1 errata (link below), which says "when accessing the MDR1 registers that causes a dummy under-run condition that will freeze the UART in IrDA transmission. In UART mode, this may corrupt the transferred data". Strictly speaking, omap_8250_mdr1_errataset() performs a read access and if the value is the same as should be written, exits without errata-recommended FIFO reset.
A brief check of the serial_omap_mdr1_errataset() from the competing omap-serial driver showed it has no read access of MDR1. After removing the read access from omap_8250_mdr1_errataset() the data corruption never happened any more.
--- drivers/tty/serial/8250/8250_omap.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/tty/serial/8250/8250_omap.c +0 -5
@@ -155,11 +155,6 @@ static void omap_8250_mdr1_errataset(str struct omap8250_priv *priv) {u8 timeout =255 ; -u8 old_mdr1; - - old_mdr1 =serial_in (up,UART_OMAP_MDR1 ); -if (old_mdr1 == priv->mdr1) -return ;serial_out (up,UART_OMAP_MDR1 , priv->mdr1);udelay (2 );
Greg Kroah-Hartman
maintainerPATCH 21/132 USB: serial: cp210x: enable usb generic throttle/unthrottle
In reply to Greg Kroah-HartmanFrom: Brant Merryman <[email protected]>
commit 4387b3dbb079d482d3c2b43a703ceed4dd27ed28 upstream
Assign the .throttle and .unthrottle functions to be generic function in the driver structure to prevent data loss that can otherwise occur if the host does not enable USB throttling.
--- drivers/usb/serial/cp210x.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/cp210x.c +2 -0
@@ -252,6 +252,8 @@ static struct usb_serial_driver cp210x_d .close = cp210x_close, .break_ctl = cp210x_break_ctl, .set_termios = cp210x_set_termios, + .throttle = usb_serial_generic_throttle, + .unthrottle = usb_serial_generic_unthrottle, .tiocmget = cp210x_tiocmget, .tiocmset = cp210x_tiocmset, .attach = cp210x_startup,
Greg Kroah-Hartman
maintainerPATCH 22/132 scsi: bnx2i: Requires MMU
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 2d586494c4a001312650f0b919d534e429dd1e09 ]
The SCSI_BNX2_ISCSI kconfig symbol selects CNIC and CNIC selects UIO, which depends on MMU.
Since 'select' does not follow dependency chains, add the same MMU dependency to SCSI_BNX2_ISCSI.
Quietens this kconfig warning:
WARNING: unmet direct dependencies detected for CNIC
Depends on [n]: NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_BROADCOM [=y] && PCI [=y] && (IPV6 [=m] || IPV6 [=m]=n) && MMU [=n] Selected by [m]:
- SCSI_BNX2_ISCSI [=m] && SCSI_LOWLEVEL [=y] && SCSI [=y] && NET [=y] && PCI [=y] && (IPV6 [=m] || IPV6 [=m]=n)
--- drivers/scsi/bnx2i/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/bnx2i/Kconfig +1 -0
@@ -3,6 +3,7 @@ config SCSI_BNX2_ISCSI depends on NET depends on PCI depends on (IPV6 || IPV6=n) + depends on MMU select SCSI_ISCSI_ATTRS select NETDEVICES select ETHERNET
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 23/132 can: softing: softing_netdev_open(): fix error handling
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 4d1be581ec6b92a338bb7ed23e1381f45ddf336f ]
If softing_netdev_open() fails, we should call close_candev() to avoid reference leak.
--- drivers/net/can/softing/softing_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/can/softing/softing_main.c +7 -2
@@ -393,8 +393,13 @@ static int softing_netdev_open(struct net_device *ndev)/* check or determine and set bittime */ ret =open_candev (ndev); -if (!ret) - ret =softing_startstop (ndev,1 ); +if (ret) +return ret; + + ret =softing_startstop (ndev,1 ); +if (ret <0 ) +close_candev (ndev); +return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 24/132 RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
[ Upstream commit 340b940ea0ed12d9adbb8f72dea17d516b2019e8 ]
If cm_create_timewait_info() fails, the timewait_info pointer will contain an error value and will be used in cm_remove_remote() later.
general protection fault, probably for non-canonical address 0xdffffc0000000024: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0×0000000000000120-0×0000000000000127] CPU: 2 PID: 12446 Comm: syz-executor.3 Not tainted 5.10.0-rc5-5d4c0742a60e #27 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:cm_remove_remote.isra.0+0x24/0×170 drivers/infiniband/core/cm.c:978 Code: 84 00 00 00 00 00 41 54 55 53 48 89 fb 48 8d ab 2d 01 00 00 e8 7d bf 4b fe 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <0f> b6 04 02 48 89 ea 83 e2 07 38 d0 7f 08 84 c0 0f 85 fc 00 00 00 RSP: 0018:ffff888013127918 EFLAGS: 00010006 RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: ffffc9000a18b000 RDX: 0000000000000024 RSI: ffffffff82edc573 RDI: fffffffffffffff4 RBP: 0000000000000121 R08: 0000000000000001 R09: ffffed1002624f1d R10: 0000000000000003 R11: ffffed1002624f1c R12: ffff888107760c70 R13: ffff888107760c40 R14: fffffffffffffff4 R15: ffff888107760c9c FS: 00007fe1ffcc1700(0000) GS:ffff88811a600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2ff21000 CR3: 000000010f504001 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: cm_destroy_id+0x189/0×15b0 drivers/infiniband/core/cm.c:1155 cma_connect_ib drivers/infiniband/core/cma.c:4029 [inline] rdma_connect_locked+0x1100/0×17c0 drivers/infiniband/core/cma.c:4107 rdma_connect+0x2a/0×40 drivers/infiniband/core/cma.c:4140 ucma_connect+0x277/0×340 drivers/infiniband/core/ucma.c:1069 ucma_write+0x236/0×2f0 drivers/infiniband/core/ucma.c:1724 vfs_write+0x220/0×830 fs/read_write.c:603 ksys_write+0x1df/0×240 fs/read_write.c:658 do_syscall_64+0x33/0×40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9
--- drivers/infiniband/core/cm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/core/cm.c +2 -0
@@ -1252,6 +1252,7 @@ int ib_send_cm_req(struct ib_cm_id *cm_id, id.local_id);if (IS_ERR (cm_id_priv->timewait_info)) { ret =PTR_ERR (cm_id_priv->timewait_info); + cm_id_priv->timewait_info =NULL ; goto out; }
@@ -1681,6 +1682,7 @@ static int cm_req_handler(struct cm_work *work) id.local_id);if (IS_ERR (cm_id_priv->timewait_info)) { ret =PTR_ERR (cm_id_priv->timewait_info); + cm_id_priv->timewait_info =NULL ; goto destroy; } cm_id_priv->timewait_info->work.remote_id = req_msg->local_comm_id;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 25/132 dm table: Remove BUG_ON(in_interrupt())
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
[ Upstream commit e7b624183d921b49ef0a96329f21647d38865ee9 ]
The BUG_ON(in_interrupt()) in dm_table_event() is a historic leftover from a rework of the dm table code which changed the calling context.
Issuing a BUG for a wrong calling context is frowned upon and in_interrupt() is deprecated and only covering parts of the wrong contexts. The sanity check for the context is covered by CONFIG_DEBUG_ATOMIC_SLEEP and other debug facilities already.
--- drivers/md/dm-table.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/md/dm-table.c +0 -6
@@ -1154,12 +1154,6 @@ void dm_table_event_callback(struct dm_table *t,void dm_table_event (struct dm_table *t) { -/* -* You can no longer call dm_table_event() from interrupt -* context, use a bottom half instead. -*/ -BUG_ON (in_interrupt ()); -mutex_lock (&_event_lock);if (t->event_fn) t->event_fn (t->event_context);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 26/132 soc/tegra: fuse: Fix index bug in get_process_id
In reply to Greg Kroah-HartmanFrom: Nicolin Chen <[email protected]>
commit b9ce9b0f83b536a4ac7de7567a265d28d13e5bea upstream.
This patch simply fixes a bug of referencing speedos[num] in every for-loop iteration in get_process_id function.
--- drivers/soc/tegra/fuse/speedo-tegra210.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/speedo-tegra210.c +1 -1
@@ -105,7 +105,7 @@ static int get_process_id(int value, conunsigned int i;for (i =0 ; i < num; i++) -if (value < speedos[num]) +if (value < speedos[i])return i;return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 27/132 USB: serial: option: add interface-number sanity check to flag handling
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit a251963f76fa0226d0fdf0c4f989496f18d9ae7f upstream.
Add an interface-number sanity check before testing the device flags to avoid relying on undefined behaviour when left shifting in case a device uses an interface number greater than or equal to BITS_PER_LONG (i.e. 64 or 32).
--- drivers/usb/serial/option.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/usb/serial/option.c +21 -2
@@ -563,6 +563,9 @@ static void option_instat_callback(struc/* Device flags */ +/* Highest interface number which can be used with NCTRL() and RSVD() */ +#define FLAG_IFNUM_MAX 7 +/* Interface does not support modem-control requests */ #define NCTRL (ifnum) ((BIT(ifnum) & 0xff) << 8)
@@ -2086,6 +2089,14 @@ static struct usb_serial_driver * constmodule_usb_serial_driver (serial_drivers, option_ids); +static bool iface_is_reserved (unsigned long device_flags,u8 ifnum) +{ +if (ifnum >FLAG_IFNUM_MAX ) +return false; + +return device_flags &RSVD (ifnum); +} +static int option_probe (struct usb_serial *serial,const struct usb_device_id *id) {
@@ -2103,7 +2114,7 @@ static int option_probe(struct usb_seria* the same class/subclass/protocol as the serial interfaces. Look at * the Windows driver .INF files for reserved interface numbers. */ -if (device_flags &RSVD (iface_desc->bInterfaceNumber)) +if (iface_is_reserved (device_flags, iface_desc->bInterfaceNumber))return -ENODEV ;/* * Don't bind network interface on Samsung GT-B3730, it is handled by
@@ -2120,6 +2131,14 @@ static int option_probe(struct usb_seriareturn 0 ; } +static bool iface_no_modem_control (unsigned long device_flags,u8 ifnum) +{ +if (ifnum >FLAG_IFNUM_MAX ) +return false; + +return device_flags &NCTRL (ifnum); +} +static int option_attach (struct usb_serial *serial) {struct usb_interface_descriptor *iface_desc;
@@ -2135,7 +2154,7 @@ static int option_attach(struct usb_seri iface_desc = &serial->interface->cur_altsetting->desc; -if (!(device_flags &NCTRL (iface_desc->bInterfaceNumber))) +if (!iface_no_modem_control (device_flags, iface_desc->bInterfaceNumber)) data->use_send_setup =1 ;if (device_flags &ZLP )
Greg Kroah-Hartman
maintainerPATCH 28/132 USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
In reply to Greg Kroah-HartmanFrom: Will McVicker <[email protected]>
commit b00f444f9add39b64d1943fa75538a1ebd54a290 upstream.
Align the SuperSpeed Plus bitrate for f_rndis to match f_ncm's ncm_bitrate defined by commit 1650113888fe ("usb: gadget: f_ncm: add SuperSpeed descriptors for CDC NCM").
--- drivers/usb/gadget/function/f_rndis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/f_rndis.c +3 -1
@@ -91,8 +91,10 @@ static inline struct f_rndis *func_to_rn/* peak (theoretical) bulk transfer rate in bits-per-second */ static unsigned int bitrate (struct usb_gadget *g) { +if (gadget_is_superspeed (g) && g->speed >=USB_SPEED_SUPER_PLUS ) +return 4250000000U ;if (gadget_is_superspeed (g) && g->speed ==USB_SPEED_SUPER ) -return 13 *1024 *8 *1000 *8 ; +return 3750000000U ;else if (gadget_is_dualspeed (g) && g->speed ==USB_SPEED_HIGH )return 13 *512 *8 *1000 *8 ;else
Greg Kroah-Hartman
maintainerPATCH 29/132 usb: chipidea: ci_hdrc_imx: Pass DISABLE_DEVICE_STREAMING flag to imx6ul
In reply to Greg Kroah-HartmanFrom: Fabio Estevam <[email protected]>
commit c7721e15f434920145c376e8fe77e1c079fc3726 upstream.
According to the i.MX6UL Errata document:
https://www.nxp.com/docs/en/errata/IMX6ULCE.pdf
ERR007881 also affects i.MX6UL, so pass the CI_HDRC_DISABLE_DEVICE_STREAMING flag to workaround the issue.
--- drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/chipidea/ci_hdrc_imx.c +2 -1
@@ -58,7 +58,8 @@ static const struct ci_hdrc_imx_platformstatic const struct ci_hdrc_imx_platform_flag imx6ul_usb_data = { .flags =CI_HDRC_SUPPORTS_RUNTIME_PM | -CI_HDRC_TURN_VBUS_EARLY_ON , +CI_HDRC_TURN_VBUS_EARLY_ON | +CI_HDRC_DISABLE_DEVICE_STREAMING , };static const struct ci_hdrc_imx_platform_flag imx7d_usb_data = {
Greg Kroah-Hartman
maintainerPATCH 30/132 media: msi2500: assign SPI bus number dynamically
In reply to Greg Kroah-HartmanFrom: Antti Palosaari <[email protected]>
commit 9c60cc797cf72e95bb39f32316e9f0e5f85435f9 upstream.
SPI bus number must be assigned dynamically for each device, otherwise it will crash when multiple devices are plugged to system.
--- drivers/media/usb/msi2500/msi2500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/msi2500/msi2500.c +1 -1
@@ -1254,7 +1254,7 @@ static int msi2500_probe(struct usb_inte } dev->master = master; - master->bus_num =0 ; + master->bus_num =-1 ; master->num_chipselect =1 ; master->transfer_one_message = msi2500_transfer_one_message;spi_master_set_devdata (master, dev);
Greg Kroah-Hartman
maintainerPATCH 31/132 Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()
In reply to Greg Kroah-HartmanFrom: Peilin Ye <[email protected]>
commit f7e0e8b2f1b0a09b527885babda3e912ba820798 upstream.
num_reports is not being properly checked. A malformed event packet with a large num_reports number makes hci_le_direct_adv_report_evt() read out of bounds. Fix it.
--- net/bluetooth/hci_event.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
net/bluetooth/hci_event.c +5 -7
@@ -5114,20 +5114,18 @@ static void hci_le_direct_adv_report_evt struct sk_buff *skb) {u8 num_reports = skb->data[0 ]; -void *ptr = &skb->data[1 ]; +struct hci_ev_le_direct_adv_info *ev = (void *)&skb->data[1 ]; -hci_dev_lock (hdev); +if (!num_reports || skb->len < num_reports *sizeof (*ev) +1 ) +return ; -while (num_reports--) { -struct hci_ev_le_direct_adv_info *ev = ptr; +hci_dev_lock (hdev); +for (; num_reports; num_reports--, ev++)process_adv_report (hdev, ev->evt_type, &ev->bdaddr, ev->bdaddr_type, &ev->direct_addr, ev->direct_addr_type, ev->rssi,NULL ,0 ); - ptr +=sizeof (*ev); - } -hci_dev_unlock (hdev); }
Greg Kroah-Hartman
maintainerPATCH 32/132 drm/gma500: fix double free of gma_connector
In reply to Greg Kroah-HartmanFrom: Tom Rix <[email protected]>
[ Upstream commit 4e19d51ca5b28a1d435a844c7b2a8e1b1b6fa237 ]
clang static analysis reports this problem:
cdv_intel_dp.c:2101:2: warning: Attempt to free released memory
kfree(gma_connector);
^~~~~~~~~~~~~~~~~~~~In cdv_intel_dp_init() when the call to cdv_intel_edp_panel_vdd_off() fails, the handler calls cdv_intel_dp_destroy(connector) which does the first free of gma_connector. So adjust the goto label and skip the second free.
--- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/gma500/cdv_intel_dp.c +1 -1
@@ -2125,7 +2125,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_devDRM_INFO ("failed to retrieve link info, disabling eDP\n" );cdv_intel_dp_encoder_destroy (encoder);cdv_intel_dp_destroy (connector); - goto err_priv; + goto err_connector; }else { DRM_DEBUG_KMS("DPCD: Rev=%x LN_Rate=%x LN_CNT=%x LN_DOWNSP=%x\n", intel_dp->dpcd[0], intel_dp->dpcd[1],
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 33/132 ARM: p2v: fix handling of LPAE translation in BE mode
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit 4e79f0211b473f8e1eab8211a9fd50cc41a3a061 ]
When running in BE mode on LPAE hardware with a PA-to-VA translation that exceeds 4 GB, we patch bits 39:32 of the offset into the wrong byte of the opcode. So fix that, by rotating the offset in r0 to the right by 8 bits, which will put the 8-bit immediate in bits 31:24.
Note that this will also move bit #22 in its correct place when applying the rotation to the constant #0x400000.
--- arch/arm/kernel/head.S | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
arch/arm/kernel/head.S +1 -5
@@ -673,12 +673,8 @@ ARM_BE8(rev16 ip, ip) ldrcc r7, [r4], #4 @ use branch for delay slot bcc 1b bx lr -#else -#ifdef CONFIG_CPU_ENDIAN_BE8 - moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction #else moveq r0, #0x400000 @ set bit 22, mov to mvn instruction -#endif b 2f 1: ldr ip, [r7, r3] #ifdef CONFIG_CPU_ENDIAN_BE8
@@ -687,7 +683,7 @@ ARM_BE8(rev16 ip, ip) tst ip, #0x000f0000 @ check the rotation field orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 biceq ip, ip, #0x00004000 @ clear bit 22 - orreq ip, ip, r0 @ mask in offset bits 7-0 + orreq ip, ip, r0, ror #8 @ mask in offset bits 7-0 #else bic ip, ip, #0x000000ff tst ip, #0xf00 @ check the rotation field
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 34/132 crypto: talitos - Fix return type of current_desc_hdr()
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
[ Upstream commit 0237616173fd363a54bd272aa3bd376faa1d7caa ]
current_desc_hdr() returns a u32 but in fact this is a __be32, leading to a lot of sparse warnings.
Change the return type to __be32 and ensure it is handled as sure by the caller.
--- drivers/crypto/talitos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/crypto/talitos.c +3 -3
@@ -440,7 +440,7 @@ DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE)/* * locate current (offending) descriptor */ -static u32 current_desc_hdr (struct device *dev,int ch) +static __be32 current_desc_hdr (struct device *dev,int ch) {struct talitos_private *priv =dev_get_drvdata (dev);int tail, iter;
@@ -471,13 +471,13 @@ static u32 current_desc_hdr(struct device *dev, int ch)/* * user diagnostics; report root cause of error based on execution unit status */ -static void report_eu_error (struct device *dev,int ch,u32 desc_hdr) +static void report_eu_error (struct device *dev,int ch,__be32 desc_hdr) {struct talitos_private *priv =dev_get_drvdata (dev);int i;if (!desc_hdr) - desc_hdr =in_be32 (priv->chan[ch].reg +TALITOS_DESCBUF ); + desc_hdr =cpu_to_be32 (in_be32 (priv->chan[ch].reg +TALITOS_DESCBUF ));switch (desc_hdr &DESC_HDR_SEL0_MASK ) {case DESC_HDR_SEL0_AFEU :
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 35/132 spi: img-spfi: fix reference leak in img_spfi_resume
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit ee5558a9084584015c8754ffd029ce14a5827fa8 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in img_spfi_resume, so we should fix it.
--- drivers/spi/spi-img-spfi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/spi/spi-img-spfi.c +3 -1
@@ -773,8 +773,10 @@ static int img_spfi_resume(struct device *dev)int ret; ret =pm_runtime_get_sync (dev); -if (ret) +if (ret) { +pm_runtime_put_noidle (dev);return ret; + }spfi_reset (spfi);pm_runtime_put (dev);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 36/132 ASoC: pcm: DRAIN support reactivation
In reply to Greg Kroah-HartmanFrom: Cezary Rojewski <[email protected]>
[ Upstream commit 4c22b80f61540ea99d9b4af0127315338755f05b ]
soc-pcm's dpcm_fe_dai_do_trigger() supported DRAIN commnad up to kernel v5.4 where explicit switch(cmd) has been introduced which takes into account all SNDRV_PCM_TRIGGER_xxx but SNDRV_PCM_TRIGGER_DRAIN. Update switch statement to reactive support for it.
As DRAIN is somewhat unique by lacking negative/stop counterpart, bring behaviour of dpcm_fe_dai_do_trigger() for said command back to its pre-v5.4 state by adding it to START/RESUME/PAUSE_RELEASE group.
--- sound/soc/soc-pcm.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/soc-pcm.c +2 -0
@@ -2075,6 +2075,7 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_RESUME :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE : +case SNDRV_PCM_TRIGGER_DRAIN : ret =dpcm_dai_trigger_fe_be (substream, cmd, true);break ;case SNDRV_PCM_TRIGGER_STOP :
@@ -2092,6 +2093,7 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_RESUME :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE : +case SNDRV_PCM_TRIGGER_DRAIN : ret =dpcm_dai_trigger_fe_be (substream, cmd, false);break ;case SNDRV_PCM_TRIGGER_STOP :
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 37/132 Bluetooth: Fix null pointer dereference in hci_event_packet()
In reply to Greg Kroah-HartmanFrom: Anmol Karn <[email protected]>
[ Upstream commit 6dfccd13db2ff2b709ef60a50163925d477549aa ]
AMP_MGR is getting derefernced in hci_phy_link_complete_evt(), when called from hci_event_packet() and there is a possibility, that hcon->amp_mgr may not be found when accessing after initialization of hcon.
- net/bluetooth/hci_event.c:4945
The bug seems to get triggered in this line:
bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon;
Fix it by adding a NULL check for the hcon->amp_mgr before checking the ev-status.
--- net/bluetooth/hci_event.c | 5 +++++ 1 file changed, 5 insertions(+)
net/bluetooth/hci_event.c +5 -0
@@ -4336,6 +4336,11 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev,return ; } +if (!hcon->amp_mgr) { +hci_dev_unlock (hdev); +return ; + } +if (ev->status) {hci_conn_del (hcon);hci_dev_unlock (hdev);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 38/132 spi: spi-ti-qspi: fix reference leak in ti_qspi_setup
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 45c0cba753641e5d7c3207f04241bd0e7a021698 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in ti_qspi_setup, so we should fix it.
--- drivers/spi/spi-ti-qspi.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-ti-qspi.c +1 -0
@@ -159,6 +159,7 @@ static int ti_qspi_setup(struct spi_device *spi) ret =pm_runtime_get_sync (qspi->dev);if (ret <0 ) { +pm_runtime_put_noidle (qspi->dev);dev_err (qspi->dev,"pm_runtime_get_sync() failed\n" );return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 39/132 spi: tegra20-slink: fix reference leak in slink ops of tegra20
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 763eab7074f6e71babd85d796156f05a675f9510 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in two callers(tegra_slink_setup and tegra_slink_resume), so we should fix it.
--- drivers/spi/spi-tegra20-slink.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/spi/spi-tegra20-slink.c +2 -0
@@ -761,6 +761,7 @@ static int tegra_slink_setup(struct spi_device *spi) ret =pm_runtime_get_sync (tspi->dev);if (ret <0 ) { +pm_runtime_put_noidle (tspi->dev);dev_err (tspi->dev,"pm runtime failed, e = %d\n" , ret);return ret; }
@@ -1197,6 +1198,7 @@ static int tegra_slink_resume(struct device *dev) ret =pm_runtime_get_sync (dev);if (ret <0 ) { +pm_runtime_put_noidle (dev);dev_err (dev,"pm runtime failed, e = %d\n" , ret);return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 40/132 spi: tegra20-sflash: fix reference leak in tegra_sflash_resume
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 3482e797ab688da6703fe18d8bad52f94199f4f2 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in tegra_sflash_resume, so we should fix it.
--- drivers/spi/spi-tegra20-sflash.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-tegra20-sflash.c +1 -0
@@ -564,6 +564,7 @@ static int tegra_sflash_resume(struct device *dev) ret =pm_runtime_get_sync (dev);if (ret <0 ) { +pm_runtime_put_noidle (dev);dev_err (dev,"pm runtime failed, e = %d\n" , ret);return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 41/132 spi: tegra114: fix reference leak in tegra spi ops
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit a042184c7fb99961ea083d4ec192614bec671969 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in two callers(tegra_spi_setup and tegra_spi_resume), so we should fix it.
--- drivers/spi/spi-tegra114.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/spi/spi-tegra114.c +2 -0
@@ -801,6 +801,7 @@ static int tegra_spi_setup(struct spi_device *spi) ret =pm_runtime_get_sync (tspi->dev);if (ret <0 ) { +pm_runtime_put_noidle (tspi->dev);dev_err (tspi->dev,"pm runtime failed, e = %d\n" , ret);return ret; }
@@ -1214,6 +1215,7 @@ static int tegra_spi_resume(struct device *dev) ret =pm_runtime_get_sync (dev);if (ret <0 ) { +pm_runtime_put_noidle (dev);dev_err (dev,"pm runtime failed, e = %d\n" , ret);return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 42/132 net: evaluate net.ipvX.conf.all.ignore_routes_with_linkdown
In reply to Greg Kroah-HartmanFrom: Vincent Bernat <[email protected]>
[ Upstream commit c0c5a60f0f1311bcf08bbe735122096d6326fb5b ]
Introduced in 0eeb075fad73, the "ignore_routes_with_linkdown" sysctl ignores a route whose interface is down. It is provided as a per-interface sysctl. However, while a "all" variant is exposed, it was a noop since it was never evaluated. We use the usual "or" logic for this kind of sysctls.
Tested with:
ip link add type veth # veth0 + veth1
ip link add type veth # veth1 + veth2
ip link set up dev veth0
ip link set up dev veth1 # link-status paired with veth0
ip link set up dev veth2
ip link set up dev veth3 # link-status paired with veth2
# First available path
ip -4 addr add 203.0.113.${uts#H}/24 dev veth0
ip -6 addr add 2001:db8:1::${uts#H}/64 dev veth0
# Second available path
ip -4 addr add 192.0.2.${uts#H}/24 dev veth2
ip -6 addr add 2001:db8:2::${uts#H}/64 dev veth2
# More specific route through first path
ip -4 route add 198.51.100.0/25 via 203.0.113.254 # via veth0
ip -6 route add 2001:db8:3::/56 via 2001:db8:1::ff # via veth0
# Less specific route through second path
ip -4 route add 198.51.100.0/24 via 192.0.2.254 # via veth2
ip -6 route add 2001:db8:3::/48 via 2001:db8:2::ff # via veth2
# H1: enable on "all"
# H2: enable on "veth0"
for v in ipv4 ipv6; do
case $uts in
H1)
sysctl -qw net.${v}.conf.all.ignore_routes_with_linkdown=1
;;
H2)
sysctl -qw net.${v}.conf.veth0.ignore_routes_with_linkdown=1
;;
esac
done
set -xe
# When veth0 is up, best route is through veth0
ip -o route get 198.51.100.1 | grep -Fw veth0
ip -o route get 2001:db8:3::1 | grep -Fw veth0
# When veth0 is down, best route should be through veth2 on H1/H2,
# but on veth0 on H2
ip link set down dev veth1 # down veth0
ip route show
[ $uts != H3 ] || ip -o route get 198.51.100.1 | grep -Fw veth0
[ $uts != H3 ] || ip -o route get 2001:db8:3::1 | grep -Fw veth0
[ $uts = H3 ] || ip -o route get 198.51.100.1 | grep -Fw veth2
[ $uts = H3 ] || ip -o route get 2001:db8:3::1 | grep -Fw veth2Without this patch, the two last lines would fail on H1 (the one using the "all" sysctl). With the patch, everything succeeds as expected.
Also document the sysctl in ip-sysctl.rst.
--- Documentation/networking/ip-sysctl.txt | 3 +++ include/linux/inetdevice.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
Documentation/networking/ip-sysctl.txt +3 -0
@@ -1211,6 +1211,9 @@ igmpv3_unsolicited_report_interval - INTEGER IGMPv3 report retransmit will take place. Default: 1000 (1 seconds) +ignore_routes_with_linkdown - BOOLEAN + Ignore routes whose link is down when performing a FIB lookup. + promote_secondaries - BOOLEAN When a primary IP address is removed from this interface promote a corresponding secondary IP address instead of
include/linux/inetdevice.h +1 -1
@@ -121,7 +121,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS)))#define IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN (in_dev) \ - IN_DEV_CONF_GET((in_dev), IGNORE_ROUTES_WITH_LINKDOWN) + IN_DEV_ORCONF((in_dev), IGNORE_ROUTES_WITH_LINKDOWN)#define IN_DEV_ARPFILTER (in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER)#define IN_DEV_ARP_ACCEPT (in_dev) IN_DEV_ORCONF((in_dev), ARP_ACCEPT)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 43/132 net: evaluate net.ipv4.conf.all.proxy_arp_pvlan
In reply to Greg Kroah-HartmanFrom: Vincent Bernat <[email protected]>
[ Upstream commit 1af5318c00a8acc33a90537af49b3f23f72a2c4b ]
Introduced in 65324144b50b, the "proxy_arp_vlan" sysctl is a per-interface sysctl to tune proxy ARP support for private VLANs. While the "all" variant is exposed, it was a noop and never evaluated. We use the usual "or" logic for this kind of sysctls.
--- include/linux/inetdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/inetdevice.h +1 -1
@@ -100,7 +100,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)#define IN_DEV_LOG_MARTIANS (in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)#define IN_DEV_PROXY_ARP (in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) -#define IN_DEV_PROXY_ARP_PVLAN (in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN) +#define IN_DEV_PROXY_ARP_PVLAN (in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP_PVLAN)#define IN_DEV_SHARED_MEDIA (in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA)#define IN_DEV_TX_REDIRECTS (in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS)#define IN_DEV_SEC_REDIRECTS (in_dev) IN_DEV_ORCONF((in_dev), \
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 44/132 RDMa/mthca: Work around -Wenum-conversion warning
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit fbb7dc5db6dee553b5a07c27e86364a5223e244c ]
gcc points out a suspicious mixing of enum types in a function that converts from MTHCA_OPCODE_* values to IB_WC_* values:
drivers/infiniband/hw/mthca/mthca_cq.c: In function 'mthca_poll_one':drivers/infiniband/hw/mthca/mthca_cq.c:607:21: warning: implicit conversion from 'enum <anonymous>' to 'enum ib_wc_opcode' [-Wenum-conversion]
607 | entry->opcode = MTHCA_OPCODE_INVALID;
Nothing seems to ever check for MTHCA_OPCODE_INVALID again, no idea if this is meaningful, but it seems harmless as it deals with an invalid input.
Remove MTHCA_OPCODE_INVALID and set the ib_wc_opcode to 0xFF, which is still bogus, but at least doesn't make compiler warnings.
--- drivers/infiniband/hw/mthca/mthca_cq.c | 2 +- drivers/infiniband/hw/mthca/mthca_dev.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/hw/mthca/mthca_cq.c +1 -1
@@ -612,7 +612,7 @@ static inline int mthca_poll_one(struct mthca_dev *dev, entry->opcode =IB_WC_BIND_MW ;break ;default : - entry->opcode =MTHCA_OPCODE_INVALID ; + entry->opcode =0xFF ;break ; } }else {
drivers/infiniband/hw/mthca/mthca_dev.h +0 -1
@@ -105,7 +105,6 @@ enum {MTHCA_OPCODE_ATOMIC_CS =0x11 ,MTHCA_OPCODE_ATOMIC_FA =0x12 , MTHCA_OPCODE_BIND_MW = 0x18, -MTHCA_OPCODE_INVALID =0xff }; enum {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 45/132 MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA
In reply to Greg Kroah-HartmanFrom: Necip Fazil Yildiran <[email protected]>
[ Upstream commit 3a5fe2fb9635c43359c9729352f45044f3c8df6b ]
When BCM47XX_BCMA is enabled and BCMA_DRIVER_PCI is disabled, it results in the following Kbuild warning:
WARNING: unmet direct dependencies detected for BCMA_DRIVER_PCI_HOSTMODE
Depends on [n]: MIPS [=y] && BCMA_DRIVER_PCI [=n] && PCI_DRIVERS_LEGACY [=y] && BCMA [=y]=y Selected by [y]:
- BCM47XX_BCMA [=y] && BCM47XX [=y] && PCI [=y]
The reason is that BCM47XX_BCMA selects BCMA_DRIVER_PCI_HOSTMODE without depending on or selecting BCMA_DRIVER_PCI while BCMA_DRIVER_PCI_HOSTMODE depends on BCMA_DRIVER_PCI. This can also fail building the kernel.
Honor the kconfig dependency to remove unmet direct dependency warnings and avoid any potential build failures.
--- arch/mips/bcm47xx/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/bcm47xx/Kconfig +1 -0
@@ -26,6 +26,7 @@ config BCM47XX_BCMA select BCMA select BCMA_HOST_SOC select BCMA_DRIVER_MIPS + select BCMA_DRIVER_PCI if PCI select BCMA_DRIVER_PCI_HOSTMODE if PCI select BCMA_DRIVER_GPIO default y
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 46/132 media: solo6x10: fix missing snd_card_free in error handling case
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit dcdff74fa6bc00c32079d0bebd620764c26f2d89 ]
Fix to goto snd_error in error handling case when fails to do snd_ctl_add, as done elsewhere in this function.
--- drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/solo6x10/solo6x10-g723.c +1 -1
@@ -385,7 +385,7 @@ int solo_g723_init(struct solo_dev *solo_dev) ret =snd_ctl_add (card,snd_ctl_new1 (&kctl, solo_dev));if (ret <0 ) -return ret; + goto snd_error; ret =solo_snd_pcm_init (solo_dev);if (ret <0 )
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 47/132 drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 723ae803218da993143387bf966042eccefac077 ]
Return -ENOMEM when allocating refill memory failed.
--- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +1 -0
@@ -720,6 +720,7 @@ static int omap_dmm_probe(struct platform_device *dev) &omap_dmm->refill_pa, GFP_KERNEL);if (!omap_dmm->refill_va) {dev_err (&dev->dev,"could not allocate refill memory\n" ); + ret = -ENOMEM ; goto fail; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 48/132 Input: ads7846 - fix integer overflow on Rt calculation
In reply to Greg Kroah-HartmanFrom: Oleksij Rempel <[email protected]>
[ Upstream commit 820830ec918f6c3dcd77a54a1c6198ab57407916 ]
In some rare cases the 32 bit Rt value will overflow if z2 and x is max, z1 is minimal value and x_plate_ohms is relatively high (for example 800 ohm). This would happen on some screen age with low pressure.
There are two possible fixes:
- make Rt 64bit
- reorder calculation to avoid overflow
The second variant seems to be preferable, since 64 bit calculation on 32 bit system is a bit more expensive.
--- drivers/input/touchscreen/ads7846.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/input/touchscreen/ads7846.c +3 -2
@@ -785,10 +785,11 @@ static void ads7846_report_state(struct ads7846 *ts)/* compute touch pressure resistance using equation #2 */ Rt = z2; Rt -= z1; - Rt *= x; Rt *= ts->x_plate_ohms; + Rt =DIV_ROUND_CLOSEST (Rt,16 ); + Rt *= x; Rt /= z1; - Rt = (Rt +2047 ) >>12 ; + Rt =DIV_ROUND_CLOSEST (Rt,256 ); }else { Rt =0 ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 49/132 Input: ads7846 - fix unaligned access on 7845
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 03e2c9c782f721b661a0e42b1b58f394b5298544 ]
req->sample[1] is not naturally aligned at word boundary, and therefore we should use get_unaligned_be16() when accessing it.
--- drivers/input/touchscreen/ads7846.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/touchscreen/ads7846.c +2 -1
@@ -35,6 +35,7 @@#include <linux/regulator/consumer.h> #include <linux/module.h> #include <asm/irq.h> +#include <asm/unaligned.h> /* * This code has been heavily tested on a Nokia 770, and lightly
@@ -410,7 +411,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command)if (status ==0 ) {/* BE12 value, then padding */ - status =be16_to_cpu (*((u16 *)&req->sample[1 ])); + status =get_unaligned_be16 (&req->sample[1 ]); status = status >>3 ; status &=0x0fff ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 50/132 powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
[ Upstream commit 78665179e569c7e1fe102fb6c21d0f5b6951f084 ]
On 8xx, we get the following features:
[ 0.000000] cpu_features = 0x0000000000000100 [ 0.000000] possible = 0x0000000000000120 [ 0.000000] always = 0x0000000000000000
This is not correct. As CONFIG_PPC_8xx is mutually exclusive with all other configurations, the three lines should be equal.
The problem is due to CPU_FTRS_GENERIC_32 which is taken when CONFIG_BOOK3S_32 is NOT selected. This CPU_FTRS_GENERIC_32 is pointless because there is no generic configuration supporting all 32 bits but book3s/32.
Remove this pointless generic features definition to unbreak the calculation of 'possible' features and 'always' features.
--- arch/powerpc/include/asm/cputable.h | 5 ----- 1 file changed, 5 deletions(-)
arch/powerpc/include/asm/cputable.h +0 -5
@@ -400,7 +400,6 @@ enum { CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \ CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT) -#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)/* 64-bit CPUs */ #define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
@@ -479,8 +478,6 @@ enum { CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 | CPU_FTRS_CLASSIC32 | -#else - CPU_FTRS_GENERIC_32 |#endif #ifdef CONFIG_8xx CPU_FTRS_8XX |
@@ -530,8 +527,6 @@ enum { CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 & CPU_FTRS_CLASSIC32 & -#else - CPU_FTRS_GENERIC_32 &#endif #ifdef CONFIG_8xx CPU_FTRS_8XX &
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 51/132 soc: ti: knav_qmss: fix reference leak in knav_queue_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit ec8684847d8062496c4619bc3fcff31c19d56847 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in knav_queue_probe, so we should fix it.
--- drivers/soc/ti/knav_qmss_queue.c | 1 + 1 file changed, 1 insertion(+)
drivers/soc/ti/knav_qmss_queue.c +1 -0
@@ -1717,6 +1717,7 @@ static int knav_queue_probe(struct platform_device *pdev)pm_runtime_enable (&pdev->dev); ret =pm_runtime_get_sync (&pdev->dev);if (ret <0 ) { +pm_runtime_put_noidle (&pdev->dev);dev_err (dev,"Failed to enable QMSS\n" );return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 52/132 soc: ti: Fix reference imbalance in knav_dma_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit b4fa73358c306d747a2200aec6f7acb97e5750e6 ]
The patch fix two reference leak.
1) pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to call put operation will result in reference leak.
2) The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced.
We fix it by: 1) adding call pm_runtime_put_noidle or pm_runtime_put_sync in error handling. 2) adding pm_runtime_disable in error handling, to keep usage counter and disable depth balanced.
--- drivers/soc/ti/knav_dma.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/soc/ti/knav_dma.c +11 -2
@@ -752,8 +752,9 @@ static int knav_dma_probe(struct platform_device *pdev)pm_runtime_enable (kdev->dev); ret =pm_runtime_get_sync (kdev->dev);if (ret <0 ) { +pm_runtime_put_noidle (kdev->dev);dev_err (kdev->dev,"unable to enable pktdma, err %d\n" , ret); -return ret; + goto err_pm_disable; }/* Initialise all packet dmas */
@@ -767,13 +768,21 @@ static int knav_dma_probe(struct platform_device *pdev)if (list_empty (&kdev->list)) {dev_err (dev,"no valid dma instance\n" ); -return -ENODEV ; + ret = -ENODEV ; + goto err_put_sync; }debugfs_create_file ("knav_dma" ,S_IFREG |S_IRUGO ,NULL ,NULL , &knav_dma_debug_ops);return ret; + +err_put_sync: +pm_runtime_put_sync (kdev->dev); +err_pm_disable: +pm_runtime_disable (kdev->dev); + +return ret; }static int knav_dma_remove (struct platform_device *pdev)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 53/132 drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
[ Upstream commit 4cba398f37f868f515ff12868418dc28574853a1 ]
Fix to return the error code from of_get_child_by_name() instaed of 0 in knav_queue_probe().
--- drivers/soc/ti/knav_qmss_queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soc/ti/knav_qmss_queue.c +2 -1
@@ -1785,9 +1785,10 @@ static int knav_queue_probe(struct platform_device *pdev)if (ret) goto err; - regions =of_get_child_by_name (node,"descriptor-regions" ); + regions =of_get_child_by_name (node,"descriptor-regions" );if (!regions) {dev_err (dev,"descriptor-regions not specified\n" ); + ret = -ENODEV ; goto err; } ret =knav_queue_setup_regions (kdev, regions);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 54/132 memstick: fix a double-free bug in memstick_check
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit e3e9ced5c93803d5b2ea1942c4bf0192622531d6 ]
kfree(host->card) has been called in put_device so that another kfree would raise cause a double-free bug.
--- drivers/memstick/core/memstick.c | 1 - 1 file changed, 1 deletion(-)
drivers/memstick/core/memstick.c +0 -1
@@ -469,7 +469,6 @@ static void memstick_check(struct work_struct *work) host->card = card;if (device_register (&card->dev)) {put_device (&card->dev); -kfree (host->card); host->card =NULL ; } }else
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 55/132 ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host
In reply to Greg Kroah-HartmanFrom: Cristian Birsan <[email protected]>
[ Upstream commit be4dd2d448816a27c1446f8f37fce375daf64148 ]
The pincontrol node is needed for USB Host since Linux v5.7-rc1. Without it the driver probes but VBus is not powered because of wrong pincontrol configuration.
--- arch/arm/boot/dts/at91-sama5d4_xplained.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/at91-sama5d4_xplained.dts +7 -0
@@ -152,6 +152,11 @@ atmel,pins = <AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; }; + pinctrl_usb_default: usb_default { + atmel,pins = + <AT91_PIOE 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE + AT91_PIOE 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; + }; pinctrl_key_gpio: key_gpio_0 { atmel,pins = <AT91_PIOE 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
@@ -177,6 +182,8 @@ &pioE 11 GPIO_ACTIVE_HIGH &pioE 14 GPIO_ACTIVE_HIGH >; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_default>; status = "okay"; };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 56/132 ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host
In reply to Greg Kroah-HartmanFrom: Cristian Birsan <[email protected]>
[ Upstream commit e1062fa7292f1e3744db0a487c4ac0109e09b03d ]
The pincontrol node is needed for USB Host since Linux v5.7-rc1. Without it the driver probes but VBus is not powered because of wrong pincontrol configuration.
--- arch/arm/boot/dts/at91-sama5d3_xplained.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/at91-sama5d3_xplained.dts +7 -0
@@ -231,6 +231,11 @@ atmel,pins = <AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */ }; + pinctrl_usb_default: usb_default { + atmel,pins = + <AT91_PIOE 3 AT91_PERIPH_GPIO AT91_PINCTRL_NONE + AT91_PIOE 4 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; + }; }; }; };
@@ -288,6 +293,8 @@ &pioE 3 GPIO_ACTIVE_LOW &pioE 4 GPIO_ACTIVE_LOW >; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_default>; status = "okay"; };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 57/132 orinoco: Move context allocation after processing the skb
In reply to Greg Kroah-HartmanFrom: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit a31eb615646a63370aa1da1053c45439c7653d83 ]
ezusb_xmit() allocates a context which is leaked if orinoco_process_xmit_skb() returns an error.
Move ezusb_alloc_ctx() after the invocation of orinoco_process_xmit_skb() because the context is not needed so early. ezusb_access_ltv() will cleanup the context in case of an error.
--- drivers/net/wireless/orinoco/orinoco_usb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/orinoco/orinoco_usb.c +7 -7
@@ -1224,13 +1224,6 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)if (skb->len <ETH_HLEN ) goto drop; - ctx =ezusb_alloc_ctx (upriv,EZUSB_RID_TX ,0 ); -if (!ctx) - goto busy; - -memset (ctx->buf,0 ,BULK_BUF_SIZE ); - buf = ctx->buf->data; - tx_control =0 ; err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control,
@@ -1238,6 +1231,13 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)if (err) goto drop; + ctx =ezusb_alloc_ctx (upriv,EZUSB_RID_TX ,0 ); +if (!ctx) + goto drop; + +memset (ctx->buf,0 ,BULK_BUF_SIZE ); + buf = ctx->buf->data; + {__le16 *tx_cntl = (__le16 *)buf; *tx_cntl =cpu_to_le16 (tx_control);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 58/132 cw1200: fix missing destroy_workqueue() on error in cw1200_init_common
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit 7ec8a926188eb8e7a3cbaca43ec44f2d7146d71b ]
Add the missing destroy_workqueue() before return from cw1200_init_common in the error handling case.
--- drivers/net/wireless/cw1200/main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/cw1200/main.c +2 -0
@@ -385,6 +385,7 @@ static struct ieee80211_hw *cw1200_init_common(const u8 *macaddr, CW1200_LINK_ID_MAX, cw1200_skb_dtor, priv)) { +destroy_workqueue (priv->workqueue);ieee80211_free_hw (hw);return NULL ; }
@@ -396,6 +397,7 @@ static struct ieee80211_hw *cw1200_init_common(const u8 *macaddr,for (; i >0 ; i--)cw1200_queue_deinit (&priv->tx_queue[i -1 ]);cw1200_queue_stats_deinit (&priv->tx_queue_stats); +destroy_workqueue (priv->workqueue);ieee80211_free_hw (hw);return NULL ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 59/132 mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit f0e82242b16826077a2775eacfe201d803bb7a22 ]
kfree(dev) has been called inside put_device so anther kfree would cause a use-after-free bug/
--- drivers/bus/mips_cdmm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/bus/mips_cdmm.c +1 -3
@@ -544,10 +544,8 @@ static void mips_cdmm_bus_discover(struct mips_cdmm_bus *bus)dev_set_name (&dev->dev,"cdmm%u-%u" , cpu, id); ++id; ret =device_register (&dev->dev); -if (ret) { +if (ret)put_device (&dev->dev); -kfree (dev); - } } }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 60/132 NFSv4.2: condition READDIRs mask for security label based on LSM state
In reply to Greg Kroah-HartmanFrom: Olga Kornievskaia <[email protected]>
[ Upstream commit 05ad917561fca39a03338cb21fe9622f998b0f9c ]
Currently, the client will always ask for security_labels if the server returns that it supports that feature regardless of any LSM modules (such as Selinux) enforcing security policy. This adds performance penalty to the READDIR operation.
Client adjusts superblock's support of the security_label based on the server's support but also current client's configuration of the LSM modules. Thus, prior to using the default bitmask in READDIR, this patch checks the server's capabilities and then instructs READDIR to remove FATTR4_WORD2_SECURITY_LABEL from the bitmask.
v5: fixing silly mistakes of the rushed v4
v4: simplifying logic
v3: changing label's initialization per Ondrej's comment
v2: dropping selinux hook and using the sb cap.
--- fs/nfs/nfs4proc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +8 -2
@@ -4047,12 +4047,12 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, u64 cookie, struct page **pages, unsigned int count, int plus) { struct inode *dir = d_inode(dentry); +struct nfs_server *server =NFS_SERVER (dir);struct nfs4_readdir_arg args = { .fh =NFS_FH (dir), .pages = pages, .pgbase =0 , .count = count, - .bitmask =NFS_SERVER (d_inode (dentry))->attr_bitmask, .plus = plus, };struct nfs4_readdir_res res;
@@ -4067,9 +4067,15 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,dprintk ("%s: dentry = %pd2, cookie = %Lu\n" , __func__, dentry, (unsigned long long )cookie); +if (!(server->caps &NFS_CAP_SECURITY_LABEL )) + args.bitmask = server->attr_bitmask_nl; +else + args.bitmask = server->attr_bitmask; +nfs4_setup_readdir (cookie,NFS_I (dir)->cookieverf, dentry, &args); res.pgbase = args.pgbase; - status =nfs4_call_sync (NFS_SERVER (dir)->client,NFS_SERVER (dir), &msg, &args.seq_args, &res.seq_res,0 ); + status =nfs4_call_sync (server->client, server, &msg, &args.seq_args, + &res.seq_res,0 );if (status >=0 ) {memcpy (NFS_I (dir)->cookieverf, res.verifier.data,NFS4_VERIFIER_SIZE ); status += args.pgbase;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 61/132 lockd: dont use interval-based rebinding over TCP
In reply to Greg Kroah-HartmanFrom: Calum Mackay <[email protected]>
[ Upstream commit 9b82d88d5976e5f2b8015d58913654856576ace5 ]
NLM uses an interval-based rebinding, i.e. it clears the transport's binding under certain conditions if more than 60 seconds have elapsed since the connection was last bound.
This rebinding is not necessary for an autobind RPC client over a connection-oriented protocol like TCP.
It can also cause problems: it is possible for nlm_bind_host() to clear XPRT_BOUND whilst a connection worker is in the middle of trying to reconnect, after it had already been checked in xprt_connect().
When the connection worker notices that XPRT_BOUND has been cleared under it, in xs_tcp_finish_connecting(), that results in:
xs_tcp_setup_socket: connect returned unhandled error -107
Worse, it's possible that the two can get into lockstep, resulting in the same behaviour repeated indefinitely, with the above error every 300 seconds, without ever recovering, and the connection never being established. This has been seen in practice, with a large number of NLM client tasks, following a server restart.
The existing callers of nlm_bind_host & nlm_rebind_host should not need to force the rebind, for TCP, so restrict the interval-based rebinding to UDP only.
For TCP, we will still rebind when needed, e.g. on timeout, and connection error (including closure), since connection-related errors on an existing connection, ECONNREFUSED when trying to connect, and rpc_check_timeout(), already unconditionally clear XPRT_BOUND.
To avoid having to add the fix, and explanation, to both nlm_bind_host() and nlm_rebind_host(), remove the duplicate code from the former, and have it call the latter.
Drop the dprintk, which adds no value over a trace.
--- fs/lockd/host.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
fs/lockd/host.c +11 -9
@@ -430,12 +430,7 @@ nlm_bind_host(struct nlm_host *host)* RPC rebind is required */ if ((clnt = host->h_rpcclnt) !=NULL ) { -if (time_after_eq (jiffies, host->h_nextrebind)) { -rpc_force_rebind (clnt); - host->h_nextrebind = jiffies +NLM_HOST_REBIND ; -dprintk ("lockd: next rebind in %lu jiffies\n" , - host->h_nextrebind - jiffies); - } +nlm_rebind_host (host); }else {unsigned long increment = nlmsvc_timeout;struct rpc_timeout timeparms = {
@@ -483,13 +478,20 @@ nlm_bind_host(struct nlm_host *host)return clnt; } -/* -* Force a portmap lookup of the remote lockd port +/** +* nlm_rebind_host - If needed, force a portmap lookup of the peer's lockd port +* @host: NLM host handle for peer +* +* This is not needed when using a connection-oriented protocol, such as TCP. +* The existing autobind mechanism is sufficient to force a rebind when +* required, e.g. on connection state transitions. */ void nlm_rebind_host (struct nlm_host *host) { -dprintk ("lockd: rebind host %s\n" , host->h_name); +if (host->h_proto !=IPPROTO_UDP ) +return ; +if (host->h_rpcclnt &&time_after_eq (jiffies, host->h_nextrebind)) {rpc_force_rebind (host->h_rpcclnt); host->h_nextrebind = jiffies +NLM_HOST_REBIND ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 62/132 NFS: switch nfsiod to be an UNBOUND workqueue.
In reply to Greg Kroah-HartmanFrom: NeilBrown <[email protected]>
[ Upstream commit bf701b765eaa82dd164d65edc5747ec7288bb5c3 ]
nfsiod is currently a concurrency-managed workqueue (CMWQ). This means that workitems scheduled to nfsiod on a given CPU are queued behind all other work items queued on any CMWQ on the same CPU. This can introduce unexpected latency.
Occaionally nfsiod can even cause excessive latency. If the work item to complete a CLOSE request calls the final iput() on an inode, the address_space of that inode will be dismantled. This takes time proportional to the number of in-memory pages, which on a large host working on large files (e.g.. 5TB), can be a large number of pages resulting in a noticable number of seconds.
We can avoid these latency problems by switching nfsiod to WQ_UNBOUND. This causes each concurrent work item to gets a dedicated thread which can be scheduled to an idle CPU.
There is precedent for this as several other filesystems use WQ_UNBOUND workqueue for handling various async events.
--- fs/nfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/inode.c +1 -1
@@ -1964,7 +1964,7 @@ static int nfsiod_start(void) {struct workqueue_struct *wq;dprintk ("RPC: creating workqueue nfsiod\n" ); - wq =alloc_workqueue ("nfsiod" ,WQ_MEM_RECLAIM ,0 ); + wq =alloc_workqueue ("nfsiod" ,WQ_MEM_RECLAIM |WQ_UNBOUND ,0 );if (wq ==NULL )return -ENOMEM ; nfsiod_workqueue = wq;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 63/132 media: saa7146: fix array overflow in vidioc_s_audio()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 8e4d86e241cf035d6d3467cd346e7ce490681937 ]
The "a->index" value comes from the user via the ioctl. The problem is that the shift can wrap resulting in setting "mxb->cur_audinput" to an invalid value, which later results in an array overflow.
--- drivers/media/pci/saa7146/mxb.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/media/pci/saa7146/mxb.c +10 -9
@@ -652,16 +652,17 @@ static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *struct mxb *mxb = (struct mxb *)dev->ext_priv;DEB_D ("VIDIOC_S_AUDIO %d\n" , a->index); -if (mxb_inputs[mxb->cur_input].audioset & (1 << a->index)) { -if (mxb->cur_audinput != a->index) { - mxb->cur_audinput = a->index; -tea6420_route (mxb, a->index); -if (mxb->cur_audinput ==0 ) -mxb_update_audmode (mxb); - } -return 0 ; +if (a->index >=32 || + !(mxb_inputs[mxb->cur_input].audioset & (1 << a->index))) +return -EINVAL ; + +if (mxb->cur_audinput != a->index) { + mxb->cur_audinput = a->index; +tea6420_route (mxb, a->index); +if (mxb->cur_audinput ==0 ) +mxb_update_audmode (mxb); } -return -EINVAL ; +return 0 ; }#ifdef CONFIG_VIDEO_ADV_DEBUG
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 64/132 pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit 89cce2b3f247a434ee174ab6803698041df98014 ]
if of_find_device_by_node() succeed, pinctrl_falcon_probe() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation.
--- drivers/pinctrl/pinctrl-falcon.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/pinctrl/pinctrl-falcon.c +9 -5
@@ -438,24 +438,28 @@ static int pinctrl_falcon_probe(struct platform_device *pdev)/* load and remap the pad resources of the different banks */ for_each_compatible_node (np,NULL ,"lantiq,pad-falcon" ) { -struct platform_device *ppdev =of_find_device_by_node (np);const __be32 *bank =of_get_property (np,"lantiq,bank" ,NULL );struct resource res; +struct platform_device *ppdev;u32 avail;int pins;if (!of_device_is_available (np))continue ; -if (!ppdev) { -dev_err (&pdev->dev,"failed to find pad pdev\n" ); -continue ; - }if (!bank || *bank >=PORTS )continue ;if (of_address_to_resource (np,0 , &res))continue ; + + ppdev =of_find_device_by_node (np); +if (!ppdev) { +dev_err (&pdev->dev,"failed to find pad pdev\n" ); +continue ; + } + falcon_info.clk[*bank] =clk_get (&ppdev->dev,NULL ); +put_device (&ppdev->dev);if (IS_ERR (falcon_info.clk[*bank])) {dev_err (&ppdev->dev,"failed to get clock\n" );return PTR_ERR (falcon_info.clk[*bank]);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 65/132 memstick: r592: Fix error return in r592_probe()
In reply to Greg Kroah-HartmanFrom: Jing Xiangfeng <[email protected]>
[ Upstream commit db29d3d1c2451e673e29c7257471e3ce9d50383a ]
Fix to return a error code from the error handling case instead of 0.
--- drivers/memstick/host/r592.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/memstick/host/r592.c +8 -4
@@ -763,8 +763,10 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto error3; dev->mmio =pci_ioremap_bar (pdev,0 ); -if (!dev->mmio) +if (!dev->mmio) { + error = -ENOMEM ; goto error4; + } dev->irq = pdev->irq;spin_lock_init (&dev->irq_lock);
@@ -791,12 +793,14 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id) &dev->dummy_dma_page_physical_address, GFP_KERNEL);r592_stop_dma (dev ,0 ); -if (request_irq (dev->irq, &r592_irq,IRQF_SHARED , -DRV_NAME , dev)) + error =request_irq (dev->irq, &r592_irq,IRQF_SHARED , +DRV_NAME , dev); +if (error) goto error6;r592_update_card_detect (dev); -if (memstick_add_host (host)) + error =memstick_add_host (host); +if (error) goto error7;message ("driver successfully loaded" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 66/132 ASoC: jz4740-i2s: add missed checks for clk_get()
In reply to Greg Kroah-HartmanFrom: Chuhong Yuan <[email protected]>
[ Upstream commit 1c1fb2653a0c2e3f310c07eacd8fc3a10e08c97a ]
jz4740_i2s_set_sysclk() does not check the return values of clk_get(), while the file dereferences the pointers in clk_put().
Add the missed checks to fix it.
--- sound/soc/jz4740/jz4740-i2s.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/jz4740/jz4740-i2s.c +4 -0
@@ -315,10 +315,14 @@ static int jz4740_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id,switch (clk_id) {case JZ4740_I2S_CLKSRC_EXT : parent =clk_get (NULL ,"ext" ); +if (IS_ERR (parent)) +return PTR_ERR (parent);clk_set_parent (i2s->clk_i2s, parent);break ;case JZ4740_I2S_CLKSRC_PLL : parent =clk_get (NULL ,"pll half" ); +if (IS_ERR (parent)) +return PTR_ERR (parent);clk_set_parent (i2s->clk_i2s, parent); ret =clk_set_rate (i2s->clk_i2s, freq);break ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 67/132 dm ioctl: fix error return code in target_message
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit 4d7659bfbe277a43399a4a2d90fca141e70f29e1 ]
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- drivers/md/dm-ioctl.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/dm-ioctl.c +1 -0
@@ -1539,6 +1539,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size)if (!argc) {DMWARN ("Empty message received." ); + r = -EINVAL ; goto out_argv; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 68/132 clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI
In reply to Greg Kroah-HartmanFrom: Keqian Zhu <[email protected]>
[ Upstream commit 8b7770b877d187bfdae1eaf587bd2b792479a31c ]
ARM virtual counter supports event stream, it can only trigger an event when the trigger bit (the value of CNTKCTL_EL1.EVNTI) of CNTVCT_EL0 changes, so the actual period of event stream is 2^(cntkctl_evnti + 1). For example, when the trigger bit is 0, then virtual counter trigger an event for every two cycles.
While we're at it, rework the way we compute the trigger bit position by making it more obvious that when bits [n:n-1] are both set (with n being the most significant bit), we pick bit (n + 1).
--- drivers/clocksource/arm_arch_timer.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/clocksource/arm_arch_timer.c +16 -7
@@ -310,15 +310,24 @@ static void arch_timer_evtstrm_enable(int divider)static void arch_timer_configure_evtstream (void ) { -int evt_stream_div, pos; +int evt_stream_div, lsb; + +/* +* As the event stream can at most be generated at half the frequency +* of the counter, use half the frequency when computing the divider. +*/ + evt_stream_div = arch_timer_rate /ARCH_TIMER_EVT_STREAM_FREQ /2 ; + +/* +* Find the closest power of two to the divisor. If the adjacent bit +* of lsb (last set bit, starts from 0) is set, then we use (lsb + 1). +*/ + lsb =fls (evt_stream_div) -1 ; +if (lsb >0 && (evt_stream_div &BIT (lsb -1 ))) + lsb++; -/* Find the closest power of two to the divisor */ - evt_stream_div = arch_timer_rate /ARCH_TIMER_EVT_STREAM_FREQ ; - pos =fls (evt_stream_div); -if (pos >1 && !(evt_stream_div & (1 << (pos -2 )))) - pos--;/* enable event stream */ -arch_timer_evtstrm_enable (min (pos,15 )); +arch_timer_evtstrm_enable (max (0 ,min (lsb,15 ))); }static void arch_counter_set_user_access (void )
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 69/132 cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 9433777a6e0aae27468d3434b75cd51bb88ff711 ]
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this cpufreq driver when it is compiled as an external module.
--- drivers/cpufreq/highbank-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/cpufreq/highbank-cpufreq.c +7 -0
@@ -104,6 +104,13 @@ out_put_node: }module_init (hb_cpufreq_driver_init); +static const struct of_device_id __maybe_unused hb_cpufreq_of_match[] = { + { .compatible ="calxeda,highbank" }, + { .compatible ="calxeda,ecx-2000" }, + { }, +}; +MODULE_DEVICE_TABLE (of, hb_cpufreq_of_match); +MODULE_AUTHOR ("Mark Langsdorf <[email protected]>" );MODULE_DESCRIPTION ("Calxeda Highbank cpufreq driver" );MODULE_LICENSE ("GPL" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 70/132 cpufreq: loongson1: Add missing MODULE_ALIAS
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit b9acab091842ca8b288882798bb809f7abf5408a ]
This patch adds missing MODULE_ALIAS for automatic loading of this cpufreq driver when it is compiled as an external module.
--- drivers/cpufreq/ls1x-cpufreq.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/ls1x-cpufreq.c +1 -0
@@ -217,6 +217,7 @@ static struct platform_driver ls1x_cpufreq_platdrv = {module_platform_driver (ls1x_cpufreq_platdrv); +MODULE_ALIAS ("platform:ls1x-cpufreq" );MODULE_AUTHOR ("Kelvin Cheung <[email protected]>" );MODULE_DESCRIPTION ("Loongson 1 CPUFreq driver" );MODULE_LICENSE ("GPL" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 71/132 cpufreq: scpi: Add missing MODULE_ALIAS
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit c0382d049d2def37b81e907a8b22661a4a4a6eb5 ]
This patch adds missing MODULE_ALIAS for automatic loading of this cpufreq driver when it is compiled as an external module.
--- drivers/cpufreq/scpi-cpufreq.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/scpi-cpufreq.c +1 -0
@@ -119,6 +119,7 @@ static struct platform_driver scpi_cpufreq_platdrv = { };module_platform_driver (scpi_cpufreq_platdrv); +MODULE_ALIAS ("platform:scpi-cpufreq" );MODULE_AUTHOR ("Sudeep Holla <[email protected]>" );MODULE_DESCRIPTION ("ARM SCPI CPUFreq interface driver" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 72/132 scsi: pm80xx: Fix error return in pm8001_pci_probe()
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 97031ccffa4f62728602bfea8439dd045cd3aeb2 ]
The driver did not return an error in the case where pm8001_configure_phy_settings() failed.
Use rc to store the return value of pm8001_configure_phy_settings().
--- drivers/scsi/pm8001/pm8001_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/pm8001/pm8001_init.c +2 -1
@@ -1063,7 +1063,8 @@ static int pm8001_pci_probe(struct pci_dev *pdev,pm8001_init_sas_add (pm8001_ha);/* phy setting support for motherboard controller */ -if (pm8001_configure_phy_settings (pm8001_ha)) + rc =pm8001_configure_phy_settings (pm8001_ha); +if (rc) goto err_out_shost;pm8001_post_sas_ha_init (shost, chip);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 73/132 seq_buf: Avoid type mismatch for seq_buf_init
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit d9a9280a0d0ae51dc1d4142138b99242b7ec8ac6 ]
Building with W=2 prints a number of warnings for one function that has a pointer type mismatch:
linux/seq_buf.h: In function 'seq_buf_init':linux/seq_buf.h:35:12: warning: pointer targets in assignment from 'unsigned char *' to 'char *' differ in signedness [-Wpointer-sign]
Change the type in the function prototype according to the type in the structure.
--- include/linux/seq_buf.h | 2 +- include/linux/trace_seq.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/seq_buf.h +1 -1
@@ -29,7 +29,7 @@ static inline void seq_buf_clear(struct seq_buf *s) }static inline void -seq_buf_init (struct seq_buf *s,unsigned char *buf,unsigned int size) +seq_buf_init (struct seq_buf *s,char *buf,unsigned int size) { s->buffer = buf; s->size = size;
include/linux/trace_seq.h +2 -2
@@ -11,7 +11,7 @@*/ struct trace_seq { -unsigned char buffer[PAGE_SIZE ]; +char buffer[PAGE_SIZE ];struct seq_buf seq;int full; };
@@ -50,7 +50,7 @@ static inline int trace_seq_used(struct trace_seq *s)* that is about to be written to and then return the result * of that write. */ -static inline unsigned char * +static inline char *trace_seq_buffer_ptr (struct trace_seq *s) {return s->buffer +seq_buf_used (&s->seq);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 74/132 scsi: fnic: Fix error return code in fnic_probe()
In reply to Greg Kroah-HartmanFrom: Zhang Changzhong <[email protected]>
[ Upstream commit d4fc94fe65578738ded138e9fce043db6bfc3241 ]
Return a negative error code from the error handling case instead of 0 as done elsewhere in this function.
--- drivers/scsi/fnic/fnic_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/fnic/fnic_main.c +1 -0
@@ -735,6 +735,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)for (i =0 ; i <FNIC_IO_LOCKS ; i++)spin_lock_init (&fnic->io_req_lock[i]); + err = -ENOMEM ; fnic->io_req_pool =mempool_create_slab_pool (2 , fnic_io_req_cache);if (!fnic->io_req_pool) goto err_out_free_resources;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 75/132 powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
In reply to Greg Kroah-HartmanFrom: Nathan Lynch <[email protected]>
[ Upstream commit 52719fce3f4c7a8ac9eaa191e8d75a697f9fbcbc ]
There are three ways pseries_suspend_begin() can be reached:
1. When "mem" is written to /sys/power/state:
kobj_attr_store()
-> state_store()
-> pm_suspend()
-> suspend_devices_and_enter()
-> pseries_suspend_begin()This never works because there is no way to supply a valid stream id using this interface, and H_VASI_STATE is called with a stream id of zero. So this call path is useless at best.
2. When a stream id is written to /sys/devices/system/power/hibernate. pseries_suspend_begin() is polled directly from store_hibernate() until the stream is in the "Suspending" state (i.e. the platform is ready for the OS to suspend execution):
dev_attr_store()
-> store_hibernate()
-> pseries_suspend_begin()
3. When a stream id is written to /sys/devices/system/power/hibernate (continued). After #2, pseries_suspend_begin() is called once again from the pm core:
dev_attr_store()
-> store_hibernate()
-> pm_suspend()
-> suspend_devices_and_enter()
-> pseries_suspend_begin()This is redundant because the VASI suspend state is already known to be Suspending.
The begin() callback of platform_suspend_ops is optional, so we can simply remove that assignment with no loss of function.
--- arch/powerpc/platforms/pseries/suspend.c | 1 - 1 file changed, 1 deletion(-)
arch/powerpc/platforms/pseries/suspend.c +0 -1
@@ -224,7 +224,6 @@ static struct bus_type suspend_subsys = {static const struct platform_suspend_ops pseries_suspend_ops = { .valid = suspend_valid_only_mem, - .begin = pseries_suspend_begin, .prepare_late = pseries_prepare_late, .enter = pseries_suspend_enter, };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 76/132 usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit d6ff32478d7e95d6ca199b5c852710d6964d5811 ]
The pm_runtime_enable will decrement the power disable depth. Imbalance depth will resulted in enabling runtime PM of device fails later. Thus a pairing decrement must be needed on the error handling path to keep it balanced.
--- drivers/usb/host/ehci-omap.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ehci-omap.c +1 -0
@@ -237,6 +237,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) err_pm_runtime:pm_runtime_put_sync (dev); +pm_runtime_disable (dev); err_phy:for (i =0 ; i < omap->nports; i++) {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 77/132 usb: oxu210hp-hcd: Fix memory leak in oxu_create
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit e5548b05631ec3e6bfdaef1cad28c799545b791b ]
usb_create_hcd will alloc memory for hcd, and we should call usb_put_hcd to free it when adding fails to prevent memory leak.
--- drivers/usb/host/oxu210hp-hcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/oxu210hp-hcd.c +3 -1
@@ -3741,8 +3741,10 @@ static struct usb_hcd *oxu_create(struct platform_device *pdev, oxu->is_otg = otg; ret =usb_add_hcd (hcd, irq,IRQF_SHARED ); -if (ret <0 ) +if (ret <0 ) { +usb_put_hcd (hcd);return ERR_PTR (ret); + }device_wakeup_enable (hcd->self.controller);return hcd;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 78/132 speakup: fix uninitialized flush_lock
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit d1b928ee1cfa965a3327bbaa59bfa005d97fa0fe ]
The flush_lock is uninitialized, use DEFINE_SPINLOCK to define and initialize flush_lock.
--- drivers/staging/speakup/speakup_dectlk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/speakup_dectlk.c +1 -1
@@ -51,7 +51,7 @@ static unsigned char get_index(void);static int in_escape;static int is_flushing; -static spinlock_t flush_lock; +static DEFINE_SPINLOCK (flush_lock);static DECLARE_WAIT_QUEUE_HEAD (flush);static struct var_t vars[] = {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 79/132 nfs_common: need lock during iterate through the list
In reply to Greg Kroah-HartmanFrom: Cheng Lin <[email protected]>
[ Upstream commit 4a9d81caf841cd2c0ae36abec9c2963bf21d0284 ]
If the elem is deleted during be iterated on it, the iteration process will fall into an endless loop.
kernel: NMI watchdog: BUG: soft lockup - CPU#4 stuck for 22s! [nfsd:17137]
PID: 17137 TASK: ffff8818d93c0000 CPU: 4 COMMAND: "nfsd" [exception RIP: __state_in_grace+76]
RIP: ffffffffc00e817c RSP: ffff8818d3aefc98 RFLAGS: 00000246 RAX: ffff881dc0c38298 RBX: ffffffff81b03580 RCX: ffff881dc02c9f50 RDX: ffff881e3fce8500 RSI: 0000000000000001 RDI: ffffffff81b03580 RBP: ffff8818d3aefca0 R8: 0000000000000020 R9: ffff8818d3aefd40 R10: ffff88017fc03800 R11: ffff8818e83933c0 R12: ffff8818d3aefd40 R13: 0000000000000000 R14: ffff8818e8391068 R15: ffff8818fa6e4000 CS: 0010 SS: 0018
#0 [ffff8818d3aefc98] opens_in_grace at ffffffffc00e81e3 [grace] #1 [ffff8818d3aefca8] nfs4_preprocess_stateid_op at ffffffffc02a3e6c [nfsd] #2 [ffff8818d3aefd18] nfsd4_write at ffffffffc028ed5b [nfsd]
#3 [ffff8818d3aefd80] nfsd4_proc_compound at ffffffffc0290a0d [nfsd] #4 [ffff8818d3aefdd0] nfsd_dispatch at ffffffffc027b800 [nfsd] #5 [ffff8818d3aefe08] svc_process_common at ffffffffc02017f3 [sunrpc] #6 [ffff8818d3aefe70] svc_process at ffffffffc0201ce3 [sunrpc] #7 [ffff8818d3aefe98] nfsd at ffffffffc027b117 [nfsd]
#8 [ffff8818d3aefec8] kthread at ffffffff810b88c1
#9 [ffff8818d3aeff50] ret_from_fork at ffffffff816d1607
The troublemake elem:
crash> lock_manager ffff881dc0c38298
struct lock_manager {
list = {
next = 0xffff881dc0c38298,
prev = 0xffff881dc0c38298
},
block_opens = false
}
--- fs/nfs_common/grace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/nfs_common/grace.c +5 -1
@@ -75,10 +75,14 @@ __state_in_grace(struct net *net, bool open)if (!open)return !list_empty (grace_list); +spin_lock (&grace_lock);list_for_each_entry (lm, grace_list, list) { -if (lm->block_opens) +if (lm->block_opens) { +spin_unlock (&grace_lock);return true; + } } +spin_unlock (&grace_lock);return false; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 80/132 x86/kprobes: Restore BTF if the single-stepping is cancelled
In reply to Greg Kroah-HartmanFrom: Masami Hiramatsu <[email protected]>
[ Upstream commit 78ff2733ff352175eb7f4418a34654346e1b6cd2 ]
Fix to restore BTF if single-stepping causes a page fault and it is cancelled.
Usually the BTF flag was restored when the single stepping is done (in resume_execution()). However, if a page fault happens on the single stepping instruction, the fault handler is invoked and the single stepping is cancelled. Thus, the BTF flag is not restored.
--- arch/x86/kernel/kprobes/core.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/kernel/kprobes/core.c +5 -0
@@ -1014,6 +1014,11 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)* So clear it by resetting the current kprobe: */ regs->flags &= ~X86_EFLAGS_TF ; +/* +* Since the single step (trap) has been cancelled, +* we need to restore BTF here. +*/ +restore_btf ();/* * If the TF flag was set before the kprobe hit,
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 81/132 extcon: max77693: Fix modalias string
In reply to Greg Kroah-HartmanFrom: Marek Szyprowski <[email protected]>
[ Upstream commit e1efdb604f5c9903a5d92ef42244009d3c04880f ]
The platform device driver name is "max77693-muic", so advertise it properly in the modalias string. This fixes automated module loading when this driver is compiled as a module.
--- drivers/extcon/extcon-max77693.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-max77693.c +1 -1
@@ -1262,4 +1262,4 @@ module_platform_driver(max77693_muic_driver);MODULE_DESCRIPTION ("Maxim MAX77693 Extcon driver" );MODULE_AUTHOR ("Chanwoo Choi <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("platform:extcon-max77693" ); +MODULE_ALIAS ("platform:max77693-muic" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 82/132 ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 85a7555575a0e48f9b73db310d0d762a08a46d63 ]
The error handling frees "ctl" but it's still on the "dsp->ctl_list" list so that could result in a use after free. Remove it from the list before returning.
--- sound/soc/codecs/wm_adsp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/codecs/wm_adsp.c +3 -2
@@ -852,7 +852,7 @@ static int wm_adsp_create_control(struct wm_adsp *dsp, ctl_work =kzalloc (sizeof (*ctl_work),GFP_KERNEL );if (!ctl_work) { ret = -ENOMEM ; - goto err_ctl_cache; + goto err_list_del; } ctl_work->dsp = dsp;
@@ -862,7 +862,8 @@ static int wm_adsp_create_control(struct wm_adsp *dsp,return 0 ; -err_ctl_cache: +err_list_del: +list_del (&ctl->list);kfree (ctl->cache); err_ctl_name:kfree (ctl->name);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 83/132 um: chan_xterm: Fix fd leak
In reply to Greg Kroah-HartmanFrom: Anton Ivanov <[email protected]>
[ Upstream commit 9431f7c199ab0d02da1482d62255e0b4621cb1b5 ]
xterm serial channel was leaking a fd used in setting up the port helper
This bug is prehistoric - it predates switching to git. The "fixes" header here is really just to mark all the versions we would like this to apply to which is "Anything from the Cretaceous period onwards".
No dinosaurs were harmed in fixing this bug.
--- arch/um/drivers/xterm.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/um/drivers/xterm.c +5 -0
@@ -18,6 +18,7 @@struct xterm_chan {int pid;int helper_pid; +int chan_fd;char *title;int device;int raw;
@@ -33,6 +34,7 @@ static void *xterm_init(char *str, int device, const struct chan_opts *opts)return NULL ; *data = ((struct xterm_chan ) { .pid =-1 , .helper_pid =-1 , + .chan_fd =-1 , .device = device, .title = opts->xterm_title, .raw = opts->raw } );
@@ -149,6 +151,7 @@ static int xterm_open(int input, int output, int primary, void *d, goto out_kill; } + data->chan_fd = fd; new =xterm_fd (fd, &data->helper_pid);if (new <0 ) { err = new;
@@ -206,6 +209,8 @@ static void xterm_close(int fd, void *d)os_kill_process (data->helper_pid,0 ); data->helper_pid =-1 ; +if (data->chan_fd !=-1 ) +os_close_file (data->chan_fd);os_close_file (fd); }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 84/132 nfc: s3fwrn5: Release the nfc firmware
In reply to Greg Kroah-HartmanFrom: Bongsu Jeon <[email protected]>
[ Upstream commit a4485baefa1efa596702ebffd5a9c760d42b14b5 ]
add the code to release the nfc firmware when the firmware image size is wrong.
--- drivers/nfc/s3fwrn5/firmware.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nfc/s3fwrn5/firmware.c +3 -1
@@ -304,8 +304,10 @@ static int s3fwrn5_fw_request_firmware(struct s3fwrn5_fw_info *fw_info)if (ret <0 )return ret; -if (fw->fw->size <S3FWRN5_FW_IMAGE_HEADER_SIZE ) +if (fw->fw->size <S3FWRN5_FW_IMAGE_HEADER_SIZE ) { +release_firmware (fw->fw);return -EINVAL ; + }memcpy (fw->date, fw->fw->data +0x00 ,12 ); fw->date[12 ] ='\0' ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 85/132 powerpc/ps3: use dma_mapping_error()
In reply to Greg Kroah-HartmanFrom: Vincent Stehlé <[email protected]>
[ Upstream commit d0edaa28a1f7830997131cbce87b6c52472825d1 ]
The DMA address returned by dma_map_single() should be checked with dma_mapping_error(). Fix the ps3stor_setup() function accordingly.
--- drivers/ps3/ps3stor_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ps3/ps3stor_lib.c +1 -1
@@ -201,7 +201,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, irq_handler_t handler) dev->bounce_lpar =ps3_mm_phys_to_lpar (__pa (dev->bounce_buf)); dev->bounce_dma =dma_map_single (&dev->sbd.core, dev->bounce_buf, dev->bounce_size,DMA_BIDIRECTIONAL ); -if (!dev->bounce_dma) { +if (dma_mapping_error (&dev->sbd.core, dev->bounce_dma)) {dev_err (&dev->sbd.core,"%s:%u: map DMA region failed\n" , __func__, __LINE__); error = -ENODEV ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 86/132 checkpatch: fix unescaped left brace
In reply to Greg Kroah-HartmanFrom: Dwaipayan Ray <[email protected]>
[ Upstream commit 03f4935135b9efeb780b970ba023c201f81cf4e6 ]
There is an unescaped left brace in a regex in OPEN_BRACE check. This throws a runtime error when checkpatch is run with --fix flag and the OPEN_BRACE check is executed.
Fix it by escaping the left brace.
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
@@ -3580,7 +3580,7 @@ sub process { $fix) { fix_delete_line($fixlinenr, $rawline); my $fixed_line = $rawline; - $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/; + $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*)\{(.*)$/; my $line1 = $1; my $line2 = $2; fix_insert_line($fixlinenr, ltrim($line1));
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 87/132 net: bcmgenet: Fix a resource leak in an error handling path in the probe functin
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 4375ada01963d1ebf733d60d1bb6e5db401e1ac6 ]
If the 'register_netdev()' call fails, we must undo a previous 'bcmgenet_mii_init()' call.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +3 -1
@@ -3518,8 +3518,10 @@ static int bcmgenet_probe(struct platform_device *pdev)clk_disable_unprepare (priv->clk); err =register_netdev (dev); -if (err) +if (err) { +bcmgenet_mii_exit (dev); goto err; + }return err;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 88/132 net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 322e53d1e2529ae9d501f5e0f20604a79b873aef ]
'irq_of_parse_and_map()' should be balanced by a corresponding 'irq_dispose_mapping()' call. Otherwise, there is some resources leaks.
Add such a call in the error handling path of the probe function and in the remove function.
--- drivers/net/ethernet/allwinner/sun4i-emac.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/allwinner/sun4i-emac.c +5 -2
@@ -853,13 +853,13 @@ static int emac_probe(struct platform_device *pdev) db->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (db->clk)) { ret =PTR_ERR (db->clk); - goto out_iounmap; + goto out_dispose_mapping; } ret =clk_prepare_enable (db->clk);if (ret) {dev_err (&pdev->dev,"Error couldn't enable clock (%d)\n" , ret); - goto out_iounmap; + goto out_dispose_mapping; } ret =sunxi_sram_claim (&pdev->dev);
@@ -916,6 +916,8 @@ out_release_sram:sunxi_sram_release (&pdev->dev); out_clk_disable_unprepare:clk_disable_unprepare (db->clk); +out_dispose_mapping: +irq_dispose_mapping (ndev->irq); out_iounmap:iounmap (db->membase); out:
@@ -934,6 +936,7 @@ static int emac_remove(struct platform_device *pdev)unregister_netdev (ndev);sunxi_sram_release (&pdev->dev);clk_disable_unprepare (db->clk); +irq_dispose_mapping (ndev->irq);iounmap (db->membase);free_netdev (ndev);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 89/132 net: korina: fix return value
In reply to Greg Kroah-HartmanFrom: Vincent Stehlé <[email protected]>
[ Upstream commit 7eb000bdbe7c7da811ef51942b356f6e819b13ba ]
The ndo_start_xmit() method must not attempt to free the skb to transmit when returning NETDEV_TX_BUSY. Therefore, make sure the korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.
--- drivers/net/ethernet/korina.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/korina.c +1 -1
@@ -216,7 +216,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)dev_kfree_skb_any (skb);spin_unlock_irqrestore (&lp->lock, flags); -return NETDEV_TX_BUSY ; +return NETDEV_TX_OK ; } }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 90/132 clk: ti: Fix memleak in ti_fapll_synth_setup
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 8c6239f6e95f583bb763d0228e02d4dd0fb3d492 ]
If clk_register fails, we should goto free branch
before function returns to prevent memleak.
--- drivers/clk/ti/fapll.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/clk/ti/fapll.c +9 -2
@@ -497,6 +497,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, {struct clk_init_data *init;struct fapll_synth *synth; +struct clk *clk =ERR_PTR (-ENOMEM ); init =kzalloc (sizeof (*init),GFP_KERNEL );if (!init)
@@ -519,13 +520,19 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, synth->hw.init = init; synth->clk_pll = pll_clk; -return clk_register (NULL , &synth->hw); + clk =clk_register (NULL , &synth->hw); +if (IS_ERR (clk)) { +pr_err ("failed to register clock\n" ); + goto free; + } + +return clk; free:kfree (synth);kfree (init); -return ERR_PTR (-ENOMEM ); +return clk; }static void __init ti_fapll_setup (struct device_node *node)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 91/132 perf record: Fix memory leak when using --user-regs=? to list registers
In reply to Greg Kroah-HartmanFrom: Zheng Zengkai <[email protected]>
[ Upstream commit 2eb5dd418034ecea2f7031e3d33f2991a878b148 ]
When using 'perf record's option '-I' or '--user-regs=' along with argument '?' to list available register names, memory of variable 'os' allocated by strdup() needs to be released before __parse_regs() returns, otherwise memory leak will occur.
--- tools/perf/util/parse-regs-options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/parse-regs-options.c +1 -1
@@ -40,7 +40,7 @@ parse_regs(const struct option *opt, const char *str, int unset) }fputc ('\n' , stderr);/* just printing available regs */ -return -1 ; + goto error; }for (r = sample_reg_masks; r->name; r++) {if (!strcasecmp (s, r->name))
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 92/132 qlcnic: Fix error code in probe
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 0d52848632a357948028eab67ff9b7cc0c12a0fb ]
Return -EINVAL if we can't find the correct device. Currently it returns success.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -0
@@ -2506,6 +2506,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)qlcnic_sriov_vf_register_map (ahw);break ;default : + err = -EINVAL ; goto err_out_free_hw_res; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 93/132 clk: s2mps11: Fix a resource leak in error handling paths in the probe function
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit d2d94fc567624f96187e8b52083795620f93e69f ]
Some resource should be released in the error handling path of the probe function, as already done in the remove function.
The remove function was fixed in commit bf416bd45738 ("clk: s2mps11: Add missing of_node_put and of_clk_del_provider")
--- drivers/clk/clk-s2mps11.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/clk-s2mps11.c +1 -0
@@ -263,6 +263,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)return ret; err_reg: +of_node_put (s2mps11_clks[0 ].clk_np);while (--i >=0 )clkdev_drop (s2mps11_clks[i].lookup);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 94/132 cfg80211: initialize rekey_data
In reply to Greg Kroah-HartmanFrom: Sara Sharon <[email protected]>
[ Upstream commit f495acd8851d7b345e5f0e521b2645b1e1f928a0 ]
In case we have old supplicant, the akm field is uninitialized.
--- net/wireless/nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/nl80211.c +1 -1
@@ -9836,7 +9836,7 @@ static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info)struct net_device *dev = info->user_ptr[1 ];struct wireless_dev *wdev = dev->ieee80211_ptr;struct nlattr *tb[NUM_NL80211_REKEY_DATA ]; -struct cfg80211_gtk_rekey_data rekey_data; +struct cfg80211_gtk_rekey_data rekey_data = {};int err;if (!info->attrs[NL80211_ATTR_REKEY_DATA ])
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 95/132 Input: cros_ec_keyb - send scancodes in addition to key events
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 80db2a087f425b63f0163bc95217abd01c637cb5 ]
To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN capability, so it is only matter of actually sending the events.
--- drivers/input/keyboard/cros_ec_keyb.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/keyboard/cros_ec_keyb.c +1 -0
@@ -137,6 +137,7 @@ static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,"changed: [r%d c%d]: byte %02x\n" , row, col, new_state); +input_event (idev,EV_MSC ,MSC_SCAN , pos);input_report_key (idev, keycodes[pos], new_state); }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 96/132 Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
In reply to Greg Kroah-HartmanFrom: Simon Beginn <[email protected]>
[ Upstream commit cffdd6d90482316e18d686060a4397902ea04bd2 ]
The touchscreen on the Teclast x98 Pro is also mounted upside-down in relation to the display orientation.
--- drivers/input/touchscreen/goodix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/input/touchscreen/goodix.c +12 -0
@@ -77,6 +77,18 @@ static const struct dmi_system_id rotated_screen[] = { DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"), }, }, + { + .ident = "Teclast X98 Pro", + .matches = { +/* +* Only match BIOS date, because the manufacturers +* BIOS does not report the board name at all +* (sometimes)... +*/ +DMI_MATCH (DMI_BOARD_VENDOR ,"TECLAST" ), + DMI_MATCH(DMI_BIOS_DATE, "10/28/2015"), + }, + }, { .ident ="WinBook TW100" , .matches = {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 97/132 media: gspca: Fix memory leak in probe
In reply to Greg Kroah-HartmanFrom: Alan Stern <[email protected]>
commit e469d0b09a19496e1972a20974bbf55b728151eb upstream.
The gspca driver leaks memory when a probe fails. gspca_dev_probe2() calls v4l2_device_register(), which takes a reference to the underlying device node (in this case, a USB interface). But the failure pathway neglects to call v4l2_device_unregister(), the routine responsible for dropping this reference. Consequently the memory for the USB interface and its device never gets released.
This patch adds the missing function call.
--- drivers/media/usb/gspca/gspca.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/usb/gspca/gspca.c +1 -0
@@ -2130,6 +2130,7 @@ out:input_unregister_device (gspca_dev->input_dev);#endif v4l2_ctrl_handler_free (gspca_dev->vdev.ctrl_handler); +v4l2_device_unregister (&gspca_dev->v4l2_dev);kfree (gspca_dev->usb_buf);kfree (gspca_dev);return ret;
Greg Kroah-Hartman
maintainerPATCH 98/132 media: sunxi-cir: ensure IR is handled when it is continuous
In reply to Greg Kroah-HartmanFrom: Sean Young <[email protected]>
commit 3f56df4c8ffeb120ed41906d3aae71799b7e726a upstream.
If a user holds a button down on a remote, then no ir idle interrupt will be generated until the user releases the button, depending on how quickly the remote repeats. No IR is processed until that point, which means that holding down a button may not do anything.
This also resolves an issue on a Cubieboard 1 where the IR receiver is picking up ambient infrared as IR and spews out endless
"rc rc0: IR event FIFO is full!" messages unless you choose to live in the dark.
--- drivers/media/rc/sunxi-cir.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/rc/sunxi-cir.c +2 -0
@@ -132,6 +132,8 @@ static irqreturn_t sunxi_ir_irq(int irqn }else if (status ®_RXINT_RPEI_EN ) {ir_raw_event_set_idle (ir->rc, true);ir_raw_event_handle (ir->rc); + }else { +ir_raw_event_handle (ir->rc); }spin_unlock (&ir->ir_lock);
Greg Kroah-Hartman
maintainerPATCH 99/132 media: netup_unidvb: Dont leak SPI master in probe error path
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit e297ddf296de35037fa97f4302782def196d350a upstream.
If the call to spi_register_master() fails on probe of the NetUP Universal DVB driver, the spi_master struct is erroneously not freed.
Likewise, if spi_new_device() fails, the spi_controller struct is not unregistered. Plug the leaks.
While at it, fix an ordering issue in netup_spi_release() wherein spi_unregister_master() is called after fiddling with the IRQ control register. The correct order is to call spi_unregister_master() *before* this teardown step because bus accesses may still be ongoing until that function returns.
--- drivers/media/pci/netup_unidvb/netup_unidvb_spi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c +3 -2
@@ -184,7 +184,7 @@ int netup_spi_init(struct netup_unidvb_dstruct spi_master *master;struct netup_spi *nspi; - master =spi_alloc_master (&ndev->pci_dev->dev, + master =devm_spi_alloc_master (&ndev->pci_dev->dev,sizeof (struct netup_spi ));if (!master) { dev_err(&ndev->pci_dev->dev,
@@ -217,6 +217,7 @@ int netup_spi_init(struct netup_unidvb_d ndev->pci_slot, ndev->pci_func);if (!spi_new_device (master, &netup_spi_board)) { +spi_unregister_master (master); ndev->spi =NULL ;dev_err (&ndev->pci_dev->dev,"%s(): unable to create SPI device\n" , __func__);
@@ -235,13 +236,13 @@ void netup_spi_release(struct netup_unidif (!spi)return ; +spi_unregister_master (spi->master);spin_lock_irqsave (&spi->lock, flags); reg =readw (&spi->regs->control_stat);writew (reg |NETUP_SPI_CTRL_IRQ , &spi->regs->control_stat); reg =readw (&spi->regs->control_stat);writew (reg & ~NETUP_SPI_CTRL_IMASK , &spi->regs->control_stat);spin_unlock_irqrestore (&spi->lock, flags); -spi_unregister_master (spi->master); ndev->spi =NULL ; }
Greg Kroah-Hartman
maintainerPATCH 100/132 Input: cyapa_gen6 - fix out-of-bounds stack access
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit f051ae4f6c732c231046945b36234e977f8467c6 upstream.
gcc -Warray-bounds warns about a serious bug incyapa_pip_retrieve_data_structure:
drivers/input/mouse/cyapa_gen6.c: In function 'cyapa_pip_retrieve_data_structure.constprop':include/linux/unaligned/access_ok.h:40:17: warning: array subscript -1 is outside array bounds of 'struct retrieve_data_struct_cmd[1]' [-Warray-bounds]
40 | *((__le16 *)p) = cpu_to_le16(val);drivers/input/mouse/cyapa_gen6.c:569:13: note: while referencing 'cmd'
569 | } __packed cmd;
| ^~~
Apparently the '-2' was added to the pointer instead of the value, writing garbage into the stack next to this variable.
--- drivers/input/mouse/cyapa_gen6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/mouse/cyapa_gen6.c +1 -1
@@ -573,7 +573,7 @@ static int cyapa_pip_retrieve_data_strucmemset (&cmd,0 ,sizeof (cmd));put_unaligned_le16 (PIP_OUTPUT_REPORT_ADDR , &cmd.head.addr); -put_unaligned_le16 (sizeof (cmd), &cmd.head.length -2 ); +put_unaligned_le16 (sizeof (cmd) -2 , &cmd.head.length); cmd.head.report_id =PIP_APP_CMD_REPORT_ID ; cmd.head.cmd_code =PIP_RETRIEVE_DATA_STRUCTURE ;put_unaligned_le16 (read_offset, &cmd.read_offset);
Greg Kroah-Hartman
maintainerPATCH 101/132 Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
In reply to Greg Kroah-HartmanFrom: Daniel Scally <[email protected]>
commit 12fc4dad94dfac25599f31257aac181c691ca96f upstream.
This reverts commit 8a66790b7850a6669129af078768a1d42076a0ef.
Switching this function to AE_CTRL_TERMINATE broke the documented behaviour of acpi_dev_get_resources() - AE_CTRL_TERMINATE does not, in fact, terminate the resource walk because acpi_walk_resource_buffer() ignores it (specifically converting it to AE_OK), referring to that value as "an OK termination by the user function". This means that acpi_dev_get_resources() does not abort processing when the preproc function returns a negative value.
--- drivers/acpi/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/resource.c +1 -1
@@ -506,7 +506,7 @@ static acpi_status acpi_dev_process_reso ret = c->preproc (ares, c->preproc_data);if (ret <0 ) { c->error = ret; -return AE_CTRL_TERMINATE ; +return AE_ABORT_METHOD ; }else if (ret >0 ) {return AE_OK ; }
Greg Kroah-Hartman
maintainerPATCH 102/132 ACPI: PNP: compare the string length in the matching_id()
In reply to Greg Kroah-HartmanFrom: Hui Wang <[email protected]>
commit b08221c40febcbda9309dd70c61cf1b0ebb0e351 upstream.
Recently we met a touchscreen problem on some Thinkpad machines, the touchscreen driver (i2c-hid) is not loaded and the touchscreen can't work.
An i2c ACPI device with the name WACF2200 is defined in the BIOS, with the current rule in matching_id(), this device will be regarded as a PNP device since there is WACFXXX in the acpi_pnp_device_ids[] and this PNP device is attached to the acpi device as the 1st physical_node, this will make the i2c bus match fail when i2c bus calls acpi_companion_match() to match the acpi_id_table in the i2c-hid driver.
WACF2200 is an i2c device instead of a PNP device, after adding the string length comparing, the matching_id() will return false when matching WACF2200 and WACFXXX, and it is reasonable to compare the string length when matching two IDs.
--- drivers/acpi/acpi_pnp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/acpi/acpi_pnp.c +3 -0
@@ -320,6 +320,9 @@ static bool matching_id(const char *idst {int i; +if (strlen (idstr) !=strlen (list_id)) +return false; +if (memcmp (idstr, list_id,3 ))return false;
Greg Kroah-Hartman
maintainerPATCH 103/132 ALSA: pcm: oss: Fix a few more UBSAN fixes
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 11cb881bf075cea41092a20236ba708b18e1dbb2 upstream.
There are a few places that call round{up|down}_pow_of_two() with the value zero, and this causes undefined behavior warnings. Avoid calling those macros if such a nonsense value is passed; it's a minor optimization as well, as we handle it as either an error or a value to be skipped, instead.
--- sound/core/oss/pcm_oss.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
sound/core/oss/pcm_oss.c +14 -8
@@ -718,6 +718,8 @@ static int snd_pcm_oss_period_size(struc oss_buffer_size =snd_pcm_plug_client_size (substream,snd_pcm_hw_param_value_max (slave_params,SNDRV_PCM_HW_PARAM_BUFFER_SIZE ,NULL )) * oss_frame_size; +if (!oss_buffer_size) +return -EINVAL ; oss_buffer_size =rounddown_pow_of_two (oss_buffer_size);if (atomic_read (&substream->mmap_count)) {if (oss_buffer_size > runtime->oss.mmap_bytes)
@@ -753,17 +755,21 @@ static int snd_pcm_oss_period_size(struc min_period_size =snd_pcm_plug_client_size (substream,snd_pcm_hw_param_value_min (slave_params,SNDRV_PCM_HW_PARAM_PERIOD_SIZE ,NULL )); - min_period_size *= oss_frame_size; - min_period_size =roundup_pow_of_two (min_period_size); -if (oss_period_size < min_period_size) - oss_period_size = min_period_size; +if (min_period_size) { + min_period_size *= oss_frame_size; + min_period_size =roundup_pow_of_two (min_period_size); +if (oss_period_size < min_period_size) + oss_period_size = min_period_size; + } max_period_size =snd_pcm_plug_client_size (substream,snd_pcm_hw_param_value_max (slave_params,SNDRV_PCM_HW_PARAM_PERIOD_SIZE ,NULL )); - max_period_size *= oss_frame_size; - max_period_size =rounddown_pow_of_two (max_period_size); -if (oss_period_size > max_period_size) - oss_period_size = max_period_size; +if (max_period_size) { + max_period_size *= oss_frame_size; + max_period_size =rounddown_pow_of_two (max_period_size); +if (oss_period_size > max_period_size) + oss_period_size = max_period_size; + } oss_periods = oss_buffer_size / oss_period_size;
Greg Kroah-Hartman
maintainerPATCH 104/132 s390/dasd: fix list corruption of pavgroup group list
In reply to Greg Kroah-HartmanFrom: Stefan Haberland <[email protected]>
commit 0ede91f83aa335da1c3ec68eb0f9e228f269f6d8 upstream.
dasd_alias_add_device() moves devices to the active_devices list in case of a scheduled LCU update regardless if they have previously been in a pavgroup or not.
Example: device A and B are in the same pavgroup.
Device A has already been in a pavgroup and the private->pavgroup pointer is set and points to a valid pavgroup. While going through dasd_add_device it is moved from the pavgroup to the active_devices list.
In parallel device B might be removed from the same pavgroup in remove_device_from_lcu() which in turn checks if the group is empty and deletes it accordingly because device A has already been removed from there.
When now device A enters remove_device_from_lcu() it is tried to remove it from the pavgroup again because the pavgroup pointer is still set and again the empty group will be cleaned up which leads to a list corruption.
Fix by setting private->pavgroup to NULL in dasd_add_device.
If the device has been the last device on the pavgroup an empty pavgroup remains but this will be cleaned up by the scheduled lcu_update which iterates over all existing pavgroups.
--- drivers/s390/block/dasd_alias.c | 1 + 1 file changed, 1 insertion(+)
drivers/s390/block/dasd_alias.c +1 -0
@@ -637,6 +637,7 @@ int dasd_alias_add_device(struct dasd_de }if (lcu->flags &UPDATE_PENDING ) {list_move (&device->alias_list, &lcu->active_devices); + private->pavgroup =NULL ;_schedule_lcu_update (lcu, device); }spin_unlock (&lcu->lock);
Greg Kroah-Hartman
maintainerPATCH 105/132 s390/dasd: fix list corruption of lcu list
In reply to Greg Kroah-HartmanFrom: Stefan Haberland <[email protected]>
commit 53a7f655834c7c335bf683f248208d4fbe4b47bc upstream.
In dasd_alias_disconnect_device_from_lcu the device is removed from any list on the LCU. Afterwards the LCU is removed from the lcu list if it does not contain devices any longer.
The lcu->lock protects the lcu from parallel updates. But to cancel all workers and wait for completion the lcu->lock has to be unlocked.
If two devices are removed in parallel and both are removed from the LCU the first device that takes the lcu->lock again will delete the LCU because it is already empty but the second device also tries to free the LCU which leads to a list corruption of the lcu list.
Fix by removing the device right before the lcu is checked without unlocking the lcu->lock in between.
--- drivers/s390/block/dasd_alias.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/block/dasd_alias.c +1 -1
@@ -258,7 +258,6 @@ void dasd_alias_disconnect_device_from_lreturn ; device->discipline->get_uid (device, &uid);spin_lock_irqsave (&lcu->lock, flags); -list_del_init (&device->alias_list);/* make sure that the workers don't use this device */ if (device == lcu->suc_data.device) {spin_unlock_irqrestore (&lcu->lock, flags);
@@ -285,6 +284,7 @@ void dasd_alias_disconnect_device_from_lspin_lock_irqsave (&aliastree.lock, flags);spin_lock (&lcu->lock); +list_del_init (&device->alias_list);if (list_empty (&lcu->grouplist) &&list_empty (&lcu->active_devices) &&list_empty (&lcu->inactive_devices)) {
Greg Kroah-Hartman
maintainerPATCH 106/132 staging: comedi: mf6x4: Fix AI end-of-conversion detection
In reply to Greg Kroah-HartmanFrom: Ian Abbott <[email protected]>
commit 56c90457ebfe9422496aac6ef3d3f0f0ea8b2ec2 upstream.
I have had reports from two different people that attempts to read the analog input channels of the MF624 board fail with an ETIMEDOUT error.
After triggering the conversion, the code calls comedi_timeout() with mf6x4_ai_eoc() as the callback function to check if the conversion is complete. The callback returns 0 if complete or -EBUSY if not yet complete. comedi_timeout() returns -ETIMEDOUT if it has not completed within a timeout period which is propagated as an error to the user application.
The existing code considers the conversion to be complete when the EOLC bit is high. However, according to the user manuals for the MF624 and MF634 boards, this test is incorrect because EOLC is an active low signal that goes high when the conversion is triggered, and goes low when the conversion is complete. Fix the problem by inverting the test of the EOLC bit state.
--- drivers/staging/comedi/drivers/mf6x4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/comedi/drivers/mf6x4.c +2 -1
@@ -121,8 +121,9 @@ static int mf6x4_ai_eoc(struct comedi_destruct mf6x4_private *devpriv = dev->private;unsigned int status; +/* EOLC goes low at end of conversion. */ status =ioread32 (devpriv->gpioc_reg); -if (status &MF6X4_GPIOC_EOLC ) +if ((status &MF6X4_GPIOC_EOLC ) ==0 )return 0 ;return -EBUSY ; }
Greg Kroah-Hartman
maintainerPATCH 107/132 powerpc/perf: Exclude kernel samples while counting events in user space.
In reply to Greg Kroah-HartmanFrom: Athira Rajeev <[email protected]>
commit aa8e21c053d72b6639ea5a7f1d3a1d0209534c94 upstream.
Perf event attritube supports exclude_kernel flag to avoid sampling/profiling in supervisor state (kernel). Based on this event attr flag, Monitor Mode Control Register bit is set to freeze on supervisor state. But sometimes (due to hardware limitation), Sampled Instruction Address Register (SIAR) locks on to kernel address even when freeze on supervisor is set. Patch here adds a check to drop those samples.
--- arch/powerpc/perf/core-book3s.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/powerpc/perf/core-book3s.c +10 -0
@@ -2021,6 +2021,16 @@ static void record_and_restart(struct peperf_event_update_userpage (event);/* +* Due to hardware limitation, sometimes SIAR could sample a kernel +* address even when freeze on supervisor state (kernel) is set in +* MMCR2. Check attr.exclude_kernel and address to drop the sample in +* these cases. +*/ +if (event->attr.exclude_kernel && record) +if (is_kernel_addr (mfspr (SPRN_SIAR ))) + record =0 ; + +/* * Finally record data if requested. */ if (record) {
Greg Kroah-Hartman
maintainerPATCH 108/132 USB: serial: mos7720: fix parallel-port state restore
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 975323ab8f116667676c30ca3502a6757bd89e8d upstream.
The parallel-port restore operations is called when a driver claims the port and is supposed to restore the provided state (e.g. saved when releasing the port).
--- drivers/usb/serial/mos7720.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/mos7720.c +2 -0
@@ -640,6 +640,8 @@ static void parport_mos7715_restore_statspin_unlock (&release_lock);return ; } + mos_parport->shadowDCR = s->u.pc.ctr; + mos_parport->shadowECR = s->u.pc.ecr;write_parport_reg_nonblock (mos_parport,MOS7720_DCR , mos_parport->shadowDCR); write_parport_reg_nonblock(mos_parport, MOS7720_ECR,
Greg Kroah-Hartman
maintainerPATCH 109/132 USB: serial: keyspan_pda: fix dropped unthrottle interrupts
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 696c541c8c6cfa05d65aa24ae2b9e720fc01766e upstream.
Commit c528fcb116e6 ("USB: serial: keyspan_pda: fix receive sanity checks") broke write-unthrottle handling by dropping well-formed unthrottle-interrupt packets which are precisely two bytes long. This could lead to blocked writers not being woken up when buffer space again becomes available.
Instead, stop unconditionally printing the third byte which is (presumably) only valid on modem-line changes.
--- drivers/usb/serial/keyspan_pda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/keyspan_pda.c +2 -2
@@ -176,11 +176,11 @@ static void keyspan_pda_rx_interrupt(strbreak ;case 1 :/* status interrupt */ -if (len <3 ) { +if (len <2 ) {dev_warn (&port->dev,"short interrupt message received\n" );break ; } -dev_dbg (&port->dev,"rx int, d1=%d, d2=%d\n" , data[1 ], data[2 ]); +dev_dbg (&port->dev,"rx int, d1=%d\n" , data[1 ]);switch (data[1 ]) {case 1 :/* modemline change */ break ;
Greg Kroah-Hartman
maintainerPATCH 110/132 USB: serial: keyspan_pda: fix write deadlock
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 7353cad7ee4deaefc16e94727e69285563e219f6 upstream.
The write() callback can be called in interrupt context (e.g. when used as a console) so interrupts must be disabled while holding the port lock to prevent a possible deadlock.
--- drivers/usb/serial/keyspan_pda.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/usb/serial/keyspan_pda.c +4 -3
@@ -447,6 +447,7 @@ static int keyspan_pda_write(struct tty_int request_unthrottle =0 ;int rc =0 ;struct keyspan_pda_private *priv; +unsigned long flags; priv =usb_get_serial_port_data (port);/* guess how much room is left in the device's ring buffer, and if we
@@ -466,13 +467,13 @@ static int keyspan_pda_write(struct tty_the TX urb is in-flight (wait until it completes) the device is full (wait until it says there is room) */ -spin_lock_bh (&port->lock); +spin_lock_irqsave (&port->lock, flags);if (!test_bit (0 , &port->write_urbs_free) || priv->tx_throttled) { -spin_unlock_bh (&port->lock); +spin_unlock_irqrestore (&port->lock, flags);return 0 ; }clear_bit (0 , &port->write_urbs_free); -spin_unlock_bh (&port->lock); +spin_unlock_irqrestore (&port->lock, flags);/* At this point the URB is in our control, nobody else can submit it again (the only sudden transition was the one from EINPROGRESS to
Greg Kroah-Hartman
maintainerPATCH 111/132 USB: serial: keyspan_pda: fix stalled writes
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit c01d2c58698f710c9e13ba3e2d296328606f74fd upstream.
Make sure to clear the write-busy flag also in case no new data was submitted due to lack of device buffer space so that writing is resumed once space again becomes available.
--- drivers/usb/serial/keyspan_pda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/keyspan_pda.c +1 -1
@@ -552,7 +552,7 @@ static int keyspan_pda_write(struct tty_ rc = count; exit: -if (rc <0 ) +if (rc <=0 )set_bit (0 , &port->write_urbs_free);return rc; }
Greg Kroah-Hartman
maintainerPATCH 112/132 USB: serial: keyspan_pda: fix write-wakeup use-after-free
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 37faf50615412947868c49aee62f68233307f4e4 upstream.
The driver's deferred write wakeup was never flushed on disconnect, something which could lead to the driver port data being freed while the wakeup work is still scheduled.
Fix this by using the usb-serial write wakeup which gets cancelled properly on disconnect.
--- drivers/usb/serial/keyspan_pda.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
drivers/usb/serial/keyspan_pda.c +3 -14
@@ -47,8 +47,7 @@struct keyspan_pda_private {int tx_room;int tx_throttled; -struct work_struct wakeup_work; -struct work_struct unthrottle_work; +struct work_struct unthrottle_work;struct usb_serial *serial;struct usb_serial_port *port; };
@@ -101,15 +100,6 @@ static const struct usb_device_id id_tab };#endif -static void keyspan_pda_wakeup_write (struct work_struct *work) -{ -struct keyspan_pda_private *priv = - container_of(work, struct keyspan_pda_private, wakeup_work); -struct usb_serial_port *port = priv->port; - -tty_port_tty_wakeup (&port->port); -} -static void keyspan_pda_request_unthrottle (struct work_struct *work) { struct keyspan_pda_private *priv =
@@ -187,7 +177,7 @@ static void keyspan_pda_rx_interrupt(strcase 2 :/* tx unthrottle interrupt */ priv->tx_throttled =0 ;/* queue up a wakeup at scheduler time */ -schedule_work (&priv->wakeup_work); +usb_serial_port_softint (port);break ;default :break ;
@@ -567,7 +557,7 @@ static void keyspan_pda_write_bulk_callb priv =usb_get_serial_port_data (port);/* queue up a wakeup at scheduler time */ -schedule_work (&priv->wakeup_work); +usb_serial_port_softint (port); }
@@ -733,7 +723,6 @@ static int keyspan_pda_port_probe(structif (!priv)return -ENOMEM ; -INIT_WORK (&priv->wakeup_work, keyspan_pda_wakeup_write);INIT_WORK (&priv->unthrottle_work, keyspan_pda_request_unthrottle); priv->serial = port->serial; priv->port = port;
Greg Kroah-Hartman
maintainerPATCH 113/132 USB: serial: keyspan_pda: fix tx-unthrottle use-after-free
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 49fbb8e37a961396a5b6c82937c70df91de45e9d upstream.
The driver's transmit-unthrottle work was never flushed on disconnect, something which could lead to the driver port data being freed while the unthrottle work is still scheduled.
Fix this by cancelling the unthrottle work when shutting down the port.
--- drivers/usb/serial/keyspan_pda.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/keyspan_pda.c +4 -0
@@ -651,8 +651,12 @@ error: }static void keyspan_pda_close (struct usb_serial_port *port) { +struct keyspan_pda_private *priv =usb_get_serial_port_data (port); +usb_kill_urb (port->write_urb);usb_kill_urb (port->interrupt_in_urb); + +cancel_work_sync (&priv->unthrottle_work); }
Greg Kroah-Hartman
maintainerPATCH 114/132 USB: serial: keyspan_pda: fix write unthrottling
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 320f9028c7873c3c7710e8e93e5c979f4c857490 upstream.
The driver did not update its view of the available device buffer space until write() was called in task context. This meant that write_room() would return 0 even after the device had sent a write-unthrottle notification, something which could lead to blocked writers not being woken up (e.g. when using OPOST).
Note that we must also request an unthrottle notification is case a write() request fills the device buffer exactly.
--- drivers/usb/serial/keyspan_pda.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
drivers/usb/serial/keyspan_pda.c +20 -9
@@ -44,6 +44,8 @@#define DRIVER_AUTHOR "Brian Warner <[email protected]>"#define DRIVER_DESC "USB Keyspan PDA Converter driver" +#define KEYSPAN_TX_THRESHOLD 16 +struct keyspan_pda_private {int tx_room;int tx_throttled;
@@ -114,7 +116,7 @@ static void keyspan_pda_request_unthrott7 ,/* request_unthrottle */ USB_TYPE_VENDOR |USB_RECIP_INTERFACE |USB_DIR_OUT , -16 ,/* value: threshold */ +KEYSPAN_TX_THRESHOLD ,0 ,/* index */ NULL , 0,
@@ -133,6 +135,8 @@ static void keyspan_pda_rx_interrupt(strint retval;int status = urb->status;struct keyspan_pda_private *priv; +unsigned long flags; + priv =usb_get_serial_port_data (port);switch (status) {
@@ -175,7 +179,10 @@ static void keyspan_pda_rx_interrupt(strcase 1 :/* modemline change */ break ;case 2 :/* tx unthrottle interrupt */ +spin_lock_irqsave (&port->lock, flags); priv->tx_throttled =0 ; + priv->tx_room =max (priv->tx_room,KEYSPAN_TX_THRESHOLD ); +spin_unlock_irqrestore (&port->lock, flags);/* queue up a wakeup at scheduler time */ usb_serial_port_softint (port);break ;
@@ -509,7 +516,8 @@ static int keyspan_pda_write(struct tty_ goto exit; } } -if (count > priv->tx_room) { + +if (count >= priv->tx_room) {/* we're about to completely fill the Tx buffer, so we'll be throttled afterwards. */ count = priv->tx_room;
@@ -564,14 +572,17 @@ static void keyspan_pda_write_bulk_callbstatic int keyspan_pda_write_room (struct tty_struct *tty) {struct usb_serial_port *port = tty->driver_data; -struct keyspan_pda_private *priv; - priv =usb_get_serial_port_data (port); -/* used by n_tty.c for processing of tabs and such. Giving it our -conservative guess is probably good enough, but needs testing by -running a console through the device. */ -return priv->tx_room; -} +struct keyspan_pda_private *priv =usb_get_serial_port_data (port); +unsigned long flags; +int room =0 ; + +spin_lock_irqsave (&port->lock, flags); +if (test_bit (0 , &port->write_urbs_free) && !priv->tx_throttled) + room = priv->tx_room; +spin_unlock_irqrestore (&port->lock, flags); +return room; +}static int keyspan_pda_chars_in_buffer (struct tty_struct *tty) {
Greg Kroah-Hartman
maintainerPATCH 115/132 btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
commoit 6f7de19ed3d4d3526ca5eca428009f97cf969c2f upstream
Commit ff3d27a048d9 ("btrfs: qgroup: Finish rescan when hit the last leaf of extent tree") added a new exit for rescan finish.
However after finishing quota rescan, we set fs_info->qgroup_rescan_progress to (u64)-1 before we exit through the original exit path.
While we missed that assignment of (u64)-1 in the new exit path.
The end result is, the quota status item doesn't have the same value. (-1 vs the last bytenr + 1)
Although it doesn't affect quota accounting, it's still better to keep the original behavior.
--- fs/btrfs/qgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/btrfs/qgroup.c +3 -1
@@ -2288,8 +2288,10 @@ out: }btrfs_put_tree_mod_seq (fs_info, &tree_mod_seq_elem); -if (done && !ret) +if (done && !ret) { ret =1 ; + fs_info->qgroup_rescan_progress.objectid = (u64)-1 ; + }return ret; }
Greg Kroah-Hartman
maintainerPATCH 116/132 btrfs: scrub: Dont use inode page cache in scrub_handle_errored_block()
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
commit 665d4953cde6d9e75c62a07ec8f4f8fd7d396ade upstream
In commit ac0b4145d662 ("btrfs: scrub: Don't use inode pages for device replace") we removed the branch of copy_nocow_pages() to avoid corruption for compressed nodatasum extents.
However above commit only solves the problem in scrub_extent(), if during scrub_pages() we failed to read some pages, sctx->no_io_error_seen will be non-zero and we go to fixup function scrub_handle_errored_block().
In scrub_handle_errored_block(), for sctx without csum (no matter if we're doing replace or scrub) we go to scrub_fixup_nodatasum() routine, which does the similar thing with copy_nocow_pages(), but does it without the extra check in copy_nocow_pages() routine.
So for test cases like btrfs/100, where we emulate read errors during replace/scrub, we could corrupt compressed extent data again.
This patch will fix it just by avoiding any "optimization" for nodatasum, just falls back to the normal fixup routine by try read from any good copy.
This also solves WARN_ON() or dead lock caused by lame backref iteration in scrub_fixup_nodatasum() routine.
The deadlock or WARN_ON() won't be triggered before commit ac0b4145d662 ("btrfs: scrub: Don't use inode pages for device replace") since copy_nocow_pages() have better locking and extra check for data extent, and it's already doing the fixup work by try to read data from any good copy, so it won't go scrub_fixup_nodatasum() anyway.
This patch disables the faulty code and will be removed completely in a followup patch.
--- fs/btrfs/scrub.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
fs/btrfs/scrub.c +9 -8
@@ -918,11 +918,6 @@ static int scrub_handle_errored_block(st have_csum = sblock_to_check->pagev[0 ]->have_csum; dev = sblock_to_check->pagev[0 ]->dev; -if (sctx->is_dev_replace && !is_metadata && !have_csum) { - sblocks_for_recheck =NULL ; - goto nodatasum_case; - } -/* * read all mirrors one after the other. This includes to * re-read the extent or metadata block that failed (that was
@@ -1035,13 +1030,19 @@ static int scrub_handle_errored_block(st goto out; } -if (!is_metadata && !have_csum) { +/* +* NOTE: Even for nodatasum case, it's still possible that it's a +* compressed data extent, thus scrub_fixup_nodatasum(), which write +* inode page cache onto disk, could cause serious data corruption. +* +* So here we could only read from disk, and hope our recovery could +* reach disk before the newer write. +*/ +if (0 && !is_metadata && !have_csum) {struct scrub_fixup_nodatasum *fixup_nodatasum;WARN_ON (sctx->is_dev_replace); -nodatasum_case: -/* * !is_metadata and !have_csum, this means that the data * might not be COW'ed, that it might be modified
Greg Kroah-Hartman
maintainerPATCH 117/132 Btrfs: fix selftests failure due to uninitialized i_mode in test inodes
In reply to Greg Kroah-HartmanFrom: Filipe Manana <[email protected]>
commit 9f7fec0ba89108b9385f1b9fb167861224912a4a upstream
Some of the self tests create a test inode, setup some extents and then do calls to btrfs_get_extent() to test that the corresponding extent maps exist and are correct. However btrfs_get_extent(), since the 5.2 merge window, now errors out when it finds a regular or prealloc extent for an inode that does not correspond to a regular file (its ->i_mode is not S_IFREG). This causes the self tests to fail sometimes, specially when KASAN, slub_debug and page poisoning are enabled:
$ modprobe btrfs modprobe: ERROR: could not insert 'btrfs': Invalid argument
$ dmesg [ 9414.691648] Btrfs loaded, crc32c=crc32c-intel, debug=on, assert=on, integrity-checker=on, ref-verify=on [ 9414.692655] BTRFS: selftest: sectorsize: 4096 nodesize: 4096 [ 9414.692658] BTRFS: selftest: running btrfs free space cache tests [ 9414.692918] BTRFS: selftest: running extent only tests [ 9414.693061] BTRFS: selftest: running bitmap only tests [ 9414.693366] BTRFS: selftest: running bitmap and extent tests [ 9414.696455] BTRFS: selftest: running space stealing from bitmap to extent tests [ 9414.697131] BTRFS: selftest: running extent buffer operation tests [ 9414.697133] BTRFS: selftest: running btrfs_split_item tests [ 9414.697564] BTRFS: selftest: running extent I/O tests [ 9414.697583] BTRFS: selftest: running find delalloc tests [ 9415.081125] BTRFS: selftest: running find_first_clear_extent_bit test [ 9415.081278] BTRFS: selftest: running extent buffer bitmap tests [ 9415.124192] BTRFS: selftest: running inode tests [ 9415.124195] BTRFS: selftest: running btrfs_get_extent tests [ 9415.127909] BTRFS: selftest: running hole first btrfs_get_extent test [ 9415.128343] BTRFS critical (device (efault)): regular/prealloc extent found for non-regular inode 256 [ 9415.131428] BTRFS: selftest: fs/btrfs/tests/inode-tests.c:904 expected a real extent, got 0
This happens because the test inodes are created without ever initializing the i_mode field of the inode, and neither VFS's new_inode() nor the btrfs callback btrfs_alloc_inode() initialize the i_mode. Initialization of the i_mode is done through the various callbacks used by the VFS to create new inodes (regular files, directories, symlinks, tmpfiles, etc), which all call btrfs_new_inode() which in turn calls inode_init_owner(), which sets the inode's i_mode. Since the tests only uses new_inode() to create the test inodes, the i_mode was never initialized.
This always happens on a VM I used with kasan, slub_debug and many other debug facilities enabled. It also happened to someone who reported this on bugzilla (on a 5.3-rc).
Fix this by setting i_mode to S_IFREG at btrfs_new_test_inode().
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204397
--- fs/btrfs/tests/btrfs-tests.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/btrfs/tests/btrfs-tests.c +7 -1
@@ -48,7 +48,13 @@ static struct file_system_type test_typestruct inode *btrfs_new_test_inode (void ) { -return new_inode (test_mnt->mnt_sb); +struct inode *inode; + + inode =new_inode (test_mnt->mnt_sb); +if (inode) +inode_init_owner (inode,NULL ,S_IFREG ); + +return inode; }int btrfs_init_test_fs (void )
Greg Kroah-Hartman
maintainerPATCH 118/132 btrfs: fix return value mixup in btrfs_get_extent
In reply to Greg Kroah-HartmanFrom: Pavel Machek <[email protected]>
commit 881a3a11c2b858fe9b69ef79ac5ee9978a266dc9 upstream
btrfs_get_extent() sets variable ret, but out: error path expect error to be in variable err so the error code is lost.
--- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/inode.c +1 -1
@@ -6923,7 +6923,7 @@ again: found_type == BTRFS_FILE_EXTENT_PREALLOC) {/* Only regular file could have regular/prealloc extent */ if (!S_ISREG (inode->i_mode)) { - ret = -EUCLEAN ; + err = -EUCLEAN ;btrfs_crit (root->fs_info,"regular/prealloc extent found for non-regular inode %llu" ,btrfs_ino (inode));
Greg Kroah-Hartman
maintainerPATCH 119/132 ext4: fix a memory leak of ext4_free_data
In reply to Greg Kroah-HartmanFrom: Chunguang Xu <[email protected]>
commit cca415537244f6102cbb09b5b90db6ae2c953bdd upstream.
When freeing metadata, we will create an ext4_free_data and insert it into the pending free list. After the current transaction is committed, the object will be freed.
ext4_mb_free_metadata() will check whether the area to be freed overlaps with the pending free list. If true, return directly. At this time, ext4_free_data is leaked. Fortunately, the probability of this problem is small, since it only occurs if the file system is corrupted such that a block is claimed by more one inode and those inodes are deleted within a single jbd2 transaction.
--- fs/ext4/mballoc.c | 1 + 1 file changed, 1 insertion(+)
fs/ext4/mballoc.c +1 -0
@@ -4646,6 +4646,7 @@ ext4_mb_free_metadata(handle_t *handle,ext4_group_first_block_no (sb, group) +EXT4_C2B (sbi, cluster), "Block already on to-be-freed list"); +kmem_cache_free (ext4_free_data_cachep, new_entry);return 0 ; } }
Greg Kroah-Hartman
maintainerPATCH 120/132 ceph: fix race in concurrent __ceph_remove_cap invocations
In reply to Greg Kroah-HartmanFrom: Luis Henriques <[email protected]>
commit e5cafce3ad0f8652d6849314d951459c2bff7233 upstream.
A NULL pointer dereference may occur in __ceph_remove_cap with some of the callbacks used in ceph_iterate_session_caps, namely trim_caps_cb and remove_session_caps_cb. Those callers hold the session->s_mutex, so they are prevented from concurrent execution, but ceph_evict_inode does not.
Since the callers of this function hold the i_ceph_lock, the fix is simply a matter of returning immediately if caps->ci is NULL.
Cc: [email protected]
URL: https://tracker.ceph.com/issues/43272
--- fs/ceph/caps.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
fs/ceph/caps.c +9 -2
@@ -920,12 +920,19 @@ void __ceph_remove_cap(struct ceph_cap * {struct ceph_mds_session *session = cap->session;struct ceph_inode_info *ci = cap->ci; -struct ceph_mds_client *mdsc = -ceph_sb_to_client (ci->vfs_inode.i_sb)->mdsc; +struct ceph_mds_client *mdsc;int removed =0 ; +/* 'ci' being NULL means the remove have already occurred */ +if (!ci) { +dout ("%s: cap inode is NULL\n" , __func__); +return ; + } +dout ("__ceph_remove_cap %p from %p\n" , cap, &ci->vfs_inode); + mdsc =ceph_inode_to_client (&ci->vfs_inode)->mdsc; +/* remove from inode's cap rbtree, and clear auth cap */ rb_erase (&cap->ci_node, &ci->i_caps);if (ci->i_auth_cap == cap)
Greg Kroah-Hartman
maintainerPATCH 121/132 jffs2: Fix GC exit abnormally
In reply to Greg Kroah-HartmanFrom: Zhe Li <[email protected]>
commit 9afc9a8a4909fece0e911e72b1060614ba2f7969 upstream.
The log of this problem is:
jffs2: Error garbage collecting node at 0x***!
jffs2: No space for garbage collection. Aborting GC thread
This is because GC believe that it do nothing, so it abort.
After going over the image of jffs2, I find a scene that can trigger this problem stably.
The scene is: there is a normal dirent node at summary-area, but abnormal at corresponding not-summary-area with error name_crc.
The reason that GC exit abnormally is because it find that abnormal dirent node to GC, but when it goes to function jffs2_add_fd_to_list, it cannot meet the condition listed below:
if ((*prev)->nhash == new->nhash && !strcmp((*prev)->name, new->name))
So no node is marked obsolete, statistical information of erase_block do not change, which cause GC exit abnormally.
The root cause of this problem is: we do not check the name_crc of the abnormal dirent node with summary is enabled.
Noticed that in function jffs2_scan_dirent_node, we use function jffs2_scan_dirty_space to deal with the dirent node with error name_crc. So this patch add a checking code in function read_direntry to ensure the correctness of dirent node. If checked failed, the dirent node will be marked obsolete so GC will pass this node and this problem will be fixed.
--- fs/jffs2/readinode.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
fs/jffs2/readinode.c +16 -0
@@ -672,6 +672,22 @@ static inline int read_direntry(struct jjffs2_free_full_dirent (fd);return -EIO ; } + +#ifdef CONFIG_JFFS2_SUMMARY +/* +* we use CONFIG_JFFS2_SUMMARY because without it, we +* have checked it while mounting +*/ + crc =crc32 (0 , fd->name, rd->nsize); +if (unlikely (crc !=je32_to_cpu (rd->name_crc))) { +JFFS2_NOTICE ("name CRC failed on dirent node at" +"%#08x: read %#08x,calculated %#08x\n" , +ref_offset (ref),je32_to_cpu (rd->node_crc), crc); +jffs2_mark_node_obsolete (c, ref); +jffs2_free_full_dirent (fd); +return 0 ; + } +#endif } fd->nhash =full_name_hash (fd->name, rd->nsize);
Greg Kroah-Hartman
maintainerPATCH 122/132 jfs: Fix array index bounds check in dbAdjTree
In reply to Greg Kroah-HartmanFrom: Dave Kleikamp <[email protected]>
commit c61b3e4839007668360ed8b87d7da96d2e59fc6c upstream.
Bounds checking tools can flag a bug in dbAdjTree() for an array index out of bounds in dmt_stree. Since dmt_stree can refer to the stree in both structures dmaptree and dmapctl, use the larger array to eliminate the false positive.
--- fs/jfs/jfs_dmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/jfs_dmap.h +1 -1
@@ -196,7 +196,7 @@ typedef union dmtree {#define dmt_leafidx t1.leafidx#define dmt_height t1.height#define dmt_budmin t1.budmin -#define dmt_stree t1.stree +#define dmt_stree t2.stree/* * on-disk aggregate disk allocation map descriptor.
Greg Kroah-Hartman
maintainerPATCH 123/132 spi: rb4xx: Dont leak SPI master in probe error path
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit a4729c3506c3eb1a6ca5c0289f4e7cafa4115065 upstream.
If the calls to devm_clk_get(), devm_spi_register_master() or clk_prepare_enable() fail on probe of the Mikrotik RB4xx SPI driver, the spi_master struct is erroneously not freed.
Fix by switching over to the new devm_spi_alloc_master() helper.
--- drivers/spi/spi-rb4xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-rb4xx.c +1 -1
@@ -148,7 +148,7 @@ static int rb4xx_spi_probe(struct platfoif (IS_ERR (spi_base))return PTR_ERR (spi_base); - master =spi_alloc_master (&pdev->dev,sizeof (*rbspi)); + master =devm_spi_alloc_master (&pdev->dev,sizeof (*rbspi));if (!master)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 124/132 mtd: parser: cmdline: Fix parsing of part-names with colons
In reply to Greg Kroah-HartmanFrom: Sven Eckelmann <[email protected]>
commit 639a82434f16a6df0ce0e7c8595976f1293940fd upstream.
Some devices (especially QCA ones) are already using hardcoded partition names with colons in it. The OpenMesh A62 for example provides following mtd relevant information via cmdline:
root=31:11 mtdparts=spi0.0:256k(0:SBL1),128k(0:MIBIB),384k(0:QSEE),64k(0:CDT),64k(0:DDRPARAMS),64k(0:APPSBLENV),512k(0:APPSBL),64k(0:ART),64k(custom),64k(0:KEYS),0x002b0000(kernel),0x00c80000(rootfs),15552k(inactive) rootfsname=rootfs rootwait
The change to split only on the last colon between mtd-id and partitions will cause newpart to see following string for the first partition:
KEYS),0x002b0000(kernel),0x00c80000(rootfs),15552k(inactive)
Such a partition list cannot be parsed and thus the device fails to boot.
Avoid this behavior by making sure that the start of the first part-name ("(") will also be the last byte the mtd-id split algorithm is using for its colon search.
--- drivers/mtd/cmdlinepart.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/mtd/cmdlinepart.c +13 -1
@@ -228,7 +228,7 @@ static int mtdpart_setup_real(char *s)struct cmdline_mtd_partition *this_mtd;struct mtd_partition *parts;int mtd_id_len, num_parts; -char *p, *mtd_id, *semicol; +char *p, *mtd_id, *semicol, *open_parenth;/* * Replace the first ';' by a NULL char so strrchr can work
@@ -238,6 +238,14 @@ static int mtdpart_setup_real(char *s)if (semicol) *semicol ='\0' ; +/* +* make sure that part-names with ":" will not be handled as +* part of the mtd-id with an ":" +*/ + open_parenth =strchr (s,'(' ); +if (open_parenth) + *open_parenth ='\0' ; + mtd_id = s;/*
@@ -247,6 +255,10 @@ static int mtdpart_setup_real(char *s)*/ p =strrchr (s,':' ); +/* Restore the '(' now. */ +if (open_parenth) + *open_parenth ='(' ; +/* Restore the ';' now. */ if (semicol) *semicol =';' ;
Greg Kroah-Hartman
maintainerPATCH 125/132 iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
commit 560c6b914c6ec7d9d9a69fddbb5bf3bf71433e8b upstream.
Fix the missing clk_disable_unprepare() of info->pclk before return from rockchip_saradc_resume in the error handling case when fails to prepare and enable info->clk.
--- drivers/iio/adc/rockchip_saradc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/rockchip_saradc.c +1 -1
@@ -359,7 +359,7 @@ static int rockchip_saradc_resume(struct ret =clk_prepare_enable (info->clk);if (ret) -return ret; +clk_disable_unprepare (info->pclk);return ret; }
Greg Kroah-Hartman
maintainerPATCH 126/132 iio:pressure:mpl3115: Force alignment of buffer
In reply to Greg Kroah-HartmanFrom: Jonathan Cameron <[email protected]>
commit 198cf32f0503d2ad60d320b95ef6fb8243db857f upstream.
Whilst this is another case of the issue Lars reported with an array of elements of smaller than 8 bytes being passed to iio_push_to_buffers_with_timestamp(), the solution here is a bit different from the other cases and relies on __aligned working on the stack (true since 4.6?)
This one is unusual. We have to do an explicit memset() each time as we are reading 3 bytes into a potential 4 byte channel which may sometimes be a 2 byte channel depending on what is enabled. As such, moving the buffer to the heap in the iio_priv structure doesn't save us much. We can't use a nice explicit structure on the stack either as the data channels have different storage sizes and are all separately controlled.
--- drivers/iio/pressure/mpl3115.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/iio/pressure/mpl3115.c +8 -1
@@ -139,7 +139,14 @@ static irqreturn_t mpl3115_trigger_handlstruct iio_poll_func *pf = p;struct iio_dev *indio_dev = pf->indio_dev;struct mpl3115_data *data =iio_priv (indio_dev); -u8 buffer[16 ];/* 32-bit channel + 16-bit channel + padding + ts */ +/* +* 32-bit channel + 16-bit channel + padding + ts +* Note that it is possible for only one of the first 2 +* channels to be enabled. If that happens, the first element +* of the buffer may be either 16 or 32-bits. As such we cannot +* use a simple structure definition to express this data layout. +*/ +u8 buffer[16 ]__aligned(8) ;int ret, pos =0 ;mutex_lock (&data->lock);
Greg Kroah-Hartman
maintainerPATCH 127/132 xen/xenbus: Allow watches discard events before queueing
In reply to Greg Kroah-HartmanFrom: SeongJae Park <[email protected]>
commit fed1755b118147721f2c87b37b9d66e62c39b668 upstream.
If handling logics of watch events are slower than the events enqueue logic and the events can be created from the guests, the guests could trigger memory pressure by intensively inducing the events, because it will create a huge number of pending events that exhausting the memory.
Fortunately, some watch events could be ignored, depending on its handler callback. For example, if the callback has interest in only one single path, the watch wouldn't want multiple pending events. Or, some watches could ignore events to same path.
To let such watches to volutarily help avoiding the memory pressure situation, this commit introduces new watch callback, 'will_handle'. If it is not NULL, it will be called for each new event just before enqueuing it. Then, if the callback returns false, the event will be discarded. No watch is using the callback for now, though.
This is part of XSA-349
--- drivers/net/xen-netback/xenbus.c | 2 ++ drivers/xen/xenbus/xenbus_client.c | 1 + drivers/xen/xenbus/xenbus_xs.c | 7 ++++++- include/xen/xenbus.h | 7 +++++++ 4 files changed, 16 insertions(+), 1 deletion(-)
drivers/net/xen-netback/xenbus.c +2 -0
@@ -697,12 +697,14 @@ static int xen_register_watchers(structreturn -ENOMEM ;snprintf (node, maxlen,"%s/rate" , dev->nodename); vif->credit_watch.node = node; + vif->credit_watch.will_handle =NULL ; vif->credit_watch.callback = xen_net_rate_changed; err =register_xenbus_watch (&vif->credit_watch);if (err) {pr_err ("Failed to set watcher %s\n" , vif->credit_watch.node);kfree (node); vif->credit_watch.node =NULL ; + vif->credit_watch.will_handle =NULL ; vif->credit_watch.callback =NULL ; }return err;
drivers/xen/xenbus/xenbus_client.c +1 -0
@@ -120,6 +120,7 @@ int xenbus_watch_path(struct xenbus_deviint err; watch->node = path; + watch->will_handle =NULL ; watch->callback = callback; err =register_xenbus_watch (watch);
drivers/xen/xenbus/xenbus_xs.c +6 -1
@@ -903,7 +903,12 @@ static int process_msg(void)spin_lock (&watches_lock); msg->u.watch.handle =find_watch ( msg->u.watch.vec[XS_WATCH_TOKEN ]); -if (msg->u.watch.handle !=NULL ) { +if (msg->u.watch.handle !=NULL && + (!msg->u.watch.handle->will_handle || + msg->u.watch.handle->will_handle ( + msg->u.watch.handle, + (const char **)msg->u.watch.vec, + msg->u.watch.vec_size))) {spin_lock (&watch_events_lock);list_add_tail (&msg->list, &watch_events);wake_up (&watch_events_waitq);
include/xen/xenbus.h +7 -0
@@ -58,6 +58,13 @@ struct xenbus_watch/* Path being watched. */ const char *node; +/* +* Called just before enqueing new event while a spinlock is held. +* The event will be discarded if this callback returns false. +*/ +bool (*will_handle)(struct xenbus_watch *, +const char **vec,unsigned int len); +/* Callback (executed in a process context with no locks held). */ void (*callback)(struct xenbus_watch *,const char **vec,unsigned int len);
Greg Kroah-Hartman
maintainerPATCH 128/132 xen/xenbus: Add will_handle callback support in xenbus_watch_path()
In reply to Greg Kroah-HartmanFrom: SeongJae Park <[email protected]>
commit 2e85d32b1c865bec703ce0c962221a5e955c52c2 upstream.
Some code does not directly make 'xenbus_watch' object and call 'register_xenbus_watch()' but use 'xenbus_watch_path()' instead. This commit adds support of 'will_handle' callback in the 'xenbus_watch_path()' and it's wrapper, 'xenbus_watch_pathfmt()'.
This is part of XSA-349
--- drivers/block/xen-blkback/xenbus.c | 3 ++- drivers/net/xen-netback/xenbus.c | 2 +- drivers/xen/xen-pciback/xenbus.c | 2 +- drivers/xen/xenbus/xenbus_client.c | 9 +++++++-- drivers/xen/xenbus/xenbus_probe.c | 2 +- include/xen/xenbus.h | 6 +++++- 6 files changed, 17 insertions(+), 7 deletions(-)
drivers/block/xen-blkback/xenbus.c +2 -1
@@ -553,7 +553,8 @@ static int xen_blkbk_probe(struct xenbus/* setup back pointer */ be->blkif->be = be; - err =xenbus_watch_pathfmt (dev, &be->backend_watch, backend_changed, + err =xenbus_watch_pathfmt (dev, &be->backend_watch,NULL , + backend_changed,"%s/%s" , dev->nodename,"physical-device" );if (err) goto fail;
drivers/net/xen-netback/xenbus.c +1 -1
@@ -849,7 +849,7 @@ static void connect(struct backend_infoxenvif_carrier_on (be->vif);unregister_hotplug_status_watch (be); - err =xenbus_watch_pathfmt (dev, &be->hotplug_status_watch, + err =xenbus_watch_pathfmt (dev, &be->hotplug_status_watch,NULL , hotplug_status_changed,"%s/%s" , dev->nodename,"hotplug-status" );if (!err)
drivers/xen/xen-pciback/xenbus.c +1 -1
@@ -691,7 +691,7 @@ static int xen_pcibk_xenbus_probe(struct/* watch the backend node for backend configuration information */ err =xenbus_watch_path (dev, dev->nodename, &pdev->be_watch, - xen_pcibk_be_watch); +NULL , xen_pcibk_be_watch);if (err) goto out;
drivers/xen/xenbus/xenbus_client.c +7 -2
@@ -114,19 +114,22 @@ EXPORT_SYMBOL_GPL(xenbus_strstate);*/ int xenbus_watch_path (struct xenbus_device *dev,const char *path,struct xenbus_watch *watch, +bool (*will_handle)(struct xenbus_watch *, +const char **,unsigned int ),void (*callback)(struct xenbus_watch *,const char **,unsigned int )) {int err; watch->node = path; - watch->will_handle =NULL ; + watch->will_handle = will_handle; watch->callback = callback; err =register_xenbus_watch (watch);if (err) { watch->node =NULL ; + watch->will_handle =NULL ; watch->callback =NULL ;xenbus_dev_fatal (dev, err,"adding watch on %s" , path); }
@@ -153,6 +156,8 @@ EXPORT_SYMBOL_GPL(xenbus_watch_path);*/ int xenbus_watch_pathfmt (struct xenbus_device *dev,struct xenbus_watch *watch, +bool (*will_handle)(struct xenbus_watch *, +const char **,unsigned int ),void (*callback)(struct xenbus_watch *,const char **,unsigned int ),const char *pathfmt, ...)
@@ -169,7 +174,7 @@ int xenbus_watch_pathfmt(struct xenbus_dxenbus_dev_fatal (dev, -ENOMEM ,"allocating path for watch" );return -ENOMEM ; } - err =xenbus_watch_path (dev, path, watch, callback); + err =xenbus_watch_path (dev, path, watch, will_handle, callback);if (err)kfree (path);
drivers/xen/xenbus/xenbus_probe.c +1 -1
@@ -137,7 +137,7 @@ static int watch_otherend(struct xenbus_ container_of(dev->dev.bus, struct xen_bus_type, bus);return xenbus_watch_pathfmt (dev, &dev->otherend_watch, - bus->otherend_changed, +NULL , bus->otherend_changed,"%s/%s" , dev->otherend,"state" ); }
include/xen/xenbus.h +5 -1
@@ -201,10 +201,14 @@ void xenbus_suspend_cancel(void);int xenbus_watch_path (struct xenbus_device *dev,const char *path,struct xenbus_watch *watch, +bool (*will_handle)(struct xenbus_watch *, +const char **,unsigned int ),void (*callback)(struct xenbus_watch *,const char **,unsigned int )); -__printf(4, 5) +__printf(5, 6)int xenbus_watch_pathfmt (struct xenbus_device *dev,struct xenbus_watch *watch, +bool (*will_handle)(struct xenbus_watch *, +const char **,unsigned int ),void (*callback)(struct xenbus_watch *,const char **,unsigned int ),const char *pathfmt, ...);
Greg Kroah-Hartman
maintainerPATCH 129/132 xen/xenbus/xen_bus_type: Support will_handle watch callback
In reply to Greg Kroah-HartmanFrom: SeongJae Park <[email protected]>
commit be987200fbaceaef340872841d4f7af2c5ee8dc3 upstream.
This commit adds support of the 'will_handle' watch callback for 'xen_bus_type' users.
This is part of XSA-349
--- drivers/xen/xenbus/xenbus_probe.c | 3 ++- drivers/xen/xenbus/xenbus_probe.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/xen/xenbus/xenbus_probe.c +2 -1
@@ -137,7 +137,8 @@ static int watch_otherend(struct xenbus_ container_of(dev->dev.bus, struct xen_bus_type, bus);return xenbus_watch_pathfmt (dev, &dev->otherend_watch, -NULL , bus->otherend_changed, + bus->otherend_will_handle, + bus->otherend_changed,"%s/%s" , dev->otherend,"state" ); }
drivers/xen/xenbus/xenbus_probe.h +2 -0
@@ -42,6 +42,8 @@ struct xen_bus_type {int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE ],const char *nodename);int (*probe)(struct xen_bus_type *bus,const char *type,const char *dir); +bool (*otherend_will_handle)(struct xenbus_watch *watch, +const char **vec,unsigned int len);void (*otherend_changed)(struct xenbus_watch *watch,const char **vec,unsigned int len);struct bus_type bus;
Greg Kroah-Hartman
maintainerPATCH 130/132 xen/xenbus: Count pending messages for each watch
In reply to Greg Kroah-HartmanFrom: SeongJae Park <[email protected]>
commit 3dc86ca6b4c8cfcba9da7996189d1b5a358a94fc upstream.
This commit adds a counter of pending messages for each watch in the struct. It is used to skip unnecessary pending messages lookup in 'unregister_xenbus_watch()'. It could also be used in 'will_handle' callback.
This is part of XSA-349
--- drivers/xen/xenbus/xenbus_xs.c | 31 +++++++++++++++++++------------ include/xen/xenbus.h | 2 ++ 2 files changed, 21 insertions(+), 12 deletions(-)
drivers/xen/xenbus/xenbus_xs.c +19 -12
@@ -701,6 +701,8 @@ int register_xenbus_watch(struct xenbus_sprintf (token,"%lX" , (long )watch); + watch->nr_pending =0 ; +down_read (&xs_state.watch_mutex);spin_lock (&watches_lock);
@@ -750,12 +752,15 @@ void unregister_xenbus_watch(struct xenb/* Cancel pending watch events. */ spin_lock (&watch_events_lock); -list_for_each_entry_safe (msg, tmp, &watch_events, list) { -if (msg->u.watch.handle != watch) -continue ; -list_del (&msg->list); -kfree (msg->u.watch.vec); -kfree (msg); +if (watch->nr_pending) { +list_for_each_entry_safe (msg, tmp, &watch_events, list) { +if (msg->u.watch.handle != watch) +continue ; +list_del (&msg->list); +kfree (msg->u.watch.vec); +kfree (msg); + } + watch->nr_pending =0 ; }spin_unlock (&watch_events_lock);
@@ -802,7 +807,6 @@ void xs_suspend_cancel(void)static int xenwatch_thread (void *unused) { -struct list_head *ent;struct xs_stored_msg *msg;for (;;) {
@@ -815,13 +819,15 @@ static int xenwatch_thread(void *unused)mutex_lock (&xenwatch_mutex);spin_lock (&watch_events_lock); - ent = watch_events.next; -if (ent != &watch_events) -list_del (ent); + msg =list_first_entry_or_null (&watch_events, + struct xs_stored_msg, list); +if (msg) { +list_del (&msg->list); + msg->u.watch.handle->nr_pending--; + }spin_unlock (&watch_events_lock); -if (ent != &watch_events) { - msg = list_entry(ent, struct xs_stored_msg, list); +if (msg) { msg->u.watch.handle->callback( msg->u.watch.handle, (const char **)msg->u.watch.vec,
@@ -911,6 +917,7 @@ static int process_msg(void) msg->u.watch.vec_size))) { spin_lock(&watch_events_lock); list_add_tail(&msg->list, &watch_events); + msg->u.watch.handle->nr_pending++; wake_up(&watch_events_waitq); spin_unlock(&watch_events_lock); } else {
include/xen/xenbus.h +2 -0
@@ -58,6 +58,8 @@ struct xenbus_watch/* Path being watched. */ const char *node; +unsigned int nr_pending; +/* * Called just before enqueing new event while a spinlock is held. * The event will be discarded if this callback returns false.
Greg Kroah-Hartman
maintainerPATCH 131/132 xenbus/xenbus_backend: Disallow pending watch messages
In reply to Greg Kroah-HartmanFrom: SeongJae Park <[email protected]>
commit 9996bd494794a2fe393e97e7a982388c6249aa76 upstream.
'xenbus_backend' watches 'state' of devices, which is writable by guests. Hence, if guests intensively updates it, dom0 will have lots of pending events that exhausting memory of dom0. In other words, guests can trigger dom0 memory pressure. This is known as XSA-349. However, the watch callback of it, 'frontend_changed()', reads only 'state', so doesn't need to have the pending events.
To avoid the problem, this commit disallows pending watch messages for 'xenbus_backend' using the 'will_handle()' watch callback.
This is part of XSA-349
--- drivers/xen/xenbus/xenbus_probe_backend.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/xen/xenbus/xenbus_probe_backend.c +7 -0
@@ -181,6 +181,12 @@ static int xenbus_probe_backend(struct xreturn err; } +static bool frontend_will_handle (struct xenbus_watch *watch, +const char **vec,unsigned int len) +{ +return watch->nr_pending ==0 ; +} +static void frontend_changed (struct xenbus_watch *watch,const char **vec,unsigned int len) {
@@ -192,6 +198,7 @@ static struct xen_bus_type xenbus_backen .levels = 3, /* backend/type/<frontend>/<id> */ .get_bus_id = backend_bus_id, .probe = xenbus_probe_backend, + .otherend_will_handle = frontend_will_handle, .otherend_changed = frontend_changed, .bus = { .name = "xen-backend",
Greg Kroah-Hartman
maintainerPATCH 132/132 PCI: Fix pci_slot_release() NULL pointer dereference
In reply to Greg Kroah-HartmanFrom: Jubin Zhong <[email protected]>
commit 4684709bf81a2d98152ed6b610e3d5c403f9bced upstream.
If kobject_init_and_add() fails, pci_slot_release() is called to delete slot->list from parent->slots. But slot->list hasn't been initialized yet, so we dereference a NULL pointer:
Unable to handle kernel NULL pointer dereference at virtual address 00000000 ... CPU: 10 PID: 1 Comm: swapper/0 Not tainted 4.4.240 #197 task: ffffeb398a45ef10 task.stack: ffffeb398a470000 PC is at __list_del_entry_valid+0x5c/0xb0 LR is at pci_slot_release+0x84/0xe4 ... __list_del_entry_valid+0x5c/0xb0 pci_slot_release+0x84/0xe4 kobject_put+0x184/0x1c4 pci_create_slot+0x17c/0x1b4 __pci_hp_initialize+0x68/0xa4 pciehp_probe+0x1a4/0x2fc pcie_port_probe_service+0x58/0x84 driver_probe_device+0x320/0x470
Initialize slot->list before calling kobject_init_and_add() to avoid this.
--- drivers/pci/slot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/slot.c +3 -3
@@ -307,6 +307,9 @@ placeholder: goto err; } +INIT_LIST_HEAD (&slot->list); +list_add (&slot->list, &parent->slots); + err =kobject_init_and_add (&slot->kobj, &pci_slot_ktype,NULL ,"%s" , slot_name);if (err) {
@@ -314,9 +317,6 @@ placeholder: goto err; } -INIT_LIST_HEAD (&slot->list); -list_add (&slot->list, &parent->slots); -down_read (&pci_bus_sem);list_for_each_entry (dev, &parent->devices, bus_list)if (PCI_SLOT (dev->devfn) == slot_nr)
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.249 release. There are 132 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 30 Dec 2020 12:48:23 +0000. Anything received after that time might be too late.
Build results:
total: 165 pass: 165 fail: 0 Qemu test results: total: 328 pass: 328 fail: 0
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.249 release. There are 132 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 30 Dec 2020 12:48:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.249-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
All tests passing for Tegra ...
Test results for stable-v4.4:
6 builds: 6 pass, 0 fail
12 boots: 12 pass, 0 fail
25 tests: 25 pass, 0 failLinux version: 4.4.249-rc1-g45f5fd21658c
Boards tested: tegra124-jetson-tk1, tegra20-ventana,
tegra30-cardhu-a04
Jon
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.249 release. There are 132 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 30 Dec 2020 12:48:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.249-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
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 4.4.249-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: 45f5fd21658c73f302ca6e7a05952b9354835354
git describe: v4.4.248-133-g45f5fd21658c
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-4.4.y/build/v4.4.248-133-g45f5fd21658c
No regressions (compared to build v4.4.248)
No fixes (compared to build v4.4.248)
Ran 22873 total tests in the following environments and test suites.
Environments
--------------
- arm
- arm64
- i386
- juno-r2 - arm64
- mips
- qemu-arm64-kasan
- qemu-x86_64-kasan
- qemu_arm
- qemu_arm64
- qemu_arm64-compat
- qemu_i386
- qemu_x86_64
- qemu_x86_64-compat
- sparc
- x15 - arm
- x86_64
- x86-kasan
Test Suites
-----------
* build
* linux-log-parser
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* perf
* v4l2-compliance
* install-android-platform-tools-r2600
* fwts
Summary
------------------------------------------------------------------------
kernel: 4.4.249-rc1
git repo: https://git.linaro.org/lkft/arm64-stable-rc.git
git branch: 4.4.249-rc1-hikey-20201228-883
git commit: 8260d75b2737884615cf923d8a1708725a92738e
git describe: 4.4.249-rc1-hikey-20201228-883
Test details: https://qa-reports.linaro.org/lkft/linaro-hikey-stable-rc-4.4-oe/build/4.4.249-rc1-hikey-20201228-883
No regressions (compared to build 4.4.249-rc1-hikey-20201223-880)
No fixes (compared to build 4.4.249-rc1-hikey-20201223-880)
Ran 1698 total tests in the following environments and test suites.
Environments
--------------
- hi6220-hikey - arm64
Test Suites
-----------
* build
* install-android-platform-tools-r2600
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-cpuhotplug-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* perf
* spectre-meltdown-checker-test
* v4l2-compliance
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Hi!
Quoted 7 lines
This is the start of the stable review cycle for the 4.4.249 release. There are 132 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 30 Dec 2020 12:48:23 +0000. Anything received after that time might be too late.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-4.4.y
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany