* [PATCH 5.10 000/149] 5.10.156-rc1 review
@ 2022-11-23 8:49 Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 001/149] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe" Greg Kroah-Hartman
` (155 more replies)
0 siblings, 156 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow
This is the start of the stable review cycle for the 5.10.156 release.
There are 149 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 Fri, 25 Nov 2022 08:45:20 +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/v5.x/stable-review/patch-5.10.156-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-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 5.10.156-rc1
Hawkins Jiawei <yin31149@gmail.com>
ntfs: check overflow when iterating ATTR_RECORDs
Hawkins Jiawei <yin31149@gmail.com>
ntfs: fix out-of-bounds read in ntfs_attr_find()
Hawkins Jiawei <yin31149@gmail.com>
ntfs: fix use-after-free in ntfs_attr_find()
Alexander Potapenko <glider@google.com>
mm: fs: initialize fsdata passed to write_begin/write_end interface
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
9p/trans_fd: always use O_NONBLOCK read/write
Andreas Gruenbacher <agruenba@redhat.com>
gfs2: Switch from strlcpy to strscpy
Andrew Price <anprice@redhat.com>
gfs2: Check sb_bsize_shift after reading superblock
Dominique Martinet <asmadeus@codewreck.org>
9p: trans_fd/p9_conn_cancel: drop client lock earlier
Cong Wang <cong.wang@bytedance.com>
kcm: close race conditions on sk_receive_queue
Eric Dumazet <edumazet@google.com>
kcm: avoid potential race in kcm_tx_work
Eric Dumazet <edumazet@google.com>
tcp: cdg: allow tcp_cdg_release() to be called multiple times
Eric Dumazet <edumazet@google.com>
macvlan: enforce a consistent minimal mtu
Tadeusz Struk <tadeusz.struk@linaro.org>
uapi/linux/stddef.h: Add include guards
Chen Jun <chenjun102@huawei.com>
Input: i8042 - fix leaking of platform device on module removal
Li Huafei <lihuafei1@huawei.com>
kprobes: Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case
Yuan Can <yuancan@huawei.com>
scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper()
Yang Yingliang <yangyingliang@huawei.com>
scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus()
Hangbin Liu <liuhangbin@gmail.com>
net: use struct_group to copy ip/ipv6 header addresses
Kees Cook <keescook@chromium.org>
stddef: Introduce struct_group() helper macro
Lukas Wunner <lukas@wunner.de>
usbnet: smsc95xx: Fix deadlock on runtime resume
Steven Rostedt (Google) <rostedt@goodmis.org>
ring-buffer: Include dropped pages in counting dirty patches
Gong, Sishuai <sishuai@purdue.edu>
net: fix a concurrency bug in l2tp_tunnel_register()
Keith Busch <kbusch@kernel.org>
nvme: ensure subsystem reset is single threaded
Keith Busch <kbusch@kernel.org>
nvme: restrict management ioctls to admin
Adrian Hunter <adrian.hunter@intel.com>
perf/x86/intel/pt: Fix sampling using single range output
Alexander Potapenko <glider@google.com>
misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram()
Shuah Khan <skhan@linuxfoundation.org>
docs: update mediator contact information in CoC doc
Xiongfeng Wang <wangxiongfeng2@huawei.com>
mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put()
Chevron Li <chevron.li@bayhubtech.com>
mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout
Yann Gautier <yann.gautier@foss.st.com>
mmc: core: properly select voltage range without power cycle
Brian Norris <briannorris@chromium.org>
firmware: coreboot: Register bus in module init
Tina Zhang <tina.zhang@intel.com>
iommu/vt-d: Set SRE bit only when hardware has SRS cap
Benjamin Block <bblock@linux.ibm.com>
scsi: zfcp: Fix double free of FSF request when qdio send fails
Alban Crequy <albancrequy@linux.microsoft.com>
maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault()
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Input: iforce - invert valid length check when fetching device IDs
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
serial: 8250_lpss: Configure DMA also w/o DMA filter
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
serial: 8250: Flush DMA Rx on RLSI
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs
Mikulas Patocka <mpatocka@redhat.com>
dm ioctl: fix misbehavior if list_versions races with module loading
Mitja Spes <mitja@lxnav.com>
iio: pressure: ms5611: changed hardcoded SPI speed to value limited
Saravanan Sekar <sravanhome@gmail.com>
iio: adc: mp2629: fix potential array out of bound access
Saravanan Sekar <sravanhome@gmail.com>
iio: adc: mp2629: fix wrong comparison of channel
Yang Yingliang <yangyingliang@huawei.com>
iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init()
Yang Yingliang <yangyingliang@huawei.com>
iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger()
Rajat Khandelwal <rajat.khandelwal@linux.intel.com>
usb: typec: mux: Enter safe mode only when pins need to be reconfigured
Duoming Zhou <duoming@zju.edu.cn>
usb: chipidea: fix deadlock in ci_otg_del_timer
Nicolas Dumazet <ndumazet@google.com>
usb: add NO_LPM quirk for Realforce 87U Keyboard
Reinhard Speyerer <rspmn@arcor.de>
USB: serial: option: add Fibocom FM160 0x0111 composition
Davide Tronchin <davide.tronchin.94@gmail.com>
USB: serial: option: add u-blox LARA-L6 modem
Davide Tronchin <davide.tronchin.94@gmail.com>
USB: serial: option: add u-blox LARA-R6 00B modem
Davide Tronchin <davide.tronchin.94@gmail.com>
USB: serial: option: remove old LARA-R6 PID
Benoît Monin <benoit.monin@gmx.fr>
USB: serial: option: add Sierra Wireless EM9191
Linus Walleij <linus.walleij@linaro.org>
USB: bcma: Make GPIO explicitly optional
Mushahid Hussain <mushi.shar@gmail.com>
speakup: fix a segfault caused by switching consoles
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
slimbus: stream: correct presence rate frequencies
Johan Hovold <johan+linaro@kernel.org>
Revert "usb: dwc3: disable USB core PHY management"
Takashi Iwai <tiwai@suse.de>
ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
Emil Flink <emil.flink@gmail.com>
ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open()
Shang XiaoJing <shangxiaojing@huawei.com>
tracing: kprobe: Fix potential null-ptr-deref on trace_array in kprobe_event_gen_test_exit()
Shang XiaoJing <shangxiaojing@huawei.com>
tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit()
Shang XiaoJing <shangxiaojing@huawei.com>
tracing: Fix wild-memory-access in register_synth_event()
Shang XiaoJing <shangxiaojing@huawei.com>
tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event()
Steven Rostedt (Google) <rostedt@goodmis.org>
tracing/ring-buffer: Have polling block on watermark
Daniil Tatianin <d-tatianin@yandex-team.ru>
ring_buffer: Do not deactivate non-existant pages
Xiu Jianfeng <xiujianfeng@huawei.com>
ftrace: Fix null pointer dereference in ftrace_add_mod()
Wang Wensheng <wangwensheng4@huawei.com>
ftrace: Optimize the allocation for mcount entries
Wang Wensheng <wangwensheng4@huawei.com>
ftrace: Fix the possible incorrect kernel message
Anastasia Belova <abelova@astralinux.ru>
cifs: add check for returning value of SMB2_set_info_init
Yuan Can <yuancan@huawei.com>
net: thunderbolt: Fix error handling in tbnet_init()
Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
cifs: Fix wrong return value checking when GETFLAGS
Wei Yongjun <weiyongjun1@huawei.com>
net/x25: Fix skb leak in x25_lapb_receive_frame()
Liu Jian <liujian56@huawei.com>
net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
Anastasia Belova <abelova@astralinux.ru>
cifs: add check for returning value of SMB2_close_init
Roger Pau Monné <roger.pau@citrix.com>
platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized
Dan Carpenter <error27@gmail.com>
drbd: use after free in drbd_create_device()
Yuan Can <yuancan@huawei.com>
net: ena: Fix error handling in ena_init()
Yuan Can <yuancan@huawei.com>
net: ionic: Fix error handling in ionic_init_module()
Yang Yingliang <yangyingliang@huawei.com>
xen/pcpu: fix possible memory leak in register_pcpu()
Gaosheng Cui <cuigaosheng1@huawei.com>
bnxt_en: Remove debugfs when pci_register_driver failed
Zhengchao Shao <shaozhengchao@huawei.com>
net: caif: fix double disconnect client in chnl_net_open()
Chuang Wang <nashuiliang@gmail.com>
net: macvlan: Use built-in RCU list checking
Wang ShaoBo <bobo.shaobowang@huawei.com>
mISDN: fix misuse of put_device() in mISDN_register_device()
Zhengchao Shao <shaozhengchao@huawei.com>
net: liquidio: release resources when liquidio driver open failed
Yuan Can <yuancan@huawei.com>
net: hinic: Fix error handling in hinic_module_init()
Yang Yingliang <yangyingliang@huawei.com>
mISDN: fix possible memory leak in mISDN_dsp_element_register()
Wei Yongjun <weiyongjun1@huawei.com>
net: bgmac: Drop free_netdev() from bgmac_enet_remove()
Xu Kuohai <xukuohai@huawei.com>
bpf: Initialize same number of free nodes for each pcpu_freelist
Yang Yingliang <yangyingliang@huawei.com>
ata: libata-transport: fix error handling in ata_tdev_add()
Yang Yingliang <yangyingliang@huawei.com>
ata: libata-transport: fix error handling in ata_tlink_add()
Yang Yingliang <yangyingliang@huawei.com>
ata: libata-transport: fix error handling in ata_tport_add()
Yang Yingliang <yangyingliang@huawei.com>
ata: libata-transport: fix double ata_host_put() in ata_tport_add()
Marek Vasut <marex@denx.de>
arm64: dts: imx8mn: Fix NAND controller size-cells
Marek Vasut <marex@denx.de>
arm64: dts: imx8mm: Fix NAND controller size-cells
Marek Vasut <marex@denx.de>
ARM: dts: imx7: Fix NAND controller size-cells
Shang XiaoJing <shangxiaojing@huawei.com>
drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker()
Shang XiaoJing <shangxiaojing@huawei.com>
drm/drv: Fix potential memory leak in drm_dev_init()
Aishwarya Kothari <aishwarya.kothari@toradex.com>
drm/panel: simple: set bpc field for logic technologies displays
Zeng Heng <zengheng4@huawei.com>
pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map
Maciej W. Rozycki <macro@orcam.me.uk>
parport_pc: Avoid FIFO port location truncation
Yang Yingliang <yangyingliang@huawei.com>
siox: fix possible memory leak in siox_device_add()
D Scott Phillips <scott@os.amperecomputing.com>
arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro
Serge Semin <Sergey.Semin@baikalelectronics.ru>
block: sed-opal: kmalloc the cmd/resp buffers
Xin Long <lucien.xin@gmail.com>
sctp: clear out_curr if all frag chunks of current msg are pruned
Xin Long <lucien.xin@gmail.com>
sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent
Chen Zhongjin <chenzhongjin@huawei.com>
ASoC: soc-utils: Remove __exit for snd_soc_util_exit()
Baisong Zhong <zhongbaisong@huawei.com>
bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb()
Duoming Zhou <duoming@zju.edu.cn>
tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send
Shawn Guo <shawn.guo@linaro.org>
serial: imx: Add missing .thaw_noirq hook
Tony Lindgren <tony@atomide.com>
serial: 8250: omap: Flush PM QOS work on remove
Tony Lindgren <tony@atomide.com>
serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()
Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
serial: 8250_omap: remove wait loop from Errata i202 workaround
Tony Lindgren <tony@atomide.com>
serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl()
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
serial: 8250: Remove serial_rs485 sanitization from em485
Martin Povišer <povik+lin@cutebit.org>
ASoC: tas2764: Fix set_tdm_slot in case of single slot
Martin Povišer <povik+lin@cutebit.org>
ASoC: tas2770: Fix set_tdm_slot in case of single slot
Chen Zhongjin <chenzhongjin@huawei.com>
ASoC: core: Fix use-after-free in snd_soc_exit()
Marek Vasut <marex@denx.de>
spi: stm32: Print summary 'callbacks suppressed' message
Guchun Chen <guchun.chen@amd.com>
drm/amdgpu: disable BACO on special BEIGE_GOBY card
Guchun Chen <guchun.chen@amd.com>
drm/amd/pm: disable BACO entry/exit completely on several sienna cichlid cards
Lijo Lazar <lijo.lazar@amd.com>
drm/amd/pm: Read BIF STRAP also for BACO check
Evan Quan <evan.quan@amd.com>
drm/amd/pm: support power source switch on Sienna Cichlid
Haibo Chen <haibo.chen@nxp.com>
mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA
Mika Westerberg <mika.westerberg@linux.intel.com>
spi: intel: Use correct mask for flash and protected regions
Mika Westerberg <mika.westerberg@linux.intel.com>
mtd: spi-nor: intel-spi: Disable write protection only if asked
Alexander Sergeyev <sergeev917@gmail.com>
ALSA: hda/realtek: fix speakers and micmute on HP 855 G8
Colin Ian King <colin.i.king@gmail.com>
ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route"
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
Filipe Manana <fdmanana@suse.com>
btrfs: remove pointless and double ulist frees in error paths of qgroup tests
Nathan Huckleberry <nhuck@google.com>
drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid
Nam Cao <namcaov@gmail.com>
i2c: i801: add lis3lv02d's I2C address for Vostro 5568
Thierry Reding <treding@nvidia.com>
i2c: tegra: Allocate DMA memory for DMA engine
Benjamin Coddington <bcodding@redhat.com>
NFSv4: Retry LOCK on OLD_STATEID during delegation return
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
drm/amd/display: Remove wrong pipe control lock
Shuming Fan <shumingf@realtek.com>
ASoC: rt1308-sdw: add the default value of some registers
Alexandre Belloni <alexandre.belloni@bootlin.com>
rtc: cmos: fix build on non-ACPI platforms
Ricardo Cañuelo <ricardo.canuelo@collabora.com>
selftests/intel_pstate: fix build for ARCH=x86_64
Ricardo Cañuelo <ricardo.canuelo@collabora.com>
selftests/futex: fix build for clang
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15
Siarhei Volkau <lis8215@gmail.com>
ASoC: codecs: jz4725b: fix capture selector naming
Siarhei Volkau <lis8215@gmail.com>
ASoC: codecs: jz4725b: use right control for Capture Volume
Siarhei Volkau <lis8215@gmail.com>
ASoC: codecs: jz4725b: fix reported volume for Master ctl
Siarhei Volkau <lis8215@gmail.com>
ASoC: codecs: jz4725b: add missed Line In power control bit
Mauro Lima <mauro.lima@eclypsium.com>
spi: intel: Fix the offset to get the 64K erase opcode
Xiaolei Wang <xiaolei.wang@windriver.com>
ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK
Zhang Qilong <zhangqilong3@huawei.com>
ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe
Zhang Qilong <zhangqilong3@huawei.com>
ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe"
Zhang Qilong <zhangqilong3@huawei.com>
ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe"
Zhang Qilong <zhangqilong3@huawei.com>
ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe"
-------------
Diffstat:
.../process/code-of-conduct-interpretation.rst | 2 +-
Makefile | 4 +-
arch/arm/boot/dts/imx7s.dtsi | 4 +-
arch/arm64/boot/dts/freescale/imx8mm.dtsi | 4 +-
arch/arm64/boot/dts/freescale/imx8mn.dtsi | 2 +-
arch/arm64/include/asm/cputype.h | 2 +-
arch/x86/events/intel/pt.c | 9 +++
block/sed-opal.c | 32 ++++++++--
drivers/accessibility/speakup/main.c | 2 +-
drivers/ata/libata-transport.c | 19 ++++--
drivers/block/drbd/drbd_main.c | 4 +-
drivers/firmware/google/coreboot_table.c | 37 ++++++++---
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +-
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 25 ++++++--
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 27 +++++---
.../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 42 +++++++++++--
drivers/gpu/drm/drm_drv.c | 2 +-
drivers/gpu/drm/drm_internal.h | 3 +-
drivers/gpu/drm/imx/imx-tve.c | 5 +-
drivers/gpu/drm/panel/panel-simple.c | 2 +
drivers/i2c/busses/i2c-i801.c | 1 +
drivers/i2c/busses/i2c-tegra.c | 16 +++--
drivers/iio/adc/at91_adc.c | 4 +-
drivers/iio/adc/mp2629_adc.c | 5 +-
drivers/iio/pressure/ms5611_spi.c | 2 +-
drivers/iio/trigger/iio-trig-sysfs.c | 6 +-
drivers/input/joystick/iforce/iforce-main.c | 8 +--
drivers/input/serio/i8042.c | 4 --
drivers/iommu/intel/pasid.c | 5 +-
drivers/isdn/mISDN/core.c | 2 +-
drivers/isdn/mISDN/dsp_pipeline.c | 3 +-
drivers/md/dm-ioctl.c | 4 +-
drivers/mfd/lpc_ich.c | 59 ++++++++++++++++--
drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 +
drivers/mmc/core/core.c | 8 ++-
drivers/mmc/host/sdhci-esdhc-imx.c | 4 +-
drivers/mmc/host/sdhci-pci-core.c | 2 +
drivers/mmc/host/sdhci-pci-o2micro.c | 7 +++
drivers/mtd/spi-nor/controllers/intel-spi-pci.c | 29 ++++++---
drivers/mtd/spi-nor/controllers/intel-spi.c | 51 ++++++++--------
drivers/net/ethernet/amazon/ena/ena_netdev.c | 8 ++-
drivers/net/ethernet/atheros/ag71xx.c | 3 +-
drivers/net/ethernet/broadcom/bgmac.c | 1 -
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 ++-
drivers/net/ethernet/cavium/liquidio/lio_main.c | 34 ++++++++---
drivers/net/ethernet/huawei/hinic/hinic_main.c | 9 ++-
drivers/net/ethernet/pensando/ionic/ionic_main.c | 8 ++-
drivers/net/macvlan.c | 6 +-
drivers/net/thunderbolt.c | 19 ++++--
drivers/net/usb/smsc95xx.c | 27 ++++++--
drivers/nvme/host/core.c | 6 ++
drivers/nvme/host/nvme.h | 16 ++++-
drivers/parport/parport_pc.c | 2 +-
drivers/pinctrl/devicetree.c | 2 +
drivers/platform/x86/intel_pmc_core_pltdrv.c | 9 +++
drivers/rtc/rtc-cmos.c | 3 +
drivers/s390/scsi/zfcp_fsf.c | 2 +-
drivers/scsi/scsi_debug.c | 6 +-
drivers/siox/siox-core.c | 2 +
drivers/slimbus/stream.c | 8 +--
drivers/spi/spi-stm32.c | 1 +
drivers/target/loopback/tcm_loop.c | 3 +-
drivers/tty/n_gsm.c | 2 +-
drivers/tty/serial/8250/8250_lpss.c | 15 +++--
drivers/tty/serial/8250/8250_omap.c | 45 ++++++++------
drivers/tty/serial/8250/8250_port.c | 25 +++-----
drivers/tty/serial/imx.c | 1 +
drivers/usb/chipidea/otg_fsm.c | 2 +
drivers/usb/core/quirks.c | 3 +
drivers/usb/dwc3/host.c | 10 ---
drivers/usb/host/bcma-hcd.c | 10 +--
drivers/usb/serial/option.c | 19 +++++-
drivers/usb/typec/mux/intel_pmc_mux.c | 15 ++++-
drivers/xen/pcpu.c | 2 +-
fs/btrfs/tests/qgroup-tests.c | 16 ++---
fs/buffer.c | 4 +-
fs/cifs/ioctl.c | 4 +-
fs/cifs/smb2ops.c | 4 ++
fs/gfs2/ops_fstype.c | 17 ++++--
fs/namei.c | 2 +-
fs/nfs/nfs4proc.c | 6 +-
fs/ntfs/attrib.c | 28 +++++++--
fs/ntfs/inode.c | 7 +++
include/linux/platform_data/intel-spi.h | 6 +-
include/linux/ring_buffer.h | 2 +-
include/linux/stddef.h | 48 +++++++++++++++
include/net/ip.h | 2 +-
include/net/ipv6.h | 2 +-
include/uapi/linux/ip.h | 6 +-
include/uapi/linux/ipv6.h | 6 +-
include/uapi/linux/stddef.h | 25 ++++++++
kernel/bpf/percpu_freelist.c | 23 ++++---
kernel/kprobes.c | 8 ++-
kernel/trace/ftrace.c | 5 +-
kernel/trace/kprobe_event_gen_test.c | 48 ++++++++++-----
kernel/trace/ring_buffer.c | 71 +++++++++++++++-------
kernel/trace/synth_event_gen_test.c | 16 ++---
kernel/trace/trace.c | 2 +-
kernel/trace/trace_events_synth.c | 5 +-
mm/filemap.c | 2 +-
mm/maccess.c | 2 +-
net/9p/trans_fd.c | 6 +-
net/bluetooth/l2cap_core.c | 2 +-
net/bpf/test_run.c | 1 +
net/caif/chnl_net.c | 3 -
net/ipv4/tcp_cdg.c | 2 +
net/kcm/kcmsock.c | 62 +++----------------
net/l2tp/l2tp_core.c | 10 +--
net/sctp/outqueue.c | 13 ++--
net/x25/x25_dev.c | 2 +-
scripts/kernel-doc | 7 +++
sound/pci/hda/patch_realtek.c | 14 +++++
sound/soc/codecs/jz4725b.c | 34 ++++++-----
sound/soc/codecs/mt6660.c | 8 +--
sound/soc/codecs/rt1308-sdw.h | 2 +
sound/soc/codecs/tas2764.c | 19 ++----
sound/soc/codecs/tas2770.c | 20 ++----
sound/soc/codecs/wm5102.c | 6 +-
sound/soc/codecs/wm5110.c | 6 +-
sound/soc/codecs/wm8962.c | 54 +++++++++++++++-
sound/soc/codecs/wm8997.c | 6 +-
sound/soc/intel/boards/sof_sdw.c | 11 ++++
sound/soc/soc-core.c | 17 +++++-
sound/soc/soc-utils.c | 2 +-
sound/usb/midi.c | 4 +-
tools/testing/selftests/futex/functional/Makefile | 6 +-
tools/testing/selftests/intel_pstate/Makefile | 6 +-
127 files changed, 1008 insertions(+), 467 deletions(-)
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 001/149] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe"
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 002/149] ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe" Greg Kroah-Hartman
` (154 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhang Qilong, Charles Keepax,
Mark Brown, Sasha Levin
From: Zhang Qilong <zhangqilong3@huawei.com>
[ Upstream commit de71d7567e358effd06dfc3e2a154b25f1331c10 ]
This reverts commit fcbb60820cd3008bb44334a0395e5e57ccb77329.
The pm_runtime_disable is redundant when error returns in
wm5102_probe, we just revert the old patch to fix it.
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010114852.88127-2-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wm5102.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index b7f5e5391fdb..2ed3fa67027d 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -2083,6 +2083,9 @@ static int wm5102_probe(struct platform_device *pdev)
regmap_update_bits(arizona->regmap, wm5102_digital_vu[i],
WM5102_DIG_VU, WM5102_DIG_VU);
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_idle(&pdev->dev);
+
ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1,
"ADSP2 Compressed IRQ", wm5102_adsp2_irq,
wm5102);
@@ -2115,9 +2118,6 @@ static int wm5102_probe(struct platform_device *pdev)
goto err_spk_irqs;
}
- pm_runtime_enable(&pdev->dev);
- pm_runtime_idle(&pdev->dev);
-
return ret;
err_spk_irqs:
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 002/149] ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe"
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 001/149] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe" Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 003/149] ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe" Greg Kroah-Hartman
` (153 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhang Qilong, Charles Keepax,
Mark Brown, Sasha Levin
From: Zhang Qilong <zhangqilong3@huawei.com>
[ Upstream commit 7d4e966f4cd73ff69bf06934e8e14a33fb7ef447 ]
This reverts commit 86b46bf1feb83898d89a2b4a8d08d21e9ea277a7.
The pm_runtime_disable is redundant when error returns in
wm5110_probe, we just revert the old patch to fix it.
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010114852.88127-3-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wm5110.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index c158f8b1e8e4..d0cef982215d 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -2452,6 +2452,9 @@ static int wm5110_probe(struct platform_device *pdev)
regmap_update_bits(arizona->regmap, wm5110_digital_vu[i],
WM5110_DIG_VU, WM5110_DIG_VU);
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_idle(&pdev->dev);
+
ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1,
"ADSP2 Compressed IRQ", wm5110_adsp2_irq,
wm5110);
@@ -2484,9 +2487,6 @@ static int wm5110_probe(struct platform_device *pdev)
goto err_spk_irqs;
}
- pm_runtime_enable(&pdev->dev);
- pm_runtime_idle(&pdev->dev);
-
return ret;
err_spk_irqs:
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 003/149] ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe"
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 001/149] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe" Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 002/149] ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe" Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 004/149] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe Greg Kroah-Hartman
` (152 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhang Qilong, Charles Keepax,
Mark Brown, Sasha Levin
From: Zhang Qilong <zhangqilong3@huawei.com>
[ Upstream commit 68ce83e3bb26feba0fcdd59667fde942b3a600a1 ]
This reverts commit 41a736ac20602f64773e80f0f5b32cde1830a44a.
The pm_runtime_disable is redundant when error returns in
wm8997_probe, we just revert the old patch to fix it.
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010114852.88127-4-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wm8997.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index 07378714b013..229f2986cd96 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1156,6 +1156,9 @@ static int wm8997_probe(struct platform_device *pdev)
regmap_update_bits(arizona->regmap, wm8997_digital_vu[i],
WM8997_DIG_VU, WM8997_DIG_VU);
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_idle(&pdev->dev);
+
arizona_init_common(arizona);
ret = arizona_init_vol_limit(arizona);
@@ -1174,9 +1177,6 @@ static int wm8997_probe(struct platform_device *pdev)
goto err_spk_irqs;
}
- pm_runtime_enable(&pdev->dev);
- pm_runtime_idle(&pdev->dev);
-
return ret;
err_spk_irqs:
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 004/149] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 003/149] ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe" Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 005/149] ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK Greg Kroah-Hartman
` (151 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhang Qilong,
AngeloGioacchino Del Regno, Mark Brown, Sasha Levin
From: Zhang Qilong <zhangqilong3@huawei.com>
[ Upstream commit c4ab29b0f3a6f1e167c5a627f7cd036c1d2b7d65 ]
It would be better to keep the pm_runtime enables before the
IRQ and component stuff. Both of those could start triggering
PM runtime events.
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221008140522.134912-1-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/mt6660.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/mt6660.c b/sound/soc/codecs/mt6660.c
index e18a58868273..3cee2ea4b85d 100644
--- a/sound/soc/codecs/mt6660.c
+++ b/sound/soc/codecs/mt6660.c
@@ -504,14 +504,14 @@ static int mt6660_i2c_probe(struct i2c_client *client,
dev_err(chip->dev, "read chip revision fail\n");
goto probe_fail;
}
+ pm_runtime_set_active(chip->dev);
+ pm_runtime_enable(chip->dev);
ret = devm_snd_soc_register_component(chip->dev,
&mt6660_component_driver,
&mt6660_codec_dai, 1);
- if (!ret) {
- pm_runtime_set_active(chip->dev);
- pm_runtime_enable(chip->dev);
- }
+ if (ret)
+ pm_runtime_disable(chip->dev);
return ret;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 005/149] ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 004/149] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 006/149] spi: intel: Fix the offset to get the 64K erase opcode Greg Kroah-Hartman
` (150 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiaolei Wang, Adam Ford,
Charles Keepax, Mark Brown, Sasha Levin
From: Xiaolei Wang <xiaolei.wang@windriver.com>
[ Upstream commit ee1aa2ae3eaa96e70229fa61deee87ef4528ffdf ]
In wm8962 driver, the WM8962_ADDITIONAL_CONTROL_4 is used as a volatile
register, but this register mixes a bunch of volatile status bits and a
bunch of non-volatile control bits. The dapm widgets TEMP_HP and
TEMP_SPK leverages the control bits in this register. After the wm8962
probe, the regmap will bet set to cache only mode, then a read error
like below would be triggered when trying to read the initial power
state of the dapm widgets TEMP_HP and TEMP_SPK.
wm8962 0-001a: ASoC: error at soc_component_read_no_lock
on wm8962.0-001a: -16
In order to fix this issue, we add event handler to actually power
up/down these widgets. With this change, we also need to explicitly
power off these widgets in the wm8962 probe since they are enabled
by default.
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Tested-by: Adam Ford <aford173@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010092014.2229246-1-xiaolei.wang@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wm8962.c | 54 +++++++++++++++++++++++++++++++++++++--
1 file changed, 52 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 38651022e3d5..21574447650c 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -1840,6 +1840,49 @@ SOC_SINGLE_TLV("SPKOUTR Mixer DACR Volume", WM8962_SPEAKER_MIXER_5,
4, 1, 0, inmix_tlv),
};
+static int tp_event(struct snd_soc_dapm_widget *w,
+ struct snd_kcontrol *kcontrol, int event)
+{
+ int ret, reg, val, mask;
+ struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+
+ ret = pm_runtime_resume_and_get(component->dev);
+ if (ret < 0) {
+ dev_err(component->dev, "Failed to resume device: %d\n", ret);
+ return ret;
+ }
+
+ reg = WM8962_ADDITIONAL_CONTROL_4;
+
+ if (!strcmp(w->name, "TEMP_HP")) {
+ mask = WM8962_TEMP_ENA_HP_MASK;
+ val = WM8962_TEMP_ENA_HP;
+ } else if (!strcmp(w->name, "TEMP_SPK")) {
+ mask = WM8962_TEMP_ENA_SPK_MASK;
+ val = WM8962_TEMP_ENA_SPK;
+ } else {
+ pm_runtime_put(component->dev);
+ return -EINVAL;
+ }
+
+ switch (event) {
+ case SND_SOC_DAPM_POST_PMD:
+ val = 0;
+ fallthrough;
+ case SND_SOC_DAPM_POST_PMU:
+ ret = snd_soc_component_update_bits(component, reg, mask, val);
+ break;
+ default:
+ WARN(1, "Invalid event %d\n", event);
+ pm_runtime_put(component->dev);
+ return -EINVAL;
+ }
+
+ pm_runtime_put(component->dev);
+
+ return 0;
+}
+
static int cp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
@@ -2133,8 +2176,10 @@ SND_SOC_DAPM_SUPPLY("TOCLK", WM8962_ADDITIONAL_CONTROL_1, 0, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY_S("DSP2", 1, WM8962_DSP2_POWER_MANAGEMENT,
WM8962_DSP2_ENA_SHIFT, 0, dsp2_event,
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
-SND_SOC_DAPM_SUPPLY("TEMP_HP", WM8962_ADDITIONAL_CONTROL_4, 2, 0, NULL, 0),
-SND_SOC_DAPM_SUPPLY("TEMP_SPK", WM8962_ADDITIONAL_CONTROL_4, 1, 0, NULL, 0),
+SND_SOC_DAPM_SUPPLY("TEMP_HP", SND_SOC_NOPM, 0, 0, tp_event,
+ SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD),
+SND_SOC_DAPM_SUPPLY("TEMP_SPK", SND_SOC_NOPM, 0, 0, tp_event,
+ SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER("INPGAL", WM8962_LEFT_INPUT_PGA_CONTROL, 4, 0,
inpgal, ARRAY_SIZE(inpgal)),
@@ -3760,6 +3805,11 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
if (ret < 0)
goto err_pm_runtime;
+ regmap_update_bits(wm8962->regmap, WM8962_ADDITIONAL_CONTROL_4,
+ WM8962_TEMP_ENA_HP_MASK, 0);
+ regmap_update_bits(wm8962->regmap, WM8962_ADDITIONAL_CONTROL_4,
+ WM8962_TEMP_ENA_SPK_MASK, 0);
+
regcache_cache_only(wm8962->regmap, true);
/* The drivers should power up as needed */
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 006/149] spi: intel: Fix the offset to get the 64K erase opcode
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 005/149] ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 007/149] ASoC: codecs: jz4725b: add missed Line In power control bit Greg Kroah-Hartman
` (149 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mauro Lima, Mika Westerberg,
Mark Brown, Sasha Levin
From: Mauro Lima <mauro.lima@eclypsium.com>
[ Upstream commit 6a43cd02ddbc597dc9a1f82c1e433f871a2f6f06 ]
According to documentation, the 64K erase opcode is located in VSCC
range [16:23] instead of [8:15].
Use the proper value to shift the mask over the correct range.
Signed-off-by: Mauro Lima <mauro.lima@eclypsium.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20221012152135.28353-1-mauro.lima@eclypsium.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mtd/spi-nor/controllers/intel-spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/controllers/intel-spi.c b/drivers/mtd/spi-nor/controllers/intel-spi.c
index b54a56a68100..b4b0affd16c8 100644
--- a/drivers/mtd/spi-nor/controllers/intel-spi.c
+++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
@@ -117,7 +117,7 @@
#define ERASE_OPCODE_SHIFT 8
#define ERASE_OPCODE_MASK (0xff << ERASE_OPCODE_SHIFT)
#define ERASE_64K_OPCODE_SHIFT 16
-#define ERASE_64K_OPCODE_MASK (0xff << ERASE_OPCODE_SHIFT)
+#define ERASE_64K_OPCODE_MASK (0xff << ERASE_64K_OPCODE_SHIFT)
#define INTEL_SPI_TIMEOUT 5000 /* ms */
#define INTEL_SPI_FIFO_SZ 64
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 007/149] ASoC: codecs: jz4725b: add missed Line In power control bit
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 006/149] spi: intel: Fix the offset to get the 64K erase opcode Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 008/149] ASoC: codecs: jz4725b: fix reported volume for Master ctl Greg Kroah-Hartman
` (148 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Siarhei Volkau, Mark Brown,
Sasha Levin
From: Siarhei Volkau <lis8215@gmail.com>
[ Upstream commit 1013999b431b4bcdc1f5ae47dd3338122751db31 ]
Line In path stayed powered off during capturing or
bypass to mixer.
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-2-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/jz4725b.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index e49374c72e70..9f6f4e941e55 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -236,7 +236,8 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {
SND_SOC_DAPM_MIXER("DAC to Mixer", JZ4725B_CODEC_REG_CR1,
REG_CR1_DACSEL_OFFSET, 0, NULL, 0),
- SND_SOC_DAPM_MIXER("Line In", SND_SOC_NOPM, 0, 0, NULL, 0),
+ SND_SOC_DAPM_MIXER("Line In", JZ4725B_CODEC_REG_PMR1,
+ REG_PMR1_SB_LIN_OFFSET, 1, NULL, 0),
SND_SOC_DAPM_MIXER("HP Out", JZ4725B_CODEC_REG_CR1,
REG_CR1_HP_DIS_OFFSET, 1, NULL, 0),
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 008/149] ASoC: codecs: jz4725b: fix reported volume for Master ctl
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 007/149] ASoC: codecs: jz4725b: add missed Line In power control bit Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 009/149] ASoC: codecs: jz4725b: use right control for Capture Volume Greg Kroah-Hartman
` (147 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Siarhei Volkau, Mark Brown,
Sasha Levin
From: Siarhei Volkau <lis8215@gmail.com>
[ Upstream commit 088777bf65b98cfa4b5378119d0a7d49a58ece44 ]
DAC volume control is the Master Playback Volume at the moment
and it reports wrong levels in alsamixer and other alsa apps.
The patch fixes that, as stated in manual on the jz4725b SoC
(16.6.3.4 Programmable attenuation: GOD) the ctl range varies
from -22.5dB to 0dB with 1.5dB step.
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-3-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/jz4725b.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index 9f6f4e941e55..6f3d4ead9150 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -142,8 +142,8 @@ struct jz_icdc {
struct clk *clk;
};
-static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_dac_tlv, -2250, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600);
+static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);
static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
SOC_DOUBLE_TLV("Master Playback Volume",
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 009/149] ASoC: codecs: jz4725b: use right control for Capture Volume
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 008/149] ASoC: codecs: jz4725b: fix reported volume for Master ctl Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 010/149] ASoC: codecs: jz4725b: fix capture selector naming Greg Kroah-Hartman
` (146 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Siarhei Volkau, Mark Brown,
Sasha Levin
From: Siarhei Volkau <lis8215@gmail.com>
[ Upstream commit 1538e2c8c9b7e7a656effcc6e4e7cfe8c1b405fd ]
Line In Bypass control is used as Master Capture at the moment
this is completely incorrect.
Current control routed to Mixer instead of ADC, thus can't affect
Capture path. ADC control shall be used instead.
ADC volume control parameters are different, so the patch fixes that
as well. Manual says (16.6.3.2 Programmable input attenuation amplifier:
PGATM) that gain varies in range 0dB..22.5dB with 1.5dB step.
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-4-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/jz4725b.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index 6f3d4ead9150..9dc8d76bf104 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -136,13 +136,16 @@ enum {
#define REG_CGR3_GO1L_OFFSET 0
#define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET)
+#define REG_CGR10_GIL_OFFSET 0
+#define REG_CGR10_GIR_OFFSET 4
+
struct jz_icdc {
struct regmap *regmap;
void __iomem *base;
struct clk *clk;
};
-static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600);
+static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);
static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
@@ -151,11 +154,11 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
REG_CGR1_GODL_OFFSET,
REG_CGR1_GODR_OFFSET,
0xf, 1, jz4725b_dac_tlv),
- SOC_DOUBLE_R_TLV("Master Capture Volume",
- JZ4725B_CODEC_REG_CGR3,
- JZ4725B_CODEC_REG_CGR2,
- REG_CGR2_GO1R_OFFSET,
- 0x1f, 1, jz4725b_line_tlv),
+ SOC_DOUBLE_TLV("Master Capture Volume",
+ JZ4725B_CODEC_REG_CGR10,
+ REG_CGR10_GIL_OFFSET,
+ REG_CGR10_GIR_OFFSET,
+ 0xf, 0, jz4725b_adc_tlv),
SOC_SINGLE("Master Playback Switch", JZ4725B_CODEC_REG_CR1,
REG_CR1_DAC_MUTE_OFFSET, 1, 1),
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 010/149] ASoC: codecs: jz4725b: fix capture selector naming
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 009/149] ASoC: codecs: jz4725b: use right control for Capture Volume Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 011/149] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 Greg Kroah-Hartman
` (145 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Siarhei Volkau, Mark Brown,
Sasha Levin
From: Siarhei Volkau <lis8215@gmail.com>
[ Upstream commit 80852f8268769715db335a22305e81a0c4a38a84 ]
At the moment Capture source selector appears on Playback
tab in the alsamixer and has a senseless name.
Let's fix that.
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-5-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/jz4725b.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index 9dc8d76bf104..ab744e375367 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -183,7 +183,7 @@ static SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum,
jz4725b_codec_adc_src_texts,
jz4725b_codec_adc_src_values);
static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl =
- SOC_DAPM_ENUM("Route", jz4725b_codec_adc_src_enum);
+ SOC_DAPM_ENUM("ADC Source Capture Route", jz4725b_codec_adc_src_enum);
static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = {
SOC_DAPM_SINGLE("Line In Bypass", JZ4725B_CODEC_REG_CR1,
@@ -228,7 +228,7 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {
SND_SOC_DAPM_ADC("ADC", "Capture",
JZ4725B_CODEC_REG_PMR1, REG_PMR1_SB_ADC_OFFSET, 1),
- SND_SOC_DAPM_MUX("ADC Source", SND_SOC_NOPM, 0, 0,
+ SND_SOC_DAPM_MUX("ADC Source Capture Route", SND_SOC_NOPM, 0, 0,
&jz4725b_codec_adc_src_ctrl),
/* Mixer */
@@ -287,11 +287,11 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = {
{"Mixer", NULL, "DAC to Mixer"},
{"Mixer to ADC", NULL, "Mixer"},
- {"ADC Source", "Mixer", "Mixer to ADC"},
- {"ADC Source", "Line In", "Line In"},
- {"ADC Source", "Mic 1", "Mic 1"},
- {"ADC Source", "Mic 2", "Mic 2"},
- {"ADC", NULL, "ADC Source"},
+ {"ADC Source Capture Route", "Mixer", "Mixer to ADC"},
+ {"ADC Sourc Capture Routee", "Line In", "Line In"},
+ {"ADC Source Capture Route", "Mic 1", "Mic 1"},
+ {"ADC Source Capture Route", "Mic 2", "Mic 2"},
+ {"ADC", NULL, "ADC Source Capture Route"},
{"Out Stage", NULL, "Mixer"},
{"HP Out", NULL, "Out Stage"},
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 011/149] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 010/149] ASoC: codecs: jz4725b: fix capture selector naming Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-24 13:47 ` Salvatore Bonaccorso
2022-11-23 8:49 ` [PATCH 5.10 012/149] selftests/futex: fix build for clang Greg Kroah-Hartman
` (144 subsequent siblings)
155 siblings, 1 reply; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pierre-Louis Bossart,
Ranjani Sridharan, Bard Liao, Mark Brown, Sasha Levin
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
[ Upstream commit 41deb2db64997d01110faaf763bd911d490dfde7 ]
Some NUC15 LAPBC710 devices don't expose the same DMI information as
the Intel reference, add additional entry in the match table.
BugLink: https://github.com/thesofproject/linux/issues/3885
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221017204054.207512-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/intel/boards/sof_sdw.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 25548555d8d7..5e1a718a64da 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -175,6 +175,17 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
SOF_SDW_PCH_DMIC |
SOF_RT711_JD_SRC_JD2),
},
+ {
+ /* NUC15 LAPBC710 skews */
+ .callback = sof_sdw_quirk_cb,
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
+ DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"),
+ },
+ .driver_data = (void *)(SOF_SDW_TGL_HDMI |
+ SOF_SDW_PCH_DMIC |
+ RT711_JD1),
+ },
/* TigerLake-SDCA devices */
{
.callback = sof_sdw_quirk_cb,
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 012/149] selftests/futex: fix build for clang
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 011/149] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 013/149] selftests/intel_pstate: fix build for ARCH=x86_64 Greg Kroah-Hartman
` (143 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ricardo Cañuelo,
André Almeida, Shuah Khan, Sasha Levin
From: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
[ Upstream commit 03cab65a07e083b6c1010fbc8f9b817e9aca75d9 ]
Don't use the test-specific header files as source files to force a
target dependency, as clang will complain if more than one source file
is used for a compile command with a single '-o' flag.
Use the proper Makefile variables instead as defined in
tools/testing/selftests/lib.mk.
Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/futex/functional/Makefile | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index 23207829ec75..6a0ed2e7881e 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -3,11 +3,11 @@ INCLUDES := -I../include -I../../
CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES)
LDLIBS := -lpthread -lrt
-HEADERS := \
+LOCAL_HDRS := \
../include/futextest.h \
../include/atomic.h \
../include/logging.h
-TEST_GEN_FILES := \
+TEST_GEN_PROGS := \
futex_wait_timeout \
futex_wait_wouldblock \
futex_requeue_pi \
@@ -21,5 +21,3 @@ TEST_PROGS := run.sh
top_srcdir = ../../../../..
KSFT_KHDR_INSTALL := 1
include ../../lib.mk
-
-$(TEST_GEN_FILES): $(HEADERS)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 013/149] selftests/intel_pstate: fix build for ARCH=x86_64
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 012/149] selftests/futex: fix build for clang Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 014/149] rtc: cmos: fix build on non-ACPI platforms Greg Kroah-Hartman
` (142 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ricardo Cañuelo, Shuah Khan,
Sasha Levin
From: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
[ Upstream commit beb7d862ed4ac6aa14625418970f22a7d55b8615 ]
Handle the scenario where the build is launched with the ARCH envvar
defined as x86_64.
Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/intel_pstate/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile
index 39f0fa2a8fd6..05d66ef50c97 100644
--- a/tools/testing/selftests/intel_pstate/Makefile
+++ b/tools/testing/selftests/intel_pstate/Makefile
@@ -2,10 +2,10 @@
CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE
LDLIBS += -lm
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
+ARCH_PROCESSED := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
-ifeq (x86,$(ARCH))
+ifeq (x86,$(ARCH_PROCESSED))
TEST_GEN_FILES := msr aperf
endif
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 014/149] rtc: cmos: fix build on non-ACPI platforms
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 013/149] selftests/intel_pstate: fix build for ARCH=x86_64 Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 015/149] ASoC: rt1308-sdw: add the default value of some registers Greg Kroah-Hartman
` (141 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Alexandre Belloni,
Sasha Levin
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
[ Upstream commit db4e955ae333567dea02822624106c0b96a2f84f ]
Now that rtc_wake_setup is called outside of cmos_wake_setup, it also need
to be defined on non-ACPI platforms.
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20221018203512.2532407-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rtc/rtc-cmos.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 58c6382a2807..0383f49ee0d8 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1293,6 +1293,9 @@ static void cmos_check_acpi_rtc_status(struct device *dev,
{
}
+static void rtc_wake_setup(struct device *dev)
+{
+}
#endif
#ifdef CONFIG_PNP
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 015/149] ASoC: rt1308-sdw: add the default value of some registers
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 014/149] rtc: cmos: fix build on non-ACPI platforms Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 016/149] drm/amd/display: Remove wrong pipe control lock Greg Kroah-Hartman
` (140 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shuming Fan, Mark Brown, Sasha Levin
From: Shuming Fan <shumingf@realtek.com>
[ Upstream commit 75d8b1662ca5c20cf8365575222abaef18ff1f50 ]
The driver missed the default value of register 0xc070/0xc360.
This patch adds that default value to avoid invalid register access
when the device doesn't be enumerated yet.
BugLink: https://github.com/thesofproject/linux/issues/3924
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20221019095715.31082-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt1308-sdw.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/rt1308-sdw.h b/sound/soc/codecs/rt1308-sdw.h
index c5ce75666dcc..98293d73ebab 100644
--- a/sound/soc/codecs/rt1308-sdw.h
+++ b/sound/soc/codecs/rt1308-sdw.h
@@ -139,9 +139,11 @@ static const struct reg_default rt1308_reg_defaults[] = {
{ 0x3005, 0x23 },
{ 0x3008, 0x02 },
{ 0x300a, 0x00 },
+ { 0xc000 | (RT1308_DATA_PATH << 4), 0x00 },
{ 0xc003 | (RT1308_DAC_SET << 4), 0x00 },
{ 0xc001 | (RT1308_POWER << 4), 0x00 },
{ 0xc002 | (RT1308_POWER << 4), 0x00 },
+ { 0xc000 | (RT1308_POWER_STATUS << 4), 0x00 },
};
#define RT1308_SDW_OFFSET 0xc000
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 016/149] drm/amd/display: Remove wrong pipe control lock
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 015/149] ASoC: rt1308-sdw: add the default value of some registers Greg Kroah-Hartman
@ 2022-11-23 8:49 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 017/149] NFSv4: Retry LOCK on OLD_STATEID during delegation return Greg Kroah-Hartman
` (139 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Wheeler, Qingqing Zhuo,
Rodrigo Siqueira, Alex Deucher, Sasha Levin
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
[ Upstream commit ca08a1725d0d78efca8d2dbdbce5ea70355da0f2 ]
When using a device based on DCN32/321,
we have an issue where a second
4k@60Hz display does not light up,
and the system becomes unresponsive
for a few minutes. In the debug process,
it was possible to see a hang
in the function dcn20_post_unlock_program_front_end
in this part:
for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_MS*1000
&& hubp->funcs->hubp_is_flip_pending(hubp); j++)
mdelay(1);
}
The hubp_is_flip_pending always returns positive
for waiting pending flips which is a symptom of
pipe hang. Additionally, the dmesg log shows
this message after a few minutes:
BUG: soft lockup - CPU#4 stuck for 26s!
...
[ +0.000003] dcn20_post_unlock_program_front_end+0x112/0x340 [amdgpu]
[ +0.000171] dc_commit_state_no_check+0x63d/0xbf0 [amdgpu]
[ +0.000155] ? dc_validate_global_state+0x358/0x3d0 [amdgpu]
[ +0.000154] dc_commit_state+0xe2/0xf0 [amdgpu]
This confirmed the hypothesis that we had a pipe
hanging somewhere. Next, after checking the
ftrace entries, we have the below weird
sequence:
[..]
2) | dcn10_lock_all_pipes [amdgpu]() {
2) 0.120 us | optc1_is_tg_enabled [amdgpu]();
2) | dcn20_pipe_control_lock [amdgpu]() {
2) | dc_dmub_srv_clear_inbox0_ack [amdgpu]() {
2) 0.121 us | amdgpu_dm_dmub_reg_write [amdgpu]();
2) 0.551 us | }
2) | dc_dmub_srv_send_inbox0_cmd [amdgpu]() {
2) 0.110 us | amdgpu_dm_dmub_reg_write [amdgpu]();
2) 0.511 us | }
2) | dc_dmub_srv_wait_for_inbox0_ack [amdgpu]() {
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
[..]
We are not expected to read from dmub register
so many times and for so long. From the trace log,
it was possible to identify that the function
dcn20_pipe_control_lock was triggering the dmub
operation when it was unnecessary and causing
the hang issue. This commit drops the unnecessary
dmub code and, consequently, fixes the second display not
lighting up the issue.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index 8f66eef0c683..c6c4888c6665 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -1746,7 +1746,7 @@ void dcn20_post_unlock_program_front_end(
for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_MS*1000
&& hubp->funcs->hubp_is_flip_pending(hubp); j++)
- mdelay(1);
+ udelay(1);
}
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 017/149] NFSv4: Retry LOCK on OLD_STATEID during delegation return
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2022-11-23 8:49 ` [PATCH 5.10 016/149] drm/amd/display: Remove wrong pipe control lock Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 018/149] i2c: tegra: Allocate DMA memory for DMA engine Greg Kroah-Hartman
` (138 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gonzalo Siero Humet,
Benjamin Coddington, Anna Schumaker, Sasha Levin
From: Benjamin Coddington <bcodding@redhat.com>
[ Upstream commit f5ea16137a3fa2858620dc9084466491c128535f ]
There's a small window where a LOCK sent during a delegation return can
race with another OPEN on client, but the open stateid has not yet been
updated. In this case, the client doesn't handle the OLD_STATEID error
from the server and will lose this lock, emitting:
"NFS: nfs4_handle_delegation_recall_error: unhandled error -10024".
Fix this by sending the task through the nfs4 error handling in
nfs4_lock_done() when we may have to reconcile our stateid with what the
server believes it to be. For this case, the result is a retry of the
LOCK operation with the updated stateid.
Reported-by: Gonzalo Siero Humet <gsierohu@redhat.com>
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/nfs4proc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 03f09399abf4..36af3734ac87 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7014,6 +7014,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
{
struct nfs4_lockdata *data = calldata;
struct nfs4_lock_state *lsp = data->lsp;
+ struct nfs_server *server = NFS_SERVER(d_inode(data->ctx->dentry));
dprintk("%s: begin!\n", __func__);
@@ -7023,8 +7024,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
data->rpc_status = task->tk_status;
switch (task->tk_status) {
case 0:
- renew_lease(NFS_SERVER(d_inode(data->ctx->dentry)),
- data->timestamp);
+ renew_lease(server, data->timestamp);
if (data->arg.new_lock && !data->cancelled) {
data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0)
@@ -7045,6 +7045,8 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
if (!nfs4_stateid_match(&data->arg.open_stateid,
&lsp->ls_state->open_stateid))
goto out_restart;
+ else if (nfs4_async_handle_error(task, server, lsp->ls_state, NULL) == -EAGAIN)
+ goto out_restart;
} else if (!nfs4_stateid_match(&data->arg.lock_stateid,
&lsp->ls_stateid))
goto out_restart;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 018/149] i2c: tegra: Allocate DMA memory for DMA engine
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 017/149] NFSv4: Retry LOCK on OLD_STATEID during delegation return Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 019/149] i2c: i801: add lis3lv02ds I2C address for Vostro 5568 Greg Kroah-Hartman
` (137 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Robin Murphy, Thierry Reding,
Wolfram Sang, Sasha Levin
From: Thierry Reding <treding@nvidia.com>
[ Upstream commit cdbf26251d3b35c4ccaea0c3a6de4318f727d3d2 ]
When the I2C controllers are running in DMA mode, it is the DMA engine
that performs the memory accesses rather than the I2C controller. Pass
the DMA engine's struct device pointer to the DMA API to make sure the
correct DMA operations are used.
This fixes an issue where the DMA engine's SMMU stream ID needs to be
misleadingly set for the I2C controllers in device tree.
Suggested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-tegra.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 8b113ae32dc7..42f1db60ad6f 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -283,6 +283,7 @@ struct tegra_i2c_dev {
struct dma_chan *tx_dma_chan;
struct dma_chan *rx_dma_chan;
unsigned int dma_buf_size;
+ struct device *dma_dev;
dma_addr_t dma_phys;
void *dma_buf;
@@ -419,7 +420,7 @@ static int tegra_i2c_dma_submit(struct tegra_i2c_dev *i2c_dev, size_t len)
static void tegra_i2c_release_dma(struct tegra_i2c_dev *i2c_dev)
{
if (i2c_dev->dma_buf) {
- dma_free_coherent(i2c_dev->dev, i2c_dev->dma_buf_size,
+ dma_free_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
i2c_dev->dma_buf, i2c_dev->dma_phys);
i2c_dev->dma_buf = NULL;
}
@@ -466,10 +467,13 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
i2c_dev->tx_dma_chan = chan;
+ WARN_ON(i2c_dev->tx_dma_chan->device != i2c_dev->rx_dma_chan->device);
+ i2c_dev->dma_dev = chan->device->dev;
+
i2c_dev->dma_buf_size = i2c_dev->hw->quirks->max_write_len +
I2C_PACKET_HEADER_SIZE;
- dma_buf = dma_alloc_coherent(i2c_dev->dev, i2c_dev->dma_buf_size,
+ dma_buf = dma_alloc_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
&dma_phys, GFP_KERNEL | __GFP_NOWARN);
if (!dma_buf) {
dev_err(i2c_dev->dev, "failed to allocate DMA buffer\n");
@@ -1255,7 +1259,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
if (i2c_dev->dma_mode) {
if (i2c_dev->msg_read) {
- dma_sync_single_for_device(i2c_dev->dev,
+ dma_sync_single_for_device(i2c_dev->dma_dev,
i2c_dev->dma_phys,
xfer_size, DMA_FROM_DEVICE);
@@ -1263,7 +1267,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
if (err)
return err;
} else {
- dma_sync_single_for_cpu(i2c_dev->dev,
+ dma_sync_single_for_cpu(i2c_dev->dma_dev,
i2c_dev->dma_phys,
xfer_size, DMA_TO_DEVICE);
}
@@ -1276,7 +1280,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
memcpy(i2c_dev->dma_buf + I2C_PACKET_HEADER_SIZE,
msg->buf, msg->len);
- dma_sync_single_for_device(i2c_dev->dev,
+ dma_sync_single_for_device(i2c_dev->dma_dev,
i2c_dev->dma_phys,
xfer_size, DMA_TO_DEVICE);
@@ -1327,7 +1331,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
}
if (i2c_dev->msg_read && i2c_dev->msg_err == I2C_ERR_NONE) {
- dma_sync_single_for_cpu(i2c_dev->dev,
+ dma_sync_single_for_cpu(i2c_dev->dma_dev,
i2c_dev->dma_phys,
xfer_size, DMA_FROM_DEVICE);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 019/149] i2c: i801: add lis3lv02ds I2C address for Vostro 5568
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 018/149] i2c: tegra: Allocate DMA memory for DMA engine Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 020/149] drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid Greg Kroah-Hartman
` (136 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nam Cao, Jean Delvare,
Pali Rohár, Wolfram Sang, Sasha Levin
From: Nam Cao <namcaov@gmail.com>
[ Upstream commit d6643d7207c572c1b0305ed505101f15502c6c87 ]
Dell Vostro 5568 laptop has lis3lv02d, but its i2c address is not known
to the kernel. Add this address.
Output of "cat /sys/devices/platform/lis3lv02d/position" on Dell Vostro
5568 laptop:
- Horizontal: (-18,0,1044)
- Front elevated: (522,-18,1080)
- Left elevated: (-18,-360,1080)
- Upside down: (36,108,-1134)
Signed-off-by: Nam Cao <namcaov@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-i801.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 5618c1ff34dc..45682d30d705 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1275,6 +1275,7 @@ static const struct {
*/
{ "Latitude 5480", 0x29 },
{ "Vostro V131", 0x1d },
+ { "Vostro 5568", 0x29 },
};
static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 020/149] drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 019/149] i2c: i801: add lis3lv02ds I2C address for Vostro 5568 Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 021/149] btrfs: remove pointless and double ulist frees in error paths of qgroup tests Greg Kroah-Hartman
` (135 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dan Carpenter, llvm,
Nathan Huckleberry, Nathan Chancellor, Fabio Estevam,
Philipp Zabel, Sasha Levin
From: Nathan Huckleberry <nhuck@google.com>
[ Upstream commit fc007fb815ab5395c3962c09b79a1630b0fbed9c ]
The mode_valid field in drm_connector_helper_funcs is expected to be of
type:
enum drm_mode_status (* mode_valid) (struct drm_connector *connector,
struct drm_display_mode *mode);
The mismatched return type breaks forward edge kCFI since the underlying
function definition does not match the function hook definition.
The return type of imx_tve_connector_mode_valid should be changed from
int to enum drm_mode_status.
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1703
Cc: llvm@lists.linux.dev
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220913205544.155106-1-nhuck@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/imx/imx-tve.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
index 2a8d2e32e7b4..9fe6a4733106 100644
--- a/drivers/gpu/drm/imx/imx-tve.c
+++ b/drivers/gpu/drm/imx/imx-tve.c
@@ -212,8 +212,9 @@ static int imx_tve_connector_get_modes(struct drm_connector *connector)
return ret;
}
-static int imx_tve_connector_mode_valid(struct drm_connector *connector,
- struct drm_display_mode *mode)
+static enum drm_mode_status
+imx_tve_connector_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
{
struct imx_tve *tve = con_to_tve(connector);
unsigned long rate;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 021/149] btrfs: remove pointless and double ulist frees in error paths of qgroup tests
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 020/149] drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 022/149] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Greg Kroah-Hartman
` (134 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Filipe Manana, David Sterba,
Sasha Levin
From: Filipe Manana <fdmanana@suse.com>
[ Upstream commit d0ea17aec12ea0f7b9d2ed727d8ef8169d1e7699 ]
Several places in the qgroup self tests follow the pattern of freeing the
ulist pointer they passed to btrfs_find_all_roots() if the call to that
function returned an error. That is pointless because that function always
frees the ulist in case it returns an error.
Also In some places like at test_multiple_refs(), after a call to
btrfs_qgroup_account_extent() we also leave "old_roots" and "new_roots"
pointing to ulists that were freed, because btrfs_qgroup_account_extent()
has freed those ulists, and if after that the next call to
btrfs_find_all_roots() fails, we call ulist_free() on the "old_roots"
ulist again, resulting in a double free.
So remove those calls to reduce the code size and avoid double ulist
free in case of an error.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/tests/qgroup-tests.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/fs/btrfs/tests/qgroup-tests.c b/fs/btrfs/tests/qgroup-tests.c
index c4b31dccc184..289366c98f5b 100644
--- a/fs/btrfs/tests/qgroup-tests.c
+++ b/fs/btrfs/tests/qgroup-tests.c
@@ -230,7 +230,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
false);
if (ret) {
- ulist_free(old_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -246,7 +245,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
false);
if (ret) {
ulist_free(old_roots);
- ulist_free(new_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -258,18 +256,19 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
return ret;
}
+ /* btrfs_qgroup_account_extent() always frees the ulists passed to it. */
+ old_roots = NULL;
+ new_roots = NULL;
+
if (btrfs_verify_qgroup_counts(fs_info, BTRFS_FS_TREE_OBJECTID,
nodesize, nodesize)) {
test_err("qgroup counts didn't match expected values");
return -EINVAL;
}
- old_roots = NULL;
- new_roots = NULL;
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
false);
if (ret) {
- ulist_free(old_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -284,7 +283,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
false);
if (ret) {
ulist_free(old_roots);
- ulist_free(new_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -335,7 +333,6 @@ static int test_multiple_refs(struct btrfs_root *root,
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
false);
if (ret) {
- ulist_free(old_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -351,7 +348,6 @@ static int test_multiple_refs(struct btrfs_root *root,
false);
if (ret) {
ulist_free(old_roots);
- ulist_free(new_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -372,7 +368,6 @@ static int test_multiple_refs(struct btrfs_root *root,
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
false);
if (ret) {
- ulist_free(old_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -388,7 +383,6 @@ static int test_multiple_refs(struct btrfs_root *root,
false);
if (ret) {
ulist_free(old_roots);
- ulist_free(new_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -415,7 +409,6 @@ static int test_multiple_refs(struct btrfs_root *root,
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
false);
if (ret) {
- ulist_free(old_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
@@ -431,7 +424,6 @@ static int test_multiple_refs(struct btrfs_root *root,
false);
if (ret) {
ulist_free(old_roots);
- ulist_free(new_roots);
test_err("couldn't find old roots: %d", ret);
return ret;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 022/149] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 021/149] btrfs: remove pointless and double ulist frees in error paths of qgroup tests Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 023/149] ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route" Greg Kroah-Hartman
` (133 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz,
Tedd Ho-Jeong An, Sasha Levin
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ Upstream commit f937b758a188d6fd328a81367087eddbb2fce50f ]
l2cap_global_chan_by_psm shall not return fixed channels as they are not
meant to be connected by (S)PSM.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/l2cap_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index e69e96ef4927..c5e4d2b8cb0b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1986,7 +1986,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
if (link_type == LE_LINK && c->src_type == BDADDR_BREDR)
continue;
- if (c->psm == psm) {
+ if (c->chan_type != L2CAP_CHAN_FIXED && c->psm == psm) {
int src_match, dst_match;
int src_any, dst_any;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 023/149] ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route"
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 022/149] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 024/149] ALSA: hda/realtek: fix speakers and micmute on HP 855 G8 Greg Kroah-Hartman
` (132 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Colin Ian King,
Philippe Mathieu-Daudé, Paul Cercueil, Mark Brown,
Sasha Levin
From: Colin Ian King <colin.i.king@gmail.com>
[ Upstream commit df496157a5afa1b6d1f4c46ad6549c2c346d1e59 ]
There are two spelling mistakes in codec routing description. Fix it.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20221019071639.1003730-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/jz4725b.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index ab744e375367..8a830d0ad950 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -288,7 +288,7 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = {
{"Mixer to ADC", NULL, "Mixer"},
{"ADC Source Capture Route", "Mixer", "Mixer to ADC"},
- {"ADC Sourc Capture Routee", "Line In", "Line In"},
+ {"ADC Source Capture Route", "Line In", "Line In"},
{"ADC Source Capture Route", "Mic 1", "Mic 1"},
{"ADC Source Capture Route", "Mic 2", "Mic 2"},
{"ADC", NULL, "ADC Source Capture Route"},
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 024/149] ALSA: hda/realtek: fix speakers and micmute on HP 855 G8
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 023/149] ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route" Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 025/149] mtd: spi-nor: intel-spi: Disable write protection only if asked Greg Kroah-Hartman
` (131 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Sergeyev, Takashi Iwai,
Sasha Levin
From: Alexander Sergeyev <sergeev917@gmail.com>
[ Upstream commit 91502a9a0b0d5252cf3f32ebd898823c2f5aadab ]
There are several PCI ids associated with HP EliteBook 855 G8 Notebook
PC. Commit 0e68c4b11f1e6 ("ALSA: hda/realtek: fix mute/micmute LEDs for
HP 855 G8") covers 0x103c:0x8896, while this commit covers 0x103c:0x8895
which needs some additional work on top of the quirk from 0e68c4b11f1e6.
Note that the device can boot up with working speakers and micmute LED
without this patch, but the success rate would be quite low (order of
16 working boots across 709 boots) at least for the built-in drivers
scenario. This also means that there are some timing issues during early
boot and this patch is a workaround.
With this patch applied speakers and headphones are consistenly working,
as well as mute/micmute LEDs and the internal microphone.
Signed-off-by: Alexander Sergeyev <sergeev917@gmail.com>
Link: https://lore.kernel.org/r/20220114165050.ouw2nknuspclynro@localhost.localdomain
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/patch_realtek.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e3f6b930ad4a..d427e8939a0e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6883,6 +6883,7 @@ enum {
ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
+ ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
};
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -8693,6 +8694,16 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
},
+ [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
+ .type = HDA_FIXUP_VERBS,
+ .v.verbs = (const struct hda_verb[]) {
+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
+ { }
+ },
+ .chained = true,
+ .chain_id = ALC285_FIXUP_HP_MUTE_LED,
+ },
};
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -8915,6 +8926,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
+ SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 025/149] mtd: spi-nor: intel-spi: Disable write protection only if asked
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 024/149] ALSA: hda/realtek: fix speakers and micmute on HP 855 G8 Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 026/149] spi: intel: Use correct mask for flash and protected regions Greg Kroah-Hartman
` (130 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mika Westerberg, Andy Shevchenko,
Mauro Lima, Tudor Ambarus, Lee Jones, Mark Brown, Sasha Levin
From: Mika Westerberg <mika.westerberg@linux.intel.com>
[ Upstream commit cd149eff8d2201a63c074a6d9d03e52926aa535d ]
Currently the driver tries to disable the BIOS write protection
automatically even if this is not what the user wants. For this reason
modify the driver so that by default it does not touch the write
protection. Only if specifically asked by the user (setting writeable=1
command line parameter) the driver tries to disable the BIOS write
protection.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mauro Lima <mauro.lima@eclypsium.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220209122706.42439-2-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 92a66cbf6b30 ("spi: intel: Use correct mask for flash and protected regions")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/lpc_ich.c | 59 +++++++++++++++++--
.../mtd/spi-nor/controllers/intel-spi-pci.c | 29 +++++----
drivers/mtd/spi-nor/controllers/intel-spi.c | 41 ++++++-------
include/linux/platform_data/intel-spi.h | 6 +-
4 files changed, 96 insertions(+), 39 deletions(-)
diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index 3bbb29a7e7a5..2411b7a2e6f4 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -63,6 +63,8 @@
#define SPIBASE_BYT 0x54
#define SPIBASE_BYT_SZ 512
#define SPIBASE_BYT_EN BIT(1)
+#define BYT_BCR 0xfc
+#define BYT_BCR_WPD BIT(0)
#define SPIBASE_LPT 0x3800
#define SPIBASE_LPT_SZ 512
@@ -1083,12 +1085,57 @@ static int lpc_ich_init_wdt(struct pci_dev *dev)
return ret;
}
+static bool lpc_ich_byt_set_writeable(void __iomem *base, void *data)
+{
+ u32 val;
+
+ val = readl(base + BYT_BCR);
+ if (!(val & BYT_BCR_WPD)) {
+ val |= BYT_BCR_WPD;
+ writel(val, base + BYT_BCR);
+ val = readl(base + BYT_BCR);
+ }
+
+ return val & BYT_BCR_WPD;
+}
+
+static bool lpc_ich_lpt_set_writeable(void __iomem *base, void *data)
+{
+ struct pci_dev *pdev = data;
+ u32 bcr;
+
+ pci_read_config_dword(pdev, BCR, &bcr);
+ if (!(bcr & BCR_WPD)) {
+ bcr |= BCR_WPD;
+ pci_write_config_dword(pdev, BCR, bcr);
+ pci_read_config_dword(pdev, BCR, &bcr);
+ }
+
+ return bcr & BCR_WPD;
+}
+
+static bool lpc_ich_bxt_set_writeable(void __iomem *base, void *data)
+{
+ unsigned int spi = PCI_DEVFN(13, 2);
+ struct pci_bus *bus = data;
+ u32 bcr;
+
+ pci_bus_read_config_dword(bus, spi, BCR, &bcr);
+ if (!(bcr & BCR_WPD)) {
+ bcr |= BCR_WPD;
+ pci_bus_write_config_dword(bus, spi, BCR, bcr);
+ pci_bus_read_config_dword(bus, spi, BCR, &bcr);
+ }
+
+ return bcr & BCR_WPD;
+}
+
static int lpc_ich_init_spi(struct pci_dev *dev)
{
struct lpc_ich_priv *priv = pci_get_drvdata(dev);
struct resource *res = &intel_spi_res[0];
struct intel_spi_boardinfo *info;
- u32 spi_base, rcba, bcr;
+ u32 spi_base, rcba;
info = devm_kzalloc(&dev->dev, sizeof(*info), GFP_KERNEL);
if (!info)
@@ -1102,6 +1149,8 @@ static int lpc_ich_init_spi(struct pci_dev *dev)
if (spi_base & SPIBASE_BYT_EN) {
res->start = spi_base & ~(SPIBASE_BYT_SZ - 1);
res->end = res->start + SPIBASE_BYT_SZ - 1;
+
+ info->set_writeable = lpc_ich_byt_set_writeable;
}
break;
@@ -1112,8 +1161,8 @@ static int lpc_ich_init_spi(struct pci_dev *dev)
res->start = spi_base + SPIBASE_LPT;
res->end = res->start + SPIBASE_LPT_SZ - 1;
- pci_read_config_dword(dev, BCR, &bcr);
- info->writeable = !!(bcr & BCR_WPD);
+ info->set_writeable = lpc_ich_lpt_set_writeable;
+ info->data = dev;
}
break;
@@ -1134,8 +1183,8 @@ static int lpc_ich_init_spi(struct pci_dev *dev)
res->start = spi_base & 0xfffffff0;
res->end = res->start + SPIBASE_APL_SZ - 1;
- pci_bus_read_config_dword(bus, spi, BCR, &bcr);
- info->writeable = !!(bcr & BCR_WPD);
+ info->set_writeable = lpc_ich_bxt_set_writeable;
+ info->data = bus;
}
pci_bus_write_config_byte(bus, p2sb, 0xe1, 0x1);
diff --git a/drivers/mtd/spi-nor/controllers/intel-spi-pci.c b/drivers/mtd/spi-nor/controllers/intel-spi-pci.c
index 555fe55d14ae..8a3c1f3c2d2e 100644
--- a/drivers/mtd/spi-nor/controllers/intel-spi-pci.c
+++ b/drivers/mtd/spi-nor/controllers/intel-spi-pci.c
@@ -16,12 +16,30 @@
#define BCR 0xdc
#define BCR_WPD BIT(0)
+static bool intel_spi_pci_set_writeable(void __iomem *base, void *data)
+{
+ struct pci_dev *pdev = data;
+ u32 bcr;
+
+ /* Try to make the chip read/write */
+ pci_read_config_dword(pdev, BCR, &bcr);
+ if (!(bcr & BCR_WPD)) {
+ bcr |= BCR_WPD;
+ pci_write_config_dword(pdev, BCR, bcr);
+ pci_read_config_dword(pdev, BCR, &bcr);
+ }
+
+ return bcr & BCR_WPD;
+}
+
static const struct intel_spi_boardinfo bxt_info = {
.type = INTEL_SPI_BXT,
+ .set_writeable = intel_spi_pci_set_writeable,
};
static const struct intel_spi_boardinfo cnl_info = {
.type = INTEL_SPI_CNL,
+ .set_writeable = intel_spi_pci_set_writeable,
};
static int intel_spi_pci_probe(struct pci_dev *pdev,
@@ -29,7 +47,6 @@ static int intel_spi_pci_probe(struct pci_dev *pdev,
{
struct intel_spi_boardinfo *info;
struct intel_spi *ispi;
- u32 bcr;
int ret;
ret = pcim_enable_device(pdev);
@@ -41,15 +58,7 @@ static int intel_spi_pci_probe(struct pci_dev *pdev,
if (!info)
return -ENOMEM;
- /* Try to make the chip read/write */
- pci_read_config_dword(pdev, BCR, &bcr);
- if (!(bcr & BCR_WPD)) {
- bcr |= BCR_WPD;
- pci_write_config_dword(pdev, BCR, bcr);
- pci_read_config_dword(pdev, BCR, &bcr);
- }
- info->writeable = !!(bcr & BCR_WPD);
-
+ info->data = pdev;
ispi = intel_spi_probe(&pdev->dev, &pdev->resource[0], info);
if (IS_ERR(ispi))
return PTR_ERR(ispi);
diff --git a/drivers/mtd/spi-nor/controllers/intel-spi.c b/drivers/mtd/spi-nor/controllers/intel-spi.c
index b4b0affd16c8..65f41c0781bf 100644
--- a/drivers/mtd/spi-nor/controllers/intel-spi.c
+++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
@@ -132,7 +132,6 @@
* @sregs: Start of software sequencer registers
* @nregions: Maximum number of regions
* @pr_num: Maximum number of protected range registers
- * @writeable: Is the chip writeable
* @locked: Is SPI setting locked
* @swseq_reg: Use SW sequencer in register reads/writes
* @swseq_erase: Use SW sequencer in erase operation
@@ -150,7 +149,6 @@ struct intel_spi {
void __iomem *sregs;
size_t nregions;
size_t pr_num;
- bool writeable;
bool locked;
bool swseq_reg;
bool swseq_erase;
@@ -305,6 +303,14 @@ static int intel_spi_wait_sw_busy(struct intel_spi *ispi)
INTEL_SPI_TIMEOUT * 1000);
}
+static bool intel_spi_set_writeable(struct intel_spi *ispi)
+{
+ if (!ispi->info->set_writeable)
+ return false;
+
+ return ispi->info->set_writeable(ispi->base, ispi->info->data);
+}
+
static int intel_spi_init(struct intel_spi *ispi)
{
u32 opmenu0, opmenu1, lvscc, uvscc, val;
@@ -317,19 +323,6 @@ static int intel_spi_init(struct intel_spi *ispi)
ispi->nregions = BYT_FREG_NUM;
ispi->pr_num = BYT_PR_NUM;
ispi->swseq_reg = true;
-
- if (writeable) {
- /* Disable write protection */
- val = readl(ispi->base + BYT_BCR);
- if (!(val & BYT_BCR_WPD)) {
- val |= BYT_BCR_WPD;
- writel(val, ispi->base + BYT_BCR);
- val = readl(ispi->base + BYT_BCR);
- }
-
- ispi->writeable = !!(val & BYT_BCR_WPD);
- }
-
break;
case INTEL_SPI_LPT:
@@ -359,6 +352,12 @@ static int intel_spi_init(struct intel_spi *ispi)
return -EINVAL;
}
+ /* Try to disable write protection if user asked to do so */
+ if (writeable && !intel_spi_set_writeable(ispi)) {
+ dev_warn(ispi->dev, "can't disable chip write protection\n");
+ writeable = false;
+ }
+
/* Disable #SMI generation from HW sequencer */
val = readl(ispi->base + HSFSTS_CTL);
val &= ~HSFSTS_CTL_FSMIE;
@@ -885,9 +884,12 @@ static void intel_spi_fill_partition(struct intel_spi *ispi,
/*
* If any of the regions have protection bits set, make the
* whole partition read-only to be on the safe side.
+ *
+ * Also if the user did not ask the chip to be writeable
+ * mask the bit too.
*/
- if (intel_spi_is_protected(ispi, base, limit))
- ispi->writeable = false;
+ if (!writeable || intel_spi_is_protected(ispi, base, limit))
+ part->mask_flags |= MTD_WRITEABLE;
end = (limit << 12) + 4096;
if (end > part->size)
@@ -928,7 +930,6 @@ struct intel_spi *intel_spi_probe(struct device *dev,
ispi->dev = dev;
ispi->info = info;
- ispi->writeable = info->writeable;
ret = intel_spi_init(ispi);
if (ret)
@@ -946,10 +947,6 @@ struct intel_spi *intel_spi_probe(struct device *dev,
intel_spi_fill_partition(ispi, &part);
- /* Prevent writes if not explicitly enabled */
- if (!ispi->writeable || !writeable)
- ispi->nor.mtd.flags &= ~MTD_WRITEABLE;
-
ret = mtd_device_register(&ispi->nor.mtd, &part, 1);
if (ret)
return ERR_PTR(ret);
diff --git a/include/linux/platform_data/intel-spi.h b/include/linux/platform_data/intel-spi.h
index 7f53a5c6f35e..7dda3f690465 100644
--- a/include/linux/platform_data/intel-spi.h
+++ b/include/linux/platform_data/intel-spi.h
@@ -19,11 +19,13 @@ enum intel_spi_type {
/**
* struct intel_spi_boardinfo - Board specific data for Intel SPI driver
* @type: Type which this controller is compatible with
- * @writeable: The chip is writeable
+ * @set_writeable: Try to make the chip writeable (optional)
+ * @data: Data to be passed to @set_writeable can be %NULL
*/
struct intel_spi_boardinfo {
enum intel_spi_type type;
- bool writeable;
+ bool (*set_writeable)(void __iomem *base, void *data);
+ void *data;
};
#endif /* INTEL_SPI_PDATA_H */
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 026/149] spi: intel: Use correct mask for flash and protected regions
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 025/149] mtd: spi-nor: intel-spi: Disable write protection only if asked Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 027/149] mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA Greg Kroah-Hartman
` (129 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mika Westerberg, Mark Brown,
Sasha Levin
From: Mika Westerberg <mika.westerberg@linux.intel.com>
[ Upstream commit 92a66cbf6b30eda5719fbdfb24cd15fb341bba32 ]
The flash and protected region mask is actually 0x7fff (30:16 and 14:0)
and not 0x3fff so fix this accordingly. While there use GENMASK() instead.
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20221025062800.22357-1-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mtd/spi-nor/controllers/intel-spi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/spi-nor/controllers/intel-spi.c b/drivers/mtd/spi-nor/controllers/intel-spi.c
index 65f41c0781bf..6c802db6b4af 100644
--- a/drivers/mtd/spi-nor/controllers/intel-spi.c
+++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
@@ -53,17 +53,17 @@
#define FRACC 0x50
#define FREG(n) (0x54 + ((n) * 4))
-#define FREG_BASE_MASK 0x3fff
+#define FREG_BASE_MASK GENMASK(14, 0)
#define FREG_LIMIT_SHIFT 16
-#define FREG_LIMIT_MASK (0x03fff << FREG_LIMIT_SHIFT)
+#define FREG_LIMIT_MASK GENMASK(30, 16)
/* Offset is from @ispi->pregs */
#define PR(n) ((n) * 4)
#define PR_WPE BIT(31)
#define PR_LIMIT_SHIFT 16
-#define PR_LIMIT_MASK (0x3fff << PR_LIMIT_SHIFT)
+#define PR_LIMIT_MASK GENMASK(30, 16)
#define PR_RPE BIT(15)
-#define PR_BASE_MASK 0x3fff
+#define PR_BASE_MASK GENMASK(14, 0)
/* Offsets are from @ispi->sregs */
#define SSFSTS_CTL 0x00
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 027/149] mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 026/149] spi: intel: Use correct mask for flash and protected regions Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 028/149] drm/amd/pm: support power source switch on Sienna Cichlid Greg Kroah-Hartman
` (128 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haibo Chen, Adrian Hunter,
Ulf Hansson, Sasha Levin
From: Haibo Chen <haibo.chen@nxp.com>
[ Upstream commit f002f45a00ee14214d96b18b9a555fe2c56afb20 ]
MMC_CAP_8_BIT_DATA belongs to struct mmc_host, not struct sdhci_host.
So correct it here.
Fixes: 1ed5c3b22fc7 ("mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Cc: stable@vger.kernel.org
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/1667893503-20583-1-git-send-email-haibo.chen@nxp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 449562122adc..1f1bdd34dd55 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1621,14 +1621,14 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536)
host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
- if (host->caps & MMC_CAP_8_BIT_DATA &&
+ if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
imx_data->socdata->flags & ESDHC_FLAG_HS400)
host->quirks2 |= SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400;
if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23)
host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN;
- if (host->caps & MMC_CAP_8_BIT_DATA &&
+ if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
host->mmc->caps2 |= MMC_CAP2_HS400_ES;
host->mmc_host_ops.hs400_enhanced_strobe =
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 028/149] drm/amd/pm: support power source switch on Sienna Cichlid
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 027/149] mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 029/149] drm/amd/pm: Read BIF STRAP also for BACO check Greg Kroah-Hartman
` (127 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Evan Quan, Lijo Lazar, Alex Deucher,
Sasha Levin
From: Evan Quan <evan.quan@amd.com>
[ Upstream commit 18a4b3de5fc1c63c80e3be0673886431a56e4307 ]
Enable power source switch on Sienna Cichlid.
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 0c85c067c9d9 ("drm/amdgpu: disable BACO on special BEIGE_GOBY card")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
index 49d7fa1d0842..834ac633281c 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
@@ -301,6 +301,9 @@ static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
table_context->power_play_table;
struct smu_baco_context *smu_baco = &smu->smu_baco;
+ if (powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_HARDWAREDC)
+ smu->dc_controlled_by_gpio = true;
+
if (powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_BACO ||
powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_MACO)
smu_baco->platform_support = true;
@@ -2806,6 +2809,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = {
.get_dpm_ultimate_freq = sienna_cichlid_get_dpm_ultimate_freq,
.set_soft_freq_limited_range = smu_v11_0_set_soft_freq_limited_range,
.run_btc = sienna_cichlid_run_btc,
+ .set_power_source = smu_v11_0_set_power_source,
.get_pp_feature_mask = smu_cmn_get_pp_feature_mask,
.set_pp_feature_mask = smu_cmn_set_pp_feature_mask,
.get_gpu_metrics = sienna_cichlid_get_gpu_metrics,
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 029/149] drm/amd/pm: Read BIF STRAP also for BACO check
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 028/149] drm/amd/pm: support power source switch on Sienna Cichlid Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 030/149] drm/amd/pm: disable BACO entry/exit completely on several sienna cichlid cards Greg Kroah-Hartman
` (126 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lijo Lazar, Evan Quan, Alex Deucher,
Sasha Levin
From: Lijo Lazar <lijo.lazar@amd.com>
[ Upstream commit 458020dd4f7109693d4857ed320398e662e8899a ]
Avoid reading BIF STRAP each time for BACO capability. Read the STRAP
value while checking BACO capability in PPTable.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 0c85c067c9d9 ("drm/amdgpu: disable BACO on special BEIGE_GOBY card")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 25 ++++++++++++-----
.../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 27 ++++++++++++++-----
.../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 27 ++++++++++++++-----
3 files changed, 59 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
index 1c526cb239e0..3a31058b029e 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
@@ -379,16 +379,31 @@ static int arcturus_set_default_dpm_table(struct smu_context *smu)
return 0;
}
-static int arcturus_check_powerplay_table(struct smu_context *smu)
+static void arcturus_check_bxco_support(struct smu_context *smu)
{
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_powerplay_table *powerplay_table =
table_context->power_play_table;
struct smu_baco_context *smu_baco = &smu->smu_baco;
+ struct amdgpu_device *adev = smu->adev;
+ uint32_t val;
if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
- powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO)
- smu_baco->platform_support = true;
+ powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO) {
+ val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
+ smu_baco->platform_support =
+ (val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true :
+ false;
+ }
+}
+
+static int arcturus_check_powerplay_table(struct smu_context *smu)
+{
+ struct smu_table_context *table_context = &smu->smu_table;
+ struct smu_11_0_powerplay_table *powerplay_table =
+ table_context->power_play_table;
+
+ arcturus_check_bxco_support(smu);
table_context->thermal_controller_type =
powerplay_table->thermal_controller_type;
@@ -2131,13 +2146,11 @@ static void arcturus_get_unique_id(struct smu_context *smu)
static bool arcturus_is_baco_supported(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
- uint32_t val;
if (!smu_v11_0_baco_is_support(smu) || amdgpu_sriov_vf(adev))
return false;
- val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
- return (val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true : false;
+ return true;
}
static int arcturus_set_df_cstate(struct smu_context *smu,
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
index 2937784bc824..a7773b6453d5 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
@@ -338,19 +338,34 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
return 0;
}
-static int navi10_check_powerplay_table(struct smu_context *smu)
+static void navi10_check_bxco_support(struct smu_context *smu)
{
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_powerplay_table *powerplay_table =
table_context->power_play_table;
struct smu_baco_context *smu_baco = &smu->smu_baco;
+ struct amdgpu_device *adev = smu->adev;
+ uint32_t val;
+
+ if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
+ powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO) {
+ val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
+ smu_baco->platform_support =
+ (val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true :
+ false;
+ }
+}
+
+static int navi10_check_powerplay_table(struct smu_context *smu)
+{
+ struct smu_table_context *table_context = &smu->smu_table;
+ struct smu_11_0_powerplay_table *powerplay_table =
+ table_context->power_play_table;
if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_HARDWAREDC)
smu->dc_controlled_by_gpio = true;
- if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
- powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO)
- smu_baco->platform_support = true;
+ navi10_check_bxco_support(smu);
table_context->thermal_controller_type =
powerplay_table->thermal_controller_type;
@@ -1948,13 +1963,11 @@ static int navi10_overdrive_get_gfx_clk_base_voltage(struct smu_context *smu,
static bool navi10_is_baco_supported(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
- uint32_t val;
if (amdgpu_sriov_vf(adev) || (!smu_v11_0_baco_is_support(smu)))
return false;
- val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
- return (val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true : false;
+ return true;
}
static int navi10_set_default_od_settings(struct smu_context *smu)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
index 834ac633281c..def32b6897f9 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
@@ -294,19 +294,34 @@ sienna_cichlid_get_allowed_feature_mask(struct smu_context *smu,
return 0;
}
-static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
+static void sienna_cichlid_check_bxco_support(struct smu_context *smu)
{
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_7_powerplay_table *powerplay_table =
table_context->power_play_table;
struct smu_baco_context *smu_baco = &smu->smu_baco;
+ struct amdgpu_device *adev = smu->adev;
+ uint32_t val;
+
+ if (powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_BACO ||
+ powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_MACO) {
+ val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
+ smu_baco->platform_support =
+ (val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true :
+ false;
+ }
+}
+
+static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
+{
+ struct smu_table_context *table_context = &smu->smu_table;
+ struct smu_11_0_7_powerplay_table *powerplay_table =
+ table_context->power_play_table;
if (powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_HARDWAREDC)
smu->dc_controlled_by_gpio = true;
- if (powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_BACO ||
- powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_MACO)
- smu_baco->platform_support = true;
+ sienna_cichlid_check_bxco_support(smu);
table_context->thermal_controller_type =
powerplay_table->thermal_controller_type;
@@ -1739,13 +1754,11 @@ static int sienna_cichlid_run_btc(struct smu_context *smu)
static bool sienna_cichlid_is_baco_supported(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
- uint32_t val;
if (amdgpu_sriov_vf(adev) || (!smu_v11_0_baco_is_support(smu)))
return false;
- val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
- return (val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true : false;
+ return true;
}
static bool sienna_cichlid_is_mode1_reset_supported(struct smu_context *smu)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 030/149] drm/amd/pm: disable BACO entry/exit completely on several sienna cichlid cards
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 029/149] drm/amd/pm: Read BIF STRAP also for BACO check Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 031/149] drm/amdgpu: disable BACO on special BEIGE_GOBY card Greg Kroah-Hartman
` (125 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guchun Chen, Lijo Lazar,
Alex Deucher, Sasha Levin
From: Guchun Chen <guchun.chen@amd.com>
[ Upstream commit 7bb91228291aa95bfee3b9d5710887673711c74c ]
To avoid hardware intermittent failures.
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 0c85c067c9d9 ("drm/amdgpu: disable BACO on special BEIGE_GOBY card")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
index def32b6897f9..91026d0c1c79 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
@@ -309,6 +309,17 @@ static void sienna_cichlid_check_bxco_support(struct smu_context *smu)
smu_baco->platform_support =
(val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true :
false;
+
+ /*
+ * Disable BACO entry/exit completely on below SKUs to
+ * avoid hardware intermittent failures.
+ */
+ if (((adev->pdev->device == 0x73A1) &&
+ (adev->pdev->revision == 0x00)) ||
+ ((adev->pdev->device == 0x73BF) &&
+ (adev->pdev->revision == 0xCF)))
+ smu_baco->platform_support = false;
+
}
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 031/149] drm/amdgpu: disable BACO on special BEIGE_GOBY card
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 030/149] drm/amd/pm: disable BACO entry/exit completely on several sienna cichlid cards Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 032/149] spi: stm32: Print summary callbacks suppressed message Greg Kroah-Hartman
` (124 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guchun Chen, Lijo Lazar, Evan Quan,
Alex Deucher, Sasha Levin
From: Guchun Chen <guchun.chen@amd.com>
[ Upstream commit 0c85c067c9d9d7a1b2cc2e01a236d5d0d4a872b5 ]
Still avoid intermittent failure.
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
index 91026d0c1c79..45c815262200 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
@@ -317,7 +317,9 @@ static void sienna_cichlid_check_bxco_support(struct smu_context *smu)
if (((adev->pdev->device == 0x73A1) &&
(adev->pdev->revision == 0x00)) ||
((adev->pdev->device == 0x73BF) &&
- (adev->pdev->revision == 0xCF)))
+ (adev->pdev->revision == 0xCF)) ||
+ ((adev->pdev->device == 0x7422) &&
+ (adev->pdev->revision == 0x00)))
smu_baco->platform_support = false;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 032/149] spi: stm32: Print summary callbacks suppressed message
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 031/149] drm/amdgpu: disable BACO on special BEIGE_GOBY card Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 033/149] ASoC: core: Fix use-after-free in snd_soc_exit() Greg Kroah-Hartman
` (123 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Marek Vasut, Mark Brown, Sasha Levin
From: Marek Vasut <marex@denx.de>
[ Upstream commit 195583504be28df5d608a4677dd796117aea875f ]
The original fix "spi: stm32: Rate-limit the 'Communication suspended' message"
still leads to "stm32h7_spi_irq_thread: 1696 callbacks suppressed" spew in the
kernel log. Since this 'Communication suspended' message is a debug print, add
RATELIMIT_MSG_ON_RELEASE flag to inhibit the "callbacks suspended" part during
normal operation and only print summary at the end.
Fixes: ea8be08cc9358 ("spi: stm32: Rate-limit the 'Communication suspended' message")
Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20221018183513.206706-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-stm32.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index a6dfc8fef20c..651a6510fb54 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -941,6 +941,7 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id)
static DEFINE_RATELIMIT_STATE(rs,
DEFAULT_RATELIMIT_INTERVAL * 10,
1);
+ ratelimit_set_flags(&rs, RATELIMIT_MSG_ON_RELEASE);
if (__ratelimit(&rs))
dev_dbg_ratelimited(spi->dev, "Communication suspended\n");
if (!spi->cur_usedma && (spi->rx_buf && (spi->rx_len > 0)))
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 033/149] ASoC: core: Fix use-after-free in snd_soc_exit()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 032/149] spi: stm32: Print summary callbacks suppressed message Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 034/149] ASoC: tas2770: Fix set_tdm_slot in case of single slot Greg Kroah-Hartman
` (122 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Zhongjin, Mark Brown,
Sasha Levin
From: Chen Zhongjin <chenzhongjin@huawei.com>
[ Upstream commit 6ec27c53886c8963729885bcf2dd996eba2767a7 ]
KASAN reports a use-after-free:
BUG: KASAN: use-after-free in device_del+0xb5b/0xc60
Read of size 8 at addr ffff888008655050 by task rmmod/387
CPU: 2 PID: 387 Comm: rmmod
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
Call Trace:
<TASK>
dump_stack_lvl+0x79/0x9a
print_report+0x17f/0x47b
kasan_report+0xbb/0xf0
device_del+0xb5b/0xc60
platform_device_del.part.0+0x24/0x200
platform_device_unregister+0x2e/0x40
snd_soc_exit+0xa/0x22 [snd_soc_core]
__do_sys_delete_module.constprop.0+0x34f/0x5b0
do_syscall_64+0x3a/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
...
</TASK>
It's bacause in snd_soc_init(), snd_soc_util_init() is possble to fail,
but its ret is ignored, which makes soc_dummy_dev unregistered twice.
snd_soc_init()
snd_soc_util_init()
platform_device_register_simple(soc_dummy_dev)
platform_driver_register() # fail
platform_device_unregister(soc_dummy_dev)
platform_driver_register() # success
...
snd_soc_exit()
snd_soc_util_exit()
# soc_dummy_dev will be unregistered for second time
To fix it, handle error and stop snd_soc_init() when util_init() fail.
Also clean debugfs when util_init() or driver_register() fail.
Fixes: fb257897bf20 ("ASoC: Work around allmodconfig failure")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Link: https://lore.kernel.org/r/20221028031603.59416-1-chenzhongjin@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/soc-core.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a6d6d10cd471..e9da95ebccc8 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3178,10 +3178,23 @@ EXPORT_SYMBOL_GPL(snd_soc_of_get_dai_link_codecs);
static int __init snd_soc_init(void)
{
+ int ret;
+
snd_soc_debugfs_init();
- snd_soc_util_init();
+ ret = snd_soc_util_init();
+ if (ret)
+ goto err_util_init;
- return platform_driver_register(&soc_driver);
+ ret = platform_driver_register(&soc_driver);
+ if (ret)
+ goto err_register;
+ return 0;
+
+err_register:
+ snd_soc_util_exit();
+err_util_init:
+ snd_soc_debugfs_exit();
+ return ret;
}
module_init(snd_soc_init);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 034/149] ASoC: tas2770: Fix set_tdm_slot in case of single slot
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 033/149] ASoC: core: Fix use-after-free in snd_soc_exit() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 035/149] ASoC: tas2764: " Greg Kroah-Hartman
` (121 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jos Dehaes, Martin Povišer,
Mark Brown, Sasha Levin
From: Martin Povišer <povik+lin@cutebit.org>
[ Upstream commit e59bf547a7dd366f93bfebb7487959580ca6c0ec ]
There's a special branch in the set_tdm_slot op for the case of nslots
being 1, but:
(1) That branch can never work (there's a check for tx_mask being
non-zero, later there's another check for it *being* zero; one or
the other always throws -EINVAL).
(2) The intention of the branch seems to be what the general other
branch reduces to in case of nslots being 1.
For those reasons remove the 'nslots being 1' special case.
Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver")
Suggested-by: Jos Dehaes <jos.dehaes@gmail.com>
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20221027095800.16094-1-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/tas2770.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index 171bbcc919d5..c213c8096142 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -395,21 +395,13 @@ static int tas2770_set_dai_tdm_slot(struct snd_soc_dai *dai,
if (tx_mask == 0 || rx_mask != 0)
return -EINVAL;
- if (slots == 1) {
- if (tx_mask != 1)
- return -EINVAL;
-
- left_slot = 0;
- right_slot = 0;
+ left_slot = __ffs(tx_mask);
+ tx_mask &= ~(1 << left_slot);
+ if (tx_mask == 0) {
+ right_slot = left_slot;
} else {
- left_slot = __ffs(tx_mask);
- tx_mask &= ~(1 << left_slot);
- if (tx_mask == 0) {
- right_slot = left_slot;
- } else {
- right_slot = __ffs(tx_mask);
- tx_mask &= ~(1 << right_slot);
- }
+ right_slot = __ffs(tx_mask);
+ tx_mask &= ~(1 << right_slot);
}
if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 035/149] ASoC: tas2764: Fix set_tdm_slot in case of single slot
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 034/149] ASoC: tas2770: Fix set_tdm_slot in case of single slot Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 036/149] serial: 8250: Remove serial_rs485 sanitization from em485 Greg Kroah-Hartman
` (120 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jos Dehaes, Martin Povišer,
Mark Brown, Sasha Levin
From: Martin Povišer <povik+lin@cutebit.org>
[ Upstream commit faac764ea1ea6898d93e46c403271fb105c0906e ]
There's a special branch in the set_tdm_slot op for the case of nslots
being 1, but:
(1) That branch can never work (there's a check for tx_mask being
non-zero, later there's another check for it *being* zero; one or
the other always throws -EINVAL).
(2) The intention of the branch seems to be what the general other
branch reduces to in case of nslots being 1.
For those reasons remove the 'nslots being 1' special case.
Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764")
Suggested-by: Jos Dehaes <jos.dehaes@gmail.com>
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20221027095800.16094-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/tas2764.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c
index 8b262e7f5275..c8f6f5122cac 100644
--- a/sound/soc/codecs/tas2764.c
+++ b/sound/soc/codecs/tas2764.c
@@ -386,20 +386,13 @@ static int tas2764_set_dai_tdm_slot(struct snd_soc_dai *dai,
if (tx_mask == 0 || rx_mask != 0)
return -EINVAL;
- if (slots == 1) {
- if (tx_mask != 1)
- return -EINVAL;
- left_slot = 0;
- right_slot = 0;
+ left_slot = __ffs(tx_mask);
+ tx_mask &= ~(1 << left_slot);
+ if (tx_mask == 0) {
+ right_slot = left_slot;
} else {
- left_slot = __ffs(tx_mask);
- tx_mask &= ~(1 << left_slot);
- if (tx_mask == 0) {
- right_slot = left_slot;
- } else {
- right_slot = __ffs(tx_mask);
- tx_mask &= ~(1 << right_slot);
- }
+ right_slot = __ffs(tx_mask);
+ tx_mask &= ~(1 << right_slot);
}
if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 036/149] serial: 8250: Remove serial_rs485 sanitization from em485
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 035/149] ASoC: tas2764: " Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 037/149] serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl() Greg Kroah-Hartman
` (119 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ilpo Järvinen, Sasha Levin
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Upstream commit 84f2faa7852e1f55d89bb0c99b3a672b87b11f87 ]
Serial core handles serial_rs485 sanitization.
When em485 init fails, there are two possible paths of entry:
1) uart_rs485_config (init path) that fully clears port->rs485 on
error.
2) ioctl path with a pre-existing, valid port->rs485 unto which the
kernel falls back on error and port->rs485 should therefore be
kept untouched. The temporary rs485 struct is not returned to
userspace in case of error so its flag don't matter.
...Thus SER_RS485_ENABLED clearing on error can/should be dropped.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220606100433.13793-37-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 93810191f5d2 ("serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/8250/8250_port.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index f648fd1d7548..7cdfc2458d36 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -661,13 +661,6 @@ int serial8250_em485_config(struct uart_port *port, struct serial_rs485 *rs485)
rs485->flags &= ~SER_RS485_RTS_AFTER_SEND;
}
- /* clamp the delays to [0, 100ms] */
- rs485->delay_rts_before_send = min(rs485->delay_rts_before_send, 100U);
- rs485->delay_rts_after_send = min(rs485->delay_rts_after_send, 100U);
-
- memset(rs485->padding, 0, sizeof(rs485->padding));
- port->rs485 = *rs485;
-
gpiod_set_value(port->rs485_term_gpio,
rs485->flags & SER_RS485_TERMINATE_BUS);
@@ -675,15 +668,8 @@ int serial8250_em485_config(struct uart_port *port, struct serial_rs485 *rs485)
* Both serial8250_em485_init() and serial8250_em485_destroy()
* are idempotent.
*/
- if (rs485->flags & SER_RS485_ENABLED) {
- int ret = serial8250_em485_init(up);
-
- if (ret) {
- rs485->flags &= ~SER_RS485_ENABLED;
- port->rs485.flags &= ~SER_RS485_ENABLED;
- }
- return ret;
- }
+ if (rs485->flags & SER_RS485_ENABLED)
+ return serial8250_em485_init(up);
serial8250_em485_destroy(up);
return 0;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 037/149] serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 036/149] serial: 8250: Remove serial_rs485 sanitization from em485 Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 038/149] serial: 8250_omap: remove wait loop from Errata i202 workaround Greg Kroah-Hartman
` (118 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Merlijn Wajer, Romain Naour,
Ivaylo Dimitrov, Tony Lindgren, Sasha Levin
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit 93810191f5d23652c0b8a1a9b3a4a89d6fd5063e ]
There are cases where omap8250_set_mctrl() may get called after the
UART has already autoidled causing an asynchronous external abort.
This can happen on ttyport_open():
mem_serial_in from omap8250_set_mctrl+0x38/0xa0
omap8250_set_mctrl from uart_update_mctrl+0x4c/0x58
uart_update_mctrl from uart_dtr_rts+0x60/0xa8
uart_dtr_rts from tty_port_block_til_ready+0xd0/0x2a8
tty_port_block_til_ready from uart_open+0x14/0x1c
uart_open from ttyport_open+0x64/0x148
And on ttyport_close():
omap8250_set_mctrl from uart_update_mctrl+0x3c/0x48
uart_update_mctrl from uart_dtr_rts+0x54/0x9c
uart_dtr_rts from tty_port_shutdown+0x78/0x9c
tty_port_shutdown from tty_port_close+0x3c/0x74
tty_port_close from ttyport_close+0x40/0x58
It can also happen on disassociate_ctty() calling uart_shutdown()
that ends up calling omap8250_set_mctrl().
Let's fix the issue by adding missing PM runtime calls to
omap8250_set_mctrl(). To do this, we need to add __omap8250_set_mctrl()
that can be called from both omap8250_set_mctrl(), and from runtime PM
resume path when restoring the registers.
Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver")
Reported-by: Merlijn Wajer <merlijn@wizzup.org>
Reported-by: Romain Naour <romain.naour@smile.fr>
Reported-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Tested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Depends-on: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
Link: https://lore.kernel.org/r/20221024063613.25943-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/8250/8250_omap.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index f3744ac805ec..7c7cfd6d48d8 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -157,7 +157,11 @@ static u32 uart_read(struct uart_8250_port *up, u32 reg)
return readl(up->port.membase + (reg << up->port.regshift));
}
-static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
+/*
+ * Called on runtime PM resume path from omap8250_restore_regs(), and
+ * omap8250_set_mctrl().
+ */
+static void __omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
struct uart_8250_port *up = up_to_u8250p(port);
struct omap8250_priv *priv = up->port.private_data;
@@ -181,6 +185,20 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
}
}
+static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
+{
+ int err;
+
+ err = pm_runtime_resume_and_get(port->dev);
+ if (err)
+ return;
+
+ __omap8250_set_mctrl(port, mctrl);
+
+ pm_runtime_mark_last_busy(port->dev);
+ pm_runtime_put_autosuspend(port->dev);
+}
+
/*
* Work Around for Errata i202 (2430, 3430, 3630, 4430 and 4460)
* The access to uart register after MDR1 Access
@@ -341,7 +359,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up)
omap8250_update_mdr1(up, priv);
- up->port.ops->set_mctrl(&up->port, up->port.mctrl);
+ __omap8250_set_mctrl(&up->port, up->port.mctrl);
if (up->port.rs485.flags & SER_RS485_ENABLED)
serial8250_em485_stop_tx(up);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 038/149] serial: 8250_omap: remove wait loop from Errata i202 workaround
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 037/149] serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 039/149] serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove() Greg Kroah-Hartman
` (117 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ilpo Järvinen,
Matthias Schiffer, Sasha Levin
From: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
[ Upstream commit e828e56684d61b17317e0cfdef83791fa61cb76b ]
We were occasionally seeing the "Errata i202: timedout" on an AM335x
board when repeatedly opening and closing a UART connected to an active
sender. As new input may arrive at any time, it is possible to miss the
"RX FIFO empty" condition, forcing the loop to wait until it times out.
Nothing in the i202 Advisory states that such a wait is even necessary;
other FIFO clear functions like serial8250_clear_fifos() do not wait
either. For this reason, it seems safe to remove the wait, fixing the
mentioned issue.
Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver")
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20221013112339.2540767-1-matthias.schiffer@ew.tq-group.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/8250/8250_omap.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 7c7cfd6d48d8..655553a3c78a 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -211,27 +211,10 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
static void omap_8250_mdr1_errataset(struct uart_8250_port *up,
struct omap8250_priv *priv)
{
- u8 timeout = 255;
-
serial_out(up, UART_OMAP_MDR1, priv->mdr1);
udelay(2);
serial_out(up, UART_FCR, up->fcr | UART_FCR_CLEAR_XMIT |
UART_FCR_CLEAR_RCVR);
- /*
- * Wait for FIFO to empty: when empty, RX_FIFO_E bit is 0 and
- * TX_FIFO_E bit is 1.
- */
- while (UART_LSR_THRE != (serial_in(up, UART_LSR) &
- (UART_LSR_THRE | UART_LSR_DR))) {
- timeout--;
- if (!timeout) {
- /* Should *never* happen. we warn and carry on */
- dev_crit(up->port.dev, "Errata i202: timedout %x\n",
- serial_in(up, UART_LSR));
- break;
- }
- udelay(1);
- }
}
static void omap_8250_get_divisor(struct uart_port *port, unsigned int baud,
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 039/149] serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 038/149] serial: 8250_omap: remove wait loop from Errata i202 workaround Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 040/149] serial: 8250: omap: Flush PM QOS work on remove Greg Kroah-Hartman
` (116 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tony Lindgren, Sasha Levin
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit e3f0c638f428fd66b5871154b62706772045f91a ]
On remove, we get an error for "Runtime PM usage count underflow!". I guess
this driver is mostly built-in, and this issue has gone unnoticed for a
while. Somehow I did not catch this issue with my earlier fix done with
commit 4e0f5cc65098 ("serial: 8250_omap: Fix probe and remove for PM
runtime").
Fixes: 4e0f5cc65098 ("serial: 8250_omap: Fix probe and remove for PM runtime")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Depends-on: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
Link: https://lore.kernel.org/r/20221028105813.54290-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/8250/8250_omap.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 655553a3c78a..57524950b8dc 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1475,6 +1475,11 @@ static int omap8250_probe(struct platform_device *pdev)
static int omap8250_remove(struct platform_device *pdev)
{
struct omap8250_priv *priv = platform_get_drvdata(pdev);
+ int err;
+
+ err = pm_runtime_resume_and_get(&pdev->dev);
+ if (err)
+ return err;
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_put_sync(&pdev->dev);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 040/149] serial: 8250: omap: Flush PM QOS work on remove
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 039/149] serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 041/149] serial: imx: Add missing .thaw_noirq hook Greg Kroah-Hartman
` (115 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tony Lindgren, Sasha Levin
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit d0b68629bd2fb61e0171a62f2e8da3db322f5cf6 ]
Rebinding 8250_omap in a loop will at some point produce a warning for
kernel/power/qos.c:296 cpu_latency_qos_update_request() with error
"cpu_latency_qos_update_request called for unknown object". Let's flush
the possibly pending PM QOS work scheduled from omap8250_runtime_suspend()
before we disable runtime PM.
Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20221028110044.54719-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/8250/8250_omap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 57524950b8dc..3f7379f16a36 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1483,6 +1483,7 @@ static int omap8250_remove(struct platform_device *pdev)
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_put_sync(&pdev->dev);
+ flush_work(&priv->qos_work);
pm_runtime_disable(&pdev->dev);
serial8250_unregister_port(priv->line);
cpu_latency_qos_remove_request(&priv->pm_qos_request);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 041/149] serial: imx: Add missing .thaw_noirq hook
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 040/149] serial: 8250: omap: Flush PM QOS work on remove Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 042/149] tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send Greg Kroah-Hartman
` (114 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Martin Kaiser, Shawn Guo,
Sasha Levin
From: Shawn Guo <shawn.guo@linaro.org>
[ Upstream commit 4561d8008a467cb05ac632a215391d6b787f40aa ]
The following warning is seen with non-console UART instance when
system hibernates.
[ 37.371969] ------------[ cut here ]------------
[ 37.376599] uart3_root_clk already disabled
[ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0
...
[ 37.506986] Call trace:
[ 37.509432] clk_core_disable+0xa4/0xb0
[ 37.513270] clk_disable+0x34/0x50
[ 37.516672] imx_uart_thaw+0x38/0x5c
[ 37.520250] platform_pm_thaw+0x30/0x6c
[ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4
[ 37.528972] device_resume+0x7c/0x160
[ 37.532633] dpm_resume+0xe8/0x230
[ 37.536036] hibernation_snapshot+0x288/0x430
[ 37.540397] hibernate+0x10c/0x2e0
[ 37.543798] state_store+0xc4/0xd0
[ 37.547203] kobj_attr_store+0x1c/0x30
[ 37.550953] sysfs_kf_write+0x48/0x60
[ 37.554619] kernfs_fop_write_iter+0x118/0x1ac
[ 37.559063] new_sync_write+0xe8/0x184
[ 37.562812] vfs_write+0x230/0x290
[ 37.566214] ksys_write+0x68/0xf4
[ 37.569529] __arm64_sys_write+0x20/0x2c
[ 37.573452] invoke_syscall.constprop.0+0x50/0xf0
[ 37.578156] do_el0_svc+0x11c/0x150
[ 37.581648] el0_svc+0x30/0x140
[ 37.584792] el0t_64_sync_handler+0xe8/0xf0
[ 37.588976] el0t_64_sync+0x1a0/0x1a4
[ 37.592639] ---[ end trace 56e22eec54676d75 ]---
On hibernating, pm core calls into related hooks in sequence like:
.freeze
.freeze_noirq
.thaw_noirq
.thaw
With .thaw_noirq hook being absent, the clock will be disabled in a
unbalanced call which results the warning above.
imx_uart_freeze()
clk_prepare_enable()
imx_uart_suspend_noirq()
clk_disable()
imx_uart_thaw
clk_disable_unprepare()
Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have
the call sequence corrected as below and thus fix the warning.
imx_uart_freeze()
clk_prepare_enable()
imx_uart_suspend_noirq()
clk_disable()
imx_uart_resume_noirq()
clk_enable()
imx_uart_thaw
clk_disable_unprepare()
Fixes: 09df0b3464e5 ("serial: imx: fix endless loop during suspend")
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Link: https://lore.kernel.org/r/20221012121353.2346280-1-shawn.guo@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/imx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index cf3d53165776..164597e2e004 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2626,6 +2626,7 @@ static const struct dev_pm_ops imx_uart_pm_ops = {
.suspend_noirq = imx_uart_suspend_noirq,
.resume_noirq = imx_uart_resume_noirq,
.freeze_noirq = imx_uart_suspend_noirq,
+ .thaw_noirq = imx_uart_resume_noirq,
.restore_noirq = imx_uart_resume_noirq,
.suspend = imx_uart_suspend,
.resume = imx_uart_resume,
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 042/149] tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 041/149] serial: imx: Add missing .thaw_noirq hook Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 043/149] bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() Greg Kroah-Hartman
` (113 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Duoming Zhou, Sasha Levin
From: Duoming Zhou <duoming@zju.edu.cn>
[ Upstream commit 7b7dfe4833c70a11cdfa51b38705103bd31eddaa ]
The function gsm_dlci_t1() is a timer handler that runs in an
atomic context, but it calls "kzalloc(..., GFP_KERNEL)" that
may sleep. As a result, the sleep-in-atomic-context bug will
happen. The process is shown below:
gsm_dlci_t1()
gsm_dlci_open()
gsm_modem_update()
gsm_modem_upd_via_msc()
gsm_control_send()
kzalloc(sizeof(.., GFP_KERNEL) //may sleep
This patch changes the gfp_t parameter of kzalloc() from GFP_KERNEL to
GFP_ATOMIC in order to mitigate the bug.
Fixes: e1eaea46bb40 ("tty: n_gsm line discipline")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20221002040709.27849-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/n_gsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index c91a3004931f..e85282825973 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -1416,7 +1416,7 @@ static struct gsm_control *gsm_control_send(struct gsm_mux *gsm,
unsigned int command, u8 *data, int clen)
{
struct gsm_control *ctrl = kzalloc(sizeof(struct gsm_control),
- GFP_KERNEL);
+ GFP_ATOMIC);
unsigned long flags;
if (ctrl == NULL)
return NULL;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 043/149] bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 042/149] tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 044/149] ASoC: soc-utils: Remove __exit for snd_soc_util_exit() Greg Kroah-Hartman
` (112 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Baisong Zhong, Daniel Borkmann,
Eric Dumazet, Sasha Levin
From: Baisong Zhong <zhongbaisong@huawei.com>
[ Upstream commit d3fd203f36d46aa29600a72d57a1b61af80e4a25 ]
We got a syzkaller problem because of aarch64 alignment fault
if KFENCE enabled. When the size from user bpf program is an odd
number, like 399, 407, etc, it will cause the struct skb_shared_info's
unaligned access. As seen below:
BUG: KFENCE: use-after-free read in __skb_clone+0x23c/0x2a0 net/core/skbuff.c:1032
Use-after-free read at 0xffff6254fffac077 (in kfence-#213):
__lse_atomic_add arch/arm64/include/asm/atomic_lse.h:26 [inline]
arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline]
arch_atomic_inc include/linux/atomic-arch-fallback.h:270 [inline]
atomic_inc include/asm-generic/atomic-instrumented.h:241 [inline]
__skb_clone+0x23c/0x2a0 net/core/skbuff.c:1032
skb_clone+0xf4/0x214 net/core/skbuff.c:1481
____bpf_clone_redirect net/core/filter.c:2433 [inline]
bpf_clone_redirect+0x78/0x1c0 net/core/filter.c:2420
bpf_prog_d3839dd9068ceb51+0x80/0x330
bpf_dispatcher_nop_func include/linux/bpf.h:728 [inline]
bpf_test_run+0x3c0/0x6c0 net/bpf/test_run.c:53
bpf_prog_test_run_skb+0x638/0xa7c net/bpf/test_run.c:594
bpf_prog_test_run kernel/bpf/syscall.c:3148 [inline]
__do_sys_bpf kernel/bpf/syscall.c:4441 [inline]
__se_sys_bpf+0xad0/0x1634 kernel/bpf/syscall.c:4381
kfence-#213: 0xffff6254fffac000-0xffff6254fffac196, size=407, cache=kmalloc-512
allocated by task 15074 on cpu 0 at 1342.585390s:
kmalloc include/linux/slab.h:568 [inline]
kzalloc include/linux/slab.h:675 [inline]
bpf_test_init.isra.0+0xac/0x290 net/bpf/test_run.c:191
bpf_prog_test_run_skb+0x11c/0xa7c net/bpf/test_run.c:512
bpf_prog_test_run kernel/bpf/syscall.c:3148 [inline]
__do_sys_bpf kernel/bpf/syscall.c:4441 [inline]
__se_sys_bpf+0xad0/0x1634 kernel/bpf/syscall.c:4381
__arm64_sys_bpf+0x50/0x60 kernel/bpf/syscall.c:4381
To fix the problem, we adjust @size so that (@size + @hearoom) is a
multiple of SMP_CACHE_BYTES. So we make sure the struct skb_shared_info
is aligned to a cache line.
Fixes: 1cf1cae963c2 ("bpf: introduce BPF_PROG_TEST_RUN command")
Signed-off-by: Baisong Zhong <zhongbaisong@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/bpf/20221102081620.1465154-1-zhongbaisong@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bpf/test_run.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 2983e926fe3c..717b01ff9b2b 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -231,6 +231,7 @@ static void *bpf_test_init(const union bpf_attr *kattr, u32 size,
if (user_size > size)
return ERR_PTR(-EMSGSIZE);
+ size = SKB_DATA_ALIGN(size);
data = kzalloc(size + headroom + tailroom, GFP_USER);
if (!data)
return ERR_PTR(-ENOMEM);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 044/149] ASoC: soc-utils: Remove __exit for snd_soc_util_exit()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 043/149] bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 045/149] sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent Greg Kroah-Hartman
` (111 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Zhongjin, Mark Brown,
Sasha Levin
From: Chen Zhongjin <chenzhongjin@huawei.com>
[ Upstream commit 314d34fe7f0a5836cb0472950c1f17744b4efde8 ]
snd_soc_util_exit() is called in __init snd_soc_init() for cleanup.
Remove the __exit annotation for it to fix the build warning:
WARNING: modpost: sound/soc/snd-soc-core.o: section mismatch in reference: init_module (section: .init.text) -> snd_soc_util_exit (section: .exit.text)
Fixes: 6ec27c53886c ("ASoC: core: Fix use-after-free in snd_soc_exit()")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Link: https://lore.kernel.org/r/20221031134031.256511-1-chenzhongjin@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/soc-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index f27f94ca064b..6b398ffabb02 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -171,7 +171,7 @@ int __init snd_soc_util_init(void)
return ret;
}
-void __exit snd_soc_util_exit(void)
+void snd_soc_util_exit(void)
{
platform_driver_unregister(&soc_dummy_driver);
platform_device_unregister(soc_dummy_dev);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 045/149] sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 044/149] ASoC: soc-utils: Remove __exit for snd_soc_util_exit() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 046/149] sctp: clear out_curr if all frag chunks of current msg are pruned Greg Kroah-Hartman
` (110 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xin Long, Jakub Kicinski,
Sasha Levin
From: Xin Long <lucien.xin@gmail.com>
[ Upstream commit 9f0b773210c27a8f5d98ddb2fc4ba60a42a3285f ]
Since commit 5bbbbe32a431 ("sctp: introduce stream scheduler foundations"),
sctp_stream_outq_migrate() has been called in sctp_stream_init/update to
removes those chunks to streams higher than the new max. There is no longer
need to do such check in sctp_prsctp_prune_unsent().
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 2f201ae14ae0 ("sctp: clear out_curr if all frag chunks of current msg are pruned")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sctp/outqueue.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 3fd06a27105d..35d5532320f9 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -384,6 +384,7 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
{
struct sctp_outq *q = &asoc->outqueue;
struct sctp_chunk *chk, *temp;
+ struct sctp_stream_out *sout;
q->sched->unsched_all(&asoc->stream);
@@ -398,12 +399,9 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
sctp_sched_dequeue_common(q, chk);
asoc->sent_cnt_removable--;
asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
- if (chk->sinfo.sinfo_stream < asoc->stream.outcnt) {
- struct sctp_stream_out *streamout =
- SCTP_SO(&asoc->stream, chk->sinfo.sinfo_stream);
- streamout->ext->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
- }
+ sout = SCTP_SO(&asoc->stream, chk->sinfo.sinfo_stream);
+ sout->ext->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
msg_len -= chk->skb->truesize + sizeof(struct sctp_chunk);
sctp_chunk_free(chk);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 046/149] sctp: clear out_curr if all frag chunks of current msg are pruned
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 045/149] sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 047/149] block: sed-opal: kmalloc the cmd/resp buffers Greg Kroah-Hartman
` (109 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhen Chen, Caowangbao, Xin Long,
Jakub Kicinski, Sasha Levin
From: Xin Long <lucien.xin@gmail.com>
[ Upstream commit 2f201ae14ae0f91dbf1cffea7bb1e29e81d4d108 ]
A crash was reported by Zhen Chen:
list_del corruption, ffffa035ddf01c18->next is NULL
WARNING: CPU: 1 PID: 250682 at lib/list_debug.c:49 __list_del_entry_valid+0x59/0xe0
RIP: 0010:__list_del_entry_valid+0x59/0xe0
Call Trace:
sctp_sched_dequeue_common+0x17/0x70 [sctp]
sctp_sched_fcfs_dequeue+0x37/0x50 [sctp]
sctp_outq_flush_data+0x85/0x360 [sctp]
sctp_outq_uncork+0x77/0xa0 [sctp]
sctp_cmd_interpreter.constprop.0+0x164/0x1450 [sctp]
sctp_side_effects+0x37/0xe0 [sctp]
sctp_do_sm+0xd0/0x230 [sctp]
sctp_primitive_SEND+0x2f/0x40 [sctp]
sctp_sendmsg_to_asoc+0x3fa/0x5c0 [sctp]
sctp_sendmsg+0x3d5/0x440 [sctp]
sock_sendmsg+0x5b/0x70
and in sctp_sched_fcfs_dequeue() it dequeued a chunk from stream
out_curr outq while this outq was empty.
Normally stream->out_curr must be set to NULL once all frag chunks of
current msg are dequeued, as we can see in sctp_sched_dequeue_done().
However, in sctp_prsctp_prune_unsent() as it is not a proper dequeue,
sctp_sched_dequeue_done() is not called to do this.
This patch is to fix it by simply setting out_curr to NULL when the
last frag chunk of current msg is dequeued from out_curr stream in
sctp_prsctp_prune_unsent().
Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations")
Reported-by: Zhen Chen <chenzhen126@huawei.com>
Tested-by: Caowangbao <caowangbao@huawei.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sctp/outqueue.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 35d5532320f9..83a89dcf75ed 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -403,6 +403,11 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
sout = SCTP_SO(&asoc->stream, chk->sinfo.sinfo_stream);
sout->ext->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
+ /* clear out_curr if all frag chunks are pruned */
+ if (asoc->stream.out_curr == sout &&
+ list_is_last(&chk->frag_list, &chk->msg->chunks))
+ asoc->stream.out_curr = NULL;
+
msg_len -= chk->skb->truesize + sizeof(struct sctp_chunk);
sctp_chunk_free(chk);
if (msg_len <= 0)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 047/149] block: sed-opal: kmalloc the cmd/resp buffers
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 046/149] sctp: clear out_curr if all frag chunks of current msg are pruned Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 048/149] arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro Greg Kroah-Hartman
` (108 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Serge Semin, Christoph Hellwig,
Jens Axboe, Sasha Levin
From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
[ Upstream commit f829230dd51974c1f4478900ed30bb77ba530b40 ]
In accordance with [1] the DMA-able memory buffers must be
cacheline-aligned otherwise the cache writing-back and invalidation
performed during the mapping may cause the adjacent data being lost. It's
specifically required for the DMA-noncoherent platforms [2]. Seeing the
opal_dev.{cmd,resp} buffers are implicitly used for DMAs in the NVME and
SCSI/SD drivers in framework of the nvme_sec_submit() and sd_sec_submit()
methods respectively they must be cacheline-aligned to prevent the denoted
problem. One of the option to guarantee that is to kmalloc the buffers
[2]. Let's explicitly allocate them then instead of embedding into the
opal_dev structure instance.
Note this fix was inspired by the commit c94b7f9bab22 ("nvme-hwmon:
kmalloc the NVME SMART log buffer").
[1] Documentation/core-api/dma-api.rst
[2] Documentation/core-api/dma-api-howto.rst
Fixes: 455a7b238cd6 ("block: Add Sed-opal library")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20221107203944.31686-1-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/sed-opal.c | 32 ++++++++++++++++++++++++++++----
1 file changed, 28 insertions(+), 4 deletions(-)
diff --git a/block/sed-opal.c b/block/sed-opal.c
index daafadbb88ca..0ac5a4f3f226 100644
--- a/block/sed-opal.c
+++ b/block/sed-opal.c
@@ -88,8 +88,8 @@ struct opal_dev {
u64 lowest_lba;
size_t pos;
- u8 cmd[IO_BUFFER_LENGTH];
- u8 resp[IO_BUFFER_LENGTH];
+ u8 *cmd;
+ u8 *resp;
struct parsed_resp parsed;
size_t prev_d_len;
@@ -2134,6 +2134,8 @@ void free_opal_dev(struct opal_dev *dev)
return;
clean_opal_dev(dev);
+ kfree(dev->resp);
+ kfree(dev->cmd);
kfree(dev);
}
EXPORT_SYMBOL(free_opal_dev);
@@ -2146,17 +2148,39 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv)
if (!dev)
return NULL;
+ /*
+ * Presumably DMA-able buffers must be cache-aligned. Kmalloc makes
+ * sure the allocated buffer is DMA-safe in that regard.
+ */
+ dev->cmd = kmalloc(IO_BUFFER_LENGTH, GFP_KERNEL);
+ if (!dev->cmd)
+ goto err_free_dev;
+
+ dev->resp = kmalloc(IO_BUFFER_LENGTH, GFP_KERNEL);
+ if (!dev->resp)
+ goto err_free_cmd;
+
INIT_LIST_HEAD(&dev->unlk_lst);
mutex_init(&dev->dev_lock);
dev->data = data;
dev->send_recv = send_recv;
if (check_opal_support(dev) != 0) {
pr_debug("Opal is not supported on this device\n");
- kfree(dev);
- return NULL;
+ goto err_free_resp;
}
return dev;
+
+err_free_resp:
+ kfree(dev->resp);
+
+err_free_cmd:
+ kfree(dev->cmd);
+
+err_free_dev:
+ kfree(dev);
+
+ return NULL;
}
EXPORT_SYMBOL(init_opal_dev);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 048/149] arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 047/149] block: sed-opal: kmalloc the cmd/resp buffers Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 049/149] siox: fix possible memory leak in siox_device_add() Greg Kroah-Hartman
` (107 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, D Scott Phillips,
Catalin Marinas, Sasha Levin
From: D Scott Phillips <scott@os.amperecomputing.com>
[ Upstream commit 8ec8490a1950efeccb00967698cf7cb2fcd25ca7 ]
CONFIG_UBSAN_SHIFT with gcc-5 complains that the shifting of
ARM_CPU_IMP_AMPERE (0xC0) into bits [31:24] by MIDR_CPU_MODEL() is
undefined behavior. Well, sort of, it actually spells the error as:
arch/arm64/kernel/proton-pack.c: In function 'spectre_bhb_loop_affected':
arch/arm64/include/asm/cputype.h:44:2: error: initializer element is not constant
(((imp) << MIDR_IMPLEMENTOR_SHIFT) | \
^
This isn't an issue for other Implementor codes, as all the other codes
have zero in the top bit and so are representable as a signed int.
Cast the implementor code to unsigned in MIDR_CPU_MODEL to remove the
undefined behavior.
Fixes: 0e5d5ae837c8 ("arm64: Add AMPERE1 to the Spectre-BHB affected list")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com>
Link: https://lore.kernel.org/r/20221102160106.1096948-1-scott@os.amperecomputing.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/include/asm/cputype.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index 457b6bb276bb..9cf5d9551e99 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -41,7 +41,7 @@
(((midr) & MIDR_IMPLEMENTOR_MASK) >> MIDR_IMPLEMENTOR_SHIFT)
#define MIDR_CPU_MODEL(imp, partnum) \
- (((imp) << MIDR_IMPLEMENTOR_SHIFT) | \
+ ((_AT(u32, imp) << MIDR_IMPLEMENTOR_SHIFT) | \
(0xf << MIDR_ARCHITECTURE_SHIFT) | \
((partnum) << MIDR_PARTNUM_SHIFT))
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 049/149] siox: fix possible memory leak in siox_device_add()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 048/149] arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 050/149] parport_pc: Avoid FIFO port location truncation Greg Kroah-Hartman
` (106 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang,
Uwe Kleine-König, Sasha Levin
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit 6e63153db50059fb78b8a8447b132664887d24e3 ]
If device_register() returns error in siox_device_add(),
the name allocated by dev_set_name() need be freed. As
comment of device_register() says, it should use put_device()
to give up the reference in the error path. So fix this
by calling put_device(), then the name can be freed in
kobject_cleanup(), and sdevice is freed in siox_device_release(),
set it to null in error path.
Fixes: bbecb07fa0af ("siox: new driver framework for eckelmann SIOX")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221104021334.618189-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/siox/siox-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/siox/siox-core.c b/drivers/siox/siox-core.c
index f8c08fb9891d..e0ffef6e9386 100644
--- a/drivers/siox/siox-core.c
+++ b/drivers/siox/siox-core.c
@@ -835,6 +835,8 @@ static struct siox_device *siox_device_add(struct siox_master *smaster,
err_device_register:
/* don't care to make the buffer smaller again */
+ put_device(&sdevice->dev);
+ sdevice = NULL;
err_buf_alloc:
siox_master_unlock(smaster);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 050/149] parport_pc: Avoid FIFO port location truncation
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 049/149] siox: fix possible memory leak in siox_device_add() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 051/149] pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map Greg Kroah-Hartman
` (105 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej W. Rozycki, Sudip Mukherjee,
Sasha Levin
From: Maciej W. Rozycki <macro@orcam.me.uk>
[ Upstream commit ab126f51c93a15093df604f661c9480854c005a3 ]
Match the data type of a temporary holding a reference to the FIFO port
with the type of the original reference coming from `struct parport',
avoiding data truncation with LP64 ports such as SPARC64 that refer to
PCI port I/O locations via their corresponding MMIO addresses and will
therefore have non-zero bits in the high 32-bit part of the reference.
And in any case it is cleaner to have the data types matching here.
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://lore.kernel.org/linux-pci/20220419033752.GA1101844@bhelgaas/
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209231912550.29493@angie.orcam.me.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/parport/parport_pc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index eda4ded4d5e5..925be41eeebe 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -468,7 +468,7 @@ static size_t parport_pc_fifo_write_block_pio(struct parport *port,
const unsigned char *bufp = buf;
size_t left = length;
unsigned long expire = jiffies + port->physport->cad->timeout;
- const int fifo = FIFO(port);
+ const unsigned long fifo = FIFO(port);
int poll_for = 8; /* 80 usecs */
const struct parport_pc_private *priv = port->physport->private_data;
const int fifo_depth = priv->fifo_depth;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 051/149] pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 050/149] parport_pc: Avoid FIFO port location truncation Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 052/149] drm/panel: simple: set bpc field for logic technologies displays Greg Kroah-Hartman
` (104 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zeng Heng, Linus Walleij,
Sasha Levin
From: Zeng Heng <zengheng4@huawei.com>
[ Upstream commit 91d5c5060ee24fe8da88cd585bb43b843d2f0dce ]
Here is the BUG report by KASAN about null pointer dereference:
BUG: KASAN: null-ptr-deref in strcmp+0x2e/0x50
Read of size 1 at addr 0000000000000000 by task python3/2640
Call Trace:
strcmp
__of_find_property
of_find_property
pinctrl_dt_to_map
kasprintf() would return NULL pointer when kmalloc() fail to allocate.
So directly return ENOMEM, if kasprintf() return NULL pointer.
Fixes: 57291ce295c0 ("pinctrl: core device tree mapping table parsing support")
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Link: https://lore.kernel.org/r/20221110082056.2014898-1-zengheng4@huawei.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/devicetree.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
index 3fb238714718..eac55fee5281 100644
--- a/drivers/pinctrl/devicetree.c
+++ b/drivers/pinctrl/devicetree.c
@@ -220,6 +220,8 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)
for (state = 0; ; state++) {
/* Retrieve the pinctrl-* property */
propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state);
+ if (!propname)
+ return -ENOMEM;
prop = of_find_property(np, propname, &size);
kfree(propname);
if (!prop) {
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 052/149] drm/panel: simple: set bpc field for logic technologies displays
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 051/149] pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 053/149] drm/drv: Fix potential memory leak in drm_dev_init() Greg Kroah-Hartman
` (103 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aishwarya Kothari, Francesco Dolcini,
Douglas Anderson, Sasha Levin
From: Aishwarya Kothari <aishwarya.kothari@toradex.com>
[ Upstream commit 876153ab068b2507a19aa3ef481f5b00a2cc780f ]
In case bpc is not set for a panel it then throws a WARN(). Add bpc to
the panels logictechno_lt170410_2whc and logictechno_lt161010_2nh.
Fixes: 5728fe7fa539 ("drm/panel: simple: add display timings for logic technologies displays")
Signed-off-by: Aishwarya Kothari <aishwarya.kothari@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220831141622.39605-1-francesco.dolcini@toradex.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panel/panel-simple.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index b7b37082a9d7..1a87cc445b5e 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -2655,6 +2655,7 @@ static const struct display_timing logictechno_lt161010_2nh_timing = {
static const struct panel_desc logictechno_lt161010_2nh = {
.timings = &logictechno_lt161010_2nh_timing,
.num_timings = 1,
+ .bpc = 6,
.size = {
.width = 154,
.height = 86,
@@ -2684,6 +2685,7 @@ static const struct display_timing logictechno_lt170410_2whc_timing = {
static const struct panel_desc logictechno_lt170410_2whc = {
.timings = &logictechno_lt170410_2whc_timing,
.num_timings = 1,
+ .bpc = 8,
.size = {
.width = 217,
.height = 136,
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 053/149] drm/drv: Fix potential memory leak in drm_dev_init()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 052/149] drm/panel: simple: set bpc field for logic technologies displays Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 054/149] drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker() Greg Kroah-Hartman
` (102 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shang XiaoJing, Lyude Paul,
Sasha Levin
From: Shang XiaoJing <shangxiaojing@huawei.com>
[ Upstream commit ff963634f7b2e0dc011349abb3fb81a0d074f443 ]
drm_dev_init() will add drm_dev_init_release() as a callback. When
drmm_add_action() failed, the release function won't be added. As the
result, the ref cnt added by device_get() in drm_dev_init() won't be put
by drm_dev_init_release(), which leads to the memleak. Use
drmm_add_action_or_reset() instead of drmm_add_action() to prevent
memleak.
unreferenced object 0xffff88810bc0c800 (size 2048):
comm "modprobe", pid 8322, jiffies 4305809845 (age 15.292s)
hex dump (first 32 bytes):
e8 cc c0 0b 81 88 ff ff ff ff ff ff 00 00 00 00 ................
20 24 3c 0c 81 88 ff ff 18 c8 c0 0b 81 88 ff ff $<.............
backtrace:
[<000000007251f72d>] __kmalloc+0x4b/0x1c0
[<0000000045f21f26>] platform_device_alloc+0x2d/0xe0
[<000000004452a479>] platform_device_register_full+0x24/0x1c0
[<0000000089f4ea61>] 0xffffffffa0736051
[<00000000235b2441>] do_one_initcall+0x7a/0x380
[<0000000001a4a177>] do_init_module+0x5c/0x230
[<000000002bf8a8e2>] load_module+0x227d/0x2420
[<00000000637d6d0a>] __do_sys_finit_module+0xd5/0x140
[<00000000c99fc324>] do_syscall_64+0x3f/0x90
[<000000004d85aa77>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
Fixes: 2cbf7fc6718b ("drm: Use drmm_ for drm_dev_init cleanup")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221101070716.9189-2-shangxiaojing@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 006e3b896cae..4ca995ce19af 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -610,7 +610,7 @@ static int drm_dev_init(struct drm_device *dev,
mutex_init(&dev->clientlist_mutex);
mutex_init(&dev->master_mutex);
- ret = drmm_add_action(dev, drm_dev_init_release, NULL);
+ ret = drmm_add_action_or_reset(dev, drm_dev_init_release, NULL);
if (ret)
return ret;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 054/149] drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 053/149] drm/drv: Fix potential memory leak in drm_dev_init() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 055/149] ARM: dts: imx7: Fix NAND controller size-cells Greg Kroah-Hartman
` (101 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shang XiaoJing, Lyude Paul,
Sasha Levin
From: Shang XiaoJing <shangxiaojing@huawei.com>
[ Upstream commit 4979524f5a2a8210e87fde2f642b0dc060860821 ]
drm_vblank_init() call drmm_add_action_or_reset() with
drm_vblank_init_release() as action. If __drmm_add_action() failed, will
directly call drm_vblank_init_release() with the vblank whose worker is
NULL. As the resule, a null-ptr-deref will happen in
kthread_destroy_worker(). Add the NULL check before calling
drm_vblank_destroy_worker().
BUG: null-ptr-deref
KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f]
CPU: 5 PID: 961 Comm: modprobe Not tainted 6.0.0-11331-gd465bff130bf-dirty
RIP: 0010:kthread_destroy_worker+0x25/0xb0
Call Trace:
<TASK>
drm_vblank_init_release+0x124/0x220 [drm]
? drm_crtc_vblank_restore+0x8b0/0x8b0 [drm]
__drmm_add_action_or_reset+0x41/0x50 [drm]
drm_vblank_init+0x282/0x310 [drm]
vkms_init+0x35f/0x1000 [vkms]
? 0xffffffffc4508000
? lock_is_held_type+0xd7/0x130
? __kmem_cache_alloc_node+0x1c2/0x2b0
? lock_is_held_type+0xd7/0x130
? 0xffffffffc4508000
do_one_initcall+0xd0/0x4f0
...
do_syscall_64+0x35/0x80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
Fixes: 5e6c2b4f9161 ("drm/vblank: Add vblank works")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221101070716.9189-3-shangxiaojing@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_internal.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index f80e0f28087d..41efe40bc70f 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -116,7 +116,8 @@ static inline void drm_vblank_flush_worker(struct drm_vblank_crtc *vblank)
static inline void drm_vblank_destroy_worker(struct drm_vblank_crtc *vblank)
{
- kthread_destroy_worker(vblank->worker);
+ if (vblank->worker)
+ kthread_destroy_worker(vblank->worker);
}
int drm_vblank_worker_init(struct drm_vblank_crtc *vblank);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 055/149] ARM: dts: imx7: Fix NAND controller size-cells
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 054/149] drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 056/149] arm64: dts: imx8mm: " Greg Kroah-Hartman
` (100 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Marek Vasut, Shawn Guo, Sasha Levin
From: Marek Vasut <marex@denx.de>
[ Upstream commit 753395ea1e45c724150070b5785900b6a44bd5fb ]
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
"
Fix the missing space in node name too.
Fixes: e7495a45a76de ("ARM: dts: imx7: add GPMI NAND and APBH DMA")
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/imx7s.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 9e1b0af0aa43..e4ff47110a96 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -1221,10 +1221,10 @@ dma_apbh: dma-apbh@33000000 {
clocks = <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>;
};
- gpmi: nand-controller@33002000{
+ gpmi: nand-controller@33002000 {
compatible = "fsl,imx7d-gpmi-nand";
#address-cells = <1>;
- #size-cells = <1>;
+ #size-cells = <0>;
reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
reg-names = "gpmi-nand", "bch";
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 056/149] arm64: dts: imx8mm: Fix NAND controller size-cells
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 055/149] ARM: dts: imx7: Fix NAND controller size-cells Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 057/149] arm64: dts: imx8mn: " Greg Kroah-Hartman
` (99 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Marek Vasut, Shawn Guo, Sasha Levin
From: Marek Vasut <marex@denx.de>
[ Upstream commit 1610233bc2c2cae2dff9e101e6ea5ef69cceb0e9 ]
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
"
Fix the missing space in node name too.
Fixes: a05ea40eb384e ("arm64: dts: imx: Add i.mx8mm dtsi support")
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/freescale/imx8mm.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index f4d7bb75707d..3490619a9ba9 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -939,10 +939,10 @@ dma_apbh: dma-controller@33000000 {
clocks = <&clk IMX8MM_CLK_NAND_USDHC_BUS_RAWNAND_CLK>;
};
- gpmi: nand-controller@33002000{
+ gpmi: nand-controller@33002000 {
compatible = "fsl,imx8mm-gpmi-nand", "fsl,imx7d-gpmi-nand";
#address-cells = <1>;
- #size-cells = <1>;
+ #size-cells = <0>;
reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
reg-names = "gpmi-nand", "bch";
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 057/149] arm64: dts: imx8mn: Fix NAND controller size-cells
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 056/149] arm64: dts: imx8mm: " Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 058/149] ata: libata-transport: fix double ata_host_put() in ata_tport_add() Greg Kroah-Hartman
` (98 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Marek Vasut, Shawn Guo, Sasha Levin
From: Marek Vasut <marex@denx.de>
[ Upstream commit 5468e93b5b1083eaa729f98e59da18c85d9c4126 ]
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
"
Fixes: 6c3debcbae47a ("arm64: dts: freescale: Add i.MX8MN dtsi support")
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/freescale/imx8mn.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index aea723eb2ba3..7dba83041264 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -809,7 +809,7 @@ dma_apbh: dma-controller@33000000 {
gpmi: nand-controller@33002000 {
compatible = "fsl,imx8mn-gpmi-nand", "fsl,imx7d-gpmi-nand";
#address-cells = <1>;
- #size-cells = <1>;
+ #size-cells = <0>;
reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
reg-names = "gpmi-nand", "bch";
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 058/149] ata: libata-transport: fix double ata_host_put() in ata_tport_add()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 057/149] arm64: dts: imx8mn: " Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 059/149] ata: libata-transport: fix error handling " Greg Kroah-Hartman
` (97 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Damien Le Moal,
Sasha Levin
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit 8c76310740807ade5ecdab5888f70ecb6d35732e ]
In the error path in ata_tport_add(), when calling put_device(),
ata_tport_release() is called, it will put the refcount of 'ap->host'.
And then ata_host_put() is called again, the refcount is decreased
to 0, ata_host_release() is called, all ports are freed and set to
null.
When unbinding the device after failure, ata_host_stop() is called
to release the resources, it leads a null-ptr-deref(), because all
the ports all freed and null.
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
CPU: 7 PID: 18671 Comm: modprobe Kdump: loaded Tainted: G E 6.1.0-rc3+ #8
pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : ata_host_stop+0x3c/0x84 [libata]
lr : release_nodes+0x64/0xd0
Call trace:
ata_host_stop+0x3c/0x84 [libata]
release_nodes+0x64/0xd0
devres_release_all+0xbc/0x1b0
device_unbind_cleanup+0x20/0x70
really_probe+0x158/0x320
__driver_probe_device+0x84/0x120
driver_probe_device+0x44/0x120
__driver_attach+0xb4/0x220
bus_for_each_dev+0x78/0xdc
driver_attach+0x2c/0x40
bus_add_driver+0x184/0x240
driver_register+0x80/0x13c
__pci_register_driver+0x4c/0x60
ahci_pci_driver_init+0x30/0x1000 [ahci]
Fix this by removing redundant ata_host_put() in the error path.
Fixes: 2623c7a5f279 ("libata: add refcounting to ata_host")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-transport.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index b33772df9bc6..8a9850bd5d6c 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -317,7 +317,6 @@ int ata_tport_add(struct device *parent,
tport_err:
transport_destroy_device(dev);
put_device(dev);
- ata_host_put(ap->host);
return error;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 059/149] ata: libata-transport: fix error handling in ata_tport_add()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 058/149] ata: libata-transport: fix double ata_host_put() in ata_tport_add() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 060/149] ata: libata-transport: fix error handling in ata_tlink_add() Greg Kroah-Hartman
` (96 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Damien Le Moal,
Sasha Levin
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit 3613dbe3909dcc637fe6be00e4dc43b4aa0470ee ]
In ata_tport_add(), the return value of transport_add_device() is
not checked. As a result, it causes null-ptr-deref while removing
the module, because transport_remove_device() is called to remove
the device that was not added.
Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0
CPU: 12 PID: 13605 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #8
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : device_del+0x48/0x39c
lr : device_del+0x44/0x39c
Call trace:
device_del+0x48/0x39c
attribute_container_class_device_del+0x28/0x40
transport_remove_classdev+0x60/0x7c
attribute_container_device_trigger+0x118/0x120
transport_remove_device+0x20/0x30
ata_tport_delete+0x34/0x60 [libata]
ata_port_detach+0x148/0x1b0 [libata]
ata_pci_remove_one+0x50/0x80 [libata]
ahci_remove_one+0x4c/0x8c [ahci]
Fix this by checking and handling return value of transport_add_device()
in ata_tport_add().
Fixes: d9027470b886 ("[libata] Add ATA transport class")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-transport.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 8a9850bd5d6c..da1b144d8288 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -301,7 +301,9 @@ int ata_tport_add(struct device *parent,
pm_runtime_enable(dev);
pm_runtime_forbid(dev);
- transport_add_device(dev);
+ error = transport_add_device(dev);
+ if (error)
+ goto tport_transport_add_err;
transport_configure_device(dev);
error = ata_tlink_add(&ap->link);
@@ -312,6 +314,7 @@ int ata_tport_add(struct device *parent,
tport_link_err:
transport_remove_device(dev);
+ tport_transport_add_err:
device_del(dev);
tport_err:
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 060/149] ata: libata-transport: fix error handling in ata_tlink_add()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 059/149] ata: libata-transport: fix error handling " Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 061/149] ata: libata-transport: fix error handling in ata_tdev_add() Greg Kroah-Hartman
` (95 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Damien Le Moal,
Sasha Levin
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit cf0816f6322c5c37ee52655f928e91ecf32da103 ]
In ata_tlink_add(), the return value of transport_add_device() is
not checked. As a result, it causes null-ptr-deref while removing
the module, because transport_remove_device() is called to remove
the device that was not added.
Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0
CPU: 33 PID: 13850 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #12
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : device_del+0x48/0x39c
lr : device_del+0x44/0x39c
Call trace:
device_del+0x48/0x39c
attribute_container_class_device_del+0x28/0x40
transport_remove_classdev+0x60/0x7c
attribute_container_device_trigger+0x118/0x120
transport_remove_device+0x20/0x30
ata_tlink_delete+0x88/0xb0 [libata]
ata_tport_delete+0x2c/0x60 [libata]
ata_port_detach+0x148/0x1b0 [libata]
ata_pci_remove_one+0x50/0x80 [libata]
ahci_remove_one+0x4c/0x8c [ahci]
Fix this by checking and handling return value of transport_add_device()
in ata_tlink_add().
Fixes: d9027470b886 ("[libata] Add ATA transport class")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-transport.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index da1b144d8288..e386e5f35015 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -428,7 +428,9 @@ int ata_tlink_add(struct ata_link *link)
goto tlink_err;
}
- transport_add_device(dev);
+ error = transport_add_device(dev);
+ if (error)
+ goto tlink_transport_err;
transport_configure_device(dev);
ata_for_each_dev(ata_dev, link, ALL) {
@@ -443,6 +445,7 @@ int ata_tlink_add(struct ata_link *link)
ata_tdev_delete(ata_dev);
}
transport_remove_device(dev);
+ tlink_transport_err:
device_del(dev);
tlink_err:
transport_destroy_device(dev);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 061/149] ata: libata-transport: fix error handling in ata_tdev_add()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 060/149] ata: libata-transport: fix error handling in ata_tlink_add() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 062/149] bpf: Initialize same number of free nodes for each pcpu_freelist Greg Kroah-Hartman
` (94 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Damien Le Moal,
Sasha Levin
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit 1ff36351309e3eadcff297480baf4785e726de9b ]
In ata_tdev_add(), the return value of transport_add_device() is
not checked. As a result, it causes null-ptr-deref while removing
the module, because transport_remove_device() is called to remove
the device that was not added.
Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0
CPU: 13 PID: 13603 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #36
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : device_del+0x48/0x3a0
lr : device_del+0x44/0x3a0
Call trace:
device_del+0x48/0x3a0
attribute_container_class_device_del+0x28/0x40
transport_remove_classdev+0x60/0x7c
attribute_container_device_trigger+0x118/0x120
transport_remove_device+0x20/0x30
ata_tdev_delete+0x24/0x50 [libata]
ata_tlink_delete+0x40/0xa0 [libata]
ata_tport_delete+0x2c/0x60 [libata]
ata_port_detach+0x148/0x1b0 [libata]
ata_pci_remove_one+0x50/0x80 [libata]
ahci_remove_one+0x4c/0x8c [ahci]
Fix this by checking and handling return value of transport_add_device()
in ata_tdev_add(). In the error path, device_del() is called to delete
the device which was added earlier in this function, and ata_tdev_free()
is called to free ata_dev.
Fixes: d9027470b886 ("[libata] Add ATA transport class")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-transport.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index e386e5f35015..31a66fc0c31d 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -683,7 +683,13 @@ static int ata_tdev_add(struct ata_device *ata_dev)
return error;
}
- transport_add_device(dev);
+ error = transport_add_device(dev);
+ if (error) {
+ device_del(dev);
+ ata_tdev_free(ata_dev);
+ return error;
+ }
+
transport_configure_device(dev);
return 0;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 062/149] bpf: Initialize same number of free nodes for each pcpu_freelist
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 061/149] ata: libata-transport: fix error handling in ata_tdev_add() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 063/149] net: bgmac: Drop free_netdev() from bgmac_enet_remove() Greg Kroah-Hartman
` (93 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xu Kuohai, Andrii Nakryiko,
Yonghong Song, Sasha Levin
From: Xu Kuohai <xukuohai@huawei.com>
[ Upstream commit 4b45cd81f737d79d0fbfc0d320a1e518e7f0bbf0 ]
pcpu_freelist_populate() initializes nr_elems / num_possible_cpus() + 1
free nodes for some CPUs, and then possibly one CPU with fewer nodes,
followed by remaining cpus with 0 nodes. For example, when nr_elems == 256
and num_possible_cpus() == 32, CPU 0~27 each gets 9 free nodes, CPU 28 gets
4 free nodes, CPU 29~31 get 0 free nodes, while in fact each CPU should get
8 nodes equally.
This patch initializes nr_elems / num_possible_cpus() free nodes for each
CPU firstly, then allocates the remaining free nodes by one for each CPU
until no free nodes left.
Fixes: e19494edab82 ("bpf: introduce percpu_freelist")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20221110122128.105214-1-xukuohai@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/percpu_freelist.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/kernel/bpf/percpu_freelist.c b/kernel/bpf/percpu_freelist.c
index 3d897de89061..bbab8bb4b2fd 100644
--- a/kernel/bpf/percpu_freelist.c
+++ b/kernel/bpf/percpu_freelist.c
@@ -102,22 +102,21 @@ void pcpu_freelist_populate(struct pcpu_freelist *s, void *buf, u32 elem_size,
u32 nr_elems)
{
struct pcpu_freelist_head *head;
- int i, cpu, pcpu_entries;
+ unsigned int cpu, cpu_idx, i, j, n, m;
- pcpu_entries = nr_elems / num_possible_cpus() + 1;
- i = 0;
+ n = nr_elems / num_possible_cpus();
+ m = nr_elems % num_possible_cpus();
+ cpu_idx = 0;
for_each_possible_cpu(cpu) {
-again:
head = per_cpu_ptr(s->freelist, cpu);
- /* No locking required as this is not visible yet. */
- pcpu_freelist_push_node(head, buf);
- i++;
- buf += elem_size;
- if (i == nr_elems)
- break;
- if (i % pcpu_entries)
- goto again;
+ j = n + (cpu_idx < m ? 1 : 0);
+ for (i = 0; i < j; i++) {
+ /* No locking required as this is not visible yet. */
+ pcpu_freelist_push_node(head, buf);
+ buf += elem_size;
+ }
+ cpu_idx++;
}
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 063/149] net: bgmac: Drop free_netdev() from bgmac_enet_remove()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 062/149] bpf: Initialize same number of free nodes for each pcpu_freelist Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 064/149] mISDN: fix possible memory leak in mISDN_dsp_element_register() Greg Kroah-Hartman
` (92 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wei Yongjun, Jakub Kicinski,
Sasha Levin
From: Wei Yongjun <weiyongjun1@huawei.com>
[ Upstream commit 6f928ab8ee9bfbcb0e631c47ea8a16c3d5116ff1 ]
netdev is allocated in bgmac_alloc() with devm_alloc_etherdev() and will
be auto released in ->remove and ->probe failure path. Using free_netdev()
in bgmac_enet_remove() leads to double free.
Fixes: 34a5102c3235 ("net: bgmac: allocate struct bgmac just once & don't copy it")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20221109150136.2991171-1-weiyongjun@huaweicloud.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/bgmac.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 6290d8bedc92..9960127f612e 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1568,7 +1568,6 @@ void bgmac_enet_remove(struct bgmac *bgmac)
phy_disconnect(bgmac->net_dev->phydev);
netif_napi_del(&bgmac->napi);
bgmac_dma_free(bgmac);
- free_netdev(bgmac->net_dev);
}
EXPORT_SYMBOL_GPL(bgmac_enet_remove);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 064/149] mISDN: fix possible memory leak in mISDN_dsp_element_register()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 063/149] net: bgmac: Drop free_netdev() from bgmac_enet_remove() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 065/149] net: hinic: Fix error handling in hinic_module_init() Greg Kroah-Hartman
` (91 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Jakub Kicinski,
Sasha Levin
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit 98a2ac1ca8fd6eca6867726fe238d06e75eb1acd ]
Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's
bus_id string array"), the name of device is allocated dynamically,
use put_device() to give up the reference, so that the name can be
freed in kobject_cleanup() when the refcount is 0.
The 'entry' is going to be freed in mISDN_dsp_dev_release(), so the
kfree() is removed. list_del() is called in mISDN_dsp_dev_release(),
so it need be initialized.
Fixes: 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221109132832.3270119-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/isdn/mISDN/dsp_pipeline.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
index c3b2c99b5cd5..cfbcd9e973c2 100644
--- a/drivers/isdn/mISDN/dsp_pipeline.c
+++ b/drivers/isdn/mISDN/dsp_pipeline.c
@@ -77,6 +77,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem)
if (!entry)
return -ENOMEM;
+ INIT_LIST_HEAD(&entry->list);
entry->elem = elem;
entry->dev.class = elements_class;
@@ -107,7 +108,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem)
device_unregister(&entry->dev);
return ret;
err1:
- kfree(entry);
+ put_device(&entry->dev);
return ret;
}
EXPORT_SYMBOL(mISDN_dsp_element_register);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 065/149] net: hinic: Fix error handling in hinic_module_init()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 064/149] mISDN: fix possible memory leak in mISDN_dsp_element_register() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 066/149] net: liquidio: release resources when liquidio driver open failed Greg Kroah-Hartman
` (90 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Can, Leon Romanovsky,
Jakub Kicinski, Sasha Levin
From: Yuan Can <yuancan@huawei.com>
[ Upstream commit 8eab9be56cc6b702a445d2b6d0256aa0992316b3 ]
A problem about hinic create debugfs failed is triggered with the
following log given:
[ 931.419023] debugfs: Directory 'hinic' with parent '/' already present!
The reason is that hinic_module_init() returns pci_register_driver()
directly without checking its return value, if pci_register_driver()
failed, it returns without destroy the newly created debugfs, resulting
the debugfs of hinic can never be created later.
hinic_module_init()
hinic_dbg_register_debugfs() # create debugfs directory
pci_register_driver()
driver_register()
bus_add_driver()
priv = kzalloc(...) # OOM happened
# return without destroy debugfs directory
Fix by removing debugfs when pci_register_driver() returns error.
Fixes: 253ac3a97921 ("hinic: add support to query sq info")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20221110021642.80378-1-yuancan@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/huawei/hinic/hinic_main.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
index 4f1d585485d7..6ec042d48cd1 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
@@ -1502,8 +1502,15 @@ static struct pci_driver hinic_driver = {
static int __init hinic_module_init(void)
{
+ int ret;
+
hinic_dbg_register_debugfs(HINIC_DRV_NAME);
- return pci_register_driver(&hinic_driver);
+
+ ret = pci_register_driver(&hinic_driver);
+ if (ret)
+ hinic_dbg_unregister_debugfs();
+
+ return ret;
}
static void __exit hinic_module_exit(void)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 066/149] net: liquidio: release resources when liquidio driver open failed
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 065/149] net: hinic: Fix error handling in hinic_module_init() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 067/149] mISDN: fix misuse of put_device() in mISDN_register_device() Greg Kroah-Hartman
` (89 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhengchao Shao, Leon Romanovsky,
David S. Miller, Sasha Levin
From: Zhengchao Shao <shaozhengchao@huawei.com>
[ Upstream commit 8979f428a4afc215e390006e5ea19fd4e22c7ca9 ]
When liquidio driver open failed, it doesn't release resources. Compile
tested only.
Fixes: 5b07aee11227 ("liquidio: MSIX support for CN23XX")
Fixes: dbc97bfd3918 ("net: liquidio: Add missing null pointer checks")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/cavium/liquidio/lio_main.c | 34 ++++++++++++++-----
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index e0d18e917108..c4dc6e2ccd6b 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -1798,13 +1798,10 @@ static int liquidio_open(struct net_device *netdev)
ifstate_set(lio, LIO_IFSTATE_RUNNING);
- if (OCTEON_CN23XX_PF(oct)) {
- if (!oct->msix_on)
- if (setup_tx_poll_fn(netdev))
- return -1;
- } else {
- if (setup_tx_poll_fn(netdev))
- return -1;
+ if (!OCTEON_CN23XX_PF(oct) || (OCTEON_CN23XX_PF(oct) && !oct->msix_on)) {
+ ret = setup_tx_poll_fn(netdev);
+ if (ret)
+ goto err_poll;
}
netif_tx_start_all_queues(netdev);
@@ -1817,7 +1814,7 @@ static int liquidio_open(struct net_device *netdev)
/* tell Octeon to start forwarding packets to host */
ret = send_rx_ctrl_cmd(lio, 1);
if (ret)
- return ret;
+ goto err_rx_ctrl;
/* start periodical statistics fetch */
INIT_DELAYED_WORK(&lio->stats_wk.work, lio_fetch_stats);
@@ -1828,6 +1825,27 @@ static int liquidio_open(struct net_device *netdev)
dev_info(&oct->pci_dev->dev, "%s interface is opened\n",
netdev->name);
+ return 0;
+
+err_rx_ctrl:
+ if (!OCTEON_CN23XX_PF(oct) || (OCTEON_CN23XX_PF(oct) && !oct->msix_on))
+ cleanup_tx_poll_fn(netdev);
+err_poll:
+ if (lio->ptp_clock) {
+ ptp_clock_unregister(lio->ptp_clock);
+ lio->ptp_clock = NULL;
+ }
+
+ if (oct->props[lio->ifidx].napi_enabled == 1) {
+ list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list)
+ napi_disable(napi);
+
+ oct->props[lio->ifidx].napi_enabled = 0;
+
+ if (OCTEON_CN23XX_PF(oct))
+ oct->droq[0]->ops.poll_mode = 0;
+ }
+
return ret;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 067/149] mISDN: fix misuse of put_device() in mISDN_register_device()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 066/149] net: liquidio: release resources when liquidio driver open failed Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 068/149] net: macvlan: Use built-in RCU list checking Greg Kroah-Hartman
` (88 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wang ShaoBo, David S. Miller,
Sasha Levin
From: Wang ShaoBo <bobo.shaobowang@huawei.com>
[ Upstream commit 2d25107e111a85c56f601a5470f1780ec054e6ac ]
We should not release reference by put_device() before calling device_initialize().
Fixes: e7d1d4d9ac0d ("mISDN: fix possible memory leak in mISDN_register_device()")
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/isdn/mISDN/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
index 7ea0100f218a..90ee56d07a6e 100644
--- a/drivers/isdn/mISDN/core.c
+++ b/drivers/isdn/mISDN/core.c
@@ -222,7 +222,7 @@ mISDN_register_device(struct mISDNdevice *dev,
err = get_free_devid();
if (err < 0)
- goto error1;
+ return err;
dev->id = err;
device_initialize(&dev->dev);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 068/149] net: macvlan: Use built-in RCU list checking
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 067/149] mISDN: fix misuse of put_device() in mISDN_register_device() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 069/149] net: caif: fix double disconnect client in chnl_net_open() Greg Kroah-Hartman
` (87 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuang Wang, David S. Miller,
Sasha Levin
From: Chuang Wang <nashuiliang@gmail.com>
[ Upstream commit 5df1341ea822292275c56744aab9c536d75c33be ]
hlist_for_each_entry_rcu() has built-in RCU and lock checking.
Pass cond argument to hlist_for_each_entry_rcu() to silence false
lockdep warning when CONFIG_PROVE_RCU_LIST is enabled.
Execute as follow:
ip link add link eth0 type macvlan mode source macaddr add <MAC-ADDR>
The rtnl_lock is held when macvlan_hash_lookup_source() or
macvlan_fill_info_macaddr() are called in the non-RCU read side section.
So, pass lockdep_rtnl_is_held() to silence false lockdep warning.
Fixes: 79cf79abce71 ("macvlan: add source mode")
Signed-off-by: Chuang Wang <nashuiliang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/macvlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 6b269a72388b..5d6b4f76b519 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -139,7 +139,7 @@ static struct macvlan_source_entry *macvlan_hash_lookup_source(
u32 idx = macvlan_eth_hash(addr);
struct hlist_head *h = &vlan->port->vlan_source_hash[idx];
- hlist_for_each_entry_rcu(entry, h, hlist) {
+ hlist_for_each_entry_rcu(entry, h, hlist, lockdep_rtnl_is_held()) {
if (ether_addr_equal_64bits(entry->addr, addr) &&
entry->vlan == vlan)
return entry;
@@ -1614,7 +1614,7 @@ static int macvlan_fill_info_macaddr(struct sk_buff *skb,
struct hlist_head *h = &vlan->port->vlan_source_hash[i];
struct macvlan_source_entry *entry;
- hlist_for_each_entry_rcu(entry, h, hlist) {
+ hlist_for_each_entry_rcu(entry, h, hlist, lockdep_rtnl_is_held()) {
if (entry->vlan != vlan)
continue;
if (nla_put(skb, IFLA_MACVLAN_MACADDR, ETH_ALEN, entry->addr))
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 069/149] net: caif: fix double disconnect client in chnl_net_open()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 068/149] net: macvlan: Use built-in RCU list checking Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 070/149] bnxt_en: Remove debugfs when pci_register_driver failed Greg Kroah-Hartman
` (86 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhengchao Shao, David S. Miller,
Sasha Levin
From: Zhengchao Shao <shaozhengchao@huawei.com>
[ Upstream commit 8fbb53c8bfd8c56ecf1f78dc821778b58f505503 ]
When connecting to client timeout, disconnect client for twice in
chnl_net_open(). Remove one. Compile tested only.
Fixes: 2aa40aef9deb ("caif: Use link layer MTU instead of fixed MTU")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/caif/chnl_net.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c
index 42dc080a4dbb..806fb4d84fd3 100644
--- a/net/caif/chnl_net.c
+++ b/net/caif/chnl_net.c
@@ -315,9 +315,6 @@ static int chnl_net_open(struct net_device *dev)
if (result == 0) {
pr_debug("connect timeout\n");
- caif_disconnect_client(dev_net(dev), &priv->chnl);
- priv->state = CAIF_DISCONNECTED;
- pr_debug("state disconnected\n");
result = -ETIMEDOUT;
goto error;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 070/149] bnxt_en: Remove debugfs when pci_register_driver failed
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 069/149] net: caif: fix double disconnect client in chnl_net_open() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 071/149] xen/pcpu: fix possible memory leak in register_pcpu() Greg Kroah-Hartman
` (85 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gaosheng Cui, Leon Romanovsky,
Michael Chan, David S. Miller, Sasha Levin
From: Gaosheng Cui <cuigaosheng1@huawei.com>
[ Upstream commit 991aef4ee4f6eb999924f429b943441a32835c8f ]
When pci_register_driver failed, we need to remove debugfs,
which will caused a resource leak, fix it.
Resource leak logs as follows:
[ 52.184456] debugfs: Directory 'bnxt_en' with parent '/' already present!
Fixes: cabfb09d87bd ("bnxt_en: add debugfs support for DIM")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 8311473d537b..92f54e333395 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -13111,8 +13111,16 @@ static struct pci_driver bnxt_pci_driver = {
static int __init bnxt_init(void)
{
+ int err;
+
bnxt_debug_init();
- return pci_register_driver(&bnxt_pci_driver);
+ err = pci_register_driver(&bnxt_pci_driver);
+ if (err) {
+ bnxt_debug_exit();
+ return err;
+ }
+
+ return 0;
}
static void __exit bnxt_exit(void)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 071/149] xen/pcpu: fix possible memory leak in register_pcpu()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 070/149] bnxt_en: Remove debugfs when pci_register_driver failed Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 072/149] net: ionic: Fix error handling in ionic_init_module() Greg Kroah-Hartman
` (84 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Juergen Gross,
Sasha Levin
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit da36a2a76b01b210ffaa55cdc2c99bc8783697c5 ]
In device_add(), dev_set_name() is called to allocate name, if it returns
error, the name need be freed. As comment of device_register() says, it
should use put_device() to give up the reference in the error path. So fix
this by calling put_device(), then the name can be freed in kobject_cleanup().
Fixes: f65c9bb3fb72 ("xen/pcpu: Xen physical cpus online/offline sys interface")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20221110152441.401630-1-yangyingliang@huawei.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/xen/pcpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c
index cdc6daa7a9f6..9cf7085a260b 100644
--- a/drivers/xen/pcpu.c
+++ b/drivers/xen/pcpu.c
@@ -228,7 +228,7 @@ static int register_pcpu(struct pcpu *pcpu)
err = device_register(dev);
if (err) {
- pcpu_release(dev);
+ put_device(dev);
return err;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 072/149] net: ionic: Fix error handling in ionic_init_module()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 071/149] xen/pcpu: fix possible memory leak in register_pcpu() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 073/149] net: ena: Fix error handling in ena_init() Greg Kroah-Hartman
` (83 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Can, Shannon Nelson,
Jakub Kicinski, Sasha Levin
From: Yuan Can <yuancan@huawei.com>
[ Upstream commit 280c0f7cd0aa4d190619b18243110e052a90775c ]
A problem about ionic create debugfs failed is triggered with the
following log given:
[ 415.799514] debugfs: Directory 'ionic' with parent '/' already present!
The reason is that ionic_init_module() returns ionic_bus_register_driver()
directly without checking its return value, if ionic_bus_register_driver()
failed, it returns without destroy the newly created debugfs, resulting
the debugfs of ionic can never be created later.
ionic_init_module()
ionic_debugfs_create() # create debugfs directory
ionic_bus_register_driver()
pci_register_driver()
driver_register()
bus_add_driver()
priv = kzalloc(...) # OOM happened
# return without destroy debugfs directory
Fix by removing debugfs when ionic_bus_register_driver() returns error.
Fixes: fbfb8031533c ("ionic: Add hardware init and device commands")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Link: https://lore.kernel.org/r/20221113092929.19161-1-yuancan@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/pensando/ionic/ionic_main.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c
index f60ffef33e0c..00b6985edea0 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_main.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c
@@ -569,8 +569,14 @@ int ionic_port_reset(struct ionic *ionic)
static int __init ionic_init_module(void)
{
+ int ret;
+
ionic_debugfs_create();
- return ionic_bus_register_driver();
+ ret = ionic_bus_register_driver();
+ if (ret)
+ ionic_debugfs_destroy();
+
+ return ret;
}
static void __exit ionic_cleanup_module(void)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 073/149] net: ena: Fix error handling in ena_init()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 072/149] net: ionic: Fix error handling in ionic_init_module() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 074/149] drbd: use after free in drbd_create_device() Greg Kroah-Hartman
` (82 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Can, Shay Agroskin, Paolo Abeni,
Sasha Levin
From: Yuan Can <yuancan@huawei.com>
[ Upstream commit d349e9be5a2c2d7588a2c4e4bfa0bb3dc1226769 ]
The ena_init() won't destroy workqueue created by
create_singlethread_workqueue() when pci_register_driver() failed.
Call destroy_workqueue() when pci_register_driver() failed to prevent the
resource leak.
Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Acked-by: Shay Agroskin <shayagr@amazon.com>
Link: https://lore.kernel.org/r/20221114025659.124726-1-yuancan@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/amazon/ena/ena_netdev.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 52414ac2c901..1722d4091ea3 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -4488,13 +4488,19 @@ static struct pci_driver ena_pci_driver = {
static int __init ena_init(void)
{
+ int ret;
+
ena_wq = create_singlethread_workqueue(DRV_MODULE_NAME);
if (!ena_wq) {
pr_err("Failed to create workqueue\n");
return -ENOMEM;
}
- return pci_register_driver(&ena_pci_driver);
+ ret = pci_register_driver(&ena_pci_driver);
+ if (ret)
+ destroy_workqueue(ena_wq);
+
+ return ret;
}
static void __exit ena_cleanup(void)
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 074/149] drbd: use after free in drbd_create_device()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 073/149] net: ena: Fix error handling in ena_init() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 075/149] platform/x86/intel: pmc: Dont unconditionally attach Intel PMC when virtualized Greg Kroah-Hartman
` (81 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dan Carpenter,
Christoph Böhmwalder, Jens Axboe, Sasha Levin
From: Dan Carpenter <error27@gmail.com>
[ Upstream commit a7a1598189228b5007369a9622ccdf587be0730f ]
The drbd_destroy_connection() frees the "connection" so use the _safe()
iterator to prevent a use after free.
Fixes: b6f85ef9538b ("drbd: Iterate over all connections")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/Y3Jd5iZRbNQ9w6gm@kili
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/drbd/drbd_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 407527ff6b1f..51450f7c81af 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2720,7 +2720,7 @@ static int init_submitter(struct drbd_device *device)
enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor)
{
struct drbd_resource *resource = adm_ctx->resource;
- struct drbd_connection *connection;
+ struct drbd_connection *connection, *n;
struct drbd_device *device;
struct drbd_peer_device *peer_device, *tmp_peer_device;
struct gendisk *disk;
@@ -2839,7 +2839,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
out_idr_remove_vol:
idr_remove(&connection->peer_devices, vnr);
out_idr_remove_from_resource:
- for_each_connection(connection, resource) {
+ for_each_connection_safe(connection, n, resource) {
peer_device = idr_remove(&connection->peer_devices, vnr);
if (peer_device)
kref_put(&connection->kref, drbd_destroy_connection);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 075/149] platform/x86/intel: pmc: Dont unconditionally attach Intel PMC when virtualized
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 074/149] drbd: use after free in drbd_create_device() Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 076/149] cifs: add check for returning value of SMB2_close_init Greg Kroah-Hartman
` (80 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roger Pau Monné, David E. Box,
Andy Shevchenko, Hans de Goede, Sasha Levin
From: Roger Pau Monné <roger.pau@citrix.com>
[ Upstream commit 2dbfb3f33350e1e868d3d7ed4c176d8777150878 ]
The current logic in the Intel PMC driver will forcefully attach it
when detecting any CPU on the intel_pmc_core_platform_ids array,
even if the matching ACPI device is not present.
There's no checking in pmc_core_probe() to assert that the PMC device
is present, and hence on virtualized environments the PMC device
probes successfully, even if the underlying registers are not present.
Before commit 21ae43570940 ("platform/x86: intel_pmc_core: Substitute PCI
with CPUID enumeration") the driver would check for the presence of a
specific PCI device, and that prevented the driver from attaching when
running virtualized.
Fix by only forcefully attaching the PMC device when not running
virtualized. Note that virtualized platforms can still get the device
to load if the appropriate ACPI device is present on the tables
provided to the VM.
Make an exception for the Xen initial domain, which does have full
hardware access, and hence can attach to the PMC if present.
Fixes: 21ae43570940 ("platform/x86: intel_pmc_core: Substitute PCI with CPUID enumeration")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221110163145.80374-1-roger.pau@citrix.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/intel_pmc_core_pltdrv.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/platform/x86/intel_pmc_core_pltdrv.c b/drivers/platform/x86/intel_pmc_core_pltdrv.c
index 15ca8afdd973..ddfba38c2104 100644
--- a/drivers/platform/x86/intel_pmc_core_pltdrv.c
+++ b/drivers/platform/x86/intel_pmc_core_pltdrv.c
@@ -18,6 +18,8 @@
#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
+#include <xen/xen.h>
+
static void intel_pmc_core_release(struct device *dev)
{
kfree(dev);
@@ -53,6 +55,13 @@ static int __init pmc_core_platform_init(void)
if (acpi_dev_present("INT33A1", NULL, -1))
return -ENODEV;
+ /*
+ * Skip forcefully attaching the device for VMs. Make an exception for
+ * Xen dom0, which does have full hardware access.
+ */
+ if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR) && !xen_initial_domain())
+ return -ENODEV;
+
if (!x86_match_cpu(intel_pmc_core_platform_ids))
return -ENODEV;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 076/149] cifs: add check for returning value of SMB2_close_init
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 075/149] platform/x86/intel: pmc: Dont unconditionally attach Intel PMC when virtualized Greg Kroah-Hartman
@ 2022-11-23 8:50 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 077/149] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() Greg Kroah-Hartman
` (79 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anastasia Belova, Steve French,
Sasha Levin
From: Anastasia Belova <abelova@astralinux.ru>
[ Upstream commit d520de6cb42e88a1d008b54f935caf9fc05951da ]
If the returning value of SMB2_close_init is an error-value,
exit the function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 352d96f3acc6 ("cifs: multichannel: move channel selection above transport layer")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/cifs/smb2ops.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 11efd5289ec4..1cc823e96065 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1266,6 +1266,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
rqst[2].rq_nvec = 1;
rc = SMB2_close_init(tcon, server,
&rqst[2], COMPOUND_FID, COMPOUND_FID, false);
+ if (rc)
+ goto sea_exit;
smb2_set_related(&rqst[2]);
rc = compound_send_recv(xid, ses, server,
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 077/149] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2022-11-23 8:50 ` [PATCH 5.10 076/149] cifs: add check for returning value of SMB2_close_init Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 078/149] net/x25: Fix skb leak in x25_lapb_receive_frame() Greg Kroah-Hartman
` (78 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Liu Jian, Russell King (Oracle),
Jakub Kicinski, Sasha Levin
From: Liu Jian <liujian56@huawei.com>
[ Upstream commit c9b895c6878bdb6789dc1d7af60fd10f4a9f1937 ]
If ag71xx_hw_enable() fails, call phylink_disconnect_phy() to clean up.
And if phylink_of_phy_connect() fails, nothing needs to be done.
Compile tested only.
Fixes: 892e09153fa3 ("net: ag71xx: port to phylink")
Signed-off-by: Liu Jian <liujian56@huawei.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20221114095549.40342-1-liujian56@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/atheros/ag71xx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index c26c9b0c00d8..fe3ca3af431a 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -1468,7 +1468,7 @@ static int ag71xx_open(struct net_device *ndev)
if (ret) {
netif_err(ag, link, ndev, "phylink_of_phy_connect filed with err: %i\n",
ret);
- goto err;
+ return ret;
}
max_frame_len = ag71xx_max_frame_len(ndev->mtu);
@@ -1489,6 +1489,7 @@ static int ag71xx_open(struct net_device *ndev)
err:
ag71xx_rings_cleanup(ag);
+ phylink_disconnect_phy(ag->phylink);
return ret;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 078/149] net/x25: Fix skb leak in x25_lapb_receive_frame()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 077/149] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 079/149] cifs: Fix wrong return value checking when GETFLAGS Greg Kroah-Hartman
` (77 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wei Yongjun, Martin Schiller,
Jakub Kicinski, Sasha Levin
From: Wei Yongjun <weiyongjun1@huawei.com>
[ Upstream commit 2929cceb2fcf0ded7182562e4888afafece82cce ]
x25_lapb_receive_frame() using skb_copy() to get a private copy of
skb, the new skb should be freed in the undersized/fragmented skb
error handling path. Otherwise there is a memory leak.
Fixes: cb101ed2c3c7 ("x25: Handle undersized/fragmented skbs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Martin Schiller <ms@dev.tdt.de>
Link: https://lore.kernel.org/r/20221114110519.514538-1-weiyongjun@huaweicloud.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/x25/x25_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
index 25bf72ee6cad..226397add422 100644
--- a/net/x25/x25_dev.c
+++ b/net/x25/x25_dev.c
@@ -117,7 +117,7 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
if (!pskb_may_pull(skb, 1)) {
x25_neigh_put(nb);
- return 0;
+ goto drop;
}
switch (skb->data[0]) {
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 079/149] cifs: Fix wrong return value checking when GETFLAGS
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 078/149] net/x25: Fix skb leak in x25_lapb_receive_frame() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 080/149] net: thunderbolt: Fix error handling in tbnet_init() Greg Kroah-Hartman
` (76 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhang Xiaoxu, Steve French,
Sasha Levin
From: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
[ Upstream commit 92bbd67a55fee50743b42825d1c016e7fd5c79f9 ]
The return value of CIFSGetExtAttr is negative, should be checked
with -EOPNOTSUPP rather than EOPNOTSUPP.
Fixes: 64a5cfa6db94 ("Allow setting per-file compression via SMB2/3")
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/cifs/ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index dcde44ff6cf9..e45598b62242 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -193,7 +193,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
rc = put_user(ExtAttrBits &
FS_FL_USER_VISIBLE,
(int __user *)arg);
- if (rc != EOPNOTSUPP)
+ if (rc != -EOPNOTSUPP)
break;
}
#endif /* CONFIG_CIFS_POSIX */
@@ -222,7 +222,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
* pSMBFile->fid.netfid,
* extAttrBits,
* &ExtAttrMask);
- * if (rc != EOPNOTSUPP)
+ * if (rc != -EOPNOTSUPP)
* break;
*/
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 080/149] net: thunderbolt: Fix error handling in tbnet_init()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 079/149] cifs: Fix wrong return value checking when GETFLAGS Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 081/149] cifs: add check for returning value of SMB2_set_info_init Greg Kroah-Hartman
` (75 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Can, Mika Westerberg,
David S. Miller, Sasha Levin
From: Yuan Can <yuancan@huawei.com>
[ Upstream commit f524b7289bbb0c8ffaa2ba3c34c146e43da54fb2 ]
A problem about insmod thunderbolt-net failed is triggered with following
log given while lsmod does not show thunderbolt_net:
insmod: ERROR: could not insert module thunderbolt-net.ko: File exists
The reason is that tbnet_init() returns tb_register_service_driver()
directly without checking its return value, if tb_register_service_driver()
failed, it returns without removing property directory, resulting the
property directory can never be created later.
tbnet_init()
tb_register_property_dir() # register property directory
tb_register_service_driver()
driver_register()
bus_add_driver()
priv = kzalloc(...) # OOM happened
# return without remove property directory
Fix by remove property directory when tb_register_service_driver() returns
error.
Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/thunderbolt.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c
index 3160443ef3b9..5d96dc1b00b3 100644
--- a/drivers/net/thunderbolt.c
+++ b/drivers/net/thunderbolt.c
@@ -1343,12 +1343,21 @@ static int __init tbnet_init(void)
TBNET_MATCH_FRAGS_ID);
ret = tb_register_property_dir("network", tbnet_dir);
- if (ret) {
- tb_property_free_dir(tbnet_dir);
- return ret;
- }
+ if (ret)
+ goto err_free_dir;
+
+ ret = tb_register_service_driver(&tbnet_driver);
+ if (ret)
+ goto err_unregister;
- return tb_register_service_driver(&tbnet_driver);
+ return 0;
+
+err_unregister:
+ tb_unregister_property_dir("network", tbnet_dir);
+err_free_dir:
+ tb_property_free_dir(tbnet_dir);
+
+ return ret;
}
module_init(tbnet_init);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 081/149] cifs: add check for returning value of SMB2_set_info_init
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 080/149] net: thunderbolt: Fix error handling in tbnet_init() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 082/149] ftrace: Fix the possible incorrect kernel message Greg Kroah-Hartman
` (74 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anastasia Belova, Steve French,
Sasha Levin
From: Anastasia Belova <abelova@astralinux.ru>
[ Upstream commit a51e5d293dd1c2e7bf6f7be788466cd9b5d280fb ]
If the returning value of SMB2_set_info_init is an error-value,
exit the function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 0967e5457954 ("cifs: use a compound for setting an xattr")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/cifs/smb2ops.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 1cc823e96065..72368b656b33 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1256,6 +1256,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
COMPOUND_FID, current->tgid,
FILE_FULL_EA_INFORMATION,
SMB2_O_INFO_FILE, 0, data, size);
+ if (rc)
+ goto sea_exit;
smb2_set_next_command(tcon, &rqst[1]);
smb2_set_related(&rqst[1]);
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 082/149] ftrace: Fix the possible incorrect kernel message
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 081/149] cifs: add check for returning value of SMB2_set_info_init Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 083/149] ftrace: Optimize the allocation for mcount entries Greg Kroah-Hartman
` (73 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, mhiramat, mark.rutland,
Wang Wensheng, Steven Rostedt (Google)
From: Wang Wensheng <wangwensheng4@huawei.com>
commit 08948caebe93482db1adfd2154eba124f66d161d upstream.
If the number of mcount entries is an integer multiple of
ENTRIES_PER_PAGE, the page count showing on the console would be wrong.
Link: https://lkml.kernel.org/r/20221109094434.84046-2-wangwensheng4@huawei.com
Cc: <mhiramat@kernel.org>
Cc: <mark.rutland@arm.com>
Cc: stable@vger.kernel.org
Fixes: 5821e1b74f0d0 ("function tracing: fix wrong pos computing when read buffer has been fulfilled")
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -6877,7 +6877,7 @@ void __init ftrace_init(void)
}
pr_info("ftrace: allocating %ld entries in %ld pages\n",
- count, count / ENTRIES_PER_PAGE + 1);
+ count, DIV_ROUND_UP(count, ENTRIES_PER_PAGE));
last_ftrace_enabled = ftrace_enabled = 1;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 083/149] ftrace: Optimize the allocation for mcount entries
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 082/149] ftrace: Fix the possible incorrect kernel message Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 084/149] ftrace: Fix null pointer dereference in ftrace_add_mod() Greg Kroah-Hartman
` (72 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, mhiramat, mark.rutland,
Wang Wensheng, Steven Rostedt (Google)
From: Wang Wensheng <wangwensheng4@huawei.com>
commit bcea02b096333dc74af987cb9685a4dbdd820840 upstream.
If we can't allocate this size, try something smaller with half of the
size. Its order should be decreased by one instead of divided by two.
Link: https://lkml.kernel.org/r/20221109094434.84046-3-wangwensheng4@huawei.com
Cc: <mhiramat@kernel.org>
Cc: <mark.rutland@arm.com>
Cc: stable@vger.kernel.org
Fixes: a79008755497d ("ftrace: Allocate the mcount record pages as groups")
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3178,7 +3178,7 @@ static int ftrace_allocate_records(struc
/* if we can't allocate this size, try something smaller */
if (!order)
return -ENOMEM;
- order >>= 1;
+ order--;
goto again;
}
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 084/149] ftrace: Fix null pointer dereference in ftrace_add_mod()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 083/149] ftrace: Optimize the allocation for mcount entries Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 085/149] ring_buffer: Do not deactivate non-existant pages Greg Kroah-Hartman
` (71 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xiu Jianfeng,
Steven Rostedt (Google)
From: Xiu Jianfeng <xiujianfeng@huawei.com>
commit 19ba6c8af9382c4c05dc6a0a79af3013b9a35cd0 upstream.
The @ftrace_mod is allocated by kzalloc(), so both the members {prev,next}
of @ftrace_mode->list are NULL, it's not a valid state to call list_del().
If kstrdup() for @ftrace_mod->{func|module} fails, it goes to @out_free
tag and calls free_ftrace_mod() to destroy @ftrace_mod, then list_del()
will write prev->next and next->prev, where null pointer dereference
happens.
BUG: kernel NULL pointer dereference, address: 0000000000000008
Oops: 0002 [#1] PREEMPT SMP NOPTI
Call Trace:
<TASK>
ftrace_mod_callback+0x20d/0x220
? do_filp_open+0xd9/0x140
ftrace_process_regex.isra.51+0xbf/0x130
ftrace_regex_write.isra.52.part.53+0x6e/0x90
vfs_write+0xee/0x3a0
? __audit_filter_op+0xb1/0x100
? auditd_test_task+0x38/0x50
ksys_write+0xa5/0xe0
do_syscall_64+0x3a/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Kernel panic - not syncing: Fatal exception
So call INIT_LIST_HEAD() to initialize the list member to fix this issue.
Link: https://lkml.kernel.org/r/20221116015207.30858-1-xiujianfeng@huawei.com
Cc: stable@vger.kernel.org
Fixes: 673feb9d76ab ("ftrace: Add :mod: caching infrastructure to trace_array")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ftrace.c | 1 +
1 file changed, 1 insertion(+)
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1295,6 +1295,7 @@ static int ftrace_add_mod(struct trace_a
if (!ftrace_mod)
return -ENOMEM;
+ INIT_LIST_HEAD(&ftrace_mod->list);
ftrace_mod->func = kstrdup(func, GFP_KERNEL);
ftrace_mod->module = kstrdup(module, GFP_KERNEL);
ftrace_mod->enable = enable;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 085/149] ring_buffer: Do not deactivate non-existant pages
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 084/149] ftrace: Fix null pointer dereference in ftrace_add_mod() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 086/149] tracing/ring-buffer: Have polling block on watermark Greg Kroah-Hartman
` (70 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniil Tatianin,
Steven Rostedt (Google)
From: Daniil Tatianin <d-tatianin@yandex-team.ru>
commit 56f4ca0a79a9f1af98f26c54b9b89ba1f9bcc6bd upstream.
rb_head_page_deactivate() expects cpu_buffer to contain a valid list of
->pages, so verify that the list is actually present before calling it.
Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.
Link: https://lkml.kernel.org/r/20221114143129.3534443-1-d-tatianin@yandex-team.ru
Cc: stable@vger.kernel.org
Fixes: 77ae365eca895 ("ring-buffer: make lockless")
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ring_buffer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1635,9 +1635,9 @@ static void rb_free_cpu_buffer(struct ri
free_buffer_page(cpu_buffer->reader_page);
- rb_head_page_deactivate(cpu_buffer);
-
if (head) {
+ rb_head_page_deactivate(cpu_buffer);
+
list_for_each_entry_safe(bpage, tmp, head, list) {
list_del_init(&bpage->list);
free_buffer_page(bpage);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 086/149] tracing/ring-buffer: Have polling block on watermark
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 085/149] ring_buffer: Do not deactivate non-existant pages Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 087/149] tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() Greg Kroah-Hartman
` (69 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linux Trace Kernel, Masami Hiramatsu,
Mathieu Desnoyers, Primiano Tucci, Steven Rostedt (Google)
From: Steven Rostedt (Google) <rostedt@goodmis.org>
commit 42fb0a1e84ff525ebe560e2baf9451ab69127e2b upstream.
Currently the way polling works on the ring buffer is broken. It will
return immediately if there's any data in the ring buffer whereas a read
will block until the watermark (defined by the tracefs buffer_percent file)
is hit.
That is, a select() or poll() will return as if there's data available,
but then the following read will block. This is broken for the way
select()s and poll()s are supposed to work.
Have the polling on the ring buffer also block the same way reads and
splice does on the ring buffer.
Link: https://lkml.kernel.org/r/20221020231427.41be3f26@gandalf.local.home
Cc: Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Primiano Tucci <primiano@google.com>
Cc: stable@vger.kernel.org
Fixes: 1e0d6714aceb7 ("ring-buffer: Do not wake up a splice waiter when page is not full")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/ring_buffer.h | 2 -
kernel/trace/ring_buffer.c | 55 ++++++++++++++++++++++++++++----------------
kernel/trace/trace.c | 2 -
3 files changed, 38 insertions(+), 21 deletions(-)
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -99,7 +99,7 @@ __ring_buffer_alloc(unsigned long size,
int ring_buffer_wait(struct trace_buffer *buffer, int cpu, int full);
__poll_t ring_buffer_poll_wait(struct trace_buffer *buffer, int cpu,
- struct file *filp, poll_table *poll_table);
+ struct file *filp, poll_table *poll_table, int full);
void ring_buffer_wake_waiters(struct trace_buffer *buffer, int cpu);
#define RING_BUFFER_ALL_CPUS -1
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -784,6 +784,21 @@ size_t ring_buffer_nr_dirty_pages(struct
return cnt - read;
}
+static __always_inline bool full_hit(struct trace_buffer *buffer, int cpu, int full)
+{
+ struct ring_buffer_per_cpu *cpu_buffer = buffer->buffers[cpu];
+ size_t nr_pages;
+ size_t dirty;
+
+ nr_pages = cpu_buffer->nr_pages;
+ if (!nr_pages || !full)
+ return true;
+
+ dirty = ring_buffer_nr_dirty_pages(buffer, cpu);
+
+ return (dirty * 100) > (full * nr_pages);
+}
+
/*
* rb_wake_up_waiters - wake up tasks waiting for ring buffer input
*
@@ -912,22 +927,20 @@ int ring_buffer_wait(struct trace_buffer
!ring_buffer_empty_cpu(buffer, cpu)) {
unsigned long flags;
bool pagebusy;
- size_t nr_pages;
- size_t dirty;
+ bool done;
if (!full)
break;
raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags);
pagebusy = cpu_buffer->reader_page == cpu_buffer->commit_page;
- nr_pages = cpu_buffer->nr_pages;
- dirty = ring_buffer_nr_dirty_pages(buffer, cpu);
+ done = !pagebusy && full_hit(buffer, cpu, full);
+
if (!cpu_buffer->shortest_full ||
cpu_buffer->shortest_full > full)
cpu_buffer->shortest_full = full;
raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
- if (!pagebusy &&
- (!nr_pages || (dirty * 100) > full * nr_pages))
+ if (done)
break;
}
@@ -953,6 +966,7 @@ int ring_buffer_wait(struct trace_buffer
* @cpu: the cpu buffer to wait on
* @filp: the file descriptor
* @poll_table: The poll descriptor
+ * @full: wait until the percentage of pages are available, if @cpu != RING_BUFFER_ALL_CPUS
*
* If @cpu == RING_BUFFER_ALL_CPUS then the task will wake up as soon
* as data is added to any of the @buffer's cpu buffers. Otherwise
@@ -962,14 +976,15 @@ int ring_buffer_wait(struct trace_buffer
* zero otherwise.
*/
__poll_t ring_buffer_poll_wait(struct trace_buffer *buffer, int cpu,
- struct file *filp, poll_table *poll_table)
+ struct file *filp, poll_table *poll_table, int full)
{
struct ring_buffer_per_cpu *cpu_buffer;
struct rb_irq_work *work;
- if (cpu == RING_BUFFER_ALL_CPUS)
+ if (cpu == RING_BUFFER_ALL_CPUS) {
work = &buffer->irq_work;
- else {
+ full = 0;
+ } else {
if (!cpumask_test_cpu(cpu, buffer->cpumask))
return -EINVAL;
@@ -977,8 +992,14 @@ __poll_t ring_buffer_poll_wait(struct tr
work = &cpu_buffer->irq_work;
}
- poll_wait(filp, &work->waiters, poll_table);
- work->waiters_pending = true;
+ if (full) {
+ poll_wait(filp, &work->full_waiters, poll_table);
+ work->full_waiters_pending = true;
+ } else {
+ poll_wait(filp, &work->waiters, poll_table);
+ work->waiters_pending = true;
+ }
+
/*
* There's a tight race between setting the waiters_pending and
* checking if the ring buffer is empty. Once the waiters_pending bit
@@ -994,6 +1015,9 @@ __poll_t ring_buffer_poll_wait(struct tr
*/
smp_mb();
+ if (full)
+ return full_hit(buffer, cpu, full) ? EPOLLIN | EPOLLRDNORM : 0;
+
if ((cpu == RING_BUFFER_ALL_CPUS && !ring_buffer_empty(buffer)) ||
(cpu != RING_BUFFER_ALL_CPUS && !ring_buffer_empty_cpu(buffer, cpu)))
return EPOLLIN | EPOLLRDNORM;
@@ -3033,10 +3057,6 @@ static void rb_commit(struct ring_buffer
static __always_inline void
rb_wakeups(struct trace_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer)
{
- size_t nr_pages;
- size_t dirty;
- size_t full;
-
if (buffer->irq_work.waiters_pending) {
buffer->irq_work.waiters_pending = false;
/* irq_work_queue() supplies it's own memory barriers */
@@ -3060,10 +3080,7 @@ rb_wakeups(struct trace_buffer *buffer,
cpu_buffer->last_pages_touch = local_read(&cpu_buffer->pages_touched);
- full = cpu_buffer->shortest_full;
- nr_pages = cpu_buffer->nr_pages;
- dirty = ring_buffer_nr_dirty_pages(buffer, cpu_buffer->cpu);
- if (full && nr_pages && (dirty * 100) <= full * nr_pages)
+ if (!full_hit(buffer, cpu_buffer->cpu, cpu_buffer->shortest_full))
return;
cpu_buffer->irq_work.wakeup_full = true;
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6263,7 +6263,7 @@ trace_poll(struct trace_iterator *iter,
return EPOLLIN | EPOLLRDNORM;
else
return ring_buffer_poll_wait(iter->array_buffer->buffer, iter->cpu_file,
- filp, poll_table);
+ filp, poll_table, iter->tr->buffer_percent);
}
static __poll_t
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 087/149] tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 086/149] tracing/ring-buffer: Have polling block on watermark Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 088/149] tracing: Fix wild-memory-access in register_synth_event() Greg Kroah-Hartman
` (68 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, mhiramat, zanussi, fengguang.wu,
Shang XiaoJing, Steven Rostedt (Google)
From: Shang XiaoJing <shangxiaojing@huawei.com>
commit a4527fef9afe5c903c718d0cd24609fe9c754250 upstream.
test_gen_synth_cmd() only free buf in fail path, hence buf will leak
when there is no failure. Add kfree(buf) to prevent the memleak. The
same reason and solution in test_empty_synth_event().
unreferenced object 0xffff8881127de000 (size 2048):
comm "modprobe", pid 247, jiffies 4294972316 (age 78.756s)
hex dump (first 32 bytes):
20 67 65 6e 5f 73 79 6e 74 68 5f 74 65 73 74 20 gen_synth_test
20 70 69 64 5f 74 20 6e 65 78 74 5f 70 69 64 5f pid_t next_pid_
backtrace:
[<000000004254801a>] kmalloc_trace+0x26/0x100
[<0000000039eb1cf5>] 0xffffffffa00083cd
[<000000000e8c3bc8>] 0xffffffffa00086ba
[<00000000c293d1ea>] do_one_initcall+0xdb/0x480
[<00000000aa189e6d>] do_init_module+0x1cf/0x680
[<00000000d513222b>] load_module+0x6a50/0x70a0
[<000000001fd4d529>] __do_sys_finit_module+0x12f/0x1c0
[<00000000b36c4c0f>] do_syscall_64+0x3f/0x90
[<00000000bbf20cf3>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
unreferenced object 0xffff8881127df000 (size 2048):
comm "modprobe", pid 247, jiffies 4294972324 (age 78.728s)
hex dump (first 32 bytes):
20 65 6d 70 74 79 5f 73 79 6e 74 68 5f 74 65 73 empty_synth_tes
74 20 20 70 69 64 5f 74 20 6e 65 78 74 5f 70 69 t pid_t next_pi
backtrace:
[<000000004254801a>] kmalloc_trace+0x26/0x100
[<00000000d4db9a3d>] 0xffffffffa0008071
[<00000000c31354a5>] 0xffffffffa00086ce
[<00000000c293d1ea>] do_one_initcall+0xdb/0x480
[<00000000aa189e6d>] do_init_module+0x1cf/0x680
[<00000000d513222b>] load_module+0x6a50/0x70a0
[<000000001fd4d529>] __do_sys_finit_module+0x12f/0x1c0
[<00000000b36c4c0f>] do_syscall_64+0x3f/0x90
[<00000000bbf20cf3>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
Link: https://lkml.kernel.org/r/20221117012346.22647-2-shangxiaojing@huawei.com
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Cc: stable@vger.kernel.org
Fixes: 9fe41efaca08 ("tracing: Add synth event generation test module")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/synth_event_gen_test.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
--- a/kernel/trace/synth_event_gen_test.c
+++ b/kernel/trace/synth_event_gen_test.c
@@ -120,15 +120,13 @@ static int __init test_gen_synth_cmd(voi
/* Now generate a gen_synth_test event */
ret = synth_event_trace_array(gen_synth_test, vals, ARRAY_SIZE(vals));
- out:
+ free:
+ kfree(buf);
return ret;
delete:
/* We got an error after creating the event, delete it */
synth_event_delete("gen_synth_test");
- free:
- kfree(buf);
-
- goto out;
+ goto free;
}
/*
@@ -227,15 +225,13 @@ static int __init test_empty_synth_event
/* Now trace an empty_synth_test event */
ret = synth_event_trace_array(empty_synth_test, vals, ARRAY_SIZE(vals));
- out:
+ free:
+ kfree(buf);
return ret;
delete:
/* We got an error after creating the event, delete it */
synth_event_delete("empty_synth_test");
- free:
- kfree(buf);
-
- goto out;
+ goto free;
}
static struct synth_field_desc create_synth_test_fields[] = {
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 088/149] tracing: Fix wild-memory-access in register_synth_event()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 087/149] tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 089/149] tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit() Greg Kroah-Hartman
` (67 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shang XiaoJing, mhiramat, zanussi,
fengguang.wu, Steven Rostedt (Google)
From: Shang XiaoJing <shangxiaojing@huawei.com>
commit 1b5f1c34d3f5a664a57a5a7557a50e4e3cc2505c upstream.
In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.
register_synth_event
set_synth_event_print_fmt failed
trace_remove_event_call
event_remove
if call->event.funcs then
__unregister_trace_event (first call)
unregister_trace_event
__unregister_trace_event (second call)
Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.
general protection fault, probably for non-canonical address
0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 #299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS: 00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__create_synth_event+0x1e37/0x1eb0
create_or_delete_synth_event+0x110/0x250
synth_event_run_command+0x2f/0x110
test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
do_one_initcall+0xdb/0x480
do_init_module+0x1cf/0x680
load_module+0x6a50/0x70a0
__do_sys_finit_module+0x12f/0x1c0
do_syscall_64+0x3f/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com
Fixes: 4b147936fa50 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_synth.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -791,10 +791,9 @@ static int register_synth_event(struct s
}
ret = set_synth_event_print_fmt(call);
- if (ret < 0) {
+ /* unregister_trace_event() will be called inside */
+ if (ret < 0)
trace_remove_event_call(call);
- goto err;
- }
out:
return ret;
err:
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 089/149] tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 088/149] tracing: Fix wild-memory-access in register_synth_event() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 090/149] tracing: kprobe: Fix potential null-ptr-deref on trace_array " Greg Kroah-Hartman
` (66 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shang XiaoJing,
Masami Hiramatsu (Google)
From: Shang XiaoJing <shangxiaojing@huawei.com>
commit e0d75267f59d7084e0468bd68beeb1bf9c71d7c0 upstream.
When trace_get_event_file() failed, gen_kretprobe_test will be assigned
as the error code. If module kprobe_event_gen_test is removed now, the
null pointer dereference will happen in kprobe_event_gen_test_exit().
Check if gen_kprobe_test or gen_kretprobe_test is error code or NULL
before dereference them.
BUG: kernel NULL pointer dereference, address: 0000000000000012
PGD 0 P4D 0
Oops: 0000 [#1] SMP PTI
CPU: 3 PID: 2210 Comm: modprobe Not tainted
6.1.0-rc1-00171-g2159299a3b74-dirty #217
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:kprobe_event_gen_test_exit+0x1c/0xb5 [kprobe_event_gen_test]
Code: Unable to access opcode bytes at 0xffffffff9ffffff2.
RSP: 0018:ffffc900015bfeb8 EFLAGS: 00010246
RAX: ffffffffffffffea RBX: ffffffffa0002080 RCX: 0000000000000000
RDX: ffffffffa0001054 RSI: ffffffffa0001064 RDI: ffffffffdfc6349c
RBP: ffffffffa0000000 R08: 0000000000000004 R09: 00000000001e95c0
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000800
R13: ffffffffa0002420 R14: 0000000000000000 R15: 0000000000000000
FS: 00007f56b75be540(0000) GS:ffff88813bc00000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffff9ffffff2 CR3: 000000010874a006 CR4: 0000000000330ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__x64_sys_delete_module+0x206/0x380
? lockdep_hardirqs_on_prepare+0xd8/0x190
? syscall_enter_from_user_mode+0x1c/0x50
do_syscall_64+0x3f/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Link: https://lore.kernel.org/all/20221108015130.28326-2-shangxiaojing@huawei.com/
Fixes: 64836248dda2 ("tracing: Add kprobe event command generation test module")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/kprobe_event_gen_test.c | 44 ++++++++++++++++++++++-------------
1 file changed, 28 insertions(+), 16 deletions(-)
--- a/kernel/trace/kprobe_event_gen_test.c
+++ b/kernel/trace/kprobe_event_gen_test.c
@@ -73,6 +73,10 @@ static struct trace_event_file *gen_kret
#define KPROBE_GEN_TEST_ARG3 NULL
#endif
+static bool trace_event_file_is_valid(struct trace_event_file *input)
+{
+ return input && !IS_ERR(input);
+}
/*
* Test to make sure we can create a kprobe event, then add more
@@ -217,10 +221,12 @@ static int __init kprobe_event_gen_test_
ret = test_gen_kretprobe_cmd();
if (ret) {
- WARN_ON(trace_array_set_clr_event(gen_kretprobe_test->tr,
- "kprobes",
- "gen_kretprobe_test", false));
- trace_put_event_file(gen_kretprobe_test);
+ if (trace_event_file_is_valid(gen_kretprobe_test)) {
+ WARN_ON(trace_array_set_clr_event(gen_kretprobe_test->tr,
+ "kprobes",
+ "gen_kretprobe_test", false));
+ trace_put_event_file(gen_kretprobe_test);
+ }
WARN_ON(kprobe_event_delete("gen_kretprobe_test"));
}
@@ -229,24 +235,30 @@ static int __init kprobe_event_gen_test_
static void __exit kprobe_event_gen_test_exit(void)
{
- /* Disable the event or you can't remove it */
- WARN_ON(trace_array_set_clr_event(gen_kprobe_test->tr,
- "kprobes",
- "gen_kprobe_test", false));
+ if (trace_event_file_is_valid(gen_kprobe_test)) {
+ /* Disable the event or you can't remove it */
+ WARN_ON(trace_array_set_clr_event(gen_kprobe_test->tr,
+ "kprobes",
+ "gen_kprobe_test", false));
+
+ /* Now give the file and instance back */
+ trace_put_event_file(gen_kprobe_test);
+ }
- /* Now give the file and instance back */
- trace_put_event_file(gen_kprobe_test);
/* Now unregister and free the event */
WARN_ON(kprobe_event_delete("gen_kprobe_test"));
- /* Disable the event or you can't remove it */
- WARN_ON(trace_array_set_clr_event(gen_kretprobe_test->tr,
- "kprobes",
- "gen_kretprobe_test", false));
+ if (trace_event_file_is_valid(gen_kretprobe_test)) {
+ /* Disable the event or you can't remove it */
+ WARN_ON(trace_array_set_clr_event(gen_kretprobe_test->tr,
+ "kprobes",
+ "gen_kretprobe_test", false));
+
+ /* Now give the file and instance back */
+ trace_put_event_file(gen_kretprobe_test);
+ }
- /* Now give the file and instance back */
- trace_put_event_file(gen_kretprobe_test);
/* Now unregister and free the event */
WARN_ON(kprobe_event_delete("gen_kretprobe_test"));
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 090/149] tracing: kprobe: Fix potential null-ptr-deref on trace_array in kprobe_event_gen_test_exit()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 089/149] tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 091/149] ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open() Greg Kroah-Hartman
` (65 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shang XiaoJing,
Masami Hiramatsu (Google)
From: Shang XiaoJing <shangxiaojing@huawei.com>
commit 22ea4ca9631eb137e64e5ab899e9c89cb6670959 upstream.
When test_gen_kprobe_cmd() failed after kprobe_event_gen_cmd_end(), it
will goto delete, which will call kprobe_event_delete() and release the
corresponding resource. However, the trace_array in gen_kretprobe_test
will point to the invalid resource. Set gen_kretprobe_test to NULL
after called kprobe_event_delete() to prevent null-ptr-deref.
BUG: kernel NULL pointer dereference, address: 0000000000000070
PGD 0 P4D 0
Oops: 0000 [#1] SMP PTI
CPU: 0 PID: 246 Comm: modprobe Tainted: G W
6.1.0-rc1-00174-g9522dc5c87da-dirty #248
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:__ftrace_set_clr_event_nolock+0x53/0x1b0
Code: e8 82 26 fc ff 49 8b 1e c7 44 24 0c ea ff ff ff 49 39 de 0f 84 3c
01 00 00 c7 44 24 18 00 00 00 00 e8 61 26 fc ff 48 8b 6b 10 <44> 8b 65
70 4c 8b 6d 18 41 f7 c4 00 02 00 00 75 2f
RSP: 0018:ffffc9000159fe00 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88810971d268 RCX: 0000000000000000
RDX: ffff8881080be600 RSI: ffffffff811b48ff RDI: ffff88810971d058
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001
R10: ffffc9000159fe58 R11: 0000000000000001 R12: ffffffffa0001064
R13: ffffffffa000106c R14: ffff88810971d238 R15: 0000000000000000
FS: 00007f89eeff6540(0000) GS:ffff88813b600000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000070 CR3: 000000010599e004 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__ftrace_set_clr_event+0x3e/0x60
trace_array_set_clr_event+0x35/0x50
? 0xffffffffa0000000
kprobe_event_gen_test_exit+0xcd/0x10b [kprobe_event_gen_test]
__x64_sys_delete_module+0x206/0x380
? lockdep_hardirqs_on_prepare+0xd8/0x190
? syscall_enter_from_user_mode+0x1c/0x50
do_syscall_64+0x3f/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f89eeb061b7
Link: https://lore.kernel.org/all/20221108015130.28326-3-shangxiaojing@huawei.com/
Fixes: 64836248dda2 ("tracing: Add kprobe event command generation test module")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/kprobe_event_gen_test.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/kernel/trace/kprobe_event_gen_test.c
+++ b/kernel/trace/kprobe_event_gen_test.c
@@ -143,6 +143,8 @@ static int __init test_gen_kprobe_cmd(vo
kfree(buf);
return ret;
delete:
+ if (trace_event_file_is_valid(gen_kprobe_test))
+ gen_kprobe_test = NULL;
/* We got an error after creating the event, delete it */
ret = kprobe_event_delete("gen_kprobe_test");
goto out;
@@ -206,6 +208,8 @@ static int __init test_gen_kretprobe_cmd
kfree(buf);
return ret;
delete:
+ if (trace_event_file_is_valid(gen_kretprobe_test))
+ gen_kretprobe_test = NULL;
/* We got an error after creating the event, delete it */
ret = kprobe_event_delete("gen_kretprobe_test");
goto out;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 091/149] ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 090/149] tracing: kprobe: Fix potential null-ptr-deref on trace_array " Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 092/149] ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro Greg Kroah-Hartman
` (64 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+9abda841d636d86c41da,
Takashi Iwai
From: Takashi Iwai <tiwai@suse.de>
commit ad72c3c3f6eb81d2cb189ec71e888316adada5df upstream.
snd_usbmidi_output_open() has a check of the NULL port with
snd_BUG_ON(). snd_BUG_ON() was used as this shouldn't have happened,
but in reality, the NULL port may be seen when the device gives an
invalid endpoint setup at the descriptor, hence the driver skips the
allocation. That is, the check itself is valid and snd_BUG_ON()
should be dropped from there. Otherwise it's confusing as if it were
a real bug, as recently syzbot stumbled on it.
Reported-by: syzbot+9abda841d636d86c41da@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/syzbot+9abda841d636d86c41da@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20221112141223.6144-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/midi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1149,10 +1149,8 @@ static int snd_usbmidi_output_open(struc
port = &umidi->endpoints[i].out->ports[j];
break;
}
- if (!port) {
- snd_BUG();
+ if (!port)
return -ENXIO;
- }
substream->runtime->private_data = port;
port->state = STATE_UNKNOWN;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 092/149] ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 091/149] ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 093/149] ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360 Greg Kroah-Hartman
` (63 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Emil Flink, Takashi Iwai
From: Emil Flink <emil.flink@gmail.com>
commit b18a456330e1c1ca207b57b45872f10336741388 upstream.
The Samsung Galaxy Book Pro seems to have the same issue as a few
other Samsung laptops, detailed in kernel bug report 207423. Sound from
headphone jack works, but not the built-in speakers.
alsa-info: http://alsa-project.org/db/?f=b40ba609dc6ae28dc84ad404a0d8a4bbcd8bea6d
Signed-off-by: Emil Flink <emil.flink@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221115144500.7782-1-emil.flink@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/patch_realtek.c | 1 +
1 file changed, 1 insertion(+)
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9007,6 +9007,7 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
+ SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 093/149] ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 092/149] ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 094/149] Revert "usb: dwc3: disable USB core PHY management" Greg Kroah-Hartman
` (62 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai
From: Takashi Iwai <tiwai@suse.de>
commit 1abfd71ee8f3ed99c5d0df5d9843a360541d6808 upstream.
Samsung Galaxy Book Pro 360 (13" 2021 NP930QBD-ke1US) with codec SSID
144d:c1a6 requires the same workaround for enabling the speaker amp
like other Samsung models with ALC298 codec.
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1205100
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221115170235.18875-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/patch_realtek.c | 1 +
1 file changed, 1 insertion(+)
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9008,6 +9008,7 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
+ SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 094/149] Revert "usb: dwc3: disable USB core PHY management"
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 093/149] ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360 Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 095/149] slimbus: stream: correct presence rate frequencies Greg Kroah-Hartman
` (61 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefan Agner, Johan Hovold,
Marek Szyprowski, Thinh Nguyen
From: Johan Hovold <johan+linaro@kernel.org>
commit 5c294de36e7fb3e0cba0c4e1ef9a5f57bc080d0f upstream.
This reverts commit 6000b8d900cd5f52fbcd0776d0cc396e88c8c2ea.
The offending commit disabled the USB core PHY management as the dwc3
already manages the PHYs in question.
Unfortunately some platforms have started relying on having USB core
also controlling the PHY and this is specifically currently needed on
some Exynos platforms for PHY calibration or connected device may fail
to enumerate.
The PHY calibration was previously handled in the dwc3 driver, but to
work around some issues related to how the dwc3 driver interacts with
xhci (e.g. using multiple drivers) this was moved to USB core by commits
34c7ed72f4f0 ("usb: core: phy: add support for PHY calibration") and
a0a465569b45 ("usb: dwc3: remove generic PHY calibrate() calls").
The same PHY obviously should not be controlled from two different
places, which for example do no agree on the PHY mode or power state
during suspend, but as the offending patch was backported to stable,
let's revert it for now.
Reported-by: Stefan Agner <stefan@agner.ch>
Link: https://lore.kernel.org/lkml/808bdba846bb60456adf10a3016911ee@agner.ch/
Fixes: 6000b8d900cd ("usb: dwc3: disable USB core PHY management")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20221103144648.14197-1-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/host.c | 10 ----------
1 file changed, 10 deletions(-)
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -10,13 +10,8 @@
#include <linux/acpi.h>
#include <linux/platform_device.h>
-#include "../host/xhci-plat.h"
#include "core.h"
-static const struct xhci_plat_priv dwc3_xhci_plat_priv = {
- .quirks = XHCI_SKIP_PHY_INIT,
-};
-
static int dwc3_host_get_irq(struct dwc3 *dwc)
{
struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
@@ -92,11 +87,6 @@ int dwc3_host_init(struct dwc3 *dwc)
goto err;
}
- ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv,
- sizeof(dwc3_xhci_plat_priv));
- if (ret)
- goto err;
-
memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
if (dwc->usb3_lpm_capable)
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 095/149] slimbus: stream: correct presence rate frequencies
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 094/149] Revert "usb: dwc3: disable USB core PHY management" Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 096/149] speakup: fix a segfault caused by switching consoles Greg Kroah-Hartman
` (60 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
commit b9c1939627f8185dec8ba6d741e9573a4c7a5834 upstream.
Correct few frequencies in presence rate table - multiplied by 10
(110250 instead of 11025 Hz).
Fixes: abb9c9b8b51b ("slimbus: stream: add stream support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220929165202.410937-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/slimbus/stream.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/slimbus/stream.c
+++ b/drivers/slimbus/stream.c
@@ -67,10 +67,10 @@ static const int slim_presence_rate_tabl
384000,
768000,
0, /* Reserved */
- 110250,
- 220500,
- 441000,
- 882000,
+ 11025,
+ 22050,
+ 44100,
+ 88200,
176400,
352800,
705600,
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 096/149] speakup: fix a segfault caused by switching consoles
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 095/149] slimbus: stream: correct presence rate frequencies Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 097/149] USB: bcma: Make GPIO explicitly optional Greg Kroah-Hartman
` (59 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Mushahid Hussain,
Samuel Thibault
From: Mushahid Hussain <mushi.shar@gmail.com>
commit 0fc801f8018000c8e64a275a20cb1da7c54e46df upstream.
This patch fixes a segfault by adding a null check on synth in
speakup_con_update(). The segfault can be reproduced as follows:
- Login into a text console
- Load speakup and speakup_soft modules
- Remove speakup_soft
- Switch to a graphics console
This is caused by lack of a null check on `synth` in
speakup_con_update().
Here's the sequence that causes the segfault:
- When we remove the speakup_soft, synth_release() sets the synth
to null.
- After that, when we change the virtual console to graphics
console, vt_notifier_call() is fired, which then calls
speakup_con_update().
- Inside speakup_con_update() there's no null check on synth,
so it calls synth_printf().
- Inside synth_printf(), synth_buffer_add() and synth_start(),
both access synth, when it is null and causing a segfault.
Therefore adding a null check on synth solves the issue.
Fixes: 2610df41489f ("staging: speakup: Add pause command used on switching to graphical mode")
Cc: stable <stable@kernel.org>
Signed-off-by: Mushahid Hussain <mushi.shar@gmail.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://lore.kernel.org/r/20221010165720.397042-1-mushi.shar@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/accessibility/speakup/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/accessibility/speakup/main.c
+++ b/drivers/accessibility/speakup/main.c
@@ -1780,7 +1780,7 @@ static void speakup_con_update(struct vc
{
unsigned long flags;
- if (!speakup_console[vc->vc_num] || spk_parked)
+ if (!speakup_console[vc->vc_num] || spk_parked || !synth)
return;
if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
/* Speakup output, discard */
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 097/149] USB: bcma: Make GPIO explicitly optional
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 096/149] speakup: fix a segfault caused by switching consoles Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 098/149] USB: serial: option: add Sierra Wireless EM9191 Greg Kroah-Hartman
` (58 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafał Miłecki,
Chuhong Yuan, Linus Walleij, stable
From: Linus Walleij <linus.walleij@linaro.org>
commit cd136706b4f925aa5d316642543babac90d45910 upstream.
What the code does is to not check the return value from
devm_gpiod_get() and then avoid using an erroneous GPIO descriptor
with IS_ERR_OR_NULL().
This will miss real errors from the GPIO core that should not be
ignored, such as probe deferral.
Instead request the GPIO as explicitly optional, which means that
if it doesn't exist, the descriptor returned will be NULL.
Then we can add error handling and also avoid just doing this on
the device tree path, and simplify the site where the optional
GPIO descriptor is used.
There were some problems with cleaning up this GPIO descriptor
use in the past, but this is the proper way to deal with it.
Cc: Rafał Miłecki <rafal@milecki.pl>
Cc: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/20221107090753.1404679-1-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/bcma-hcd.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/drivers/usb/host/bcma-hcd.c
+++ b/drivers/usb/host/bcma-hcd.c
@@ -285,7 +285,7 @@ static void bcma_hci_platform_power_gpio
{
struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev);
- if (IS_ERR_OR_NULL(usb_dev->gpio_desc))
+ if (!usb_dev->gpio_desc)
return;
gpiod_set_value(usb_dev->gpio_desc, val);
@@ -406,9 +406,11 @@ static int bcma_hcd_probe(struct bcma_de
return -ENOMEM;
usb_dev->core = core;
- if (core->dev.of_node)
- usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
- GPIOD_OUT_HIGH);
+ usb_dev->gpio_desc = devm_gpiod_get_optional(&core->dev, "vcc",
+ GPIOD_OUT_HIGH);
+ if (IS_ERR(usb_dev->gpio_desc))
+ return dev_err_probe(&core->dev, PTR_ERR(usb_dev->gpio_desc),
+ "error obtaining VCC GPIO");
switch (core->id.id) {
case BCMA_CORE_USB20_HOST:
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 098/149] USB: serial: option: add Sierra Wireless EM9191
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 097/149] USB: bcma: Make GPIO explicitly optional Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 099/149] USB: serial: option: remove old LARA-R6 PID Greg Kroah-Hartman
` (57 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Benoît Monin, Johan Hovold
From: Benoît Monin <benoit.monin@gmx.fr>
commit df3414b0a245f43476061fddd78cee7d6cff797f upstream.
Add support for the AT and diag ports, similar to other qualcomm SDX55
modems. In QDL mode, the modem uses a different device ID and support
is provided by qcserial in commit 11c52d250b34 ("USB: serial: qcserial:
add EM9191 QDL support").
T: Bus=08 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0
D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1
P: Vendor=1199 ProdID=90d3 Rev=00.06
S: Manufacturer=Sierra Wireless, Incorporated
S: Product=Sierra Wireless EM9191
S: SerialNumber=xxxxxxxxxxxxxxxx
C: #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=896mA
I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
I: If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=(none)
Signed-off-by: Benoît Monin <benoit.monin@gmx.fr>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/option.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -581,6 +581,9 @@ static void option_instat_callback(struc
#define OPPO_VENDOR_ID 0x22d9
#define OPPO_PRODUCT_R11 0x276c
+/* Sierra Wireless products */
+#define SIERRA_VENDOR_ID 0x1199
+#define SIERRA_PRODUCT_EM9191 0x90d3
/* Device flags */
@@ -2176,6 +2179,8 @@ static const struct usb_device_id option
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
{ USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) },
+ { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x30) },
+ { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, option_ids);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 099/149] USB: serial: option: remove old LARA-R6 PID
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 098/149] USB: serial: option: add Sierra Wireless EM9191 Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 100/149] USB: serial: option: add u-blox LARA-R6 00B modem Greg Kroah-Hartman
` (56 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Davide Tronchin, Johan Hovold
From: Davide Tronchin <davide.tronchin.94@gmail.com>
commit 2ec106b96afc19698ff934323b633c0729d4c7f8 upstream.
Remove the UBLOX_PRODUCT_R6XX 0x90fa association since LARA-R6 00B final
product uses a new USB composition with different PID. 0x90fa PID used
only by LARA-R6 internal prototypes.
Move 0x90fa PID directly in the option_ids array since used by other
Qualcomm based modem vendors as pointed out in:
https://lore.kernel.org/all/6572c4e6-d8bc-b8d3-4396-d879e4e76338@gmail.com
Signed-off-by: Davide Tronchin <davide.tronchin.94@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/option.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -240,7 +240,6 @@ static void option_instat_callback(struc
#define QUECTEL_PRODUCT_UC15 0x9090
/* These u-blox products use Qualcomm's vendor ID */
#define UBLOX_PRODUCT_R410M 0x90b2
-#define UBLOX_PRODUCT_R6XX 0x90fa
/* These Yuga products use Qualcomm's vendor ID */
#define YUGA_PRODUCT_CLM920_NC5 0x9625
@@ -1127,7 +1126,7 @@ static const struct usb_device_id option
/* u-blox products using Qualcomm vendor ID */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),
.driver_info = RSVD(1) | RSVD(3) },
- { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R6XX),
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x90fa),
.driver_info = RSVD(3) },
/* Quectel products using Quectel vendor ID */
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff),
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 100/149] USB: serial: option: add u-blox LARA-R6 00B modem
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (98 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 099/149] USB: serial: option: remove old LARA-R6 PID Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 101/149] USB: serial: option: add u-blox LARA-L6 modem Greg Kroah-Hartman
` (55 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Davide Tronchin, Johan Hovold
From: Davide Tronchin <davide.tronchin.94@gmail.com>
commit d9e37a5c4d80ea25a7171ab8557a449115554e76 upstream.
The official LARA-R6 (00B) modem uses 0x908b PID. LARA-R6 00B does not
implement a QMI interface on port 4, the reservation (RSVD(4)) has been
added to meet other companies that implement QMI on that interface.
LARA-R6 00B USB composition exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parser/alternative functions
Signed-off-by: Davide Tronchin <davide.tronchin.94@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/option.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1126,6 +1126,8 @@ static const struct usb_device_id option
/* u-blox products using Qualcomm vendor ID */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),
.driver_info = RSVD(1) | RSVD(3) },
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x908b), /* u-blox LARA-R6 00B */
+ .driver_info = RSVD(4) },
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x90fa),
.driver_info = RSVD(3) },
/* Quectel products using Quectel vendor ID */
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 101/149] USB: serial: option: add u-blox LARA-L6 modem
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (99 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 100/149] USB: serial: option: add u-blox LARA-R6 00B modem Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 102/149] USB: serial: option: add Fibocom FM160 0x0111 composition Greg Kroah-Hartman
` (54 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Davide Tronchin, Johan Hovold
From: Davide Tronchin <davide.tronchin.94@gmail.com>
commit c1547f12df8b8e9ca2686accee43213ecd117efe upstream.
Add LARA-L6 PIDs for three different USB compositions.
LARA-L6 module can be configured (by AT interface) in three different
USB modes:
* Default mode (Vendor ID: 0x1546 Product ID: 0x1341) with 4 serial
interfaces
* RmNet mode (Vendor ID: 0x1546 Product ID: 0x1342) with 4 serial
interfaces and 1 RmNet virtual network interface
* CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1343) with 4 serial
interface and 1 CDC-ECM virtual network interface
In default mode LARA-L6 exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parser/alternative functions
In RmNet mode LARA-L6 exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parset/alternative functions
If 4: RMNET interface
In CDC-ECM mode LARA-L6 exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parset/alternative functions
If 4: CDC-ECM interface
Signed-off-by: Davide Tronchin <davide.tronchin.94@gmail.com>
[ johan: drop PID defines in favour of comments ]
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/option.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -162,6 +162,8 @@ static void option_instat_callback(struc
#define NOVATELWIRELESS_PRODUCT_G2 0xA010
#define NOVATELWIRELESS_PRODUCT_MC551 0xB001
+#define UBLOX_VENDOR_ID 0x1546
+
/* AMOI PRODUCTS */
#define AMOI_VENDOR_ID 0x1614
#define AMOI_PRODUCT_H01 0x0800
@@ -1130,6 +1132,12 @@ static const struct usb_device_id option
.driver_info = RSVD(4) },
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x90fa),
.driver_info = RSVD(3) },
+ /* u-blox products */
+ { USB_DEVICE(UBLOX_VENDOR_ID, 0x1341) }, /* u-blox LARA-L6 */
+ { USB_DEVICE(UBLOX_VENDOR_ID, 0x1342), /* u-blox LARA-L6 (RMNET) */
+ .driver_info = RSVD(4) },
+ { USB_DEVICE(UBLOX_VENDOR_ID, 0x1343), /* u-blox LARA-L6 (ECM) */
+ .driver_info = RSVD(4) },
/* Quectel products using Quectel vendor ID */
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff),
.driver_info = NUMEP2 },
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 102/149] USB: serial: option: add Fibocom FM160 0x0111 composition
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (100 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 101/149] USB: serial: option: add u-blox LARA-L6 modem Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 103/149] usb: add NO_LPM quirk for Realforce 87U Keyboard Greg Kroah-Hartman
` (53 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Reinhard Speyerer, Johan Hovold
From: Reinhard Speyerer <rspmn@arcor.de>
commit 148f4b32b4504d8a32cf82049b7b9499a4b299ab upstream.
Add support for the following Fibocom FM160 composition:
0x0111: MBIM + MODEM + DIAG + AT
T: Bus=01 Lev=02 Prnt=125 Port=01 Cnt=02 Dev#= 93 Spd=480 MxCh= 0
D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=2cb7 ProdID=0111 Rev= 5.04
S: Manufacturer=Fibocom
S: Product=Fibocom FM160 Modem_SN:12345678
S: SerialNumber=12345678
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms
I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
Signed-off-by: Reinhard Speyerer <rspmn@arcor.de>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/option.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -2179,6 +2179,7 @@ static const struct usb_device_id option
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x010a, 0xff) }, /* Fibocom MA510 (ECM mode) */
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
+ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 103/149] usb: add NO_LPM quirk for Realforce 87U Keyboard
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (101 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 102/149] USB: serial: option: add Fibocom FM160 0x0111 composition Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 104/149] usb: chipidea: fix deadlock in ci_otg_del_timer Greg Kroah-Hartman
` (52 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Nicolas Dumazet
From: Nicolas Dumazet <ndumazet@google.com>
commit 181135bb20dcb184edd89817831b888eb8132741 upstream.
Before adding this quirk, this (mechanical keyboard) device would not be
recognized, logging:
new full-speed USB device number 56 using xhci_hcd
unable to read config index 0 descriptor/start: -32
chopping to 0 config(s)
It would take dozens of plugging/unpuggling cycles for the keyboard to
be recognized. Keyboard seems to simply work after applying this quirk.
This issue had been reported by users in two places already ([1], [2])
but nobody tried upstreaming a patch yet. After testing I believe their
suggested fix (DELAY_INIT + NO_LPM + DEVICE_QUALIFIER) was probably a
little overkill. I assume this particular combination was tested because
it had been previously suggested in [3], but only NO_LPM seems
sufficient for this device.
[1]: https://qiita.com/float168/items/fed43d540c8e2201b543
[2]: https://blog.kostic.dev/posts/making-the-realforce-87ub-work-with-usb30-on-Ubuntu/
[3]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1678477
Cc: stable@vger.kernel.org
Signed-off-by: Nicolas Dumazet <ndumazet@google.com>
Link: https://lore.kernel.org/r/20221109122946.706036-1-ndumazet@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/core/quirks.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -362,6 +362,9 @@ static const struct usb_device_id usb_qu
{ USB_DEVICE(0x0781, 0x5583), .driver_info = USB_QUIRK_NO_LPM },
{ USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM },
+ /* Realforce 87U Keyboard */
+ { USB_DEVICE(0x0853, 0x011b), .driver_info = USB_QUIRK_NO_LPM },
+
/* M-Systems Flash Disk Pioneers */
{ USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 104/149] usb: chipidea: fix deadlock in ci_otg_del_timer
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (102 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 103/149] usb: add NO_LPM quirk for Realforce 87U Keyboard Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 105/149] usb: typec: mux: Enter safe mode only when pins need to be reconfigured Greg Kroah-Hartman
` (51 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Duoming Zhou
From: Duoming Zhou <duoming@zju.edu.cn>
commit 7a58b8d6021426b796eebfae80983374d9a80a75 upstream.
There is a deadlock in ci_otg_del_timer(), the process is
shown below:
(thread 1) | (thread 2)
ci_otg_del_timer() | ci_otg_hrtimer_func()
... |
spin_lock_irqsave() //(1) | ...
... |
hrtimer_cancel() | spin_lock_irqsave() //(2)
(block forever)
We hold ci->lock in position (1) and use hrtimer_cancel() to
wait ci_otg_hrtimer_func() to stop, but ci_otg_hrtimer_func()
also need ci->lock in position (2). As a result, the
hrtimer_cancel() in ci_otg_del_timer() will be blocked forever.
This patch extracts hrtimer_cancel() from the protection of
spin_lock_irqsave() in order that the ci_otg_hrtimer_func()
could obtain the ci->lock.
What`s more, there will be no race happen. Because the
"next_timer" is always under the protection of
spin_lock_irqsave() and we only check whether "next_timer"
equals to NUM_OTG_FSM_TIMERS in the following code.
Fixes: 3a316ec4c91c ("usb: chipidea: use hrtimer for otg fsm timers")
Cc: stable <stable@kernel.org>
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20220918033312.94348-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/chipidea/otg_fsm.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -256,8 +256,10 @@ static void ci_otg_del_timer(struct ci_h
ci->enabled_otg_timer_bits &= ~(1 << t);
if (ci->next_otg_timer == t) {
if (ci->enabled_otg_timer_bits == 0) {
+ spin_unlock_irqrestore(&ci->lock, flags);
/* No enabled timers after delete it */
hrtimer_cancel(&ci->otg_fsm_hrtimer);
+ spin_lock_irqsave(&ci->lock, flags);
ci->next_otg_timer = NUM_OTG_FSM_TIMERS;
} else {
/* Find the next timer */
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 105/149] usb: typec: mux: Enter safe mode only when pins need to be reconfigured
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (103 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 104/149] usb: chipidea: fix deadlock in ci_otg_del_timer Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 106/149] iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger() Greg Kroah-Hartman
` (50 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Rajat Khandelwal,
Lee Shawn C, Heikki Krogerus
From: Rajat Khandelwal <rajat.khandelwal@linux.intel.com>
commit 40bf8f162d0f95e0716e479d7db41443d931765c upstream.
There is no point to enter safe mode during DP/TBT configuration
if the DP/TBT was already configured in mux. This is because safe
mode is only applicable when there is a need to reconfigure the
pins in order to avoid damage within/to port partner.
In some chrome systems, IOM/mux is already configured before OS
comes up. Thus, when driver is probed, it blindly enters safe
mode due to PD negotiations but only after gfx driver lowers
dp_phy_ownership, will the IOM complete safe mode and send an
ack to PMC.
Since, that never happens, we see IPC timeout.
Hence, allow safe mode only when pin reconfiguration is not
required, which makes sense.
Fixes: 43d596e32276 ("usb: typec: intel_pmc_mux: Check the port status before connect")
Cc: stable <stable@kernel.org>
Signed-off-by: Rajat Khandelwal <rajat.khandelwal@linux.intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20221024171611.181468-1-rajat.khandelwal@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/mux/intel_pmc_mux.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -339,13 +339,24 @@ pmc_usb_mux_usb4(struct pmc_usb_port *po
return pmc_usb_command(port, (void *)&req, sizeof(req));
}
-static int pmc_usb_mux_safe_state(struct pmc_usb_port *port)
+static int pmc_usb_mux_safe_state(struct pmc_usb_port *port,
+ struct typec_mux_state *state)
{
u8 msg;
if (IOM_PORT_ACTIVITY_IS(port->iom_status, SAFE_MODE))
return 0;
+ if ((IOM_PORT_ACTIVITY_IS(port->iom_status, DP) ||
+ IOM_PORT_ACTIVITY_IS(port->iom_status, DP_MFD)) &&
+ state->alt && state->alt->svid == USB_TYPEC_DP_SID)
+ return 0;
+
+ if ((IOM_PORT_ACTIVITY_IS(port->iom_status, TBT) ||
+ IOM_PORT_ACTIVITY_IS(port->iom_status, ALT_MODE_TBT_USB)) &&
+ state->alt && state->alt->svid == USB_TYPEC_TBT_SID)
+ return 0;
+
msg = PMC_USB_SAFE_MODE;
msg |= port->usb3_port << PMC_USB_MSG_USB3_PORT_SHIFT;
@@ -413,7 +424,7 @@ pmc_usb_mux_set(struct typec_mux *mux, s
return 0;
if (state->mode == TYPEC_STATE_SAFE)
- return pmc_usb_mux_safe_state(port);
+ return pmc_usb_mux_safe_state(port, state);
if (state->mode == TYPEC_STATE_USB)
return pmc_usb_connect(port, port->role);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 106/149] iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (104 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 105/149] usb: typec: mux: Enter safe mode only when pins need to be reconfigured Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 107/149] iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init() Greg Kroah-Hartman
` (49 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Stable,
Jonathan Cameron
From: Yang Yingliang <yangyingliang@huawei.com>
commit 65f20301607d07ee279b0804d11a05a62a6c1a1c upstream.
If iio_trigger_register() returns error, it should call iio_trigger_free()
to give up the reference that hold in iio_trigger_alloc(), so that it can
call iio_trig_release() to free memory when the refcount hit to 0.
Fixes: 0e589d5fb317 ("ARM: AT91: IIO: Add AT91 ADC driver.")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221024084511.815096-1-yangyingliang@huawei.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/adc/at91_adc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -616,8 +616,10 @@ static struct iio_trigger *at91_adc_allo
trig->ops = &at91_adc_trigger_ops;
ret = iio_trigger_register(trig);
- if (ret)
+ if (ret) {
+ iio_trigger_free(trig);
return NULL;
+ }
return trig;
}
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 107/149] iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (105 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 106/149] iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 108/149] iio: adc: mp2629: fix wrong comparison of channel Greg Kroah-Hartman
` (48 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Stable,
Jonathan Cameron
From: Yang Yingliang <yangyingliang@huawei.com>
commit efa17e90e1711bdb084e3954fa44afb6647331c0 upstream.
dev_set_name() allocates memory for name, it need be freed
when device_add() fails, call put_device() to give up the
reference that hold in device_initialize(), so that it can
be freed in kobject_cleanup() when the refcount hit to 0.
Fault injection test can trigger this:
unreferenced object 0xffff8e8340a7b4c0 (size 32):
comm "modprobe", pid 243, jiffies 4294678145 (age 48.845s)
hex dump (first 32 bytes):
69 69 6f 5f 73 79 73 66 73 5f 74 72 69 67 67 65 iio_sysfs_trigge
72 00 a7 40 83 8e ff ff 00 86 13 c4 f6 ee ff ff r..@............
backtrace:
[<0000000074999de8>] __kmem_cache_alloc_node+0x1e9/0x360
[<00000000497fd30b>] __kmalloc_node_track_caller+0x44/0x1a0
[<000000003636c520>] kstrdup+0x2d/0x60
[<0000000032f84da2>] kobject_set_name_vargs+0x1e/0x90
[<0000000092efe493>] dev_set_name+0x4e/0x70
Fixes: 1f785681a870 ("staging:iio:trigger sysfs userspace trigger rework.")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221022074212.1386424-1-yangyingliang@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/trigger/iio-trig-sysfs.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/iio/trigger/iio-trig-sysfs.c
+++ b/drivers/iio/trigger/iio-trig-sysfs.c
@@ -209,9 +209,13 @@ static int iio_sysfs_trigger_remove(int
static int __init iio_sysfs_trig_init(void)
{
+ int ret;
device_initialize(&iio_sysfs_trig_dev);
dev_set_name(&iio_sysfs_trig_dev, "iio_sysfs_trigger");
- return device_add(&iio_sysfs_trig_dev);
+ ret = device_add(&iio_sysfs_trig_dev);
+ if (ret)
+ put_device(&iio_sysfs_trig_dev);
+ return ret;
}
module_init(iio_sysfs_trig_init);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 108/149] iio: adc: mp2629: fix wrong comparison of channel
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (106 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 107/149] iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 109/149] iio: adc: mp2629: fix potential array out of bound access Greg Kroah-Hartman
` (47 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Saravanan Sekar, Andy Shevchenko,
Stable, Jonathan Cameron
From: Saravanan Sekar <sravanhome@gmail.com>
commit 1eb20332a082fa801fb89c347c5e62de916a4001 upstream.
Input voltage channel enum is compared against iio address instead
of the channel.
Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver")
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20221029093000.45451-2-sravanhome@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/adc/mp2629_adc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/adc/mp2629_adc.c
+++ b/drivers/iio/adc/mp2629_adc.c
@@ -73,7 +73,7 @@ static int mp2629_read_raw(struct iio_de
if (ret)
return ret;
- if (chan->address == MP2629_INPUT_VOLT)
+ if (chan->channel == MP2629_INPUT_VOLT)
rval &= GENMASK(6, 0);
*val = rval;
return IIO_VAL_INT;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 109/149] iio: adc: mp2629: fix potential array out of bound access
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (107 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 108/149] iio: adc: mp2629: fix wrong comparison of channel Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 110/149] iio: pressure: ms5611: changed hardcoded SPI speed to value limited Greg Kroah-Hartman
` (46 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Saravanan Sekar, Stable,
Jonathan Cameron
From: Saravanan Sekar <sravanhome@gmail.com>
commit ca1547ab15f48dc81624183ae17a2fd1bad06dfc upstream.
Add sentinel at end of maps to avoid potential array out of
bound access in iio core.
Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver")
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Link: https://lore.kernel.org/r/20221029093000.45451-4-sravanhome@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/adc/mp2629_adc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/iio/adc/mp2629_adc.c
+++ b/drivers/iio/adc/mp2629_adc.c
@@ -56,7 +56,8 @@ static struct iio_map mp2629_adc_maps[]
MP2629_MAP(SYSTEM_VOLT, "system-volt"),
MP2629_MAP(INPUT_VOLT, "input-volt"),
MP2629_MAP(BATT_CURRENT, "batt-current"),
- MP2629_MAP(INPUT_CURRENT, "input-current")
+ MP2629_MAP(INPUT_CURRENT, "input-current"),
+ { }
};
static int mp2629_read_raw(struct iio_dev *indio_dev,
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 110/149] iio: pressure: ms5611: changed hardcoded SPI speed to value limited
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (108 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 109/149] iio: adc: mp2629: fix potential array out of bound access Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 111/149] dm ioctl: fix misbehavior if list_versions races with module loading Greg Kroah-Hartman
` (45 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mitja Spes, Stable, Jonathan Cameron
From: Mitja Spes <mitja@lxnav.com>
commit 741cec30cc52058d1c10d415f3b98319887e4f73 upstream.
Don't hardcode the ms5611 SPI speed, limit it instead.
Signed-off-by: Mitja Spes <mitja@lxnav.com>
Fixes: c0644160a8b5 ("iio: pressure: add support for MS5611 pressure and temperature sensor")
Link: https://lore.kernel.org/r/20221021135827.1444793-3-mitja@lxnav.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/pressure/ms5611_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/pressure/ms5611_spi.c
+++ b/drivers/iio/pressure/ms5611_spi.c
@@ -94,7 +94,7 @@ static int ms5611_spi_probe(struct spi_d
spi_set_drvdata(spi, indio_dev);
spi->mode = SPI_MODE_0;
- spi->max_speed_hz = 20000000;
+ spi->max_speed_hz = min(spi->max_speed_hz, 20000000U);
spi->bits_per_word = 8;
ret = spi_setup(spi);
if (ret < 0)
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 111/149] dm ioctl: fix misbehavior if list_versions races with module loading
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (109 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 110/149] iio: pressure: ms5611: changed hardcoded SPI speed to value limited Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 112/149] serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs Greg Kroah-Hartman
` (44 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka, Mike Snitzer
From: Mikulas Patocka <mpatocka@redhat.com>
commit 4fe1ec995483737f3d2a14c3fe1d8fe634972979 upstream.
__list_versions will first estimate the required space using the
"dm_target_iterate(list_version_get_needed, &needed)" call and then will
fill the space using the "dm_target_iterate(list_version_get_info,
&iter_info)" call. Each of these calls locks the targets using the
"down_read(&_lock)" and "up_read(&_lock)" calls, however between the first
and second "dm_target_iterate" there is no lock held and the target
modules can be loaded at this point, so the second "dm_target_iterate"
call may need more space than what was the first "dm_target_iterate"
returned.
The code tries to handle this overflow (see the beginning of
list_version_get_info), however this handling is incorrect.
The code sets "param->data_size = param->data_start + needed" and
"iter_info.end = (char *)vers+len" - "needed" is the size returned by the
first dm_target_iterate call; "len" is the size of the buffer allocated by
userspace.
"len" may be greater than "needed"; in this case, the code will write up
to "len" bytes into the buffer, however param->data_size is set to
"needed", so it may write data past the param->data_size value. The ioctl
interface copies only up to param->data_size into userspace, thus part of
the result will be truncated.
Fix this bug by setting "iter_info.end = (char *)vers + needed;" - this
guarantees that the second "dm_target_iterate" call will write only up to
the "needed" buffer and it will exit with "DM_BUFFER_FULL_FLAG" if it
overflows the "needed" space - in this case, userspace will allocate a
larger buffer and retry.
Note that there is also a bug in list_version_get_needed - we need to add
"strlen(tt->name) + 1" to the needed size, not "strlen(tt->name)".
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -573,7 +573,7 @@ static void list_version_get_needed(stru
size_t *needed = needed_param;
*needed += sizeof(struct dm_target_versions);
- *needed += strlen(tt->name);
+ *needed += strlen(tt->name) + 1;
*needed += ALIGN_MASK;
}
@@ -638,7 +638,7 @@ static int __list_versions(struct dm_ioc
iter_info.old_vers = NULL;
iter_info.vers = vers;
iter_info.flags = 0;
- iter_info.end = (char *)vers+len;
+ iter_info.end = (char *)vers + needed;
/*
* Now loop through filling out the names & versions.
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 112/149] serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (110 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 111/149] dm ioctl: fix misbehavior if list_versions races with module loading Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 113/149] serial: 8250: Flush DMA Rx on RLSI Greg Kroah-Hartman
` (43 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Srikanth Thokala, Aman Kumar,
Ilpo Järvinen, Andy Shevchenko
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
commit a931237cbea256aff13bb403da13a97b2d1605d9 upstream.
DW UART sometimes triggers IIR_RDI during DMA Rx when IIR_RX_TIMEOUT
should have been triggered instead. Since IIR_RDI has higher priority
than IIR_RX_TIMEOUT, this causes the Rx to hang into interrupt loop.
The problem seems to occur at least with some combinations of
small-sized transfers (I've reproduced the problem on Elkhart Lake PSE
UARTs).
If there's already an on-going Rx DMA and IIR_RDI triggers, fall
graciously back to non-DMA Rx. That is, behave as if IIR_RX_TIMEOUT had
occurred.
8250_omap already considers IIR_RDI similar to this change so its
nothing unheard of.
Fixes: 75df022b5f89 ("serial: 8250_dma: Fix RX handling")
Cc: <stable@vger.kernel.org>
Co-developed-by: Srikanth Thokala <srikanth.thokala@intel.com>
Signed-off-by: Srikanth Thokala <srikanth.thokala@intel.com>
Co-developed-by: Aman Kumar <aman.kumar@intel.com>
Signed-off-by: Aman Kumar <aman.kumar@intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221108121952.5497-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_port.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1869,6 +1869,10 @@ EXPORT_SYMBOL_GPL(serial8250_modem_statu
static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)
{
switch (iir & 0x3f) {
+ case UART_IIR_RDI:
+ if (!up->dma->rx_running)
+ break;
+ fallthrough;
case UART_IIR_RX_TIMEOUT:
serial8250_rx_dma_flush(up);
fallthrough;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 113/149] serial: 8250: Flush DMA Rx on RLSI
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (111 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 112/149] serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 114/149] serial: 8250_lpss: Configure DMA also w/o DMA filter Greg Kroah-Hartman
` (42 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ilpo Järvinen, Andy Shevchenko
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
commit 1980860e0c8299316cddaf0992dd9e1258ec9d88 upstream.
Returning true from handle_rx_dma() without flushing DMA first creates
a data ordering hazard. If DMA Rx has handled any character at the
point when RLSI occurs, the non-DMA path handles any pending characters
jumping them ahead of those characters that are pending under DMA.
Fixes: 75df022b5f89 ("serial: 8250_dma: Fix RX handling")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221108121952.5497-5-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_port.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1873,10 +1873,9 @@ static bool handle_rx_dma(struct uart_82
if (!up->dma->rx_running)
break;
fallthrough;
+ case UART_IIR_RLSI:
case UART_IIR_RX_TIMEOUT:
serial8250_rx_dma_flush(up);
- fallthrough;
- case UART_IIR_RLSI:
return true;
}
return up->dma->rx_dma(up);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 114/149] serial: 8250_lpss: Configure DMA also w/o DMA filter
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (112 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 113/149] serial: 8250: Flush DMA Rx on RLSI Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 115/149] Input: iforce - invert valid length check when fetching device IDs Greg Kroah-Hartman
` (41 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Ilpo Järvinen,
Andy Shevchenko
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
commit 1bfcbe5805d0cfc83c3544dcd01e0a282c1f6790 upstream.
If the platform doesn't use DMA device filter (as is the case with
Elkhart Lake), whole lpss8250_dma_setup() setup is skipped. This
results in skipping also *_maxburst setup which is undesirable.
Refactor lpss8250_dma_setup() to configure DMA even if filter is not
setup.
Cc: stable <stable@kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221108121952.5497-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_lpss.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/drivers/tty/serial/8250/8250_lpss.c
+++ b/drivers/tty/serial/8250/8250_lpss.c
@@ -268,8 +268,13 @@ static int lpss8250_dma_setup(struct lps
struct dw_dma_slave *rx_param, *tx_param;
struct device *dev = port->port.dev;
- if (!lpss->dma_param.dma_dev)
+ if (!lpss->dma_param.dma_dev) {
+ dma = port->dma;
+ if (dma)
+ goto out_configuration_only;
+
return 0;
+ }
rx_param = devm_kzalloc(dev, sizeof(*rx_param), GFP_KERNEL);
if (!rx_param)
@@ -280,16 +285,18 @@ static int lpss8250_dma_setup(struct lps
return -ENOMEM;
*rx_param = lpss->dma_param;
- dma->rxconf.src_maxburst = lpss->dma_maxburst;
-
*tx_param = lpss->dma_param;
- dma->txconf.dst_maxburst = lpss->dma_maxburst;
dma->fn = lpss8250_dma_filter;
dma->rx_param = rx_param;
dma->tx_param = tx_param;
port->dma = dma;
+
+out_configuration_only:
+ dma->rxconf.src_maxburst = lpss->dma_maxburst;
+ dma->txconf.dst_maxburst = lpss->dma_maxburst;
+
return 0;
}
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 115/149] Input: iforce - invert valid length check when fetching device IDs
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (113 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 114/149] serial: 8250_lpss: Configure DMA also w/o DMA filter Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 116/149] maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault() Greg Kroah-Hartman
` (40 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, syzbot, Tetsuo Handa,
Dmitry Torokhov
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
commit b8ebf250997c5fb253582f42bfe98673801ebebd upstream.
syzbot is reporting uninitialized value at iforce_init_device() [1], for
commit 6ac0aec6b0a6 ("Input: iforce - allow callers supply data buffer
when fetching device IDs") is checking that valid length is shorter than
bytes to read. Since iforce_get_id_packet() stores valid length when
returning 0, the caller needs to check that valid length is longer than or
equals to bytes to read.
Reported-by: syzbot <syzbot+4dd880c1184280378821@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 6ac0aec6b0a6 ("Input: iforce - allow callers supply data buffer when fetching device IDs")
Link: https://lore.kernel.org/r/531fb432-7396-ad37-ecba-3e42e7f56d5c@I-love.SAKURA.ne.jp
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/joystick/iforce/iforce-main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/input/joystick/iforce/iforce-main.c
+++ b/drivers/input/joystick/iforce/iforce-main.c
@@ -273,22 +273,22 @@ int iforce_init_device(struct device *pa
* Get device info.
*/
- if (!iforce_get_id_packet(iforce, 'M', buf, &len) || len < 3)
+ if (!iforce_get_id_packet(iforce, 'M', buf, &len) && len >= 3)
input_dev->id.vendor = get_unaligned_le16(buf + 1);
else
dev_warn(&iforce->dev->dev, "Device does not respond to id packet M\n");
- if (!iforce_get_id_packet(iforce, 'P', buf, &len) || len < 3)
+ if (!iforce_get_id_packet(iforce, 'P', buf, &len) && len >= 3)
input_dev->id.product = get_unaligned_le16(buf + 1);
else
dev_warn(&iforce->dev->dev, "Device does not respond to id packet P\n");
- if (!iforce_get_id_packet(iforce, 'B', buf, &len) || len < 3)
+ if (!iforce_get_id_packet(iforce, 'B', buf, &len) && len >= 3)
iforce->device_memory.end = get_unaligned_le16(buf + 1);
else
dev_warn(&iforce->dev->dev, "Device does not respond to id packet B\n");
- if (!iforce_get_id_packet(iforce, 'N', buf, &len) || len < 2)
+ if (!iforce_get_id_packet(iforce, 'N', buf, &len) && len >= 2)
ff_effects = buf[1];
else
dev_warn(&iforce->dev->dev, "Device does not respond to id packet N\n");
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 116/149] maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (114 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 115/149] Input: iforce - invert valid length check when fetching device IDs Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 117/149] scsi: zfcp: Fix double free of FSF request when qdio send fails Greg Kroah-Hartman
` (39 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alban Crequy, Andrii Nakryiko,
Francis Laniel, Andrew Morton
From: Alban Crequy <albancrequy@linux.microsoft.com>
commit 8678ea06852cd1f819b870c773d43df888d15d46 upstream.
If a page fault occurs while copying the first byte, this function resets one
byte before dst.
As a consequence, an address could be modified and leaded to kernel crashes if
case the modified address was accessed later.
Fixes: b58294ead14c ("maccess: allow architectures to provide kernel probing directly")
Signed-off-by: Alban Crequy <albancrequy@linux.microsoft.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Francis Laniel <flaniel@linux.microsoft.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org> [5.8]
Link: https://lore.kernel.org/bpf/20221110085614.111213-2-albancrequy@linux.microsoft.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/maccess.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/maccess.c
+++ b/mm/maccess.c
@@ -83,7 +83,7 @@ long strncpy_from_kernel_nofault(char *d
return src - unsafe_addr;
Efault:
pagefault_enable();
- dst[-1] = '\0';
+ dst[0] = '\0';
return -EFAULT;
}
#else /* HAVE_GET_KERNEL_NOFAULT */
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 117/149] scsi: zfcp: Fix double free of FSF request when qdio send fails
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (115 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 116/149] maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 118/149] iommu/vt-d: Set SRE bit only when hardware has SRS cap Greg Kroah-Hartman
` (38 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Benjamin Block, Steffen Maier,
Martin K. Petersen
From: Benjamin Block <bblock@linux.ibm.com>
commit 0954256e970ecf371b03a6c9af2cf91b9c4085ff upstream.
We used to use the wrong type of integer in 'zfcp_fsf_req_send()' to cache
the FSF request ID when sending a new FSF request. This is used in case the
sending fails and we need to remove the request from our internal hash
table again (so we don't keep an invalid reference and use it when we free
the request again).
In 'zfcp_fsf_req_send()' we used to cache the ID as 'int' (signed and 32
bit wide), but the rest of the zfcp code (and the firmware specification)
handles the ID as 'unsigned long'/'u64' (unsigned and 64 bit wide [s390x
ELF ABI]). For one this has the obvious problem that when the ID grows
past 32 bit (this can happen reasonably fast) it is truncated to 32 bit
when storing it in the cache variable and so doesn't match the original ID
anymore. The second less obvious problem is that even when the original ID
has not yet grown past 32 bit, as soon as the 32nd bit is set in the
original ID (0x80000000 = 2'147'483'648) we will have a mismatch when we
cast it back to 'unsigned long'. As the cached variable is of a signed
type, the compiler will choose a sign-extending instruction to load the 32
bit variable into a 64 bit register (e.g.: 'lgf %r11,188(%r15)'). So once
we pass the cached variable into 'zfcp_reqlist_find_rm()' to remove the
request again all the leading zeros will be flipped to ones to extend the
sign and won't match the original ID anymore (this has been observed in
practice).
If we can't successfully remove the request from the hash table again after
'zfcp_qdio_send()' fails (this happens regularly when zfcp cannot notify
the adapter about new work because the adapter is already gone during
e.g. a ChpID toggle) we will end up with a double free. We unconditionally
free the request in the calling function when 'zfcp_fsf_req_send()' fails,
but because the request is still in the hash table we end up with a stale
memory reference, and once the zfcp adapter is either reset during recovery
or shutdown we end up freeing the same memory twice.
The resulting stack traces vary depending on the kernel and have no direct
correlation to the place where the bug occurs. Here are three examples that
have been seen in practice:
list_del corruption. next->prev should be 00000001b9d13800, but was 00000000dead4ead. (next=00000001bd131a00)
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:62!
monitor event: 0040 ilc:2 [#1] PREEMPT SMP
Modules linked in: ...
CPU: 9 PID: 1617 Comm: zfcperp0.0.1740 Kdump: loaded
Hardware name: ...
Krnl PSW : 0704d00180000000 00000003cbeea1f8 (__list_del_entry_valid+0x98/0x140)
R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3
Krnl GPRS: 00000000916d12f1 0000000080000000 000000000000006d 00000003cb665cd6
0000000000000001 0000000000000000 0000000000000000 00000000d28d21e8
00000000d3844000 00000380099efd28 00000001bd131a00 00000001b9d13800
00000000d3290100 0000000000000000 00000003cbeea1f4 00000380099efc70
Krnl Code: 00000003cbeea1e8: c020004f68a7 larl %r2,00000003cc8d7336
00000003cbeea1ee: c0e50027fd65 brasl %r14,00000003cc3e9cb8
#00000003cbeea1f4: af000000 mc 0,0
>00000003cbeea1f8: c02000920440 larl %r2,00000003cd12aa78
00000003cbeea1fe: c0e500289c25 brasl %r14,00000003cc3fda48
00000003cbeea204: b9040043 lgr %r4,%r3
00000003cbeea208: b9040051 lgr %r5,%r1
00000003cbeea20c: b9040032 lgr %r3,%r2
Call Trace:
[<00000003cbeea1f8>] __list_del_entry_valid+0x98/0x140
([<00000003cbeea1f4>] __list_del_entry_valid+0x94/0x140)
[<000003ff7ff502fe>] zfcp_fsf_req_dismiss_all+0xde/0x150 [zfcp]
[<000003ff7ff49cd0>] zfcp_erp_strategy_do_action+0x160/0x280 [zfcp]
[<000003ff7ff4a22e>] zfcp_erp_strategy+0x21e/0xca0 [zfcp]
[<000003ff7ff4ad34>] zfcp_erp_thread+0x84/0x1a0 [zfcp]
[<00000003cb5eece8>] kthread+0x138/0x150
[<00000003cb557f3c>] __ret_from_fork+0x3c/0x60
[<00000003cc4172ea>] ret_from_fork+0xa/0x40
INFO: lockdep is turned off.
Last Breaking-Event-Address:
[<00000003cc3e9d04>] _printk+0x4c/0x58
Kernel panic - not syncing: Fatal exception: panic_on_oops
or:
Unable to handle kernel pointer dereference in virtual kernel address space
Failing address: 6b6b6b6b6b6b6000 TEID: 6b6b6b6b6b6b6803
Fault in home space mode while using kernel ASCE.
AS:0000000063b10007 R3:0000000000000024
Oops: 0038 ilc:3 [#1] SMP
Modules linked in: ...
CPU: 10 PID: 0 Comm: swapper/10 Kdump: loaded
Hardware name: ...
Krnl PSW : 0404d00180000000 000003ff7febaf8e (zfcp_fsf_reqid_check+0x86/0x158 [zfcp])
R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3
Krnl GPRS: 5a6f1cfa89c49ac3 00000000aff2c4c8 6b6b6b6b6b6b6b6b 00000000000002a8
0000000000000000 0000000000000055 0000000000000000 00000000a8515800
0700000000000000 00000000a6e14500 00000000aff2c000 000000008003c44c
000000008093c700 0000000000000010 00000380009ebba8 00000380009ebb48
Krnl Code: 000003ff7febaf7e: a7f4003d brc 15,000003ff7febaff8
000003ff7febaf82: e32020000004 lg %r2,0(%r2)
#000003ff7febaf88: ec2100388064 cgrj %r2,%r1,8,000003ff7febaff8
>000003ff7febaf8e: e3b020100020 cg %r11,16(%r2)
000003ff7febaf94: a774fff7 brc 7,000003ff7febaf82
000003ff7febaf98: ec280030007c cgij %r2,0,8,000003ff7febaff8
000003ff7febaf9e: e31020080004 lg %r1,8(%r2)
000003ff7febafa4: e33020000004 lg %r3,0(%r2)
Call Trace:
[<000003ff7febaf8e>] zfcp_fsf_reqid_check+0x86/0x158 [zfcp]
[<000003ff7febbdbc>] zfcp_qdio_int_resp+0x6c/0x170 [zfcp]
[<000003ff7febbf90>] zfcp_qdio_irq_tasklet+0xd0/0x108 [zfcp]
[<0000000061d90a04>] tasklet_action_common.constprop.0+0xdc/0x128
[<000000006292f300>] __do_softirq+0x130/0x3c0
[<0000000061d906c6>] irq_exit_rcu+0xfe/0x118
[<000000006291e818>] do_io_irq+0xc8/0x168
[<000000006292d516>] io_int_handler+0xd6/0x110
[<000000006292d596>] psw_idle_exit+0x0/0xa
([<0000000061d3be50>] arch_cpu_idle+0x40/0xd0)
[<000000006292ceea>] default_idle_call+0x52/0xf8
[<0000000061de4fa4>] do_idle+0xd4/0x168
[<0000000061de51fe>] cpu_startup_entry+0x36/0x40
[<0000000061d4faac>] smp_start_secondary+0x12c/0x138
[<000000006292d88e>] restart_int_handler+0x6e/0x90
Last Breaking-Event-Address:
[<000003ff7febaf94>] zfcp_fsf_reqid_check+0x8c/0x158 [zfcp]
Kernel panic - not syncing: Fatal exception in interrupt
or:
Unable to handle kernel pointer dereference in virtual kernel address space
Failing address: 523b05d3ae76a000 TEID: 523b05d3ae76a803
Fault in home space mode while using kernel ASCE.
AS:0000000077c40007 R3:0000000000000024
Oops: 0038 ilc:3 [#1] SMP
Modules linked in: ...
CPU: 3 PID: 453 Comm: kworker/3:1H Kdump: loaded
Hardware name: ...
Workqueue: kblockd blk_mq_run_work_fn
Krnl PSW : 0404d00180000000 0000000076fc0312 (__kmalloc+0xd2/0x398)
R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3
Krnl GPRS: ffffffffffffffff 523b05d3ae76abf6 0000000000000000 0000000000092a20
0000000000000002 00000007e49b5cc0 00000007eda8f000 0000000000092a20
00000007eda8f000 00000003b02856b9 00000000000000a8 523b05d3ae76abf6
00000007dd662000 00000007eda8f000 0000000076fc02b2 000003e0037637a0
Krnl Code: 0000000076fc0302: c004000000d4 brcl 0,76fc04aa
0000000076fc0308: b904001b lgr %r1,%r11
#0000000076fc030c: e3106020001a algf %r1,32(%r6)
>0000000076fc0312: e31010000082 xg %r1,0(%r1)
0000000076fc0318: b9040001 lgr %r0,%r1
0000000076fc031c: e30061700082 xg %r0,368(%r6)
0000000076fc0322: ec59000100d9 aghik %r5,%r9,1
0000000076fc0328: e34003b80004 lg %r4,952
Call Trace:
[<0000000076fc0312>] __kmalloc+0xd2/0x398
[<0000000076f318f2>] mempool_alloc+0x72/0x1f8
[<000003ff8027c5f8>] zfcp_fsf_req_create.isra.7+0x40/0x268 [zfcp]
[<000003ff8027f1bc>] zfcp_fsf_fcp_cmnd+0xac/0x3f0 [zfcp]
[<000003ff80280f1a>] zfcp_scsi_queuecommand+0x122/0x1d0 [zfcp]
[<000003ff800b4218>] scsi_queue_rq+0x778/0xa10 [scsi_mod]
[<00000000771782a0>] __blk_mq_try_issue_directly+0x130/0x208
[<000000007717a124>] blk_mq_request_issue_directly+0x4c/0xa8
[<000003ff801302e2>] dm_mq_queue_rq+0x2ea/0x468 [dm_mod]
[<0000000077178c12>] blk_mq_dispatch_rq_list+0x33a/0x818
[<000000007717f064>] __blk_mq_do_dispatch_sched+0x284/0x2f0
[<000000007717f44c>] __blk_mq_sched_dispatch_requests+0x1c4/0x218
[<000000007717fa7a>] blk_mq_sched_dispatch_requests+0x52/0x90
[<0000000077176d74>] __blk_mq_run_hw_queue+0x9c/0xc0
[<0000000076da6d74>] process_one_work+0x274/0x4d0
[<0000000076da7018>] worker_thread+0x48/0x560
[<0000000076daef18>] kthread+0x140/0x160
[<000000007751d144>] ret_from_fork+0x28/0x30
Last Breaking-Event-Address:
[<0000000076fc0474>] __kmalloc+0x234/0x398
Kernel panic - not syncing: Fatal exception: panic_on_oops
To fix this, simply change the type of the cache variable to 'unsigned
long', like the rest of zfcp and also the argument for
'zfcp_reqlist_find_rm()'. This prevents truncation and wrong sign extension
and so can successfully remove the request from the hash table.
Fixes: e60a6d69f1f8 ("[SCSI] zfcp: Remove function zfcp_reqlist_find_safe")
Cc: <stable@vger.kernel.org> #v2.6.34+
Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Link: https://lore.kernel.org/r/979f6e6019d15f91ba56182f1aaf68d61bf37fc6.1668595505.git.bblock@linux.ibm.com
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/scsi/zfcp_fsf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -866,7 +866,7 @@ static int zfcp_fsf_req_send(struct zfcp
const bool is_srb = zfcp_fsf_req_is_status_read_buffer(req);
struct zfcp_adapter *adapter = req->adapter;
struct zfcp_qdio *qdio = adapter->qdio;
- int req_id = req->req_id;
+ unsigned long req_id = req->req_id;
zfcp_reqlist_add(adapter->req_list, req);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 118/149] iommu/vt-d: Set SRE bit only when hardware has SRS cap
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (116 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 117/149] scsi: zfcp: Fix double free of FSF request when qdio send fails Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 119/149] firmware: coreboot: Register bus in module init Greg Kroah-Hartman
` (37 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tina Zhang, Lu Baolu, Joerg Roedel
From: Tina Zhang <tina.zhang@intel.com>
commit 7fc961cf7ffcb130c4e93ee9a5628134f9de700a upstream.
SRS cap is the hardware cap telling if the hardware IOMMU can support
requests seeking supervisor privilege or not. SRE bit in scalable-mode
PASID table entry is treated as Reserved(0) for implementation not
supporting SRS cap.
Checking SRS cap before setting SRE bit can avoid the non-recoverable
fault of "Non-zero reserved field set in PASID Table Entry" caused by
setting SRE bit while there is no SRS cap support. The fault messages
look like below:
DMAR: DRHD: handling fault status reg 2
DMAR: [DMA Read NO_PASID] Request device [00:0d.0] fault addr 0x1154e1000
[fault reason 0x5a]
SM: Non-zero reserved field set in PASID Table Entry
Fixes: 6f7db75e1c46 ("iommu/vt-d: Add second level page table interface")
Cc: stable@vger.kernel.org
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
Link: https://lore.kernel.org/r/20221115070346.1112273-1-tina.zhang@intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20221116051544.26540-3-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iommu/intel/pasid.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/iommu/intel/pasid.c
+++ b/drivers/iommu/intel/pasid.c
@@ -669,7 +669,7 @@ int intel_pasid_setup_second_level(struc
* Since it is a second level only translation setup, we should
* set SRE bit as well (addresses are expected to be GPAs).
*/
- if (pasid != PASID_RID2PASID)
+ if (pasid != PASID_RID2PASID && ecap_srs(iommu->ecap))
pasid_set_sre(pte);
pasid_set_present(pte);
pasid_flush_caches(iommu, pte, pasid, did);
@@ -704,7 +704,8 @@ int intel_pasid_setup_pass_through(struc
* We should set SRE bit as well since the addresses are expected
* to be GPAs.
*/
- pasid_set_sre(pte);
+ if (ecap_srs(iommu->ecap))
+ pasid_set_sre(pte);
pasid_set_present(pte);
pasid_flush_caches(iommu, pte, pasid, did);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 119/149] firmware: coreboot: Register bus in module init
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (117 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 118/149] iommu/vt-d: Set SRE bit only when hardware has SRS cap Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 120/149] mmc: core: properly select voltage range without power cycle Greg Kroah-Hartman
` (36 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brian Norris, Guenter Roeck,
Stephen Boyd
From: Brian Norris <briannorris@chromium.org>
commit 65946690ed8d972fdb91a74ee75ac0f0f0d68321 upstream.
The coreboot_table driver registers a coreboot bus while probing a
"coreboot_table" device representing the coreboot table memory region.
Probing this device (i.e., registering the bus) is a dependency for the
module_init() functions of any driver for this bus (e.g.,
memconsole-coreboot.c / memconsole_driver_init()).
With synchronous probe, this dependency works OK, as the link order in
the Makefile ensures coreboot_table_driver_init() (and thus,
coreboot_table_probe()) completes before a coreboot device driver tries
to add itself to the bus.
With asynchronous probe, however, coreboot_table_probe() may race with
memconsole_driver_init(), and so we're liable to hit one of these two:
1. coreboot_driver_register() eventually hits "[...] the bus was not
initialized.", and the memconsole driver fails to register; or
2. coreboot_driver_register() gets past #1, but still races with
bus_register() and hits some other undefined/crashing behavior (e.g.,
in driver_find() [1])
We can resolve this by registering the bus in our initcall, and only
deferring "device" work (scanning the coreboot memory region and
creating sub-devices) to probe().
[1] Example failure, using 'driver_async_probe=*' kernel command line:
[ 0.114217] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
...
[ 0.114307] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc1 #63
[ 0.114316] Hardware name: Google Scarlet (DT)
...
[ 0.114488] Call trace:
[ 0.114494] _raw_spin_lock+0x34/0x60
[ 0.114502] kset_find_obj+0x28/0x84
[ 0.114511] driver_find+0x30/0x50
[ 0.114520] driver_register+0x64/0x10c
[ 0.114528] coreboot_driver_register+0x30/0x3c
[ 0.114540] memconsole_driver_init+0x24/0x30
[ 0.114550] do_one_initcall+0x154/0x2e0
[ 0.114560] do_initcall_level+0x134/0x160
[ 0.114571] do_initcalls+0x60/0xa0
[ 0.114579] do_basic_setup+0x28/0x34
[ 0.114588] kernel_init_freeable+0xf8/0x150
[ 0.114596] kernel_init+0x2c/0x12c
[ 0.114607] ret_from_fork+0x10/0x20
[ 0.114624] Code: 5280002b 1100054a b900092a f9800011 (885ffc01)
[ 0.114631] ---[ end trace 0000000000000000 ]---
Fixes: b81e3140e412 ("firmware: coreboot: Make bus registration symmetric")
Cc: <stable@vger.kernel.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20221019180934.1.If29e167d8a4771b0bf4a39c89c6946ed764817b9@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/firmware/google/coreboot_table.c | 37 ++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 8 deletions(-)
--- a/drivers/firmware/google/coreboot_table.c
+++ b/drivers/firmware/google/coreboot_table.c
@@ -152,12 +152,8 @@ static int coreboot_table_probe(struct p
if (!ptr)
return -ENOMEM;
- ret = bus_register(&coreboot_bus_type);
- if (!ret) {
- ret = coreboot_table_populate(dev, ptr);
- if (ret)
- bus_unregister(&coreboot_bus_type);
- }
+ ret = coreboot_table_populate(dev, ptr);
+
memunmap(ptr);
return ret;
@@ -172,7 +168,6 @@ static int __cb_dev_unregister(struct de
static int coreboot_table_remove(struct platform_device *pdev)
{
bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister);
- bus_unregister(&coreboot_bus_type);
return 0;
}
@@ -202,6 +197,32 @@ static struct platform_driver coreboot_t
.of_match_table = of_match_ptr(coreboot_of_match),
},
};
-module_platform_driver(coreboot_table_driver);
+
+static int __init coreboot_table_driver_init(void)
+{
+ int ret;
+
+ ret = bus_register(&coreboot_bus_type);
+ if (ret)
+ return ret;
+
+ ret = platform_driver_register(&coreboot_table_driver);
+ if (ret) {
+ bus_unregister(&coreboot_bus_type);
+ return ret;
+ }
+
+ return 0;
+}
+
+static void __exit coreboot_table_driver_exit(void)
+{
+ platform_driver_unregister(&coreboot_table_driver);
+ bus_unregister(&coreboot_bus_type);
+}
+
+module_init(coreboot_table_driver_init);
+module_exit(coreboot_table_driver_exit);
+
MODULE_AUTHOR("Google, Inc.");
MODULE_LICENSE("GPL");
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 120/149] mmc: core: properly select voltage range without power cycle
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (118 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 119/149] firmware: coreboot: Register bus in module init Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 121/149] mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout Greg Kroah-Hartman
` (35 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yann Gautier, Ulf Hansson
From: Yann Gautier <yann.gautier@foss.st.com>
commit 39a72dbfe188291b156dd6523511e3d5761ce775 upstream.
In mmc_select_voltage(), if there is no full power cycle, the voltage
range selected at the end of the function will be on a single range
(e.g. 3.3V/3.4V). To keep a range around the selected voltage (3.2V/3.4V),
the mask shift should be reduced by 1.
This issue was triggered by using a specific SD-card (Verbatim Premium
16GB UHS-1) on an STM32MP157C-DK2 board. This board cannot do UHS modes
and there is no power cycle. And the card was failing to switch to
high-speed mode. When adding the range 3.2V/3.3V for this card with the
proposed shift change, the card can switch to high-speed mode.
Fixes: ce69d37b7d8f ("mmc: core: Prevent violation of specs while initializing cards")
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221028073740.7259-1-yann.gautier@foss.st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/core/core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1128,7 +1128,13 @@ u32 mmc_select_voltage(struct mmc_host *
mmc_power_cycle(host, ocr);
} else {
bit = fls(ocr) - 1;
- ocr &= 3 << bit;
+ /*
+ * The bit variable represents the highest voltage bit set in
+ * the OCR register.
+ * To keep a range of 2 values (e.g. 3.2V/3.3V and 3.3V/3.4V),
+ * we must shift the mask '3' with (bit - 1).
+ */
+ ocr &= 3 << (bit - 1);
if (bit != host->ios.vdd)
dev_warn(mmc_dev(host), "exceeding card's volts\n");
}
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 121/149] mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (119 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 120/149] mmc: core: properly select voltage range without power cycle Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 122/149] mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() Greg Kroah-Hartman
` (34 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chevron Li, Ulf Hansson
From: Chevron Li <chevron.li@bayhubtech.com>
commit 096cc0cddf58232bded309336961784f1d1c85f8 upstream.
The SD card is recognized failed sometimes when resume from suspend.
Because CD# debounce time too long then card present report wrong.
Finally, card is recognized failed.
Signed-off-by: Chevron Li <chevron.li@bayhubtech.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221104095512.4068-1-chevron.li@bayhubtech.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/sdhci-pci-o2micro.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/mmc/host/sdhci-pci-o2micro.c
+++ b/drivers/mmc/host/sdhci-pci-o2micro.c
@@ -31,6 +31,7 @@
#define O2_SD_CAPS 0xE0
#define O2_SD_ADMA1 0xE2
#define O2_SD_ADMA2 0xE7
+#define O2_SD_MISC_CTRL2 0xF0
#define O2_SD_INF_MOD 0xF1
#define O2_SD_MISC_CTRL4 0xFC
#define O2_SD_MISC_CTRL 0x1C0
@@ -822,6 +823,12 @@ static int sdhci_pci_o2_probe(struct sdh
/* Set Tuning Windows to 5 */
pci_write_config_byte(chip->pdev,
O2_SD_TUNING_CTRL, 0x55);
+ //Adjust 1st and 2nd CD debounce time
+ pci_read_config_dword(chip->pdev, O2_SD_MISC_CTRL2, &scratch_32);
+ scratch_32 &= 0xFFE7FFFF;
+ scratch_32 |= 0x00180000;
+ pci_write_config_dword(chip->pdev, O2_SD_MISC_CTRL2, scratch_32);
+ pci_write_config_dword(chip->pdev, O2_SD_DETECT_SETTING, 1);
/* Lock WP */
ret = pci_read_config_byte(chip->pdev,
O2_SD_LOCK_WP, &scratch);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 122/149] mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (120 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 121/149] mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 123/149] docs: update mediator contact information in CoC doc Greg Kroah-Hartman
` (33 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xiongfeng Wang, Ulf Hansson
From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
commit 222cfa0118aa68687ace74aab8fdf77ce8fbd7e6 upstream.
pci_get_device() will increase the reference count for the returned
pci_dev. We need to use pci_dev_put() to decrease the reference count
before amd_probe() returns. There is no problem for the 'smbus_dev ==
NULL' branch because pci_dev_put() can also handle the NULL input
parameter case.
Fixes: 659c9bc114a8 ("mmc: sdhci-pci: Build o2micro support in the same module")
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221114083100.149200-1-wangxiongfeng2@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/sdhci-pci-core.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -1799,6 +1799,8 @@ static int amd_probe(struct sdhci_pci_ch
}
}
+ pci_dev_put(smbus_dev);
+
if (gen == AMD_CHIPSET_BEFORE_ML || gen == AMD_CHIPSET_CZ)
chip->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 123/149] docs: update mediator contact information in CoC doc
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (121 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 122/149] mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 124/149] misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() Greg Kroah-Hartman
` (32 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shuah Khan
From: Shuah Khan <skhan@linuxfoundation.org>
commit 5fddf8962b429b8303c4a654291ecb6e61a7d747 upstream.
Update mediator contact information in CoC interpretation document.
Cc: <stable@vger.kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20221011171417.34286-1-skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/process/code-of-conduct-interpretation.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/Documentation/process/code-of-conduct-interpretation.rst
+++ b/Documentation/process/code-of-conduct-interpretation.rst
@@ -51,7 +51,7 @@ the Technical Advisory Board (TAB) or ot
uncertain how to handle situations that come up. It will not be
considered a violation report unless you want it to be. If you are
uncertain about approaching the TAB or any other maintainers, please
-reach out to our conflict mediator, Joanna Lee <joanna.lee@gesmer.com>.
+reach out to our conflict mediator, Joanna Lee <jlee@linuxfoundation.org>.
In the end, "be kind to each other" is really what the end goal is for
everybody. We know everyone is human and we all fail at times, but the
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 124/149] misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (122 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 123/149] docs: update mediator contact information in CoC doc Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 125/149] perf/x86/intel/pt: Fix sampling using single range output Greg Kroah-Hartman
` (31 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+39be4da489ed2493ba25, stable,
Alexander Potapenko, Vishnu Dasa
From: Alexander Potapenko <glider@google.com>
commit e5b0d06d9b10f5f43101bd6598b076c347f9295f upstream.
`struct vmci_event_qp` allocated by qp_notify_peer() contains padding,
which may carry uninitialized data to the userspace, as observed by
KMSAN:
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user ./include/linux/instrumented.h:121
instrument_copy_to_user ./include/linux/instrumented.h:121
_copy_to_user+0x5f/0xb0 lib/usercopy.c:33
copy_to_user ./include/linux/uaccess.h:169
vmci_host_do_receive_datagram drivers/misc/vmw_vmci/vmci_host.c:431
vmci_host_unlocked_ioctl+0x33d/0x43d0 drivers/misc/vmw_vmci/vmci_host.c:925
vfs_ioctl fs/ioctl.c:51
...
Uninit was stored to memory at:
kmemdup+0x74/0xb0 mm/util.c:131
dg_dispatch_as_host drivers/misc/vmw_vmci/vmci_datagram.c:271
vmci_datagram_dispatch+0x4f8/0xfc0 drivers/misc/vmw_vmci/vmci_datagram.c:339
qp_notify_peer+0x19a/0x290 drivers/misc/vmw_vmci/vmci_queue_pair.c:1479
qp_broker_attach drivers/misc/vmw_vmci/vmci_queue_pair.c:1662
qp_broker_alloc+0x2977/0x2f30 drivers/misc/vmw_vmci/vmci_queue_pair.c:1750
vmci_qp_broker_alloc+0x96/0xd0 drivers/misc/vmw_vmci/vmci_queue_pair.c:1940
vmci_host_do_alloc_queuepair drivers/misc/vmw_vmci/vmci_host.c:488
vmci_host_unlocked_ioctl+0x24fd/0x43d0 drivers/misc/vmw_vmci/vmci_host.c:927
...
Local variable ev created at:
qp_notify_peer+0x54/0x290 drivers/misc/vmw_vmci/vmci_queue_pair.c:1456
qp_broker_attach drivers/misc/vmw_vmci/vmci_queue_pair.c:1662
qp_broker_alloc+0x2977/0x2f30 drivers/misc/vmw_vmci/vmci_queue_pair.c:1750
Bytes 28-31 of 48 are uninitialized
Memory access of size 48 starts at ffff888035155e00
Data copied to user address 0000000020000100
Use memset() to prevent the infoleaks.
Also speculatively fix qp_notify_peer_local(), which may suffer from the
same problem.
Reported-by: syzbot+39be4da489ed2493ba25@syzkaller.appspotmail.com
Cc: stable <stable@kernel.org>
Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.")
Signed-off-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
Link: https://lore.kernel.org/r/20221104175849.2782567-1-glider@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/misc/vmw_vmci/vmci_queue_pair.c
+++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c
@@ -852,6 +852,7 @@ static int qp_notify_peer_local(bool att
u32 context_id = vmci_get_context_id();
struct vmci_event_qp ev;
+ memset(&ev, 0, sizeof(ev));
ev.msg.hdr.dst = vmci_make_handle(context_id, VMCI_EVENT_HANDLER);
ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,
VMCI_CONTEXT_RESOURCE_ID);
@@ -1465,6 +1466,7 @@ static int qp_notify_peer(bool attach,
* kernel.
*/
+ memset(&ev, 0, sizeof(ev));
ev.msg.hdr.dst = vmci_make_handle(peer_id, VMCI_EVENT_HANDLER);
ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,
VMCI_CONTEXT_RESOURCE_ID);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 125/149] perf/x86/intel/pt: Fix sampling using single range output
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (123 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 124/149] misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 126/149] nvme: restrict management ioctls to admin Greg Kroah-Hartman
` (30 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Adrian Hunter,
Peter Zijlstra (Intel)
From: Adrian Hunter <adrian.hunter@intel.com>
commit ce0d998be9274dd3a3d971cbeaa6fe28fd2c3062 upstream.
Deal with errata TGL052, ADL037 and RPL017 "Trace May Contain Incorrect
Data When Configured With Single Range Output Larger Than 4KB" by
disabling single range output whenever larger than 4KB.
Fixes: 670638477aed ("perf/x86/intel/pt: Opportunistically use single range output mode")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20221112151508.13768-1-adrian.hunter@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/events/intel/pt.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/arch/x86/events/intel/pt.c
+++ b/arch/x86/events/intel/pt.c
@@ -1247,6 +1247,15 @@ static int pt_buffer_try_single(struct p
if (1 << order != nr_pages)
goto out;
+ /*
+ * Some processors cannot always support single range for more than
+ * 4KB - refer errata TGL052, ADL037 and RPL017. Future processors might
+ * also be affected, so for now rather than trying to keep track of
+ * which ones, just disable it for all.
+ */
+ if (nr_pages > 1)
+ goto out;
+
buf->single = true;
buf->nr_pages = nr_pages;
ret = 0;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 126/149] nvme: restrict management ioctls to admin
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (124 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 125/149] perf/x86/intel/pt: Fix sampling using single range output Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 127/149] nvme: ensure subsystem reset is single threaded Greg Kroah-Hartman
` (29 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Keith Busch, Christoph Hellwig,
Ovidiu Panait
From: Keith Busch <kbusch@kernel.org>
commit 23e085b2dead13b51fe86d27069895b740f749c0 upstream.
The passthrough commands already have this restriction, but the other
operations do not. Require the same capabilities for all users as all of
these operations, which include resets and rescans, can be disruptive.
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvme/host/core.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3330,11 +3330,17 @@ static long nvme_dev_ioctl(struct file *
case NVME_IOCTL_IO_CMD:
return nvme_dev_user_cmd(ctrl, argp);
case NVME_IOCTL_RESET:
+ if (!capable(CAP_SYS_ADMIN))
+ return -EACCES;
dev_warn(ctrl->device, "resetting controller\n");
return nvme_reset_ctrl_sync(ctrl);
case NVME_IOCTL_SUBSYS_RESET:
+ if (!capable(CAP_SYS_ADMIN))
+ return -EACCES;
return nvme_reset_subsystem(ctrl);
case NVME_IOCTL_RESCAN:
+ if (!capable(CAP_SYS_ADMIN))
+ return -EACCES;
nvme_queue_scan(ctrl);
return 0;
default:
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 127/149] nvme: ensure subsystem reset is single threaded
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (125 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 126/149] nvme: restrict management ioctls to admin Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 128/149] net: fix a concurrency bug in l2tp_tunnel_register() Greg Kroah-Hartman
` (28 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Keith Busch, Christoph Hellwig,
Ovidiu Panait
From: Keith Busch <kbusch@kernel.org>
commit 1e866afd4bcdd01a70a5eddb4371158d3035ce03 upstream.
The subsystem reset writes to a register, so we have to ensure the
device state is capable of handling that otherwise the driver may access
unmapped registers. Use the state machine to ensure the subsystem reset
doesn't try to write registers on a device already undergoing this type
of reset.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=214771
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvme/host/nvme.h | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -544,11 +544,23 @@ static inline void nvme_fault_inject_fin
static inline void nvme_should_fail(struct request *req) {}
#endif
+bool nvme_wait_reset(struct nvme_ctrl *ctrl);
+int nvme_try_sched_reset(struct nvme_ctrl *ctrl);
+
static inline int nvme_reset_subsystem(struct nvme_ctrl *ctrl)
{
+ int ret;
+
if (!ctrl->subsystem)
return -ENOTTY;
- return ctrl->ops->reg_write32(ctrl, NVME_REG_NSSR, 0x4E564D65);
+ if (!nvme_wait_reset(ctrl))
+ return -EBUSY;
+
+ ret = ctrl->ops->reg_write32(ctrl, NVME_REG_NSSR, 0x4E564D65);
+ if (ret)
+ return ret;
+
+ return nvme_try_sched_reset(ctrl);
}
/*
@@ -635,7 +647,6 @@ void nvme_cancel_tagset(struct nvme_ctrl
void nvme_cancel_admin_tagset(struct nvme_ctrl *ctrl);
bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
enum nvme_ctrl_state new_state);
-bool nvme_wait_reset(struct nvme_ctrl *ctrl);
int nvme_disable_ctrl(struct nvme_ctrl *ctrl);
int nvme_enable_ctrl(struct nvme_ctrl *ctrl);
int nvme_shutdown_ctrl(struct nvme_ctrl *ctrl);
@@ -688,7 +699,6 @@ int nvme_set_queue_count(struct nvme_ctr
void nvme_stop_keep_alive(struct nvme_ctrl *ctrl);
int nvme_reset_ctrl(struct nvme_ctrl *ctrl);
int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl);
-int nvme_try_sched_reset(struct nvme_ctrl *ctrl);
int nvme_delete_ctrl(struct nvme_ctrl *ctrl);
int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi,
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 128/149] net: fix a concurrency bug in l2tp_tunnel_register()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (126 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 127/149] nvme: ensure subsystem reset is single threaded Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 129/149] ring-buffer: Include dropped pages in counting dirty patches Greg Kroah-Hartman
` (27 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cong Wang, Sishuai Gong,
David S. Miller, Sasha Levin
From: Gong, Sishuai <sishuai@purdue.edu>
[ Upstream commit 69e16d01d1de4f1249869de342915f608feb55d5 ]
l2tp_tunnel_register() registers a tunnel without fully
initializing its attribute. This can allow another kernel thread
running l2tp_xmit_core() to access the uninitialized data and
then cause a kernel NULL pointer dereference error, as shown below.
Thread 1 Thread 2
//l2tp_tunnel_register()
list_add_rcu(&tunnel->list, &pn->l2tp_tunnel_list);
//pppol2tp_connect()
tunnel = l2tp_tunnel_get(sock_net(sk), info.tunnel_id);
// Fetch the new tunnel
...
//l2tp_xmit_core()
struct sock *sk = tunnel->sock;
...
bh_lock_sock(sk);
//Null pointer error happens
tunnel->sock = sk;
Fix this bug by initializing tunnel->sock before adding the
tunnel into l2tp_tunnel_list.
Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Sishuai Gong <sishuai@purdue.edu>
Reported-by: Sishuai Gong <sishuai@purdue.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: b68777d54fac ("l2tp: Serialize access to sk_user_data with sk_callback_lock")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/l2tp/l2tp_core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 561b6d67ab8b..dc8987ed08ad 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1480,11 +1480,15 @@ int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net,
tunnel->l2tp_net = net;
pn = l2tp_pernet(net);
+ sk = sock->sk;
+ sock_hold(sk);
+ tunnel->sock = sk;
+
spin_lock_bh(&pn->l2tp_tunnel_list_lock);
list_for_each_entry(tunnel_walk, &pn->l2tp_tunnel_list, list) {
if (tunnel_walk->tunnel_id == tunnel->tunnel_id) {
spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
-
+ sock_put(sk);
ret = -EEXIST;
goto err_sock;
}
@@ -1492,10 +1496,6 @@ int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net,
list_add_rcu(&tunnel->list, &pn->l2tp_tunnel_list);
spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
- sk = sock->sk;
- sock_hold(sk);
- tunnel->sock = sk;
-
if (tunnel->encap == L2TP_ENCAPTYPE_UDP) {
struct udp_tunnel_sock_cfg udp_cfg = {
.sk_user_data = tunnel,
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 129/149] ring-buffer: Include dropped pages in counting dirty patches
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (127 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 128/149] net: fix a concurrency bug in l2tp_tunnel_register() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 130/149] usbnet: smsc95xx: Fix deadlock on runtime resume Greg Kroah-Hartman
` (26 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Steven Rostedt (Google), Sasha Levin
From: Steven Rostedt (Google) <rostedt@goodmis.org>
[ Upstream commit 31029a8b2c7e656a0289194ef16415050ae4c4ac ]
The function ring_buffer_nr_dirty_pages() was created to find out how many
pages are filled in the ring buffer. There's two running counters. One is
incremented whenever a new page is touched (pages_touched) and the other
is whenever a page is read (pages_read). The dirty count is the number
touched minus the number read. This is used to determine if a blocked task
should be woken up if the percentage of the ring buffer it is waiting for
is hit.
The problem is that it does not take into account dropped pages (when the
new writes overwrite pages that were not read). And then the dirty pages
will always be greater than the percentage.
This makes the "buffer_percent" file inaccurate, as the number of dirty
pages end up always being larger than the percentage, event when it's not
and this causes user space to be woken up more than it wants to be.
Add a new counter to keep track of lost pages, and include that in the
accounting of dirty pages so that it is actually accurate.
Link: https://lkml.kernel.org/r/20221021123013.55fb6055@gandalf.local.home
Fixes: 2c2b0a78b3739 ("ring-buffer: Add percentage of ring buffer full to wake up reader")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/ring_buffer.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 9a1f82cafad4..49ebb8c66268 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -517,6 +517,7 @@ struct ring_buffer_per_cpu {
local_t committing;
local_t commits;
local_t pages_touched;
+ local_t pages_lost;
local_t pages_read;
long last_pages_touch;
size_t shortest_full;
@@ -771,10 +772,18 @@ size_t ring_buffer_nr_pages(struct trace_buffer *buffer, int cpu)
size_t ring_buffer_nr_dirty_pages(struct trace_buffer *buffer, int cpu)
{
size_t read;
+ size_t lost;
size_t cnt;
read = local_read(&buffer->buffers[cpu]->pages_read);
+ lost = local_read(&buffer->buffers[cpu]->pages_lost);
cnt = local_read(&buffer->buffers[cpu]->pages_touched);
+
+ if (WARN_ON_ONCE(cnt < lost))
+ return 0;
+
+ cnt -= lost;
+
/* The reader can read an empty page, but not more than that */
if (cnt < read) {
WARN_ON_ONCE(read > cnt + 1);
@@ -1897,6 +1906,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages)
*/
local_add(page_entries, &cpu_buffer->overrun);
local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes);
+ local_inc(&cpu_buffer->pages_lost);
}
/*
@@ -2387,6 +2397,7 @@ rb_handle_head_page(struct ring_buffer_per_cpu *cpu_buffer,
*/
local_add(entries, &cpu_buffer->overrun);
local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes);
+ local_inc(&cpu_buffer->pages_lost);
/*
* The entries will be zeroed out when we move the
@@ -4981,6 +4992,7 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)
local_set(&cpu_buffer->committing, 0);
local_set(&cpu_buffer->commits, 0);
local_set(&cpu_buffer->pages_touched, 0);
+ local_set(&cpu_buffer->pages_lost, 0);
local_set(&cpu_buffer->pages_read, 0);
cpu_buffer->last_pages_touch = 0;
cpu_buffer->shortest_full = 0;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 130/149] usbnet: smsc95xx: Fix deadlock on runtime resume
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (128 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 129/149] ring-buffer: Include dropped pages in counting dirty patches Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 131/149] stddef: Introduce struct_group() helper macro Greg Kroah-Hartman
` (25 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lukas Wunner, Andre Edich,
David S. Miller, Sasha Levin
From: Lukas Wunner <lukas@wunner.de>
[ Upstream commit 7b960c967f2aa01ab8f45c5a0bd78e754cffdeee ]
Commit 05b35e7eb9a1 ("smsc95xx: add phylib support") amended
smsc95xx_resume() to call phy_init_hw(). That function waits for the
device to runtime resume even though it is placed in the runtime resume
path, causing a deadlock.
The problem is that phy_init_hw() calls down to smsc95xx_mdiobus_read(),
which never uses the _nopm variant of usbnet_read_cmd().
Commit b4df480f68ae ("usbnet: smsc95xx: add reset_resume function with
reset operation") causes a similar deadlock on resume if the device was
already runtime suspended when entering system sleep:
That's because the commit introduced smsc95xx_reset_resume(), which
calls down to smsc95xx_reset(), which neglects to use _nopm accessors.
Fix by auto-detecting whether a device access is performed by the
suspend/resume task_struct and use the _nopm variant if so. This works
because the PM core guarantees that suspend/resume callbacks are run in
task context.
Stacktrace for posterity:
INFO: task kworker/2:1:49 blocked for more than 122 seconds.
Workqueue: usb_hub_wq hub_event
schedule
rpm_resume
__pm_runtime_resume
usb_autopm_get_interface
usbnet_read_cmd
__smsc95xx_read_reg
__smsc95xx_phy_wait_not_busy
__smsc95xx_mdio_read
smsc95xx_mdiobus_read
__mdiobus_read
mdiobus_read
smsc_phy_reset
phy_init_hw
smsc95xx_resume
usb_resume_interface
usb_resume_both
usb_runtime_resume
__rpm_callback
rpm_callback
rpm_resume
__pm_runtime_resume
usb_autoresume_device
hub_event
process_one_work
Fixes: b4df480f68ae ("usbnet: smsc95xx: add reset_resume function with reset operation")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org # v3.16+
Cc: Andre Edich <andre.edich@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/usb/smsc95xx.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 65d42f5d42a3..e1cd4c2de2d3 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -61,6 +61,7 @@ struct smsc95xx_priv {
u8 suspend_flags;
struct mii_bus *mdiobus;
struct phy_device *phydev;
+ struct task_struct *pm_task;
};
static bool turbo_mode = true;
@@ -70,13 +71,14 @@ MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
u32 *data, int in_pm)
{
+ struct smsc95xx_priv *pdata = dev->driver_priv;
u32 buf;
int ret;
int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
BUG_ON(!dev);
- if (!in_pm)
+ if (current != pdata->pm_task)
fn = usbnet_read_cmd;
else
fn = usbnet_read_cmd_nopm;
@@ -100,13 +102,14 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index,
u32 data, int in_pm)
{
+ struct smsc95xx_priv *pdata = dev->driver_priv;
u32 buf;
int ret;
int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
BUG_ON(!dev);
- if (!in_pm)
+ if (current != pdata->pm_task)
fn = usbnet_write_cmd;
else
fn = usbnet_write_cmd_nopm;
@@ -1468,9 +1471,12 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
u32 val, link_up;
int ret;
+ pdata->pm_task = current;
+
ret = usbnet_suspend(intf, message);
if (ret < 0) {
netdev_warn(dev->net, "usbnet_suspend error\n");
+ pdata->pm_task = NULL;
return ret;
}
@@ -1717,6 +1723,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
if (ret && PMSG_IS_AUTO(message))
usbnet_resume(intf);
+ pdata->pm_task = NULL;
return ret;
}
@@ -1737,29 +1744,31 @@ static int smsc95xx_resume(struct usb_interface *intf)
/* do this first to ensure it's cleared even in error case */
pdata->suspend_flags = 0;
+ pdata->pm_task = current;
+
if (suspend_flags & SUSPEND_ALLMODES) {
/* clear wake-up sources */
ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
if (ret < 0)
- return ret;
+ goto done;
val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_);
ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
if (ret < 0)
- return ret;
+ goto done;
/* clear wake-up status */
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
if (ret < 0)
- return ret;
+ goto done;
val &= ~PM_CTL_WOL_EN_;
val |= PM_CTL_WUPS_;
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
if (ret < 0)
- return ret;
+ goto done;
}
ret = usbnet_resume(intf);
@@ -1767,15 +1776,21 @@ static int smsc95xx_resume(struct usb_interface *intf)
netdev_warn(dev->net, "usbnet_resume error\n");
phy_init_hw(pdata->phydev);
+
+done:
+ pdata->pm_task = NULL;
return ret;
}
static int smsc95xx_reset_resume(struct usb_interface *intf)
{
struct usbnet *dev = usb_get_intfdata(intf);
+ struct smsc95xx_priv *pdata = dev->driver_priv;
int ret;
+ pdata->pm_task = current;
ret = smsc95xx_reset(dev);
+ pdata->pm_task = NULL;
if (ret < 0)
return ret;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 131/149] stddef: Introduce struct_group() helper macro
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (129 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 130/149] usbnet: smsc95xx: Fix deadlock on runtime resume Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 132/149] net: use struct_group to copy ip/ipv6 header addresses Greg Kroah-Hartman
` (24 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Keith Packard, Gustavo A. R. Silva,
Dan Williams, Kees Cook, Sasha Levin, Rasmus Villemoes,
Daniel Vetter
From: Kees Cook <keescook@chromium.org>
[ Upstream commit 50d7bd38c3aafc4749e05e8d7fcb616979143602 ]
Kernel code has a regular need to describe groups of members within a
structure usually when they need to be copied or initialized separately
from the rest of the surrounding structure. The generally accepted design
pattern in C is to use a named sub-struct:
struct foo {
int one;
struct {
int two;
int three, four;
} thing;
int five;
};
This would allow for traditional references and sizing:
memcpy(&dst.thing, &src.thing, sizeof(dst.thing));
However, doing this would mean that referencing struct members enclosed
by such named structs would always require including the sub-struct name
in identifiers:
do_something(dst.thing.three);
This has tended to be quite inflexible, especially when such groupings
need to be added to established code which causes huge naming churn.
Three workarounds exist in the kernel for this problem, and each have
other negative properties.
To avoid the naming churn, there is a design pattern of adding macro
aliases for the named struct:
#define f_three thing.three
This ends up polluting the global namespace, and makes it difficult to
search for identifiers.
Another common work-around in kernel code avoids the pollution by avoiding
the named struct entirely, instead identifying the group's boundaries using
either a pair of empty anonymous structs of a pair of zero-element arrays:
struct foo {
int one;
struct { } start;
int two;
int three, four;
struct { } finish;
int five;
};
struct foo {
int one;
int start[0];
int two;
int three, four;
int finish[0];
int five;
};
This allows code to avoid needing to use a sub-struct named for member
references within the surrounding structure, but loses the benefits of
being able to actually use such a struct, making it rather fragile. Using
these requires open-coded calculation of sizes and offsets. The efforts
made to avoid common mistakes include lots of comments, or adding various
BUILD_BUG_ON()s. Such code is left with no way for the compiler to reason
about the boundaries (e.g. the "start" object looks like it's 0 bytes
in length), making bounds checking depend on open-coded calculations:
if (length > offsetof(struct foo, finish) -
offsetof(struct foo, start))
return -EINVAL;
memcpy(&dst.start, &src.start, offsetof(struct foo, finish) -
offsetof(struct foo, start));
However, the vast majority of places in the kernel that operate on
groups of members do so without any identification of the grouping,
relying either on comments or implicit knowledge of the struct contents,
which is even harder for the compiler to reason about, and results in
even more fragile manual sizing, usually depending on member locations
outside of the region (e.g. to copy "two" and "three", use the start of
"four" to find the size):
BUILD_BUG_ON((offsetof(struct foo, four) <
offsetof(struct foo, two)) ||
(offsetof(struct foo, four) <
offsetof(struct foo, three));
if (length > offsetof(struct foo, four) -
offsetof(struct foo, two))
return -EINVAL;
memcpy(&dst.two, &src.two, length);
In order to have a regular programmatic way to describe a struct
region that can be used for references and sizing, can be examined for
bounds checking, avoids forcing the use of intermediate identifiers,
and avoids polluting the global namespace, introduce the struct_group()
macro. This macro wraps the member declarations to create an anonymous
union of an anonymous struct (no intermediate name) and a named struct
(for references and sizing):
struct foo {
int one;
struct_group(thing,
int two;
int three, four;
);
int five;
};
if (length > sizeof(src.thing))
return -EINVAL;
memcpy(&dst.thing, &src.thing, length);
do_something(dst.three);
There are some rare cases where the resulting struct_group() needs
attributes added, so struct_group_attr() is also introduced to allow
for specifying struct attributes (e.g. __align(x) or __packed).
Additionally, there are places where such declarations would like to
have the struct be tagged, so struct_group_tagged() is added.
Given there is a need for a handful of UAPI uses too, the underlying
__struct_group() macro has been defined in UAPI so it can be used there
too.
To avoid confusing scripts/kernel-doc, hide the macro from its struct
parsing.
Co-developed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/lkml/20210728023217.GC35706@embeddedor
Enhanced-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/lkml/41183a98-bdb9-4ad6-7eab-5a7292a6df84@rasmusvillemoes.dk
Enhanced-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/lkml/1d9a2e6df2a9a35b2cdd50a9a68cac5991e7e5f0.camel@intel.com
Enhanced-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://lore.kernel.org/lkml/YQKa76A6XuFqgM03@phenom.ffwll.local
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Stable-dep-of: 58e0be1ef611 ("net: use struct_group to copy ip/ipv6 header addresses")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/stddef.h | 48 +++++++++++++++++++++++++++++++++++++
include/uapi/linux/stddef.h | 21 ++++++++++++++++
scripts/kernel-doc | 7 ++++++
3 files changed, 76 insertions(+)
diff --git a/include/linux/stddef.h b/include/linux/stddef.h
index 998a4ba28eba..938216f8ab7e 100644
--- a/include/linux/stddef.h
+++ b/include/linux/stddef.h
@@ -36,4 +36,52 @@ enum {
#define offsetofend(TYPE, MEMBER) \
(offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER))
+/**
+ * struct_group() - Wrap a set of declarations in a mirrored struct
+ *
+ * @NAME: The identifier name of the mirrored sub-struct
+ * @MEMBERS: The member declarations for the mirrored structs
+ *
+ * Used to create an anonymous union of two structs with identical
+ * layout and size: one anonymous and one named. The former can be
+ * used normally without sub-struct naming, and the latter can be
+ * used to reason about the start, end, and size of the group of
+ * struct members.
+ */
+#define struct_group(NAME, MEMBERS...) \
+ __struct_group(/* no tag */, NAME, /* no attrs */, MEMBERS)
+
+/**
+ * struct_group_attr() - Create a struct_group() with trailing attributes
+ *
+ * @NAME: The identifier name of the mirrored sub-struct
+ * @ATTRS: Any struct attributes to apply
+ * @MEMBERS: The member declarations for the mirrored structs
+ *
+ * Used to create an anonymous union of two structs with identical
+ * layout and size: one anonymous and one named. The former can be
+ * used normally without sub-struct naming, and the latter can be
+ * used to reason about the start, end, and size of the group of
+ * struct members. Includes structure attributes argument.
+ */
+#define struct_group_attr(NAME, ATTRS, MEMBERS...) \
+ __struct_group(/* no tag */, NAME, ATTRS, MEMBERS)
+
+/**
+ * struct_group_tagged() - Create a struct_group with a reusable tag
+ *
+ * @TAG: The tag name for the named sub-struct
+ * @NAME: The identifier name of the mirrored sub-struct
+ * @MEMBERS: The member declarations for the mirrored structs
+ *
+ * Used to create an anonymous union of two structs with identical
+ * layout and size: one anonymous and one named. The former can be
+ * used normally without sub-struct naming, and the latter can be
+ * used to reason about the start, end, and size of the group of
+ * struct members. Includes struct tag argument for the named copy,
+ * so the specified layout can be reused later.
+ */
+#define struct_group_tagged(TAG, NAME, MEMBERS...) \
+ __struct_group(TAG, NAME, /* no attrs */, MEMBERS)
+
#endif
diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
index ee8220f8dcf5..610204f7c275 100644
--- a/include/uapi/linux/stddef.h
+++ b/include/uapi/linux/stddef.h
@@ -4,3 +4,24 @@
#ifndef __always_inline
#define __always_inline inline
#endif
+
+/**
+ * __struct_group() - Create a mirrored named and anonyomous struct
+ *
+ * @TAG: The tag name for the named sub-struct (usually empty)
+ * @NAME: The identifier name of the mirrored sub-struct
+ * @ATTRS: Any struct attributes (usually empty)
+ * @MEMBERS: The member declarations for the mirrored structs
+ *
+ * Used to create an anonymous union of two structs with identical layout
+ * and size: one anonymous and one named. The former's members can be used
+ * normally without sub-struct naming, and the latter can be used to
+ * reason about the start, end, and size of the group of struct members.
+ * The named struct can also be explicitly tagged for layer reuse, as well
+ * as both having struct attributes appended.
+ */
+#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
+ union { \
+ struct { MEMBERS } ATTRS; \
+ struct TAG { MEMBERS } ATTRS NAME; \
+ }
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 6325bec3f66f..19af6dd160e6 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1215,6 +1215,13 @@ sub dump_struct($$) {
$members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos;
$members =~ s/\s*____cacheline_aligned_in_smp/ /gos;
$members =~ s/\s*____cacheline_aligned/ /gos;
+ # unwrap struct_group():
+ # - first eat non-declaration parameters and rewrite for final match
+ # - then remove macro, outer parens, and trailing semicolon
+ $members =~ s/\bstruct_group\s*\(([^,]*,)/STRUCT_GROUP(/gos;
+ $members =~ s/\bstruct_group_(attr|tagged)\s*\(([^,]*,){2}/STRUCT_GROUP(/gos;
+ $members =~ s/\b__struct_group\s*\(([^,]*,){3}/STRUCT_GROUP(/gos;
+ $members =~ s/\bSTRUCT_GROUP(\(((?:(?>[^)(]+)|(?1))*)\))[^;]*;/$2/gos;
# replace DECLARE_BITMAP
$members =~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 132/149] net: use struct_group to copy ip/ipv6 header addresses
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (130 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 131/149] stddef: Introduce struct_group() helper macro Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 133/149] scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() Greg Kroah-Hartman
` (23 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Hangbin Liu,
Paolo Abeni, Sasha Levin
From: Hangbin Liu <liuhangbin@gmail.com>
[ Upstream commit 58e0be1ef6118c5352b56a4d06e974c5599993a5 ]
kernel test robot reported warnings when build bonding module with
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/bonding/:
from ../drivers/net/bonding/bond_main.c:35:
In function ‘fortify_memcpy_chk’,
inlined from ‘iph_to_flow_copy_v4addrs’ at ../include/net/ip.h:566:2,
inlined from ‘bond_flow_ip’ at ../drivers/net/bonding/bond_main.c:3984:3:
../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of f
ield (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
413 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘fortify_memcpy_chk’,
inlined from ‘iph_to_flow_copy_v6addrs’ at ../include/net/ipv6.h:900:2,
inlined from ‘bond_flow_ip’ at ../drivers/net/bonding/bond_main.c:3994:3:
../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of f
ield (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
413 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is because we try to copy the whole ip/ip6 address to the flow_key,
while we only point the to ip/ip6 saddr. Note that since these are UAPI
headers, __struct_group() is used to avoid the compiler warnings.
Reported-by: kernel test robot <lkp@intel.com>
Fixes: c3f8324188fa ("net: Add full IPv6 addresses to flow_keys")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://lore.kernel.org/r/20221115142400.1204786-1-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/ip.h | 2 +-
include/net/ipv6.h | 2 +-
include/uapi/linux/ip.h | 6 ++++--
include/uapi/linux/ipv6.h | 6 ++++--
4 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/include/net/ip.h b/include/net/ip.h
index c5822d7824cd..4b775af57268 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -545,7 +545,7 @@ static inline void iph_to_flow_copy_v4addrs(struct flow_keys *flow,
BUILD_BUG_ON(offsetof(typeof(flow->addrs), v4addrs.dst) !=
offsetof(typeof(flow->addrs), v4addrs.src) +
sizeof(flow->addrs.v4addrs.src));
- memcpy(&flow->addrs.v4addrs, &iph->saddr, sizeof(flow->addrs.v4addrs));
+ memcpy(&flow->addrs.v4addrs, &iph->addrs, sizeof(flow->addrs.v4addrs));
flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
}
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 60601896d474..89ce8a50f236 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -842,7 +842,7 @@ static inline void iph_to_flow_copy_v6addrs(struct flow_keys *flow,
BUILD_BUG_ON(offsetof(typeof(flow->addrs), v6addrs.dst) !=
offsetof(typeof(flow->addrs), v6addrs.src) +
sizeof(flow->addrs.v6addrs.src));
- memcpy(&flow->addrs.v6addrs, &iph->saddr, sizeof(flow->addrs.v6addrs));
+ memcpy(&flow->addrs.v6addrs, &iph->addrs, sizeof(flow->addrs.v6addrs));
flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
}
diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
index e42d13b55cf3..d2f143393780 100644
--- a/include/uapi/linux/ip.h
+++ b/include/uapi/linux/ip.h
@@ -100,8 +100,10 @@ struct iphdr {
__u8 ttl;
__u8 protocol;
__sum16 check;
- __be32 saddr;
- __be32 daddr;
+ __struct_group(/* no tag */, addrs, /* no attrs */,
+ __be32 saddr;
+ __be32 daddr;
+ );
/*The options start here. */
};
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index 13e8751bf24a..766ab5c8ee65 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -130,8 +130,10 @@ struct ipv6hdr {
__u8 nexthdr;
__u8 hop_limit;
- struct in6_addr saddr;
- struct in6_addr daddr;
+ __struct_group(/* no tag */, addrs, /* no attrs */,
+ struct in6_addr saddr;
+ struct in6_addr daddr;
+ );
};
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 133/149] scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (131 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 132/149] net: use struct_group to copy ip/ipv6 header addresses Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 134/149] scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper() Greg Kroah-Hartman
` (22 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Mike Christie,
Martin K. Petersen, Sasha Levin
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit bc68e428d4963af0201e92159629ab96948f0893 ]
If device_register() fails in tcm_loop_setup_hba_bus(), the name allocated
by dev_set_name() need be freed. As comment of device_register() says, it
should use put_device() to give up the reference in the error path. So fix
this by calling put_device(), then the name can be freed in kobject_cleanup().
The 'tl_hba' will be freed in tcm_loop_release_adapter(), so it don't need
goto error label in this case.
Fixes: 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221115015042.3652261-1-yangyingliang@huawei.com
Reviewed-by: Mike Christie <michael.chritie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/loopback/tcm_loop.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 16d5a4e117a2..5ae5d94c5b93 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -394,6 +394,7 @@ static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host
ret = device_register(&tl_hba->dev);
if (ret) {
pr_err("device_register() failed for tl_hba->dev: %d\n", ret);
+ put_device(&tl_hba->dev);
return -ENODEV;
}
@@ -1072,7 +1073,7 @@ static struct se_wwn *tcm_loop_make_scsi_hba(
*/
ret = tcm_loop_setup_hba_bus(tl_hba, tcm_loop_hba_no_cnt);
if (ret)
- goto out;
+ return ERR_PTR(ret);
sh = tl_hba->sh;
tcm_loop_hba_no_cnt++;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 134/149] scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (132 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 133/149] scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 135/149] kprobes: Skip clearing aggrprobes post_handler in kprobe-on-ftrace case Greg Kroah-Hartman
` (21 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Can, Douglas Gilbert,
Martin K. Petersen, Sasha Levin
From: Yuan Can <yuancan@huawei.com>
[ Upstream commit e208a1d795a08d1ac0398c79ad9c58106531bcc5 ]
If device_register() fails in sdebug_add_host_helper(), it will goto clean
and sdbg_host will be freed, but sdbg_host->host_list will not be removed
from sdebug_host_list, then list traversal may cause UAF. Fix it.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20221117084421.58918-1-yuancan@huawei.com
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 5eb959b5f701..261b915835b4 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -7079,8 +7079,12 @@ static int sdebug_add_host_helper(int per_host_idx)
dev_set_name(&sdbg_host->dev, "adapter%d", sdebug_num_hosts);
error = device_register(&sdbg_host->dev);
- if (error)
+ if (error) {
+ spin_lock(&sdebug_host_list_lock);
+ list_del(&sdbg_host->host_list);
+ spin_unlock(&sdebug_host_list_lock);
goto clean;
+ }
++sdebug_num_hosts;
return 0;
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 135/149] kprobes: Skip clearing aggrprobes post_handler in kprobe-on-ftrace case
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (133 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 134/149] scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper() Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 136/149] Input: i8042 - fix leaking of platform device on module removal Greg Kroah-Hartman
` (20 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhao Gongyi,
Masami Hiramatsu (Google), Li Huafei, Sasha Levin
From: Li Huafei <lihuafei1@huawei.com>
[ Upstream commit 5dd7caf0bdc5d0bae7cf9776b4d739fb09bd5ebb ]
In __unregister_kprobe_top(), if the currently unregistered probe has
post_handler but other child probes of the aggrprobe do not have
post_handler, the post_handler of the aggrprobe is cleared. If this is
a ftrace-based probe, there is a problem. In later calls to
disarm_kprobe(), we will use kprobe_ftrace_ops because post_handler is
NULL. But we're armed with kprobe_ipmodify_ops. This triggers a WARN in
__disarm_kprobe_ftrace() and may even cause use-after-free:
Failed to disarm kprobe-ftrace at kernel_clone+0x0/0x3c0 (error -2)
WARNING: CPU: 5 PID: 137 at kernel/kprobes.c:1135 __disarm_kprobe_ftrace.isra.21+0xcf/0xe0
Modules linked in: testKprobe_007(-)
CPU: 5 PID: 137 Comm: rmmod Not tainted 6.1.0-rc4-dirty #18
[...]
Call Trace:
<TASK>
__disable_kprobe+0xcd/0xe0
__unregister_kprobe_top+0x12/0x150
? mutex_lock+0xe/0x30
unregister_kprobes.part.23+0x31/0xa0
unregister_kprobe+0x32/0x40
__x64_sys_delete_module+0x15e/0x260
? do_user_addr_fault+0x2cd/0x6b0
do_syscall_64+0x3a/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
[...]
For the kprobe-on-ftrace case, we keep the post_handler setting to
identify this aggrprobe armed with kprobe_ipmodify_ops. This way we
can disarm it correctly.
Link: https://lore.kernel.org/all/20221112070000.35299-1-lihuafei1@huawei.com/
Fixes: 0bc11ed5ab60 ("kprobes: Allow kprobes coexist with livepatch")
Reported-by: Zhao Gongyi <zhaogongyi@huawei.com>
Suggested-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Li Huafei <lihuafei1@huawei.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/kprobes.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index b0f444e86487..75150e755518 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1841,7 +1841,13 @@ static int __unregister_kprobe_top(struct kprobe *p)
if ((list_p != p) && (list_p->post_handler))
goto noclean;
}
- ap->post_handler = NULL;
+ /*
+ * For the kprobe-on-ftrace case, we keep the
+ * post_handler setting to identify this aggrprobe
+ * armed with kprobe_ipmodify_ops.
+ */
+ if (!kprobe_ftrace(ap))
+ ap->post_handler = NULL;
}
noclean:
/*
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 136/149] Input: i8042 - fix leaking of platform device on module removal
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (134 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 135/149] kprobes: Skip clearing aggrprobes post_handler in kprobe-on-ftrace case Greg Kroah-Hartman
@ 2022-11-23 8:51 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 137/149] uapi/linux/stddef.h: Add include guards Greg Kroah-Hartman
` (19 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Jun, Dmitry Torokhov,
Sasha Levin
From: Chen Jun <chenjun102@huawei.com>
[ Upstream commit 81cd7e8489278d28794e7b272950c3e00c344e44 ]
Avoid resetting the module-wide i8042_platform_device pointer in
i8042_probe() or i8042_remove(), so that the device can be properly
destroyed by i8042_exit() on module unload.
Fixes: 9222ba68c3f4 ("Input: i8042 - add deferred probe support")
Signed-off-by: Chen Jun <chenjun102@huawei.com>
Link: https://lore.kernel.org/r/20221109034148.23821-1-chenjun102@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/serio/i8042.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index a9f68f535b72..8648b4c46138 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1543,8 +1543,6 @@ static int i8042_probe(struct platform_device *dev)
{
int error;
- i8042_platform_device = dev;
-
if (i8042_reset == I8042_RESET_ALWAYS) {
error = i8042_controller_selftest();
if (error)
@@ -1582,7 +1580,6 @@ static int i8042_probe(struct platform_device *dev)
i8042_free_aux_ports(); /* in case KBD failed but AUX not */
i8042_free_irqs();
i8042_controller_reset(false);
- i8042_platform_device = NULL;
return error;
}
@@ -1592,7 +1589,6 @@ static int i8042_remove(struct platform_device *dev)
i8042_unregister_ports();
i8042_free_irqs();
i8042_controller_reset(false);
- i8042_platform_device = NULL;
return 0;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 5.10 137/149] uapi/linux/stddef.h: Add include guards
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (135 preceding siblings ...)
2022-11-23 8:51 ` [PATCH 5.10 136/149] Input: i8042 - fix leaking of platform device on module removal Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 138/149] macvlan: enforce a consistent minimal mtu Greg Kroah-Hartman
` (18 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tadeusz Struk, Kees Cook
From: Tadeusz Struk <tadeusz.struk@linaro.org>
commit 55037ed7bdc62151a726f5685f88afa6a82959b1 upstream.
Add include guard wrapper define to uapi/linux/stddef.h to prevent macro
redefinition errors when stddef.h is included more than once. This was not
needed before since the only contents already used a redefinition test.
Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Link: https://lore.kernel.org/r/20220329171252.57279-1-tadeusz.struk@linaro.org
Fixes: 50d7bd38c3aa ("stddef: Introduce struct_group() helper macro")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/uapi/linux/stddef.h | 4 ++++
1 file changed, 4 insertions(+)
--- a/include/uapi/linux/stddef.h
+++ b/include/uapi/linux/stddef.h
@@ -1,4 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _UAPI_LINUX_STDDEF_H
+#define _UAPI_LINUX_STDDEF_H
+
#include <linux/compiler_types.h>
#ifndef __always_inline
@@ -25,3 +28,4 @@
struct { MEMBERS } ATTRS; \
struct TAG { MEMBERS } ATTRS NAME; \
}
+#endif
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 138/149] macvlan: enforce a consistent minimal mtu
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (136 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 137/149] uapi/linux/stddef.h: Add include guards Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 139/149] tcp: cdg: allow tcp_cdg_release() to be called multiple times Greg Kroah-Hartman
` (17 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, syzbot, Eric Dumazet,
David S. Miller
From: Eric Dumazet <edumazet@google.com>
commit b64085b00044bdf3cd1c9825e9ef5b2e0feae91a upstream.
macvlan should enforce a minimal mtu of 68, even at link creation.
This patch avoids the current behavior (which could lead to crashes
in ipv6 stack if the link is brought up)
$ ip link add macvlan1 link eno1 mtu 8 type macvlan # This should fail !
$ ip link sh dev macvlan1
5: macvlan1@eno1: <BROADCAST,MULTICAST> mtu 8 qdisc noop
state DOWN mode DEFAULT group default qlen 1000
link/ether 02:47:6c:24:74:82 brd ff:ff:ff:ff:ff:ff
$ ip link set macvlan1 mtu 67
Error: mtu less than device minimum.
$ ip link set macvlan1 mtu 68
$ ip link set macvlan1 mtu 8
Error: mtu less than device minimum.
Fixes: 91572088e3fd ("net: use core MTU range checking in core net infra")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/macvlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1176,7 +1176,7 @@ void macvlan_common_setup(struct net_dev
{
ether_setup(dev);
- dev->min_mtu = 0;
+ /* ether_setup() has set dev->min_mtu to ETH_MIN_MTU. */
dev->max_mtu = ETH_MAX_MTU;
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
netif_keep_dst(dev);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 139/149] tcp: cdg: allow tcp_cdg_release() to be called multiple times
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (137 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 138/149] macvlan: enforce a consistent minimal mtu Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 140/149] kcm: avoid potential race in kcm_tx_work Greg Kroah-Hartman
` (16 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, syzbot, Eric Dumazet,
David S. Miller
From: Eric Dumazet <edumazet@google.com>
commit 72e560cb8c6f80fc2b4afc5d3634a32465e13a51 upstream.
Apparently, mptcp is able to call tcp_disconnect() on an already
disconnected flow. This is generally fine, unless current congestion
control is CDG, because it might trigger a double-free [1]
Instead of fixing MPTCP, and future bugs, we can make tcp_disconnect()
more resilient.
[1]
BUG: KASAN: double-free in slab_free mm/slub.c:3539 [inline]
BUG: KASAN: double-free in kfree+0xe2/0x580 mm/slub.c:4567
CPU: 0 PID: 3645 Comm: kworker/0:7 Not tainted 6.0.0-syzkaller-02734-g0326074ff465 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Workqueue: events mptcp_worker
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:317 [inline]
print_report.cold+0x2ba/0x719 mm/kasan/report.c:433
kasan_report_invalid_free+0x81/0x190 mm/kasan/report.c:462
____kasan_slab_free+0x18b/0x1c0 mm/kasan/common.c:356
kasan_slab_free include/linux/kasan.h:200 [inline]
slab_free_hook mm/slub.c:1759 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1785
slab_free mm/slub.c:3539 [inline]
kfree+0xe2/0x580 mm/slub.c:4567
tcp_disconnect+0x980/0x1e20 net/ipv4/tcp.c:3145
__mptcp_close_ssk+0x5ca/0x7e0 net/mptcp/protocol.c:2327
mptcp_do_fastclose net/mptcp/protocol.c:2592 [inline]
mptcp_worker+0x78c/0xff0 net/mptcp/protocol.c:2627
process_one_work+0x991/0x1610 kernel/workqueue.c:2289
worker_thread+0x665/0x1080 kernel/workqueue.c:2436
kthread+0x2e4/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>
Allocated by task 3671:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:437 [inline]
____kasan_kmalloc mm/kasan/common.c:516 [inline]
____kasan_kmalloc mm/kasan/common.c:475 [inline]
__kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525
kmalloc_array include/linux/slab.h:640 [inline]
kcalloc include/linux/slab.h:671 [inline]
tcp_cdg_init+0x10d/0x170 net/ipv4/tcp_cdg.c:380
tcp_init_congestion_control+0xab/0x550 net/ipv4/tcp_cong.c:193
tcp_reinit_congestion_control net/ipv4/tcp_cong.c:217 [inline]
tcp_set_congestion_control+0x96c/0xaa0 net/ipv4/tcp_cong.c:391
do_tcp_setsockopt+0x505/0x2320 net/ipv4/tcp.c:3513
tcp_setsockopt+0xd4/0x100 net/ipv4/tcp.c:3801
mptcp_setsockopt+0x35f/0x2570 net/mptcp/sockopt.c:844
__sys_setsockopt+0x2d6/0x690 net/socket.c:2252
__do_sys_setsockopt net/socket.c:2263 [inline]
__se_sys_setsockopt net/socket.c:2260 [inline]
__x64_sys_setsockopt+0xba/0x150 net/socket.c:2260
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Freed by task 16:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track+0x21/0x30 mm/kasan/common.c:45
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370
____kasan_slab_free mm/kasan/common.c:367 [inline]
____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329
kasan_slab_free include/linux/kasan.h:200 [inline]
slab_free_hook mm/slub.c:1759 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1785
slab_free mm/slub.c:3539 [inline]
kfree+0xe2/0x580 mm/slub.c:4567
tcp_cleanup_congestion_control+0x70/0x120 net/ipv4/tcp_cong.c:226
tcp_v4_destroy_sock+0xdd/0x750 net/ipv4/tcp_ipv4.c:2254
tcp_v6_destroy_sock+0x11/0x20 net/ipv6/tcp_ipv6.c:1969
inet_csk_destroy_sock+0x196/0x440 net/ipv4/inet_connection_sock.c:1157
tcp_done+0x23b/0x340 net/ipv4/tcp.c:4649
tcp_rcv_state_process+0x40e7/0x4990 net/ipv4/tcp_input.c:6624
tcp_v6_do_rcv+0x3fc/0x13c0 net/ipv6/tcp_ipv6.c:1525
tcp_v6_rcv+0x2e8e/0x3830 net/ipv6/tcp_ipv6.c:1759
ip6_protocol_deliver_rcu+0x2db/0x1950 net/ipv6/ip6_input.c:439
ip6_input_finish+0x14c/0x2c0 net/ipv6/ip6_input.c:484
NF_HOOK include/linux/netfilter.h:302 [inline]
NF_HOOK include/linux/netfilter.h:296 [inline]
ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:493
dst_input include/net/dst.h:455 [inline]
ip6_rcv_finish+0x193/0x2c0 net/ipv6/ip6_input.c:79
ip_sabotage_in net/bridge/br_netfilter_hooks.c:874 [inline]
ip_sabotage_in+0x1fa/0x260 net/bridge/br_netfilter_hooks.c:865
nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
nf_hook_slow+0xc5/0x1f0 net/netfilter/core.c:614
nf_hook.constprop.0+0x3ac/0x650 include/linux/netfilter.h:257
NF_HOOK include/linux/netfilter.h:300 [inline]
ipv6_rcv+0x9e/0x380 net/ipv6/ip6_input.c:309
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5485
__netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5599
netif_receive_skb_internal net/core/dev.c:5685 [inline]
netif_receive_skb+0x12f/0x8d0 net/core/dev.c:5744
NF_HOOK include/linux/netfilter.h:302 [inline]
NF_HOOK include/linux/netfilter.h:296 [inline]
br_pass_frame_up+0x303/0x410 net/bridge/br_input.c:68
br_handle_frame_finish+0x909/0x1aa0 net/bridge/br_input.c:199
br_nf_hook_thresh+0x2f8/0x3d0 net/bridge/br_netfilter_hooks.c:1041
br_nf_pre_routing_finish_ipv6+0x695/0xef0 net/bridge/br_netfilter_ipv6.c:207
NF_HOOK include/linux/netfilter.h:302 [inline]
br_nf_pre_routing_ipv6+0x417/0x7c0 net/bridge/br_netfilter_ipv6.c:237
br_nf_pre_routing+0x1496/0x1fe0 net/bridge/br_netfilter_hooks.c:507
nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
nf_hook_bridge_pre net/bridge/br_input.c:255 [inline]
br_handle_frame+0x9c9/0x12d0 net/bridge/br_input.c:399
__netif_receive_skb_core+0x9fe/0x38f0 net/core/dev.c:5379
__netif_receive_skb_one_core+0xae/0x180 net/core/dev.c:5483
__netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5599
process_backlog+0x3a0/0x7c0 net/core/dev.c:5927
__napi_poll+0xb3/0x6d0 net/core/dev.c:6494
napi_poll net/core/dev.c:6561 [inline]
net_rx_action+0x9c1/0xd90 net/core/dev.c:6672
__do_softirq+0x1d0/0x9c8 kernel/softirq.c:571
Fixes: 2b0a8c9eee81 ("tcp: add CDG congestion control")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp_cdg.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/ipv4/tcp_cdg.c
+++ b/net/ipv4/tcp_cdg.c
@@ -375,6 +375,7 @@ static void tcp_cdg_init(struct sock *sk
struct cdg *ca = inet_csk_ca(sk);
struct tcp_sock *tp = tcp_sk(sk);
+ ca->gradients = NULL;
/* We silently fall back to window = 1 if allocation fails. */
if (window > 1)
ca->gradients = kcalloc(window, sizeof(ca->gradients[0]),
@@ -388,6 +389,7 @@ static void tcp_cdg_release(struct sock
struct cdg *ca = inet_csk_ca(sk);
kfree(ca->gradients);
+ ca->gradients = NULL;
}
static struct tcp_congestion_ops tcp_cdg __read_mostly = {
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 140/149] kcm: avoid potential race in kcm_tx_work
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (138 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 139/149] tcp: cdg: allow tcp_cdg_release() to be called multiple times Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 141/149] kcm: close race conditions on sk_receive_queue Greg Kroah-Hartman
` (15 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot, Eric Dumazet, Tom Herbert,
Jakub Kicinski
From: Eric Dumazet <edumazet@google.com>
commit ec7eede369fe5b0d085ac51fdbb95184f87bfc6c upstream.
syzbot found that kcm_tx_work() could crash [1] in:
/* Primarily for SOCK_SEQPACKET sockets */
if (likely(sk->sk_socket) &&
test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
<<*>> clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
sk->sk_write_space(sk);
}
I think the reason is that another thread might concurrently
run in kcm_release() and call sock_orphan(sk) while sk is not
locked. kcm_tx_work() find sk->sk_socket being NULL.
[1]
BUG: KASAN: null-ptr-deref in instrument_atomic_write include/linux/instrumented.h:86 [inline]
BUG: KASAN: null-ptr-deref in clear_bit include/asm-generic/bitops/instrumented-atomic.h:41 [inline]
BUG: KASAN: null-ptr-deref in kcm_tx_work+0xff/0x160 net/kcm/kcmsock.c:742
Write of size 8 at addr 0000000000000008 by task kworker/u4:3/53
CPU: 0 PID: 53 Comm: kworker/u4:3 Not tainted 5.19.0-rc3-next-20220621-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: kkcmd kcm_tx_work
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
kasan_report+0xbe/0x1f0 mm/kasan/report.c:495
check_region_inline mm/kasan/generic.c:183 [inline]
kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
instrument_atomic_write include/linux/instrumented.h:86 [inline]
clear_bit include/asm-generic/bitops/instrumented-atomic.h:41 [inline]
kcm_tx_work+0xff/0x160 net/kcm/kcmsock.c:742
process_one_work+0x996/0x1610 kernel/workqueue.c:2289
worker_thread+0x665/0x1080 kernel/workqueue.c:2436
kthread+0x2e9/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
</TASK>
Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <tom@herbertland.com>
Link: https://lore.kernel.org/r/20221012133412.519394-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/kcm/kcmsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1844,10 +1844,10 @@ static int kcm_release(struct socket *so
kcm = kcm_sk(sk);
mux = kcm->mux;
+ lock_sock(sk);
sock_orphan(sk);
kfree_skb(kcm->seq_skb);
- lock_sock(sk);
/* Purge queue under lock to avoid race condition with tx_work trying
* to act when queue is nonempty. If tx_work runs after this point
* it will just return.
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 141/149] kcm: close race conditions on sk_receive_queue
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (139 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 140/149] kcm: avoid potential race in kcm_tx_work Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 142/149] 9p: trans_fd/p9_conn_cancel: drop client lock earlier Greg Kroah-Hartman
` (14 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+278279efdd2730dd14bf,
shaozhengchao, Paolo Abeni, Tom Herbert, Cong Wang
From: Cong Wang <cong.wang@bytedance.com>
commit 5121197ecc5db58c07da95eb1ff82b98b121a221 upstream.
sk->sk_receive_queue is protected by skb queue lock, but for KCM
sockets its RX path takes mux->rx_lock to protect more than just
skb queue. However, kcm_recvmsg() still only grabs the skb queue
lock, so race conditions still exist.
We can teach kcm_recvmsg() to grab mux->rx_lock too but this would
introduce a potential performance regression as struct kcm_mux can
be shared by multiple KCM sockets.
So we have to enforce skb queue lock in requeue_rx_msgs() and handle
skb peek case carefully in kcm_wait_data(). Fortunately,
skb_recv_datagram() already handles it nicely and is widely used by
other sockets, we can just switch to skb_recv_datagram() after
getting rid of the unnecessary sock lock in kcm_recvmsg() and
kcm_splice_read(). Side note: SOCK_DONE is not used by KCM sockets,
so it is safe to get rid of this check too.
I ran the original syzbot reproducer for 30 min without seeing any
issue.
Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module")
Reported-by: syzbot+278279efdd2730dd14bf@syzkaller.appspotmail.com
Reported-by: shaozhengchao <shaozhengchao@huawei.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Tom Herbert <tom@herbertland.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Link: https://lore.kernel.org/r/20221114005119.597905-1-xiyou.wangcong@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/kcm/kcmsock.c | 60 +++++++-----------------------------------------------
1 file changed, 8 insertions(+), 52 deletions(-)
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -221,7 +221,7 @@ static void requeue_rx_msgs(struct kcm_m
struct sk_buff *skb;
struct kcm_sock *kcm;
- while ((skb = __skb_dequeue(head))) {
+ while ((skb = skb_dequeue(head))) {
/* Reset destructor to avoid calling kcm_rcv_ready */
skb->destructor = sock_rfree;
skb_orphan(skb);
@@ -1084,53 +1084,18 @@ out_error:
return err;
}
-static struct sk_buff *kcm_wait_data(struct sock *sk, int flags,
- long timeo, int *err)
-{
- struct sk_buff *skb;
-
- while (!(skb = skb_peek(&sk->sk_receive_queue))) {
- if (sk->sk_err) {
- *err = sock_error(sk);
- return NULL;
- }
-
- if (sock_flag(sk, SOCK_DONE))
- return NULL;
-
- if ((flags & MSG_DONTWAIT) || !timeo) {
- *err = -EAGAIN;
- return NULL;
- }
-
- sk_wait_data(sk, &timeo, NULL);
-
- /* Handle signals */
- if (signal_pending(current)) {
- *err = sock_intr_errno(timeo);
- return NULL;
- }
- }
-
- return skb;
-}
-
static int kcm_recvmsg(struct socket *sock, struct msghdr *msg,
size_t len, int flags)
{
+ int noblock = flags & MSG_DONTWAIT;
struct sock *sk = sock->sk;
struct kcm_sock *kcm = kcm_sk(sk);
int err = 0;
- long timeo;
struct strp_msg *stm;
int copied = 0;
struct sk_buff *skb;
- timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
-
- lock_sock(sk);
-
- skb = kcm_wait_data(sk, flags, timeo, &err);
+ skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb)
goto out;
@@ -1161,14 +1126,11 @@ msg_finished:
/* Finished with message */
msg->msg_flags |= MSG_EOR;
KCM_STATS_INCR(kcm->stats.rx_msgs);
- skb_unlink(skb, &sk->sk_receive_queue);
- kfree_skb(skb);
}
}
out:
- release_sock(sk);
-
+ skb_free_datagram(sk, skb);
return copied ? : err;
}
@@ -1176,9 +1138,9 @@ static ssize_t kcm_splice_read(struct so
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
{
+ int noblock = flags & MSG_DONTWAIT;
struct sock *sk = sock->sk;
struct kcm_sock *kcm = kcm_sk(sk);
- long timeo;
struct strp_msg *stm;
int err = 0;
ssize_t copied;
@@ -1186,11 +1148,7 @@ static ssize_t kcm_splice_read(struct so
/* Only support splice for SOCKSEQPACKET */
- timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
-
- lock_sock(sk);
-
- skb = kcm_wait_data(sk, flags, timeo, &err);
+ skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb)
goto err_out;
@@ -1218,13 +1176,11 @@ static ssize_t kcm_splice_read(struct so
* finish reading the message.
*/
- release_sock(sk);
-
+ skb_free_datagram(sk, skb);
return copied;
err_out:
- release_sock(sk);
-
+ skb_free_datagram(sk, skb);
return err;
}
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 142/149] 9p: trans_fd/p9_conn_cancel: drop client lock earlier
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (140 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 141/149] kcm: close race conditions on sk_receive_queue Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 143/149] gfs2: Check sb_bsize_shift after reading superblock Greg Kroah-Hartman
` (13 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+50f7e8d06c3768dd97f3,
Dominique Martinet, Schspa Shi
From: Dominique Martinet <asmadeus@codewreck.org>
commit 52f1c45dde9136f964d63a77d19826c8a74e2c7f upstream.
syzbot reported a double-lock here and we no longer need this
lock after requests have been moved off to local list:
just drop the lock earlier.
Link: https://lkml.kernel.org/r/20220904064028.1305220-1-asmadeus@codewreck.org
Reported-by: syzbot+50f7e8d06c3768dd97f3@syzkaller.appspotmail.com
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Tested-by: Schspa Shi <schspa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/9p/trans_fd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -205,6 +205,8 @@ static void p9_conn_cancel(struct p9_con
list_move(&req->req_list, &cancel_list);
}
+ spin_unlock(&m->client->lock);
+
list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) {
p9_debug(P9_DEBUG_ERROR, "call back req %p\n", req);
list_del(&req->req_list);
@@ -212,7 +214,6 @@ static void p9_conn_cancel(struct p9_con
req->t_err = err;
p9_client_cb(m->client, req, REQ_STATUS_ERROR);
}
- spin_unlock(&m->client->lock);
}
static __poll_t
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 143/149] gfs2: Check sb_bsize_shift after reading superblock
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (141 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 142/149] 9p: trans_fd/p9_conn_cancel: drop client lock earlier Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 144/149] gfs2: Switch from strlcpy to strscpy Greg Kroah-Hartman
` (12 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+dcf33a7aae997956fe06,
Andrew Price, Andreas Gruenbacher
From: Andrew Price <anprice@redhat.com>
commit 670f8ce56dd0632dc29a0322e188cc73ce3c6b92 upstream.
Fuzzers like to scribble over sb_bsize_shift but in reality it's very
unlikely that this field would be corrupted on its own. Nevertheless it
should be checked to avoid the possibility of messy mount errors due to
bad calculations. It's always a fixed value based on the block size so
we can just check that it's the expected value.
Tested with:
mkfs.gfs2 -O -p lock_nolock /dev/vdb
for i in 0 -1 64 65 32 33; do
gfs2_edit -p sb field sb_bsize_shift $i /dev/vdb
mount /dev/vdb /mnt/test && umount /mnt/test
done
Before this patch we get a withdraw after
[ 76.413681] gfs2: fsid=loop0.0: fatal: invalid metadata block
[ 76.413681] bh = 19 (type: exp=5, found=4)
[ 76.413681] function = gfs2_meta_buffer, file = fs/gfs2/meta_io.c, line = 492
and with UBSAN configured we also get complaints like
[ 76.373395] UBSAN: shift-out-of-bounds in fs/gfs2/ops_fstype.c:295:19
[ 76.373815] shift exponent 4294967287 is too large for 64-bit type 'long unsigned int'
After the patch, these complaints don't appear, mount fails immediately
and we get an explanation in dmesg.
Reported-by: syzbot+dcf33a7aae997956fe06@syzkaller.appspotmail.com
Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/gfs2/ops_fstype.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -182,7 +182,10 @@ static int gfs2_check_sb(struct gfs2_sbd
pr_warn("Invalid superblock size\n");
return -EINVAL;
}
-
+ if (sb->sb_bsize_shift != ffs(sb->sb_bsize) - 1) {
+ pr_warn("Invalid block size shift\n");
+ return -EINVAL;
+ }
return 0;
}
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 144/149] gfs2: Switch from strlcpy to strscpy
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (142 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 143/149] gfs2: Check sb_bsize_shift after reading superblock Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 145/149] 9p/trans_fd: always use O_NONBLOCK read/write Greg Kroah-Hartman
` (11 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wolfram Sang, Andreas Gruenbacher
From: Andreas Gruenbacher <agruenba@redhat.com>
commit 204c0300c4e99707e9fb6e57840aa1127060e63f upstream.
Switch from strlcpy to strscpy and make sure that @count is the size of
the smaller of the source and destination buffers. This prevents
reading beyond the end of the source buffer when the source string isn't
null terminated.
Found by a modified version of syzkaller.
Suggested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/gfs2/ops_fstype.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -384,8 +384,10 @@ static int init_names(struct gfs2_sbd *s
if (!table[0])
table = sdp->sd_vfs->s_id;
- strlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
- strlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
+ BUILD_BUG_ON(GFS2_LOCKNAME_LEN > GFS2_FSNAME_LEN);
+
+ strscpy(sdp->sd_proto_name, proto, GFS2_LOCKNAME_LEN);
+ strscpy(sdp->sd_table_name, table, GFS2_LOCKNAME_LEN);
table = sdp->sd_table_name;
while ((table = strchr(table, '/')))
@@ -1417,13 +1419,13 @@ static int gfs2_parse_param(struct fs_co
switch (o) {
case Opt_lockproto:
- strlcpy(args->ar_lockproto, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_lockproto, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_locktable:
- strlcpy(args->ar_locktable, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_locktable, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_hostdata:
- strlcpy(args->ar_hostdata, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_hostdata, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_spectator:
args->ar_spectator = 1;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 145/149] 9p/trans_fd: always use O_NONBLOCK read/write
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (143 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 144/149] gfs2: Switch from strlcpy to strscpy Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 146/149] mm: fs: initialize fsdata passed to write_begin/write_end interface Greg Kroah-Hartman
` (10 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot, Tetsuo Handa,
Christian Schoenebeck, Dominique Martinet
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
commit ef575281b21e9a34dfae544a187c6aac2ae424a9 upstream.
syzbot is reporting hung task at p9_fd_close() [1], for p9_mux_poll_stop()
from p9_conn_destroy() from p9_fd_close() is failing to interrupt already
started kernel_read() from p9_fd_read() from p9_read_work() and/or
kernel_write() from p9_fd_write() from p9_write_work() requests.
Since p9_socket_open() sets O_NONBLOCK flag, p9_mux_poll_stop() does not
need to interrupt kernel_read()/kernel_write(). However, since p9_fd_open()
does not set O_NONBLOCK flag, but pipe blocks unless signal is pending,
p9_mux_poll_stop() needs to interrupt kernel_read()/kernel_write() when
the file descriptor refers to a pipe. In other words, pipe file descriptor
needs to be handled as if socket file descriptor.
We somehow need to interrupt kernel_read()/kernel_write() on pipes.
A minimal change, which this patch is doing, is to set O_NONBLOCK flag
from p9_fd_open(), for O_NONBLOCK flag does not affect reading/writing
of regular files. But this approach changes O_NONBLOCK flag on userspace-
supplied file descriptors (which might break userspace programs), and
O_NONBLOCK flag could be changed by userspace. It would be possible to set
O_NONBLOCK flag every time p9_fd_read()/p9_fd_write() is invoked, but still
remains small race window for clearing O_NONBLOCK flag.
If we don't want to manipulate O_NONBLOCK flag, we might be able to
surround kernel_read()/kernel_write() with set_thread_flag(TIF_SIGPENDING)
and recalc_sigpending(). Since p9_read_work()/p9_write_work() works are
processed by kernel threads which process global system_wq workqueue,
signals could not be delivered from remote threads when p9_mux_poll_stop()
from p9_conn_destroy() from p9_fd_close() is called. Therefore, calling
set_thread_flag(TIF_SIGPENDING)/recalc_sigpending() every time would be
needed if we count on signals for making kernel_read()/kernel_write()
non-blocking.
Link: https://lkml.kernel.org/r/345de429-a88b-7097-d177-adecf9fed342@I-love.SAKURA.ne.jp
Link: https://syzkaller.appspot.com/bug?extid=8b41a1365f1106fd0f33 [1]
Reported-by: syzbot <syzbot+8b41a1365f1106fd0f33@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: syzbot <syzbot+8b41a1365f1106fd0f33@syzkaller.appspotmail.com>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
[Dominique: add comment at Christian's suggestion]
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/9p/trans_fd.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -821,11 +821,14 @@ static int p9_fd_open(struct p9_client *
goto out_free_ts;
if (!(ts->rd->f_mode & FMODE_READ))
goto out_put_rd;
+ /* prevent workers from hanging on IO when fd is a pipe */
+ ts->rd->f_flags |= O_NONBLOCK;
ts->wr = fget(wfd);
if (!ts->wr)
goto out_put_rd;
if (!(ts->wr->f_mode & FMODE_WRITE))
goto out_put_wr;
+ ts->wr->f_flags |= O_NONBLOCK;
client->trans = ts;
client->status = Connected;
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 146/149] mm: fs: initialize fsdata passed to write_begin/write_end interface
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (144 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 145/149] 9p/trans_fd: always use O_NONBLOCK read/write Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 147/149] ntfs: fix use-after-free in ntfs_attr_find() Greg Kroah-Hartman
` (9 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Potapenko, Alexander Viro,
Alexei Starovoitov, Andrey Konovalov, Andrey Konovalov,
Andy Lutomirski, Arnd Bergmann, Borislav Petkov,
Christoph Hellwig, Christoph Lameter, David Rientjes,
Dmitry Vyukov, Eric Biggers, Eric Biggers, Eric Dumazet,
Herbert Xu, Ilya Leoshkevich, Ingo Molnar, Jens Axboe,
Joonsoo Kim, Kees Cook, Marco Elver, Mark Rutland, Matthew Wilcox,
Michael S. Tsirkin, Pekka Enberg, Peter Zijlstra, Petr Mladek,
Stephen Rothwell, Steven Rostedt, Thomas Gleixner, Vasily Gorbik,
Vegard Nossum, Vlastimil Babka, Andrew Morton
From: Alexander Potapenko <glider@google.com>
commit 1468c6f4558b1bcd92aa0400f2920f9dc7588402 upstream.
Functions implementing the a_ops->write_end() interface accept the `void
*fsdata` parameter that is supposed to be initialized by the corresponding
a_ops->write_begin() (which accepts `void **fsdata`).
However not all a_ops->write_begin() implementations initialize `fsdata`
unconditionally, so it may get passed uninitialized to a_ops->write_end(),
resulting in undefined behavior.
Fix this by initializing fsdata with NULL before the call to
write_begin(), rather than doing so in all possible a_ops implementations.
This patch covers only the following cases found by running x86 KMSAN
under syzkaller:
- generic_perform_write()
- cont_expand_zero() and generic_cont_expand_simple()
- page_symlink()
Other cases of passing uninitialized fsdata may persist in the codebase.
Link: https://lkml.kernel.org/r/20220915150417.722975-43-glider@google.com
Signed-off-by: Alexander Potapenko <glider@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Marco Elver <elver@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/buffer.c | 4 ++--
fs/namei.c | 2 +-
mm/filemap.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2350,7 +2350,7 @@ int generic_cont_expand_simple(struct in
{
struct address_space *mapping = inode->i_mapping;
struct page *page;
- void *fsdata;
+ void *fsdata = NULL;
int err;
err = inode_newsize_ok(inode, size);
@@ -2376,7 +2376,7 @@ static int cont_expand_zero(struct file
struct inode *inode = mapping->host;
unsigned int blocksize = i_blocksize(inode);
struct page *page;
- void *fsdata;
+ void *fsdata = NULL;
pgoff_t index, curidx;
loff_t curpos;
unsigned zerofrom, offset, len;
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -4633,7 +4633,7 @@ int __page_symlink(struct inode *inode,
{
struct address_space *mapping = inode->i_mapping;
struct page *page;
- void *fsdata;
+ void *fsdata = NULL;
int err;
unsigned int flags = 0;
if (nofs)
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3303,7 +3303,7 @@ ssize_t generic_perform_write(struct fil
unsigned long offset; /* Offset into pagecache page */
unsigned long bytes; /* Bytes to write to page */
size_t copied; /* Bytes copied from user */
- void *fsdata;
+ void *fsdata = NULL;
offset = (pos & (PAGE_SIZE - 1));
bytes = min_t(unsigned long, PAGE_SIZE - offset,
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 147/149] ntfs: fix use-after-free in ntfs_attr_find()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (145 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 146/149] mm: fs: initialize fsdata passed to write_begin/write_end interface Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 148/149] ntfs: fix out-of-bounds read " Greg Kroah-Hartman
` (8 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hawkins Jiawei, Anton Altaparmakov,
ChenXiaoSong, syzkaller-bugs, Dan Carpenter, Andrew Morton
From: Hawkins Jiawei <yin31149@gmail.com>
commit d85a1bec8e8d552ab13163ca1874dcd82f3d1550 upstream.
Patch series "ntfs: fix bugs about Attribute", v2.
This patchset fixes three bugs relative to Attribute in record:
Patch 1 adds a sanity check to ensure that, attrs_offset field in first
mft record loading from disk is within bounds.
Patch 2 moves the ATTR_RECORD's bounds checking earlier, to avoid
dereferencing ATTR_RECORD before checking this ATTR_RECORD is within
bounds.
Patch 3 adds an overflow checking to avoid possible forever loop in
ntfs_attr_find().
Without patch 1 and patch 2, the kernel triggersa KASAN use-after-free
detection as reported by Syzkaller.
Although one of patch 1 or patch 2 can fix this, we still need both of
them. Because patch 1 fixes the root cause, and patch 2 not only fixes
the direct cause, but also fixes the potential out-of-bounds bug.
This patch (of 3):
Syzkaller reported use-after-free read as follows:
==================================================================
BUG: KASAN: use-after-free in ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597
Read of size 2 at addr ffff88807e352009 by task syz-executor153/3607
[...]
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:317 [inline]
print_report.cold+0x2ba/0x719 mm/kasan/report.c:433
kasan_report+0xb1/0x1e0 mm/kasan/report.c:495
ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597
ntfs_attr_lookup+0x1056/0x2070 fs/ntfs/attrib.c:1193
ntfs_read_inode_mount+0x89a/0x2580 fs/ntfs/inode.c:1845
ntfs_fill_super+0x1799/0x9320 fs/ntfs/super.c:2854
mount_bdev+0x34d/0x410 fs/super.c:1400
legacy_get_tree+0x105/0x220 fs/fs_context.c:610
vfs_get_tree+0x89/0x2f0 fs/super.c:1530
do_new_mount fs/namespace.c:3040 [inline]
path_mount+0x1326/0x1e20 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
[...]
</TASK>
The buggy address belongs to the physical page:
page:ffffea0001f8d400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e350
head:ffffea0001f8d400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888011842140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88807e351f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807e351f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807e352000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807e352080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807e352100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Kernel will loads $MFT/$DATA's first mft record in
ntfs_read_inode_mount().
Yet the problem is that after loading, kernel doesn't check whether
attrs_offset field is a valid value.
To be more specific, if attrs_offset field is larger than bytes_allocated
field, then it may trigger the out-of-bounds read bug(reported as
use-after-free bug) in ntfs_attr_find(), when kernel tries to access the
corresponding mft record's attribute.
This patch solves it by adding the sanity check between attrs_offset field
and bytes_allocated field, after loading the first mft record.
Link: https://lkml.kernel.org/r/20220831160935.3409-1-yin31149@gmail.com
Link: https://lkml.kernel.org/r/20220831160935.3409-2-yin31149@gmail.com
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Cc: Anton Altaparmakov <anton@tuxera.com>
Cc: ChenXiaoSong <chenxiaosong2@huawei.com>
Cc: syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/inode.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -1829,6 +1829,13 @@ int ntfs_read_inode_mount(struct inode *
goto err_out;
}
+ /* Sanity check offset to the first attribute */
+ if (le16_to_cpu(m->attrs_offset) >= le32_to_cpu(m->bytes_allocated)) {
+ ntfs_error(sb, "Incorrect mft offset to the first attribute %u in superblock.",
+ le16_to_cpu(m->attrs_offset));
+ goto err_out;
+ }
+
/* Need this to sanity check attribute list references to $MFT. */
vi->i_generation = ni->seq_no = le16_to_cpu(m->sequence_number);
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 148/149] ntfs: fix out-of-bounds read in ntfs_attr_find()
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (146 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 147/149] ntfs: fix use-after-free in ntfs_attr_find() Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 149/149] ntfs: check overflow when iterating ATTR_RECORDs Greg Kroah-Hartman
` (7 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, chenxiaosong (A), Dan Carpenter,
Hawkins Jiawei, syzbot+5f8dcabe4a3b2c51c607, Anton Altaparmakov,
syzkaller-bugs, Andrew Morton
From: Hawkins Jiawei <yin31149@gmail.com>
commit 36a4d82dddbbd421d2b8e79e1cab68c8126d5075 upstream.
Kernel iterates over ATTR_RECORDs in mft record in ntfs_attr_find(). To
ensure access on these ATTR_RECORDs are within bounds, kernel will do some
checking during iteration.
The problem is that during checking whether ATTR_RECORD's name is within
bounds, kernel will dereferences the ATTR_RECORD name_offset field, before
checking this ATTR_RECORD strcture is within bounds. This problem may
result out-of-bounds read in ntfs_attr_find(), reported by Syzkaller:
==================================================================
BUG: KASAN: use-after-free in ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597
Read of size 2 at addr ffff88807e352009 by task syz-executor153/3607
[...]
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:317 [inline]
print_report.cold+0x2ba/0x719 mm/kasan/report.c:433
kasan_report+0xb1/0x1e0 mm/kasan/report.c:495
ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597
ntfs_attr_lookup+0x1056/0x2070 fs/ntfs/attrib.c:1193
ntfs_read_inode_mount+0x89a/0x2580 fs/ntfs/inode.c:1845
ntfs_fill_super+0x1799/0x9320 fs/ntfs/super.c:2854
mount_bdev+0x34d/0x410 fs/super.c:1400
legacy_get_tree+0x105/0x220 fs/fs_context.c:610
vfs_get_tree+0x89/0x2f0 fs/super.c:1530
do_new_mount fs/namespace.c:3040 [inline]
path_mount+0x1326/0x1e20 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
[...]
</TASK>
The buggy address belongs to the physical page:
page:ffffea0001f8d400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e350
head:ffffea0001f8d400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888011842140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88807e351f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807e351f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807e352000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807e352080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807e352100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
This patch solves it by moving the ATTR_RECORD strcture's bounds checking
earlier, then checking whether ATTR_RECORD's name is within bounds.
What's more, this patch also add some comments to improve its
maintainability.
Link: https://lkml.kernel.org/r/20220831160935.3409-3-yin31149@gmail.com
Link: https://lore.kernel.org/all/1636796c-c85e-7f47-e96f-e074fee3c7d3@huawei.com/
Link: https://groups.google.com/g/syzkaller-bugs/c/t_XdeKPGTR4/m/LECAuIGcBgAJ
Signed-off-by: chenxiaosong (A) <chenxiaosong2@huawei.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Reported-by: syzbot+5f8dcabe4a3b2c51c607@syzkaller.appspotmail.com
Tested-by: syzbot+5f8dcabe4a3b2c51c607@syzkaller.appspotmail.com
Cc: Anton Altaparmakov <anton@tuxera.com>
Cc: syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/attrib.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -594,11 +594,23 @@ static int ntfs_attr_find(const ATTR_TYP
for (;; a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))) {
u8 *mrec_end = (u8 *)ctx->mrec +
le32_to_cpu(ctx->mrec->bytes_allocated);
- u8 *name_end = (u8 *)a + le16_to_cpu(a->name_offset) +
- a->name_length * sizeof(ntfschar);
- if ((u8*)a < (u8*)ctx->mrec || (u8*)a > mrec_end ||
- name_end > mrec_end)
+ u8 *name_end;
+
+ /* check whether ATTR_RECORD wrap */
+ if ((u8 *)a < (u8 *)ctx->mrec)
break;
+
+ /* check whether Attribute Record Header is within bounds */
+ if ((u8 *)a > mrec_end ||
+ (u8 *)a + sizeof(ATTR_RECORD) > mrec_end)
+ break;
+
+ /* check whether ATTR_RECORD's name is within bounds */
+ name_end = (u8 *)a + le16_to_cpu(a->name_offset) +
+ a->name_length * sizeof(ntfschar);
+ if (name_end > mrec_end)
+ break;
+
ctx->attr = a;
if (unlikely(le32_to_cpu(a->type) > le32_to_cpu(type) ||
a->type == AT_END))
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 5.10 149/149] ntfs: check overflow when iterating ATTR_RECORDs
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (147 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 148/149] ntfs: fix out-of-bounds read " Greg Kroah-Hartman
@ 2022-11-23 8:52 ` Greg Kroah-Hartman
2022-11-23 11:11 ` [PATCH 5.10 000/149] 5.10.156-rc1 review Rudi Heitbaum
` (6 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-23 8:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hawkins Jiawei, Dan Carpenter,
Anton Altaparmakov, chenxiaosong (A), syzkaller-bugs,
Andrew Morton
From: Hawkins Jiawei <yin31149@gmail.com>
commit 63095f4f3af59322bea984a6ae44337439348fe0 upstream.
Kernel iterates over ATTR_RECORDs in mft record in ntfs_attr_find().
Because the ATTR_RECORDs are next to each other, kernel can get the next
ATTR_RECORD from end address of current ATTR_RECORD, through current
ATTR_RECORD length field.
The problem is that during iteration, when kernel calculates the end
address of current ATTR_RECORD, kernel may trigger an integer overflow bug
in executing `a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))`. This
may wrap, leading to a forever iteration on 32bit systems.
This patch solves it by adding some checks on calculating end address
of current ATTR_RECORD during iteration.
Link: https://lkml.kernel.org/r/20220831160935.3409-4-yin31149@gmail.com
Link: https://lore.kernel.org/all/20220827105842.GM2030@kadam/
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Anton Altaparmakov <anton@tuxera.com>
Cc: chenxiaosong (A) <chenxiaosong2@huawei.com>
Cc: syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/attrib.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -617,6 +617,14 @@ static int ntfs_attr_find(const ATTR_TYP
return -ENOENT;
if (unlikely(!a->length))
break;
+
+ /* check whether ATTR_RECORD's length wrap */
+ if ((u8 *)a + le32_to_cpu(a->length) < (u8 *)a)
+ break;
+ /* check whether ATTR_RECORD's length is within bounds */
+ if ((u8 *)a + le32_to_cpu(a->length) > mrec_end)
+ break;
+
if (a->type != type)
continue;
/*
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (148 preceding siblings ...)
2022-11-23 8:52 ` [PATCH 5.10 149/149] ntfs: check overflow when iterating ATTR_RECORDs Greg Kroah-Hartman
@ 2022-11-23 11:11 ` Rudi Heitbaum
2022-11-23 11:16 ` Pavel Machek
` (5 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Rudi Heitbaum @ 2022-11-23 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow
On Wed, Nov 23, 2022 at 09:49:43AM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.156 release.
> There are 149 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 Fri, 25 Nov 2022 08:45:20 +0000.
> Anything received after that time might be too late.
Hi Greg,
5.10.156-rc1 tested.
Run tested on:
- Intel Skylake x86_64 (nuc6 i5-6260U)
In addition - build tested for:
- Allwinner A64
- Allwinner H3
- Allwinner H5
- Allwinner H6
- Rockchip RK3288
- Rockchip RK3328
- Rockchip RK3399pro
Tested-by: Rudi Heitbaum <rudi@heitbaum.com>
--
Rudi
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (149 preceding siblings ...)
2022-11-23 11:11 ` [PATCH 5.10 000/149] 5.10.156-rc1 review Rudi Heitbaum
@ 2022-11-23 11:16 ` Pavel Machek
2022-11-23 14:00 ` Naresh Kamboju
` (4 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Pavel Machek @ 2022-11-23 11:16 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow
[-- Attachment #1: Type: text/plain, Size: 664 bytes --]
Hi!
> This is the start of the stable review cycle for the 5.10.156 release.
> There are 149 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.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-5.10.y
Tested-by: Pavel Machek (CIP) <pavel@denx.de>
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (150 preceding siblings ...)
2022-11-23 11:16 ` Pavel Machek
@ 2022-11-23 14:00 ` Naresh Kamboju
2022-11-24 15:47 ` Naresh Kamboju
2022-11-24 2:37 ` Guenter Roeck
` (3 subsequent siblings)
155 siblings, 1 reply; 168+ messages in thread
From: Naresh Kamboju @ 2022-11-23 14:00 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow, Netdev, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
On Wed, 23 Nov 2022 at 14:50, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 5.10.156 release.
> There are 149 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 Fri, 25 Nov 2022 08:45:20 +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/v5.x/stable-review/patch-5.10.156-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-5.10.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
With stable rc 5.10.156-rc1 Raspberry Pi 4 Model B failed to boot due to
following warnings / errors [1]. The NFS mount failed and failed to boot.
I have to bisect this problem.
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
[ 0.000000] Linux version 5.10.156-rc1 (tuxmake@tuxmake)
(aarch64-linux-gnu-gcc (Debian 11.3.0-6) 11.3.0, GNU ld (GNU Binutils
for Debian) 2.39) #1 SMP PREEMPT @1669194931
[ 0.000000] Machine model: Raspberry Pi 4 Model B
---
[ 3.253965] mmc0: new high speed SDIO card at address 0001
[ 7.229502] bcmgenet fd580000.ethernet eth0: Link is Up -
1Gbps/Full - flow control off
[ 7.237710] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 7.253259] Sending DHCP requests ......
[ 81.086546] DHCP/BOOTP: Reply not for us on eth0, op[2] xid[42e6766b]
[ 89.106504] DHCP/BOOTP: Reply not for us on eth0, op[2] xid[42e6766b]
[ 98.657252] timed out!
[ 98.683997] bcmgenet fd580000.ethernet eth0: Link is Down
[ 98.691276] IP-Config: Retrying forever (NFS root)...
[ 98.698404] bcmgenet fd580000.ethernet: configuring instance for
external RGMII (RX delay)
[ 98.707190] bcmgenet fd580000.ethernet eth0: Link is Down
[ 102.813504] bcmgenet fd580000.ethernet eth0: Link is Up -
1Gbps/Full - flow control off
[ 102.821680] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 102.841257] Sending DHCP requests ....
[ 119.840915] DHCP/BOOTP: Reply not for us on eth0, op[2] xid[34e6766b]
[ 127.860148] DHCP/BOOTP: Reply not for us on eth0, op[2] xid[34e6766b]
[ 132.513252] .. timed out!
[1] https://lkft.validation.linaro.org/scheduler/job/5880584#L392
--
Linaro LKFT
https://lkft.linaro.org
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (151 preceding siblings ...)
2022-11-23 14:00 ` Naresh Kamboju
@ 2022-11-24 2:37 ` Guenter Roeck
2022-11-24 10:46 ` Sudip Mukherjee
` (2 subsequent siblings)
155 siblings, 0 replies; 168+ messages in thread
From: Guenter Roeck @ 2022-11-24 2:37 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee, srw,
rwarsow
On Wed, Nov 23, 2022 at 09:49:43AM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.156 release.
> There are 149 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 Fri, 25 Nov 2022 08:45:20 +0000.
> Anything received after that time might be too late.
>
Build results:
total: 163 pass: 163 fail: 0
Qemu test results:
total: 475 pass: 475 fail: 0
Tested-by: Guenter Roeck <linux@roeck-us.net>
Guenter
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (152 preceding siblings ...)
2022-11-24 2:37 ` Guenter Roeck
@ 2022-11-24 10:46 ` Sudip Mukherjee
2022-11-26 2:39 ` zhouzhixiu
2022-11-28 22:37 ` Florian Fainelli
155 siblings, 0 replies; 168+ messages in thread
From: Sudip Mukherjee @ 2022-11-24 10:46 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli, srw, rwarsow
Hi Greg,
On Wed, Nov 23, 2022 at 09:49:43AM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.156 release.
> There are 149 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 Fri, 25 Nov 2022 08:45:20 +0000.
> Anything received after that time might be too late.
Build test (gcc version 11.3.1 20221016):
mips: 63 configs -> no failure
arm: 104 configs -> no failure
arm64: 3 configs -> no failure
x86_64: 4 configs -> no failure
alpha allmodconfig -> no failure
powerpc allmodconfig -> no failure
riscv allmodconfig -> no failure
s390 allmodconfig -> no failure
xtensa allmodconfig -> no failure
Boot test:
x86_64: Booted on my test laptop. No regression.
x86_64: Booted on qemu. No regression. [1]
arm64: Booted on rpi4b (4GB model). No regression. [2]
[1]. https://openqa.qa.codethink.co.uk/tests/2208
[2]. https://openqa.qa.codethink.co.uk/tests/2212
Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
--
Regards
Sudip
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 011/149] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15
2022-11-23 8:49 ` [PATCH 5.10 011/149] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 Greg Kroah-Hartman
@ 2022-11-24 13:47 ` Salvatore Bonaccorso
2022-11-25 7:29 ` Greg Kroah-Hartman
0 siblings, 1 reply; 168+ messages in thread
From: Salvatore Bonaccorso @ 2022-11-24 13:47 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, Pierre-Louis Bossart, Ranjani Sridharan,
Bard Liao, Mark Brown, Sasha Levin
Hi Greg,
On Wed, Nov 23, 2022 at 09:49:54AM +0100, Greg Kroah-Hartman wrote:
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>
> [ Upstream commit 41deb2db64997d01110faaf763bd911d490dfde7 ]
>
> Some NUC15 LAPBC710 devices don't expose the same DMI information as
> the Intel reference, add additional entry in the match table.
>
> BugLink: https://github.com/thesofproject/linux/issues/3885
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> Link: https://lore.kernel.org/r/20221017204054.207512-1-pierre-louis.bossart@linux.intel.com
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> sound/soc/intel/boards/sof_sdw.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
> index 25548555d8d7..5e1a718a64da 100644
> --- a/sound/soc/intel/boards/sof_sdw.c
> +++ b/sound/soc/intel/boards/sof_sdw.c
> @@ -175,6 +175,17 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
> SOF_SDW_PCH_DMIC |
> SOF_RT711_JD_SRC_JD2),
> },
> + {
> + /* NUC15 LAPBC710 skews */
> + .callback = sof_sdw_quirk_cb,
> + .matches = {
> + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
> + DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"),
> + },
> + .driver_data = (void *)(SOF_SDW_TGL_HDMI |
> + SOF_SDW_PCH_DMIC |
> + RT711_JD1),
> + },
> /* TigerLake-SDCA devices */
> {
> .callback = sof_sdw_quirk_cb,
> --
> 2.35.1
This one causes a build failure for 5.10.156-rc1 (not tested newer
ones possibly affected):
sound/soc/intel/boards/sof_sdw.c:187:6: error: ‘RT711_JD1’ undeclared here (not in a function)
187 | RT711_JD1),
| ^~~~~~~~~
make[7]: *** [scripts/Makefile.build:286: sound/soc/intel/boards/sof_sdw.o] Error 1
make[6]: *** [scripts/Makefile.build:503: sound/soc/intel/boards] Error 2
make[5]: *** [scripts/Makefile.build:503: sound/soc/intel] Error 2
make[4]: *** [scripts/Makefile.build:503: sound/soc] Error 2
make[3]: *** [Makefile:1837: sound] Error 2
make[3]: *** Waiting for unfinished jobs....
If not mistaken this is because 5.10.y does not have yet 8e6c00f1fdea ("ASoC:
Intel: sof_sdw: include rt711.h for RT711 JD mode") which is present on
5.15-rc1 onwards.
Regards,
Salvatore
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-23 14:00 ` Naresh Kamboju
@ 2022-11-24 15:47 ` Naresh Kamboju
2022-11-25 7:27 ` Greg Kroah-Hartman
0 siblings, 1 reply; 168+ messages in thread
From: Naresh Kamboju @ 2022-11-24 15:47 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow, Netdev, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, YueHaibing,
Daniel Díaz
On Wed, 23 Nov 2022 at 19:30, Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
>
> On Wed, 23 Nov 2022 at 14:50, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > This is the start of the stable review cycle for the 5.10.156 release.
> > There are 149 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 Fri, 25 Nov 2022 08:45:20 +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/v5.x/stable-review/patch-5.10.156-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-5.10.y
> > and the diffstat can be found below.
> >
> > thanks,
> >
> > greg k-h
>
>
> With stable rc 5.10.156-rc1 Raspberry Pi 4 Model B failed to boot due to
> following warnings / errors [1]. The NFS mount failed and failed to boot.
>
> I have to bisect this problem.
Daniel bisected this reported problem and found the first bad commit,
YueHaibing <yuehaibing@huawei.com>
net: broadcom: Fix BCMGENET Kconfig
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
>
>
> [ 0.000000] Linux version 5.10.156-rc1 (tuxmake@tuxmake)
> (aarch64-linux-gnu-gcc (Debian 11.3.0-6) 11.3.0, GNU ld (GNU Binutils
> for Debian) 2.39) #1 SMP PREEMPT @1669194931
> [ 0.000000] Machine model: Raspberry Pi 4 Model B
> ---
> [ 3.253965] mmc0: new high speed SDIO card at address 0001
> [ 7.229502] bcmgenet fd580000.ethernet eth0: Link is Up -
> 1Gbps/Full - flow control off
> [ 7.237710] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> [ 7.253259] Sending DHCP requests ......
> [ 81.086546] DHCP/BOOTP: Reply not for us on eth0, op[2] xid[42e6766b]
> [ 89.106504] DHCP/BOOTP: Reply not for us on eth0, op[2] xid[42e6766b]
> [ 98.657252] timed out!
> [ 98.683997] bcmgenet fd580000.ethernet eth0: Link is Down
> [ 98.691276] IP-Config: Retrying forever (NFS root)...
> [ 98.698404] bcmgenet fd580000.ethernet: configuring instance for
> external RGMII (RX delay)
> [ 98.707190] bcmgenet fd580000.ethernet eth0: Link is Down
> [ 102.813504] bcmgenet fd580000.ethernet eth0: Link is Up -
> 1Gbps/Full - flow control off
> [ 102.821680] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> [ 102.841257] Sending DHCP requests ....
> [ 119.840915] DHCP/BOOTP: Reply not for us on eth0, op[2] xid[34e6766b]
> [ 127.860148] DHCP/BOOTP: Reply not for us on eth0, op[2] xid[34e6766b]
> [ 132.513252] .. timed out!
>
> [1] https://lkft.validation.linaro.org/scheduler/job/5880584#L392
>
> --
> Linaro LKFT
> https://lkft.linaro.org
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-24 15:47 ` Naresh Kamboju
@ 2022-11-25 7:27 ` Greg Kroah-Hartman
2022-11-25 8:05 ` Naresh Kamboju
0 siblings, 1 reply; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-25 7:27 UTC (permalink / raw)
To: Naresh Kamboju
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow, Netdev, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, YueHaibing,
Daniel Díaz
On Thu, Nov 24, 2022 at 09:17:36PM +0530, Naresh Kamboju wrote:
> On Wed, 23 Nov 2022 at 19:30, Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
> >
> > On Wed, 23 Nov 2022 at 14:50, Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > This is the start of the stable review cycle for the 5.10.156 release.
> > > There are 149 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 Fri, 25 Nov 2022 08:45:20 +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/v5.x/stable-review/patch-5.10.156-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-5.10.y
> > > and the diffstat can be found below.
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> >
> > With stable rc 5.10.156-rc1 Raspberry Pi 4 Model B failed to boot due to
> > following warnings / errors [1]. The NFS mount failed and failed to boot.
> >
> > I have to bisect this problem.
>
> Daniel bisected this reported problem and found the first bad commit,
>
> YueHaibing <yuehaibing@huawei.com>
> net: broadcom: Fix BCMGENET Kconfig
But that is in 5.10.155, 5.15.79, 6.0.9, and 6.1-rc5. It is not new to
this -rc release.
What config options are being set because of this that cause the
problem? Should it just be reverted for 5.10.y, and not the other
branches? Or for everywhere including Linus's tree?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 011/149] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15
2022-11-24 13:47 ` Salvatore Bonaccorso
@ 2022-11-25 7:29 ` Greg Kroah-Hartman
0 siblings, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-25 7:29 UTC (permalink / raw)
To: Salvatore Bonaccorso
Cc: stable, patches, Pierre-Louis Bossart, Ranjani Sridharan,
Bard Liao, Mark Brown, Sasha Levin
On Thu, Nov 24, 2022 at 02:47:51PM +0100, Salvatore Bonaccorso wrote:
> Hi Greg,
>
> On Wed, Nov 23, 2022 at 09:49:54AM +0100, Greg Kroah-Hartman wrote:
> > From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> >
> > [ Upstream commit 41deb2db64997d01110faaf763bd911d490dfde7 ]
> >
> > Some NUC15 LAPBC710 devices don't expose the same DMI information as
> > the Intel reference, add additional entry in the match table.
> >
> > BugLink: https://github.com/thesofproject/linux/issues/3885
> > Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> > Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> > Link: https://lore.kernel.org/r/20221017204054.207512-1-pierre-louis.bossart@linux.intel.com
> > Signed-off-by: Mark Brown <broonie@kernel.org>
> > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > ---
> > sound/soc/intel/boards/sof_sdw.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
> > index 25548555d8d7..5e1a718a64da 100644
> > --- a/sound/soc/intel/boards/sof_sdw.c
> > +++ b/sound/soc/intel/boards/sof_sdw.c
> > @@ -175,6 +175,17 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
> > SOF_SDW_PCH_DMIC |
> > SOF_RT711_JD_SRC_JD2),
> > },
> > + {
> > + /* NUC15 LAPBC710 skews */
> > + .callback = sof_sdw_quirk_cb,
> > + .matches = {
> > + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
> > + DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"),
> > + },
> > + .driver_data = (void *)(SOF_SDW_TGL_HDMI |
> > + SOF_SDW_PCH_DMIC |
> > + RT711_JD1),
> > + },
> > /* TigerLake-SDCA devices */
> > {
> > .callback = sof_sdw_quirk_cb,
> > --
> > 2.35.1
>
> This one causes a build failure for 5.10.156-rc1 (not tested newer
> ones possibly affected):
>
> sound/soc/intel/boards/sof_sdw.c:187:6: error: ‘RT711_JD1’ undeclared here (not in a function)
> 187 | RT711_JD1),
> | ^~~~~~~~~
> make[7]: *** [scripts/Makefile.build:286: sound/soc/intel/boards/sof_sdw.o] Error 1
> make[6]: *** [scripts/Makefile.build:503: sound/soc/intel/boards] Error 2
> make[5]: *** [scripts/Makefile.build:503: sound/soc/intel] Error 2
> make[4]: *** [scripts/Makefile.build:503: sound/soc] Error 2
> make[3]: *** [Makefile:1837: sound] Error 2
> make[3]: *** Waiting for unfinished jobs....
>
> If not mistaken this is because 5.10.y does not have yet 8e6c00f1fdea ("ASoC:
> Intel: sof_sdw: include rt711.h for RT711 JD mode") which is present on
> 5.15-rc1 onwards.
Thanks, I've now dropped this commit.
greg k-h
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-25 7:27 ` Greg Kroah-Hartman
@ 2022-11-25 8:05 ` Naresh Kamboju
2022-11-25 9:42 ` YueHaibing
2022-11-25 10:02 ` Arnd Bergmann
0 siblings, 2 replies; 168+ messages in thread
From: Naresh Kamboju @ 2022-11-25 8:05 UTC (permalink / raw)
To: Greg Kroah-Hartman, YueHaibing
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow, Netdev, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Daniel Díaz
On Fri, 25 Nov 2022 at 12:57, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Thu, Nov 24, 2022 at 09:17:36PM +0530, Naresh Kamboju wrote:
> > On Wed, 23 Nov 2022 at 19:30, Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
> > >
> > > On Wed, 23 Nov 2022 at 14:50, Greg Kroah-Hartman
> > > <gregkh@linuxfoundation.org> wrote:
> > > >
> > > > This is the start of the stable review cycle for the 5.10.156 release.
> > > > There are 149 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 Fri, 25 Nov 2022 08:45:20 +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/v5.x/stable-review/patch-5.10.156-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-5.10.y
> > > > and the diffstat can be found below.
> > > >
> > > > thanks,
> > > >
> > > > greg k-h
> > >
> > >
> > > With stable rc 5.10.156-rc1 Raspberry Pi 4 Model B failed to boot due to
> > > following warnings / errors [1]. The NFS mount failed and failed to boot.
> > >
> > > I have to bisect this problem.
> >
> > Daniel bisected this reported problem and found the first bad commit,
> >
> > YueHaibing <yuehaibing@huawei.com>
> > net: broadcom: Fix BCMGENET Kconfig
>
> But that is in 5.10.155, 5.15.79, 6.0.9, and 6.1-rc5. It is not new to
> this -rc release.
It started from 5.10.155 and this is only seen on 5.10 and other
branches 5.15, 6.0 and mainline are looking good.
>
> What config options are being set because of this that cause the
> problem?
LKFT is built with arm64 defconfig + distro configs as described below.
> Should it just be reverted for 5.10.y, and not the other
> branches? Or for everywhere including Linus's tree?
Reverting for 5.10 works for Rpi-4 to boot.
Due to the problematic commit
# CONFIG_BROADCOM_PHY is not set
and Raspberry Pi 4 boot failed only on 5.10.155 and later.
--
diff -Narub good-config bad-config
--- good-config 2022-11-09 14:19:58.000000000 +0530
+++ bad-config 2022-11-16 15:50:36.000000000 +0530
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm64 5.10.154-rc2 Kernel Configuration
+# Linux/arm64 5.10.155 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (Debian 11.3.0-6) 11.3.0"
CONFIG_CC_IS_GCC=y
@@ -2611,7 +2611,7 @@
# CONFIG_ADIN_PHY is not set
CONFIG_AQUANTIA_PHY=y
# CONFIG_AX88796B_PHY is not set
-CONFIG_BROADCOM_PHY=y
+# CONFIG_BROADCOM_PHY is not set
# CONFIG_BCM54140_PHY is not set
CONFIG_BCM7XXX_PHY=y
# CONFIG_BCM84881_PHY is not set
---
# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake
#
# See https://docs.tuxmake.org/ for complete documentation.
# Original tuxmake command with fragments listed below.
# tuxmake --runtime podman --target-arch arm64 --toolchain gcc-11
--kconfig defconfig --kconfig-add
https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/lkft.config
--kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/lkft-crypto.config
--kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/distro-overrides.config
--kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/systemd.config
--kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/virtio.config
--kconfig-add CONFIG_ARM64_MODULE_PLTS=y --kconfig-add
CONFIG_SYN_COOKIES=y --kconfig-add CONFIG_SCHEDSTATS=y
CROSS_COMPILE_COMPAT=arm-linux-gnueabihf-
Bad config link,
https://builds.tuxbuild.com/2HcnnvEDD3gSr1zmS5DHzqPG2cJ/config
>
> thanks,
>
> greg k-h
- Naresh
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-25 8:05 ` Naresh Kamboju
@ 2022-11-25 9:42 ` YueHaibing
2022-11-25 10:02 ` Arnd Bergmann
1 sibling, 0 replies; 168+ messages in thread
From: YueHaibing @ 2022-11-25 9:42 UTC (permalink / raw)
To: Naresh Kamboju, Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow, Netdev, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Daniel Díaz
On 2022/11/25 16:05, Naresh Kamboju wrote:
> On Fri, 25 Nov 2022 at 12:57, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
>>
>> On Thu, Nov 24, 2022 at 09:17:36PM +0530, Naresh Kamboju wrote:
>>> On Wed, 23 Nov 2022 at 19:30, Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
>>>>
>>>> On Wed, 23 Nov 2022 at 14:50, Greg Kroah-Hartman
>>>> <gregkh@linuxfoundation.org> wrote:
>>>>>
>>>>> This is the start of the stable review cycle for the 5.10.156 release.
>>>>> There are 149 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 Fri, 25 Nov 2022 08:45:20 +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/v5.x/stable-review/patch-5.10.156-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-5.10.y
>>>>> and the diffstat can be found below.
>>>>>
>>>>> thanks,
>>>>>
>>>>> greg k-h
>>>>
>>>>
>>>> With stable rc 5.10.156-rc1 Raspberry Pi 4 Model B failed to boot due to
>>>> following warnings / errors [1]. The NFS mount failed and failed to boot.
>>>>
>>>> I have to bisect this problem.
>>>
>>> Daniel bisected this reported problem and found the first bad commit,
>>>
>>> YueHaibing <yuehaibing@huawei.com>
>>> net: broadcom: Fix BCMGENET Kconfig
>>
>> But that is in 5.10.155, 5.15.79, 6.0.9, and 6.1-rc5. It is not new to
>> this -rc release.
>
> It started from 5.10.155 and this is only seen on 5.10 and other
> branches 5.15, 6.0 and mainline are looking good.
>
>>
>> What config options are being set because of this that cause the
>> problem?
>
> LKFT is built with arm64 defconfig + distro configs as described below.
>
>> Should it just be reverted for 5.10.y, and not the other
>> branches? Or for everywhere including Linus's tree?
>
> Reverting for 5.10 works for Rpi-4 to boot.
>
> Due to the problematic commit
> # CONFIG_BROADCOM_PHY is not set
> and Raspberry Pi 4 boot failed only on 5.10.155 and later.
BROADCOM_PHY is needed by ARCH_BCM2835, but BROADCOM_PHY depends on PTP_1588_CLOCK_OPTIONAL now
see commit 39db6be781cd ("net: phy: broadcom: Add PTP support for some Broadcom PHYs.")
config BROADCOM_PHY
tristate "Broadcom 54XX PHYs"
select BCM_NET_PHYLIB
select BCM_NET_PHYPTP if NETWORK_PHY_TIMESTAMPING
depends on PTP_1588_CLOCK_OPTIONAL
Your config don't enable PTP_1588_CLOCK_OPTIONAL, maybe PTP_1588_CLOCK_OPTIONAL should be enabled
or BROADCOM_PHY does not depends on PTP_1588_CLOCK_OPTIONAL?
>
> --
>
> diff -Narub good-config bad-config
> --- good-config 2022-11-09 14:19:58.000000000 +0530
> +++ bad-config 2022-11-16 15:50:36.000000000 +0530
> @@ -1,6 +1,6 @@
> #
> # Automatically generated file; DO NOT EDIT.
> -# Linux/arm64 5.10.154-rc2 Kernel Configuration
> +# Linux/arm64 5.10.155 Kernel Configuration
> #
> CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (Debian 11.3.0-6) 11.3.0"
> CONFIG_CC_IS_GCC=y
> @@ -2611,7 +2611,7 @@
> # CONFIG_ADIN_PHY is not set
> CONFIG_AQUANTIA_PHY=y
> # CONFIG_AX88796B_PHY is not set
> -CONFIG_BROADCOM_PHY=y
> +# CONFIG_BROADCOM_PHY is not set
> # CONFIG_BCM54140_PHY is not set
> CONFIG_BCM7XXX_PHY=y
> # CONFIG_BCM84881_PHY is not set
>
> ---
>
> # To install tuxmake on your system globally:
> # sudo pip3 install -U tuxmake
> #
> # See https://docs.tuxmake.org/ for complete documentation.
> # Original tuxmake command with fragments listed below.
> # tuxmake --runtime podman --target-arch arm64 --toolchain gcc-11
> --kconfig defconfig --kconfig-add
> https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/lkft.config
> --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/lkft-crypto.config
> --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/distro-overrides.config
> --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/systemd.config
> --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/virtio.config
> --kconfig-add CONFIG_ARM64_MODULE_PLTS=y --kconfig-add
> CONFIG_SYN_COOKIES=y --kconfig-add CONFIG_SCHEDSTATS=y
> CROSS_COMPILE_COMPAT=arm-linux-gnueabihf-
>
> Bad config link,
> https://builds.tuxbuild.com/2HcnnvEDD3gSr1zmS5DHzqPG2cJ/config
>
>>
>> thanks,
>>
>> greg k-h
>
> - Naresh
> .
>
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-25 8:05 ` Naresh Kamboju
2022-11-25 9:42 ` YueHaibing
@ 2022-11-25 10:02 ` Arnd Bergmann
2022-11-25 10:25 ` YueHaibing
1 sibling, 1 reply; 168+ messages in thread
From: Arnd Bergmann @ 2022-11-25 10:02 UTC (permalink / raw)
To: Naresh Kamboju, Greg Kroah-Hartman, YueHaibing
Cc: stable, patches, linux-kernel, Linus Torvalds, Andrew Morton,
Guenter Roeck, shuah, patches, lkft-triage, Pavel Machek,
Jon Hunter, Florian Fainelli, Sudip Mukherjee, srw, rwarsow,
Netdev, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Daniel Díaz
On Fri, Nov 25, 2022, at 09:05, Naresh Kamboju wrote:
> On Fri, 25 Nov 2022 at 12:57, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>> On Thu, Nov 24, 2022 at 09:17:36PM +0530, Naresh Kamboju wrote:
>> >
>> > Daniel bisected this reported problem and found the first bad commit,
>> >
>> > YueHaibing <yuehaibing@huawei.com>
>> > net: broadcom: Fix BCMGENET Kconfig
>>
>> But that is in 5.10.155, 5.15.79, 6.0.9, and 6.1-rc5. It is not new to
>> this -rc release.
>
> It started from 5.10.155 and this is only seen on 5.10 and other
> branches 5.15, 6.0 and mainline are looking good.
I think the original patch is wrong and should be fixed upstream.
The backported patch in question is a one-line Kconfig change doing
diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index f4e1ca68d831..55dfdb34e37b 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -77,7 +77,7 @@ config BCMGENET
select BCM7XXX_PHY
select MDIO_BCM_UNIMAC
select DIMLIB
- select BROADCOM_PHY if ARCH_BCM2835
+ select BROADCOM_PHY if (ARCH_BCM2835 && PTP_1588_CLOCK_OPTIONAL)
help
This driver supports the built-in Ethernet MACs found in the
Broadcom BCM7xxx Set Top Box family chipset.
which fixes the build on kernels that contain 99addbe31f55 ("net:
broadcom: Select BROADCOM_PHY for BCMGENET") and enable
BCMGENET=y but PTP_1588_CLOCK_OPTIONAL=m, which otherwise
leads to a link failure.
The patch unfortunately solves it by replacing it with a runtime
failure by no longer linking in the PHY driver (as found by Naresh).
I think the correct fix would be to propagate the dependency down
to BCMGENET:
diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index f4e1ca68d831..f4ca0c6c0f51 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -71,6 +71,7 @@ config BCM63XX_ENET
config BCMGENET
tristate "Broadcom GENET internal MAC support"
depends on HAS_IOMEM
+ depends on PTP_1588_CLOCK_OPTIONAL || !ARCH_BCM2835
select MII
select PHYLIB
select FIXED_PHY
With this change, the broken config is no longer possible, instead
forcing BCMGENET to be =m when building for ARCH_BCM2835 with
PTP_1588_CLOCK=m.
Arnd
^ permalink raw reply related [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-25 10:02 ` Arnd Bergmann
@ 2022-11-25 10:25 ` YueHaibing
2022-11-25 10:32 ` Arnd Bergmann
0 siblings, 1 reply; 168+ messages in thread
From: YueHaibing @ 2022-11-25 10:25 UTC (permalink / raw)
To: Arnd Bergmann, Naresh Kamboju, Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, Linus Torvalds, Andrew Morton,
Guenter Roeck, shuah, patches, lkft-triage, Pavel Machek,
Jon Hunter, Florian Fainelli, Sudip Mukherjee, srw, rwarsow,
Netdev, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Daniel Díaz
On 2022/11/25 18:02, Arnd Bergmann wrote:
> On Fri, Nov 25, 2022, at 09:05, Naresh Kamboju wrote:
>> On Fri, 25 Nov 2022 at 12:57, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>>> On Thu, Nov 24, 2022 at 09:17:36PM +0530, Naresh Kamboju wrote:
>>>>
>>>> Daniel bisected this reported problem and found the first bad commit,
>>>>
>>>> YueHaibing <yuehaibing@huawei.com>
>>>> net: broadcom: Fix BCMGENET Kconfig
>>>
>>> But that is in 5.10.155, 5.15.79, 6.0.9, and 6.1-rc5. It is not new to
>>> this -rc release.
>>
>> It started from 5.10.155 and this is only seen on 5.10 and other
>> branches 5.15, 6.0 and mainline are looking good.
>
> I think the original patch is wrong and should be fixed upstream.
> The backported patch in question is a one-line Kconfig change doing
It seems lts 5.10 do not contain commit e5f31552674e ("ethernet: fix PTP_1588_CLOCK dependencies"),
there is not PTP_1588_CLOCK_OPTIONAL option.
>
> diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
> index f4e1ca68d831..55dfdb34e37b 100644
> --- a/drivers/net/ethernet/broadcom/Kconfig
> +++ b/drivers/net/ethernet/broadcom/Kconfig
> @@ -77,7 +77,7 @@ config BCMGENET
> select BCM7XXX_PHY
> select MDIO_BCM_UNIMAC
> select DIMLIB
> - select BROADCOM_PHY if ARCH_BCM2835
> + select BROADCOM_PHY if (ARCH_BCM2835 && PTP_1588_CLOCK_OPTIONAL)
> help
> This driver supports the built-in Ethernet MACs found in the
> Broadcom BCM7xxx Set Top Box family chipset.
>
> which fixes the build on kernels that contain 99addbe31f55 ("net:
> broadcom: Select BROADCOM_PHY for BCMGENET") and enable
> BCMGENET=y but PTP_1588_CLOCK_OPTIONAL=m, which otherwise
> leads to a link failure.
>
> The patch unfortunately solves it by replacing it with a runtime
> failure by no longer linking in the PHY driver (as found by Naresh).
>
> I think the correct fix would be to propagate the dependency down
> to BCMGENET:
>
> diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
> index f4e1ca68d831..f4ca0c6c0f51 100644
> --- a/drivers/net/ethernet/broadcom/Kconfig
> +++ b/drivers/net/ethernet/broadcom/Kconfig
> @@ -71,6 +71,7 @@ config BCM63XX_ENET
> config BCMGENET
> tristate "Broadcom GENET internal MAC support"
> depends on HAS_IOMEM
> + depends on PTP_1588_CLOCK_OPTIONAL || !ARCH_BCM2835
> select MII
> select PHYLIB
> select FIXED_PHY
>
> With this change, the broken config is no longer possible, instead
> forcing BCMGENET to be =m when building for ARCH_BCM2835 with
> PTP_1588_CLOCK=m.
>
> Arnd
> .
>
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-25 10:25 ` YueHaibing
@ 2022-11-25 10:32 ` Arnd Bergmann
2022-11-25 10:43 ` YueHaibing
2022-11-25 14:54 ` Greg Kroah-Hartman
0 siblings, 2 replies; 168+ messages in thread
From: Arnd Bergmann @ 2022-11-25 10:32 UTC (permalink / raw)
To: YueHaibing, Naresh Kamboju, Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, Linus Torvalds, Andrew Morton,
Guenter Roeck, shuah, patches, lkft-triage, Pavel Machek,
Jon Hunter, Florian Fainelli, Sudip Mukherjee, srw, rwarsow,
Netdev, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Daniel Díaz
On Fri, Nov 25, 2022, at 11:25, YueHaibing wrote:
> On 2022/11/25 18:02, Arnd Bergmann wrote:
>> On Fri, Nov 25, 2022, at 09:05, Naresh Kamboju wrote:
>>> On Fri, 25 Nov 2022 at 12:57, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>>>> On Thu, Nov 24, 2022 at 09:17:36PM +0530, Naresh Kamboju wrote:
>>>>>
>>>>> Daniel bisected this reported problem and found the first bad commit,
>>>>>
>>>>> YueHaibing <yuehaibing@huawei.com>
>>>>> net: broadcom: Fix BCMGENET Kconfig
>>>>
>>>> But that is in 5.10.155, 5.15.79, 6.0.9, and 6.1-rc5. It is not new to
>>>> this -rc release.
>>>
>>> It started from 5.10.155 and this is only seen on 5.10 and other
>>> branches 5.15, 6.0 and mainline are looking good.
>>
>> I think the original patch is wrong and should be fixed upstream.
>> The backported patch in question is a one-line Kconfig change doing
>
> It seems lts 5.10 do not contain commit e5f31552674e ("ethernet: fix
> PTP_1588_CLOCK dependencies"),
> there is not PTP_1588_CLOCK_OPTIONAL option.
Ok, so there is a second problem then.
Greg, please just revert fbb4e8e6dc7b ("net: broadcom: Fix BCMGENET Kconfig")
in stable/linux-5.10.y: it depends on e5f31552674e ("ethernet: fix
PTP_1588_CLOCK dependencies"), which we probably don't want backported
from 5.15 to 5.10.
YueHaibing, do you agree with my suggestion for improving the
upstream 8d820bc9d12b ("net: broadcom: Fix BCMGENET Kconfig")
commit? Can you send a follow-up fix, or should I?
Arnd
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-25 10:32 ` Arnd Bergmann
@ 2022-11-25 10:43 ` YueHaibing
2022-11-25 14:54 ` Greg Kroah-Hartman
1 sibling, 0 replies; 168+ messages in thread
From: YueHaibing @ 2022-11-25 10:43 UTC (permalink / raw)
To: Arnd Bergmann, Naresh Kamboju, Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, Linus Torvalds, Andrew Morton,
Guenter Roeck, shuah, patches, lkft-triage, Pavel Machek,
Jon Hunter, Florian Fainelli, Sudip Mukherjee, srw, rwarsow,
Netdev, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Daniel Díaz
On 2022/11/25 18:32, Arnd Bergmann wrote:
> On Fri, Nov 25, 2022, at 11:25, YueHaibing wrote:
>> On 2022/11/25 18:02, Arnd Bergmann wrote:
>>> On Fri, Nov 25, 2022, at 09:05, Naresh Kamboju wrote:
>>>> On Fri, 25 Nov 2022 at 12:57, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>>>>> On Thu, Nov 24, 2022 at 09:17:36PM +0530, Naresh Kamboju wrote:
>>>>>>
>>>>>> Daniel bisected this reported problem and found the first bad commit,
>>>>>>
>>>>>> YueHaibing <yuehaibing@huawei.com>
>>>>>> net: broadcom: Fix BCMGENET Kconfig
>>>>>
>>>>> But that is in 5.10.155, 5.15.79, 6.0.9, and 6.1-rc5. It is not new to
>>>>> this -rc release.
>>>>
>>>> It started from 5.10.155 and this is only seen on 5.10 and other
>>>> branches 5.15, 6.0 and mainline are looking good.
>>>
>>> I think the original patch is wrong and should be fixed upstream.
>>> The backported patch in question is a one-line Kconfig change doing
>>
>> It seems lts 5.10 do not contain commit e5f31552674e ("ethernet: fix
>> PTP_1588_CLOCK dependencies"),
>> there is not PTP_1588_CLOCK_OPTIONAL option.
>
> Ok, so there is a second problem then.
>
> Greg, please just revert fbb4e8e6dc7b ("net: broadcom: Fix BCMGENET Kconfig")
> in stable/linux-5.10.y: it depends on e5f31552674e ("ethernet: fix
> PTP_1588_CLOCK dependencies"), which we probably don't want backported
> from 5.15 to 5.10.
>
> YueHaibing, do you agree with my suggestion for improving the
> upstream 8d820bc9d12b ("net: broadcom: Fix BCMGENET Kconfig")
> commit? Can you send a follow-up fix, or should I?
Ok, I will take care this.
>
> Arnd
> .
>
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-25 10:32 ` Arnd Bergmann
2022-11-25 10:43 ` YueHaibing
@ 2022-11-25 14:54 ` Greg Kroah-Hartman
1 sibling, 0 replies; 168+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-25 14:54 UTC (permalink / raw)
To: Arnd Bergmann
Cc: YueHaibing, Naresh Kamboju, stable, patches, linux-kernel,
Linus Torvalds, Andrew Morton, Guenter Roeck, shuah, patches,
lkft-triage, Pavel Machek, Jon Hunter, Florian Fainelli,
Sudip Mukherjee, srw, rwarsow, Netdev, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Daniel Díaz
On Fri, Nov 25, 2022 at 11:32:49AM +0100, Arnd Bergmann wrote:
> On Fri, Nov 25, 2022, at 11:25, YueHaibing wrote:
> > On 2022/11/25 18:02, Arnd Bergmann wrote:
> >> On Fri, Nov 25, 2022, at 09:05, Naresh Kamboju wrote:
> >>> On Fri, 25 Nov 2022 at 12:57, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> >>>> On Thu, Nov 24, 2022 at 09:17:36PM +0530, Naresh Kamboju wrote:
> >>>>>
> >>>>> Daniel bisected this reported problem and found the first bad commit,
> >>>>>
> >>>>> YueHaibing <yuehaibing@huawei.com>
> >>>>> net: broadcom: Fix BCMGENET Kconfig
> >>>>
> >>>> But that is in 5.10.155, 5.15.79, 6.0.9, and 6.1-rc5. It is not new to
> >>>> this -rc release.
> >>>
> >>> It started from 5.10.155 and this is only seen on 5.10 and other
> >>> branches 5.15, 6.0 and mainline are looking good.
> >>
> >> I think the original patch is wrong and should be fixed upstream.
> >> The backported patch in question is a one-line Kconfig change doing
> >
> > It seems lts 5.10 do not contain commit e5f31552674e ("ethernet: fix
> > PTP_1588_CLOCK dependencies"),
> > there is not PTP_1588_CLOCK_OPTIONAL option.
>
> Ok, so there is a second problem then.
>
> Greg, please just revert fbb4e8e6dc7b ("net: broadcom: Fix BCMGENET Kconfig")
> in stable/linux-5.10.y: it depends on e5f31552674e ("ethernet: fix
> PTP_1588_CLOCK dependencies"), which we probably don't want backported
> from 5.15 to 5.10.
Now reverted, thanks.
greg k-h
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (153 preceding siblings ...)
2022-11-24 10:46 ` Sudip Mukherjee
@ 2022-11-26 2:39 ` zhouzhixiu
2022-11-28 22:37 ` Florian Fainelli
155 siblings, 0 replies; 168+ messages in thread
From: zhouzhixiu @ 2022-11-26 2:39 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee, srw,
rwarsow
On 2022/11/23 16:49, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.156 release.
> There are 149 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 Fri, 25 Nov 2022 08:45:20 +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/v5.x/stable-review/patch-5.10.156-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-5.10.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
> -------------
Tested on arm64 and x86 for 5.10.156-rc1,
Kernel
repo:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Branch: linux-5.10.y
Version: 5.10.156-rc1
Commit: 38866e257e18dbc209f4c355fe57123b0c2e0e4a
Compiler: gcc version 7.3.0 (GCC)
arm64:
--------------------------------------------------------------------
Testcase Result Summary:
total: 9023
passed: 9023
failed: 0
timeout: 0
--------------------------------------------------------------------
x86:
--------------------------------------------------------------------
Testcase Result Summary:
total: 9023
passed: 9023
failed: 0
timeout: 0
--------------------------------------------------------------------
Tested-by: Hulk Robot <hulkrobot@huawei.com>
^ permalink raw reply [flat|nested] 168+ messages in thread
* Re: [PATCH 5.10 000/149] 5.10.156-rc1 review
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
` (154 preceding siblings ...)
2022-11-26 2:39 ` zhouzhixiu
@ 2022-11-28 22:37 ` Florian Fainelli
155 siblings, 0 replies; 168+ messages in thread
From: Florian Fainelli @ 2022-11-28 22:37 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, sudipm.mukherjee, srw, rwarsow
On 11/23/22 00:49, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.156 release.
> There are 149 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 Fri, 25 Nov 2022 08:45:20 +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/v5.x/stable-review/patch-5.10.156-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-5.10.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on
BMIPS_GENERIC:
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 168+ messages in thread
end of thread, other threads:[~2022-11-28 22:37 UTC | newest]
Thread overview: 168+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-23 8:49 [PATCH 5.10 000/149] 5.10.156-rc1 review Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 001/149] ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe" Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 002/149] ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe" Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 003/149] ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe" Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 004/149] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 005/149] ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 006/149] spi: intel: Fix the offset to get the 64K erase opcode Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 007/149] ASoC: codecs: jz4725b: add missed Line In power control bit Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 008/149] ASoC: codecs: jz4725b: fix reported volume for Master ctl Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 009/149] ASoC: codecs: jz4725b: use right control for Capture Volume Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 010/149] ASoC: codecs: jz4725b: fix capture selector naming Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 011/149] ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 Greg Kroah-Hartman
2022-11-24 13:47 ` Salvatore Bonaccorso
2022-11-25 7:29 ` Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 012/149] selftests/futex: fix build for clang Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 013/149] selftests/intel_pstate: fix build for ARCH=x86_64 Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 014/149] rtc: cmos: fix build on non-ACPI platforms Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 015/149] ASoC: rt1308-sdw: add the default value of some registers Greg Kroah-Hartman
2022-11-23 8:49 ` [PATCH 5.10 016/149] drm/amd/display: Remove wrong pipe control lock Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 017/149] NFSv4: Retry LOCK on OLD_STATEID during delegation return Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 018/149] i2c: tegra: Allocate DMA memory for DMA engine Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 019/149] i2c: i801: add lis3lv02ds I2C address for Vostro 5568 Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 020/149] drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 021/149] btrfs: remove pointless and double ulist frees in error paths of qgroup tests Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 022/149] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 023/149] ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route" Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 024/149] ALSA: hda/realtek: fix speakers and micmute on HP 855 G8 Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 025/149] mtd: spi-nor: intel-spi: Disable write protection only if asked Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 026/149] spi: intel: Use correct mask for flash and protected regions Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 027/149] mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 028/149] drm/amd/pm: support power source switch on Sienna Cichlid Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 029/149] drm/amd/pm: Read BIF STRAP also for BACO check Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 030/149] drm/amd/pm: disable BACO entry/exit completely on several sienna cichlid cards Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 031/149] drm/amdgpu: disable BACO on special BEIGE_GOBY card Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 032/149] spi: stm32: Print summary callbacks suppressed message Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 033/149] ASoC: core: Fix use-after-free in snd_soc_exit() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 034/149] ASoC: tas2770: Fix set_tdm_slot in case of single slot Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 035/149] ASoC: tas2764: " Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 036/149] serial: 8250: Remove serial_rs485 sanitization from em485 Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 037/149] serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 038/149] serial: 8250_omap: remove wait loop from Errata i202 workaround Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 039/149] serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 040/149] serial: 8250: omap: Flush PM QOS work on remove Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 041/149] serial: imx: Add missing .thaw_noirq hook Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 042/149] tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 043/149] bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 044/149] ASoC: soc-utils: Remove __exit for snd_soc_util_exit() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 045/149] sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 046/149] sctp: clear out_curr if all frag chunks of current msg are pruned Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 047/149] block: sed-opal: kmalloc the cmd/resp buffers Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 048/149] arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 049/149] siox: fix possible memory leak in siox_device_add() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 050/149] parport_pc: Avoid FIFO port location truncation Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 051/149] pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 052/149] drm/panel: simple: set bpc field for logic technologies displays Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 053/149] drm/drv: Fix potential memory leak in drm_dev_init() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 054/149] drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 055/149] ARM: dts: imx7: Fix NAND controller size-cells Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 056/149] arm64: dts: imx8mm: " Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 057/149] arm64: dts: imx8mn: " Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 058/149] ata: libata-transport: fix double ata_host_put() in ata_tport_add() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 059/149] ata: libata-transport: fix error handling " Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 060/149] ata: libata-transport: fix error handling in ata_tlink_add() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 061/149] ata: libata-transport: fix error handling in ata_tdev_add() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 062/149] bpf: Initialize same number of free nodes for each pcpu_freelist Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 063/149] net: bgmac: Drop free_netdev() from bgmac_enet_remove() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 064/149] mISDN: fix possible memory leak in mISDN_dsp_element_register() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 065/149] net: hinic: Fix error handling in hinic_module_init() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 066/149] net: liquidio: release resources when liquidio driver open failed Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 067/149] mISDN: fix misuse of put_device() in mISDN_register_device() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 068/149] net: macvlan: Use built-in RCU list checking Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 069/149] net: caif: fix double disconnect client in chnl_net_open() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 070/149] bnxt_en: Remove debugfs when pci_register_driver failed Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 071/149] xen/pcpu: fix possible memory leak in register_pcpu() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 072/149] net: ionic: Fix error handling in ionic_init_module() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 073/149] net: ena: Fix error handling in ena_init() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 074/149] drbd: use after free in drbd_create_device() Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 075/149] platform/x86/intel: pmc: Dont unconditionally attach Intel PMC when virtualized Greg Kroah-Hartman
2022-11-23 8:50 ` [PATCH 5.10 076/149] cifs: add check for returning value of SMB2_close_init Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 077/149] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 078/149] net/x25: Fix skb leak in x25_lapb_receive_frame() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 079/149] cifs: Fix wrong return value checking when GETFLAGS Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 080/149] net: thunderbolt: Fix error handling in tbnet_init() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 081/149] cifs: add check for returning value of SMB2_set_info_init Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 082/149] ftrace: Fix the possible incorrect kernel message Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 083/149] ftrace: Optimize the allocation for mcount entries Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 084/149] ftrace: Fix null pointer dereference in ftrace_add_mod() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 085/149] ring_buffer: Do not deactivate non-existant pages Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 086/149] tracing/ring-buffer: Have polling block on watermark Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 087/149] tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 088/149] tracing: Fix wild-memory-access in register_synth_event() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 089/149] tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 090/149] tracing: kprobe: Fix potential null-ptr-deref on trace_array " Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 091/149] ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 092/149] ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 093/149] ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360 Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 094/149] Revert "usb: dwc3: disable USB core PHY management" Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 095/149] slimbus: stream: correct presence rate frequencies Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 096/149] speakup: fix a segfault caused by switching consoles Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 097/149] USB: bcma: Make GPIO explicitly optional Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 098/149] USB: serial: option: add Sierra Wireless EM9191 Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 099/149] USB: serial: option: remove old LARA-R6 PID Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 100/149] USB: serial: option: add u-blox LARA-R6 00B modem Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 101/149] USB: serial: option: add u-blox LARA-L6 modem Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 102/149] USB: serial: option: add Fibocom FM160 0x0111 composition Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 103/149] usb: add NO_LPM quirk for Realforce 87U Keyboard Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 104/149] usb: chipidea: fix deadlock in ci_otg_del_timer Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 105/149] usb: typec: mux: Enter safe mode only when pins need to be reconfigured Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 106/149] iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 107/149] iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 108/149] iio: adc: mp2629: fix wrong comparison of channel Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 109/149] iio: adc: mp2629: fix potential array out of bound access Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 110/149] iio: pressure: ms5611: changed hardcoded SPI speed to value limited Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 111/149] dm ioctl: fix misbehavior if list_versions races with module loading Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 112/149] serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 113/149] serial: 8250: Flush DMA Rx on RLSI Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 114/149] serial: 8250_lpss: Configure DMA also w/o DMA filter Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 115/149] Input: iforce - invert valid length check when fetching device IDs Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 116/149] maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 117/149] scsi: zfcp: Fix double free of FSF request when qdio send fails Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 118/149] iommu/vt-d: Set SRE bit only when hardware has SRS cap Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 119/149] firmware: coreboot: Register bus in module init Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 120/149] mmc: core: properly select voltage range without power cycle Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 121/149] mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 122/149] mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 123/149] docs: update mediator contact information in CoC doc Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 124/149] misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 125/149] perf/x86/intel/pt: Fix sampling using single range output Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 126/149] nvme: restrict management ioctls to admin Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 127/149] nvme: ensure subsystem reset is single threaded Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 128/149] net: fix a concurrency bug in l2tp_tunnel_register() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 129/149] ring-buffer: Include dropped pages in counting dirty patches Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 130/149] usbnet: smsc95xx: Fix deadlock on runtime resume Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 131/149] stddef: Introduce struct_group() helper macro Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 132/149] net: use struct_group to copy ip/ipv6 header addresses Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 133/149] scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 134/149] scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper() Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 135/149] kprobes: Skip clearing aggrprobes post_handler in kprobe-on-ftrace case Greg Kroah-Hartman
2022-11-23 8:51 ` [PATCH 5.10 136/149] Input: i8042 - fix leaking of platform device on module removal Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 137/149] uapi/linux/stddef.h: Add include guards Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 138/149] macvlan: enforce a consistent minimal mtu Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 139/149] tcp: cdg: allow tcp_cdg_release() to be called multiple times Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 140/149] kcm: avoid potential race in kcm_tx_work Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 141/149] kcm: close race conditions on sk_receive_queue Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 142/149] 9p: trans_fd/p9_conn_cancel: drop client lock earlier Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 143/149] gfs2: Check sb_bsize_shift after reading superblock Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 144/149] gfs2: Switch from strlcpy to strscpy Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 145/149] 9p/trans_fd: always use O_NONBLOCK read/write Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 146/149] mm: fs: initialize fsdata passed to write_begin/write_end interface Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 147/149] ntfs: fix use-after-free in ntfs_attr_find() Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 148/149] ntfs: fix out-of-bounds read " Greg Kroah-Hartman
2022-11-23 8:52 ` [PATCH 5.10 149/149] ntfs: check overflow when iterating ATTR_RECORDs Greg Kroah-Hartman
2022-11-23 11:11 ` [PATCH 5.10 000/149] 5.10.156-rc1 review Rudi Heitbaum
2022-11-23 11:16 ` Pavel Machek
2022-11-23 14:00 ` Naresh Kamboju
2022-11-24 15:47 ` Naresh Kamboju
2022-11-25 7:27 ` Greg Kroah-Hartman
2022-11-25 8:05 ` Naresh Kamboju
2022-11-25 9:42 ` YueHaibing
2022-11-25 10:02 ` Arnd Bergmann
2022-11-25 10:25 ` YueHaibing
2022-11-25 10:32 ` Arnd Bergmann
2022-11-25 10:43 ` YueHaibing
2022-11-25 14:54 ` Greg Kroah-Hartman
2022-11-24 2:37 ` Guenter Roeck
2022-11-24 10:46 ` Sudip Mukherjee
2022-11-26 2:39 ` zhouzhixiu
2022-11-28 22:37 ` Florian Fainelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox