2022-07-19 13:53:58

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 000/231] 5.18.13-rc1 review

This is the start of the stable review cycle for the 5.18.13 release.
There are 231 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 Thu, 21 Jul 2022 11:43:40 +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.18.13-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.18.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>
Linux 5.18.13-rc1

Juergen Gross <[email protected]>
x86/pat: Fix x86_has_pat_wp()

Pali Rohár <[email protected]>
serial: mvebu-uart: correctly report configured baudrate value

Ilpo Järvinen <[email protected]>
serial: 8250: Fix PM usage_count for console handover

Ilpo Järvinen <[email protected]>
serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle

Ilpo Järvinen <[email protected]>
serial: stm32: Clear prev values before setting RTS delays

Dorian Rudolph <[email protected]>
power: supply: core: Fix boundary conditions in interpolation

Yi Yang <[email protected]>
serial: 8250: fix return error code in serial8250_request_std_resource()

Mario Limonciello <[email protected]>
ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory

Tony Krowiak <[email protected]>
s390/ap: fix error handling in __verify_queue_reservations()

Yangxi Xiang <[email protected]>
vt: fix memory overlapping when deleting chars in the buffer

Hans de Goede <[email protected]>
ACPI: video: Fix acpi_video_handles_brightness_key_presses()

Linus Torvalds <[email protected]>
signal handling: don't use BUG_ON() for debugging

Jason A. Donenfeld <[email protected]>
wireguard: selftests: always call kernel makefile

Jason A. Donenfeld <[email protected]>
wireguard: selftests: set fake real time in init

Keith Busch <[email protected]>
nvme: use struct group for generic command dwords

Keith Busch <[email protected]>
nvme-pci: phison e16 has bogus namespace ids

Egor Vorontsov <[email protected]>
ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0)

Egor Vorontsov <[email protected]>
ALSA: usb-audio: Add quirk for Fiero SC-01

John Veness <[email protected]>
ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices

Srinivas Neeli <[email protected]>
Revert "can: xilinx_can: Limit CANFD brp to 2"

Gabriel Fernandez <[email protected]>
ARM: dts: stm32: use the correct clock source for CEC on stm32mp151

Linus Walleij <[email protected]>
soc: ixp4xx/npe: Fix unused match warning

Juergen Gross <[email protected]>
x86: Clear .brk area at early boot

Jacky Bai <[email protected]>
pinctrl: imx: Add the zero base flag for imx93

Stafford Horne <[email protected]>
irqchip: or1k-pic: Undefine mask_ack for level triggered hardware

Charles Keepax <[email protected]>
ASoC: madera: Fix event generation for rate controls

Charles Keepax <[email protected]>
ASoC: madera: Fix event generation for OUT1 demux

Charles Keepax <[email protected]>
ASoC: cs47l15: Fix event generation for low power mux control

Charles Keepax <[email protected]>
ASoC: cs35l41: Add ASP TX3/4 source to register patch

Charles Keepax <[email protected]>
ASoC: dapm: Initialise kcontrol data for mux/demux controls

Shuming Fan <[email protected]>
ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error

Charles Keepax <[email protected]>
ASoC: cs35l41: Correct some control names

Charles Keepax <[email protected]>
ASoC: wm5110: Fix DRE control

Charles Keepax <[email protected]>
ASoC: wm_adsp: Fix event for preloader

Hans de Goede <[email protected]>
ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem

Mark Brown <[email protected]>
ASoC: wcd938x: Fix event generation for some controls

Mark Brown <[email protected]>
ASoC: wcd9335: Fix spurious event generation

Yassine Oudjana <[email protected]>
ASoC: wcd9335: Remove RX channel from old list before adding it to a new one

Peter Ujfalusi <[email protected]>
ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow

Peter Ujfalusi <[email protected]>
ASoC: SOF: Intel: hda-loader: Make sure that the fw load sequence is followed

Peter Ujfalusi <[email protected]>
ASoC: SOF: Intel: hda-dsp: Expose hda_dsp_core_power_up()

Pierre-Louis Bossart <[email protected]>
ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe

Pierre-Louis Bossart <[email protected]>
ASoC: rt7*-sdw: harden jack_detect_handler

Pierre-Louis Bossart <[email protected]>
ASoC: rt711: fix calibrate mutex initialization

Pierre-Louis Bossart <[email protected]>
ASoC: Intel: sof_sdw: handle errors on card registration

Pierre-Louis Bossart <[email protected]>
ASoC: rt711-sdca-sdw: fix calibrate mutex initialization

Pierre-Louis Bossart <[email protected]>
ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove

Haowen Bai <[email protected]>
pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux()

Mark Brown <[email protected]>
ASoC: ops: Fix off by one in range control validation

Jianglei Nie <[email protected]>
net: sfp: fix memory leak in sfp_probe()

Ruozhu Li <[email protected]>
nvme: fix regression when disconnect a recovering ctrl

Sagi Grimberg <[email protected]>
nvme-tcp: always fail a request when sending it failed

Michael Walle <[email protected]>
NFC: nxp-nci: don't print header length mismatch on i2c error

Hangyu Hua <[email protected]>
net: tipc: fix possible refcount leak in tipc_sk_create()

Javier Martinez Canillas <[email protected]>
fbdev: Disable sysfb device registration when removing conflicting FBs

Javier Martinez Canillas <[email protected]>
firmware: sysfb: Add sysfb_disable() helper function

Javier Martinez Canillas <[email protected]>
firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer

Kai-Heng Feng <[email protected]>
platform/x86: hp-wmi: Ignore Sanitization Mode event

Mark Pearson <[email protected]>
platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms

Mark Pearson <[email protected]>
platform/x86: thinkpad-acpi: profile capabilities as integer

Liang He <[email protected]>
cpufreq: pmac32-cpufreq: Fix refcount leak bug

John Garry <[email protected]>
scsi: hisi_sas: Limit max hw sectors for v3 HW

Florian Westphal <[email protected]>
netfilter: br_netfilter: do not skip all hooks with 0 priority

Florian Westphal <[email protected]>
netfilter: nf_tables: avoid skb access on nf_stolen

Stephan Gerhold <[email protected]>
virtio_mmio: Restore guest page size on resume

Stephan Gerhold <[email protected]>
virtio_mmio: Add missing PM calls to freeze/restore

Gayatri Kammela <[email protected]>
platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver

Parav Pandit <[email protected]>
vduse: Tie vduse mgmtdev and its device

Eli Cohen <[email protected]>
vdpa/mlx5: Initialize CVQ vringh only once

Nathan Lynch <[email protected]>
powerpc/xive/spapr: correct bitmap allocation size

Namjae Jeon <[email protected]>
ksmbd: use SOCK_NONBLOCK type for kernel_accept()

Israel Rukshin <[email protected]>
nvme: fix block device naming collision

Bjorn Andersson <[email protected]>
scsi: ufs: core: Drop loglevel of WriteBoost message

Ming Lei <[email protected]>
scsi: megaraid: Clear READ queue map's nr_queues

Vasily Gorbik <[email protected]>
s390/nospec: build expoline.o for modules_prepare target

Jiri Slaby <[email protected]>
tty: use new tty_insert_flip_string_and_push_buffer() in pty_write()

Jiri Slaby <[email protected]>
tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push()

Marc Kleine-Budde <[email protected]>
tee: tee_get_drvdata(): fix description of return value

Bryan O'Donoghue <[email protected]>
ASoC: dt-bindings: Fix description for msm8916

Linus Walleij <[email protected]>
ARM: 9212/1: domain: Modify Kconfig help text

Linus Walleij <[email protected]>
ARM: 9211/1: domain: drop modify_domain()

Peter Zijlstra <[email protected]>
x86/cpu/amd: Add Spectral Chicken

Peter Zijlstra <[email protected]>
x86/xen: Rename SYS* entry points

Peter Zijlstra <[email protected]>
objtool: Update Retpoline validation

Alexandre Chartre <[email protected]>
x86/bugs: Report AMD retbleed vulnerability

Kim Phillips <[email protected]>
x86/sev: Avoid using __x86_return_thunk

Peter Zijlstra <[email protected]>
x86/kvm: Fix SETcc emulation for return thunks

Muchun Song <[email protected]>
mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE

Tariq Toukan <[email protected]>
net/tls: Check for errors in tls_device_init

Vitaly Kuznetsov <[email protected]>
KVM: x86: Fully initialize 'struct kvm_lapic_irq' in kvm_pv_kick_cpu_op()

Chia-Lin Kao (AceLan) <[email protected]>
net: atlantic: remove aq_nic_deinit() when resume

Chia-Lin Kao (AceLan) <[email protected]>
net: atlantic: remove deep parameter on suspend/resume functions

Íñigo Huguet <[email protected]>
sfc: fix kernel panic when creating VF

Andrea Mayer <[email protected]>
seg6: bpf: fix skb checksum in bpf_push_seg6_encap()

Andrea Mayer <[email protected]>
seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors

Andrea Mayer <[email protected]>
seg6: fix skb checksum evaluation in SRH encapsulation/insertion

Xiubo Li <[email protected]>
netfs: do not unlock and put the folio twice

Íñigo Huguet <[email protected]>
sfc: fix use after free when disabling sriov

Steve French <[email protected]>
smb3: workaround negprot bug in some Samba servers

Michel Dänzer <[email protected]>
drm/amd/display: Ensure valid event timestamp for cursor-only commits

Yefim Barashkin <[email protected]>
drm/amd/pm: Prevent divide by zero

Mario Kleiner <[email protected]>
drm/amd/display: Only use depth 36 bpp linebuffers on DCN display engines.

Prike Liang <[email protected]>
drm/amdkfd: correct the MEC atomic support firmware checking for GC 10.3.7

Fangzhi Zuo <[email protected]>
drm/amd/display: Ignore First MST Sideband Message Return Error

Jianglei Nie <[email protected]>
ima: Fix potential memory leak in ima_init_crypto()

Coiby Xu <[email protected]>
ima: force signature verification when CONFIG_KEXEC_SIG is configured

Dan Carpenter <[email protected]>
net: stmmac: fix leaks in probe

Liang He <[email protected]>
net: ftgmac100: Hold reference returned by of_get_child_by_name()

Kuniyuki Iwashima <[email protected]>
nexthop: Fix data-races around nexthop_compat_mode.

Kuniyuki Iwashima <[email protected]>
ipv4: Fix data-races around sysctl_ip_dynaddr.

Kuniyuki Iwashima <[email protected]>
tcp: Fix a data-race around sysctl_tcp_ecn_fallback.

Kuniyuki Iwashima <[email protected]>
tcp: Fix data-races around sysctl_tcp_ecn.

Kuniyuki Iwashima <[email protected]>
raw: Fix a data-race around sysctl_raw_l3mdev_accept.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_ratemask.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_ratelimit.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_errors_use_inbound_ifaddr.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_echo_ignore_broadcasts.

Kuniyuki Iwashima <[email protected]>
icmp: Fix data-races around sysctl_icmp_echo_enable_probe.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_echo_ignore_all.

Kuniyuki Iwashima <[email protected]>
tcp: Fix a data-race around sysctl_max_tw_buckets.

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data-races in proc_dointvec_ms_jiffies().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data-races in proc_dou8vec_minmax().

Pavan Chebbi <[email protected]>
bnxt_en: Fix bnxt_refclk_read()

Vikas Gupta <[email protected]>
bnxt_en: fix livepatch query

Michael Chan <[email protected]>
bnxt_en: Fix bnxt_reinit_after_abort() code path

Kashyap Desai <[email protected]>
bnxt_en: reclaim max resources if sriov enable fails

Andrzej Hajda <[email protected]>
drm/i915/selftests: fix subtraction overflow bug

Chris Wilson <[email protected]>
drm/i915/gt: Serialize TLB invalidates with GT resets

Chris Wilson <[email protected]>
drm/i915/gt: Serialize GRDOM access between multiple engine resets

Matthew Auld <[email protected]>
drm/i915/ttm: fix sg_table construction

Dan Carpenter <[email protected]>
drm/i915/selftests: fix a couple IS_ERR() vs NULL tests

Douglas Anderson <[email protected]>
tracing: Fix sleeping while atomic in kdb ftdump

Paul M Stillwell Jr <[email protected]>
ice: change devlink code to read NVM in blocks

Paul M Stillwell Jr <[email protected]>
ice: handle E822 generic device ID in PLDM header

Yevhen Orlov <[email protected]>
net: marvell: prestera: fix missed deinit sequence

Jeff Layton <[email protected]>
lockd: fix nlm_close_files

Jeff Layton <[email protected]>
lockd: set fl_owner when unlocking files

Chuck Lever <[email protected]>
NFSD: Decode NFSv4 birth time attribute

Paolo Abeni <[email protected]>
mptcp: fix subflow traversal at disconnect time

Demi Marie Obenour <[email protected]>
xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE

Dan Carpenter <[email protected]>
drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist()

Anup Patel <[email protected]>
RISC-V: KVM: Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests()

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: replace BUG_ON by element length check

Eric Dumazet <[email protected]>
vlan: fix memory leak in vlan_newlink()

Baowen Zheng <[email protected]>
nfp: fix issue of skb segments exceeds descriptor limitation

Pablo Neira Ayuso <[email protected]>
netfilter: nf_log: incorrect offset to network header

William Zhang <[email protected]>
arm64: dts: broadcom: bcm4908: Fix cpu node for smp boot

William Zhang <[email protected]>
arm64: dts: broadcom: bcm4908: Fix timer node for BCM4906 SoC

Michal Suchanek <[email protected]>
ARM: dts: sunxi: Fix SPI NOR campatible on Orange Pi Zero

Ryan Wanner <[email protected]>
ARM: dts: at91: sama5d2: Fix typo in i2s1 node

Kuniyuki Iwashima <[email protected]>
ipv4: Fix a data-race around sysctl_fib_sync_mem.

Kuniyuki Iwashima <[email protected]>
icmp: Fix data-races around sysctl.

Kuniyuki Iwashima <[email protected]>
cipso: Fix data-races around sysctl.

Kuniyuki Iwashima <[email protected]>
net: Fix data-races around sysctl_mem.

Kuniyuki Iwashima <[email protected]>
inetpeer: Fix data-races around sysctl.

Kuniyuki Iwashima <[email protected]>
tcp: Fix a data-race around sysctl_tcp_max_orphans.

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_dointvec_jiffies().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_doulongvec_minmax().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_douintvec_minmax().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_dointvec_minmax().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_douintvec().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_dointvec().

Pavel Skripkin <[email protected]>
net: ocelot: fix wrong time_after usage

Siddharth Vadapalli <[email protected]>
net: ethernet: ti: am65-cpsw: Fix devlink port register sequence

Jon Hunter <[email protected]>
net: stmmac: dwc-qos: Disable split header for Tegra194

Florian Westphal <[email protected]>
netfilter: conntrack: fix crash due to confirmed bit load reordering

Florian Westphal <[email protected]>
netfilter: conntrack: remove the percpu dying list

Florian Westphal <[email protected]>
netfilter: conntrack: include ecache dying list in dumps

Florian Westphal <[email protected]>
netfilter: ecache: use dedicated list for event redelivery

Florian Westphal <[email protected]>
netfilter: conntrack: split inner loop of list dumping to own function

Florian Westphal <[email protected]>
netfilter: ecache: move to separate structure

Peter Ujfalusi <[email protected]>
ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array

Peter Ujfalusi <[email protected]>
ASoC: Intel: Skylake: Correct the ssp rate discovery in skl_get_ssp_clks()

Hector Martin <[email protected]>
ASoC: tas2764: Fix amp gain register offset & default

Hector Martin <[email protected]>
ASoC: tas2764: Correct playback volume range

Martin Povišer <[email protected]>
ASoC: tas2764: Fix and extend FSYNC polarity handling

Martin Povišer <[email protected]>
ASoC: tas2764: Add post reset delays

Francesco Dolcini <[email protected]>
ASoC: sgtl5000: Fix noise on shutdown/remove

Huaxin Lu <[email protected]>
ima: Fix a potential integer overflow in ima_appraise_measurement

Daniele Ceraolo Spurio <[email protected]>
drm/i915/guc: ADL-N should use the same GuC FW as ADL-S

Hangyu Hua <[email protected]>
drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()

Alex Deucher <[email protected]>
drm/amdgpu/display: disable prefer_shadow for generic fb helpers

Alex Deucher <[email protected]>
drm/amdgpu: keep fbdev buffers pinned during suspend

Maxim Mikityanskiy <[email protected]>
net/mlx5e: Ring the TX doorbell on DMA errors

Gal Pressman <[email protected]>
net/mlx5e: Fix capability check for updating vnic env counters

Roi Dayan <[email protected]>
net/mlx5e: CT: Use own workqueue instead of mlx5e priv

Paul Blakey <[email protected]>
net/mlx5e: Fix enabling sriov while tc nic rules are offloaded

Tariq Toukan <[email protected]>
net/mlx5e: kTLS, Fix build time constant test in RX

Tariq Toukan <[email protected]>
net/mlx5e: kTLS, Fix build time constant test in TX

Zhen Lei <[email protected]>
ARM: 9210/1: Mark the FDT_FIXED sections as shareable

Ard Biesheuvel <[email protected]>
ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle

Cristian Ciocaltea <[email protected]>
spi: amd: Limit max transfer and message size

Conor Dooley <[email protected]>
riscv: dts: microchip: hook up the mpfs' l2cache

Kris Bahnsen <[email protected]>
ARM: dts: imx6qdl-ts7970: Fix ngpio typo and count

Sean Anderson <[email protected]>
arm64: dts: ls1028a: Update SFP node to include clock

Serge Semin <[email protected]>
reset: Fix devm bulk optional exclusive control getter

Xiu Jianfeng <[email protected]>
Revert "evm: Fix memleak in init_desc"

Geert Uytterhoeven <[email protected]>
sh: convert nommu io{re,un}map() to static inline functions

Ryusuke Konishi <[email protected]>
nilfs2: fix incorrect masking of permission flags for symlinks

Dave Chinner <[email protected]>
fs/remap: constrain dedupe of EOF blocks

Dmitry Osipenko <[email protected]>
drm/panfrost: Fix shrinker list corruption by madvise IOCTL

Dmitry Osipenko <[email protected]>
drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error

Christoph Hellwig <[email protected]>
btrfs: zoned: fix a leaked bioc in read_zone_info

Filipe Manana <[email protected]>
btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and inline extents

Tejun Heo <[email protected]>
cgroup: Use separate src/dst nodes when preloading css_sets for migration

Felix Fietkau <[email protected]>
wifi: mac80211: fix queue selection for mesh/OCB interfaces

Ard Biesheuvel <[email protected]>
ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction

Dmitry Osipenko <[email protected]>
ARM: 9213/1: Print message about disabled Spectre workarounds only once

Nicolas Dichtel <[email protected]>
ip: fix dflt addr selection for connected nexthop

Steven Rostedt (Google) <[email protected]>
net: sock: tracing: Fix sock_exceed_buf_limit not to dereference stale pointer

Zheng Yejian <[email protected]>
tracing/histograms: Fix memory leak problem

Baolin Wang <[email protected]>
mm/damon: use set_huge_pte_at() to make huge pte old

Gowans, James <[email protected]>
mm: split huge PUD on wp_huge_pud fallback

Muchun Song <[email protected]>
mm: sparsemem: fix missing higher order allocation splitting

Axel Rasmussen <[email protected]>
mm: userfaultfd: fix UFFDIO_CONTINUE on fallocated shmem pages

Oleg Nesterov <[email protected]>
fix race between exit_itimers() and /proc/pid/timers

Juergen Gross <[email protected]>
xen/netback: avoid entering xenvif_rx_next_skb() with an empty rx queue

Meng Tang <[email protected]>
ALSA: hda/realtek - Enable the headset-mic on a Xiaomi's laptop

Meng Tang <[email protected]>
ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc221

Jeremy Szu <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP machines

Meng Tang <[email protected]>
ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671

Meng Tang <[email protected]>
ALSA: hda/realtek: Fix headset mic for Acer SF313-51

Meng Tang <[email protected]>
ALSA: hda/conexant: Apply quirk for another HP ProDesk 600 G3 model

Meng Tang <[email protected]>
ALSA: hda - Add fixup for Dell Latitidue E5430

Juergen Gross <[email protected]>
x86/xen: Use clear_bss() for Xen PV guests

Chanho Park <[email protected]>
tty: serial: samsung_tty: set dma burst_size to 1

Bartosz Golaszewski <[email protected]>
gpio: sim: fix the chip_name configfs item

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Fix event pending check

Linyu Yuan <[email protected]>
usb: typec: add missing uevent when partner support PD

Lucien Buchmann <[email protected]>
USB: serial: ftdi_sio: add Belimo device ids


-------------

Diffstat:

.../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 8 +-
.../driver-api/firmware/other_interfaces.rst | 6 +
Documentation/filesystems/netfs_library.rst | 8 +-
Documentation/networking/ip-sysctl.rst | 4 +-
Makefile | 4 +-
arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 2 +-
arch/arm/boot/dts/sama5d2.dtsi | 2 +-
arch/arm/boot/dts/stm32mp151.dtsi | 2 +-
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 2 +-
arch/arm/include/asm/domain.h | 13 --
arch/arm/include/asm/mach/map.h | 1 +
arch/arm/include/asm/ptrace.h | 26 +++
arch/arm/mm/Kconfig | 6 +-
arch/arm/mm/alignment.c | 3 +
arch/arm/mm/mmu.c | 15 +-
arch/arm/mm/proc-v7-bugs.c | 9 +-
arch/arm/probes/decode.h | 26 +--
arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi | 8 +
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 2 +
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 5 +-
arch/powerpc/sysdev/xive/spapr.c | 5 +-
arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 4 +
arch/riscv/kvm/vcpu.c | 2 +
arch/s390/Makefile | 8 +-
arch/s390/lib/Makefile | 3 +-
arch/s390/lib/expoline/Makefile | 3 +
arch/s390/lib/{ => expoline}/expoline.S | 0
arch/sh/include/asm/io.h | 8 +-
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/include/asm/msr-index.h | 3 +
arch/x86/include/asm/nospec-branch.h | 6 +
arch/x86/include/asm/setup.h | 3 +
arch/x86/kernel/acpi/cppc.c | 6 +
arch/x86/kernel/cpu/amd.c | 23 +-
arch/x86/kernel/cpu/bugs.c | 13 ++
arch/x86/kernel/cpu/common.c | 19 ++
arch/x86/kernel/cpu/cpu.h | 2 +
arch/x86/kernel/cpu/hygon.c | 6 +
arch/x86/kernel/head64.c | 4 +-
arch/x86/kvm/emulate.c | 28 +--
arch/x86/kvm/x86.c | 18 +-
arch/x86/mm/init.c | 14 +-
arch/x86/mm/mem_encrypt_boot.S | 10 +-
arch/x86/xen/enlighten_pv.c | 8 +-
arch/x86/xen/setup.c | 6 +-
arch/x86/xen/xen-asm.S | 20 +-
arch/x86/xen/xen-head.S | 11 +-
arch/x86/xen/xen-ops.h | 6 +-
drivers/acpi/acpi_video.c | 11 +-
drivers/base/cpu.c | 8 +
drivers/cpufreq/pmac32-cpufreq.c | 4 +
drivers/firmware/sysfb.c | 58 ++++-
drivers/firmware/sysfb_simplefb.c | 16 +-
drivers/gpio/gpio-sim.c | 16 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 25 ++-
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 +-
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 +-
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 +-
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 +-
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 3 +-
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 85 ++++++-
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 8 +
.../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 ++
drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 11 +-
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 +
drivers/gpu/drm/i915/display/intel_dp_mst.c | 1 +
drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +-
drivers/gpu/drm/i915/gt/intel_gt.c | 15 +-
drivers/gpu/drm/i915/gt/intel_reset.c | 37 ++-
drivers/gpu/drm/i915/gt/selftest_lrc.c | 8 +-
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 9 +
drivers/gpu/drm/i915/gvt/cmd_parser.c | 6 +-
drivers/gpu/drm/i915/i915_scatterlist.c | 19 +-
drivers/gpu/drm/i915/i915_scatterlist.h | 6 +-
drivers/gpu/drm/i915/intel_region_ttm.c | 10 +-
drivers/gpu/drm/i915/intel_region_ttm.h | 3 +-
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
.../gpu/drm/i915/selftests/intel_memory_region.c | 21 +-
drivers/gpu/drm/i915/selftests/mock_region.c | 3 +-
drivers/gpu/drm/panfrost/panfrost_drv.c | 4 +-
drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +-
drivers/irqchip/irq-or1k-pic.c | 1 -
drivers/net/can/xilinx_can.c | 4 +-
.../net/ethernet/aquantia/atlantic/aq_pci_func.c | 23 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 +
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 8 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 13 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 7 +-
.../chelsio/inline_crypto/chtls/chtls_cm.c | 2 +-
drivers/net/ethernet/faraday/ftgmac100.c | 15 +-
drivers/net/ethernet/intel/ice/ice_devids.h | 1 +
drivers/net/ethernet/intel/ice/ice_devlink.c | 59 +++--
drivers/net/ethernet/intel/ice/ice_fw_update.c | 96 +++++++-
drivers/net/ethernet/intel/ice/ice_main.c | 1 +
.../ethernet/marvell/prestera/prestera_router.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 20 +-
.../ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c | 3 +-
.../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 3 +-
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 39 +++-
.../net/ethernet/mellanox/mlx5/core/esw/legacy.c | 5 +-
drivers/net/ethernet/mscc/ocelot_fdma.c | 17 +-
drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 33 ++-
drivers/net/ethernet/sfc/ef10.c | 3 +
drivers/net/ethernet/sfc/ef10_sriov.c | 10 +-
.../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 1 +
.../net/ethernet/stmicro/stmmac/dwmac-ingenic.c | 6 +-
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 17 +-
drivers/net/phy/sfp.c | 2 +-
drivers/net/xen-netback/rx.c | 1 +
drivers/nfc/nxp-nci/i2c.c | 8 +-
drivers/nvme/host/core.c | 8 +-
drivers/nvme/host/nvme.h | 1 +
drivers/nvme/host/pci.c | 3 +-
drivers/nvme/host/rdma.c | 12 +-
drivers/nvme/host/tcp.c | 13 +-
drivers/nvme/host/trace.h | 2 +-
drivers/pinctrl/aspeed/pinctrl-aspeed.c | 4 +-
drivers/pinctrl/freescale/pinctrl-imx93.c | 1 +
drivers/platform/x86/hp-wmi.c | 3 +
drivers/platform/x86/intel/pmc/core.c | 1 +
drivers/platform/x86/thinkpad_acpi.c | 50 ++---
drivers/power/supply/power_supply_core.c | 24 +-
drivers/s390/crypto/ap_bus.c | 2 +-
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 7 +
drivers/scsi/megaraid/megaraid_sas_base.c | 3 +
drivers/scsi/ufs/ufshcd.c | 2 +-
drivers/soc/ixp4xx/ixp4xx-npe.c | 2 +-
drivers/spi/spi-amd.c | 8 +
drivers/tee/tee_core.c | 2 +-
drivers/tty/pty.c | 14 +-
drivers/tty/serial/8250/8250_core.c | 4 +
drivers/tty/serial/8250/8250_port.c | 4 +-
drivers/tty/serial/amba-pl011.c | 23 +-
drivers/tty/serial/mvebu-uart.c | 25 ++-
drivers/tty/serial/samsung_tty.c | 5 +-
drivers/tty/serial/serial_core.c | 5 -
drivers/tty/serial/stm32-usart.c | 2 +
drivers/tty/tty.h | 3 +
drivers/tty/tty_buffer.c | 46 +++-
drivers/tty/vt/vt.c | 2 +-
drivers/usb/dwc3/gadget.c | 4 +-
drivers/usb/serial/ftdi_sio.c | 3 +
drivers/usb/serial/ftdi_sio_ids.h | 6 +
drivers/usb/typec/class.c | 1 +
drivers/vdpa/mlx5/net/mlx5_vnet.c | 31 ++-
drivers/vdpa/vdpa_user/vduse_dev.c | 60 +++--
drivers/video/fbdev/core/fbmem.c | 12 +
drivers/virtio/virtio_mmio.c | 26 +++
drivers/xen/gntdev.c | 6 +-
fs/afs/file.c | 2 +-
fs/btrfs/inode.c | 14 +-
fs/btrfs/zoned.c | 13 +-
fs/ceph/addr.c | 11 +-
fs/cifs/smb2pdu.c | 13 +-
fs/exec.c | 2 +-
fs/ksmbd/transport_tcp.c | 2 +-
fs/lockd/svcsubs.c | 14 +-
fs/netfs/buffered_read.c | 17 +-
fs/nfsd/nfs4xdr.c | 9 +
fs/nfsd/nfsd.h | 3 +-
fs/nilfs2/nilfs.h | 3 +
fs/remap_range.c | 3 +-
include/linux/cgroup-defs.h | 3 +-
include/linux/cpu.h | 2 +
include/linux/kexec.h | 6 +
include/linux/netfs.h | 2 +-
include/linux/nvme.h | 2 +
include/linux/reset.h | 2 +-
include/linux/sched/task.h | 2 +-
include/linux/serial_core.h | 5 +
include/linux/sysfb.h | 22 +-
include/net/netfilter/nf_conntrack.h | 9 +-
include/net/netfilter/nf_conntrack_ecache.h | 4 +-
include/net/netfilter/nf_tables.h | 30 ++-
include/net/netns/conntrack.h | 1 -
include/net/raw.h | 2 +-
include/net/sock.h | 2 +-
include/net/tls.h | 4 +-
include/trace/events/sock.h | 6 +-
kernel/cgroup/cgroup.c | 37 +--
kernel/exit.c | 2 +-
kernel/kexec_file.c | 11 +-
kernel/signal.c | 8 +-
kernel/sysctl.c | 57 ++---
kernel/time/posix-timers.c | 19 +-
kernel/trace/trace.c | 11 +-
kernel/trace/trace_events_hist.c | 2 +
mm/damon/vaddr.c | 3 +-
mm/memory.c | 27 +--
mm/sparse-vmemmap.c | 8 +
mm/userfaultfd.c | 5 +-
net/8021q/vlan_netlink.c | 10 +-
net/bridge/br_netfilter_hooks.c | 21 +-
net/core/filter.c | 1 -
net/ipv4/af_inet.c | 4 +-
net/ipv4/cipso_ipv4.c | 12 +-
net/ipv4/fib_semantics.c | 4 +-
net/ipv4/fib_trie.c | 2 +-
net/ipv4/icmp.c | 20 +-
net/ipv4/inet_timewait_sock.c | 3 +-
net/ipv4/inetpeer.c | 12 +-
net/ipv4/nexthop.c | 5 +-
net/ipv4/syncookies.c | 2 +-
net/ipv4/sysctl_net_ipv4.c | 12 +
net/ipv4/tcp.c | 3 +-
net/ipv4/tcp_input.c | 2 +-
net/ipv4/tcp_output.c | 4 +-
net/ipv6/icmp.c | 2 +-
net/ipv6/route.c | 2 +-
net/ipv6/seg6_iptunnel.c | 5 +-
net/ipv6/seg6_local.c | 2 -
net/mac80211/wme.c | 4 +-
net/mptcp/protocol.c | 4 +-
net/netfilter/nf_conntrack_core.c | 86 ++++---
net/netfilter/nf_conntrack_ecache.c | 139 ++++++------
net/netfilter/nf_conntrack_netlink.c | 125 ++++++++---
net/netfilter/nf_conntrack_standalone.c | 3 +
net/netfilter/nf_log_syslog.c | 8 +-
net/netfilter/nf_tables_api.c | 72 ++++--
net/netfilter/nf_tables_core.c | 24 +-
net/netfilter/nf_tables_trace.c | 44 ++--
net/tipc/socket.c | 1 +
net/tls/tls_device.c | 4 +-
net/tls/tls_main.c | 7 +-
security/integrity/evm/evm_crypto.c | 7 +-
security/integrity/ima/ima_appraise.c | 3 +-
security/integrity/ima/ima_crypto.c | 1 +
security/integrity/ima/ima_efi.c | 2 +
sound/pci/hda/patch_conexant.c | 1 +
sound/pci/hda/patch_realtek.c | 20 ++
sound/soc/codecs/cs35l41-lib.c | 10 +-
sound/soc/codecs/cs35l41.c | 12 +-
sound/soc/codecs/cs47l15.c | 5 +-
sound/soc/codecs/madera.c | 14 +-
sound/soc/codecs/max98373-sdw.c | 12 +-
sound/soc/codecs/rt1308-sdw.c | 11 +
sound/soc/codecs/rt1316-sdw.c | 11 +
sound/soc/codecs/rt5682-sdw.c | 5 +-
sound/soc/codecs/rt700-sdw.c | 6 +-
sound/soc/codecs/rt700.c | 14 +-
sound/soc/codecs/rt711-sdca-sdw.c | 9 +-
sound/soc/codecs/rt711-sdca.c | 18 +-
sound/soc/codecs/rt711-sdw.c | 9 +-
sound/soc/codecs/rt711.c | 16 +-
sound/soc/codecs/rt715-sdca-sdw.c | 12 +
sound/soc/codecs/rt715-sdw.c | 12 +
sound/soc/codecs/sgtl5000.c | 9 +
sound/soc/codecs/sgtl5000.h | 1 +
sound/soc/codecs/tas2764.c | 46 ++--
sound/soc/codecs/tas2764.h | 6 +-
sound/soc/codecs/wcd9335.c | 8 +-
sound/soc/codecs/wcd938x.c | 12 +
sound/soc/codecs/wm5110.c | 8 +-
sound/soc/codecs/wm_adsp.c | 2 +-
sound/soc/intel/boards/bytcr_wm5102.c | 13 +-
sound/soc/intel/boards/sof_sdw.c | 51 +++--
sound/soc/intel/skylake/skl-nhlt.c | 40 ++--
sound/soc/soc-dapm.c | 5 +
sound/soc/soc-ops.c | 4 +-
sound/soc/sof/intel/hda-dsp.c | 10 +-
sound/soc/sof/intel/hda-loader.c | 10 +-
sound/soc/sof/intel/hda.h | 1 +
sound/usb/quirks-table.h | 248 +++++++++++++++++++++
sound/usb/quirks.c | 9 +
tools/objtool/check.c | 19 +-
tools/testing/selftests/wireguard/qemu/Makefile | 5 +-
.../selftests/wireguard/qemu/arch/arm.config | 1 +
.../selftests/wireguard/qemu/arch/armeb.config | 1 +
.../selftests/wireguard/qemu/arch/i686.config | 1 +
.../selftests/wireguard/qemu/arch/m68k.config | 1 +
.../selftests/wireguard/qemu/arch/mips.config | 1 +
.../selftests/wireguard/qemu/arch/mipsel.config | 1 +
.../selftests/wireguard/qemu/arch/powerpc.config | 1 +
tools/testing/selftests/wireguard/qemu/init.c | 11 +
277 files changed, 2493 insertions(+), 955 deletions(-)



2022-07-19 13:54:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 176/231] firmware: sysfb: Add sysfb_disable() helper function

From: Javier Martinez Canillas <[email protected]>

[ Upstream commit bde376e9de3c0bc55eedc8956b0f114c05531595 ]

This can be used by subsystems to unregister a platform device registered
by sysfb and also to disable future platform device registration in sysfb.

Suggested-by: Daniel Vetter <[email protected]>
Signed-off-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
.../driver-api/firmware/other_interfaces.rst | 6 +++
drivers/firmware/sysfb.c | 54 ++++++++++++++++---
include/linux/sysfb.h | 12 +++++
3 files changed, 66 insertions(+), 6 deletions(-)

diff --git a/Documentation/driver-api/firmware/other_interfaces.rst b/Documentation/driver-api/firmware/other_interfaces.rst
index b81794e0cfbb..06ac89adaafb 100644
--- a/Documentation/driver-api/firmware/other_interfaces.rst
+++ b/Documentation/driver-api/firmware/other_interfaces.rst
@@ -13,6 +13,12 @@ EDD Interfaces
.. kernel-doc:: drivers/firmware/edd.c
:internal:

+Generic System Framebuffers Interface
+-------------------------------------
+
+.. kernel-doc:: drivers/firmware/sysfb.c
+ :export:
+
Intel Stratix10 SoC Service Layer
---------------------------------
Some features of the Intel Stratix10 SoC require a level of privilege
diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c
index b032f40a92de..1f276f108cc9 100644
--- a/drivers/firmware/sysfb.c
+++ b/drivers/firmware/sysfb.c
@@ -34,21 +34,59 @@
#include <linux/screen_info.h>
#include <linux/sysfb.h>

+static struct platform_device *pd;
+static DEFINE_MUTEX(disable_lock);
+static bool disabled;
+
+static bool sysfb_unregister(void)
+{
+ if (IS_ERR_OR_NULL(pd))
+ return false;
+
+ platform_device_unregister(pd);
+ pd = NULL;
+
+ return true;
+}
+
+/**
+ * sysfb_disable() - disable the Generic System Framebuffers support
+ *
+ * This disables the registration of system framebuffer devices that match the
+ * generic drivers that make use of the system framebuffer set up by firmware.
+ *
+ * It also unregisters a device if this was already registered by sysfb_init().
+ *
+ * Context: The function can sleep. A @disable_lock mutex is acquired to serialize
+ * against sysfb_init(), that registers a system framebuffer device.
+ */
+void sysfb_disable(void)
+{
+ mutex_lock(&disable_lock);
+ sysfb_unregister();
+ disabled = true;
+ mutex_unlock(&disable_lock);
+}
+EXPORT_SYMBOL_GPL(sysfb_disable);
+
static __init int sysfb_init(void)
{
struct screen_info *si = &screen_info;
struct simplefb_platform_data mode;
- struct platform_device *pd;
const char *name;
bool compatible;
- int ret;
+ int ret = 0;
+
+ mutex_lock(&disable_lock);
+ if (disabled)
+ goto unlock_mutex;

/* try to create a simple-framebuffer device */
compatible = sysfb_parse_mode(si, &mode);
if (compatible) {
pd = sysfb_create_simplefb(si, &mode);
if (!IS_ERR(pd))
- return 0;
+ goto unlock_mutex;
}

/* if the FB is incompatible, create a legacy framebuffer device */
@@ -60,8 +98,10 @@ static __init int sysfb_init(void)
name = "platform-framebuffer";

pd = platform_device_alloc(name, 0);
- if (!pd)
- return -ENOMEM;
+ if (!pd) {
+ ret = -ENOMEM;
+ goto unlock_mutex;
+ }

sysfb_apply_efi_quirks(pd);

@@ -73,9 +113,11 @@ static __init int sysfb_init(void)
if (ret)
goto err;

- return 0;
+ goto unlock_mutex;
err:
platform_device_put(pd);
+unlock_mutex:
+ mutex_unlock(&disable_lock);
return ret;
}

diff --git a/include/linux/sysfb.h b/include/linux/sysfb.h
index 708152e9037b..8ba8b5be5567 100644
--- a/include/linux/sysfb.h
+++ b/include/linux/sysfb.h
@@ -55,6 +55,18 @@ struct efifb_dmi_info {
int flags;
};

+#ifdef CONFIG_SYSFB
+
+void sysfb_disable(void);
+
+#else /* CONFIG_SYSFB */
+
+static inline void sysfb_disable(void)
+{
+}
+
+#endif /* CONFIG_SYSFB */
+
#ifdef CONFIG_EFI

extern struct efifb_dmi_info efifb_dmi_list[];
--
2.35.1



2022-07-19 13:54:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 064/231] netfilter: conntrack: remove the percpu dying list

From: Florian Westphal <[email protected]>

[ Upstream commit 1397af5bfd7d32b0cf2adb70a78c9a9e8f11d912 ]

Its no longer needed. Entries that need event redelivery are placed
on the new pernet dying list.

The advantage is that there is no need to take additional spinlock on
conntrack removal unless event redelivery failed or the conntrack entry
was never added to the table in the first place (confirmed bit not set).

The IPS_CONFIRMED bit now needs to be set as soon as the entry has been
unlinked from the unconfirmed list, else the destroy function may
attempt to unlink it a second time.

Signed-off-by: Florian Westphal <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
include/net/netns/conntrack.h | 1 -
net/netfilter/nf_conntrack_core.c | 35 +++++-----------------------
net/netfilter/nf_conntrack_ecache.c | 1 -
net/netfilter/nf_conntrack_netlink.c | 23 ++++++------------
4 files changed, 13 insertions(+), 47 deletions(-)

diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index 0294f3d473af..e985a3010b89 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -96,7 +96,6 @@ struct nf_ip_net {
struct ct_pcpu {
spinlock_t lock;
struct hlist_nulls_head unconfirmed;
- struct hlist_nulls_head dying;
};

struct netns_ct {
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index ca1d1d105163..9010b6e5a072 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -525,21 +525,6 @@ clean_from_lists(struct nf_conn *ct)
nf_ct_remove_expectations(ct);
}

-/* must be called with local_bh_disable */
-static void nf_ct_add_to_dying_list(struct nf_conn *ct)
-{
- struct ct_pcpu *pcpu;
-
- /* add this conntrack to the (per cpu) dying list */
- ct->cpu = smp_processor_id();
- pcpu = per_cpu_ptr(nf_ct_net(ct)->ct.pcpu_lists, ct->cpu);
-
- spin_lock(&pcpu->lock);
- hlist_nulls_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
- &pcpu->dying);
- spin_unlock(&pcpu->lock);
-}
-
/* must be called with local_bh_disable */
static void nf_ct_add_to_unconfirmed_list(struct nf_conn *ct)
{
@@ -556,11 +541,11 @@ static void nf_ct_add_to_unconfirmed_list(struct nf_conn *ct)
}

/* must be called with local_bh_disable */
-static void nf_ct_del_from_dying_or_unconfirmed_list(struct nf_conn *ct)
+static void nf_ct_del_from_unconfirmed_list(struct nf_conn *ct)
{
struct ct_pcpu *pcpu;

- /* We overload first tuple to link into unconfirmed or dying list.*/
+ /* We overload first tuple to link into unconfirmed list.*/
pcpu = per_cpu_ptr(nf_ct_net(ct)->ct.pcpu_lists, ct->cpu);

spin_lock(&pcpu->lock);
@@ -648,7 +633,8 @@ void nf_ct_destroy(struct nf_conntrack *nfct)
*/
nf_ct_remove_expectations(ct);

- nf_ct_del_from_dying_or_unconfirmed_list(ct);
+ if (unlikely(!nf_ct_is_confirmed(ct)))
+ nf_ct_del_from_unconfirmed_list(ct);

local_bh_enable();

@@ -686,7 +672,6 @@ static void nf_ct_delete_from_lists(struct nf_conn *ct)
local_bh_disable();

__nf_ct_delete_from_lists(ct);
- nf_ct_add_to_dying_list(ct);

local_bh_enable();
}
@@ -700,8 +685,6 @@ static void nf_ct_add_to_ecache_list(struct nf_conn *ct)
hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
&cnet->ecache.dying_list);
spin_unlock(&cnet->ecache.dying_lock);
-#else
- nf_ct_add_to_dying_list(ct);
#endif
}

@@ -995,7 +978,6 @@ static void __nf_conntrack_insert_prepare(struct nf_conn *ct)
struct nf_conn_tstamp *tstamp;

refcount_inc(&ct->ct_general.use);
- ct->status |= IPS_CONFIRMED;

/* set conntrack timestamp, if enabled. */
tstamp = nf_conn_tstamp_find(ct);
@@ -1024,7 +1006,6 @@ static int __nf_ct_resolve_clash(struct sk_buff *skb,
nf_conntrack_get(&ct->ct_general);

nf_ct_acct_merge(ct, ctinfo, loser_ct);
- nf_ct_add_to_dying_list(loser_ct);
nf_ct_put(loser_ct);
nf_ct_set(skb, ct, ctinfo);

@@ -1157,7 +1138,6 @@ nf_ct_resolve_clash(struct sk_buff *skb, struct nf_conntrack_tuple_hash *h,
return ret;

drop:
- nf_ct_add_to_dying_list(loser_ct);
NF_CT_STAT_INC(net, drop);
NF_CT_STAT_INC(net, insert_failed);
return NF_DROP;
@@ -1224,10 +1204,10 @@ __nf_conntrack_confirm(struct sk_buff *skb)
* user context, else we insert an already 'dead' hash, blocking
* further use of that particular connection -JM.
*/
- nf_ct_del_from_dying_or_unconfirmed_list(ct);
+ nf_ct_del_from_unconfirmed_list(ct);
+ ct->status |= IPS_CONFIRMED;

if (unlikely(nf_ct_is_dying(ct))) {
- nf_ct_add_to_dying_list(ct);
NF_CT_STAT_INC(net, insert_failed);
goto dying;
}
@@ -1251,7 +1231,6 @@ __nf_conntrack_confirm(struct sk_buff *skb)
goto out;
if (chainlen++ > max_chainlen) {
chaintoolong:
- nf_ct_add_to_dying_list(ct);
NF_CT_STAT_INC(net, chaintoolong);
NF_CT_STAT_INC(net, insert_failed);
ret = NF_DROP;
@@ -2800,7 +2779,6 @@ void nf_conntrack_init_end(void)
* We need to use special "null" values, not used in hash table
*/
#define UNCONFIRMED_NULLS_VAL ((1<<30)+0)
-#define DYING_NULLS_VAL ((1<<30)+1)

int nf_conntrack_init_net(struct net *net)
{
@@ -2821,7 +2799,6 @@ int nf_conntrack_init_net(struct net *net)

spin_lock_init(&pcpu->lock);
INIT_HLIST_NULLS_HEAD(&pcpu->unconfirmed, UNCONFIRMED_NULLS_VAL);
- INIT_HLIST_NULLS_HEAD(&pcpu->dying, DYING_NULLS_VAL);
}

net->ct.stat = alloc_percpu(struct ip_conntrack_stat);
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c
index 334b2b4e5e8b..7472c544642f 100644
--- a/net/netfilter/nf_conntrack_ecache.c
+++ b/net/netfilter/nf_conntrack_ecache.c
@@ -94,7 +94,6 @@ static enum retry_state ecache_work_evict_list(struct nf_conntrack_net *cnet)
hlist_nulls_for_each_entry_safe(h, n, &evicted_list, hnnode) {
struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(h);

- hlist_nulls_add_fake(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode);
hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode);
nf_ct_put(ct);

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index a4ec2aad2187..2e9c8183e4a2 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -62,7 +62,6 @@ struct ctnetlink_list_dump_ctx {
struct nf_conn *last;
unsigned int cpu;
bool done;
- bool retrans_done;
};

static int ctnetlink_dump_tuples_proto(struct sk_buff *skb,
@@ -1751,13 +1750,12 @@ static int ctnetlink_dump_one_entry(struct sk_buff *skb,
}

static int
-ctnetlink_dump_list(struct sk_buff *skb, struct netlink_callback *cb, bool dying)
+ctnetlink_dump_unconfirmed(struct sk_buff *skb, struct netlink_callback *cb)
{
struct ctnetlink_list_dump_ctx *ctx = (void *)cb->ctx;
struct nf_conn *ct, *last;
struct nf_conntrack_tuple_hash *h;
struct hlist_nulls_node *n;
- struct hlist_nulls_head *list;
struct net *net = sock_net(skb->sk);
int res, cpu;

@@ -1774,12 +1772,11 @@ ctnetlink_dump_list(struct sk_buff *skb, struct netlink_callback *cb, bool dying

pcpu = per_cpu_ptr(net->ct.pcpu_lists, cpu);
spin_lock_bh(&pcpu->lock);
- list = dying ? &pcpu->dying : &pcpu->unconfirmed;
restart:
- hlist_nulls_for_each_entry(h, n, list, hnnode) {
+ hlist_nulls_for_each_entry(h, n, &pcpu->unconfirmed, hnnode) {
ct = nf_ct_tuplehash_to_ctrack(h);

- res = ctnetlink_dump_one_entry(skb, cb, ct, dying);
+ res = ctnetlink_dump_one_entry(skb, cb, ct, false);
if (res < 0) {
ctx->cpu = cpu;
spin_unlock_bh(&pcpu->lock);
@@ -1812,8 +1809,8 @@ ctnetlink_dump_dying(struct sk_buff *skb, struct netlink_callback *cb)
struct hlist_nulls_node *n;
#endif

- if (ctx->retrans_done)
- return ctnetlink_dump_list(skb, cb, true);
+ if (ctx->done)
+ return 0;

ctx->last = NULL;

@@ -1842,10 +1839,10 @@ ctnetlink_dump_dying(struct sk_buff *skb, struct netlink_callback *cb)

spin_unlock_bh(&ecache_net->dying_lock);
#endif
+ ctx->done = true;
nf_ct_put(last);
- ctx->retrans_done = true;

- return ctnetlink_dump_list(skb, cb, true);
+ return skb->len;
}

static int ctnetlink_get_ct_dying(struct sk_buff *skb,
@@ -1863,12 +1860,6 @@ static int ctnetlink_get_ct_dying(struct sk_buff *skb,
return -EOPNOTSUPP;
}

-static int
-ctnetlink_dump_unconfirmed(struct sk_buff *skb, struct netlink_callback *cb)
-{
- return ctnetlink_dump_list(skb, cb, false);
-}
-
static int ctnetlink_get_ct_unconfirmed(struct sk_buff *skb,
const struct nfnl_info *info,
const struct nlattr * const cda[])
--
2.35.1



2022-07-19 13:54:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 201/231] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error

From: Shuming Fan <[email protected]>

[ Upstream commit 1df793d479bef546569fc2e409ff8bb3f0fb8e99 ]

The initial settings will be written before the codec probe function.
But, the rt711->component doesn't be assigned yet.
If IO error happened during initial settings operations, it will cause the kernel panic.
This patch changed component->dev to slave->dev to fix this issue.

Signed-off-by: Shuming Fan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/codecs/rt711-sdca.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt711-sdca.c b/sound/soc/codecs/rt711-sdca.c
index dfe3c9299ebd..5ad53bbc8528 100644
--- a/sound/soc/codecs/rt711-sdca.c
+++ b/sound/soc/codecs/rt711-sdca.c
@@ -34,7 +34,7 @@ static int rt711_sdca_index_write(struct rt711_sdca_priv *rt711,

ret = regmap_write(regmap, addr, value);
if (ret < 0)
- dev_err(rt711->component->dev,
+ dev_err(&rt711->slave->dev,
"Failed to set private value: %06x <= %04x ret=%d\n",
addr, value, ret);

@@ -50,7 +50,7 @@ static int rt711_sdca_index_read(struct rt711_sdca_priv *rt711,

ret = regmap_read(regmap, addr, value);
if (ret < 0)
- dev_err(rt711->component->dev,
+ dev_err(&rt711->slave->dev,
"Failed to get private value: %06x => %04x ret=%d\n",
addr, *value, ret);

--
2.35.1



2022-07-19 13:54:18

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 116/231] icmp: Fix a data-race around sysctl_icmp_errors_use_inbound_ifaddr.

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit d2efabce81db7eed1c98fa1a3f203f0edd738ac3 ]

While reading sysctl_icmp_errors_use_inbound_ifaddr, it can be changed
concurrently. Thus, we need to add READ_ONCE() to its reader.

Fixes: 1c2fb7f93cb2 ("[IPV4]: Sysctl configurable icmp error source address.")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/ipv4/icmp.c | 2 +-
net/ipv4/sysctl_net_ipv4.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 1a061d10949f..37ba5f042908 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -693,7 +693,7 @@ void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,

rcu_read_lock();
if (rt_is_input_route(rt) &&
- net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr)
+ READ_ONCE(net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr))
dev = dev_get_by_index_rcu(net, inet_iif(skb_in));

if (dev)
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 4cf2a6f560d4..33e65e79e46e 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -639,6 +639,8 @@ static struct ctl_table ipv4_net_table[] = {
.maxlen = sizeof(u8),
.mode = 0644,
.proc_handler = proc_dou8vec_minmax,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE
},
{
.procname = "icmp_ratelimit",
--
2.35.1



2022-07-19 13:54:20

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 084/231] arm64: dts: broadcom: bcm4908: Fix cpu node for smp boot

From: William Zhang <[email protected]>

[ Upstream commit 8bd582ae9a71d7f14c4e0c735b2eacaf7516d626 ]

Add spin-table enable-method and cpu-release-addr properties for
cpu0 node. This is required by all ARMv8 SoC. Otherwise some
bootloader like u-boot can not update cpu-release-addr and linux
fails to start up secondary cpus.

Fixes: 2961f69f151c ("arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early DTS files")
Signed-off-by: William Zhang <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
index a4be040a00c0..967d2cd3c3ce 100644
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
@@ -29,6 +29,8 @@ cpu0: cpu@0 {
device_type = "cpu";
compatible = "brcm,brahma-b53";
reg = <0x0>;
+ enable-method = "spin-table";
+ cpu-release-addr = <0x0 0xfff8>;
next-level-cache = <&l2>;
};

--
2.35.1



2022-07-19 13:54:29

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 039/231] spi: amd: Limit max transfer and message size

From: Cristian Ciocaltea <[email protected]>

[ Upstream commit 6ece49c56965544262523dae4a071ace3db63507 ]

Enabling the SPI CS35L41 audio codec driver for Steam Deck [1]
revealed a problem with the current AMD SPI controller driver
implementation, consisting of an unrecoverable system hang.

The issue can be prevented if we ensure the max transfer size
and the max message size do not exceed the FIFO buffer size.

According to the implementation of the downstream driver, the
AMD SPI controller is not able to handle more than 70 bytes per
transfer, which corresponds to the size of the FIFO buffer.

Hence, let's fix this by setting the SPI limits mentioned above.

[1] https://lore.kernel.org/r/[email protected]

Reported-by: Anastasios Vacharakis <[email protected]>
Fixes: bbb336f39efc ("spi: spi-amd: Add AMD SPI controller driver support")
Signed-off-by: Cristian Ciocaltea <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/spi/spi-amd.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c
index cba6a4486c24..efdcbe6c4c26 100644
--- a/drivers/spi/spi-amd.c
+++ b/drivers/spi/spi-amd.c
@@ -33,6 +33,7 @@
#define AMD_SPI_RX_COUNT_REG 0x4B
#define AMD_SPI_STATUS_REG 0x4C

+#define AMD_SPI_FIFO_SIZE 70
#define AMD_SPI_MEM_SIZE 200

/* M_CMD OP codes for SPI */
@@ -270,6 +271,11 @@ static int amd_spi_master_transfer(struct spi_master *master,
return 0;
}

+static size_t amd_spi_max_transfer_size(struct spi_device *spi)
+{
+ return AMD_SPI_FIFO_SIZE;
+}
+
static int amd_spi_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -302,6 +308,8 @@ static int amd_spi_probe(struct platform_device *pdev)
master->flags = SPI_MASTER_HALF_DUPLEX;
master->setup = amd_spi_master_setup;
master->transfer_one_message = amd_spi_master_transfer;
+ master->max_transfer_size = amd_spi_max_transfer_size;
+ master->max_message_size = amd_spi_max_transfer_size;

/* Register the controller with SPI framework */
err = devm_spi_register_master(dev, master);
--
2.35.1



2022-07-19 13:54:31

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 045/231] net/mlx5e: CT: Use own workqueue instead of mlx5e priv

From: Roi Dayan <[email protected]>

[ Upstream commit 6c4e8fa03fde7e5b304594294e397a9ba92feaf6 ]

Allocate a ct priv workqueue instead of using mlx5e priv one
so flushing will only be of related CT entries.
Also move flushing of the workqueue before rhashtable destroy
otherwise entries won't be valid.

Fixes: b069e14fff46 ("net/mlx5e: CT: Fix queued up restore put() executing after relevant ft release")
Signed-off-by: Roi Dayan <[email protected]>
Reviewed-by: Oz Shlomo <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
.../ethernet/mellanox/mlx5/core/en/tc_ct.c | 20 +++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
index 1ff7a07bcd06..fbcce63e5b80 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
@@ -66,6 +66,7 @@ struct mlx5_tc_ct_priv {
struct mlx5_ct_fs *fs;
struct mlx5_ct_fs_ops *fs_ops;
spinlock_t ht_lock; /* protects ft entries */
+ struct workqueue_struct *wq;
};

struct mlx5_ct_flow {
@@ -927,14 +928,11 @@ static void mlx5_tc_ct_entry_del_work(struct work_struct *work)
static void
__mlx5_tc_ct_entry_put(struct mlx5_ct_entry *entry)
{
- struct mlx5e_priv *priv;
-
if (!refcount_dec_and_test(&entry->refcnt))
return;

- priv = netdev_priv(entry->ct_priv->netdev);
INIT_WORK(&entry->work, mlx5_tc_ct_entry_del_work);
- queue_work(priv->wq, &entry->work);
+ queue_work(entry->ct_priv->wq, &entry->work);
}

static struct mlx5_ct_counter *
@@ -1744,19 +1742,16 @@ mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg)
static void
mlx5_tc_ct_del_ft_cb(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft)
{
- struct mlx5e_priv *priv;
-
if (!refcount_dec_and_test(&ft->refcount))
return;

+ flush_workqueue(ct_priv->wq);
nf_flow_table_offload_del_cb(ft->nf_ft,
mlx5_tc_ct_block_flow_offload, ft);
rhashtable_remove_fast(&ct_priv->zone_ht, &ft->node, zone_params);
rhashtable_free_and_destroy(&ft->ct_entries_ht,
mlx5_tc_ct_flush_ft_entry,
ct_priv);
- priv = netdev_priv(ct_priv->netdev);
- flush_workqueue(priv->wq);
mlx5_tc_ct_free_pre_ct_tables(ft);
mapping_remove(ct_priv->zone_mapping, ft->zone_restore_id);
kfree(ft);
@@ -2139,6 +2134,12 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
if (rhashtable_init(&ct_priv->ct_tuples_nat_ht, &tuples_nat_ht_params))
goto err_ct_tuples_nat_ht;

+ ct_priv->wq = alloc_ordered_workqueue("mlx5e_ct_priv_wq", 0);
+ if (!ct_priv->wq) {
+ err = -ENOMEM;
+ goto err_wq;
+ }
+
err = mlx5_tc_ct_fs_init(ct_priv);
if (err)
goto err_init_fs;
@@ -2146,6 +2147,8 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
return ct_priv;

err_init_fs:
+ destroy_workqueue(ct_priv->wq);
+err_wq:
rhashtable_destroy(&ct_priv->ct_tuples_nat_ht);
err_ct_tuples_nat_ht:
rhashtable_destroy(&ct_priv->ct_tuples_ht);
@@ -2175,6 +2178,7 @@ mlx5_tc_ct_clean(struct mlx5_tc_ct_priv *ct_priv)
if (!ct_priv)
return;

+ destroy_workqueue(ct_priv->wq);
chains = ct_priv->chains;

ct_priv->fs_ops->destroy(ct_priv->fs);
--
2.35.1



2022-07-19 13:54:41

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 021/231] net: sock: tracing: Fix sock_exceed_buf_limit not to dereference stale pointer

From: Steven Rostedt (Google) <[email protected]>

commit 820b8963adaea34a87abbecb906d1f54c0aabfb7 upstream.

The trace event sock_exceed_buf_limit saves the prot->sysctl_mem pointer
and then dereferences it in the TP_printk() portion. This is unsafe as the
TP_printk() portion is executed at the time the buffer is read. That is,
it can be seconds, minutes, days, months, even years later. If the proto
is freed, then this dereference will can also lead to a kernel crash.

Instead, save the sysctl_mem array into the ring buffer and have the
TP_printk() reference that instead. This is the proper and safe way to
read pointers in trace events.

Link: https://lore.kernel.org/all/[email protected]/

Cc: [email protected]
Fixes: 3847ce32aea9f ("core: add tracepoints for queueing skb to rcvbuf")
Signed-off-by: Steven Rostedt (Google) <[email protected]>
Acked-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
include/trace/events/sock.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--- a/include/trace/events/sock.h
+++ b/include/trace/events/sock.h
@@ -98,7 +98,7 @@ TRACE_EVENT(sock_exceed_buf_limit,

TP_STRUCT__entry(
__array(char, name, 32)
- __field(long *, sysctl_mem)
+ __array(long, sysctl_mem, 3)
__field(long, allocated)
__field(int, sysctl_rmem)
__field(int, rmem_alloc)
@@ -110,7 +110,9 @@ TRACE_EVENT(sock_exceed_buf_limit,

TP_fast_assign(
strncpy(__entry->name, prot->name, 32);
- __entry->sysctl_mem = prot->sysctl_mem;
+ __entry->sysctl_mem[0] = READ_ONCE(prot->sysctl_mem[0]);
+ __entry->sysctl_mem[1] = READ_ONCE(prot->sysctl_mem[1]);
+ __entry->sysctl_mem[2] = READ_ONCE(prot->sysctl_mem[2]);
__entry->allocated = allocated;
__entry->sysctl_rmem = sk_get_rmem0(sk, prot);
__entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);


2022-07-19 13:54:41

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 225/231] serial: 8250: fix return error code in serial8250_request_std_resource()

From: Yi Yang <[email protected]>

commit 6e690d54cfa802f939cefbd2fa2c91bd0b8bd1b6 upstream.

If port->mapbase = NULL in serial8250_request_std_resource() , it need
return a error code instead of 0. If uart_set_info() fail to request new
regions by serial8250_request_std_resource() but the return value of
serial8250_request_std_resource() is 0, The system incorrectly considers
that the resource application is successful and does not attempt to
restore the old setting. A null pointer reference is triggered when the
port resource is later invoked.

Signed-off-by: Yi Yang <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/serial/8250/8250_port.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -2971,8 +2971,10 @@ static int serial8250_request_std_resour
case UPIO_MEM32BE:
case UPIO_MEM16:
case UPIO_MEM:
- if (!port->mapbase)
+ if (!port->mapbase) {
+ ret = -EINVAL;
break;
+ }

if (!request_mem_region(port->mapbase, size, "serial")) {
ret = -EBUSY;


2022-07-19 13:54:42

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 162/231] powerpc/xive/spapr: correct bitmap allocation size

From: Nathan Lynch <[email protected]>

[ Upstream commit 19fc5bb93c6bbdce8292b4d7eed04e2fa118d2fe ]

kasan detects access beyond the end of the xibm->bitmap allocation:

BUG: KASAN: slab-out-of-bounds in _find_first_zero_bit+0x40/0x140
Read of size 8 at addr c00000001d1d0118 by task swapper/0/1

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc2-00001-g90df023b36dd #28
Call Trace:
[c00000001d98f770] [c0000000012baab8] dump_stack_lvl+0xac/0x108 (unreliable)
[c00000001d98f7b0] [c00000000068faac] print_report+0x37c/0x710
[c00000001d98f880] [c0000000006902c0] kasan_report+0x110/0x354
[c00000001d98f950] [c000000000692324] __asan_load8+0xa4/0xe0
[c00000001d98f970] [c0000000011c6ed0] _find_first_zero_bit+0x40/0x140
[c00000001d98f9b0] [c0000000000dbfbc] xive_spapr_get_ipi+0xcc/0x260
[c00000001d98fa70] [c0000000000d6d28] xive_setup_cpu_ipi+0x1e8/0x450
[c00000001d98fb30] [c000000004032a20] pSeries_smp_probe+0x5c/0x118
[c00000001d98fb60] [c000000004018b44] smp_prepare_cpus+0x944/0x9ac
[c00000001d98fc90] [c000000004009f9c] kernel_init_freeable+0x2d4/0x640
[c00000001d98fd90] [c0000000000131e8] kernel_init+0x28/0x1d0
[c00000001d98fe10] [c00000000000cd54] ret_from_kernel_thread+0x5c/0x64

Allocated by task 0:
kasan_save_stack+0x34/0x70
__kasan_kmalloc+0xb4/0xf0
__kmalloc+0x268/0x540
xive_spapr_init+0x4d0/0x77c
pseries_init_irq+0x40/0x27c
init_IRQ+0x44/0x84
start_kernel+0x2a4/0x538
start_here_common+0x1c/0x20

The buggy address belongs to the object at c00000001d1d0118
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
8-byte region [c00000001d1d0118, c00000001d1d0120)

The buggy address belongs to the physical page:
page:c00c000000074740 refcount:1 mapcount:0 mapping:0000000000000000 index:0xc00000001d1d0558 pfn:0x1d1d
flags: 0x7ffff000000200(slab|node=0|zone=0|lastcpupid=0x7ffff)
raw: 007ffff000000200 c00000001d0003c8 c00000001d0003c8 c00000001d010480
raw: c00000001d1d0558 0000000001e1000a 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
c00000001d1d0000: fc 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
c00000001d1d0080: fc fc 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
>c00000001d1d0100: fc fc fc 02 fc fc fc fc fc fc fc fc fc fc fc fc
^
c00000001d1d0180: fc fc fc fc 04 fc fc fc fc fc fc fc fc fc fc fc
c00000001d1d0200: fc fc fc fc fc 04 fc fc fc fc fc fc fc fc fc fc

This happens because the allocation uses the wrong unit (bits) when it
should pass (BITS_TO_LONGS(count) * sizeof(long)) or equivalent. With small
numbers of bits, the allocated object can be smaller than sizeof(long),
which results in invalid accesses.

Use bitmap_zalloc() to allocate and initialize the irq bitmap, paired with
bitmap_free() for consistency.

Signed-off-by: Nathan Lynch <[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
arch/powerpc/sysdev/xive/spapr.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index 503f544d28e2..b0d36e430dbc 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -13,6 +13,7 @@
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <linux/bitmap.h>
#include <linux/cpumask.h>
#include <linux/mm.h>
#include <linux/delay.h>
@@ -55,7 +56,7 @@ static int __init xive_irq_bitmap_add(int base, int count)
spin_lock_init(&xibm->lock);
xibm->base = base;
xibm->count = count;
- xibm->bitmap = kzalloc(xibm->count, GFP_KERNEL);
+ xibm->bitmap = bitmap_zalloc(xibm->count, GFP_KERNEL);
if (!xibm->bitmap) {
kfree(xibm);
return -ENOMEM;
@@ -73,7 +74,7 @@ static void xive_irq_bitmap_remove_all(void)

list_for_each_entry_safe(xibm, tmp, &xive_irq_bitmaps, list) {
list_del(&xibm->list);
- kfree(xibm->bitmap);
+ bitmap_free(xibm->bitmap);
kfree(xibm);
}
}
--
2.35.1



2022-07-19 13:54:42

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 150/231] x86/cpu/amd: Add Spectral Chicken

From: Peter Zijlstra <[email protected]>

[ Upstream commit d7caac991feeef1b871ee6988fd2c9725df09039 ]

Zen2 uarchs have an undocumented, unnamed, MSR that contains a chicken
bit for some speculation behaviour. It needs setting.

Note: very belatedly AMD released naming; it's now officially called
MSR_AMD64_DE_CFG2 and MSR_AMD64_DE_CFG2_SUPPRESS_NOBR_PRED_BIT
but shall remain the SPECTRAL CHICKEN.

Suggested-by: Andrew Cooper <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/x86/include/asm/msr-index.h | 3 +++
arch/x86/kernel/cpu/amd.c | 23 ++++++++++++++++++++++-
arch/x86/kernel/cpu/cpu.h | 2 ++
arch/x86/kernel/cpu/hygon.c | 6 ++++++
4 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 4425d6773183..d15d0ef6b357 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -552,6 +552,9 @@
/* Fam 17h MSRs */
#define MSR_F17H_IRPERF 0xc00000e9

+#define MSR_ZEN2_SPECTRAL_CHICKEN 0xc00110e3
+#define MSR_ZEN2_SPECTRAL_CHICKEN_BIT BIT_ULL(1)
+
/* Fam 16h MSRs */
#define MSR_F16H_L2I_PERF_CTL 0xc0010230
#define MSR_F16H_L2I_PERF_CTR 0xc0010231
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 0c0b09796ced..8cf0659c0521 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -862,6 +862,26 @@ static void init_amd_bd(struct cpuinfo_x86 *c)
clear_rdrand_cpuid_bit(c);
}

+void init_spectral_chicken(struct cpuinfo_x86 *c)
+{
+ u64 value;
+
+ /*
+ * On Zen2 we offer this chicken (bit) on the altar of Speculation.
+ *
+ * This suppresses speculation from the middle of a basic block, i.e. it
+ * suppresses non-branch predictions.
+ *
+ * We use STIBP as a heuristic to filter out Zen2 from the rest of F17H
+ */
+ if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && cpu_has(c, X86_FEATURE_AMD_STIBP)) {
+ if (!rdmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, &value)) {
+ value |= MSR_ZEN2_SPECTRAL_CHICKEN_BIT;
+ wrmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, value);
+ }
+ }
+}
+
static void init_amd_zn(struct cpuinfo_x86 *c)
{
set_cpu_cap(c, X86_FEATURE_ZEN);
@@ -907,7 +927,8 @@ static void init_amd(struct cpuinfo_x86 *c)
case 0x12: init_amd_ln(c); break;
case 0x15: init_amd_bd(c); break;
case 0x16: init_amd_jg(c); break;
- case 0x17: fallthrough;
+ case 0x17: init_spectral_chicken(c);
+ fallthrough;
case 0x19: init_amd_zn(c); break;
}

diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 2a8e584fc991..7c9b5893c30a 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -61,6 +61,8 @@ static inline void tsx_init(void) { }
static inline void tsx_ap_init(void) { }
#endif /* CONFIG_CPU_SUP_INTEL */

+extern void init_spectral_chicken(struct cpuinfo_x86 *c);
+
extern void get_cpu_cap(struct cpuinfo_x86 *c);
extern void get_cpu_address_sizes(struct cpuinfo_x86 *c);
extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c
index 3fcdda4c1e11..21fd425088fe 100644
--- a/arch/x86/kernel/cpu/hygon.c
+++ b/arch/x86/kernel/cpu/hygon.c
@@ -302,6 +302,12 @@ static void init_hygon(struct cpuinfo_x86 *c)
/* get apicid instead of initial apic id from cpuid */
c->apicid = hard_smp_processor_id();

+ /*
+ * XXX someone from Hygon needs to confirm this DTRT
+ *
+ init_spectral_chicken(c);
+ */
+
set_cpu_cap(c, X86_FEATURE_ZEN);
set_cpu_cap(c, X86_FEATURE_CPB);

--
2.35.1



2022-07-19 13:54:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 071/231] sysctl: Fix data races in proc_dointvec_minmax().

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit f613d86d014b6375a4085901de39406598121e35 ]

A sysctl variable is accessed concurrently, and there is always a chance
of data-race. So, all readers and writers need some basic protection to
avoid load/store-tearing.

This patch changes proc_dointvec_minmax() to use READ_ONCE() and
WRITE_ONCE() internally to fix data-races on the sysctl side. For now,
proc_dointvec_minmax() itself is tolerant to a data-race, but we still
need to add annotations on the other subsystem's side.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
kernel/sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 6c61e2992fed..22ebf3f5eefe 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -929,7 +929,7 @@ static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp,
if ((param->min && *param->min > tmp) ||
(param->max && *param->max < tmp))
return -EINVAL;
- *valp = tmp;
+ WRITE_ONCE(*valp, tmp);
}

return 0;
--
2.35.1



2022-07-19 13:54:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 118/231] icmp: Fix a data-race around sysctl_icmp_ratemask.

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit 1ebcb25ad6fc3d50fca87350acf451b9a66dd31e ]

While reading sysctl_icmp_ratemask, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its reader.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/ipv4/icmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 41efb7381859..c13ceda9ce5d 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -282,7 +282,7 @@ static bool icmpv4_mask_allow(struct net *net, int type, int code)
return true;

/* Limit if icmp type is enabled in ratemask. */
- if (!((1 << type) & net->ipv4.sysctl_icmp_ratemask))
+ if (!((1 << type) & READ_ONCE(net->ipv4.sysctl_icmp_ratemask)))
return true;

return false;
--
2.35.1



2022-07-19 13:54:47

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 081/231] ARM: dts: at91: sama5d2: Fix typo in i2s1 node

From: Ryan Wanner <[email protected]>

[ Upstream commit 2fdf15b50a46e366740df4cccbe2343269b4ff55 ]

Fix typo in i2s1 causing errors in dt binding validation.
Change assigned-parrents to assigned-clock-parents
to match i2s0 node formatting.

Fixes: 1ca81883c557 ("ARM: dts: at91: sama5d2: add nodes for I2S controllers")
Signed-off-by: Ryan Wanner <[email protected]>
[claudiu.beznea: use imperative addressing in commit description, remove
blank line after fixes tag, fix typo in commit message]
Signed-off-by: Claudiu Beznea <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm/boot/dts/sama5d2.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 89c71d419f82..659a17fc755c 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -1124,7 +1124,7 @@ AT91_XDMAC_DT_PERID(33))>,
clocks = <&pmc PMC_TYPE_PERIPHERAL 55>, <&pmc PMC_TYPE_GCK 55>;
clock-names = "pclk", "gclk";
assigned-clocks = <&pmc PMC_TYPE_CORE PMC_I2S1_MUX>;
- assigned-parrents = <&pmc PMC_TYPE_GCK 55>;
+ assigned-clock-parents = <&pmc PMC_TYPE_GCK 55>;
status = "disabled";
};

--
2.35.1



2022-07-19 13:54:49

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 003/231] usb: dwc3: gadget: Fix event pending check

From: Thinh Nguyen <[email protected]>

commit 7441b273388b9a59d8387a03ffbbca9d5af6348c upstream.

The DWC3_EVENT_PENDING flag is used to protect against invalid call to
top-half interrupt handler, which can occur when there's a delay in
software detection of the interrupt line deassertion.

However, the clearing of this flag was done prior to unmasking the
interrupt line, creating opportunity where the top-half handler can
come. This breaks the serialization and creates a race between the
top-half and bottom-half handler, resulting in losing synchronization
between the controller and the driver when processing events.

To fix this, make sure the clearing of the DWC3_EVENT_PENDING is done at
the end of the bottom-half handler.

Fixes: d325a1de49d6 ("usb: dwc3: gadget: Prevent losing events in event cache")
Cc: [email protected]
Signed-off-by: Thinh Nguyen <[email protected]>
Link: https://lore.kernel.org/r/8670aaf1cf52e7d1e6df2a827af2d77263b93b75.1656380429.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/usb/dwc3/gadget.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -4224,7 +4224,6 @@ static irqreturn_t dwc3_process_event_bu
}

evt->count = 0;
- evt->flags &= ~DWC3_EVENT_PENDING;
ret = IRQ_HANDLED;

/* Unmask interrupt */
@@ -4236,6 +4235,9 @@ static irqreturn_t dwc3_process_event_bu
dwc3_writel(dwc->regs, DWC3_DEV_IMOD(0), dwc->imod_interval);
}

+ /* Keep the clearing of DWC3_EVENT_PENDING at the end */
+ evt->flags &= ~DWC3_EVENT_PENDING;
+
return ret;
}



2022-07-19 13:54:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 037/231] ARM: dts: imx6qdl-ts7970: Fix ngpio typo and count

From: Kris Bahnsen <[email protected]>

[ Upstream commit e95ea0f687e679fcb0a3a67d0755b81ee7d60db0 ]

Device-tree incorrectly used "ngpio" which caused the driver to
fallback to 32 ngpios.

This platform has 62 GPIO registers.

Fixes: 9ff8e9fccef9 ("ARM: dts: TS-7970: add basic device tree")
Signed-off-by: Kris Bahnsen <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6qdl-ts7970.dtsi b/arch/arm/boot/dts/imx6qdl-ts7970.dtsi
index fded07f370b3..d6ba4b2a60f6 100644
--- a/arch/arm/boot/dts/imx6qdl-ts7970.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-ts7970.dtsi
@@ -226,7 +226,7 @@ gpio8: gpio@28 {
reg = <0x28>;
#gpio-cells = <2>;
gpio-controller;
- ngpio = <32>;
+ ngpios = <62>;
};

sgtl5000: codec@a {
--
2.35.1



2022-07-19 13:54:51

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 205/231] ASoC: madera: Fix event generation for OUT1 demux

From: Charles Keepax <[email protected]>

[ Upstream commit e3cabbef3db8269207a6b8808f510137669f8deb ]

madera_out1_demux_put returns the value of
snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for
the kcontrol. This is obviously different to the expected return a 1 if
the control was updated value. This results in spurious notifications to
user-space. Update the handling to only return a 1 when the value is
changed.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/codecs/madera.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c
index 272041c6236a..8095a87117cf 100644
--- a/sound/soc/codecs/madera.c
+++ b/sound/soc/codecs/madera.c
@@ -618,7 +618,13 @@ int madera_out1_demux_put(struct snd_kcontrol *kcontrol,
end:
snd_soc_dapm_mutex_unlock(dapm);

- return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
+ ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
+ if (ret < 0) {
+ dev_err(madera->dev, "Failed to update demux power state: %d\n", ret);
+ return ret;
+ }
+
+ return change;
}
EXPORT_SYMBOL_GPL(madera_out1_demux_put);

--
2.35.1



2022-07-19 13:54:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 134/231] sfc: fix use after free when disabling sriov

From: Íñigo Huguet <[email protected]>

[ Upstream commit ebe41da5d47ac0fff877e57bd14c54dccf168827 ]

Use after free is detected by kfence when disabling sriov. What was read
after being freed was vf->pci_dev: it was freed from pci_disable_sriov
and later read in efx_ef10_sriov_free_vf_vports, called from
efx_ef10_sriov_free_vf_vswitching.

Set the pointer to NULL at release time to not trying to read it later.

Reproducer and dmesg log (note that kfence doesn't detect it every time):
$ echo 1 > /sys/class/net/enp65s0f0np0/device/sriov_numvfs
$ echo 0 > /sys/class/net/enp65s0f0np0/device/sriov_numvfs

BUG: KFENCE: use-after-free read in efx_ef10_sriov_free_vf_vswitching+0x82/0x170 [sfc]

Use-after-free read at 0x00000000ff3c1ba5 (in kfence-#224):
efx_ef10_sriov_free_vf_vswitching+0x82/0x170 [sfc]
efx_ef10_pci_sriov_disable+0x38/0x70 [sfc]
efx_pci_sriov_configure+0x24/0x40 [sfc]
sriov_numvfs_store+0xfe/0x140
kernfs_fop_write_iter+0x11c/0x1b0
new_sync_write+0x11f/0x1b0
vfs_write+0x1eb/0x280
ksys_write+0x5f/0xe0
do_syscall_64+0x5c/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xae

kfence-#224: 0x00000000edb8ef95-0x00000000671f5ce1, size=2792, cache=kmalloc-4k

allocated by task 6771 on cpu 10 at 3137.860196s:
pci_alloc_dev+0x21/0x60
pci_iov_add_virtfn+0x2a2/0x320
sriov_enable+0x212/0x3e0
efx_ef10_sriov_configure+0x67/0x80 [sfc]
efx_pci_sriov_configure+0x24/0x40 [sfc]
sriov_numvfs_store+0xba/0x140
kernfs_fop_write_iter+0x11c/0x1b0
new_sync_write+0x11f/0x1b0
vfs_write+0x1eb/0x280
ksys_write+0x5f/0xe0
do_syscall_64+0x5c/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xae

freed by task 6771 on cpu 12 at 3170.991309s:
device_release+0x34/0x90
kobject_cleanup+0x3a/0x130
pci_iov_remove_virtfn+0xd9/0x120
sriov_disable+0x30/0xe0
efx_ef10_pci_sriov_disable+0x57/0x70 [sfc]
efx_pci_sriov_configure+0x24/0x40 [sfc]
sriov_numvfs_store+0xfe/0x140
kernfs_fop_write_iter+0x11c/0x1b0
new_sync_write+0x11f/0x1b0
vfs_write+0x1eb/0x280
ksys_write+0x5f/0xe0
do_syscall_64+0x5c/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xae

Fixes: 3c5eb87605e85 ("sfc: create vports for VFs and assign random MAC addresses")
Reported-by: Yanghang Liu <[email protected]>
Signed-off-by: Íñigo Huguet <[email protected]>
Acked-by: Martin Habets <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/sfc/ef10_sriov.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index 7f5aa4a8c451..92550c7e85ce 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -408,8 +408,9 @@ static int efx_ef10_pci_sriov_enable(struct efx_nic *efx, int num_vfs)
static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force)
{
struct pci_dev *dev = efx->pci_dev;
+ struct efx_ef10_nic_data *nic_data = efx->nic_data;
unsigned int vfs_assigned = pci_vfs_assigned(dev);
- int rc = 0;
+ int i, rc = 0;

if (vfs_assigned && !force) {
netif_info(efx, drv, efx->net_dev, "VFs are assigned to guests; "
@@ -417,10 +418,13 @@ static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force)
return -EBUSY;
}

- if (!vfs_assigned)
+ if (!vfs_assigned) {
+ for (i = 0; i < efx->vf_count; i++)
+ nic_data->vf[i].pci_dev = NULL;
pci_disable_sriov(dev);
- else
+ } else {
rc = -EBUSY;
+ }

efx_ef10_sriov_free_vf_vswitching(efx);
efx->vf_count = 0;
--
2.35.1



2022-07-19 13:55:02

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 147/231] x86/bugs: Report AMD retbleed vulnerability

From: Alexandre Chartre <[email protected]>

[ Upstream commit 6b80b59b3555706508008f1f127b5412c89c7fd8 ]

Report that AMD x86 CPUs are vulnerable to the RETBleed (Arbitrary
Speculative Code Execution with Return Instructions) attack.

[peterz: add hygon]
[kim: invert parity; fam15h]

Co-developed-by: Kim Phillips <[email protected]>
Signed-off-by: Kim Phillips <[email protected]>
Signed-off-by: Alexandre Chartre <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/kernel/cpu/bugs.c | 13 +++++++++++++
arch/x86/kernel/cpu/common.c | 19 +++++++++++++++++++
drivers/base/cpu.c | 8 ++++++++
include/linux/cpu.h | 2 ++
5 files changed, 43 insertions(+)

diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index e17de69faa54..cf5553744e83 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -444,5 +444,6 @@
#define X86_BUG_ITLB_MULTIHIT X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */
#define X86_BUG_SRBDS X86_BUG(24) /* CPU may leak RNG bits if not mitigated */
#define X86_BUG_MMIO_STALE_DATA X86_BUG(25) /* CPU is affected by Processor MMIO Stale Data vulnerabilities */
+#define X86_BUG_RETBLEED X86_BUG(26) /* CPU is affected by RETBleed */

#endif /* _ASM_X86_CPUFEATURES_H */
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index a8a9f6406331..425ff2f32669 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1987,6 +1987,11 @@ static ssize_t srbds_show_state(char *buf)
return sprintf(buf, "%s\n", srbds_strings[srbds_mitigation]);
}

+static ssize_t retbleed_show_state(char *buf)
+{
+ return sprintf(buf, "Vulnerable\n");
+}
+
static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr,
char *buf, unsigned int bug)
{
@@ -2032,6 +2037,9 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
case X86_BUG_MMIO_STALE_DATA:
return mmio_stale_data_show_state(buf);

+ case X86_BUG_RETBLEED:
+ return retbleed_show_state(buf);
+
default:
break;
}
@@ -2088,4 +2096,9 @@ ssize_t cpu_show_mmio_stale_data(struct device *dev, struct device_attribute *at
{
return cpu_show_common(dev, attr, buf, X86_BUG_MMIO_STALE_DATA);
}
+
+ssize_t cpu_show_retbleed(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ return cpu_show_common(dev, attr, buf, X86_BUG_RETBLEED);
+}
#endif
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index af5d0c188f7b..796cc55313f4 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1231,16 +1231,27 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = {
{}
};

+#define VULNBL(vendor, family, model, blacklist) \
+ X86_MATCH_VENDOR_FAM_MODEL(vendor, family, model, blacklist)
+
#define VULNBL_INTEL_STEPPINGS(model, steppings, issues) \
X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE(INTEL, 6, \
INTEL_FAM6_##model, steppings, \
X86_FEATURE_ANY, issues)

+#define VULNBL_AMD(family, blacklist) \
+ VULNBL(AMD, family, X86_MODEL_ANY, blacklist)
+
+#define VULNBL_HYGON(family, blacklist) \
+ VULNBL(HYGON, family, X86_MODEL_ANY, blacklist)
+
#define SRBDS BIT(0)
/* CPU is affected by X86_BUG_MMIO_STALE_DATA */
#define MMIO BIT(1)
/* CPU is affected by Shared Buffers Data Sampling (SBDS), a variant of X86_BUG_MMIO_STALE_DATA */
#define MMIO_SBDS BIT(2)
+/* CPU is affected by RETbleed, speculating where you would not expect it */
+#define RETBLEED BIT(3)

static const struct x86_cpu_id cpu_vuln_blacklist[] __initconst = {
VULNBL_INTEL_STEPPINGS(IVYBRIDGE, X86_STEPPING_ANY, SRBDS),
@@ -1273,6 +1284,11 @@ static const struct x86_cpu_id cpu_vuln_blacklist[] __initconst = {
VULNBL_INTEL_STEPPINGS(ATOM_TREMONT, X86_STEPPINGS(0x1, 0x1), MMIO | MMIO_SBDS),
VULNBL_INTEL_STEPPINGS(ATOM_TREMONT_D, X86_STEPPING_ANY, MMIO),
VULNBL_INTEL_STEPPINGS(ATOM_TREMONT_L, X86_STEPPINGS(0x0, 0x0), MMIO | MMIO_SBDS),
+
+ VULNBL_AMD(0x15, RETBLEED),
+ VULNBL_AMD(0x16, RETBLEED),
+ VULNBL_AMD(0x17, RETBLEED),
+ VULNBL_HYGON(0x18, RETBLEED),
{}
};

@@ -1374,6 +1390,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
!arch_cap_mmio_immune(ia32_cap))
setup_force_cpu_bug(X86_BUG_MMIO_STALE_DATA);

+ if (cpu_matches(cpu_vuln_blacklist, RETBLEED))
+ setup_force_cpu_bug(X86_BUG_RETBLEED);
+
if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN))
return;

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index a97776ea9d99..4c98849577d4 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -570,6 +570,12 @@ ssize_t __weak cpu_show_mmio_stale_data(struct device *dev,
return sysfs_emit(buf, "Not affected\n");
}

+ssize_t __weak cpu_show_retbleed(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return sysfs_emit(buf, "Not affected\n");
+}
+
static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL);
static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL);
@@ -580,6 +586,7 @@ static DEVICE_ATTR(tsx_async_abort, 0444, cpu_show_tsx_async_abort, NULL);
static DEVICE_ATTR(itlb_multihit, 0444, cpu_show_itlb_multihit, NULL);
static DEVICE_ATTR(srbds, 0444, cpu_show_srbds, NULL);
static DEVICE_ATTR(mmio_stale_data, 0444, cpu_show_mmio_stale_data, NULL);
+static DEVICE_ATTR(retbleed, 0444, cpu_show_retbleed, NULL);

static struct attribute *cpu_root_vulnerabilities_attrs[] = {
&dev_attr_meltdown.attr,
@@ -592,6 +599,7 @@ static struct attribute *cpu_root_vulnerabilities_attrs[] = {
&dev_attr_itlb_multihit.attr,
&dev_attr_srbds.attr,
&dev_attr_mmio_stale_data.attr,
+ &dev_attr_retbleed.attr,
NULL
};

diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 2c7477354744..314802f98b9d 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -68,6 +68,8 @@ extern ssize_t cpu_show_srbds(struct device *dev, struct device_attribute *attr,
extern ssize_t cpu_show_mmio_stale_data(struct device *dev,
struct device_attribute *attr,
char *buf);
+extern ssize_t cpu_show_retbleed(struct device *dev,
+ struct device_attribute *attr, char *buf);

extern __printf(4, 5)
struct device *cpu_device_create(struct device *parent, void *drvdata,
--
2.35.1



2022-07-19 13:55:08

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 011/231] ALSA: hda/realtek: fix mute/micmute LEDs for HP machines

From: Jeremy Szu <[email protected]>

commit 61d307855eb1a2ae849da445edd5389db8a58a5c upstream.

The HP ProBook 440/450 G9 and EliteBook 640/650 G9 have multiple
motherboard design and they are using different subsystem ID of audio
codec. Add the same quirk for other MBs.

Signed-off-by: Jeremy Szu <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
sound/pci/hda/patch_realtek.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9150,6 +9150,10 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
+ SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
+ SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
+ SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
+ SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),


2022-07-19 13:55:16

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 058/231] ASoC: Intel: Skylake: Correct the ssp rate discovery in skl_get_ssp_clks()

From: Peter Ujfalusi <[email protected]>

[ Upstream commit 219af251bd1694bce1f627d238347d2eaf13de61 ]

The present flag is only set once when one rate has been found to be saved.
This will effectively going to ignore any rate discovered at later time and
based on the code, this is not the intention.

Fixes: bc2bd45b1f7f3 ("ASoC: Intel: Skylake: Parse nhlt and register clock device")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Cezary Rojewski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/intel/skylake/skl-nhlt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c
index 2439a574ac2f..366f7bd9bc02 100644
--- a/sound/soc/intel/skylake/skl-nhlt.c
+++ b/sound/soc/intel/skylake/skl-nhlt.c
@@ -99,7 +99,6 @@ static void skl_get_ssp_clks(struct skl_dev *skl, struct skl_ssp_clk *ssp_clks,
struct nhlt_fmt_cfg *fmt_cfg;
struct wav_fmt_ext *wav_fmt;
unsigned long rate;
- bool present = false;
int rate_index = 0;
u16 channels, bps;
u8 clk_src;
@@ -113,6 +112,8 @@ static void skl_get_ssp_clks(struct skl_dev *skl, struct skl_ssp_clk *ssp_clks,
return;

for (i = 0; i < fmt->fmt_count; i++) {
+ bool present = false;
+
fmt_cfg = &fmt->fmt_config[i];
wav_fmt = &fmt_cfg->fmt_ext;

--
2.35.1



2022-07-19 13:55:20

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 089/231] RISC-V: KVM: Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests()

From: Anup Patel <[email protected]>

[ Upstream commit be82abe6a76ba8e76f25312566182b0f13c4fbf9 ]

The kvm_riscv_check_vcpu_requests() is called with SRCU read lock held
and for KVM_REQ_SLEEP request it will block the VCPU without releasing
SRCU read lock. This causes KVM ioctls (such as KVM_IOEVENTFD) from
other VCPUs of the same Guest/VM to hang/deadlock if there is any
synchronize_srcu() or synchronize_srcu_expedited() in the path.

To fix the above in kvm_riscv_check_vcpu_requests(), we should do SRCU
read unlock before blocking the VCPU and do SRCU read lock after VCPU
wakeup.

Fixes: cce69aff689e ("RISC-V: KVM: Implement VCPU interrupts and requests handling")
Reported-by: Bin Meng <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
Tested-by: Heinrich Schuchardt <[email protected]>
Tested-by: Bin Meng <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/riscv/kvm/vcpu.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c
index 7461f964d20a..3894777bfa87 100644
--- a/arch/riscv/kvm/vcpu.c
+++ b/arch/riscv/kvm/vcpu.c
@@ -673,9 +673,11 @@ static void kvm_riscv_check_vcpu_requests(struct kvm_vcpu *vcpu)

if (kvm_request_pending(vcpu)) {
if (kvm_check_request(KVM_REQ_SLEEP, vcpu)) {
+ kvm_vcpu_srcu_read_unlock(vcpu);
rcuwait_wait_event(wait,
(!vcpu->arch.power_off) && (!vcpu->arch.pause),
TASK_INTERRUPTIBLE);
+ kvm_vcpu_srcu_read_lock(vcpu);

if (vcpu->arch.power_off || vcpu->arch.pause) {
/*
--
2.35.1



2022-07-19 13:55:20

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 138/231] seg6: bpf: fix skb checksum in bpf_push_seg6_encap()

From: Andrea Mayer <[email protected]>

[ Upstream commit 4889fbd98deaf243c3baadc54e296d71c6af1eb0 ]

Both helper functions bpf_lwt_seg6_action() and bpf_lwt_push_encap() use
the bpf_push_seg6_encap() to encapsulate the packet in an IPv6 with Segment
Routing Header (SRH) or insert an SRH between the IPv6 header and the
payload.
To achieve this result, such helper functions rely on bpf_push_seg6_encap()
which, in turn, leverages seg6_do_srh_{encap,inline}() to perform the
required operation (i.e. encap/inline).

This patch removes the initialization of the IPv6 header payload length
from bpf_push_seg6_encap(), as it is now handled properly by
seg6_do_srh_{encap,inline}() to prevent corruption of the skb checksum.

Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Signed-off-by: Andrea Mayer <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/core/filter.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index af1e77f2f24a..6391c1885bca 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6148,7 +6148,6 @@ static int bpf_push_seg6_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len
if (err)
return err;

- ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
skb_set_transport_header(skb, sizeof(struct ipv6hdr));

return seg6_lookup_nexthop(skb, NULL, 0);
--
2.35.1



2022-07-19 13:55:22

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 100/231] drm/i915/selftests: fix a couple IS_ERR() vs NULL tests

From: Dan Carpenter <[email protected]>

[ Upstream commit 896dcabd1f8f613c533d948df17408c41f8929f5 ]

The shmem_pin_map() function doesn't return error pointers, it returns
NULL.

Fixes: be1cb55a07bf ("drm/i915/gt: Keep a no-frills swappable copy of the default context state")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>
Signed-off-by: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20220708094104.GL2316@kadam
(cherry picked from commit d50f5a109cf4ed50c5b575c1bb5fc3bd17b23308)
Signed-off-by: Rodrigo Vivi <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/gpu/drm/i915/gt/selftest_lrc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index 21c29d315cc0..9d42a7c67a8c 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -155,8 +155,8 @@ static int live_lrc_layout(void *arg)
continue;

hw = shmem_pin_map(engine->default_state);
- if (IS_ERR(hw)) {
- err = PTR_ERR(hw);
+ if (!hw) {
+ err = -ENOMEM;
break;
}
hw += LRC_STATE_OFFSET / sizeof(*hw);
@@ -331,8 +331,8 @@ static int live_lrc_fixed(void *arg)
continue;

hw = shmem_pin_map(engine->default_state);
- if (IS_ERR(hw)) {
- err = PTR_ERR(hw);
+ if (!hw) {
+ err = -ENOMEM;
break;
}
hw += LRC_STATE_OFFSET / sizeof(*hw);
--
2.35.1



2022-07-19 13:55:29

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 217/231] nvme: use struct group for generic command dwords

From: Keith Busch <[email protected]>

[ Upstream commit 5c629dc9609dc43492a7bc8060cc6120875bf096 ]

This will allow the trace event to know the full size of the data
intended to be copied and silence read overflow checks.

Reported-by: John Garry <[email protected]>
Suggested-by: Christoph Hellwig <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/nvme/host/trace.h | 2 +-
include/linux/nvme.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h
index b5f85259461a..37c7f4c89f92 100644
--- a/drivers/nvme/host/trace.h
+++ b/drivers/nvme/host/trace.h
@@ -69,7 +69,7 @@ TRACE_EVENT(nvme_setup_cmd,
__entry->metadata = !!blk_integrity_rq(req);
__entry->fctype = cmd->fabrics.fctype;
__assign_disk_name(__entry->disk, req->q->disk);
- memcpy(__entry->cdw10, &cmd->common.cdw10,
+ memcpy(__entry->cdw10, &cmd->common.cdws,
sizeof(__entry->cdw10));
),
TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%x, cmd=(%s %s)",
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index f626a445d1a8..99b1b56f0cd3 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -867,12 +867,14 @@ struct nvme_common_command {
__le32 cdw2[2];
__le64 metadata;
union nvme_data_ptr dptr;
+ struct_group(cdws,
__le32 cdw10;
__le32 cdw11;
__le32 cdw12;
__le32 cdw13;
__le32 cdw14;
__le32 cdw15;
+ );
};

struct nvme_rw_command {
--
2.35.1



2022-07-19 13:55:36

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 032/231] nilfs2: fix incorrect masking of permission flags for symlinks

From: Ryusuke Konishi <[email protected]>

commit 5924e6ec1585445f251ea92713eb15beb732622a upstream.

The permission flags of newly created symlinks are wrongly dropped on
nilfs2 with the current umask value even though symlinks should have 777
(rwxrwxrwx) permissions:

$ umask
0022
$ touch file && ln -s file symlink; ls -l file symlink
-rw-r--r--. 1 root root 0 Jun 23 16:29 file
lrwxr-xr-x. 1 root root 4 Jun 23 16:29 symlink -> file

This fixes the bug by inserting a missing check that excludes
symlinks.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ryusuke Konishi <[email protected]>
Reported-by: Tommy Pettersson <[email protected]>
Reported-by: Ciprian Craciun <[email protected]>
Tested-by: Ryusuke Konishi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/nilfs2/nilfs.h | 3 +++
1 file changed, 3 insertions(+)

--- a/fs/nilfs2/nilfs.h
+++ b/fs/nilfs2/nilfs.h
@@ -198,6 +198,9 @@ static inline int nilfs_acl_chmod(struct

static inline int nilfs_init_acl(struct inode *inode, struct inode *dir)
{
+ if (S_ISLNK(inode->i_mode))
+ return 0;
+
inode->i_mode &= ~current_umask();
return 0;
}


2022-07-19 13:55:38

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 133/231] smb3: workaround negprot bug in some Samba servers

From: Steve French <[email protected]>

[ Upstream commit 32f319183c439b239294cb2d70ada3564c4c7c39 ]

Mount can now fail to older Samba servers due to a server
bug handling padding at the end of the last negotiate
context (negotiate contexts typically are rounded up to 8
bytes by adding padding if needed). This server bug can
be avoided by switching the order of negotiate contexts,
placing a negotiate context at the end that does not
require padding (prior to the recent netname context fix
this was the case on the client).

Fixes: 73130a7b1ac9 ("smb3: fix empty netname context on secondary channels")
Reported-by: Julian Sikorski <[email protected]>
Tested-by: Julian Sikorski <[email protected]>
Reviewed-by: Shyam Prasad N <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
fs/cifs/smb2pdu.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 6a8a00f28b19..2e6c0f4d8449 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -571,10 +571,6 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
*total_len += ctxt_len;
pneg_ctxt += ctxt_len;

- build_posix_ctxt((struct smb2_posix_neg_context *)pneg_ctxt);
- *total_len += sizeof(struct smb2_posix_neg_context);
- pneg_ctxt += sizeof(struct smb2_posix_neg_context);
-
/*
* secondary channels don't have the hostname field populated
* use the hostname field in the primary channel instead
@@ -586,9 +582,14 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
hostname);
*total_len += ctxt_len;
pneg_ctxt += ctxt_len;
- neg_context_count = 4;
- } else /* second channels do not have a hostname */
neg_context_count = 3;
+ } else
+ neg_context_count = 2;
+
+ build_posix_ctxt((struct smb2_posix_neg_context *)pneg_ctxt);
+ *total_len += sizeof(struct smb2_posix_neg_context);
+ pneg_ctxt += sizeof(struct smb2_posix_neg_context);
+ neg_context_count++;

if (server->compress_algorithm) {
build_compression_ctxt((struct smb2_compression_capabilities_context *)
--
2.35.1



2022-07-19 13:55:42

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 040/231] ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle

From: Ard Biesheuvel <[email protected]>

[ Upstream commit 0609e200246bfd3b7516091c491bec4308349055 ]

Jon reports that the Spectre-BHB init code is filling up the kernel log
with spurious notifications about which mitigation has been enabled,
every time any CPU comes out of a low power state.

Given that Spectre-BHB mitigations are system wide, only a single
mitigation can be enabled, and we already print an error if two types of
CPUs coexist in a single system that require different Spectre-BHB
mitigations.

This means that the pr_info() that describes the selected mitigation
does not need to be emitted for each CPU anyway, and so we can simply
emit it only once.

In order to clarify the above in the log message, update it to describe
that the selected mitigation will be enabled on all CPUs, including ones
that are unaffected. If another CPU comes up later that is affected and
requires a different mitigation, we report an error as before.

Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround")
Tested-by: Jon Hunter <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Russell King (Oracle) <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm/mm/proc-v7-bugs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mm/proc-v7-bugs.c b/arch/arm/mm/proc-v7-bugs.c
index f9730eba0632..8bc7a2d6d6c7 100644
--- a/arch/arm/mm/proc-v7-bugs.c
+++ b/arch/arm/mm/proc-v7-bugs.c
@@ -208,10 +208,10 @@ static int spectre_bhb_install_workaround(int method)
return SPECTRE_VULNERABLE;

spectre_bhb_method = method;
- }

- pr_info("CPU%u: Spectre BHB: using %s workaround\n",
- smp_processor_id(), spectre_bhb_method_name(method));
+ pr_info("CPU%u: Spectre BHB: enabling %s workaround for all CPUs\n",
+ smp_processor_id(), spectre_bhb_method_name(method));
+ }

return SPECTRE_MITIGATED;
}
--
2.35.1



2022-07-19 13:55:42

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 179/231] NFC: nxp-nci: dont print header length mismatch on i2c error

From: Michael Walle <[email protected]>

[ Upstream commit 9577fc5fdc8b07b891709af6453545db405e24ad ]

Don't print a misleading header length mismatch error if the i2c call
returns an error. Instead just return the error code without any error
message.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/nfc/nxp-nci/i2c.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -122,7 +122,9 @@ static int nxp_nci_i2c_fw_read(struct nx
skb_put_data(*skb, &header, NXP_NCI_FW_HDR_LEN);

r = i2c_master_recv(client, skb_put(*skb, frame_len), frame_len);
- if (r != frame_len) {
+ if (r < 0) {
+ goto fw_read_exit_free_skb;
+ } else if (r != frame_len) {
nfc_err(&client->dev,
"Invalid frame length: %u (expected %zu)\n",
r, frame_len);
@@ -166,7 +168,9 @@ static int nxp_nci_i2c_nci_read(struct n
return 0;

r = i2c_master_recv(client, skb_put(*skb, header.plen), header.plen);
- if (r != header.plen) {
+ if (r < 0) {
+ goto nci_read_exit_free_skb;
+ } else if (r != header.plen) {
nfc_err(&client->dev,
"Invalid frame payload length: %u (expected %u)\n",
r, header.plen);


2022-07-19 13:55:45

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 193/231] ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow

From: Peter Ujfalusi <[email protected]>

[ Upstream commit bbfef046c6613404c01aeb9e9928bebb78dd327a ]

Update the comment for the cl_dsp_init() to clarify what is done by the
function and use the chip->init_core_mask instead of BIT(0) when
unstalling/running the init core.

Complements: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/sof/intel/hda-loader.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c
index 9f624a84182b..88d23924e1bf 100644
--- a/sound/soc/sof/intel/hda-loader.c
+++ b/sound/soc/sof/intel/hda-loader.c
@@ -97,9 +97,9 @@ static struct hdac_ext_stream *cl_stream_prepare(struct snd_sof_dev *sdev, unsig
}

/*
- * first boot sequence has some extra steps. core 0 waits for power
- * status on core 1, so power up core 1 also momentarily, keep it in
- * reset/stall and then turn it off
+ * first boot sequence has some extra steps.
+ * power on all host managed cores and only unstall/run the boot core to boot the
+ * DSP then turn off all non boot cores (if any) is powered on.
*/
static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
{
@@ -127,7 +127,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
((stream_tag - 1) << 9)));

/* step 3: unset core 0 reset state & unstall/run core 0 */
- ret = hda_dsp_core_run(sdev, BIT(0));
+ ret = hda_dsp_core_run(sdev, chip->init_core_mask);
if (ret < 0) {
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
dev_err(sdev->dev,
--
2.35.1



2022-07-19 13:56:05

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 195/231] ASoC: wcd9335: Fix spurious event generation

From: Mark Brown <[email protected]>

[ Upstream commit a7786cbae4b2732815da98efa39df96746b5bd0d ]

The slimbus mux put operation unconditionally reports a change in value
which means that spurious events are generated. Fix this by exiting early
in that case.

Signed-off-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/codecs/wcd9335.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index 12be043ee9a3..aa685980a97b 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -1287,6 +1287,9 @@ static int slim_rx_mux_put(struct snd_kcontrol *kc,
struct snd_soc_dapm_update *update = NULL;
u32 port_id = w->shift;

+ if (wcd->rx_port_value[port_id] == ucontrol->value.enumerated.item[0])
+ return 0;
+
wcd->rx_port_value[port_id] = ucontrol->value.enumerated.item[0];

/* Remove channel from any list it's in before adding it to a new one */
--
2.35.1



2022-07-19 13:56:05

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 101/231] drm/i915/ttm: fix sg_table construction

From: Matthew Auld <[email protected]>

[ Upstream commit aff1e0b09b54b64944b7fe32997229552737b9e9 ]

If we encounter some monster sized local-memory page that exceeds the
maximum sg length (UINT32_MAX), ensure that don't end up with some
misaligned address in the entry that follows, leading to fireworks
later. Also ensure we have some coverage of this in the selftests.

v2(Chris):
- Use round_down consistently to avoid udiv errors
v3(Nirmoy):
- Also update the max_segment in the selftest

Fixes: f701b16d4cc5 ("drm/i915/ttm: add i915_sg_from_buddy_resource")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6379
Signed-off-by: Matthew Auld <[email protected]>
Cc: Thomas Hellström <[email protected]>
Cc: Nirmoy Das <[email protected]>
Reviewed-by: Nirmoy Das <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit bc99f1209f19fefa3ee11e77464ccfae541f4291)
Signed-off-by: Rodrigo Vivi <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 ++++++++--
drivers/gpu/drm/i915/i915_scatterlist.c | 19 +++++++++++++----
drivers/gpu/drm/i915/i915_scatterlist.h | 6 ++++--
drivers/gpu/drm/i915/intel_region_ttm.c | 10 ++++++---
drivers/gpu/drm/i915/intel_region_ttm.h | 3 ++-
.../drm/i915/selftests/intel_memory_region.c | 21 +++++++++++++++++--
drivers/gpu/drm/i915/selftests/mock_region.c | 3 ++-
7 files changed, 58 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
index 45cc5837ce00..342ca303eae4 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
@@ -583,10 +583,15 @@ i915_ttm_resource_get_st(struct drm_i915_gem_object *obj,
struct ttm_resource *res)
{
struct ttm_buffer_object *bo = i915_gem_to_ttm(obj);
+ u64 page_alignment;

if (!i915_ttm_gtt_binds_lmem(res))
return i915_ttm_tt_get_st(bo->ttm);

+ page_alignment = bo->page_alignment << PAGE_SHIFT;
+ if (!page_alignment)
+ page_alignment = obj->mm.region->min_page_size;
+
/*
* If CPU mapping differs, we need to add the ttm_tt pages to
* the resulting st. Might make sense for GGTT.
@@ -597,7 +602,8 @@ i915_ttm_resource_get_st(struct drm_i915_gem_object *obj,
struct i915_refct_sgt *rsgt;

rsgt = intel_region_ttm_resource_to_rsgt(obj->mm.region,
- res);
+ res,
+ page_alignment);
if (IS_ERR(rsgt))
return rsgt;

@@ -606,7 +612,8 @@ i915_ttm_resource_get_st(struct drm_i915_gem_object *obj,
return i915_refct_sgt_get(obj->ttm.cached_io_rsgt);
}

- return intel_region_ttm_resource_to_rsgt(obj->mm.region, res);
+ return intel_region_ttm_resource_to_rsgt(obj->mm.region, res,
+ page_alignment);
}

static int i915_ttm_truncate(struct drm_i915_gem_object *obj)
diff --git a/drivers/gpu/drm/i915/i915_scatterlist.c b/drivers/gpu/drm/i915/i915_scatterlist.c
index 159571b9bd24..f63b50b71e10 100644
--- a/drivers/gpu/drm/i915/i915_scatterlist.c
+++ b/drivers/gpu/drm/i915/i915_scatterlist.c
@@ -68,6 +68,7 @@ void i915_refct_sgt_init(struct i915_refct_sgt *rsgt, size_t size)
* drm_mm_node
* @node: The drm_mm_node.
* @region_start: An offset to add to the dma addresses of the sg list.
+ * @page_alignment: Required page alignment for each sg entry. Power of two.
*
* Create a struct sg_table, initializing it from a struct drm_mm_node,
* taking a maximum segment length into account, splitting into segments
@@ -77,15 +78,18 @@ void i915_refct_sgt_init(struct i915_refct_sgt *rsgt, size_t size)
* error code cast to an error pointer on failure.
*/
struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
- u64 region_start)
+ u64 region_start,
+ u64 page_alignment)
{
- const u64 max_segment = SZ_1G; /* Do we have a limit on this? */
+ const u64 max_segment = round_down(UINT_MAX, page_alignment);
u64 segment_pages = max_segment >> PAGE_SHIFT;
u64 block_size, offset, prev_end;
struct i915_refct_sgt *rsgt;
struct sg_table *st;
struct scatterlist *sg;

+ GEM_BUG_ON(!max_segment);
+
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL);
if (!rsgt)
return ERR_PTR(-ENOMEM);
@@ -112,6 +116,8 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
sg = __sg_next(sg);

sg_dma_address(sg) = region_start + offset;
+ GEM_BUG_ON(!IS_ALIGNED(sg_dma_address(sg),
+ page_alignment));
sg_dma_len(sg) = 0;
sg->length = 0;
st->nents++;
@@ -138,6 +144,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
* i915_buddy_block list
* @res: The struct i915_ttm_buddy_resource.
* @region_start: An offset to add to the dma addresses of the sg list.
+ * @page_alignment: Required page alignment for each sg entry. Power of two.
*
* Create a struct sg_table, initializing it from struct i915_buddy_block list,
* taking a maximum segment length into account, splitting into segments
@@ -147,11 +154,12 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
* error code cast to an error pointer on failure.
*/
struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
- u64 region_start)
+ u64 region_start,
+ u64 page_alignment)
{
struct i915_ttm_buddy_resource *bman_res = to_ttm_buddy_resource(res);
const u64 size = res->num_pages << PAGE_SHIFT;
- const u64 max_segment = rounddown(UINT_MAX, PAGE_SIZE);
+ const u64 max_segment = round_down(UINT_MAX, page_alignment);
struct drm_buddy *mm = bman_res->mm;
struct list_head *blocks = &bman_res->blocks;
struct drm_buddy_block *block;
@@ -161,6 +169,7 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
resource_size_t prev_end;

GEM_BUG_ON(list_empty(blocks));
+ GEM_BUG_ON(!max_segment);

rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL);
if (!rsgt)
@@ -191,6 +200,8 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
sg = __sg_next(sg);

sg_dma_address(sg) = region_start + offset;
+ GEM_BUG_ON(!IS_ALIGNED(sg_dma_address(sg),
+ page_alignment));
sg_dma_len(sg) = 0;
sg->length = 0;
st->nents++;
diff --git a/drivers/gpu/drm/i915/i915_scatterlist.h b/drivers/gpu/drm/i915/i915_scatterlist.h
index 12c6a1684081..b13e4cdea923 100644
--- a/drivers/gpu/drm/i915/i915_scatterlist.h
+++ b/drivers/gpu/drm/i915/i915_scatterlist.h
@@ -213,9 +213,11 @@ static inline void __i915_refct_sgt_init(struct i915_refct_sgt *rsgt,
void i915_refct_sgt_init(struct i915_refct_sgt *rsgt, size_t size);

struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
- u64 region_start);
+ u64 region_start,
+ u64 page_alignment);

struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
- u64 region_start);
+ u64 region_start,
+ u64 page_alignment);

#endif
diff --git a/drivers/gpu/drm/i915/intel_region_ttm.c b/drivers/gpu/drm/i915/intel_region_ttm.c
index 737ef3f4ab54..d896558cf458 100644
--- a/drivers/gpu/drm/i915/intel_region_ttm.c
+++ b/drivers/gpu/drm/i915/intel_region_ttm.c
@@ -151,6 +151,7 @@ int intel_region_ttm_fini(struct intel_memory_region *mem)
* Convert an opaque TTM resource manager resource to a refcounted sg_table.
* @mem: The memory region.
* @res: The resource manager resource obtained from the TTM resource manager.
+ * @page_alignment: Required page alignment for each sg entry. Power of two.
*
* The gem backends typically use sg-tables for operations on the underlying
* io_memory. So provide a way for the backends to translate the
@@ -160,16 +161,19 @@ int intel_region_ttm_fini(struct intel_memory_region *mem)
*/
struct i915_refct_sgt *
intel_region_ttm_resource_to_rsgt(struct intel_memory_region *mem,
- struct ttm_resource *res)
+ struct ttm_resource *res,
+ u64 page_alignment)
{
if (mem->is_range_manager) {
struct ttm_range_mgr_node *range_node =
to_ttm_range_mgr_node(res);

return i915_rsgt_from_mm_node(&range_node->mm_nodes[0],
- mem->region.start);
+ mem->region.start,
+ page_alignment);
} else {
- return i915_rsgt_from_buddy_resource(res, mem->region.start);
+ return i915_rsgt_from_buddy_resource(res, mem->region.start,
+ page_alignment);
}
}

diff --git a/drivers/gpu/drm/i915/intel_region_ttm.h b/drivers/gpu/drm/i915/intel_region_ttm.h
index fdee5e7bd46c..b17e494ef79c 100644
--- a/drivers/gpu/drm/i915/intel_region_ttm.h
+++ b/drivers/gpu/drm/i915/intel_region_ttm.h
@@ -24,7 +24,8 @@ int intel_region_ttm_fini(struct intel_memory_region *mem);

struct i915_refct_sgt *
intel_region_ttm_resource_to_rsgt(struct intel_memory_region *mem,
- struct ttm_resource *res);
+ struct ttm_resource *res,
+ u64 page_alignment);

void intel_region_ttm_resource_free(struct intel_memory_region *mem,
struct ttm_resource *res);
diff --git a/drivers/gpu/drm/i915/selftests/intel_memory_region.c b/drivers/gpu/drm/i915/selftests/intel_memory_region.c
index ba32893e0873..0250a114fe0a 100644
--- a/drivers/gpu/drm/i915/selftests/intel_memory_region.c
+++ b/drivers/gpu/drm/i915/selftests/intel_memory_region.c
@@ -451,7 +451,6 @@ static int igt_mock_splintered_region(void *arg)

static int igt_mock_max_segment(void *arg)
{
- const unsigned int max_segment = rounddown(UINT_MAX, PAGE_SIZE);
struct intel_memory_region *mem = arg;
struct drm_i915_private *i915 = mem->i915;
struct i915_ttm_buddy_resource *res;
@@ -460,7 +459,10 @@ static int igt_mock_max_segment(void *arg)
struct drm_buddy *mm;
struct list_head *blocks;
struct scatterlist *sg;
+ I915_RND_STATE(prng);
LIST_HEAD(objects);
+ unsigned int max_segment;
+ unsigned int ps;
u64 size;
int err = 0;

@@ -472,7 +474,13 @@ static int igt_mock_max_segment(void *arg)
*/

size = SZ_8G;
- mem = mock_region_create(i915, 0, size, PAGE_SIZE, 0, 0);
+ ps = PAGE_SIZE;
+ if (i915_prandom_u64_state(&prng) & 1)
+ ps = SZ_64K; /* For something like DG2 */
+
+ max_segment = round_down(UINT_MAX, ps);
+
+ mem = mock_region_create(i915, 0, size, ps, 0, 0);
if (IS_ERR(mem))
return PTR_ERR(mem);

@@ -498,12 +506,21 @@ static int igt_mock_max_segment(void *arg)
}

for (sg = obj->mm.pages->sgl; sg; sg = sg_next(sg)) {
+ dma_addr_t daddr = sg_dma_address(sg);
+
if (sg->length > max_segment) {
pr_err("%s: Created an oversized scatterlist entry, %u > %u\n",
__func__, sg->length, max_segment);
err = -EINVAL;
goto out_close;
}
+
+ if (!IS_ALIGNED(daddr, ps)) {
+ pr_err("%s: Created an unaligned scatterlist entry, addr=%pa, ps=%u\n",
+ __func__, &daddr, ps);
+ err = -EINVAL;
+ goto out_close;
+ }
}

out_close:
diff --git a/drivers/gpu/drm/i915/selftests/mock_region.c b/drivers/gpu/drm/i915/selftests/mock_region.c
index f64325491f35..6f7c9820d3e9 100644
--- a/drivers/gpu/drm/i915/selftests/mock_region.c
+++ b/drivers/gpu/drm/i915/selftests/mock_region.c
@@ -32,7 +32,8 @@ static int mock_region_get_pages(struct drm_i915_gem_object *obj)
return PTR_ERR(obj->mm.res);

obj->mm.rsgt = intel_region_ttm_resource_to_rsgt(obj->mm.region,
- obj->mm.res);
+ obj->mm.res,
+ obj->mm.region->min_page_size);
if (IS_ERR(obj->mm.rsgt)) {
err = PTR_ERR(obj->mm.rsgt);
goto err_free_resource;
--
2.35.1



2022-07-19 13:56:13

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 061/231] netfilter: conntrack: split inner loop of list dumping to own function

From: Florian Westphal <[email protected]>

[ Upstream commit 49001a2e83a80f6d9c4287c46ffa41a03667bbd1 ]

This allows code re-use in the followup patch.
No functional changes intended.

Signed-off-by: Florian Westphal <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/netfilter/nf_conntrack_netlink.c | 68 ++++++++++++++++++----------
1 file changed, 43 insertions(+), 25 deletions(-)

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 1ea2ad732d57..924d766e6c53 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1708,6 +1708,47 @@ static int ctnetlink_done_list(struct netlink_callback *cb)
return 0;
}

+static int ctnetlink_dump_one_entry(struct sk_buff *skb,
+ struct netlink_callback *cb,
+ struct nf_conn *ct,
+ bool dying)
+{
+ struct ctnetlink_list_dump_ctx *ctx = (void *)cb->ctx;
+ struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
+ u8 l3proto = nfmsg->nfgen_family;
+ int res;
+
+ if (l3proto && nf_ct_l3num(ct) != l3proto)
+ return 0;
+
+ if (ctx->last) {
+ if (ct != ctx->last)
+ return 0;
+
+ ctx->last = NULL;
+ }
+
+ /* We can't dump extension info for the unconfirmed
+ * list because unconfirmed conntracks can have
+ * ct->ext reallocated (and thus freed).
+ *
+ * In the dying list case ct->ext can't be free'd
+ * until after we drop pcpu->lock.
+ */
+ res = ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).portid,
+ cb->nlh->nlmsg_seq,
+ NFNL_MSG_TYPE(cb->nlh->nlmsg_type),
+ ct, dying, 0);
+ if (res < 0) {
+ if (!refcount_inc_not_zero(&ct->ct_general.use))
+ return 0;
+
+ ctx->last = ct;
+ }
+
+ return res;
+}
+
static int
ctnetlink_dump_list(struct sk_buff *skb, struct netlink_callback *cb, bool dying)
{
@@ -1715,12 +1756,9 @@ ctnetlink_dump_list(struct sk_buff *skb, struct netlink_callback *cb, bool dying
struct nf_conn *ct, *last;
struct nf_conntrack_tuple_hash *h;
struct hlist_nulls_node *n;
- struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
- u_int8_t l3proto = nfmsg->nfgen_family;
- int res;
- int cpu;
struct hlist_nulls_head *list;
struct net *net = sock_net(skb->sk);
+ int res, cpu;

if (ctx->done)
return 0;
@@ -1739,30 +1777,10 @@ ctnetlink_dump_list(struct sk_buff *skb, struct netlink_callback *cb, bool dying
restart:
hlist_nulls_for_each_entry(h, n, list, hnnode) {
ct = nf_ct_tuplehash_to_ctrack(h);
- if (l3proto && nf_ct_l3num(ct) != l3proto)
- continue;
- if (ctx->last) {
- if (ct != last)
- continue;
- ctx->last = NULL;
- }

- /* We can't dump extension info for the unconfirmed
- * list because unconfirmed conntracks can have
- * ct->ext reallocated (and thus freed).
- *
- * In the dying list case ct->ext can't be free'd
- * until after we drop pcpu->lock.
- */
- res = ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).portid,
- cb->nlh->nlmsg_seq,
- NFNL_MSG_TYPE(cb->nlh->nlmsg_type),
- ct, dying, 0);
+ res = ctnetlink_dump_one_entry(skb, cb, ct, dying);
if (res < 0) {
- if (!refcount_inc_not_zero(&ct->ct_general.use))
- continue;
ctx->cpu = cpu;
- ctx->last = ct;
spin_unlock_bh(&pcpu->lock);
goto out;
}
--
2.35.1



2022-07-19 13:56:19

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 002/231] usb: typec: add missing uevent when partner support PD

From: Linyu Yuan <[email protected]>

commit 6fb9e1d94789e8ee5a258a23bc588693f743fd6c upstream.

System like Android allow user control power role from UI, it is possible
to implement application base on typec uevent to refresh UI, but found
there is chance that UI show different state from typec attribute file.

In typec_set_pwr_opmode(), when partner support PD, there is no uevent
send to user space which cause the problem.

Fix it by sending uevent notification when change power mode to PD.

Fixes: bdecb33af34f ("usb: typec: API for controlling USB Type-C Multiplexers")
Cc: [email protected]
Signed-off-by: Linyu Yuan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/usb/typec/class.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -1718,6 +1718,7 @@ void typec_set_pwr_opmode(struct typec_p
partner->usb_pd = 1;
sysfs_notify(&partner_dev->kobj, NULL,
"supports_usb_power_delivery");
+ kobject_uevent(&partner_dev->kobj, KOBJ_CHANGE);
}
put_device(partner_dev);
}


2022-07-19 13:56:29

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 050/231] drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()

From: Hangyu Hua <[email protected]>

[ Upstream commit 85144df9ff4652816448369de76897c57cbb1b93 ]

If drm_connector_init fails, intel_connector_free will be called to take
care of proper free. So it is necessary to drop the refcount of port
before intel_connector_free.

Fixes: 091a4f91942a ("drm/i915: Handle drm-layer errors in intel_dp_add_mst_connector")
Signed-off-by: Hangyu Hua <[email protected]>
Reviewed-by: José Roberto de Souza <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: José Roberto de Souza <[email protected]>
(cherry picked from commit cea9ed611e85d36a05db52b6457bf584b7d969e2)
Signed-off-by: Rodrigo Vivi <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/gpu/drm/i915/display/intel_dp_mst.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index e30e698aa684..f7d46ea3afb9 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -841,6 +841,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs,
DRM_MODE_CONNECTOR_DisplayPort);
if (ret) {
+ drm_dp_mst_put_port_malloc(port);
intel_connector_free(intel_connector);
return NULL;
}
--
2.35.1



2022-07-19 13:56:30

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 172/231] platform/x86: thinkpad-acpi: profile capabilities as integer

From: Mark Pearson <[email protected]>

[ Upstream commit 42504af775361ca2330a2bfde496a5ebc5655c86 ]

Currently the active mode (PSC/MMC) is stored in an enum and queried
throughout the driver.

Other driver changes will enumerate additional submodes that are relevant
to be tracked, so instead track PSC/MMC in a single integer variable.

Co-developed-by: Mario Limonciello <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Mark Pearson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/platform/x86/thinkpad_acpi.c | 45 ++++++++++++++---------------------
1 file changed, 18 insertions(+), 27 deletions(-)

--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -10300,21 +10300,15 @@ static struct ibm_struct proxsensor_driv
#define DYTC_DISABLE_CQL DYTC_SET_COMMAND(DYTC_FUNCTION_CQL, DYTC_MODE_MMC_BALANCE, 0)
#define DYTC_ENABLE_CQL DYTC_SET_COMMAND(DYTC_FUNCTION_CQL, DYTC_MODE_MMC_BALANCE, 1)

-enum dytc_profile_funcmode {
- DYTC_FUNCMODE_NONE = 0,
- DYTC_FUNCMODE_MMC,
- DYTC_FUNCMODE_PSC,
-};
-
-static enum dytc_profile_funcmode dytc_profile_available;
static enum platform_profile_option dytc_current_profile;
static atomic_t dytc_ignore_event = ATOMIC_INIT(0);
static DEFINE_MUTEX(dytc_mutex);
+static int dytc_capabilities;
static bool dytc_mmc_get_available;

static int convert_dytc_to_profile(int dytcmode, enum platform_profile_option *profile)
{
- if (dytc_profile_available == DYTC_FUNCMODE_MMC) {
+ if (dytc_capabilities & BIT(DYTC_FC_MMC)) {
switch (dytcmode) {
case DYTC_MODE_MMC_LOWPOWER:
*profile = PLATFORM_PROFILE_LOW_POWER;
@@ -10331,7 +10325,7 @@ static int convert_dytc_to_profile(int d
}
return 0;
}
- if (dytc_profile_available == DYTC_FUNCMODE_PSC) {
+ if (dytc_capabilities & BIT(DYTC_FC_PSC)) {
switch (dytcmode) {
case DYTC_MODE_PSC_LOWPOWER:
*profile = PLATFORM_PROFILE_LOW_POWER;
@@ -10353,21 +10347,21 @@ static int convert_profile_to_dytc(enum
{
switch (profile) {
case PLATFORM_PROFILE_LOW_POWER:
- if (dytc_profile_available == DYTC_FUNCMODE_MMC)
+ if (dytc_capabilities & BIT(DYTC_FC_MMC))
*perfmode = DYTC_MODE_MMC_LOWPOWER;
- else if (dytc_profile_available == DYTC_FUNCMODE_PSC)
+ else if (dytc_capabilities & BIT(DYTC_FC_PSC))
*perfmode = DYTC_MODE_PSC_LOWPOWER;
break;
case PLATFORM_PROFILE_BALANCED:
- if (dytc_profile_available == DYTC_FUNCMODE_MMC)
+ if (dytc_capabilities & BIT(DYTC_FC_MMC))
*perfmode = DYTC_MODE_MMC_BALANCE;
- else if (dytc_profile_available == DYTC_FUNCMODE_PSC)
+ else if (dytc_capabilities & BIT(DYTC_FC_PSC))
*perfmode = DYTC_MODE_PSC_BALANCE;
break;
case PLATFORM_PROFILE_PERFORMANCE:
- if (dytc_profile_available == DYTC_FUNCMODE_MMC)
+ if (dytc_capabilities & BIT(DYTC_FC_MMC))
*perfmode = DYTC_MODE_MMC_PERFORM;
- else if (dytc_profile_available == DYTC_FUNCMODE_PSC)
+ else if (dytc_capabilities & BIT(DYTC_FC_PSC))
*perfmode = DYTC_MODE_PSC_PERFORM;
break;
default: /* Unknown profile */
@@ -10446,7 +10440,7 @@ static int dytc_profile_set(struct platf
if (err)
goto unlock;

- if (dytc_profile_available == DYTC_FUNCMODE_MMC) {
+ if (dytc_capabilities & BIT(DYTC_FC_MMC)) {
if (profile == PLATFORM_PROFILE_BALANCED) {
/*
* To get back to balanced mode we need to issue a reset command.
@@ -10465,7 +10459,7 @@ static int dytc_profile_set(struct platf
goto unlock;
}
}
- if (dytc_profile_available == DYTC_FUNCMODE_PSC) {
+ if (dytc_capabilities & BIT(DYTC_FC_PSC)) {
err = dytc_command(DYTC_SET_COMMAND(DYTC_FUNCTION_PSC, perfmode, 1), &output);
if (err)
goto unlock;
@@ -10484,12 +10478,12 @@ static void dytc_profile_refresh(void)
int perfmode;

mutex_lock(&dytc_mutex);
- if (dytc_profile_available == DYTC_FUNCMODE_MMC) {
+ if (dytc_capabilities & BIT(DYTC_FC_MMC)) {
if (dytc_mmc_get_available)
err = dytc_command(DYTC_CMD_MMC_GET, &output);
else
err = dytc_cql_command(DYTC_CMD_GET, &output);
- } else if (dytc_profile_available == DYTC_FUNCMODE_PSC)
+ } else if (dytc_capabilities & BIT(DYTC_FC_PSC))
err = dytc_command(DYTC_CMD_GET, &output);

mutex_unlock(&dytc_mutex);
@@ -10518,7 +10512,6 @@ static int tpacpi_dytc_profile_init(stru
set_bit(PLATFORM_PROFILE_BALANCED, dytc_profile.choices);
set_bit(PLATFORM_PROFILE_PERFORMANCE, dytc_profile.choices);

- dytc_profile_available = DYTC_FUNCMODE_NONE;
err = dytc_command(DYTC_CMD_QUERY, &output);
if (err)
return err;
@@ -10531,13 +10524,12 @@ static int tpacpi_dytc_profile_init(stru
return -ENODEV;

/* Check what capabilities are supported */
- err = dytc_command(DYTC_CMD_FUNC_CAP, &output);
+ err = dytc_command(DYTC_CMD_FUNC_CAP, &dytc_capabilities);
if (err)
return err;

- if (output & BIT(DYTC_FC_MMC)) { /* MMC MODE */
- dytc_profile_available = DYTC_FUNCMODE_MMC;
-
+ if (dytc_capabilities & BIT(DYTC_FC_MMC)) { /* MMC MODE */
+ pr_debug("MMC is supported\n");
/*
* Check if MMC_GET functionality available
* Version > 6 and return success from MMC_GET command
@@ -10548,8 +10540,8 @@ static int tpacpi_dytc_profile_init(stru
if (!err && ((output & DYTC_ERR_MASK) == DYTC_ERR_SUCCESS))
dytc_mmc_get_available = true;
}
- } else if (output & BIT(DYTC_FC_PSC)) { /* PSC MODE */
- dytc_profile_available = DYTC_FUNCMODE_PSC;
+ } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */
+ pr_debug("PSC is supported\n");
} else {
dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n");
return -ENODEV;
@@ -10575,7 +10567,6 @@ static int tpacpi_dytc_profile_init(stru

static void dytc_profile_exit(void)
{
- dytc_profile_available = DYTC_FUNCMODE_NONE;
platform_profile_remove();
}



2022-07-19 13:56:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 183/231] ASoC: ops: Fix off by one in range control validation

From: Mark Brown <[email protected]>

[ Upstream commit 5871321fb4558c55bf9567052b618ff0be6b975e ]

We currently report that range controls accept a range of 0..(max-min) but
accept writes in the range 0..(max-min+1). Remove that extra +1.

Signed-off-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/soc-ops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index e693070f51fe..d867f449d82d 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -526,7 +526,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
return -EINVAL;
if (mc->platform_max && tmp > mc->platform_max)
return -EINVAL;
- if (tmp > mc->max - mc->min + 1)
+ if (tmp > mc->max - mc->min)
return -EINVAL;

if (invert)
@@ -547,7 +547,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
return -EINVAL;
if (mc->platform_max && tmp > mc->platform_max)
return -EINVAL;
- if (tmp > mc->max - mc->min + 1)
+ if (tmp > mc->max - mc->min)
return -EINVAL;

if (invert)
--
2.35.1



2022-07-19 13:56:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 009/231] ALSA: hda/realtek: Fix headset mic for Acer SF313-51

From: Meng Tang <[email protected]>

commit 5f3fe25e70559fa3b096ab17e13316c93ddb7020 upstream.

The issue on Acer SWIFT SF313-51 is that headset microphone
doesn't work. The following quirk fixed headset microphone issue.
Note that the fixup of SF314-54/55 (ALC256_FIXUP_ACER_HEADSET_MIC)
was not successful on my SF313-51.

Signed-off-by: Meng Tang <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
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
@@ -8938,6 +8938,7 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
+ SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),


2022-07-19 13:56:39

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 212/231] Revert "can: xilinx_can: Limit CANFD brp to 2"

From: Srinivas Neeli <[email protected]>

[ Upstream commit c6da4590fe819dfe28a4f8037a8dc1e056542fb4 ]

This reverts commit 05ca14fdb6fe65614e0652d03e44b02748d25af7.

On early silicon engineering samples observed bit shrinking issue when
we use brp as 1. Hence updated brp_min as 2. As in production silicon
this issue is fixed, so reverting the patch.

Link: https://lore.kernel.org/all/[email protected]
Signed-off-by: Srinivas Neeli <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/can/xilinx_can.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 43f0c6a064ba..75b4db4d050b 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -259,7 +259,7 @@ static const struct can_bittiming_const xcan_bittiming_const_canfd2 = {
.tseg2_min = 1,
.tseg2_max = 128,
.sjw_max = 128,
- .brp_min = 2,
+ .brp_min = 1,
.brp_max = 256,
.brp_inc = 1,
};
@@ -272,7 +272,7 @@ static const struct can_bittiming_const xcan_data_bittiming_const_canfd2 = {
.tseg2_min = 1,
.tseg2_max = 16,
.sjw_max = 16,
- .brp_min = 2,
+ .brp_min = 1,
.brp_max = 256,
.brp_inc = 1,
};
--
2.35.1



2022-07-19 13:56:42

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 106/231] bnxt_en: Fix bnxt_reinit_after_abort() code path

From: Michael Chan <[email protected]>

[ Upstream commit 4279414bff8af9898e8c53ae6c5bc17f68ad67b7 ]

bnxt_reinit_after_abort() is called during ifup when a previous
FW reset sequence has aborted or a previous ifup has failed after
detecting FW reset. In all cases, it is safe to assume that a
previous FW reset has completed and the driver may not have fully
reinitialized.

Prior to this patch, it is assumed that the
FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE flag will always be
set by the firmware in bnxt_hwrm_if_change(). This may not be true if
the driver has already attempted to register with the firmware. The
firmware may not set the RESET_DONE flag again after the driver has
registered, assuming that the driver has seen the flag already.

Fix it to always go through the FW reset initialization path if
the BNXT_STATE_FW_RESET_DET flag is set. This flag is always set
by the driver after successfully going through bnxt_reinit_after_abort().

Fixes: 6882c36cf82e ("bnxt_en: attempt to reinitialize after aborted reset")
Reviewed-by: Pavan Chebbi <[email protected]>
Signed-off-by: Michael Chan <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index ee6686a111bd..1ceccaed2da0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9916,7 +9916,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)

if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_RESC_CHANGE)
resc_reinit = true;
- if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE)
+ if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE ||
+ test_bit(BNXT_STATE_FW_RESET_DET, &bp->state))
fw_reset = true;
else
bnxt_remap_fw_health_regs(bp);
--
2.35.1



2022-07-19 13:57:13

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 077/231] net: Fix data-races around sysctl_mem.

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit 310731e2f1611d1d13aae237abcf8e66d33345d5 ]

While reading .sysctl_mem, it can be changed concurrently.
So, we need to add READ_ONCE() to avoid data-races.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
include/net/sock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 3c4fb8f03fd9..6bef0ffb1e7b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1534,7 +1534,7 @@ void __sk_mem_reclaim(struct sock *sk, int amount);
/* sysctl_mem values are in pages, we convert them in SK_MEM_QUANTUM units */
static inline long sk_prot_mem_limits(const struct sock *sk, int index)
{
- long val = sk->sk_prot->sysctl_mem[index];
+ long val = READ_ONCE(sk->sk_prot->sysctl_mem[index]);

#if PAGE_SIZE > SK_MEM_QUANTUM
val <<= PAGE_SHIFT - SK_MEM_QUANTUM_SHIFT;
--
2.35.1



2022-07-19 13:57:21

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 120/231] tcp: Fix data-races around sysctl_tcp_ecn.

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit 4785a66702f086cf2ea84bdbe6ec921f274bd9f2 ]

While reading sysctl_tcp_ecn, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c | 2 +-
net/ipv4/syncookies.c | 2 +-
net/ipv4/sysctl_net_ipv4.c | 2 ++
net/ipv4/tcp_input.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
5 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c
index 4af5561cbfc5..7c760aa65540 100644
--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c
+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c
@@ -1392,7 +1392,7 @@ static void chtls_pass_accept_request(struct sock *sk,
th_ecn = tcph->ece && tcph->cwr;
if (th_ecn) {
ect = !INET_ECN_is_not_ect(ip_dsfield);
- ecn_ok = sock_net(sk)->ipv4.sysctl_tcp_ecn;
+ ecn_ok = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_ecn);
if ((!ect && ecn_ok) || tcp_ca_needs_ecn(sk))
inet_rsk(oreq)->ecn_ok = 1;
}
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index f33c31dd7366..b387c4835155 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -273,7 +273,7 @@ bool cookie_ecn_ok(const struct tcp_options_received *tcp_opt,
if (!ecn_ok)
return false;

- if (net->ipv4.sysctl_tcp_ecn)
+ if (READ_ONCE(net->ipv4.sysctl_tcp_ecn))
return true;

return dst_feature(dst, RTAX_FEATURE_ECN);
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 33e65e79e46e..11add5214713 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -680,6 +680,8 @@ static struct ctl_table ipv4_net_table[] = {
.maxlen = sizeof(u8),
.mode = 0644,
.proc_handler = proc_dou8vec_minmax,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_TWO,
},
{
.procname = "tcp_ecn_fallback",
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 6b8fcf79688b..2d71bcfcc759 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6712,7 +6712,7 @@ static void tcp_ecn_create_request(struct request_sock *req,

ect = !INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield);
ecn_ok_dst = dst_feature(dst, DST_FEATURE_ECN_MASK);
- ecn_ok = net->ipv4.sysctl_tcp_ecn || ecn_ok_dst;
+ ecn_ok = READ_ONCE(net->ipv4.sysctl_tcp_ecn) || ecn_ok_dst;

if (((!ect || th->res1) && ecn_ok) || tcp_ca_needs_ecn(listen_sk) ||
(ecn_ok_dst & DST_FEATURE_ECN_CA) ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 6b00c17c72aa..9eefe7f6370f 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -324,7 +324,7 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
bool bpf_needs_ecn = tcp_bpf_ca_needs_ecn(sk);
- bool use_ecn = sock_net(sk)->ipv4.sysctl_tcp_ecn == 1 ||
+ bool use_ecn = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_ecn) == 1 ||
tcp_ca_needs_ecn(sk) || bpf_needs_ecn;

if (!use_ecn) {
--
2.35.1



2022-07-19 13:57:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 016/231] mm: userfaultfd: fix UFFDIO_CONTINUE on fallocated shmem pages

From: Axel Rasmussen <[email protected]>

commit 73f37dbcfe1763ee2294c7717a1f571e27d17fd8 upstream.

When fallocate() is used on a shmem file, the pages we allocate can end up
with !PageUptodate.

Since UFFDIO_CONTINUE tries to find the existing page the user wants to
map with SGP_READ, we would fail to find such a page, since
shmem_getpage_gfp returns with a "NULL" pagep for SGP_READ if it discovers
!PageUptodate. As a result, UFFDIO_CONTINUE returns -EFAULT, as it would
do if the page wasn't found in the page cache at all.

This isn't the intended behavior. UFFDIO_CONTINUE is just trying to find
if a page exists, and doesn't care whether it still needs to be cleared or
not. So, instead of SGP_READ, pass in SGP_NOALLOC. This is the same,
except for one critical difference: in the !PageUptodate case, SGP_NOALLOC
will clear the page and then return it. With this change, UFFDIO_CONTINUE
works properly (succeeds) on a shmem file which has been fallocated, but
otherwise not modified.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 153132571f02 ("userfaultfd/shmem: support UFFDIO_CONTINUE for shmem")
Signed-off-by: Axel Rasmussen <[email protected]>
Acked-by: Peter Xu <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
mm/userfaultfd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -231,7 +231,10 @@ static int mcontinue_atomic_pte(struct m
struct page *page;
int ret;

- ret = shmem_getpage(inode, pgoff, &page, SGP_READ);
+ ret = shmem_getpage(inode, pgoff, &page, SGP_NOALLOC);
+ /* Our caller expects us to return -EFAULT if we failed to find page. */
+ if (ret == -ENOENT)
+ ret = -EFAULT;
if (ret)
goto out;
if (!page) {


2022-07-19 13:57:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 121/231] tcp: Fix a data-race around sysctl_tcp_ecn_fallback.

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit 12b8d9ca7e678abc48195294494f1815b555d658 ]

While reading sysctl_tcp_ecn_fallback, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its reader.

Fixes: 492135557dc0 ("tcp: add rfc3168, section 6.1.1.1. fallback")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/ipv4/sysctl_net_ipv4.c | 2 ++
net/ipv4/tcp_output.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 11add5214713..ffe0264a51b8 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -689,6 +689,8 @@ static struct ctl_table ipv4_net_table[] = {
.maxlen = sizeof(u8),
.mode = 0644,
.proc_handler = proc_dou8vec_minmax,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE,
},
{
.procname = "ip_dynaddr",
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 9eefe7f6370f..34249469e361 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -346,7 +346,7 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb)

static void tcp_ecn_clear_syn(struct sock *sk, struct sk_buff *skb)
{
- if (sock_net(sk)->ipv4.sysctl_tcp_ecn_fallback)
+ if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_ecn_fallback))
/* tp->ecn_flags are cleared at a later point in time when
* SYN ACK is ultimatively being received.
*/
--
2.35.1



2022-07-19 13:57:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 136/231] seg6: fix skb checksum evaluation in SRH encapsulation/insertion

From: Andrea Mayer <[email protected]>

[ Upstream commit df8386d13ea280d55beee1b95f61a59234a3798b ]

Support for SRH encapsulation and insertion was introduced with
commit 6c8702c60b88 ("ipv6: sr: add support for SRH encapsulation and
injection with lwtunnels"), through the seg6_do_srh_encap() and
seg6_do_srh_inline() functions, respectively.
The former encapsulates the packet in an outer IPv6 header along with
the SRH, while the latter inserts the SRH between the IPv6 header and
the payload. Then, the headers are initialized/updated according to the
operating mode (i.e., encap/inline).
Finally, the skb checksum is calculated to reflect the changes applied
to the headers.

The IPv6 payload length ('payload_len') is not initialized
within seg6_do_srh_{inline,encap}() but is deferred in seg6_do_srh(), i.e.
the caller of seg6_do_srh_{inline,encap}().
However, this operation invalidates the skb checksum, since the
'payload_len' is updated only after the checksum is evaluated.

To solve this issue, the initialization of the IPv6 payload length is
moved from seg6_do_srh() directly into the seg6_do_srh_{inline,encap}()
functions and before the skb checksum update takes place.

Fixes: 6c8702c60b88 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels")
Reported-by: Paolo Abeni <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Signed-off-by: Andrea Mayer <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/ipv6/seg6_iptunnel.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c
index d64855010948..e756ba705fd9 100644
--- a/net/ipv6/seg6_iptunnel.c
+++ b/net/ipv6/seg6_iptunnel.c
@@ -189,6 +189,8 @@ int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh, int proto)
}
#endif

+ hdr->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
+
skb_postpush_rcsum(skb, hdr, tot_len);

return 0;
@@ -241,6 +243,8 @@ int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
}
#endif

+ hdr->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
+
skb_postpush_rcsum(skb, hdr, sizeof(struct ipv6hdr) + hdrlen);

return 0;
@@ -302,7 +306,6 @@ static int seg6_do_srh(struct sk_buff *skb)
break;
}

- ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
skb_set_transport_header(skb, sizeof(struct ipv6hdr));
nf_reset_ct(skb);

--
2.35.1



2022-07-19 13:58:13

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 074/231] sysctl: Fix data races in proc_dointvec_jiffies().

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit e877820877663fbae8cb9582ea597a7230b94df3 ]

A sysctl variable is accessed concurrently, and there is always a chance
of data-race. So, all readers and writers need some basic protection to
avoid load/store-tearing.

This patch changes proc_dointvec_jiffies() to use READ_ONCE() and
WRITE_ONCE() internally to fix data-races on the sysctl side. For now,
proc_dointvec_jiffies() itself is tolerant to a data-race, but we still
need to add annotations on the other subsystem's side.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
kernel/sysctl.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 7a8899f237a2..878b1122cb89 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1245,9 +1245,12 @@ static int do_proc_dointvec_jiffies_conv(bool *negp, unsigned long *lvalp,
if (write) {
if (*lvalp > INT_MAX / HZ)
return 1;
- *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ);
+ if (*negp)
+ WRITE_ONCE(*valp, -*lvalp * HZ);
+ else
+ WRITE_ONCE(*valp, *lvalp * HZ);
} else {
- int val = *valp;
+ int val = READ_ONCE(*valp);
unsigned long lval;
if (val < 0) {
*negp = true;
--
2.35.1



2022-07-19 13:58:24

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 125/231] net: stmmac: fix leaks in probe

From: Dan Carpenter <[email protected]>

[ Upstream commit 23aa6d5088e3bd65de77c5c307237b9937f8b48a ]

These two error paths should clean up before returning.

Fixes: 2bb4b98b60d7 ("net: stmmac: Add Ingenic SoCs MAC support.")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
index 9a6d819b84ae..378b4dd826bb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
@@ -273,7 +273,8 @@ static int ingenic_mac_probe(struct platform_device *pdev)
mac->tx_delay = tx_delay_ps * 1000;
} else {
dev_err(&pdev->dev, "Invalid TX clock delay: %dps\n", tx_delay_ps);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_remove_config_dt;
}
}

@@ -283,7 +284,8 @@ static int ingenic_mac_probe(struct platform_device *pdev)
mac->rx_delay = rx_delay_ps * 1000;
} else {
dev_err(&pdev->dev, "Invalid RX clock delay: %dps\n", rx_delay_ps);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_remove_config_dt;
}
}

--
2.35.1



2022-07-19 14:12:12

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 148/231] objtool: Update Retpoline validation

From: Peter Zijlstra <[email protected]>

[ Upstream commit 9bb2ec608a209018080ca262f771e6a9ff203b6f ]

Update retpoline validation with the new CONFIG_RETPOLINE requirement of
not having bare naked RET instructions.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/x86/include/asm/nospec-branch.h | 6 ++++++
arch/x86/mm/mem_encrypt_boot.S | 2 ++
arch/x86/xen/xen-head.S | 1 +
tools/objtool/check.c | 19 +++++++++++++------
4 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index da251a5645b0..f1a7ecd0a7c7 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -75,6 +75,12 @@
.popsection
.endm

+/*
+ * (ab)use RETPOLINE_SAFE on RET to annotate away 'bare' RET instructions
+ * vs RETBleed validation.
+ */
+#define ANNOTATE_UNRET_SAFE ANNOTATE_RETPOLINE_SAFE
+
/*
* JMP_NOSPEC and CALL_NOSPEC macros can be used instead of a simple
* indirect jmp/call which may be susceptible to the Spectre variant 2
diff --git a/arch/x86/mm/mem_encrypt_boot.S b/arch/x86/mm/mem_encrypt_boot.S
index d94dea450fa6..9de3d900bc92 100644
--- a/arch/x86/mm/mem_encrypt_boot.S
+++ b/arch/x86/mm/mem_encrypt_boot.S
@@ -66,6 +66,7 @@ SYM_FUNC_START(sme_encrypt_execute)
pop %rbp

/* Offset to __x86_return_thunk would be wrong here */
+ ANNOTATE_UNRET_SAFE
ret
int3
SYM_FUNC_END(sme_encrypt_execute)
@@ -154,6 +155,7 @@ SYM_FUNC_START(__enc_copy)
pop %r15

/* Offset to __x86_return_thunk would be wrong here */
+ ANNOTATE_UNRET_SAFE
ret
int3
.L__enc_copy_end:
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 13af6fe453e3..ffaa62167f6e 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -26,6 +26,7 @@ SYM_CODE_START(hypercall_page)
.rept (PAGE_SIZE / 32)
UNWIND_HINT_FUNC
ANNOTATE_NOENDBR
+ ANNOTATE_UNRET_SAFE
ret
/*
* Xen will write the hypercall page, and sort out ENDBR.
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index f66e4ac0af94..fbe41203fc9b 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2030,8 +2030,9 @@ static int read_retpoline_hints(struct objtool_file *file)
}

if (insn->type != INSN_JUMP_DYNAMIC &&
- insn->type != INSN_CALL_DYNAMIC) {
- WARN_FUNC("retpoline_safe hint not an indirect jump/call",
+ insn->type != INSN_CALL_DYNAMIC &&
+ insn->type != INSN_RETURN) {
+ WARN_FUNC("retpoline_safe hint not an indirect jump/call/ret",
insn->sec, insn->offset);
return -1;
}
@@ -3561,7 +3562,8 @@ static int validate_retpoline(struct objtool_file *file)

for_each_insn(file, insn) {
if (insn->type != INSN_JUMP_DYNAMIC &&
- insn->type != INSN_CALL_DYNAMIC)
+ insn->type != INSN_CALL_DYNAMIC &&
+ insn->type != INSN_RETURN)
continue;

if (insn->retpoline_safe)
@@ -3576,9 +3578,14 @@ static int validate_retpoline(struct objtool_file *file)
if (!strcmp(insn->sec->name, ".init.text") && !module)
continue;

- WARN_FUNC("indirect %s found in RETPOLINE build",
- insn->sec, insn->offset,
- insn->type == INSN_JUMP_DYNAMIC ? "jump" : "call");
+ if (insn->type == INSN_RETURN) {
+ WARN_FUNC("'naked' return found in RETPOLINE build",
+ insn->sec, insn->offset);
+ } else {
+ WARN_FUNC("indirect %s found in RETPOLINE build",
+ insn->sec, insn->offset,
+ insn->type == INSN_JUMP_DYNAMIC ? "jump" : "call");
+ }

warnings++;
}
--
2.35.1



2022-07-19 14:12:14

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 146/231] x86/sev: Avoid using __x86_return_thunk

From: Kim Phillips <[email protected]>

[ Upstream commit 0ee9073000e8791f8b134a8ded31bcc767f7f232 ]

Specifically, it's because __enc_copy() encrypts the kernel after
being relocated outside the kernel in sme_encrypt_execute(), and the
RET macro's jmp offset isn't amended prior to execution.

Signed-off-by: Kim Phillips <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/x86/mm/mem_encrypt_boot.S | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/mem_encrypt_boot.S b/arch/x86/mm/mem_encrypt_boot.S
index 3d1dba05fce4..d94dea450fa6 100644
--- a/arch/x86/mm/mem_encrypt_boot.S
+++ b/arch/x86/mm/mem_encrypt_boot.S
@@ -65,7 +65,9 @@ SYM_FUNC_START(sme_encrypt_execute)
movq %rbp, %rsp /* Restore original stack pointer */
pop %rbp

- RET
+ /* Offset to __x86_return_thunk would be wrong here */
+ ret
+ int3
SYM_FUNC_END(sme_encrypt_execute)

SYM_FUNC_START(__enc_copy)
@@ -151,6 +153,8 @@ SYM_FUNC_START(__enc_copy)
pop %r12
pop %r15

- RET
+ /* Offset to __x86_return_thunk would be wrong here */
+ ret
+ int3
.L__enc_copy_end:
SYM_FUNC_END(__enc_copy)
--
2.35.1



2022-07-19 14:12:26

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 079/231] icmp: Fix data-races around sysctl.

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit 48d7ee321ea5182c6a70782aa186422a70e67e22 ]

While reading icmp sysctl variables, they can be changed concurrently.
So, we need to add READ_ONCE() to avoid data-races.

Fixes: 4cdf507d5452 ("icmp: add a global rate limitation")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/ipv4/icmp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 72a375c7f417..97350a38a75d 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -253,11 +253,12 @@ bool icmp_global_allow(void)
spin_lock(&icmp_global.lock);
delta = min_t(u32, now - icmp_global.stamp, HZ);
if (delta >= HZ / 50) {
- incr = sysctl_icmp_msgs_per_sec * delta / HZ ;
+ incr = READ_ONCE(sysctl_icmp_msgs_per_sec) * delta / HZ;
if (incr)
WRITE_ONCE(icmp_global.stamp, now);
}
- credit = min_t(u32, icmp_global.credit + incr, sysctl_icmp_msgs_burst);
+ credit = min_t(u32, icmp_global.credit + incr,
+ READ_ONCE(sysctl_icmp_msgs_burst));
if (credit) {
/* We want to use a credit of one in average, but need to randomize
* it for security reasons.
--
2.35.1



2022-07-19 14:13:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 197/231] ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem

From: Hans de Goede <[email protected]>

[ Upstream commit 4e07479eab8a044cc9542414ccb4aeb8eb033bde ]

The "wlf,spkvdd-ena" GPIO needed by the bytcr_wm5102 driver
is made available through a gpio-lookup table.

This gpio-lookup table is registered by drivers/mfd/arizona-spi.c, which
may get probed after the bytcr_wm5102 driver.

If the gpio-lookup table has not registered yet then the gpiod_get()
will return -ENOENT. Treat -ENOENT as -EPROBE_DEFER to still keep
things working in this case.

Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/intel/boards/bytcr_wm5102.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c
index 8d8e96e3cd2d..f6d0cef1b28c 100644
--- a/sound/soc/intel/boards/bytcr_wm5102.c
+++ b/sound/soc/intel/boards/bytcr_wm5102.c
@@ -421,8 +421,17 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)
priv->spkvdd_en_gpio = gpiod_get(codec_dev, "wlf,spkvdd-ena", GPIOD_OUT_LOW);
put_device(codec_dev);

- if (IS_ERR(priv->spkvdd_en_gpio))
- return dev_err_probe(dev, PTR_ERR(priv->spkvdd_en_gpio), "getting spkvdd-GPIO\n");
+ if (IS_ERR(priv->spkvdd_en_gpio)) {
+ ret = PTR_ERR(priv->spkvdd_en_gpio);
+ /*
+ * The spkvdd gpio-lookup is registered by: drivers/mfd/arizona-spi.c,
+ * so -ENOENT means that arizona-spi hasn't probed yet.
+ */
+ if (ret == -ENOENT)
+ ret = -EPROBE_DEFER;
+
+ return dev_err_probe(dev, ret, "getting spkvdd-GPIO\n");
+ }

/* override platform name, if required */
byt_wm5102_card.dev = dev;
--
2.35.1



2022-07-19 14:13:59

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 115/231] icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses.

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit b04f9b7e85c7d7aecbada620e8759a662af068d3 ]

While reading sysctl_icmp_ignore_bogus_error_responses, it can be changed
concurrently. Thus, we need to add READ_ONCE() to its reader.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/ipv4/icmp.c | 2 +-
net/ipv4/sysctl_net_ipv4.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 2c402b4671a1..1a061d10949f 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -930,7 +930,7 @@ static bool icmp_unreach(struct sk_buff *skb)
* get the other vendor to fix their kit.
*/

- if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses &&
+ if (!READ_ONCE(net->ipv4.sysctl_icmp_ignore_bogus_error_responses) &&
inet_addr_type_dev_table(net, skb->dev, iph->daddr) == RTN_BROADCAST) {
net_warn_ratelimited("%pI4 sent an invalid ICMP type %u, code %u error to a broadcast: %pI4 on %s\n",
&ip_hdr(skb)->saddr,
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 6613351094ce..4cf2a6f560d4 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -630,6 +630,8 @@ static struct ctl_table ipv4_net_table[] = {
.maxlen = sizeof(u8),
.mode = 0644,
.proc_handler = proc_dou8vec_minmax,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE
},
{
.procname = "icmp_errors_use_inbound_ifaddr",
--
2.35.1



2022-07-19 14:14:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 229/231] serial: 8250: Fix PM usage_count for console handover

From: Ilpo Järvinen <[email protected]>

commit f9b11229b79c0fb2100b5bb4628a101b1d37fbf6 upstream.

When console is enabled, univ8250_console_setup() calls
serial8250_console_setup() before .dev is set to uart_port. Therefore,
it will not call pm_runtime_get_sync(). Later, when the actual driver
is going to take over univ8250_console_exit() is called. As .dev is
already set, serial8250_console_exit() makes pm_runtime_put_sync() call
with usage count being zero triggering PM usage count warning
(extra debug for univ8250_console_setup(), univ8250_console_exit(), and
serial8250_register_ports()):

[ 0.068987] univ8250_console_setup ttyS0 nodev
[ 0.499670] printk: console [ttyS0] enabled
[ 0.717955] printk: console [ttyS0] printing thread started
[ 1.960163] serial8250_register_ports assigned dev for ttyS0
[ 1.976830] printk: console [ttyS0] disabled
[ 1.976888] printk: console [ttyS0] printing thread stopped
[ 1.977073] univ8250_console_exit ttyS0 usage:0
[ 1.977075] serial8250 serial8250: Runtime PM usage count underflow!
[ 1.977429] dw-apb-uart.6: ttyS0 at MMIO 0x4010006000 (irq = 33, base_baud = 115200) is a 16550A
[ 1.977812] univ8250_console_setup ttyS0 usage:2
[ 1.978167] printk: console [ttyS0] printing thread started
[ 1.978203] printk: console [ttyS0] enabled

To fix the issue, call pm_runtime_get_sync() in
serial8250_register_ports() as soon as .dev is set for an uart_port
if it has console enabled.

This problem became apparent only recently because 82586a721595 ("PM:
runtime: Avoid device usage count underflows") added the warning
printout. I confirmed this problem also occurs with v5.18 (w/o the
warning printout, obviously).

Fixes: bedb404e91bb ("serial: 8250_port: Don't use power management for kernel console")
Cc: stable <[email protected]>
Tested-by: Tony Lindgren <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Tony Lindgren <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/serial/8250/8250_core.c | 4 ++++
drivers/tty/serial/serial_core.c | 5 -----
include/linux/serial_core.h | 5 +++++
3 files changed, 9 insertions(+), 5 deletions(-)

--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -23,6 +23,7 @@
#include <linux/sysrq.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/tty.h>
#include <linux/ratelimit.h>
#include <linux/tty_flip.h>
@@ -560,6 +561,9 @@ serial8250_register_ports(struct uart_dr

up->port.dev = dev;

+ if (uart_console_enabled(&up->port))
+ pm_runtime_get_sync(up->port.dev);
+
serial8250_apply_quirks(up);
uart_add_one_port(drv, &up->port);
}
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1904,11 +1904,6 @@ static int uart_proc_show(struct seq_fil
}
#endif

-static inline bool uart_console_enabled(struct uart_port *port)
-{
- return uart_console(port) && (port->cons->flags & CON_ENABLED);
-}
-
static void uart_port_spin_lock_init(struct uart_port *port)
{
spin_lock_init(&port->lock);
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -388,6 +388,11 @@ static const bool earlycon_acpi_spcr_ena
static inline int setup_earlycon(char *buf) { return 0; }
#endif

+static inline bool uart_console_enabled(struct uart_port *port)
+{
+ return uart_console(port) && (port->cons->flags & CON_ENABLED);
+}
+
struct uart_port *uart_get_console(struct uart_port *ports, int nr,
struct console *c);
int uart_parse_earlycon(char *p, unsigned char *iotype, resource_size_t *addr,


2022-07-19 14:15:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 098/231] ice: change devlink code to read NVM in blocks

From: Paul M Stillwell Jr <[email protected]>

[ Upstream commit 7b6f9462a3234c35cf808453d39a074a04e71de1 ]

When creating a snapshot of the NVM the driver needs to read the entire
contents from the NVM and store it. The NVM reads are protected by a lock
that is shared between the driver and the firmware.

If the driver takes too long to read the entire NVM (which can happen on
some systems) then the firmware could reclaim the lock and cause subsequent
reads from the driver to fail.

We could fix this by increasing the timeout that we pass to the firmware,
but we could end up in the same situation again if the system is slow.
Instead have the driver break the reading of the NVM into blocks that are
small enough that we have confidence that the read will complete within the
timeout time, but large enough not to cause significant AQ overhead.

Fixes: dce730f17825 ("ice: add a devlink region for dumping NVM contents")
Signed-off-by: Paul M Stillwell Jr <[email protected]>
Tested-by: Gurucharan <[email protected]> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/intel/ice/ice_devlink.c | 59 +++++++++++++-------
1 file changed, 40 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
index 4a9de59121d8..31836bbdf813 100644
--- a/drivers/net/ethernet/intel/ice/ice_devlink.c
+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
@@ -792,6 +792,8 @@ void ice_devlink_destroy_vf_port(struct ice_vf *vf)
devlink_port_unregister(devlink_port);
}

+#define ICE_DEVLINK_READ_BLK_SIZE (1024 * 1024)
+
/**
* ice_devlink_nvm_snapshot - Capture a snapshot of the NVM flash contents
* @devlink: the devlink instance
@@ -818,8 +820,9 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
struct ice_pf *pf = devlink_priv(devlink);
struct device *dev = ice_pf_to_dev(pf);
struct ice_hw *hw = &pf->hw;
- void *nvm_data;
- u32 nvm_size;
+ u8 *nvm_data, *tmp, i;
+ u32 nvm_size, left;
+ s8 num_blks;
int status;

nvm_size = hw->flash.flash_size;
@@ -827,26 +830,44 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
if (!nvm_data)
return -ENOMEM;

- status = ice_acquire_nvm(hw, ICE_RES_READ);
- if (status) {
- dev_dbg(dev, "ice_acquire_nvm failed, err %d aq_err %d\n",
- status, hw->adminq.sq_last_status);
- NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore");
- vfree(nvm_data);
- return status;
- }

- status = ice_read_flat_nvm(hw, 0, &nvm_size, nvm_data, false);
- if (status) {
- dev_dbg(dev, "ice_read_flat_nvm failed after reading %u bytes, err %d aq_err %d\n",
- nvm_size, status, hw->adminq.sq_last_status);
- NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents");
+ num_blks = DIV_ROUND_UP(nvm_size, ICE_DEVLINK_READ_BLK_SIZE);
+ tmp = nvm_data;
+ left = nvm_size;
+
+ /* Some systems take longer to read the NVM than others which causes the
+ * FW to reclaim the NVM lock before the entire NVM has been read. Fix
+ * this by breaking the reads of the NVM into smaller chunks that will
+ * probably not take as long. This has some overhead since we are
+ * increasing the number of AQ commands, but it should always work
+ */
+ for (i = 0; i < num_blks; i++) {
+ u32 read_sz = min_t(u32, ICE_DEVLINK_READ_BLK_SIZE, left);
+
+ status = ice_acquire_nvm(hw, ICE_RES_READ);
+ if (status) {
+ dev_dbg(dev, "ice_acquire_nvm failed, err %d aq_err %d\n",
+ status, hw->adminq.sq_last_status);
+ NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore");
+ vfree(nvm_data);
+ return -EIO;
+ }
+
+ status = ice_read_flat_nvm(hw, i * ICE_DEVLINK_READ_BLK_SIZE,
+ &read_sz, tmp, false);
+ if (status) {
+ dev_dbg(dev, "ice_read_flat_nvm failed after reading %u bytes, err %d aq_err %d\n",
+ read_sz, status, hw->adminq.sq_last_status);
+ NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents");
+ ice_release_nvm(hw);
+ vfree(nvm_data);
+ return -EIO;
+ }
ice_release_nvm(hw);
- vfree(nvm_data);
- return status;
- }

- ice_release_nvm(hw);
+ tmp += read_sz;
+ left -= read_sz;
+ }

*data = nvm_data;

--
2.35.1



2022-07-19 14:16:13

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 006/231] x86/xen: Use clear_bss() for Xen PV guests

From: Juergen Gross <[email protected]>

commit 96e8fc5818686d4a1591bb6907e7fdb64ef29884 upstream.

Instead of clearing the bss area in assembly code, use the clear_bss()
function.

This requires to pass the start_info address as parameter to
xen_start_kernel() in order to avoid the xen_start_info being zeroed
again.

Signed-off-by: Juergen Gross <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
Reviewed-by: Boris Ostrovsky <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/x86/include/asm/setup.h | 3 +++
arch/x86/kernel/head64.c | 2 +-
arch/x86/xen/enlighten_pv.c | 8 ++++++--
arch/x86/xen/xen-head.S | 10 +---------
4 files changed, 11 insertions(+), 12 deletions(-)

--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -132,6 +132,9 @@ void *extend_brk(size_t size, size_t ali
}

extern void probe_roms(void);
+
+void clear_bss(void);
+
#ifdef __i386__

asmlinkage void __init i386_start_kernel(void);
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -421,7 +421,7 @@ void __init do_early_exception(struct pt

/* Don't add a printk in there. printk relies on the PDA which is not initialized
yet. */
-static void __init clear_bss(void)
+void __init clear_bss(void)
{
memset(__bss_start, 0,
(unsigned long) __bss_stop - (unsigned long) __bss_start);
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1183,15 +1183,19 @@ static void __init xen_domu_set_legacy_f
extern void early_xen_iret_patch(void);

/* First C function to be called on Xen boot */
-asmlinkage __visible void __init xen_start_kernel(void)
+asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
{
struct physdev_set_iopl set_iopl;
unsigned long initrd_start = 0;
int rc;

- if (!xen_start_info)
+ if (!si)
return;

+ clear_bss();
+
+ xen_start_info = si;
+
__text_gen_insn(&early_xen_iret_patch,
JMP32_INSN_OPCODE, &early_xen_iret_patch, &xen_iret,
JMP32_INSN_SIZE);
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -48,15 +48,6 @@ SYM_CODE_START(startup_xen)
ANNOTATE_NOENDBR
cld

- /* Clear .bss */
- xor %eax,%eax
- mov $__bss_start, %rdi
- mov $__bss_stop, %rcx
- sub %rdi, %rcx
- shr $3, %rcx
- rep stosq
-
- mov %rsi, xen_start_info
mov initial_stack(%rip), %rsp

/* Set up %gs.
@@ -71,6 +62,7 @@ SYM_CODE_START(startup_xen)
cdq
wrmsr

+ mov %rsi, %rdi
call xen_start_kernel
SYM_CODE_END(startup_xen)
__FINIT


2022-07-19 14:16:18

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 144/231] mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE

From: Muchun Song <[email protected]>

[ Upstream commit 43b5240ca6b33108998810593248186b1e3ae34a ]

"numa_stat" should not be included in the scope of CONFIG_HUGETLB_PAGE, if
CONFIG_HUGETLB_PAGE is not configured even if CONFIG_NUMA is configured,
"numa_stat" is missed form /proc. Move it out of CONFIG_HUGETLB_PAGE to
fix it.

Fixes: 4518085e127d ("mm, sysctl: make NUMA stats configurable")
Signed-off-by: Muchun Song <[email protected]>
Cc: <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Signed-off-by: Luis Chamberlain <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
kernel/sysctl.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index f165ea67dd33..c42ba2d669dc 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2466,6 +2466,17 @@ static struct ctl_table vm_table[] = {
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_TWO_HUNDRED,
},
+#ifdef CONFIG_NUMA
+ {
+ .procname = "numa_stat",
+ .data = &sysctl_vm_numa_stat,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = sysctl_vm_numa_stat_handler,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE,
+ },
+#endif
#ifdef CONFIG_HUGETLB_PAGE
{
.procname = "nr_hugepages",
@@ -2482,15 +2493,6 @@ static struct ctl_table vm_table[] = {
.mode = 0644,
.proc_handler = &hugetlb_mempolicy_sysctl_handler,
},
- {
- .procname = "numa_stat",
- .data = &sysctl_vm_numa_stat,
- .maxlen = sizeof(int),
- .mode = 0644,
- .proc_handler = sysctl_vm_numa_stat_handler,
- .extra1 = SYSCTL_ZERO,
- .extra2 = SYSCTL_ONE,
- },
#endif
{
.procname = "hugetlb_shm_group",
--
2.35.1



2022-07-19 14:16:21

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 083/231] arm64: dts: broadcom: bcm4908: Fix timer node for BCM4906 SoC

From: William Zhang <[email protected]>

[ Upstream commit b4a544e415e9be33b37d9bfa9d9f9f4d13f553d6 ]

The cpu mask value in interrupt property inherits from bcm4908.dtsi
which sets to four cpus. Correct the value to two cpus for dual core
BCM4906 SoC.

Fixes: c8b404fb05dc ("arm64: dts: broadcom: bcm4908: add BCM4906 Netgear R8000P DTS files")
Signed-off-by: William Zhang <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi
index 66023d553524..d084c33d5ca8 100644
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi
@@ -9,6 +9,14 @@ cpus {
/delete-node/ cpu@3;
};

+ timer {
+ compatible = "arm,armv8-timer";
+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
+ };
+
pmu {
compatible = "arm,cortex-a53-pmu";
interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
--
2.35.1



2022-07-19 14:16:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 073/231] sysctl: Fix data races in proc_doulongvec_minmax().

From: Kuniyuki Iwashima <[email protected]>

[ Upstream commit c31bcc8fb89fc2812663900589c6325ba35d9a65 ]

A sysctl variable is accessed concurrently, and there is always a chance
of data-race. So, all readers and writers need some basic protection to
avoid load/store-tearing.

This patch changes proc_doulongvec_minmax() to use READ_ONCE() and
WRITE_ONCE() internally to fix data-races on the sysctl side. For now,
proc_doulongvec_minmax() itself is tolerant to a data-race, but we still
need to add annotations on the other subsystem's side.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
kernel/sysctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index a769f64a78ed..7a8899f237a2 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1162,9 +1162,9 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table,
err = -EINVAL;
break;
}
- *i = val;
+ WRITE_ONCE(*i, val);
} else {
- val = convdiv * (*i) / convmul;
+ val = convdiv * READ_ONCE(*i) / convmul;
if (!first)
proc_put_char(&buffer, &left, '\t');
proc_put_long(&buffer, &left, val, false);
--
2.35.1



2022-07-19 14:17:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 228/231] serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle

From: Ilpo Järvinen <[email protected]>

commit 211565b100993c90b53bf40851eacaefc830cfe0 upstream.

The driver must provide throttle and unthrottle in uart_ops when it
sets UPSTAT_AUTORTS. Add them using existing stop_rx &
enable_interrupts functions.

Fixes: 2a76fa283098 (serial: pl011: Adopt generic flag to store auto RTS status)
Cc: stable <[email protected]>
Cc: Lukas Wunner <[email protected]>
Reported-by: Nuno Gonçalves <[email protected]>
Tested-by: Nuno Gonçalves <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/serial/amba-pl011.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1339,6 +1339,15 @@ static void pl011_stop_rx(struct uart_po
pl011_dma_rx_stop(uap);
}

+static void pl011_throttle_rx(struct uart_port *port)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&port->lock, flags);
+ pl011_stop_rx(port);
+ spin_unlock_irqrestore(&port->lock, flags);
+}
+
static void pl011_enable_ms(struct uart_port *port)
{
struct uart_amba_port *uap =
@@ -1760,9 +1769,10 @@ static int pl011_allocate_irq(struct uar
*/
static void pl011_enable_interrupts(struct uart_amba_port *uap)
{
+ unsigned long flags;
unsigned int i;

- spin_lock_irq(&uap->port.lock);
+ spin_lock_irqsave(&uap->port.lock, flags);

/* Clear out any spuriously appearing RX interrupts */
pl011_write(UART011_RTIS | UART011_RXIS, uap, REG_ICR);
@@ -1784,7 +1794,14 @@ static void pl011_enable_interrupts(stru
if (!pl011_dma_rx_running(uap))
uap->im |= UART011_RXIM;
pl011_write(uap->im, uap, REG_IMSC);
- spin_unlock_irq(&uap->port.lock);
+ spin_unlock_irqrestore(&uap->port.lock, flags);
+}
+
+static void pl011_unthrottle_rx(struct uart_port *port)
+{
+ struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port);
+
+ pl011_enable_interrupts(uap);
}

static int pl011_startup(struct uart_port *port)
@@ -2211,6 +2228,8 @@ static const struct uart_ops amba_pl011_
.stop_tx = pl011_stop_tx,
.start_tx = pl011_start_tx,
.stop_rx = pl011_stop_rx,
+ .throttle = pl011_throttle_rx,
+ .unthrottle = pl011_unthrottle_rx,
.enable_ms = pl011_enable_ms,
.break_ctl = pl011_break_ctl,
.startup = pl011_startup,


2022-07-19 14:18:38

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 128/231] drm/amd/display: Ignore First MST Sideband Message Return Error

From: Fangzhi Zuo <[email protected]>

[ Upstream commit acea108fa067d140bd155161a79b1fcd967f4137 ]

[why]
First MST sideband message returns AUX_RET_ERROR_HPD_DISCON
on certain intel platform. Aux transaction considered failure
if HPD unexpected pulled low. The actual aux transaction success
in such case, hence do not return error.

[how]
Not returning error when AUX_RET_ERROR_HPD_DISCON detected
on the first sideband message.

v2: squash in additional DMI entries
v3: squash in static fix

Signed-off-by: Fangzhi Zuo <[email protected]>
Acked-by: Solomon Chiu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 39 +++++++++++++++++++
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 8 ++++
.../display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 ++++++++
3 files changed, 64 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index b55a433e829e..bfbd701a4c9a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -72,6 +72,7 @@
#include <linux/pci.h>
#include <linux/firmware.h>
#include <linux/component.h>
+#include <linux/dmi.h>

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_uapi.h>
@@ -1391,6 +1392,41 @@ static bool dm_should_disable_stutter(struct pci_dev *pdev)
return false;
}

+static const struct dmi_system_id hpd_disconnect_quirk_table[] = {
+ {
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3660"),
+ },
+ },
+ {
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3260"),
+ },
+ },
+ {
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3460"),
+ },
+ },
+ {}
+};
+
+static void retrieve_dmi_info(struct amdgpu_display_manager *dm)
+{
+ const struct dmi_system_id *dmi_id;
+
+ dm->aux_hpd_discon_quirk = false;
+
+ dmi_id = dmi_first_match(hpd_disconnect_quirk_table);
+ if (dmi_id) {
+ dm->aux_hpd_discon_quirk = true;
+ DRM_INFO("aux_hpd_discon_quirk attached\n");
+ }
+}
+
static int amdgpu_dm_init(struct amdgpu_device *adev)
{
struct dc_init_data init_data;
@@ -1521,6 +1557,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
}

INIT_LIST_HEAD(&adev->dm.da_list);
+
+ retrieve_dmi_info(&adev->dm);
+
/* Display Core create. */
adev->dm.dc = dc_create(&init_data);

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index 7e44b0429448..4844601a5f47 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -546,6 +546,14 @@ struct amdgpu_display_manager {
* last successfully applied backlight values.
*/
u32 actual_brightness[AMDGPU_DM_MAX_NUM_EDP];
+
+ /**
+ * @aux_hpd_discon_quirk:
+ *
+ * quirk for hpd discon while aux is on-going.
+ * occurred on certain intel platform
+ */
+ bool aux_hpd_discon_quirk;
};

enum dsc_clock_force_state {
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 31ac1fce36f8..d864cae1af67 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -58,6 +58,8 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
ssize_t result = 0;
struct aux_payload payload;
enum aux_return_code_type operation_result;
+ struct amdgpu_device *adev;
+ struct ddc_service *ddc;

if (WARN_ON(msg->size > 16))
return -E2BIG;
@@ -76,6 +78,21 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
result = dc_link_aux_transfer_raw(TO_DM_AUX(aux)->ddc_service, &payload,
&operation_result);

+ /*
+ * w/a on certain intel platform where hpd is unexpected to pull low during
+ * 1st sideband message transaction by return AUX_RET_ERROR_HPD_DISCON
+ * aux transaction is succuess in such case, therefore bypass the error
+ */
+ ddc = TO_DM_AUX(aux)->ddc_service;
+ adev = ddc->ctx->driver_context;
+ if (adev->dm.aux_hpd_discon_quirk) {
+ if (msg->address == DP_SIDEBAND_MSG_DOWN_REQ_BASE &&
+ operation_result == AUX_RET_ERROR_HPD_DISCON) {
+ result = 0;
+ operation_result = AUX_RET_SUCCESS;
+ }
+ }
+
if (payload.write && result >= 0)
result = msg->size;

--
2.35.1



2022-07-19 14:20:38

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 224/231] ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory

From: Mario Limonciello <[email protected]>

commit fbd74d16890b9f5d08ea69b5282b123c894f8860 upstream.

When commit 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all
and when CPPC_LIB is supported") was introduced, we found collateral
damage that a number of AMD systems that supported CPPC but
didn't advertise support in _OSC stopped having a functional
amd-pstate driver. The _OSC was only enforced on Intel systems at that
time.

This was fixed for the MSR based designs by commit 8b356e536e69f
("ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported")
but some shared memory based designs also support CPPC but haven't
advertised support in the _OSC. Add support for those designs as well by
hardcoding the list of systems.

Fixes: 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported")
Fixes: 8b356e536e69f ("ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported")
Link: https://lore.kernel.org/all/[email protected]/
Cc: 5.18+ <[email protected]> # 5.18+
Reported-and-tested-by: Oleksandr Natalenko <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/x86/kernel/acpi/cppc.c | 6 ++++++
1 file changed, 6 insertions(+)

--- a/arch/x86/kernel/acpi/cppc.c
+++ b/arch/x86/kernel/acpi/cppc.c
@@ -16,6 +16,12 @@ bool cpc_supported_by_cpu(void)
switch (boot_cpu_data.x86_vendor) {
case X86_VENDOR_AMD:
case X86_VENDOR_HYGON:
+ if (boot_cpu_data.x86 == 0x19 && ((boot_cpu_data.x86_model <= 0x0f) ||
+ (boot_cpu_data.x86_model >= 0x20 && boot_cpu_data.x86_model <= 0x2f)))
+ return true;
+ else if (boot_cpu_data.x86 == 0x17 &&
+ boot_cpu_data.x86_model >= 0x70 && boot_cpu_data.x86_model <= 0x7f)
+ return true;
return boot_cpu_has(X86_FEATURE_CPPC);
}
return false;


2022-07-19 14:20:47

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 124/231] net: ftgmac100: Hold reference returned by of_get_child_by_name()

From: Liang He <[email protected]>

[ Upstream commit 49b9f431ff0d845a36be0b3ede35ec324f2e5fee ]

In ftgmac100_probe(), we should hold the refernece returned by
of_get_child_by_name() and use it to call of_node_put() for
reference balance.

Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property")
Signed-off-by: Liang He <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/faraday/ftgmac100.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 5231818943c6..c03663785a8d 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1764,6 +1764,19 @@ static int ftgmac100_setup_clk(struct ftgmac100 *priv)
return rc;
}

+static bool ftgmac100_has_child_node(struct device_node *np, const char *name)
+{
+ struct device_node *child_np = of_get_child_by_name(np, name);
+ bool ret = false;
+
+ if (child_np) {
+ ret = true;
+ of_node_put(child_np);
+ }
+
+ return ret;
+}
+
static int ftgmac100_probe(struct platform_device *pdev)
{
struct resource *res;
@@ -1883,7 +1896,7 @@ static int ftgmac100_probe(struct platform_device *pdev)

/* Display what we found */
phy_attached_info(phy);
- } else if (np && !of_get_child_by_name(np, "mdio")) {
+ } else if (np && !ftgmac100_has_child_node(np, "mdio")) {
/* Support legacy ASPEED devicetree descriptions that decribe a
* MAC with an embedded MDIO controller but have no "mdio"
* child node. Automatically scan the MDIO bus for available
--
2.35.1



2022-07-19 14:21:29

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 173/231] platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms

From: Mark Pearson <[email protected]>

[ Upstream commit bce6243f767f7da88aa4674d5d678f9f156eaba9 ]

PSC platform profile mode is only supported on Linux for AMD platforms.

Some older Intel platforms (e.g T490) are advertising it's capability
as Windows uses it - but on Linux we should only be using MMC profile
for Intel systems.

Add a check to prevent it being enabled incorrectly.

Signed-off-by: Mark Pearson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/platform/x86/thinkpad_acpi.c | 5 +++++
1 file changed, 5 insertions(+)

--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -10541,6 +10541,11 @@ static int tpacpi_dytc_profile_init(stru
dytc_mmc_get_available = true;
}
} else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */
+ /* Support for this only works on AMD platforms */
+ if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
+ dbg_printk(TPACPI_DBG_INIT, "PSC not support on Intel platforms\n");
+ return -ENODEV;
+ }
pr_debug("PSC is supported\n");
} else {
dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n");


2022-07-19 14:22:19

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 216/231] nvme-pci: phison e16 has bogus namespace ids

From: Keith Busch <[email protected]>

[ Upstream commit 73029c9b23cf1213e5f54c2b59efce08665199e7 ]

Add the quirk.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216049
Reported-by: Chris Egolf <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/nvme/host/pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index fe829377c7c2..ab575fdd8015 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3432,7 +3432,8 @@ static const struct pci_device_id nvme_id_table[] = {
NVME_QUIRK_DISABLE_WRITE_ZEROES|
NVME_QUIRK_IGNORE_DEV_SUBNQN, },
{ PCI_DEVICE(0x1987, 0x5016), /* Phison E16 */
- .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
+ .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN |
+ NVME_QUIRK_BOGUS_NID, },
{ PCI_DEVICE(0x1b4b, 0x1092), /* Lexar 256 GB SSD */
.driver_data = NVME_QUIRK_NO_NS_DESC_LIST |
NVME_QUIRK_IGNORE_DEV_SUBNQN, },
--
2.35.1



2022-07-19 14:22:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 067/231] net: ethernet: ti: am65-cpsw: Fix devlink port register sequence

From: Siddharth Vadapalli <[email protected]>

[ Upstream commit 0680e20af5fbf41df8a11b11bd9a7c25b2ca0746 ]

Renaming interfaces using udevd depends on the interface being registered
before its netdev is registered. Otherwise, udevd reads an empty
phys_port_name value, resulting in the interface not being renamed.

Fix this by registering the interface before registering its netdev
by invoking am65_cpsw_nuss_register_devlink() before invoking
register_netdev() for the interface.

Move the function call to devlink_port_type_eth_set(), invoking it after
register_netdev() is invoked, to ensure that netlink notification for the
port state change is generated after the netdev is completely initialized.

Fixes: 58356eb31d60 ("net: ti: am65-cpsw-nuss: Add devlink support")
Signed-off-by: Siddharth Vadapalli <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 6d978dbf708f..298953053407 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -2475,7 +2475,6 @@ static int am65_cpsw_nuss_register_devlink(struct am65_cpsw_common *common)
port->port_id, ret);
goto dl_port_unreg;
}
- devlink_port_type_eth_set(dl_port, port->ndev);
}
devlink_register(common->devlink);
return ret;
@@ -2519,6 +2518,7 @@ static void am65_cpsw_unregister_devlink(struct am65_cpsw_common *common)
static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
{
struct device *dev = common->dev;
+ struct devlink_port *dl_port;
struct am65_cpsw_port *port;
int ret = 0, i;

@@ -2535,6 +2535,10 @@ static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
return ret;
}

+ ret = am65_cpsw_nuss_register_devlink(common);
+ if (ret)
+ return ret;
+
for (i = 0; i < common->port_num; i++) {
port = &common->ports[i];

@@ -2547,25 +2551,24 @@ static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
i, ret);
goto err_cleanup_ndev;
}
+
+ dl_port = &port->devlink_port;
+ devlink_port_type_eth_set(dl_port, port->ndev);
}

ret = am65_cpsw_register_notifiers(common);
if (ret)
goto err_cleanup_ndev;

- ret = am65_cpsw_nuss_register_devlink(common);
- if (ret)
- goto clean_unregister_notifiers;
-
/* can't auto unregister ndev using devm_add_action() due to
* devres release sequence in DD core for DMA
*/

return 0;
-clean_unregister_notifiers:
- am65_cpsw_unregister_notifiers(common);
+
err_cleanup_ndev:
am65_cpsw_nuss_cleanup_ndev(common);
+ am65_cpsw_unregister_devlink(common);

return ret;
}
--
2.35.1



2022-07-19 14:24:06

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 199/231] ASoC: wm5110: Fix DRE control

From: Charles Keepax <[email protected]>

[ Upstream commit 0bc0ae9a5938d512fd5d44f11c9c04892dcf4961 ]

The DRE controls on wm5110 should return a value of 1 if the DRE state
is actually changed, update to fix this.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/codecs/wm5110.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index 4973ba1ed779..4ab7a672f8de 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -413,6 +413,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift;
unsigned int lold, rold;
unsigned int lena, rena;
+ bool change = false;
int ret;

snd_soc_dapm_mutex_lock(dapm);
@@ -440,8 +441,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
goto err;
}

- ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE,
- mask, lnew | rnew);
+ ret = regmap_update_bits_check(arizona->regmap, ARIZONA_DRE_ENABLE,
+ mask, lnew | rnew, &change);
if (ret) {
dev_err(arizona->dev, "Failed to set DRE: %d\n", ret);
goto err;
@@ -454,6 +455,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
if (!rnew && rold)
wm5110_clear_pga_volume(arizona, mc->rshift);

+ if (change)
+ ret = 1;
+
err:
snd_soc_dapm_mutex_unlock(dapm);

--
2.35.1



2022-07-19 14:24:41

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 085/231] netfilter: nf_log: incorrect offset to network header

From: Pablo Neira Ayuso <[email protected]>

[ Upstream commit 7a847c00eeba9744353ecdfad253143b9115678a ]

NFPROTO_ARP is expecting to find the ARP header at the network offset.

In the particular case of ARP, HTYPE= field shows the initial bytes of
the ethernet header destination MAC address.

netdev out: IN= OUT=bridge0 MACSRC=c2:76:e5:71:e1:de MACDST=36:b0:4a:e2:72:ea MACPROTO=0806 ARP HTYPE=14000 PTYPE=0x4ae2 OPCODE=49782

NFPROTO_NETDEV egress hook is also expecting to find the IP headers at
the network offset.

Fixes: 35b9395104d5 ("netfilter: add generic ARP packet logger")
Reported-by: Tom Yan <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/netfilter/nf_log_syslog.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/nf_log_syslog.c b/net/netfilter/nf_log_syslog.c
index 13234641cdb3..7000e069bc07 100644
--- a/net/netfilter/nf_log_syslog.c
+++ b/net/netfilter/nf_log_syslog.c
@@ -61,7 +61,7 @@ dump_arp_packet(struct nf_log_buf *m,
unsigned int logflags;
struct arphdr _arph;

- ah = skb_header_pointer(skb, 0, sizeof(_arph), &_arph);
+ ah = skb_header_pointer(skb, nhoff, sizeof(_arph), &_arph);
if (!ah) {
nf_log_buf_add(m, "TRUNCATED");
return;
@@ -90,7 +90,7 @@ dump_arp_packet(struct nf_log_buf *m,
ah->ar_pln != sizeof(__be32))
return;

- ap = skb_header_pointer(skb, sizeof(_arph), sizeof(_arpp), &_arpp);
+ ap = skb_header_pointer(skb, nhoff + sizeof(_arph), sizeof(_arpp), &_arpp);
if (!ap) {
nf_log_buf_add(m, " INCOMPLETE [%zu bytes]",
skb->len - sizeof(_arph));
@@ -144,7 +144,7 @@ static void nf_log_arp_packet(struct net *net, u_int8_t pf,

nf_log_dump_packet_common(m, pf, hooknum, skb, in, out, loginfo,
prefix);
- dump_arp_packet(m, loginfo, skb, 0);
+ dump_arp_packet(m, loginfo, skb, skb_network_offset(skb));

nf_log_buf_close(m);
}
@@ -829,7 +829,7 @@ static void nf_log_ip_packet(struct net *net, u_int8_t pf,
if (in)
dump_ipv4_mac_header(m, loginfo, skb);

- dump_ipv4_packet(net, m, loginfo, skb, 0);
+ dump_ipv4_packet(net, m, loginfo, skb, skb_network_offset(skb));

nf_log_buf_close(m);
}
--
2.35.1



2022-07-19 14:25:03

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 221/231] ACPI: video: Fix acpi_video_handles_brightness_key_presses()

From: Hans de Goede <[email protected]>

[ Upstream commit 5ad26161a371e4aa2d2553286f0cac580987a493 ]

Commit 3a0cf7ab8df3 ("ACPI: video: Change how we determine if brightness
key-presses are handled") made acpi_video_handles_brightness_key_presses()
report false when none of the ACPI Video Devices support backlight control.

But it turns out that at least on a Dell Inspiron N4010 there is no ACPI
backlight control, yet brightness hotkeys are still reported through
the ACPI Video Bus; and since acpi_video_handles_brightness_key_presses()
now returns false, brightness keypresses are now reported twice.

To fix this rename the has_backlight flag to may_report_brightness_keys and
also set it the first time a brightness key press event is received.

Depending on the delivery of the other ACPI (WMI) event vs the ACPI Video
Bus event this means that the first brightness key press might still get
reported twice, but all further keypresses will be filtered as before.

Note that this relies on other drivers reporting brightness key events
calling acpi_video_handles_brightness_key_presses() when delivering
the events (rather then once during driver probe). This is already
required and documented in include/acpi/video.h:

/*
* Note: The value returned by acpi_video_handles_brightness_key_presses()
* may change over time and should not be cached.
*/

Fixes: 3a0cf7ab8df3 ("ACPI: video: Change how we determine if brightness key-presses are handled")
Link: https://lore.kernel.org/regressions/CALF=6jEe5G8+r1Wo0vvz4GjNQQhdkLT5p8uCHn6ZXhg4nsOWow@mail.gmail.com/
Reported-and-tested-by: Ben Greening <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/acpi/acpi_video.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -73,7 +73,7 @@ module_param(device_id_scheme, bool, 044
static int only_lcd = -1;
module_param(only_lcd, int, 0444);

-static bool has_backlight;
+static bool may_report_brightness_keys;
static int register_count;
static DEFINE_MUTEX(register_count_mutex);
static DEFINE_MUTEX(video_list_lock);
@@ -1224,7 +1224,7 @@ acpi_video_bus_get_one_device(struct acp
acpi_video_device_find_cap(data);

if (data->cap._BCM && data->cap._BCL)
- has_backlight = true;
+ may_report_brightness_keys = true;

mutex_lock(&video->device_list_lock);
list_add_tail(&data->entry, &video->video_device_list);
@@ -1693,6 +1693,9 @@ static void acpi_video_device_notify(acp
break;
}

+ if (keycode)
+ may_report_brightness_keys = true;
+
acpi_notifier_call_chain(device, event, 0);

if (keycode && (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS)) {
@@ -2254,7 +2257,7 @@ void acpi_video_unregister(void)
if (register_count) {
acpi_bus_unregister_driver(&acpi_video_bus);
register_count = 0;
- has_backlight = false;
+ may_report_brightness_keys = false;
}
mutex_unlock(&register_count_mutex);
}
@@ -2276,7 +2279,7 @@ void acpi_video_unregister_backlight(voi

bool acpi_video_handles_brightness_key_presses(void)
{
- return has_backlight &&
+ return may_report_brightness_keys &&
(report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS);
}
EXPORT_SYMBOL(acpi_video_handles_brightness_key_presses);


2022-07-19 14:25:06

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 135/231] netfs: do not unlock and put the folio twice

From: Xiubo Li <[email protected]>

[ Upstream commit fac47b43c760ea90e64b895dba60df0327be7775 ]

check_write_begin() will unlock and put the folio when return
non-zero. So we should avoid unlocking and putting it twice in
netfs layer.

Change the way ->check_write_begin() works in the following two ways:

(1) Pass it a pointer to the folio pointer, allowing it to unlock and put
the folio prior to doing the stuff it wants to do, provided it clears
the folio pointer.

(2) Change the return values such that 0 with folio pointer set means
continue, 0 with folio pointer cleared means re-get and all error
codes indicating an error (no special treatment for -EAGAIN).

[ bagasdotme: use Sphinx code text syntax for *foliop pointer ]

Cc: [email protected]
Link: https://tracker.ceph.com/issues/56423
Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: David Howells <[email protected]>
Signed-off-by: Xiubo Li <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Bagas Sanjaya <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
Documentation/filesystems/netfs_library.rst | 8 +++++---
fs/afs/file.c | 2 +-
fs/ceph/addr.c | 11 ++++++-----
fs/netfs/buffered_read.c | 17 ++++++++++-------
include/linux/netfs.h | 2 +-
5 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/Documentation/filesystems/netfs_library.rst b/Documentation/filesystems/netfs_library.rst
index 0483abcafcb0..0542358724f1 100644
--- a/Documentation/filesystems/netfs_library.rst
+++ b/Documentation/filesystems/netfs_library.rst
@@ -300,7 +300,7 @@ through which it can issue requests and negotiate::
void (*issue_read)(struct netfs_io_subrequest *subreq);
bool (*is_still_valid)(struct netfs_io_request *rreq);
int (*check_write_begin)(struct file *file, loff_t pos, unsigned len,
- struct folio *folio, void **_fsdata);
+ struct folio **foliop, void **_fsdata);
void (*done)(struct netfs_io_request *rreq);
void (*cleanup)(struct address_space *mapping, void *netfs_priv);
};
@@ -376,8 +376,10 @@ The operations are as follows:
allocated/grabbed the folio to be modified to allow the filesystem to flush
conflicting state before allowing it to be modified.

- It should return 0 if everything is now fine, -EAGAIN if the folio should be
- regrabbed and any other error code to abort the operation.
+ It may unlock and discard the folio it was given and set the caller's folio
+ pointer to NULL. It should return 0 if everything is now fine (``*foliop``
+ left set) or the op should be retried (``*foliop`` cleared) and any other
+ error code to abort the operation.

* ``done``

diff --git a/fs/afs/file.c b/fs/afs/file.c
index fab8324833ba..a8a5a91dc375 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -376,7 +376,7 @@ static int afs_begin_cache_operation(struct netfs_io_request *rreq)
}

static int afs_check_write_begin(struct file *file, loff_t pos, unsigned len,
- struct folio *folio, void **_fsdata)
+ struct folio **foliop, void **_fsdata)
{
struct afs_vnode *vnode = AFS_FS_I(file_inode(file));

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 11dbb1133a21..ae567fb7f65a 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -63,7 +63,7 @@
(CONGESTION_ON_THRESH(congestion_kb) >> 2))

static int ceph_netfs_check_write_begin(struct file *file, loff_t pos, unsigned int len,
- struct folio *folio, void **_fsdata);
+ struct folio **foliop, void **_fsdata);

static inline struct ceph_snap_context *page_snap_context(struct page *page)
{
@@ -1285,18 +1285,19 @@ ceph_find_incompatible(struct page *page)
}

static int ceph_netfs_check_write_begin(struct file *file, loff_t pos, unsigned int len,
- struct folio *folio, void **_fsdata)
+ struct folio **foliop, void **_fsdata)
{
struct inode *inode = file_inode(file);
struct ceph_inode_info *ci = ceph_inode(inode);
struct ceph_snap_context *snapc;

- snapc = ceph_find_incompatible(folio_page(folio, 0));
+ snapc = ceph_find_incompatible(folio_page(*foliop, 0));
if (snapc) {
int r;

- folio_unlock(folio);
- folio_put(folio);
+ folio_unlock(*foliop);
+ folio_put(*foliop);
+ *foliop = NULL;
if (IS_ERR(snapc))
return PTR_ERR(snapc);

diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c
index e8e3359a4c54..8d03826c2b15 100644
--- a/fs/netfs/buffered_read.c
+++ b/fs/netfs/buffered_read.c
@@ -320,8 +320,9 @@ static bool netfs_skip_folio_read(struct folio *folio, loff_t pos, size_t len,
* conflicting writes once the folio is grabbed and locked. It is passed a
* pointer to the fsdata cookie that gets returned to the VM to be passed to
* write_end. It is permitted to sleep. It should return 0 if the request
- * should go ahead; unlock the folio and return -EAGAIN to cause the folio to
- * be regot; or return an error.
+ * should go ahead or it may return an error. It may also unlock and put the
+ * folio, provided it sets ``*foliop`` to NULL, in which case a return of 0
+ * will cause the folio to be re-got and the process to be retried.
*
* The calling netfs must initialise a netfs context contiguous to the vfs
* inode before calling this.
@@ -352,13 +353,13 @@ int netfs_write_begin(struct file *file, struct address_space *mapping,

if (ctx->ops->check_write_begin) {
/* Allow the netfs (eg. ceph) to flush conflicts. */
- ret = ctx->ops->check_write_begin(file, pos, len, folio, _fsdata);
+ ret = ctx->ops->check_write_begin(file, pos, len, &folio, _fsdata);
if (ret < 0) {
trace_netfs_failure(NULL, NULL, ret, netfs_fail_check_write_begin);
- if (ret == -EAGAIN)
- goto retry;
goto error;
}
+ if (!folio)
+ goto retry;
}

if (folio_test_uptodate(folio))
@@ -420,8 +421,10 @@ int netfs_write_begin(struct file *file, struct address_space *mapping,
error_put:
netfs_put_request(rreq, false, netfs_rreq_trace_put_failed);
error:
- folio_unlock(folio);
- folio_put(folio);
+ if (folio) {
+ folio_unlock(folio);
+ folio_put(folio);
+ }
_leave(" = %d", ret);
return ret;
}
diff --git a/include/linux/netfs.h b/include/linux/netfs.h
index a9c6f73877ec..95dadf0cd4b8 100644
--- a/include/linux/netfs.h
+++ b/include/linux/netfs.h
@@ -211,7 +211,7 @@ struct netfs_request_ops {
void (*issue_read)(struct netfs_io_subrequest *subreq);
bool (*is_still_valid)(struct netfs_io_request *rreq);
int (*check_write_begin)(struct file *file, loff_t pos, unsigned len,
- struct folio *folio, void **_fsdata);
+ struct folio **foliop, void **_fsdata);
void (*done)(struct netfs_io_request *rreq);
void (*cleanup)(struct address_space *mapping, void *netfs_priv);
};
--
2.35.1



2022-07-19 14:49:25

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.18 023/231] ARM: 9213/1: Print message about disabled Spectre workarounds only once

From: Dmitry Osipenko <[email protected]>

commit e4ced82deb5fb17222fb82e092c3f8311955b585 upstream.

Print the message about disabled Spectre workarounds only once. The
message is printed each time CPU goes out from idling state on NVIDIA
Tegra boards, causing storm in KMSG that makes system unusable.

Cc: [email protected]
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Russell King (Oracle) <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/arm/mm/proc-v7-bugs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/arch/arm/mm/proc-v7-bugs.c
+++ b/arch/arm/mm/proc-v7-bugs.c
@@ -108,8 +108,7 @@ static unsigned int spectre_v2_install_w
#else
static unsigned int spectre_v2_install_workaround(unsigned int method)
{
- pr_info("CPU%u: Spectre V2: workarounds disabled by configuration\n",
- smp_processor_id());
+ pr_info_once("Spectre V2: workarounds disabled by configuration\n");

return SPECTRE_VULNERABLE;
}


2022-07-19 16:03:08

by Ronald Warsow

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

hallo Greg

5.18.13-rc1

compiles here with a lot of warnings on an x86_64
(Intel i5-11400, Fedora 36)

warnings all over the tree like this:
...
arch/x86/crypto/twofish-x86_64-asm_64.o: warning: objtool:
twofish_enc_blk()+0x7b2: 'naked' return found in RETPOLINE build
arch/x86/crypto/twofish-x86_64-asm_64.o: warning: objtool:
twofish_dec_blk()+0x7b2: 'naked' return found in RETPOLINE build
...

patch was applied to an clean 5.18.12

is it just me ?

Tested-by: Ronald Warsow <[email protected]>

2022-07-19 18:06:21

by Naresh Kamboju

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, 19 Jul 2022 at 17:49, Greg Kroah-Hartman
<[email protected]> wrote:
>
> This is the start of the stable review cycle for the 5.18.13 release.
> There are 231 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 Thu, 21 Jul 2022 11:43:40 +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.18.13-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.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h


There are two regression found

1)
Build regression on i386 with clang-13 and clang-14,
I do not see this build error on mainline.

2) Too many build warnings x86 with gcc-11
I do not see these build warnings on mainline,

Reported-by: Linux Kernel Functional Testing <[email protected]>

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang'
'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3
>>> referenced by i915_scatterlist.c
>>> gpu/drm/i915/i915_scatterlist.o:(i915_rsgt_from_mm_node) in archive drivers/built-in.a
make[1]: *** [/builds/linux/Makefile:1162: vmlinux] Error 1


steps to reproduce:
--------------------------
tuxmake --runtime podman --target-arch i386 --toolchain clang-14
--kconfig https://builds.tuxbuild.com/2CA3gjUTE2s74Bzp3G7q2hBxj1t/config
LLVM=1 LLVM_IAS=1
[1] https://builds.tuxbuild.com/2CA3gjUTE2s74Bzp3G7q2hBxj1t/


2. Large number of build warnings on x86 with gcc-11,
I do not see these build warnings on mainline,

Build link: https://builds.tuxbuild.com/2CA3fVEQKJXLNNGgHvoEmFEjyPq/

make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64
CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc'
'HOSTCC=sccache gcc'
init/calibrate.o: warning: objtool: calibrate_delay_is_known()+0xc:
'naked' return found in RETPOLINE build
init/initramfs.o: warning: objtool: wait_for_initramfs()+0x23: 'naked'
return found in RETPOLINE build
init/main.o: warning: objtool: __traceiter_initcall_level()+0x3a:
'naked' return found in RETPOLINE build
arch/x86/entry/vdso/vma.o: warning: objtool: vdso_mremap()+0x49:
'naked' return found in RETPOLINE build
arch/x86/events/amd/core.o: warning: objtool:
amd_pmu_event_map()+0x1e: 'naked' return found in RETPOLINE build
init/do_mounts.o: warning: objtool: match_dev_by_label()+0x2d: 'naked'
return found in RETPOLINE build
arch/x86/events/amd/iommu.o: warning: objtool:
perf_iommu_event_init()+0x57: 'naked' return found in RETPOLINE build
arch/x86/events/amd/ibs.o: warning: objtool: perf_ibs_init()+0x136:
'naked' return found in RETPOLINE build
certs/system_keyring.o: warning: objtool:
restrict_link_by_builtin_trusted()+0x16: 'naked' return found in REild
kernel/locking/mutex.o: warning: objtool: __mutex_init()+0x2b: 'naked'
return found in RETPOLINE build

steps to reproduce:
tuxmake --runtime podman --target-arch x86_64 --toolchain gcc-11
--kconfig https://builds.tuxbuild.com/2CA3fVEQKJXLNNGgHvoEmFEjyPq/config

--
Linaro LKFT
https://lkft.linaro.org

2022-07-19 19:37:28

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, Jul 19, 2022 at 11:27:18PM +0530, Naresh Kamboju wrote:
> On Tue, 19 Jul 2022 at 17:49, Greg Kroah-Hartman
> <[email protected]> wrote:
> >
> > This is the start of the stable review cycle for the 5.18.13 release.
> > There are 231 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 Thu, 21 Jul 2022 11:43:40 +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.18.13-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.18.y
> > and the diffstat can be found below.
> >
> > thanks,
> >
> > greg k-h
>
>
> There are two regression found
>
> 1)
> Build regression on i386 with clang-13 and clang-14,
> I do not see this build error on mainline.
>
> 2) Too many build warnings x86 with gcc-11
> I do not see these build warnings on mainline,
>
> Reported-by: Linux Kernel Functional Testing <[email protected]>
>
> Details log:
> ------------
> 1. i386 build failures with clang-13 and clang-14
> make --silent --keep-going --jobs=8
> O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
> ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang'
> 'CC=sccache clang'
> ld.lld: error: undefined symbol: __udivdi3
> >>> referenced by i915_scatterlist.c
> >>> gpu/drm/i915/i915_scatterlist.o:(i915_rsgt_from_mm_node) in archive drivers/built-in.a
> make[1]: *** [/builds/linux/Makefile:1162: vmlinux] Error 1
>
>
> steps to reproduce:
> --------------------------
> tuxmake --runtime podman --target-arch i386 --toolchain clang-14
> --kconfig https://builds.tuxbuild.com/2CA3gjUTE2s74Bzp3G7q2hBxj1t/config
> LLVM=1 LLVM_IAS=1
> [1] https://builds.tuxbuild.com/2CA3gjUTE2s74Bzp3G7q2hBxj1t/
>
>
> 2. Large number of build warnings on x86 with gcc-11,
> I do not see these build warnings on mainline,
>
> Build link: https://builds.tuxbuild.com/2CA3fVEQKJXLNNGgHvoEmFEjyPq/

Very odd, can you do bisect to track down the offending commits?

My local building test system is not working for unrelated issues (local
heat wave), and my cloud test systems are broken for some other unknown
reason, so I can't test this myself.

thanks,

greg k-h

2022-07-19 19:39:00

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
<[email protected]> wrote:
>
>
> Details log:
> ------------
> 1. i386 build failures with clang-13 and clang-14
> make --silent --keep-going --jobs=8
> O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
> ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang'
> 'CC=sccache clang'
> ld.lld: error: undefined symbol: __udivdi3

Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix
sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix
32b build").

> 2. Large number of build warnings on x86 with gcc-11,
> I do not see these build warnings on mainline,
..
> 'naked' return found in RETPOLINE build

Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?

Your build does magic things with 'scripts/kconfig/merge_config.sh',
and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a
compiler that doesn't actually support it, or something like that?

Linus

2022-07-19 21:09:00

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review



On 7/19/2022 4:51 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.18.13 release.
> There are 231 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 Thu, 21 Jul 2022 11:43:40 +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.18.13-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.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels and built tested
with BMIPS_GENERIC (bmips_stb_defconfig):

Tested-by: Florian Fainelli <[email protected]>
--
Florian

2022-07-19 23:49:41

by Ron Economos

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On 7/19/22 4:51 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.18.13 release.
> There are 231 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 Thu, 21 Jul 2022 11:43:40 +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.18.13-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.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

Built and booted successfully on RISC-V RV64 (HiFive Unmatched).

Tested-by: Ron Economos <[email protected]>

2022-07-20 03:51:45

by Naresh Kamboju

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

Hi Linus,

On Wed, 20 Jul 2022 at 01:03, Linus Torvalds
<[email protected]> wrote:
>
> On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
> <[email protected]> wrote:
> >
> >
> > Details log:
> > ------------
> > 1. i386 build failures with clang-13 and clang-14
> > make --silent --keep-going --jobs=8
> > O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
> > ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang'
> > 'CC=sccache clang'
> > ld.lld: error: undefined symbol: __udivdi3
>
> Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix
> sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix
> 32b build").
>
> > 2. Large number of build warnings on x86 with gcc-11,
> > I do not see these build warnings on mainline,
> ..
> > 'naked' return found in RETPOLINE build
>
> Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?
>
> Your build does magic things with 'scripts/kconfig/merge_config.sh',
> and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a
> compiler that doesn't actually support it, or something like that?

I see the diff of the defconfig file from the previous release.

The new config is causing a lot of warnings.
init/calibrate.o: warning: objtool: calibrate_delay_is_known()+0x2:
'naked' return found in RETPOLINE build


Following configs have been deleted in new defconfig
CONFIG_RETHUNK=y
CONFIG_CC_HAS_RETURN_THUNK=y
CONFIG_SPECULATION_MITIGATIONS=y
CONFIG_CPU_UNRET_ENTRY=y
CONFIG_CPU_IBPB_ENTRY=y
CONFIG_CPU_IBRS_ENTRY=y

--- good-config 2022-07-13 02:22:04.000000000 +0530
+++ warning-config 2022-07-19 17:37:17.000000000 +0530
@@ -1,15 +1,15 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86_64 5.18.12-rc1 Kernel Configuration
+# Linux/x86_64 5.18.13-rc1 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="x86_64-linux-gnu-gcc (Debian 11.3.0-3) 11.3.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110300
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
-CONFIG_AS_VERSION=23800
+CONFIG_AS_VERSION=23850
CONFIG_LD_IS_BFD=y
-CONFIG_LD_VERSION=23800
+CONFIG_LD_VERSION=23850
CONFIG_LLD_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y
@@ -317,6 +317,9 @@
# CONFIG_X86_X2APIC is not set
CONFIG_X86_MPPARSE=y
# CONFIG_GOLDFISH is not set
+CONFIG_RETPOLINE=y
+CONFIG_CC_HAS_SLS=y
+# CONFIG_SLS is not set
# CONFIG_X86_CPU_RESCTRL is not set
CONFIG_X86_EXTENDED_PLATFORM=y
# CONFIG_X86_VSMP is not set
@@ -467,16 +470,6 @@
CONFIG_HAVE_LIVEPATCH=y
# end of Processor type and features

-CONFIG_CC_HAS_SLS=y
-CONFIG_CC_HAS_RETURN_THUNK=y
-CONFIG_SPECULATION_MITIGATIONS=y
-CONFIG_PAGE_TABLE_ISOLATION=y
-CONFIG_RETPOLINE=y
-CONFIG_RETHUNK=y
-CONFIG_CPU_UNRET_ENTRY=y
-CONFIG_CPU_IBPB_ENTRY=y
-CONFIG_CPU_IBRS_ENTRY=y
-# CONFIG_SLS is not set
CONFIG_ARCH_HAS_ADD_PAGES=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y

@@ -4318,6 +4311,7 @@
CONFIG_SECURITY_WRITABLE_HOOKS=y
# CONFIG_SECURITYFS is not set
CONFIG_SECURITY_NETWORK=y
+CONFIG_PAGE_TABLE_ISOLATION=y
# CONFIG_SECURITY_NETWORK_XFRM is not set
# CONFIG_SECURITY_PATH is not set
# CONFIG_INTEL_TXT is not set




--
Linaro LKFT
https://lkft.linaro.org

2022-07-20 06:19:47

by Naresh Kamboju

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Wed, 20 Jul 2022 at 01:03, Linus Torvalds
<[email protected]> wrote:
>
> On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
> <[email protected]> wrote:
> >
> >
> > Details log:
> > ------------
> > 1. i386 build failures with clang-13 and clang-14
> > make --silent --keep-going --jobs=8
> > O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
> > ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang'
> > 'CC=sccache clang'
> > ld.lld: error: undefined symbol: __udivdi3
>
> Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix
> sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix
> 32b build").

Daniel, tested with extra commits as suggested by you and i386
build pass.

ced7866db39f ("drm/i915/ttm: fix 32b build")

- Naresh

2022-07-20 06:59:59

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, Jul 19, 2022 at 01:51:25PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.18.13 release.
> There are 231 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 Thu, 21 Jul 2022 11:43:40 +0000.
> Anything received after that time might be too late.
>

Build results:
total: 154 pass: 151 fail: 3
Failed builds:
i386:defconfig
i386:allyesconfig
i386:allmodconfig
Qemu test results:
total: 489 pass: 461 fail: 28
Failed tests:
<all i386>

The problem has already been reported, so I don't need to elaborate
further.

Guenter

2022-07-20 09:32:05

by Bagas Sanjaya

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, Jul 19, 2022 at 01:51:25PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.18.13 release.
> There are 231 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.
>

Successfully cross-compiled for arm64 (bcm2711_defconfig, GCC 10.2.0)
and powerpc (ps3_defconfig, GCC 12.1.0).

Tested-by: Bagas Sanjaya <[email protected]>

--
An old man doll... just what I always wanted! - Clara

2022-07-20 15:04:21

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

Hi Greg,

On Tue, Jul 19, 2022 at 01:51:25PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.18.13 release.
> There are 231 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 Thu, 21 Jul 2022 11:43:40 +0000.
> Anything received after that time might be too late.

Build test (gcc version 12.1.1 20220706):
mips: 59 configs -> no failure
arm: 99 configs -> no failure
arm64: 3 configs -> no failure
x86_64: 4 configs -> no failure
alpha allmodconfig -> no failure
csky 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]
mips: Booted on ci20 board. No regression. [3]

[1]. https://openqa.qa.codethink.co.uk/tests/1523
[2]. https://openqa.qa.codethink.co.uk/tests/1532
[3]. https://openqa.qa.codethink.co.uk/tests/1534

Note: seen lots of build warning as reported by others.

Tested-by: Sudip Mukherjee <[email protected]>

--
Regards
Sudip

2022-07-20 15:05:28

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, Jul 19, 2022 at 4:35 PM Ronald Warsow <[email protected]> wrote:
>
> hallo Greg
>
> 5.18.13-rc1
>
> compiles here with a lot of warnings on an x86_64
> (Intel i5-11400, Fedora 36)
>
> warnings all over the tree like this:
> ...
> arch/x86/crypto/twofish-x86_64-asm_64.o: warning: objtool:
> twofish_enc_blk()+0x7b2: 'naked' return found in RETPOLINE build
> arch/x86/crypto/twofish-x86_64-asm_64.o: warning: objtool:
> twofish_dec_blk()+0x7b2: 'naked' return found in RETPOLINE build
> ...
>
> patch was applied to an clean 5.18.12
>
> is it just me ?

No, I can see on my builds too.


--
Regards
Sudip

2022-07-20 16:42:59

by Viktor Jägersküpper

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

Greg Kroah-Hartman:
> This is the start of the stable review cycle for the 5.18.13 release.
> There are 231 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.

Hi Greg,

I noticed that there are several patches in the list which are also part of your
retbleed-5.18 queue. If I am not mistaken, these are:

[PATCH 5.18 145/231] x86/kvm: Fix SETcc emulation for return thunks
[PATCH 5.18 146/231] x86/sev: Avoid using __x86_return_thunk
[PATCH 5.18 147/231] x86/bugs: Report AMD retbleed vulnerability
[PATCH 5.18 148/231] objtool: Update Retpoline validation
[PATCH 5.18 149/231] x86/xen: Rename SYS* entry points
[PATCH 5.18 150/231] x86/cpu/amd: Add Spectral Chicken

I'm wondering if this is intended or if it would be better to release a stable
kernel with all the retbleed patches later because of the problems that came up
with these patches so far. I'm just a user, so I can't say anything about the
technical side, and I don't know how the patches were selected.

Thanks,
Viktor

>
> Responses should be made by Thu, 21 Jul 2022 11:43:40 +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.18.13-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.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
> -------------
> Pseudo-Shortlog of commits:
>
> Greg Kroah-Hartman <[email protected]>
> Linux 5.18.13-rc1
>
> Juergen Gross <[email protected]>
> x86/pat: Fix x86_has_pat_wp()
>
> Pali Rohár <[email protected]>
> serial: mvebu-uart: correctly report configured baudrate value
>
> Ilpo Järvinen <[email protected]>
> serial: 8250: Fix PM usage_count for console handover
>
> Ilpo Järvinen <[email protected]>
> serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle
>
> Ilpo Järvinen <[email protected]>
> serial: stm32: Clear prev values before setting RTS delays
>
> Dorian Rudolph <[email protected]>
> power: supply: core: Fix boundary conditions in interpolation
>
> Yi Yang <[email protected]>
> serial: 8250: fix return error code in serial8250_request_std_resource()
>
> Mario Limonciello <[email protected]>
> ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory
>
> Tony Krowiak <[email protected]>
> s390/ap: fix error handling in __verify_queue_reservations()
>
> Yangxi Xiang <[email protected]>
> vt: fix memory overlapping when deleting chars in the buffer
>
> Hans de Goede <[email protected]>
> ACPI: video: Fix acpi_video_handles_brightness_key_presses()
>
> Linus Torvalds <[email protected]>
> signal handling: don't use BUG_ON() for debugging
>
> Jason A. Donenfeld <[email protected]>
> wireguard: selftests: always call kernel makefile
>
> Jason A. Donenfeld <[email protected]>
> wireguard: selftests: set fake real time in init
>
> Keith Busch <[email protected]>
> nvme: use struct group for generic command dwords
>
> Keith Busch <[email protected]>
> nvme-pci: phison e16 has bogus namespace ids
>
> Egor Vorontsov <[email protected]>
> ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0)
>
> Egor Vorontsov <[email protected]>
> ALSA: usb-audio: Add quirk for Fiero SC-01
>
> John Veness <[email protected]>
> ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices
>
> Srinivas Neeli <[email protected]>
> Revert "can: xilinx_can: Limit CANFD brp to 2"
>
> Gabriel Fernandez <[email protected]>
> ARM: dts: stm32: use the correct clock source for CEC on stm32mp151
>
> Linus Walleij <[email protected]>
> soc: ixp4xx/npe: Fix unused match warning
>
> Juergen Gross <[email protected]>
> x86: Clear .brk area at early boot
>
> Jacky Bai <[email protected]>
> pinctrl: imx: Add the zero base flag for imx93
>
> Stafford Horne <[email protected]>
> irqchip: or1k-pic: Undefine mask_ack for level triggered hardware
>
> Charles Keepax <[email protected]>
> ASoC: madera: Fix event generation for rate controls
>
> Charles Keepax <[email protected]>
> ASoC: madera: Fix event generation for OUT1 demux
>
> Charles Keepax <[email protected]>
> ASoC: cs47l15: Fix event generation for low power mux control
>
> Charles Keepax <[email protected]>
> ASoC: cs35l41: Add ASP TX3/4 source to register patch
>
> Charles Keepax <[email protected]>
> ASoC: dapm: Initialise kcontrol data for mux/demux controls
>
> Shuming Fan <[email protected]>
> ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error
>
> Charles Keepax <[email protected]>
> ASoC: cs35l41: Correct some control names
>
> Charles Keepax <[email protected]>
> ASoC: wm5110: Fix DRE control
>
> Charles Keepax <[email protected]>
> ASoC: wm_adsp: Fix event for preloader
>
> Hans de Goede <[email protected]>
> ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem
>
> Mark Brown <[email protected]>
> ASoC: wcd938x: Fix event generation for some controls
>
> Mark Brown <[email protected]>
> ASoC: wcd9335: Fix spurious event generation
>
> Yassine Oudjana <[email protected]>
> ASoC: wcd9335: Remove RX channel from old list before adding it to a new one
>
> Peter Ujfalusi <[email protected]>
> ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow
>
> Peter Ujfalusi <[email protected]>
> ASoC: SOF: Intel: hda-loader: Make sure that the fw load sequence is followed
>
> Peter Ujfalusi <[email protected]>
> ASoC: SOF: Intel: hda-dsp: Expose hda_dsp_core_power_up()
>
> Pierre-Louis Bossart <[email protected]>
> ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe
>
> Pierre-Louis Bossart <[email protected]>
> ASoC: rt7*-sdw: harden jack_detect_handler
>
> Pierre-Louis Bossart <[email protected]>
> ASoC: rt711: fix calibrate mutex initialization
>
> Pierre-Louis Bossart <[email protected]>
> ASoC: Intel: sof_sdw: handle errors on card registration
>
> Pierre-Louis Bossart <[email protected]>
> ASoC: rt711-sdca-sdw: fix calibrate mutex initialization
>
> Pierre-Louis Bossart <[email protected]>
> ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove
>
> Haowen Bai <[email protected]>
> pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux()
>
> Mark Brown <[email protected]>
> ASoC: ops: Fix off by one in range control validation
>
> Jianglei Nie <[email protected]>
> net: sfp: fix memory leak in sfp_probe()
>
> Ruozhu Li <[email protected]>
> nvme: fix regression when disconnect a recovering ctrl
>
> Sagi Grimberg <[email protected]>
> nvme-tcp: always fail a request when sending it failed
>
> Michael Walle <[email protected]>
> NFC: nxp-nci: don't print header length mismatch on i2c error
>
> Hangyu Hua <[email protected]>
> net: tipc: fix possible refcount leak in tipc_sk_create()
>
> Javier Martinez Canillas <[email protected]>
> fbdev: Disable sysfb device registration when removing conflicting FBs
>
> Javier Martinez Canillas <[email protected]>
> firmware: sysfb: Add sysfb_disable() helper function
>
> Javier Martinez Canillas <[email protected]>
> firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer
>
> Kai-Heng Feng <[email protected]>
> platform/x86: hp-wmi: Ignore Sanitization Mode event
>
> Mark Pearson <[email protected]>
> platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms
>
> Mark Pearson <[email protected]>
> platform/x86: thinkpad-acpi: profile capabilities as integer
>
> Liang He <[email protected]>
> cpufreq: pmac32-cpufreq: Fix refcount leak bug
>
> John Garry <[email protected]>
> scsi: hisi_sas: Limit max hw sectors for v3 HW
>
> Florian Westphal <[email protected]>
> netfilter: br_netfilter: do not skip all hooks with 0 priority
>
> Florian Westphal <[email protected]>
> netfilter: nf_tables: avoid skb access on nf_stolen
>
> Stephan Gerhold <[email protected]>
> virtio_mmio: Restore guest page size on resume
>
> Stephan Gerhold <[email protected]>
> virtio_mmio: Add missing PM calls to freeze/restore
>
> Gayatri Kammela <[email protected]>
> platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver
>
> Parav Pandit <[email protected]>
> vduse: Tie vduse mgmtdev and its device
>
> Eli Cohen <[email protected]>
> vdpa/mlx5: Initialize CVQ vringh only once
>
> Nathan Lynch <[email protected]>
> powerpc/xive/spapr: correct bitmap allocation size
>
> Namjae Jeon <[email protected]>
> ksmbd: use SOCK_NONBLOCK type for kernel_accept()
>
> Israel Rukshin <[email protected]>
> nvme: fix block device naming collision
>
> Bjorn Andersson <[email protected]>
> scsi: ufs: core: Drop loglevel of WriteBoost message
>
> Ming Lei <[email protected]>
> scsi: megaraid: Clear READ queue map's nr_queues
>
> Vasily Gorbik <[email protected]>
> s390/nospec: build expoline.o for modules_prepare target
>
> Jiri Slaby <[email protected]>
> tty: use new tty_insert_flip_string_and_push_buffer() in pty_write()
>
> Jiri Slaby <[email protected]>
> tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push()
>
> Marc Kleine-Budde <[email protected]>
> tee: tee_get_drvdata(): fix description of return value
>
> Bryan O'Donoghue <[email protected]>
> ASoC: dt-bindings: Fix description for msm8916
>
> Linus Walleij <[email protected]>
> ARM: 9212/1: domain: Modify Kconfig help text
>
> Linus Walleij <[email protected]>
> ARM: 9211/1: domain: drop modify_domain()
>
> Peter Zijlstra <[email protected]>
> x86/cpu/amd: Add Spectral Chicken
>
> Peter Zijlstra <[email protected]>
> x86/xen: Rename SYS* entry points
>
> Peter Zijlstra <[email protected]>
> objtool: Update Retpoline validation
>
> Alexandre Chartre <[email protected]>
> x86/bugs: Report AMD retbleed vulnerability
>
> Kim Phillips <[email protected]>
> x86/sev: Avoid using __x86_return_thunk
>
> Peter Zijlstra <[email protected]>
> x86/kvm: Fix SETcc emulation for return thunks
>
> Muchun Song <[email protected]>
> mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE
>
> Tariq Toukan <[email protected]>
> net/tls: Check for errors in tls_device_init
>
> Vitaly Kuznetsov <[email protected]>
> KVM: x86: Fully initialize 'struct kvm_lapic_irq' in kvm_pv_kick_cpu_op()
>
> Chia-Lin Kao (AceLan) <[email protected]>
> net: atlantic: remove aq_nic_deinit() when resume
>
> Chia-Lin Kao (AceLan) <[email protected]>
> net: atlantic: remove deep parameter on suspend/resume functions
>
> Íñigo Huguet <[email protected]>
> sfc: fix kernel panic when creating VF
>
> Andrea Mayer <[email protected]>
> seg6: bpf: fix skb checksum in bpf_push_seg6_encap()
>
> Andrea Mayer <[email protected]>
> seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors
>
> Andrea Mayer <[email protected]>
> seg6: fix skb checksum evaluation in SRH encapsulation/insertion
>
> Xiubo Li <[email protected]>
> netfs: do not unlock and put the folio twice
>
> Íñigo Huguet <[email protected]>
> sfc: fix use after free when disabling sriov
>
> Steve French <[email protected]>
> smb3: workaround negprot bug in some Samba servers
>
> Michel Dänzer <[email protected]>
> drm/amd/display: Ensure valid event timestamp for cursor-only commits
>
> Yefim Barashkin <[email protected]>
> drm/amd/pm: Prevent divide by zero
>
> Mario Kleiner <[email protected]>
> drm/amd/display: Only use depth 36 bpp linebuffers on DCN display engines.
>
> Prike Liang <[email protected]>
> drm/amdkfd: correct the MEC atomic support firmware checking for GC 10.3.7
>
> Fangzhi Zuo <[email protected]>
> drm/amd/display: Ignore First MST Sideband Message Return Error
>
> Jianglei Nie <[email protected]>
> ima: Fix potential memory leak in ima_init_crypto()
>
> Coiby Xu <[email protected]>
> ima: force signature verification when CONFIG_KEXEC_SIG is configured
>
> Dan Carpenter <[email protected]>
> net: stmmac: fix leaks in probe
>
> Liang He <[email protected]>
> net: ftgmac100: Hold reference returned by of_get_child_by_name()
>
> Kuniyuki Iwashima <[email protected]>
> nexthop: Fix data-races around nexthop_compat_mode.
>
> Kuniyuki Iwashima <[email protected]>
> ipv4: Fix data-races around sysctl_ip_dynaddr.
>
> Kuniyuki Iwashima <[email protected]>
> tcp: Fix a data-race around sysctl_tcp_ecn_fallback.
>
> Kuniyuki Iwashima <[email protected]>
> tcp: Fix data-races around sysctl_tcp_ecn.
>
> Kuniyuki Iwashima <[email protected]>
> raw: Fix a data-race around sysctl_raw_l3mdev_accept.
>
> Kuniyuki Iwashima <[email protected]>
> icmp: Fix a data-race around sysctl_icmp_ratemask.
>
> Kuniyuki Iwashima <[email protected]>
> icmp: Fix a data-race around sysctl_icmp_ratelimit.
>
> Kuniyuki Iwashima <[email protected]>
> icmp: Fix a data-race around sysctl_icmp_errors_use_inbound_ifaddr.
>
> Kuniyuki Iwashima <[email protected]>
> icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses.
>
> Kuniyuki Iwashima <[email protected]>
> icmp: Fix a data-race around sysctl_icmp_echo_ignore_broadcasts.
>
> Kuniyuki Iwashima <[email protected]>
> icmp: Fix data-races around sysctl_icmp_echo_enable_probe.
>
> Kuniyuki Iwashima <[email protected]>
> icmp: Fix a data-race around sysctl_icmp_echo_ignore_all.
>
> Kuniyuki Iwashima <[email protected]>
> tcp: Fix a data-race around sysctl_max_tw_buckets.
>
> Kuniyuki Iwashima <[email protected]>
> sysctl: Fix data-races in proc_dointvec_ms_jiffies().
>
> Kuniyuki Iwashima <[email protected]>
> sysctl: Fix data-races in proc_dou8vec_minmax().
>
> Pavan Chebbi <[email protected]>
> bnxt_en: Fix bnxt_refclk_read()
>
> Vikas Gupta <[email protected]>
> bnxt_en: fix livepatch query
>
> Michael Chan <[email protected]>
> bnxt_en: Fix bnxt_reinit_after_abort() code path
>
> Kashyap Desai <[email protected]>
> bnxt_en: reclaim max resources if sriov enable fails
>
> Andrzej Hajda <[email protected]>
> drm/i915/selftests: fix subtraction overflow bug
>
> Chris Wilson <[email protected]>
> drm/i915/gt: Serialize TLB invalidates with GT resets
>
> Chris Wilson <[email protected]>
> drm/i915/gt: Serialize GRDOM access between multiple engine resets
>
> Matthew Auld <[email protected]>
> drm/i915/ttm: fix sg_table construction
>
> Dan Carpenter <[email protected]>
> drm/i915/selftests: fix a couple IS_ERR() vs NULL tests
>
> Douglas Anderson <[email protected]>
> tracing: Fix sleeping while atomic in kdb ftdump
>
> Paul M Stillwell Jr <[email protected]>
> ice: change devlink code to read NVM in blocks
>
> Paul M Stillwell Jr <[email protected]>
> ice: handle E822 generic device ID in PLDM header
>
> Yevhen Orlov <[email protected]>
> net: marvell: prestera: fix missed deinit sequence
>
> Jeff Layton <[email protected]>
> lockd: fix nlm_close_files
>
> Jeff Layton <[email protected]>
> lockd: set fl_owner when unlocking files
>
> Chuck Lever <[email protected]>
> NFSD: Decode NFSv4 birth time attribute
>
> Paolo Abeni <[email protected]>
> mptcp: fix subflow traversal at disconnect time
>
> Demi Marie Obenour <[email protected]>
> xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE
>
> Dan Carpenter <[email protected]>
> drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist()
>
> Anup Patel <[email protected]>
> RISC-V: KVM: Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests()
>
> Pablo Neira Ayuso <[email protected]>
> netfilter: nf_tables: replace BUG_ON by element length check
>
> Eric Dumazet <[email protected]>
> vlan: fix memory leak in vlan_newlink()
>
> Baowen Zheng <[email protected]>
> nfp: fix issue of skb segments exceeds descriptor limitation
>
> Pablo Neira Ayuso <[email protected]>
> netfilter: nf_log: incorrect offset to network header
>
> William Zhang <[email protected]>
> arm64: dts: broadcom: bcm4908: Fix cpu node for smp boot
>
> William Zhang <[email protected]>
> arm64: dts: broadcom: bcm4908: Fix timer node for BCM4906 SoC
>
> Michal Suchanek <[email protected]>
> ARM: dts: sunxi: Fix SPI NOR campatible on Orange Pi Zero
>
> Ryan Wanner <[email protected]>
> ARM: dts: at91: sama5d2: Fix typo in i2s1 node
>
> Kuniyuki Iwashima <[email protected]>
> ipv4: Fix a data-race around sysctl_fib_sync_mem.
>
> Kuniyuki Iwashima <[email protected]>
> icmp: Fix data-races around sysctl.
>
> Kuniyuki Iwashima <[email protected]>
> cipso: Fix data-races around sysctl.
>
> Kuniyuki Iwashima <[email protected]>
> net: Fix data-races around sysctl_mem.
>
> Kuniyuki Iwashima <[email protected]>
> inetpeer: Fix data-races around sysctl.
>
> Kuniyuki Iwashima <[email protected]>
> tcp: Fix a data-race around sysctl_tcp_max_orphans.
>
> Kuniyuki Iwashima <[email protected]>
> sysctl: Fix data races in proc_dointvec_jiffies().
>
> Kuniyuki Iwashima <[email protected]>
> sysctl: Fix data races in proc_doulongvec_minmax().
>
> Kuniyuki Iwashima <[email protected]>
> sysctl: Fix data races in proc_douintvec_minmax().
>
> Kuniyuki Iwashima <[email protected]>
> sysctl: Fix data races in proc_dointvec_minmax().
>
> Kuniyuki Iwashima <[email protected]>
> sysctl: Fix data races in proc_douintvec().
>
> Kuniyuki Iwashima <[email protected]>
> sysctl: Fix data races in proc_dointvec().
>
> Pavel Skripkin <[email protected]>
> net: ocelot: fix wrong time_after usage
>
> Siddharth Vadapalli <[email protected]>
> net: ethernet: ti: am65-cpsw: Fix devlink port register sequence
>
> Jon Hunter <[email protected]>
> net: stmmac: dwc-qos: Disable split header for Tegra194
>
> Florian Westphal <[email protected]>
> netfilter: conntrack: fix crash due to confirmed bit load reordering
>
> Florian Westphal <[email protected]>
> netfilter: conntrack: remove the percpu dying list
>
> Florian Westphal <[email protected]>
> netfilter: conntrack: include ecache dying list in dumps
>
> Florian Westphal <[email protected]>
> netfilter: ecache: use dedicated list for event redelivery
>
> Florian Westphal <[email protected]>
> netfilter: conntrack: split inner loop of list dumping to own function
>
> Florian Westphal <[email protected]>
> netfilter: ecache: move to separate structure
>
> Peter Ujfalusi <[email protected]>
> ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array
>
> Peter Ujfalusi <[email protected]>
> ASoC: Intel: Skylake: Correct the ssp rate discovery in skl_get_ssp_clks()
>
> Hector Martin <[email protected]>
> ASoC: tas2764: Fix amp gain register offset & default
>
> Hector Martin <[email protected]>
> ASoC: tas2764: Correct playback volume range
>
> Martin Povišer <[email protected]>
> ASoC: tas2764: Fix and extend FSYNC polarity handling
>
> Martin Povišer <[email protected]>
> ASoC: tas2764: Add post reset delays
>
> Francesco Dolcini <[email protected]>
> ASoC: sgtl5000: Fix noise on shutdown/remove
>
> Huaxin Lu <[email protected]>
> ima: Fix a potential integer overflow in ima_appraise_measurement
>
> Daniele Ceraolo Spurio <[email protected]>
> drm/i915/guc: ADL-N should use the same GuC FW as ADL-S
>
> Hangyu Hua <[email protected]>
> drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()
>
> Alex Deucher <[email protected]>
> drm/amdgpu/display: disable prefer_shadow for generic fb helpers
>
> Alex Deucher <[email protected]>
> drm/amdgpu: keep fbdev buffers pinned during suspend
>
> Maxim Mikityanskiy <[email protected]>
> net/mlx5e: Ring the TX doorbell on DMA errors
>
> Gal Pressman <[email protected]>
> net/mlx5e: Fix capability check for updating vnic env counters
>
> Roi Dayan <[email protected]>
> net/mlx5e: CT: Use own workqueue instead of mlx5e priv
>
> Paul Blakey <[email protected]>
> net/mlx5e: Fix enabling sriov while tc nic rules are offloaded
>
> Tariq Toukan <[email protected]>
> net/mlx5e: kTLS, Fix build time constant test in RX
>
> Tariq Toukan <[email protected]>
> net/mlx5e: kTLS, Fix build time constant test in TX
>
> Zhen Lei <[email protected]>
> ARM: 9210/1: Mark the FDT_FIXED sections as shareable
>
> Ard Biesheuvel <[email protected]>
> ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle
>
> Cristian Ciocaltea <[email protected]>
> spi: amd: Limit max transfer and message size
>
> Conor Dooley <[email protected]>
> riscv: dts: microchip: hook up the mpfs' l2cache
>
> Kris Bahnsen <[email protected]>
> ARM: dts: imx6qdl-ts7970: Fix ngpio typo and count
>
> Sean Anderson <[email protected]>
> arm64: dts: ls1028a: Update SFP node to include clock
>
> Serge Semin <[email protected]>
> reset: Fix devm bulk optional exclusive control getter
>
> Xiu Jianfeng <[email protected]>
> Revert "evm: Fix memleak in init_desc"
>
> Geert Uytterhoeven <[email protected]>
> sh: convert nommu io{re,un}map() to static inline functions
>
> Ryusuke Konishi <[email protected]>
> nilfs2: fix incorrect masking of permission flags for symlinks
>
> Dave Chinner <[email protected]>
> fs/remap: constrain dedupe of EOF blocks
>
> Dmitry Osipenko <[email protected]>
> drm/panfrost: Fix shrinker list corruption by madvise IOCTL
>
> Dmitry Osipenko <[email protected]>
> drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error
>
> Christoph Hellwig <[email protected]>
> btrfs: zoned: fix a leaked bioc in read_zone_info
>
> Filipe Manana <[email protected]>
> btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and inline extents
>
> Tejun Heo <[email protected]>
> cgroup: Use separate src/dst nodes when preloading css_sets for migration
>
> Felix Fietkau <[email protected]>
> wifi: mac80211: fix queue selection for mesh/OCB interfaces
>
> Ard Biesheuvel <[email protected]>
> ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction
>
> Dmitry Osipenko <[email protected]>
> ARM: 9213/1: Print message about disabled Spectre workarounds only once
>
> Nicolas Dichtel <[email protected]>
> ip: fix dflt addr selection for connected nexthop
>
> Steven Rostedt (Google) <[email protected]>
> net: sock: tracing: Fix sock_exceed_buf_limit not to dereference stale pointer
>
> Zheng Yejian <[email protected]>
> tracing/histograms: Fix memory leak problem
>
> Baolin Wang <[email protected]>
> mm/damon: use set_huge_pte_at() to make huge pte old
>
> Gowans, James <[email protected]>
> mm: split huge PUD on wp_huge_pud fallback
>
> Muchun Song <[email protected]>
> mm: sparsemem: fix missing higher order allocation splitting
>
> Axel Rasmussen <[email protected]>
> mm: userfaultfd: fix UFFDIO_CONTINUE on fallocated shmem pages
>
> Oleg Nesterov <[email protected]>
> fix race between exit_itimers() and /proc/pid/timers
>
> Juergen Gross <[email protected]>
> xen/netback: avoid entering xenvif_rx_next_skb() with an empty rx queue
>
> Meng Tang <[email protected]>
> ALSA: hda/realtek - Enable the headset-mic on a Xiaomi's laptop
>
> Meng Tang <[email protected]>
> ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc221
>
> Jeremy Szu <[email protected]>
> ALSA: hda/realtek: fix mute/micmute LEDs for HP machines
>
> Meng Tang <[email protected]>
> ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671
>
> Meng Tang <[email protected]>
> ALSA: hda/realtek: Fix headset mic for Acer SF313-51
>
> Meng Tang <[email protected]>
> ALSA: hda/conexant: Apply quirk for another HP ProDesk 600 G3 model
>
> Meng Tang <[email protected]>
> ALSA: hda - Add fixup for Dell Latitidue E5430
>
> Juergen Gross <[email protected]>
> x86/xen: Use clear_bss() for Xen PV guests
>
> Chanho Park <[email protected]>
> tty: serial: samsung_tty: set dma burst_size to 1
>
> Bartosz Golaszewski <[email protected]>
> gpio: sim: fix the chip_name configfs item
>
> Thinh Nguyen <[email protected]>
> usb: dwc3: gadget: Fix event pending check
>
> Linyu Yuan <[email protected]>
> usb: typec: add missing uevent when partner support PD
>
> Lucien Buchmann <[email protected]>
> USB: serial: ftdi_sio: add Belimo device ids
>
>
> -------------
>
> Diffstat:
>
> .../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 8 +-
> .../driver-api/firmware/other_interfaces.rst | 6 +
> Documentation/filesystems/netfs_library.rst | 8 +-
> Documentation/networking/ip-sysctl.rst | 4 +-
> Makefile | 4 +-
> arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 2 +-
> arch/arm/boot/dts/sama5d2.dtsi | 2 +-
> arch/arm/boot/dts/stm32mp151.dtsi | 2 +-
> arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 2 +-
> arch/arm/include/asm/domain.h | 13 --
> arch/arm/include/asm/mach/map.h | 1 +
> arch/arm/include/asm/ptrace.h | 26 +++
> arch/arm/mm/Kconfig | 6 +-
> arch/arm/mm/alignment.c | 3 +
> arch/arm/mm/mmu.c | 15 +-
> arch/arm/mm/proc-v7-bugs.c | 9 +-
> arch/arm/probes/decode.h | 26 +--
> arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi | 8 +
> arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 2 +
> arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 5 +-
> arch/powerpc/sysdev/xive/spapr.c | 5 +-
> arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 4 +
> arch/riscv/kvm/vcpu.c | 2 +
> arch/s390/Makefile | 8 +-
> arch/s390/lib/Makefile | 3 +-
> arch/s390/lib/expoline/Makefile | 3 +
> arch/s390/lib/{ => expoline}/expoline.S | 0
> arch/sh/include/asm/io.h | 8 +-
> arch/x86/include/asm/cpufeatures.h | 1 +
> arch/x86/include/asm/msr-index.h | 3 +
> arch/x86/include/asm/nospec-branch.h | 6 +
> arch/x86/include/asm/setup.h | 3 +
> arch/x86/kernel/acpi/cppc.c | 6 +
> arch/x86/kernel/cpu/amd.c | 23 +-
> arch/x86/kernel/cpu/bugs.c | 13 ++
> arch/x86/kernel/cpu/common.c | 19 ++
> arch/x86/kernel/cpu/cpu.h | 2 +
> arch/x86/kernel/cpu/hygon.c | 6 +
> arch/x86/kernel/head64.c | 4 +-
> arch/x86/kvm/emulate.c | 28 +--
> arch/x86/kvm/x86.c | 18 +-
> arch/x86/mm/init.c | 14 +-
> arch/x86/mm/mem_encrypt_boot.S | 10 +-
> arch/x86/xen/enlighten_pv.c | 8 +-
> arch/x86/xen/setup.c | 6 +-
> arch/x86/xen/xen-asm.S | 20 +-
> arch/x86/xen/xen-head.S | 11 +-
> arch/x86/xen/xen-ops.h | 6 +-
> drivers/acpi/acpi_video.c | 11 +-
> drivers/base/cpu.c | 8 +
> drivers/cpufreq/pmac32-cpufreq.c | 4 +
> drivers/firmware/sysfb.c | 58 ++++-
> drivers/firmware/sysfb_simplefb.c | 16 +-
> drivers/gpio/gpio-sim.c | 16 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 25 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 +-
> drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 +-
> drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 +-
> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 +-
> drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 3 +-
> drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 85 ++++++-
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 8 +
> .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 ++
> drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 11 +-
> drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 +
> drivers/gpu/drm/i915/display/intel_dp_mst.c | 1 +
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +-
> drivers/gpu/drm/i915/gt/intel_gt.c | 15 +-
> drivers/gpu/drm/i915/gt/intel_reset.c | 37 ++-
> drivers/gpu/drm/i915/gt/selftest_lrc.c | 8 +-
> drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 9 +
> drivers/gpu/drm/i915/gvt/cmd_parser.c | 6 +-
> drivers/gpu/drm/i915/i915_scatterlist.c | 19 +-
> drivers/gpu/drm/i915/i915_scatterlist.h | 6 +-
> drivers/gpu/drm/i915/intel_region_ttm.c | 10 +-
> drivers/gpu/drm/i915/intel_region_ttm.h | 3 +-
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> .../gpu/drm/i915/selftests/intel_memory_region.c | 21 +-
> drivers/gpu/drm/i915/selftests/mock_region.c | 3 +-
> drivers/gpu/drm/panfrost/panfrost_drv.c | 4 +-
> drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +-
> drivers/irqchip/irq-or1k-pic.c | 1 -
> drivers/net/can/xilinx_can.c | 4 +-
> .../net/ethernet/aquantia/atlantic/aq_pci_func.c | 23 +-
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +-
> drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 +
> drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 8 +-
> drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 13 +-
> drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 7 +-
> .../chelsio/inline_crypto/chtls/chtls_cm.c | 2 +-
> drivers/net/ethernet/faraday/ftgmac100.c | 15 +-
> drivers/net/ethernet/intel/ice/ice_devids.h | 1 +
> drivers/net/ethernet/intel/ice/ice_devlink.c | 59 +++--
> drivers/net/ethernet/intel/ice/ice_fw_update.c | 96 +++++++-
> drivers/net/ethernet/intel/ice/ice_main.c | 1 +
> .../ethernet/marvell/prestera/prestera_router.c | 1 +
> drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 20 +-
> .../ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c | 3 +-
> .../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 3 +-
> drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +-
> drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 39 +++-
> .../net/ethernet/mellanox/mlx5/core/esw/legacy.c | 5 +-
> drivers/net/ethernet/mscc/ocelot_fdma.c | 17 +-
> drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 33 ++-
> drivers/net/ethernet/sfc/ef10.c | 3 +
> drivers/net/ethernet/sfc/ef10_sriov.c | 10 +-
> .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 1 +
> .../net/ethernet/stmicro/stmmac/dwmac-ingenic.c | 6 +-
> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 17 +-
> drivers/net/phy/sfp.c | 2 +-
> drivers/net/xen-netback/rx.c | 1 +
> drivers/nfc/nxp-nci/i2c.c | 8 +-
> drivers/nvme/host/core.c | 8 +-
> drivers/nvme/host/nvme.h | 1 +
> drivers/nvme/host/pci.c | 3 +-
> drivers/nvme/host/rdma.c | 12 +-
> drivers/nvme/host/tcp.c | 13 +-
> drivers/nvme/host/trace.h | 2 +-
> drivers/pinctrl/aspeed/pinctrl-aspeed.c | 4 +-
> drivers/pinctrl/freescale/pinctrl-imx93.c | 1 +
> drivers/platform/x86/hp-wmi.c | 3 +
> drivers/platform/x86/intel/pmc/core.c | 1 +
> drivers/platform/x86/thinkpad_acpi.c | 50 ++---
> drivers/power/supply/power_supply_core.c | 24 +-
> drivers/s390/crypto/ap_bus.c | 2 +-
> drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 7 +
> drivers/scsi/megaraid/megaraid_sas_base.c | 3 +
> drivers/scsi/ufs/ufshcd.c | 2 +-
> drivers/soc/ixp4xx/ixp4xx-npe.c | 2 +-
> drivers/spi/spi-amd.c | 8 +
> drivers/tee/tee_core.c | 2 +-
> drivers/tty/pty.c | 14 +-
> drivers/tty/serial/8250/8250_core.c | 4 +
> drivers/tty/serial/8250/8250_port.c | 4 +-
> drivers/tty/serial/amba-pl011.c | 23 +-
> drivers/tty/serial/mvebu-uart.c | 25 ++-
> drivers/tty/serial/samsung_tty.c | 5 +-
> drivers/tty/serial/serial_core.c | 5 -
> drivers/tty/serial/stm32-usart.c | 2 +
> drivers/tty/tty.h | 3 +
> drivers/tty/tty_buffer.c | 46 +++-
> drivers/tty/vt/vt.c | 2 +-
> drivers/usb/dwc3/gadget.c | 4 +-
> drivers/usb/serial/ftdi_sio.c | 3 +
> drivers/usb/serial/ftdi_sio_ids.h | 6 +
> drivers/usb/typec/class.c | 1 +
> drivers/vdpa/mlx5/net/mlx5_vnet.c | 31 ++-
> drivers/vdpa/vdpa_user/vduse_dev.c | 60 +++--
> drivers/video/fbdev/core/fbmem.c | 12 +
> drivers/virtio/virtio_mmio.c | 26 +++
> drivers/xen/gntdev.c | 6 +-
> fs/afs/file.c | 2 +-
> fs/btrfs/inode.c | 14 +-
> fs/btrfs/zoned.c | 13 +-
> fs/ceph/addr.c | 11 +-
> fs/cifs/smb2pdu.c | 13 +-
> fs/exec.c | 2 +-
> fs/ksmbd/transport_tcp.c | 2 +-
> fs/lockd/svcsubs.c | 14 +-
> fs/netfs/buffered_read.c | 17 +-
> fs/nfsd/nfs4xdr.c | 9 +
> fs/nfsd/nfsd.h | 3 +-
> fs/nilfs2/nilfs.h | 3 +
> fs/remap_range.c | 3 +-
> include/linux/cgroup-defs.h | 3 +-
> include/linux/cpu.h | 2 +
> include/linux/kexec.h | 6 +
> include/linux/netfs.h | 2 +-
> include/linux/nvme.h | 2 +
> include/linux/reset.h | 2 +-
> include/linux/sched/task.h | 2 +-
> include/linux/serial_core.h | 5 +
> include/linux/sysfb.h | 22 +-
> include/net/netfilter/nf_conntrack.h | 9 +-
> include/net/netfilter/nf_conntrack_ecache.h | 4 +-
> include/net/netfilter/nf_tables.h | 30 ++-
> include/net/netns/conntrack.h | 1 -
> include/net/raw.h | 2 +-
> include/net/sock.h | 2 +-
> include/net/tls.h | 4 +-
> include/trace/events/sock.h | 6 +-
> kernel/cgroup/cgroup.c | 37 +--
> kernel/exit.c | 2 +-
> kernel/kexec_file.c | 11 +-
> kernel/signal.c | 8 +-
> kernel/sysctl.c | 57 ++---
> kernel/time/posix-timers.c | 19 +-
> kernel/trace/trace.c | 11 +-
> kernel/trace/trace_events_hist.c | 2 +
> mm/damon/vaddr.c | 3 +-
> mm/memory.c | 27 +--
> mm/sparse-vmemmap.c | 8 +
> mm/userfaultfd.c | 5 +-
> net/8021q/vlan_netlink.c | 10 +-
> net/bridge/br_netfilter_hooks.c | 21 +-
> net/core/filter.c | 1 -
> net/ipv4/af_inet.c | 4 +-
> net/ipv4/cipso_ipv4.c | 12 +-
> net/ipv4/fib_semantics.c | 4 +-
> net/ipv4/fib_trie.c | 2 +-
> net/ipv4/icmp.c | 20 +-
> net/ipv4/inet_timewait_sock.c | 3 +-
> net/ipv4/inetpeer.c | 12 +-
> net/ipv4/nexthop.c | 5 +-
> net/ipv4/syncookies.c | 2 +-
> net/ipv4/sysctl_net_ipv4.c | 12 +
> net/ipv4/tcp.c | 3 +-
> net/ipv4/tcp_input.c | 2 +-
> net/ipv4/tcp_output.c | 4 +-
> net/ipv6/icmp.c | 2 +-
> net/ipv6/route.c | 2 +-
> net/ipv6/seg6_iptunnel.c | 5 +-
> net/ipv6/seg6_local.c | 2 -
> net/mac80211/wme.c | 4 +-
> net/mptcp/protocol.c | 4 +-
> net/netfilter/nf_conntrack_core.c | 86 ++++---
> net/netfilter/nf_conntrack_ecache.c | 139 ++++++------
> net/netfilter/nf_conntrack_netlink.c | 125 ++++++++---
> net/netfilter/nf_conntrack_standalone.c | 3 +
> net/netfilter/nf_log_syslog.c | 8 +-
> net/netfilter/nf_tables_api.c | 72 ++++--
> net/netfilter/nf_tables_core.c | 24 +-
> net/netfilter/nf_tables_trace.c | 44 ++--
> net/tipc/socket.c | 1 +
> net/tls/tls_device.c | 4 +-
> net/tls/tls_main.c | 7 +-
> security/integrity/evm/evm_crypto.c | 7 +-
> security/integrity/ima/ima_appraise.c | 3 +-
> security/integrity/ima/ima_crypto.c | 1 +
> security/integrity/ima/ima_efi.c | 2 +
> sound/pci/hda/patch_conexant.c | 1 +
> sound/pci/hda/patch_realtek.c | 20 ++
> sound/soc/codecs/cs35l41-lib.c | 10 +-
> sound/soc/codecs/cs35l41.c | 12 +-
> sound/soc/codecs/cs47l15.c | 5 +-
> sound/soc/codecs/madera.c | 14 +-
> sound/soc/codecs/max98373-sdw.c | 12 +-
> sound/soc/codecs/rt1308-sdw.c | 11 +
> sound/soc/codecs/rt1316-sdw.c | 11 +
> sound/soc/codecs/rt5682-sdw.c | 5 +-
> sound/soc/codecs/rt700-sdw.c | 6 +-
> sound/soc/codecs/rt700.c | 14 +-
> sound/soc/codecs/rt711-sdca-sdw.c | 9 +-
> sound/soc/codecs/rt711-sdca.c | 18 +-
> sound/soc/codecs/rt711-sdw.c | 9 +-
> sound/soc/codecs/rt711.c | 16 +-
> sound/soc/codecs/rt715-sdca-sdw.c | 12 +
> sound/soc/codecs/rt715-sdw.c | 12 +
> sound/soc/codecs/sgtl5000.c | 9 +
> sound/soc/codecs/sgtl5000.h | 1 +
> sound/soc/codecs/tas2764.c | 46 ++--
> sound/soc/codecs/tas2764.h | 6 +-
> sound/soc/codecs/wcd9335.c | 8 +-
> sound/soc/codecs/wcd938x.c | 12 +
> sound/soc/codecs/wm5110.c | 8 +-
> sound/soc/codecs/wm_adsp.c | 2 +-
> sound/soc/intel/boards/bytcr_wm5102.c | 13 +-
> sound/soc/intel/boards/sof_sdw.c | 51 +++--
> sound/soc/intel/skylake/skl-nhlt.c | 40 ++--
> sound/soc/soc-dapm.c | 5 +
> sound/soc/soc-ops.c | 4 +-
> sound/soc/sof/intel/hda-dsp.c | 10 +-
> sound/soc/sof/intel/hda-loader.c | 10 +-
> sound/soc/sof/intel/hda.h | 1 +
> sound/usb/quirks-table.h | 248 +++++++++++++++++++++
> sound/usb/quirks.c | 9 +
> tools/objtool/check.c | 19 +-
> tools/testing/selftests/wireguard/qemu/Makefile | 5 +-
> .../selftests/wireguard/qemu/arch/arm.config | 1 +
> .../selftests/wireguard/qemu/arch/armeb.config | 1 +
> .../selftests/wireguard/qemu/arch/i686.config | 1 +
> .../selftests/wireguard/qemu/arch/m68k.config | 1 +
> .../selftests/wireguard/qemu/arch/mips.config | 1 +
> .../selftests/wireguard/qemu/arch/mipsel.config | 1 +
> .../selftests/wireguard/qemu/arch/powerpc.config | 1 +
> tools/testing/selftests/wireguard/qemu/init.c | 11 +
> 277 files changed, 2493 insertions(+), 955 deletions(-)
>
>
>

2022-07-20 17:25:48

by Justin Forbes

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, Jul 19, 2022 at 12:32:48PM -0700, Linus Torvalds wrote:
> On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
> <[email protected]> wrote:
> >
> >
> > Details log:
> > ------------
> > 1. i386 build failures with clang-13 and clang-14
> > make --silent --keep-going --jobs=8
> > O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
> > ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang'
> > 'CC=sccache clang'
> > ld.lld: error: undefined symbol: __udivdi3
>
> Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix
> sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix
> 32b build").
>
> > 2. Large number of build warnings on x86 with gcc-11,
> > I do not see these build warnings on mainline,
> ..
> > 'naked' return found in RETPOLINE build
>
> Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?
>
> Your build does magic things with 'scripts/kconfig/merge_config.sh',
> and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a
> compiler that doesn't actually support it, or something like that?

I am seeing these 'naked' return found in RETPOLINE build on the
standard fedora 36 toolchain as well. No cross compiling, nothing fancy.
These were not seen with mainline, or with the 5.18.12-rc1 retbleed
patches.

Justin

2022-07-20 17:39:24

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

[ Adding PeterZ and Jiri to the participants. ]

Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update
Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix
ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

That said, 3131ef39fb03 should have fixed a completely different issue
on 32-bit, not the "naked ret" thing.

PeterZ, Jiri, any ideas? Limited quoting below, see thread at

https://lore.kernel.org/all/CA+G9fYsJBBbEXowA-3kxDNqcfbtcqmxBrEnJSkCnLUsMzNfJZw@mail.gmail.com/

for more details.

Linus

On Wed, Jul 20, 2022 at 9:37 AM Justin Forbes <[email protected]> wrote:
>
> On Tue, Jul 19, 2022 at 12:32:48PM -0700, Linus Torvalds wrote:
> > On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
> > <[email protected]> wrote:
> > >
> > >
> > > 2. Large number of build warnings on x86 with gcc-11,
> > > I do not see these build warnings on mainline,
> > ..
> > > 'naked' return found in RETPOLINE build
> >
> > Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?
> >
> > Your build does magic things with 'scripts/kconfig/merge_config.sh',
> > and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a
> > compiler that doesn't actually support it, or something like that?
>
> I am seeing these 'naked' return found in RETPOLINE build on the
> standard fedora 36 toolchain as well. No cross compiling, nothing fancy.
> These were not seen with mainline, or with the 5.18.12-rc1 retbleed
> patches.
>
> Justin

2022-07-20 18:13:21

by Justin Forbes

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Wed, Jul 20, 2022 at 10:28:33AM -0700, Linus Torvalds wrote:
> [ Adding PeterZ and Jiri to the participants. ]
>
> Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update
> Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix
> ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

It should be noted that the build doesn't fail, it just warns.
I am guessing the 32bit failure is what promoted someone to look at
the logs to begin with and notice the warn initially. I just verified
that it exists in our builds of 5.18.13-rc1, but not on mainline builds.
I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline
validation") should be followed up with at least commit f43b9876e857c
("x86/retbleed: Add fine grained Kconfig knobs")

Justin

> That said, 3131ef39fb03 should have fixed a completely different issue
> on 32-bit, not the "naked ret" thing.
>
> PeterZ, Jiri, any ideas? Limited quoting below, see thread at
>
> https://lore.kernel.org/all/CA+G9fYsJBBbEXowA-3kxDNqcfbtcqmxBrEnJSkCnLUsMzNfJZw@mail.gmail.com/
>
> for more details.
>
> Linus
>
> On Wed, Jul 20, 2022 at 9:37 AM Justin Forbes <[email protected]> wrote:
> >
> > On Tue, Jul 19, 2022 at 12:32:48PM -0700, Linus Torvalds wrote:
> > > On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
> > > <[email protected]> wrote:
> > > >
> > > >
> > > > 2. Large number of build warnings on x86 with gcc-11,
> > > > I do not see these build warnings on mainline,
> > > ..
> > > > 'naked' return found in RETPOLINE build
> > >
> > > Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?
> > >
> > > Your build does magic things with 'scripts/kconfig/merge_config.sh',
> > > and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a
> > > compiler that doesn't actually support it, or something like that?
> >
> > I am seeing these 'naked' return found in RETPOLINE build on the
> > standard fedora 36 toolchain as well. No cross compiling, nothing fancy.
> > These were not seen with mainline, or with the 5.18.12-rc1 retbleed
> > patches.
> >
> > Justin

2022-07-20 19:47:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Wed, Jul 20, 2022 at 06:05:55PM +0200, Viktor J?gersk?pper wrote:
> Greg Kroah-Hartman:
> > This is the start of the stable review cycle for the 5.18.13 release.
> > There are 231 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.
>
> Hi Greg,
>
> I noticed that there are several patches in the list which are also part of your
> retbleed-5.18 queue. If I am not mistaken, these are:
>
> [PATCH 5.18 145/231] x86/kvm: Fix SETcc emulation for return thunks
> [PATCH 5.18 146/231] x86/sev: Avoid using __x86_return_thunk
> [PATCH 5.18 147/231] x86/bugs: Report AMD retbleed vulnerability
> [PATCH 5.18 148/231] objtool: Update Retpoline validation
> [PATCH 5.18 149/231] x86/xen: Rename SYS* entry points
> [PATCH 5.18 150/231] x86/cpu/amd: Add Spectral Chicken
>
> I'm wondering if this is intended or if it would be better to release a stable
> kernel with all the retbleed patches later because of the problems that came up
> with these patches so far. I'm just a user, so I can't say anything about the
> technical side, and I don't know how the patches were selected.

Yes, sorry, I need to drop those and then add them only as part of the
retbleed stuff.

thanks,

greg k-h

2022-07-20 19:48:23

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Wed, Jul 20, 2022 at 11:37:01AM -0500, Justin Forbes wrote:
> On Tue, Jul 19, 2022 at 12:32:48PM -0700, Linus Torvalds wrote:
> > On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
> > <[email protected]> wrote:
> > >
> > >
> > > Details log:
> > > ------------
> > > 1. i386 build failures with clang-13 and clang-14
> > > make --silent --keep-going --jobs=8
> > > O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
> > > ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang'
> > > 'CC=sccache clang'
> > > ld.lld: error: undefined symbol: __udivdi3
> >
> > Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix
> > sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix
> > 32b build").
> >
> > > 2. Large number of build warnings on x86 with gcc-11,
> > > I do not see these build warnings on mainline,
> > ..
> > > 'naked' return found in RETPOLINE build
> >
> > Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?
> >
> > Your build does magic things with 'scripts/kconfig/merge_config.sh',
> > and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a
> > compiler that doesn't actually support it, or something like that?
>
> I am seeing these 'naked' return found in RETPOLINE build on the
> standard fedora 36 toolchain as well. No cross compiling, nothing fancy.
> These were not seen with mainline, or with the 5.18.12-rc1 retbleed
> patches.

Ok, I think we have a few of the retbleed patches in here that shouldn't
be in there yet. Let me flush them out and then put out a new -rc
tomorrow with this all fixed up. Sasha and I got things crossed, I'll
blame the heat here in Europe and me attempting to take a few days
off...

thanks,

greg k-h

2022-07-20 22:07:04

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Wed, Jul 20, 2022 at 12:57:26PM -0500, Justin Forbes wrote:
> On Wed, Jul 20, 2022 at 10:28:33AM -0700, Linus Torvalds wrote:
> > [ Adding PeterZ and Jiri to the participants. ]
> >
> > Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update
> > Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix
> > ANNOTATE_UNRET_SAFE use on 32-bit") in that list.
>
> It should be noted that the build doesn't fail, it just warns.
> I am guessing the 32bit failure is what promoted someone to look at
> the logs to begin with and notice the warn initially. I just verified
> that it exists in our builds of 5.18.13-rc1, but not on mainline builds.
> I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline
> validation") should be followed up with at least commit f43b9876e857c
> ("x86/retbleed: Add fine grained Kconfig knobs")

Still updateing the stable repro to see what the actual code looks like,
but that warning seems to suggest the -mfunction-return=thunk-extern
compiler argument went missing.

For all the files objtool complains about, does the V=1 build output
show that option?

2022-07-20 22:29:16

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Wed, Jul 20, 2022 at 11:47:02PM +0200, Peter Zijlstra wrote:
> On Wed, Jul 20, 2022 at 12:57:26PM -0500, Justin Forbes wrote:
> > On Wed, Jul 20, 2022 at 10:28:33AM -0700, Linus Torvalds wrote:
> > > [ Adding PeterZ and Jiri to the participants. ]
> > >
> > > Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update
> > > Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix
> > > ANNOTATE_UNRET_SAFE use on 32-bit") in that list.
> >
> > It should be noted that the build doesn't fail, it just warns.
> > I am guessing the 32bit failure is what promoted someone to look at
> > the logs to begin with and notice the warn initially. I just verified
> > that it exists in our builds of 5.18.13-rc1, but not on mainline builds.
> > I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline
> > validation") should be followed up with at least commit f43b9876e857c
> > ("x86/retbleed: Add fine grained Kconfig knobs")
>
> Still updateing the stable repro to see what the actual code looks like,
> but that warning seems to suggest the -mfunction-return=thunk-extern
> compiler argument went missing.
>
> For all the files objtool complains about, does the V=1 build output
> show that option?

Ok, I'm now looking at stable-rc/linux-5.18.y which reports itself as:

VERSION = 5
PATCHLEVEL = 18
SUBLEVEL = 13
EXTRAVERSION = -rc1

and I'm most terribly confused... it has the objtool patch to validate
return thunks, *however*, I'm not seeing any actual retbleed mitigations
*anywhere*.

How, what, why!?

2022-07-21 05:41:57

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On 21. 07. 22, 0:00, Peter Zijlstra wrote:
> On Wed, Jul 20, 2022 at 11:47:02PM +0200, Peter Zijlstra wrote:
>> On Wed, Jul 20, 2022 at 12:57:26PM -0500, Justin Forbes wrote:
>>> On Wed, Jul 20, 2022 at 10:28:33AM -0700, Linus Torvalds wrote:
>>>> [ Adding PeterZ and Jiri to the participants. ]
>>>>
>>>> Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update
>>>> Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix
>>>> ANNOTATE_UNRET_SAFE use on 32-bit") in that list.
>>>
>>> It should be noted that the build doesn't fail, it just warns.
>>> I am guessing the 32bit failure is what promoted someone to look at
>>> the logs to begin with and notice the warn initially. I just verified
>>> that it exists in our builds of 5.18.13-rc1, but not on mainline builds.
>>> I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline
>>> validation") should be followed up with at least commit f43b9876e857c
>>> ("x86/retbleed: Add fine grained Kconfig knobs")
>>
>> Still updateing the stable repro to see what the actual code looks like,
>> but that warning seems to suggest the -mfunction-return=thunk-extern
>> compiler argument went missing.
>>
>> For all the files objtool complains about, does the V=1 build output
>> show that option?
>
> Ok, I'm now looking at stable-rc/linux-5.18.y which reports itself as:
>
> VERSION = 5
> PATCHLEVEL = 18
> SUBLEVEL = 13
> EXTRAVERSION = -rc1
>
> and I'm most terribly confused... it has the objtool patch to validate
> return thunks, *however*, I'm not seeing any actual retbleed mitigations
> *anywhere*.
>
> How, what, why!?

They were all put aside until all this gets resolved. You can find them
in the stable-queue tree:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git

in retbleed-5.18/.

regards,
--
js
suse labs

2022-07-21 05:54:01

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On 20. 07. 22, 19:28, Linus Torvalds wrote:
> [ Adding PeterZ and Jiri to the participants. ]
>
> Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update
> Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix
> ANNOTATE_UNRET_SAFE use on 32-bit") in that list.
>
> That said, 3131ef39fb03 should have fixed a completely different issue
> on 32-bit, not the "naked ret" thing.

Right. After applying 3131ef39fb03 on the top of 5.18.12 (or 5.18.13-rc1
too), I'm fine:
https://build.opensuse.org/public/build/Kernel:stable/standard/i586/kernel-pae/_log

I.e. no warnings at all, the kernel compiles and runs fine -- tested in
qemu only. It's gcc12 as can be seen in the log above.

Config:
https://github.com/openSUSE/kernel-source/blob/stable/config/i386/pae

It says:
CONFIG_CC_HAS_SLS=y
CONFIG_CC_HAS_RETURN_THUNK=y
CONFIG_SPECULATION_MITIGATIONS=y
CONFIG_PAGE_TABLE_ISOLATION=y
CONFIG_RETPOLINE=y
CONFIG_RETHUNK=y
CONFIG_CPU_UNRET_ENTRY=y
CONFIG_CPU_IBPB_ENTRY=y
CONFIG_CPU_IBRS_ENTRY=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y

Patches:
https://github.com/openSUSE/kernel-source/tree/stable/patches.suse

Apart from others, it contains:
3131ef39fb03 x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit
bb06650634d3 KVM: VMX: Convert launched argument to flags
bea7e31a5cac KVM: VMX: Fix IBRS handling after vmexit
8bd200d23ec4 KVM: VMX: Flatten __vmx_vcpu_run()
07853adc29a0 KVM: VMX: Prevent RSB underflow before vmenter
fc02735b14ff KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS
bf5835bcdb96 intel_idle: Disable IBRS during long idle
a09a6e2399ba objtool: Add entry UNRET validation
8faea26e6111 objtool: Re-add UNWIND_HINT_{SAVE_RESTORE}
951ddecf4356 objtool: Treat .text.__x86.* as noinstr
9bb2ec608a20 objtool: Update Retpoline validation
a149180fbcf3 x86: Add magic AMD return-thunk
15e67227c49a x86: Undo return-thunk damage
aa3d480315ba x86: Use return-thunk in asm code
d77cfe594ad5 x86/bpf: Use alternative RET encoding
7fbf47c7ce50 x86/bugs: Add AMD retbleed= boot parameter
f54d45372c6a x86/bugs: Add Cannon lake to RETBleed affected CPU list
3ebc17006888 x86/bugs: Add retbleed=ibpb
0fe4aeea9c01 x86/bugs: Do IBPB fallback check only once
2259da159fbe x86/bugs: Do not enable IBPB-on-entry when IBPB is not
supported
e8ec1b6e08a2 x86/bugs: Enable STIBP for JMP2RET
caa0ff24d5d0 x86/bugs: Keep a per-CPU IA32_SPEC_CTRL value
c779bc1a9002 x86/bugs: Optimize SPEC_CTRL MSR writes
bcf163150cd3 x86/bugs: Remove apostrophe typo
6b80b59b3555 x86/bugs: Report AMD retbleed vulnerability
6ad0ad2bf8a6 x86/bugs: Report Intel retbleed vulnerability
166115c08a9b x86/bugs: Split spectre_v2_select_mitigation() and
spectre_v2_user_select_mitigation()
7a05bc95ed1c x86/common: Stamp out the stepping madness
d7caac991fee x86/cpu/amd: Add Spectral Chicken
26aae8ccbc19 x86/cpu/amd: Enumerate BTC_NO
a883d624aed4 x86/cpufeatures: Move RETPOLINE flags to word 11
2dbb887e875b x86/entry: Add kernel IBRS implementation
7c81c0c9210c x86/entry: Avoid very early RET
64cbd0acb582 x86/entry: Don't call error_entry() for XENPV
2c08b9b38f5b x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry
ee774dac0da1 x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()
d16e0b266720 x86/entry: Remove UNTRAIN_RET from native_irq_return_ldt
1b331eeea7b8 x86/entry: Remove skip_r11rcx
520a7e80c96d x86/entry: Switch the stack after error_entry() returns
1f001e9da6bb x86/ftrace: Use alternative RET encoding
697977d8415d x86/kexec: Disable RET on kexec
af2e140f3420 x86/kvm: Fix SETcc emulation for return thunks
84e7051c0bc1 x86/kvm: fix FASTOP_SIZE when return thunks are enabled
742ab6df974a x86/kvm/vmx: Make noinstr clean
a1e2c031ec39 x86/mm: Simplify RESERVE_BRK()
d9e9d2300681 x86,objtool: Create .return_sites
f43b9876e857 x86/retbleed: Add fine grained Kconfig knobs
369ae6ffc41a x86/retpoline: Cleanup some #ifdefery
00e1533325fd x86/retpoline: Swizzle retpoline thunk
0b53c374b9ef x86/retpoline: Use -mfunction-return
0ee9073000e8 x86/sev: Avoid using __x86_return_thunk
7c693f54c873 x86/speculation: Add spectre_v2=ibrs option to support
Kernel IBRS
4ad3278df6fe x86/speculation: Disable RRSBA behavior
9756bba28470 x86/speculation: Fill RSB on vmexit for IBRS
b2620facef48 x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n
56aa4d221f1e x86/speculation: Fix SPEC_CTRL write on SMT state change
e6aa13622ea8 x86/speculation: Fix firmware entry SPEC_CTRL handling
acac5e98ef8d x86/speculation: Remove x86_spec_ctrl_mask
bbb69e8bee1b x86/speculation: Use cached host SPEC_CTRL value for guest
entry/exit
c27c753ea6fd x86/static_call: Serialize __static_call_fixup() properly
ee88d363d156 x86,static_call: Use alternative RET encoding
0aca53c6b522 x86/traps: Use pt_regs directly in fixup_bad_iret()
15583e514eb1 x86/vsyscall_emu/64: Don't use RET in vsyscall emulation
d147553b64ba x86/xen: Add UNTRAIN_RET
b75b7f8ef114 x86/xen: Rename SYS* entry points

Series file:
https://github.com/openSUSE/kernel-source/blob/stable/series.conf

> PeterZ, Jiri, any ideas? Limited quoting below, see thread at
>
> https://lore.kernel.org/all/CA+G9fYsJBBbEXowA-3kxDNqcfbtcqmxBrEnJSkCnLUsMzNfJZw@mail.gmail.com/
>
> for more details.
>
> Linus
>
> On Wed, Jul 20, 2022 at 9:37 AM Justin Forbes <[email protected]> wrote:
>>
>> On Tue, Jul 19, 2022 at 12:32:48PM -0700, Linus Torvalds wrote:
>>> On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
>>> <[email protected]> wrote:
>>>>
>>>>
>>>> 2. Large number of build warnings on x86 with gcc-11,
>>>> I do not see these build warnings on mainline,
>>> ..
>>>> 'naked' return found in RETPOLINE build
>>>
>>> Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?
>>>
>>> Your build does magic things with 'scripts/kconfig/merge_config.sh',
>>> and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a
>>> compiler that doesn't actually support it, or something like that?
>>
>> I am seeing these 'naked' return found in RETPOLINE build on the
>> standard fedora 36 toolchain as well. No cross compiling, nothing fancy.
>> These were not seen with mainline, or with the 5.18.12-rc1 retbleed
>> patches.
>>
>> Justin

regards,
--
js
suse labs

2022-07-21 06:30:53

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On 21. 07. 22, 7:31, Jiri Slaby wrote:
> On 21. 07. 22, 0:00, Peter Zijlstra wrote:
>> On Wed, Jul 20, 2022 at 11:47:02PM +0200, Peter Zijlstra wrote:
>>> On Wed, Jul 20, 2022 at 12:57:26PM -0500, Justin Forbes wrote:
>>>> On Wed, Jul 20, 2022 at 10:28:33AM -0700, Linus Torvalds wrote:
>>>>> [ Adding PeterZ and Jiri to the participants. ]
>>>>>
>>>>> Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update
>>>>> Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix
>>>>> ANNOTATE_UNRET_SAFE use on 32-bit") in that list.
>>>>
>>>> It should be noted that the build doesn't fail, it just warns.
>>>> I am guessing the 32bit failure is what promoted someone to look at
>>>> the logs to begin with and notice the warn initially. I just verified
>>>> that it exists in our builds of 5.18.13-rc1, but not on mainline
>>>> builds.
>>>> I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update
>>>> Retpoline
>>>> validation") should be followed up with at least commit f43b9876e857c
>>>> ("x86/retbleed: Add fine grained Kconfig knobs")
>>>
>>> Still updateing the stable repro to see what the actual code looks like,
>>> but that warning seems to suggest the -mfunction-return=thunk-extern
>>> compiler argument went missing.
>>>
>>> For all the files objtool complains about, does the V=1 build output
>>> show that option?
>>
>> Ok, I'm now looking at stable-rc/linux-5.18.y which reports itself as:
>>
>> VERSION = 5
>> PATCHLEVEL = 18
>> SUBLEVEL = 13
>> EXTRAVERSION = -rc1
>>
>> and I'm most terribly confused... it has the objtool patch to validate
>> return thunks, *however*, I'm not seeing any actual retbleed mitigations
>> *anywhere*.
>>
>> How, what, why!?
>
> They were all put aside until all this gets resolved. You can find them
> in the stable-queue tree:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git
>
> in retbleed-5.18/.

Ah, apparently not all, as you noted above. But this is obviously a mistake:
https://lore.kernel.org/all/[email protected]/

> regards,--
--
js
suse labs

2022-07-21 06:33:01

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On 21. 07. 22, 7:42, Jiri Slaby wrote:
> Config:
> https://github.com/openSUSE/kernel-source/blob/stable/config/i386/pae
>
> It says:
> CONFIG_CC_HAS_SLS=y
> CONFIG_CC_HAS_RETURN_THUNK=y
> CONFIG_SPECULATION_MITIGATIONS=y
> CONFIG_PAGE_TABLE_ISOLATION=y
> CONFIG_RETPOLINE=y
> CONFIG_RETHUNK=y
> CONFIG_CPU_UNRET_ENTRY=y
> CONFIG_CPU_IBPB_ENTRY=y
> CONFIG_CPU_IBRS_ENTRY=y
> CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
>
> Patches:
> https://github.com/openSUSE/kernel-source/tree/stable/patches.suse
>
> Apart from others, it contains:
> 3131ef39fb03 x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit
...
> b75b7f8ef114 x86/xen: Rename SYS* entry points

Thinking about it, that's likely the reason I'm not seeing any failures
-- I still carry all the retbleed patches on the top of stable. So while
5.18.12-rc1 (the retbleed one) had them and added the above configs,
later 5.18.12-rc/-final (only rawnand fixup), or 5.18.13-rc1 do not --
the configs are gone.

regards,
--
js

2022-07-21 07:07:04

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Thu, Jul 21, 2022 at 08:58:47AM +0200, Jiri Slaby wrote:
> On 21. 07. 22, 8:05, Jiri Slaby wrote:
> > Thinking about it, that's likely the reason I'm not seeing any failures
> > -- I still carry all the retbleed patches on the top of stable. So while
>
> Confirmed. So I assume this gets fixed once the rest of retbleed patches is
> dropped from 5.18.13-rc1.

Yes, let me fix this all up, sorry for the mess...

2022-07-21 07:53:41

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On 21. 07. 22, 8:05, Jiri Slaby wrote:
> Thinking about it, that's likely the reason I'm not seeing any failures
> -- I still carry all the retbleed patches on the top of stable. So while

Confirmed. So I assume this gets fixed once the rest of retbleed patches
is dropped from 5.18.13-rc1.

regards,
--
js

2022-07-21 18:57:10

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, Jul 19, 2022 at 05:33:48PM +0200, Ronald Warsow wrote:
> hallo Greg
>
> 5.18.13-rc1
>
> compiles here with a lot of warnings on an x86_64
> (Intel i5-11400, Fedora 36)
>
> warnings all over the tree like this:
> ...
> arch/x86/crypto/twofish-x86_64-asm_64.o: warning: objtool:
> twofish_enc_blk()+0x7b2: 'naked' return found in RETPOLINE build
> arch/x86/crypto/twofish-x86_64-asm_64.o: warning: objtool:
> twofish_dec_blk()+0x7b2: 'naked' return found in RETPOLINE build
> ...
>
> patch was applied to an clean 5.18.12
>
> is it just me ?

Should now be resolved in -rc3. If not, please let me know.

2022-07-21 18:58:37

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 5.18 000/231] 5.18.13-rc1 review

On Tue, Jul 19, 2022 at 12:32:48PM -0700, Linus Torvalds wrote:
> On Tue, Jul 19, 2022 at 10:57 AM Naresh Kamboju
> <[email protected]> wrote:
> >
> >
> > Details log:
> > ------------
> > 1. i386 build failures with clang-13 and clang-14
> > make --silent --keep-going --jobs=8
> > O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
> > ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang'
> > 'CC=sccache clang'
> > ld.lld: error: undefined symbol: __udivdi3
>
> Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix
> sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix
> 32b build").

Thanks, I've queued this one up now in the -rc3 update.

greg k-h