* [PATCH 4.14 000/217] 4.14.247-rc1 review
@ 2021-09-20 16:40 Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 001/217] ext4: fix race writing to an inline_data file while its xattrs are changing Greg Kroah-Hartman
` (218 more replies)
0 siblings, 219 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, stable
This is the start of the stable review cycle for the 4.14.247 release.
There are 217 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, 22 Sep 2021 16:38:49 +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.14.247-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.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 4.14.247-rc1
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
net: renesas: sh_eth: Fix freeing wrong tx descriptor
Dinghao Liu <dinghao.liu@zju.edu.cn>
qlcnic: Remove redundant unlock in qlcnic_pinit_from_rom
Benjamin Hesmans <benjamin.hesmans@tessares.net>
netfilter: socket: icmp6: fix use-after-scope
Rafał Miłecki <rafal@milecki.pl>
net: dsa: b53: Fix calculating number of switch ports
Randy Dunlap <rdunlap@infradead.org>
ARC: export clear_user_page() for modules
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
mtd: rawnand: cafe: Fix a resource leak in the error handling path of 'cafe_nand_probe()'
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
PCI: Sync __pci_register_driver() stub for CONFIG_PCI=n
Yang Li <yang.lee@linux.alibaba.com>
ethtool: Fix an error code in cxgb2.c
Daniele Palmas <dnlplm@gmail.com>
net: usb: cdc_mbim: avoid altsetting toggling for Telit LN920
George Cherian <george.cherian@marvell.com>
PCI: Add ACS quirks for Cavium multi-function devices
Marc Zyngier <maz@kernel.org>
mfd: Don't use irq_create_mapping() to resolve a mapping
Miquel Raynal <miquel.raynal@bootlin.com>
dt-bindings: mtd: gpmc: Fix the ECC bytes vs. OOB bytes equation
David Hildenbrand <david@redhat.com>
mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range()
Sukadev Bhattiprolu <sukadev@linux.ibm.com>
ibmvnic: check failover_pending in login response
zhenggy <zhenggy@chinatelecom.cn>
tcp: fix tp->undo_retrans accounting in tcp_sacktag_one()
Eric Dumazet <edumazet@google.com>
net/af_unix: fix a data-race in unix_dgram_poll
Baptiste Lepers <baptiste.lepers@gmail.com>
events: Reuse value read using READ_ONCE instead of re-reading it
Hoang Le <hoang.h.le@dektech.com.au>
tipc: increase timeout in tipc_sk_enqueue()
Florian Fainelli <f.fainelli@gmail.com>
r6040: Restore MDIO clock frequency after MAC reset
Xiyu Yang <xiyuyang19@fudan.edu.cn>
net/l2tp: Fix reference count leak in l2tp_udp_recv_core
Lin, Zhenpeng <zplin@psu.edu>
dccp: don't duplicate ccid when cloning dccp sock
Randy Dunlap <rdunlap@infradead.org>
ptp: dp83640: don't define PAGE0
Eric Dumazet <edumazet@google.com>
net-caif: avoid user-triggerable WARN_ON(1)
Mike Rapoport <rppt@linux.ibm.com>
x86/mm: Fix kern_addr_valid() to cope with existing but not present entries
Juergen Gross <jgross@suse.com>
PM: base: power: don't try to use non-existing RTC for storing data
Adrian Bunk <bunk@kernel.org>
bnx2x: Fix enabling network interfaces without VFs
Juergen Gross <jgross@suse.com>
xen: reset legacy rtc flag for PV domU
Patryk Duda <pdk@semihalf.com>
platform/chrome: cros_ec_proto: Send command again when timeout occurs
Vasily Averin <vvs@virtuozzo.com>
memcg: enable accounting for pids in nested pid namespaces
Liu Zixian <liuzixian4@huawei.com>
mm/hugetlb: initialize hugetlb_usage in mm_init
Pratik R. Sampat <psampat@linux.ibm.com>
cpufreq: powernv: Fix init_chip_info initialization in numa=off
Saurav Kashyap <skashyap@marvell.com>
scsi: qla2xxx: Sync queue idx with queue_pair_map idx
Maciej W. Rozycki <macro@orcam.me.uk>
scsi: BusLogic: Fix missing pr_cont() use
Mikulas Patocka <mpatocka@redhat.com>
parisc: fix crash with signals and alloca
Yang Yingliang <yangyingliang@huawei.com>
net: w5100: check return value after calling platform_get_resource()
王贇 <yun.wang@linux.alibaba.com>
net: fix NULL pointer reference in cipso_v4_doi_free
Miaoqing Pan <miaoqing@codeaurora.org>
ath9k: fix sleeping in atomic context
Zekun Shen <bruceshenzk@gmail.com>
ath9k: fix OOB read ar9300_eeprom_restore_internal
Colin Ian King <colin.king@canonical.com>
parport: remove non-zero check on count
Xiaotan Luo <lxt@rock-chips.com>
ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B
Sugar Zhang <sugar.zhang@rock-chips.com>
ASoC: rockchip: i2s: Fix regmap_ops hang
Shuah Khan <skhan@linuxfoundation.org>
usbip:vhci_hcd USB port can get stuck in the disabled state
Anirudh Rayabharam <mail@anirudhrb.com>
usbip: give back URBs for unsent unlink requests during cleanup
Nadezda Lutovinova <lutovinova@ispras.ru>
usb: musb: musb_dsps: request_irq() after initializing musb
Mathias Nyman <mathias.nyman@linux.intel.com>
Revert "USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set"
Ding Hui <dinghui@sangfor.com.cn>
cifs: fix wrong release in sess_alloc_buffer() failed path
Li Zhijian <lizhijian@cn.fujitsu.com>
selftests/bpf: Enlarge select() timeout for test_maps
Thomas Hebb <tommyhebb@gmail.com>
mmc: rtsx_pci: Fix long reads when clock is prescaled
Manish Narani <manish.narani@xilinx.com>
mmc: sdhci-of-arasan: Check return value of non-void funtions
Bob Peterson <rpeterso@redhat.com>
gfs2: Don't call dlm after protocol is unmounted
Kees Cook <keescook@chromium.org>
staging: rts5208: Fix get_ms_information() heap buffer size
J. Bruce Fields <bfields@redhat.com>
rpc: fix gss_svc_init cleanup on failure
Andreas Obergschwandtner <andreas.obergschwandtner@gmail.com>
ARM: tegra: tamonten: Fix UART pad setting
Tuo Li <islituo@gmail.com>
gpu: drm: amd: amdgpu: amdgpu_i2c: fix possible uninitialized-variable access in amdgpu_i2c_router_select_ddc_port()
Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Bluetooth: avoid circular locks in sco_sock_connect
Nathan Chancellor <nathan@kernel.org>
net: ethernet: stmmac: Do not use unreachable() in ipq806x_gmac_probe()
Vinod Koul <vkoul@kernel.org>
arm64: dts: qcom: sdm660: use reg value for memory node
Hans Verkuil <hverkuil-cisco@xs4all.nl>
media: v4l2-dv-timings.c: fix wrong condition in two for-loops
Hans de Goede <hdegoede@redhat.com>
ASoC: Intel: bytcr_rt5640: Move "Platform Clock" routes to the maps for the matching in-/output
Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Bluetooth: skip invalid hci_sync_conn_complete_evt
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init()
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
staging: ks7010: Fix the initialization of the 'sleep_status' structure
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
serial: 8250_pci: make setup_port() parameters explicitly unsigned
Jiri Slaby <jslaby@suse.cz>
hvsi: don't panic on tty_register_driver failure
Jiri Slaby <jslaby@suse.cz>
xtensa: ISS: don't panic in rs_init
Maciej W. Rozycki <macro@orcam.me.uk>
serial: 8250: Define RX trigger levels for OxSemi 950 devices
Heiko Carstens <hca@linux.ibm.com>
s390/jump_label: print real address in a case of a jump label bug
Gustavo A. R. Silva <gustavoars@kernel.org>
flow_dissector: Fix out-of-bounds warnings
Gustavo A. R. Silva <gustavoars@kernel.org>
ipv4: ip_output.c: Fix out-of-bounds warning in ip_copy_addrs()
Zheyu Ma <zheyuma97@gmail.com>
video: fbdev: riva: Error out if 'pixclock' equals zero
Zheyu Ma <zheyuma97@gmail.com>
video: fbdev: kyro: Error out if 'pixclock' equals zero
Zheyu Ma <zheyuma97@gmail.com>
video: fbdev: asiliantfb: Error out if 'pixclock' equals zero
Johan Almbladh <johan.almbladh@anyfinetworks.com>
bpf/tests: Do not PASS tests without actually testing the result
Johan Almbladh <johan.almbladh@anyfinetworks.com>
bpf/tests: Fix copy-and-paste error in double word test
Zheyu Ma <zheyuma97@gmail.com>
tty: serial: jsm: hold port lock when reporting modem line changes
Geert Uytterhoeven <geert+renesas@glider.be>
staging: board: Fix uninitialized spinlock when attaching genpd
Jack Pham <jackp@codeaurora.org>
usb: gadget: composite: Allow bMaxPower=0 if self-powered
Maciej Żenczykowski <maze@google.com>
usb: gadget: u_ether: fix a potential null pointer dereference
Kelly Devilliv <kelly.devilliv@gmail.com>
usb: host: fotg210: fix the actual_length of an iso packet
Kelly Devilliv <kelly.devilliv@gmail.com>
usb: host: fotg210: fix the endpoint's transactional opportunities calculation
Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Smack: Fix wrong semantics in smk_access_entry()
Yajun Deng <yajun.deng@linux.dev>
netlink: Deal with ESRCH error in nlmsg_notify()
Zheyu Ma <zheyuma97@gmail.com>
video: fbdev: kyro: fix a DoS bug by restricting user input
David Heidelberg <david@ixit.cz>
ARM: dts: qcom: apq8064: correct clock names
Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: dac: ad5624r: Fix incorrect handling of an optional regulator.
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
PCI: Use pci_update_current_state() in pci_enable_device_flags()
Sean Anderson <sean.anderson@seco.com>
crypto: mxs-dcp - Use sg_mapping_iter to copy data
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
media: dib8000: rewrite the init prbs logic
Oleksij Rempel <o.rempel@pengutronix.de>
MIPS: Malta: fix alignment of the devicetree buffer
Dan Carpenter <dan.carpenter@oracle.com>
scsi: qedi: Fix error codes in qedi_alloc_global_queues()
Zhen Lei <thunder.leizhen@huawei.com>
pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry()
Randy Dunlap <rdunlap@infradead.org>
openrisc: don't printk() unconditionally
Jason Gunthorpe <jgg@nvidia.com>
vfio: Use config not menuconfig for VFIO_NOIOMMU
Jaehyoung Choi <jkkkkk.choi@samsung.com>
pinctrl: samsung: Fix pinctrl bank pin count
Leon Romanovsky <leonro@nvidia.com>
docs: Fix infiniband uverbs minor number
Leon Romanovsky <leonro@nvidia.com>
RDMA/iwcm: Release resources if iw_cm module initialization fails
Dmitry Torokhov <dmitry.torokhov@gmail.com>
HID: input: do not report stylus battery state as "full"
Pali Rohár <pali@kernel.org>
PCI: aardvark: Fix masking and unmasking legacy INTx interrupts
Pali Rohár <pali@kernel.org>
PCI: aardvark: Increase polling delay to 1.5s while waiting for PIO response
Hyun Kwon <hyun.kwon@xilinx.com>
PCI: xilinx-nwl: Enable the clock through CCF
Krzysztof Wilczyński <kw@linux.com>
PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure
Marek Behún <kabel@kernel.org>
PCI: Restrict ASMedia ASM1062 SATA Max Payload Size Supported
David Heidelberg <david@ixit.cz>
ARM: 9105/1: atags_to_fdt: don't warn about stack size
Hans de Goede <hdegoede@redhat.com>
libata: add ATA_HORKAGE_NO_NCQ_TRIM for Samsung 860 and 870 SSDs
Sean Young <sean@mess.org>
media: rc-loopback: return number of emitters rather than error
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
media: uvc: don't do DMA on stack
Wang Hai <wanghai38@huawei.com>
VMCI: fix NULL pointer dereference when unmapping queue pair
Arne Welzel <arne.welzel@corelight.com>
dm crypt: Avoid percpu_counter spinlock contention in crypt_page_alloc()
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
power: supply: max17042: handle fails of reading status register
Damien Le Moal <damien.lemoal@wdc.com>
block: bfq: fix bfq_set_next_ioprio_data()
zhenwei pi <pizhenwei@bytedance.com>
crypto: public_key: fix overflow during implicit conversion
Iwona Winiarska <iwona.winiarska@intel.com>
soc: aspeed: lpc-ctrl: Fix boundary check for mmap
Harshvardhan Jha <harshvardhan.jha@oracle.com>
9p/xen: Fix end of loop tests for list_for_each_entry
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
include/linux/list.h: add a macro to test if entry is pointing to the head
Juergen Gross <jgross@suse.com>
xen: fix setting of max_pfn in shared_info
Kajol Jain <kjain@linux.ibm.com>
powerpc/perf/hv-gpci: Fix counter value parsing
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
PCI/MSI: Skip masking MSI-X on Xen PV
Niklas Cassel <niklas.cassel@wdc.com>
blk-zoned: allow BLKREPORTZONE without CAP_SYS_ADMIN
Niklas Cassel <niklas.cassel@wdc.com>
blk-zoned: allow zone management send operations without CAP_SYS_ADMIN
Dmitry Osipenko <digetx@gmail.com>
rtc: tps65910: Correct driver module alias
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
fbmem: don't allow too huge resolutions
Linus Walleij <linus.walleij@linaro.org>
clk: kirkwood: Fix a clocking boot regression
Daniel Thompson <daniel.thompson@linaro.org>
backlight: pwm_bl: Improve bootloader/kernel device handover
Austin Kim <austin.kim@lge.com>
IMA: remove -Wmissing-prototypes warning
Zelin Deng <zelin.deng@linux.alibaba.com>
KVM: x86: Update vCPU's hv_clock before back to guest when tsc_offset is adjusted
Babu Moger <babu.moger@amd.com>
x86/resctrl: Fix a maybe-uninitialized build warning treated as error
Nguyen Dinh Phi <phind.uet@gmail.com>
tty: Fix data race between tiocsti() and flush_to_ldisc()
Guillaume Nault <gnault@redhat.com>
netns: protect netns ID lookups with RCU
Stefan Wahren <stefan.wahren@i2se.com>
net: qualcomm: fix QCA7000 checksum handling
Xiyu Yang <xiyuyang19@fudan.edu.cn>
net: sched: Fix qdisc_rate_table refcount leak when get tcf_block failed
Eric Dumazet <edumazet@google.com>
ipv4: make exception cache less predictible
Zenghui Yu <yuzenghui@huawei.com>
bcma: Fix memory leak for internally-handled cores
Dan Carpenter <dan.carpenter@oracle.com>
ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point()
Andy Duan <fugang.duan@nxp.com>
tty: serial: fsl_lpuart: fix the wrong mapbase value
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
usb: bdc: Fix an error handling path in 'bdc_probe()' when no suitable DMA config is available
Evgeny Novikov <novikov@ispras.ru>
usb: ehci-orion: Handle errors of clk_prepare_enable() in probe
Sergey Shtylyov <s.shtylyov@omp.ru>
i2c: mt65xx: fix IRQ check
Len Baker <len.baker@gmx.com>
CIFS: Fix a potencially linear read overflow
Tony Lindgren <tony@atomide.com>
mmc: moxart: Fix issue with uninitialized dma_slave_config
Tony Lindgren <tony@atomide.com>
mmc: dw_mmc: Fix issue with uninitialized dma_slave_config
Sergey Shtylyov <s.shtylyov@omp.ru>
i2c: s3c2410: fix IRQ check
Sergey Shtylyov <s.shtylyov@omp.ru>
i2c: iop3xx: fix deferred probing
Pavel Skripkin <paskripkin@gmail.com>
Bluetooth: add timeout sanity check to hci_inquiry
Nadezda Lutovinova <lutovinova@ispras.ru>
usb: gadget: mv_u3d: request_irq() after initializing UDC
Chih-Kang Chang <gary.chang@realtek.com>
mac80211: Fix insufficient headroom issue for AMSDU
Sergey Shtylyov <s.shtylyov@omp.ru>
usb: phy: tahvo: add IRQ check
Sergey Shtylyov <s.shtylyov@omp.ru>
usb: host: ohci-tmio: add IRQ check
Kai-Heng Feng <kai.heng.feng@canonical.com>
Bluetooth: Move shutdown callback before flushing tx and rx queue
Sergey Shtylyov <s.shtylyov@omp.ru>
usb: phy: twl6030: add IRQ checks
Sergey Shtylyov <s.shtylyov@omp.ru>
usb: phy: fsl-usb: add IRQ check
Sergey Shtylyov <s.shtylyov@omp.ru>
usb: gadget: udc: at91: add IRQ check
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
drm/msm/dsi: Fix some reference counted resource leaks
Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Bluetooth: fix repeated calls to sco_sock_kill
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
arm64: dts: exynos: correct GIC CPU interfaces address range on Exynos7
Colin Ian King <colin.king@canonical.com>
Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow
Stephan Gerhold <stephan@gerhold.net>
soc: qcom: smsm: Fix missed interrupts if state changes while masked
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
PCI: PM: Enable PME if it can be signaled from D3cold
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently
Dongliang Mu <mudongliangabcd@gmail.com>
media: em28xx-input: fix refcount bug in em28xx_usb_disconnect
Sergey Shtylyov <s.shtylyov@omp.ru>
i2c: highlander: add IRQ check
Pavel Skripkin <paskripkin@gmail.com>
net: cipso: fix warnings in netlbl_cipsov4_add_std
Martin KaFai Lau <kafai@fb.com>
tcp: seq_file: Avoid skipping sk during tcp_seek_last_pos
Dan Carpenter <dan.carpenter@oracle.com>
Bluetooth: sco: prevent information leak in sco_conn_defer_accept()
Pavel Skripkin <paskripkin@gmail.com>
media: go7007: remove redundant initialization
Dongliang Mu <mudongliangabcd@gmail.com>
media: dvb-usb: fix uninit-value in vp702x_read_mac_addr
Dongliang Mu <mudongliangabcd@gmail.com>
media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init
Geert Uytterhoeven <geert+renesas@glider.be>
soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally
Stefan Berger <stefanb@linux.ibm.com>
certs: Trigger creation of RSA module signing key if it's not an RSA key
Giovanni Cabiddu <giovanni.cabiddu@intel.com>
crypto: qat - use proper type for vf_mask
Phong Hoang <phong.hoang.wz@renesas.com>
clocksource/drivers/sh_cmt: Fix wrong setting if don't request IRQ for clock source channel
Tony Lindgren <tony@atomide.com>
spi: spi-pic32: Fix issue with uninitialized dma_slave_config
Tony Lindgren <tony@atomide.com>
spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config
Pavel Skripkin <paskripkin@gmail.com>
m68k: emu: Fix invalid free in nfeth_cleanup()
Stian Skjelstad <stian.skjelstad@gmail.com>
udf_get_extendedattr() had no boundary checks.
Giovanni Cabiddu <giovanni.cabiddu@intel.com>
crypto: qat - do not export adf_iov_putmsg()
Marco Chiappero <marco.chiappero@intel.com>
crypto: qat - fix naming for init/shutdown VF to PF notifications
Marco Chiappero <marco.chiappero@intel.com>
crypto: qat - fix reuse of completion variable
Giovanni Cabiddu <giovanni.cabiddu@intel.com>
crypto: qat - handle both source of interrupt in VF ISR
Giovanni Cabiddu <giovanni.cabiddu@intel.com>
crypto: qat - do not ignore errors from enable_vf2pf_comms()
Damien Le Moal <damien.lemoal@wdc.com>
libata: fix ata_host_start()
Vineeth Vijayan <vneethv@linux.ibm.com>
s390/cio: add dev_busid sysfs entry for each subchannel
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
power: supply: max17042_battery: fix typo in MAx17042_TOFF
Ruozhu Li <liruozhu@huawei.com>
nvme-rdma: don't update queue count when failing to set io queues
Pali Rohár <pali@kernel.org>
isofs: joliet: Fix iocharset=utf8 mount option
Jan Kara <jack@suse.cz>
udf: Check LVID earlier
Tony Lindgren <tony@atomide.com>
crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop()
Hans de Goede <hdegoede@redhat.com>
power: supply: axp288_fuel_gauge: Report register-address on readb / writeb errors
Sean Anderson <sean.anderson@seco.com>
crypto: mxs-dcp - Check for DMA mapping errors
Jeongtae Park <jeongtae.park@gmail.com>
regmap: fix the offset of register error log
Marek Behún <kabel@kernel.org>
PCI: Call Max Payload Size-related fixup quirks early
Paul Gortmaker <paul.gortmaker@windriver.com>
x86/reboot: Limit Dell Optiplex 990 quirk to early BIOS versions
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
usb: host: xhci-rcar: Don't reload firmware after the completion
Qu Wenruo <wqu@suse.com>
Revert "btrfs: compression: don't try to compress if we don't have enough pages"
Muchun Song <songmuchun@bytedance.com>
mm/page_alloc: speed up the iteration of max_order
Esben Haabendal <esben@geanix.com>
net: ll_temac: Remove left-over debug message
Fangrui Song <maskray@google.com>
powerpc/boot: Delete unneeded .globl _zimage_start
Michael Ellerman <mpe@ellerman.id.au>
powerpc/module64: Fix comment in R_PPC64_ENTRY handling
Christophe Leroy <christophe.leroy@c-s.fr>
crypto: talitos - reduce max key size for SEC1
Andrew Morton <akpm@linux-foundation.org>
mm/kmemleak.c: make cond_resched() rate-limiting more efficient
Vasily Gorbik <gor@linux.vnet.ibm.com>
s390/disassembler: correct disassembly lines alignment
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)
Christian Lamparter <chunkeey@gmail.com>
ath10k: fix recent bandwidth conversion bug
Chao Yu <yuchao0@huawei.com>
f2fs: fix potential overflow
Tom Rix <trix@redhat.com>
USB: serial: mos7720: improve OOM-handling in read_mos_reg()
Liu Jian <liujian56@huawei.com>
igmp: Add ip_mc_list lock in ip_check_mc_rcu
Pavel Skripkin <paskripkin@gmail.com>
media: stkwebcam: fix memory leak in stk_camera_probe
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
clk: fix build warning for orphan_list
Zubin Mithra <zsm@chromium.org>
ALSA: pcm: fix divide error in snd_pcm_lib_ioctl
Ben Dooks <ben-linux@fluff.org>
ARM: 8918/2: only build return_address() if needed
Christoph Hellwig <hch@lst.de>
cryptoloop: add a deprecation warning
Kim Phillips <kim.phillips@amd.com>
perf/x86/amd/ibs: Work around erratum #1197
Xiaoyao Li <xiaoyao.li@intel.com>
perf/x86/intel/pt: Fix mask of num_address_ranges
Shai Malin <smalin@marvell.com>
qede: Fix memset corruption
Harini Katakam <harini.katakam@xilinx.com>
net: macb: Add a NULL check on desc_ptp
Shai Malin <smalin@marvell.com>
qed: Fix the VF msix vectors flow
Randy Dunlap <rdunlap@infradead.org>
xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG
Theodore Ts'o <tytso@mit.edu>
ext4: fix race writing to an inline_data file while its xattrs are changing
-------------
Diffstat:
Documentation/admin-guide/devices.txt | 6 +-
.../devicetree/bindings/mtd/gpmc-nand.txt | 2 +-
Makefile | 4 +-
arch/arc/mm/cache.c | 2 +-
arch/arm/boot/compressed/Makefile | 2 +
arch/arm/boot/dts/qcom-apq8064.dtsi | 6 +-
arch/arm/boot/dts/tegra20-tamonten.dtsi | 14 ++--
arch/arm/kernel/Makefile | 6 +-
arch/arm/kernel/return_address.c | 4 --
arch/arm64/boot/dts/exynos/exynos7.dtsi | 2 +-
arch/arm64/boot/dts/qcom/ipq8074-hk01.dts | 2 +-
arch/m68k/emu/nfeth.c | 4 +-
arch/mips/mti-malta/malta-dtshim.c | 2 +-
arch/openrisc/kernel/entry.S | 2 +
arch/parisc/kernel/signal.c | 6 ++
arch/powerpc/boot/crt0.S | 3 -
arch/powerpc/kernel/module_64.c | 2 +-
arch/powerpc/perf/hv-gpci.c | 2 +-
arch/s390/kernel/dis.c | 2 +-
arch/s390/kernel/jump_label.c | 2 +-
arch/x86/events/amd/ibs.c | 8 +++
arch/x86/events/intel/pt.c | 2 +-
arch/x86/kernel/cpu/intel_rdt_monitor.c | 6 ++
arch/x86/kernel/reboot.c | 3 +-
arch/x86/kvm/x86.c | 4 ++
arch/x86/mm/init_64.c | 6 +-
arch/x86/xen/enlighten_pv.c | 7 ++
arch/x86/xen/p2m.c | 4 +-
arch/xtensa/Kconfig | 2 +-
arch/xtensa/platforms/iss/console.c | 17 ++++-
block/bfq-iosched.c | 2 +-
block/blk-zoned.c | 6 --
certs/Makefile | 8 +++
drivers/ata/libata-core.c | 6 +-
drivers/ata/sata_dwc_460ex.c | 12 ++--
drivers/base/power/trace.c | 10 +++
drivers/base/regmap/regmap.c | 2 +-
drivers/bcma/main.c | 6 +-
drivers/block/Kconfig | 4 +-
drivers/block/cryptoloop.c | 2 +
drivers/clk/clk.c | 10 +--
drivers/clk/mvebu/kirkwood.c | 1 +
drivers/clocksource/sh_cmt.c | 30 ++++----
drivers/cpufreq/powernv-cpufreq.c | 16 ++++-
drivers/crypto/mxs-dcp.c | 81 ++++++++++++----------
drivers/crypto/omap-sham.c | 2 +-
.../crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c | 4 +-
drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c | 4 +-
drivers/crypto/qat/qat_common/adf_common_drv.h | 8 +--
drivers/crypto/qat/qat_common/adf_init.c | 5 +-
drivers/crypto/qat/qat_common/adf_isr.c | 7 +-
drivers/crypto/qat/qat_common/adf_pf2vf_msg.c | 3 +-
drivers/crypto/qat/qat_common/adf_vf2pf_msg.c | 12 ++--
drivers/crypto/qat/qat_common/adf_vf_isr.c | 7 +-
.../qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c | 4 +-
drivers/crypto/talitos.c | 4 ++
drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +-
drivers/gpu/drm/msm/dsi/dsi.c | 6 +-
drivers/hid/hid-input.c | 2 -
drivers/i2c/busses/i2c-highlander.c | 2 +-
drivers/i2c/busses/i2c-iop3xx.c | 6 +-
drivers/i2c/busses/i2c-mt65xx.c | 2 +-
drivers/i2c/busses/i2c-s3c2410.c | 2 +-
drivers/iio/dac/ad5624r_spi.c | 18 ++++-
drivers/infiniband/core/iwcm.c | 19 +++--
drivers/md/dm-crypt.c | 7 +-
drivers/media/dvb-frontends/dib8000.c | 58 +++++++++++-----
drivers/media/rc/rc-loopback.c | 2 +-
drivers/media/usb/dvb-usb/nova-t-usb2.c | 6 +-
drivers/media/usb/dvb-usb/vp702x.c | 12 +++-
drivers/media/usb/em28xx/em28xx-input.c | 1 -
drivers/media/usb/go7007/go7007-driver.c | 26 -------
drivers/media/usb/stkwebcam/stk-webcam.c | 6 +-
drivers/media/usb/uvc/uvc_v4l2.c | 34 ++++++---
drivers/media/v4l2-core/v4l2-dv-timings.c | 4 +-
drivers/mfd/ab8500-core.c | 2 +-
drivers/mfd/stmpe.c | 4 +-
drivers/mfd/tc3589x.c | 2 +-
drivers/mfd/wm8994-irq.c | 2 +-
drivers/misc/aspeed-lpc-ctrl.c | 2 +-
drivers/misc/vmw_vmci/vmci_queue_pair.c | 6 +-
drivers/mmc/host/dw_mmc.c | 1 +
drivers/mmc/host/moxart-mmc.c | 1 +
drivers/mmc/host/rtsx_pci_sdmmc.c | 36 ++++++----
drivers/mmc/host/sdhci-of-arasan.c | 18 ++++-
drivers/mtd/nand/cafe_nand.c | 4 +-
drivers/net/dsa/b53/b53_common.c | 3 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 2 +-
drivers/net/ethernet/cadence/macb_ptp.c | 11 ++-
drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 1 +
drivers/net/ethernet/ibm/ibmvnic.c | 8 +++
drivers/net/ethernet/qlogic/qed/qed_main.c | 7 +-
drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 1 -
drivers/net/ethernet/qualcomm/qca_spi.c | 2 +-
drivers/net/ethernet/qualcomm/qca_uart.c | 2 +-
drivers/net/ethernet/rdc/r6040.c | 9 ++-
drivers/net/ethernet/renesas/sh_eth.c | 1 +
.../net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 18 +++--
drivers/net/ethernet/wiznet/w5100.c | 2 +
drivers/net/ethernet/xilinx/ll_temac_main.c | 4 +-
drivers/net/phy/dp83640_reg.h | 2 +-
drivers/net/usb/cdc_mbim.c | 5 ++
drivers/net/wireless/ath/ath10k/htt_rx.c | 42 ++++++-----
drivers/net/wireless/ath/ath6kl/wmi.c | 4 +-
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 3 +-
drivers/net/wireless/ath/ath9k/hw.c | 12 ++--
drivers/nvme/host/rdma.c | 4 +-
drivers/parport/ieee1284_ops.c | 2 +-
drivers/pci/host/pci-aardvark.c | 11 ++-
drivers/pci/host/pcie-xilinx-nwl.c | 12 ++++
drivers/pci/msi.c | 3 +
drivers/pci/pci.c | 31 +++++----
drivers/pci/quirks.c | 17 +++--
drivers/pci/syscall.c | 4 +-
drivers/pinctrl/pinctrl-single.c | 1 +
drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +-
drivers/platform/chrome/cros_ec_proto.c | 9 +++
drivers/power/supply/axp288_fuel_gauge.c | 4 +-
drivers/power/supply/max17042_battery.c | 8 ++-
drivers/rtc/rtc-tps65910.c | 2 +-
drivers/s390/cio/css.c | 17 +++++
drivers/scsi/BusLogic.c | 4 +-
drivers/scsi/qedi/qedi_main.c | 14 ++--
drivers/scsi/qla2xxx/qla_nvme.c | 5 +-
drivers/soc/qcom/smsm.c | 11 ++-
drivers/soc/rockchip/Kconfig | 4 +-
drivers/spi/spi-fsl-dspi.c | 1 +
drivers/spi/spi-pic32.c | 1 +
drivers/staging/board/board.c | 7 +-
drivers/staging/ks7010/ks7010_sdio.c | 2 +-
drivers/staging/rts5208/rtsx_scsi.c | 10 +--
drivers/tty/hvc/hvsi.c | 19 ++++-
drivers/tty/serial/8250/8250_pci.c | 2 +-
drivers/tty/serial/8250/8250_port.c | 3 +-
drivers/tty/serial/fsl_lpuart.c | 2 +-
drivers/tty/serial/jsm/jsm_neo.c | 2 +
drivers/tty/serial/jsm/jsm_tty.c | 3 +
drivers/tty/tty_io.c | 4 +-
drivers/usb/gadget/composite.c | 8 ++-
drivers/usb/gadget/function/u_ether.c | 5 +-
drivers/usb/gadget/udc/at91_udc.c | 4 +-
drivers/usb/gadget/udc/bdc/bdc_core.c | 3 +-
drivers/usb/gadget/udc/mv_u3d_core.c | 19 ++---
drivers/usb/host/ehci-orion.c | 8 ++-
drivers/usb/host/fotg210-hcd.c | 41 +++++------
drivers/usb/host/fotg210.h | 5 --
drivers/usb/host/ohci-tmio.c | 3 +
drivers/usb/host/xhci-rcar.c | 7 ++
drivers/usb/host/xhci.c | 24 +++----
drivers/usb/musb/musb_dsps.c | 13 ++--
drivers/usb/phy/phy-fsl-usb.c | 2 +
drivers/usb/phy/phy-tahvo.c | 4 +-
drivers/usb/phy/phy-twl6030-usb.c | 5 ++
drivers/usb/serial/mos7720.c | 4 +-
drivers/usb/usbip/vhci_hcd.c | 32 ++++++++-
drivers/vfio/Kconfig | 2 +-
drivers/video/backlight/pwm_bl.c | 54 ++++++++-------
drivers/video/fbdev/asiliantfb.c | 3 +
drivers/video/fbdev/core/fbmem.c | 7 ++
drivers/video/fbdev/kyro/fbdev.c | 8 +++
drivers/video/fbdev/riva/fbdev.c | 3 +
fs/btrfs/inode.c | 2 +-
fs/cifs/cifs_unicode.c | 9 +--
fs/cifs/sess.c | 2 +-
fs/ext4/inline.c | 6 ++
fs/f2fs/segment.c | 11 +--
fs/gfs2/lock_dlm.c | 5 ++
fs/isofs/inode.c | 27 ++++----
fs/isofs/isofs.h | 1 -
fs/isofs/joliet.c | 4 +-
fs/udf/misc.c | 13 +++-
fs/udf/super.c | 25 ++++---
include/crypto/public_key.h | 4 +-
include/linux/hugetlb.h | 9 +++
include/linux/list.h | 29 +++++---
include/linux/memory_hotplug.h | 4 +-
include/linux/pci.h | 5 +-
include/linux/power/max17042_battery.h | 2 +-
include/linux/skbuff.h | 2 +-
include/uapi/linux/serial_reg.h | 1 +
kernel/events/core.c | 2 +-
kernel/fork.c | 1 +
kernel/pid_namespace.c | 2 +-
lib/test_bpf.c | 13 +++-
mm/kmemleak.c | 2 +-
mm/memory_hotplug.c | 4 +-
mm/page_alloc.c | 8 +--
net/9p/trans_xen.c | 4 +-
net/bluetooth/cmtp/cmtp.h | 2 +-
net/bluetooth/hci_core.c | 14 ++++
net/bluetooth/hci_event.c | 15 ++++
net/bluetooth/sco.c | 50 ++++++-------
net/caif/chnl_net.c | 19 +----
net/core/flow_dissector.c | 12 ++--
net/core/net_namespace.c | 18 ++---
net/dccp/minisocks.c | 2 +
net/ipv4/icmp.c | 23 +++++-
net/ipv4/igmp.c | 2 +
net/ipv4/ip_output.c | 5 +-
net/ipv4/route.c | 46 +++++++-----
net/ipv4/tcp_input.c | 2 +-
net/ipv4/tcp_ipv4.c | 5 +-
net/ipv6/netfilter/nf_socket_ipv6.c | 4 +-
net/l2tp/l2tp_core.c | 4 +-
net/mac80211/tx.c | 4 +-
net/netlabel/netlabel_cipso_v4.c | 12 ++--
net/netlink/af_netlink.c | 4 +-
net/sched/sch_cbq.c | 2 +-
net/sunrpc/auth_gss/svcauth_gss.c | 2 +-
net/tipc/socket.c | 2 +-
net/unix/af_unix.c | 2 +-
security/integrity/ima/ima_mok.c | 2 +-
security/smack/smack_access.c | 17 +++--
sound/core/pcm_lib.c | 2 +-
sound/soc/intel/boards/bytcr_rt5640.c | 9 ++-
sound/soc/rockchip/rockchip_i2s.c | 35 ++++++----
tools/testing/selftests/bpf/test_maps.c | 2 +-
218 files changed, 1161 insertions(+), 663 deletions(-)
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 001/217] ext4: fix race writing to an inline_data file while its xattrs are changing
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 002/217] xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG Greg Kroah-Hartman
` (217 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, stable, syzbot+13146364637c7363a7de,
Theodore Tso
From: Theodore Ts'o <tytso@mit.edu>
commit a54c4613dac1500b40e4ab55199f7c51f028e848 upstream.
The location of the system.data extended attribute can change whenever
xattr_sem is not taken. So we need to recalculate the i_inline_off
field since it mgiht have changed between ext4_write_begin() and
ext4_write_end().
This means that caching i_inline_off is probably not helpful, so in
the long run we should probably get rid of it and shrink the in-memory
ext4 inode slightly, but let's fix the race the simple way for now.
Cc: stable@kernel.org
Fixes: f19d5870cbf72 ("ext4: add normal write support for inline data")
Reported-by: syzbot+13146364637c7363a7de@syzkaller.appspotmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext4/inline.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -756,6 +756,12 @@ int ext4_write_inline_data_end(struct in
ext4_write_lock_xattr(inode, &no_expand);
BUG_ON(!ext4_has_inline_data(inode));
+ /*
+ * ei->i_inline_off may have changed since ext4_write_begin()
+ * called ext4_try_to_write_inline_data()
+ */
+ (void) ext4_find_inline_data_nolock(inode);
+
kaddr = kmap_atomic(page);
ext4_write_inline_data(inode, &iloc, kaddr, pos, len);
kunmap_atomic(kaddr);
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 002/217] xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 001/217] ext4: fix race writing to an inline_data file while its xattrs are changing Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 003/217] qed: Fix the VF msix vectors flow Greg Kroah-Hartman
` (216 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Randy Dunlap, Max Filippov,
Chris Zankel, linux-xtensa
From: Randy Dunlap <rdunlap@infradead.org>
commit ed5aacc81cd41efc4d561e14af408d1003f7b855 upstream.
XTENSA should only select HAVE_FUTEX_CMPXCHG when FUTEX is
set/enabled. This prevents a kconfig warning.
WARNING: unmet direct dependencies detected for HAVE_FUTEX_CMPXCHG
Depends on [n]: FUTEX [=n]
Selected by [y]:
- XTENSA [=y] && !MMU [=n]
Fixes: d951ba21b959 ("xtensa: nommu: select HAVE_FUTEX_CMPXCHG")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: linux-xtensa@linux-xtensa.org
Message-Id: <20210526070337.28130-1-rdunlap@infradead.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/xtensa/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -20,7 +20,7 @@ config XTENSA
select HAVE_DMA_CONTIGUOUS
select HAVE_EXIT_THREAD
select HAVE_FUNCTION_TRACER
- select HAVE_FUTEX_CMPXCHG if !MMU
+ select HAVE_FUTEX_CMPXCHG if !MMU && FUTEX
select HAVE_HW_BREAKPOINT if PERF_EVENTS
select HAVE_IRQ_TIME_ACCOUNTING
select HAVE_MEMBLOCK
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 003/217] qed: Fix the VF msix vectors flow
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 001/217] ext4: fix race writing to an inline_data file while its xattrs are changing Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 002/217] xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 004/217] net: macb: Add a NULL check on desc_ptp Greg Kroah-Hartman
` (215 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Prabhakar Kushwaha, Ariel Elior,
Shai Malin, David S. Miller, Sasha Levin
From: Shai Malin <smalin@marvell.com>
[ Upstream commit b0cd08537db8d2fbb227cdb2e5835209db295a24 ]
For VFs we should return with an error in case we didn't get the exact
number of msix vectors as we requested.
Not doing that will lead to a crash when starting queues for this VF.
Signed-off-by: Prabhakar Kushwaha <pkushwaha@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/qlogic/qed/qed_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 52e747fd9c83..62d514b60e23 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -437,7 +437,12 @@ static int qed_enable_msix(struct qed_dev *cdev,
rc = cnt;
}
- if (rc > 0) {
+ /* For VFs, we should return with an error in case we didn't get the
+ * exact number of msix vectors as we requested.
+ * Not doing that will lead to a crash when starting queues for
+ * this VF.
+ */
+ if ((IS_PF(cdev) && rc > 0) || (IS_VF(cdev) && rc == cnt)) {
/* MSI-x configuration was achieved */
int_params->out.int_mode = QED_INT_MODE_MSIX;
int_params->out.num_vectors = rc;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 004/217] net: macb: Add a NULL check on desc_ptp
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 003/217] qed: Fix the VF msix vectors flow Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 005/217] qede: Fix memset corruption Greg Kroah-Hartman
` (214 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Harini Katakam, Radhey Shyam Pandey,
Michal Simek, David S. Miller, Sasha Levin
From: Harini Katakam <harini.katakam@xilinx.com>
[ Upstream commit 85520079afce885b80647fbd0d13d8f03d057167 ]
macb_ptp_desc will not return NULL under most circumstances with correct
Kconfig and IP design config register. But for the sake of the extreme
corner case, check for NULL when using the helper. In case of rx_tstamp,
no action is necessary except to return (similar to timestamp disabled)
and warn. In case of TX, return -EINVAL to let the skb be free. Perform
this check before marking skb in progress.
Fixes coverity warning:
(4) Event dereference:
Dereferencing a null pointer "desc_ptp"
Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/cadence/macb_ptp.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb_ptp.c b/drivers/net/ethernet/cadence/macb_ptp.c
index f1f07e9d53f8..07d6472dd149 100755
--- a/drivers/net/ethernet/cadence/macb_ptp.c
+++ b/drivers/net/ethernet/cadence/macb_ptp.c
@@ -286,6 +286,12 @@ void gem_ptp_rxstamp(struct macb *bp, struct sk_buff *skb,
if (GEM_BFEXT(DMA_RXVALID, desc->addr)) {
desc_ptp = macb_ptp_desc(bp, desc);
+ /* Unlikely but check */
+ if (!desc_ptp) {
+ dev_warn_ratelimited(&bp->pdev->dev,
+ "Timestamp not supported in BD\n");
+ return;
+ }
gem_hw_timestamp(bp, desc_ptp->ts_1, desc_ptp->ts_2, &ts);
memset(shhwtstamps, 0, sizeof(struct skb_shared_hwtstamps));
shhwtstamps->hwtstamp = ktime_set(ts.tv_sec, ts.tv_nsec);
@@ -318,8 +324,11 @@ int gem_ptp_txstamp(struct macb_queue *queue, struct sk_buff *skb,
if (CIRC_SPACE(head, tail, PTP_TS_BUFFER_SIZE) == 0)
return -ENOMEM;
- skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
desc_ptp = macb_ptp_desc(queue->bp, desc);
+ /* Unlikely but check */
+ if (!desc_ptp)
+ return -EINVAL;
+ skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
tx_timestamp = &queue->tx_timestamps[head];
tx_timestamp->skb = skb;
tx_timestamp->desc_ptp.ts_1 = desc_ptp->ts_1;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 005/217] qede: Fix memset corruption
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 004/217] net: macb: Add a NULL check on desc_ptp Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 006/217] perf/x86/intel/pt: Fix mask of num_address_ranges Greg Kroah-Hartman
` (213 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Prabhakar Kushwaha, Ariel Elior,
Shai Malin, Kees Cook, David S. Miller, Sasha Levin
From: Shai Malin <smalin@marvell.com>
[ Upstream commit e543468869e2532f5d7926e8f417782b48eca3dc ]
Thanks to Kees Cook who detected the problem of memset that starting
from not the first member, but sized for the whole struct.
The better change will be to remove the redundant memset and to clear
only the msix_cnt member.
Signed-off-by: Prabhakar Kushwaha <pkushwaha@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Reported-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 8bb734486bf3..99de923728ec 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -1590,6 +1590,7 @@ static void qede_sync_free_irqs(struct qede_dev *edev)
}
edev->int_info.used_cnt = 0;
+ edev->int_info.msix_cnt = 0;
}
static int qede_req_msix_irqs(struct qede_dev *edev)
@@ -2088,7 +2089,6 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode,
goto out;
err4:
qede_sync_free_irqs(edev);
- memset(&edev->int_info.msix_cnt, 0, sizeof(struct qed_int_info));
err3:
qede_napi_disable_remove(edev);
err2:
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 006/217] perf/x86/intel/pt: Fix mask of num_address_ranges
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 005/217] qede: Fix memset corruption Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 007/217] perf/x86/amd/ibs: Work around erratum #1197 Greg Kroah-Hartman
` (212 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Xiaoyao Li, Peter Zijlstra (Intel),
Alexander Shishkin, Sasha Levin
From: Xiaoyao Li <xiaoyao.li@intel.com>
[ Upstream commit c53c6b7409f4cd9e542991b53d597fbe2751d7db ]
Per SDM, bit 2:0 of CPUID(0x14,1).EAX[2:0] reports the number of
configurable address ranges for filtering, not bit 1:0.
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Link: https://lkml.kernel.org/r/20210824040622.4081502-1-xiaoyao.li@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/events/intel/pt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c
index 0661227d935c..990ca9614b23 100644
--- a/arch/x86/events/intel/pt.c
+++ b/arch/x86/events/intel/pt.c
@@ -69,7 +69,7 @@ static struct pt_cap_desc {
PT_CAP(topa_multiple_entries, 0, CPUID_ECX, BIT(1)),
PT_CAP(single_range_output, 0, CPUID_ECX, BIT(2)),
PT_CAP(payloads_lip, 0, CPUID_ECX, BIT(31)),
- PT_CAP(num_address_ranges, 1, CPUID_EAX, 0x3),
+ PT_CAP(num_address_ranges, 1, CPUID_EAX, 0x7),
PT_CAP(mtc_periods, 1, CPUID_EAX, 0xffff0000),
PT_CAP(cycle_thresholds, 1, CPUID_EBX, 0xffff),
PT_CAP(psb_periods, 1, CPUID_EBX, 0xffff0000),
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 007/217] perf/x86/amd/ibs: Work around erratum #1197
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 006/217] perf/x86/intel/pt: Fix mask of num_address_ranges Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 008/217] cryptoloop: add a deprecation warning Greg Kroah-Hartman
` (211 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Kim Phillips, Peter Zijlstra (Intel),
Ingo Molnar, Sasha Levin
From: Kim Phillips <kim.phillips@amd.com>
[ Upstream commit 26db2e0c51fe83e1dd852c1321407835b481806e ]
Erratum #1197 "IBS (Instruction Based Sampling) Register State May be
Incorrect After Restore From CC6" is published in a document:
"Revision Guide for AMD Family 19h Models 00h-0Fh Processors" 56683 Rev. 1.04 July 2021
https://bugzilla.kernel.org/show_bug.cgi?id=206537
Implement the erratum's suggested workaround and ignore IBS samples if
MSRC001_1031 == 0.
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210817221048.88063-3-kim.phillips@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/events/amd/ibs.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 3fe68f7f9d5e..5043425ced6b 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -90,6 +90,7 @@ struct perf_ibs {
unsigned long offset_mask[1];
int offset_max;
unsigned int fetch_count_reset_broken : 1;
+ unsigned int fetch_ignore_if_zero_rip : 1;
struct cpu_perf_ibs __percpu *pcpu;
struct attribute **format_attrs;
@@ -674,6 +675,10 @@ fail:
if (check_rip && (ibs_data.regs[2] & IBS_RIP_INVALID)) {
regs.flags &= ~PERF_EFLAGS_EXACT;
} else {
+ /* Workaround for erratum #1197 */
+ if (perf_ibs->fetch_ignore_if_zero_rip && !(ibs_data.regs[1]))
+ goto out;
+
set_linear_ip(®s, ibs_data.regs[1]);
regs.flags |= PERF_EFLAGS_EXACT;
}
@@ -767,6 +772,9 @@ static __init void perf_event_ibs_init(void)
if (boot_cpu_data.x86 >= 0x16 && boot_cpu_data.x86 <= 0x18)
perf_ibs_fetch.fetch_count_reset_broken = 1;
+ if (boot_cpu_data.x86 == 0x19 && boot_cpu_data.x86_model < 0x10)
+ perf_ibs_fetch.fetch_ignore_if_zero_rip = 1;
+
perf_ibs_pmu_init(&perf_ibs_fetch, "ibs_fetch");
if (ibs_caps & IBS_CAPS_OPCNT) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 008/217] cryptoloop: add a deprecation warning
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 007/217] perf/x86/amd/ibs: Work around erratum #1197 Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 009/217] ARM: 8918/2: only build return_address() if needed Greg Kroah-Hartman
` (210 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Christoph Hellwig, Jens Axboe,
Sasha Levin
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 222013f9ac30b9cec44301daa8dbd0aae38abffb ]
Support for cryptoloop has been officially marked broken and deprecated
in favor of dm-crypt (which supports the same broken algorithms if
needed) in Linux 2.6.4 (released in March 2004), and support for it has
been entirely removed from losetup in util-linux 2.23 (released in April
2013). Add a warning and a deprecation schedule.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210827163250.255325-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/Kconfig | 4 ++--
drivers/block/cryptoloop.c | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 01091c08e999..ef702fdb2f92 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -234,7 +234,7 @@ config BLK_DEV_LOOP_MIN_COUNT
dynamically allocated with the /dev/loop-control interface.
config BLK_DEV_CRYPTOLOOP
- tristate "Cryptoloop Support"
+ tristate "Cryptoloop Support (DEPRECATED)"
select CRYPTO
select CRYPTO_CBC
depends on BLK_DEV_LOOP
@@ -246,7 +246,7 @@ config BLK_DEV_CRYPTOLOOP
WARNING: This device is not safe for journaled file systems like
ext3 or Reiserfs. Please use the Device Mapper crypto module
instead, which can be configured to be on-disk compatible with the
- cryptoloop device.
+ cryptoloop device. cryptoloop support will be removed in Linux 5.16.
source "drivers/block/drbd/Kconfig"
diff --git a/drivers/block/cryptoloop.c b/drivers/block/cryptoloop.c
index 74e03aa537ad..32363816cb04 100644
--- a/drivers/block/cryptoloop.c
+++ b/drivers/block/cryptoloop.c
@@ -203,6 +203,8 @@ init_cryptoloop(void)
if (rc)
printk(KERN_ERR "cryptoloop: loop_register_transfer failed\n");
+ else
+ pr_warn("the cryptoloop driver has been deprecated and will be removed in in Linux 5.16\n");
return rc;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 009/217] ARM: 8918/2: only build return_address() if needed
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 008/217] cryptoloop: add a deprecation warning Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 010/217] ALSA: pcm: fix divide error in snd_pcm_lib_ioctl Greg Kroah-Hartman
` (209 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ben Dooks, Russell King
From: Ben Dooks <ben-linux@fluff.org>
commit fb033c95c94ca1ee3d16e04ebdb85d65fb55fff8 upstream.
The system currently warns if the config conditions for
building return_address in arch/arm/kernel/return_address.c
are not met, leaving just an EXPORT_SYMBOL_GPL(return_address)
of a function defined to be 'static linline'.
This is a result of aeea3592a13b ("ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h").
Since we're not going to build anything other than an exported
symbol for something that is already being defined to be an
inline-able return of NULL, just avoid building the code to
remove the following warning:
Fixes: aeea3592a13b ("ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h")
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm/kernel/Makefile | 6 +++++-
arch/arm/kernel/return_address.c | 4 ----
2 files changed, 5 insertions(+), 5 deletions(-)
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -17,10 +17,14 @@ CFLAGS_REMOVE_return_address.o = -pg
# Object file lists.
obj-y := elf.o entry-common.o irq.o opcodes.o \
- process.o ptrace.o reboot.o return_address.o \
+ process.o ptrace.o reboot.o \
setup.o signal.o sigreturn_codes.o \
stacktrace.o sys_arm.o time.o traps.o
+ifneq ($(CONFIG_ARM_UNWIND),y)
+obj-$(CONFIG_FRAME_POINTER) += return_address.o
+endif
+
obj-$(CONFIG_ATAGS) += atags_parse.o
obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -10,8 +10,6 @@
*/
#include <linux/export.h>
#include <linux/ftrace.h>
-
-#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
#include <linux/sched.h>
#include <asm/stacktrace.h>
@@ -56,6 +54,4 @@ void *return_address(unsigned int level)
return NULL;
}
-#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */
-
EXPORT_SYMBOL_GPL(return_address);
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 010/217] ALSA: pcm: fix divide error in snd_pcm_lib_ioctl
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 009/217] ARM: 8918/2: only build return_address() if needed Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 011/217] clk: fix build warning for orphan_list Greg Kroah-Hartman
` (208 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Zubin Mithra, Guenter Roeck,
Takashi Iwai
From: Zubin Mithra <zsm@chromium.org>
commit f3eef46f0518a2b32ca1244015820c35a22cfe4a upstream.
Syzkaller reported a divide error in snd_pcm_lib_ioctl. fifo_size
is of type snd_pcm_uframes_t(unsigned long). If frame_size
is 0x100000000, the error occurs.
Fixes: a9960e6a293e ("ALSA: pcm: fix fifo_size frame calculation")
Signed-off-by: Zubin Mithra <zsm@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210827153735.789452-1-zsm@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/core/pcm_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1757,7 +1757,7 @@ static int snd_pcm_lib_ioctl_fifo_size(s
channels = params_channels(params);
frame_size = snd_pcm_format_size(format, channels);
if (frame_size > 0)
- params->fifo_size /= (unsigned)frame_size;
+ params->fifo_size /= frame_size;
}
return 0;
}
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 011/217] clk: fix build warning for orphan_list
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 010/217] ALSA: pcm: fix divide error in snd_pcm_lib_ioctl Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 012/217] media: stkwebcam: fix memory leak in stk_camera_probe Greg Kroah-Hartman
` (207 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, kernelci.org bot
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In the backport of commit bdcf1dc25324 ("clk: Evict unregistered clks
from parent caches") to the 4.19.y and 4.14.y stable trees, the
orphan_list structure was placed in the wrong location, causing loads of
build warnings on systems that do not define CONFIG_DEBUG_FS.
Fix this up by moving the structure to the correct place in the file.
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/clk/clk.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -45,11 +45,6 @@ static struct hlist_head *all_lists[] =
NULL,
};
-static struct hlist_head *orphan_list[] = {
- &clk_orphan_list,
- NULL,
-};
-
/*** private data structures ***/
struct clk_core {
@@ -2004,6 +1999,11 @@ static int inited = 0;
static DEFINE_MUTEX(clk_debug_lock);
static HLIST_HEAD(clk_debug_list);
+static struct hlist_head *orphan_list[] = {
+ &clk_orphan_list,
+ NULL,
+};
+
static void clk_summary_show_one(struct seq_file *s, struct clk_core *c,
int level)
{
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 012/217] media: stkwebcam: fix memory leak in stk_camera_probe
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 011/217] clk: fix build warning for orphan_list Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 013/217] igmp: Add ip_mc_list lock in ip_check_mc_rcu Greg Kroah-Hartman
` (206 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Pavel Skripkin, Hans Verkuil,
Mauro Carvalho Chehab
From: Pavel Skripkin <paskripkin@gmail.com>
commit 514e97674400462cc09c459a1ddfb9bf39017223 upstream.
My local syzbot instance hit memory leak in usb_set_configuration().
The problem was in unputted usb interface. In case of errors after
usb_get_intf() the reference should be putted to correclty free memory
allocated for this interface.
Fixes: ec16dae5453e ("V4L/DVB (7019): V4L: add support for Syntek DC1125 webcams")
Cc: stable@vger.kernel.org
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/media/usb/stkwebcam/stk-webcam.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -1355,7 +1355,7 @@ static int stk_camera_probe(struct usb_i
if (!dev->isoc_ep) {
pr_err("Could not find isoc-in endpoint\n");
err = -ENODEV;
- goto error;
+ goto error_put;
}
dev->vsettings.palette = V4L2_PIX_FMT_RGB565;
dev->vsettings.mode = MODE_VGA;
@@ -1368,10 +1368,12 @@ static int stk_camera_probe(struct usb_i
err = stk_register_video_device(dev);
if (err)
- goto error;
+ goto error_put;
return 0;
+error_put:
+ usb_put_intf(interface);
error:
v4l2_ctrl_handler_free(hdl);
v4l2_device_unregister(&dev->v4l2_dev);
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 013/217] igmp: Add ip_mc_list lock in ip_check_mc_rcu
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 012/217] media: stkwebcam: fix memory leak in stk_camera_probe Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 014/217] USB: serial: mos7720: improve OOM-handling in read_mos_reg() Greg Kroah-Hartman
` (205 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Liu Jian, David S. Miller, Lee Jones
From: Liu Jian <liujian56@huawei.com>
commit 23d2b94043ca8835bd1e67749020e839f396a1c2 upstream.
I got below panic when doing fuzz test:
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 4056 Comm: syz-executor.3 Tainted: G B 5.14.0-rc1-00195-gcff5c4254439-dirty #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
Call Trace:
dump_stack_lvl+0x7a/0x9b
panic+0x2cd/0x5af
end_report.cold+0x5a/0x5a
kasan_report+0xec/0x110
ip_check_mc_rcu+0x556/0x5d0
__mkroute_output+0x895/0x1740
ip_route_output_key_hash_rcu+0x2d0/0x1050
ip_route_output_key_hash+0x182/0x2e0
ip_route_output_flow+0x28/0x130
udp_sendmsg+0x165d/0x2280
udpv6_sendmsg+0x121e/0x24f0
inet6_sendmsg+0xf7/0x140
sock_sendmsg+0xe9/0x180
____sys_sendmsg+0x2b8/0x7a0
___sys_sendmsg+0xf0/0x160
__sys_sendmmsg+0x17e/0x3c0
__x64_sys_sendmmsg+0x9e/0x100
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x462eb9
Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8
48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48>
3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3df5af1c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 000000000073bf00 RCX: 0000000000462eb9
RDX: 0000000000000312 RSI: 0000000020001700 RDI: 0000000000000007
RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3df5af26bc
R13: 00000000004c372d R14: 0000000000700b10 R15: 00000000ffffffff
It is one use-after-free in ip_check_mc_rcu.
In ip_mc_del_src, the ip_sf_list of pmc has been freed under pmc->lock protection.
But access to ip_sf_list in ip_check_mc_rcu is not protected by the lock.
Signed-off-by: Liu Jian <liujian56@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/igmp.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2695,6 +2695,7 @@ int ip_check_mc_rcu(struct in_device *in
rv = 1;
} else if (im) {
if (src_addr) {
+ spin_lock_bh(&im->lock);
for (psf = im->sources; psf; psf = psf->sf_next) {
if (psf->sf_inaddr == src_addr)
break;
@@ -2705,6 +2706,7 @@ int ip_check_mc_rcu(struct in_device *in
im->sfcount[MCAST_EXCLUDE];
else
rv = im->sfcount[MCAST_EXCLUDE] != 0;
+ spin_unlock_bh(&im->lock);
} else
rv = 1; /* unspecified source; tentatively allow */
}
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 014/217] USB: serial: mos7720: improve OOM-handling in read_mos_reg()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 013/217] igmp: Add ip_mc_list lock in ip_check_mc_rcu Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 015/217] f2fs: fix potential overflow Greg Kroah-Hartman
` (204 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Tom Rix, Johan Hovold
From: Tom Rix <trix@redhat.com>
commit 161a582bd1d8681095f158d11bc679a58f1d026b upstream.
clang static analysis reports this problem
mos7720.c:352:2: warning: Undefined or garbage value returned to caller
return d;
^~~~~~~~
In the parport_mos7715_read_data()'s call to read_mos_reg(), 'd' is
only set after the alloc block.
buf = kmalloc(1, GFP_KERNEL);
if (!buf)
return -ENOMEM;
Although the problem is reported in parport_most7715_read_data(),
none of the callee's of read_mos_reg() check the return status.
Make sure to clear the return-value buffer also on allocation failures.
Fixes: 0d130367abf5 ("USB: serial: mos7720: fix control-message error handling")
Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20210111220904.1035957-1-trix@redhat.com
[ johan: only clear the buffer on errors, amend commit message ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/mos7720.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -229,8 +229,10 @@ static int read_mos_reg(struct usb_seria
int status;
buf = kmalloc(1, GFP_KERNEL);
- if (!buf)
+ if (!buf) {
+ *data = 0;
return -ENOMEM;
+ }
status = usb_control_msg(usbdev, pipe, request, requesttype, value,
index, buf, 1, MOS_WDR_TIMEOUT);
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 015/217] f2fs: fix potential overflow
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 014/217] USB: serial: mos7720: improve OOM-handling in read_mos_reg() Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 016/217] ath10k: fix recent bandwidth conversion bug Greg Kroah-Hartman
` (203 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Chao Yu, Jaegeuk Kim
From: Chao Yu <yuchao0@huawei.com>
commit a9af3fdcc4258af406879eca63d82e9d6baa892e upstream.
In build_sit_entries(), if valid_blocks in SIT block is smaller than
valid_blocks in journal, for below calculation:
sbi->discard_blks += old_valid_blocks - se->valid_blocks;
There will be two times potential overflow:
- old_valid_blocks - se->valid_blocks will overflow, and be a very
large number.
- sbi->discard_blks += result will overflow again, comes out a correct
result accidently.
Anyway, it should be fixed.
Fixes: d600af236da5 ("f2fs: avoid unneeded loop in build_sit_entries")
Fixes: 1f43e2ad7bff ("f2fs: introduce CP_TRIMMED_FLAG to avoid unneeded discard")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/segment.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3337,14 +3337,17 @@ static int build_sit_entries(struct f2fs
} else {
memcpy(se->discard_map, se->cur_valid_map,
SIT_VBLOCK_MAP_SIZE);
- sbi->discard_blks += old_valid_blocks -
- se->valid_blocks;
+ sbi->discard_blks += old_valid_blocks;
+ sbi->discard_blks -= se->valid_blocks;
}
}
- if (sbi->segs_per_sec > 1)
+ if (sbi->segs_per_sec > 1) {
get_sec_entry(sbi, start)->valid_blocks +=
- se->valid_blocks - old_valid_blocks;
+ se->valid_blocks;
+ get_sec_entry(sbi, start)->valid_blocks -=
+ old_valid_blocks;
+ }
}
up_read(&curseg->journal_rwsem);
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 016/217] ath10k: fix recent bandwidth conversion bug
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 015/217] f2fs: fix potential overflow Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 017/217] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2) Greg Kroah-Hartman
` (202 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Christian Lamparter, Anilkumar Kolli,
Kalle Valo
From: Christian Lamparter <chunkeey@gmail.com>
commit 91493e8e10f0f495b04a5c32096d56ea1f254c93 upstream.
The commit "cfg80211: make RATE_INFO_BW_20 the default" changed
the index of RATE_INFO_BW_20, but the updates to ath10k missed
the special bandwidth calculation case in
ath10k_update_per_peer_tx_stats().
This will fix below warning,
WARNING: CPU: 0 PID: 609 at net/wireless/util.c:1254
cfg80211_calculate_bitrate+0x174/0x220
invalid rate bw=1, mcs=9, nss=2
(unwind_backtrace) from
(cfg80211_calculate_bitrate+0x174/0x220)
(cfg80211_calculate_bitrate) from
(nl80211_put_sta_rate+0x44/0x1dc)from
(nl80211_put_sta_rate) from
(nl80211_send_station+0x388/0xaf0)
(nl80211_get_station+0xa8/0xec)
[ end trace da8257d6a850e91a ]
Fixes: 842be75c77cb ("cfg80211: make RATE_INFO_BW_20 the default")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/ath/ath10k/htt_rx.c | 42 +++++++++++++++++--------------
1 file changed, 24 insertions(+), 18 deletions(-)
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -613,6 +613,28 @@ struct amsdu_subframe_hdr {
#define GROUP_ID_IS_SU_MIMO(x) ((x) == 0 || (x) == 63)
+static inline u8 ath10k_bw_to_mac80211_bw(u8 bw)
+{
+ u8 ret = 0;
+
+ switch (bw) {
+ case 0:
+ ret = RATE_INFO_BW_20;
+ break;
+ case 1:
+ ret = RATE_INFO_BW_40;
+ break;
+ case 2:
+ ret = RATE_INFO_BW_80;
+ break;
+ case 3:
+ ret = RATE_INFO_BW_160;
+ break;
+ }
+
+ return ret;
+}
+
static void ath10k_htt_rx_h_rates(struct ath10k *ar,
struct ieee80211_rx_status *status,
struct htt_rx_desc *rxd)
@@ -721,23 +743,7 @@ static void ath10k_htt_rx_h_rates(struct
if (sgi)
status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
- switch (bw) {
- /* 20MHZ */
- case 0:
- break;
- /* 40MHZ */
- case 1:
- status->bw = RATE_INFO_BW_40;
- break;
- /* 80MHZ */
- case 2:
- status->bw = RATE_INFO_BW_80;
- break;
- case 3:
- status->bw = RATE_INFO_BW_160;
- break;
- }
-
+ status->bw = ath10k_bw_to_mac80211_bw(bw);
status->encoding = RX_ENC_VHT;
break;
default:
@@ -2436,7 +2442,7 @@ ath10k_update_per_peer_tx_stats(struct a
arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
arsta->txrate.nss = txrate.nss;
- arsta->txrate.bw = txrate.bw + RATE_INFO_BW_20;
+ arsta->txrate.bw = ath10k_bw_to_mac80211_bw(txrate.bw);
}
static void ath10k_htt_fetch_peer_stats(struct ath10k *ar,
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 017/217] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 016/217] ath10k: fix recent bandwidth conversion bug Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 018/217] s390/disassembler: correct disassembly lines alignment Greg Kroah-Hartman
` (201 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Mathieu Desnoyers, David Ahern,
Jakub Kicinski
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
commit e1e84eb58eb494b77c8389fc6308b5042dcce791 upstream.
As per RFC792, ICMP errors should be sent to the source host.
However, in configurations with Virtual Routing and Forwarding tables,
looking up which routing table to use is currently done by using the
destination net_device.
commit 9d1a6c4ea43e ("net: icmp_route_lookup should use rt dev to
determine L3 domain") changes the interface passed to
l3mdev_master_ifindex() and inet_addr_type_dev_table() from skb_in->dev
to skb_dst(skb_in)->dev. This effectively uses the destination device
rather than the source device for choosing which routing table should be
used to lookup where to send the ICMP error.
Therefore, if the source and destination interfaces are within separate
VRFs, or one in the global routing table and the other in a VRF, looking
up the source host in the destination interface's routing table will
fail if the destination interface's routing table contains no route to
the source host.
One observable effect of this issue is that traceroute does not work in
the following cases:
- Route leaking between global routing table and VRF
- Route leaking between VRFs
Preferably use the source device routing table when sending ICMP error
messages. If no source device is set, fall-back on the destination
device routing table. Else, use the main routing table (index 0).
[ It has been pointed out that a similar issue may exist with ICMP
errors triggered when forwarding between network namespaces. It would
be worthwhile to investigate, but is outside of the scope of this
investigation. ]
[ It has also been pointed out that a similar issue exists with
unreachable / fragmentation needed messages, which can be triggered by
changing the MTU of eth1 in r1 to 1400 and running:
ip netns exec h1 ping -s 1450 -Mdo -c1 172.16.2.2
Some investigation points to raw_icmp_error() and raw_err() as being
involved in this last scenario. The focus of this patch is TTL expired
ICMP messages, which go through icmp_route_lookup.
Investigation of failure modes related to raw_icmp_error() is beyond
this investigation's scope. ]
Fixes: 9d1a6c4ea43e ("net: icmp_route_lookup should use rt dev to determine L3 domain")
Link: https://tools.ietf.org/html/rfc792
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/icmp.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -468,6 +468,23 @@ out_bh_enable:
local_bh_enable();
}
+/*
+ * The device used for looking up which routing table to use for sending an ICMP
+ * error is preferably the source whenever it is set, which should ensure the
+ * icmp error can be sent to the source host, else lookup using the routing
+ * table of the destination device, else use the main routing table (index 0).
+ */
+static struct net_device *icmp_get_route_lookup_dev(struct sk_buff *skb)
+{
+ struct net_device *route_lookup_dev = NULL;
+
+ if (skb->dev)
+ route_lookup_dev = skb->dev;
+ else if (skb_dst(skb))
+ route_lookup_dev = skb_dst(skb)->dev;
+ return route_lookup_dev;
+}
+
static struct rtable *icmp_route_lookup(struct net *net,
struct flowi4 *fl4,
struct sk_buff *skb_in,
@@ -476,6 +493,7 @@ static struct rtable *icmp_route_lookup(
int type, int code,
struct icmp_bxm *param)
{
+ struct net_device *route_lookup_dev;
struct rtable *rt, *rt2;
struct flowi4 fl4_dec;
int err;
@@ -490,7 +508,8 @@ static struct rtable *icmp_route_lookup(
fl4->flowi4_proto = IPPROTO_ICMP;
fl4->fl4_icmp_type = type;
fl4->fl4_icmp_code = code;
- fl4->flowi4_oif = l3mdev_master_ifindex(skb_dst(skb_in)->dev);
+ route_lookup_dev = icmp_get_route_lookup_dev(skb_in);
+ fl4->flowi4_oif = l3mdev_master_ifindex(route_lookup_dev);
security_skb_classify_flow(skb_in, flowi4_to_flowi(fl4));
rt = ip_route_output_key_hash(net, fl4, skb_in);
@@ -514,7 +533,7 @@ static struct rtable *icmp_route_lookup(
if (err)
goto relookup_failed;
- if (inet_addr_type_dev_table(net, skb_dst(skb_in)->dev,
+ if (inet_addr_type_dev_table(net, route_lookup_dev,
fl4_dec.saddr) == RTN_LOCAL) {
rt2 = __ip_route_output_key(net, &fl4_dec);
if (IS_ERR(rt2))
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 018/217] s390/disassembler: correct disassembly lines alignment
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 017/217] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2) Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 019/217] mm/kmemleak.c: make cond_resched() rate-limiting more efficient Greg Kroah-Hartman
` (200 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Vasily Gorbik, Martin Schwidefsky
From: Vasily Gorbik <gor@linux.vnet.ibm.com>
commit 26f4e759ef9b8a2bab1823d692ed6d56d40b66e3 upstream.
176.718956 Krnl Code: 00000000004d38b0: a54c0018 llihh %r4,24
176.718956 00000000004d38b4: b9080014 agr %r1,%r4
^
Using a tab to align disassembly lines which follow the first line with
"Krnl Code: " doesn't always work, e.g. if there is a prefix (timestamp
or syslog prefix) which is not 8 chars aligned. Go back to alignment
with spaces.
Fixes: b192571d1ae3 ("s390/disassembler: increase show_code buffer size")
Signed-off-by: Vasily Gorbik <gor@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/s390/kernel/dis.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -2018,7 +2018,7 @@ void show_code(struct pt_regs *regs)
start += opsize;
pr_cont("%s", buffer);
ptr = buffer;
- ptr += sprintf(ptr, "\n\t ");
+ ptr += sprintf(ptr, "\n ");
hops++;
}
pr_cont("\n");
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 019/217] mm/kmemleak.c: make cond_resched() rate-limiting more efficient
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 018/217] s390/disassembler: correct disassembly lines alignment Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 020/217] crypto: talitos - reduce max key size for SEC1 Greg Kroah-Hartman
` (199 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Linus Torvalds, Yisheng Xie,
Catalin Marinas, Michal Hocko, Andrew Morton
From: Andrew Morton <akpm@linux-foundation.org>
commit 13ab183d138f607d885e995d625e58d47678bf97 upstream.
Commit bde5f6bc68db ("kmemleak: add scheduling point to
kmemleak_scan()") tries to rate-limit the frequency of cond_resched()
calls, but does it in a way which might incur an expensive division
operation in the inner loop. Simplify this.
Fixes: bde5f6bc68db5 ("kmemleak: add scheduling point to kmemleak_scan()")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Yisheng Xie <xieyisheng1@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/kmemleak.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1520,7 +1520,7 @@ static void kmemleak_scan(void)
if (page_count(page) == 0)
continue;
scan_block(page, page + 1, NULL);
- if (!(pfn % (MAX_SCAN_SIZE / sizeof(*page))))
+ if (!(pfn & 63))
cond_resched();
}
}
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 020/217] crypto: talitos - reduce max key size for SEC1
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 019/217] mm/kmemleak.c: make cond_resched() rate-limiting more efficient Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 021/217] powerpc/module64: Fix comment in R_PPC64_ENTRY handling Greg Kroah-Hartman
` (198 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Christophe Leroy, Herbert Xu
From: Christophe Leroy <christophe.leroy@c-s.fr>
commit b8fbdc2bc4e71b62646031d5df5f08aafe15d5ad upstream.
SEC1 doesn't support SHA384/512, so it doesn't require
longer keys.
This patch reduces the max key size when the driver
is built for SEC1 only.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Fixes: 03d2c5114c95 ("crypto: talitos - Extend max key length for SHA384/512-HMAC and AEAD")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/crypto/talitos.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -816,7 +816,11 @@ static void talitos_unregister_rng(struc
* HMAC_SNOOP_NO_AFEA (HSNA) instead of type IPSEC_ESP
*/
#define TALITOS_CRA_PRIORITY_AEAD_HSNA (TALITOS_CRA_PRIORITY - 1)
+#ifdef CONFIG_CRYPTO_DEV_TALITOS_SEC2
#define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA512_BLOCK_SIZE)
+#else
+#define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA256_BLOCK_SIZE)
+#endif
#define TALITOS_MAX_IV_LENGTH 16 /* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */
struct talitos_ctx {
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 021/217] powerpc/module64: Fix comment in R_PPC64_ENTRY handling
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 020/217] crypto: talitos - reduce max key size for SEC1 Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 022/217] powerpc/boot: Delete unneeded .globl _zimage_start Greg Kroah-Hartman
` (197 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Michael Ellerman
From: Michael Ellerman <mpe@ellerman.id.au>
commit 2fb0a2c989837c976b68233496bbaefb47cd3d6f upstream.
The comment here is wrong, the addi reads from r2 not r12. The code is
correct, 0x38420000 = addi r2,r2,0.
Fixes: a61674bdfc7c ("powerpc/module: Handle R_PPC64_ENTRY relocations")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/kernel/module_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -695,7 +695,7 @@ int apply_relocate_add(Elf64_Shdr *sechd
/*
* If found, replace it with:
* addis r2, r12, (.TOC.-func)@ha
- * addi r2, r12, (.TOC.-func)@l
+ * addi r2, r2, (.TOC.-func)@l
*/
((uint32_t *)location)[0] = 0x3c4c0000 + PPC_HA(value);
((uint32_t *)location)[1] = 0x38420000 + PPC_LO(value);
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 022/217] powerpc/boot: Delete unneeded .globl _zimage_start
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 021/217] powerpc/module64: Fix comment in R_PPC64_ENTRY handling Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 023/217] net: ll_temac: Remove left-over debug message Greg Kroah-Hartman
` (196 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Fangrui Song, Michael Ellerman
From: Fangrui Song <maskray@google.com>
commit 968339fad422a58312f67718691b717dac45c399 upstream.
.globl sets the symbol binding to STB_GLOBAL while .weak sets the
binding to STB_WEAK. GNU as let .weak override .globl since
binutils-gdb 5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996). Clang
integrated assembler let the last win but it may error in the future.
Since it is a convention that only one binding directive is used, just
delete .globl.
Fixes: ee9d21b3b358 ("powerpc/boot: Ensure _zimage_start is a weak symbol")
Signed-off-by: Fangrui Song <maskray@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200325164257.170229-1-maskray@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/boot/crt0.S | 3 ---
1 file changed, 3 deletions(-)
--- a/arch/powerpc/boot/crt0.S
+++ b/arch/powerpc/boot/crt0.S
@@ -49,9 +49,6 @@ p_end: .long _end
p_pstack: .long _platform_stack_top
#endif
- .globl _zimage_start
- /* Clang appears to require the .weak directive to be after the symbol
- * is defined. See https://bugs.llvm.org/show_bug.cgi?id=38921 */
.weak _zimage_start
_zimage_start:
.globl _zimage_start_lib
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 023/217] net: ll_temac: Remove left-over debug message
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 022/217] powerpc/boot: Delete unneeded .globl _zimage_start Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 024/217] mm/page_alloc: speed up the iteration of max_order Greg Kroah-Hartman
` (195 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Esben Haabendal, David S. Miller
From: Esben Haabendal <esben@geanix.com>
commit ce03b94ba682a67e8233c9ee3066071656ded58f upstream.
Fixes: f63963411942 ("net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY")
Signed-off-by: Esben Haabendal <esben@geanix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -736,10 +736,8 @@ temac_start_xmit(struct sk_buff *skb, st
/* Kick off the transfer */
lp->dma_out(lp, TX_TAILDESC_PTR, tail_p); /* DMA start */
- if (temac_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) {
- netdev_info(ndev, "%s -> netif_stop_queue\n", __func__);
+ if (temac_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1))
netif_stop_queue(ndev);
- }
return NETDEV_TX_OK;
}
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 024/217] mm/page_alloc: speed up the iteration of max_order
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 023/217] net: ll_temac: Remove left-over debug message Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 025/217] Revert "btrfs: compression: dont try to compress if we dont have enough pages" Greg Kroah-Hartman
` (194 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Muchun Song, Vlastimil Babka,
Oscar Salvador, David Hildenbrand, Andrew Morton, Linus Torvalds
From: Muchun Song <songmuchun@bytedance.com>
commit 7ad69832f37e3cea8557db6df7c793905f1135e8 upstream.
When we free a page whose order is very close to MAX_ORDER and greater
than pageblock_order, it wastes some CPU cycles to increase max_order to
MAX_ORDER one by one and check the pageblock migratetype of that page
repeatedly especially when MAX_ORDER is much larger than pageblock_order.
We also should not be checking migratetype of buddy when "order ==
MAX_ORDER - 1" as the buddy pfn may be invalid, so adjust the condition.
With the new check, we don't need the max_order check anymore, so we
replace it.
Also adjust max_order initialization so that it's lower by one than
previously, which makes the code hopefully more clear.
Link: https://lkml.kernel.org/r/20201204155109.55451-1-songmuchun@bytedance.com
Fixes: d9dddbf55667 ("mm/page_alloc: prevent merging between isolated and other pageblocks")
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -815,7 +815,7 @@ static inline void __free_one_page(struc
struct page *buddy;
unsigned int max_order;
- max_order = min_t(unsigned int, MAX_ORDER, pageblock_order + 1);
+ max_order = min_t(unsigned int, MAX_ORDER - 1, pageblock_order);
VM_BUG_ON(!zone_is_initialized(zone));
VM_BUG_ON_PAGE(page->flags & PAGE_FLAGS_CHECK_AT_PREP, page);
@@ -828,7 +828,7 @@ static inline void __free_one_page(struc
VM_BUG_ON_PAGE(bad_range(zone, page), page);
continue_merging:
- while (order < max_order - 1) {
+ while (order < max_order) {
buddy_pfn = __find_buddy_pfn(pfn, order);
buddy = page + (buddy_pfn - pfn);
@@ -852,7 +852,7 @@ continue_merging:
pfn = combined_pfn;
order++;
}
- if (max_order < MAX_ORDER) {
+ if (order < MAX_ORDER - 1) {
/* If we are here, it means order is >= pageblock_order.
* We want to prevent merge between freepages on isolate
* pageblock and normal pageblock. Without this, pageblock
@@ -873,7 +873,7 @@ continue_merging:
is_migrate_isolate(buddy_mt)))
goto done_merging;
}
- max_order++;
+ max_order = order + 1;
goto continue_merging;
}
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 025/217] Revert "btrfs: compression: dont try to compress if we dont have enough pages"
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 024/217] mm/page_alloc: speed up the iteration of max_order Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 026/217] usb: host: xhci-rcar: Dont reload firmware after the completion Greg Kroah-Hartman
` (193 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Zygo Blaxell, Qu Wenruo, David Sterba
From: Qu Wenruo <wqu@suse.com>
commit 4e9655763b82a91e4c341835bb504a2b1590f984 upstream.
This reverts commit f2165627319ffd33a6217275e5690b1ab5c45763.
[BUG]
It's no longer possible to create compressed inline extent after commit
f2165627319f ("btrfs: compression: don't try to compress if we don't
have enough pages").
[CAUSE]
For compression code, there are several possible reasons we have a range
that needs to be compressed while it's no more than one page.
- Compressed inline write
The data is always smaller than one sector and the test lacks the
condition to properly recognize a non-inline extent.
- Compressed subpage write
For the incoming subpage compressed write support, we require page
alignment of the delalloc range.
And for 64K page size, we can compress just one page into smaller
sectors.
For those reasons, the requirement for the data to be more than one page
is not correct, and is already causing regression for compressed inline
data writeback. The idea of skipping one page to avoid wasting CPU time
could be revisited in the future.
[FIX]
Fix it by reverting the offending commit.
Reported-by: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Link: https://lore.kernel.org/linux-btrfs/afa2742.c084f5d6.17b6b08dffc@tnonline.net
Fixes: f2165627319f ("btrfs: compression: don't try to compress if we don't have enough pages")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/btrfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -540,7 +540,7 @@ again:
* inode has not been flagged as nocompress. This flag can
* change at any time if we discover bad compression ratios.
*/
- if (nr_pages > 1 && inode_need_compress(inode, start, end)) {
+ if (inode_need_compress(inode, start, end)) {
WARN_ON(pages);
pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS);
if (!pages) {
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 026/217] usb: host: xhci-rcar: Dont reload firmware after the completion
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 025/217] Revert "btrfs: compression: dont try to compress if we dont have enough pages" Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 027/217] x86/reboot: Limit Dell Optiplex 990 quirk to early BIOS versions Greg Kroah-Hartman
` (192 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Yoshihiro Shimoda
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
commit 57f3ffdc11143f56f1314972fe86fe17a0dcde85 upstream.
According to the datasheet, "Upon the completion of FW Download,
there is no need to write or reload FW.". Otherwise, it's possible
to cause unexpected behaviors. So, adds such a condition.
Fixes: 4ac8918f3a73 ("usb: host: xhci-plat: add support for the R-Car H2 and M2 xHCI controllers")
Cc: stable@vger.kernel.org # v3.17+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20210827063227.81990-1-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci-rcar.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/usb/host/xhci-rcar.c
+++ b/drivers/usb/host/xhci-rcar.c
@@ -152,6 +152,13 @@ static int xhci_rcar_download_firmware(s
const struct soc_device_attribute *attr;
const char *firmware_name;
+ /*
+ * According to the datasheet, "Upon the completion of FW Download,
+ * there is no need to write or reload FW".
+ */
+ if (readl(regs + RCAR_USB3_DL_CTRL) & RCAR_USB3_DL_CTRL_FW_SUCCESS)
+ return 0;
+
attr = soc_device_match(rcar_quirks_match);
if (attr)
quirks = (uintptr_t)attr->data;
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 027/217] x86/reboot: Limit Dell Optiplex 990 quirk to early BIOS versions
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 026/217] usb: host: xhci-rcar: Dont reload firmware after the completion Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 028/217] PCI: Call Max Payload Size-related fixup quirks early Greg Kroah-Hartman
` (191 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Paul Gortmaker, Thomas Gleixner
From: Paul Gortmaker <paul.gortmaker@windriver.com>
commit a729691b541f6e63043beae72e635635abe5dc09 upstream.
When this platform was relatively new in November 2011, with early BIOS
revisions, a reboot quirk was added in commit 6be30bb7d750 ("x86/reboot:
Blacklist Dell OptiPlex 990 known to require PCI reboot")
However, this quirk (and several others) are open-ended to all BIOS
versions and left no automatic expiry if/when the system BIOS fixed the
issue, meaning that nobody is likely to come along and re-test.
What is really problematic with using PCI reboot as this quirk does, is
that it causes this platform to do a full power down, wait one second,
and then power back on. This is less than ideal if one is using it for
boot testing and/or bisecting kernels when legacy rotating hard disks
are installed.
It was only by chance that the quirk was noticed in dmesg - and when
disabled it turned out that it wasn't required anymore (BIOS A24), and a
default reboot would work fine without the "harshness" of power cycling the
machine (and disks) down and up like the PCI reboot does.
Doing a bit more research, it seems that the "newest" BIOS for which the
issue was reported[1] was version A06, however Dell[2] seemed to suggest
only up to and including version A05, with the A06 having a large number of
fixes[3] listed.
As is typical with a new platform, the initial BIOS updates come frequently
and then taper off (and in this case, with a revival for CPU CVEs); a
search for O990-A<ver>.exe reveals the following dates:
A02 16 Mar 2011
A03 11 May 2011
A06 14 Sep 2011
A07 24 Oct 2011
A10 08 Dec 2011
A14 06 Sep 2012
A16 15 Oct 2012
A18 30 Sep 2013
A19 23 Sep 2015
A20 02 Jun 2017
A23 07 Mar 2018
A24 21 Aug 2018
While it's overkill to flash and test each of the above, it would seem
likely that the issue was contained within A0x BIOS versions, given the
dates above and the dates of issue reports[4] from distros. So rather than
just throw out the quirk entirely, limit the scope to just those early BIOS
versions, in case people are still running systems from 2011 with the
original as-shipped early A0x BIOS versions.
[1] https://lore.kernel.org/lkml/1320373471-3942-1-git-send-email-trenn@suse.de/
[2] https://www.dell.com/support/kbdoc/en-ca/000131908/linux-based-operating-systems-stall-upon-reboot-on-optiplex-390-790-990-systems
[3] https://www.dell.com/support/home/en-ca/drivers/driversdetails?driverid=85j10
[4] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/768039
Fixes: 6be30bb7d750 ("x86/reboot: Blacklist Dell OptiPlex 990 known to require PCI reboot")
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210530162447.996461-4-paul.gortmaker@windriver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/reboot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -388,10 +388,11 @@ static const struct dmi_system_id reboot
},
{ /* Handle problems with rebooting on the OptiPlex 990. */
.callback = set_pci_reboot,
- .ident = "Dell OptiPlex 990",
+ .ident = "Dell OptiPlex 990 BIOS A0x",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+ DMI_MATCH(DMI_BIOS_VERSION, "A0"),
},
},
{ /* Handle problems with rebooting on Dell 300's */
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 028/217] PCI: Call Max Payload Size-related fixup quirks early
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 027/217] x86/reboot: Limit Dell Optiplex 990 quirk to early BIOS versions Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 029/217] regmap: fix the offset of register error log Greg Kroah-Hartman
` (190 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Marek Behún, Bjorn Helgaas
From: Marek Behún <kabel@kernel.org>
commit b8da302e2955fe4d41eb9d48199242674d77dbe0 upstream.
pci_device_add() calls HEADER fixups after pci_configure_device(), which
configures Max Payload Size.
Convert MPS-related fixups to EARLY fixups so pci_configure_mps() takes
them into account.
Fixes: 27d868b5e6cfa ("PCI: Set MPS to match upstream bridge")
Link: https://lore.kernel.org/r/20210624171418.27194-1-kabel@kernel.org
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pci/quirks.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3034,12 +3034,12 @@ static void fixup_mpss_256(struct pci_de
{
dev->pcie_mpss = 1; /* 256 bytes */
}
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE,
- PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0, fixup_mpss_256);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE,
- PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1, fixup_mpss_256);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE,
- PCI_DEVICE_ID_SOLARFLARE_SFC4000B, fixup_mpss_256);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE,
+ PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0, fixup_mpss_256);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE,
+ PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1, fixup_mpss_256);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE,
+ PCI_DEVICE_ID_SOLARFLARE_SFC4000B, fixup_mpss_256);
/* Intel 5000 and 5100 Memory controllers have an errata with read completion
* coalescing (which is enabled by default on some BIOSes) and MPS of 256B.
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 029/217] regmap: fix the offset of register error log
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 028/217] PCI: Call Max Payload Size-related fixup quirks early Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 030/217] crypto: mxs-dcp - Check for DMA mapping errors Greg Kroah-Hartman
` (189 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Jeongtae Park, Mark Brown,
Sasha Levin
From: Jeongtae Park <jeongtae.park@gmail.com>
[ Upstream commit 1852f5ed358147095297a09cc3c6f160208a676d ]
This patch fixes the offset of register error log
by using regmap_get_offset().
Signed-off-by: Jeongtae Park <jeongtae.park@gmail.com>
Link: https://lore.kernel.org/r/20210701142630.44936-1-jeongtae.park@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/regmap/regmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 4e0cc40ad9ce..1c5ff22d92f1 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1378,7 +1378,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
if (ret) {
dev_err(map->dev,
"Error in caching of register: %x ret: %d\n",
- reg + i, ret);
+ reg + regmap_get_offset(map, i), ret);
return ret;
}
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 030/217] crypto: mxs-dcp - Check for DMA mapping errors
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 029/217] regmap: fix the offset of register error log Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 031/217] power: supply: axp288_fuel_gauge: Report register-address on readb / writeb errors Greg Kroah-Hartman
` (188 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sean Anderson, Richard Weinberger,
Herbert Xu, Sasha Levin
From: Sean Anderson <sean.anderson@seco.com>
[ Upstream commit df6313d707e575a679ada3313358289af24454c0 ]
After calling dma_map_single(), we must also call dma_mapping_error().
This fixes the following warning when compiling with CONFIG_DMA_API_DEBUG:
[ 311.241478] WARNING: CPU: 0 PID: 428 at kernel/dma/debug.c:1027 check_unmap+0x79c/0x96c
[ 311.249547] DMA-API: mxs-dcp 2280000.crypto: device driver failed to check map error[device address=0x00000000860cb080] [size=32 bytes] [mapped as single]
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/mxs-dcp.c | 45 +++++++++++++++++++++++++++++++---------
1 file changed, 35 insertions(+), 10 deletions(-)
diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
index eb569cf06309..96b6808847c7 100644
--- a/drivers/crypto/mxs-dcp.c
+++ b/drivers/crypto/mxs-dcp.c
@@ -167,15 +167,19 @@ static struct dcp *global_sdcp;
static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)
{
+ int dma_err;
struct dcp *sdcp = global_sdcp;
const int chan = actx->chan;
uint32_t stat;
unsigned long ret;
struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan];
-
dma_addr_t desc_phys = dma_map_single(sdcp->dev, desc, sizeof(*desc),
DMA_TO_DEVICE);
+ dma_err = dma_mapping_error(sdcp->dev, desc_phys);
+ if (dma_err)
+ return dma_err;
+
reinit_completion(&sdcp->completion[chan]);
/* Clear status register. */
@@ -213,18 +217,29 @@ static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)
static int mxs_dcp_run_aes(struct dcp_async_ctx *actx,
struct ablkcipher_request *req, int init)
{
+ dma_addr_t key_phys, src_phys, dst_phys;
struct dcp *sdcp = global_sdcp;
struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan];
struct dcp_aes_req_ctx *rctx = ablkcipher_request_ctx(req);
int ret;
- dma_addr_t key_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_key,
- 2 * AES_KEYSIZE_128,
- DMA_TO_DEVICE);
- dma_addr_t src_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_in_buf,
- DCP_BUF_SZ, DMA_TO_DEVICE);
- dma_addr_t dst_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_out_buf,
- DCP_BUF_SZ, DMA_FROM_DEVICE);
+ key_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_key,
+ 2 * AES_KEYSIZE_128, DMA_TO_DEVICE);
+ ret = dma_mapping_error(sdcp->dev, key_phys);
+ if (ret)
+ return ret;
+
+ src_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_in_buf,
+ DCP_BUF_SZ, DMA_TO_DEVICE);
+ ret = dma_mapping_error(sdcp->dev, src_phys);
+ if (ret)
+ goto err_src;
+
+ dst_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_out_buf,
+ DCP_BUF_SZ, DMA_FROM_DEVICE);
+ ret = dma_mapping_error(sdcp->dev, dst_phys);
+ if (ret)
+ goto err_dst;
if (actx->fill % AES_BLOCK_SIZE) {
dev_err(sdcp->dev, "Invalid block size!\n");
@@ -262,10 +277,12 @@ static int mxs_dcp_run_aes(struct dcp_async_ctx *actx,
ret = mxs_dcp_start_dma(actx);
aes_done_run:
+ dma_unmap_single(sdcp->dev, dst_phys, DCP_BUF_SZ, DMA_FROM_DEVICE);
+err_dst:
+ dma_unmap_single(sdcp->dev, src_phys, DCP_BUF_SZ, DMA_TO_DEVICE);
+err_src:
dma_unmap_single(sdcp->dev, key_phys, 2 * AES_KEYSIZE_128,
DMA_TO_DEVICE);
- dma_unmap_single(sdcp->dev, src_phys, DCP_BUF_SZ, DMA_TO_DEVICE);
- dma_unmap_single(sdcp->dev, dst_phys, DCP_BUF_SZ, DMA_FROM_DEVICE);
return ret;
}
@@ -565,6 +582,10 @@ static int mxs_dcp_run_sha(struct ahash_request *req)
dma_addr_t buf_phys = dma_map_single(sdcp->dev, sdcp->coh->sha_in_buf,
DCP_BUF_SZ, DMA_TO_DEVICE);
+ ret = dma_mapping_error(sdcp->dev, buf_phys);
+ if (ret)
+ return ret;
+
/* Fill in the DMA descriptor. */
desc->control0 = MXS_DCP_CONTROL0_DECR_SEMAPHORE |
MXS_DCP_CONTROL0_INTERRUPT |
@@ -597,6 +618,10 @@ static int mxs_dcp_run_sha(struct ahash_request *req)
if (rctx->fini) {
digest_phys = dma_map_single(sdcp->dev, sdcp->coh->sha_out_buf,
DCP_SHA_PAY_SZ, DMA_FROM_DEVICE);
+ ret = dma_mapping_error(sdcp->dev, digest_phys);
+ if (ret)
+ goto done_run;
+
desc->control0 |= MXS_DCP_CONTROL0_HASH_TERM;
desc->payload = digest_phys;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 031/217] power: supply: axp288_fuel_gauge: Report register-address on readb / writeb errors
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 030/217] crypto: mxs-dcp - Check for DMA mapping errors Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 032/217] crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop() Greg Kroah-Hartman
` (187 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Hans de Goede, Sebastian Reichel,
Sasha Levin
From: Hans de Goede <hdegoede@redhat.com>
[ Upstream commit caa534c3ba40c6e8352b42cbbbca9ba481814ac8 ]
When fuel_gauge_reg_readb()/_writeb() fails, report which register we
were trying to read / write when the error happened.
Also reword the message a bit:
- Drop the axp288 prefix, dev_err() already prints this
- Switch from telegram / abbreviated style to a normal sentence, aligning
the message with those from fuel_gauge_read_*bit_word()
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/axp288_fuel_gauge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
index a8dcabc32721..1fe18c365c87 100644
--- a/drivers/power/supply/axp288_fuel_gauge.c
+++ b/drivers/power/supply/axp288_fuel_gauge.c
@@ -142,7 +142,7 @@ static int fuel_gauge_reg_readb(struct axp288_fg_info *info, int reg)
}
if (ret < 0) {
- dev_err(&info->pdev->dev, "axp288 reg read err:%d\n", ret);
+ dev_err(&info->pdev->dev, "Error reading reg 0x%02x err: %d\n", reg, ret);
return ret;
}
@@ -156,7 +156,7 @@ static int fuel_gauge_reg_writeb(struct axp288_fg_info *info, int reg, u8 val)
ret = regmap_write(info->regmap, reg, (unsigned int)val);
if (ret < 0)
- dev_err(&info->pdev->dev, "axp288 reg write err:%d\n", ret);
+ dev_err(&info->pdev->dev, "Error writing reg 0x%02x err: %d\n", reg, ret);
return ret;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 032/217] crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 031/217] power: supply: axp288_fuel_gauge: Report register-address on readb / writeb errors Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 033/217] udf: Check LVID earlier Greg Kroah-Hartman
` (186 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Lokesh Vutla, Tero Kristo,
Tony Lindgren, Herbert Xu, Sasha Levin
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit fe28140b3393b0ba1eb95cc109f974a7e58b26fd ]
We should not clear FLAGS_DMA_ACTIVE before omap_sham_update_dma_stop() is
done calling dma_unmap_sg(). We already clear FLAGS_DMA_ACTIVE at the
end of omap_sham_update_dma_stop().
The early clearing of FLAGS_DMA_ACTIVE is not causing issues as we do not
need to defer anything based on FLAGS_DMA_ACTIVE currently. So this can be
applied as clean-up.
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Tero Kristo <kristo@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/omap-sham.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index e34e9561e77d..adf958956982 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1746,7 +1746,7 @@ static void omap_sham_done_task(unsigned long data)
if (test_and_clear_bit(FLAGS_OUTPUT_READY, &dd->flags))
goto finish;
} else if (test_bit(FLAGS_DMA_READY, &dd->flags)) {
- if (test_and_clear_bit(FLAGS_DMA_ACTIVE, &dd->flags)) {
+ if (test_bit(FLAGS_DMA_ACTIVE, &dd->flags)) {
omap_sham_update_dma_stop(dd);
if (dd->err) {
err = dd->err;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 033/217] udf: Check LVID earlier
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 032/217] crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop() Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 034/217] isofs: joliet: Fix iocharset=utf8 mount option Greg Kroah-Hartman
` (185 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, syzbot+7fbfe5fed73ebb675748, Jan Kara,
Sasha Levin
From: Jan Kara <jack@suse.cz>
[ Upstream commit 781d2a9a2fc7d0be53a072794dc03ef6de770f3d ]
We were checking validity of LVID entries only when getting
implementation use information from LVID in udf_sb_lvidiu(). However if
the LVID is suitably corrupted, it can cause problems also to code such
as udf_count_free() which doesn't use udf_sb_lvidiu(). So check validity
of LVID already when loading it from the disk and just disable LVID
altogether when it is not valid.
Reported-by: syzbot+7fbfe5fed73ebb675748@syzkaller.appspotmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/udf/super.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 2b8147ecd97f..70b56011b823 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -113,16 +113,10 @@ struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct super_block *sb)
return NULL;
lvid = (struct logicalVolIntegrityDesc *)UDF_SB(sb)->s_lvid_bh->b_data;
partnum = le32_to_cpu(lvid->numOfPartitions);
- if ((sb->s_blocksize - sizeof(struct logicalVolIntegrityDescImpUse) -
- offsetof(struct logicalVolIntegrityDesc, impUse)) /
- (2 * sizeof(uint32_t)) < partnum) {
- udf_err(sb, "Logical volume integrity descriptor corrupted "
- "(numOfPartitions = %u)!\n", partnum);
- return NULL;
- }
/* The offset is to skip freeSpaceTable and sizeTable arrays */
offset = partnum * 2 * sizeof(uint32_t);
- return (struct logicalVolIntegrityDescImpUse *)&(lvid->impUse[offset]);
+ return (struct logicalVolIntegrityDescImpUse *)
+ (((uint8_t *)(lvid + 1)) + offset);
}
/* UDF filesystem type */
@@ -1565,6 +1559,7 @@ static void udf_load_logicalvolint(struct super_block *sb, struct kernel_extent_
struct udf_sb_info *sbi = UDF_SB(sb);
struct logicalVolIntegrityDesc *lvid;
int indirections = 0;
+ u32 parts, impuselen;
while (++indirections <= UDF_MAX_LVID_NESTING) {
final_bh = NULL;
@@ -1591,15 +1586,27 @@ static void udf_load_logicalvolint(struct super_block *sb, struct kernel_extent_
lvid = (struct logicalVolIntegrityDesc *)final_bh->b_data;
if (lvid->nextIntegrityExt.extLength == 0)
- return;
+ goto check;
loc = leea_to_cpu(lvid->nextIntegrityExt);
}
udf_warn(sb, "Too many LVID indirections (max %u), ignoring.\n",
UDF_MAX_LVID_NESTING);
+out_err:
brelse(sbi->s_lvid_bh);
sbi->s_lvid_bh = NULL;
+ return;
+check:
+ parts = le32_to_cpu(lvid->numOfPartitions);
+ impuselen = le32_to_cpu(lvid->lengthOfImpUse);
+ if (parts >= sb->s_blocksize || impuselen >= sb->s_blocksize ||
+ sizeof(struct logicalVolIntegrityDesc) + impuselen +
+ 2 * parts * sizeof(u32) > sb->s_blocksize) {
+ udf_warn(sb, "Corrupted LVID (parts=%u, impuselen=%u), "
+ "ignoring.\n", parts, impuselen);
+ goto out_err;
+ }
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 034/217] isofs: joliet: Fix iocharset=utf8 mount option
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 033/217] udf: Check LVID earlier Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 035/217] nvme-rdma: dont update queue count when failing to set io queues Greg Kroah-Hartman
` (184 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Pali Rohár, Jan Kara,
Sasha Levin
From: Pali Rohár <pali@kernel.org>
[ Upstream commit 28ce50f8d96ec9035f60c9348294ea26b94db944 ]
Currently iocharset=utf8 mount option is broken. To use UTF-8 as iocharset,
it is required to use utf8 mount option.
Fix iocharset=utf8 mount option to use be equivalent to the utf8 mount
option.
If UTF-8 as iocharset is used then s_nls_iocharset is set to NULL. So
simplify code around, remove s_utf8 field as to distinguish between UTF-8
and non-UTF-8 it is needed just to check if s_nls_iocharset is set to NULL
or not.
Link: https://lore.kernel.org/r/20210808162453.1653-5-pali@kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/isofs/inode.c | 27 +++++++++++++--------------
fs/isofs/isofs.h | 1 -
fs/isofs/joliet.c | 4 +---
3 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index a4994e25e19e..f1134752cea3 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -157,7 +157,6 @@ struct iso9660_options{
unsigned int overriderockperm:1;
unsigned int uid_set:1;
unsigned int gid_set:1;
- unsigned int utf8:1;
unsigned char map;
unsigned char check;
unsigned int blocksize;
@@ -357,7 +356,6 @@ static int parse_options(char *options, struct iso9660_options *popt)
popt->gid = GLOBAL_ROOT_GID;
popt->uid = GLOBAL_ROOT_UID;
popt->iocharset = NULL;
- popt->utf8 = 0;
popt->overriderockperm = 0;
popt->session=-1;
popt->sbsector=-1;
@@ -390,10 +388,13 @@ static int parse_options(char *options, struct iso9660_options *popt)
case Opt_cruft:
popt->cruft = 1;
break;
+#ifdef CONFIG_JOLIET
case Opt_utf8:
- popt->utf8 = 1;
+ kfree(popt->iocharset);
+ popt->iocharset = kstrdup("utf8", GFP_KERNEL);
+ if (!popt->iocharset)
+ return 0;
break;
-#ifdef CONFIG_JOLIET
case Opt_iocharset:
kfree(popt->iocharset);
popt->iocharset = match_strdup(&args[0]);
@@ -496,7 +497,6 @@ static int isofs_show_options(struct seq_file *m, struct dentry *root)
if (sbi->s_nocompress) seq_puts(m, ",nocompress");
if (sbi->s_overriderockperm) seq_puts(m, ",overriderockperm");
if (sbi->s_showassoc) seq_puts(m, ",showassoc");
- if (sbi->s_utf8) seq_puts(m, ",utf8");
if (sbi->s_check) seq_printf(m, ",check=%c", sbi->s_check);
if (sbi->s_mapping) seq_printf(m, ",map=%c", sbi->s_mapping);
@@ -519,9 +519,10 @@ static int isofs_show_options(struct seq_file *m, struct dentry *root)
seq_printf(m, ",fmode=%o", sbi->s_fmode);
#ifdef CONFIG_JOLIET
- if (sbi->s_nls_iocharset &&
- strcmp(sbi->s_nls_iocharset->charset, CONFIG_NLS_DEFAULT) != 0)
+ if (sbi->s_nls_iocharset)
seq_printf(m, ",iocharset=%s", sbi->s_nls_iocharset->charset);
+ else
+ seq_puts(m, ",iocharset=utf8");
#endif
return 0;
}
@@ -865,14 +866,13 @@ root_found:
sbi->s_nls_iocharset = NULL;
#ifdef CONFIG_JOLIET
- if (joliet_level && opt.utf8 == 0) {
+ if (joliet_level) {
char *p = opt.iocharset ? opt.iocharset : CONFIG_NLS_DEFAULT;
- sbi->s_nls_iocharset = load_nls(p);
- if (! sbi->s_nls_iocharset) {
- /* Fail only if explicit charset specified */
- if (opt.iocharset)
+ if (strcmp(p, "utf8") != 0) {
+ sbi->s_nls_iocharset = opt.iocharset ?
+ load_nls(opt.iocharset) : load_nls_default();
+ if (!sbi->s_nls_iocharset)
goto out_freesbi;
- sbi->s_nls_iocharset = load_nls_default();
}
}
#endif
@@ -888,7 +888,6 @@ root_found:
sbi->s_gid = opt.gid;
sbi->s_uid_set = opt.uid_set;
sbi->s_gid_set = opt.gid_set;
- sbi->s_utf8 = opt.utf8;
sbi->s_nocompress = opt.nocompress;
sbi->s_overriderockperm = opt.overriderockperm;
/*
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
index 8e42b4fbefdc..b4b9d4861c9d 100644
--- a/fs/isofs/isofs.h
+++ b/fs/isofs/isofs.h
@@ -44,7 +44,6 @@ struct isofs_sb_info {
unsigned char s_session;
unsigned int s_high_sierra:1;
unsigned int s_rock:2;
- unsigned int s_utf8:1;
unsigned int s_cruft:1; /* Broken disks with high byte of length
* containing junk */
unsigned int s_nocompress:1;
diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c
index be8b6a9d0b92..c0f04a1e7f69 100644
--- a/fs/isofs/joliet.c
+++ b/fs/isofs/joliet.c
@@ -41,14 +41,12 @@ uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls)
int
get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, struct inode * inode)
{
- unsigned char utf8;
struct nls_table *nls;
unsigned char len = 0;
- utf8 = ISOFS_SB(inode->i_sb)->s_utf8;
nls = ISOFS_SB(inode->i_sb)->s_nls_iocharset;
- if (utf8) {
+ if (!nls) {
len = utf16s_to_utf8s((const wchar_t *) de->name,
de->name_len[0] >> 1, UTF16_BIG_ENDIAN,
outname, PAGE_SIZE);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 035/217] nvme-rdma: dont update queue count when failing to set io queues
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 034/217] isofs: joliet: Fix iocharset=utf8 mount option Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 036/217] power: supply: max17042_battery: fix typo in MAx17042_TOFF Greg Kroah-Hartman
` (183 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ruozhu Li, Sagi Grimberg,
Christoph Hellwig, Sasha Levin
From: Ruozhu Li <liruozhu@huawei.com>
[ Upstream commit 85032874f80ba17bf187de1d14d9603bf3f582b8 ]
We update ctrl->queue_count and schedule another reconnect when io queue
count is zero.But we will never try to create any io queue in next reco-
nnection, because ctrl->queue_count already set to zero.We will end up
having an admin-only session in Live state, which is exactly what we try
to avoid in the original patch.
Update ctrl->queue_count after queue_count zero checking to fix it.
Signed-off-by: Ruozhu Li <liruozhu@huawei.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/rdma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 57e1c0dd63c4..11fd3a7484ac 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -654,13 +654,13 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl)
if (ret)
return ret;
- ctrl->ctrl.queue_count = nr_io_queues + 1;
- if (ctrl->ctrl.queue_count < 2) {
+ if (nr_io_queues == 0) {
dev_err(ctrl->ctrl.device,
"unable to set any I/O queues\n");
return -ENOMEM;
}
+ ctrl->ctrl.queue_count = nr_io_queues + 1;
dev_info(ctrl->ctrl.device,
"creating %d I/O queues.\n", nr_io_queues);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 036/217] power: supply: max17042_battery: fix typo in MAx17042_TOFF
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 035/217] nvme-rdma: dont update queue count when failing to set io queues Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 037/217] s390/cio: add dev_busid sysfs entry for each subchannel Greg Kroah-Hartman
` (182 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sebastian Krzyszkowiak,
Sebastian Reichel, Sasha Levin
From: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
[ Upstream commit ed0d0a0506025f06061325cedae1bbebd081620a ]
Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/max17042_battery.c | 2 +-
include/linux/power/max17042_battery.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index 911d42366ef1..e824ab19318a 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -717,7 +717,7 @@ static inline void max17042_override_por_values(struct max17042_chip *chip)
struct max17042_config_data *config = chip->pdata->config_data;
max17042_override_por(map, MAX17042_TGAIN, config->tgain);
- max17042_override_por(map, MAx17042_TOFF, config->toff);
+ max17042_override_por(map, MAX17042_TOFF, config->toff);
max17042_override_por(map, MAX17042_CGAIN, config->cgain);
max17042_override_por(map, MAX17042_COFF, config->coff);
diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h
index a7ed29baf44a..86e5ad8aeee4 100644
--- a/include/linux/power/max17042_battery.h
+++ b/include/linux/power/max17042_battery.h
@@ -82,7 +82,7 @@ enum max17042_register {
MAX17042_RelaxCFG = 0x2A,
MAX17042_MiscCFG = 0x2B,
MAX17042_TGAIN = 0x2C,
- MAx17042_TOFF = 0x2D,
+ MAX17042_TOFF = 0x2D,
MAX17042_CGAIN = 0x2E,
MAX17042_COFF = 0x2F,
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 037/217] s390/cio: add dev_busid sysfs entry for each subchannel
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 036/217] power: supply: max17042_battery: fix typo in MAx17042_TOFF Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:40 ` [PATCH 4.14 038/217] libata: fix ata_host_start() Greg Kroah-Hartman
` (181 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Vineeth Vijayan, Peter Oberparleiter,
Vasily Gorbik, Sasha Levin
From: Vineeth Vijayan <vneethv@linux.ibm.com>
[ Upstream commit d3683c055212bf910d4e318f7944910ce10dbee6 ]
Introduce dev_busid, which exports the device-id associated with the
io-subchannel (and message-subchannel). The dev_busid indicates that of
the device which may be physically installed on the corrosponding
subchannel. The dev_busid value "none" indicates that the subchannel
is not valid, there is no I/O device currently associated with the
subchannel.
The dev_busid information would be helpful to write device-specific
udev-rules associated with the subchannel. The dev_busid interface would
be available even when the sch is not bound to any driver or if there is
no operational device connected on it. Hence this attribute can be used to
write udev-rules which are specific to the device associated with the
subchannel.
Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/cio/css.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index e2026d54dd37..435e804b6b8b 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -330,9 +330,26 @@ static ssize_t pimpampom_show(struct device *dev,
}
static DEVICE_ATTR(pimpampom, 0444, pimpampom_show, NULL);
+static ssize_t dev_busid_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct subchannel *sch = to_subchannel(dev);
+ struct pmcw *pmcw = &sch->schib.pmcw;
+
+ if ((pmcw->st == SUBCHANNEL_TYPE_IO ||
+ pmcw->st == SUBCHANNEL_TYPE_MSG) && pmcw->dnv)
+ return sysfs_emit(buf, "0.%x.%04x\n", sch->schid.ssid,
+ pmcw->dev);
+ else
+ return sysfs_emit(buf, "none\n");
+}
+static DEVICE_ATTR_RO(dev_busid);
+
static struct attribute *io_subchannel_type_attrs[] = {
&dev_attr_chpids.attr,
&dev_attr_pimpampom.attr,
+ &dev_attr_dev_busid.attr,
NULL,
};
ATTRIBUTE_GROUPS(io_subchannel_type);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 038/217] libata: fix ata_host_start()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 037/217] s390/cio: add dev_busid sysfs entry for each subchannel Greg Kroah-Hartman
@ 2021-09-20 16:40 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 039/217] crypto: qat - do not ignore errors from enable_vf2pf_comms() Greg Kroah-Hartman
` (180 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:40 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, kernel test robot, Damien Le Moal,
Hannes Reinecke, Jens Axboe, Sasha Levin
From: Damien Le Moal <damien.lemoal@wdc.com>
[ Upstream commit 355a8031dc174450ccad2a61c513ad7222d87a97 ]
The loop on entry of ata_host_start() may not initialize host->ops to a
non NULL value. The test on the host_stop field of host->ops must then
be preceded by a check that host->ops is not NULL.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20210816014456.2191776-3-damien.lemoal@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index c28b0ca24907..0f0ed04de886 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6339,7 +6339,7 @@ int ata_host_start(struct ata_host *host)
have_stop = 1;
}
- if (host->ops->host_stop)
+ if (host->ops && host->ops->host_stop)
have_stop = 1;
if (have_stop) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 039/217] crypto: qat - do not ignore errors from enable_vf2pf_comms()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2021-09-20 16:40 ` [PATCH 4.14 038/217] libata: fix ata_host_start() Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 040/217] crypto: qat - handle both source of interrupt in VF ISR Greg Kroah-Hartman
` (179 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Giovanni Cabiddu, Marco Chiappero,
Fiona Trahe, Herbert Xu, Sasha Levin
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
[ Upstream commit 5147f0906d50a9d26f2b8698cd06b5680e9867ff ]
The function adf_dev_init() ignores the error code reported by
enable_vf2pf_comms(). If the latter fails, e.g. the VF is not compatible
with the pf, then the load of the VF driver progresses.
This patch changes adf_dev_init() so that the error code from
enable_vf2pf_comms() is returned to the caller.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Marco Chiappero <marco.chiappero@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/qat/qat_common/adf_init.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/qat/qat_common/adf_init.c b/drivers/crypto/qat/qat_common/adf_init.c
index 26556c713049..7a7d43c47534 100644
--- a/drivers/crypto/qat/qat_common/adf_init.c
+++ b/drivers/crypto/qat/qat_common/adf_init.c
@@ -105,6 +105,7 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
struct service_hndl *service;
struct list_head *list_itr;
struct adf_hw_device_data *hw_data = accel_dev->hw_device;
+ int ret;
if (!hw_data) {
dev_err(&GET_DEV(accel_dev),
@@ -171,9 +172,9 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
}
hw_data->enable_error_correction(accel_dev);
- hw_data->enable_vf2pf_comms(accel_dev);
+ ret = hw_data->enable_vf2pf_comms(accel_dev);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(adf_dev_init);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 040/217] crypto: qat - handle both source of interrupt in VF ISR
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 039/217] crypto: qat - do not ignore errors from enable_vf2pf_comms() Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 041/217] crypto: qat - fix reuse of completion variable Greg Kroah-Hartman
` (178 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Giovanni Cabiddu, Marco Chiappero,
Fiona Trahe, Herbert Xu, Sasha Levin
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
[ Upstream commit 0a73c762e1eee33a5e5dc0e3488f1b7cd17249b3 ]
The top half of the VF drivers handled only a source at the time.
If an interrupt for PF2VF and bundle occurred at the same time, the ISR
scheduled only the bottom half for PF2VF.
This patch fixes the VF top half so that if both sources of interrupt
trigger at the same time, both bottom halves are scheduled.
This patch is based on earlier work done by Conor McLoughlin.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Marco Chiappero <marco.chiappero@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/qat/qat_common/adf_vf_isr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/qat/qat_common/adf_vf_isr.c b/drivers/crypto/qat/qat_common/adf_vf_isr.c
index df9a1f35b832..ef90902c8200 100644
--- a/drivers/crypto/qat/qat_common/adf_vf_isr.c
+++ b/drivers/crypto/qat/qat_common/adf_vf_isr.c
@@ -203,6 +203,7 @@ static irqreturn_t adf_isr(int irq, void *privdata)
struct adf_bar *pmisc =
&GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
void __iomem *pmisc_bar_addr = pmisc->virt_addr;
+ bool handled = false;
u32 v_int;
/* Read VF INT source CSR to determine the source of VF interrupt */
@@ -215,7 +216,7 @@ static irqreturn_t adf_isr(int irq, void *privdata)
/* Schedule tasklet to handle interrupt BH */
tasklet_hi_schedule(&accel_dev->vf.pf2vf_bh_tasklet);
- return IRQ_HANDLED;
+ handled = true;
}
/* Check bundle interrupt */
@@ -227,10 +228,10 @@ static irqreturn_t adf_isr(int irq, void *privdata)
WRITE_CSR_INT_FLAG_AND_COL(bank->csr_addr, bank->bank_number,
0);
tasklet_hi_schedule(&bank->resp_handler);
- return IRQ_HANDLED;
+ handled = true;
}
- return IRQ_NONE;
+ return handled ? IRQ_HANDLED : IRQ_NONE;
}
static int adf_request_msi_irq(struct adf_accel_dev *accel_dev)
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 041/217] crypto: qat - fix reuse of completion variable
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 040/217] crypto: qat - handle both source of interrupt in VF ISR Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 042/217] crypto: qat - fix naming for init/shutdown VF to PF notifications Greg Kroah-Hartman
` (177 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Marco Chiappero, Giovanni Cabiddu,
Fiona Trahe, Herbert Xu, Sasha Levin
From: Marco Chiappero <marco.chiappero@intel.com>
[ Upstream commit 3d655732b0199562267a05c7ff69ecdd11632939 ]
Use reinit_completion() to set to a clean state a completion variable,
used to coordinate the VF to PF request-response flow, before every
new VF request.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Co-developed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/qat/qat_common/adf_pf2vf_msg.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
index b3875fdf6cd7..9dab2cc11fdf 100644
--- a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
+++ b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
@@ -361,6 +361,8 @@ static int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev)
msg |= ADF_PFVF_COMPATIBILITY_VERSION << ADF_VF2PF_COMPAT_VER_REQ_SHIFT;
BUILD_BUG_ON(ADF_PFVF_COMPATIBILITY_VERSION > 255);
+ reinit_completion(&accel_dev->vf.iov_msg_completion);
+
/* Send request from VF to PF */
ret = adf_iov_putmsg(accel_dev, msg, 0);
if (ret) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 042/217] crypto: qat - fix naming for init/shutdown VF to PF notifications
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 041/217] crypto: qat - fix reuse of completion variable Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 043/217] crypto: qat - do not export adf_iov_putmsg() Greg Kroah-Hartman
` (176 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Marco Chiappero, Giovanni Cabiddu,
Fiona Trahe, Herbert Xu, Sasha Levin
From: Marco Chiappero <marco.chiappero@intel.com>
[ Upstream commit b90c1c4d3fa8cd90f4e8245b13564380fd0bfad1 ]
At start and shutdown, VFs notify the PF about their state. These
notifications are carried out through a message exchange using the PFVF
protocol.
Function names lead to believe they do perform init or shutdown logic.
This is to fix the naming to better reflect their purpose.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Co-developed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c | 4 ++--
drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c | 4 ++--
drivers/crypto/qat/qat_common/adf_common_drv.h | 8 ++++----
drivers/crypto/qat/qat_common/adf_vf2pf_msg.c | 12 ++++++------
.../qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c | 4 ++--
5 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c b/drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c
index d2d0ae445fd8..7c7d49a8a403 100644
--- a/drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c
+++ b/drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c
@@ -123,10 +123,10 @@ void adf_init_hw_data_c3xxxiov(struct adf_hw_device_data *hw_data)
hw_data->enable_error_correction = adf_vf_void_noop;
hw_data->init_admin_comms = adf_vf_int_noop;
hw_data->exit_admin_comms = adf_vf_void_noop;
- hw_data->send_admin_init = adf_vf2pf_init;
+ hw_data->send_admin_init = adf_vf2pf_notify_init;
hw_data->init_arb = adf_vf_int_noop;
hw_data->exit_arb = adf_vf_void_noop;
- hw_data->disable_iov = adf_vf2pf_shutdown;
+ hw_data->disable_iov = adf_vf2pf_notify_shutdown;
hw_data->get_accel_mask = get_accel_mask;
hw_data->get_ae_mask = get_ae_mask;
hw_data->get_num_accels = get_num_accels;
diff --git a/drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c b/drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c
index 38e4bc04f407..90e8a7564756 100644
--- a/drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c
+++ b/drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c
@@ -123,10 +123,10 @@ void adf_init_hw_data_c62xiov(struct adf_hw_device_data *hw_data)
hw_data->enable_error_correction = adf_vf_void_noop;
hw_data->init_admin_comms = adf_vf_int_noop;
hw_data->exit_admin_comms = adf_vf_void_noop;
- hw_data->send_admin_init = adf_vf2pf_init;
+ hw_data->send_admin_init = adf_vf2pf_notify_init;
hw_data->init_arb = adf_vf_int_noop;
hw_data->exit_arb = adf_vf_void_noop;
- hw_data->disable_iov = adf_vf2pf_shutdown;
+ hw_data->disable_iov = adf_vf2pf_notify_shutdown;
hw_data->get_accel_mask = get_accel_mask;
hw_data->get_ae_mask = get_ae_mask;
hw_data->get_num_accels = get_num_accels;
diff --git a/drivers/crypto/qat/qat_common/adf_common_drv.h b/drivers/crypto/qat/qat_common/adf_common_drv.h
index d78f8d5c89c3..289dd7e48d4a 100644
--- a/drivers/crypto/qat/qat_common/adf_common_drv.h
+++ b/drivers/crypto/qat/qat_common/adf_common_drv.h
@@ -239,8 +239,8 @@ void adf_enable_vf2pf_interrupts(struct adf_accel_dev *accel_dev,
void adf_enable_pf2vf_interrupts(struct adf_accel_dev *accel_dev);
void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev);
-int adf_vf2pf_init(struct adf_accel_dev *accel_dev);
-void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev);
+int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev);
+void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev);
int adf_init_pf_wq(void);
void adf_exit_pf_wq(void);
int adf_init_vf_wq(void);
@@ -263,12 +263,12 @@ static inline void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev)
{
}
-static inline int adf_vf2pf_init(struct adf_accel_dev *accel_dev)
+static inline int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev)
{
return 0;
}
-static inline void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev)
+static inline void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
{
}
diff --git a/drivers/crypto/qat/qat_common/adf_vf2pf_msg.c b/drivers/crypto/qat/qat_common/adf_vf2pf_msg.c
index cd5f37dffe8a..1830194567e8 100644
--- a/drivers/crypto/qat/qat_common/adf_vf2pf_msg.c
+++ b/drivers/crypto/qat/qat_common/adf_vf2pf_msg.c
@@ -49,14 +49,14 @@
#include "adf_pf2vf_msg.h"
/**
- * adf_vf2pf_init() - send init msg to PF
+ * adf_vf2pf_notify_init() - send init msg to PF
* @accel_dev: Pointer to acceleration VF device.
*
* Function sends an init messge from the VF to a PF
*
* Return: 0 on success, error code otherwise.
*/
-int adf_vf2pf_init(struct adf_accel_dev *accel_dev)
+int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev)
{
u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM |
(ADF_VF2PF_MSGTYPE_INIT << ADF_VF2PF_MSGTYPE_SHIFT));
@@ -69,17 +69,17 @@ int adf_vf2pf_init(struct adf_accel_dev *accel_dev)
set_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status);
return 0;
}
-EXPORT_SYMBOL_GPL(adf_vf2pf_init);
+EXPORT_SYMBOL_GPL(adf_vf2pf_notify_init);
/**
- * adf_vf2pf_shutdown() - send shutdown msg to PF
+ * adf_vf2pf_notify_shutdown() - send shutdown msg to PF
* @accel_dev: Pointer to acceleration VF device.
*
* Function sends a shutdown messge from the VF to a PF
*
* Return: void
*/
-void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev)
+void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
{
u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM |
(ADF_VF2PF_MSGTYPE_SHUTDOWN << ADF_VF2PF_MSGTYPE_SHIFT));
@@ -89,4 +89,4 @@ void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev)
dev_err(&GET_DEV(accel_dev),
"Failed to send Shutdown event to PF\n");
}
-EXPORT_SYMBOL_GPL(adf_vf2pf_shutdown);
+EXPORT_SYMBOL_GPL(adf_vf2pf_notify_shutdown);
diff --git a/drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c b/drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c
index a3b4dd8099a7..3a8361c83f0b 100644
--- a/drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c
+++ b/drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c
@@ -123,10 +123,10 @@ void adf_init_hw_data_dh895xcciov(struct adf_hw_device_data *hw_data)
hw_data->enable_error_correction = adf_vf_void_noop;
hw_data->init_admin_comms = adf_vf_int_noop;
hw_data->exit_admin_comms = adf_vf_void_noop;
- hw_data->send_admin_init = adf_vf2pf_init;
+ hw_data->send_admin_init = adf_vf2pf_notify_init;
hw_data->init_arb = adf_vf_int_noop;
hw_data->exit_arb = adf_vf_void_noop;
- hw_data->disable_iov = adf_vf2pf_shutdown;
+ hw_data->disable_iov = adf_vf2pf_notify_shutdown;
hw_data->get_accel_mask = get_accel_mask;
hw_data->get_ae_mask = get_ae_mask;
hw_data->get_num_accels = get_num_accels;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 043/217] crypto: qat - do not export adf_iov_putmsg()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 042/217] crypto: qat - fix naming for init/shutdown VF to PF notifications Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 044/217] udf_get_extendedattr() had no boundary checks Greg Kroah-Hartman
` (175 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Giovanni Cabiddu, Fiona Trahe,
Herbert Xu, Sasha Levin
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
[ Upstream commit 645ae0af1840199086c33e4f841892ebee73f615 ]
The function adf_iov_putmsg() is only used inside the intel_qat module
therefore should not be exported.
Remove EXPORT_SYMBOL for the function adf_iov_putmsg().
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/qat/qat_common/adf_pf2vf_msg.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
index 9dab2cc11fdf..c64481160b71 100644
--- a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
+++ b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
@@ -231,7 +231,6 @@ int adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr)
return ret;
}
-EXPORT_SYMBOL_GPL(adf_iov_putmsg);
void adf_vf2pf_req_hndl(struct adf_accel_vf_info *vf_info)
{
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 044/217] udf_get_extendedattr() had no boundary checks.
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 043/217] crypto: qat - do not export adf_iov_putmsg() Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 045/217] m68k: emu: Fix invalid free in nfeth_cleanup() Greg Kroah-Hartman
` (174 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Stian Skjelstad, Jan Kara,
Sasha Levin
From: Stian Skjelstad <stian.skjelstad@gmail.com>
[ Upstream commit 58bc6d1be2f3b0ceecb6027dfa17513ec6aa2abb ]
When parsing the ExtendedAttr data, malicous or corrupt attribute length
could cause kernel hangs and buffer overruns in some special cases.
Link: https://lore.kernel.org/r/20210822093332.25234-1-stian.skjelstad@gmail.com
Signed-off-by: Stian Skjelstad <stian.skjelstad@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/udf/misc.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 3949c4bec3a3..e5f4dcde309f 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -173,13 +173,22 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
else
offset = le32_to_cpu(eahd->appAttrLocation);
- while (offset < iinfo->i_lenEAttr) {
+ while (offset + sizeof(*gaf) < iinfo->i_lenEAttr) {
+ uint32_t attrLength;
+
gaf = (struct genericFormat *)&ea[offset];
+ attrLength = le32_to_cpu(gaf->attrLength);
+
+ /* Detect undersized elements and buffer overflows */
+ if ((attrLength < sizeof(*gaf)) ||
+ (attrLength > (iinfo->i_lenEAttr - offset)))
+ break;
+
if (le32_to_cpu(gaf->attrType) == type &&
gaf->attrSubtype == subtype)
return gaf;
else
- offset += le32_to_cpu(gaf->attrLength);
+ offset += attrLength;
}
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 045/217] m68k: emu: Fix invalid free in nfeth_cleanup()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 044/217] udf_get_extendedattr() had no boundary checks Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 046/217] spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config Greg Kroah-Hartman
` (173 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Pavel Skripkin, Geert Uytterhoeven,
Sasha Levin
From: Pavel Skripkin <paskripkin@gmail.com>
[ Upstream commit 761608f5cf70e8876c2f0e39ca54b516bdcb7c12 ]
In the for loop all nfeth_dev array members should be freed, not only
the first one. Freeing only the first array member can cause
double-free bugs and memory leaks.
Fixes: 9cd7b148312f ("m68k/atari: ARAnyM - Add support for network access")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20210705204727.10743-1-paskripkin@gmail.com
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/m68k/emu/nfeth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c
index e45ce4243aaa..76262dc40e79 100644
--- a/arch/m68k/emu/nfeth.c
+++ b/arch/m68k/emu/nfeth.c
@@ -258,8 +258,8 @@ static void __exit nfeth_cleanup(void)
for (i = 0; i < MAX_UNIT; i++) {
if (nfeth_dev[i]) {
- unregister_netdev(nfeth_dev[0]);
- free_netdev(nfeth_dev[0]);
+ unregister_netdev(nfeth_dev[i]);
+ free_netdev(nfeth_dev[i]);
}
}
free_irq(nfEtherIRQ, nfeth_interrupt);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 046/217] spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 045/217] m68k: emu: Fix invalid free in nfeth_cleanup() Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 047/217] spi: spi-pic32: " Greg Kroah-Hartman
` (172 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sanchayan Maity, Vladimir Oltean,
Peter Ujfalusi, Vinod Koul, Tony Lindgren, Mark Brown,
Sasha Levin
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit 209ab223ad5b18e437289235e3bde12593b94ac4 ]
Depending on the DMA driver being used, the struct dma_slave_config may
need to be initialized to zero for the unused data.
For example, we have three DMA drivers using src_port_window_size and
dst_port_window_size. If these are left uninitialized, it can cause DMA
failures.
For spi-fsl-dspi, this is probably not currently an issue but is still
good to fix though.
Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid")
Cc: Sanchayan Maity <maitysanchayan@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Cc: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20210810081727.19491-1-tony@atomide.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-fsl-dspi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index ed114f00a6d1..59f18e344bfb 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -394,6 +394,7 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
goto err_rx_dma_buf;
}
+ memset(&cfg, 0, sizeof(cfg));
cfg.src_addr = phy_addr + SPI_POPR;
cfg.dst_addr = phy_addr + SPI_PUSHR;
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 047/217] spi: spi-pic32: Fix issue with uninitialized dma_slave_config
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 046/217] spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 048/217] clocksource/drivers/sh_cmt: Fix wrong setting if dont request IRQ for clock source channel Greg Kroah-Hartman
` (171 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Purna Chandra Mandal, Peter Ujfalusi,
Vinod Koul, Tony Lindgren, Mark Brown, Sasha Levin
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit 976c1de1de147bb7f4e0d87482f375221c05aeaf ]
Depending on the DMA driver being used, the struct dma_slave_config may
need to be initialized to zero for the unused data.
For example, we have three DMA drivers using src_port_window_size and
dst_port_window_size. If these are left uninitialized, it can cause DMA
failures.
For spi-pic32, this is probably not currently an issue but is still good to
fix though.
Fixes: 1bcb9f8ceb67 ("spi: spi-pic32: Add PIC32 SPI master driver")
Cc: Purna Chandra Mandal <purna.mandal@microchip.com>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Cc: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210810081727.19491-2-tony@atomide.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-pic32.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c
index 661a40c653e9..d8cdb13ce3e4 100644
--- a/drivers/spi/spi-pic32.c
+++ b/drivers/spi/spi-pic32.c
@@ -369,6 +369,7 @@ static int pic32_spi_dma_config(struct pic32_spi *pic32s, u32 dma_width)
struct dma_slave_config cfg;
int ret;
+ memset(&cfg, 0, sizeof(cfg));
cfg.device_fc = true;
cfg.src_addr = pic32s->dma_base + buf_offset;
cfg.dst_addr = pic32s->dma_base + buf_offset;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 048/217] clocksource/drivers/sh_cmt: Fix wrong setting if dont request IRQ for clock source channel
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 047/217] spi: spi-pic32: " Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 049/217] crypto: qat - use proper type for vf_mask Greg Kroah-Hartman
` (170 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Phong Hoang, Niklas Söderlund,
Daniel Lezcano, Sasha Levin
From: Phong Hoang <phong.hoang.wz@renesas.com>
[ Upstream commit be83c3b6e7b8ff22f72827a613bf6f3aa5afadbb ]
If CMT instance has at least two channels, one channel will be used
as a clock source and another one used as a clock event device.
In that case, IRQ is not requested for clock source channel so
sh_cmt_clock_event_program_verify() might work incorrectly.
Besides, when a channel is only used for clock source, don't need to
re-set the next match_value since it should be maximum timeout as
it still is.
On the other hand, due to no IRQ, total_cycles is not counted up
when reaches compare match time (timer counter resets to zero),
so sh_cmt_clocksource_read() returns unexpected value.
Therefore, use 64-bit clocksoure's mask for 32-bit or 16-bit variants
will also lead to wrong delta calculation. Hence, this mask should
correspond to timer counter width, and above function just returns
the raw value of timer counter register.
Fixes: bfa76bb12f23 ("clocksource: sh_cmt: Request IRQ for clock event device only")
Fixes: 37e7742c55ba ("clocksource/drivers/sh_cmt: Fix clocksource width for 32-bit machines")
Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210422123443.73334-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clocksource/sh_cmt.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 3cd62f7c33e3..48eeee53a586 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -570,7 +570,8 @@ static int sh_cmt_start(struct sh_cmt_channel *ch, unsigned long flag)
ch->flags |= flag;
/* setup timeout if no clockevent */
- if ((flag == FLAG_CLOCKSOURCE) && (!(ch->flags & FLAG_CLOCKEVENT)))
+ if (ch->cmt->num_channels == 1 &&
+ flag == FLAG_CLOCKSOURCE && (!(ch->flags & FLAG_CLOCKEVENT)))
__sh_cmt_set_next(ch, ch->max_match_value);
out:
raw_spin_unlock_irqrestore(&ch->lock, flags);
@@ -606,20 +607,25 @@ static struct sh_cmt_channel *cs_to_sh_cmt(struct clocksource *cs)
static u64 sh_cmt_clocksource_read(struct clocksource *cs)
{
struct sh_cmt_channel *ch = cs_to_sh_cmt(cs);
- unsigned long flags;
u32 has_wrapped;
- u64 value;
- u32 raw;
- raw_spin_lock_irqsave(&ch->lock, flags);
- value = ch->total_cycles;
- raw = sh_cmt_get_counter(ch, &has_wrapped);
+ if (ch->cmt->num_channels == 1) {
+ unsigned long flags;
+ u64 value;
+ u32 raw;
- if (unlikely(has_wrapped))
- raw += ch->match_value + 1;
- raw_spin_unlock_irqrestore(&ch->lock, flags);
+ raw_spin_lock_irqsave(&ch->lock, flags);
+ value = ch->total_cycles;
+ raw = sh_cmt_get_counter(ch, &has_wrapped);
+
+ if (unlikely(has_wrapped))
+ raw += ch->match_value + 1;
+ raw_spin_unlock_irqrestore(&ch->lock, flags);
+
+ return value + raw;
+ }
- return value + raw;
+ return sh_cmt_get_counter(ch, &has_wrapped);
}
static int sh_cmt_clocksource_enable(struct clocksource *cs)
@@ -682,7 +688,7 @@ static int sh_cmt_register_clocksource(struct sh_cmt_channel *ch,
cs->disable = sh_cmt_clocksource_disable;
cs->suspend = sh_cmt_clocksource_suspend;
cs->resume = sh_cmt_clocksource_resume;
- cs->mask = CLOCKSOURCE_MASK(sizeof(u64) * 8);
+ cs->mask = CLOCKSOURCE_MASK(ch->cmt->info->width);
cs->flags = CLOCK_SOURCE_IS_CONTINUOUS;
dev_info(&ch->cmt->pdev->dev, "ch%u: used as clock source\n",
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 049/217] crypto: qat - use proper type for vf_mask
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 048/217] clocksource/drivers/sh_cmt: Fix wrong setting if dont request IRQ for clock source channel Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 050/217] certs: Trigger creation of RSA module signing key if its not an RSA key Greg Kroah-Hartman
` (169 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Giovanni Cabiddu, Marco Chiappero,
Fiona Trahe, Herbert Xu, Sasha Levin
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
[ Upstream commit 462354d986b6a89c6449b85f17aaacf44e455216 ]
Replace vf_mask type with unsigned long to avoid a stack-out-of-bound.
This is to fix the following warning reported by KASAN the first time
adf_msix_isr_ae() gets called.
[ 692.091987] BUG: KASAN: stack-out-of-bounds in find_first_bit+0x28/0x50
[ 692.092017] Read of size 8 at addr ffff88afdf789e60 by task swapper/32/0
[ 692.092076] Call Trace:
[ 692.092089] <IRQ>
[ 692.092101] dump_stack+0x9c/0xcf
[ 692.092132] print_address_description.constprop.0+0x18/0x130
[ 692.092164] ? find_first_bit+0x28/0x50
[ 692.092185] kasan_report.cold+0x7f/0x111
[ 692.092213] ? static_obj+0x10/0x80
[ 692.092234] ? find_first_bit+0x28/0x50
[ 692.092262] find_first_bit+0x28/0x50
[ 692.092288] adf_msix_isr_ae+0x16e/0x230 [intel_qat]
Fixes: ed8ccaef52fa ("crypto: qat - Add support for SRIOV")
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Marco Chiappero <marco.chiappero@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/qat/qat_common/adf_isr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/qat/qat_common/adf_isr.c b/drivers/crypto/qat/qat_common/adf_isr.c
index 2c0be14309cf..7877ba677220 100644
--- a/drivers/crypto/qat/qat_common/adf_isr.c
+++ b/drivers/crypto/qat/qat_common/adf_isr.c
@@ -59,6 +59,8 @@
#include "adf_transport_access_macros.h"
#include "adf_transport_internal.h"
+#define ADF_MAX_NUM_VFS 32
+
static int adf_enable_msix(struct adf_accel_dev *accel_dev)
{
struct adf_accel_pci *pci_dev_info = &accel_dev->accel_pci_dev;
@@ -111,7 +113,7 @@ static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr)
struct adf_bar *pmisc =
&GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
void __iomem *pmisc_bar_addr = pmisc->virt_addr;
- u32 vf_mask;
+ unsigned long vf_mask;
/* Get the interrupt sources triggered by VFs */
vf_mask = ((ADF_CSR_RD(pmisc_bar_addr, ADF_ERRSOU5) &
@@ -132,8 +134,7 @@ static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr)
* unless the VF is malicious and is attempting to
* flood the host OS with VF2PF interrupts.
*/
- for_each_set_bit(i, (const unsigned long *)&vf_mask,
- (sizeof(vf_mask) * BITS_PER_BYTE)) {
+ for_each_set_bit(i, &vf_mask, ADF_MAX_NUM_VFS) {
vf_info = accel_dev->pf.vf_info + i;
if (!__ratelimit(&vf_info->vf2pf_ratelimit)) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 050/217] certs: Trigger creation of RSA module signing key if its not an RSA key
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 049/217] crypto: qat - use proper type for vf_mask Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 051/217] soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally Greg Kroah-Hartman
` (168 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, David Howells, David Woodhouse,
Stefan Berger, Jarkko Sakkinen, Sasha Levin
From: Stefan Berger <stefanb@linux.ibm.com>
[ Upstream commit ea35e0d5df6c92fa2e124bb1b91d09b2240715ba ]
Address a kbuild issue where a developer created an ECDSA key for signing
kernel modules and then builds an older version of the kernel, when bi-
secting the kernel for example, that does not support ECDSA keys.
If openssl is installed, trigger the creation of an RSA module signing
key if it is not an RSA key.
Fixes: cfc411e7fff3 ("Move certificate handling to its own directory")
Cc: David Howells <dhowells@redhat.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
certs/Makefile | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/certs/Makefile b/certs/Makefile
index 5d0999b9e21b..ca3c71e3a3d9 100644
--- a/certs/Makefile
+++ b/certs/Makefile
@@ -46,11 +46,19 @@ endif
redirect_openssl = 2>&1
quiet_redirect_openssl = 2>&1
silent_redirect_openssl = 2>/dev/null
+openssl_available = $(shell openssl help 2>/dev/null && echo yes)
# We do it this way rather than having a boolean option for enabling an
# external private key, because 'make randconfig' might enable such a
# boolean option and we unfortunately can't make it depend on !RANDCONFIG.
ifeq ($(CONFIG_MODULE_SIG_KEY),"certs/signing_key.pem")
+
+ifeq ($(openssl_available),yes)
+X509TEXT=$(shell openssl x509 -in "certs/signing_key.pem" -text 2>/dev/null)
+
+$(if $(findstring rsaEncryption,$(X509TEXT)),,$(shell rm -f "certs/signing_key.pem"))
+endif
+
$(obj)/signing_key.pem: $(obj)/x509.genkey
@$(kecho) "###"
@$(kecho) "### Now generating an X.509 key pair to be used for signing modules."
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 051/217] soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 050/217] certs: Trigger creation of RSA module signing key if its not an RSA key Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 052/217] media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init Greg Kroah-Hartman
` (167 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Geert Uytterhoeven, Heiko Stuebner,
Sasha Levin
From: Geert Uytterhoeven <geert+renesas@glider.be>
[ Upstream commit 2a1c55d4762dd34a8b0f2e36fb01b7b16b60735b ]
Merely enabling CONFIG_COMPILE_TEST should not enable additional code.
To fix this, restrict the automatic enabling of ROCKCHIP_GRF to
ARCH_ROCKCHIP, and ask the user in case of compile-testing.
Fixes: 4c58063d4258f6be ("soc: rockchip: add driver handling grf setup")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210208143855.418374-1-geert+renesas@glider.be
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/rockchip/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/rockchip/Kconfig b/drivers/soc/rockchip/Kconfig
index 20da55d9cbb1..d483b0e29b81 100644
--- a/drivers/soc/rockchip/Kconfig
+++ b/drivers/soc/rockchip/Kconfig
@@ -5,8 +5,8 @@ if ARCH_ROCKCHIP || COMPILE_TEST
#
config ROCKCHIP_GRF
- bool
- default y
+ bool "Rockchip General Register Files support" if COMPILE_TEST
+ default y if ARCH_ROCKCHIP
help
The General Register Files are a central component providing
special additional settings registers for a lot of soc-components.
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 052/217] media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 051/217] soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 053/217] media: dvb-usb: fix uninit-value in vp702x_read_mac_addr Greg Kroah-Hartman
` (166 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, syzbot+e27b4fd589762b0b9329,
Dongliang Mu, Sean Young, Mauro Carvalho Chehab, Sasha Levin
From: Dongliang Mu <mudongliangabcd@gmail.com>
[ Upstream commit c5453769f77ce19a5b03f1f49946fd3f8a374009 ]
If dibusb_read_eeprom_byte fails, the mac address is not initialized.
And nova_t_read_mac_address does not handle this failure, which leads to
the uninit-value in dvb_usb_adapter_dvb_init.
Fix this by handling the failure of dibusb_read_eeprom_byte.
Reported-by: syzbot+e27b4fd589762b0b9329@syzkaller.appspotmail.com
Fixes: 786baecfe78f ("[media] dvb-usb: move it to drivers/media/usb/dvb-usb")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/usb/dvb-usb/nova-t-usb2.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/nova-t-usb2.c b/drivers/media/usb/dvb-usb/nova-t-usb2.c
index 1babd3341910..016a6d1ad279 100644
--- a/drivers/media/usb/dvb-usb/nova-t-usb2.c
+++ b/drivers/media/usb/dvb-usb/nova-t-usb2.c
@@ -133,7 +133,7 @@ ret:
static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6])
{
- int i;
+ int i, ret;
u8 b;
mac[0] = 0x00;
@@ -142,7 +142,9 @@ static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6])
/* this is a complete guess, but works for my box */
for (i = 136; i < 139; i++) {
- dibusb_read_eeprom_byte(d,i, &b);
+ ret = dibusb_read_eeprom_byte(d, i, &b);
+ if (ret)
+ return ret;
mac[5 - (i - 136)] = b;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 053/217] media: dvb-usb: fix uninit-value in vp702x_read_mac_addr
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 052/217] media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 054/217] media: go7007: remove redundant initialization Greg Kroah-Hartman
` (165 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dongliang Mu, Sean Young,
Mauro Carvalho Chehab, Sasha Levin
From: Dongliang Mu <mudongliangabcd@gmail.com>
[ Upstream commit 797c061ad715a9a1480eb73f44b6939fbe3209ed ]
If vp702x_usb_in_op fails, the mac address is not initialized.
And vp702x_read_mac_addr does not handle this failure, which leads to
the uninit-value in dvb_usb_adapter_dvb_init.
Fix this by handling the failure of vp702x_usb_in_op.
Fixes: 786baecfe78f ("[media] dvb-usb: move it to drivers/media/usb/dvb-usb")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/usb/dvb-usb/vp702x.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/vp702x.c b/drivers/media/usb/dvb-usb/vp702x.c
index 40de33de90a7..5c3b0a7ca27e 100644
--- a/drivers/media/usb/dvb-usb/vp702x.c
+++ b/drivers/media/usb/dvb-usb/vp702x.c
@@ -294,16 +294,22 @@ static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
static int vp702x_read_mac_addr(struct dvb_usb_device *d,u8 mac[6])
{
u8 i, *buf;
+ int ret;
struct vp702x_device_state *st = d->priv;
mutex_lock(&st->buf_mutex);
buf = st->buf;
- for (i = 6; i < 12; i++)
- vp702x_usb_in_op(d, READ_EEPROM_REQ, i, 1, &buf[i - 6], 1);
+ for (i = 6; i < 12; i++) {
+ ret = vp702x_usb_in_op(d, READ_EEPROM_REQ, i, 1,
+ &buf[i - 6], 1);
+ if (ret < 0)
+ goto err;
+ }
memcpy(mac, buf, 6);
+err:
mutex_unlock(&st->buf_mutex);
- return 0;
+ return ret;
}
static int vp702x_frontend_attach(struct dvb_usb_adapter *adap)
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 054/217] media: go7007: remove redundant initialization
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 053/217] media: dvb-usb: fix uninit-value in vp702x_read_mac_addr Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 055/217] Bluetooth: sco: prevent information leak in sco_conn_defer_accept() Greg Kroah-Hartman
` (164 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Pavel Skripkin, Hans Verkuil,
Mauro Carvalho Chehab, Sasha Levin
From: Pavel Skripkin <paskripkin@gmail.com>
[ Upstream commit 6f5885a7750545973bf1a942d2f0f129aef0aa06 ]
In go7007_alloc() kzalloc() is used for struct go7007
allocation. It means that there is no need in zeroing
any members, because kzalloc will take care of it.
Removing these reduntant initialization steps increases
execution speed a lot:
Before:
+ 86.802 us | go7007_alloc();
After:
+ 29.595 us | go7007_alloc();
Fixes: 866b8695d67e8 ("Staging: add the go7007 video driver")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/usb/go7007/go7007-driver.c | 26 ------------------------
1 file changed, 26 deletions(-)
diff --git a/drivers/media/usb/go7007/go7007-driver.c b/drivers/media/usb/go7007/go7007-driver.c
index 05b1126f263e..d861d7225f49 100644
--- a/drivers/media/usb/go7007/go7007-driver.c
+++ b/drivers/media/usb/go7007/go7007-driver.c
@@ -698,49 +698,23 @@ struct go7007 *go7007_alloc(const struct go7007_board_info *board,
struct device *dev)
{
struct go7007 *go;
- int i;
go = kzalloc(sizeof(struct go7007), GFP_KERNEL);
if (go == NULL)
return NULL;
go->dev = dev;
go->board_info = board;
- go->board_id = 0;
go->tuner_type = -1;
- go->channel_number = 0;
- go->name[0] = 0;
mutex_init(&go->hw_lock);
init_waitqueue_head(&go->frame_waitq);
spin_lock_init(&go->spinlock);
go->status = STATUS_INIT;
- memset(&go->i2c_adapter, 0, sizeof(go->i2c_adapter));
- go->i2c_adapter_online = 0;
- go->interrupt_available = 0;
init_waitqueue_head(&go->interrupt_waitq);
- go->input = 0;
go7007_update_board(go);
- go->encoder_h_halve = 0;
- go->encoder_v_halve = 0;
- go->encoder_subsample = 0;
go->format = V4L2_PIX_FMT_MJPEG;
go->bitrate = 1500000;
go->fps_scale = 1;
- go->pali = 0;
go->aspect_ratio = GO7007_RATIO_1_1;
- go->gop_size = 0;
- go->ipb = 0;
- go->closed_gop = 0;
- go->repeat_seqhead = 0;
- go->seq_header_enable = 0;
- go->gop_header_enable = 0;
- go->dvd_mode = 0;
- go->interlace_coding = 0;
- for (i = 0; i < 4; ++i)
- go->modet[i].enable = 0;
- for (i = 0; i < 1624; ++i)
- go->modet_map[i] = 0;
- go->audio_deliver = NULL;
- go->audio_enabled = 0;
return go;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 055/217] Bluetooth: sco: prevent information leak in sco_conn_defer_accept()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 054/217] media: go7007: remove redundant initialization Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 056/217] tcp: seq_file: Avoid skipping sk during tcp_seek_last_pos Greg Kroah-Hartman
` (163 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Marcel Holtmann,
Sasha Levin
From: Dan Carpenter <dan.carpenter@oracle.com>
[ Upstream commit 59da0b38bc2ea570ede23a3332ecb3e7574ce6b2 ]
Smatch complains that some of these struct members are not initialized
leading to a stack information disclosure:
net/bluetooth/sco.c:778 sco_conn_defer_accept() warn:
check that 'cp.retrans_effort' doesn't leak information
This seems like a valid warning. I've added a default case to fix
this issue.
Fixes: 2f69a82acf6f ("Bluetooth: Use voice setting in deferred SCO connection request")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/sco.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 2d23b29ce00d..930828ec2afb 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -762,6 +762,11 @@ static void sco_conn_defer_accept(struct hci_conn *conn, u16 setting)
cp.max_latency = cpu_to_le16(0xffff);
cp.retrans_effort = 0xff;
break;
+ default:
+ /* use CVSD settings as fallback */
+ cp.max_latency = cpu_to_le16(0xffff);
+ cp.retrans_effort = 0xff;
+ break;
}
hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ,
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 056/217] tcp: seq_file: Avoid skipping sk during tcp_seek_last_pos
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 055/217] Bluetooth: sco: prevent information leak in sco_conn_defer_accept() Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 057/217] net: cipso: fix warnings in netlbl_cipsov4_add_std Greg Kroah-Hartman
` (162 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Martin KaFai Lau, Andrii Nakryiko,
Eric Dumazet, Kuniyuki Iwashima, Yonghong Song, Sasha Levin
From: Martin KaFai Lau <kafai@fb.com>
[ Upstream commit 525e2f9fd0229eb10cb460a9e6d978257f24804e ]
st->bucket stores the current bucket number.
st->offset stores the offset within this bucket that is the sk to be
seq_show(). Thus, st->offset only makes sense within the same
st->bucket.
These two variables are an optimization for the common no-lseek case.
When resuming the seq_file iteration (i.e. seq_start()),
tcp_seek_last_pos() tries to continue from the st->offset
at bucket st->bucket.
However, it is possible that the bucket pointed by st->bucket
has changed and st->offset may end up skipping the whole st->bucket
without finding a sk. In this case, tcp_seek_last_pos() currently
continues to satisfy the offset condition in the next (and incorrect)
bucket. Instead, regardless of the offset value, the first sk of the
next bucket should be returned. Thus, "bucket == st->bucket" check is
added to tcp_seek_last_pos().
The chance of hitting this is small and the issue is a decade old,
so targeting for the next tree.
Fixes: a8b690f98baf ("tcp: Fix slowness in read /proc/net/tcp")
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210701200541.1033917-1-kafai@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_ipv4.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 146a137ee7ef..744479c8b91f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2087,6 +2087,7 @@ static void *tcp_get_idx(struct seq_file *seq, loff_t pos)
static void *tcp_seek_last_pos(struct seq_file *seq)
{
struct tcp_iter_state *st = seq->private;
+ int bucket = st->bucket;
int offset = st->offset;
int orig_num = st->num;
void *rc = NULL;
@@ -2097,7 +2098,7 @@ static void *tcp_seek_last_pos(struct seq_file *seq)
break;
st->state = TCP_SEQ_STATE_LISTENING;
rc = listening_get_next(seq, NULL);
- while (offset-- && rc)
+ while (offset-- && rc && bucket == st->bucket)
rc = listening_get_next(seq, rc);
if (rc)
break;
@@ -2108,7 +2109,7 @@ static void *tcp_seek_last_pos(struct seq_file *seq)
if (st->bucket > tcp_hashinfo.ehash_mask)
break;
rc = established_get_first(seq);
- while (offset-- && rc)
+ while (offset-- && rc && bucket == st->bucket)
rc = established_get_next(seq, rc);
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 057/217] net: cipso: fix warnings in netlbl_cipsov4_add_std
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 056/217] tcp: seq_file: Avoid skipping sk during tcp_seek_last_pos Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 058/217] i2c: highlander: add IRQ check Greg Kroah-Hartman
` (161 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Paul Moore, Pavel Skripkin,
David S. Miller, Sasha Levin, syzbot+cdd51ee2e6b0b2e18c0d
From: Pavel Skripkin <paskripkin@gmail.com>
[ Upstream commit 8ca34a13f7f9b3fa2c464160ffe8cc1a72088204 ]
Syzbot reported warning in netlbl_cipsov4_add(). The
problem was in too big doi_def->map.std->lvl.local_size
passed to kcalloc(). Since this value comes from userpace there is
no need to warn if value is not correct.
The same problem may occur with other kcalloc() calls in
this function, so, I've added __GFP_NOWARN flag to all
kcalloc() calls there.
Reported-and-tested-by: syzbot+cdd51ee2e6b0b2e18c0d@syzkaller.appspotmail.com
Fixes: 96cb8e3313c7 ("[NetLabel]: CIPSOv4 and Unlabeled packet integration")
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netlabel/netlabel_cipso_v4.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index 3e3494c8d42f..0559d442ad80 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -198,14 +198,14 @@ static int netlbl_cipsov4_add_std(struct genl_info *info,
}
doi_def->map.std->lvl.local = kcalloc(doi_def->map.std->lvl.local_size,
sizeof(u32),
- GFP_KERNEL);
+ GFP_KERNEL | __GFP_NOWARN);
if (doi_def->map.std->lvl.local == NULL) {
ret_val = -ENOMEM;
goto add_std_failure;
}
doi_def->map.std->lvl.cipso = kcalloc(doi_def->map.std->lvl.cipso_size,
sizeof(u32),
- GFP_KERNEL);
+ GFP_KERNEL | __GFP_NOWARN);
if (doi_def->map.std->lvl.cipso == NULL) {
ret_val = -ENOMEM;
goto add_std_failure;
@@ -273,7 +273,7 @@ static int netlbl_cipsov4_add_std(struct genl_info *info,
doi_def->map.std->cat.local = kcalloc(
doi_def->map.std->cat.local_size,
sizeof(u32),
- GFP_KERNEL);
+ GFP_KERNEL | __GFP_NOWARN);
if (doi_def->map.std->cat.local == NULL) {
ret_val = -ENOMEM;
goto add_std_failure;
@@ -281,7 +281,7 @@ static int netlbl_cipsov4_add_std(struct genl_info *info,
doi_def->map.std->cat.cipso = kcalloc(
doi_def->map.std->cat.cipso_size,
sizeof(u32),
- GFP_KERNEL);
+ GFP_KERNEL | __GFP_NOWARN);
if (doi_def->map.std->cat.cipso == NULL) {
ret_val = -ENOMEM;
goto add_std_failure;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 058/217] i2c: highlander: add IRQ check
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 057/217] net: cipso: fix warnings in netlbl_cipsov4_add_std Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 059/217] media: em28xx-input: fix refcount bug in em28xx_usb_disconnect Greg Kroah-Hartman
` (160 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sergey Shtylyov, Wolfram Sang,
Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit f16a3bb69aa6baabf8f0aca982c8cf21e2a4f6bc ]
The driver is written as if platform_get_irq() returns 0 on errors (while
actually it returns a negative error code), blithely passing these error
codes to request_irq() (which takes *unsigned* IRQ #) -- which fails with
-EINVAL. Add the necessary error check to the pre-existing *if* statement
forcing the driver into the polling mode...
Fixes: 4ad48e6ab18c ("i2c: Renesas Highlander FPGA SMBus support")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-highlander.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
index 56dc69e7349f..9ad031ea3300 100644
--- a/drivers/i2c/busses/i2c-highlander.c
+++ b/drivers/i2c/busses/i2c-highlander.c
@@ -382,7 +382,7 @@ static int highlander_i2c_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dev);
dev->irq = platform_get_irq(pdev, 0);
- if (iic_force_poll)
+ if (dev->irq < 0 || iic_force_poll)
dev->irq = 0;
if (dev->irq) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 059/217] media: em28xx-input: fix refcount bug in em28xx_usb_disconnect
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 058/217] i2c: highlander: add IRQ check Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 060/217] PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently Greg Kroah-Hartman
` (159 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dongliang Mu, Sean Young,
Mauro Carvalho Chehab, Sasha Levin
From: Dongliang Mu <mudongliangabcd@gmail.com>
[ Upstream commit 6fa54bc713c262e1cfbc5613377ef52280d7311f ]
If em28xx_ir_init fails, it would decrease the refcount of dev. However,
in the em28xx_ir_fini, when ir is NULL, it goes to ref_put and decrease
the refcount of dev. This will lead to a refcount bug.
Fix this bug by removing the kref_put in the error handling code
of em28xx_ir_init.
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 7 at lib/refcount.c:28 refcount_warn_saturate+0x18e/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 0 PID: 7 Comm: kworker/0:1 Not tainted 5.13.0 #3
Workqueue: usb_hub_wq hub_event
RIP: 0010:refcount_warn_saturate+0x18e/0x1a0 lib/refcount.c:28
Call Trace:
kref_put.constprop.0+0x60/0x85 include/linux/kref.h:69
em28xx_usb_disconnect.cold+0xd7/0xdc drivers/media/usb/em28xx/em28xx-cards.c:4150
usb_unbind_interface+0xbf/0x3a0 drivers/usb/core/driver.c:458
__device_release_driver drivers/base/dd.c:1201 [inline]
device_release_driver_internal+0x22a/0x230 drivers/base/dd.c:1232
bus_remove_device+0x108/0x160 drivers/base/bus.c:529
device_del+0x1fe/0x510 drivers/base/core.c:3540
usb_disable_device+0xd1/0x1d0 drivers/usb/core/message.c:1419
usb_disconnect+0x109/0x330 drivers/usb/core/hub.c:2221
hub_port_connect drivers/usb/core/hub.c:5151 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5440 [inline]
port_event drivers/usb/core/hub.c:5586 [inline]
hub_event+0xf81/0x1d40 drivers/usb/core/hub.c:5668
process_one_work+0x2c9/0x610 kernel/workqueue.c:2276
process_scheduled_works kernel/workqueue.c:2338 [inline]
worker_thread+0x333/0x5b0 kernel/workqueue.c:2424
kthread+0x188/0x1d0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Reported-by: Dongliang Mu <mudongliangabcd@gmail.com>
Fixes: ac5688637144 ("media: em28xx: Fix possible memory leak of em28xx struct")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/usb/em28xx/em28xx-input.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index b8c94b4ad232..0be2fb751705 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -839,7 +839,6 @@ error:
kfree(ir);
ref_put:
em28xx_shutdown_buttons(dev);
- kref_put(&dev->ref, em28xx_free_device);
return err;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 060/217] PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 059/217] media: em28xx-input: fix refcount bug in em28xx_usb_disconnect Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 061/217] PCI: PM: Enable PME if it can be signaled from D3cold Greg Kroah-Hartman
` (158 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Mika Westerberg, Utkarsh H Patel,
Koba Ko, Rafael J. Wysocki, Sasha Levin
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit da9f2150684ea684a7ddd6d7f0e38b2bdf43dcd8 ]
It is inconsistent to return PCI_D0 from pci_target_state() instead
of the original target state if 'wakeup' is true and the device
cannot signal PME from D0.
This only happens when the device cannot signal PME from the original
target state and any shallower power states (including D0) and that
case is effectively equivalent to the one in which PME singaling is
not supported at all. Since the original target state is returned in
the latter case, make the function do that in the former one too.
Link: https://lore.kernel.org/linux-pm/3149540.aeNJFYEL58@kreacher/
Fixes: 666ff6f83e1d ("PCI/PM: Avoid using device_may_wakeup() for runtime PM")
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reported-by: Utkarsh H Patel <utkarsh.h.patel@intel.com>
Reported-by: Koba Ko <koba.ko@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/pci.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index c847b5554db6..ac2c9d0c02fe 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2054,17 +2054,21 @@ static pci_power_t pci_target_state(struct pci_dev *dev, bool wakeup)
if (dev->current_state == PCI_D3cold)
target_state = PCI_D3cold;
- if (wakeup) {
+ if (wakeup && dev->pme_support) {
+ pci_power_t state = target_state;
+
/*
* Find the deepest state from which the device can generate
* wake-up events, make it the target state and enable device
* to generate PME#.
*/
- if (dev->pme_support) {
- while (target_state
- && !(dev->pme_support & (1 << target_state)))
- target_state--;
- }
+ while (state && !(dev->pme_support & (1 << state)))
+ state--;
+
+ if (state)
+ return state;
+ else if (dev->pme_support & 1)
+ return PCI_D0;
}
return target_state;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 061/217] PCI: PM: Enable PME if it can be signaled from D3cold
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 060/217] PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 062/217] soc: qcom: smsm: Fix missed interrupts if state changes while masked Greg Kroah-Hartman
` (157 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Mika Westerberg, Utkarsh H Patel,
Koba Ko, Rafael J. Wysocki, Sasha Levin
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 0e00392a895c95c6d12d42158236c8862a2f43f2 ]
PME signaling is only enabled by __pci_enable_wake() if the target
device can signal PME from the given target power state (to avoid
pointless reconfiguration of the device), but if the hierarchy above
the device goes into D3cold, the device itself will end up in D3cold
too, so if it can signal PME from D3cold, it should be enabled to
do so in __pci_enable_wake().
[Note that if the device does not end up in D3cold and it cannot
signal PME from the original target power state, it will not signal
PME, so in that case the behavior does not change.]
Link: https://lore.kernel.org/linux-pm/3149540.aeNJFYEL58@kreacher/
Fixes: 5bcc2fb4e815 ("PCI PM: Simplify PCI wake-up code")
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reported-by: Utkarsh H Patel <utkarsh.h.patel@intel.com>
Reported-by: Koba Ko <koba.ko@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/pci.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index ac2c9d0c02fe..1c5c0937c5da 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1950,7 +1950,14 @@ static int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable
if (enable) {
int error;
- if (pci_pme_capable(dev, state))
+ /*
+ * Enable PME signaling if the device can signal PME from
+ * D3cold regardless of whether or not it can signal PME from
+ * the current target state, because that will allow it to
+ * signal PME when the hierarchy above it goes into D3cold and
+ * the device itself ends up in D3cold as a result of that.
+ */
+ if (pci_pme_capable(dev, state) || pci_pme_capable(dev, PCI_D3cold))
pci_pme_active(dev, true);
else
ret = 1;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 062/217] soc: qcom: smsm: Fix missed interrupts if state changes while masked
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 061/217] PCI: PM: Enable PME if it can be signaled from D3cold Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 063/217] Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow Greg Kroah-Hartman
` (156 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Stephan Gerhold, Bjorn Andersson,
Sasha Levin
From: Stephan Gerhold <stephan@gerhold.net>
[ Upstream commit e3d4571955050736bbf3eda0a9538a09d9fcfce8 ]
The SMSM driver detects interrupt edges by tracking the last state
it has seen (and has triggered the interrupt handler for). This works
fine, but only if the interrupt does not change state while masked.
For example, if an interrupt is unmasked while the state is HIGH,
the stored last_value for that interrupt might still be LOW. Then,
when the remote processor triggers smsm_intr() we assume that nothing
has changed, even though the state might have changed from HIGH to LOW.
Attempt to fix this by checking the current remote state before
unmasking an IRQ. Use atomic operations to avoid the interrupt handler
from interfering with the unmask function.
This fixes modem crashes in some edge cases with the BAM-DMUX driver.
Specifically, the BAM-DMUX interrupt handler is not called for the
HIGH -> LOW smsm state transition if the BAM-DMUX driver is loaded
(and therefore unmasks the interrupt) after the modem was already started:
qcom-q6v5-mss 4080000.remoteproc: fatal error received: a2_task.c:3188:
Assert FALSE failed: A2 DL PER deadlock timer expired waiting for Apps ACK
Fixes: c97c4090ff72 ("soc: qcom: smsm: Add driver for Qualcomm SMSM")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210712135703.324748-2-stephan@gerhold.net
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/qcom/smsm.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
index 50214b620865..2b49d2c212da 100644
--- a/drivers/soc/qcom/smsm.c
+++ b/drivers/soc/qcom/smsm.c
@@ -117,7 +117,7 @@ struct smsm_entry {
DECLARE_BITMAP(irq_enabled, 32);
DECLARE_BITMAP(irq_rising, 32);
DECLARE_BITMAP(irq_falling, 32);
- u32 last_value;
+ unsigned long last_value;
u32 *remote_state;
u32 *subscription;
@@ -212,8 +212,7 @@ static irqreturn_t smsm_intr(int irq, void *data)
u32 val;
val = readl(entry->remote_state);
- changed = val ^ entry->last_value;
- entry->last_value = val;
+ changed = val ^ xchg(&entry->last_value, val);
for_each_set_bit(i, entry->irq_enabled, 32) {
if (!(changed & BIT(i)))
@@ -274,6 +273,12 @@ static void smsm_unmask_irq(struct irq_data *irqd)
struct qcom_smsm *smsm = entry->smsm;
u32 val;
+ /* Make sure our last cached state is up-to-date */
+ if (readl(entry->remote_state) & BIT(irq))
+ set_bit(irq, &entry->last_value);
+ else
+ clear_bit(irq, &entry->last_value);
+
set_bit(irq, entry->irq_enabled);
if (entry->subscription) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 063/217] Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 062/217] soc: qcom: smsm: Fix missed interrupts if state changes while masked Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 064/217] arm64: dts: exynos: correct GIC CPU interfaces address range on Exynos7 Greg Kroah-Hartman
` (155 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Colin Ian King, Marcel Holtmann,
Sasha Levin
From: Colin Ian King <colin.king@canonical.com>
[ Upstream commit 713baf3dae8f45dc8ada4ed2f5fdcbf94a5c274d ]
An earlier commit replaced using batostr to using %pMR sprintf for the
construction of session->name. Static analysis detected that this new
method can use a total of 21 characters (including the trailing '\0')
so we need to increase the BTNAMSIZ from 18 to 21 to fix potential
buffer overflows.
Addresses-Coverity: ("Out-of-bounds write")
Fixes: fcb73338ed53 ("Bluetooth: Use %pMR in sprintf/seq_printf instead of batostr")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/cmtp/cmtp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/cmtp/cmtp.h b/net/bluetooth/cmtp/cmtp.h
index c32638dddbf9..f6b9dc4e408f 100644
--- a/net/bluetooth/cmtp/cmtp.h
+++ b/net/bluetooth/cmtp/cmtp.h
@@ -26,7 +26,7 @@
#include <linux/types.h>
#include <net/bluetooth/bluetooth.h>
-#define BTNAMSIZ 18
+#define BTNAMSIZ 21
/* CMTP ioctl defines */
#define CMTPCONNADD _IOW('C', 200, int)
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 064/217] arm64: dts: exynos: correct GIC CPU interfaces address range on Exynos7
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 063/217] Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 065/217] Bluetooth: fix repeated calls to sco_sock_kill Greg Kroah-Hartman
` (154 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sam Protsenko, Marc Zyngier,
Krzysztof Kozlowski, Alim Akhtar, Sasha Levin
From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
[ Upstream commit 01c72cad790cb6cd3ccbe4c1402b6cb6c6bbffd0 ]
The GIC-400 CPU interfaces address range is defined as 0x2000-0x3FFF (by
ARM).
Reported-by: Sam Protsenko <semen.protsenko@linaro.org>
Reported-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Fixes: b9024cbc937d ("arm64: dts: Add initial device tree support for exynos7")
Link: https://lore.kernel.org/r/20210805072110.4730-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/exynos/exynos7.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/exynos/exynos7.dtsi b/arch/arm64/boot/dts/exynos/exynos7.dtsi
index 875297a470da..331dcf94acf0 100644
--- a/arch/arm64/boot/dts/exynos/exynos7.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi
@@ -94,7 +94,7 @@
#address-cells = <0>;
interrupt-controller;
reg = <0x11001000 0x1000>,
- <0x11002000 0x1000>,
+ <0x11002000 0x2000>,
<0x11004000 0x2000>,
<0x11006000 0x2000>;
};
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 065/217] Bluetooth: fix repeated calls to sco_sock_kill
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 064/217] arm64: dts: exynos: correct GIC CPU interfaces address range on Exynos7 Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 066/217] drm/msm/dsi: Fix some reference counted resource leaks Greg Kroah-Hartman
` (153 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Desmond Cheong Zhi Xi,
Luiz Augusto von Dentz, Sasha Levin
From: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
[ Upstream commit e1dee2c1de2b4dd00eb44004a4bda6326ed07b59 ]
In commit 4e1a720d0312 ("Bluetooth: avoid killing an already killed
socket"), a check was added to sco_sock_kill to skip killing a socket
if the SOCK_DEAD flag was set.
This was done after a trace for a use-after-free bug showed that the
same sock pointer was being killed twice.
Unfortunately, this check prevents sco_sock_kill from running on any
socket. sco_sock_kill kills a socket only if it's zapped and orphaned,
however sock_orphan announces that the socket is dead before detaching
it. i.e., orphaned sockets have the SOCK_DEAD flag set.
To fix this, we remove the check for SOCK_DEAD, and avoid repeated
calls to sco_sock_kill by removing incorrect calls in:
1. sco_sock_timeout. The socket should not be killed on timeout as
further processing is expected to be done. For example,
sco_sock_connect sets the timer then waits for the socket to be
connected or for an error to be returned.
2. sco_conn_del. This function should clean up resources for the
connection, but the socket itself should be cleaned up in
sco_sock_release.
3. sco_sock_close. Calls to sco_sock_close in sco_sock_cleanup_listen
and sco_sock_release are followed by sco_sock_kill. Hence the
duplicated call should be removed.
Fixes: 4e1a720d0312 ("Bluetooth: avoid killing an already killed socket")
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/sco.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 930828ec2afb..f4b997fb33d6 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -84,7 +84,6 @@ static void sco_sock_timeout(unsigned long arg)
sk->sk_state_change(sk);
bh_unlock_sock(sk);
- sco_sock_kill(sk);
sock_put(sk);
}
@@ -176,7 +175,6 @@ static void sco_conn_del(struct hci_conn *hcon, int err)
sco_sock_clear_timer(sk);
sco_chan_del(sk, err);
bh_unlock_sock(sk);
- sco_sock_kill(sk);
sock_put(sk);
}
@@ -393,8 +391,7 @@ static void sco_sock_cleanup_listen(struct sock *parent)
*/
static void sco_sock_kill(struct sock *sk)
{
- if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket ||
- sock_flag(sk, SOCK_DEAD))
+ if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket)
return;
BT_DBG("sk %p state %d", sk, sk->sk_state);
@@ -446,7 +443,6 @@ static void sco_sock_close(struct sock *sk)
lock_sock(sk);
__sco_sock_close(sk);
release_sock(sk);
- sco_sock_kill(sk);
}
static void sco_sock_init(struct sock *sk, struct sock *parent)
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 066/217] drm/msm/dsi: Fix some reference counted resource leaks
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 065/217] Bluetooth: fix repeated calls to sco_sock_kill Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 067/217] usb: gadget: udc: at91: add IRQ check Greg Kroah-Hartman
` (152 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Christophe JAILLET, Rob Clark,
Sasha Levin
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
[ Upstream commit 6977cc89c87506ff17e6c05f0e37f46752256e82 ]
'of_find_device_by_node()' takes a reference that must be released when
not needed anymore.
This is expected to be done in 'dsi_destroy()'.
However, there are 2 issues in 'dsi_get_phy()'.
First, if 'of_find_device_by_node()' succeeds but 'platform_get_drvdata()'
returns NULL, 'msm_dsi->phy_dev' will still be NULL, and the reference
won't be released in 'dsi_destroy()'.
Secondly, as 'of_find_device_by_node()' already takes a reference, there is
no need for an additional 'get_device()'.
Move the assignment to 'msm_dsi->phy_dev' a few lines above and remove the
unneeded 'get_device()' to solve both issues.
Fixes: ec31abf6684e ("drm/msm/dsi: Separate PHY to another platform device")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f15bc57648a00e7c99f943903468a04639d50596.1628241097.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/dsi/dsi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 98742d7af6dc..bacb33eec0fa 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -34,8 +34,10 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
}
phy_pdev = of_find_device_by_node(phy_node);
- if (phy_pdev)
+ if (phy_pdev) {
msm_dsi->phy = platform_get_drvdata(phy_pdev);
+ msm_dsi->phy_dev = &phy_pdev->dev;
+ }
of_node_put(phy_node);
@@ -44,8 +46,6 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
return -EPROBE_DEFER;
}
- msm_dsi->phy_dev = get_device(&phy_pdev->dev);
-
return 0;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 067/217] usb: gadget: udc: at91: add IRQ check
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 066/217] drm/msm/dsi: Fix some reference counted resource leaks Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 068/217] usb: phy: fsl-usb: " Greg Kroah-Hartman
` (151 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sergey Shtylyov, Felipe Balbi,
Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit 50855c31573b02963f0aa2aacfd4ea41c31ae0e0 ]
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code. Stop calling devm_request_irq() with the invalid IRQ #s.
Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Felipe Balbi <balbi@kernel.org>
Link: https://lore.kernel.org/r/6654a224-739a-1a80-12f0-76d920f87b6c@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/gadget/udc/at91_udc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c
index 8bc78418d40e..cd92cda03d71 100644
--- a/drivers/usb/gadget/udc/at91_udc.c
+++ b/drivers/usb/gadget/udc/at91_udc.c
@@ -1895,7 +1895,9 @@ static int at91udc_probe(struct platform_device *pdev)
clk_disable(udc->iclk);
/* request UDC and maybe VBUS irqs */
- udc->udp_irq = platform_get_irq(pdev, 0);
+ udc->udp_irq = retval = platform_get_irq(pdev, 0);
+ if (retval < 0)
+ goto err_unprepare_iclk;
retval = devm_request_irq(dev, udc->udp_irq, at91_udc_irq, 0,
driver_name, udc);
if (retval) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 068/217] usb: phy: fsl-usb: add IRQ check
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 067/217] usb: gadget: udc: at91: add IRQ check Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 069/217] usb: phy: twl6030: add IRQ checks Greg Kroah-Hartman
` (150 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Felipe Balbi, Sergey Shtylyov,
Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit ecc2f30dbb25969908115c81ec23650ed982b004 ]
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code. Stop calling request_irq() with the invalid IRQ #s.
Fixes: 0807c500a1a6 ("USB: add Freescale USB OTG Transceiver driver")
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/b0a86089-8b8b-122e-fd6d-73e8c2304964@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/phy/phy-fsl-usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 9b4354a00ca7..968900c36451 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -886,6 +886,8 @@ int usb_otg_start(struct platform_device *pdev)
/* request irq */
p_otg->irq = platform_get_irq(pdev, 0);
+ if (p_otg->irq < 0)
+ return p_otg->irq;
status = request_irq(p_otg->irq, fsl_otg_isr,
IRQF_SHARED, driver_name, p_otg);
if (status) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 069/217] usb: phy: twl6030: add IRQ checks
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 068/217] usb: phy: fsl-usb: " Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 070/217] Bluetooth: Move shutdown callback before flushing tx and rx queue Greg Kroah-Hartman
` (149 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Felipe Balbi, Sergey Shtylyov,
Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit 0881e22c06e66af0b64773c91c8868ead3d01aa1 ]
The driver neglects to check the result of platform_get_irq()'s calls and
blithely passes the negative error codes to request_threaded_irq() (which
takes *unsigned* IRQ #), causing them both to fail with -EINVAL, overriding
an original error code. Stop calling request_threaded_irq() with the
invalid IRQ #s.
Fixes: c33fad0c3748 ("usb: otg: Adding twl6030-usb transceiver driver for OMAP4430")
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/9507f50b-50f1-6dc4-f57c-3ed4e53a1c25@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/phy/phy-twl6030-usb.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/usb/phy/phy-twl6030-usb.c b/drivers/usb/phy/phy-twl6030-usb.c
index 8e14fa221191..4884c4238b7b 100644
--- a/drivers/usb/phy/phy-twl6030-usb.c
+++ b/drivers/usb/phy/phy-twl6030-usb.c
@@ -355,6 +355,11 @@ static int twl6030_usb_probe(struct platform_device *pdev)
twl->irq2 = platform_get_irq(pdev, 1);
twl->linkstat = MUSB_UNKNOWN;
+ if (twl->irq1 < 0)
+ return twl->irq1;
+ if (twl->irq2 < 0)
+ return twl->irq2;
+
twl->comparator.set_vbus = twl6030_set_vbus;
twl->comparator.start_srp = twl6030_start_srp;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 070/217] Bluetooth: Move shutdown callback before flushing tx and rx queue
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 069/217] usb: phy: twl6030: add IRQ checks Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 071/217] usb: host: ohci-tmio: add IRQ check Greg Kroah-Hartman
` (148 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Hsin-Yi Wang, Guenter Roeck,
Kai-Heng Feng, Marcel Holtmann, Sasha Levin, Mattijs Korpershoek
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
[ Upstream commit 0ea53674d07fb6db2dd7a7ec2fdc85a12eb246c2 ]
Commit 0ea9fd001a14 ("Bluetooth: Shutdown controller after workqueues
are flushed or cancelled") introduced a regression that makes mtkbtsdio
driver stops working:
[ 36.593956] Bluetooth: hci0: Firmware already downloaded
[ 46.814613] Bluetooth: hci0: Execution of wmt command timed out
[ 46.814619] Bluetooth: hci0: Failed to send wmt func ctrl (-110)
The shutdown callback depends on the result of hdev->rx_work, so we
should call it before flushing rx_work:
-> btmtksdio_shutdown()
-> mtk_hci_wmt_sync()
-> __hci_cmd_send()
-> wait for BTMTKSDIO_TX_WAIT_VND_EVT gets cleared
-> btmtksdio_recv_event()
-> hci_recv_frame()
-> queue_work(hdev->workqueue, &hdev->rx_work)
-> clears BTMTKSDIO_TX_WAIT_VND_EVT
So move the shutdown callback before flushing TX/RX queue to resolve the
issue.
Reported-and-tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Fixes: 0ea9fd001a14 ("Bluetooth: Shutdown controller after workqueues are flushed or cancelled")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 3b2dd98e9fd6..89f4b9fc9bcc 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1582,6 +1582,14 @@ int hci_dev_do_close(struct hci_dev *hdev)
hci_request_cancel_all(hdev);
hci_req_sync_lock(hdev);
+ if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
+ !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
+ test_bit(HCI_UP, &hdev->flags)) {
+ /* Execute vendor specific shutdown routine */
+ if (hdev->shutdown)
+ hdev->shutdown(hdev);
+ }
+
if (!test_and_clear_bit(HCI_UP, &hdev->flags)) {
cancel_delayed_work_sync(&hdev->cmd_timer);
hci_req_sync_unlock(hdev);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 071/217] usb: host: ohci-tmio: add IRQ check
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 070/217] Bluetooth: Move shutdown callback before flushing tx and rx queue Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 072/217] usb: phy: tahvo: " Greg Kroah-Hartman
` (147 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Alan Stern, Sergey Shtylyov,
Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit 4ac5132e8a4300637a2da8f5d6bc7650db735b8a ]
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to usb_add_hcd() (which takes
*unsigned* IRQ #), causing request_irq() that it calls to fail with
-EINVAL, overriding an original error code. Stop calling usb_add_hcd()
with the invalid IRQ #s.
Fixes: 78c73414f4f6 ("USB: ohci: add support for tmio-ohci cell")
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/402e1a45-a0a4-0e08-566a-7ca1331506b1@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/host/ohci-tmio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
index 16d081a093bb..0cf4b6dc8972 100644
--- a/drivers/usb/host/ohci-tmio.c
+++ b/drivers/usb/host/ohci-tmio.c
@@ -202,6 +202,9 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
if (!cell)
return -EINVAL;
+ if (irq < 0)
+ return irq;
+
hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev));
if (!hcd) {
ret = -ENOMEM;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 072/217] usb: phy: tahvo: add IRQ check
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 071/217] usb: host: ohci-tmio: add IRQ check Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 073/217] mac80211: Fix insufficient headroom issue for AMSDU Greg Kroah-Hartman
` (146 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Felipe Balbi, Sergey Shtylyov,
Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit 0d45a1373e669880b8beaecc8765f44cb0241e47 ]
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to request_threaded_irq() (which
takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an
original error code. Stop calling request_threaded_irq() with the invalid
IRQ #s.
Fixes: 9ba96ae5074c ("usb: omap1: Tahvo USB transceiver driver")
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/8280d6a4-8e9a-7cfe-1aa9-db586dc9afdf@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/phy/phy-tahvo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index 1ec00eae339a..e4fc73bf6ee9 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -404,7 +404,9 @@ static int tahvo_usb_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, tu);
- tu->irq = platform_get_irq(pdev, 0);
+ tu->irq = ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ return ret;
ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt,
IRQF_ONESHOT,
"tahvo-vbus", tu);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 073/217] mac80211: Fix insufficient headroom issue for AMSDU
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 072/217] usb: phy: tahvo: " Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 074/217] usb: gadget: mv_u3d: request_irq() after initializing UDC Greg Kroah-Hartman
` (145 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Chih-Kang Chang, Ping-Ke Shih,
Johannes Berg, Sasha Levin
From: Chih-Kang Chang <gary.chang@realtek.com>
[ Upstream commit f50d2ff8f016b79a2ff4acd5943a1eda40c545d4 ]
ieee80211_amsdu_realloc_pad() fails to account for extra_tx_headroom,
the original reserved headroom might be eaten. Add the necessary
extra_tx_headroom.
Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://lore.kernel.org/r/20210816085128.10931-2-pkshih@realtek.com
[fix indentation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c7e8935224c0..e7b63ba8c184 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3080,7 +3080,9 @@ static bool ieee80211_amsdu_prepare_head(struct ieee80211_sub_if_data *sdata,
if (info->control.flags & IEEE80211_TX_CTRL_AMSDU)
return true;
- if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr)))
+ if (!ieee80211_amsdu_realloc_pad(local, skb,
+ sizeof(*amsdu_hdr) +
+ local->hw.extra_tx_headroom))
return false;
data = skb_push(skb, sizeof(*amsdu_hdr));
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 074/217] usb: gadget: mv_u3d: request_irq() after initializing UDC
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 073/217] mac80211: Fix insufficient headroom issue for AMSDU Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 075/217] Bluetooth: add timeout sanity check to hci_inquiry Greg Kroah-Hartman
` (144 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Felipe Balbi, Nadezda Lutovinova,
Sasha Levin
From: Nadezda Lutovinova <lutovinova@ispras.ru>
[ Upstream commit 2af0c5ffadaf9d13eca28409d4238b4e672942d3 ]
If IRQ occurs between calling request_irq() and mv_u3d_eps_init(),
then null pointer dereference occurs since u3d->eps[] wasn't
initialized yet but used in mv_u3d_nuke().
The patch puts registration of the interrupt handler after
initializing of neccesery data.
Found by Linux Driver Verification project (linuxtesting.org).
Fixes: 90fccb529d24 ("usb: gadget: Gadget directory cleanup - group UDC drivers")
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Nadezda Lutovinova <lutovinova@ispras.ru>
Link: https://lore.kernel.org/r/20210818141247.4794-1-lutovinova@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/gadget/udc/mv_u3d_core.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c
index 772049afe166..83c6c776a371 100644
--- a/drivers/usb/gadget/udc/mv_u3d_core.c
+++ b/drivers/usb/gadget/udc/mv_u3d_core.c
@@ -1925,14 +1925,6 @@ static int mv_u3d_probe(struct platform_device *dev)
goto err_get_irq;
}
u3d->irq = r->start;
- if (request_irq(u3d->irq, mv_u3d_irq,
- IRQF_SHARED, driver_name, u3d)) {
- u3d->irq = 0;
- dev_err(&dev->dev, "Request irq %d for u3d failed\n",
- u3d->irq);
- retval = -ENODEV;
- goto err_request_irq;
- }
/* initialize gadget structure */
u3d->gadget.ops = &mv_u3d_ops; /* usb_gadget_ops */
@@ -1945,6 +1937,15 @@ static int mv_u3d_probe(struct platform_device *dev)
mv_u3d_eps_init(u3d);
+ if (request_irq(u3d->irq, mv_u3d_irq,
+ IRQF_SHARED, driver_name, u3d)) {
+ u3d->irq = 0;
+ dev_err(&dev->dev, "Request irq %d for u3d failed\n",
+ u3d->irq);
+ retval = -ENODEV;
+ goto err_request_irq;
+ }
+
/* external vbus detection */
if (u3d->vbus) {
u3d->clock_gating = 1;
@@ -1968,8 +1969,8 @@ static int mv_u3d_probe(struct platform_device *dev)
err_unregister:
free_irq(u3d->irq, u3d);
-err_request_irq:
err_get_irq:
+err_request_irq:
kfree(u3d->status_req);
err_alloc_status_req:
kfree(u3d->eps);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 075/217] Bluetooth: add timeout sanity check to hci_inquiry
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 074/217] usb: gadget: mv_u3d: request_irq() after initializing UDC Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 076/217] i2c: iop3xx: fix deferred probing Greg Kroah-Hartman
` (143 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Pavel Skripkin, Marcel Holtmann,
Sasha Levin, syzbot+be2baed593ea56c6a84c
From: Pavel Skripkin <paskripkin@gmail.com>
[ Upstream commit f41a4b2b5eb7872109723dab8ae1603bdd9d9ec1 ]
Syzbot hit "task hung" bug in hci_req_sync(). The problem was in
unreasonable huge inquiry timeout passed from userspace.
Fix it by adding sanity check for timeout value to hci_inquiry().
Since hci_inquiry() is the only user of hci_req_sync() with user
controlled timeout value, it makes sense to check timeout value in
hci_inquiry() and don't touch hci_req_sync().
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-and-tested-by: syzbot+be2baed593ea56c6a84c@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 89f4b9fc9bcc..1906adfd553a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1258,6 +1258,12 @@ int hci_inquiry(void __user *arg)
goto done;
}
+ /* Restrict maximum inquiry length to 60 seconds */
+ if (ir.length > 60) {
+ err = -EINVAL;
+ goto done;
+ }
+
hci_dev_lock(hdev);
if (inquiry_cache_age(hdev) > INQUIRY_CACHE_AGE_MAX ||
inquiry_cache_empty(hdev) || ir.flags & IREQ_CACHE_FLUSH) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 076/217] i2c: iop3xx: fix deferred probing
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 075/217] Bluetooth: add timeout sanity check to hci_inquiry Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 077/217] i2c: s3c2410: fix IRQ check Greg Kroah-Hartman
` (142 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sergey Shtylyov, Wolfram Sang,
Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit a1299505162ad00def3573260c2c68b9c8e8d697 ]
When adding the code to handle platform_get_irq*() errors in the commit
489447380a29 ("handle errors returned by platform_get_irq*()"), the
actual error code was enforced to be -ENXIO in the driver for some
strange reason. This didn't matter much until the deferred probing was
introduced -- which requires an actual error code to be propagated
upstream from the failure site.
While fixing this, also stop overriding the errors from request_irq() to
-EIO (done since the pre-git era).
Fixes: 489447380a29 ("[PATCH] handle errors returned by platform_get_irq*()")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-iop3xx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index 85cbe4b55578..d4fe7ccccb22 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -456,16 +456,14 @@ iop3xx_i2c_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
- ret = -ENXIO;
+ ret = irq;
goto unmap;
}
ret = request_irq(irq, iop3xx_i2c_irq_handler, 0,
pdev->name, adapter_data);
- if (ret) {
- ret = -EIO;
+ if (ret)
goto unmap;
- }
memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
new_adapter->owner = THIS_MODULE;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 077/217] i2c: s3c2410: fix IRQ check
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 076/217] i2c: iop3xx: fix deferred probing Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 078/217] mmc: dw_mmc: Fix issue with uninitialized dma_slave_config Greg Kroah-Hartman
` (141 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sergey Shtylyov, Krzysztof Kozlowski,
Wolfram Sang, Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit d6840a5e370b7ea4fde16ce2caf431bcc87f9a75 ]
Iff platform_get_irq() returns 0, the driver's probe() method will return 0
early (as if the method's call was successful). Let's consider IRQ0 valid
for simplicity -- devm_request_irq() can always override that decision...
Fixes: e0d1ec97853f ("i2c-s3c2410: Change IRQ to be plain integer.")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-s3c2410.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index de10ca40aebc..911f8628128e 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1181,7 +1181,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
*/
if (!(i2c->quirks & QUIRK_POLL)) {
i2c->irq = ret = platform_get_irq(pdev, 0);
- if (ret <= 0) {
+ if (ret < 0) {
dev_err(&pdev->dev, "cannot find IRQ\n");
clk_unprepare(i2c->clk);
return ret;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 078/217] mmc: dw_mmc: Fix issue with uninitialized dma_slave_config
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 077/217] i2c: s3c2410: fix IRQ check Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 079/217] mmc: moxart: " Greg Kroah-Hartman
` (140 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Shawn Lin, Jaehoon Chung,
Peter Ujfalusi, Vinod Koul, Tony Lindgren, Ulf Hansson,
Sasha Levin
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit c3ff0189d3bc9c03845fe37472c140f0fefd0c79 ]
Depending on the DMA driver being used, the struct dma_slave_config may
need to be initialized to zero for the unused data.
For example, we have three DMA drivers using src_port_window_size and
dst_port_window_size. If these are left uninitialized, it can cause DMA
failures.
For dw_mmc, this is probably not currently an issue but is still good to
fix though.
Fixes: 3fc7eaef44db ("mmc: dw_mmc: Add external dma interface support")
Cc: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Cc: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210810081644.19353-2-tony@atomide.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/dw_mmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index bd994a8fce14..44d317d71b4c 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -832,6 +832,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host,
int ret = 0;
/* Set external dma config: burst size, burst width */
+ memset(&cfg, 0, sizeof(cfg));
cfg.dst_addr = host->phy_regs + fifo_offset;
cfg.src_addr = cfg.dst_addr;
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 079/217] mmc: moxart: Fix issue with uninitialized dma_slave_config
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 078/217] mmc: dw_mmc: Fix issue with uninitialized dma_slave_config Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 080/217] CIFS: Fix a potencially linear read overflow Greg Kroah-Hartman
` (139 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Jonas Jensen, Vinod Koul,
Peter Ujfalusi, Tony Lindgren, Ulf Hansson, Sasha Levin
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit ee5165354d498e5bceb0b386e480ac84c5f8c28c ]
Depending on the DMA driver being used, the struct dma_slave_config may
need to be initialized to zero for the unused data.
For example, we have three DMA drivers using src_port_window_size and
dst_port_window_size. If these are left uninitialized, it can cause DMA
failures.
For moxart, this is probably not currently an issue but is still good to
fix though.
Fixes: 1b66e94e6b99 ("mmc: moxart: Add MOXA ART SD/MMC driver")
Cc: Jonas Jensen <jonas.jensen@gmail.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210810081644.19353-3-tony@atomide.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/moxart-mmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c
index a0670e9cd012..5553a5643f40 100644
--- a/drivers/mmc/host/moxart-mmc.c
+++ b/drivers/mmc/host/moxart-mmc.c
@@ -631,6 +631,7 @@ static int moxart_probe(struct platform_device *pdev)
host->dma_chan_tx, host->dma_chan_rx);
host->have_dma = true;
+ memset(&cfg, 0, sizeof(cfg));
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 080/217] CIFS: Fix a potencially linear read overflow
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 079/217] mmc: moxart: " Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 081/217] i2c: mt65xx: fix IRQ check Greg Kroah-Hartman
` (138 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Len Baker, Paulo Alcantara (SUSE),
Jeff Layton, Steve French, Sasha Levin
From: Len Baker <len.baker@gmx.com>
[ Upstream commit f980d055a0f858d73d9467bb0b570721bbfcdfb8 ]
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated.
Also, the strnlen() call does not avoid the read overflow in the strlcpy
function when a not NUL-terminated string is passed.
So, replace this block by a call to kstrndup() that avoids this type of
overflow and does the same.
Fixes: 066ce6899484d ("cifs: rename cifs_strlcpy_to_host and make it use new functions")
Signed-off-by: Len Baker <len.baker@gmx.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/cifs/cifs_unicode.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
index 9986817532b1..7932e20555d2 100644
--- a/fs/cifs/cifs_unicode.c
+++ b/fs/cifs/cifs_unicode.c
@@ -371,14 +371,9 @@ cifs_strndup_from_utf16(const char *src, const int maxlen,
if (!dst)
return NULL;
cifs_from_utf16(dst, (__le16 *) src, len, maxlen, codepage,
- NO_MAP_UNI_RSVD);
+ NO_MAP_UNI_RSVD);
} else {
- len = strnlen(src, maxlen);
- len++;
- dst = kmalloc(len, GFP_KERNEL);
- if (!dst)
- return NULL;
- strlcpy(dst, src, len);
+ dst = kstrndup(src, maxlen, GFP_KERNEL);
}
return dst;
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 081/217] i2c: mt65xx: fix IRQ check
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 080/217] CIFS: Fix a potencially linear read overflow Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 082/217] usb: ehci-orion: Handle errors of clk_prepare_enable() in probe Greg Kroah-Hartman
` (137 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sergey Shtylyov, Qii Wang,
Wolfram Sang, Sasha Levin
From: Sergey Shtylyov <s.shtylyov@omp.ru>
[ Upstream commit 58fb7c643d346e2364404554f531cfa6a1a3917c ]
Iff platform_get_irq() returns 0, the driver's probe() method will return 0
early (as if the method's call was successful). Let's consider IRQ0 valid
for simplicity -- devm_request_irq() can always override that decision...
Fixes: ce38815d39ea ("I2C: mediatek: Add driver for MediaTek I2C controller")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Reviewed-by: Qii Wang <qii.wang@mediatek.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-mt65xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index 09d288ce0ddb..cbcf76ea9c19 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -740,7 +740,7 @@ static int mtk_i2c_probe(struct platform_device *pdev)
return PTR_ERR(i2c->pdmabase);
irq = platform_get_irq(pdev, 0);
- if (irq <= 0)
+ if (irq < 0)
return irq;
init_completion(&i2c->msg_complete);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 082/217] usb: ehci-orion: Handle errors of clk_prepare_enable() in probe
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 081/217] i2c: mt65xx: fix IRQ check Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 083/217] usb: bdc: Fix an error handling path in bdc_probe() when no suitable DMA config is available Greg Kroah-Hartman
` (136 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Andrew Lunn, Alan Stern,
Evgeny Novikov, Kirill Shilimanov, Sasha Levin
From: Evgeny Novikov <novikov@ispras.ru>
[ Upstream commit 4720f1bf4ee4a784d9ece05420ba33c9222a3004 ]
ehci_orion_drv_probe() did not account for possible errors of
clk_prepare_enable() that in particular could cause invocation of
clk_disable_unprepare() on clocks that were not prepared/enabled yet,
e.g. in remove or on handling errors of usb_add_hcd() in probe. Though,
there were several patches fixing different issues with clocks in this
driver, they did not solve this problem.
Add handling of errors of clk_prepare_enable() in ehci_orion_drv_probe()
to avoid calls of clk_disable_unprepare() without previous successful
invocation of clk_prepare_enable().
Found by Linux Driver Verification project (linuxtesting.org).
Fixes: 8c869edaee07 ("ARM: Orion: EHCI: Add support for enabling clocks")
Co-developed-by: Kirill Shilimanov <kirill.shilimanov@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Signed-off-by: Kirill Shilimanov <kirill.shilimanov@huawei.com>
Link: https://lore.kernel.org/r/20210825170902.11234-1-novikov@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/host/ehci-orion.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 1aec87ec68df..753c73624fb6 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -253,8 +253,11 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
* the clock does not exists.
*/
priv->clk = devm_clk_get(&pdev->dev, NULL);
- if (!IS_ERR(priv->clk))
- clk_prepare_enable(priv->clk);
+ if (!IS_ERR(priv->clk)) {
+ err = clk_prepare_enable(priv->clk);
+ if (err)
+ goto err_put_hcd;
+ }
priv->phy = devm_phy_optional_get(&pdev->dev, "usb");
if (IS_ERR(priv->phy)) {
@@ -315,6 +318,7 @@ err_phy_init:
err_phy_get:
if (!IS_ERR(priv->clk))
clk_disable_unprepare(priv->clk);
+err_put_hcd:
usb_put_hcd(hcd);
err:
dev_err(&pdev->dev, "init %s fail, %d\n",
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 083/217] usb: bdc: Fix an error handling path in bdc_probe() when no suitable DMA config is available
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 082/217] usb: ehci-orion: Handle errors of clk_prepare_enable() in probe Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 084/217] tty: serial: fsl_lpuart: fix the wrong mapbase value Greg Kroah-Hartman
` (135 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Florian Fainelli, Christophe JAILLET,
Sasha Levin
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
[ Upstream commit d2f42e09393c774ab79088d8e3afcc62b3328fc9 ]
If no suitable DMA configuration is available, a previous 'bdc_phy_init()'
call must be undone by a corresponding 'bdc_phy_exit()' call.
Branch to the existing error handling path instead of returning
directly.
Fixes: cc29d4f67757 ("usb: bdc: Add support for USB phy")
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/0c5910979f39225d5d8fe68c9ab1c147c68ddee1.1629314734.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/gadget/udc/bdc/bdc_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index 58ba04d858ba..23a27eb33c42 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -573,7 +573,8 @@ static int bdc_probe(struct platform_device *pdev)
if (ret) {
dev_err(dev,
"No suitable DMA config available, abort\n");
- return -ENOTSUPP;
+ ret = -ENOTSUPP;
+ goto phycleanup;
}
dev_dbg(dev, "Using 32-bit address\n");
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 084/217] tty: serial: fsl_lpuart: fix the wrong mapbase value
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 083/217] usb: bdc: Fix an error handling path in bdc_probe() when no suitable DMA config is available Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 085/217] ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point() Greg Kroah-Hartman
` (134 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Leonard Crestez, Adriana Reus,
Sherry Sun, Andy Duan, Sasha Levin
From: Andy Duan <fugang.duan@nxp.com>
[ Upstream commit d5c38948448abc2bb6b36dbf85a554bf4748885e ]
Register offset needs to be applied on mapbase also.
dma_tx/rx_request use the physical address of UARTDATA.
Register offset is currently only applied to membase (the
corresponding virtual addr) but not on mapbase.
Fixes: 24b1e5f0e83c ("tty: serial: lpuart: add imx7ulp support")
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Andy Duan <fugang.duan@nxp.com>
Link: https://lore.kernel.org/r/20210819021033.32606-1-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/fsl_lpuart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 3d5fe53988e5..62d1e4607912 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2170,7 +2170,7 @@ static int lpuart_probe(struct platform_device *pdev)
return PTR_ERR(sport->port.membase);
sport->port.membase += sdata->reg_off;
- sport->port.mapbase = res->start;
+ sport->port.mapbase = res->start + sdata->reg_off;
sport->port.dev = &pdev->dev;
sport->port.type = PORT_LPUART;
ret = platform_get_irq(pdev, 0);
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 085/217] ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 084/217] tty: serial: fsl_lpuart: fix the wrong mapbase value Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 086/217] bcma: Fix memory leak for internally-handled cores Greg Kroah-Hartman
` (133 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Kalle Valo,
Sasha Levin
From: Dan Carpenter <dan.carpenter@oracle.com>
[ Upstream commit fd6729ec534cffbbeb3917761e6d1fe6a412d3fe ]
This error path is unlikely because of it checked for NULL and
returned -ENOMEM earlier in the function. But it should return
an error code here as well if we ever do hit it because of a
race condition or something.
Fixes: bdcd81707973 ("Add ath6kl cleaned up driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210813113438.GB30697@kili
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath6kl/wmi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index f80f1757b58f..66df6f8bc0de 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -2513,8 +2513,10 @@ static int ath6kl_wmi_sync_point(struct wmi *wmi, u8 if_idx)
goto free_data_skb;
for (index = 0; index < num_pri_streams; index++) {
- if (WARN_ON(!data_sync_bufs[index].skb))
+ if (WARN_ON(!data_sync_bufs[index].skb)) {
+ ret = -ENOMEM;
goto free_data_skb;
+ }
ep_id = ath6kl_ac2_endpoint_id(wmi->parent_dev,
data_sync_bufs[index].
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 086/217] bcma: Fix memory leak for internally-handled cores
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 085/217] ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point() Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 087/217] ipv4: make exception cache less predictible Greg Kroah-Hartman
` (132 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Zenghui Yu, Kalle Valo, Sasha Levin
From: Zenghui Yu <yuzenghui@huawei.com>
[ Upstream commit b63aed3ff195130fef12e0af590f4838cf0201d8 ]
kmemleak reported that dev_name() of internally-handled cores were leaked
on driver unbinding. Let's use device_initialize() to take refcounts for
them and put_device() to properly free the related stuff.
While looking at it, there's another potential issue for those which should
be *registered* into driver core. If device_register() failed, we put
device once and freed bcma_device structures. In bcma_unregister_cores(),
they're treated as unregistered and we hit both UAF and double-free. That
smells not good and has also been fixed now.
Fixes: ab54bc8460b5 ("bcma: fill core details for every device")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210727025232.663-2-yuzenghui@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bcma/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index e6986c7608f1..b1783f5b5cb5 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -236,6 +236,7 @@ EXPORT_SYMBOL(bcma_core_irq);
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
{
+ device_initialize(&core->dev);
core->dev.release = bcma_release_core_dev;
core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
@@ -299,11 +300,10 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
{
int err;
- err = device_register(&core->dev);
+ err = device_add(&core->dev);
if (err) {
bcma_err(bus, "Could not register dev for core 0x%03X\n",
core->id.id);
- put_device(&core->dev);
return;
}
core->dev_registered = true;
@@ -394,7 +394,7 @@ void bcma_unregister_cores(struct bcma_bus *bus)
/* Now noone uses internally-handled cores, we can free them */
list_for_each_entry_safe(core, tmp, &bus->cores, list) {
list_del(&core->list);
- kfree(core);
+ put_device(&core->dev);
}
}
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 087/217] ipv4: make exception cache less predictible
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 086/217] bcma: Fix memory leak for internally-handled cores Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 088/217] net: sched: Fix qdisc_rate_table refcount leak when get tcf_block failed Greg Kroah-Hartman
` (131 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Eric Dumazet, Keyu Man, Willy Tarreau,
David S. Miller, David Ahern, Sasha Levin
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 67d6d681e15b578c1725bad8ad079e05d1c48a8e ]
Even after commit 6457378fe796 ("ipv4: use siphash instead of Jenkins in
fnhe_hashfun()"), an attacker can still use brute force to learn
some secrets from a victim linux host.
One way to defeat these attacks is to make the max depth of the hash
table bucket a random value.
Before this patch, each bucket of the hash table used to store exceptions
could contain 6 items under attack.
After the patch, each bucket would contains a random number of items,
between 6 and 10. The attacker can no longer infer secrets.
This is slightly increasing memory size used by the hash table,
by 50% in average, we do not expect this to be a problem.
This patch is more complex than the prior one (IPv6 equivalent),
because IPv4 was reusing the oldest entry.
Since we need to be able to evict more than one entry per
update_or_create_fnhe() call, I had to replace
fnhe_oldest() with fnhe_remove_oldest().
Also note that we will queue extra kfree_rcu() calls under stress,
which hopefully wont be a too big issue.
Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Keyu Man <kman001@ucr.edu>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: David Ahern <dsahern@kernel.org>
Tested-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/route.c | 46 ++++++++++++++++++++++++++++++----------------
1 file changed, 30 insertions(+), 16 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 81901b052907..d67d424be919 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -619,18 +619,25 @@ static void fnhe_flush_routes(struct fib_nh_exception *fnhe)
}
}
-static struct fib_nh_exception *fnhe_oldest(struct fnhe_hash_bucket *hash)
+static void fnhe_remove_oldest(struct fnhe_hash_bucket *hash)
{
- struct fib_nh_exception *fnhe, *oldest;
+ struct fib_nh_exception __rcu **fnhe_p, **oldest_p;
+ struct fib_nh_exception *fnhe, *oldest = NULL;
- oldest = rcu_dereference(hash->chain);
- for (fnhe = rcu_dereference(oldest->fnhe_next); fnhe;
- fnhe = rcu_dereference(fnhe->fnhe_next)) {
- if (time_before(fnhe->fnhe_stamp, oldest->fnhe_stamp))
+ for (fnhe_p = &hash->chain; ; fnhe_p = &fnhe->fnhe_next) {
+ fnhe = rcu_dereference_protected(*fnhe_p,
+ lockdep_is_held(&fnhe_lock));
+ if (!fnhe)
+ break;
+ if (!oldest ||
+ time_before(fnhe->fnhe_stamp, oldest->fnhe_stamp)) {
oldest = fnhe;
+ oldest_p = fnhe_p;
+ }
}
fnhe_flush_routes(oldest);
- return oldest;
+ *oldest_p = oldest->fnhe_next;
+ kfree_rcu(oldest, rcu);
}
static inline u32 fnhe_hashfun(__be32 daddr)
@@ -707,16 +714,21 @@ static void update_or_create_fnhe(struct fib_nh *nh, __be32 daddr, __be32 gw,
if (rt)
fill_route_from_fnhe(rt, fnhe);
} else {
- if (depth > FNHE_RECLAIM_DEPTH)
- fnhe = fnhe_oldest(hash);
- else {
- fnhe = kzalloc(sizeof(*fnhe), GFP_ATOMIC);
- if (!fnhe)
- goto out_unlock;
-
- fnhe->fnhe_next = hash->chain;
- rcu_assign_pointer(hash->chain, fnhe);
+ /* Randomize max depth to avoid some side channels attacks. */
+ int max_depth = FNHE_RECLAIM_DEPTH +
+ prandom_u32_max(FNHE_RECLAIM_DEPTH);
+
+ while (depth > max_depth) {
+ fnhe_remove_oldest(hash);
+ depth--;
}
+
+ fnhe = kzalloc(sizeof(*fnhe), GFP_ATOMIC);
+ if (!fnhe)
+ goto out_unlock;
+
+ fnhe->fnhe_next = hash->chain;
+
fnhe->fnhe_genid = genid;
fnhe->fnhe_daddr = daddr;
fnhe->fnhe_gw = gw;
@@ -724,6 +736,8 @@ static void update_or_create_fnhe(struct fib_nh *nh, __be32 daddr, __be32 gw,
fnhe->fnhe_mtu_locked = lock;
fnhe->fnhe_expires = max(1UL, expires);
+ rcu_assign_pointer(hash->chain, fnhe);
+
/* Exception created; mark the cached routes for the nexthop
* stale, so anyone caching it rechecks if this exception
* applies to them.
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 088/217] net: sched: Fix qdisc_rate_table refcount leak when get tcf_block failed
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 087/217] ipv4: make exception cache less predictible Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 089/217] net: qualcomm: fix QCA7000 checksum handling Greg Kroah-Hartman
` (130 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Xiyu Yang, Cong Wang, Jakub Kicinski,
Sasha Levin
From: Xiyu Yang <xiyuyang19@fudan.edu.cn>
[ Upstream commit c66070125837900163b81a03063ddd657a7e9bfb ]
The reference counting issue happens in one exception handling path of
cbq_change_class(). When failing to get tcf_block, the function forgets
to decrease the refcount of "rtab" increased by qdisc_put_rtab(),
causing a refcount leak.
Fix this issue by jumping to "failure" label when get tcf_block failed.
Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure")
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Link: https://lore.kernel.org/r/1630252681-71588-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sched/sch_cbq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 40fd1ee0095c..dea125d8aac7 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1590,7 +1590,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
err = tcf_block_get(&cl->block, &cl->filter_list);
if (err) {
kfree(cl);
- return err;
+ goto failure;
}
if (tca[TCA_RATE]) {
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 089/217] net: qualcomm: fix QCA7000 checksum handling
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 088/217] net: sched: Fix qdisc_rate_table refcount leak when get tcf_block failed Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 090/217] netns: protect netns ID lookups with RCU Greg Kroah-Hartman
` (129 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Michael Heimpold, Stefan Wahren,
David S. Miller, Sasha Levin
From: Stefan Wahren <stefan.wahren@i2se.com>
[ Upstream commit 429205da6c834447a57279af128bdd56ccd5225e ]
Based on tests the QCA7000 doesn't support checksum offloading. So assume
ip_summed is CHECKSUM_NONE and let the kernel take care of the checksum
handling. This fixes data transfer issues in noisy environments.
Reported-by: Michael Heimpold <michael.heimpold@in-tech.com>
Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/qualcomm/qca_spi.c | 2 +-
drivers/net/ethernet/qualcomm/qca_uart.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index 1c87178fc485..1ca1f72474ab 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -413,7 +413,7 @@ qcaspi_receive(struct qcaspi *qca)
skb_put(qca->rx_skb, retcode);
qca->rx_skb->protocol = eth_type_trans(
qca->rx_skb, qca->rx_skb->dev);
- qca->rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
+ skb_checksum_none_assert(qca->rx_skb);
netif_rx_ni(qca->rx_skb);
qca->rx_skb = netdev_alloc_skb_ip_align(net_dev,
net_dev->mtu + VLAN_ETH_HLEN);
diff --git a/drivers/net/ethernet/qualcomm/qca_uart.c b/drivers/net/ethernet/qualcomm/qca_uart.c
index db6068cd7a1f..466e9d07697a 100644
--- a/drivers/net/ethernet/qualcomm/qca_uart.c
+++ b/drivers/net/ethernet/qualcomm/qca_uart.c
@@ -107,7 +107,7 @@ qca_tty_receive(struct serdev_device *serdev, const unsigned char *data,
skb_put(qca->rx_skb, retcode);
qca->rx_skb->protocol = eth_type_trans(
qca->rx_skb, qca->rx_skb->dev);
- qca->rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
+ skb_checksum_none_assert(qca->rx_skb);
netif_rx_ni(qca->rx_skb);
qca->rx_skb = netdev_alloc_skb_ip_align(netdev,
netdev->mtu +
--
2.30.2
^ permalink raw reply related [flat|nested] 220+ messages in thread
* [PATCH 4.14 090/217] netns: protect netns ID lookups with RCU
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 089/217] net: qualcomm: fix QCA7000 checksum handling Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 091/217] tty: Fix data race between tiocsti() and flush_to_ldisc() Greg Kroah-Hartman
` (128 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Guillaume Nault, David S. Miller,
Håkon Bugge
From: Guillaume Nault <gnault@redhat.com>
commit 2dce224f469f060b9998a5a869151ef83c08ce77 upstream.
__peernet2id() can be protected by RCU as it only calls idr_for_each(),
which is RCU-safe, and never modifies the nsid table.
rtnl_net_dumpid() can also do lockless lookups. It does two nested
idr_for_each() calls on nsid tables (one direct call and one indirect
call because of rtnl_net_dumpid_one() calling __peernet2id()). The
netnsid tables are never updated. Therefore it is safe to not take the
nsid_lock and run within an RCU-critical section instead.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
---
net/core/net_namespace.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -181,9 +181,9 @@ static int net_eq_idr(int id, void *net,
return 0;
}
-/* Should be called with nsid_lock held. If a new id is assigned, the bool alloc
- * is set to true, thus the caller knows that the new id must be notified via
- * rtnl.
+/* Must be called from RCU-critical section or with nsid_lock held. If
+ * a new id is assigned, the bool alloc is set to true, thus the
+ * caller knows that the new id must be notified via rtnl.
*/
static int __peernet2id_alloc(struct net *net, struct net *peer, bool *alloc)
{
@@ -207,7 +207,7 @@ static int __peernet2id_alloc(struct net
return NETNSA_NSID_NOT_ASSIGNED;
}
-/* should be called with nsid_lock held */
+/* Must be called from RCU-critical section or with nsid_lock held */
static int __peernet2id(struct net *net, struct net *peer)
{
bool no = false;
@@ -240,9 +240,10 @@ int peernet2id(struct net *net, struct n
{
int id;
- spin_lock_bh(&net->nsid_lock);
+ rcu_read_lock();
id = __peernet2id(net, peer);
- spin_unlock_bh(&net->nsid_lock);
+ rcu_read_unlock();
+
return id;
}
EXPORT_SYMBOL(peernet2id);
@@ -761,6 +762,7 @@ struct rtnl_net_dump_cb {
int s_idx;
};
+/* Runs in RCU-critical section. */
static int rtnl_net_dumpid_one(int id, void *peer, void *data)
{
struct rtnl_net_dump_cb *net_cb = (struct rtnl_net_dump_cb *)data;
@@ -791,9 +793,9 @@ static int rtnl_net_dumpid(struct sk_buf
.s_idx = cb->args[0],
};
- spin_lock_bh(&net->nsid_lock);
+ rcu_read_lock();
idr_for_each(&net->netns_ids, rtnl_net_dumpid_one, &net_cb);
- spin_unlock_bh(&net->nsid_lock);
+ rcu_read_unlock();
cb->args[0] = net_cb.idx;
return skb->len;
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 091/217] tty: Fix data race between tiocsti() and flush_to_ldisc()
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 090/217] netns: protect netns ID lookups with RCU Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 092/217] x86/resctrl: Fix a maybe-uninitialized build warning treated as error Greg Kroah-Hartman
` (127 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, syzbot+97388eb9d31b997fe1d0,
Jiri Slaby, Nguyen Dinh Phi
From: Nguyen Dinh Phi <phind.uet@gmail.com>
commit bb2853a6a421a052268eee00fd5d3f6b3504b2b1 upstream.
The ops->receive_buf() may be accessed concurrently from these two
functions. If the driver flushes data to the line discipline
receive_buf() method while tiocsti() is waiting for the
ops->receive_buf() to finish its work, the data race will happen.
For example:
tty_ioctl |tty_ldisc_receive_buf
->tioctsi | ->tty_port_default_receive_buf
| ->tty_ldisc_receive_buf
->hci_uart_tty_receive | ->hci_uart_tty_receive
->h4_recv | ->h4_recv
In this case, the h4 receive buffer will be overwritten by the
latecomer, and we will lost the data.
Hence, change tioctsi() function to use the exclusive lock interface
from tty_buffer to avoid the data race.
Reported-by: syzbot+97388eb9d31b997fe1d0@syzkaller.appspotmail.com
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Link: https://lore.kernel.org/r/20210823000641.2082292-1-phind.uet@gmail.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/tty_io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2165,8 +2165,6 @@ static int tty_fasync(int fd, struct fil
* Locking:
* Called functions take tty_ldiscs_lock
* current->signal->tty check is safe without locks
- *
- * FIXME: may race normal receive processing
*/
static int tiocsti(struct tty_struct *tty, char __user *p)
@@ -2182,8 +2180,10 @@ static int tiocsti(struct tty_struct *tt
ld = tty_ldisc_ref_wait(tty);
if (!ld)
return -EIO;
+ tty_buffer_lock_exclusive(tty->port);
if (ld->ops->receive_buf)
ld->ops->receive_buf(tty, &ch, &mbz, 1);
+ tty_buffer_unlock_exclusive(tty->port);
tty_ldisc_deref(ld);
return 0;
}
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 092/217] x86/resctrl: Fix a maybe-uninitialized build warning treated as error
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 091/217] tty: Fix data race between tiocsti() and flush_to_ldisc() Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 093/217] KVM: x86: Update vCPUs hv_clock before back to guest when tsc_offset is adjusted Greg Kroah-Hartman
` (126 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Terry Bowman, kernel test robot,
Babu Moger, Borislav Petkov, Reinette Chatre
From: Babu Moger <babu.moger@amd.com>
commit 527f721478bce3f49b513a733bacd19d6f34b08c upstream.
The recent commit
064855a69003 ("x86/resctrl: Fix default monitoring groups reporting")
caused a RHEL build failure with an uninitialized variable warning
treated as an error because it removed the default case snippet.
The RHEL Makefile uses '-Werror=maybe-uninitialized' to force possibly
uninitialized variable warnings to be treated as errors. This is also
reported by smatch via the 0day robot.
The error from the RHEL build is:
arch/x86/kernel/cpu/resctrl/monitor.c: In function ‘__mon_event_count’:
arch/x86/kernel/cpu/resctrl/monitor.c:261:12: error: ‘m’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
m->chunks += chunks;
^~
The upstream Makefile does not build using '-Werror=maybe-uninitialized'.
So, the problem is not seen there. Fix the problem by putting back the
default case snippet.
[ bp: note that there's nothing wrong with the code and other compilers
do not trigger this warning - this is being done just so the RHEL compiler
is happy. ]
Fixes: 064855a69003 ("x86/resctrl: Fix default monitoring groups reporting")
Reported-by: Terry Bowman <Terry.Bowman@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/162949631908.23903.17090272726012848523.stgit@bmoger-ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/cpu/intel_rdt_monitor.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/arch/x86/kernel/cpu/intel_rdt_monitor.c
+++ b/arch/x86/kernel/cpu/intel_rdt_monitor.c
@@ -244,6 +244,12 @@ static u64 __mon_event_count(u32 rmid, s
case QOS_L3_MBM_LOCAL_EVENT_ID:
m = &rr->d->mbm_local[rmid];
break;
+ default:
+ /*
+ * Code would never reach here because an invalid
+ * event id would fail the __rmid_read.
+ */
+ return RMID_VAL_ERROR;
}
if (rr->first) {
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 093/217] KVM: x86: Update vCPUs hv_clock before back to guest when tsc_offset is adjusted
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 092/217] x86/resctrl: Fix a maybe-uninitialized build warning treated as error Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 094/217] IMA: remove -Wmissing-prototypes warning Greg Kroah-Hartman
` (125 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Zelin Deng, Paolo Bonzini
From: Zelin Deng <zelin.deng@linux.alibaba.com>
commit d9130a2dfdd4b21736c91b818f87dbc0ccd1e757 upstream.
When MSR_IA32_TSC_ADJUST is written by guest due to TSC ADJUST feature
especially there's a big tsc warp (like a new vCPU is hot-added into VM
which has been up for a long time), tsc_offset is added by a large value
then go back to guest. This causes system time jump as tsc_timestamp is
not adjusted in the meantime and pvclock monotonic character.
To fix this, just notify kvm to update vCPU's guest time before back to
guest.
Cc: stable@vger.kernel.org
Signed-off-by: Zelin Deng <zelin.deng@linux.alibaba.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1619576521-81399-2-git-send-email-zelin.deng@linux.alibaba.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/x86.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2355,6 +2355,10 @@ int kvm_set_msr_common(struct kvm_vcpu *
if (!msr_info->host_initiated) {
s64 adj = data - vcpu->arch.ia32_tsc_adjust_msr;
adjust_tsc_offset_guest(vcpu, adj);
+ /* Before back to guest, tsc_timestamp must be adjusted
+ * as well, otherwise guest's percpu pvclock time could jump.
+ */
+ kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
}
vcpu->arch.ia32_tsc_adjust_msr = data;
}
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 094/217] IMA: remove -Wmissing-prototypes warning
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 093/217] KVM: x86: Update vCPUs hv_clock before back to guest when tsc_offset is adjusted Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 095/217] backlight: pwm_bl: Improve bootloader/kernel device handover Greg Kroah-Hartman
` (124 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Austin Kim, Mimi Zohar
From: Austin Kim <austin.kim@lge.com>
commit a32ad90426a9c8eb3915eed26e08ce133bd9e0da upstream.
With W=1 build, the compiler throws warning message as below:
security/integrity/ima/ima_mok.c:24:12: warning:
no previous prototype for ‘ima_mok_init’ [-Wmissing-prototypes]
__init int ima_mok_init(void)
Silence the warning by adding static keyword to ima_mok_init().
Signed-off-by: Austin Kim <austin.kim@lge.com>
Fixes: 41c89b64d718 ("IMA: create machine owner and blacklist keyrings")
Cc: stable@vger.kernel.org
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/integrity/ima/ima_mok.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/security/integrity/ima/ima_mok.c
+++ b/security/integrity/ima/ima_mok.c
@@ -26,7 +26,7 @@ struct key *ima_blacklist_keyring;
/*
* Allocate the IMA blacklist keyring
*/
-__init int ima_mok_init(void)
+static __init int ima_mok_init(void)
{
struct key_restriction *restriction;
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 095/217] backlight: pwm_bl: Improve bootloader/kernel device handover
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 094/217] IMA: remove -Wmissing-prototypes warning Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 096/217] clk: kirkwood: Fix a clocking boot regression Greg Kroah-Hartman
` (123 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Marek Vasut, Daniel Thompson,
Lee Jones
From: Daniel Thompson <daniel.thompson@linaro.org>
commit 79fad92f2e596f5a8dd085788a24f540263ef887 upstream.
Currently there are (at least) two problems in the way pwm_bl starts
managing the enable_gpio pin. Both occur when the backlight is initially
off and the driver finds the pin not already in output mode and, as a
result, unconditionally switches it to output-mode and asserts the signal.
Problem 1: This could cause the backlight to flicker since, at this stage
in driver initialisation, we have no idea what the PWM and regulator are
doing (an unconfigured PWM could easily "rest" at 100% duty cycle).
Problem 2: This will cause us not to correctly honour the
post_pwm_on_delay (which also risks flickers).
Fix this by moving the code to configure the GPIO output mode until after
we have examines the handover state. That allows us to initialize
enable_gpio to off if the backlight is currently off and on if the
backlight is on.
Cc: stable@vger.kernel.org
Reported-by: Marek Vasut <marex@denx.de>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/video/backlight/pwm_bl.c | 54 ++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 26 deletions(-)
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -199,6 +199,33 @@ static int pwm_backlight_parse_dt(struct
static int pwm_backlight_initial_power_state(const struct pwm_bl_data *pb)
{
struct device_node *node = pb->dev->of_node;
+ bool active = true;
+
+ /*
+ * If the enable GPIO is present, observable (either as input
+ * or output) and off then the backlight is not currently active.
+ * */
+ if (pb->enable_gpio && gpiod_get_value_cansleep(pb->enable_gpio) == 0)
+ active = false;
+
+ if (!regulator_is_enabled(pb->power_supply))
+ active = false;
+
+ if (!pwm_is_enabled(pb->pwm))
+ active = false;
+
+ /*
+ * Synchronize the enable_gpio with the observed state of the
+ * hardware.
+ */
+ if (pb->enable_gpio)
+ gpiod_direction_output(pb->enable_gpio, active);
+
+ /*
+ * Do not change pb->enabled here! pb->enabled essentially
+ * tells us if we own one of the regulator's use counts and
+ * right now we do not.
+ */
/* Not booted with device tree or no phandle link to the node */
if (!node || !node->phandle)
@@ -210,20 +237,7 @@ static int pwm_backlight_initial_power_s
* assume that another driver will enable the backlight at the
* appropriate time. Therefore, if it is disabled, keep it so.
*/
-
- /* if the enable GPIO is disabled, do not enable the backlight */
- if (pb->enable_gpio && gpiod_get_value_cansleep(pb->enable_gpio) == 0)
- return FB_BLANK_POWERDOWN;
-
- /* The regulator is disabled, do not enable the backlight */
- if (!regulator_is_enabled(pb->power_supply))
- return FB_BLANK_POWERDOWN;
-
- /* The PWM is disabled, keep it like this */
- if (!pwm_is_enabled(pb->pwm))
- return FB_BLANK_POWERDOWN;
-
- return FB_BLANK_UNBLANK;
+ return active ? FB_BLANK_UNBLANK: FB_BLANK_POWERDOWN;
}
static int pwm_backlight_probe(struct platform_device *pdev)
@@ -300,18 +314,6 @@ static int pwm_backlight_probe(struct pl
pb->enable_gpio = gpio_to_desc(data->enable_gpio);
}
- /*
- * If the GPIO is not known to be already configured as output, that
- * is, if gpiod_get_direction returns either 1 or -EINVAL, change the
- * direction to output and set the GPIO as active.
- * Do not force the GPIO to active when it was already output as it
- * could cause backlight flickering or we would enable the backlight too
- * early. Leave the decision of the initial backlight state for later.
- */
- if (pb->enable_gpio &&
- gpiod_get_direction(pb->enable_gpio) != 0)
- gpiod_direction_output(pb->enable_gpio, 1);
-
pb->power_supply = devm_regulator_get(&pdev->dev, "power");
if (IS_ERR(pb->power_supply)) {
ret = PTR_ERR(pb->power_supply);
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 096/217] clk: kirkwood: Fix a clocking boot regression
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 095/217] backlight: pwm_bl: Improve bootloader/kernel device handover Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 097/217] fbmem: dont allow too huge resolutions Greg Kroah-Hartman
` (122 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Andrew Lunn, Chris Packham,
Gregory CLEMENT, Sebastian Hesselbarth, Linus Walleij,
Stephen Boyd
From: Linus Walleij <linus.walleij@linaro.org>
commit aaedb9e00e5400220a8871180d23a83e67f29f63 upstream.
Since a few kernel releases the Pogoplug 4 has crashed like this
during boot:
Unable to handle kernel NULL pointer dereference at virtual address 00000002
(...)
[<c04116ec>] (strlen) from [<c00ead80>] (kstrdup+0x1c/0x4c)
[<c00ead80>] (kstrdup) from [<c04591d8>] (__clk_register+0x44/0x37c)
[<c04591d8>] (__clk_register) from [<c04595ec>] (clk_hw_register+0x20/0x44)
[<c04595ec>] (clk_hw_register) from [<c045bfa8>] (__clk_hw_register_mux+0x198/0x1e4)
[<c045bfa8>] (__clk_hw_register_mux) from [<c045c050>] (clk_register_mux_table+0x5c/0x6c)
[<c045c050>] (clk_register_mux_table) from [<c0acf3e0>] (kirkwood_clk_muxing_setup.constprop.0+0x13c/0x1ac)
[<c0acf3e0>] (kirkwood_clk_muxing_setup.constprop.0) from [<c0aceae0>] (of_clk_init+0x12c/0x214)
[<c0aceae0>] (of_clk_init) from [<c0ab576c>] (time_init+0x20/0x2c)
[<c0ab576c>] (time_init) from [<c0ab3d18>] (start_kernel+0x3dc/0x56c)
[<c0ab3d18>] (start_kernel) from [<00000000>] (0x0)
Code: e3130020 1afffffb e12fff1e c08a1078 (e5d03000)
This is because the "powersave" mux clock 0 was provided in an unterminated
array, which is required by the loop in the driver:
/* Count, allocate, and register clock muxes */
for (n = 0; desc[n].name;)
n++;
Here n will go out of bounds and then call clk_register_mux() on random
memory contents after the mux clock.
Fix this by terminating the array with a blank entry.
Fixes: 105299381d87 ("cpufreq: kirkwood: use the powersave multiplexer")
Cc: stable@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210814235514.403426-1-linus.walleij@linaro.org
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/clk/mvebu/kirkwood.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/clk/mvebu/kirkwood.c
+++ b/drivers/clk/mvebu/kirkwood.c
@@ -254,6 +254,7 @@ static const char *powersave_parents[] =
static const struct clk_muxing_soc_desc kirkwood_mux_desc[] __initconst = {
{ "powersave", powersave_parents, ARRAY_SIZE(powersave_parents),
11, 1, 0 },
+ { }
};
static struct clk *clk_muxing_get_src(
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 097/217] fbmem: dont allow too huge resolutions
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 096/217] clk: kirkwood: Fix a clocking boot regression Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:41 ` [PATCH 4.14 098/217] rtc: tps65910: Correct driver module alias Greg Kroah-Hartman
` (121 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, syzbot, Tetsuo Handa,
Geert Uytterhoeven, Daniel Vetter, Randy Dunlap
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
commit 8c28051cdcbe9dfcec6bd0a4709d67a09df6edae upstream.
syzbot is reporting page fault at vga16fb_fillrect() [1], for
vga16fb_check_var() is failing to detect multiplication overflow.
if (vxres * vyres > maxmem) {
vyres = maxmem / vxres;
if (vyres < yres)
return -ENOMEM;
}
Since no module would accept too huge resolutions where multiplication
overflow happens, let's reject in the common path.
Link: https://syzkaller.appspot.com/bug?extid=04168c8063cfdde1db5e [1]
Reported-by: syzbot <syzbot+04168c8063cfdde1db5e@syzkaller.appspotmail.com>
Debugged-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/185175d6-227a-7b55-433d-b070929b262c@i-love.sakura.ne.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/video/fbdev/core/fbmem.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -34,6 +34,7 @@
#include <linux/fb.h>
#include <linux/fbcon.h>
#include <linux/mem_encrypt.h>
+#include <linux/overflow.h>
#include <asm/fb.h>
@@ -983,6 +984,7 @@ fb_set_var(struct fb_info *info, struct
if ((var->activate & FB_ACTIVATE_FORCE) ||
memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) {
u32 activate = var->activate;
+ u32 unused;
/* When using FOURCC mode, make sure the red, green, blue and
* transp fields are set to 0.
@@ -1007,6 +1009,11 @@ fb_set_var(struct fb_info *info, struct
if (var->xres < 8 || var->yres < 8)
return -EINVAL;
+ /* Too huge resolution causes multiplication overflow. */
+ if (check_mul_overflow(var->xres, var->yres, &unused) ||
+ check_mul_overflow(var->xres_virtual, var->yres_virtual, &unused))
+ return -EINVAL;
+
ret = info->fbops->fb_check_var(var, info);
if (ret)
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 098/217] rtc: tps65910: Correct driver module alias
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 097/217] fbmem: dont allow too huge resolutions Greg Kroah-Hartman
@ 2021-09-20 16:41 ` Greg Kroah-Hartman
2021-09-20 16:42 ` [PATCH 4.14 099/217] blk-zoned: allow zone management send operations without CAP_SYS_ADMIN Greg Kroah-Hartman
` (120 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:41 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Anton Bambura, Dmitry Osipenko,
Alexandre Belloni
From: Dmitry Osipenko <digetx@gmail.com>
commit 8d448fa0a8bb1c8d94eef7647edffe9ac81a281e upstream.
The TPS65910 RTC driver module doesn't auto-load because of the wrong
module alias that doesn't match the device name, fix it.
Cc: stable@vger.kernel.org
Reported-by: Anton Bambura <jenneron@protonmail.com>
Tested-by: Anton Bambura <jenneron@protonmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210808160030.8556-1-digetx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/rtc/rtc-tps65910.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -480,6 +480,6 @@ static struct platform_driver tps65910_r
};
module_platform_driver(tps65910_rtc_driver);
-MODULE_ALIAS("platform:rtc-tps65910");
+MODULE_ALIAS("platform:tps65910-rtc");
MODULE_AUTHOR("Venu Byravarasu <vbyravarasu@nvidia.com>");
MODULE_LICENSE("GPL");
^ permalink raw reply [flat|nested] 220+ messages in thread
* [PATCH 4.14 099/217] blk-zoned: allow zone management send operations without CAP_SYS_ADMIN
2021-09-20 16:40 [PATCH 4.14 000/217] 4.14.247-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2021-09-20 16:41 ` [PATCH 4.14 098/217] rtc: tps65910: Correct driver module alias Greg Kroah-Hartman
@ 2021-09-20 16:42 ` Greg Kroah-Hartman
2021-09-20 16:42 ` [PATCH 4.14 100/217] blk-zoned: allow BLKREPORTZONE " Greg Kroah-Hartman
` (119 subsequent siblings)
218 siblings, 0 replies; 220+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-20 16:42 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Niklas Cassel, Damien Le Moal,
Aravind Ramesh, Adam Manzanares, Himanshu Madhani,
Johannes Thumshirn, Jens Axboe
From: Niklas Cassel <niklas.cassel@wdc.com>
commit ead3b768bb51259e3a5f2287ff5fc9041eb6f450 upstream.
Zone management send operations (BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE
and BLKFINISHZONE) should be allowed under the same permissions as write().
(write() does not require CAP_SYS_ADMIN).
Additionally, other ioctls like BLKSECDISCARD and BLKZEROOUT only check if
the fd was successfully opened with FMODE_WRITE.
(They do not require CAP_SYS_ADMIN).
Currently, zone management send operations require both CAP_SYS_ADMIN
and that the fd was successfully opened with FMODE_WRITE.
Remove the CAP_SYS_ADMIN requirement, so that zone management send
operations match the access control requirement of write(), BLKSECDISCARD
and BLKZEROOUT.
Fixes: 3ed05a987e0f ("blk-zoned: implement ioctls")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal