6.12.64-rc1 review
Subsystems (4)
Greg Kroah-Hartman
maintainercover 6.12.64-rc1 review
This is the start of the stable review cycle for the 6.12.64 release. There are 567 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, 08 Jan 2026 17:03:16 +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/v6.x/stable-review/patch-6.12.64-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-6.12.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.12.64-rc1
Damien Le Moal <[email protected]>
block: fix NULL pointer dereference in blk_zone_reset_all_bio_endio()
Christoph Hellwig <[email protected]>
iomap: allocate s_dio_done_wq for async reads as well
SeongJae Park <[email protected]>
mm/damon/tests/vaddr-kunit: handle alloc failures on damon_do_test_apply_three_regions()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failres in damon_test_new_filter()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failures on damon_test_split_regions_of()
Kevin Tian <[email protected]>
vfio/pci: Disable qword access to the PCI ROM bar
Ming Qian <[email protected]>
media: amphion: Remove vpu_vb_is_codecconfig
Laurent Pinchart <[email protected]>
media: amphion: Make some vpu_v4l2 functions static
Ming Qian <[email protected]>
media: amphion: Add a frame flush mode for decoder
Chen-Yu Tsai <[email protected]>
media: mediatek: vcodec: Use spinlock for context list protection lock
David Hildenbrand <[email protected]>
powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages
David Hildenbrand <[email protected]>
mm/balloon_compaction: convert balloon_page_delete() to balloon_page_finalize()
David Hildenbrand <[email protected]>
mm/balloon_compaction: we cannot have isolated pages in the balloon list
Jim Quinlan <[email protected]>
PCI: brcmstb: Fix disabling L0s capability
Jim Quinlan <[email protected]>
PCI: brcmstb: Set MLW based on "num-lanes" DT property if present
Stanimir Varbanov <[email protected]>
PCI: brcmstb: Reuse pcie_cfg_data structure
Biju Das <[email protected]>
ASoC: renesas: rz-ssi: Fix rz_ssi_priv::hw_params_cache::sample_width
Srinivas Kandagatla <[email protected]>
ASoC: qcom: sdw: fix memory leak for sdw_stream_runtime
Pierre-Louis Bossart <[email protected]>
soundwire: stream: extend sdw_alloc_stream() to take 'type' parameter
Damien Le Moal <[email protected]>
block: handle zone management operations completions
Biju Das <[email protected]>
ASoC: renesas: rz-ssi: Fix channel swap issue in full duplex mode
Ankit Garg <[email protected]>
gve: defer interrupt enabling until NAPI registration
Thomas Gleixner <[email protected]>
hrtimers: Make hrtimer_update_function() less expensive
Joshua Hay <[email protected]>
idpf: remove obsolete stashing code
Joshua Hay <[email protected]>
idpf: stop Tx if there are insufficient buffer resources
Joshua Hay <[email protected]>
idpf: replace flow scheduling buffer ring with buffer pool
Joshua Hay <[email protected]>
idpf: simplify and fix splitq Tx packet rollback error path
Joshua Hay <[email protected]>
idpf: improve when to set RE bit logic
Joshua Hay <[email protected]>
idpf: add support for Tx refillqs in flow scheduling mode
Joshua Hay <[email protected]>
idpf: trigger SW interrupt when exiting wb_on_itr mode
Joshua Hay <[email protected]>
idpf: add support for SW triggered interrupts
Quan Zhou <[email protected]>
wifi: mt76: mt7925: add handler to hif suspend/resume event
Quan Zhou <[email protected]>
wifi: mt76: mt7925: fix CLC command timeout when suspend/resume
Quan Zhou <[email protected]>
wifi: mt76: mt7925: fix the unfinished command of regd_notifier before suspend
Dave Stevenson <[email protected]>
media: i2c: imx219: Fix 1920x1080 mode to use 1:1 pixel aspect ratio
Borislav Petkov (AMD) <[email protected]>
x86/microcode/AMD: Select which microcode patch to load
Jiri Slaby (SUSE) <[email protected]>
tty: fix tty_port_tty_*hangup() kernel-doc
Alexander Stein <[email protected]>
serial: core: Fix serial device initialization
Zqiang <[email protected]>
usbnet: Fix using smp_processor_id() in preemptible code warnings
Eric Dumazet <[email protected]>
net: use dst_dev_rcu() in sk_setup_caps()
Eric Dumazet <[email protected]>
ipv6: adopt dst_dev() helper
Justin Iurman <[email protected]>
net: ipv6: ioam6: use consistent dst names
Boris Brezillon <[email protected]>
drm/panthor: Flush shmem writes before mapping buffers CPU-uncached
Xiao Ni <[email protected]>
md/raid10: wait barrier before returning discard request with REQ_NOWAIT
Andrii Melnychenko <[email protected]>
netfilter: nft_ct: add seqadj extension for natted connections
Askar Safin <[email protected]>
gpiolib: acpi: Add quirk for Dell Precision 7780
Mario Limonciello (AMD) <[email protected]>
gpiolib: acpi: Add quirk for ASUS ProArt PX13
Mario Limonciello <[email protected]>
gpiolib: acpi: Add a quirk for Acer Nitro V15
Andy Shevchenko <[email protected]>
gpiolib: acpi: Move quirks to a separate file
Andy Shevchenko <[email protected]>
gpiolib: acpi: Add acpi_gpio_need_run_edge_events_on_boot() getter
Andy Shevchenko <[email protected]>
gpiolib: acpi: Handle deferred list via new API
Andy Shevchenko <[email protected]>
gpiolib: acpi: Switch to use enum in acpi_gpio_in_ignore_list()
Chao Yu <[email protected]>
f2fs: fix to propagate error from f2fs_enable_checkpoint()
Chao Yu <[email protected]>
f2fs: dump more information for f2fs_{enable,disable}_checkpoint()
Chao Yu <[email protected]>
f2fs: add timeout in f2fs_enable_checkpoint()
Sheng Yong <[email protected]>
f2fs: clear SBI_POR_DOING before initing inmem curseg
j.turek <[email protected]>
serial: xilinx_uartps: fix rs485 delay_rts_after_send
Nam Cao <[email protected]>
serial: xilinx_uartps: Use helper function hrtimer_update_function()
Nam Cao <[email protected]>
hrtimers: Introduce hrtimer_update_function()
Jani Nikula <[email protected]>
drm/displayid: add quirk to ignore DisplayID checksum errors
Tejun Heo <[email protected]>
sched_ext: Fix missing post-enqueue handling in move_local_task_to_local_dsq()
Tejun Heo <[email protected]>
sched_ext: Factor out local_dsq_post_enq() from dispatch_enqueue()
Jarkko Sakkinen <[email protected]>
tpm2-sessions: Fix tpm2_read_public range checks
Damien Le Moal <[email protected]>
block: freeze queue when updating zone resources
Nicolas Ferre <[email protected]>
ARM: dts: microchip: sama7g5: fix uart fifo size to 32
Joshua Rogers <[email protected]>
svcrdma: bound check rq_pages index in inline path
xu xin <[email protected]>
mm/ksm: fix exec/fork inheritance support for prctl
Matthieu Baerts (NGI0) <[email protected]>
mptcp: pm: ignore unknown endpoint flags
Andy Shevchenko <[email protected]>
serial: core: Restore sysfs fwnode information
Johan Hovold <[email protected]>
serial: core: fix OF node leak
Chao Yu <[email protected]>
f2fs: fix to avoid updating compression context during writeback
Jaegeuk Kim <[email protected]>
f2fs: drop inode from the donation list when the last file is closed
Chao Yu <[email protected]>
f2fs: use global inline_xattr_slab instead of per-sb slab cache
Chao Yu <[email protected]>
f2fs: fix to detect recoverable inode during dryrun of find_fsync_dnodes()
Łukasz Bartosik <[email protected]>
xhci: dbgtty: fix device unregister: fixup
Jiri Slaby (SUSE) <[email protected]>
tty: introduce and use tty_port_tty_vhangup() helper
Ye Bin <[email protected]>
jbd2: fix the inconsistency between checksum and data in memory for journal sb
Zqiang <[email protected]>
sched_ext: Fix incorrect sched_class settings for per-cpu migration tasks
Junbeom Yeom <[email protected]>
erofs: fix unexpected EIO under memory pressure
Peter Zijlstra <[email protected]>
sched/eevdf: Fix min_vruntime vs avg_vruntime
Josef Bacik <[email protected]>
btrfs: don't rewrite ret from inode_permission
Alexey Velichayshiy <[email protected]>
gfs2: fix freeze error handling
Vivian Wang <[email protected]>
lib/crypto: riscv/chacha: Avoid s0/fp register
Alessio Belle <[email protected]>
drm/imagination: Disallow exporting of PM/FW protected objects
Lyude Paul <[email protected]>
drm/nouveau/dispnv50: Don't call drm_atomic_get_crtc_state() in prepare_fb
Krzysztof Niemiec <[email protected]>
drm/i915/gem: Zero-initialize the eb.vma array in i915_gem_do_execbuffer
Nikolay Kuratov <[email protected]>
drm/msm/dpu: Add missing NULL pointer check for pingpong interface
Thomas Hellström <[email protected]>
drm/xe: Drop preempt-fences when destroying imported dma-bufs.
Matthew Brost <[email protected]>
drm/xe: Use usleep_range for accurate long-running workload timeslicing
Matthew Brost <[email protected]>
drm/xe: Adjust long-running workload timeslices to reasonable values
Ashutosh Dixit <[email protected]>
drm/xe/oa: Disallow 0 OA property values
Thomas Hellström <[email protected]>
drm/xe/bo: Don't include the CCS metadata in the dma-buf sg-table
René Rebe <[email protected]>
drm/mgag200: Fix big-endian support
Simon Richter <[email protected]>
drm/ttm: Avoid NULL pointer deref for evicted BOs
Ard Biesheuvel <[email protected]>
drm/i915: Fix format string truncation warning
Jay Cornwall <[email protected]>
drm/amdkfd: Trap handler support for expert scheduling mode
Jonathan Kim <[email protected]>
drm/amdkfd: bump minimum vgpr size for gfx1151
Mario Limonciello <[email protected]>
drm/amdkfd: Export the cwsr_size and ctl_stack_size to userspace
Johan Hovold <[email protected]>
drm/mediatek: Fix probe device leaks
Johan Hovold <[email protected]>
drm/mediatek: Fix probe memory leak
Johan Hovold <[email protected]>
drm/mediatek: Fix probe resource leaks
Miaoqian Lin <[email protected]>
drm/mediatek: Fix device node reference leak in mtk_dp_dt_parse()
Sanjay Yadav <[email protected]>
drm/xe/oa: Fix potential UAF in xe_oa_add_config_ioctl()
Jani Nikula <[email protected]>
drm/edid: add DRM_EDID_IDENT_INIT() to initialize struct drm_edid_ident
Thomas Zimmermann <[email protected]>
drm/gma500: Remove unused helper psb_fbdev_fb_setcolreg()
Arunpravin Paneer Selvam <[email protected]>
drm/buddy: Separate clear and dirty free block trees
Arunpravin Paneer Selvam <[email protected]>
drm/buddy: Optimize free block management with RB tree
Akhil P Oommen <[email protected]>
drm/msm/a6xx: Fix out of bound IO access in a6xx_get_gmu_registers
Alex Deucher <[email protected]>
drm/amdgpu/gmc11: add amdgpu_vm_handle_fault() handling
Pierre-Eric Pelloux-Prayer <[email protected]>
drm/amdgpu: add missing lock to amdgpu_ttm_access_memory_sdma
Alex Deucher <[email protected]>
drm/amdgpu/gmc12: add amdgpu_vm_handle_fault() handling
Mario Limonciello (AMD) <[email protected]>
Revert "drm/amd: Skip power ungate during suspend for VPE"
Xiaolei Wang <[email protected]>
net: macb: Relocate mog_init_rings() callback from macb_mac_link_up() to macb_open()
Deepanshu Kartikey <[email protected]>
net: nfc: fix deadlock between nfc_unregister_device and rfkill_fop_write
Ethan Nelson-Moore <[email protected]>
net: usb: sr9700: fix incorrect command used to write single register
Haoxiang Li <[email protected]>
nfsd: Drop the client reference in client_states_open()
Hengqi Chen <[email protected]>
LoongArch: BPF: Sign extend kfunc call arguments
Hengqi Chen <[email protected]>
LoongArch: BPF: Zero-extend bpf_tail_call() index
Chenghao Duan <[email protected]>
LoongArch: Refactor register restoration in ftrace_common_return
Haoxiang Li <[email protected]>
fjes: Add missing iounmap in fjes_hw_init()
Guangshuo Li <[email protected]>
e1000: fix OOB in e1000_tbi_should_accept()
Jason Gunthorpe <[email protected]>
RDMA/cm: Fix leaking the multicast GID table reference
Jason Gunthorpe <[email protected]>
RDMA/core: Check for the presence of LS_NLA_TYPE_DGID correctly
Chenghao Duan <[email protected]>
samples/ftrace: Adjust LoongArch register restore order in direct calls
Kaushlendra Kumar <[email protected]>
tools/mm/page_owner_sort: fix timestamp comparison for stable sorting
Rong Zhang <[email protected]>
x86/microcode/AMD: Fix Entrysign revision check for Zen5/Strix Halo
Ran Xiaokai <[email protected]>
mm/page_owner: fix memory leak in page_owner_stack_fops->release()
Matthew Wilcox (Oracle) <[email protected]>
idr: fix idr_alloc() returning an ID out of range
NeilBrown <[email protected]>
lockd: fix vfs_test_lock() calls
Maciej Wieczor-Retman <[email protected]>
kasan: unpoison vms[area] addresses with a common tag
Maciej Wieczor-Retman <[email protected]>
kasan: refactor pcpu kasan vmalloc unpoison
Jiayuan Chen <[email protected]>
mm/kasan: fix incorrect unpoisoning in vrealloc for KASAN
H. Peter Anvin <[email protected]>
compiler_types.h: add "auto" as a macro for "__auto_type"
Wentao Liang <[email protected]>
pmdomain: imx: Fix reference count leak in imx_gpc_probe()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failure on damon_test_set_attrs()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failures in damon_test_ops_registration()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failures in damon_test_update_monitoring_result()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failures in damon_test_set_regions()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failures on damon_test_merge_two()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failures on dasmon_test_merge_regions_of()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle memory alloc failure from damon_test_aggregate()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle memory failure from damon_test_target()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle allocation failures in damon_test_regions()
SeongJae Park <[email protected]>
mm/damon/tests/core-kunit: handle alloc failures on damon_test_split_at()
SeongJae Park <[email protected]>
mm/damon/tests/vaddr-kunit: handle alloc failures on damon_test_split_evenly_succ()
SeongJae Park <[email protected]>
mm/damon/tests/vaddr-kunit: handle alloc failures in damon_test_split_evenly_fail()
SeongJae Park <[email protected]>
mm/damon/tests/sysfs-kunit: handle alloc failures on damon_sysfs_test_add_targets()
Tiezhu Yang <[email protected]>
LoongArch: Use unsigned long for _end and _text
WangYuli <[email protected]>
LoongArch: Use __pmd()/__pte() for swap entry conversions
Huacai Chen <[email protected]>
LoongArch: Fix build errors for CONFIG_RANDSTRUCT
Qiang Ma <[email protected]>
LoongArch: Correct the calculation logic of thread_count
Huacai Chen <[email protected]>
LoongArch: Add new PCI ID for pci_fixup_vgadev()
Haoxiang Li <[email protected]>
media: mediatek: vcodec: Fix a reference leak in mtk_vcodec_fw_vpu_init()
Duoming Zhou <[email protected]>
media: i2c: adv7842: Remove redundant cancel_delayed_work in probe
Duoming Zhou <[email protected]>
media: i2c: ADV7604: Remove redundant cancel_delayed_work in probe
Ming Qian <[email protected]>
media: amphion: Cancel message work before releasing the VPU core
Johan Hovold <[email protected]>
media: vpif_display: fix section mismatch
Johan Hovold <[email protected]>
media: vpif_capture: fix section mismatch
Haotian Zhang <[email protected]>
media: videobuf2: Fix device reference leak in vb2_dc_alloc error path
Nicolas Dufresne <[email protected]>
media: verisilicon: Protect G2 HEVC decoder against invalid DPB index
Duoming Zhou <[email protected]>
media: TDA1997x: Remove redundant cancel_delayed_work in probe
Marek Szyprowski <[email protected]>
media: samsung: exynos4-is: fix potential ABBA deadlock on init
Miaoqian Lin <[email protected]>
media: renesas: rcar_drif: fix device node reference leak in rcar_drif_bond_enabled
Johan Hovold <[email protected]>
media: platform: mtk-mdp3: fix device leaks at probe
Ivan Abramov <[email protected]>
media: msp3400: Avoid possible out-of-bounds array accesses in msp3400c_thread()
Haotian Zhang <[email protected]>
media: cec: Fix debugfs leak on bus_register() failure
René Rebe <[email protected]>
fbdev: tcx.c fix mem_map to correct smem_start offset
Thorsten Blum <[email protected]>
fbdev: pxafb: Fix multiple clamped values in pxafb_adjust_timing
Rene Rebe <[email protected]>
fbdev: gbefb: fix to use physical address instead of dma address
Mikulas Patocka <[email protected]>
dm-bufio: align write boundary on physical block size
Uladzislau Rezki (Sony) <[email protected]>
dm-ebs: Mark full buffer dirty even on partial write
Mahesh Rao <[email protected]>
firmware: stratix10-svc: Add mutex in stratix10 memory management
Ivan Abramov <[email protected]>
media: adv7842: Avoid possible out-of-bounds array accesses in adv7842_cp_log_status()
David Hildenbrand <[email protected]>
powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION
Sandipan Das <[email protected]>
perf/x86/amd/uncore: Fix the return value of amd_uncore_df_event_init() on error
Sven Schnelle <[email protected]>
parisc: entry: set W bit for !compat tasks in syscall_restore_rfi()
Sven Schnelle <[email protected]>
parisc: entry.S: fix space adjustment on interruption for 64-bit userspace
Miquel Raynal <[email protected]>
mtd: spi-nor: winbond: Add support for W25H02NWxxAM chips
Miquel Raynal <[email protected]>
mtd: spi-nor: winbond: Add support for W25H01NWxxAM chips
Miquel Raynal <[email protected]>
mtd: spi-nor: winbond: Add support for W25H512NWxxAM chips
Miquel Raynal <[email protected]>
mtd: spi-nor: winbond: Add support for W25Q02NWxxIM chips
Miquel Raynal <[email protected]>
mtd: spi-nor: winbond: Add support for W25Q01NWxxIM chips
Miquel Raynal <[email protected]>
mtd: spi-nor: winbond: Add support for W25Q01NWxxIQ chips
Christian Marangi <[email protected]>
mtd: mtdpart: ignore error -ENOENT from parsers on subpartitions
Nicolas Dufresne <[email protected]>
media: verisilicon: Fix CPU stalls on G2 bus error
Haotian Zhang <[email protected]>
media: rc: st_rc: Fix reset control resource leak
Krzysztof Kozlowski <[email protected]>
mfd: max77620: Fix potential IRQ chip conflict when probing two devices
Johan Hovold <[email protected]>
mfd: altera-sysmgr: Fix device leak on sysmgr regmap lookup
Nathan Chancellor <[email protected]>
clk: samsung: exynos-clkout: Assign .num before accessing .hws
Damien Le Moal <[email protected]>
block: Clear BLK_ZONE_WPLUG_PLUGGED when aborting plugged BIOs
Christian Hitz <[email protected]>
leds: leds-lp50xx: Enable chip before any communication
Christian Hitz <[email protected]>
leds: leds-lp50xx: LP5009 supports 3 modules for a total of 9 LEDs
Christian Hitz <[email protected]>
leds: leds-lp50xx: Allow LED 0 to be added to module bank
Thomas Weißschuh <[email protected]>
leds: leds-cros_ec: Skip LEDs without color components
Donet Tom <[email protected]>
powerpc/64s/slb: Fix SLB multihit issue during SLB preload
Dave Vasilevsky <[email protected]>
powerpc, mm: Fix mprotect on book3s 32-bit
Siddharth Vadapalli <[email protected]>
arm64: dts: ti: k3-j721e-sk: Fix pinmux for pin Y1 used by power regulator
Lukas Wunner <[email protected]>
PCI/PM: Reinstate clearing state_saved in legacy and !PM codepaths
Shengming Hu <[email protected]>
fgraph: Check ftrace_pids_enabled on registration for early filtering
Shengming Hu <[email protected]>
fgraph: Initialize ftrace_ops->private for function graph ops
Hans de Goede <[email protected]>
HID: logitech-dj: Remove duplicate error logging
Lu Baolu <[email protected]>
iommu: disable SVA when CONFIG_X86 is set
Johan Hovold <[email protected]>
iommu/tegra: fix device leak on probe_device()
Johan Hovold <[email protected]>
iommu/sun50i: fix device leak on of_xlate()
Johan Hovold <[email protected]>
iommu/qcom: fix device leak on of_xlate()
Johan Hovold <[email protected]>
iommu/omap: fix device leaks on probe_device()
Johan Hovold <[email protected]>
iommu/mediatek: fix device leak on of_xlate()
Johan Hovold <[email protected]>
iommu/mediatek-v1: fix device leaks on probe()
Johan Hovold <[email protected]>
iommu/mediatek-v1: fix device leak on probe_device()
Johan Hovold <[email protected]>
iommu/ipmmu-vmsa: fix device leak on of_xlate()
Johan Hovold <[email protected]>
iommu/exynos: fix device leak on of_xlate()
Johan Hovold <[email protected]>
iommu/apple-dart: fix device leak on of_xlate()
Jinhui Guo <[email protected]>
iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()
Jinhui Guo <[email protected]>
iommu/amd: Fix pci_segment memleak in alloc_pci_segment()
Srinivas Kandagatla <[email protected]>
ASoC: qcom: qdsp6: q6asm-dai: set 10 ms period and buffer alignment.
Srinivas Kandagatla <[email protected]>
ASoC: qcom: q6adm: the the copp device only during last instance
Srinivas Kandagatla <[email protected]>
ASoC: qcom: q6asm-dai: perform correct state check before closing
Srinivas Kandagatla <[email protected]>
ASoC: qcom: q6apm-dai: set flags to reflect correct operation of appl_ptr
Srinivas Kandagatla <[email protected]>
ASoC: codecs: lpass-tx-macro: fix SM6115 support
Johan Hovold <[email protected]>
ASoC: stm32: sai: fix OF node leak on probe
Johan Hovold <[email protected]>
ASoC: stm32: sai: fix clk prepare imbalance on probe failure
Johan Hovold <[email protected]>
ASoC: stm32: sai: fix device leak on probe
Johan Hovold <[email protected]>
ASoC: codecs: wcd939x: fix regmap leak on probe failure
Matthew Wilcox (Oracle) <[email protected]>
ntfs: Do not overwrite uptodate pages
Yipeng Zou <[email protected]>
selftests/ftrace: traceonoff_triggers: strip off names
Cong Zhang <[email protected]>
blk-mq: skip CPU offline notify on unmapped hctx
Thomas Fourier <[email protected]>
RDMA/bnxt_re: fix dma_free_coherent() pointer
Honggang LI <[email protected]>
RDMA/rtrs: Fix clt_path::max_pages_per_mr calculation
Zilin Guan <[email protected]>
ksmbd: Fix memory leak in get_file_all_info()
Tuo Li <[email protected]>
md/raid5: fix possible null-pointer dereferences in raid5_store_group_thread_cnt()
Li Nan <[email protected]>
md: Fix static checker warning in analyze_sbs
Kalesh AP <[email protected]>
RDMA/bnxt_re: Fix to use correct page size for PDE table
Alok Tiwari <[email protected]>
RDMA/bnxt_re: Fix IB_SEND_IP_CSUM handling in post_send
Tetsuo Handa <[email protected]>
RDMA/core: always drop device refcount in ib_del_sub_device_and_put()
Alok Tiwari <[email protected]>
RDMA/bnxt_re: Fix incorrect BAR check in bnxt_qplib_map_creq_db()
Jang Ingyu <[email protected]>
RDMA/core: Fix logic error in ib_get_gids_from_rdma_hdr()
Michael Margolin <[email protected]>
RDMA/efa: Remove possible negative shift
Michal Schmidt <[email protected]>
RDMA/irdma: avoid invalid read in irdma_net_event
Jiayuan Chen <[email protected]>
ipv6: fix a BUG in rt6_get_pcpu_route() under PREEMPT_RT
Pwnverse <[email protected]>
net: rose: fix invalid array index in rose_kill_by_device()
Ido Schimmel <[email protected]>
ipv4: Fix reference count leak when using error routes with nexthop objects
Will Rosenberg <[email protected]>
ipv6: BUG() in pskb_expand_head() as part of calipso_skbuff_setattr()
Wei Fang <[email protected]>
net: stmmac: fix the crash issue for zero copy XDP_TX action
Anshumali Gaur <[email protected]>
octeontx2-pf: fix "UBSAN: shift-out-of-bounds error"
Junrui Luo <[email protected]>
platform/x86: hp-bioscfg: Fix out-of-bounds array access in ACPI package parsing
Zilin Guan <[email protected]>
vfio/pds: Fix memory leak in pds_vfio_dirty_enable()
Bagas Sanjaya <[email protected]>
net: bridge: Describe @tunnel_hash member in net_bridge_vlan_group struct
Deepanshu Kartikey <[email protected]>
net: usb: asix: validate PHY address before use
Thomas De Schampheleire <[email protected]>
kbuild: fix compilation of dtb specified on command-line without make rule
Jonas Gorski <[email protected]>
net: dsa: b53: skip multicast entries for fdb_dump()
Thomas Fourier <[email protected]>
firewire: nosy: Fix dma_free_coherent() size
Andrew Morton <[email protected]>
genalloc.h: fix htmldocs warning
Yeoreum Yun <[email protected]>
smc91x: fix broken irq-context in PREEMPT_RT
Alice C. Munduruca <[email protected]>
selftests: net: fix "buffer overflow detected" for tap.c
Deepakkumar Karn <[email protected]>
net: usb: rtl8150: fix memory leak on usb_submit_urb() failure
Raju Rangoju <[email protected]>
amd-xgbe: reset retries and mode on RX adapt failures
Vladimir Oltean <[email protected]>
net: dsa: fix missing put_device() in dsa_tree_find_first_conduit()
Jiri Pirko <[email protected]>
team: fix check for port enabled in team_queue_override_port_prio_changed()
Junrui Luo <[email protected]>
platform/x86: ibm_rtl: fix EBDA signature search pointer arithmetic
Thomas Fourier <[email protected]>
platform/x86: msi-laptop: add missing sysfs_remove_group()
Shravan Kumar Ramani <[email protected]>
platform/mellanox: mlxbf-pmc: Remove trailing whitespaces from event names
Eric Dumazet <[email protected]>
ip6_gre: make ip6gre_header() robust
Toke Høiland-Jørgensen <[email protected]>
net: openvswitch: Avoid needlessly taking the RTNL on vport destroy
Jacky Chou <[email protected]>
net: mdio: aspeed: add dummy read to avoid read-after-write issue
Raphael Pinsonneault-Thibeault <[email protected]>
Bluetooth: btusb: revert use of devm_kzalloc in btusb
Herbert Xu <[email protected]>
crypto: seqiv - Do not use req->iv after crypto_aead_encrypt
Brian Vazquez <[email protected]>
idpf: reduce mbx_task schedule delay to 300us
Kohei Enju <[email protected]>
iavf: fix off-by-one issues in iavf_config_rss_reg()
Gregory Herrero <[email protected]>
i40e: validate ring_len parameter against hardware-specific values
Przemyslaw Korba <[email protected]>
i40e: fix scheduling in set_rx_mode
Aloka Dixit <[email protected]>
wifi: mac80211: do not use old MBSSID elements
Dan Carpenter <[email protected]>
wifi: cfg80211: sme: store capped length in __cfg80211_connect_result()
Morning Star <[email protected]>
wifi: rtlwifi: 8192cu: fix tid out of range in rtl92cu_tx_fill_desc()
Ping-Ke Shih <[email protected]>
wifi: rtw88: limit indirect IO under powered off for RTL8822CS
Joanne Koong <[email protected]>
fuse: fix readahead reclaim deadlock
Johan Hovold <[email protected]>
iommu/mediatek: fix use-after-free on probe deferral
Thomas Gleixner <[email protected]>
x86/msi: Make irq_retrigger() functional for posted MSI
Nicolas Ferre <[email protected]>
ARM: dts: microchip: sama5d2: fix spi flexcom fifo size to 32
Gui-Dong Han <[email protected]>
hwmon: (w83l786ng) Convert macros to functions to avoid TOCTOU
Gui-Dong Han <[email protected]>
hwmon: (w83791d) Convert macros to functions to avoid TOCTOU
Johan Hovold <[email protected]>
hwmon: (max6697) fix regmap leak on probe failure
Gui-Dong Han <[email protected]>
hwmon: (max16065) Use local variable to avoid TOCTOU
Raviteja Laggyshetty <[email protected]>
interconnect: qcom: sdx75: Drop QPIC interconnect and BCM nodes
Ma Ke <[email protected]>
i2c: amd-mp2: fix reference leak in MP2 PCI device
Bartosz Golaszewski <[email protected]>
platform/x86: intel: chtwc_int33fe: don't dereference swnode args
Srinivas Kandagatla <[email protected]>
rpmsg: glink: fix rpmsg device leak
Johan Hovold <[email protected]>
soc: amlogic: canvas: fix device leak on lookup
Johan Hovold <[email protected]>
soc: apple: mailbox: fix device leak on lookup
Johan Hovold <[email protected]>
soc: qcom: ocmem: fix device leak on lookup
Johan Hovold <[email protected]>
soc: qcom: pbs: fix device leak on lookup
Johan Hovold <[email protected]>
soc: samsung: exynos-pmu: fix device leak on regmap lookup
Steven Rostedt <[email protected]>
tracing: Fix fixed array of synthetic event
Miaoqian Lin <[email protected]>
virtio: vdpa: Fix reference count leak in octep_sriov_enable()
Johan Hovold <[email protected]>
amba: tegra-ahb: Fix device leak on SMMU enable
Guangshuo Li <[email protected]>
crypto: caam - Add check for kcalloc() in test_len()
Shivani Agarwal <[email protected]>
crypto: af_alg - zero initialize memory allocated via sock_kmalloc
Krzysztof Kozlowski <[email protected]>
dt-bindings: PCI: qcom,pcie-sm8550: Add missing required power-domains and resets
Krzysztof Kozlowski <[email protected]>
dt-bindings: PCI: qcom,pcie-sm8450: Add missing required power-domains and resets
Krzysztof Kozlowski <[email protected]>
dt-bindings: PCI: qcom,pcie-sm8350: Add missing required power-domains and resets
Krzysztof Kozlowski <[email protected]>
dt-bindings: PCI: qcom,pcie-sm8250: Add missing required power-domains and resets
Krzysztof Kozlowski <[email protected]>
dt-bindings: PCI: qcom,pcie-sm8150: Add missing required power-domains and resets
Krzysztof Kozlowski <[email protected]>
dt-bindings: PCI: qcom,pcie-sc8280xp: Add missing required power-domains and resets
Krzysztof Kozlowski <[email protected]>
dt-bindings: PCI: qcom,pcie-sc7280: Add missing required power-domains and resets
Marc Zyngier <[email protected]>
arm64: Revamp HCR_EL2.E2H RES1 detection
Ahmed Genidi <[email protected]>
KVM: arm64: Initialize SCTLR_EL1 in __kvm_hyp_init_cpu()
Mark Rutland <[email protected]>
KVM: arm64: Initialize HCR_EL2.E2H early
Harshit Agarwal <[email protected]>
sched/rt: Fix race in push_rt_task
Hangbin Liu <[email protected]>
hsr: hold rcu and dev lock for hsr_get_port_ndev
Claudiu Beznea <[email protected]>
pinctrl: renesas: rzg2l: Fix ISEL restore on resume
Junrui Luo <[email protected]>
ALSA: wavefront: Clear substream pointers on close
Takashi Iwai <[email protected]>
ALSA: wavefront: Use guard() for spin locks
Denis Arefev <[email protected]>
ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_hda_read_acpi()
Jani Nikula <[email protected]>
drm/displayid: pass iter to drm_find_displayid_extension()
Ray Wu <[email protected]>
drm/amd/display: Fix scratch registers offsets for DCN351
Ray Wu <[email protected]>
drm/amd/display: Fix scratch registers offsets for DCN35
Alex Deucher <[email protected]>
drm/amd/display: Use GFP_ATOMIC in dc_create_plane_state()
Mario Limonciello <[email protected]>
Revert "drm/amd/display: Fix pbn to kbps Conversion"
Jens Axboe <[email protected]>
io_uring: fix min_wait wakeups for SQPOLL
Jens Axboe <[email protected]>
io_uring/poll: correctly handle io_poll_add() return value on update
Wentao Guan <[email protected]>
gpio: regmap: Fix memleak in error path in gpio_regmap_register()
Sven Schnelle <[email protected]>
s390/ipl: Clear SBP flag when bootprog is set
Filipe Manana <[email protected]>
btrfs: don't log conflicting inode if it's a dir moved in the current transaction
Nysal Jan K.A. <[email protected]>
powerpc/kexec: Enable SMT before waking offline CPUs
Joshua Rogers <[email protected]>
SUNRPC: svcauth_gss: avoid NULL deref on zero length gss_token in gss_read_proxy_verf
Joshua Rogers <[email protected]>
svcrdma: use rc_pageoff for memcpy byte offset
Joshua Rogers <[email protected]>
svcrdma: return 0 on success from svc_rdma_copy_inline_range
Andy Shevchenko <[email protected]>
nfsd: Mark variable __maybe_unused to avoid W=1 build break
Chuck Lever <[email protected]>
NFSD: NFSv4 file creation neglects setting ACL
Chuck Lever <[email protected]>
NFSD: Clear SECLABEL in the suppattr_exclcreat bitmap
caoping <[email protected]>
net/handshake: restore destructor on submit failure
Amir Goldstein <[email protected]>
fsnotify: do not generate ACCESS/MODIFY events on child for special files
Thorsten Blum <[email protected]>
net: phy: marvell-88q2xxx: Fix clamped value in mv88q2xxx_hwmon_write
René Rebe <[email protected]>
r8169: fix RTL8117 Wake-on-Lan in DASH mode
Rafael J. Wysocki <[email protected]>
PM: runtime: Do not clear needs_force_resume with enabled runtime PM
Steven Rostedt <[email protected]>
tracing: Do not register unsupported perf events
Darrick J. Wong <[email protected]>
xfs: fix a UAF problem in xattr repair
Darrick J. Wong <[email protected]>
xfs: fix stupid compiler warning
Haoxiang Li <[email protected]>
xfs: fix a memory leak in xfs_buf_item_init()
Sean Christopherson <[email protected]>
KVM: nSVM: Clear exit_code_hi in VMCB when synthesizing nested VM-Exits
Sean Christopherson <[email protected]>
KVM: nSVM: Set exit_code_hi to -1 when synthesizing SVM_EXIT_ERR (failed VMRUN)
Dongli Zhang <[email protected]>
KVM: nVMX: Immediately refresh APICv controls as needed on nested VM-Exit
Jim Mattson <[email protected]>
KVM: SVM: Mark VMCB_PERM_MAP as dirty on nested VMRUN
Yosry Ahmed <[email protected]>
KVM: nSVM: Propagate SVM_EXIT_CR0_SEL_WRITE correctly for LMSW emulation
Jim Mattson <[email protected]>
KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN
Yosry Ahmed <[email protected]>
KVM: nSVM: Avoid incorrect injection of SVM_EXIT_CR0_SEL_WRITE
fuqiang wang <[email protected]>
KVM: x86: Fix VM hard lockup after prolonged inactivity with periodic HV timer
fuqiang wang <[email protected]>
KVM: x86: Explicitly set new periodic hrtimer expiration in apic_timer_fn()
Sean Christopherson <[email protected]>
KVM: x86: WARN if hrtimer callback for periodic APIC timer fires with period=0
Finn Thain <[email protected]>
powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
Ilya Dryomov <[email protected]>
libceph: make decode_pool() more resilient against corrupted osdmaps
Helge Deller <[email protected]>
parisc: Do not reprogram affinitiy on ASP chip
Zhichi Lin <[email protected]>
scs: fix a wrong parameter in __scs_magic
Tzung-Bi Shih <[email protected]>
platform/chrome: cros_ec_ishtp: Fix UAF after unbinding driver
Maxim Levitsky <[email protected]>
KVM: x86: Don't clear async #PF queue when CR0.PG is disabled (e.g. on #SMI)
Prithvi Tambewagh <[email protected]>
ocfs2: fix kernel BUG in ocfs2_find_victim_chain
Jeongjun Park <[email protected]>
media: vidtv: initialize local pointers upon transfer of memory ownership
Sean Christopherson <[email protected]>
KVM: Disallow toggling KVM_MEM_GUEST_MEMFD on an existing memslot
Alison Schofield <[email protected]>
tools/testing/nvdimm: Use per-DIMM device handle
Chao Yu <[email protected]>
f2fs: fix return value of f2fs_recover_fsync_data()
Xiaole He <[email protected]>
f2fs: fix uninitialized one_time_gc in victim_sel_policy
Xiaole He <[email protected]>
f2fs: fix age extent cache insertion skip on counter overflow
Deepanshu Kartikey <[email protected]>
f2fs: invalidate dentry cache on failed whiteout creation
Chao Yu <[email protected]>
f2fs: fix to avoid updating zero-sized extent in extent cache
Chao Yu <[email protected]>
f2fs: fix to avoid potential deadlock
Jan Prusakowski <[email protected]>
f2fs: ensure node page reads complete before f2fs_put_super() finishes
Seunghwan Baek <[email protected]>
scsi: ufs: core: Add ufshcd_update_evt_hist() for UFS suspend error
Chandrakanth Patil <[email protected]>
scsi: mpi3mr: Read missing IOCFacts flag for reply queue full overflow
Andrey Vatoropin <[email protected]>
scsi: target: Reset t_task_cdb pointer in error case
Dai Ngo <[email protected]>
NFSD: use correct reservation type in nfsd4_scsi_fence_client
Junrui Luo <[email protected]>
scsi: aic94xx: fix use-after-free in device removal path
Tony Battersby <[email protected]>
scsi: Revert "scsi: qla2xxx: Perform lockless command completion in abort path"
Miaoqian Lin <[email protected]>
cpufreq: nforce2: fix reference count leak in nforce2
Rafael J. Wysocki <[email protected]>
cpuidle: governors: teo: Drop misguided target residency check
Claudiu Beznea <[email protected]>
serial: sh-sci: Check that the DMA cookie is valid
Junxiao Chang <[email protected]>
mei: gsc: add dependency on Xe driver
Ma Ke <[email protected]>
intel_th: Fix error handling in intel_th_output_open
Tianchu Chen <[email protected]>
char: applicom: fix NULL pointer dereference in ac_ioctl
Haoxiang Li <[email protected]>
usb: renesas_usbhs: Fix a resource leak in usbhs_pipe_malloc()
Udipto Goswami <[email protected]>
usb: dwc3: keep susphy enabled during exit to avoid controller faults
Miaoqian Lin <[email protected]>
usb: dwc3: of-simple: fix clock resource leak in dwc3_of_simple_probe
Johan Hovold <[email protected]>
usb: gadget: lpc32xx_udc: fix clock imbalance in error path
Johan Hovold <[email protected]>
usb: phy: isp1301: fix non-OF device reference imbalance
Duoming Zhou <[email protected]>
usb: phy: fsl-usb: Fix use-after-free in delayed work during device removal
Ma Ke <[email protected]>
USB: lpc32xx_udc: Fix error handling in probe
Haoxiang Li <[email protected]>
usb: typec: altmodes/displayport: Drop the device reference in dp_altmode_probe()
Johan Hovold <[email protected]>
usb: ohci-nxp: fix device leak on probe failure
Johan Hovold <[email protected]>
phy: broadcom: bcm63xx-usbh: fix section mismatches
Colin Ian King <[email protected]>
media: pvrusb2: Fix incorrect variable used in trace message
Jeongjun Park <[email protected]>
media: dvb-usb: dtv5100: fix out-of-bounds in dtv5100_i2c_msg()
Chen Changcheng <[email protected]>
usb: usb-storage: Maintain minimal modifications to the bcdDevice range.
Paolo Abeni <[email protected]>
mptcp: avoid deadlock on fallback while reinjecting
Paolo Abeni <[email protected]>
mptcp: schedule rtx timer only after pushing data
Matthieu Baerts (NGI0) <[email protected]>
selftests: mptcp: pm: ensure unknown flags are ignored
Laurent Pinchart <[email protected]>
media: v4l2-mem2mem: Fix outdated documentation
Byungchul Park <[email protected]>
jbd2: use a weaker annotation in journal handling
Tetsuo Handa <[email protected]>
jbd2: use a per-journal lock_class_key for jbd2_trans_commit_key
Baokun Li <[email protected]>
ext4: align max orphan file size with e2fsprogs limit
Yongjian Sun <[email protected]>
ext4: fix incorrect group number assertion in mb_check_buddy
Haibo Chen <[email protected]>
ext4: clear i_state_flags when alloc inode
Karina Yankevich <[email protected]>
ext4: xattr: fix null pointer deref in ext4_raw_inode()
Fedor Pchelkin <[email protected]>
ext4: fix string copying in parse_apply_sb_mount_options()
Jarkko Sakkinen <[email protected]>
tpm: Cap the number of PCR banks
Steven Rostedt <[email protected]>
ktest.pl: Fix uninitialized var in config-bisect.pl
Konstantin Komarov <[email protected]>
fs/ntfs3: fix mount failure for sparse runs in run_unpack()
Zheng Yejian <[email protected]>
kallsyms: Fix wrong "big" kernel symbol type read from procfs
Rene Rebe <[email protected]>
floppy: fix for PAGE_SIZE != 4KB
Li Chen <[email protected]>
block: rate-limit capacity change info log
Sven Eckelmann (Plasma Cloud) <[email protected]>
wifi: mt76: Fix DTS power-limits on little endian systems
Stefan Haberland <[email protected]>
s390/dasd: Fix gendisk parent after copy pair swap
Eric Biggers <[email protected]>
lib/crypto: x86/blake2s: Fix 32-bit arg treated as 64-bit
Ma Ke <[email protected]>
perf: arm_cspmu: fix error handling in arm_cspmu_impl_unregister()
Sarthak Garg <[email protected]>
mmc: sdhci-msm: Avoid early clock doubling during HS400 transition
Avadhut Naik <[email protected]>
x86/mce: Do not clear bank's poll bit in mce_poll_banks on AMD SMCA systems
Prithvi Tambewagh <[email protected]>
io_uring: fix filename leak in __io_openat_prep()
Jarkko Sakkinen <[email protected]>
KEYS: trusted: Fix a memory leak in tpm2_load_cmd
Zilin Guan <[email protected]>
cifs: Fix memory and information leak in smb3_reconfigure()
Stefano Garzarella <[email protected]>
vhost/vsock: improve RCU read sections around vhost_vsock_get()
Dan Carpenter <[email protected]>
block: rnbd-clt: Fix signedness bug in init_dev()
John Garry <[email protected]>
scsi: scsi_debug: Fix atomic write enable module param description
Gregory CLEMENT <[email protected]>
MIPS: ftrace: Fix memory corruption when kernel is located beyond 32 bits
Chia-Lin Kao (AceLan) <[email protected]>
platform/x86/intel/hid: Add Dell Pro Rugged 10/12 tablet to VGBS DMI quirks
Justin Tee <[email protected]>
nvme-fabrics: add ENOKEY to no retry criteria for authentication failures
Daniel Wagner <[email protected]>
nvme-fc: don't hold rport lock when putting ctrl
Jinhui Guo <[email protected]>
i2c: designware: Disable SMBus interrupts to prevent storms from mis-configured firmware
Jens Reidel <[email protected]>
clk: qcom: dispcc-sm7150: Fix dispcc_mdss_pclk0_clk_src
Ian Rogers <[email protected]>
libperf cpumap: Fix perf_cpu_map__max for an empty/NULL map
Wenhua Lin <[email protected]>
serial: sprd: Return -EPROBE_DEFER when uart clock is not ready
Chen Changcheng <[email protected]>
usb: usb-storage: No additional quirks need to be added to the EL-R12 optical drive.
Hongyu Xie <[email protected]>
usb: xhci: limit run_graceperiod for only usb 3.0 devices
Pei Xiao <[email protected]>
iio: adc: ti_am335x_adc: Limit step_avg to valid range for gcc complains
Mark Pearson <[email protected]>
usb: typec: ucsi: Handle incorrect num_connectors capability
Lizhi Xu <[email protected]>
usbip: Fix locking bug in RT-enabled kernels
Yuezhang Mo <[email protected]>
exfat: zero out post-EOF page cache on file extension
Yuezhang Mo <[email protected]>
exfat: fix remount failure in different process environments
Encrow Thorne <[email protected]>
reset: fix BIT macro reference
Li Qiang <[email protected]>
via_wdt: fix critical boot hang due to unnamed resource allocation
Bernd Schubert <[email protected]>
fuse: Invalidate the page cache after FOPEN_DIRECT_IO write
Bernd Schubert <[email protected]>
fuse: Always flush the page cache before FOPEN_DIRECT_IO write
Tony Battersby <[email protected]>
scsi: qla2xxx: Use reinit_completion on mbx_intr_comp
Tony Battersby <[email protected]>
scsi: qla2xxx: Fix initiator mode with qlini_mode=exclusive
Tony Battersby <[email protected]>
scsi: qla2xxx: Fix lost interrupts with qlini_mode=disabled
Ben Collins <[email protected]>
powerpc/addnote: Fix overflow on 32-bit builds
Josua Mayer <[email protected]>
clk: mvebu: cp110 add CLK_IGNORE_UNUSED to pcie_x10, pcie_x11 & pcie_x4
David Strahan <[email protected]>
scsi: smartpqi: Add support for Hurray Data new controller PCI device
Matthias Schiffer <[email protected]>
ti-sysc: allow OMAP2 and OMAP4 timers to be reserved on AM33xx
Peng Fan <[email protected]>
firmware: imx: scu-irq: Init workqueue before request mbox channel
Peter Wang <[email protected]>
scsi: ufs: host: mediatek: Fix shutdown/suspend race condition
Jinhui Guo <[email protected]>
ipmi: Fix __scan_channels() failing to rescan channels
Jinhui Guo <[email protected]>
ipmi: Fix the race between __scan_channels() and deliver_response()
Shardul Bankar <[email protected]>
nfsd: fix memory leak in nfsd_create_serv error paths
Mike Snitzer <[email protected]>
nfsd: rename nfsd_serv_ prefixed methods and variables with nfsd_net_
Mike Snitzer <[email protected]>
nfsd: update percpu_ref to manage references on nfsd_net
Shengjiu Wang <[email protected]>
ASoC: ak4458: remove the reset operation in probe and remove
Shipei Qu <[email protected]>
ALSA: usb-mixer: us16x08: validate meter packet indices
Haotian Zhang <[email protected]>
ALSA: pcmcia: Fix resource leak in snd_pdacf_probe error path
Haotian Zhang <[email protected]>
ALSA: vxpocket: Fix resource leak in vxpocket_probe error path
Yongxin Liu <[email protected]>
x86/fpu: Fix FPU state core dump truncation on CPUs with no extended xfeatures
Shaurya Rane <[email protected]>
net/hsr: fix NULL pointer dereference in prp_get_untagged_frame()
Andrew Jeffery <[email protected]>
dt-bindings: mmc: sdhci-of-aspeed: Switch ref to sdhci-common.yaml
Sai Krishna Potthuri <[email protected]>
mmc: sdhci-of-arasan: Increase CD stable timeout to 2 seconds
Jared Kangas <[email protected]>
mmc: sdhci-esdhc-imx: add alternate ARCH_S32 dependency to Kconfig
Christophe Leroy <[email protected]>
spi: fsl-cpm: Check length parity before switching to 16 bit mode
Pengjie Zhang <[email protected]>
ACPI: CPPC: Fix missing PCC check for guaranteed_perf
Pengjie Zhang <[email protected]>
ACPI: PCC: Fix race condition by removing static qualifier
Kartik Rajput <[email protected]>
soc/tegra: fuse: Do not register SoC device on ACPI boot
Marc Kleine-Budde <[email protected]>
can: gs_usb: gs_can_open(): fix error handling
Christoph Hellwig <[email protected]>
xfs: don't leak a locked dquot when xfs_dquot_attach_buf fails
Christoffer Sandberg <[email protected]>
Input: i8042 - add TUXEDO InfinityBook Max Gen10 AMD to i8042 quirk table
Duoming Zhou <[email protected]>
Input: alps - fix use-after-free bugs caused by dev3_register_work
Minseong Kim <[email protected]>
Input: lkkbd - disable pending work before freeing device
Junjie Cao <[email protected]>
Input: ti_am335x_tsc - fix off-by-one error in wire_order validation
Ping Cheng <[email protected]>
HID: input: map HID_GD_Z to ABS_DISTANCE for stylus/pen
Namjae Jeon <[email protected]>
ksmbd: fix buffer validation by including null terminator size in EA length
Namjae Jeon <[email protected]>
ksmbd: Fix refcount leak when invalid session is found on session lookup
Qianchang Zhao <[email protected]>
ksmbd: skip lock-range check on equal size to avoid size==0 underflow
Nuno Sá <[email protected]>
hwmon: (ltc4282): Fix reset_history file permissions
Shuicheng Lin <[email protected]>
drm/xe/oa: Limit num_syncs to prevent oversized allocations
Shuicheng Lin <[email protected]>
drm/xe: Limit num_syncs to prevent oversized allocations
Thomas Fourier <[email protected]>
block: rnbd-clt: Fix leaked ID in init_dev()
Anurag Dutta <[email protected]>
spi: cadence-quadspi: Fix clock disable on probe failure path
Jianpeng Chang <[email protected]>
arm64: kdump: Fix elfcorehdr overlap caused by reserved memory processing reorder
Juergen Gross <[email protected]>
x86/xen: Fix sparse warning in enlighten_pv.c
Brian Gerst <[email protected]>
x86/xen: Move Xen upcall handler
Marijn Suijten <[email protected]>
drm/panel: sony-td4353-jdi: Enable prepare_prev_first
Haoxiang Li <[email protected]>
MIPS: Fix a reference leak bug in ip22_check_gio()
Jan Maslak <[email protected]>
drm/xe: Restore engine registers before restarting schedulers after GT reset
Junxiao Chang <[email protected]>
drm/me/gsc: mei interrupt top half should be in irq disabled context
Alexey Simakov <[email protected]>
hwmon: (tmp401) fix overflow caused by default conversion rate value
Junrui Luo <[email protected]>
hwmon: (ibmpex) fix use-after-free in high/low store
Denis Sergeev <[email protected]>
hwmon: (dell-smm) Limit fan multiplier to avoid overflow
Jian Shen <[email protected]>
net: hns3: add VLAN id validation before using
Jian Shen <[email protected]>
net: hns3: using the num_tqps to check whether tqp_index is out of range when vf get ring info from mbx
Jian Shen <[email protected]>
net: hns3: using the num_tqps in the vf driver to apply for resources
Wei Fang <[email protected]>
net: enetc: do not transmit redirected XDP frames when the link is down
Scott Mayhew <[email protected]>
net/handshake: duplicate handshake cancellations leak socket
Shay Drory <[email protected]>
net/mlx5: Serialize firmware reset with devlink
Shay Drory <[email protected]>
net/mlx5: fw_tracer, Handle escaped percent properly
Shay Drory <[email protected]>
net/mlx5: fw_tracer, Validate format string parameters
Moshe Shemesh <[email protected]>
net/mlx5: Drain firmware reset in shutdown callback
Moshe Shemesh <[email protected]>
net/mlx5: fw reset, clear reset requested on drain_fw_reset
Gal Pressman <[email protected]>
ethtool: Avoid overflowing userspace buffer on stats query
Jason Gunthorpe <[email protected]>
iommufd/selftest: Check for overflow in IOMMU_TEST_OP_ADD_RESERVED
Jason Gunthorpe <[email protected]>
iommufd/selftest: Make it clearer to gcc that the access is not out of bounds
Nicolin Chen <[email protected]>
iommufd/selftest: Update hw_info coverage for an input data_type
Yi Liu <[email protected]>
iommufd/selftest: Add coverage for reporting max_pasid_log2 via IOMMU_HW_INFO
Florian Westphal <[email protected]>
selftests: netfilter: packetdrill: avoid failure on HZ=100 kernel
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: remove redundant chain validation on register store
Florian Westphal <[email protected]>
netfilter: nf_nat: remove bogus direction check
Dan Carpenter <[email protected]>
nfc: pn533: Fix error code in pn533_acr122_poweron_rdr()
Victor Nogueira <[email protected]>
net/sched: ets: Remove drr class from the active list if it changes to strict
Junrui Luo <[email protected]>
caif: fix integer underflow in cffrml_receive()
Slavin Liu <[email protected]>
ipvs: fix ipv4 null-ptr-deref in route error path
Fernando Fernandez Mancera <[email protected]>
netfilter: nf_conncount: fix leaked ct in error paths
Alexey Simakov <[email protected]>
broadcom: b44: prevent uninitialized value usage
Ilya Maximets <[email protected]>
net: openvswitch: fix middle attribute validation in push_nsh() action
Michael Chan <[email protected]>
bnxt_en: Fix XDP_TX path
Ido Schimmel <[email protected]>
mlxsw: spectrum_mr: Fix use-after-free when updating multicast route stats
Ido Schimmel <[email protected]>
mlxsw: spectrum_router: Fix neighbour use-after-free
Ido Schimmel <[email protected]>
mlxsw: spectrum_router: Fix possible neighbour reference count leak
Dmitry Skorodumov <[email protected]>
ipvlan: Ignore PACKET_LOOPBACK in handle_mode_l2()
Jamal Hadi Salim <[email protected]>
net/sched: ets: Always remove class from active list before deleting in ets_qdisc_change
Wang Liang <[email protected]>
netrom: Fix memory leak in nr_sendmsg()
Wei Fang <[email protected]>
net: fec: ERR007885 Workaround for XDP TX path
Andreas Gruenbacher <[email protected]>
gfs2: Fix use of bio_chain
Max Chou <[email protected]>
Bluetooth: btusb: Add new VID/PID 0x0489/0xE12F for RTL8852BE-VT
Gongwei Li <[email protected]>
Bluetooth: btusb: Add new VID/PID 13d3/3533 for RTL8821CE
Chris Lu <[email protected]>
Bluetooth: btusb: MT7920: Add VID/PID 0489/e135
Chris Lu <[email protected]>
Bluetooth: btusb: MT7922: Add VID/PID 0489/e170
Chingbin Li <[email protected]>
Bluetooth: btusb: Add new VID/PID 2b89/6275 for RTL8761BUV
Qianchang Zhao <[email protected]>
ksmbd: vfs: fix race on m_flags in vfs_cache
Namjae Jeon <[email protected]>
ksmbd: fix use-after-free in ksmbd_tree_connect_put under concurrency
ChenXiaoSong <[email protected]>
smb/server: fix return value of smb2_ioctl()
Andreas Gruenbacher <[email protected]>
gfs2: Fix "gfs2: Switch to wait_event in gfs2_quotad"
Andreas Gruenbacher <[email protected]>
gfs2: fix remote evict for read-only filesystems
Qu Wenruo <[email protected]>
btrfs: scrub: always update btrfs_scrub_progress::last_physical
Hans de Goede <[email protected]>
wifi: brcmfmac: Add DMI nvram filename quirk for Acer A1 840 tablet
Quan Zhou <[email protected]>
wifi: mt76: mt792x: fix wifi init fail by setting MCU_RUNNING after CLC load
Johannes Berg <[email protected]>
wifi: cfg80211: use cfg80211_leave() in iftype change
Johannes Berg <[email protected]>
wifi: cfg80211: stop radar detection in cfg80211_leave()
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Fix HT40 channel config for RTL8192CU, RTL8723AU
Konstantin Komarov <[email protected]>
fs/ntfs3: check for shutdown in fsync
Viacheslav Dubeyko <[email protected]>
hfsplus: fix volume corruption issue for generic/073
Tetsuo Handa <[email protected]>
hfsplus: Verify inode mode when loading from disk
Yang Chenzhi <[email protected]>
hfsplus: fix missing hfs_bnode_get() in __hfs_bnode_create
Viacheslav Dubeyko <[email protected]>
hfsplus: fix volume corruption issue for generic/070
Pedro Demarchi Gomes <[email protected]>
ntfs: set dummy blocksize to read boot_block when mounting
Mikhail Malyshev <[email protected]>
kbuild: Use objtree for module signing key path
Konstantin Komarov <[email protected]>
fs/ntfs3: Support timestamps prior to epoch
Song Liu <[email protected]>
livepatch: Match old_sympos 0 and 1 in klp_find_func()
Aboorva Devarajan <[email protected]>
cpuidle: menu: Use residency threshold in polling state override decisions
Shuhao Fu <[email protected]>
cpufreq: s5pv210: fix refcount leak
Armin Wolf <[email protected]>
ACPI: fan: Workaround for 64-bit firmware bug
Hal Feng <[email protected]>
cpufreq: dt-platdev: Add JH7110S SOC to the allowlist
Sakari Ailus <[email protected]>
ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
Cryolitia PukNgae <[email protected]>
ACPICA: Avoid walking the Namespace if start_node is NULL
Peter Zijlstra <[email protected]>
x86/ptrace: Always inline trivial accessors
Peter Zijlstra <[email protected]>
sched/fair: Revert max_newidle_lb_cost bump
Doug Berger <[email protected]>
sched/deadline: only set free_cpus for online runqueues
George Kennedy <[email protected]>
perf/x86/amd: Check event before enable to avoid GPF
Pankaj Raghav <[email protected]>
scripts/faddr2line: Fix "Argument list too long" error
Joanne Koong <[email protected]>
iomap: account for unaligned end offsets when truncating read range
Joanne Koong <[email protected]>
iomap: adjust read range correctly for non-block-aligned positions
Al Viro <[email protected]>
shmem: fix recovery on rename failures
Deepanshu Kartikey <[email protected]>
btrfs: fix memory leak of fs_devices in degraded seed device path
Ondrej Mosnacek <[email protected]>
bpf, arm64: Do not audit capability check in do_jit()
Qu Wenruo <[email protected]>
btrfs: fix a potential path leak in print_data_reloc_error()
Filipe Manana <[email protected]>
btrfs: do not skip logging new dentries when logging a new name
-------------
Diffstat:
.../devicetree/bindings/mmc/aspeed,sdhci.yaml | 2 +-
.../devicetree/bindings/pci/qcom,pcie-sc7280.yaml | 5 +
.../bindings/pci/qcom,pcie-sc8280xp.yaml | 3 +
.../devicetree/bindings/pci/qcom,pcie-sm8150.yaml | 5 +
.../devicetree/bindings/pci/qcom,pcie-sm8250.yaml | 5 +
.../devicetree/bindings/pci/qcom,pcie-sm8350.yaml | 5 +
.../devicetree/bindings/pci/qcom,pcie-sm8450.yaml | 5 +
.../devicetree/bindings/pci/qcom,pcie-sm8550.yaml | 5 +
Documentation/driver-api/soundwire/stream.rst | 2 +-
Documentation/driver-api/tty/tty_port.rst | 5 +-
Documentation/filesystems/nfs/localio.rst | 81 +--
Makefile | 4 +-
arch/arm/boot/dts/microchip/sama5d2.dtsi | 10 +-
arch/arm/boot/dts/microchip/sama7g5.dtsi | 4 +-
arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 12 +-
arch/arm64/include/asm/el2_setup.h | 57 +-
arch/arm64/kernel/head.S | 22 +-
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 10 +-
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 3 +
arch/arm64/net/bpf_jit_comp.c | 2 +-
arch/loongarch/include/asm/pgtable.h | 4 +-
arch/loongarch/kernel/mcount_dyn.S | 14 +-
arch/loongarch/kernel/relocate.c | 4 +-
arch/loongarch/kernel/setup.c | 8 +-
arch/loongarch/kernel/switch.S | 4 +-
arch/loongarch/net/bpf_jit.c | 18 +
arch/loongarch/net/bpf_jit.h | 26 +
arch/loongarch/pci/pci.c | 2 +
arch/mips/kernel/ftrace.c | 25 +-
arch/mips/sgi-ip22/ip22-gio.c | 3 +-
arch/parisc/kernel/asm-offsets.c | 2 +
arch/parisc/kernel/entry.S | 16 +-
arch/powerpc/boot/addnote.c | 7 +-
arch/powerpc/include/asm/book3s/32/tlbflush.h | 5 +-
arch/powerpc/include/asm/book3s/64/mmu-hash.h | 1 -
arch/powerpc/kernel/btext.c | 3 +-
arch/powerpc/kernel/process.c | 5 -
arch/powerpc/kexec/core_64.c | 19 +
arch/powerpc/mm/book3s32/tlb.c | 9 +
arch/powerpc/mm/book3s64/internal.h | 2 -
arch/powerpc/mm/book3s64/mmu_context.c | 2 -
arch/powerpc/mm/book3s64/slb.c | 88 ---
arch/powerpc/platforms/pseries/cmm.c | 5 +-
arch/riscv/crypto/chacha-riscv64-zvkb.S | 5 +-
arch/s390/include/uapi/asm/ipl.h | 1 +
arch/s390/kernel/ipl.c | 48 +-
arch/x86/crypto/blake2s-core.S | 4 +-
arch/x86/entry/common.c | 72 --
arch/x86/events/amd/core.c | 7 +-
arch/x86/events/amd/uncore.c | 5 +-
arch/x86/include/asm/irq_remapping.h | 7 +
arch/x86/include/asm/ptrace.h | 20 +-
arch/x86/kernel/cpu/mce/threshold.c | 3 +-
arch/x86/kernel/cpu/microcode/amd.c | 106 ++-
arch/x86/kernel/fpu/xstate.c | 4 +-
arch/x86/kernel/irq.c | 23 +
arch/x86/kvm/lapic.c | 32 +-
arch/x86/kvm/svm/nested.c | 6 +-
arch/x86/kvm/svm/svm.c | 54 +-
arch/x86/kvm/svm/svm.h | 7 +-
arch/x86/kvm/vmx/nested.c | 3 +-
arch/x86/kvm/x86.c | 25 +-
arch/x86/xen/enlighten_pv.c | 69 ++
block/blk-mq.c | 2 +-
block/blk-zoned.c | 193 +++--
block/blk.h | 14 +
block/genhd.c | 2 +-
crypto/af_alg.c | 5 +-
crypto/algif_hash.c | 3 +-
crypto/algif_rng.c | 3 +-
crypto/seqiv.c | 8 +-
drivers/acpi/acpi_pcc.c | 2 +-
drivers/acpi/acpica/nswalk.c | 9 +-
drivers/acpi/cppc_acpi.c | 3 +-
drivers/acpi/fan.h | 33 +
drivers/acpi/fan_hwmon.c | 10 +-
drivers/acpi/property.c | 8 +-
drivers/amba/tegra-ahb.c | 1 +
drivers/base/power/runtime.c | 22 +-
drivers/block/floppy.c | 2 +-
drivers/block/rnbd/rnbd-clt.c | 13 +-
drivers/block/rnbd/rnbd-clt.h | 2 +-
drivers/bluetooth/btusb.c | 22 +-
drivers/bus/ti-sysc.c | 11 +-
drivers/char/applicom.c | 5 +-
drivers/char/ipmi/ipmi_msghandler.c | 20 +-
drivers/char/tpm/tpm-chip.c | 1 -
drivers/char/tpm/tpm1-cmd.c | 5 -
drivers/char/tpm/tpm2-cmd.c | 11 +-
drivers/char/tpm/tpm2-sessions.c | 85 ++-
drivers/clk/mvebu/cp110-system-controller.c | 20 +
drivers/clk/qcom/dispcc-sm7150.c | 2 +-
drivers/clk/samsung/clk-exynos-clkout.c | 2 +-
drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
drivers/cpufreq/cpufreq-nforce2.c | 3 +
drivers/cpufreq/s5pv210-cpufreq.c | 6 +-
drivers/cpuidle/governors/menu.c | 9 +-
drivers/cpuidle/governors/teo.c | 7 +-
drivers/crypto/caam/caamrng.c | 4 +-
drivers/firewire/nosy.c | 10 +-
drivers/firmware/imx/imx-scu-irq.c | 4 +-
drivers/firmware/stratix10-svc.c | 11 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-regmap.c | 2 +-
.../gpio/{gpiolib-acpi.c => gpiolib-acpi-core.c} | 344 +--------
drivers/gpio/gpiolib-acpi-quirks.c | 412 +++++++++++
drivers/gpio/gpiolib-acpi.h | 15 +
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 27 +
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 27 +
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 62 +-
.../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm | 37 +
drivers/gpu/drm/amd/amdkfd/kfd_queue.c | 1 +
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +
.../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 59 +-
drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 2 +-
.../amd/display/dc/resource/dcn35/dcn35_resource.c | 8 +-
.../display/dc/resource/dcn351/dcn351_resource.c | 8 +-
drivers/gpu/drm/drm_buddy.c | 390 ++++++----
drivers/gpu/drm/drm_displayid.c | 58 +-
drivers/gpu/drm/drm_displayid_internal.h | 2 +
drivers/gpu/drm/gma500/fbdev.c | 43 --
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 37 +-
drivers/gpu/drm/i915/intel_memory_region.h | 2 +-
drivers/gpu/drm/imagination/pvr_gem.c | 11 +
drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 33 +-
drivers/gpu/drm/mediatek/mtk_ddp_comp.h | 2 +-
drivers/gpu/drm/mediatek/mtk_dp.c | 1 +
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 +-
drivers/gpu/drm/mgag200/mgag200_mode.c | 25 +
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +-
.../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 10 +-
drivers/gpu/drm/nouveau/dispnv50/atom.h | 13 +
drivers/gpu/drm/nouveau/dispnv50/wndw.c | 2 +-
drivers/gpu/drm/panel/panel-sony-td4353-jdi.c | 2 +
drivers/gpu/drm/panthor/panthor_gem.c | 18 +
drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +
drivers/gpu/drm/xe/xe_bo.c | 15 +-
drivers/gpu/drm/xe/xe_dma_buf.c | 2 +-
drivers/gpu/drm/xe/xe_exec.c | 3 +-
drivers/gpu/drm/xe/xe_gt.c | 7 +-
drivers/gpu/drm/xe/xe_guc_submit.c | 20 +-
drivers/gpu/drm/xe/xe_heci_gsc.c | 4 +-
drivers/gpu/drm/xe/xe_oa.c | 13 +-
drivers/gpu/drm/xe/xe_vm.c | 8 +-
drivers/gpu/drm/xe/xe_vm_types.h | 2 +-
drivers/hid/hid-input.c | 18 +-
drivers/hid/hid-logitech-dj.c | 56 +-
drivers/hwmon/dell-smm-hwmon.c | 9 +
drivers/hwmon/ibmpex.c | 9 +-
drivers/hwmon/ltc4282.c | 9 +-
drivers/hwmon/max16065.c | 7 +-
drivers/hwmon/max6697.c | 2 +-
drivers/hwmon/tmp401.c | 2 +-
drivers/hwmon/w83791d.c | 19 +-
drivers/hwmon/w83l786ng.c | 26 +-
drivers/hwtracing/intel_th/core.c | 20 +-
drivers/i2c/busses/i2c-amd-mp2-pci.c | 5 +-
drivers/i2c/busses/i2c-designware-core.h | 1 +
drivers/i2c/busses/i2c-designware-master.c | 7 +
drivers/iio/adc/ti_am335x_adc.c | 2 +-
drivers/infiniband/core/addr.c | 33 +-
drivers/infiniband/core/cma.c | 3 +
drivers/infiniband/core/device.c | 4 +-
drivers/infiniband/core/verbs.c | 2 +-
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 7 +-
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 2 +-
drivers/infiniband/hw/bnxt_re/qplib_res.c | 8 +-
drivers/infiniband/hw/efa/efa_verbs.c | 4 -
drivers/infiniband/hw/irdma/utils.c | 3 +-
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 1 +
drivers/input/keyboard/lkkbd.c | 5 +-
drivers/input/mouse/alps.c | 1 +
drivers/input/serio/i8042-acpipnpio.h | 7 +
drivers/input/touchscreen/ti_am335x_tsc.c | 2 +-
drivers/interconnect/qcom/sdx75.c | 26 -
drivers/interconnect/qcom/sdx75.h | 2 -
drivers/iommu/amd/init.c | 15 +-
drivers/iommu/amd/iommu.c | 2 +-
drivers/iommu/apple-dart.c | 2 +
drivers/iommu/arm/arm-smmu/qcom_iommu.c | 10 +-
drivers/iommu/exynos-iommu.c | 9 +-
drivers/iommu/intel/irq_remapping.c | 8 +-
drivers/iommu/iommu-sva.c | 3 +
drivers/iommu/iommufd/selftest.c | 8 +-
drivers/iommu/ipmmu-vmsa.c | 2 +
drivers/iommu/mtk_iommu.c | 27 +-
drivers/iommu/mtk_iommu_v1.c | 25 +-
drivers/iommu/omap-iommu.c | 2 +-
drivers/iommu/omap-iommu.h | 2 -
drivers/iommu/sun50i-iommu.c | 2 +
drivers/iommu/tegra-smmu.c | 5 +-
drivers/isdn/capi/capi.c | 8 +-
drivers/leds/leds-cros_ec.c | 5 +-
drivers/leds/leds-lp50xx.c | 67 +-
drivers/md/dm-bufio.c | 10 +-
drivers/md/dm-ebs-target.c | 2 +-
drivers/md/md.c | 5 +-
drivers/md/raid10.c | 3 +-
drivers/md/raid5.c | 10 +-
drivers/media/cec/core/cec-core.c | 1 +
.../media/common/videobuf2/videobuf2-dma-contig.c | 1 +
drivers/media/i2c/adv7604.c | 4 +-
drivers/media/i2c/adv7842.c | 11 +-
drivers/media/i2c/imx219.c | 9 +-
drivers/media/i2c/msp3400-kthreads.c | 2 +
drivers/media/i2c/tda1997x.c | 1 -
drivers/media/platform/amphion/vpu_malone.c | 35 +-
drivers/media/platform/amphion/vpu_v4l2.c | 28 +-
drivers/media/platform/amphion/vpu_v4l2.h | 18 -
.../media/platform/mediatek/mdp3/mtk-mdp3-core.c | 14 +
.../mediatek/vcodec/common/mtk_vcodec_fw_vpu.c | 14 +-
.../mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 12 +-
.../mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h | 2 +-
.../platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 5 +-
.../mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c | 12 +-
.../mediatek/vcodec/encoder/mtk_vcodec_enc_drv.h | 2 +-
.../platform/mediatek/vcodec/encoder/venc_vpu_if.c | 5 +-
drivers/media/platform/renesas/rcar_drif.c | 1 +
.../media/platform/samsung/exynos4-is/media-dev.c | 10 +-
drivers/media/platform/ti/davinci/vpif_capture.c | 4 +-
drivers/media/platform/ti/davinci/vpif_display.c | 4 +-
drivers/media/platform/verisilicon/hantro_g2.c | 84 ++-
.../platform/verisilicon/hantro_g2_hevc_dec.c | 17 +-
.../media/platform/verisilicon/hantro_g2_regs.h | 13 +
.../media/platform/verisilicon/hantro_g2_vp9_dec.c | 2 -
drivers/media/platform/verisilicon/hantro_hw.h | 1 +
drivers/media/platform/verisilicon/imx8m_vpu_hw.c | 2 +
drivers/media/rc/st_rc.c | 2 +-
drivers/media/test-drivers/vidtv/vidtv_channel.c | 3 +
drivers/media/usb/dvb-usb/dtv5100.c | 5 +
drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +-
drivers/mfd/altera-sysmgr.c | 2 +
drivers/mfd/max77620.c | 15 +-
drivers/misc/mei/Kconfig | 2 +-
drivers/misc/vmw_balloon.c | 3 +-
drivers/mmc/host/Kconfig | 4 +-
drivers/mmc/host/sdhci-msm.c | 27 +-
drivers/mmc/host/sdhci-of-arasan.c | 2 +-
drivers/mtd/mtdpart.c | 7 +-
drivers/mtd/spi-nor/winbond.c | 24 +
drivers/net/can/usb/gs_usb.c | 2 +-
drivers/net/dsa/b53/b53_common.c | 3 +
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 2 +
drivers/net/ethernet/broadcom/b44.c | 3 +
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 3 +-
drivers/net/ethernet/cadence/macb_main.c | 3 +-
drivers/net/ethernet/freescale/enetc/enetc.c | 3 +-
drivers/net/ethernet/freescale/fec_main.c | 7 +-
drivers/net/ethernet/google/gve/gve_main.c | 2 +-
drivers/net/ethernet/google/gve/gve_utils.c | 2 +
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 4 +-
.../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 +-
drivers/net/ethernet/intel/e1000/e1000_main.c | 10 +-
drivers/net/ethernet/intel/i40e/i40e.h | 11 +
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 12 -
drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 +-
drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +-
drivers/net/ethernet/intel/idpf/idpf_dev.c | 3 +
drivers/net/ethernet/intel/idpf/idpf_lib.c | 2 +-
.../net/ethernet/intel/idpf/idpf_singleq_txrx.c | 61 +-
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 782 ++++++++-------------
drivers/net/ethernet/intel/idpf/idpf_txrx.h | 95 ++-
drivers/net/ethernet/intel/idpf/idpf_vf_dev.c | 3 +
.../ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 8 +
drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 5 +
.../ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 97 ++-
.../ethernet/mellanox/mlx5/core/diag/fw_tracer.h | 1 +
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 6 +
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 48 +-
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.h | 1 +
drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c | 2 +
.../net/ethernet/mellanox/mlxsw/spectrum_router.c | 27 +-
drivers/net/ethernet/realtek/r8169_main.c | 5 +-
drivers/net/ethernet/smsc/smc91x.c | 10 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 17 +-
drivers/net/fjes/fjes_hw.c | 12 +-
drivers/net/ipvlan/ipvlan_core.c | 3 +
drivers/net/mdio/mdio-aspeed.c | 7 +
drivers/net/phy/marvell-88q2xxx.c | 2 +-
drivers/net/team/team_core.c | 2 +-
drivers/net/usb/asix_common.c | 5 +
drivers/net/usb/rtl8150.c | 2 +
drivers/net/usb/sr9700.c | 4 +-
drivers/net/usb/usbnet.c | 2 +
.../net/wireless/broadcom/brcm80211/brcmfmac/dmi.c | 14 +
drivers/net/wireless/mediatek/mt76/eeprom.c | 37 +-
drivers/net/wireless/mediatek/mt76/mt7615/main.c | 4 +-
drivers/net/wireless/mediatek/mt76/mt7615/pci.c | 6 +-
drivers/net/wireless/mediatek/mt76/mt7615/sdio.c | 4 +-
drivers/net/wireless/mediatek/mt76/mt7615/usb.c | 4 +-
.../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 4 +-
.../net/wireless/mediatek/mt76/mt76_connac_mcu.h | 3 +-
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 6 +-
drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 6 +-
drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 4 +-
drivers/net/wireless/mediatek/mt76/mt7925/init.c | 24 +-
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 51 +-
drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h | 21 +
drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 33 +-
drivers/net/wireless/mediatek/mt76/mt7925/usb.c | 20 +-
drivers/net/wireless/mediatek/mt76/mt792x.h | 2 +
drivers/net/wireless/realtek/rtl8xxxu/core.c | 7 +-
.../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 3 +-
drivers/net/wireless/realtek/rtw88/sdio.c | 4 +-
drivers/nfc/pn533/usb.c | 2 +-
drivers/nvme/host/fabrics.c | 2 +-
drivers/nvme/host/fc.c | 6 +-
drivers/of/fdt.c | 2 +-
drivers/parisc/gsc.c | 4 +-
drivers/pci/controller/pcie-brcmstb.c | 107 +--
drivers/pci/pci-driver.c | 4 +
drivers/perf/arm_cspmu/arm_cspmu.c | 4 +-
drivers/phy/broadcom/phy-bcm63xx-usbh.c | 6 +-
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 75 +-
drivers/platform/chrome/cros_ec_ishtp.c | 1 +
drivers/platform/mellanox/mlxbf-pmc.c | 14 +-
.../platform/x86/hp/hp-bioscfg/enum-attributes.c | 4 +-
.../platform/x86/hp/hp-bioscfg/int-attributes.c | 2 +-
.../x86/hp/hp-bioscfg/order-list-attributes.c | 5 +
.../x86/hp/hp-bioscfg/passwdobj-attributes.c | 5 +
.../platform/x86/hp/hp-bioscfg/string-attributes.c | 2 +-
drivers/platform/x86/ibm_rtl.c | 2 +-
drivers/platform/x86/intel/chtwc_int33fe.c | 29 +-
drivers/platform/x86/intel/hid.c | 12 +
drivers/platform/x86/msi-laptop.c | 3 +
drivers/pmdomain/imx/gpc.c | 5 +-
drivers/rpmsg/qcom_glink_native.c | 8 +
drivers/s390/block/dasd_eckd.c | 8 +
drivers/scsi/aic94xx/aic94xx_init.c | 3 +
drivers/scsi/mpi3mr/mpi/mpi30_ioc.h | 1 +
drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 +
drivers/scsi/qla2xxx/qla_def.h | 1 -
drivers/scsi/qla2xxx/qla_gbl.h | 2 +-
drivers/scsi/qla2xxx/qla_isr.c | 32 +-
drivers/scsi/qla2xxx/qla_mbx.c | 2 +
drivers/scsi/qla2xxx/qla_mid.c | 4 +-
drivers/scsi/qla2xxx/qla_os.c | 14 +-
drivers/scsi/scsi_debug.c | 2 +-
drivers/scsi/smartpqi/smartpqi_init.c | 4 +
drivers/soc/amlogic/meson-canvas.c | 5 +-
drivers/soc/apple/mailbox.c | 15 +-
drivers/soc/qcom/ocmem.c | 2 +-
drivers/soc/qcom/qcom-pbs.c | 2 +
drivers/soc/samsung/exynos-pmu.c | 2 +
drivers/soc/tegra/fuse/fuse-tegra.c | 2 -
drivers/soundwire/stream.c | 6 +-
drivers/spi/spi-cadence-quadspi.c | 4 +-
drivers/spi/spi-fsl-spi.c | 2 +-
drivers/staging/greybus/uart.c | 7 +-
drivers/target/target_core_transport.c | 1 +
drivers/tty/serial/serial_base_bus.c | 8 +-
drivers/tty/serial/serial_core.c | 7 +-
drivers/tty/serial/sh-sci.c | 2 +-
drivers/tty/serial/sprd_serial.c | 6 +
drivers/tty/serial/xilinx_uartps.c | 16 +-
drivers/tty/tty_port.c | 17 +-
drivers/ufs/core/ufshcd.c | 5 +-
drivers/ufs/host/ufs-mediatek.c | 5 +
drivers/usb/class/cdc-acm.c | 7 +-
drivers/usb/dwc3/dwc3-of-simple.c | 7 +-
drivers/usb/dwc3/gadget.c | 2 +-
drivers/usb/dwc3/host.c | 2 +-
drivers/usb/gadget/udc/lpc32xx_udc.c | 21 +-
drivers/usb/host/ohci-nxp.c | 2 +
drivers/usb/host/xhci-dbgtty.c | 2 +-
drivers/usb/host/xhci-hub.c | 2 +-
drivers/usb/phy/phy-fsl-usb.c | 1 +
drivers/usb/phy/phy-isp1301.c | 7 +-
drivers/usb/renesas_usbhs/pipe.c | 2 +
drivers/usb/serial/usb-serial.c | 7 +-
drivers/usb/storage/unusual_uas.h | 2 +-
drivers/usb/typec/altmodes/displayport.c | 8 +-
drivers/usb/typec/ucsi/ucsi.c | 6 +
drivers/usb/usbip/vhci_hcd.c | 6 +-
drivers/vdpa/octeon_ep/octep_vdpa_main.c | 1 +
drivers/vfio/pci/nvgrace-gpu/main.c | 4 +-
drivers/vfio/pci/pds/dirty.c | 7 +-
drivers/vfio/pci/vfio_pci_rdwr.c | 24 +-
drivers/vhost/vsock.c | 15 +-
drivers/video/fbdev/gbefb.c | 5 +-
drivers/video/fbdev/pxafb.c | 12 +-
drivers/video/fbdev/tcx.c | 2 +-
drivers/virtio/virtio_balloon.c | 4 +-
drivers/watchdog/via_wdt.c | 1 +
fs/btrfs/inode.c | 1 +
fs/btrfs/ioctl.c | 4 +-
fs/btrfs/scrub.c | 5 +
fs/btrfs/tree-log.c | 46 +-
fs/btrfs/volumes.c | 1 +
fs/erofs/zdata.c | 8 +-
fs/exfat/file.c | 5 +
fs/exfat/super.c | 19 +-
fs/ext4/ialloc.c | 1 -
fs/ext4/inode.c | 1 -
fs/ext4/mballoc.c | 2 +
fs/ext4/orphan.c | 4 +-
fs/ext4/super.c | 6 +-
fs/ext4/xattr.c | 6 +-
fs/f2fs/compress.c | 5 +-
fs/f2fs/data.c | 17 +
fs/f2fs/extent_cache.c | 5 +-
fs/f2fs/f2fs.h | 17 +-
fs/f2fs/file.c | 20 +-
fs/f2fs/gc.c | 2 +-
fs/f2fs/inode.c | 2 +-
fs/f2fs/namei.c | 6 +-
fs/f2fs/recovery.c | 20 +-
fs/f2fs/segment.c | 9 +-
fs/f2fs/super.c | 160 ++---
fs/f2fs/xattr.c | 30 +-
fs/f2fs/xattr.h | 10 +-
fs/fuse/file.c | 37 +-
fs/gfs2/glops.c | 3 +-
fs/gfs2/lops.c | 2 +-
fs/gfs2/quota.c | 2 +-
fs/gfs2/super.c | 4 +-
fs/hfsplus/bnode.c | 4 +-
fs/hfsplus/dir.c | 7 +-
fs/hfsplus/inode.c | 32 +-
fs/iomap/buffered-io.c | 41 +-
fs/iomap/direct-io.c | 10 +-
fs/jbd2/journal.c | 20 +-
fs/jbd2/transaction.c | 2 +-
fs/libfs.c | 50 +-
fs/lockd/svc4proc.c | 4 +-
fs/lockd/svclock.c | 21 +-
fs/lockd/svcproc.c | 5 +-
fs/locks.c | 12 +-
fs/nfs_common/nfslocalio.c | 10 +-
fs/nfsd/blocklayout.c | 3 +-
fs/nfsd/export.c | 2 +-
fs/nfsd/filecache.c | 2 +-
fs/nfsd/localio.c | 4 +-
fs/nfsd/netns.h | 11 +-
fs/nfsd/nfs4state.c | 4 +-
fs/nfsd/nfs4xdr.c | 5 +
fs/nfsd/nfssvc.c | 45 +-
fs/nfsd/vfs.h | 3 +-
fs/notify/fsnotify.c | 9 +-
fs/ntfs3/file.c | 14 +-
fs/ntfs3/frecord.c | 35 +-
fs/ntfs3/ntfs_fs.h | 9 +-
fs/ntfs3/run.c | 6 +-
fs/ntfs3/super.c | 5 +
fs/ocfs2/suballoc.c | 10 +
fs/smb/client/fs_context.c | 2 +
fs/smb/server/mgmt/tree_connect.c | 18 +-
fs/smb/server/mgmt/tree_connect.h | 1 -
fs/smb/server/mgmt/user_session.c | 4 +-
fs/smb/server/smb2pdu.c | 20 +-
fs/smb/server/vfs.c | 5 +-
fs/smb/server/vfs_cache.c | 88 ++-
fs/xfs/scrub/attr_repair.c | 2 +-
fs/xfs/xfs_attr_item.c | 2 +-
fs/xfs/xfs_buf_item.c | 1 +
fs/xfs/xfs_qm.c | 5 +-
include/drm/drm_buddy.h | 11 +-
include/drm/drm_edid.h | 6 +
include/linux/balloon_compaction.h | 43 +-
include/linux/compiler_types.h | 13 +
include/linux/fs.h | 2 +-
include/linux/genalloc.h | 1 +
include/linux/hrtimer.h | 23 +
include/linux/jbd2.h | 6 +
include/linux/kasan.h | 16 +
include/linux/nfslocalio.h | 12 +-
include/linux/reset.h | 1 +
include/linux/soundwire/sdw.h | 2 +-
include/linux/tpm.h | 8 +-
include/linux/tty_port.h | 21 +-
include/linux/vfio_pci_core.h | 10 +-
include/media/v4l2-mem2mem.h | 3 +-
include/net/ip.h | 6 +-
include/net/ip6_route.h | 4 +-
include/net/route.h | 2 +-
include/uapi/drm/xe_drm.h | 1 +
include/uapi/linux/mptcp.h | 1 +
io_uring/io_uring.c | 3 +
io_uring/openclose.c | 2 +-
io_uring/poll.c | 9 +-
kernel/kallsyms.c | 5 +-
kernel/livepatch/core.c | 8 +-
kernel/sched/cpudeadline.c | 34 +-
kernel/sched/cpudeadline.h | 4 +-
kernel/sched/deadline.c | 8 +-
kernel/sched/debug.c | 8 +-
kernel/sched/ext.c | 58 +-
kernel/sched/fair.c | 103 +--
kernel/sched/rt.c | 52 +-
kernel/sched/sched.h | 4 +-
kernel/scs.c | 2 +-
kernel/trace/fgraph.c | 10 +-
kernel/trace/trace_events.c | 2 +
kernel/trace/trace_events_synth.c | 1 -
lib/idr.c | 2 +
mm/balloon_compaction.c | 9 +-
mm/damon/tests/core-kunit.h | 99 ++-
mm/damon/tests/sysfs-kunit.h | 25 +
mm/damon/tests/vaddr-kunit.h | 26 +-
mm/kasan/common.c | 32 +
mm/kasan/hw_tags.c | 2 +-
mm/kasan/shadow.c | 4 +-
mm/ksm.c | 18 +-
mm/page_owner.c | 2 +-
mm/shmem.c | 24 +-
mm/vmalloc.c | 8 +-
net/bluetooth/rfcomm/tty.c | 7 +-
net/bridge/br_private.h | 1 +
net/caif/cffrml.c | 9 +-
net/ceph/osdmap.c | 116 ++-
net/core/sock.c | 16 +-
net/dsa/dsa.c | 8 +-
net/ethtool/ioctl.c | 30 +-
net/handshake/request.c | 8 +-
net/hsr/hsr_device.c | 7 +-
net/hsr/hsr_forward.c | 2 +
net/ipv4/fib_trie.c | 7 +-
net/ipv6/calipso.c | 3 +-
net/ipv6/exthdrs.c | 2 +-
net/ipv6/icmp.c | 4 +-
net/ipv6/ila/ila_lwt.c | 2 +-
net/ipv6/ioam6_iptunnel.c | 37 +-
net/ipv6/ip6_gre.c | 17 +-
net/ipv6/ip6_output.c | 19 +-
net/ipv6/ip6_tunnel.c | 4 +-
net/ipv6/ip6_udp_tunnel.c | 2 +-
net/ipv6/ip6_vti.c | 2 +-
net/ipv6/ndisc.c | 6 +-
net/ipv6/netfilter/nf_dup_ipv6.c | 2 +-
net/ipv6/output_core.c | 2 +-
net/ipv6/route.c | 33 +-
net/ipv6/rpl_iptunnel.c | 4 +-
net/ipv6/seg6_iptunnel.c | 20 +-
net/ipv6/seg6_local.c | 2 +-
net/mac80211/cfg.c | 10 -
net/mptcp/pm_netlink.c | 3 +-
net/mptcp/protocol.c | 22 +-
net/netfilter/ipvs/ip_vs_xmit.c | 3 +
net/netfilter/nf_conncount.c | 25 +-
net/netfilter/nf_nat_core.c | 14 +-
net/netfilter/nf_tables_api.c | 11 -
net/netfilter/nft_ct.c | 5 +
net/netrom/nr_out.c | 4 +-
net/nfc/core.c | 9 +-
net/openvswitch/flow_netlink.c | 13 +-
net/openvswitch/vport-netdev.c | 17 +-
net/rose/af_rose.c | 2 +-
net/sched/sch_ets.c | 6 +-
net/sunrpc/auth_gss/svcauth_gss.c | 3 +-
net/sunrpc/xprtrdma/svc_rdma_rw.c | 7 +-
net/wireless/core.c | 1 +
net/wireless/core.h | 1 +
net/wireless/mlme.c | 19 +
net/wireless/sme.c | 2 +-
net/wireless/util.c | 23 +-
samples/ftrace/ftrace-direct-modify.c | 8 +-
samples/ftrace/ftrace-direct-multi-modify.c | 8 +-
samples/ftrace/ftrace-direct-multi.c | 4 +-
samples/ftrace/ftrace-direct-too.c | 4 +-
samples/ftrace/ftrace-direct.c | 4 +-
scripts/Makefile.build | 26 +-
scripts/Makefile.modinst | 2 +-
scripts/faddr2line | 13 +-
security/keys/trusted-keys/trusted_tpm2.c | 6 +-
sound/isa/wavefront/wavefront_midi.c | 131 ++--
sound/isa/wavefront/wavefront_synth.c | 18 +-
sound/pci/hda/cs35l41_hda.c | 2 +
sound/pcmcia/pdaudiocf/pdaudiocf.c | 8 +-
sound/pcmcia/vx/vxpocket.c | 8 +-
sound/soc/codecs/ak4458.c | 4 -
sound/soc/codecs/lpass-tx-macro.c | 3 +-
sound/soc/codecs/wcd939x-sdw.c | 8 +-
sound/soc/qcom/qdsp6/q6adm.c | 146 ++--
sound/soc/qcom/qdsp6/q6apm-dai.c | 2 +
sound/soc/qcom/qdsp6/q6asm-dai.c | 7 +-
sound/soc/qcom/sc7280.c | 2 +-
sound/soc/qcom/sc8280xp.c | 2 +-
sound/soc/qcom/sdw.c | 107 +--
sound/soc/qcom/sdw.h | 1 +
sound/soc/qcom/sm8250.c | 2 +-
sound/soc/qcom/x1e80100.c | 2 +-
sound/soc/sh/rz-ssi.c | 64 +-
sound/soc/stm/stm32_sai.c | 14 +-
sound/soc/stm/stm32_sai_sub.c | 51 +-
sound/usb/mixer_us16x08.c | 20 +-
tools/lib/perf/cpumap.c | 10 +-
tools/mm/page_owner_sort.c | 6 +-
tools/testing/ktest/config-bisect.pl | 4 +-
tools/testing/nvdimm/test/nfit.c | 7 +-
tools/testing/radix-tree/idr-test.c | 21 +
.../test.d/ftrace/func_traceonoff_triggers.tc | 5 +-
tools/testing/selftests/iommu/iommufd.c | 54 +-
tools/testing/selftests/iommu/iommufd_fail_nth.c | 3 +-
tools/testing/selftests/iommu/iommufd_utils.h | 36 +-
tools/testing/selftests/net/mptcp/pm_netlink.sh | 4 +
tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 11 +
.../net/netfilter/conntrack_reverse_clash.c | 13 +-
.../net/netfilter/conntrack_reverse_clash.sh | 2 +
.../packetdrill/conntrack_syn_challenge_ack.pkt | 2 +-
tools/testing/selftests/net/tap.c | 16 +-
virt/kvm/kvm_main.c | 2 +-
607 files changed, 5906 insertions(+), 3784 deletions(-)Greg Kroah-Hartman
maintainerPATCH 1/567 btrfs: do not skip logging new dentries when logging a new name
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit 5630f7557de61264ccb4f031d4734a1a97eaed16 ]
When we are logging a directory and the log context indicates that we are logging a new name for some other file (that is or was inside that directory), we skip logging the inodes for new dentries in the directory.
This is ok most of the time, but if after the rename or link operation that triggered the logging of that directory, we have an explicit fsync of that directory without the directory inode being evicted and reloaded, we end up never logging the inodes for the new dentries that we found during the new name logging, as the next directory fsync will only process dentries that were added after the last time we logged the directory (we are doing an incremental directory logging).
So make sure we always log new dentries for a directory even if we are in a context of logging a new name.
We started skipping logging inodes for new dentries as of commit c48792c6ee7a ("btrfs: do not log new dentries when logging that a new name exists") and it was fine back then, because when logging a directory we always iterated over all the directory entries (for leaves changed in the current transaction) so a subsequent fsync would always log anything that was previously skipped while logging a directory when logging a new name (with btrfs_log_new_name()). But later support for incrementally logging a directory was added in commit dc2872247ec0 ("btrfs: keep track of the last logged keys when logging a directory"), to avoid checking all dir items every time we log a directory, so the check to skip dentry logging added in the first commit should have been removed when the incremental support for logging a directory was added.
A test case for fstests will follow soon.
--- fs/btrfs/tree-log.c | 8 -------- 1 file changed, 8 deletions(-)
fs/btrfs/tree-log.c +0 -8
@@ -5556,14 +5556,6 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans,struct btrfs_inode *curr_inode = start_inode;int ret =0 ; -/* -* If we are logging a new name, as part of a link or rename operation, -* don't bother logging new dentries, as we just want to log the names -* of an inode and that any new parents exist. -*/ -if (ctx->logging_new_name) -return 0 ; - path =btrfs_alloc_path ();if (!path)return -ENOMEM ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 2/567 btrfs: fix a potential path leak in print_data_reloc_error()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
[ Upstream commit 313ef70a9f0f637a09d9ef45222f5bdcf30a354b ]
Inside print_data_reloc_error(), if extent_from_logical() failed we return immediately.
However there are the following cases where extent_from_logical() can return error but still holds a path:
- btrfs_search_slot() returned 0
- No backref item found in extent tree
- No flags_ret provided
This is not possible in this call site though.
So for the above two cases, we can return without releasing the path, causing extent buffer leaks.
--- fs/btrfs/inode.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/inode.c +1 -0
@@ -253,6 +253,7 @@ static void print_data_reloc_error(const struct btrfs_inode *inode, u64 file_offif (ret <0 ) {btrfs_err_rl (fs_info,"failed to lookup extent item for logical %llu: %d" , logical, ret); +btrfs_release_path (&path);return ; } eb = path.nodes[0 ];
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 3/567 bpf, arm64: Do not audit capability check in do_jit()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ondrej Mosnacek <[email protected]>
[ Upstream commit 189e5deb944a6f9c7992355d60bffd8ec2e54a9c ]
Analogically to the x86 commit 881a9c9cb785 ("bpf: Do not audit capability check in do_jit()"), change the capable() call to ns_capable_noaudit() in order to avoid spurious SELinux denials in audit log.
The commit log from that commit applies here as well:
"""
The failure of this check only results in a security mitigation being applied, slightly affecting performance of the compiled BPF program. It doesn't result in a failed syscall, an thus auditing a failed LSM permission check for it is unwanted. For example with SELinux, it causes a denial to be reported for confined processes running as root, which tends to be flagged as a problem to be fixed in the policy. Yet dontauditing or allowing CAP_SYS_ADMIN to the domain may not be desirable, as it would allow/silence also other checks - either going against the principle of least privilege or making debugging potentially harder.
Fix it by changing it from capable() to ns_capable_noaudit(), which instructs the LSMs to not audit the resulting denials. """
--- arch/arm64/net/bpf_jit_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/net/bpf_jit_comp.c +1 -1
@@ -871,7 +871,7 @@ static void __maybe_unused build_bhb_mitigation(struct jit_ctx *ctx) arm64_get_spectre_v2_state() == SPECTRE_VULNERABLE)return ; -if (capable (CAP_SYS_ADMIN )) +if (ns_capable_noaudit (&init_user_ns,CAP_SYS_ADMIN ))return ;if (supports_clearbhb (SCOPE_SYSTEM )) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 4/567 btrfs: fix memory leak of fs_devices in degraded seed device path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepanshu Kartikey <[email protected]>
[ Upstream commit b57f2ddd28737db6ff0e9da8467f0ab9d707e997 ]
In open_seed_devices(), when find_fsid() fails and we're in DEGRADED mode, a new fs_devices is allocated via alloc_fs_devices() but is never added to the seed_list before returning. This contrasts with the normal path where fs_devices is properly added via list_add().
If any error occurs later in read_one_dev() or btrfs_read_chunk_tree(), the cleanup code iterates seed_list to free seed devices, but this orphaned fs_devices is never found and never freed, causing a memory leak. Any devices allocated via add_missing_dev() and attached to this fs_devices are also leaked.
Fix this by adding the newly allocated fs_devices to seed_list in the degraded path, consistent with the normal path.
--- fs/btrfs/volumes.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/volumes.c +1 -0
@@ -7071,6 +7071,7 @@ static struct btrfs_fs_devices *open_seed_devices(struct btrfs_fs_info *fs_info, fs_devices->seeding = true; fs_devices->opened =1 ; +list_add (&fs_devices->seed_list, &fs_info->fs_devices->seed_list);return fs_devices; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 5/567 shmem: fix recovery on rename failures
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit e1b4c6a58304fd490124cc2b454d80edc786665c ]
maple_tree insertions can fail if we are seriously short on memory; simple_offset_rename() does not recover well if it runs into that. The same goes for simple_offset_rename_exchange().
Moreover, shmem_whiteout() expects that if it succeeds, the caller will progress to d_move(), i.e. that shmem_rename2() won't fail past the successful call of shmem_whiteout().
Not hard to fix, fortunately - mtree_store() can't fail if the index we are trying to store into is already present in the tree as a singleton.
For simple_offset_rename_exchange() that's enough - we just need to be careful about the order of operations.
For simple_offset_rename() solution is to preinsert the target into the tree for new_dir; the rest can be done without any potentially failing operations.
That preinsertion has to be done in shmem_rename2() rather than in simple_offset_rename() itself - otherwise we'd need to deal with the possibility of failure after successful shmem_whiteout().
--- fs/libfs.c | 50 +++++++++++++++++++--------------------------- include/linux/fs.h | 2 +- mm/shmem.c | 18 ++++++++++++----- 3 files changed, 35 insertions(+), 35 deletions(-)
fs/libfs.c +21 -29
@@ -345,22 +345,22 @@ void simple_offset_remove(struct offset_ctx *octx, struct dentry *dentry)* User space expects the directory offset value of the replaced * (new) directory entry to be unchanged after a rename. * -* Returns zero on success, a negative errno value on failure. +* Caller must have grabbed a slot for new_dentry in the maple_tree +* associated with new_dir, even if dentry is negative. */ -int simple_offset_rename (struct inode *old_dir,struct dentry *old_dentry, -struct inode *new_dir,struct dentry *new_dentry) +void simple_offset_rename (struct inode *old_dir,struct dentry *old_dentry, +struct inode *new_dir,struct dentry *new_dentry) {struct offset_ctx *old_ctx = old_dir->i_op->get_offset_ctx (old_dir);struct offset_ctx *new_ctx = new_dir->i_op->get_offset_ctx (new_dir);long new_offset =dentry2offset (new_dentry); -simple_offset_remove (old_ctx, old_dentry); +if (WARN_ON (!new_offset)) +return ; -if (new_offset) { -offset_set (new_dentry,0 ); -return simple_offset_replace (new_ctx, old_dentry, new_offset); - } -return simple_offset_add (new_ctx, old_dentry); +simple_offset_remove (old_ctx, old_dentry); +offset_set (new_dentry,0 ); +WARN_ON (simple_offset_replace (new_ctx, old_dentry, new_offset)); }/**
@@ -387,31 +387,23 @@ int simple_offset_rename_exchange(struct inode *old_dir,long new_index =dentry2offset (new_dentry);int ret; -simple_offset_remove (old_ctx, old_dentry); -simple_offset_remove (new_ctx, new_dentry); +if (WARN_ON (!old_index || !new_index)) +return -EINVAL ; - ret =simple_offset_replace (new_ctx, old_dentry, new_index); -if (ret) - goto out_restore; + ret =mtree_store (&new_ctx->mt, new_index, old_dentry,GFP_KERNEL ); +if (WARN_ON (ret)) +return ret; - ret =simple_offset_replace (old_ctx, new_dentry, old_index); -if (ret) { -simple_offset_remove (new_ctx, old_dentry); - goto out_restore; + ret =mtree_store (&old_ctx->mt, old_index, new_dentry,GFP_KERNEL ); +if (WARN_ON (ret)) { +mtree_store (&new_ctx->mt, new_index, new_dentry,GFP_KERNEL ); +return ret; } - ret =simple_rename_exchange (old_dir, old_dentry, new_dir, new_dentry); -if (ret) { -simple_offset_remove (new_ctx, old_dentry); -simple_offset_remove (old_ctx, new_dentry); - goto out_restore; - } +offset_set (old_dentry, new_index); +offset_set (new_dentry, old_index); +simple_rename_exchange (old_dir, old_dentry, new_dir, new_dentry);return 0 ; - -out_restore: - (void )simple_offset_replace (old_ctx, old_dentry, old_index); - (void )simple_offset_replace (new_ctx, new_dentry, new_index); -return ret; }/**
include/linux/fs.h +1 -1
@@ -3446,7 +3446,7 @@ struct offset_ctx {void simple_offset_init (struct offset_ctx *octx);int simple_offset_add (struct offset_ctx *octx,struct dentry *dentry);void simple_offset_remove (struct offset_ctx *octx,struct dentry *dentry); -int simple_offset_rename (struct inode *old_dir,struct dentry *old_dentry, +void simple_offset_rename (struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry); int simple_offset_rename_exchange(struct inode *old_dir, struct dentry *old_dentry,
mm/shmem.c +13 -5
@@ -3749,6 +3749,7 @@ static int shmem_rename2(struct mnt_idmap *idmap, {struct inode *inode =d_inode (old_dentry);int they_are_dirs =S_ISDIR (inode->i_mode); +bool had_offset = false;int error;if (flags & ~(RENAME_NOREPLACE |RENAME_EXCHANGE |RENAME_WHITEOUT ))
@@ -3761,16 +3762,23 @@ static int shmem_rename2(struct mnt_idmap *idmap,if (!simple_empty (new_dentry))return -ENOTEMPTY ; + error =simple_offset_add (shmem_get_offset_ctx (new_dir), new_dentry); +if (error == -EBUSY ) + had_offset = true; +else if (unlikely (error)) +return error; +if (flags &RENAME_WHITEOUT ) { error =shmem_whiteout (idmap, old_dir, old_dentry); -if (error) +if (error) { +if (!had_offset) +simple_offset_remove (shmem_get_offset_ctx (new_dir), + new_dentry);return error; + } } - error =simple_offset_rename (old_dir, old_dentry, new_dir, new_dentry); -if (error) -return error; - +simple_offset_rename (old_dir, old_dentry, new_dir, new_dentry);if (d_really_is_positive (new_dentry)) { (void )shmem_unlink (new_dir, new_dentry);if (they_are_dirs) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 6/567 iomap: adjust read range correctly for non-block-aligned positions
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joanne Koong <[email protected]>
[ Upstream commit 7aa6bc3e8766990824f66ca76c19596ce10daf3e ]
iomap_adjust_read_range() assumes that the position and length passed in are block-aligned. This is not always the case however, as shown in the syzbot generated case for erofs. This causes too many bytes to be skipped for uptodate blocks, which results in returning the incorrect position and length to read in. If all the blocks are uptodate, this underflows length and returns a position beyond the folio.
Fix the calculation to also take into account the block offset when calculating how many bytes can be skipped for uptodate blocks.
--- fs/iomap/buffered-io.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
fs/iomap/buffered-io.c +13 -6
@@ -250,17 +250,24 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,* to avoid reading in already uptodate ranges. */ if (ifs) { -unsigned int i; +unsigned int i, blocks_skipped;/* move forward for each leading block marked uptodate */ -for (i = first; i <= last; i++) { +for (i = first; i <= last; i++)if (!ifs_block_is_uptodate (ifs, i))break ; - *pos += block_size; - poff += block_size; - plen -= block_size; - first++; + + blocks_skipped = i - first; +if (blocks_skipped) { +unsigned long block_offset = *pos & (block_size -1 ); +unsigned bytes_skipped = + (blocks_skipped << block_bits) - block_offset; + + *pos += bytes_skipped; + poff += bytes_skipped; + plen -= bytes_skipped; } + first = i;/* truncate len if we find any trailing uptodate block(s) */ while (++i <= last) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 7/567 iomap: account for unaligned end offsets when truncating read range
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joanne Koong <[email protected]>
[ Upstream commit 9d875e0eef8ec15b6b1da0cb9a0f8ed13efee89e ]
The end position to start truncating from may be at an offset into a block, which under the current logic would result in overtruncation.
Adjust the calculation to account for unaligned end offsets.
--- fs/iomap/buffered-io.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
fs/iomap/buffered-io.c +20 -2
@@ -227,6 +227,22 @@ static void ifs_free(struct folio *folio)kfree (ifs); } +/* +* Calculate how many bytes to truncate based off the number of blocks to +* truncate and the end position to start truncating from. +*/ +static size_t iomap_bytes_to_truncate (loff_t end_pos,unsigned block_bits, +unsigned blocks_truncated) +{ +unsigned block_size =1 << block_bits; +unsigned block_offset = end_pos & (block_size -1 ); + +if (!block_offset) +return blocks_truncated << block_bits; + +return ((blocks_truncated -1 ) << block_bits) + block_offset; +} +/* * Calculate the range inside the folio that we actually need to read. */
@@ -272,7 +288,8 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,/* truncate len if we find any trailing uptodate block(s) */ while (++i <= last) {if (ifs_block_is_uptodate (ifs, i)) { - plen -= (last - i +1 ) * block_size; + plen -=iomap_bytes_to_truncate (*pos + plen, + block_bits, last - i +1 ); last = i -1 ;break ; }
@@ -288,7 +305,8 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,unsigned end =offset_in_folio (folio, isize -1 ) >> block_bits;if (first <= end && last > end) - plen -= (last - end) * block_size; + plen -=iomap_bytes_to_truncate (*pos + plen, block_bits, + last - end); } *offp = poff;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 8/567 scripts/faddr2line: Fix "Argument list too long" error
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pankaj Raghav <[email protected]>
[ Upstream commit ff5c0466486ba8d07ab2700380e8fd6d5344b4e9 ]
The run_readelf() function reads the entire output of readelf into a single shell variable. For large object files with extensive debug information, the size of this variable can exceed the system's command-line argument length limit.
When this variable is subsequently passed to sed via echo "${out}", it triggers an "Argument list too long" error, causing the script to fail.
Fix this by redirecting the output of readelf to a temporary file instead of a variable. The sed commands are then modified to read from this file, avoiding the argument length limitation entirely.
--- scripts/faddr2line | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
scripts/faddr2line +9 -4
@@ -107,14 +107,19 @@ find_dir_prefix() { run_readelf() { local objfile=$1 - local out=$(${READELF} --file-header --section-headers --symbols --wide $objfile) + local tmpfile + tmpfile=$(mktemp) + + ${READELF} --file-header --section-headers --symbols --wide "$objfile" > "$tmpfile" # This assumes that readelf first prints the file header, then the section headers, then the symbols. # Note: It seems that GNU readelf does not prefix section headers with the "There are X section headers" # line when multiple options are given, so let's also match with the "Section Headers:" line. - ELF_FILEHEADER=$(echo "${out}" | sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/q;p') - ELF_SECHEADERS=$(echo "${out}" | sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/,$p' | sed -n '/Symbol table .* contains [0-9]* entries:/q;p') - ELF_SYMS=$(echo "${out}" | sed -n '/Symbol table .* contains [0-9]* entries:/,$p') + ELF_FILEHEADER=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/q;p' "$tmpfile") + ELF_SECHEADERS=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/,$p' "$tmpfile" | sed -n '/Symbol table .* contains [0-9]* entries:/q;p') + ELF_SYMS=$(sed -n '/Symbol table .* contains [0-9]* entries:/,$p' "$tmpfile") + + rm -f -- "$tmpfile" } check_vmlinux() {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 9/567 perf/x86/amd: Check event before enable to avoid GPF
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: George Kennedy <[email protected]>
[ Upstream commit 866cf36bfee4fba6a492d2dcc5133f857e3446b0 ]
On AMD machines cpuc->events[idx] can become NULL in a subtle race condition with NMI->throttle->x86_pmu_stop().
Check event for NULL in amd_pmu_enable_all() before enable to avoid a GPF. This appears to be an AMD only issue.
Syzkaller reported a GPF in amd_pmu_enable_all.
INFO: NMI handler (perf_event_nmi_handler) took too long to run: 13.143
msecs
Oops: general protection fault, probably for non-canonical address
0xdffffc0000000034: 0000 PREEMPT SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x00000000000001a0-0x00000000000001a7]
CPU: 0 UID: 0 PID: 328415 Comm: repro_36674776 Not tainted 6.12.0-rc1-syzk
RIP: 0010:x86_pmu_enable_event (arch/x86/events/perf_event.h:1195
arch/x86/events/core.c:1430)
RSP: 0018:ffff888118009d60 EFLAGS: 00010012
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000034 RSI: 0000000000000000 RDI: 00000000000001a0
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000002
R13: ffff88811802a440 R14: ffff88811802a240 R15: ffff8881132d8601
FS: 00007f097dfaa700(0000) GS:ffff888118000000(0000) GS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200001c0 CR3: 0000000103d56000 CR4: 00000000000006f0
Call Trace:
<IRQ>
amd_pmu_enable_all (arch/x86/events/amd/core.c:760 (discriminator 2))
x86_pmu_enable (arch/x86/events/core.c:1360)
event_sched_out (kernel/events/core.c:1191 kernel/events/core.c:1186
kernel/events/core.c:2346)
__perf_remove_from_context (kernel/events/core.c:2435)
event_function (kernel/events/core.c:259)
remote_function (kernel/events/core.c:92 (discriminator 1)
kernel/events/core.c:72 (discriminator 1))
__flush_smp_call_function_queue (./arch/x86/include/asm/jump_label.h:27
./include/linux/jump_label.h:207 ./include/trace/events/csd.h:64
kernel/smp.c:135 kernel/smp.c:540)
__sysvec_call_function_single (./arch/x86/include/asm/jump_label.h:27
./include/linux/jump_label.h:207
./arch/x86/include/asm/trace/irq_vectors.h:99 arch/x86/kernel/smp.c:272)
sysvec_call_function_single (arch/x86/kernel/smp.c:266 (discriminator 47)
arch/x86/kernel/smp.c:266 (discriminator 47))
</IRQ>--- arch/x86/events/amd/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/events/amd/core.c +6 -1
@@ -762,7 +762,12 @@ static void amd_pmu_enable_all(int added)if (!test_bit (idx, cpuc->active_mask))continue ; -amd_pmu_enable_event (cpuc->events[idx]); +/* +* FIXME: cpuc->events[idx] can become NULL in a subtle race +* condition with NMI->throttle->x86_pmu_stop(). +*/ +if (cpuc->events[idx]) +amd_pmu_enable_event (cpuc->events[idx]); } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 10/567 sched/deadline: only set free_cpus for online runqueues
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Doug Berger <[email protected]>
[ Upstream commit 382748c05e58a9f1935f5a653c352422375566ea ]
Commit 16b269436b72 ("sched/deadline: Modify cpudl::free_cpus to reflect rd->online") introduced the cpudl_set/clear_freecpu functions to allow the cpu_dl::free_cpus mask to be manipulated by the deadline scheduler class rq_on/offline callbacks so the mask would also reflect this state.
Commit 9659e1eeee28 ("sched/deadline: Remove cpu_active_mask from cpudl_find()") removed the check of the cpu_active_mask to save some processing on the premise that the cpudl::free_cpus mask already reflected the runqueue online state.
Unfortunately, there are cases where it is possible for the cpudl_clear function to set the free_cpus bit for a CPU when the deadline runqueue is offline. When this occurs while a CPU is connected to the default root domain the flag may retain the bad state after the CPU has been unplugged. Later, a different CPU that is transitioning through the default root domain may push a deadline task to the powered down CPU when cpudl_find sees its free_cpus bit is set. If this happens the task will not have the opportunity to run.
One example is outlined here:
https://lore.kernel.org/lkml/[email protected]
Another occurs when the last deadline task is migrated from a CPU that has an offlined runqueue. The dequeue_task member of the deadline scheduler class will eventually call cpudl_clear and set the free_cpus bit for the CPU.
This commit modifies the cpudl_clear function to be aware of the online state of the deadline runqueue so that the free_cpus mask can be updated appropriately.
It is no longer necessary to manage the mask outside of the cpudl_set/clear functions so the cpudl_set/clear_freecpu functions are removed. In addition, since the free_cpus mask is now only updated under the cpudl lock the code was changed to use the non-atomic __cpumask functions.
--- kernel/sched/cpudeadline.c | 34 +++++++++------------------------- kernel/sched/cpudeadline.h | 4 +--- kernel/sched/deadline.c | 8 ++++---- 3 files changed, 14 insertions(+), 32 deletions(-)
kernel/sched/cpudeadline.c +9 -25
@@ -165,12 +165,13 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p,* cpudl_clear - remove a CPU from the cpudl max-heap * @cp: the cpudl max-heap context * @cpu: the target CPU +* @online: the online state of the deadline runqueue * * Notes: assumes cpu_rq(cpu)->lock is locked * * Returns: (void) */ -void cpudl_clear (struct cpudl *cp,int cpu) +void cpudl_clear (struct cpudl *cp,int cpu,bool online) {int old_idx, new_cpu;unsigned long flags;
@@ -183,7 +184,7 @@ void cpudl_clear(struct cpudl *cp, int cpu)if (old_idx ==IDX_INVALID ) {/* * Nothing to remove if old_idx was invalid. -* This could happen if a rq_offline_dl is +* This could happen if rq_online_dl or rq_offline_dl is * called for a CPU without -dl tasks running. */ }else {
@@ -194,9 +195,12 @@ void cpudl_clear(struct cpudl *cp, int cpu) cp->elements[new_cpu].idx = old_idx; cp->elements[cpu].idx =IDX_INVALID ;cpudl_heapify (cp, old_idx); - -cpumask_set_cpu (cpu, cp->free_cpus); } +if (likely (online)) +__cpumask_set_cpu (cpu, cp->free_cpus); +else +__cpumask_clear_cpu (cpu, cp->free_cpus); +raw_spin_unlock_irqrestore (&cp->lock, flags); }
@@ -227,7 +231,7 @@ void cpudl_set(struct cpudl *cp, int cpu, u64 dl) cp->elements[new_idx].cpu = cpu; cp->elements[cpu].idx = new_idx;cpudl_heapify_up (cp, new_idx); -cpumask_clear_cpu (cpu, cp->free_cpus); +__cpumask_clear_cpu (cpu, cp->free_cpus); }else { cp->elements[old_idx].dl = dl;cpudl_heapify (cp, old_idx);
@@ -236,26 +240,6 @@ void cpudl_set(struct cpudl *cp, int cpu, u64 dl)raw_spin_unlock_irqrestore (&cp->lock, flags); } -/* -* cpudl_set_freecpu - Set the cpudl.free_cpus -* @cp: the cpudl max-heap context -* @cpu: rd attached CPU -*/ -void cpudl_set_freecpu (struct cpudl *cp,int cpu) -{ -cpumask_set_cpu (cpu, cp->free_cpus); -} - -/* -* cpudl_clear_freecpu - Clear the cpudl.free_cpus -* @cp: the cpudl max-heap context -* @cpu: rd attached CPU -*/ -void cpudl_clear_freecpu (struct cpudl *cp,int cpu) -{ -cpumask_clear_cpu (cpu, cp->free_cpus); -} -/* * cpudl_init - initialize the cpudl structure * @cp: the cpudl max-heap context
kernel/sched/cpudeadline.h +1 -3
@@ -18,9 +18,7 @@ struct cpudl {#ifdef CONFIG_SMP int cpudl_find (struct cpudl *cp,struct task_struct *p,struct cpumask *later_mask);void cpudl_set (struct cpudl *cp,int cpu,u64 dl); -void cpudl_clear (struct cpudl *cp,int cpu); +void cpudl_clear (struct cpudl *cp,int cpu,bool online);int cpudl_init (struct cpudl *cp); -void cpudl_set_freecpu (struct cpudl *cp,int cpu); -void cpudl_clear_freecpu (struct cpudl *cp,int cpu);void cpudl_cleanup (struct cpudl *cp);#endif /* CONFIG_SMP */
kernel/sched/deadline.c +4 -4
@@ -1852,7 +1852,7 @@ static void dec_dl_deadline(struct dl_rq *dl_rq, u64 deadline)if (!dl_rq->dl_nr_running) { dl_rq->earliest_dl.curr =0 ; dl_rq->earliest_dl.next =0 ; -cpudl_clear (&rq->rd->cpudl, rq->cpu); +cpudl_clear (&rq->rd->cpudl, rq->cpu, rq->online);cpupri_set (&rq->rd->cpupri, rq->cpu, rq->rt.highest_prio.curr); }else {struct rb_node *leftmost =rb_first_cached (&dl_rq->root);
@@ -2950,9 +2950,10 @@ static void rq_online_dl(struct rq *rq)if (rq->dl.overloaded)dl_set_overload (rq); -cpudl_set_freecpu (&rq->rd->cpudl, rq->cpu);if (rq->dl.dl_nr_running >0 )cpudl_set (&rq->rd->cpudl, rq->cpu, rq->dl.earliest_dl.curr); +else +cpudl_clear (&rq->rd->cpudl, rq->cpu, true); }/* Assumes rq->lock is held */
@@ -2961,8 +2962,7 @@ static void rq_offline_dl(struct rq *rq)if (rq->dl.overloaded)dl_clear_overload (rq); -cpudl_clear (&rq->rd->cpudl, rq->cpu); -cpudl_clear_freecpu (&rq->rd->cpudl, rq->cpu); +cpudl_clear (&rq->rd->cpudl, rq->cpu, false); }void __init init_sched_dl_class (void )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 11/567 sched/fair: Revert max_newidle_lb_cost bump
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit d206fbad9328ddb68ebabd7cf7413392acd38081 ]
Many people reported regressions on their database workloads due to:
155213a2aed4 ("sched/fair: Bump sd->max_newidle_lb_cost when newidle balance fails")
For instance Adam Li reported a 6% regression on SpecJBB.
Conversely this will regress schbench again; on my machine from 2.22 Mrps/s down to 2.04 Mrps/s.
--- kernel/sched/fair.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-)
kernel/sched/fair.c +3 -16
@@ -12238,14 +12238,8 @@ static inline bool update_newidle_cost(struct sched_domain *sd, u64 cost)/* * Track max cost of a domain to make sure to not delay the * next wakeup on the CPU. -* -* sched_balance_newidle() bumps the cost whenever newidle -* balance fails, and we don't want things to grow out of -* control. Use the sysctl_sched_migration_cost as the upper -* limit, plus a litle extra to avoid off by ones. */ - sd->max_newidle_lb_cost = -min (cost, sysctl_sched_migration_cost +200 ); + sd->max_newidle_lb_cost = cost; sd->last_decay_max_lb_cost = jiffies; }else if (time_after (jiffies, sd->last_decay_max_lb_cost +HZ )) {/*
@@ -12950,17 +12944,10 @@ static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf) t1 =sched_clock_cpu (this_cpu); domain_cost = t1 - t0; +update_newidle_cost (sd, domain_cost); + curr_cost += domain_cost; t0 = t1; - -/* -* Failing newidle means it is not effective; -* bump the cost so we end up doing less of it. -*/ -if (!pulled_task) - domain_cost = (3 * sd->max_newidle_lb_cost) /2 ; - -update_newidle_cost (sd, domain_cost); }/*
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 12/567 x86/ptrace: Always inline trivial accessors
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit 1fe4002cf7f23d70c79bda429ca2a9423ebcfdfa ]
A KASAN build bloats these single load/store helpers such that it fails to inline them:
vmlinux.o: error: objtool: irqentry_exit+0x5e8: call to instruction_pointer_set() with UACCESS enabled
Make sure the compiler isn't allowed to do stupid.
--- arch/x86/include/asm/ptrace.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
arch/x86/include/asm/ptrace.h +10 -10
@@ -187,12 +187,12 @@ convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs);extern void send_sigtrap (struct pt_regs *regs,int error_code,int si_code); -static inline unsigned long regs_return_value (struct pt_regs *regs) +static __always_inline unsigned long regs_return_value (struct pt_regs *regs) {return regs->ax; } -static inline void regs_set_return_value (struct pt_regs *regs,unsigned long rc) +static __always_inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc) { regs->ax = rc; }
@@ -277,34 +277,34 @@ static __always_inline bool ip_within_syscall_gap(struct pt_regs *regs) }#endif -static inline unsigned long kernel_stack_pointer (struct pt_regs *regs) +static __always_inline unsigned long kernel_stack_pointer (struct pt_regs *regs) {return regs->sp; } -static inline unsigned long instruction_pointer (struct pt_regs *regs) +static __always_inline unsigned long instruction_pointer (struct pt_regs *regs) {return regs->ip; } -static inline void instruction_pointer_set (struct pt_regs *regs, -unsigned long val) +static __always_inline +void instruction_pointer_set(struct pt_regs *regs, unsigned long val) { regs->ip = val; } -static inline unsigned long frame_pointer (struct pt_regs *regs) +static __always_inline unsigned long frame_pointer (struct pt_regs *regs) {return regs->bp; } -static inline unsigned long user_stack_pointer (struct pt_regs *regs) +static __always_inline unsigned long user_stack_pointer (struct pt_regs *regs) {return regs->sp; } -static inline void user_stack_pointer_set (struct pt_regs *regs, -unsigned long val) +static __always_inline +void user_stack_pointer_set(struct pt_regs *regs, unsigned long val) { regs->sp = val; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 13/567 ACPICA: Avoid walking the Namespace if start_node is NULL
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cryolitia PukNgae <[email protected]>
[ Upstream commit 9d6c58dae8f6590c746ac5d0012ffe14a77539f0 ]
Although commit 0c9992315e73 ("ACPICA: Avoid walking the ACPI Namespace if it is not there") fixed the situation when both start_node and acpi_gbl_root_node are NULL, the Linux kernel mainline now still crashed on Honor Magicbook 14 Pro [1].
That happens due to the access to the member of parent_node in acpi_ns_get_next_node(). The NULL pointer dereference will always happen, no matter whether or not the start_node is equal to ACPI_ROOT_OBJECT, so move the check of start_node being NULL out of the if block.
Unfortunately, all the attempts to contact Honor have failed, they refused to provide any technical support for Linux.
The bad DSDT table's dump could be found on GitHub [2].
DMI: HONOR FMB-P/FMB-P-PCB, BIOS 1.13 05/08/2025
--- drivers/acpi/acpica/nswalk.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/acpi/acpica/nswalk.c +6 -3
@@ -169,9 +169,12 @@ acpi_ns_walk_namespace(acpi_object_type type,if (start_node ==ACPI_ROOT_OBJECT ) { start_node = acpi_gbl_root_node; -if (!start_node) { -return_ACPI_STATUS (AE_NO_NAMESPACE ); - } + } + +/* Avoid walking the namespace if the StartNode is NULL */ + +if (!start_node) { +return_ACPI_STATUS (AE_NO_NAMESPACE ); }/* Null child means "get first node" */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 14/567 ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sakari Ailus <[email protected]>
[ Upstream commit 5d010473cdeaabf6a2d3a9e2aed2186c1b73c213 ]
Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode property API is somewhat problematic as the latter is used in the impelementation of the former. Instead of using fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call acpi_get_next_subnode() directly instead.
--- drivers/acpi/property.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/acpi/property.c +4 -4
@@ -1441,7 +1441,7 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(if (!prev) { do { - port = fwnode_get_next_child_node(fwnode, port); + port = acpi_get_next_subnode(fwnode, port); /* * The names of the port nodes begin with "port@" * followed by the number of the port node and they also
@@ -1459,13 +1459,13 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(if (!port)return NULL ; - endpoint =fwnode_get_next_child_node (port, prev); + endpoint =acpi_get_next_subnode (port, prev);while (!endpoint) { - port =fwnode_get_next_child_node (fwnode, port); + port =acpi_get_next_subnode (fwnode, port);if (!port)break ;if (is_acpi_graph_node (port,"port" )) - endpoint =fwnode_get_next_child_node (port,NULL ); + endpoint =acpi_get_next_subnode (port,NULL ); }/*
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 15/567 cpufreq: dt-platdev: Add JH7110S SOC to the allowlist
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hal Feng <[email protected]>
[ Upstream commit 6e7970cab51d01b8f7c56f120486c571c22e1b80 ]
Add the compatible strings for supporting the generic cpufreq driver on the StarFive JH7110S SoC.
--- drivers/cpufreq/cpufreq-dt-platdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/cpufreq-dt-platdev.c +1 -0
@@ -87,6 +87,7 @@ static const struct of_device_id allowlist[] __initconst = { { .compatible = "st-ericsson,u9540", }, { .compatible = "starfive,jh7110", }, + { .compatible = "starfive,jh7110s", }, { .compatible = "ti,omap2", }, { .compatible = "ti,omap4", },
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 16/567 ACPI: fan: Workaround for 64-bit firmware bug
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Armin Wolf <[email protected]>
[ Upstream commit 2e00f7a4bb0ac25ec7477b55fe482da39fb4dce8 ]
Some firmware implementations use the "Ones" ASL opcode to produce an integer with all bits set in order to indicate missing speed or power readings. This however only works when using 32-bit integers, as the ACPI spec requires a 32-bit integer (0xFFFFFFFF) to be returned for missing speed/power readings. With 64-bit integers the "Ones" opcode produces a 64-bit integer with all bits set, violating the ACPI spec regarding the placeholder value for missing readings.
Work around such buggy firmware implementation by also checking for 64-bit integers with all bits set when reading _FST.
--- drivers/acpi/fan.h | 33 +++++++++++++++++++++++++++++++++ drivers/acpi/fan_hwmon.c | 10 +++------- 2 files changed, 36 insertions(+), 7 deletions(-)
drivers/acpi/fan.h +33 -0
@@ -11,6 +11,7 @@#define _ACPI_FAN_H_#include <linux/kconfig.h> +#include <linux/limits.h> #define ACPI_FAN_DEVICE_IDS \ {"INT3404", },/* Fan */ \
@@ -58,6 +59,38 @@ struct acpi_fan {struct device_attribute fine_grain_control; }; +/** +* acpi_fan_speed_valid - Check if fan speed value is valid +* @speeed: Speed value returned by the ACPI firmware +* +* Check if the fan speed value returned by the ACPI firmware is valid. This function is +* necessary as ACPI firmware implementations can return 0xFFFFFFFF to signal that the +* ACPI fan does not support speed reporting. Additionally, some buggy ACPI firmware +* implementations return a value larger than the 32-bit integer value defined by +* the ACPI specification when using placeholder values. Such invalid values are also +* detected by this function. +* +* Returns: True if the fan speed value is valid, false otherwise. +*/ +static inline bool acpi_fan_speed_valid (u64 speed) +{ +return speed <U32_MAX ; +} + +/** +* acpi_fan_power_valid - Check if fan power value is valid +* @power: Power value returned by the ACPI firmware +* +* Check if the fan power value returned by the ACPI firmware is valid. +* See acpi_fan_speed_valid() for details. +* +* Returns: True if the fan power value is valid, false otherwise. +*/ +static inline bool acpi_fan_power_valid (u64 power) +{ +return power <U32_MAX ; +} +int acpi_fan_get_fst (acpi_handle handle,struct acpi_fan_fst *fst);int acpi_fan_create_attributes (struct acpi_device *device);void acpi_fan_delete_attributes (struct acpi_device *device);
drivers/acpi/fan_hwmon.c +3 -7
@@ -15,10 +15,6 @@#include "fan.h" -/* Returned when the ACPI fan does not support speed reporting */ -#define FAN_SPEED_UNAVAILABLE U32_MAX -#define FAN_POWER_UNAVAILABLE U32_MAX -static struct acpi_fan_fps *acpi_fan_get_current_fps (struct acpi_fan *fan,u64 control) {unsigned int i;
@@ -77,7 +73,7 @@ static umode_t acpi_fan_hwmon_is_visible(const void *drvdata, enum hwmon_sensor_* when the associated attribute should not be created. */ for (i =0 ; i < fan->fps_count; i++) { -if (fan->fps[i].power !=FAN_POWER_UNAVAILABLE ) +if (acpi_fan_power_valid (fan->fps[i].power))return 0444 ; }
@@ -106,7 +102,7 @@ static int acpi_fan_hwmon_read(struct device *dev, enum hwmon_sensor_types type,case hwmon_fan:switch (attr) {case hwmon_fan_input: -if (fst.speed ==FAN_SPEED_UNAVAILABLE ) +if (!acpi_fan_speed_valid (fst.speed))return -ENODEV ;if (fst.speed >LONG_MAX )
@@ -134,7 +130,7 @@ static int acpi_fan_hwmon_read(struct device *dev, enum hwmon_sensor_types type,if (!fps)return -EIO ; -if (fps->power ==FAN_POWER_UNAVAILABLE ) +if (!acpi_fan_power_valid (fps->power))return -ENODEV ;if (fps->power >LONG_MAX /MICROWATT_PER_MILLIWATT )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 17/567 cpufreq: s5pv210: fix refcount leak
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuhao Fu <[email protected]>
[ Upstream commit 2de5cb96060a1664880d65b120e59485a73588a8 ]
In function s5pv210_cpu_init, a possible refcount inconsistency has been identified, causing a resource leak.
Why it is a bug:
1. For every clk_get, there should be a matching clk_put on every successive error handling path.
2. After calling clk_get(dmc1_clk), variable dmc1_clk will not be freed even if any error happens.
How it is fixed: For every failed path, an extra goto label is added to ensure dmc1_clk will be freed regardlessly.
--- drivers/cpufreq/s5pv210-cpufreq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/cpufreq/s5pv210-cpufreq.c +4 -2
@@ -518,7 +518,7 @@ static int s5pv210_cpu_init(struct cpufreq_policy *policy)if (policy->cpu !=0 ) { ret = -EINVAL ; - goto out_dmc1; + goto out; }/*
@@ -530,7 +530,7 @@ static int s5pv210_cpu_init(struct cpufreq_policy *policy)if ((mem_type !=LPDDR ) && (mem_type !=LPDDR2 )) {pr_err ("CPUFreq doesn't support this memory type\n" ); ret = -EINVAL ; - goto out_dmc1; + goto out; }/* Find current refresh counter and frequency each DMC */
@@ -544,6 +544,8 @@ static int s5pv210_cpu_init(struct cpufreq_policy *policy)cpufreq_generic_init (policy, s5pv210_freq_table,40000 );return 0 ; +out: +clk_put (dmc1_clk); out_dmc1:clk_put (dmc0_clk); out_dmc0:
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 18/567 cpuidle: menu: Use residency threshold in polling state override decisions
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aboorva Devarajan <[email protected]>
[ Upstream commit 07d815701274d156ad8c7c088a52e01642156fb8 ]
On virtualized PowerPC (pseries) systems, where only one polling state (Snooze) and one deep state (CEDE) are available, selecting CEDE when the predicted idle duration is less than the target residency of CEDE state can hurt performance. In such cases, the entry/exit overhead of CEDE outweighs the power savings, leading to unnecessary state transitions and higher latency.
Menu governor currently contains a special-case rule that prioritizes the first non-polling state over polling, even when its target residency is much longer than the predicted idle duration. On PowerPC/pseries, where the gap between the polling state (Snooze) and the first non-polling state (CEDE) is large, this behavior causes performance regressions.
Refine that special case by adding an extra requirement: the first non-polling state can only be chosen if its target residency is below the defined RESIDENCY_THRESHOLD_NS. If this condition is not satisfied, polling is allowed instead, avoiding suboptimal non-polling state entries.
This change is limited to the single special-case rule for the first non-polling state. The general non-polling state selection logic in the menu governor remains unchanged.
Performance improvement observed with pgbench on PowerPC (pseries) system:
+---------------------------+------------+------------+------------+ | Metric | Baseline | Patched | Change (%) | +---------------------------+------------+------------+------------+ | Transactions/sec (TPS) | 495,210 | 536,982 | +8.45% | | Avg latency (ms) | 0.163 | 0.150 | -7.98% | +---------------------------+------------+------------+------------+
CPUIdle state usage:
+--------------+--------------+-------------+ | Metric | Baseline | Patched | +--------------+--------------+-------------+ | Total usage | 12,735,820 | 13,918,442 | | Above usage | 11,401,520 | 1,598,210 | | Below usage | 20,145 | 702,395 | +--------------+--------------+-------------+
Above/Total and Below/Total usage percentages:
+------------------------+-----------+---------+ | Metric | Baseline | Patched | +------------------------+-----------+---------+ | Above % (Above/Total) | 89.56% | 11.49% | | Below % (Below/Total) | 0.16% | 5.05% | | Total cpuidle miss (%) | 89.72% | 16.54% | +------------------------+-----------+---------+
The results indicate that restricting CEDE selection to cases where its residency matches the predicted idle time reduces mispredictions, lowers unnecessary state transitions, and improves overall throughput.
--- drivers/cpuidle/governors/menu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/cpuidle/governors/menu.c +5 -4
@@ -323,12 +323,13 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, }/* -* Use a physical idle state, not busy polling, unless a timer -* is going to trigger soon enough or the exit latency of the -* idle state in question is greater than the predicted idle -* duration. +* Use a physical idle state instead of busy polling so long as +* its target residency is below the residency threshold, its +* exit latency is not greater than the predicted idle duration, +* and the next timer doesn't expire soon. */ if ((drv->states[idx].flags &CPUIDLE_FLAG_POLLING ) && + s->target_residency_ns <RESIDENCY_THRESHOLD_NS && s->target_residency_ns <= data->next_timer_ns && s->exit_latency_ns <= predicted_ns) { predicted_ns = s->target_residency_ns;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 19/567 livepatch: Match old_sympos 0 and 1 in klp_find_func()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Song Liu <[email protected]>
[ Upstream commit 139560e8b973402140cafeb68c656c1374bd4c20 ]
When there is only one function of the same name, old_sympos of 0 and 1 are logically identical. Match them in klp_find_func().
This is to avoid a corner case with different toolchain behavior.
In this specific issue, two versions of kpatch-build were used to build livepatch for the same kernel. One assigns old_sympos == 0 for unique local functions, the other assigns old_sympos == 1 for unique local functions. Both versions work fine by themselves. (PS: This behavior change was introduced in a downstream version of kpatch-build. This change does not exist in upstream kpatch-build.)
However, during livepatch upgrade (with the replace flag set) from a patch built with one version of kpatch-build to the same fix built with the other version of kpatch-build, livepatching fails with errors like:
[ 14.218706] sysfs: cannot create duplicate filename 'xxx/somefunc,1'
...
[ 14.219466] Call Trace:
[ 14.219468] <TASK>
[ 14.219469] dump_stack_lvl+0x47/0x60
[ 14.219474] sysfs_warn_dup.cold+0x17/0x27
[ 14.219476] sysfs_create_dir_ns+0x95/0xb0
[ 14.219479] kobject_add_internal+0x9e/0x260
[ 14.219483] kobject_add+0x68/0x80
[ 14.219485] ? kstrdup+0x3c/0xa0
[ 14.219486] klp_enable_patch+0x320/0x830
[ 14.219488] patch_init+0x443/0x1000 [ccc_0_6]
[ 14.219491] ? 0xffffffffa05eb000
[ 14.219492] do_one_initcall+0x2e/0x190
[ 14.219494] do_init_module+0x67/0x270
[ 14.219496] init_module_from_file+0x75/0xa0
[ 14.219499] idempotent_init_module+0x15a/0x240
[ 14.219501] __x64_sys_finit_module+0x61/0xc0
[ 14.219503] do_syscall_64+0x5b/0x160
[ 14.219505] entry_SYSCALL_64_after_hwframe+0x4b/0x53
[ 14.219507] RIP: 0033:0x7f545a4bd96d
...
[ 14.219516] kobject: kobject_add_internal failed for somefunc,1 with
-EEXIST, don't try to register things with the same name ...This happens because klp_find_func() thinks somefunc with old_sympos==0 is not the same as somefunc with old_sympos==1, and klp_add_object_nops adds another xxx/func,1 to the list of functions to patch.
--- kernel/livepatch/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
kernel/livepatch/core.c +7 -1
@@ -90,8 +90,14 @@ static struct klp_func *klp_find_func(struct klp_object *obj,struct klp_func *func;klp_for_each_func (obj, func) { +/* +* Besides identical old_sympos, also consider old_sympos +* of 0 and 1 are identical. +*/ if ((strcmp (old_func->old_name, func->old_name) ==0 ) && - (old_func->old_sympos == func->old_sympos)) { + ((old_func->old_sympos == func->old_sympos) || + (old_func->old_sympos ==0 && func->old_sympos ==1 ) || + (old_func->old_sympos ==1 && func->old_sympos ==0 ))) {return func; } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 20/567 fs/ntfs3: Support timestamps prior to epoch
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Komarov <[email protected]>
[ Upstream commit 5180138604323895b5c291eca6aa7c20be494ade ]
Before it used an unsigned 64-bit type, which prevented proper handling of timestamps earlier than 1970-01-01. Switch to a signed 64-bit type to support pre-epoch timestamps. The issue was caught by xfstests.
--- fs/ntfs3/ntfs_fs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
fs/ntfs3/ntfs_fs.h +5 -4
@@ -980,11 +980,12 @@ static inline __le64 kernel2nt(const struct timespec64 *ts)*/ static inline void nt2kernel (const __le64 tm,struct timespec64 *ts) { -u64 t =le64_to_cpu (tm) - _100ns2seconds * SecondsToStartOf1970; +s32 t32; +/* use signed 64 bit to support timestamps prior to epoch. xfstest 258. */ +s64 t =le64_to_cpu (tm) - _100ns2seconds * SecondsToStartOf1970; -// WARNING: do_div changes its first argument(!) - ts->tv_nsec =do_div (t, _100ns2seconds) *100 ; - ts->tv_sec = t; + ts->tv_sec =div_s64_rem (t, _100ns2seconds, &t32); + ts->tv_nsec = t32 *100 ; }static inline struct ntfs_sb_info *ntfs_sb (struct super_block *sb)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 21/567 kbuild: Use objtree for module signing key path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Malyshev <[email protected]>
[ Upstream commit af61da281f52aba0c5b090bafb3a31c5739850ff ]
When building out-of-tree modules with CONFIG_MODULE_SIG_FORCE=y, module signing fails because the private key path uses $(srctree) while the public key path uses $(objtree). Since signing keys are generated in the build directory during kernel compilation, both paths should use $(objtree) for consistency.
This causes SSL errors like:
SSL error:02001002:system library:fopen:No such file or directory
sign-file: /kernel-src/certs/signing_key.pem
The issue occurs because:
- sig-key uses: $(srctree)/certs/signing_key.pem (source tree)
- cmd_sign uses: $(objtree)/certs/signing_key.x509 (build tree)
But both keys are generated in $(objtree) during the build.
This complements commit 25ff08aa43e37 ("kbuild: Fix signing issue for external modules") which fixed the scripts path and public key path, but missed the private key path inconsistency.
Fixes out-of-tree module signing for configurations with separate source and build directories (e.g., O=/kernel-out).
--- scripts/Makefile.modinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.modinst +1 -1
@@ -100,7 +100,7 @@ endif # Don't stop modules_install even if we can't sign external modules. # ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),) -sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(srctree)/)$(CONFIG_MODULE_SIG_KEY) +sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(objtree)/)$(CONFIG_MODULE_SIG_KEY) else sig-key := $(CONFIG_MODULE_SIG_KEY) endif
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 22/567 ntfs: set dummy blocksize to read boot_block when mounting
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pedro Demarchi Gomes <[email protected]>
[ Upstream commit d1693a7d5a38acf6424235a6070bcf5b186a360d ]
When mounting, sb->s_blocksize is used to read the boot_block without being defined or validated. Set a dummy blocksize before attempting to read the boot_block.
The issue can be triggered with the following syz reproducer:
mkdirat(0xffffffffffffff9c, &(0x7f0000000080)='./file1\x00', 0x0) r4 = openat$nullb(0xffffffffffffff9c, &(0x7f0000000040), 0x121403, 0x0) ioctl$FS_IOC_SETFLAGS(r4, 0x40081271, &(0x7f0000000980)=0x4000) mount(&(0x7f0000000140)=@nullb, &(0x7f0000000040)='./cgroup\x00',
&(0x7f0000000000)='ntfs3\x00', 0x2208004, 0x0)
syz_clone(0x88200200, 0x0, 0x0, 0x0, 0x0, 0x0)
Here, the ioctl sets the bdev block size to 16384. During mount, get_tree_bdev_flags() calls sb_set_blocksize(sb, block_size(bdev)), but since block_size(bdev) > PAGE_SIZE, sb_set_blocksize() leaves sb->s_blocksize at zero.
Later, ntfs_init_from_boot() attempts to read the boot_block while sb->s_blocksize is still zero, which triggers the bug.
[[email protected]: changed comment style, added return value handling]
--- fs/ntfs3/super.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/ntfs3/super.c +5 -0
@@ -892,6 +892,11 @@ static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size, sbi->volume.blocks = dev_size >>PAGE_SHIFT ; +/* Set dummy blocksize to read boot_block. */ +if (!sb_min_blocksize (sb,PAGE_SIZE )) { +return -EINVAL ; + } + read_boot: bh =ntfs_bread (sb, boot_block);if (!bh)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 23/567 hfsplus: fix volume corruption issue for generic/070
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viacheslav Dubeyko <[email protected]>
[ Upstream commit ed490f36f439b877393c12a2113601e4145a5a56 ]
The xfstests' test-case generic/070 leaves HFS+ volume in corrupted state:
sudo ./check generic/070
FSTYP -- hfsplus
PLATFORM -- Linux/x86_64 hfsplus-testing-0001 6.17.0-rc1+ #4 SMP PREEMPT_DYNAMIC Wed Oct 1 15:02:44 PDT 2025 MKFS_OPTIONS -- /dev/loop51MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch
generic/070 _check_generic_filesystem: filesystem on /dev/loop50 is inconsistent (see xfstests-dev/results//generic/070.full for details)
Ran: generic/070
Failures: generic/070
Failed 1 of 1 tests
sudo fsck.hfsplus -d /dev/loop50
** /dev/loop50
Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K. Executing fsck_hfs (version 540.1-Linux).
** Checking non-journaled HFS Plus Volume.
The volume name is test
** Checking extents overflow file.
Unused node is not erased (node = 1)
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
Verify Status: VIStat = 0x0000, ABTStat = 0x0000 EBTStat = 0x0004 CBTStat = 0x0000 CatStat = 0x00000000
** Repairing volume.
** Rechecking volume.
** Checking non-journaled HFS Plus Volume.
The volume name is test
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume test was repaired successfully.
It is possible to see that fsck.hfsplus detected not erased and unused node for the case of extents overflow file. The HFS+ logic has special method that defines if the node should be erased:
bool hfs_bnode_need_zeroout(struct hfs_btree *tree)
{
struct super_block *sb = tree->inode->i_sb;
struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
const u32 volume_attr = be32_to_cpu(sbi->s_vhdr->attributes);
return tree->cnid == HFSPLUS_CAT_CNID &&
volume_attr & HFSPLUS_VOL_UNUSED_NODE_FIX;
}However, it is possible to see that this method works only for the case of catalog file. But debugging of the issue has shown that HFSPLUS_VOL_UNUSED_NODE_FIX attribute has been requested for the extents overflow file too:
catalog file
kernel: hfsplus: node 4, num_recs 0, flags 0x10
kernel: hfsplus: tree->cnid 4, volume_attr 0x80000800
extents overflow file
kernel: hfsplus: node 1, num_recs 0, flags 0x10
kernel: hfsplus: tree->cnid 3, volume_attr 0x80000800
This patch modifies the hfs_bnode_need_zeroout() by checking only volume_attr but not the b-tree ID because node zeroing can be requested for all HFS+ b-tree types.
sudo ./check generic/070
FSTYP -- hfsplus PLATFORM -- Linux/x86_64 hfsplus-testing-0001 6.18.0-rc3+ #79 SMP PREEMPT_DYNAMIC Fri Oct 31 16:07:42 PDT 2025 MKFS_OPTIONS -- /dev/loop51
MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch
generic/070 33s ... 34s
Ran: generic/070
Passed all 1 tests
--- fs/hfsplus/bnode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/hfsplus/bnode.c +1 -2
@@ -704,6 +704,5 @@ bool hfs_bnode_need_zeroout(struct hfs_btree *tree)struct hfsplus_sb_info *sbi =HFSPLUS_SB (sb);const u32 volume_attr =be32_to_cpu (sbi->s_vhdr->attributes); -return tree->cnid ==HFSPLUS_CAT_CNID && - volume_attr &HFSPLUS_VOL_UNUSED_NODE_FIX ; +return volume_attr &HFSPLUS_VOL_UNUSED_NODE_FIX ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 24/567 hfsplus: fix missing hfs_bnode_get() in __hfs_bnode_create
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Chenzhi <[email protected]>
[ Upstream commit 152af114287851583cf7e0abc10129941f19466a ]
When sync() and link() are called concurrently, both threads may enter hfs_bnode_find() without finding the node in the hash table and proceed to create it.
Thread A:
hfsplus_write_inode()
-> hfsplus_write_system_inode()
-> hfs_btree_write()
-> hfs_bnode_find(tree, 0)
-> __hfs_bnode_create(tree, 0)Thread B:
hfsplus_create_cat()
-> hfs_brec_insert()
-> hfs_bnode_split()
-> hfs_bmap_alloc()
-> hfs_bnode_find(tree, 0)
-> __hfs_bnode_create(tree, 0)In this case, thread A creates the bnode, sets refcnt=1, and hashes it. Thread B also tries to create the same bnode, notices it has already been inserted, drops its own instance, and uses the hashed one without getting the node.
```
node2 = hfs_bnode_findhash(tree, cnid);
if (!node2) { <- Thread A
hash = hfs_bnode_hash(cnid);
node->next_hash = tree->node_hash[hash];
tree->node_hash[hash] = node;
tree->node_hash_cnt++;
} else { <- Thread B
spin_unlock(&tree->hash_lock);
kfree(node);
wait_event(node2->lock_wq,
!test_bit(HFS_BNODE_NEW, &node2->flags));
return node2;
}
```However, hfs_bnode_find() requires each call to take a reference. Here both threads end up setting refcnt=1. When they later put the node, this triggers:
BUG_ON(!atomic_read(&node->refcnt))
In this scenario, Thread B in fact finds the node in the hash table rather than creating a new one, and thus must take a reference.
Fix this by calling hfs_bnode_get() when reusing a bnode newly created by another thread to ensure the refcount is updated correctly.
A similar bug was fixed in HFS long ago in commit a9dc087fd3c4 ("fix missing hfs_bnode_get() in __hfs_bnode_create") but the same issue remained in HFS+ until now.
--- fs/hfsplus/bnode.c | 1 + 1 file changed, 1 insertion(+)
fs/hfsplus/bnode.c +1 -0
@@ -481,6 +481,7 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) tree->node_hash[hash] = node; tree->node_hash_cnt++; }else { +hfs_bnode_get (node2);spin_unlock (&tree->hash_lock);kfree (node); wait_event(node2->lock_wq,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 25/567 hfsplus: Verify inode mode when loading from disk
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 005d4b0d33f6b4a23d382b7930f7a96b95b01f39 ]
syzbot is reporting that S_IFMT bits of inode->i_mode can become bogus when the S_IFMT bits of the 16bits "mode" field loaded from disk are corrupted.
According to [1], the permissions field was treated as reserved in Mac OS 8 and 9. According to [2], the reserved field was explicitly initialized with 0, and that field must remain 0 as long as reserved. Therefore, when the "mode" field is not 0 (i.e. no longer reserved), the file must be S_IFDIR if dir == 1, and the file must be one of S_IFREG/S_IFLNK/S_IFCHR/ S_IFBLK/S_IFIFO/S_IFSOCK if dir == 0.
--- fs/hfsplus/inode.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)
fs/hfsplus/inode.c +28 -4
@@ -178,13 +178,29 @@ const struct dentry_operations hfsplus_dentry_operations = { .d_compare = hfsplus_compare_dentry, }; -static void hfsplus_get_perms (struct inode *inode, -struct hfsplus_perm *perms,int dir) +static int hfsplus_get_perms (struct inode *inode, +struct hfsplus_perm *perms,int dir) {struct hfsplus_sb_info *sbi =HFSPLUS_SB (inode->i_sb);u16 mode; mode =be16_to_cpu (perms->mode); +if (dir) { +if (mode && !S_ISDIR (mode)) + goto bad_type; + }else if (mode) { +switch (mode &S_IFMT ) { +case S_IFREG : +case S_IFLNK : +case S_IFCHR : +case S_IFBLK : +case S_IFIFO : +case S_IFSOCK : +break ; +default : + goto bad_type; + } + }i_uid_write (inode,be32_to_cpu (perms->owner));if ((test_bit (HFSPLUS_SB_UID , &sbi->flags)) || (!i_uid_read (inode) && !mode))
@@ -210,6 +226,10 @@ static void hfsplus_get_perms(struct inode *inode, inode->i_flags |=S_APPEND ; else inode->i_flags &= ~S_APPEND; +return 0 ; +bad_type: +pr_err ("invalid file type 0%04o for inode %lu\n" , mode, inode->i_ino); +return -EIO ; }static int hfsplus_file_open (struct inode *inode,struct file *file)
@@ -514,7 +534,9 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) }hfs_bnode_read (fd->bnode, &entry, fd->entryoffset,sizeof (struct hfsplus_cat_folder )); -hfsplus_get_perms (inode, &folder->permissions,1 ); + res =hfsplus_get_perms (inode, &folder->permissions,1 ); +if (res) + goto out;set_nlink (inode,1 ); inode->i_size =2 +be32_to_cpu (folder->valence);inode_set_atime_to_ts (inode,hfsp_mt2ut (folder->access_date));
@@ -543,7 +565,9 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)hfsplus_inode_read_fork (inode,HFSPLUS_IS_RSRC (inode) ? &file->rsrc_fork : &file->data_fork); -hfsplus_get_perms (inode, &file->permissions,0 ); + res =hfsplus_get_perms (inode, &file->permissions,0 ); +if (res) + goto out;set_nlink (inode,1 );if (S_ISREG (inode->i_mode)) {if (file->permissions.dev)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 26/567 hfsplus: fix volume corruption issue for generic/073
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viacheslav Dubeyko <[email protected]>
[ Upstream commit 24e17a29cf7537f0947f26a50f85319abd723c6c ]
The xfstests' test-case generic/073 leaves HFS+ volume in corrupted state:
sudo ./check generic/073
FSTYP -- hfsplus
PLATFORM -- Linux/x86_64 hfsplus-testing-0001 6.17.0-rc1+ #4 SMP PREEMPT_DYNAMIC Wed Oct 1 15:02:44 PDT 2025 MKFS_OPTIONS -- /dev/loop51MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch
generic/073 _check_generic_filesystem: filesystem on /dev/loop51 is inconsistent (see XFSTESTS-2/xfstests-dev/results//generic/073.full for details)
Ran: generic/073
Failures: generic/073
Failed 1 of 1 tests
sudo fsck.hfsplus -d /dev/loop51
** /dev/loop51
Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K. Executing fsck_hfs (version 540.1-Linux).
** Checking non-journaled HFS Plus Volume.
The volume name is untitled
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
Invalid directory item count
(It should be 1 instead of 0)
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
Verify Status: VIStat = 0x0000, ABTStat = 0x0000 EBTStat = 0x0000 CBTStat = 0x0000 CatStat = 0x00004000
** Repairing volume.
** Rechecking volume.
** Checking non-journaled HFS Plus Volume.
The volume name is untitled
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume untitled was repaired successfully.
The test is doing these steps on final phase:
mv $SCRATCH_MNT/testdir_1/bar $SCRATCH_MNT/testdir_2/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/testdir_1 $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
So, we move file bar from testdir_1 into testdir_2 folder. It means that HFS+ logic decrements the number of entries in testdir_1 and increments number of entries in testdir_2. Finally, we do fsync only for testdir_1 and foo but not for testdir_2. As a result, this is the reason why fsck.hfsplus detects the volume corruption afterwards.
This patch fixes the issue by means of adding the hfsplus_cat_write_inode() call for old_dir and new_dir in hfsplus_rename() after the successful ending of hfsplus_rename_cat(). This method makes modification of in-core inode objects for old_dir and new_dir but it doesn't save these modifications in Catalog File's entries. It was expected that hfsplus_write_inode() will save these modifications afterwards. However, because generic/073 does fsync only for testdir_1 and foo then testdir_2 modification hasn't beed saved into Catalog File's entry and it was flushed without this modification. And it was detected by fsck.hfsplus. Now, hfsplus_rename() stores in Catalog File all modified entries and correct state of Catalog File will be flushed during hfsplus_file_fsync() call. Finally, it makes fsck.hfsplus happy.
sudo ./check generic/073
FSTYP -- hfsplus PLATFORM -- Linux/x86_64 hfsplus-testing-0001 6.18.0-rc3+ #93 SMP PREEMPT_DYNAMIC Wed Nov 12 14:37:49 PST 2025 MKFS_OPTIONS -- /dev/loop51
MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch
generic/073 32s ... 32s
Ran: generic/073
Passed all 1 tests
--- fs/hfsplus/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/hfsplus/dir.c +6 -1
@@ -552,8 +552,13 @@ static int hfsplus_rename(struct mnt_idmap *idmap, res =hfsplus_rename_cat ((u32 )(unsigned long )old_dentry->d_fsdata, old_dir, &old_dentry->d_name, new_dir, &new_dentry->d_name); -if (!res) +if (!res) { new_dentry->d_fsdata = old_dentry->d_fsdata; + + res =hfsplus_cat_write_inode (old_dir); +if (!res) + res =hfsplus_cat_write_inode (new_dir); + }return res; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 27/567 fs/ntfs3: check for shutdown in fsync
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Komarov <[email protected]>
[ Upstream commit 1b2ae190ea43bebb8c73d21f076addc8a8c71849 ]
Ensure fsync() returns -EIO when the ntfs3 filesystem is in forced shutdown, instead of silently succeeding via generic_file_fsync().
--- fs/ntfs3/file.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
fs/ntfs3/file.c +13 -1
@@ -1396,6 +1396,18 @@ static ssize_t ntfs_file_splice_write(struct pipe_inode_info *pipe,return iter_file_splice_write (pipe, file, ppos, len, flags); } +/* +* ntfs_file_fsync - file_operations::fsync +*/ +static int ntfs_file_fsync (struct file *file,loff_t start,loff_t end,int datasync) +{ +struct inode *inode =file_inode (file); +if (unlikely (ntfs3_forced_shutdown (inode->i_sb))) +return -EIO ; + +return generic_file_fsync (file, start, end, datasync); +} +// clang-format off const struct inode_operations ntfs_file_inode_operations = { .getattr = ntfs_getattr,
@@ -1420,7 +1432,7 @@ const struct file_operations ntfs_file_operations = { .splice_write = ntfs_file_splice_write, .mmap = ntfs_file_mmap, .open = ntfs_file_open, - .fsync = generic_file_fsync, + .fsync = ntfs_file_fsync, .fallocate = ntfs_fallocate, .release = ntfs_file_release, };
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 28/567 wifi: rtl8xxxu: Fix HT40 channel config for RTL8192CU, RTL8723AU
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
[ Upstream commit 5511ba3de434892e5ef3594d6eabbd12b1629356 ]
Flip the response rate subchannel. It was backwards, causing low speeds when using 40 MHz channel width. "iw dev ... station dump" showed a low RX rate, 11M or less.
Also fix the channel width field of RF6052_REG_MODE_AG.
Tested only with RTL8192CU, but these settings are identical for RTL8723AU.
--- drivers/net/wireless/realtek/rtl8xxxu/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/core.c +3 -4
@@ -1252,7 +1252,7 @@ void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw) opmode &= ~BW_OPMODE_20MHZ ;rtl8xxxu_write8 (priv,REG_BW_OPMODE , opmode); rsr &= ~RSR_RSC_BANDWIDTH_40M ; -if (sec_ch_above) +if (!sec_ch_above) rsr |=RSR_RSC_UPPER_SUB_CHANNEL ;else rsr |=RSR_RSC_LOWER_SUB_CHANNEL ;
@@ -1321,9 +1321,8 @@ void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)for (i =RF_A ; i < priv->rf_paths; i++) { val32 =rtl8xxxu_read_rfreg (priv, i,RF6052_REG_MODE_AG ); -if (hw->conf.chandef.width ==NL80211_CHAN_WIDTH_40 ) - val32 &= ~MODE_AG_CHANNEL_20MHZ ; -else + val32 &= ~MODE_AG_BW_MASK ; +if (hw->conf.chandef.width !=NL80211_CHAN_WIDTH_40 ) val32 |=MODE_AG_CHANNEL_20MHZ ;rtl8xxxu_write_rfreg (priv, i,RF6052_REG_MODE_AG , val32); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 29/567 wifi: cfg80211: stop radar detection in cfg80211_leave()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 9f33477b9a31a1edfe2df9f1a0359cccb0e16b4c ]
If an interface is set down or, per the previous patch, changes type, radar detection for it should be cancelled. This is done for AP mode in mac80211 (somewhat needlessly, since cfg80211 can do it, but didn't until now), but wasn't handled for mesh, so if radar detection was started and then the interface set down or its type switched (the latter sometimes happning in the hwsim test 'mesh_peer_connected_dfs'), radar detection would be around with the interface unknown to the driver, later leading to some warnings around chanctx usage.
--- net/wireless/core.c | 1 + net/wireless/core.h | 1 + net/wireless/mlme.c | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+)
net/wireless/core.c +1 -0
@@ -1343,6 +1343,7 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,cfg80211_pmsr_wdev_down (wdev); +cfg80211_stop_radar_detection (wdev);cfg80211_stop_background_radar_detection (wdev);switch (wdev->iftype) {
net/wireless/core.h +1 -0
@@ -483,6 +483,7 @@ cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdestruct wireless_dev *wdev, struct cfg80211_chan_def *chandef); +void cfg80211_stop_radar_detection (struct wireless_dev *wdev);void cfg80211_stop_background_radar_detection (struct wireless_dev *wdev);void cfg80211_background_cac_done_wk (struct work_struct *work);
net/wireless/mlme.c +19 -0
@@ -1271,6 +1271,25 @@ cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdereturn 0 ; } +void cfg80211_stop_radar_detection (struct wireless_dev *wdev) +{ +struct wiphy *wiphy = wdev->wiphy; +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy); +int link_id; + +for_each_valid_link (wdev, link_id) { +struct cfg80211_chan_def chandef; + +if (!wdev->links[link_id].cac_started) +continue ; + + chandef = *wdev_chandef (wdev, link_id); +rdev_end_cac (rdev, wdev->netdev, link_id); +nl80211_radar_notify (rdev, &chandef,NL80211_RADAR_CAC_ABORTED , + wdev->netdev,GFP_KERNEL ); + } +} +void cfg80211_stop_background_radar_detection (struct wireless_dev *wdev) {struct wiphy *wiphy = wdev->wiphy;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 30/567 wifi: cfg80211: use cfg80211_leave() in iftype change
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 7a27b73943a70ee226fa125327101fb18e94701d ]
When changing the interface type, all activity on the interface has to be stopped first. This was done independent of existing code in cfg80211_leave(), so didn't handle e.g. background radar detection. Use cfg80211_leave() to handle it the same way.
Note that cfg80211_leave() behaves slightly differently for IBSS in wireless extensions, it won't send an event in that case. We could handle that, but since nl80211 was used to change the type, IBSS is rare, and wext is already a corner case, it doesn't seem worth it.
--- net/wireless/util.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-)
net/wireless/util.c +1 -22
@@ -1230,28 +1230,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev, dev->ieee80211_ptr->use_4addr = false;rdev_set_qos_map (rdev, dev,NULL ); -switch (otype) { -case NL80211_IFTYPE_AP : -case NL80211_IFTYPE_P2P_GO : -cfg80211_stop_ap (rdev, dev,-1 , true); -break ; -case NL80211_IFTYPE_ADHOC : -cfg80211_leave_ibss (rdev, dev, false); -break ; -case NL80211_IFTYPE_STATION : -case NL80211_IFTYPE_P2P_CLIENT : -cfg80211_disconnect (rdev, dev, -WLAN_REASON_DEAUTH_LEAVING , true); -break ; -case NL80211_IFTYPE_MESH_POINT : -/* mesh should be handled? */ -break ; -case NL80211_IFTYPE_OCB : -cfg80211_leave_ocb (rdev, dev); -break ; -default : -break ; - } +cfg80211_leave (rdev, dev->ieee80211_ptr);cfg80211_process_rdev_events (rdev);cfg80211_mlme_purge_registrations (dev->ieee80211_ptr);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 31/567 wifi: mt76: mt792x: fix wifi init fail by setting MCU_RUNNING after CLC load
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quan Zhou <[email protected]>
[ Upstream commit 066f417be5fd8c7fe581c5550206364735dad7a3 ]
Set the MT76_STATE_MCU_RUNNING bit only after mt7921_load_clc() has successfully completed. Previously, the MCU_RUNNING state was set before loading CLC, which could cause conflict between chip mcu_init retry and mac_reset flow, result in chip init fail and chip abnormal status. By moving the state set after CLC load, firmware initialization becomes robust and resolves init fail issue.
--- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +1 -1
@@ -637,10 +637,10 @@ int mt7921_run_firmware(struct mt792x_dev *dev)if (err)return err; -set_bit (MT76_STATE_MCU_RUNNING , &dev->mphy.state); err =mt7921_load_clc (dev,mt792x_ram_name (dev));if (err)return err; +set_bit (MT76_STATE_MCU_RUNNING , &dev->mphy.state);return mt7921_mcu_fw_log_2_host (dev,1 ); }
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +1 -1
@@ -958,10 +958,10 @@ int mt7925_run_firmware(struct mt792x_dev *dev)if (err)return err; -set_bit (MT76_STATE_MCU_RUNNING , &dev->mphy.state); err =mt7925_load_clc (dev,mt792x_ram_name (dev));if (err)return err; +set_bit (MT76_STATE_MCU_RUNNING , &dev->mphy.state);return mt7925_mcu_fw_log_2_host (dev,1 ); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 32/567 wifi: brcmfmac: Add DMI nvram filename quirk for Acer A1 840 tablet
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit a8e5a110c0c38e08e5dd66356cd1156e91cf88e1 ]
The Acer A1 840 tablet contains quite generic names in the sys_vendor and product_name DMI strings, without this patch brcmfmac will try to load:
brcmfmac43340-sdio.Insyde-BayTrail.txt as nvram file which is a bit too generic.
Add a DMI quirk so that a unique and clearly identifiable nvram file name is used on the Acer A1 840 tablet.
--- .../net/wireless/broadcom/brcm80211/brcmfmac/dmi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c +14 -0
@@ -24,6 +24,10 @@ static const struct brcmf_dmi_data acepc_t8_data = { BRCM_CC_4345_CHIP_ID, 6, "acepc-t8" }; +static const struct brcmf_dmi_data acer_a1_840_data = { +BRCM_CC_43340_CHIP_ID ,2 ,"acer-a1-840" +}; +/* The Chuwi Hi8 Pro uses the same Ampak AP6212 module as the Chuwi Vi8 Plus * and the nvram for the Vi8 Plus is already in linux-firmware, so use that. */
@@ -91,6 +95,16 @@ static const struct dmi_system_id dmi_platform_data[] = { }, .driver_data = (void *)&acepc_t8_data, }, + { +/* Acer Iconia One 8 A1-840 (non FHD version) */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Insyde" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"BayTrail" ), +/* Above strings are too generic also match BIOS date */ + DMI_MATCH(DMI_BIOS_DATE, "04/01/2014"), + }, + .driver_data = (void *)&acer_a1_840_data, + }, {/* Chuwi Hi8 Pro with D2D3_Hi8Pro.233 BIOS */ .matches = {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 33/567 btrfs: scrub: always update btrfs_scrub_progress::last_physical
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
[ Upstream commit 54df8b80cc63aa0f22c4590cad11542731ed43ff ]
[BUG]
When a scrub failed immediately without any byte scrubbed, the returned btrfs_scrub_progress::last_physical will always be 0, even if there is a non-zero @start passed into btrfs_scrub_dev() for resume cases.
This will reset the progress and make later scrub resume start from the beginning.
[CAUSE]
The function btrfs_scrub_dev() accepts a @progress parameter to copy its updated progress to the caller, there are cases where we either don't touch progress::last_physical at all or copy 0 into last_physical:
- last_physical not updated at all
If some error happened before scrubbing any super block or chunk, we will not copy the progress, leaving the @last_physical untouched.
E.g. failed to allocate @sctx, scrubbing a missing device or even there is already a running scrub and so on.
All those cases won't touch @progress at all, resulting the last_physical untouched and will be left as 0 for most cases.
- Error out before scrubbing any bytes
In those case we allocated @sctx, and sctx->stat.last_physical is all zero (initialized by kvzalloc()).
Unfortunately some critical errors happened during scrub_enumerate_chunks() or scrub_supers() before any stripe is really scrubbed.
In that case although we will copy sctx->stat back to @progress, since no byte is really scrubbed, last_physical will be overwritten to 0.
[FIX]
Make sure the parameter @progress always has its @last_physical member updated to @start parameter inside btrfs_scrub_dev().
At the very beginning of the function, set @progress->last_physical to @start, so that even if we error out without doing progress copying, last_physical is still at @start.
Then after we got @sctx allocated, set sctx->stat.last_physical to @start, this will make sure even if we didn't get any byte scrubbed, at the progress copying stage the @last_physical is not left as zero.
This should resolve the resume progress reset problem.
--- fs/btrfs/scrub.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/btrfs/scrub.c +5 -0
@@ -2943,6 +2943,10 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,unsigned int nofs_flag;bool need_commit = false; +/* Set the basic fallback @last_physical before we got a sctx. */ +if (progress) + progress->last_physical = start; +if (btrfs_fs_closing (fs_info))return -EAGAIN ;
@@ -2961,6 +2965,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start, sctx =scrub_setup_ctx (fs_info, is_dev_replace);if (IS_ERR (sctx))return PTR_ERR (sctx); + sctx->stat.last_physical = start; ret =scrub_workers_get (fs_info);if (ret)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 34/567 gfs2: fix remote evict for read-only filesystems
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Gruenbacher <[email protected]>
[ Upstream commit 64c10ed9274bc46416f502afea48b4ae11279669 ]
When a node tries to delete an inode, it first requests exclusive access to the iopen glock. This triggers demote requests on all remote nodes currently holding the iopen glock. To satisfy those requests, the remote nodes evict the inode in question, or they poke the corresponding inode glock to signal that the inode is still in active use.
This behavior doesn't depend on whether or not a filesystem is read-only, so remove the incorrect read-only check.
--- fs/gfs2/glops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/gfs2/glops.c +1 -2
@@ -631,8 +631,7 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote)struct gfs2_inode *ip = gl->gl_object;struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; -if (!remote ||sb_rdonly (sdp->sd_vfs) || -test_bit (SDF_KILL , &sdp->sd_flags)) +if (!remote ||test_bit (SDF_KILL , &sdp->sd_flags))return ; if (gl->gl_demote_state == LM_ST_UNLOCKED &&
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 35/567 gfs2: Fix "gfs2: Switch to wait_event in gfs2_quotad"
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Gruenbacher <[email protected]>
[ Upstream commit dff1fb6d8b7abe5b1119fa060f5d6b3370bf10ac ]
Commit e4a8b5481c59a ("gfs2: Switch to wait_event in gfs2_quotad") broke cyclic statfs syncing, so the numbers reported by "df" could easily get completely out of sync with reality. Fix this by reverting part of commit e4a8b5481c59a for now.
A follow-up commit will clean this code up later.
--- fs/gfs2/quota.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/quota.c +1 -1
@@ -1617,7 +1617,7 @@ int gfs2_quotad(void *data) t =min (quotad_timeo, statfs_timeo); - t = wait_event_freezable_timeout(sdp->sd_quota_wait, + t -= wait_event_freezable_timeout(sdp->sd_quota_wait, sdp->sd_statfs_force_sync || gfs2_withdrawing_or_withdrawn(sdp) || kthread_should_stop(),
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 36/567 smb/server: fix return value of smb2_ioctl()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: ChenXiaoSong <[email protected]>
[ Upstream commit 269df046c1e15ab34fa26fd90db9381f022a0963 ]
__process_request() will not print error messages if smb2_ioctl() always returns 0.
Fix this by returning the correct value at the end of function.
--- fs/smb/server/smb2pdu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
fs/smb/server/smb2pdu.c +6 -3
@@ -8107,7 +8107,7 @@ int smb2_ioctl(struct ksmbd_work *work) id = req->VolatileFileId;if (req->Flags !=cpu_to_le32 (SMB2_0_IOCTL_IS_FSCTL )) { - rsp->hdr.Status =STATUS_NOT_SUPPORTED ; + ret = -EOPNOTSUPP ; goto out; }
@@ -8127,8 +8127,9 @@ int smb2_ioctl(struct ksmbd_work *work)case FSCTL_DFS_GET_REFERRALS :case FSCTL_DFS_GET_REFERRALS_EX :/* Not support DFS yet */ + ret = -EOPNOTSUPP ; rsp->hdr.Status =STATUS_FS_DRIVER_REQUIRED ; - goto out; + goto out2;case FSCTL_CREATE_OR_GET_OBJECT_ID : {struct file_object_buf_type1_ioctl_rsp *obj_buf;
@@ -8418,8 +8419,10 @@ int smb2_ioctl(struct ksmbd_work *work) rsp->hdr.Status =STATUS_BUFFER_TOO_SMALL ; else if (ret < 0 || rsp->hdr.Status == 0) rsp->hdr.Status =STATUS_INVALID_PARAMETER ; + +out2:smb2_set_err_rsp (work); -return 0 ; +return ret; }/**
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 37/567 ksmbd: fix use-after-free in ksmbd_tree_connect_put under concurrency
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
[ Upstream commit b39a1833cc4a2755b02603eec3a71a85e9dff926 ]
Under high concurrency, A tree-connection object (tcon) is freed on a disconnect path while another path still holds a reference and later executes *_put()/write on it.
--- fs/smb/server/mgmt/tree_connect.c | 18 ++++-------------- fs/smb/server/mgmt/tree_connect.h | 1 - fs/smb/server/smb2pdu.c | 3 --- 3 files changed, 4 insertions(+), 18 deletions(-)
fs/smb/server/mgmt/tree_connect.c +4 -14
@@ -78,7 +78,6 @@ ksmbd_tree_conn_connect(struct ksmbd_work *work, const char *share_name) tree_conn->t_state =TREE_NEW ; status.tree_conn = tree_conn;atomic_set (&tree_conn->refcount,1 ); -init_waitqueue_head (&tree_conn->refcount_q); ret =xa_err (xa_store (&sess->tree_conns, tree_conn->id, tree_conn,KSMBD_DEFAULT_GFP ));
@@ -100,14 +99,8 @@ ksmbd_tree_conn_connect(struct ksmbd_work *work, const char *share_name)void ksmbd_tree_connect_put (struct ksmbd_tree_connect *tcon) { -/* -* Checking waitqueue to releasing tree connect on -* tree disconnect. waitqueue_active is safe because it -* uses atomic operation for condition. -*/ -if (!atomic_dec_return (&tcon->refcount) && -waitqueue_active (&tcon->refcount_q)) -wake_up (&tcon->refcount_q); +if (atomic_dec_and_test (&tcon->refcount)) +kfree (tcon); } int ksmbd_tree_conn_disconnect(struct ksmbd_session *sess,
@@ -119,14 +112,11 @@ int ksmbd_tree_conn_disconnect(struct ksmbd_session *sess,xa_erase (&sess->tree_conns, tree_conn->id);write_unlock (&sess->tree_conns_lock); -if (!atomic_dec_and_test (&tree_conn->refcount)) -wait_event (tree_conn->refcount_q, -atomic_read (&tree_conn->refcount) ==0 ); - ret =ksmbd_ipc_tree_disconnect_request (sess->id, tree_conn->id);ksmbd_release_tree_conn_id (sess, tree_conn->id);ksmbd_share_config_put (tree_conn->share_conf); -kfree (tree_conn); +if (atomic_dec_and_test (&tree_conn->refcount)) +kfree (tree_conn);return ret; }
fs/smb/server/mgmt/tree_connect.h +0 -1
@@ -33,7 +33,6 @@ struct ksmbd_tree_connect {int maximal_access;bool posix_extensions;atomic_t refcount; -wait_queue_head_t refcount_q;unsigned int t_state; };
fs/smb/server/smb2pdu.c +0 -3
@@ -2190,7 +2190,6 @@ int smb2_tree_disconnect(struct ksmbd_work *work) goto err_out; } -WARN_ON_ONCE (atomic_dec_and_test (&tcon->refcount)); tcon->t_state =TREE_DISCONNECTED ;write_unlock (&sess->tree_conns_lock);
@@ -2200,8 +2199,6 @@ int smb2_tree_disconnect(struct ksmbd_work *work) goto err_out; } - work->tcon =NULL ; - rsp->StructureSize =cpu_to_le16 (4 ); err =ksmbd_iov_pin_rsp (work, rsp,sizeof (struct smb2_tree_disconnect_rsp ));
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 38/567 ksmbd: vfs: fix race on m_flags in vfs_cache
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qianchang Zhao <[email protected]>
[ Upstream commit 991f8a79db99b14c48d20d2052c82d65b9186cad ]
ksmbd maintains delete-on-close and pending-delete state in ksmbd_inode->m_flags. In vfs_cache.c this field is accessed under inconsistent locking: some paths read and modify m_flags under ci->m_lock while others do so without taking the lock at all.
Examples:
- ksmbd_query_inode_status() and __ksmbd_inode_close() use ci->m_lock when checking or updating m_flags.
- ksmbd_inode_pending_delete(), ksmbd_set_inode_pending_delete(), ksmbd_clear_inode_pending_delete() and ksmbd_fd_set_delete_on_close() used to read and modify m_flags without ci->m_lock.
This creates a potential data race on m_flags when multiple threads open, close and delete the same file concurrently. In the worst case delete-on-close and pending-delete bits can be lost or observed in an inconsistent state, leading to confusing delete semantics (files that stay on disk after delete-on-close, or files that disappear while still in use).
Fix it by:
- Making ksmbd_query_inode_status() look at m_flags under ci->m_lock after dropping inode_hash_lock.
- Adding ci->m_lock protection to all helpers that read or modify m_flags (ksmbd_inode_pending_delete(), ksmbd_set_inode_pending_delete(), ksmbd_clear_inode_pending_delete(), ksmbd_fd_set_delete_on_close()).
- Keeping the existing ci->m_lock protection in __ksmbd_inode_close(), and moving the actual unlink/xattr removal outside the lock.
This unifies the locking around m_flags and removes the data race while preserving the existing delete-on-close behaviour.
--- fs/smb/server/vfs_cache.c | 88 +++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 26 deletions(-)
fs/smb/server/vfs_cache.c +62 -26
@@ -112,40 +112,62 @@ int ksmbd_query_inode_status(struct dentry *dentry)read_lock (&inode_hash_lock); ci =__ksmbd_inode_lookup (dentry); -if (ci) { - ret =KSMBD_INODE_STATUS_OK ; -if (ci->m_flags & (S_DEL_PENDING |S_DEL_ON_CLS )) - ret =KSMBD_INODE_STATUS_PENDING_DELETE ; -atomic_dec (&ci->m_count); - }read_unlock (&inode_hash_lock); +if (!ci) +return ret; + +down_read (&ci->m_lock); +if (ci->m_flags & (S_DEL_PENDING |S_DEL_ON_CLS )) + ret =KSMBD_INODE_STATUS_PENDING_DELETE ; +else + ret =KSMBD_INODE_STATUS_OK ; +up_read (&ci->m_lock); + +atomic_dec (&ci->m_count);return ret; }bool ksmbd_inode_pending_delete (struct ksmbd_file *fp) { -return (fp->f_ci->m_flags & (S_DEL_PENDING |S_DEL_ON_CLS )); +struct ksmbd_inode *ci = fp->f_ci; +int ret; + +down_read (&ci->m_lock); + ret = (ci->m_flags & (S_DEL_PENDING |S_DEL_ON_CLS )); +up_read (&ci->m_lock); + +return ret; }void ksmbd_set_inode_pending_delete (struct ksmbd_file *fp) { - fp->f_ci->m_flags |=S_DEL_PENDING ; +struct ksmbd_inode *ci = fp->f_ci; + +down_write (&ci->m_lock); + ci->m_flags |=S_DEL_PENDING ; +up_write (&ci->m_lock); }void ksmbd_clear_inode_pending_delete (struct ksmbd_file *fp) { - fp->f_ci->m_flags &= ~S_DEL_PENDING ; +struct ksmbd_inode *ci = fp->f_ci; + +down_write (&ci->m_lock); + ci->m_flags &= ~S_DEL_PENDING ; +up_write (&ci->m_lock); }void ksmbd_fd_set_delete_on_close (struct ksmbd_file *fp,int file_info) { -if (ksmbd_stream_fd (fp)) { - fp->f_ci->m_flags |=S_DEL_ON_CLS_STREAM ; -return ; - } +struct ksmbd_inode *ci = fp->f_ci; - fp->f_ci->m_flags |=S_DEL_ON_CLS ; +down_write (&ci->m_lock); +if (ksmbd_stream_fd (fp)) + ci->m_flags |=S_DEL_ON_CLS_STREAM ; +else + ci->m_flags |=S_DEL_ON_CLS ; +up_write (&ci->m_lock); }static void ksmbd_inode_hash (struct ksmbd_inode *ci)
@@ -257,27 +279,41 @@ static void __ksmbd_inode_close(struct ksmbd_file *fp)struct file *filp; filp = fp->filp; -if (ksmbd_stream_fd (fp) && (ci->m_flags &S_DEL_ON_CLS_STREAM )) { - ci->m_flags &= ~S_DEL_ON_CLS_STREAM ; - err =ksmbd_vfs_remove_xattr (file_mnt_idmap (filp), - &filp->f_path, - fp->stream.name, - true); -if (err) -pr_err ("remove xattr failed : %s\n" , - fp->stream.name); + +if (ksmbd_stream_fd (fp)) { +bool remove_stream_xattr = false; + +down_write (&ci->m_lock); +if (ci->m_flags &S_DEL_ON_CLS_STREAM ) { + ci->m_flags &= ~S_DEL_ON_CLS_STREAM ; + remove_stream_xattr = true; + } +up_write (&ci->m_lock); + +if (remove_stream_xattr) { + err =ksmbd_vfs_remove_xattr (file_mnt_idmap (filp), + &filp->f_path, + fp->stream.name, + true); +if (err) +pr_err ("remove xattr failed : %s\n" , + fp->stream.name); + } }if (atomic_dec_and_test (&ci->m_count)) { +bool do_unlink = false; +down_write (&ci->m_lock);if (ci->m_flags & (S_DEL_ON_CLS |S_DEL_PENDING )) { ci->m_flags &= ~(S_DEL_ON_CLS |S_DEL_PENDING ); -up_write (&ci->m_lock); -ksmbd_vfs_unlink (filp); -down_write (&ci->m_lock); + do_unlink = true; }up_write (&ci->m_lock); +if (do_unlink) +ksmbd_vfs_unlink (filp); +ksmbd_inode_free (ci); } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 39/567 Bluetooth: btusb: Add new VID/PID 2b89/6275 for RTL8761BUV
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chingbin Li <[email protected]>
[ Upstream commit 8dbbb5423c0802ec21266765de80fd491868fab1 ]
Add VID 2b89 & PID 6275 for Realtek RTL8761BUV USB Bluetooth chip.
The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below.
T: Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 6 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2b89 ProdID=6275 Rev= 2.00 S: Manufacturer=Realtek S: Product=Bluetooth Radio S: SerialNumber=00E04C239987 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
--- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/btusb.c +2 -0
@@ -763,6 +763,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x2b89, 0x8761), .driver_info = BTUSB_REALTEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x2b89, 0x6275), .driver_info = BTUSB_REALTEK | + BTUSB_WIDEBAND_SPEECH }, /* Additional Realtek 8821AE Bluetooth devices */ { USB_DEVICE(0x0b05, 0x17dc), .driver_info = BTUSB_REALTEK },
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 40/567 Bluetooth: btusb: MT7922: Add VID/PID 0489/e170
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit 5a6700a31c953af9a17a7e2681335f31d922614d ]
Add VID 0489 & PID e170 for MediaTek MT7922 USB Bluetooth chip.
The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below.
T: Bus=06 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e170 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us
--- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/btusb.c +2 -0
@@ -673,6 +673,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe153), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe170), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x04ca, 0x3804), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x04ca, 0x38e4), .driver_info = BTUSB_MEDIATEK |
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 41/567 Bluetooth: btusb: MT7920: Add VID/PID 0489/e135
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit c126f98c011f5796ba118ef2093122d02809d30d ]
Add VID 0489 & PID e135 for MediaTek MT7920 USB Bluetooth chip.
The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below.
T: Bus=06 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e135 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us
--- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/btusb.c +2 -0
@@ -611,6 +611,8 @@ static const struct usb_device_id quirks_table[] = {/* Additional MediaTek MT7920 Bluetooth devices */ { USB_DEVICE(0x0489, 0xe134), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe135), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x13d3, 0x3620), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x13d3, 0x3621), .driver_info = BTUSB_MEDIATEK |
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 42/567 Bluetooth: btusb: Add new VID/PID 13d3/3533 for RTL8821CE
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gongwei Li <[email protected]>
[ Upstream commit 525459da4bd62a81142fea3f3d52188ceb4d8907 ]
Add VID 13d3 & PID 3533 for Realtek RTL8821CE USB Bluetooth chip.
The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below.
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=13d3 ProdID=3533 Rev= 1.10 S: Manufacturer=Realtek S: Product=Bluetooth Radio S: SerialNumber=00e04c000001 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
--- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/btusb.c +2 -0
@@ -501,6 +501,8 @@ static const struct usb_device_id quirks_table[] = {/* Realtek 8821CE Bluetooth devices */ { USB_DEVICE(0x13d3, 0x3529), .driver_info = BTUSB_REALTEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x13d3, 0x3533), .driver_info = BTUSB_REALTEK | + BTUSB_WIDEBAND_SPEECH }, /* Realtek 8822CE Bluetooth devices */ { USB_DEVICE(0x0bda, 0xb00c), .driver_info = BTUSB_REALTEK |
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 43/567 Bluetooth: btusb: Add new VID/PID 0x0489/0xE12F for RTL8852BE-VT
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Chou <[email protected]>
[ Upstream commit 32caa197b9b603e20f49fd3a0dffecd0cd620499 ]
Add the support ID(0x0489, 0xE12F) to usb_device_id table for Realtek RTL8852BE-VT.
The device info from /sys/kernel/debug/usb/devices as below.
T: Bus=04 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 86 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e12f Rev= 0.00 S: Manufacturer=Realtek S: Product=Bluetooth Radio S: SerialNumber=00e04c000001 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
--- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/btusb.c +2 -0
@@ -577,6 +577,8 @@ static const struct usb_device_id quirks_table[] = {/* Realtek 8852BT/8852BE-VT Bluetooth devices */ { USB_DEVICE(0x0bda, 0x8520), .driver_info = BTUSB_REALTEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe12f), .driver_info = BTUSB_REALTEK | + BTUSB_WIDEBAND_SPEECH }, /* Realtek 8922AE Bluetooth devices */ { USB_DEVICE(0x0bda, 0x8922), .driver_info = BTUSB_REALTEK |
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 44/567 gfs2: Fix use of bio_chain
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Gruenbacher <[email protected]>
[ Upstream commit 8a157e0a0aa5143b5d94201508c0ca1bb8cfb941 ]
In gfs2_chain_bio(), the call to bio_chain() has its arguments swapped. The result is leaked bios and incorrect synchronization (only the last bio will actually be waited for). This code is only used during mount and filesystem thaw, so the bug normally won't be noticeable.
--- fs/gfs2/lops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/lops.c +1 -1
@@ -485,7 +485,7 @@ static struct bio *gfs2_chain_bio(struct bio *prev, unsigned int nr_iovecs) new =bio_alloc (prev->bi_bdev, nr_iovecs, prev->bi_opf,GFP_NOIO );bio_clone_blkg_association (new, prev); new->bi_iter.bi_sector =bio_end_sector (prev); -bio_chain (new, prev); +bio_chain (prev, new);submit_bio (prev);return new; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 45/567 net: fec: ERR007885 Workaround for XDP TX path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
[ Upstream commit e8e032cd24dda7cceaa27bc2eb627f82843f0466 ]
The ERR007885 will lead to a TDAR race condition for mutliQ when the driver sets TDAR and the UDMA clears TDAR simultaneously or in a small window (2-4 cycles). And it will cause the udma_tx and udma_tx_arbiter state machines to hang. Therefore, the commit 53bb20d1faba ("net: fec:
add variable reg_desc_active to speed things up") and the commit a179aad12bad ("net: fec: ERR007885 Workaround for conventional TX") have added the workaround to fix the potential issue for the conventional TX path. Similarly, the XDP TX path should also have the potential hang issue, so add the workaround for XDP TX path.
--- drivers/net/ethernet/freescale/fec_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +6 -1
@@ -3934,7 +3934,12 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep, txq->bd.cur = bdp;/* Trigger transmission start */ -writel (0 , txq->bd.reg_desc_active); +if (!(fep->quirks &FEC_QUIRK_ERR007885 ) || + !readl (txq->bd.reg_desc_active) || + !readl (txq->bd.reg_desc_active) || + !readl (txq->bd.reg_desc_active) || + !readl (txq->bd.reg_desc_active)) +writel (0 , txq->bd.reg_desc_active);return 0 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 46/567 netrom: Fix memory leak in nr_sendmsg()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang Liang <[email protected]>
[ Upstream commit 613d12dd794e078be8ff3cf6b62a6b9acf7f4619 ]
syzbot reported a memory leak [1].
When function sock_alloc_send_skb() return NULL in nr_output(), the original skb is not freed, which was allocated in nr_sendmsg(). Fix this by freeing it before return.
[1]
BUG: memory leak
unreferenced object 0xffff888129f35500 (size 240):
comm "syz.0.17", pid 6119, jiffies 4294944652
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 10 52 28 81 88 ff ff ..........R(....
backtrace (crc 1456a3e4):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4983 [inline]
slab_alloc_node mm/slub.c:5288 [inline]
kmem_cache_alloc_node_noprof+0x36f/0x5e0 mm/slub.c:5340
__alloc_skb+0x203/0x240 net/core/skbuff.c:660
alloc_skb include/linux/skbuff.h:1383 [inline]
alloc_skb_with_frags+0x69/0x3f0 net/core/skbuff.c:6671
sock_alloc_send_pskb+0x379/0x3e0 net/core/sock.c:2965
sock_alloc_send_skb include/net/sock.h:1859 [inline]
nr_sendmsg+0x287/0x450 net/netrom/af_netrom.c:1105
sock_sendmsg_nosec net/socket.c:727 [inline]
__sock_sendmsg net/socket.c:742 [inline]
sock_write_iter+0x293/0x2a0 net/socket.c:1195
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0x45d/0x710 fs/read_write.c:686
ksys_write+0x143/0x170 fs/read_write.c:738
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f--- net/netrom/nr_out.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/netrom/nr_out.c +3 -1
@@ -43,8 +43,10 @@ void nr_output(struct sock *sk, struct sk_buff *skb) frontlen =skb_headroom (skb);while (skb->len >0 ) { -if ((skbn =sock_alloc_send_skb (sk, frontlen +NR_MAX_PACKET_SIZE ,0 , &err)) ==NULL ) +if ((skbn =sock_alloc_send_skb (sk, frontlen +NR_MAX_PACKET_SIZE ,0 , &err)) ==NULL ) { +kfree_skb (skb);return ; + }skb_reserve (skbn, frontlen);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 47/567 net/sched: ets: Always remove class from active list before deleting in ets_qdisc_change
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit ce052b9402e461a9aded599f5b47e76bc727f7de ]
[email protected] says:
The vulnerability is a race condition between ets_qdisc_dequeue and ets_qdisc_change. It leads to UAF on struct Qdisc object. Attacker requires the capability to create new user and network namespace in order to trigger the bug.
See my additional commentary at the end of the analysis.
Analysis:
static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,
struct netlink_ext_ack *extack)
{
...
// (1) this lock is preventing .change handler (`ets_qdisc_change`)
//to race with .dequeue handler (`ets_qdisc_dequeue`)
sch_tree_lock(sch);
for (i = nbands; i < oldbands; i++) {
if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)
list_del_init(&q->classes[i].alist);
qdisc_purge_queue(q->classes[i].qdisc);
}
WRITE_ONCE(q->nbands, nbands);
for (i = nstrict; i < q->nstrict; i++) {
if (q->classes[i].qdisc->q.qlen) {
// (2) the class is added to the q->active
list_add_tail(&q->classes[i].alist, &q->active);
q->classes[i].deficit = quanta[i];
}
}
WRITE_ONCE(q->nstrict, nstrict);
memcpy(q->prio2band, priomap, sizeof(priomap));
for (i = 0; i < q->nbands; i++)
WRITE_ONCE(q->classes[i].quantum, quanta[i]);
for (i = oldbands; i < q->nbands; i++) {
q->classes[i].qdisc = queues[i];
if (q->classes[i].qdisc != &noop_qdisc)
qdisc_hash_add(q->classes[i].qdisc, true);
}
// (3) the qdisc is unlocked, now dequeue can be called in parallel
// to the rest of .change handler
sch_tree_unlock(sch);
ets_offload_change(sch);
for (i = q->nbands; i < oldbands; i++) {
// (4) we're reducing the refcount for our class's qdisc and
// freeing it
qdisc_put(q->classes[i].qdisc);
// (5) If we call .dequeue between (4) and (5), we will have
// a strong UAF and we can control RIP
q->classes[i].qdisc = NULL;
WRITE_ONCE(q->classes[i].quantum, 0);
q->classes[i].deficit = 0;
gnet_stats_basic_sync_init(&q->classes[i].bstats);
memset(&q->classes[i].qstats, 0, sizeof(q->classes[i].qstats));
}
return 0;
}Comment:
This happens because some of the classes have their qdiscs assigned to NULL, but remain in the active list. This commit fixes this issue by always removing the class from the active list before deleting and freeing its associated qdisc
Reproducer Steps
(trimmed version of what was sent by [email protected])
```
DEV="${DEV:-lo}"
ROOT_HANDLE="${ROOT_HANDLE:-1:}"
BAND2_HANDLE="${BAND2_HANDLE:-20:}" # child under 1:2
PING_BYTES="${PING_BYTES:-48}"
PING_COUNT="${PING_COUNT:-200000}"
PING_DST="${PING_DST:-127.0.0.1}"
SLOW_TBF_RATE="${SLOW_TBF_RATE:-8bit}"
SLOW_TBF_BURST="${SLOW_TBF_BURST:-100b}"
SLOW_TBF_LAT="${SLOW_TBF_LAT:-1s}"
cleanup() {
tc qdisc del dev "$DEV" root 2>/dev/null
}
trap cleanup EXIT
ip link set "$DEV" up
tc qdisc del dev "$DEV" root 2>/dev/null || true
tc qdisc add dev "$DEV" root handle "$ROOT_HANDLE" ets bands 2 strict 2
tc qdisc add dev "$DEV" parent 1:2 handle "$BAND2_HANDLE" \
tbf rate "$SLOW_TBF_RATE" burst "$SLOW_TBF_BURST" latency "$SLOW_TBF_LAT"
tc filter add dev "$DEV" parent 1: protocol all prio 1 u32 match u32 0 0 flowid 1:2
tc -s qdisc ls dev $DEV
ping -I "$DEV" -f -c "$PING_COUNT" -s "$PING_BYTES" -W 0.001 "$PING_DST" \
>/dev/null 2>&1 &
tc qdisc change dev "$DEV" root handle "$ROOT_HANDLE" ets bands 2 strict 0
tc qdisc change dev "$DEV" root handle "$ROOT_HANDLE" ets bands 2 strict 2
tc -s qdisc ls dev $DEV
tc qdisc del dev "$DEV" parent 1:2 || true
tc -s qdisc ls dev $DEV
tc qdisc change dev "$DEV" root handle "$ROOT_HANDLE" ets bands 1 strict 1
```KASAN report
```
==================================================================
BUG: KASAN: slab-use-after-free in ets_qdisc_dequeue+0x1071/0x11b0 kernel/net/sched/sch_ets.c:481 Read of size 8 at addr ffff8880502fc018 by task ping/12308
Quoted 1 line
CPU: 0 UID: 0 PID: 12308 Comm: ping Not tainted 6.18.0-rc4-dirty #1 PREEMPT(full) Hardware name: QEMU Ubuntu 25.04 PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: <IRQ> __dump_stack kernel/lib/dump_stack.c:94 dump_stack_lvl+0x100/0x190 kernel/lib/dump_stack.c:120 print_address_description kernel/mm/kasan/report.c:378 print_report+0x156/0x4c9 kernel/mm/kasan/report.c:482 kasan_report+0xdf/0x110 kernel/mm/kasan/report.c:595 ets_qdisc_dequeue+0x1071/0x11b0 kernel/net/sched/sch_ets.c:481 dequeue_skb kernel/net/sched/sch_generic.c:294 qdisc_restart kernel/net/sched/sch_generic.c:399 __qdisc_run+0x1c9/0x1b00 kernel/net/sched/sch_generic.c:417 __dev_xmit_skb kernel/net/core/dev.c:4221 __dev_queue_xmit+0x2848/0x4410 kernel/net/core/dev.c:4729 dev_queue_xmit kernel/./include/linux/netdevice.h:3365
[...]
Allocated by task 17115: kasan_save_stack+0x30/0x50 kernel/mm/kasan/common.c:56 kasan_save_track+0x14/0x30 kernel/mm/kasan/common.c:77 poison_kmalloc_redzone kernel/mm/kasan/common.c:400 __kasan_kmalloc+0xaa/0xb0 kernel/mm/kasan/common.c:417 kasan_kmalloc kernel/./include/linux/kasan.h:262 __do_kmalloc_node kernel/mm/slub.c:5642 __kmalloc_node_noprof+0x34e/0x990 kernel/mm/slub.c:5648 kmalloc_node_noprof kernel/./include/linux/slab.h:987 qdisc_alloc+0xb8/0xc30 kernel/net/sched/sch_generic.c:950 qdisc_create_dflt+0x93/0x490 kernel/net/sched/sch_generic.c:1012 ets_class_graft+0x4fd/0x800 kernel/net/sched/sch_ets.c:261 qdisc_graft+0x3e4/0x1780 kernel/net/sched/sch_api.c:1196
[...]
Freed by task 9905: kasan_save_stack+0x30/0x50 kernel/mm/kasan/common.c:56 kasan_save_track+0x14/0x30 kernel/mm/kasan/common.c:77 __kasan_save_free_info+0x3b/0x70 kernel/mm/kasan/generic.c:587 kasan_save_free_info kernel/mm/kasan/kasan.h:406 poison_slab_object kernel/mm/kasan/common.c:252 __kasan_slab_free+0x5f/0x80 kernel/mm/kasan/common.c:284 kasan_slab_free kernel/./include/linux/kasan.h:234 slab_free_hook kernel/mm/slub.c:2539 slab_free kernel/mm/slub.c:6630 kfree+0x144/0x700 kernel/mm/slub.c:6837 rcu_do_batch kernel/kernel/rcu/tree.c:2605 rcu_core+0x7c0/0x1500 kernel/kernel/rcu/tree.c:2861 handle_softirqs+0x1ea/0x8a0 kernel/kernel/softirq.c:622 __do_softirq kernel/kernel/softirq.c:656
[...]
Commentary:
1. Maher Azzouzi working with Trend Micro Zero Day Initiative was reported as the person who found the issue. I requested to get a proper email to add to the reported-by tag but got no response. For this reason i will credit the person i exchanged emails with i.e [email protected]
2. Neither i nor Victor who did a much more thorough testing was able to reproduce a UAF with the PoC or other approaches we tried. We were both able to reproduce a null ptr deref. After exchange with [email protected] they sent a small change to be made to the code to add an extra delay which was able to simulate the UAF. i.e, this:
qdisc_put(q->classes[i].qdisc);
mdelay(90);
q->classes[i].qdisc = NULL;
I was informed by Thomas Gleixner([email protected]) that adding delays was acceptable approach for demonstrating the bug, quote:
"Adding such delays is common exploit validation practice"
The equivalent delay could happen "by virt scheduling the vCPU out, SMIs, NMIs, PREEMPT_RT enabled kernel"
3. I asked the OP to test and report back but got no response and after a few days gave up and proceeded to submit this fix.
--- net/sched/sch_ets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_ets.c +1 -1
@@ -652,7 +652,7 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,sch_tree_lock (sch);for (i = nbands; i < oldbands; i++) { -if (i >= q->nstrict && q->classes[i].qdisc->q.qlen) +if (cl_is_active (&q->classes[i]))list_del_init (&q->classes[i].alist);qdisc_purge_queue (q->classes[i].qdisc); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 48/567 ipvlan: Ignore PACKET_LOOPBACK in handle_mode_l2()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Skorodumov <[email protected]>
[ Upstream commit 0c57ff008a11f24f7f05fa760222692a00465fec ]
Packets with pkt_type == PACKET_LOOPBACK are captured by handle_frame() function, but they don't have L2 header. We should not process them in handle_mode_l2().
This doesn't affect old L2 functionality, since handling was anyway incorrect.
Handle them the same way as in br_handle_frame():
just pass the skb.
To observe invalid behaviour, just start "ping -b" on bcast address of port-interface.
--- drivers/net/ipvlan/ipvlan_core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ipvlan/ipvlan_core.c +3 -0
@@ -737,6 +737,9 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,struct ethhdr *eth =eth_hdr (skb);rx_handler_result_t ret =RX_HANDLER_PASS ; +if (unlikely (skb->pkt_type ==PACKET_LOOPBACK )) +return RX_HANDLER_PASS ; +if (is_multicast_ether_addr (eth->h_dest)) {if (ipvlan_external_frame (skb, port)) {struct sk_buff *nskb =skb_clone (skb,GFP_ATOMIC );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 49/567 mlxsw: spectrum_router: Fix possible neighbour reference count leak
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit b6b638bda240395dff49a87403b2e32493e56d2a ]
mlxsw_sp_router_schedule_work() takes a reference on a neighbour, expecting a work item to release it later on. However, we might fail to schedule the work item, in which case the neighbour reference count will be leaked.
Fix by taking the reference just before scheduling the work item. Note that mlxsw_sp_router_schedule_work() can receive a NULL neighbour pointer, but neigh_clone() handles that correctly.
Spotted during code review, did not actually observe the reference count leak.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +5 -5
@@ -2858,6 +2858,11 @@ static int mlxsw_sp_router_schedule_work(struct net *net,if (!net_work)return NOTIFY_BAD ; +/* Take a reference to ensure the neighbour won't be destructed until +* we drop the reference in the work item. +*/ +neigh_clone (n); +INIT_WORK (&net_work->work, cb); net_work->mlxsw_sp = router->mlxsw_sp; net_work->n = n;
@@ -2881,11 +2886,6 @@ static int mlxsw_sp_router_schedule_neigh_work(struct mlxsw_sp_router *router,struct net *net; net =neigh_parms_net (n->parms); - -/* Take a reference to ensure the neighbour won't be destructed until we -* drop the reference in delayed work. -*/ -neigh_clone (n);return mlxsw_sp_router_schedule_work (net, router, n, mlxsw_sp_router_neigh_event_work); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 50/567 mlxsw: spectrum_router: Fix neighbour use-after-free
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 8b0e69763ef948fb872a7767df4be665d18f5fd4 ]
We sometimes observe use-after-free when dereferencing a neighbour [1]. The problem seems to be that the driver stores a pointer to the neighbour, but without holding a reference on it. A reference is only taken when the neighbour is used by a nexthop.
Fix by simplifying the reference counting scheme. Always take a reference when storing a neighbour pointer in a neighbour entry. Avoid taking a referencing when the neighbour is used by a nexthop as the neighbour entry associated with the nexthop already holds a reference.
Tested by running the test that uncovered the problem over 300 times. Without this patch the problem was reproduced after a handful of iterations.
[1]
BUG: KASAN: slab-use-after-free in mlxsw_sp_neigh_entry_update+0x2d4/0x310 Read of size 8 at addr ffff88817f8e3420 by task ip/3929 CPU: 3 UID: 0 PID: 3929 Comm: ip Not tainted 6.18.0-rc4-virtme-g36b21a067510 #3 PREEMPT(full) Hardware name: Nvidia SN5600/VMOD0013, BIOS 5.13 05/31/2023 Call Trace: <TASK> dump_stack_lvl+0x6f/0xa0 print_address_description.constprop.0+0x6e/0x300 print_report+0xfc/0x1fb kasan_report+0xe4/0x110 mlxsw_sp_neigh_entry_update+0x2d4/0x310 mlxsw_sp_router_rif_gone_sync+0x35f/0x510 mlxsw_sp_rif_destroy+0x1ea/0x730 mlxsw_sp_inetaddr_port_vlan_event+0xa1/0x1b0 __mlxsw_sp_inetaddr_lag_event+0xcc/0x130 __mlxsw_sp_inetaddr_event+0xf5/0x3c0 mlxsw_sp_router_netdevice_event+0x1015/0x1580 notifier_call_chain+0xcc/0x150 call_netdevice_notifiers_info+0x7e/0x100 __netdev_upper_dev_unlink+0x10b/0x210 netdev_upper_dev_unlink+0x79/0xa0 vrf_del_slave+0x18/0x50 do_set_master+0x146/0x7d0 do_setlink.isra.0+0x9a0/0x2880 rtnl_newlink+0x637/0xb20 rtnetlink_rcv_msg+0x6fe/0xb90 netlink_rcv_skb+0x123/0x380 netlink_unicast+0x4a3/0x770 netlink_sendmsg+0x75b/0xc90 __sock_sendmsg+0xbe/0x160 ____sys_sendmsg+0x5b2/0x7d0 ___sys_sendmsg+0xfd/0x180 __sys_sendmsg+0x124/0x1c0 do_syscall_64+0xbb/0xfd0 entry_SYSCALL_64_after_hwframe+0x4b/0x53
[...]
Allocated by task 109: kasan_save_stack+0x30/0x50 kasan_save_track+0x14/0x30 __kasan_kmalloc+0x7b/0x90 __kmalloc_noprof+0x2c1/0x790 neigh_alloc+0x6af/0x8f0 ___neigh_create+0x63/0xe90 mlxsw_sp_nexthop_neigh_init+0x430/0x7e0 mlxsw_sp_nexthop_type_init+0x212/0x960 mlxsw_sp_nexthop6_group_info_init.constprop.0+0x81f/0x1280 mlxsw_sp_nexthop6_group_get+0x392/0x6a0 mlxsw_sp_fib6_entry_create+0x46a/0xfd0 mlxsw_sp_router_fib6_replace+0x1ed/0x5f0 mlxsw_sp_router_fib6_event_work+0x10a/0x2a0 process_one_work+0xd57/0x1390 worker_thread+0x4d6/0xd40 kthread+0x355/0x5b0 ret_from_fork+0x1d4/0x270 ret_from_fork_asm+0x11/0x20 Freed by task 154: kasan_save_stack+0x30/0x50 kasan_save_track+0x14/0x30 __kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x43/0x70 kmem_cache_free_bulk.part.0+0x1eb/0x5e0 kvfree_rcu_bulk+0x1f2/0x260 kfree_rcu_work+0x130/0x1b0 process_one_work+0xd57/0x1390 worker_thread+0x4d6/0xd40 kthread+0x355/0x5b0 ret_from_fork+0x1d4/0x270 ret_from_fork_asm+0x11/0x20 Last potentially related work creation: kasan_save_stack+0x30/0x50 kasan_record_aux_stack+0x8c/0xa0 kvfree_call_rcu+0x93/0x5b0 mlxsw_sp_router_neigh_event_work+0x67d/0x860 process_one_work+0xd57/0x1390 worker_thread+0x4d6/0xd40 kthread+0x355/0x5b0 ret_from_fork+0x1d4/0x270 ret_from_fork_asm+0x11/0x20
--- .../ethernet/mellanox/mlxsw/spectrum_router.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +9 -8
@@ -2265,6 +2265,7 @@ mlxsw_sp_neigh_entry_alloc(struct mlxsw_sp *mlxsw_sp, struct neighbour *n,if (!neigh_entry)return NULL ; +neigh_hold (n); neigh_entry->key.n = n; neigh_entry->rif = rif;INIT_LIST_HEAD (&neigh_entry->nexthop_list);
@@ -2274,6 +2275,7 @@ mlxsw_sp_neigh_entry_alloc(struct mlxsw_sp *mlxsw_sp, struct neighbour *n,static void mlxsw_sp_neigh_entry_free (struct mlxsw_sp_neigh_entry *neigh_entry) { +neigh_release (neigh_entry->key.n);kfree (neigh_entry); }
@@ -4320,6 +4322,8 @@ mlxsw_sp_nexthop_dead_neigh_replace(struct mlxsw_sp *mlxsw_sp,if (err) goto err_neigh_entry_insert; +neigh_release (old_n); +read_lock_bh (&n->lock); nud_state = n->nud_state; dead = n->dead;
@@ -4328,14 +4332,10 @@ mlxsw_sp_nexthop_dead_neigh_replace(struct mlxsw_sp *mlxsw_sp,list_for_each_entry (nh, &neigh_entry->nexthop_list, neigh_list_node) { -neigh_release (old_n); -neigh_clone (n);__mlxsw_sp_nexthop_neigh_update (nh, !entry_connected);mlxsw_sp_nexthop_group_refresh (mlxsw_sp, nh->nhgi->nh_grp); } -neigh_release (n); -return 0 ; err_neigh_entry_insert:
@@ -4428,6 +4428,11 @@ static int mlxsw_sp_nexthop_neigh_init(struct mlxsw_sp *mlxsw_sp, } } +/* Release the reference taken by neigh_lookup() / neigh_create() since +* neigh_entry already holds one. +*/ +neigh_release (n); +/* If that is the first nexthop connected to that neigh, add to * nexthop_neighs_list */
@@ -4454,11 +4459,9 @@ static void mlxsw_sp_nexthop_neigh_fini(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nexthop *nh) {struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry; -struct neighbour *n;if (!neigh_entry)return ; - n = neigh_entry->key.n;__mlxsw_sp_nexthop_neigh_update (nh, true);list_del (&nh->neigh_list_node);
@@ -4472,8 +4475,6 @@ static void mlxsw_sp_nexthop_neigh_fini(struct mlxsw_sp *mlxsw_sp,if (!neigh_entry->connected &&list_empty (&neigh_entry->nexthop_list))mlxsw_sp_neigh_entry_destroy (mlxsw_sp, neigh_entry); - -neigh_release (n); }static bool mlxsw_sp_ipip_netdev_ul_up (struct net_device *ol_dev)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 51/567 mlxsw: spectrum_mr: Fix use-after-free when updating multicast route stats
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 8ac1dacec458f55f871f7153242ed6ab60373b90 ]
Cited commit added a dedicated mutex (instead of RTNL) to protect the multicast route list, so that it will not change while the driver periodically traverses it in order to update the kernel about multicast route stats that were queried from the device.
One instance of list entry deletion (during route replace) was missed and it can result in a use-after-free [1].
Fix by acquiring the mutex before deleting the entry from the list and releasing it afterwards.
[1]
BUG: KASAN: slab-use-after-free in mlxsw_sp_mr_stats_update+0x4a5/0x540 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c:1006 [mlxsw_spectrum] Read of size 8 at addr ffff8881523c2fa8 by task kworker/2:5/22043 CPU: 2 UID: 0 PID: 22043 Comm: kworker/2:5 Not tainted 6.18.0-rc1-custom-g1a3d6d7cd014 #1 PREEMPT(full) Hardware name: Mellanox Technologies Ltd. MSN2010/SA002610, BIOS 5.6.5 08/24/2017 Workqueue: mlxsw_core mlxsw_sp_mr_stats_update [mlxsw_spectrum] Call Trace: <TASK> dump_stack_lvl+0xba/0x110 print_report+0x174/0x4f5 kasan_report+0xdf/0x110 mlxsw_sp_mr_stats_update+0x4a5/0x540 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c:1006 [mlxsw_spectrum] process_one_work+0x9cc/0x18e0 worker_thread+0x5df/0xe40 kthread+0x3b8/0x730 ret_from_fork+0x3e9/0x560 ret_from_fork_asm+0x1a/0x30 </TASK> Allocated by task 29933: kasan_save_stack+0x30/0x50 kasan_save_track+0x14/0x30 __kasan_kmalloc+0x8f/0xa0 mlxsw_sp_mr_route_add+0xd8/0x4770 [mlxsw_spectrum] mlxsw_sp_router_fibmr_event_work+0x371/0xad0 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:7965 [mlxsw_spectrum] process_one_work+0x9cc/0x18e0 worker_thread+0x5df/0xe40 kthread+0x3b8/0x730 ret_from_fork+0x3e9/0x560 ret_from_fork_asm+0x1a/0x30 Freed by task 29933: kasan_save_stack+0x30/0x50 kasan_save_track+0x14/0x30 __kasan_save_free_info+0x3b/0x70 __kasan_slab_free+0x43/0x70 kfree+0x14e/0x700 mlxsw_sp_mr_route_add+0x2dea/0x4770 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c:444 [mlxsw_spectrum] mlxsw_sp_router_fibmr_event_work+0x371/0xad0 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:7965 [mlxsw_spectrum] process_one_work+0x9cc/0x18e0 worker_thread+0x5df/0xe40 kthread+0x3b8/0x730 ret_from_fork+0x3e9/0x560 ret_from_fork_asm+0x1a/0x30
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c +2 -0
@@ -440,7 +440,9 @@ int mlxsw_sp_mr_route_add(struct mlxsw_sp_mr_table *mr_table,rhashtable_remove_fast (&mr_table->route_ht, &mr_orig_route->ht_node, mlxsw_sp_mr_route_ht_params); +mutex_lock (&mr_table->route_list_lock);list_del (&mr_orig_route->node); +mutex_unlock (&mr_table->route_list_lock);mlxsw_sp_mr_route_destroy (mr_table, mr_orig_route); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 52/567 bnxt_en: Fix XDP_TX path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Chan <[email protected]>
[ Upstream commit 0373d5c387f24de749cc22e694a14b3a7c7eb515 ]
For XDP_TX action in bnxt_rx_xdp(), clearing of the event flags is not correct. __bnxt_poll_work() -> bnxt_rx_pkt() -> bnxt_rx_xdp() may be looping within NAPI and some event flags may be set in earlier iterations. In particular, if BNXT_TX_EVENT is set earlier indicating some XDP_TX packets are ready and pending, it will be cleared if it is XDP_TX action again. Normally, we will set BNXT_TX_EVENT again when we successfully call __bnxt_xmit_xdp(). But if the TX ring has no more room, the flag will not be set. This will cause the TX producer to be ahead but the driver will not hit the TX doorbell.
For multi-buf XDP_TX, there is no need to clear the event flags and set BNXT_AGG_EVENT. The BNXT_AGG_EVENT flag should have been set earlier in bnxt_rx_pkt().
The visible symptom of this is that the RX ring associated with the TX XDP ring will eventually become empty and all packets will be dropped. Because this condition will cause the driver to not refill the RX ring seeing that the TX ring has forever pending XDP_TX packets.
The fix is to only clear BNXT_RX_EVENT when we have successfully called __bnxt_xmit_xdp().
--- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +1 -2
@@ -268,13 +268,11 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,case XDP_TX : rx_buf = &rxr->rx_buf_ring[cons]; mapping = rx_buf->mapping - bp->rx_dma_offset; - *event &=BNXT_TX_CMP_EVENT ;if (unlikely (xdp_buff_has_frags (xdp))) {struct skb_shared_info *sinfo =xdp_get_shared_info_from_buff (xdp); tx_needed += sinfo->nr_frags; - *event =BNXT_AGG_EVENT ; }if (tx_avail < tx_needed) {
@@ -287,6 +285,7 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,dma_sync_single_for_device (&pdev->dev, mapping + offset, *len, bp->rx_dir); + *event &= ~BNXT_RX_EVENT ; *event |=BNXT_TX_EVENT ;__bnxt_xmit_xdp (bp, txr, mapping + offset, *len,NEXT_RX (rxr->rx_prod), xdp);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 53/567 net: openvswitch: fix middle attribute validation in push_nsh() action
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Maximets <[email protected]>
[ Upstream commit 5ace7ef87f059d68b5f50837ef3e8a1a4870c36e ]
The push_nsh() action structure looks like this:
OVS_ACTION_ATTR_PUSH_NSH(OVS_KEY_ATTR_NSH(OVS_NSH_KEY_ATTR_BASE,...))
The outermost OVS_ACTION_ATTR_PUSH_NSH attribute is OK'ed by the nla_for_each_nested() inside __ovs_nla_copy_actions(). The innermost OVS_NSH_KEY_ATTR_BASE/MD1/MD2 are OK'ed by the nla_for_each_nested() inside nsh_key_put_from_nlattr(). But nothing checks if the attribute in the middle is OK. We don't even check that this attribute is the OVS_KEY_ATTR_NSH. We just do a double unwrap with a pair of nla_data() calls - first time directly while calling validate_push_nsh() and the second time as part of the nla_for_each_nested() macro, which isn't safe, potentially causing invalid memory access if the size of this attribute is incorrect. The failure may not be noticed during validation due to larger netlink buffer, but cause trouble later during action execution where the buffer is allocated exactly to the size:
BUG: KASAN: slab-out-of-bounds in nsh_hdr_from_nlattr+0x1dd/0x6a0 [openvswitch] Read of size 184 at addr ffff88816459a634 by task a.out/22624 CPU: 8 UID: 0 PID: 22624 6.18.0-rc7+ #115 PREEMPT(voluntary) Call Trace: <TASK> dump_stack_lvl+0x51/0x70 print_address_description.constprop.0+0x2c/0x390 kasan_report+0xdd/0x110 kasan_check_range+0x35/0x1b0 __asan_memcpy+0x20/0x60 nsh_hdr_from_nlattr+0x1dd/0x6a0 [openvswitch] push_nsh+0x82/0x120 [openvswitch] do_execute_actions+0x1405/0x2840 [openvswitch] ovs_execute_actions+0xd5/0x3b0 [openvswitch] ovs_packet_cmd_execute+0x949/0xdb0 [openvswitch] genl_family_rcv_msg_doit+0x1d6/0x2b0 genl_family_rcv_msg+0x336/0x580 genl_rcv_msg+0x9f/0x130 netlink_rcv_skb+0x11f/0x370 genl_rcv+0x24/0x40 netlink_unicast+0x73e/0xaa0 netlink_sendmsg+0x744/0xbf0 __sys_sendto+0x3d6/0x450 do_syscall_64+0x79/0x2c0 entry_SYSCALL_64_after_hwframe+0x76/0x7e </TASK>
Let's add some checks that the attribute is properly sized and it's the only one attribute inside the action. Technically, there is no real reason for OVS_KEY_ATTR_NSH to be there, as we know that we're pushing an NSH header already, it just creates extra nesting, but that's how uAPI works today. So, keeping as it is.
--- net/openvswitch/flow_netlink.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
net/openvswitch/flow_netlink.c +10 -3
@@ -2802,13 +2802,20 @@ static int validate_and_copy_set_tun(const struct nlattr *attr,return err; } -static bool validate_push_nsh (const struct nlattr *attr,bool log) +static bool validate_push_nsh (const struct nlattr *a,bool log) { +struct nlattr *nsh_key =nla_data (a);struct sw_flow_match match;struct sw_flow_key key; +/* There must be one and only one NSH header. */ +if (!nla_ok (nsh_key,nla_len (a)) || +nla_total_size (nla_len (nsh_key)) !=nla_len (a) || +nla_type (nsh_key) !=OVS_KEY_ATTR_NSH ) +return false; +ovs_match_init (&match, &key, true,NULL ); -return !nsh_key_put_from_nlattr (attr, &match, false, true, log); +return !nsh_key_put_from_nlattr (nsh_key, &match, false, true, log); }/* Return false if there are any non-masked bits set.
@@ -3388,7 +3395,7 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,return -EINVAL ; } mac_proto =MAC_PROTO_NONE ; -if (!validate_push_nsh (nla_data (a), log)) +if (!validate_push_nsh (a, log))return -EINVAL ;break ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 54/567 broadcom: b44: prevent uninitialized value usage
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Simakov <[email protected]>
[ Upstream commit 50b3db3e11864cb4e18ff099cfb38e11e7f87a68 ]
On execution path with raised B44_FLAG_EXTERNAL_PHY, b44_readphy() leaves bmcr value uninitialized and it is used later in the code.
Add check of this flag at the beginning of the b44_nway_reset() and exit early of the function with restarting autonegotiation if an external PHY is used.
--- drivers/net/ethernet/broadcom/b44.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/b44.c +3 -0
@@ -1789,6 +1789,9 @@ static int b44_nway_reset(struct net_device *dev)u32 bmcr;int r; +if (bp->flags &B44_FLAG_EXTERNAL_PHY ) +return phy_ethtool_nway_reset (dev); +spin_lock_irq (&bp->lock);b44_readphy (bp,MII_BMCR , &bmcr);b44_readphy (bp,MII_BMCR , &bmcr);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 55/567 netfilter: nf_conncount: fix leaked ct in error paths
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fernando Fernandez Mancera <[email protected]>
[ Upstream commit 2e2a720766886190a6d35c116794693aabd332b6 ]
There are some situations where ct might be leaked as error paths are skipping the refcounted check and return immediately. In order to solve it make sure that the check is always called.
--- net/netfilter/nf_conncount.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
net/netfilter/nf_conncount.c +14 -11
@@ -172,14 +172,14 @@ static int __nf_conncount_add(struct net *net,struct nf_conn *found_ct;unsigned int collect =0 ;bool refcounted = false; +int err =0 ;if (!get_ct_or_tuple_from_skb (net, skb, l3num, &ct, &tuple, &zone, &refcounted))return -ENOENT ;if (ct &&nf_ct_is_confirmed (ct)) { -if (refcounted) -nf_ct_put (ct); -return -EEXIST ; + err = -EEXIST ; + goto out_put; }if ((u32 )jiffies == list->last_gc)
@@ -231,12 +231,16 @@ static int __nf_conncount_add(struct net *net, } add_new_node: -if (WARN_ON_ONCE (list->count >INT_MAX )) -return -EOVERFLOW ; +if (WARN_ON_ONCE (list->count >INT_MAX )) { + err = -EOVERFLOW ; + goto out_put; + } conn =kmem_cache_alloc (conncount_conn_cachep,GFP_ATOMIC ); -if (conn ==NULL ) -return -ENOMEM ; +if (conn ==NULL ) { + err = -ENOMEM ; + goto out_put; + } conn->tuple = tuple; conn->zone = *zone;
@@ -249,7 +253,7 @@ static int __nf_conncount_add(struct net *net, out_put:if (refcounted)nf_ct_put (ct); -return 0 ; +return err; } int nf_conncount_add_skb(struct net *net,
@@ -446,11 +450,10 @@ insert_tree(struct net *net,rb_link_node_rcu (&rbconn->node, parent, rbnode);rb_insert_color (&rbconn->node, root); - -if (refcounted) -nf_ct_put (ct); } out_unlock: +if (refcounted) +nf_ct_put (ct);spin_unlock_bh (&nf_conncount_locks[hash]);return count; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 56/567 ipvs: fix ipv4 null-ptr-deref in route error path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <[email protected]>
[ Upstream commit ad891bb3d079a46a821bf2b8867854645191bab0 ]
The IPv4 code path in __ip_vs_get_out_rt() calls dst_link_failure() without ensuring skb->dev is set, leading to a NULL pointer dereference in fib_compute_spec_dst() when ipv4_link_failure() attempts to send ICMP destination unreachable messages.
The issue emerged after commit ed0de45a1008 ("ipv4: recompile ip options in ipv4_link_failure") started calling __ip_options_compile() from ipv4_link_failure(). This code path eventually calls fib_compute_spec_dst() which dereferences skb->dev. An attempt was made to fix the NULL skb->dev dereference in commit 0113d9c9d1cc ("ipv4: fix null-deref in ipv4_link_failure"), but it only addressed the immediate dev_net(skb->dev) dereference by using a fallback device. The fix was incomplete because fib_compute_spec_dst() later in the call chain still accesses skb->dev directly, which remains NULL when IPVS calls dst_link_failure().
The crash occurs when:
1. IPVS processes a packet in NAT mode with a misconfigured destination
2. Route lookup fails in __ip_vs_get_out_rt() before establishing a route
3. The error path calls dst_link_failure(skb) with skb->dev == NULL
4. ipv4_link_failure() → ipv4_send_dest_unreach() → __ip_options_compile() → fib_compute_spec_dst()
5. fib_compute_spec_dst() dereferences NULL skb->dev
Apply the same fix used for IPv6 in commit 326bf17ea5d4 ("ipvs: fix ipv6 route unreach panic"): set skb->dev from skb_dst(skb)->dev before calling dst_link_failure().
KASAN: null-ptr-deref in range [0x0000000000000328-0x000000000000032f] CPU: 1 PID: 12732 Comm: syz.1.3469 Not tainted 6.6.114 #2 RIP: 0010:__in_dev_get_rcu include/linux/inetdevice.h:233 RIP: 0010:fib_compute_spec_dst+0x17a/0x9f0 net/ipv4/fib_frontend.c:285 Call Trace: <TASK> spec_dst_fill net/ipv4/ip_options.c:232 spec_dst_fill net/ipv4/ip_options.c:229 __ip_options_compile+0x13a1/0x17d0 net/ipv4/ip_options.c:330 ipv4_send_dest_unreach net/ipv4/route.c:1252 ipv4_link_failure+0x702/0xb80 net/ipv4/route.c:1265 dst_link_failure include/net/dst.h:437 __ip_vs_get_out_rt+0x15fd/0x19e0 net/netfilter/ipvs/ip_vs_xmit.c:412 ip_vs_nat_xmit+0x1d8/0xc80 net/netfilter/ipvs/ip_vs_xmit.c:764
--- net/netfilter/ipvs/ip_vs_xmit.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/ipvs/ip_vs_xmit.c +3 -0
@@ -409,6 +409,9 @@ __ip_vs_get_out_rt(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,return -1 ; err_unreach: +if (!skb->dev) + skb->dev =skb_dst (skb)->dev; +dst_link_failure (skb);return -1 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 57/567 caif: fix integer underflow in cffrml_receive()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junrui Luo <[email protected]>
[ Upstream commit 8a11ff0948b5ad09b71896b7ccc850625f9878d1 ]
The cffrml_receive() function extracts a length field from the packet header and, when FCS is disabled, subtracts 2 from this length without validating that len >= 2.
If an attacker sends a malicious packet with a length field of 0 or 1 to an interface with FCS disabled, the subtraction causes an integer underflow.
This can lead to memory exhaustion and kernel instability, potential information disclosure if padding contains uninitialized kernel memory.
Fix this by validating that len >= 2 before performing the subtraction.
--- net/caif/cffrml.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
net/caif/cffrml.c +8 -1
@@ -92,8 +92,15 @@ static int cffrml_receive(struct cflayer *layr, struct cfpkt *pkt) len =le16_to_cpu (tmp);/* Subtract for FCS on length if FCS is not used. */ -if (!this->dofcs) +if (!this->dofcs) { +if (len <2 ) { + ++cffrml_rcv_error; +pr_err ("Invalid frame length (%d)\n" , len); +cfpkt_destroy (pkt); +return -EPROTO ; + } len -=2 ; + }if (cfpkt_setlen (pkt, len) <0 ) { ++cffrml_rcv_error;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 58/567 net/sched: ets: Remove drr class from the active list if it changes to strict
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Victor Nogueira <[email protected]>
[ Upstream commit b1e125ae425aba9b45252e933ca8df52a843ec70 ]
Whenever a user issues an ets qdisc change command, transforming a drr class into a strict one, the ets code isn't checking whether that class was in the active list and removing it. This means that, if a user changes a strict class (which was in the active list) back to a drr one, that class will be added twice to the active list [1].
Doing so with the following commands:
tc qdisc add dev lo root handle 1: ets bands 2 strict 1 tc qdisc add dev lo parent 1:2 handle 20: \
tbf rate 8bit burst 100b latency 1s
tc filter add dev lo parent 1: basic classid 1:2 ping -c1 -W0.01 -s 56 127.0.0.1
tc qdisc change dev lo root handle 1: ets bands 2 strict 2 tc qdisc change dev lo root handle 1: ets bands 2 strict 1 ping -c1 -W0.01 -s 56 127.0.0.1
Will trigger the following splat with list debug turned on:
[ 59.279014][ T365] ------------[ cut here ]------------ [ 59.279452][ T365] list_add double add: new=ffff88801d60e350, prev=ffff88801d60e350, next=ffff88801d60e2c0. [ 59.280153][ T365] WARNING: CPU: 3 PID: 365 at lib/list_debug.c:35 __list_add_valid_or_report+0x17f/0x220 [ 59.280860][ T365] Modules linked in: [ 59.281165][ T365] CPU: 3 UID: 0 PID: 365 Comm: tc Not tainted 6.18.0-rc7-00105-g7e9f13163c13-dirty #239 PREEMPT(voluntary) [ 59.281977][ T365] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 59.282391][ T365] RIP: 0010:__list_add_valid_or_report+0x17f/0x220 [ 59.282842][ T365] Code: 89 c6 e8 d4 b7 0d ff 90 0f 0b 90 90 31 c0 e9 31 ff ff ff 90 48 c7 c7 e0 a0 22 9f 48 89 f2 48 89 c1 4c 89 c6 e8 b2 b7 0d ff 90 <0f> 0b 90 90 31 c0 e9 0f ff ff ff 48 89 f7 48 89 44 24 10 4c 89 44 ... [ 59.288812][ T365] Call Trace: [ 59.289056][ T365] <TASK> [ 59.289224][ T365] ? srso_alias_return_thunk+0x5/0xfbef5 [ 59.289546][ T365] ets_qdisc_change+0xd2b/0x1e80 [ 59.289891][ T365] ? __lock_acquire+0x7e7/0x1be0 [ 59.290223][ T365] ? __pfx_ets_qdisc_change+0x10/0x10 [ 59.290546][ T365] ? srso_alias_return_thunk+0x5/0xfbef5 [ 59.290898][ T365] ? __mutex_trylock_common+0xda/0x240 [ 59.291228][ T365] ? __pfx___mutex_trylock_common+0x10/0x10 [ 59.291655][ T365] ? srso_alias_return_thunk+0x5/0xfbef5 [ 59.291993][ T365] ? srso_alias_return_thunk+0x5/0xfbef5 [ 59.292313][ T365] ? trace_contention_end+0xc8/0x110 [ 59.292656][ T365] ? srso_alias_return_thunk+0x5/0xfbef5 [ 59.293022][ T365] ? srso_alias_return_thunk+0x5/0xfbef5 [ 59.293351][ T365] tc_modify_qdisc+0x63a/0x1cf0
Fix this by always checking and removing an ets class from the active list when changing it to strict.
--- net/sched/sch_ets.c | 4 ++++ 1 file changed, 4 insertions(+)
net/sched/sch_ets.c +4 -0
@@ -664,6 +664,10 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt, q->classes[i].deficit = quanta[i]; } } +for (i = q->nstrict; i < nstrict; i++) { +if (cl_is_active (&q->classes[i])) +list_del_init (&q->classes[i].alist); + }WRITE_ONCE (q->nstrict, nstrict);memcpy (q->prio2band, priomap,sizeof (priomap));
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 59/567 nfc: pn533: Fix error code in pn533_acr122_poweron_rdr()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 885bebac9909994050bbbeed0829c727e42bd1b7 ]
Set the error code if "transferred != sizeof(cmd)" instead of returning success.
--- drivers/nfc/pn533/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/pn533/usb.c +1 -1
@@ -406,7 +406,7 @@ static int pn533_acr122_poweron_rdr(struct pn533_usb_phy *phy)if (rc || (transferred !=sizeof (cmd))) {nfc_err (&phy->udev->dev,"Reader power on cmd error %d\n" , rc); -return rc; +return rc ?: -EINVAL ; } rc =usb_submit_urb (phy->in_urb,GFP_KERNEL );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 60/567 netfilter: nf_nat: remove bogus direction check
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit 5ec8ca26fe93103577c904644b0957f069d0051a ]
Jakub reports spurious failures of the 'conntrack_reverse_clash.sh' selftest. A bogus test makes nat core resort to port rewrite even though there is no need for this.
When the test is made, nf_nat_used_tuple() would already have caused us to return if no other CPU had added a colliding entry. Moreover, nf_nat_used_tuple() would have ignored the colliding entry if their origin tuples had been the same.
All that is left to check is if the colliding entry in the hash table is subject to NAT, and, if its not, if our entry matches in the reverse direction, e.g. hash table has
addr1:1234 -> addr2:80, and we want to commit
addr2:80 -> addr1:1234.
Because we already checked that neither the new nor the committed entry is subject to NAT we only have to check origin vs. reply tuple:
for non-nat entries, the reply tuple is always the inverted original.
Just in case there are more problems extend the error reporting in the selftest while at it and dump conntrack table/stats on error.
--- net/netfilter/nf_nat_core.c | 14 +------------- .../net/netfilter/conntrack_reverse_clash.c | 13 +++++++++---- .../net/netfilter/conntrack_reverse_clash.sh | 2 ++ 3 files changed, 12 insertions(+), 17 deletions(-)
net/netfilter/nf_nat_core.c +1 -13
@@ -298,25 +298,13 @@ nf_nat_used_tuple_new(const struct nf_conntrack_tuple *tuple, ct =nf_ct_tuplehash_to_ctrack (thash); -/* NB: IP_CT_DIR_ORIGINAL should be impossible because -* nf_nat_used_tuple() handles origin collisions. -* -* Handle remote chance other CPU confirmed its ct right after. -*/ -if (thash->tuple.dst.dir !=IP_CT_DIR_REPLY ) - goto out; -/* clashing connection subject to NAT? Retry with new tuple. */ if (READ_ONCE (ct->status) & uses_nat) goto out;if (nf_ct_tuple_equal (&ct->tuplehash[IP_CT_DIR_ORIGINAL ].tuple, - &ignored_ct->tuplehash[IP_CT_DIR_REPLY ].tuple) && -nf_ct_tuple_equal (&ct->tuplehash[IP_CT_DIR_REPLY ].tuple, - &ignored_ct->tuplehash[IP_CT_DIR_ORIGINAL ].tuple)) { + &ignored_ct->tuplehash[IP_CT_DIR_REPLY ].tuple)) taken = false; - goto out; - } out:nf_ct_put (ct);return taken;
tools/testing/selftests/net/netfilter/conntrack_reverse_clash.c +9 -4
@@ -33,9 +33,14 @@ static void die(const char *e)exit (111 ); } -static void die_port (uint16_t got,uint16_t want) +static void die_port (const struct sockaddr_in *sin,uint16_t want) { -fprintf (stderr,"Port number changed, wanted %d got %d\n" , want,ntohs (got)); +uint16_t got =ntohs (sin->sin_port); +char str[INET_ADDRSTRLEN ]; + +inet_ntop (AF_INET , &sin->sin_addr, str,sizeof (str)); + +fprintf (stderr,"Port number changed, wanted %d got %d from %s\n" , want, got, str);exit (1 ); }
@@ -100,7 +105,7 @@ int main(int argc, char *argv[])die ("child recvfrom" );if (peer.sin_port !=htons (PORT )) -die_port (peer.sin_port,PORT ); +die_port (&peer,PORT ); }else {if (sendto (s2, buf,LEN ,0 , (struct sockaddr *)&sa1,sizeof (sa1)) !=LEN )continue ;
@@ -109,7 +114,7 @@ int main(int argc, char *argv[])die ("parent recvfrom" );if (peer.sin_port !=htons ((PORT +1 ))) -die_port (peer.sin_port,PORT +1 ); +die_port (&peer,PORT +1 ); } }
tools/testing/selftests/net/netfilter/conntrack_reverse_clash.sh +2 -0
@@ -45,6 +45,8 @@ if ip netns exec "$ns0" ./conntrack_reverse_clash; then echo "PASS: No SNAT performed for null bindings" else echo "ERROR: SNAT performed without any matching snat rule" + ip netns exec "$ns0" conntrack -L + ip netns exec "$ns0" conntrack -S exit 1 fi
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 61/567 netfilter: nf_tables: remove redundant chain validation on register store
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit a67fd55f6a09f4119b7232c19e0f348fe31ab0db ]
This validation predates the introduction of the state machine that determines when to enter slow path validation for error reporting.
Currently, table validation is perform when:
- new rule contains expressions that need validation.
- new set element with jump/goto verdict.
Validation on register store skips most checks with no basechains, still this walks the graph searching for loops and ensuring expressions are called from the right hook. Remove this.
--- net/netfilter/nf_tables_api.c | 11 ----------- 1 file changed, 11 deletions(-)
net/netfilter/nf_tables_api.c +0 -11
@@ -11211,21 +11211,10 @@ static int nft_validate_register_store(const struct nft_ctx *ctx, enum nft_data_types type, unsigned int len) { - int err; - switch (reg) {case NFT_REG_VERDICT :if (type !=NFT_DATA_VERDICT )return -EINVAL ; - -if (data !=NULL && - (data->verdict.code ==NFT_GOTO || - data->verdict.code ==NFT_JUMP )) { - err =nft_chain_validate (ctx, data->verdict.chain); -if (err <0 ) -return err; - } -break ;default :if (type !=NFT_DATA_VALUE )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 62/567 selftests: netfilter: packetdrill: avoid failure on HZ=100 kernel
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit fec7b0795548b43e2c3c46e3143c34ef6070341c ]
packetdrill --ip_version=ipv4 --mtu=1500 --tolerance_usecs=1000000 --non_fatal packet conntrack_syn_challenge_ack.pkt conntrack v1.4.8 (conntrack-tools): 1 flow entries have been shown. conntrack_syn_challenge_ack.pkt:32: error executing `conntrack -f $NFCT_IP_VERSION \
-L -p tcp --dport 8080 | grep UNREPLIED | grep -q SYN_SENT` command: non-zero status 1
Affected kernel had CONFIG_HZ=100; reset packet was still sitting in backlog.
--- .../net/netfilter/packetdrill/conntrack_syn_challenge_ack.pkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/netfilter/packetdrill/conntrack_syn_challenge_ack.pkt +1 -1
@@ -26,7 +26,7 @@ +0.01 > R 643160523:643160523(0) win 0 -+0.01 `conntrack -f $NFCT_IP_VERSION -L -p tcp --dport 8080 2>/dev/null | grep UNREPLIED | grep -q SYN_SENT` ++0.1 `conntrack -f $NFCT_IP_VERSION -L -p tcp --dport 8080 2>/dev/null | grep UNREPLIED | grep -q SYN_SENT` // Must go through. +0.01 > S 0:0(0) win 65535 <mss 1460,sackOK,TS val 1 ecr 0,nop,wscale 8>
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 63/567 iommufd/selftest: Add coverage for reporting max_pasid_log2 via IOMMU_HW_INFO
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yi Liu <[email protected]>
[ Upstream commit 6d9500bb1ff8c7f9c3ce199521c41aa41e8fd994 ]
IOMMU_HW_INFO is extended to report max_pasid_log2, hence add coverage for it.
Stable-dep-of: 5b244b077c0b ("iommufd/selftest: Make it clearer to gcc that the access is not out of bounds")
--- tools/testing/selftests/iommu/iommufd.c | 18 ++++++++++++++++++ .../testing/selftests/iommu/iommufd_fail_nth.c | 3 ++- tools/testing/selftests/iommu/iommufd_utils.h | 17 +++++++++++++---- 3 files changed, 33 insertions(+), 5 deletions(-)
tools/testing/selftests/iommu/iommufd.c +18 -0
@@ -194,12 +194,14 @@ FIXTURE(iommufd_ioas)uint32_t hwpt_id;uint32_t device_id;uint64_t base_iova; +uint32_t device_pasid_id; };FIXTURE_VARIANT (iommufd_ioas) {unsigned int mock_domains;unsigned int memory_limit; +bool pasid_capable; };FIXTURE_SETUP (iommufd_ioas)
@@ -222,6 +224,12 @@ FIXTURE_SETUP(iommufd_ioas) &self->hwpt_id, &self->device_id); self->base_iova =MOCK_APERTURE_START ; } + +if (variant->pasid_capable) +test_cmd_mock_domain_flags (self->ioas_id, +MOCK_FLAGS_DEVICE_PASID , +NULL ,NULL , + &self->device_pasid_id); }FIXTURE_TEARDOWN (iommufd_ioas)
@@ -237,6 +245,7 @@ FIXTURE_VARIANT_ADD(iommufd_ioas, no_domain)FIXTURE_VARIANT_ADD (iommufd_ioas, mock_domain) { .mock_domains = 1, + .pasid_capable = true, };FIXTURE_VARIANT_ADD (iommufd_ioas, two_mock_domain)
@@ -602,6 +611,8 @@ TEST_F(iommufd_ioas, get_hw_info) } buffer_smaller;if (self->device_id) { +uint8_t max_pasid =0 ; +/* Provide a zero-size user_buffer */ test_cmd_get_hw_info (self->device_id,NULL ,0 );/* Provide a user_buffer with exact size */
@@ -616,6 +627,13 @@ TEST_F(iommufd_ioas, get_hw_info)* the fields within the size range still gets updated. */ test_cmd_get_hw_info (self->device_id, &buffer_smaller,sizeof (buffer_smaller)); +test_cmd_get_hw_info_pasid (self->device_id, &max_pasid); +ASSERT_EQ (0 , max_pasid); +if (variant->pasid_capable) { +test_cmd_get_hw_info_pasid (self->device_pasid_id, + &max_pasid); +ASSERT_EQ (MOCK_PASID_WIDTH , max_pasid); + } }else {test_err_get_hw_info (ENOENT , self->device_id, &buffer_exact,sizeof (buffer_exact));
tools/testing/selftests/iommu/iommufd_fail_nth.c +2 -1
@@ -612,7 +612,8 @@ TEST_FAIL_NTH(basic_fail_nth, device) &idev_id))return -1 ; -if (_test_cmd_get_hw_info (self->fd, idev_id, &info,sizeof (info),NULL )) +if (_test_cmd_get_hw_info (self->fd, idev_id, &info, +sizeof (info),NULL ,NULL ))return -1 ; if (_test_cmd_hwpt_alloc(self->fd, idev_id, ioas_id, 0, 0, &hwpt_id,
tools/testing/selftests/iommu/iommufd_utils.h +13 -4
@@ -638,7 +638,8 @@ static void teardown_iommufd(int fd, struct __test_metadata *_metadata)/* @data can be NULL */ static int _test_cmd_get_hw_info (int fd,__u32 device_id,void *data, -size_t data_len,uint32_t *capabilities) +size_t data_len,uint32_t *capabilities, +uint8_t *max_pasid) {struct iommu_test_hw_info *info = (struct iommu_test_hw_info *)data;struct iommu_hw_info cmd = {
@@ -683,6 +684,9 @@ static int _test_cmd_get_hw_info(int fd, __u32 device_id, void *data,assert (!info->flags); } +if (max_pasid) + *max_pasid = cmd.out_max_pasid_log2; +if (capabilities) *capabilities = cmd.out_capabilities;
@@ -691,14 +695,19 @@ static int _test_cmd_get_hw_info(int fd, __u32 device_id, void *data,#define test_cmd_get_hw_info (device_id, data, data_len) \ ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, data, \ - data_len, NULL)) + data_len, NULL, NULL))#define test_err_get_hw_info (_errno, device_id, data, data_len) \ EXPECT_ERRNO(_errno, _test_cmd_get_hw_info(self->fd, device_id, data, \ - data_len, NULL)) + data_len, NULL, NULL))#define test_cmd_get_hw_capabilities (device_id, caps, mask) \ - ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, NULL, 0, &caps)) + ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, NULL, \ + 0, &caps, NULL)) + +#define test_cmd_get_hw_info_pasid (device_id, max_pasid) \ + ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, NULL, \ + 0, NULL, max_pasid))static int _test_ioctl_fault_alloc (int fd,__u32 *fault_id,__u32 *fault_fd) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 64/567 iommufd/selftest: Update hw_info coverage for an input data_type
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolin Chen <[email protected]>
[ Upstream commit 3a35f7d4a4673edf6f02422bb2d78b17c667e167 ]
Test both IOMMU_HW_INFO_TYPE_DEFAULT and IOMMU_HW_INFO_TYPE_SELFTEST, and add a negative test for an unsupported type.
Also drop the unused mask in test_cmd_get_hw_capabilities() as checkpatch is complaining.
Stable-dep-of: 5b244b077c0b ("iommufd/selftest: Make it clearer to gcc that the access is not out of bounds")
--- tools/testing/selftests/iommu/iommufd.c | 32 +++++++++++++----- .../selftests/iommu/iommufd_fail_nth.c | 4 +-- tools/testing/selftests/iommu/iommufd_utils.h | 33 +++++++++++-------- 3 files changed, 46 insertions(+), 23 deletions(-)
tools/testing/selftests/iommu/iommufd.c +24 -8
@@ -614,19 +614,34 @@ TEST_F(iommufd_ioas, get_hw_info)uint8_t max_pasid =0 ;/* Provide a zero-size user_buffer */ -test_cmd_get_hw_info (self->device_id,NULL ,0 ); +test_cmd_get_hw_info (self->device_id, +IOMMU_HW_INFO_TYPE_DEFAULT ,NULL ,0 );/* Provide a user_buffer with exact size */ -test_cmd_get_hw_info (self->device_id, &buffer_exact,sizeof (buffer_exact)); +test_cmd_get_hw_info (self->device_id, +IOMMU_HW_INFO_TYPE_DEFAULT , &buffer_exact, +sizeof (buffer_exact)); + +/* Request for a wrong data_type, and a correct one */ +test_err_get_hw_info (EOPNOTSUPP , self->device_id, +IOMMU_HW_INFO_TYPE_SELFTEST +1 , + &buffer_exact,sizeof (buffer_exact)); +test_cmd_get_hw_info (self->device_id, +IOMMU_HW_INFO_TYPE_SELFTEST , &buffer_exact, +sizeof (buffer_exact));/* * Provide a user_buffer with size larger than the exact size to check if * kernel zero the trailing bytes. */ -test_cmd_get_hw_info (self->device_id, &buffer_larger,sizeof (buffer_larger)); +test_cmd_get_hw_info (self->device_id, +IOMMU_HW_INFO_TYPE_DEFAULT , &buffer_larger, +sizeof (buffer_larger));/* * Provide a user_buffer with size smaller than the exact size to check if * the fields within the size range still gets updated. */ -test_cmd_get_hw_info (self->device_id, &buffer_smaller,sizeof (buffer_smaller)); +test_cmd_get_hw_info (self->device_id, +IOMMU_HW_INFO_TYPE_DEFAULT , + &buffer_smaller,sizeof (buffer_smaller));test_cmd_get_hw_info_pasid (self->device_id, &max_pasid);ASSERT_EQ (0 , max_pasid);if (variant->pasid_capable) {
@@ -636,9 +651,11 @@ TEST_F(iommufd_ioas, get_hw_info) } }else {test_err_get_hw_info (ENOENT , self->device_id, - &buffer_exact,sizeof (buffer_exact)); +IOMMU_HW_INFO_TYPE_DEFAULT , &buffer_exact, +sizeof (buffer_exact));test_err_get_hw_info (ENOENT , self->device_id, - &buffer_larger,sizeof (buffer_larger)); +IOMMU_HW_INFO_TYPE_DEFAULT , &buffer_larger, +sizeof (buffer_larger)); } }
@@ -1945,8 +1962,7 @@ TEST_F(iommufd_dirty_tracking, device_dirty_capability)test_cmd_hwpt_alloc (self->idev_id, self->ioas_id,0 , &hwpt_id);test_cmd_mock_domain (hwpt_id, &stddev_id,NULL ,NULL ); -test_cmd_get_hw_capabilities (self->idev_id, caps, -IOMMU_HW_CAP_DIRTY_TRACKING ); +test_cmd_get_hw_capabilities (self->idev_id, caps);ASSERT_EQ (IOMMU_HW_CAP_DIRTY_TRACKING , caps &IOMMU_HW_CAP_DIRTY_TRACKING );
tools/testing/selftests/iommu/iommufd_fail_nth.c +2 -2
@@ -612,8 +612,8 @@ TEST_FAIL_NTH(basic_fail_nth, device) &idev_id))return -1 ; -if (_test_cmd_get_hw_info (self->fd, idev_id, &info, -sizeof (info),NULL ,NULL )) +if (_test_cmd_get_hw_info (self->fd, idev_id,IOMMU_HW_INFO_TYPE_DEFAULT , + &info,sizeof (info),NULL ,NULL ))return -1 ; if (_test_cmd_hwpt_alloc(self->fd, idev_id, ioas_id, 0, 0, &hwpt_id,
tools/testing/selftests/iommu/iommufd_utils.h +20 -13
@@ -637,20 +637,24 @@ static void teardown_iommufd(int fd, struct __test_metadata *_metadata)#endif /* @data can be NULL */ -static int _test_cmd_get_hw_info (int fd,__u32 device_id,void *data, -size_t data_len,uint32_t *capabilities, -uint8_t *max_pasid) +static int _test_cmd_get_hw_info (int fd,__u32 device_id,__u32 data_type, +void *data,size_t data_len, +uint32_t *capabilities,uint8_t *max_pasid) {struct iommu_test_hw_info *info = (struct iommu_test_hw_info *)data;struct iommu_hw_info cmd = { .size =sizeof (cmd), .dev_id = device_id, .data_len = data_len, + .in_data_type = data_type, .data_uptr = (uint64_t )data, .out_capabilities =0 , };int ret; +if (data_type !=IOMMU_HW_INFO_TYPE_DEFAULT ) + cmd.flags |=IOMMU_HW_INFO_FLAG_INPUT_TYPE ; + ret =ioctl (fd,IOMMU_GET_HW_INFO , &cmd);if (ret)return ret;
@@ -693,20 +697,23 @@ static int _test_cmd_get_hw_info(int fd, __u32 device_id, void *data,return 0 ; } -#define test_cmd_get_hw_info (device_id, data, data_len) \ - ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, data, \ - data_len, NULL, NULL)) +#define test_cmd_get_hw_info (device_id, data_type, data, data_len) \ + ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, data_type, \ + data, data_len, NULL, NULL)) -#define test_err_get_hw_info (_errno, device_id, data, data_len) \ - EXPECT_ERRNO(_errno, _test_cmd_get_hw_info(self->fd, device_id, data, \ - data_len, NULL, NULL)) +#define test_err_get_hw_info (_errno, device_id, data_type, data, data_len) \ + EXPECT_ERRNO(_errno, \ + _test_cmd_get_hw_info(self->fd, device_id, data_type, \ + data, data_len, NULL, NULL)) -#define test_cmd_get_hw_capabilities (device_id, caps, mask) \ - ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, NULL, \ +#define test_cmd_get_hw_capabilities (device_id, caps) \ + ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, \ + IOMMU_HW_INFO_TYPE_DEFAULT, NULL, \ 0, &caps, NULL)) -#define test_cmd_get_hw_info_pasid (device_id, max_pasid) \ - ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, NULL, \ +#define test_cmd_get_hw_info_pasid (device_id, max_pasid) \ + ASSERT_EQ(0, _test_cmd_get_hw_info(self->fd, device_id, \ + IOMMU_HW_INFO_TYPE_DEFAULT, NULL, \ 0, NULL, max_pasid))static int _test_ioctl_fault_alloc (int fd,__u32 *fault_id,__u32 *fault_fd)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 65/567 iommufd/selftest: Make it clearer to gcc that the access is not out of bounds
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <[email protected]>
[ Upstream commit 5b244b077c0b0e76573fbb9542cf038e42368901 ]
GCC gets a bit confused and reports:
In function '_test_cmd_get_hw_info',
inlined from 'iommufd_ioas_get_hw_info' at iommufd.c:779:3, inlined from 'wrapper_iommufd_ioas_get_hw_info' at iommufd.c:752:1:
Quoted 1 line
Quoted 1 line
iommufd_utils.h:804:37: warning: array subscript 'struct iommu_test_hw_info[0]' is partly outside array bounds of 'struct iommu_test_hw_info_buffer_smaller[1]' [-Warray-bounds=]
804 | assert(!info->flags);
| ~~~~^~~~~~~
iommufd.c: In function 'wrapper_iommufd_ioas_get_hw_info':
iommufd.c:761:11: note: object 'buffer_smaller' of size 4
761 | } buffer_smaller;
| ^~~~~~~~~~~~~~While it is true that "struct iommu_test_hw_info[0]" is partly out of bounds of the input pointer, it is not true that info->flags is out of bounds. Unclear why it warns on this.
Reuse an existing properly sized stack buffer and pass a truncated length instead to test the same thing.
--- tools/testing/selftests/iommu/iommufd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
tools/testing/selftests/iommu/iommufd.c +3 -5
@@ -606,9 +606,6 @@ TEST_F(iommufd_ioas, get_hw_info)struct iommu_test_hw_info info;uint64_t trailing_bytes; } buffer_larger; -struct iommu_test_hw_info_buffer_smaller { -__u32 flags; - } buffer_smaller;if (self->device_id) {uint8_t max_pasid =0 ;
@@ -640,8 +637,9 @@ TEST_F(iommufd_ioas, get_hw_info)* the fields within the size range still gets updated. */ test_cmd_get_hw_info (self->device_id, -IOMMU_HW_INFO_TYPE_DEFAULT , - &buffer_smaller,sizeof (buffer_smaller)); +IOMMU_HW_INFO_TYPE_DEFAULT , &buffer_exact, + offsetofend(struct iommu_test_hw_info, + flags));test_cmd_get_hw_info_pasid (self->device_id, &max_pasid);ASSERT_EQ (0 , max_pasid);if (variant->pasid_capable) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 66/567 iommufd/selftest: Check for overflow in IOMMU_TEST_OP_ADD_RESERVED
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <[email protected]>
[ Upstream commit e6a973af11135439de32ece3b9cbe3bfc043bea8 ]
syzkaller found it could overflow math in the test infrastructure and cause a WARN_ON by corrupting the reserved interval tree. This only effects test kernels with CONFIG_IOMMUFD_TEST.
Validate the user input length in the test ioctl.
--- drivers/iommu/iommufd/selftest.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/iommu/iommufd/selftest.c +7 -1
@@ -836,14 +836,20 @@ static int iommufd_test_add_reserved(struct iommufd_ucmd *ucmd,unsigned int mockpt_id, unsigned long start, size_t length) { + unsigned long last;struct iommufd_ioas *ioas;int rc; +if (!length) +return -EINVAL ; +if (check_add_overflow (start, length -1 , &last)) +return -EOVERFLOW ; + ioas =iommufd_get_ioas (ucmd->ictx, mockpt_id);if (IS_ERR (ioas))return PTR_ERR (ioas);down_write (&ioas->iopt.iova_rwsem); - rc =iopt_reserve_iova (&ioas->iopt, start, start + length -1 ,NULL ); + rc =iopt_reserve_iova (&ioas->iopt, start, last,NULL );up_write (&ioas->iopt.iova_rwsem);iommufd_put_object (ucmd->ictx, &ioas->obj);return rc;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 67/567 ethtool: Avoid overflowing userspace buffer on stats query
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gal Pressman <[email protected]>
[ Upstream commit 7b07be1ff1cb6c49869910518650e8d0abc7d25f ]
The ethtool -S command operates across three ioctl calls:ETHTOOL_GSSET_INFO for the size, ETHTOOL_GSTRINGS for the names, and ETHTOOL_GSTATS for the values.
If the number of stats changes between these calls (e.g., due to device reconfiguration), userspace's buffer allocation will be incorrect, potentially leading to buffer overflow.
Drivers are generally expected to maintain stable stat counts, but some drivers (e.g., mlx5, bnx2x, bna, ksz884x) use dynamic counters, making this scenario possible.
Some drivers try to handle this internally:
- bnad_get_ethtool_stats() returns early in case stats.n_stats is not equal to the driver's stats count.
- micrel/ksz884x also makes sure not to write anything beyond stats.n_stats and overflow the buffer.
However, both use stats.n_stats which is already assigned with the value returned from get_sset_count(), hence won't solve the issue described here.
Change ethtool_get_strings(), ethtool_get_stats(), ethtool_get_phy_stats() to not return anything in case of a mismatch between userspace's size and get_sset_size(), to prevent buffer overflow.
The returned n_stats value will be equal to zero, to reflect that nothing has been returned.
This could result in one of two cases when using upstream ethtool, depending on when the size change is detected:
1. When detected in ethtool_get_strings():
# ethtool -S eth2
no stats available2. When detected in get stats, all stats will be reported as zero.
Both cases are presumably transient, and a subsequent ethtool call should succeed.
Other than the overflow avoidance, these two cases are very evident (no output/cleared stats), which is arguably better than presenting incorrect/shifted stats.
I also considered returning an error instead of a "silent" response, but that seems more destructive towards userspace apps.
Notes:
- This patch does not claim to fix the inherent race, it only makes sure that we do not overflow the userspace buffer, and makes for a more predictable behavior.
- RTNL lock is held during each ioctl, the race window exists between the separate ioctl calls when the lock is released.
- Userspace ethtool always fills stats.n_stats, but it is likely that these stats ioctls are implemented in other userspace applications which might not fill it. The added code checks that it's not zero, to prevent any regressions.
--- net/ethtool/ioctl.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-)
net/ethtool/ioctl.c +24 -6
@@ -2231,7 +2231,10 @@ static int ethtool_get_strings(struct net_device *dev, void __user *useraddr)return -ENOMEM ;WARN_ON_ONCE (!ret); - gstrings.len = ret; +if (gstrings.len && gstrings.len != ret) + gstrings.len =0 ; +else + gstrings.len = ret;if (gstrings.len) { data =vzalloc (array_size (gstrings.len,ETH_GSTRING_LEN ));
@@ -2353,10 +2356,13 @@ static int ethtool_get_stats(struct net_device *dev, void __user *useraddr)if (copy_from_user (&stats, useraddr,sizeof (stats)))return -EFAULT ; - stats.n_stats = n_stats; +if (stats.n_stats && stats.n_stats != n_stats) + stats.n_stats =0 ; +else + stats.n_stats = n_stats; -if (n_stats) { - data =vzalloc (array_size (n_stats,sizeof (u64))); +if (stats.n_stats) { + data =vzalloc (array_size (stats.n_stats,sizeof (u64)));if (!data)return -ENOMEM ; ops->get_ethtool_stats (dev, &stats, data);
@@ -2368,7 +2374,9 @@ static int ethtool_get_stats(struct net_device *dev, void __user *useraddr)if (copy_to_user (useraddr, &stats,sizeof (stats))) goto out; useraddr +=sizeof (stats); -if (n_stats &©_to_user (useraddr, data,array_size (n_stats,sizeof (u64)))) +if (stats.n_stats && +copy_to_user (useraddr, data, +array_size (stats.n_stats,sizeof (u64)))) goto out; ret =0 ;
@@ -2404,6 +2412,10 @@ static int ethtool_get_phy_stats_phydev(struct phy_device *phydev,return -EOPNOTSUPP ; n_stats = phy_ops->get_sset_count (phydev); +if (stats->n_stats && stats->n_stats != n_stats) { + stats->n_stats =0 ; +return 0 ; + } ret =ethtool_vzalloc_stats_array (n_stats, data);if (ret)
@@ -2424,6 +2436,10 @@ static int ethtool_get_phy_stats_ethtool(struct net_device *dev,return -EOPNOTSUPP ; n_stats = ops->get_sset_count (dev,ETH_SS_PHY_STATS ); +if (stats->n_stats && stats->n_stats != n_stats) { + stats->n_stats =0 ; +return 0 ; + } ret =ethtool_vzalloc_stats_array (n_stats, data);if (ret)
@@ -2460,7 +2476,9 @@ static int ethtool_get_phy_stats(struct net_device *dev, void __user *useraddr) } useraddr +=sizeof (stats); -if (copy_to_user (useraddr, data,array_size (stats.n_stats,sizeof (u64)))) +if (stats.n_stats && +copy_to_user (useraddr, data, +array_size (stats.n_stats,sizeof (u64)))) ret = -EFAULT ; out:
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 68/567 net/mlx5: fw reset, clear reset requested on drain_fw_reset
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Moshe Shemesh <[email protected]>
[ Upstream commit 89a898d63f6f588acf5c104c65c94a38b68c69a6 ]
drain_fw_reset() waits for ongoing firmware reset events and blocks new event handling, but does not clear the reset requested flag, and may keep sync reset polling.
To fix it, call mlx5_sync_reset_clear_reset_requested() to clear the flag, stop sync reset polling, and resume health polling, ensuring health issues are still detected after the firmware reset drain.
--- drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +2 -1
@@ -832,7 +832,8 @@ void mlx5_drain_fw_reset(struct mlx5_core_dev *dev)cancel_work_sync (&fw_reset->reset_reload_work);cancel_work_sync (&fw_reset->reset_now_work);cancel_work_sync (&fw_reset->reset_abort_work); -cancel_delayed_work (&fw_reset->reset_timeout_work); +if (test_bit (MLX5_FW_RESET_FLAGS_RESET_REQUESTED , &fw_reset->reset_flags)) +mlx5_sync_reset_clear_reset_requested (dev, true); }static const struct devlink_param mlx5_fw_reset_devlink_params[] = {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 69/567 net/mlx5: Drain firmware reset in shutdown callback
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Moshe Shemesh <[email protected]>
[ Upstream commit 5846a365fc6476b02d6766963cf0985520f0385f ]
Invoke drain_fw_reset() in the shutdown callback to ensure all firmware reset handling is completed before shutdown proceeds.
--- drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx5/core/main.c +1 -0
@@ -2196,6 +2196,7 @@ static void shutdown(struct pci_dev *pdev)mlx5_core_info (dev,"Shutdown was called\n" );set_bit (MLX5_BREAK_FW_WAIT , &dev->intf_state); +mlx5_drain_fw_reset (dev);mlx5_drain_health_wq (dev); err =mlx5_try_fast_unload (dev);if (err)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 70/567 net/mlx5: fw_tracer, Validate format string parameters
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shay Drory <[email protected]>
[ Upstream commit b35966042d20b14e2d83330049f77deec5229749 ]
Add validation for format string parameters in the firmware tracer to prevent potential security vulnerabilities and crashes from malformed format strings received from firmware.
The firmware tracer receives format strings from the device firmware and uses them to format trace messages. Without proper validation, bad firmware could provide format strings with invalid format specifiers (e.g., %s, %p, %n) that could lead to crashes, or other undefined behavior.
Add mlx5_tracer_validate_params() to validate that all format specifiers in trace strings are limited to safe integer/hex formats (%x, %d, %i, %u, %llx, %lx, etc.). Reject strings containing other format types that could be used to access arbitrary memory or cause crashes. Invalid format strings are added to the trace output for visibility with "BAD_FORMAT: " prefix.
--- .../mellanox/mlx5/core/diag/fw_tracer.c | 83 ++++++++++++++++--- .../mellanox/mlx5/core/diag/fw_tracer.h | 1 + 2 files changed, 74 insertions(+), 10 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +73 -10
@@ -33,6 +33,7 @@#include "lib/eq.h" #include "fw_tracer.h" #include "fw_tracer_tracepoint.h" +#include <linux/ctype.h> static int mlx5_query_mtrc_caps (struct mlx5_fw_tracer *tracer) {
@@ -358,6 +359,43 @@ static const char *VAL_PARM = "%llx";static const char *REPLACE_64_VAL_PARM ="%x%x" ;static const char *PARAM_CHAR ="%" ; +static bool mlx5_is_valid_spec (const char *str) +{ +/* Parse format specifiers to find the actual type. +* Structure: %[flags][width][.precision][length]type +* Skip flags, width, precision & length. +*/ +while (isdigit (*str) || *str =='#' || *str =='.' || *str =='l' ) + str++; + +/* Check if it's a valid integer/hex specifier: +* Valid formats: %x, %d, %i, %u, etc. +*/ +if (*str !='x' && *str !='X' && *str !='d' && *str !='i' && + *str !='u' && *str !='c' ) +return false; + +return true; +} + +static bool mlx5_tracer_validate_params (const char *str) +{ +const char *substr = str; + +if (!str) +return false; + + substr =strstr (substr,PARAM_CHAR ); +while (substr) { +if (!mlx5_is_valid_spec (substr +1 )) +return false; + + substr =strstr (substr +1 ,PARAM_CHAR ); + } + +return true; +} +static int mlx5_tracer_message_hash (u32 message_id) {return jhash_1word (message_id,0 ) & (MESSAGE_HASH_SIZE -1 );
@@ -419,6 +457,10 @@ static int mlx5_tracer_get_num_of_params(char *str)char *substr, *pstr = str;int num_of_params =0 ; +/* Validate that all parameters are valid before processing */ +if (!mlx5_tracer_validate_params (str)) +return -EINVAL ; +/* replace %llx with %x%x */ substr =strstr (pstr,VAL_PARM );while (substr) {
@@ -570,14 +612,17 @@ void mlx5_tracer_print_trace(struct tracer_string_format *str_frmt, {char tmp[512 ]; -snprintf (tmp,sizeof (tmp), str_frmt->string, - str_frmt->params[0 ], - str_frmt->params[1 ], - str_frmt->params[2 ], - str_frmt->params[3 ], - str_frmt->params[4 ], - str_frmt->params[5 ], - str_frmt->params[6 ]); +if (str_frmt->invalid_string) +snprintf (tmp,sizeof (tmp),"BAD_FORMAT: %s" , str_frmt->string); +else +snprintf (tmp,sizeof (tmp), str_frmt->string, + str_frmt->params[0 ], + str_frmt->params[1 ], + str_frmt->params[2 ], + str_frmt->params[3 ], + str_frmt->params[4 ], + str_frmt->params[5 ], + str_frmt->params[6 ]);trace_mlx5_fw (dev->tracer, trace_timestamp, str_frmt->lost, str_frmt->event_id, tmp);
@@ -609,6 +654,13 @@ static int mlx5_tracer_handle_raw_string(struct mlx5_fw_tracer *tracer,return 0 ; } +static void mlx5_tracer_handle_bad_format_string (struct mlx5_fw_tracer *tracer, +struct tracer_string_format *cur_string) +{ + cur_string->invalid_string = true; +list_add_tail (&cur_string->list, &tracer->ready_strings_list); +} +static int mlx5_tracer_handle_string_trace (struct mlx5_fw_tracer *tracer,struct tracer_event *tracer_event) {
@@ -619,12 +671,18 @@ static int mlx5_tracer_handle_string_trace(struct mlx5_fw_tracer *tracer,if (!cur_string)return mlx5_tracer_handle_raw_string (tracer, tracer_event); - cur_string->num_of_params =mlx5_tracer_get_num_of_params (cur_string->string); - cur_string->last_param_num =0 ; cur_string->event_id = tracer_event->event_id; cur_string->tmsn = tracer_event->string_event.tmsn; cur_string->timestamp = tracer_event->string_event.timestamp; cur_string->lost = tracer_event->lost_event; + cur_string->last_param_num =0 ; + cur_string->num_of_params =mlx5_tracer_get_num_of_params (cur_string->string); +if (cur_string->num_of_params <0 ) { +pr_debug ("%s Invalid format string parameters\n" , + __func__); +mlx5_tracer_handle_bad_format_string (tracer, cur_string); +return 0 ; + }if (cur_string->num_of_params ==0 )/* trace with no params */ list_add_tail (&cur_string->list, &tracer->ready_strings_list); }else {
@@ -634,6 +692,11 @@ static int mlx5_tracer_handle_string_trace(struct mlx5_fw_tracer *tracer, __func__, tracer_event->string_event.tmsn);return mlx5_tracer_handle_raw_string (tracer, tracer_event); } +if (cur_string->num_of_params <0 ) { +pr_debug ("%s string parameter of invalid string, dumping\n" , + __func__); +return 0 ; + } cur_string->last_param_num +=1 ;if (cur_string->last_param_num >TRACER_MAX_PARAMS ) { pr_debug("%s Number of params exceeds the max (%d)\n",
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h +1 -0
@@ -125,6 +125,7 @@ struct tracer_string_format {struct list_head list;u32 timestamp;bool lost; +bool invalid_string; };enum mlx5_fw_tracer_ownership_state {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 71/567 net/mlx5: fw_tracer, Handle escaped percent properly
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shay Drory <[email protected]>
[ Upstream commit c0289f67f7d6a0dfba0e92cfe661a5c70c8c6e92 ]
The firmware tracer's format string validation and parameter counting did not properly handle escaped percent signs (%%). This caused fw_tracer to count more parameters when trace format strings contained literal percent characters.
To fix it, allow %% to pass string validation and skip %% sequences when counting parameters since they represent literal percent signs rather than format specifiers.
--- .../mellanox/mlx5/core/diag/fw_tracer.c | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +14 -6
@@ -368,11 +368,11 @@ static bool mlx5_is_valid_spec(const char *str)while (isdigit (*str) || *str =='#' || *str =='.' || *str =='l' ) str++; -/* Check if it's a valid integer/hex specifier: +/* Check if it's a valid integer/hex specifier or %%: * Valid formats: %x, %d, %i, %u, etc. */ if (*str !='x' && *str !='X' && *str !='d' && *str !='i' && - *str !='u' && *str !='c' ) + *str !='u' && *str !='c' && *str !='%' )return false;return true;
@@ -390,7 +390,11 @@ static bool mlx5_tracer_validate_params(const char *str)if (!mlx5_is_valid_spec (substr +1 ))return false; - substr =strstr (substr +1 ,PARAM_CHAR ); +if (*(substr +1 ) =='%' ) + substr =strstr (substr +2 ,PARAM_CHAR ); +else + substr =strstr (substr +1 ,PARAM_CHAR ); + }return true;
@@ -469,11 +473,15 @@ static int mlx5_tracer_get_num_of_params(char *str) substr =strstr (pstr,VAL_PARM ); } -/* count all the % characters */ +/* count all the % characters, but skip %% (escaped percent) */ substr =strstr (str,PARAM_CHAR );while (substr) { - num_of_params +=1 ; - str = substr +1 ; +if (*(substr +1 ) !='%' ) { + num_of_params +=1 ; + str = substr +1 ; + }else { + str = substr +2 ; + } substr =strstr (str,PARAM_CHAR ); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 72/567 net/mlx5: Serialize firmware reset with devlink
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shay Drory <[email protected]>
[ Upstream commit 367e501f8b095eca08d2eb0ba4ccea5b5e82c169 ]
The firmware reset mechanism can be triggered by asynchronous events, which may race with other devlink operations like devlink reload or devlink dev eswitch set, potentially leading to inconsistent states.
This patch addresses the race by using the devl_lock to serialize the firmware reset against other devlink operations. When a reset is requested, the driver attempts to acquire the lock. If successful, it sets a flag to block devlink reload or eswitch changes, ACKs the reset to firmware and then releases the lock. If the lock is already held by another operation, the driver NACKs the firmware reset request, indicating that the reset cannot proceed.
Firmware reset does not keep the devl_lock and instead uses an internal firmware reset bit. This is because firmware resets can be triggered by asynchronous events, and processed in different threads. It is illegal and unsafe to acquire a lock in one thread and attempt to release it in another, as lock ownership is intrinsically thread-specific.
This change ensures that firmware resets and other devlink operations are mutually exclusive during the critical reset request phase, preventing race conditions.
--- .../net/ethernet/mellanox/mlx5/core/devlink.c | 5 +++ .../mellanox/mlx5/core/eswitch_offloads.c | 6 +++ .../ethernet/mellanox/mlx5/core/fw_reset.c | 45 +++++++++++++++++-- .../ethernet/mellanox/mlx5/core/fw_reset.h | 1 + 4 files changed, 53 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +5 -0
@@ -143,6 +143,11 @@ static int mlx5_devlink_reload_down(struct devlink *devlink, bool netns_change,struct pci_dev *pdev = dev->pdev;int ret =0 ; +if (mlx5_fw_reset_in_progress (dev)) { +NL_SET_ERR_MSG_MOD (extack,"Can't reload during firmware reset" ); +return -EBUSY ; + } +if (mlx5_dev_is_lightweight (dev)) {if (action !=DEVLINK_RELOAD_ACTION_DRIVER_REINIT )return -EOPNOTSUPP ;
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +6 -0
@@ -52,6 +52,7 @@#include "devlink.h" #include "lag/lag.h" #include "en/tc/post_meter.h" +#include "fw_reset.h" /* There are two match-all miss flows, one for unicast dst mac and * one for multicast.
@@ -3731,6 +3732,11 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,if (IS_ERR (esw))return PTR_ERR (esw); +if (mlx5_fw_reset_in_progress (esw->dev)) { +NL_SET_ERR_MSG_MOD (extack,"Can't change eswitch mode during firmware reset" ); +return -EBUSY ; + } +if (esw_mode_from_devlink (mode, &mlx5_mode))return -EINVAL ;
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +41 -4
98 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.h +1 -0
@@ -10,6 +10,7 @@ int mlx5_fw_reset_query(struct mlx5_core_dev *dev, u8 *reset_level, u8 *reset_tyint mlx5_fw_reset_set_reset_sync (struct mlx5_core_dev *dev,u8 reset_type_sel,struct netlink_ext_ack *extack);int mlx5_fw_reset_set_live_patch (struct mlx5_core_dev *dev); +bool mlx5_fw_reset_in_progress (struct mlx5_core_dev *dev);int mlx5_fw_reset_wait_reset_done (struct mlx5_core_dev *dev);void mlx5_sync_reset_unload_flow (struct mlx5_core_dev *dev,bool locked);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 73/567 net/handshake: duplicate handshake cancellations leak socket
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Scott Mayhew <[email protected]>
[ Upstream commit 15564bd67e2975002f2a8e9defee33e321d3183f ]
When a handshake request is cancelled it is removed from the handshake_net->hn_requests list, but it is still present in the handshake_rhashtbl until it is destroyed.
If a second cancellation request arrives for the same handshake request, then remove_pending() will return false... and assuming HANDSHAKE_F_REQ_COMPLETED isn't set in req->hr_flags, we'll continue processing through the out_true label, where we put another reference on the sock and a refcount underflow occurs.
This can happen for example if a handshake times out - particularly if the SUNRPC client sends the AUTH_TLS probe to the server but doesn't follow it up with the ClientHello due to a problem with tlshd. When the timeout is hit on the server, the server will send a FIN, which triggers a cancellation request via xs_reset_transport(). When the timeout is hit on the client, another cancellation request happens via xs_tls_handshake_sync().
Add a test_and_set_bit(HANDSHAKE_F_REQ_COMPLETED) in the pending cancel path so duplicate cancels can be detected.
--- net/handshake/request.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/handshake/request.c +5 -1
@@ -325,7 +325,11 @@ bool handshake_req_cancel(struct sock *sk) hn =handshake_pernet (net);if (hn &&remove_pending (hn, req)) { -/* Request hadn't been accepted */ +/* Request hadn't been accepted - mark cancelled */ +if (test_and_set_bit (HANDSHAKE_F_REQ_COMPLETED , &req->hr_flags)) { +trace_handshake_cancel_busy (net, req, sk); +return false; + } goto out_true; }if (test_and_set_bit (HANDSHAKE_F_REQ_COMPLETED , &req->hr_flags)) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 74/567 net: enetc: do not transmit redirected XDP frames when the link is down
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
[ Upstream commit 2939203ffee818f1e5ebd60bbb85a174d63aab9c ]
In the current implementation, the enetc_xdp_xmit() always transmits redirected XDP frames even if the link is down, but the frames cannot be transmitted from TX BD rings when the link is down, so the frames are still kept in the TX BD rings. If the XDP program is uninstalled, users will see the following warning logs.
fsl_enetc 0000:00:00.0 eno0: timeout for tx ring #6 clear
More worse, the TX BD ring cannot work properly anymore, because the HW PIR and CIR are not equal after the re-initialization of the TX BD ring. At this point, the BDs between CIR and PIR are invalid, which will cause a hardware malfunction.
Another reason is that there is internal context in the ring prefetch logic that will retain the state from the first incarnation of the ring and continue prefetching from the stale location when we re-initialize the ring. The internal context is only reset by an FLR. That is to say, for LS1028A ENETC, software cannot set the HW CIR and PIR when initializing the TX BD ring.
It does not make sense to transmit redirected XDP frames when the link is down. Add a link status check to prevent transmission in this condition. This fixes part of the issue, but more complex cases remain. For example, the TX BD ring may still contain unsent frames when the link goes down. Those situations require additional patches, which will build on this one.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc.c +2 -1
@@ -1429,7 +1429,8 @@ int enetc_xdp_xmit(struct net_device *ndev, int num_frames,int xdp_tx_bd_cnt, i, k;int xdp_tx_frm_cnt =0 ; -if (unlikely (test_bit (ENETC_TX_DOWN , &priv->flags))) +if (unlikely (test_bit (ENETC_TX_DOWN , &priv->flags) || + !netif_carrier_ok (ndev)))return -ENETDOWN ;enetc_lock_mdio ();
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 75/567 net: hns3: using the num_tqps in the vf driver to apply for resources
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jian Shen <[email protected]>
[ Upstream commit c2a16269742e176fccdd0ef9c016a233491a49ad ]
Currently, hdev->htqp is allocated using hdev->num_tqps, and kinfo->tqp is allocated using kinfo->num_tqps. However, kinfo->num_tqps is set to min(new_tqps, hdev->num_tqps); Therefore, kinfo->num_tqps may be smaller than hdev->num_tqps, which causes some hdev->htqp[i] to remain uninitialized in hclgevf_knic_setup().
Thus, this patch allocates hdev->htqp and kinfo->tqp using hdev->num_tqps, ensuring that the lengths of hdev->htqp and kinfo->tqp are consistent and that all elements are properly initialized.
--- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +2 -2
@@ -370,12 +370,12 @@ static int hclgevf_knic_setup(struct hclgevf_dev *hdev) new_tqps = kinfo->rss_size * num_tc; kinfo->num_tqps =min (new_tqps, hdev->num_tqps); - kinfo->tqp =devm_kcalloc (&hdev->pdev->dev, kinfo->num_tqps, + kinfo->tqp =devm_kcalloc (&hdev->pdev->dev, hdev->num_tqps,sizeof (struct hnae3_queue *),GFP_KERNEL );if (!kinfo->tqp)return -ENOMEM ; -for (i =0 ; i < kinfo->num_tqps; i++) { +for (i =0 ; i < hdev->num_tqps; i++) { hdev->htqp[i].q.handle = &hdev->nic; hdev->htqp[i].q.tqp_index = i; kinfo->tqp[i] = &hdev->htqp[i].q;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 76/567 net: hns3: using the num_tqps to check whether tqp_index is out of range when vf get ring info from mbx
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jian Shen <[email protected]>
[ Upstream commit d180c11aa8a6fa735f9ac2c72c61364a9afc2ba7 ]
Currently, rss_size = num_tqps / tc_num. If tc_num is 1, then num_tqps equals rss_size. However, if the tc_num is greater than 1, then rss_size will be less than num_tqps, causing the tqp_index check for subsequent TCs using rss_size to always fail.
This patch uses the num_tqps to check whether tqp_index is out of range, instead of rss_size.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +2 -2
@@ -193,10 +193,10 @@ static int hclge_get_ring_chain_from_mbx(return -EINVAL ;for (i =0 ; i < ring_num; i++) { -if (req->msg.param[i].tqp_index >= vport->nic.kinfo.rss_size) { +if (req->msg.param[i].tqp_index >= vport->nic.kinfo.num_tqps) {dev_err (&hdev->pdev->dev,"tqp index(%u) is out of range(0-%u)\n" , req->msg.param[i].tqp_index, - vport->nic.kinfo.rss_size -1U ); + vport->nic.kinfo.num_tqps -1U );return -EINVAL ; } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 77/567 net: hns3: add VLAN id validation before using
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jian Shen <[email protected]>
[ Upstream commit 6ef935e65902bfed53980ad2754b06a284ea8ac1 ]
Currently, the VLAN id may be used without validation when receive a VLAN configuration mailbox from VF. The length of vlan_del_fail_bmap is BITS_TO_LONGS(VLAN_N_VID). It may cause out-of-bounds memory access once the VLAN id is bigger than or equal to VLAN_N_VID.
Therefore, VLAN id needs to be checked to ensure it is within the range of VLAN_N_VID.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +3 -0
@@ -10572,6 +10572,9 @@ int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto,bool writen_to_tbl = false;int ret =0 ; +if (vlan_id >=VLAN_N_VID ) +return -EINVAL ; +/* When device is resetting or reset failed, firmware is unable to * handle mailbox. Just record the vlan id, and remove it after * reset finished.
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 78/567 hwmon: (dell-smm) Limit fan multiplier to avoid overflow
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis Sergeev <[email protected]>
[ Upstream commit 46c28bbbb150b80827e4bcbea231560af9d16854 ]
The fan nominal speed returned by SMM is limited to 16 bits, but the driver allows the fan multiplier to be set via a module parameter.
Clamp the computed fan multiplier so that fan_nominal_speed * i8k_fan_mult always fits into a signed 32-bit integer and refuse to initialize the driver if the value is too large.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/hwmon/dell-smm-hwmon.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/hwmon/dell-smm-hwmon.c +9 -0
@@ -75,6 +75,9 @@#define DELL_SMM_NO_TEMP 10#define DELL_SMM_NO_FANS 4 +/* limit fan multiplier to avoid overflow */ +#define DELL_SMM_MAX_FAN_MULT (INT_MAX / U16_MAX) +struct smm_regs {unsigned int eax;unsigned int ebx;
@@ -1203,6 +1206,12 @@ static int dell_smm_init_data(struct device *dev, const struct dell_smm_ops *ops data->ops = ops;/* All options must not be 0 */ data->i8k_fan_mult = fan_mult ? :I8K_FAN_MULT ; +if (data->i8k_fan_mult >DELL_SMM_MAX_FAN_MULT ) { +dev_err (dev, +"fan multiplier %u is too large (max %u)\n" , + data->i8k_fan_mult,DELL_SMM_MAX_FAN_MULT ); +return -EINVAL ; + } data->i8k_fan_max = fan_max ? :I8K_FAN_HIGH ; data->i8k_pwm_mult =DIV_ROUND_UP (255 , data->i8k_fan_max);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 79/567 hwmon: (ibmpex) fix use-after-free in high/low store
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junrui Luo <[email protected]>
[ Upstream commit 6946c726c3f4c36f0f049e6f97e88c510b15f65d ]
The ibmpex_high_low_store() function retrieves driver data using dev_get_drvdata() and uses it without validation. This creates a race condition where the sysfs callback can be invoked after the data structure is freed, leading to use-after-free.
Fix by adding a NULL check after dev_get_drvdata(), and reordering operations in the deletion path to prevent TOCTOU.
--- drivers/hwmon/ibmpex.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/hwmon/ibmpex.c +7 -2
@@ -277,6 +277,9 @@ static ssize_t ibmpex_high_low_store(struct device *dev, {struct ibmpex_bmc_data *data =dev_get_drvdata (dev); +if (!data) +return -ENODEV ; +ibmpex_reset_high_low_data (data);return count;
@@ -508,6 +511,9 @@ static void ibmpex_bmc_delete(struct ibmpex_bmc_data *data) {int i, j; +hwmon_device_unregister (data->hwmon_dev); +dev_set_drvdata (data->bmc_device,NULL ); +device_remove_file (data->bmc_device, &sensor_dev_attr_reset_high_low.dev_attr);device_remove_file (data->bmc_device, &dev_attr_name.attr);
@@ -521,8 +527,7 @@ static void ibmpex_bmc_delete(struct ibmpex_bmc_data *data) }list_del (&data->list); -dev_set_drvdata (data->bmc_device,NULL ); -hwmon_device_unregister (data->hwmon_dev); +ipmi_destroy_user (data->user);kfree (data->sensors);kfree (data);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 80/567 hwmon: (tmp401) fix overflow caused by default conversion rate value
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Simakov <[email protected]>
[ Upstream commit 82f2aab35a1ab2e1460de06ef04c726460aed51c ]
The driver computes conversion intervals using the formula:
interval = (1 << (7 - rate)) * 125ms
where 'rate' is the sensor's conversion rate register value. According to the datasheet, the power-on reset value of this register is 0x8, which could be assigned to the register, after handling i2c general call. Using this default value causes a result greater than the bit width of left operand and an undefined behaviour in the calculation above, since shifting by values larger than the bit width is undefined behaviour as per C language standard.
Limit the maximum usable 'rate' value to 7 to prevent undefined behaviour in calculations.
Found by Linux Verification Center (linuxtesting.org) with Svace.
Note (groeck):
This does not matter in practice unless someone overwrites the chip configuration from outside the driver while the driver is loaded. The conversion time register is initialized with a value of 5 (500ms) when the driver is loaded, and the driver never writes a bad value.
--- drivers/hwmon/tmp401.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/tmp401.c +1 -1
@@ -401,7 +401,7 @@ static int tmp401_chip_read(struct device *dev, u32 attr, int channel, long *val ret =regmap_read (data->regmap,TMP401_CONVERSION_RATE , ®val);if (ret <0 )return ret; - *val = (1 << (7 - regval)) *125 ; + *val = (1 << (7 -min (regval,7 ))) *125 ;break ;case hwmon_chip_temp_reset_history: *val =0 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 81/567 drm/me/gsc: mei interrupt top half should be in irq disabled context
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxiao Chang <[email protected]>
[ Upstream commit 17445af7dcc7d645b6fb8951fd10c8b72cc7f23f ]
MEI GSC interrupt comes from i915 or xe driver. It has top half and bottom half. Top half is called from i915/xe interrupt handler. It should be in irq disabled context.
With RT kernel(PREEMPT_RT enabled), by default IRQ handler is in threaded IRQ. MEI GSC top half might be in threaded IRQ context. generic_handle_irq_safe API could be called from either IRQ or process context, it disables local IRQ then calls MEI GSC interrupt top half.
This change fixes B580 GPU boot issue with RT enabled.
--- drivers/gpu/drm/xe/xe_heci_gsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_heci_gsc.c +2 -2
@@ -230,7 +230,7 @@ void xe_heci_gsc_irq_handler(struct xe_device *xe, u32 iir)if (xe->heci_gsc.irq <0 )return ; - ret =generic_handle_irq (xe->heci_gsc.irq); + ret =generic_handle_irq_safe (xe->heci_gsc.irq);if (ret)drm_err_ratelimited (&xe->drm,"error handling GSC irq: %d\n" , ret); }
@@ -250,7 +250,7 @@ void xe_heci_csc_irq_handler(struct xe_device *xe, u32 iir)if (xe->heci_gsc.irq <0 )return ; - ret =generic_handle_irq (xe->heci_gsc.irq); + ret =generic_handle_irq_safe (xe->heci_gsc.irq);if (ret)drm_err_ratelimited (&xe->drm,"error handling GSC irq: %d\n" , ret); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 82/567 drm/xe: Restore engine registers before restarting schedulers after GT reset
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Maslak <[email protected]>
[ Upstream commit eed5b815fa49c17d513202f54e980eb91955d3ed ]
During GT reset recovery in do_gt_restart(), xe_uc_start() was called before xe_reg_sr_apply_mmio() restored engine-specific registers. This created a race window where the scheduler could run jobs before hardware state was fully restored.
This caused failures in eudebug tests (xe_exec_sip_eudebug@breakpoint- waitsip-*) where TD_CTL register (containing TD_CTL_GLOBAL_DEBUG_ENABLE) wasn't restored before jobs started executing. Breakpoints would fail to trigger SIP entry because the debug enable bit wasn't set yet.
Fix by moving xe_uc_start() after all MMIO register restoration, including engine registers and CCS mode configuration, ensuring all hardware state is fully restored before any jobs can be scheduled.
--- drivers/gpu/drm/xe/xe_gt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/xe_gt.c +4 -3
@@ -721,9 +721,6 @@ static int do_gt_restart(struct xe_gt *gt)xe_gt_sriov_pf_init_hw (gt);xe_mocs_init (gt); - err =xe_uc_start (>->uc); -if (err) -return err;for_each_hw_engine (hwe, gt, id) {xe_reg_sr_apply_mmio (&hwe->reg_sr, gt);
@@ -733,6 +730,10 @@ static int do_gt_restart(struct xe_gt *gt)/* Get CCS mode in sync between sw/hw */ xe_gt_apply_ccs_mode (gt); + err =xe_uc_start (>->uc); +if (err) +return err; +/* Restore GT freq to expected values */ xe_gt_sanitize_freq (gt);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 83/567 MIPS: Fix a reference leak bug in ip22_check_gio()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haoxiang Li <[email protected]>
[ Upstream commit 680ad315caaa2860df411cb378bf3614d96c7648 ]
If gio_device_register fails, gio_dev_put() is required to drop the gio_dev device reference.
--- arch/mips/sgi-ip22/ip22-gio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/sgi-ip22/ip22-gio.c +2 -1
@@ -373,7 +373,8 @@ static void ip22_check_gio(int slotno, unsigned long addr, int irq) gio_dev->resource.flags =IORESOURCE_MEM ; gio_dev->irq = irq;dev_set_name (&gio_dev->dev,"%d" , slotno); -gio_device_register (gio_dev); +if (gio_device_register (gio_dev)) +gio_dev_put (gio_dev); }else printk (KERN_INFO "GIO: slot %d : Empty\n" , slotno); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 84/567 drm/panel: sony-td4353-jdi: Enable prepare_prev_first
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marijn Suijten <[email protected]>
[ Upstream commit 2b973ca48ff3ef1952091c8f988d7796781836c8 ]
The DSI host must be enabled before our prepare function can run, which has to send its init sequence over DSI. Without enabling the host first the panel will not probe.
--- drivers/gpu/drm/panel/panel-sony-td4353-jdi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/panel/panel-sony-td4353-jdi.c +2 -0
@@ -274,6 +274,8 @@ static int sony_td4353_jdi_probe(struct mipi_dsi_device *dsi)if (ret)return dev_err_probe (dev, ret,"Failed to get backlight\n" ); + ctx->panel.prepare_prev_first = true; +drm_panel_add (&ctx->panel); ret =mipi_dsi_attach (dsi);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 85/567 x86/xen: Move Xen upcall handler
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Gerst <[email protected]>
[ Upstream commit 1ab7b5ed44ba9bce581e225f40219b793bc779d6 ]
Move the upcall handler to Xen-specific files.
No functional changes.
Stable-dep-of: e5aff444e3a7 ("x86/xen: Fix sparse warning in enlighten_pv.c")
--- arch/x86/entry/common.c | 72 ------------------------------------- arch/x86/xen/enlighten_pv.c | 69 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 72 deletions(-)
arch/x86/entry/common.c +0 -72
@@ -21,11 +21,6 @@#include <linux/uaccess.h> #include <linux/init.h> -#ifdef CONFIG_XEN_PV -#include <xen/xen-ops.h> -#include <xen/events.h> -#endif -#include <asm/apic.h> #include <asm/desc.h> #include <asm/traps.h>
@@ -454,70 +449,3 @@ SYSCALL_DEFINE0(ni_syscall) {return -ENOSYS ; } - -#ifdef CONFIG_XEN_PV -#ifndef CONFIG_PREEMPTION -/* -* Some hypercalls issued by the toolstack can take many 10s of -* seconds. Allow tasks running hypercalls via the privcmd driver to -* be voluntarily preempted even if full kernel preemption is -* disabled. -* -* Such preemptible hypercalls are bracketed by -* xen_preemptible_hcall_begin() and xen_preemptible_hcall_end() -* calls. -*/ -DEFINE_PER_CPU (bool, xen_in_preemptible_hcall); -EXPORT_SYMBOL_GPL (xen_in_preemptible_hcall); - -/* -* In case of scheduling the flag must be cleared and restored after -* returning from schedule as the task might move to a different CPU. -*/ -static __always_inline bool get_and_clear_inhcall(void) -{ -bool inhcall =__this_cpu_read (xen_in_preemptible_hcall); - -__this_cpu_write (xen_in_preemptible_hcall, false); -return inhcall; -} - -static __always_inline void restore_inhcall(bool inhcall) -{ -__this_cpu_write (xen_in_preemptible_hcall, inhcall); -} -#else -static __always_inline bool get_and_clear_inhcall(void) { return false; } -static __always_inline void restore_inhcall(bool inhcall) { } -#endif - -static void __xen_pv_evtchn_do_upcall (struct pt_regs *regs) -{ -struct pt_regs *old_regs =set_irq_regs (regs); - -inc_irq_stat (irq_hv_callback_count); - -xen_evtchn_do_upcall (); - -set_irq_regs (old_regs); -} - -__visible noinstr void xen_pv_evtchn_do_upcall(struct pt_regs *regs) -{ -irqentry_state_t state =irqentry_enter (regs); -bool inhcall; - -instrumentation_begin (); -run_sysvec_on_irqstack_cond (__xen_pv_evtchn_do_upcall, regs); - - inhcall =get_and_clear_inhcall (); -if (inhcall && !WARN_ON_ONCE (state.exit_rcu)) { -irqentry_exit_cond_resched (); -instrumentation_end (); -restore_inhcall (inhcall); - }else { -instrumentation_end (); -irqentry_exit (regs, state); - } -} -#endif /* CONFIG_XEN_PV */
arch/x86/xen/enlighten_pv.c +69 -0
87 lines not on this page · raw message
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 86/567 x86/xen: Fix sparse warning in enlighten_pv.c
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Juergen Gross <[email protected]>
[ Upstream commit e5aff444e3a7bdeef5ea796a2099fc3c60a070fa ]
The sparse tool issues a warning for arch/x76/xen/enlighten_pv.c:
arch/x86/xen/enlighten_pv.c:120:9: sparse: sparse: incorrect type
in initializer (different address spaces)
expected void const [noderef] __percpu *__vpp_verify got bool *
This is due to the percpu variable xen_in_preemptible_hcall being exported via EXPORT_SYMBOL_GPL() instead of EXPORT_PER_CPU_SYMBOL_GPL().
Message-ID: <[email protected]>
--- arch/x86/xen/enlighten_pv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/enlighten_pv.c +1 -1
@@ -106,7 +106,7 @@ static int xen_cpu_dead_pv(unsigned int cpu);* calls. */ DEFINE_PER_CPU (bool, xen_in_preemptible_hcall); -EXPORT_SYMBOL_GPL (xen_in_preemptible_hcall); +EXPORT_PER_CPU_SYMBOL_GPL (xen_in_preemptible_hcall);/* * In case of scheduling the flag must be cleared and restored after
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 87/567 arm64: kdump: Fix elfcorehdr overlap caused by reserved memory processing reorder
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianpeng Chang <[email protected]>
[ Upstream commit 3e8ade58b71b48913d21b647b2089e03e81f117e ]
Commit 8a6e02d0c00e ("of: reserved_mem: Restructure how the reserved memory regions are processed") changed the processing order of reserved memory regions, causing elfcorehdr to overlap with dynamically allocated reserved memory regions during kdump kernel boot.
The issue occurs because:
1. kexec-tools allocates elfcorehdr in the last crashkernel reserved memory region and passes it to the second kernel
2. The problematic commit moved dynamic reserved memory allocation (like bman-fbpr) to occur during fdt_scan_reserved_mem(), before elfcorehdr reservation in fdt_reserve_elfcorehdr()
3. bman-fbpr with 16MB alignment requirement can get allocated at addresses that overlap with the elfcorehdr location
4. When fdt_reserve_elfcorehdr() tries to reserve elfcorehdr memory, overlap detection identifies the conflict and skips reservation
5. kdump kernel fails with "Unable to handle kernel paging request" because elfcorehdr memory is not properly reserved
The boot log:
Before 8a6e02d0c00e:
OF: fdt: Reserving 1 KiB of memory at 0xf4fff000 for elfcorehdr
OF: reserved mem: 0xf3000000..0xf3ffffff bman-fbpr
After 8a6e02d0c00e:
OF: reserved mem: 0xf4000000..0xf4ffffff bman-fbpr
OF: fdt: elfcorehdr is overlapped
Fix this by ensuring elfcorehdr reservation occurs before dynamic reserved memory allocation.
--- drivers/of/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/fdt.c +1 -1
@@ -501,8 +501,8 @@ void __init early_init_fdt_scan_reserved_mem(void)if (!initial_boot_params)return ; -fdt_scan_reserved_mem ();fdt_reserve_elfcorehdr (); +fdt_scan_reserved_mem ();/* Process header /memreserve/ fields */ for (n =0 ; ; n++) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 88/567 spi: cadence-quadspi: Fix clock disable on probe failure path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anurag Dutta <[email protected]>
[ Upstream commit 1889dd2081975ce1f6275b06cdebaa8d154847a9 ]
When cqspi_request_mmap_dma() returns -EPROBE_DEFER after runtime PM is enabled, the error path calls clk_disable_unprepare() on an already disabled clock, causing an imbalance.
Use pm_runtime_get_sync() to increment the usage counter and resume the device. This prevents runtime_suspend() from being invoked and causing a double clock disable.
--- drivers/spi/spi-cadence-quadspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/spi/spi-cadence-quadspi.c +3 -1
@@ -1959,7 +1959,9 @@ static int cqspi_probe(struct platform_device *pdev) probe_reset_failed:if (cqspi->is_jh7110)cqspi_jh7110_disable_clk (pdev, cqspi); -clk_disable_unprepare (cqspi->clk); + +if (pm_runtime_get_sync (&pdev->dev) >=0 ) +clk_disable_unprepare (cqspi->clk); probe_clk_failed:return ret; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 89/567 block: rnbd-clt: Fix leaked ID in init_dev()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Fourier <[email protected]>
[ Upstream commit c9b5645fd8ca10f310e41b07540f98e6a9720f40 ]
If kstrdup() fails in init_dev(), then the newly allocated ID is lost.
--- drivers/block/rnbd/rnbd-clt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/block/rnbd/rnbd-clt.c +8 -5
@@ -1424,9 +1424,11 @@ static struct rnbd_clt_dev *init_dev(struct rnbd_clt_session *sess, goto out_alloc; } - ret =ida_alloc_max (&index_ida, (1 << (MINORBITS -RNBD_PART_BITS )) -1 , -GFP_KERNEL ); -if (ret <0 ) { + dev->clt_device_id =ida_alloc_max (&index_ida, + (1 << (MINORBITS -RNBD_PART_BITS )) -1 , +GFP_KERNEL ); +if (dev->clt_device_id <0 ) { + ret = dev->clt_device_id;pr_err ("Failed to initialize device '%s' from session %s, allocating idr failed, err: %d\n" , pathname, sess->sessname, ret); goto out_queues;
@@ -1435,10 +1437,9 @@ static struct rnbd_clt_dev *init_dev(struct rnbd_clt_session *sess, dev->pathname =kstrdup (pathname,GFP_KERNEL );if (!dev->pathname) { ret = -ENOMEM ; - goto out_queues; + goto out_ida; } - dev->clt_device_id = ret; dev->sess = sess; dev->access_mode = access_mode; dev->nr_poll_queues = nr_poll_queues;
@@ -1454,6 +1455,8 @@ static struct rnbd_clt_dev *init_dev(struct rnbd_clt_session *sess,return dev; +out_ida: +ida_free (&index_ida, dev->clt_device_id); out_queues:kfree (dev->hw_queues); out_alloc:
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 90/567 drm/xe: Limit num_syncs to prevent oversized allocations
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuicheng Lin <[email protected]>
[ Upstream commit 8e461304009135270e9ccf2d7e2dfe29daec9b60 ]
The exec and vm_bind ioctl allow userspace to specify an arbitrary num_syncs value. Without bounds checking, a very large num_syncs can force an excessively large allocation, leading to kernel warnings from the page allocator as below.
Introduce DRM_XE_MAX_SYNCS (set to 1024) and reject any request exceeding this limit.
"
------------[ cut here ]------------ WARNING: CPU: 0 PID: 1217 at mm/page_alloc.c:5124 __alloc_frozen_pages_noprof+0x2f8/0x2180 mm/page_alloc.c:5124 ... Call Trace: <TASK> alloc_pages_mpol+0xe4/0x330 mm/mempolicy.c:2416 ___kmalloc_large_node+0xd8/0x110 mm/slub.c:4317 __kmalloc_large_node_noprof+0x18/0xe0 mm/slub.c:4348 __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_noprof+0x3d4/0x4b0 mm/slub.c:4388 kmalloc_noprof include/linux/slab.h:909 [inline] kmalloc_array_noprof include/linux/slab.h:948 [inline] xe_exec_ioctl+0xa47/0x1e70 drivers/gpu/drm/xe/xe_exec.c:158 drm_ioctl_kernel+0x1f1/0x3e0 drivers/gpu/drm/drm_ioctl.c:797 drm_ioctl+0x5e7/0xc50 drivers/gpu/drm/drm_ioctl.c:894 xe_drm_ioctl+0x10b/0x170 drivers/gpu/drm/xe/xe_device.c:224 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl fs/ioctl.c:584 [inline] __x64_sys_ioctl+0x18b/0x210 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xbb/0x380 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f
...
"
v2: Add "Reported-by" and Cc stable kernels.
v3: Change XE_MAX_SYNCS from 64 to 1024. (Matt & Ashutosh)
v4: s/XE_MAX_SYNCS/DRM_XE_MAX_SYNCS/ (Matt)
v5: Do the check at the top of the exec func. (Matt)
Stable-dep-of: f8dd66bfb4e1 ("drm/xe/oa: Limit num_syncs to prevent oversized allocations")
--- drivers/gpu/drm/xe/xe_exec.c | 3 ++- drivers/gpu/drm/xe/xe_vm.c | 3 +++ include/uapi/drm/xe_drm.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_exec.c +2 -1
@@ -125,7 +125,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)if (XE_IOCTL_DBG (xe, args->extensions) ||XE_IOCTL_DBG (xe, args->pad[0 ] || args->pad[1 ] || args->pad[2 ]) || -XE_IOCTL_DBG (xe, args->reserved[0 ] || args->reserved[1 ])) +XE_IOCTL_DBG (xe, args->reserved[0 ] || args->reserved[1 ]) || +XE_IOCTL_DBG (xe, args->num_syncs >DRM_XE_MAX_SYNCS ))return -EINVAL ; q =xe_exec_queue_lookup (xef, args->exec_queue_id);
drivers/gpu/drm/xe/xe_vm.c +3 -0
@@ -2829,6 +2829,9 @@ static int vm_bind_ioctl_check_args(struct xe_device *xe,if (XE_IOCTL_DBG (xe, args->extensions))return -EINVAL ; +if (XE_IOCTL_DBG (xe, args->num_syncs >DRM_XE_MAX_SYNCS )) +return -EINVAL ; +if (args->num_binds >1 ) {u64 __user *bind_user =u64_to_user_ptr (args->vector_of_binds);
include/uapi/drm/xe_drm.h +1 -0
@@ -1281,6 +1281,7 @@ struct drm_xe_exec {/** @exec_queue_id: Exec queue ID for the batch buffer */ __u32 exec_queue_id; +#define DRM_XE_MAX_SYNCS 1024/** @num_syncs: Amount of struct drm_xe_sync in array. */ __u32 num_syncs;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 91/567 drm/xe/oa: Limit num_syncs to prevent oversized allocations
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuicheng Lin <[email protected]>
[ Upstream commit f8dd66bfb4e184c71bd26418a00546ebe7f5c17a ]
The OA open parameters did not validate num_syncs, allowing userspace to pass arbitrarily large values, potentially leading to excessive allocations.
Add check to ensure that num_syncs does not exceed DRM_XE_MAX_SYNCS, returning -EINVAL when the limit is violated.
v2: use XE_IOCTL_DBG() and drop duplicated check. (Ashutosh)
--- drivers/gpu/drm/xe/xe_oa.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/xe/xe_oa.c +3 -0
@@ -1200,6 +1200,9 @@ static int xe_oa_set_no_preempt(struct xe_oa *oa, u64 value,static int xe_oa_set_prop_num_syncs (struct xe_oa *oa,u64 value,struct xe_oa_open_param *param) { +if (XE_IOCTL_DBG (oa->xe, value >DRM_XE_MAX_SYNCS )) +return -EINVAL ; + param->num_syncs = value;return 0 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 92/567 hwmon: (ltc4282): Fix reset_history file permissions
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nuno Sá <[email protected]>
[ Upstream commit b3db91c3bfea69a6c6258fea508f25a59c0feb1a ]
The reset_history attributes are write only. Hence don't report them as readable just to return -EOPNOTSUPP later on.
--- drivers/hwmon/ltc4282.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/hwmon/ltc4282.c +6 -3
@@ -1016,8 +1016,9 @@ static umode_t ltc4282_in_is_visible(const struct ltc4282_state *st, u32 attr)case hwmon_in_max:case hwmon_in_min:case hwmon_in_enable: -case hwmon_in_reset_history:return 0644 ; +case hwmon_in_reset_history: +return 0200 ;default :return 0 ; }
@@ -1036,8 +1037,9 @@ static umode_t ltc4282_curr_is_visible(u32 attr)return 0444 ;case hwmon_curr_max:case hwmon_curr_min: -case hwmon_curr_reset_history:return 0644 ; +case hwmon_curr_reset_history: +return 0200 ;default :return 0 ; }
@@ -1055,8 +1057,9 @@ static umode_t ltc4282_power_is_visible(u32 attr)return 0444 ;case hwmon_power_max:case hwmon_power_min: -case hwmon_power_reset_history:return 0644 ; +case hwmon_power_reset_history: +return 0200 ;default :return 0 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 93/567 ksmbd: skip lock-range check on equal size to avoid size==0 underflow
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qianchang Zhao <[email protected]>
commit 5d510ac31626ed157d2182149559430350cf2104 upstream.
When size equals the current i_size (including 0), the code used to call check_lock_range(filp, i_size, size - 1, WRITE), which computes size - 1 and can underflow for size==0. Skip the equal case.
--- fs/smb/server/vfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/smb/server/vfs.c +4 -1
@@ -333,6 +333,9 @@ static int check_lock_range(struct filestruct file_lock_context *ctx =locks_inode_context (file_inode (filp));int error =0 ; +if (start == end) +return 0 ; +if (!ctx ||list_empty_careful (&ctx->flc_posix))return 0 ;
@@ -839,7 +842,7 @@ int ksmbd_vfs_truncate(struct ksmbd_workif (size < inode->i_size) { err =check_lock_range (filp, size, inode->i_size -1 ,WRITE ); - }else { + }else if (size > inode->i_size) { err =check_lock_range (filp, inode->i_size, size -1 ,WRITE ); }
Greg Kroah-Hartman
maintainerPATCH 94/567 ksmbd: Fix refcount leak when invalid session is found on session lookup
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit cafb57f7bdd57abba87725eb4e82bbdca4959644 upstream.
When a session is found but its state is not SMB2_SESSION_VALID, It indicates that no valid session was found, but it is missing to decrement the reference count acquired by the session lookup, which results in a reference count leak. This patch fixes the issue by explicitly calling ksmbd_user_session_put to release the reference to the session.
--- fs/smb/server/mgmt/user_session.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/smb/server/mgmt/user_session.c +3 -1
@@ -325,8 +325,10 @@ struct ksmbd_session *ksmbd_session_look sess =ksmbd_session_lookup (conn, id);if (!sess && conn->binding) sess =ksmbd_session_lookup_slowpath (id); -if (sess && sess->state !=SMB2_SESSION_VALID ) +if (sess && sess->state !=SMB2_SESSION_VALID ) { +ksmbd_user_session_put (sess); sess =NULL ; + }return sess; }
Greg Kroah-Hartman
maintainerPATCH 95/567 ksmbd: fix buffer validation by including null terminator size in EA length
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit 95d7a890e4b03e198836d49d699408fd1867cb55 upstream.
The smb2_set_ea function, which handles Extended Attributes (EA), was performing buffer validation checks that incorrectly omitted the size of the null terminating character (+1 byte) for EA Name.
This patch fixes the issue by explicitly adding '+ 1' to EaNameLength where the null terminator is expected to be present in the buffer, ensuring the validation accurately reflects the total required buffer size.
--- fs/smb/server/smb2pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/smb/server/smb2pdu.c +2 -2
@@ -2363,7 +2363,7 @@ static int smb2_set_ea(struct smb2_ea_inint rc =0 ;unsigned int next =0 ; -if (buf_len <sizeof (struct smb2_ea_info ) + eabuf->EaNameLength + +if (buf_len <sizeof (struct smb2_ea_info ) + eabuf->EaNameLength +1 +le16_to_cpu (eabuf->EaValueLength))return -EINVAL ;
@@ -2440,7 +2440,7 @@ next:break ; } -if (buf_len <sizeof (struct smb2_ea_info ) + eabuf->EaNameLength + +if (buf_len <sizeof (struct smb2_ea_info ) + eabuf->EaNameLength +1 +le16_to_cpu (eabuf->EaValueLength)) { rc = -EINVAL ;break ;
Greg Kroah-Hartman
maintainerPATCH 96/567 HID: input: map HID_GD_Z to ABS_DISTANCE for stylus/pen
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ping Cheng <[email protected]>
commit 7953794f741e94d30df9dafaaa4c031c85b891d6 upstream.
HID_GD_Z is mapped to ABS_Z for stylus and pen in hid-input.c. But HID_GD_Z should be used to report ABS_DISTANCE for stylus and pen as described at:
Documentation/input/event-codes.rst#n226
* ABS_DISTANCE:
- Used to describe the distance of a tool from an interaction surface. This event should only be emitted while the tool is hovering, meaning in close proximity of the device and while the value of the BTN_TOUCH code is 0. If the input device may be used freely in three dimensions, consider ABS_Z instead.
- BTN_TOOL_<name> should be set to 1 when the tool comes into detectable proximity and set to 0 when the tool leaves detectable proximity. BTN_TOOL_<name> signals the type of tool that is currently detected by the hardware and is otherwise independent of ABS_DISTANCE and/or BTN_TOUCH.
This patch makes the correct mapping. The ABS_DISTANCE is currently not mapped by any HID usage in hid-generic driver.
--- drivers/hid/hid-input.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/hid/hid-input.c +17 -1
@@ -864,7 +864,7 @@ static void hidinput_configure_usage(strswitch (usage->hid) {/* These usage IDs map directly to the usage codes. */ -case HID_GD_X :case HID_GD_Y :case HID_GD_Z : +case HID_GD_X :case HID_GD_Y :case HID_GD_RX :case HID_GD_RY :case HID_GD_RZ :if (field->flags &HID_MAIN_ITEM_RELATIVE )map_rel (usage->hid &0xf );
@@ -872,6 +872,22 @@ static void hidinput_configure_usage(strmap_abs_clear (usage->hid &0xf );break ; +case HID_GD_Z : +/* HID_GD_Z is mapped to ABS_DISTANCE for stylus/pen */ +if (field->flags &HID_MAIN_ITEM_RELATIVE ) { +map_rel (usage->hid &0xf ); + }else { +if (field->application ==HID_DG_PEN || + field->physical ==HID_DG_PEN || + field->logical ==HID_DG_STYLUS || + field->physical ==HID_DG_STYLUS || + field->application ==HID_DG_DIGITIZER ) +map_abs_clear (ABS_DISTANCE ); +else +map_abs_clear (usage->hid &0xf ); + } +break ; +case HID_GD_WHEEL :if (field->flags &HID_MAIN_ITEM_RELATIVE ) {set_bit (REL_WHEEL , input->relbit);
Greg Kroah-Hartman
maintainerPATCH 97/567 Input: ti_am335x_tsc - fix off-by-one error in wire_order validation
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junjie Cao <[email protected]>
commit 248d3a73a0167dce15ba100477c3e778c4787178 upstream.
The current validation 'wire_order[i] > ARRAY_SIZE(config_pins)' allows wire_order[i] to equal ARRAY_SIZE(config_pins), which causes out-of-bounds access when used as index in 'config_pins[wire_order[i]]'.
Since config_pins has 4 elements (indices 0-3), the valid range for wire_order should be 0-3. Fix the off-by-one error by using >= instead of > in the validation check.
--- drivers/input/touchscreen/ti_am335x_tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/ti_am335x_tsc.c +1 -1
@@ -85,7 +85,7 @@ static int titsc_config_wires(struct tit wire_order[i] = ts_dev->config_inp[i] &0x0F ;if (WARN_ON (analog_line[i] >7 ))return -EINVAL ; -if (WARN_ON (wire_order[i] >ARRAY_SIZE (config_pins))) +if (WARN_ON (wire_order[i] >=ARRAY_SIZE (config_pins)))return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 98/567 Input: lkkbd - disable pending work before freeing device
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Minseong Kim <[email protected]>
commit e58c88f0cb2d8ed89de78f6f17409d29cfab6c5c upstream.
lkkbd_interrupt() schedules lk->tq via schedule_work(), and the work handler lkkbd_reinit() dereferences the lkkbd structure and its serio/input_dev fields.
lkkbd_disconnect() and error paths in lkkbd_connect() free the lkkbd structure without preventing the reinit work from being queued again until serio_close() returns. This can allow the work handler to run after the structure has been freed, leading to a potential use-after-free.
Use disable_work_sync() instead of cancel_work_sync() to ensure the reinit work cannot be re-queued, and call it both in lkkbd_disconnect() and in lkkbd_connect() error paths after serio_open().
--- drivers/input/keyboard/lkkbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/input/keyboard/lkkbd.c +4 -1
@@ -670,7 +670,8 @@ static int lkkbd_connect(struct serio *sreturn 0 ; - fail3:serio_close (serio); + fail3:disable_work_sync (&lk->tq); +serio_close (serio); fail2:serio_set_drvdata (serio,NULL ); fail1:input_free_device (input_dev);kfree (lk);
@@ -684,6 +685,8 @@ static void lkkbd_disconnect(struct seri {struct lkkbd *lk =serio_get_drvdata (serio); +disable_work_sync (&lk->tq); +input_get_device (lk->dev);input_unregister_device (lk->dev);serio_close (serio);
Greg Kroah-Hartman
maintainerPATCH 99/567 Input: alps - fix use-after-free bugs caused by dev3_register_work
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Duoming Zhou <[email protected]>
commit bf40644ef8c8a288742fa45580897ed0e0289474 upstream.
The dev3_register_work delayed work item is initialized within alps_reconnect() and scheduled upon receipt of the first bare PS/2 packet from an external PS/2 device connected to the ALPS touchpad. During device detachment, the original implementation calls flush_workqueue() in psmouse_disconnect() to ensure completion of dev3_register_work. However, the flush_workqueue() in psmouse_disconnect() only blocks and waits for work items that were already queued to the workqueue prior to its invocation. Any work items submitted after flush_workqueue() is called are not included in the set of tasks that the flush operation awaits. This means that after flush_workqueue() has finished executing, the dev3_register_work could still be scheduled. Although the psmouse state is set to PSMOUSE_CMD_MODE in psmouse_disconnect(), the scheduling of dev3_register_work remains unaffected.
The race condition can occur as follows:
CPU 0 (cleanup path) | CPU 1 (delayed work)
psmouse_disconnect() |
psmouse_set_state() |
flush_workqueue() | alps_report_bare_ps2_packet()
alps_disconnect() | psmouse_queue_work()
kfree(priv); // FREE | alps_register_bare_ps2_mouse()
| priv = container_of(work...); // USE
| priv->dev3 // USEAdd disable_delayed_work_sync() in alps_disconnect() to ensure that dev3_register_work is properly canceled and prevented from executing after the alps_data structure has been deallocated.
This bug is identified by static analysis.
--- drivers/input/mouse/alps.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/alps.c +1 -0
@@ -2977,6 +2977,7 @@ static void alps_disconnect(struct psmoupsmouse_reset (psmouse);timer_shutdown_sync (&priv->timer); +disable_delayed_work_sync (&priv->dev3_register_work);if (priv->dev2)input_unregister_device (priv->dev2);if (!IS_ERR_OR_NULL (priv->dev3))
Greg Kroah-Hartman
maintainerPATCH 100/567 Input: i8042 - add TUXEDO InfinityBook Max Gen10 AMD to i8042 quirk table
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoffer Sandberg <[email protected]>
commit aed3716db7fff74919cc5775ca3a80c8bb246489 upstream.
The device occasionally wakes up from suspend with missing input on the internal keyboard and the following suspend attempt results in an instant wake-up. The quirks fix both issues for this device.
--- drivers/input/serio/i8042-acpipnpio.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/input/serio/i8042-acpipnpio.h +7 -0
@@ -1169,6 +1169,13 @@ static const struct dmi_system_id i8042_ .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) }, + { + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "X5KK45xS_X5SP45xS"), + }, + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) + }, /* * A lot of modern Clevo barebones have touchpad and/or keyboard issues * after suspend fixable with the forcenorestore quirk.
Greg Kroah-Hartman
maintainerPATCH 101/567 xfs: dont leak a locked dquot when xfs_dquot_attach_buf fails
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
commit 204c8f77e8d4a3006f8abe40331f221a597ce608 upstream.
xfs_qm_quotacheck_dqadjust acquired the dquot through xfs_qm_dqget, which means it owns a reference and holds q_qlock. Both need to be dropped on an error exit.
--- fs/xfs/xfs_qm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/xfs/xfs_qm.c +3 -2
@@ -1134,7 +1134,7 @@ xfs_qm_quotacheck_dqadjust( error =xfs_dquot_attach_buf (NULL , dqp);if (error) -return error; + goto out_unlock;trace_xfs_dqadjust (dqp);
@@ -1164,8 +1164,9 @@ xfs_qm_quotacheck_dqadjust( } dqp->q_flags |=XFS_DQFLAG_DIRTY ; +out_unlock:xfs_qm_dqput (dqp); -return 0 ; +return error; }/*
Greg Kroah-Hartman
maintainerPATCH 102/567 can: gs_usb: gs_can_open(): fix error handling
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit 3e54d3b4a8437b6783d4145c86962a2aa51022f3 upstream.
Commit 2603be9e8167 ("can: gs_usb: gs_can_open(): improve error handling") added missing error handling to the gs_can_open() function.
The driver uses 2 USB anchors to track the allocated URBs: the TX URBs in struct gs_can::tx_submitted for each netdev and the RX URBs in struct gs_usb::rx_submitted for the USB device. gs_can_open() allocates the RX URBs, while TX URBs are allocated during gs_can_start_xmit().
The cleanup in gs_can_open() kills all anchored dev->tx_submitted URBs (which is not necessary since the netdev is not yet registered), but misses the parent->rx_submitted URBs.
Fix the problem by killing the rx_submitted instead of the tx_submitted.
--- drivers/net/can/usb/gs_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/usb/gs_usb.c +1 -1
@@ -1071,7 +1071,7 @@ out_usb_free_urb:usb_free_urb (urb); out_usb_kill_anchored_urbs:if (!parent->active_channels) { -usb_kill_anchored_urbs (&dev->tx_submitted); +usb_kill_anchored_urbs (&parent->rx_submitted);if (dev->feature &GS_CAN_FEATURE_HW_TIMESTAMP )gs_usb_timestamp_stop (parent);
Greg Kroah-Hartman
maintainerPATCH 103/567 soc/tegra: fuse: Do not register SoC device on ACPI boot
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kartik Rajput <[email protected]>
commit c87f820bc4748fdd4d50969e8930cd88d1b61582 upstream.
On Tegra platforms using ACPI, the SMCCC driver already registers the SoC device. This makes the registration performed by the Tegra fuse driver redundant.
When booted via ACPI, skip registering the SoC device and suppress printing SKU information from the Tegra fuse driver, as this information is already provided by the SMCCC driver.
--- drivers/soc/tegra/fuse/fuse-tegra.c | 2 -- 1 file changed, 2 deletions(-)
drivers/soc/tegra/fuse/fuse-tegra.c +0 -2
@@ -182,8 +182,6 @@ static int tegra_fuse_probe(struct platf } fuse->soc->init (fuse); -tegra_fuse_print_sku_info (&tegra_sku_info); -tegra_soc_device_register (); err =tegra_fuse_add_lookups (fuse);if (err)
Greg Kroah-Hartman
maintainerPATCH 104/567 ACPI: PCC: Fix race condition by removing static qualifier
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengjie Zhang <[email protected]>
commit f103fa127c93016bcd89b05d8e11dc1a84f6990d upstream.
Local variable 'ret' in acpi_pcc_address_space_setup() is currently declared as 'static'. This can lead to race conditions in a multithreaded environment.
Remove the 'static' qualifier to ensure that 'ret' will be allocated directly on the stack as a local variable.
--- drivers/acpi/acpi_pcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_pcc.c +1 -1
@@ -53,7 +53,7 @@ acpi_pcc_address_space_setup(acpi_handlestruct pcc_data *data;struct acpi_pcc_info *ctx = handler_context;struct pcc_mbox_chan *pcc_chan; -static acpi_status ret; +acpi_status ret; data =kzalloc (sizeof (*data),GFP_KERNEL );if (!data)
Greg Kroah-Hartman
maintainerPATCH 105/567 ACPI: CPPC: Fix missing PCC check for guaranteed_perf
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengjie Zhang <[email protected]>
commit 6ea3a44cef28add2d93b1ef119d84886cb1e3c9b upstream.
The current implementation overlooks the 'guaranteed_perf' register in this check.
If the Guaranteed Performance register is located in the PCC subspace, the function currently attempts to read it without acquiring the lock and without sending the CMD_READ doorbell to the firmware. This can result in reading stale data.
--- drivers/acpi/cppc_acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +2 -1
@@ -1297,7 +1297,8 @@ int cppc_get_perf_caps(int cpunum, struc/* Are any of the regs PCC ?*/ if (CPC_IN_PCC (highest_reg) ||CPC_IN_PCC (lowest_reg) ||CPC_IN_PCC (lowest_non_linear_reg) ||CPC_IN_PCC (nominal_reg) || -CPC_IN_PCC (low_freq_reg) ||CPC_IN_PCC (nom_freq_reg)) { +CPC_IN_PCC (low_freq_reg) ||CPC_IN_PCC (nom_freq_reg) || +CPC_IN_PCC (guaranteed_reg)) {if (pcc_ss_id <0 ) {pr_debug ("Invalid pcc_ss_id\n" );return -ENODEV ;
Greg Kroah-Hartman
maintainerPATCH 106/567 spi: fsl-cpm: Check length parity before switching to 16 bit mode
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe Leroy <[email protected]>
commit 1417927df8049a0194933861e9b098669a95c762 upstream.
Commit fc96ec826bce ("spi: fsl-cpm: Use 16 bit mode for large transfers with even size") failed to make sure that the size is really even before switching to 16 bit mode. Until recently the problem went unnoticed because kernfs uses a pre-allocated bounce buffer of size PAGE_SIZE for reading EEPROM.
But commit 8ad6249c51d0 ("eeprom: at25: convert to spi-mem API") introduced an additional dynamically allocated bounce buffer whose size is exactly the size of the transfer, leading to a buffer overrun in the fsl-cpm driver when that size is odd.
Add the missing length parity verification and remain in 8 bit mode when the length is not even.
--- drivers/spi/spi-fsl-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-fsl-spi.c +1 -1
@@ -335,7 +335,7 @@ static int fsl_spi_prepare_message(strucif (t->bits_per_word ==16 || t->bits_per_word ==32 ) t->bits_per_word =8 ;/* pretend its 8 bits */ if (t->bits_per_word ==8 && t->len >=256 && - (mpc8xxx_spi->flags &SPI_CPM1 )) + !(t->len &1 ) && (mpc8xxx_spi->flags &SPI_CPM1 )) t->bits_per_word =16 ; } }
Greg Kroah-Hartman
maintainerPATCH 107/567 mmc: sdhci-esdhc-imx: add alternate ARCH_S32 dependency to Kconfig
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jared Kangas <[email protected]>
commit d3ecb12e2e04ce53c95f933c462f2d8b150b965b upstream.
MMC_SDHCI_ESDHC_IMX requires ARCH_MXC despite also being used on ARCH_S32, which results in unmet dependencies when compiling strictly for ARCH_S32. Resolve this by adding ARCH_S32 as an alternative to ARCH_MXC in the driver's dependencies.
--- drivers/mmc/host/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/Kconfig +2 -2
@@ -291,14 +291,14 @@ config MMC_SDHCI_ESDHC_MCF config MMC_SDHCI_ESDHC_IMX tristate "SDHCI support for the Freescale eSDHC/uSDHC i.MX controller" - depends on ARCH_MXC || COMPILE_TEST + depends on ARCH_MXC || ARCH_S32 || COMPILE_TEST depends on MMC_SDHCI_PLTFM depends on OF select MMC_SDHCI_IO_ACCESSORS select MMC_CQHCI help This selects the Freescale eSDHC/uSDHC controller support - found on i.MX25, i.MX35 i.MX5x and i.MX6x. + found on i.MX25, i.MX35, i.MX5x, i.MX6x, and S32G. If you have a controller with this interface, say Y or M here.
Greg Kroah-Hartman
maintainerPATCH 108/567 mmc: sdhci-of-arasan: Increase CD stable timeout to 2 seconds
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sai Krishna Potthuri <[email protected]>
commit a9c4c9085ec8ce3ce01be21b75184789e74f5f19 upstream.
On Xilinx/AMD platforms, the CD stable bit take slightly longer than one second(about an additional 100ms) to assert after a host controller reset. Although no functional failure observed with the existing one second delay but to ensure reliable initialization, increase the CD stable timeout to 2 seconds.
--- drivers/mmc/host/sdhci-of-arasan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -1
@@ -99,7 +99,7 @@#define HIWORD_UPDATE (val, mask, shift) \ ((val) << (shift) | (mask) << ((shift) + 16)) -#define CD_STABLE_TIMEOUT_US 1000000 +#define CD_STABLE_TIMEOUT_US 2000000#define CD_STABLE_MAX_SLEEP_US 10/**
Greg Kroah-Hartman
maintainerPATCH 109/567 dt-bindings: mmc: sdhci-of-aspeed: Switch ref to sdhci-common.yaml
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Jeffery <[email protected]>
commit ed724ea1b82a800af4704311cb89e5ef1b4ea7ac upstream.
Enable use of common SDHCI-related properties such as sdhci-caps-mask as found in the AST2600 EVB DTS.
--- Documentation/devicetree/bindings/mmc/aspeed,sdhci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/aspeed,sdhci.yaml +1 -1
@@ -41,7 +41,7 @@ properties: patternProperties: "^sdhci@[0-9a-f]+$": type: object - $ref: mmc-controller.yaml + $ref: sdhci-common.yaml unevaluatedProperties: false properties:
Greg Kroah-Hartman
maintainerPATCH 110/567 net/hsr: fix NULL pointer dereference in prp_get_untagged_frame()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shaurya Rane <[email protected]>
commit 188e0fa5a679570ea35474575e724d8211423d17 upstream.
prp_get_untagged_frame() calls __pskb_copy() to create frame->skb_std but doesn't check if the allocation failed. If __pskb_copy() returns NULL, skb_clone() is called with a NULL pointer, causing a crash:
Oops: general protection fault, probably for non-canonical address 0xdffffc000000000f: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000078-0x000000000000007f] CPU: 0 UID: 0 PID: 5625 Comm: syz.1.18 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:skb_clone+0xd7/0x3a0 net/core/skbuff.c:2041 Code: 03 42 80 3c 20 00 74 08 4c 89 f7 e8 23 29 05 f9 49 83 3e 00 0f 85 a0 01 00 00 e8 94 dd 9d f8 48 8d 6b 7e 49 89 ee 49 c1 ee 03 <43> 0f b6 04 26 84 c0 0f 85 d1 01 00 00 44 0f b6 7d 00 41 83 e7 0c RSP: 0018:ffffc9000d00f200 EFLAGS: 00010207 RAX: ffffffff892235a1 RBX: 0000000000000000 RCX: ffff88803372a480 RDX: 0000000000000000 RSI: 0000000000000820 RDI: 0000000000000000 RBP: 000000000000007e R08: ffffffff8f7d0f77 R09: 1ffffffff1efa1ee R10: dffffc0000000000 R11: fffffbfff1efa1ef R12: dffffc0000000000 R13: 0000000000000820 R14: 000000000000000f R15: ffff88805144cc00 FS: 0000555557f6d500(0000) GS:ffff88808d72f000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555581d35808 CR3: 000000005040e000 CR4: 0000000000352ef0 Call Trace: <TASK> hsr_forward_do net/hsr/hsr_forward.c:-1 [inline] hsr_forward_skb+0x1013/0x2860 net/hsr/hsr_forward.c:741 hsr_handle_frame+0x6ce/0xa70 net/hsr/hsr_slave.c:84 __netif_receive_skb_core+0x10b9/0x4380 net/core/dev.c:5966 __netif_receive_skb_one_core net/core/dev.c:6077 [inline] __netif_receive_skb+0x72/0x380 net/core/dev.c:6192 netif_receive_skb_internal net/core/dev.c:6278 [inline] netif_receive_skb+0x1cb/0x790 net/core/dev.c:6337 tun_rx_batched+0x1b9/0x730 drivers/net/tun.c:1485 tun_get_user+0x2b65/0x3e90 drivers/net/tun.c:1953 tun_chr_write_iter+0x113/0x200 drivers/net/tun.c:1999 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x5c9/0xb30 fs/read_write.c:686 ksys_write+0x145/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0449f8e1ff Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 f9 92 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 4c 93 02 00 48 RSP: 002b:00007ffd7ad94c90 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f044a1e5fa0 RCX: 00007f0449f8e1ff RDX: 000000000000003e RSI: 0000200000000500 RDI: 00000000000000c8 RBP: 00007ffd7ad94d20 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000003e R11: 0000000000000293 R12: 0000000000000001 R13: 00007f044a1e5fa0 R14: 00007f044a1e5fa0 R15: 0000000000000003 </TASK>
Add a NULL check immediately after __pskb_copy() to handle allocation failures gracefully.
--- net/hsr/hsr_forward.c | 2 ++ 1 file changed, 2 insertions(+)
net/hsr/hsr_forward.c +2 -0
@@ -205,6 +205,8 @@ struct sk_buff *prp_get_untagged_frame(s__pskb_copy (frame->skb_prp,skb_headroom (frame->skb_prp),GFP_ATOMIC ); +if (!frame->skb_std) +return NULL ; }else {/* Unexpected */ WARN_ONCE(1, "%s:%d: Unexpected frame received (port_src %s)\n",
Greg Kroah-Hartman
maintainerPATCH 111/567 x86/fpu: Fix FPU state core dump truncation on CPUs with no extended xfeatures
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yongxin Liu <[email protected]>
[ Upstream commit c8161e5304abb26e6c0bec6efc947992500fa6c5 ]
Zero can be a valid value of num_records. For example, on Intel Atom x6425RE, only x87 and SSE are supported (features 0, 1), and fpu_user_cfg.max_features is 3. The for_each_extended_xfeature() loop only iterates feature 2, which is not enabled, so num_records = 0. This is valid and should not cause core dump failure.
The issue is that dump_xsave_layout_desc() returns 0 for both genuine errors (dump_emit() failure) and valid cases (no extended features). Use negative return values for errors and only abort on genuine failures.
--- arch/x86/kernel/fpu/xstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/fpu/xstate.c +2 -2
@@ -1879,7 +1879,7 @@ static int dump_xsave_layout_desc(struct coredump_params *cprm) };if (!dump_emit (cprm, &xc,sizeof (xc))) -return 0 ; +return -1 ; num_records++; }
@@ -1917,7 +1917,7 @@ int elf_coredump_extra_notes_write(struct coredump_params *cprm)return 1 ; num_records =dump_xsave_layout_desc (cprm); -if (!num_records) +if (num_records <0 )return 1 ;/* Total size should be equal to the number of records */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 112/567 ALSA: vxpocket: Fix resource leak in vxpocket_probe error path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haotian Zhang <[email protected]>
[ Upstream commit 2a03b40deacbd293ac9aed0f9b11197dad54fe5f ]
When vxpocket_config() fails, vxpocket_probe() returns the error code directly without freeing the sound card resources allocated by snd_card_new(), which leads to a memory leak.
Add proper error handling to free the sound card and clear the allocation bit when vxpocket_config() fails.
--- sound/pcmcia/vx/vxpocket.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
sound/pcmcia/vx/vxpocket.c +7 -1
@@ -284,7 +284,13 @@ static int vxpocket_probe(struct pcmcia_device *p_dev) vxp->p_dev = p_dev; -return vxpocket_config (p_dev); + err =vxpocket_config (p_dev); +if (err <0 ) { + card_alloc &= ~(1 << i); +snd_card_free (card); +return err; + } +return 0 ; }static void vxpocket_detach (struct pcmcia_device *link)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 113/567 ALSA: pcmcia: Fix resource leak in snd_pdacf_probe error path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haotian Zhang <[email protected]>
[ Upstream commit 5032347c04ba7ff9ba878f262e075d745c06a2a8 ]
When pdacf_config() fails, snd_pdacf_probe() returns the error code directly without freeing the sound card resources allocated by snd_card_new(), which leads to a memory leak.
Add proper error handling to free the sound card and clear the card list entry when pdacf_config() fails.
--- sound/pcmcia/pdaudiocf/pdaudiocf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
sound/pcmcia/pdaudiocf/pdaudiocf.c +7 -1
@@ -131,7 +131,13 @@ static int snd_pdacf_probe(struct pcmcia_device *link) link->config_index =1 ; link->config_regs =PRESENT_OPTION ; -return pdacf_config (link); + err =pdacf_config (link); +if (err <0 ) { + card_list[i] =NULL ; +snd_card_free (card); +return err; + } +return 0 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 114/567 ALSA: usb-mixer: us16x08: validate meter packet indices
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shipei Qu <[email protected]>
[ Upstream commit 5526c1c6ba1d0913c7dfcbbd6fe1744ea7c55f1e ]
get_meter_levels_from_urb() parses the 64-byte meter packets sent by the device and fills the per-channel arrays meter_level[], comp_level[] and master_level[] in struct snd_us16x08_meter_store.
Currently the function derives the channel index directly from the meter packet (MUB2(meter_urb, s) - 1) and uses it to index those arrays without validating the range. If the packet contains a negative or out-of-range channel number, the driver may write past the end of these arrays.
Introduce a local channel variable and validate it before updating the arrays. We reject negative indices, limit meter_level[] and comp_level[] to SND_US16X08_MAX_CHANNELS, and guard master_level[] updates with ARRAY_SIZE(master_level).
--- sound/usb/mixer_us16x08.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
sound/usb/mixer_us16x08.c +14 -6
@@ -656,17 +656,25 @@ static void get_meter_levels_from_urb(int s, u8 *meter_urb) {int val =MUC2 (meter_urb, s) + (MUC3 (meter_urb, s) <<8 ); +int ch =MUB2 (meter_urb, s) -1 ; + +if (ch <0 ) +return ;if (MUA0 (meter_urb, s) ==0x61 &&MUA1 (meter_urb, s) ==0x02 &&MUA2 (meter_urb, s) ==0x04 &&MUB0 (meter_urb, s) ==0x62 ) { -if (MUC0 (meter_urb, s) ==0x72 ) - store->meter_level[MUB2 (meter_urb, s) -1 ] = val; -if (MUC0 (meter_urb, s) ==0xb2 ) - store->comp_level[MUB2 (meter_urb, s) -1 ] = val; +if (ch <SND_US16X08_MAX_CHANNELS ) { +if (MUC0 (meter_urb, s) ==0x72 ) + store->meter_level[ch] = val; +if (MUC0 (meter_urb, s) ==0xb2 ) + store->comp_level[ch] = val; + } }if (MUA0 (meter_urb, s) ==0x61 &&MUA1 (meter_urb, s) ==0x02 && -MUA2 (meter_urb, s) ==0x02 &&MUB0 (meter_urb, s) ==0x62 ) - store->master_level[MUB2 (meter_urb, s) -1 ] = val; +MUA2 (meter_urb, s) ==0x02 &&MUB0 (meter_urb, s) ==0x62 ) { +if (ch <ARRAY_SIZE (store->master_level)) + store->master_level[ch] = val; + } }/* Function to retrieve current meter values from the device.
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 115/567 ASoC: ak4458: remove the reset operation in probe and remove
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shengjiu Wang <[email protected]>
[ Upstream commit 00b960a83c764208b0623089eb70af3685e3906f ]
The reset_control handler has the reference count for usage, as there is reset operation in runtime suspend and resume, then reset operation in probe() would cause the reference count of reset not balanced.
Previously add reset operation in probe and remove is to fix the compile issue with !CONFIG_PM, as the driver has been update to use RUNTIME_PM_OPS(), so that change can be reverted.
--- sound/soc/codecs/ak4458.c | 4 ---- 1 file changed, 4 deletions(-)
sound/soc/codecs/ak4458.c +0 -4
@@ -790,16 +790,12 @@ static int ak4458_i2c_probe(struct i2c_client *i2c)pm_runtime_enable (&i2c->dev);regcache_cache_only (ak4458->regmap, true); -ak4458_reset (ak4458, false);return 0 ; }static void ak4458_i2c_remove (struct i2c_client *i2c) { -struct ak4458_priv *ak4458 =i2c_get_clientdata (i2c); - -ak4458_reset (ak4458, true);pm_runtime_disable (&i2c->dev); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 116/567 nfsd: update percpu_ref to manage references on nfsd_net
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
[ Upstream commit 39972494e318a21b3059287909fc090186dbe60a ]
Holding a reference on nfsd_net is what is required, it was never actually about ensuring nn->nfsd_serv available.
Move waiting for outstanding percpu references from nfsd_destroy_serv() to nfsd_shutdown_net().
By moving it later it will be possible to invalidate localio clients during nfsd_file_cache_shutdown_net() via __nfsd_file_cache_purge().
Stable-dep-of: df8d829bba3a ("nfsd: fix memory leak in nfsd_create_serv error paths")
--- fs/nfsd/nfssvc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
fs/nfsd/nfssvc.c +7 -5
@@ -436,6 +436,10 @@ static void nfsd_shutdown_net(struct net *net)if (!nn->nfsd_net_up)return ; + +percpu_ref_kill_and_confirm (&nn->nfsd_serv_ref, nfsd_serv_done); +wait_for_completion (&nn->nfsd_serv_confirm_done); +nfsd_export_flush (net);nfs4_state_shutdown_net (net);nfsd_reply_cache_shutdown (nn);
@@ -444,7 +448,10 @@ static void nfsd_shutdown_net(struct net *net)lockd_down (net); nn->lockd_up = false; } + +wait_for_completion (&nn->nfsd_serv_free_done);percpu_ref_exit (&nn->nfsd_serv_ref); + nn->nfsd_net_up = false;nfsd_shutdown_generic (); }
@@ -526,11 +533,6 @@ void nfsd_destroy_serv(struct net *net)lockdep_assert_held (&nfsd_mutex); -percpu_ref_kill_and_confirm (&nn->nfsd_serv_ref, nfsd_serv_done); -wait_for_completion (&nn->nfsd_serv_confirm_done); -wait_for_completion (&nn->nfsd_serv_free_done); -/* percpu_ref_exit is called in nfsd_shutdown_net */ -spin_lock (&nfsd_notifier_lock); nn->nfsd_serv =NULL ;spin_unlock (&nfsd_notifier_lock);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 117/567 nfsd: rename nfsd_serv_ prefixed methods and variables with nfsd_net_
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
[ Upstream commit b33f7dec3a67216123312c7bb752b8f6faa1c465 ]
Also update Documentation/filesystems/nfs/localio.rst accordingly and reduce the technical documentation debt that was previously captured in that document.
Stable-dep-of: df8d829bba3a ("nfsd: fix memory leak in nfsd_create_serv error paths")
--- Documentation/filesystems/nfs/localio.rst | 85 +++++++---------------- fs/nfs_common/nfslocalio.c | 10 ++- fs/nfsd/filecache.c | 2 +- fs/nfsd/localio.c | 4 +- fs/nfsd/netns.h | 11 +-- fs/nfsd/nfssvc.c | 34 ++++----- include/linux/nfslocalio.h | 12 ++-- 7 files changed, 66 insertions(+), 92 deletions(-)
Documentation/filesystems/nfs/localio.rst +27 -58
@@ -218,64 +218,30 @@ NFS Client and Server Interlock =============================== LOCALIO provides the nfs_uuid_t object and associated interfaces to -allow proper network namespace (net-ns) and NFSD object refcounting: - - We don't want to keep a long-term counted reference on each NFSD's - net-ns in the client because that prevents a server container from - completely shutting down. - - So we avoid taking a reference at all and rely on the per-cpu - reference to the server (detailed below) being sufficient to keep - the net-ns active. This involves allowing the NFSD's net-ns exit - code to iterate all active clients and clear their ->net pointers - (which are needed to find the per-cpu-refcount for the nfsd_serv). - - Details: - - - Embed nfs_uuid_t in nfs_client. nfs_uuid_t provides a list_head - that can be used to find the client. It does add the 16-byte - uuid_t to nfs_client so it is bigger than needed (given that - uuid_t is only used during the initial NFS client and server - LOCALIO handshake to determine if they are local to each other). - If that is really a problem we can find a fix. - - - When the nfs server confirms that the uuid_t is local, it moves - the nfs_uuid_t onto a per-net-ns list in NFSD's nfsd_net. - - - When each server's net-ns is shutting down - in a "pre_exit" - handler, all these nfs_uuid_t have their ->net cleared. There is - an rcu_synchronize() call between pre_exit() handlers and exit() - handlers so any caller that sees nfs_uuid_t ->net as not NULL can - safely manage the per-cpu-refcount for nfsd_serv. - - - The client's nfs_uuid_t is passed to nfsd_open_local_fh() so it - can safely dereference ->net in a private rcu_read_lock() section - to allow safe access to the associated nfsd_net and nfsd_serv. - -So LOCALIO required the introduction and use of NFSD's percpu_ref to -interlock nfsd_destroy_serv() and nfsd_open_local_fh(), to ensure each -nn->nfsd_serv is not destroyed while in use by nfsd_open_local_fh(), and +allow proper network namespace (net-ns) and NFSD object refcounting. + +LOCALIO required the introduction and use of NFSD's percpu nfsd_net_ref +to interlock nfsd_shutdown_net() and nfsd_open_local_fh(), to ensure +each net-ns is not destroyed while in use by nfsd_open_local_fh(), and warrants a more detailed explanation: - nfsd_open_local_fh() uses nfsd_serv_try_get() before opening its + nfsd_open_local_fh() uses nfsd_net_try_get() before opening its nfsd_file handle and then the caller (NFS client) must drop the - reference for the nfsd_file and associated nn->nfsd_serv using - nfs_file_put_local() once it has completed its IO. + reference for the nfsd_file and associated net-ns using + nfsd_file_put_local() once it has completed its IO. This interlock working relies heavily on nfsd_open_local_fh() being afforded the ability to safely deal with the possibility that the NFSD's net-ns (and nfsd_net by association) may have been destroyed - by nfsd_destroy_serv() via nfsd_shutdown_net() -- which is only - possible given the nfs_uuid_t ->net pointer managemenet detailed - above. - -All told, this elaborate interlock of the NFS client and server has been -verified to fix an easy to hit crash that would occur if an NFSD -instance running in a container, with a LOCALIO client mounted, is -shutdown. Upon restart of the container and associated NFSD the client -would go on to crash due to NULL pointer dereference that occurred due -to the LOCALIO client's attempting to nfsd_open_local_fh(), using -nn->nfsd_serv, without having a proper reference on nn->nfsd_serv. + by nfsd_destroy_serv() via nfsd_shutdown_net(). + +This interlock of the NFS client and server has been verified to fix an +easy to hit crash that would occur if an NFSD instance running in a +container, with a LOCALIO client mounted, is shutdown. Upon restart of +the container and associated NFSD, the client would go on to crash due +to NULL pointer dereference that occurred due to the LOCALIO client's +attempting to nfsd_open_local_fh() without having a proper reference on +NFSD's net-ns. NFS Client issues IO instead of Server ======================================
@@ -308,16 +274,19 @@ fs/nfs/localio.c:nfs_local_commit(). With normal NFS that makes use of RPC to issue IO to the server, if an application uses O_DIRECT the NFS client will bypass the pagecache but -the NFS server will not. Because the NFS server's use of buffered IO -affords applications to be less precise with their alignment when -issuing IO to the NFS client. LOCALIO can be configured to use O_DIRECT -semantics by setting the 'localio_O_DIRECT_semantics' nfs module +the NFS server will not. The NFS server's use of buffered IO affords +applications to be less precise with their alignment when issuing IO to +the NFS client. But if all applications properly align their IO, LOCALIO +can be configured to use end-to-end O_DIRECT semantics from the NFS +client to the underlying local filesystem, that it is sharing with +the NFS server, by setting the 'localio_O_DIRECT_semantics' nfs module parameter to Y, e.g.: - echo Y > /sys/module/nfs/parameters/localio_O_DIRECT_semantics + echo Y > /sys/module/nfs/parameters/localio_O_DIRECT_semantics -Once enabled, it will cause LOCALIO to use O_DIRECT semantics (this may -cause IO to fail if applications do not properly align their IO). +Once enabled, it will cause LOCALIO to use end-to-end O_DIRECT semantics +(but again, this may cause IO to fail if applications do not properly +align their IO). Security ========
fs/nfs_common/nfslocalio.c +7 -3
@@ -128,6 +128,10 @@ void nfs_uuid_invalidate_one_client(nfs_uuid_t *nfs_uuid) }EXPORT_SYMBOL_GPL (nfs_uuid_invalidate_one_client); +/* +* Caller is responsible for calling nfsd_net_put and +* nfsd_file_put (via nfs_to_nfsd_file_put_local). +*/ struct nfsd_file *nfs_open_local_fh (nfs_uuid_t *uuid,struct rpc_clnt *rpc_clnt,const struct cred *cred,const struct nfs_fh *nfs_fh,const fmode_t fmode)
@@ -139,7 +143,7 @@ struct nfsd_file *nfs_open_local_fh(nfs_uuid_t *uuid,* Not running in nfsd context, so must safely get reference on nfsd_serv. * But the server may already be shutting down, if so disallow new localio. * uuid->net is NOT a counted reference, but rcu_read_lock() ensures that -* if uuid->net is not NULL, then calling nfsd_serv_try_get() is safe +* if uuid->net is not NULL, then calling nfsd_net_try_get() is safe * and if it succeeds we will have an implied reference to the net. * * Otherwise NFS may not have ref on NFSD and therefore cannot safely
@@ -147,12 +151,12 @@ struct nfsd_file *nfs_open_local_fh(nfs_uuid_t *uuid,*/ rcu_read_lock (); net =rcu_dereference (uuid->net); -if (!net || !nfs_to->nfsd_serv_try_get (net)) { +if (!net || !nfs_to->nfsd_net_try_get (net)) {rcu_read_unlock ();return ERR_PTR (-ENXIO ); }rcu_read_unlock (); -/* We have an implied reference to net thanks to nfsd_serv_try_get */ +/* We have an implied reference to net thanks to nfsd_net_try_get */ localio = nfs_to->nfsd_open_local_fh (net, uuid->dom, rpc_clnt, cred, nfs_fh, fmode);if (IS_ERR (localio))
fs/nfsd/filecache.c +1 -1
@@ -391,7 +391,7 @@ nfsd_file_put(struct nfsd_file *nf) }/** -* nfsd_file_put_local - put nfsd_file reference and arm nfsd_serv_put in caller +* nfsd_file_put_local - put nfsd_file reference and arm nfsd_net_put in caller * @nf: nfsd_file of which to put the reference * * First save the associated net to return to caller, then put
fs/nfsd/localio.c +2 -2
@@ -25,8 +25,8 @@#include "cache.h" static const struct nfsd_localio_operations nfsd_localio_ops = { - .nfsd_serv_try_get = nfsd_serv_try_get, - .nfsd_serv_put = nfsd_serv_put, + .nfsd_net_try_get = nfsd_net_try_get, + .nfsd_net_put = nfsd_net_put, .nfsd_open_local_fh = nfsd_open_local_fh, .nfsd_file_put_local = nfsd_file_put_local, .nfsd_file_file = nfsd_file_file,
fs/nfsd/netns.h +6 -5
@@ -140,9 +140,10 @@ struct nfsd_net {struct svc_info nfsd_info;#define nfsd_serv nfsd_info.serv -struct percpu_ref nfsd_serv_ref; -struct completion nfsd_serv_confirm_done; -struct completion nfsd_serv_free_done; + +struct percpu_ref nfsd_net_ref; +struct completion nfsd_net_confirm_done; +struct completion nfsd_net_free_done;/* * clientid and stateid data for construction of net unique COPY
@@ -229,8 +230,8 @@ struct nfsd_net {extern bool nfsd_support_version (int vers);extern unsigned int nfsd_net_id; -bool nfsd_serv_try_get (struct net *net); -void nfsd_serv_put (struct net *net); +bool nfsd_net_try_get (struct net *net); +void nfsd_net_put (struct net *net);void nfsd_copy_write_verifier (__be32 verf[2 ],struct nfsd_net *nn);void nfsd_reset_write_verifier (struct nfsd_net *nn);
fs/nfsd/nfssvc.c +17 -17
@@ -214,32 +214,32 @@ int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op changereturn 0 ; } -bool nfsd_serv_try_get (struct net *net)__must_hold (rcu) +bool nfsd_net_try_get (struct net *net)__must_hold (rcu) {struct nfsd_net *nn =net_generic (net, nfsd_net_id); -return (nn &&percpu_ref_tryget_live (&nn->nfsd_serv_ref)); +return (nn &&percpu_ref_tryget_live (&nn->nfsd_net_ref)); } -void nfsd_serv_put (struct net *net)__must_hold (rcu) +void nfsd_net_put (struct net *net)__must_hold (rcu) {struct nfsd_net *nn =net_generic (net, nfsd_net_id); -percpu_ref_put (&nn->nfsd_serv_ref); +percpu_ref_put (&nn->nfsd_net_ref); } -static void nfsd_serv_done (struct percpu_ref *ref) +static void nfsd_net_done (struct percpu_ref *ref) { - struct nfsd_net *nn = container_of(ref, struct nfsd_net, nfsd_serv_ref); + struct nfsd_net *nn = container_of(ref, struct nfsd_net, nfsd_net_ref); -complete (&nn->nfsd_serv_confirm_done); +complete (&nn->nfsd_net_confirm_done); } -static void nfsd_serv_free (struct percpu_ref *ref) +static void nfsd_net_free (struct percpu_ref *ref) { - struct nfsd_net *nn = container_of(ref, struct nfsd_net, nfsd_serv_ref); + struct nfsd_net *nn = container_of(ref, struct nfsd_net, nfsd_net_ref); -complete (&nn->nfsd_serv_free_done); +complete (&nn->nfsd_net_free_done); }/*
@@ -437,8 +437,8 @@ static void nfsd_shutdown_net(struct net *net)if (!nn->nfsd_net_up)return ; -percpu_ref_kill_and_confirm (&nn->nfsd_serv_ref, nfsd_serv_done); -wait_for_completion (&nn->nfsd_serv_confirm_done); +percpu_ref_kill_and_confirm (&nn->nfsd_net_ref, nfsd_net_done); +wait_for_completion (&nn->nfsd_net_confirm_done);nfsd_export_flush (net);nfs4_state_shutdown_net (net);
@@ -449,8 +449,8 @@ static void nfsd_shutdown_net(struct net *net) nn->lockd_up = false; } -wait_for_completion (&nn->nfsd_serv_free_done); -percpu_ref_exit (&nn->nfsd_serv_ref); +wait_for_completion (&nn->nfsd_net_free_done); +percpu_ref_exit (&nn->nfsd_net_ref); nn->nfsd_net_up = false;nfsd_shutdown_generic ();
@@ -654,12 +654,12 @@ int nfsd_create_serv(struct net *net)if (nn->nfsd_serv)return 0 ; - error =percpu_ref_init (&nn->nfsd_serv_ref, nfsd_serv_free, + error =percpu_ref_init (&nn->nfsd_net_ref, nfsd_net_free,0 ,GFP_KERNEL );if (error)return error; -init_completion (&nn->nfsd_serv_free_done); -init_completion (&nn->nfsd_serv_confirm_done); +init_completion (&nn->nfsd_net_free_done); +init_completion (&nn->nfsd_net_confirm_done);if (nfsd_max_blksize ==0 ) nfsd_max_blksize =nfsd_get_default_max_blksize ();
include/linux/nfslocalio.h +6 -6
@@ -47,8 +47,8 @@ nfsd_open_local_fh(struct net *, struct auth_domain *, struct rpc_clnt *, const fmode_t) __must_hold(rcu);struct nfsd_localio_operations { -bool (*nfsd_serv_try_get)(struct net *); -void (*nfsd_serv_put)(struct net *); +bool (*nfsd_net_try_get)(struct net *); +void (*nfsd_net_put)(struct net *); struct nfsd_file *(*nfsd_open_local_fh)(struct net *, struct auth_domain *, struct rpc_clnt *,
@@ -69,12 +69,12 @@ struct nfsd_file *nfs_open_local_fh(nfs_uuid_t *,static inline void nfs_to_nfsd_net_put (struct net *net) {/* -* Once reference to nfsd_serv is dropped, NFSD could be -* unloaded, so ensure safe return from nfsd_file_put_local() -* by always taking RCU. +* Once reference to net (and associated nfsd_serv) is dropped, NFSD +* could be unloaded, so ensure safe return from nfsd_net_put() by +* always taking RCU. */ rcu_read_lock (); - nfs_to->nfsd_serv_put (net); + nfs_to->nfsd_net_put (net);rcu_read_unlock (); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 118/567 nfsd: fix memory leak in nfsd_create_serv error paths
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shardul Bankar <[email protected]>
[ Upstream commit df8d829bba3adcf3cc744c01d933b6fd7cf06e91 ]
When nfsd_create_serv() calls percpu_ref_init() to initialize nn->nfsd_net_ref, it allocates both a percpu reference counter and a percpu_ref_data structure (64 bytes). However, if the function fails later due to svc_create_pooled() returning NULL or svc_bind() returning an error, these allocations are not cleaned up, resulting in a memory leak.
The leak manifests as:
- Unreferenced percpu allocation (8 bytes per CPU)
- Unreferenced percpu_ref_data structure (64 bytes)
Fix this by adding percpu_ref_exit() calls in both error paths to properly clean up the percpu_ref_init() allocations.
This patch fixes the percpu_ref leak in nfsd_create_serv() seen as an auxiliary leak in syzbot report 099461f8558eb0a1f4f3; the prepare_creds() and vsock-related leaks in the same report remain to be addressed separately.
--- fs/nfsd/nfssvc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/nfsd/nfssvc.c +4 -1
@@ -667,13 +667,16 @@ int nfsd_create_serv(struct net *net) serv =svc_create_pooled (nfsd_programs,ARRAY_SIZE (nfsd_programs), &nn->nfsd_svcstats, nfsd_max_blksize, nfsd); -if (serv ==NULL ) +if (serv ==NULL ) { +percpu_ref_exit (&nn->nfsd_net_ref);return -ENOMEM ; + } serv->sv_maxconn = nn->max_connections; error =svc_bind (serv, net);if (error <0 ) {svc_destroy (&serv); +percpu_ref_exit (&nn->nfsd_net_ref);return error; }spin_lock (&nfsd_notifier_lock);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 119/567 ipmi: Fix the race between __scan_channels() and deliver_response()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinhui Guo <[email protected]>
[ Upstream commit 936750fdba4c45e13bbd17f261bb140dd55f5e93 ]
The race window between __scan_channels() and deliver_response() causes the parameters of some channels to be set to 0.
1.[CPUA] __scan_channels() issues an IPMI request and waits with
wait_event() until all channels have been scanned. wait_event() internally calls might_sleep(), which might yield the CPU. (Moreover, an interrupt can preempt wait_event() and force the task to yield the CPU.)
2.[CPUB] deliver_response() is invoked when the CPU receives the
IPMI response. After processing a IPMI response, deliver_response() directly assigns intf->wchannels to intf->channel_list and sets intf->channels_ready to true. However, not all channels are actually ready for use.
3.[CPUA] Since intf->channels_ready is already true, wait_event()
never enters __wait_event(). __scan_channels() immediately clears intf->null_user_handler and exits.
4.[CPUB] Once intf->null_user_handler is set to NULL, deliver_response()
ignores further IPMI responses, leaving the remaining channels zero-initialized and unusable.
CPUA CPUB
------------------------------- ----------------------------- __scan_channels()
intf->null_user_handler
= channel_handler;
send_channel_info_cmd(intf,
0);
wait_event(intf->waitq,
intf->channels_ready);
do {
might_sleep();
deliver_response()
channel_handler()
intf->channel_list =
intf->wchannels + set;
intf->channels_ready = true;
send_channel_info_cmd(intf,
intf->curr_channel);
if (condition)
break;
__wait_event(wq_head,
condition);
} while(0)
intf->null_user_handler
= NULL;
deliver_response()
if (!msg->user)
if (intf->null_user_handler)
rv = -EINVAL;
return rv;------------------------------- -----------------------------
Fix the race between __scan_channels() and deliver_response() by deferring both the assignment intf->channel_list = intf->wchannels and the flag intf->channels_ready = true until all channels have been successfully scanned or until the IPMI request has failed.
Message-ID: <[email protected]>
--- drivers/char/ipmi/ipmi_msghandler.c | 2 -- 1 file changed, 2 deletions(-)
drivers/char/ipmi/ipmi_msghandler.c +0 -2
@@ -3414,8 +3414,6 @@ channel_handler(struct ipmi_smi *intf, struct ipmi_recv_msg *msg) intf->channels_ready = true;wake_up (&intf->waitq); }else { - intf->channel_list = intf->wchannels + set; - intf->channels_ready = true; rv =send_channel_info_cmd (intf, intf->curr_channel); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 120/567 ipmi: Fix __scan_channels() failing to rescan channels
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinhui Guo <[email protected]>
[ Upstream commit 6bd30d8fc523fb880b4be548e8501bc0fe8f42d4 ]
channel_handler() sets intf->channels_ready to true but never clears it, so __scan_channels() skips any rescan. When the BMC firmware changes a rescan is required. Allow it by clearing the flag before starting a new scan.
Message-ID: <[email protected]>
--- drivers/char/ipmi/ipmi_msghandler.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/char/ipmi/ipmi_msghandler.c +13 -5
@@ -613,7 +613,8 @@ static void __ipmi_bmc_unregister(struct ipmi_smi *intf);static int __ipmi_bmc_register (struct ipmi_smi *intf,struct ipmi_device_id *id,bool guid_set,guid_t *guid,int intf_num); -static int __scan_channels (struct ipmi_smi *intf,struct ipmi_device_id *id); +static int __scan_channels (struct ipmi_smi *intf, +struct ipmi_device_id *id,bool rescan);/*
@@ -2665,7 +2666,7 @@ static int __bmc_get_device_id(struct ipmi_smi *intf, struct bmc_device *bmc,if (__ipmi_bmc_register (intf, &id, guid_set, &guid, intf_num))need_waiter (intf);/* Retry later on an error. */ else -__scan_channels (intf, &id); +__scan_channels (intf, &id, false);if (!intf_set) {
@@ -2685,7 +2686,7 @@ static int __bmc_get_device_id(struct ipmi_smi *intf, struct bmc_device *bmc, goto out_noprocessing; }else if (memcmp (&bmc->fetch_id, &bmc->id,sizeof (bmc->id)))/* Version info changes, scan the channels again. */ -__scan_channels (intf, &bmc->fetch_id); +__scan_channels (intf, &bmc->fetch_id, true); bmc->dyn_id_expiry = jiffies +IPMI_DYN_DEV_ID_EXPIRY ;
@@ -3435,10 +3436,17 @@ channel_handler(struct ipmi_smi *intf, struct ipmi_recv_msg *msg)/* * Must be holding intf->bmc_reg_mutex to call this. */ -static int __scan_channels (struct ipmi_smi *intf,struct ipmi_device_id *id) +static int __scan_channels (struct ipmi_smi *intf, +struct ipmi_device_id *id, +bool rescan) {int rv; +if (rescan) { +/* Clear channels_ready to force channels rescan. */ + intf->channels_ready = false; + } +if (ipmi_version_major (id) >1 || (ipmi_version_major (id) ==1 &&ipmi_version_minor (id) >=5 )) {
@@ -3640,7 +3648,7 @@ int ipmi_add_smi(struct module *owner, }mutex_lock (&intf->bmc_reg_mutex); - rv =__scan_channels (intf, &id); + rv =__scan_channels (intf, &id, false);mutex_unlock (&intf->bmc_reg_mutex);if (rv) goto out_err_bmc_reg;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 121/567 scsi: ufs: host: mediatek: Fix shutdown/suspend race condition
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <[email protected]>
[ Upstream commit 014de20bb36ba03e0e0b0a7e0a1406ab900c9fda ]
Address a race condition between shutdown and suspend operations in the UFS Mediatek driver. Before entering suspend, check if a shutdown is in progress to prevent conflicts and ensure system stability.
--- drivers/ufs/host/ufs-mediatek.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/ufs/host/ufs-mediatek.c +5 -0
@@ -1994,6 +1994,11 @@ static int ufs_mtk_system_suspend(struct device *dev)struct arm_smccc_res res;int ret; +if (hba->shutting_down) { + ret = -EBUSY ; + goto out; + } + ret =ufshcd_system_suspend (dev);if (ret) goto out;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 122/567 firmware: imx: scu-irq: Init workqueue before request mbox channel
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <[email protected]>
[ Upstream commit 81fb53feb66a3aefbf6fcab73bb8d06f5b0c54ad ]
With mailbox channel requested, there is possibility that interrupts may come in, so need to make sure the workqueue is initialized before the queue is scheduled by mailbox rx callback.
--- drivers/firmware/imx/imx-scu-irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/imx/imx-scu-irq.c +2 -2
@@ -214,6 +214,8 @@ int imx_scu_enable_general_irq_channel(struct device *dev) cl->dev = dev; cl->rx_callback = imx_scu_irq_callback; +INIT_WORK (&imx_sc_irq_work, imx_scu_irq_work_handler); +/* SCU general IRQ uses general interrupt channel 3 */ ch =mbox_request_channel_byname (cl,"gip3" );if (IS_ERR (ch)) {
@@ -223,8 +225,6 @@ int imx_scu_enable_general_irq_channel(struct device *dev)return ret; } -INIT_WORK (&imx_sc_irq_work, imx_scu_irq_work_handler); -if (!of_parse_phandle_with_args (dev->of_node,"mboxes" ,"#mbox-cells" ,0 , &spec)) { i =of_alias_get_id (spec.np,"mu" );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 123/567 ti-sysc: allow OMAP2 and OMAP4 timers to be reserved on AM33xx
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Schiffer <[email protected]>
[ Upstream commit 3f61783920504b2cf99330b372d82914bb004d8e ]
am33xx.dtsi has the same clock setup as am35xx.dtsi, setting ti,no-reset-on-init and ti,no-idle on timer1_target and timer2_target, so AM33 needs the same workaround as AM35 to avoid ti-sysc probe failing on certain target modules.
--- drivers/bus/ti-sysc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/bus/ti-sysc.c +9 -2
@@ -48,6 +48,7 @@ enum sysc_soc {SOC_UNKNOWN ,SOC_2420 ,SOC_2430 , +SOC_AM33 ,SOC_3430 ,SOC_AM35 , SOC_3630,
@@ -2896,6 +2897,7 @@ static void ti_sysc_idle(struct work_struct *work)static const struct soc_device_attribute sysc_soc_match[] = {SOC_FLAG ("OMAP242*" ,SOC_2420 ),SOC_FLAG ("OMAP243*" ,SOC_2430 ), +SOC_FLAG ("AM33*" ,SOC_AM33 ),SOC_FLAG ("AM35*" ,SOC_AM35 ),SOC_FLAG ("OMAP3[45]*" ,SOC_3430 ),SOC_FLAG ("OMAP3[67]*" ,SOC_3630 ),
@@ -3101,10 +3103,15 @@ static int sysc_check_active_timer(struct sysc *ddata)* can be dropped if we stop supporting old beagleboard revisions * A to B4 at some point. */ -if (sysc_soc->soc ==SOC_3430 || sysc_soc->soc ==SOC_AM35 ) +switch (sysc_soc->soc) { +case SOC_AM33 : +case SOC_3430 : +case SOC_AM35 : error = -ENXIO ; -else +break ; +default : error = -EBUSY ; + }if ((ddata->cfg.quirks &SYSC_QUIRK_NO_RESET_ON_INIT ) && (ddata->cfg.quirks &SYSC_QUIRK_NO_IDLE ))
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 124/567 scsi: smartpqi: Add support for Hurray Data new controller PCI device
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Strahan <[email protected]>
[ Upstream commit 48e6b7e708029cea451e53a8c16fc8c16039ecdc ]
Add support for new Hurray Data controller.
All entries are in HEX.
Add PCI IDs for Hurray Data controllers:
VID / DID / SVID / SDID
---- ---- ---- ----
9005 028f 207d 4840--- drivers/scsi/smartpqi/smartpqi_init.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/smartpqi/smartpqi_init.c +4 -0
@@ -10091,6 +10091,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x207d ,0x4240 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x207d ,0x4840 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_VENDOR_ID_ADVANTECH ,0x8312 )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 125/567 clk: mvebu: cp110 add CLK_IGNORE_UNUSED to pcie_x10, pcie_x11 & pcie_x4
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josua Mayer <[email protected]>
[ Upstream commit f0e6bc0c3ef4b4afb299bd6912586cafd5d864e9 ]
CP110 based platforms rely on the bootloader for pci port initialization.
TF-A actively prevents non-uboot re-configuration of pci lanes, and many boards do not have software control over the pci card reset.
If a pci port had link at boot-time and the clock is stopped at a later point, the link fails and can not be recovered.
PCI controller driver probe - and by extension ownership of a driver for the pci clocks - may be delayed especially on large modular kernels, causing the clock core to start disabling unused clocks.
Add the CLK_IGNORE_UNUSED flag to the three pci port's clocks to ensure they are not stopped before the pci controller driver has taken ownership and tested for an existing link.
This fixes failed pci link detection when controller driver probes late, e.g. with arm64 defconfig and CONFIG_PHY_MVEBU_CP110_COMPHY=m.
--- drivers/clk/mvebu/cp110-system-controller.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/clk/mvebu/cp110-system-controller.c +20 -0
@@ -110,6 +110,25 @@ static const char * const gate_base_names[] = { [CP110_GATE_EIP197 ] ="eip197" }; +static unsigned long gate_flags (const u8 bit_idx) +{ +switch (bit_idx) { +case CP110_GATE_PCIE_X1_0 : +case CP110_GATE_PCIE_X1_1 : +case CP110_GATE_PCIE_X4 : +/* +* If a port had an active link at boot time, stopping +* the clock creates a failed state from which controller +* driver can not recover. +* Prevent stopping this clock till after a driver has taken +* ownership. +*/ +return CLK_IGNORE_UNUSED ; +default : +return 0 ; + } +}; +struct cp110_gate_clk {struct clk_hw hw;struct regmap *regmap;
@@ -171,6 +190,7 @@ static struct clk_hw *cp110_register_gate(const char *name, init.ops = &cp110_gate_ops; init.parent_names = &parent_name; init.num_parents =1 ; + init.flags =gate_flags (bit_idx); gate->regmap = regmap; gate->bit_idx = bit_idx;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 126/567 powerpc/addnote: Fix overflow on 32-bit builds
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Collins <[email protected]>
[ Upstream commit 825ce89a3ef17f84cf2c0eacfa6b8dc9fd11d13f ]
The PUT_64[LB]E() macros need to cast the value to unsigned long long like the GET_64[LB]E() macros. Caused lots of warnings when compiled on 32-bit, and clobbered addresses (36-bit P4080).
--- arch/powerpc/boot/addnote.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/powerpc/boot/addnote.c +4 -3
@@ -68,8 +68,8 @@ static int e_class = ELFCLASS32;#define PUT_16BE (off, v)(buf[off] = ((v) >> 8) & 0xff, \ buf[(off) + 1] = (v) & 0xff)#define PUT_32BE (off, v)(PUT_16BE((off), (v) >> 16L), PUT_16BE((off) + 2, (v))) -#define PUT_64BE (off, v)((PUT_32BE((off), (v) >> 32L), \ - PUT_32BE((off) + 4, (v)))) +#define PUT_64BE (off, v)((PUT_32BE((off), (unsigned long long)(v) >> 32L), \ + PUT_32BE((off) + 4, (unsigned long long)(v))))#define GET_16LE (off) ((buf[off]) + (buf[(off)+1] << 8))#define GET_32LE (off) (GET_16LE(off) + (GET_16LE((off)+2U) << 16U))
@@ -78,7 +78,8 @@ static int e_class = ELFCLASS32;#define PUT_16LE (off, v) (buf[off] = (v) & 0xff, \ buf[(off) + 1] = ((v) >> 8) & 0xff)#define PUT_32LE (off, v) (PUT_16LE((off), (v)), PUT_16LE((off) + 2, (v) >> 16L)) -#define PUT_64LE (off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L)) +#define PUT_64LE (off, v) (PUT_32LE((off), (unsigned long long)(v)), \ + PUT_32LE((off) + 4, (unsigned long long)(v) >> 32L))#define GET_16 (off) (e_data == ELFDATA2MSB ? GET_16BE(off) : GET_16LE(off))#define GET_32 (off) (e_data == ELFDATA2MSB ? GET_32BE(off) : GET_32LE(off))
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 127/567 scsi: qla2xxx: Fix lost interrupts with qlini_mode=disabled
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Battersby <[email protected]>
[ Upstream commit 4f6aaade2a22ac428fa99ed716cf2b87e79c9837 ]
When qla2xxx is loaded with qlini_mode=disabled, ha->flags.disable_msix_handshake is used before it is set, resulting in the wrong interrupt handler being used on certain HBAs (qla2xxx_msix_rsp_q_hs() is used when qla2xxx_msix_rsp_q() should be used). The only difference between these two interrupt handlers is that the _hs() version writes to a register to clear the "RISC" interrupt, whereas the other version does not. So this bug results in the RISC interrupt being cleared when it should not be. This occasionally causes a different interrupt handler qla24xx_msix_default() for a different vector to see ((stat & HSRX_RISC_INT) == 0) and ignore its interrupt, which then causes problems like:
qla2xxx [0000:02:00.0]-d04c:6: MBX Command timeout for cmd 20,
iocontrol=8 jiffies=1090c0300 mb[0-3]=[0x4000 0x0 0x40 0xda] mb7 0x500 host_status 0x40000010 hccr 0x3f00
qla2xxx [0000:02:00.0]-101e:6: Mailbox cmd timeout occurred, cmd=0x20,
mb[0]=0x20. Scheduling ISP abort
(the cmd varies; sometimes it is 0x20, 0x22, 0x54, 0x5a, 0x5d, or 0x6a)
This problem can be reproduced with a 16 or 32 Gbps HBA by loading qla2xxx with qlini_mode=disabled and running a high IOPS test while triggering frequent RSCN database change events.
While analyzing the problem I discovered that even with disable_msix_handshake forced to 0, it is not necessary to clear the RISC interrupt from qla2xxx_msix_rsp_q_hs() (more below). So just completely remove qla2xxx_msix_rsp_q_hs() and the logic for selecting it, which also fixes the bug with qlini_mode=disabled.
The test below describes the justification for not needing qla2xxx_msix_rsp_q_hs():
Force disable_msix_handshake to 0:qla24xx_config_rings():
if (0 && (ha->fw_attributes & BIT_6) && (IS_MSIX_NACK_CAPABLE(ha)) &&
(ha->flags.msix_enabled)) {In qla24xx_msix_rsp_q() and qla2xxx_msix_rsp_q_hs(), check:
(rd_reg_dword(®->host_status) & HSRX_RISC_INT)
Count the number of calls to each function with HSRX_RISC_INT set and the number with HSRX_RISC_INT not set while performing some I/O.
If qla2xxx_msix_rsp_q_hs() clears the RISC interrupt (original code):
qla24xx_msix_rsp_q: 50% of calls have HSRX_RISC_INT set qla2xxx_msix_rsp_q_hs: 5% of calls have HSRX_RISC_INT set
(# of qla2xxx_msix_rsp_q_hs interrupts) =
(# of qla24xx_msix_rsp_q interrupts) * 3
If qla2xxx_msix_rsp_q_hs() does not clear the RISC interrupt (patched code):
qla24xx_msix_rsp_q: 100% of calls have HSRX_RISC_INT set qla2xxx_msix_rsp_q_hs: 9% of calls have HSRX_RISC_INT set
(# of qla2xxx_msix_rsp_q_hs interrupts) =
(# of qla24xx_msix_rsp_q interrupts) * 3
In the case of the original code, qla24xx_msix_rsp_q() was seeing HSRX_RISC_INT set only 50% of the time because qla2xxx_msix_rsp_q_hs() was clearing it when it shouldn't have been. In the patched code, qla24xx_msix_rsp_q() sees HSRX_RISC_INT set 100% of the time, which makes sense if that interrupt handler needs to clear the RISC interrupt (which it does). qla2xxx_msix_rsp_q_hs() sees HSRX_RISC_INT only 9% of the time, which is just overlap from the other interrupt during the high IOPS test.
Tested with SCST on:
QLE2742 FW:v9.08.02 (32 Gbps 2-port)
QLE2694L FW:v9.10.11 (16 Gbps 4-port)
QLE2694L FW:v9.08.02 (16 Gbps 4-port)
QLE2672 FW:v8.07.12 (16 Gbps 2-port)
both initiator and target mode
--- drivers/scsi/qla2xxx/qla_def.h | 1 - drivers/scsi/qla2xxx/qla_gbl.h | 2 +- drivers/scsi/qla2xxx/qla_isr.c | 32 +++----------------------------- drivers/scsi/qla2xxx/qla_mid.c | 4 +--- 4 files changed, 5 insertions(+), 34 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +0 -1
@@ -3503,7 +3503,6 @@ struct isp_operations {#define QLA_MSIX_RSP_Q 0x01#define QLA_ATIO_VECTOR 0x02#define QLA_MSIX_QPAIR_MULTIQ_RSP_Q 0x03 -#define QLA_MSIX_QPAIR_MULTIQ_RSP_Q_HS 0x04#define QLA_MIDX_DEFAULT 0#define QLA_MIDX_RSP_Q 1
drivers/scsi/qla2xxx/qla_gbl.h +1 -1
@@ -768,7 +768,7 @@ extern int qla2x00_dfs_remove(scsi_qla_host_t *);/* Globa function prototypes for multi-q */ extern int qla25xx_request_irq (struct qla_hw_data *,struct qla_qpair *, -struct qla_msix_entry *,int ); +struct qla_msix_entry *);extern int qla25xx_init_req_que (struct scsi_qla_host *,struct req_que *);extern int qla25xx_init_rsp_que (struct scsi_qla_host *,struct rsp_que *); extern int qla25xx_create_req_que(struct qla_hw_data *, uint16_t, uint8_t,
drivers/scsi/qla2xxx/qla_isr.c +3 -29
@@ -4467,32 +4467,6 @@ qla2xxx_msix_rsp_q(int irq, void *dev_id)return IRQ_HANDLED ; } -irqreturn_t -qla2xxx_msix_rsp_q_hs (int irq,void *dev_id) -{ -struct qla_hw_data *ha; -struct qla_qpair *qpair; -struct device_reg_24xx __iomem *reg; -unsigned long flags; - - qpair = dev_id; -if (!qpair) { -ql_log (ql_log_info,NULL ,0x505b , -"%s: NULL response queue pointer.\n" , __func__); -return IRQ_NONE ; - } - ha = qpair->hw; - - reg = &ha->iobase->isp24; -spin_lock_irqsave (&ha->hardware_lock, flags); -wrt_reg_dword (®->hccr,HCCRX_CLR_RISC_INT ); -spin_unlock_irqrestore (&ha->hardware_lock, flags); - -queue_work (ha->wq, &qpair->q_work); - -return IRQ_HANDLED ; -} -/* Interrupt handling helpers. */ struct qla_init_msix_entry {
@@ -4505,7 +4479,6 @@ static const struct qla_init_msix_entry msix_entries[] = { { "rsp_q", qla24xx_msix_rsp_q }, { "atio_q", qla83xx_msix_atio_q }, { "qpair_multiq", qla2xxx_msix_rsp_q }, - { "qpair_multiq_hs", qla2xxx_msix_rsp_q_hs }, }; static const struct qla_init_msix_entry qla82xx_msix_entries[] = {
@@ -4792,9 +4765,10 @@ qla2x00_free_irqs(scsi_qla_host_t *vha) }int qla25xx_request_irq (struct qla_hw_data *ha,struct qla_qpair *qpair, -struct qla_msix_entry *msix,int vector_type) +struct qla_msix_entry *msix) { -const struct qla_init_msix_entry *intr = &msix_entries[vector_type]; +const struct qla_init_msix_entry *intr = + &msix_entries[QLA_MSIX_QPAIR_MULTIQ_RSP_Q ];scsi_qla_host_t *vha =pci_get_drvdata (ha->pdev);int ret;
drivers/scsi/qla2xxx/qla_mid.c +1 -3
@@ -899,9 +899,7 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options, rsp->options, rsp->id, rsp->rsp_q_in, rsp->rsp_q_out); - ret =qla25xx_request_irq (ha, qpair, qpair->msix, - ha->flags.disable_msix_handshake ? -QLA_MSIX_QPAIR_MULTIQ_RSP_Q :QLA_MSIX_QPAIR_MULTIQ_RSP_Q_HS ); + ret =qla25xx_request_irq (ha, qpair, qpair->msix);if (ret) goto que_failed;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 128/567 scsi: qla2xxx: Fix initiator mode with qlini_mode=exclusive
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Battersby <[email protected]>
[ Upstream commit 8f58fc64d559b5fda1b0a5e2a71422be61e79ab9 ]
When given the module parameter qlini_mode=exclusive, qla2xxx in initiator mode is initially unable to successfully send SCSI commands to devices it finds while scanning, resulting in an escalating series of resets until an adapter reset clears the issue. Fix by checking the active mode instead of the module parameter.
--- drivers/scsi/qla2xxx/qla_os.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +1 -7
@@ -3456,13 +3456,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->mqenable =0 ;if (ha->mqenable) { -bool startit = false; - -if (QLA_TGT_MODE_ENABLED ()) - startit = false; - -if (ql2x_ini_mode ==QLA2XXX_INI_MODE_ENABLED ) - startit = true; +bool startit = !!(host->active_mode &MODE_INITIATOR );/* Create start of day qpairs for Block MQ */ for (i =0 ; i < ha->max_qpairs; i++)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 129/567 scsi: qla2xxx: Use reinit_completion on mbx_intr_comp
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Battersby <[email protected]>
[ Upstream commit 957aa5974989fba4ae4f807ebcb27f12796edd4d ]
If a mailbox command completes immediately after wait_for_completion_timeout() times out, ha->mbx_intr_comp could be left in an inconsistent state, causing the next mailbox command not to wait for the hardware. Fix by reinitializing the completion before use.
--- drivers/scsi/qla2xxx/qla_mbx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/qla2xxx/qla_mbx.c +2 -0
@@ -253,6 +253,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)/* Issue set host interrupt command to send cmd out. */ ha->flags.mbox_int =0 ;clear_bit (MBX_INTERRUPT , &ha->mbx_cmd_flags); +reinit_completion (&ha->mbx_intr_comp);/* Unlock mbx registers and wait for interrupt */ ql_dbg(ql_dbg_mbx, vha, 0x100f,
@@ -279,6 +280,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) "cmd=%x Timeout.\n", command);spin_lock_irqsave (&ha->hardware_lock, flags);clear_bit (MBX_INTR_WAIT , &ha->mbx_cmd_flags); +reinit_completion (&ha->mbx_intr_comp);spin_unlock_irqrestore (&ha->hardware_lock, flags);if (chip_reset != ha->chip_reset) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 130/567 fuse: Always flush the page cache before FOPEN_DIRECT_IO write
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernd Schubert <[email protected]>
[ Upstream commit 1ce120dcefc056ce8af2486cebbb77a458aad4c3 ]
This was done as condition on direct_io_allow_mmap, but I believe this is not right, as a file might be open two times - once with write-back enabled another time with FOPEN_DIRECT_IO.
--- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/file.c +1 -1
@@ -1582,7 +1582,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,if (!ia)return -ENOMEM ; -if (fopen_direct_io && fc->direct_io_allow_mmap) { +if (fopen_direct_io) { res =filemap_write_and_wait_range (mapping, pos, pos + count -1 );if (res) {fuse_io_free (ia);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 131/567 fuse: Invalidate the page cache after FOPEN_DIRECT_IO write
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernd Schubert <[email protected]>
[ Upstream commit b359af8275a982a458e8df6c6beab1415be1f795 ]
generic_file_direct_write() also does this and has a large comment about.
Reproducer here is xfstest's generic/209, which is exactly to have competing DIO write and cached IO read.
--- fs/fuse/file.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/fuse/file.c +9 -0
@@ -1656,6 +1656,15 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,if (res >0 ) *ppos = pos; +if (res >0 && write && fopen_direct_io) { +/* +* As in generic_file_direct_write(), invalidate after the +* write, to invalidate read-ahead cache that may have competed +* with the write. +*/ +invalidate_inode_pages2_range (mapping, idx_from, idx_to); + } +return res >0 ? res : err; }EXPORT_SYMBOL_GPL (fuse_direct_io);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 132/567 via_wdt: fix critical boot hang due to unnamed resource allocation
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Qiang <[email protected]>
[ Upstream commit 7aa31ee9ec92915926e74731378c009c9cc04928 ]
The VIA watchdog driver uses allocate_resource() to reserve a MMIO region for the watchdog control register. However, the allocated resource was not given a name, which causes the kernel resource tree to contain an entry marked as "<BAD>" under /proc/iomem on x86 platforms.
During boot, this unnamed resource can lead to a critical hang because subsequent resource lookups and conflict checks fail to handle the invalid entry properly.
--- drivers/watchdog/via_wdt.c | 1 + 1 file changed, 1 insertion(+)
drivers/watchdog/via_wdt.c +1 -0
@@ -165,6 +165,7 @@ static int wdt_probe(struct pci_dev *pdev,dev_err (&pdev->dev,"cannot enable PCI device\n" );return -ENODEV ; } + wdt_res.name ="via_wdt" ;/* * Allocate a MMIO region which contains watchdog control register
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 133/567 reset: fix BIT macro reference
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Encrow Thorne <[email protected]>
[ Upstream commit f3d8b64ee46c9b4b0b82b1a4642027728bac95b8 ]
RESET_CONTROL_FLAGS_BIT_* macros use BIT(), but reset.h does not include bits.h. This causes compilation errors when including reset.h standalone.
Include bits.h to make reset.h self-contained.
--- include/linux/reset.h | 1 + 1 file changed, 1 insertion(+)
include/linux/reset.h +1 -0
@@ -2,6 +2,7 @@#ifndef _LINUX_RESET_H_#define _LINUX_RESET_H_ +#include <linux/bits.h> #include <linux/err.h> #include <linux/errno.h> #include <linux/types.h>
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 134/567 exfat: fix remount failure in different process environments
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuezhang Mo <[email protected]>
[ Upstream commit 51fc7b4ce10ccab8ea5e4876bcdc42cf5202a0ef ]
The kernel test robot reported that the exFAT remount operation failed. The reason for the failure was that the process's umask is different between mount and remount, causing fs_fmask and fs_dmask are changed.
Potentially, both gid and uid may also be changed. Therefore, when initializing fs_context for remount, inherit these mount options from the options used during mount.
--- fs/exfat/super.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
fs/exfat/super.c +15 -4
@@ -801,10 +801,21 @@ static int exfat_init_fs_context(struct fs_context *fc)ratelimit_state_init (&sbi->ratelimit,DEFAULT_RATELIMIT_INTERVAL ,DEFAULT_RATELIMIT_BURST ); - sbi->options.fs_uid =current_uid (); - sbi->options.fs_gid =current_gid (); - sbi->options.fs_fmask = current->fs->umask; - sbi->options.fs_dmask = current->fs->umask; +if (fc->purpose ==FS_CONTEXT_FOR_RECONFIGURE && fc->root) { +struct super_block *sb = fc->root->d_sb; +struct exfat_mount_options *cur_opts = &EXFAT_SB (sb)->options; + + sbi->options.fs_uid = cur_opts->fs_uid; + sbi->options.fs_gid = cur_opts->fs_gid; + sbi->options.fs_fmask = cur_opts->fs_fmask; + sbi->options.fs_dmask = cur_opts->fs_dmask; + }else { + sbi->options.fs_uid =current_uid (); + sbi->options.fs_gid =current_gid (); + sbi->options.fs_fmask = current->fs->umask; + sbi->options.fs_dmask = current->fs->umask; + } + sbi->options.allow_utime =-1 ; sbi->options.iocharset = exfat_default_iocharset; sbi->options.errors =EXFAT_ERRORS_RO ;
Signature · 1 line
2.51.0