* [PATCH 6.6 0000/1167] 6.6.164-rc1 review
@ 2026-12-04 9:50 Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0001/1167] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
` (657 more replies)
0 siblings, 658 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
This is the start of the stable review cycle for the 6.6.164 release.
There are 1167 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 Sun, 06 Dec 2026 10:04:56 +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.6.164-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.6.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 6.6.164-rc1
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: intel_pstate: Use dedicated lock in set_power_ctl_ee_state()
Ruben Wauters <ruben.wauters@linux.dev>
drm/gud: fix potential divide error due to optimisation
Cooper Morgan <ext-github@cwooper.dev>
drm/amd/display: Saturate refresh rates in v1/v2 FreeSync infopackets
Christoph Hellwig <hch@lst.de>
direct-io: remove IOCB_NOWAIT support
Yaohan Li <shunsheng1218@gmail.com>
nvme: stop asynchronous event work before ANA teardown
Nathan Chancellor <nathan@kernel.org>
rcu/nocb: Avoid unsequenced accesses to jiffies in show_rcu_nocb_state()
Chris J Arges <carges@cloudflare.com>
net: prevent receive header offset overflow during decapsulation
Carlos Bilbao <carlos.bilbao@kernel.org>
scsi: target: iscsi: reject invalid size Extended CDB AHS
Nathan Chancellor <nathan@kernel.org>
mptcp: Avoid unsequenced accesses to jiffies in mptcp_reset_tout_timer()
Yu Kuai <yukuai3@huawei.com>
md: initialize 'active_io' while allocating mddev
Shuai Liu <847807867@qq.com>
xfrm: interface: drop non-IP packets before pskb_inet_may_pull()
Zhao Gongyi <zhaogongyi@bytedance.com>
ext4: fix OOB memmove in ext4_xattr_set_entry
Guicai Ma <maguicai@kylinos.cn>
KEYS: Use kfree_sensitive() in keyctl_pkey_e_d_s()
Jarkko Sakkinen <jarkko@kernel.org>
KEYS: trusted: Update static calls before init
Sinan Turunc <enscrpt@pm.me>
KEYS: serialise key instantiation against keyctl_chown_key()
Guicai Ma <maguicai@kylinos.cn>
KEYS: Fix userspace buffer overflow in keyctl_pkey_e_d_s()
Henry Martin <bsdhenrymartin@gmail.com>
KEYS: Fix crash on big_key read
Jarkko Sakkinen <jarkko@kernel.org>
KEYS: Fix asym key overflow in keyctl_pkey_verify()
Takashi Iwai <tiwai@suse.de>
ALSA: oss: Fix deadlock at unregistering (again)
Suyuan Wang <stevewong@hust.edu.cn>
ALSA: fireworks: Abort the transaction on a bus reset
Suyuan Wang <stevewong@hust.edu.cn>
ALSA: firewire-lib: Abort the FCP transaction on a bus reset
Vasileios Almpanis <vasilisalmpanis@gmail.com>
usb: gadget: f_uac1_legacy: fix double close of the ALSA devices
Dave Airlie <airlied@redhat.com>
i915/vma: use kfree_rcu to make sure vma are freed after a rcu grace period
Xu Rao <raoxu@uniontech.com>
vhost/net: Fix receive queue test in busy poll
Po-Hao Huang <phhuang@realtek.com>
wifi: rtw89: modify active scan rule for 6GHz band
Kuniyuki Iwashima <kuniyu@google.com>
ipv6: Flush exception route while replacing nexthop.
Kuniyuki Iwashima <kuniyu@google.com>
ipv6: Remove FIB6_EXCEPTION_BUCKET_FLUSHED.
Kuniyuki Iwashima <kuniyu@google.com>
ipv6: Prevent rt6_insert_exception() for dying fib6_info.
Christian Brauner <brauner@kernel.org>
fs: don't silently unmount busy mounts
Lingbo Kong <quic_lingbok@quicinc.com>
wifi: ath11k: modify the calculation of the average signal strength in station mode
Lingbo Kong <quic_lingbok@quicinc.com>
wifi: ath11k: fix ack signal strength calculation
Jamal Hadi Salim <jhs@mojatatu.com>
net/sched: codel: bound the dropping loop per dequeue call
Biren Pandya <birenpandya@gmail.com>
media: cec: disable delayed work before freeing an interrupted transmit
Breno Leitao <leitao@debian.org>
netpoll: fix a use-after-free on shutdown path
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: validate extension-frame layout before RX
David Carlier <devnexen@gmail.com>
tracing: Ignore .function on the function trace event
Steven Rostedt <rostedt@goodmis.org>
tracing: Do not allow user events to add a system name
Jaewon Jung <jaewon8868@gmail.com>
tracing: Avoid undefined shifts for zero histogram map size
Kyle Zeng <kylebot@openai.com>
tracing/filters: Treat zero-length dynamic strings as empty
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/filters: Handle out-of-range CPU for OP_NE in cpumask comparison
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/filters: Fix MATCH_END_ONLY regex matching for fixed-size strings
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/filters: Check for missing operand after operator in parse_pred()
David Carlier <devnexen@gmail.com>
tracing/user_events: Don't free an event that a dynamic event still references
Chaosheng Qu <chaosheng.qu.linux@gmail.com>
tracing/osnoise: Don't start a kthread in timerlat user-space mode
koraynilay <koray.fra@gmail.com>
smb: client: fix times assignments in cifs_posix_to_fattr()
koraynilay <koray.fra@gmail.com>
smb: client: fix negative timestamps being read from smb
Praneeth Balasubramanian <praneeth@ucsb.edu>
scsi: target: iscsi: Check for existing sessions only after authentication
Shao Mingyin <shao.mingyin@zte.com.cn>
scsi: target: Fix NULL pointer dereference in target_dev_alua_lu_gp_store()
Shao Mingyin <shao.mingyin@zte.com.cn>
scsi: target: Fix NULL pointer dereference in core_alua_do_port_transition()
Ciro Iriarte <ciro.iriarte+software@gmail.com>
scsi: target: core: Parse APTPL res_type and res_scope as hex
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet: zns: return the namespace lookup error for Identify
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet: use overflow-safe range checks in the file backend
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet: handle short reads and writes in the file backend
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet-tcp: only wait for in-capsule data for inline SGLs
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet-fc: reject duplicate queue IDs on Create Connection
Shao Mingyin <shao.mingyin@zte.com.cn>
nvme: reject invalid reconnect_delay sysfs values
Shao Mingyin <shao.mingyin@zte.com.cn>
nvme-tcp: require the R2T offset to match the data sent
Shao Mingyin <shao.mingyin@zte.com.cn>
nvme-loop: release the target request when SG setup fails
Shao Mingyin <shao.mingyin@zte.com.cn>
nvme-auth: use the parsed offset for the DH-CHAP key
Zxyan Zhu <zxyan0222@gmail.com>
net: stmmac: re-enable on-chip parity checkers for XGMAC ASP 0x2
Christian Schmidbauer <opensource@grische.xyz>
net: stmmac: honour Rx checksum errors in the AF_XDP zero-copy path
Christian Schmidbauer <opensource@grische.xyz>
net: stmmac: dwmac1000: don't discard frames with only a checksum error
Nathan Chancellor <nathan@kernel.org>
net: microchip: encx24j600: Avoid unsequenced accesses to jiffies in encx24j600_tx()
Anthony Pighin <anthony.pighin@nokia.com>
net: gianfar: clear the pending Rx skb when freeing the Rx ring
Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
net: e1000: fix warning in iounmap on probe failure
Daniel Wade <danjwade95@gmail.com>
net: bridge: fix skb leak of reinjected link-local frames
Daejun Park <daejun7.park@samsung.com>
xfs: wait for direct I/O before swapping extents
Daejun Park <daejun7.park@samsung.com>
xfs: break layouts before swapping extents
Ding Feng <dingf3ng@gmail.com>
zonefs: ignore RLIMIT_FSIZE above LLONG_MAX in zonefs_write_check_limits()
Krystian Kaniewski <krystianmkaniewski@gmail.com>
xarray: fix index jumping backwards in xas_find()
Adrian Schlegel <me@adrianschlegel.com>
x86/mce: Do not treat cache hierarchy errors as memory errors
WeitaoWang-oc <WeitaoWang-oc@zhaoxin.com>
x86/apic/msi: Fix MSI interrupt affinity configuration
Zhao Feng <zhaofeng2@cmss.chinamobile.com>
watchdog: npcm: fix sleeping clock call in restart handler
Matt Turner <mattst88@gmail.com>
vgacon: Fall back to the dummy console if mapping VGA memory fails
Juan Agustin Niccolini <juanagusnicco@gmail.com>
tcp: Fix the SO_REUSEPORT bind cache admitting a conflicting socket
Sebastian Reichel <sebastian.reichel@collabora.com>
spi: Fix runtime PM imbalance on pump transfer message error
Stephen Smalley <stephen.smalley.work@gmail.com>
selinux: check MAP_SHARED_VALIDATE mappings as shared
Yves Bieri <yves.bieri@theori.io>
sctp: do not free a new asoc peeled off while sendmsg slept
Cen Zhang <zzzccc427@gmail.com>
ocfs2: serialize inode journal access with shutdown
Cen Zhang <zzzccc427@gmail.com>
ocfs2: advance locking_state through the live cursor
Cen Zhang <zzzccc427@gmail.com>
ocfs2/dlmfs: keep the superblock alive during lock work
Karl Mehltretter <kmehltretter@gmail.com>
parisc: irq: Trace hardirq state in do_cpu_irq_mask()
Karl Mehltretter <kmehltretter@gmail.com>
parisc: Fix register corruption in 32-bit dynamic ftrace
Boyan Liu <yymhvert@gmail.com>
scsi: sd_zbc: Cap zone report count by buffer size
Shao Mingyin <shao.mingyin@zte.com.cn>
scsi: rdac: Keep the error status when controller lookup fails
Milan P. Gandhi <mgandhi@redhat.com>
scsi: mpi3mr: Validate reply frame size bounds
Jiale Yao <yaojiale02@163.com>
s390/dcssblk: Initialize device semaphore before sysfs registration
Gerald Schaefer <gerald.schaefer@linux.ibm.com>
s390/appldata: Fix error handling in appldata_generic_handler()
Bradley Morgan <brads@mainlining.org>
powerpc32/modules: Reserve a PLT entry for ftrace_regs_caller
Nathan Chancellor <nathan@kernel.org>
powerpc/xmon: Avoid unsequenced accesses to tsk in show_task()
Jiale Yao <yaojiale02@163.com>
powerpc/eeh: NUL-terminate force recovery input
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
RDMA/srpt: widen the indirect RDMA context counters
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
RDMA/srpt: reject zero-length buffer descriptors
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
RDMA/srpt: bound the indirect descriptor table to the IU
Deep Shah <deepshah146@gmail.com>
RDMA/siw: Fix use-after-free in siw_mem_id2obj()
Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
RDMA/mlx5: Fix DevX umem page size truncation for pages >= 4G
Nathan Chancellor <nathan@kernel.org>
qca_spi: Avoid unsequenced accesses to jiffies in qcaspi_netdev_tx_timeout()
Shrikanth Hegde <sshegde@linux.ibm.com>
PPC32: Fix hard_irq_disable to follow tracing and lockdep state
Ridong Chen <chenridong@xiaomi.com>
mm/migrate: move NR_FILE_THPS on cross-node migration
Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
mm/filemap: stop fault-around when the walk steps back
Aveline Noir <jm5905938@gmail.com>
mm/damon/core: reset watermark wait state on each iteration
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: XICS: Avoid NULL ptr deref in kvmppc_xive_cleanup_vcpu()
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: Take SRCU read lock around kvmppc_h_page_init() call
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: Ensure that calls to idr_alloc are synchronized
Amit Machhiwal <amachhiw@linux.ibm.com>
KVM: PPC: Book3S HV: Disable preemption around host-side HPT lock users
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit
Axel Mierczuk <axel.mierczuk@1password.com>
ipvs: validate cport in received sync records
Zihan Xi <zihanx@nebusec.ai>
ipvs: reject FTP control ports as data ports
Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
ipvs: ftp: skip conntrack templates in ip_vs_ftp_out
Jaeyeong Lee <lee@jaeyeong.cc>
net/tls: serialize context removal in tls_device_down()
Joas Antonio dos Santos <joasantonio108@gmail.com>
mac802154: llsec: reject secured frames with security level 0
Henry Martin <bsdhenrymartin@gmail.com>
ip6mr: prevent info-leak in ip6mr_cache_report()
Juan Parrado <jparrado.1817@gmail.com>
Input: xpad - add support to Hori Real Arcade Pro 4
Yuan Yao <yaoyuan0329os@gmail.com>
Input: trackpoint - add new TP JYT_NDT device variant id 7
Liu Chao <liuc63@xiaopeng.com>
Input: goodix - reject a bak_ref length that cannot hold the checksum
Ivan Verbovoy <ivanverbovoy@gmail.com>
Input: da7280 - do not advertise FF_GAIN
Wentao Liang <vulab@iscas.ac.cn>
Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate()
Ziheng Wei <zihengw03@163.com>
hwmon: (w83792d) Fix incorrect struct cast in show_temp1() and store_temp1()
Ziheng Wei <zihengw03@163.com>
hwmon: (w83791d) Fix incorrect struct cast in show_temp1() and store_temp1()
Wayne Ho <wayneho219@gmail.com>
hwmon: (sht3x) Fix overflow when writing alert limits
Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Fix tolerance bitmask when reading REG_FAN_MODE
Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Fix swapped temperature tolerance register writes
Ziheng Wei <zihengw03@163.com>
hwmon: (nct6775) Fix incorrect struct cast in beep callbacks
Rosen Penev <rosenp@gmail.com>
hwmon: (dell-smm) Reject out-of-range pwm values
Vítor Hugo Silva <vitorhg20080@gmail.com>
hwmon: (ads7871) Add error handle from spi_setup()
Xuanqiang Luo <luoxuanqiang@kylinos.cn>
iavf: fix ASQ command buffer leak on init failure
Sung Byeongchan <tjdqudcks0424@naver.com>
ieee802154: require CAP_NET_ADMIN for SIOCSIFADDR
Lianjie Wang <lian@is.s.u-tokyo.ac.jp>
gpio: virtio: compute the line names size in a size_t
Lianjie Wang <lian@is.s.u-tokyo.ac.jp>
gpio: virtio: bound the line names block by its configured size
Alexandre Becholey <alex@becholey.ch>
gpio: ljca: Validate the pin index of interrupt events
Junyoung Jang <graypanda.inzag@gmail.com>
fuse: skip dcache instantiation for readdirplus names with embedded NUL
Miklos Szeredi <mszeredi@redhat.com>
fuse: limit name size in listxattr
Miklos Szeredi <mszeredi@redhat.com>
fuse: fix possible UAF in fuse_direntplus_link()
Weiming Shi <bestswngs@gmail.com>
fbdev: vfb: Validate framebuffer geometry and memory size
Tim Douglas <me@timdoug.com>
fbdev: valkyriefb: keep the framebuffer mapping size fixed
Xue Haolin <xuehaolin@uniontech.com>
fbdev: sstfb: Error out if pixclock equals zero
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
fbdev: smscufx: keep the usb_device alive while ufx_data is in use
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
fbdev: smscufx: don't free registered framebuffer on probe error
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
fbdev: smscufx: allocate the size advertised in smem_len
Jianqiang Zou <jq.zou@outlook.com>
fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var()
Tim Douglas <me@timdoug.com>
fbdev: macmodes: compare the pixel clock of each candidate mode
Steffen A. Mork <linux-dev@morknet.de>
fbdev: fm2fb: Fix iomem access
Eric Biggers <ebiggers@kernel.org>
fscrypt: Initialize ->ci_master_key before publication
Aristeu Rozanski <aris@redhat.com>
EDAC/i5000: Fix slot number passed to determine_mtr()
Marek Szyprowski <m.szyprowski@samsung.com>
dma: swiotlb: Serialize restricted DMA pool initialization
Marek Szyprowski <m.szyprowski@samsung.com>
dma: swiotlb: Properly tear down the default pool on exit
Marek Szyprowski <m.szyprowski@samsung.com>
dma-coherent: serialize reserved memory pool initialization
Sumit Gupta <sumitg@nvidia.com>
cpufreq: CPPC: Set CPPC Enable register in cpu_init()
Xu Rao <raoxu@uniontech.com>
Bluetooth: MGMT: Fix runtime config status opcode
Joas Antonio dos Santos <joasantonio108@gmail.com>
Bluetooth: hci_qca: clear qca_memdump when discarding dump packets
Alex Kazinsky <a.kazinsky@ideco.ru>
blk-iocost: Fix overflow in donation weight calculation
Niklas Cassel <cassel@kernel.org>
ata: libata-scsi: fix the INC_512 bit test for SECURITY PROTOCOL IN/OUT
Chen Yuxi <chenyuxi19@huawei.com>
ASoC: wm8962: Fix broken headset button caused by wrong guard constant
yzddMr6 <yzddmr6@gmail.com>
ASoC: qcom: q6dsp-lpass-clocks: Set driver data before registering clocks
Julius Bairaktaris <julius@bairaktaris.de>
ASoC: qcom: q6asm-dai: reject compress rings larger than the DMA buffer
Julius Bairaktaris <julius@bairaktaris.de>
ASoC: qcom: q6apm-dai: reject compress rings larger than the DMA buffer
Marc Herrero <marcht@proton.me>
ASoC: qcom: audioreach: only disconnect the route a mixer control owns
Ben Cressey <ben@cressey.dev>
arm64: kexec: use a typed entry to fix kCFI oops
Vineet Gupta <vgupta@kernel.org>
ARC: io: work around GCC PR127718 in __raw_write{w,l}()
Ye Weihua <yeweihua4@huawei.com>
ALSA: pcm: oss: Restore params flag after failed reconfiguration
Aldo Ariel Panzardo <qwe.aldo@gmail.com>
drm/vmwgfx: close TOCTOU on guest_memory_bo in surface reference ioctl
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: validate command body sizes before parsing
Aldo Ariel Panzardo <qwe.aldo@gmail.com>
drm/vmwgfx: return an error when a shared GB surface has no backup buffer
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: log missing primary planes only once
Vladimir Popov <popov.nkv@gmail.com>
drm/vmwgfx: fix NULL pointer dereference in vmw_validation_bo_fence()
Aldo Ariel Panzardo <qwe.aldo@gmail.com>
drm/vmwgfx: do not hand the embedded sg_table to the PRIME core
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: bound MKSSTAT lengths before rounding to pages
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: avoid underflow when stripping short GuestInfo replies
Maíra Canal <mcanal@igalia.com>
drm/vc4: Start shader code at varying offsets in its BO
Maíra Canal <mcanal@igalia.com>
drm/vc4: Fix off-by-one in the shader record BO handle check
Maíra Canal <mcanal@igalia.com>
drm/vc4: Clear the slice caches before resetting a stalled GPU
Maíra Canal <mcanal@igalia.com>
drm/vc4: Check for a validated shader before reading its thread mode
Perry Yuan <perry.yuan@amd.com>
drm/amdkfd: check CRIU SVM priv data bounds before allocating
Jiaming Fan <fan.jiaming@hotmail.com>
drm/amdgpu: only unregister the ATPX handler if we registered it
David Rosca <david.rosca@amd.com>
drm/amdgpu: Fix VCE buffer size check for DPB and input surface
Andrei Krautsou <an9949an@gmail.com>
drm/amdgpu: enable MGCG/FGCG/PERF_CLK for GC 11.0.2
Jackie Liu <liuyun01@kylinos.cn>
drm/amd/display: Fix logger leak on perf trace allocation failure
Wang Jiang <jiangwang@kylinos.cn>
drm/amdgpu/gfx_v9_0: Add gfxoff quirk for Lenovo Picasso 318F
Joshua Horne <hornejd@etsu.edu>
drm/amd/pm: send smu8 sclk level indices, not the level mask
Jiaming Fan <fan.jiaming@hotmail.com>
drm/radeon: only unregister the ATPX handler if we registered it
Andrey Misiurov <amisiurov@cloudlinux.com>
drm/radeon: Bound GPIO I2C table entry count from VBIOS
Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
drm/nouveau: do not return early from a synchronous VM_BIND
Shigeaki Asai <y-asai.0816@docomonet.jp>
drm/meson: encoder_dsi: load ENCL gamma table while ENCL is disabled
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
drm/gud: avoid divide error in gud_stats_debugfs
Sechang Lim <rhkrqnwk98@gmail.com>
bpf, sockmap: Clear the redirect target after the stream parser runs
Rosen Penev <rosenp@gmail.com>
gpio: mvebu: validate ngpios before use
Sahaj Chaudhari <sahaj123.sc@gmail.com>
gpio: davinci: use controller-specific MMIO for BINTEN
Shravya KN <shravya.k-n@broadcom.com>
tg3: Fix heap overflow in unbuffered NVRAM write path
Pavan Chebbi <pavan.chebbi@broadcom.com>
tg3: Skip management FW version when APE firmware is not ready
Pavan Chebbi <pavan.chebbi@broadcom.com>
tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported
Linus Torvalds <torvalds@linux-foundation.org>
net: dpaa2-eth: fix objtool warning and logic bug
Alexei Starovoitov <ast@kernel.org>
bpf, sockmap: Hold the psock of the work in sk_psock_backlog()
Alexei Starovoitov <ast@kernel.org>
bpf: Keep the MAC header in bpf_skb_change_tail()
Alexei Starovoitov <ast@kernel.org>
bpf: Fail loads from a network header that was not set
Alexei Starovoitov <ast@kernel.org>
bpf: Clear the data that bpf_msg_push_data() adds
Alexei Starovoitov <ast@kernel.org>
bpf: Zero bpf_list_head in copies of map values
Alexei Starovoitov <ast@kernel.org>
bpf: Require CAP_PERFMON for dumps of xlated insns
Altgelt, Max (Nextron) <max.altgelt@nextron-systems.com>
bpf: don't skip other information if xlated_prog_insns is skipped
Alexei Starovoitov <ast@kernel.org>
bpf: Fix reads past an enum in prints of BTF data
Alexei Starovoitov <ast@kernel.org>
bpf: Add the symbol of a prog before its id
Alexei Starovoitov <ast@kernel.org>
bpf: Do not allow bpf_d_path() by an id of another BTF
Kuniyuki Iwashima <kuniyu@google.com>
tcp: Don't clear saddr before ->put_port().
Eric Dumazet <edumazet@kernel.org>
ipv6: mcast: do not pass uninitialized bytes to dev_mc_add()
Jiayuan Chen <jiayuan.chen@linux.dev>
ipv4: fix conntrack defrag forwarding after ip_frag_reinit()
Nicolai Buchwitz <nb@tipi-net.de>
net: systemport: accumulate the DIM packet and byte counters
Nicolai Buchwitz <nb@tipi-net.de>
net: systemport: restart DIM from the default profile on start
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: reset the Rx discard count with the ring
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: accumulate the DIM packet and byte counters
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: keep DIM from getting stuck after close or suspend
Zak Kemble <zakkemble@gmail.com>
net: bcmgenet: use napi_complete_done return value
Heng Qi <hengqi@linux.alibaba.com>
linux/dim: move useful macros to .h file
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: use the correct override register 2 Gbps bit
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: fix the SRAB grant timeout check
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: initialize the jumbo frame size register offset
Andrea Parri <parri.andrea@gmail.com>
ftrace: Fix lost recursion records in ftrace_record_recursion()
Shihuang Liu <shlomojune6@gmail.com>
net: sock_reuseport: Check program type on the migration path
Christian Göttsche <cgzones@googlemail.com>
jbd2: set JBD2_LOADED under j_state_lock
Filipe Manana <fdmanana@suse.com>
btrfs: fix delayed inode count leak after failure to delete inode ref
Filipe Manana <fdmanana@suse.com>
btrfs: unfold transaction abort at __btrfs_update_delayed_inode()
Qu Wenruo <wqu@suse.com>
btrfs: do not utilize goto to implement delayed inode ref deletion
Filipe Manana <fdmanana@suse.com>
btrfs: abort transaction on failure to update inode after hole punching
Arnav Kapoor <kapoorarnav43@gmail.com>
ASoC: SOF: control: reject out-of-range enum values
Stefan Ghetu <stefan.ghetu@nxp.com>
ASoC: fsl_easrc: fix context ownership on repeated hw_params
Stefan Ghetu <stefan.ghetu@nxp.com>
ASoC: fsl_asrc: fix pair ownership on repeated or failed hw_params
Binbin Deng <18983559317@163.com>
btrfs: wait for a grace period before freeing a new device
Filipe Manana <fdmanana@suse.com>
btrfs: send: fix invalid access to inline extents in clone_range()
Eric Dumazet <edumazet@kernel.org>
tun: flush uc and mc addresses in TUNSETLINK
Randy Dunlap <rdunlap@infradead.org>
chardev: GPIO common access methods: repair non-kernel-doc comment
Anastasia Eskova <anastasia.eskova@ibm.com>
s390/cert_store: Only allow the kernel to create cert_store_key keys
Anastasia Eskova <anastasia.eskova@ibm.com>
s390/cert_store: Allocate keyring with link restriction
Zhu Jun <zhujun2@cmss.chinamobile.com>
tools: gpio: Return success after monitoring requested events
Zhu Jun <zhujun2@cmss.chinamobile.com>
tools: gpio: Preserve device listing errors in lsgpio
Zhu Jun <zhujun2@cmss.chinamobile.com>
tools: gpio-hammer: Accept the maximum number of line offsets
Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
tools/bootconfig: Use the registered global tracing parameter names
Kai Vehmanen <kai.vehmanen@linux.intel.com>
ALSA: hda: intel: Release i915 power also when delayed probe fails
Petr Oros <poros@redhat.com>
ice: allow reading the last byte of the NVM and Shadow RAM regions
Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
ice: use global queue index in TC to-queue offload
Uri Dar <udar@nvidia.com>
net/mlx5: E-Switch, skip vport change work for disabled vports
Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
net: do not run out of frags in alloc_skb_with_frags()
Han Gao <gaohan@iscas.ac.cn>
riscv: efi: Map runtime MMIO with device attributes
Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
net: qrtr: ns: keep notifying local servers after a failed send
Chris Lew <quic_clew@quicinc.com>
net: qrtr: ns: Ignore ENODEV failures in ns
Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
scsi: ufs-mediatek: Restore the M-PHY power state when va09 disable fails
Yevgeny Kliteynik <kliteyn@nvidia.com>
net/mlx5: DR, Fix out-of-bounds write when sync to HW fails
Gal Pressman <gal@nvidia.com>
net/mlx5e: Release FIB event work flows before dropping RTNL
Imre Kaloz <kaloz@kernel.org>
net: marvell: prestera: disable port before changing its MAC mode
Jiayuan Chen <jiayuan.chen@linux.dev>
ipv6, calipso: fix data-race in calipso_cache_add() bucketsize check
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Fix potential ABBA deadlock at snd_pcm_action_nonatomic()
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Use guard() for locking
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Use CLASS() for fdget()/fdput()
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Use automatic cleanup of kfree()
Thomas de Gruijter <thomasdegruijter@pm.me>
Bluetooth: MSFT: Only enable the advertisement filter with monitors
Thomas de Gruijter <thomasdegruijter@pm.me>
Bluetooth: MSFT: Record the filter state on Command Disallowed
Jiale Yao <yaojiale02@163.com>
usb: cdns3: report endpoint reset timeout
Eren Çakar <hey@erencakar.com>
HID: letsketch: skip string descriptors the firmware does not implement
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor-hub: Remove clients before stopping hardware
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Register enable attribute after misc device
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Serialize misc device reads
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Fix state lifetime during removal
Chen Ni <nichen@iscas.ac.cn>
HID: hid-sensor-custom: Convert comma to semicolon
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
HID: hid-sensor-custom: Convert to platform remove callback returning void
Koichiro Den <den@valinux.co.jp>
dmaengine: rcar-dmac: Add missing dma_descriptor_unmap()
Zhang Shurong <zhang_shurong@foxmail.com>
dmaengine: rcar-dmac: Fix PM usage counter imbalance
SeungUk Nam <tmddnr49449@gmail.com>
dmaengine: idxd: Free the minor number when cdev setup fails
Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: order the TX ring index accesses
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: publish the buffer address before OWN
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: unmap RX buffers on stop with their mapped size
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: unmap the buffer of a dropped RX frame
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: release the TX ring on stop
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: drop a TX frame whose DMA mapping failed
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: fix the TX ring wrap
Artemii Mashanov <ralerrdirsardx@gmail.com>
cxgb4: allocate the full ethtool filter location array
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Disable sensor before hub close on removal
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Set owner for misc device
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor-hub: Synchronize callback removal with raw events
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_core: Don't fail removing a monitor unknown to the controller
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: MSFT: Free the response of the monitor commands
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_core: Hold hdev->lock when removing advertisement monitors
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: MSFT: Protect the event prefix with hdev->lock
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: mgmt: Fix mesh transmission locking and lifetime
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: L2CAP: Don't use uninitialized EFS in l2cap_parse_conf_rsp()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: mgmt: Reject zero multi advertising rotation duration
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Initialize ism array in query_diag320_subcodes()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix out-of-bounds read in pr_dbf_vce()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix max_vcxe_length output in pr_dbf_vcssb()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Validate hash length in check_certificate_valid()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Do not search the process keyrings for the cert_store keyring
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix keyring refcount handling in get_user_session_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix error handling of get_user_session_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Remove unnecessary static specifier in create_cs_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix potential use-after-free caused by find_cs_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix cs_keyring reference leak in fill_cs_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Check key_lookup() return code in invalidate_keyring_keys()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_event: Validate sent command length in LE Set Ext Adv Enable
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: SMP: Don't create the BR/EDR channel while unregistered
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: SMP: Check smp_data before using SMP_DEV()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: SMP: Serialize link key updates from smp_notify_keys()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_event: Fix not using key encryption size when its known
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_sync: Hold hdev->lock in hci_schedule_adv_instance_sync()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_core: Take req_sync lock in hci_power_on()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: mgmt: Fix read_index_list() buffer overflow
Shawn Lin <shawn.lin@rock-chips.com>
phy: rockchip: snps-pcie3: Raise the SRAM init timeout
Changyul Lee <lcy8047@gmail.com>
scsi: ch: Remove the minor from ch_index_idr after device_destroy()
Ricardo B. Marliere <ricardo@marliere.net>
scsi: ch: Make ch_sysfs_class constant
Michail Andreas Michalopoulos <mike.michalo@gmail.com>
ksmbd: sign the last response of a compound that ends early
Hongling Zeng <zenghongling@kylinos.cn>
phy: ti-pipe3: Fix clock leaks in init/exit error paths
Hongling Zeng <zenghongling@kylinos.cn>
phy: ti-pipe3: Fix EPROBE_DEFER handling for clock resources
Hongling Zeng <zenghongling@kylinos.cn>
phy: ti: pipe3: Fix clock resource leak on probe errors
Hongling Zeng <zenghongling@kylinos.cn>
phy: ti-pipe3: Fix ignored clock enable return value in init
Felix Gu <ustc.gu@gmail.com>
phy: ingenic: fix unbalanced regulator disable in exit
Sasha Levin <sashal@kernel.org>
selftests: drivers/s390x: Select uvdevice tests using the target architecture
Colton Lewis <coltonlewis@google.com>
irqchip/gic-v4: Use a separate lockdep class for vPE doorbell IRQs
Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
reset: scmi: Set the device for the reset controller
Fuad Tabba <fuad.tabba@linux.dev>
irqchip/gic-v4: Unwind what its_alloc_vcpu_irqs() allocated on failure
Fuad Tabba <fuad.tabba@linux.dev>
irqchip/gic-v4: Clear the domain and fwnode pointers after freeing them
Myeonghun Pak <mhun512@gmail.com>
memory: tegra: Shut down Tegra210 EMC timers before teardown
Oleg Keri <okerixx@gmail.com>
soundwire: qcom: disable the interrupt before gating the clock
Sudeep Holla <sudeep.holla@kernel.org>
firmware: arm_scmi: Unregister notifier on enable failure
Zhengping Jiang <jiangzp@google.com>
HID: vivaldi: avoid redundant feature report reads per usage
Shashikirana H K <shashikiranah@chromium.org>
HID: vivaldi: Extract feature report value directly in vivaldi_feature_mapping()
Julian Braha <julianbraha@gmail.com>
firmware: smccc: Provide stubs for HAVE_ARM_SMCCC_DISCOVERY=n
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Revert "wifi: ath10k: Stop unanswered temperature reads"
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: do not compute period estimation when updating odr
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: fix estimated value larger than interrupt timestamp
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: prevent timestamps going back in time in transitions
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: improve period measurement by using a longer delay
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: better timestamp alignment when using watermark
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: convert to kernel types
Shi Hao <i.shihao.999@gmail.com>
iio: common: fix spelling mistakes in comments
Karan Sanghavi <karansanghvi98@gmail.com>
iio: invensense: Prevent possible integer overflow while multiplication
Pu Lehui <pulehui@huawei.com>
mm: fix uprobe pte be overwritten when expanding vma
Julian Anastasov <ja@ssi.bg>
ipvs: honor the overload state and do not enter it forever
Julian Anastasov <ja@ssi.bg>
ipvs: read flags and seqs in master atomically
Fan Wu <fanwu01@zju.edu.cn>
usb: typec: qcom-pmic-typec: drain cc_debounce_dwork if port_start() fails
Fan Wu <fanwu01@zju.edu.cn>
usb: typec: qcom-pmic-typec: disable cc_debounce_dwork on stop
Johan Hovold <johan+linaro@kernel.org>
usb: typec: qcom-pmic: fix use-after-free on late probe errors
Trond Myklebust <trond.myklebust@hammerspace.com>
SUNRPC: Don't retry using the same source port if connection failed
Christopher Hoover <ch@murgatroid.com>
iio: humidity: hid-sensor-humidity: Use per-instance callbacks
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change
Josef Bacik <josef@toxicpanda.com>
w1: w1_therm: lock the list of slaves for the bulk read
Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths
Sean Anderson <sean.anderson@linux.dev>
usb: dwc3: Always deassert xilinx resets
Ihor Urazov <z0rc3r@gmail.com>
usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14
Josef Bacik <josef@toxicpanda.com>
serial: rda: free the interrupt on shutdown
Thomas Gleixner <tglx@linutronix.de>
serial: rda: Use port lock wrappers
wuyuehong <wuyuehong@cmss.chinamobile.com>
dm snapshot: fix discard_granularity unit in snapshot_io_hints
Weijiang Zhou <weijiang.zhou@unisoc.com>
dm-verity: don't restart or panic on errors during system shutdown
Joseph Qi <joseph.qi@linux.alibaba.com>
smb: client: hold server ref while queueing reconnect work
Daejun Park <daejun7.park@samsung.com>
ovl: bump the impure dir version when linking a file with origin
Amir Goldstein <amir73il@gmail.com>
ovl: fix leak of lowerdata redirect on ovl_get_inode() failure
Amir Goldstein <amir73il@gmail.com>
ovl: do not read the flags of a put upper dentry in lookup
Takashi Iwai <tiwai@suse.de>
Revert "ALSA: hda/realtek: Fix silent speaker on Higole F9B"
Muchun Song <muchun.song@linux.dev>
mm: list_lru: fix UAF for memory cgroup
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: PM: Avoid initializing power management for absent devices
Christopher Hoover <ch@murgatroid.com>
iio: temperature: hid-sensor-temperature: Use per-instance callbacks
Josef Bacik <josef@toxicpanda.com>
iio: adc: ad7923: add the AD7927 to the SPI ID table
Daejun Park <daejun7.park@samsung.com>
dm: fail a REQ_PREFLUSH bio with data when its preflush fails
Ming-Hung Tsai <mtsai@redhat.com>
dm: fix use-after-free when dm_get_device() widens the open mode
Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
dm cache: validate the discard block size before narrowing
liuyong <pkfxxxing@gmail.com>
smb: client: validate descriptor headers before query result allocation
Dan Carpenter <dan.carpenter@linaro.org>
smb/client: Prevent error pointer dereference
Dmitry Bogdanov <d.bogdanov@yadro.com>
nvme-tcp: fix usage of page_frag_cache
Krystian Kaniewski <krystianmkaniewski@gmail.com>
usb: gadget: u_serial: pin ports while TTYs are installed
Sasha Levin <sashal@kernel.org>
selftests: net: reuseport_bpf_numa: include stdbool.h
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Enable newly appended probe when target event is enabled
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: Fix updates of cached resolved frequency and index
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: Avoid redundant target() calls for unchanged limits
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: Introduce policy->boost_supported flag
Tim Menninger <tmenninger@everpuredata.com>
pNFS: avoid repeatedly cancelling I/O for the same lseg
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: Improve suspend-resume synchronization
Zihan Xi <zihanx@nebusec.ai>
netfilter: nf_dup: preserve guard across NFQUEUE reinjection
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Switch ftrace ops when adding probe with post_handler
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Validate re-registration earlier in register_kretprobe()
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Fix error return and slot leak in __register_kprobe()
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Adopt guard() and scoped_guard()
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write
Zhao Li <enderaoelyther@gmail.com>
Bluetooth: L2CAP: Only accept LE responses to outstanding requests
Vlastimil Babka (SUSE) <vbabka@kernel.org>
mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: don't undo another isolation in alloc_contig_range
Gregory Price (Meta) <gourry@gourry.net>
mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt
Gregory Price (Meta) <gourry@gourry.net>
mm/hugetlb: retry the pool walk when the zonelist is rebuilt
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: retry allocations that raced with a zonelist rebuild
Gregory Price (Meta) <gourry@gourry.net>
mm/mmzone: read each zoneref slot once when filtering by nodemask
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask()
Rosen Penev <rosenp@gmail.com>
gpio: mvebu: name regmaps to fix debugfs collisions
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211_hwsim: ignore non-generic netlink releases
Ian Bridges <icb@fastmail.org>
ksmbd: skip metadata-only opens in sharing checks
Seiji Nishikawa <snishika@redhat.com>
sched/core: Do not touch SMT siblings that have not joined the core yet
Stefan Haberland <sth@linux.ibm.com>
s390/dasd: Re-initialize RCD buffer with "V1.0" before every start
Anton Lundin <glance@ac2.se>
hwmon: (nct6775) Handle dual use registers
Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
arm64: suspend: Only track cpuidle context for idle tasks
Ada Couprie Diaz <ada.coupriediaz@arm.com>
arm64: suspend: rely on daif helpers to handle PMR
Yingjie Wang <x-professor@outlook.com>
tcp: free saved_syn after an RCU grace period
Yuansheng Yang <0xbeac@gmail.com>
KEYS: Protect pkey method checks against type removal
Mohammed EL Kadiri <med08elkadiri@gmail.com>
keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP
Karl Mehltretter <kmehltretter@gmail.com>
mtd: core: avoid double-free of OTP NVMEM device
HyeongJun An <sammiee5311@gmail.com>
ALSA: seq: Don't leak the extension cell pointer in the bounce payload
Cen Zhang (Microsoft) <blbllhy@gmail.com>
rds: tcp: unregister sysctl before tearing down listen socket
Jarkko Sakkinen <jarkko@kernel.org>
KEYS: Expand key->{datalen,quotalen} to unsigned int
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: proximity: sx9360: fix sampling frequency write and available range
Kuniyuki Iwashima <kuniyu@google.com>
ipv6: Remove IPV6_ADDRFORM.
Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
tools/bootconfig: Close only opened braces in compact output
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Bluetooth: btusb: fix use-after-free in force_poll_sync
Ian Abbott <abbotti@mev.co.uk>
comedi: comedi_bond: Fix leak of opened device references
Ming Qian <ming.qian@oss.nxp.com>
media: verisilicon: Fix kernel panic due to __initconst misuse
Wahid Khan <wahidzk0091@gmail.com>
ksmbd: refuse to read a handle that is not open for reading
Jiwoo Kim <arpe1618@gmail.com>
ksmbd: pin parent dentries in SMB2 CREATE ACL path
Eric Dumazet <edumazet@kernel.org>
net: wait for in-flight device unregistrations before netns dismantle
Tim Menninger <tmenninger@everpuredata.com>
xprtrdma: serialize unmap_sync with xprt_disconnect
Olga Kornievskaia <okorniev@redhat.com>
nfsd: fix possible badness in FREE_STATEID
Cosmin Ratiu <cratiu@nvidia.com>
xfrm: Don't clobber inner headers when already set
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Reject array count on non-dereference string sources
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Fix user-space dereference string array store type
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Fix missing BTF kind checks in char pointer/array helpers
Andrea Parri <parri.andrea@gmail.com>
sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE
Andrea Parri <parri.andrea@gmail.com>
sched/deadline: Fix spurious -EPERM for migration-disabled tasks
Zhao Feng <zhaofeng2@cmss.chinamobile.com>
watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog
Chen Ni <nichen@iscas.ac.cn>
watchdog: npcm: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare
Vishwaroop A <va@nvidia.com>
spi: tegra210-quad: Track DMA mapping state
Hyunjung Ko <hj351016@gmail.com>
tpm: flush timeout work outside buffer_mutex to avoid deadlock
Cheng Yongkang <teel4res@gmail.com>
fs/splice: clamp an over-reported write_iter result
Joas Antonio dos Santos <joasantonio108@gmail.com>
gtp: free the skb after handling an echo response
Jerome Mohm <jrmmhm.kernel@eldare.de>
vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore
Shashank Mohan Jain <jain.sm@gmail.com>
errseq: don't let errseq_check_and_advance() hide later errors
Zijun Hu <quic_zijuhu@quicinc.com>
errseq: eliminate special limitation for macro MAX_ERRNO
Anfernee Cao <anferneemelokc5@gmail.com>
mmc: sunxi: fix clock and runtime PM leaks on probe failure
Binbin Zhou <zhoubinbin@loongson.cn>
mmc: sunxi: Use devm_mmc_alloc_host() helper
Runyu Xiao <runyu.xiao@seu.edu.cn>
mmc: omap: synchronize clock timer before disabling fclk
Andrew Davison <andy@dvsn.net>
ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set
Olivier Louvignes <olivier@mgcrea.io>
mmc: jz4740: Remove the host before resetting the controller
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: imu: inv_mpu6050: fix swapped accel and gyro startup times
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: proximity: sx9500: ignore event config writes that don't change state
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: common: scmi_sensors: fix truncating 64-bit divisions
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_core: Fix not checking skb length on hci_scodata_packet
Kuniyuki Iwashima <kuniyu@google.com>
tcp: Set unhashed_state in inet_twsk_hashdance_schedule().
Kuniyuki Iwashima <kuniyu@google.com>
tcp: Do not allow buggy transitions between ehash and lhash2.
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
serial: sh-sci: Check that the DMA cookie is valid
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7915: clear wcid mask under mutex after RCU pointer clear
Mark Bundschuh <mkbund@amazon.com>
dm: fix infinite loop in dm_blk_do_report_zones()
Andrea Parri <parri.andrea@gmail.com>
sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler()
Eric Dumazet <edumazet@kernel.org>
net: gro: do not undo remote checksum offload on merged packets
Hyunwoo Kim <imv4bel@gmail.com>
tcp: do not coalesce segments after FIN
Mahanta Jambigi <mjambigi@linux.ibm.com>
net/smc: fix link group ownership in handshake abort
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: snapshot the preferred zone against shrink rebuilds
Josef Bacik <josef@toxicpanda.com>
mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone
Wei Yang <richard.weiyang@gmail.com>
mm: improve code consistency with zonelist_* helper functions
Yuya Kusakabe <yuya.kusakabe@gmail.com>
net: ipv6: keep room for the mac header in dst_dev_overhead()
Kyle Huey <me@kylehuey.com>
perf/bpf: Don't call bpf_overflow_handler() for tracing events
Ingo Molnar <mingo@kernel.org>
perf/bpf: Mark perf_event_set_bpf_handler() and perf_event_free_bpf_handler() as inline too
Ingo Molnar <mingo@kernel.org>
perf/bpf: Change the !CONFIG_BPF_SYSCALL stubs to static inlines
Kyle Huey <me@kylehuey.com>
perf/bpf: Allow a BPF program to suppress all sample side effects
Kyle Huey <me@kylehuey.com>
perf/bpf: Remove unneeded uses_default_overflow_handler()
Kyle Huey <me@kylehuey.com>
perf/bpf: Call BPF handler directly, not through overflow machinery
Kyle Huey <me@kylehuey.com>
perf/bpf: Remove #ifdef CONFIG_BPF_SYSCALL from struct perf_event members
Kyle Huey <me@kylehuey.com>
perf/bpf: Create bpf_overflow_handler() stub for !CONFIG_BPF_SYSCALL
Kyle Huey <me@kylehuey.com>
perf/bpf: Reorder bpf_overflow_handler() ahead of __perf_event_overflow()
Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
bootconfig: Trim unquoted values at end of file
Su Hui <suhui@nfschina.com>
fs/stat.c: avoid harmless garbage value problem in vfs_statx_path()
Christian Loehle <christian.loehle@arm.com>
cpufreq: Preserve global boost state on failed updates
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: btintel: Check if controller is ISO capable on btintel_classify_pkt_type
Sandipan Das <sandipan.das@amd.com>
perf/x86/amd/uncore: Avoid PMU registration if counters are unavailable
Luiz Capitulino (Red Hat) <luiz.capitulino@linux.dev>
powerpc/watchdog: disable watchdog when watchdog_thresh=0
Hyunwoo Kim <imv4bel@gmail.com>
tcp: fix NULL pointer dereference when restarting a Fast Open listener
Mani Tofigh <mt4022@columbia.edu>
nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem()
Henry Martin <bsdhenrymartin@gmail.com>
sctp: fix skb_over_panic when adding addresses with a pending delete of another family
Mani Tofigh <mt4022@columbia.edu>
blk-mq: take quiesce_lock when removing a queue from the tag set
Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
fou: reserve headroom before pushing the encap header
Karl Mehltretter <kmehltretter@gmail.com>
iio: trigger: Return an error when the trigger has no free irq
Changyul Lee <lcy8047@gmail.com>
iio: trigger: free the trigger ID after device_del()
Salah Triki <salah.triki@gmail.com>
iio: temperature: mlx90614: Fix dual channel probe condition check
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: proximity: sx9324: fix out-of-bounds read of scan period table
Shashank Mohan Jain <jain.sm@gmail.com>
iio: magnetometer: mmc35240: leave cache-only mode before the cache sync
Alexander Sarmanow <as@discnull.de>
iio: light: vcnl4035: Fix reversed ALS mode bit
Jan Remes <jan.remes@mycroftmind.com>
iio: light: tsl2591: don't divide by zero
Jiale Yao <yaojiale02@163.com>
iio: imu: kmx61: reject duplicate event disable
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes
Vidhu Sarwal <vidhu.linux@gmail.com>
iio: humidity: am2315: fix negative temperature decoding
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
iio: hid-sensors: fix fractional part for unit exponents -7 and -8
Maximilian Czirr <maxx-cz@web.de>
iio: hid-sensor: Fix scale for magnetic north heading
Jiale Yao <yaojiale02@163.com>
iio: gyro: bmg160: reject duplicate event disable
Baek Kyu, Kim <pocj8ur4in@gmail.com>
iio: dac: mcp4725: Update the cached DAC value only on success
Nikhil Gautam <nikhilgtr@gmail.com>
iio: atlas-ezo: Fix humidity channel read support
Andrea Amer <and.amer@gmail.com>
iio: afe: rescale: expose offset if rescaler or source has one
Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
iio: accel: kxsd9: Fix potential use-after-free on removal
Billy Tsai <billy_tsai@aspeedtech.com>
dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs
Johan Hovold <johan@kernel.org>
USB: serial: io_edgeport: serialise MCR accesses
Johan Hovold <johan@kernel.org>
USB: serial: io_edgeport: fix potential use-after-free on disconnect
Johan Hovold <johan@kernel.org>
USB: serial: io_edgeport: fix potential fifo corruption
Johan Hovold <johan@kernel.org>
USB: serial: io_edgeport: move initial termios update to open()
Johan Hovold <johan@kernel.org>
USB: serial: io_edgeport: fix potential NULL-deref at open
Johan Hovold <johan@kernel.org>
USB: serial: io_edgeport: fix potential close() use-after-free
Johan Hovold <johan@kernel.org>
USB: serial: io_edgeport: fix NULL-deref on early status
Johan Hovold <johan@kernel.org>
USB: serial: upd78f0730: fix NULL-deref on hangup
Tristan Madani <tristan@talencesecurity.com>
USB: serial: sierra: validate URB length in instat callback
Hui Peng <benquike@gmail.com>
USB: serial: garmin_gps: validate packet data length in nat_receive()
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: fix the error handling of amdgpu_vm_init_entities()
Josef Bacik <josef@toxicpanda.com>
w1: w1_therm: leave the slaves of other families alone
Josef Bacik <josef@toxicpanda.com>
w1: use the bus mutex for the "rw" file
Josef Bacik <josef@toxicpanda.com>
w1: remove the master's files before taking its locks
Josef Bacik <josef@toxicpanda.com>
w1: netlink: drop the slave after the bus is unlocked
Josef Bacik <josef@toxicpanda.com>
w1: ds28e04: use the bus mutex to talk on the bus
Josef Bacik <josef@toxicpanda.com>
w1: ds2805: use the bus mutex to talk on the bus
Josef Bacik <josef@toxicpanda.com>
w1: ds2482: set the strong pull-up with its byte
Josef Bacik <josef@toxicpanda.com>
w1: don't hold list_mutex while a slave is torn down
Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
usb: dwc3: xilinx: fix system suspend and resume PHY handling
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
usb: dwc3: gadget: Wait for End Transfer completion on ep disable
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
usb: dwc3: gadget: Track a timed out End Transfer
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
usb: dwc3: gadget: Reset endpoint flags on controller start
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
usb: dwc3: gadget: Reject requests to a disabled endpoint
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
usb: dwc3: gadget: Recover from End Transfer timeout
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
usb: dwc3: gadget: Clear delayed stop on End Transfer completion
Brian Ellis <brianellis@gotenna.com>
usb: gadget: u_serial: fix NULL deref in gs_close() after failed open
Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty
Sonali Pradhan <sonalipradhan@google.com>
usb: gadget: f_midi: fix UAF race during IN request handling
Yu Zhang <yuz08559@gmail.com>
usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF
Xu Rao <raoxu@uniontech.com>
usb: xhci: disable the correct slot on alloc_dev failure
Uttkarsh Aggarwal <uttkarsh.aggarwal@oss.qualcomm.com>
usb: typec: ucsi: Set ucsi->connector before enabling notifications
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
usb: usbtest: prevent divide by zero in simple_io() with zero length
Olivier Kaloudoff <olivier.kaloudoff@gmail.com>
usb: uas: ignore UAS for ASMT135x bridges (174c:55aa)
Chaz Bailey <charles.s.bailey@gmail.com>
usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove
Joonhoe Kim <26rote@gmail.com>
usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes
Josef Bacik <josef@toxicpanda.com>
USB: serial: oti6858: fix the teardown order in close
Johan Hovold <johan@kernel.org>
USB: serial: garmin_gps: fix deadlock on reset request
Rishabh Jain <rishabh.jain1198@gmail.com>
usb: pci-quirks: always assert xHCI OS ownership
Johan Hovold <johan@kernel.org>
USB: cdc-acm: fix NULL-deref on hangup
Jiri Slaby (SUSE) <jirislaby@kernel.org>
tty: fix misapplied compat_ptr() in tty_compat_ioctl()
Josef Bacik <josef@toxicpanda.com>
serial: samsung: put the previous baud clock
Josef Bacik <josef@toxicpanda.com>
serial: samsung: don't leak the tty on an RX IRQ
Josef Bacik <josef@toxicpanda.com>
serial: 8250_lpss: don't divide by 0 above 6.25 Mbaud
Josef Bacik <josef@toxicpanda.com>
misc: vmw_vmci: wait for callbacks in event unsubscribe
Jiale Yao <yaojiale02@163.com>
misc: ibmvmc: initialize HMC state before device registration
Guangshuo Li <lgs201920130244@gmail.com>
misc: bcm-vk: fix DMA allocation memory leak
Josef Bacik <josef@toxicpanda.com>
iio: hid-sensors: fix a division by zero
Josef Bacik <josef@toxicpanda.com>
iio: addac: ad74413r: fix the values of set_multiple
Josef Bacik <josef@toxicpanda.com>
comedi: vmk80xx: report failed transfers of the K8061
Josef Bacik <josef@toxicpanda.com>
comedi: ni_tio: Fix overflow of the clock period
Josef Bacik <josef@toxicpanda.com>
comedi: ni_660x: don't poll without a DMA channel
Josef Bacik <josef@toxicpanda.com>
comedi: addi_apci_1500: fix clearing of the gate enable
Chris Mason <mason@kernel.org>
vt: serialise the producers of the flip buffer
Mikulas Patocka <mpatocka@redhat.com>
dm-thin: fix parsing of feature arguments
Mikulas Patocka <mpatocka@redhat.com>
dm-thin: fix leak if __set_snapshot_details fails
Mikulas Patocka <mpatocka@redhat.com>
dm-thin: fix data corruption if discard races with regular I/O
Jay Vadayath <jay@artiphishell.com>
dm-raid: bound array_position before indexing failed_devices
Mikulas Patocka <mpatocka@redhat.com>
dm-integrity: don't attempt to commit journal on disabled device
Sinan Polat <sinan86polat@gmail.com>
dm-integrity: don't recalculate with HMAC because of a dirty bitmap
Josef Schlehofer <pepe.schlehofer@gmail.com>
dm-crypt: defer async write submission to write thread
Mikulas Patocka <mpatocka@redhat.com>
dm-cache: fix ending a cursor that never began
Mikulas Patocka <mpatocka@redhat.com>
dm-cache: fix NULL pointer dereference on open failure
Kyrylo Biryuk <illofspeed@gmail.com>
dm zoned: do not reclaim a random zone into another random zone
Kyrylo Biryuk <illofspeed@gmail.com>
dm zoned: back off when reclaim cannot make progress
Chen Cheng <chencheng@fnnas.com>
dm snapshot: fix discard writing into the next COW chunk
Chen Cheng <chencheng@fnnas.com>
dm snapshot: split discards on chunk boundaries
Mikulas Patocka <mpatocka@redhat.com>
dm persistent data: don't leak bufio buffer if find_leaf fails
Mikulas Patocka <mpatocka@redhat.com>
dm persistent data: don't ignore writeback errors
Mikulas Patocka <mpatocka@redhat.com>
dm persistent data: test return value of node_copy
Mikulas Patocka <mpatocka@redhat.com>
dm-sysfs: fix misbehavior if kobject_init_and_add fails
Yingjie Wang <1075151112@qq.com>
dm thin: avoid wrapping no_space_timeout
Yingjie Wang <x-professor@outlook.com>
dm mpath: cap queue_if_no_path_timeout_secs
shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn>
dm mpath: fix buffer overflow in parse_hw_handler()
Zhao Feng <zhaofeng2@cmss.chinamobile.com>
dm crypt: fix use of uninitialized percpu_counter in ctr error path
Edward Adam Davis <eadavis@sina.com>
dm cache: reject kcopyd client destory if it setup failed
shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn>
dm log userspace: drop the device reference on error
Joseph Qi <joseph.qi@linux.alibaba.com>
smb: client: skip NULL channel in __cifs_put_smb_ses()
Joseph Qi <joseph.qi@linux.alibaba.com>
smb: client: hold the inode across cifs_oplock_break()
Paulo Alcantara <pc@manguebit.org>
smb: client: flush deferred handles of other names before a hard link open
Fredric Cover <fredric.cover.lkernel@gmail.com>
smb: client: fix out-of-bounds read in dfs_parse_target_referral()
Paulo Alcantara <pc@manguebit.org>
smb: client: don't block dying tasks waiting for writeback on fsync
Paulo Alcantara <pc@manguebit.org>
smb: client: don't block dying tasks waiting for writeback on close
liuyong <pkfxxxing@gmail.com>
smb: client: compare owner and group SIDs using their encoded lengths
Yifan Zhang <yfzhang23@stu.pku.edu.cn>
smb: client: bound invalid NTLMSSP signature diagnostic
Giuseppe Scrivano <giuseppe@scrivano.org>
ovl: return EIO if the lowerdata is missing
Amir Goldstein <amir73il@gmail.com>
ovl: report the requested redirect_dir mode in conflicting options
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
ovl: reject different lower idmaps on the same fs
Giuseppe Scrivano <giuseppe@scrivano.org>
ovl: do not always clear absolute_redirect
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpio: sodaville: fix use-after-free bug when registering the irqchip
Cunhao Lu <1579567540@qq.com>
gpio: rockchip: Fix debounce arithmetic for GPIO v2
Guangshuo Li <lgs201920130244@gmail.com>
gpio: brcmstb: fix UAF after IRQ domain setup failure
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: bound pending OCB station allocations
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: bound pending IBSS station allocations
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: restore dormant links when link updates fail
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: recheck the OCB station limit before insertion
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: recheck the IBSS station limit before insertion
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: recheck injected headers after removing FCS
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: drain link readers before stopping removed links
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: fix use-after-free when MLO link setup is rolled back
Wahid Khan <wahidzk0091@gmail.com>
wifi: cfg80211: don't truncate the merged MBSSID profile length
Zhao Li <enderaoelyther@gmail.com>
wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers
Zhao Li <enderaoelyther@gmail.com>
wifi: cfg80211: release rejected nontransmitted BSS reference
Mehmet Fide <mehmet.fide@screeningeagle.com>
wifi: ath9k_htc: do not start ANI before the first channel is set
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Check enabled and busy state before unlinking sibling probes
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/eprobe: Disallow attaching eprobes to fprobe events
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()
Weiming Shi <bestswngs@gmail.com>
sctp: reset stored flag for each association
Tim Budding <tim.budding@gmail.com>
sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED
Tim Budding <tim.budding@gmail.com>
sctp: fix I-FORWARD-TSN handling of fragments on other streams
Andrey Misiurov <andrey.misyrov@gmail.com>
sctp: fix ASCONF address change on single-homed hosts
Kyle Zeng <kylebot@openai.com>
sctp: avoid requeueing pending control chunks
Tim Budding <tim.budding@gmail.com>
sctp: abort unordered partial delivery when its message is skipped
Stefan Haberland <sth@linux.ibm.com>
s390/dasd: Don't trust userspace-supplied result field in format check
Stefan Haberland <sth@linux.ibm.com>
s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path
Stanislav Aleksandrov <lightofmysoul@gmail.com>
hwmon: (max31760) Report 0 RPM before the first fan speed measurement
Stanislav Aleksandrov <lightofmysoul@gmail.com>
hwmon: (max31760) Leave standby mode at probe
Stanislav Aleksandrov <lightofmysoul@gmail.com>
hwmon: (max31760) Fix the local temperature limit registers
Sudeep Holla <sudeep.holla@kernel.org>
hwmon: (scmi) Check channel config allocation
Pablo Mazzini <pmazzini@gmail.com>
hwmon: (sy7636a) fix negative temperatures
Felix Radensky <fradensky@nvidia.com>
hwmon: (pmbus/mp2975) Get vout fault limits dynamically
Rupesh Majhi <zoone.rupert@gmail.com>
hwmon: (aht10) Fix update_interval overflow on 64-bit
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
xen/pvcalls: destroy the per-socket workqueue on release
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
xen/pvcalls: unwind pvcalls_new_active_socket() step by step
Qihang <q.h.hack.winter@gmail.com>
xen/privcmd: fix double free when an irqfd is shut down twice
Andrey Misiurov <andrey.misyrov@gmail.com>
xen/gntdev: fix deadlock between map ioctl and mmap
Dave Hansen <dave.hansen@linux.intel.com>
x86/mm: Ensure write visibility during LDT installation
Guanglei Zhu <zhugl3@xiaopeng.com>
tpm: eventlog: check the payload size before reading tag events
Takashi Iwai <tiwai@suse.de>
tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path
Hungyu Lin <dennylin0707@gmail.com>
timekeeping: Read getboottime64() offsets under the sequence counter
Avi Weiss <thnkslprpt@gmail.com>
SUNRPC: Fix TCP-with-TLS transport class identification
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
software node: only let the owner release a managed node
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: Cache post-resolution target frequency in __resolve_freq()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: intel_pstate: Clear last written P-state value on suspend
Li RongQing <lirongqing@baidu.com>
cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io()
Zhao Gongyi <zhaogongyi@bytedance.com>
arm64: ptrace: don't warn on missing siginfo in a group-stop
Beata Michalska <beata.michalska@arm.com>
arm64: errata: Add Cortex-A715/A720 AMU core counter workaround
Cheng Yongkang <teel4res@gmail.com>
fs/proc: fix the write length returned by proc_sys_call_handler()
HyeongJun An <sammiee5311@gmail.com>
fs/adfs: bound directory entry name length in adfs_fplus_getnext()
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
crypto: essiv - fix use-after-free in AEAD path
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
crypto: caam - reject overlong RSA CRT parameters
Zhao Li <enderaoelyther@gmail.com>
Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Bluetooth: hci_qca: fix use-after-free in ibs debugfs files
Baoli Zhang <baoli.zhang@linux.intel.com>
ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
PM: runtime: Update last_busy in rpm_resume() for active devices
Phat Dinh <phatdt1116@gmail.com>
perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit
Joas Antonio dos Santos <joasantonio108@gmail.com>
openvswitch: advance by the real header length in get_ipv6_ext_hdrs()
Tim Menninger <tmenninger@everpuredata.com>
NFSv4: Prevent indefinite waits for out-of-order OPEN stateids
Jamal Hadi Salim <jhs@mojatatu.com>
net/sched: act_ife: require a full Ethernet header on egress
Jamal Hadi Salim <jhs@mojatatu.com>
net/sched: act_ife: encode configured zero metadata values
Jamal Hadi Salim <jhs@mojatatu.com>
net/sched: sch_teql: reject qdiscs from another network namespace
Michail Andreas Michalopoulos <mike.michalo@gmail.com>
netfilter: flowtable: extend ct timeout of offloaded GRE flows
Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
netfilter: xt_recent: do not call remove_proc_entry() under recent_lock
Erni Sri Satya Vennela <ernis@linux.microsoft.com>
hv_netvsc: Stop PPI parsing on invalid metadata
Chengfeng Ye <nicoyip.dev@gmail.com>
ipvs: fix protocol data lifetime during namespace teardown
Chengfeng Ye <nicoyip.dev@gmail.com>
ipvs: Defer application parent freeing until after RCU readers
Yingjie Wang <1075151112@qq.com>
ipv6: reject routes without an inet6_dev
Xia Yan <yanxia@cmss.chinamobile.com>
ipv6: fix cached route reuse for control messages
Daniël Trujillo <datrujillo@nvidia.com>
ipv4: fib_trie: prevent speculative out-of-bounds child access
Kyle Zeng <kylebot@openai.com>
ipv4: keep XFRM headers out of corked skb lengths
Kyle Zeng <kylebot@openai.com>
mptcp: reject DATA_ACKs against a reversed send interval
Zixuan Chai <petalzu987@gmail.com>
seg6: validate state in netfilter continuations
Rishikesh Jethwani <rjethwani@purestorage.com>
tls: only install push_pending_record for a TX context
Hungyu Lin <dennylin0707@gmail.com>
tsacct: Keep task begin times stable across suspend
Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
net: mana: report RX checksum offload for IPv6
Jens Axboe <axboe@kernel.dk>
net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls
Tapio Reijonen <tapio.reijonen@vaisala.com>
net: dsa: microchip: initialize the IRQ access mutex
Jun Yang <junvyyang@tencent.com>
net: bridge: use one headroom snapshot for ND replies
Mahanta Jambigi <mjambigi@linux.ibm.com>
net/smc: fix lgr/lnk lifetime vs diag reader race
Kyle Zeng <kylebot@openai.com>
net/rds: Do not unpin a page after a failed atomic pin
Jiabin Deng <dengjiabin2023@gmail.com>
net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported
Davidlohr Bueso <dave@stgolabs.net>
mctp: accept MSG_CMSG_COMPAT in recvmsg
Kyle Zeng <kylebot@openai.com>
macsec: reject frames that decapsulate into runt Ethernet frames
Jean-Paul Sergent <jpsergent@gmail.com>
net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: detect zonelist rebuilds from memory hot-add
Josef Bacik <josef@toxicpanda.com>
mm/page_alloc: keep the pagesets of an empty zone
Josef Bacik <josef@toxicpanda.com>
mm/memory_hotplug: resize zones under their seqlock
Gregory Price (Meta) <gourry@gourry.net>
mm/mmzone: read the zoneref slot once in zonelist_zone()
Avi Weiss <thnkslprpt@gmail.com>
splice, net: avoid MSG_MORE when the bvec array fills
Christian Brauner <brauner@kernel.org>
aio: don't let exit_aio() return before complete() is done
Mani Tofigh <mt4022@columbia.edu>
eventpoll: wake the next waiter when a woken waiter is killed
Igor Velkov <iav@iav.lv>
mmc: meson-gx: name the limit of the CMD_CFG timeout field
Igor Velkov <iav@iav.lv>
mmc: meson-gx: report the longest busy wait the controller can do
Igor Velkov <iav@iav.lv>
mmc: meson-gx: honour the busy timeout for R1b commands
Igor Velkov <iav@iav.lv>
mmc: meson-gx: report busy from DAT0 alone
Ian Ray <ian.ray@gehealthcare.com>
mmc: sdhci-esdhc-imx: map unsupported driver type to Type B
Anfernee Cao <anferneemelokc5@gmail.com>
mmc: mmci: fix DMA channel leak when mmc_add_host() fails
Steven Rostedt <rostedt@goodmis.org>
tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc
Gichoon Han <gichoon.han@samsung.com>
ALSA: usb-audio: Drop capture packets with bogus actual_length
Sergei Nizovtsev <snizovtsev@cloudlinux.com>
ALSA: caiaq: Kill EP1 URB before unregistering the input device
Zhiqi Zhang <zhiqizhangg@gmail.com>
bootconfig: Allow keys with the maximum supported depth
Jarkko Sakkinen <jarkko@kernel.org>
KEYS: Verify the key identity in __key_unlink_begin
Jarkko Sakkinen <jarkko@kernel.org>
KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE
David Carlier <devnexen@gmail.com>
tracing/eprobe: Install the trigger for every instance that enables the eprobe
Mikhail Malyshev <mike.malyshev@gmail.com>
io_uring/io-wq: apply the current cpuset to new workers
Eric Dumazet <edumazet@kernel.org>
tun: clear stale skb->protocol of NAPI frags skbs
Brian Norris <briannorris@chromium.org>
PM: runtime: Only queue an idle check for RPM-linked suppliers (part 2)
John Johansen <john.johansen@canonical.com>
apparmor: advertise that sctp is being mediated
John Johansen <john.johansen@canonical.com>
apparmor: fix check SCTP bind, and connect permission checks
Jakub Kicinski <kuba@kernel.org>
eth: bnxt: don't leak buffers when XDP agg buffer allocation fails
Naman Gulati <namangulati@google.com>
netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
apparmor: check connect permission for SCTP
Maxime Bélair <maxime.belair@canonical.com>
apparmor: fix table_size() integer overflow on 32 bit
Kunhai Dai <daikunhai@didiglobal.com>
blk-iocost: publish hweights as one atomic value
Josef Bacik <josef@toxicpanda.com>
blk-mq: don't trust the cookie in blk_mq_poll()
Karol Kolacinski <karol.kolacinski@intel.com>
ice: E822: keep Tx timestamps disabled during offset calibration
Chuck Lever <cel@kernel.org>
tls: Honor O_NONBLOCK in tls_sw_splice_read()
Josef Bacik <josef@toxicpanda.com>
block: don't enter reclaim under rq_qos_mutex
Josef Bacik <josef@toxicpanda.com>
blk-throttle: make blkio.reset_stats reset I/O counts
Josef Bacik <josef@toxicpanda.com>
blk-throttle: pass the I/O counts of a dead group on
Sicong Huang <congei42@163.com>
nfp: flower: fix use-after-free in neighbour update work
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: return complete and aligned stream information
Rishikesh Jethwani <rjethwani@purestorage.com>
tls: keep TX and RX hardware offload on the same device
Daniel Machon <daniel.machon@microchip.com>
net: lan966x: don't disable hardirqs in fdma tx clear path
Tal Zussman <tz2294@columbia.edu>
ceph: fix writeback_count leak when a bounce page allocation fails
Tal Zussman <tz2294@columbia.edu>
ceph: wait for pending fscache write in write_folio_nounlock()
Cen Zhang <zzzccc427@gmail.com>
ALSA: ump: Drain sequencer callbacks before freeing their client
Dimitris Charisis <dchar@cslab.ece.ntua.gr>
maple_tree: fix maple_range_64 crashes in RCU mode
Pooyan Azad <pooyan.azadparvar@gmail.com>
zram: fix short reads from block_state
Gal Pressman <gal@nvidia.com>
net/mlx5e: IPsec, Fix out-of-bounds comparison of neighbour keys
Xingyuan Mo <hdthky0@gmail.com>
sctp: reject forged cookie peer_addr with unknown address family
Ian Rogers <irogers@google.com>
perf lock contention: Filter events before creating lock_stat
Sasha Levin <sashal@kernel.org>
selftests/proc: proc-pid-vm: fix unused variable warning on non-x86
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: fix fd_limit accounting across durable reconnects
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: fix durable reconnects for root shares
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: cache the resolved share path for durable reconnects
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: disconnect on invalid encryption transform flags
Henry Hu <huhai@kylinos.cn>
ksmbd: fix iface_list use-after-free during server reset
Chi Zhiling <chizhiling@kylinos.cn>
exfat: fix used_clusters accounting during cluster allocation
Ovidiu Panait <ovidiu.panait.rb@renesas.com>
net: stmmac: Track the TX DMA threshold per queue
Eric Dumazet <edumazet@kernel.org>
ip6mr: clear skb->cb[] in reg_vif_xmit()
Rosen Penev <rosenp@gmail.com>
net: phy: marvell: keep WOL_EIE across interrupt reconfiguration
Florian Fainelli <florian.fainelli@broadcom.com>
net: bcmasp: fix network filter lookup and wake filter pair allocation
James Hilliard <james.hilliard1@gmail.com>
xsk: freeze deferred pool teardown without blocking unregister
Yongzhao Chen <yongzhao.derek@gmail.com>
net: phy: qca83xx: read resolved QCA8337 link status
Serhat Kumral <serhatkumral1@gmail.com>
RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler
Cen Zhang <zzzccc427@gmail.com>
ALSA: aloop: Keep shared timer callbacks alive through close
Cen Zhang <zzzccc427@gmail.com>
ALSA: jack: Pin the module while debugfs files are open
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
netfilter: flowtable: reset transport header after nf_flow_encap_pop()
Adrian Ambrozewicz <aambrozewicz@nvidia.com>
gpiolib: clear the event clock flags when a line is released
Woojin Ji <random6.xyz@gmail.com>
bpf: Zero-extend the index in inlined bpf_get_func_arg()
Josef Bacik <josef@toxicpanda.com>
bpf: Follow the head if an skb is written from a slice
Josef Bacik <josef@toxicpanda.com>
bpf: Let bpf_dynptr_write() mark a global function
Josef Bacik <josef@toxicpanda.com>
bpf, cpumap: Hold the device of frames in the queue
Josef Bacik <josef@toxicpanda.com>
bpf: Keep the symbols of a program until it has ended
Alexei Starovoitov <ast@kernel.org>
bpf: Don't let an extension reach further into the context than its target
Josef Bacik <josef@toxicpanda.com>
bpf: Assume no bounds for a writable tp with tail calls
Josef Bacik <josef@toxicpanda.com>
bpf: Assume no bounds for buffers behind a tail call
Josef Bacik <josef@toxicpanda.com>
bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit
Josef Bacik <josef@toxicpanda.com>
bpf: Reject sleepable programs for task_vma iterator
Josef Bacik <josef@toxicpanda.com>
bpf: Use the frame mem type in devmap egress XDP
Yuan Chen <chenyuan@kylinos.cn>
bpf: Claim the per-CPU send_signal irq_work before filling it
Tal Zussman <tz2294@columbia.edu>
btrfs: update the inode item when removing a free space inode
Tal Zussman <tz2294@columbia.edu>
btrfs: drop the extent maps of the written part of a failed ordered extent
Viktor Menshin <ripeeerr@gmail.com>
ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912)
Ju Nan <junan76@163.com>
pinctrl: stm32: Fix the unit of the hwspinlock timeout
Eric Dumazet <edumazet@kernel.org>
tcp: use the echoed source route in cookie_v4_check()
Li RongQing <lirongqing@baidu.com>
ublk: use global index for reported zones
Haotian Zhang <vulab@iscas.ac.cn>
ASoC: rockchip: fix device node reference leak in rk3288_hdmi_analog
Myeonghun Pak <mhun512@gmail.com>
ASoC: rt5645: Shut down the button timer on removal
Pengpeng Hou <hppiscas@163.com>
irqchip/mst-intc: Validate the DT interrupt range
David Howells <dhowells@redhat.com>
rxrpc: Fix sendmsg length
David Howells <dhowells@redhat.com>
rxrpc: Fix aborting in rxperf test server
Jiayuan Chen <jiayuan.chen@linux.dev>
veth: clear rx queue hint in veth_xmit
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails
Kevin Dewald <kevin@simpleble.org>
Bluetooth: hci_event: Fix LE link drop on remote features command status
Pauli Virtanen <pav@iki.fi>
Bluetooth: hci_sync: fix mesh adv timeout units
Chris Lu <chris.lu@mediatek.com>
Bluetooth: btmtk: Validate the firmware layout before parsing it
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Protect delay DMA sync in forward and rewind, too
Namhyung Kim <namhyung@kernel.org>
perf symbol: Add missing symsrc__destroy() for libbfd
Namhyung Kim <namhyung@kernel.org>
perf symbol: Fix symbol loading from libbfd
Weiming Shi <bestswngs@gmail.com>
fs/ntfs3: do not mark frame pages uptodate on read error
Cen Zhang <zzzccc427@gmail.com>
ALSA: pcm: Protect delay DMA sync against concurrent HW_FREE
Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
platform/x86/amd/pmc: clear devm-managed pointers on remove to prevent stale reuse
Ali Ahmet Memiş <aliamemis@disroot.org>
ALSA: hda: intel: Don't free card in the probe work
Jiale Yao <yaojiale02@163.com>
wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup
Filipe Manana <fdmanana@suse.com>
btrfs: fix off-by-one end offset check in report_setget_bounds()
Guanghui Yang <3497809730@qq.com>
btrfs: roll back sprout setup after device add failure
Adrián Larumbe <adrian.larumbe@collabora.com>
drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove
Ali Ahmet Memiş <aliamemis@disroot.org>
ALSA: control_led: Fix deadlock between sysfs writes and card disconnect
Kees Cook <kees@kernel.org>
seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk()
Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
mailbox: arm_mhu_db: Remove redundant mbox_controller_unregister() on probe failure
Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Preserve the LCPA I/O address space
Jacob Moroni <jmoroni@google.com>
RDMA/core: Clear driver_udata before destroying objects in rdma_core
Quanye Yang <quanyeyang@proton.me>
RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq
Tony Luck <tony.luck@intel.com>
fs/resctrl: Ensure default group reports tasks on monitor-only systems
Leon Romanovsky <leon@kernel.org>
PCI/P2PDMA: Do not tear down the allocate attribute on registration failure
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: limit injected HT/VHT MCSes
Johannes Berg <johannes.berg@intel.com>
wifi: nl80211: reject zero RNR/MBSSID elements
Michał Kopeć <michal@nozomi.space>
ASoC: mediatek: mt8188: Constrain UL8 FE to its back end's capabilities
Takashi Iwai <tiwai@suse.de>
ALSA: hda: Don't free card at probe error in vga_switcheroo handler
Takashi Iwai <tiwai@suse.de>
ALSA: hda: Use linked list for jack table
Takashi Iwai <tiwai@suse.de>
ALSA: pcmtest: Fix leak at probe error
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path
Dmitry Morgun <d.morgun@ispras.ru>
fs/ntfs3: check return values in indx_delete_entry()
Melissa Wen <mwen@igalia.com>
drm/amd/display: copy function name into dcn_optc_lock_unlock_state trace event
Melissa Wen <mwen@igalia.com>
drm/amd/display: copy function name into dcn_fpu trace event
Melissa Wen <mwen@igalia.com>
drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class
John Crispin <john@phrozen.org>
wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup
Aamir Ahmed <elb12345@hotmail.co.uk>
wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown()
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: mt7921: honour FIF_FCSFAIL instead of hardcoding drop_err
Andrei Vagin <avagin@google.com>
proc: report SIGEV_NONE in /proc/pid/timers if target task has died
Wilson Felipe Pereira <wfelipe@google.com>
selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Recover coalesced cyclic callbacks
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix cyclic transfer residue
Roman Demidov <roman.demidov.nn@gmail.com>
drm/msm/a6xx: check pm_runtime_resume_and_get during resume
Qing Ming <a0yami@mailbox.org>
dlm: validate node weights before building member array
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drm/msm/a5xx: don't read the GPMU registers on GPUs without a GPMU
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
soc: qcom: pmic_glink: Avoid losing early rpmsg probe
Nicolin Chen <nicolinc@nvidia.com>
iommu/arm-smmu-v3: Don't rb_erase() a never-inserted stream node
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Advance the write pointer over the data written
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Do not write a partial physical block to a zoned device
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Report the residual of a write
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Enforce physical block alignment of zoned writes
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Avoid 32-bit overflow in WRITE SCATTERED offsets
Yuan Chen <chenyuan@kylinos.cn>
bpf: Roll back freplace link state when bpf_arch_text_poke() fails
Mostafa Saleh <smostafa@google.com>
iommu/arm-smmu-v3: Ensure L2 tables are visible before L1 ptrs
Lance Yang <lance.yang@linux.dev>
mm/memory_hotplug: fix missing rollback in __add_pages()
Liu Dalin <liudalin@kylinsec.com.cn>
rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove
Alexandra Winter <wintera@linux.ibm.com>
s390/ism: Zerorize dmb at allocation
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Fix UAC2 mixer unit request handling
Venkat Rao Bagalkote <venkat88@linux.ibm.com>
powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard
Waiman Long <longman@redhat.com>
cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only
Ian Rogers <irogers@google.com>
perf build: Clean libperf-gtk.so in 'make clean'
Ian Rogers <irogers@google.com>
perf test code-reading: Fix duplicate kernel maps and machine leak
Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Set QP event handler before firmware QPC insertion
Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent
Yishai Hadas <yishaih@nvidia.com>
RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access
Phil Sutter <phil@nwl.cc>
netfilter: nfnetlink: Fix for interrupted hook dumps
Danish Khateeb <danishkhateeb03@gmail.com>
tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit
Andrei Vagin <avagin@google.com>
x86/fpu: Fix potential underflow in xstate_calculate_size()
Sudeep Holla <sudeep.holla@kernel.org>
ACPI: PCC: Free channel on OpRegion deactivation
Yibo Tan <lhfff@tju.edu.cn>
sysctl: unregister tables before freeing bitmap
Hao Sun <sunhao.th@gmail.com>
bpf: Fix uninit read for helper mem args on partially spilled slots
Hao Sun <sunhao.th@gmail.com>
bpf: Fix uninit read for non-fetch atomics on partially spilled slots
Alexei Starovoitov <ast@kernel.org>
bpf: Don't converge a loop on an iterator that was created anew
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register
Puranjay Mohan <puranjay@kernel.org>
bpf: Look at frame 0 when telling async callback entries apart
Yuan Chen <chenyuan@kylinos.cn>
bpf: Keep target extended until its last freplace link detaches
Myeonghun Pak <mhun512@gmail.com>
serial: sh-sci: Unregister UART on sysfs setup failure
Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
serial: txx9: Drop noop probe function and dangerous remove callback
Ahsan Atta <ahsan.atta@intel.com>
crypto: qat - hold cfg->lock when accessing config sections
Kim Wooseok <5mghybrid@khu.ac.kr>
wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors
Kim Wooseok <5mghybrid@khu.ac.kr>
wifi: rtl8xxxu: unwind incomplete receive startup
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()
Adrian Hunter <adrian.hunter@intel.com>
i3c: mipi-i3c-hci: Process multiple IBIs per interrupt
Leon Hwang <leon.hwang@linux.dev>
bpftool: Compute map size of light skeletons at runtime
Guixin Liu <kanie@linux.alibaba.com>
cxl/region: Unregister the pmem region when the bridge is unbound
Shakeel Butt <shakeel.butt@linux.dev>
kernfs: don't repeat or skip an entry when readdir resumes
Zizhi Wo <wozizhi@huawei.com>
md/raid5: reject a per-device size smaller than one chunk
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt1015: make control calibration failures observable
Alison Schofield <alison.schofield@intel.com>
cxl/port: Bound switch decoder target array access by nr_targets
Alison Schofield <alison.schofield@intel.com>
cxl/hdm: Restore commit_end when decoder enumeration fails
Alison Schofield <alison.schofield@intel.com>
cxl/hdm: Make switch decoder target parsing endian-safe
Takahiro Kuwano <takahiro.kuwano@infineon.com>
mtd: spi-nor: spansion: Remove s25fs256s0
Mahe Tardy <mahe.tardy@gmail.com>
libbpf: fix log level propagation for light skeleton loaders
Brian Norris <briannorris@chromium.org>
PM: runtime: Only queue an idle check for RPM-linked suppliers
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Rearrange acpi_bind_one() to avoid breakage
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Carry out companion lookup under bus_type_sem
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Rework the success message in acpi_device_notify()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Reduce debug noise from acpi_device_notify()
Linmao Li <lilinmao@kylinos.cn>
crypto: mxs-dcp - handle zero-length skcipher requests
Thomas Huth <thuth@redhat.com>
crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data
Eric Dumazet <edumazet@google.com>
sit: charge ip_tunnel_prl_entry allocations to memcg
Luca Weiss <luca.weiss@fairphone.com>
arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON
Baochen Qiang <baochen.qiang@oss.qualcomm.com>
wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor
Golla Nagendra <nagendra.golla@amd.com>
dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v alloc failure
Golla Nagendra <nagendra.golla@amd.com>
dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: sta32x: make power restoration transactional
Dave Jiang <dave.jiang@intel.com>
ACPI: APEI: GHES: Validate memory error section length before payload access
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup
Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete
Chengchang Tang <tangchengchang@huawei.com>
RDMA/hns: Fix missing CQE when UD QP use different SL
Jingbo Xu <jefflexu@linux.alibaba.com>
fuse: don't bump attr_version for async direct read completion
Davidlohr Bueso <dave@stgolabs.net>
cxl/test: Map mock device nodes to an online node
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Free event in jit_repipe_code_move()
Tapio Reijonen <tapio.reijonen@vaisala.com>
gpio: pcf857x: implement get_direction()
Darren Carreras <carrerasdarren@gmail.com>
libbpf: Avoid overflow in BTF.ext bounds check
Hui Su <sh_def@163.com>
perf evsel: Restrict incremental open error unwind
Salvatore Dipietro <dipiets@amazon.it>
mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations
Lance Yang <lance.yang@linux.dev>
khugepaged: fix readahead lock inversion in collapse_file()
Josef Bacik <josef@toxicpanda.com>
mm/userfaultfd: wake all waiters on unregister
Cunhao Lu <1579567540@qq.com>
can: skb: make echo skb freeing safe in any IRQ context
Daejun Park <daejun7.park@samsung.com>
xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks
Ian Bridges <icb@fastmail.org>
ksmbd: let the owner read and change the DACL when no ACE names it
Amir Goldstein <amir73il@gmail.com>
fs: don't fail __d_obtain_alias() for unlinked inodes
Georgia Garcia <georgia.garcia@canonical.com>
apparmor: fix profile leak when a policy load fails
Sinan Turunc <enscrpt@pm.me>
ALSA: ua101: Bound packet copies by the PCM buffer size
Josef Bacik <josef@toxicpanda.com>
mm/hugetlb: don't clear the resv_map of a VMA whose lock is held
Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
hwmon: (coretemp) Return -ENODATA for invalid temperature readings
Fabricio Akio <fabricioakio@gmail.com>
power: supply: qcom_smbx: set the charge enable after software control
Shen Lichuan <shenlichuan@vivo.com>
power: supply: Correct multiple typos in comments
Bradley Morgan <brads@mainlining.org>
panic: flatten nmi_panic control flow
Ridong Chen <chenridong@xiaomi.com>
mm/page_counter: avoid integer overflow in effective_protection()
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
mm/page_counter: move calculating protection values to page_counter
Guangshuo Li <lgs201920130244@gmail.com>
crypto: omap-des - fix crypto engine cleanup
Amir Goldstein <amir73il@gmail.com>
fs: make sure to call fsnotify_inoderemove() only once when inode is dead
David Woodhouse <dwmw@amazon.co.uk>
KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration
Sean Christopherson <seanjc@google.com>
KVM: VMX: Formally define KVM's "0xdead" exit reason used for failed VM-Enter
Sean Christopherson <seanjc@google.com>
x86/cpuid: Mark CPUID function 0x23 as being indexed
David Howells <dhowells@redhat.com>
rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data()
Abdifatah Suruur <suruurism@gmail.com>
smb: client: reject short SESSION_SETUP responses
Paulo Alcantara <pc@manguebit.org>
smb: client: reclaim credits for decrypted reads with no matching mid
Vernon Yang <yanglincheng@kylinos.cn>
mm: khugepaged: fix folio is used after pte_unmap_unlock()
Fan Wu <fanwu01@zju.edu.cn>
media: marvell: mcam: stop DMA and cancel s_bh_work before freeing DMA buffers
Aamir Ahmed <elb12345@hotmail.co.uk>
ksmbd: deny access for an empty DACL instead of granting the request
Christian Brauner <brauner@kernel.org>
coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps
Jan Beulich <jbeulich@suse.com>
Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages()
Jude Gyimah <jude.gyimah87@gmail.com>
ALSA: aw2-alsa: select SND_PCM
Guixiong Wei <weiguixiong@bytedance.com>
KEYS: do not let an unmatched key decide the search result
Manuel Ebner <manuelebnerli@mailbox.org>
docs, kprobes: Fix bracket
Wenwen Fu <wenwfu@qti.qualcomm.com>
tracing: skip boot kprobe setup when no events were requested
Eric Dumazet <edumazet@kernel.org>
nsh: limit recursion in nsh_gso_segment()
Iustin Stolniceanu <iustin.stolniceanu@analog.com>
net: phy: c45: select BASE-T1 type for the forced speed
Cosmin Ratiu <cratiu@nvidia.com>
net/mlx5e: IPsec, don't match upper proto selectors in crypto offload TX
Jiahao Xu <xujiahao@cmss.chinamobile.com>
net: usb: cdc_ncm: don't underflow the NDP room check
Wenbo Sun <sunwenbo@cmss.chinamobile.com>
amt: use ipv6_hdr() in amt_mldv1_leave_handler()
Kuniyuki Iwashima <kuniyu@google.com>
tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().
Uri Dar <udar@nvidia.com>
net/mlx5: Lag, Return error when enabling MPESW without LAG support
Junyoung Jang <graypanda.inzag@gmail.com>
igmp: use the joined device when leaving a multicast group
Ofri Zangi <ofriz@xsightlabs.com>
tls: fix async encryption race on weakly ordered architectures
Kalpesh Solanki <skalpesh942@gmail.com>
tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK
Avi Weiss <thnkslprpt@gmail.com>
net: ena: avoid RX copybreak for multi-descriptor packets
Breno Leitao <leitao@debian.org>
net: ena: Keep the RX buffer mapped if skb allocation fails
Omar Ramadan <omar@blockcast.net>
amt: tear down every amt device on an unregistering lower
Chris Mason <mason@kernel.org>
tcp: Drop any segments if DEFER_CONNECT is set.
LiangCheng Wang <zaq14760@gmail.com>
ASoC: max98090: keep the MIC boost across mic input power-up
Kavitha Daula <kavi@edera.dev>
xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync()
Pengpeng Hou <hppiscas@163.com>
drm/bridge: sii902x: validate I2S data lane values
Kyle Zeng <kylebot@openai.com>
udp: check frag_list IP family before using skb_segment_list()
Anandu Padinhare <Anandu.Padinhare@electrifex.com>
net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path
Eric Dumazet <edumazet@kernel.org>
net: gro: compare skb->protocol in gro_list_prepare()
Eric Dumazet <edumazet@kernel.org>
udp: do not use a cross-family sk_rx_dst in early demux
Eric Dumazet <edumazet@kernel.org>
fou: gue: check IP version of held packets for direct IP encapsulation
Cosmin Ratiu <cratiu@nvidia.com>
net/mlx5e: Serialize TC and IPsec offload exclusion counters
Yuho Choi <oss.patchbox@gmail.com>
ptp: kvm: x86: Leak clock_pair page if changing its encryption fails
Chase Hiltz <me@chasehil.tz>
ipv4: route: don't blackhole in-use routes when retiring fnhe routes
Changyul Lee <lcy8047@gmail.com>
net/mlx5: macsec: Don't remove fs_id when adding a rule fails
Umang Pokhriyal <umangpokhriyall@gmail.com>
tun: delete the flow entries of the moved queue on detach
Eric Dumazet <edumazet@kernel.org>
bonding: fix slave_cnt leak on XDP enslave failure
Denis V. Lunev <den@openvz.org>
ovl: release the upperdir/workdir in-use locks before the umount sync
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: mesh: don't linearize SKBs unnecessarily
Kyle Zeng <kylebot@openai.com>
ipvlan: make outbound skb headers writable
Kyle Zeng <kylebot@openai.com>
net: require a full socket in sock_confirm_neigh()
Kyle Zeng <kylebot@openai.com>
net: protect negative destination advice with RCU
Mark Bloch <mbloch@nvidia.com>
net/mlx5: Lag, free steering resources on LAG destroy failure
Li RongQing <lirongqing@baidu.com>
team: fix promisc/allmulti leak in team_port_add error path
Nikola Z. Ivanov <zlatistiv@gmail.com>
team: Add matching error label for failed action
Yaroslav Dudkov <aroslavdudkov622@gmail.com>
ipv6: ignore link state in gateway check
Kuniyuki Iwashima <kuniyu@google.com>
af_unix: Remove gc_in_progress check in unix_peek_fpl().
Chenguang Zhao <zhaochenguang@kylinos.cn>
i40e: xsk: fix multi-buffer XDP_PASS skb construction
Mark Korenberg <socketpair@gmail.com>
ublk: publish a new device by its id only once it is set up
Mike Christie <michael.christie@oracle.com>
ublk: Limit dev_id/ub_number values
Avi Weiss <thnkslprpt@gmail.com>
SUNRPC: Balance queue accounting when relocating a task
Avi Weiss <thnkslprpt@gmail.com>
SUNRPC: Balance switch queue length on transport removal
Avi Weiss <thnkslprpt@gmail.com>
SUNRPC: preserve transport security policy when cloning clients
Avi Weiss <thnkslprpt@gmail.com>
SUNRPC: preserve timeout policy when cloning clients
Avi Weiss <thnkslprpt@gmail.com>
SUNRPC: wake poll waiters when an empty pipe is unlinked
Avi Weiss <thnkslprpt@gmail.com>
NFS: restore directory index when resuming readdir
Avi Weiss <thnkslprpt@gmail.com>
NFS: Fix inverted cross-directory rename check
Avi Weiss <thnkslprpt@gmail.com>
NFSv4.1: retain MDS I/O until both thresholds are met
Tyler Baker <tyler.baker@oss.qualcomm.com>
ASoC: soc-core: copy the DAI link names into the card
Dmitry Torokhov <dmitry.torokhov@gmail.com>
gpiolib: of: return -ENOENT from of_gpio_count() stub
Yifan Zhang <yfzhang23@stu.pku.edu.cn>
tracing/probes: bound symstr stores to reserved length
Shao Mingyin <shao.mingyin@zte.com.cn>
ata: libata-scsi: set the field pointer when rejecting CDL
Niklas Cassel <cassel@kernel.org>
ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers
Niklas Cassel <cassel@kernel.org>
ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length
Niklas Cassel <cassel@kernel.org>
ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages
Niklas Cassel <cassel@kernel.org>
ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit
Niklas Cassel <cassel@kernel.org>
ata: libata-scsi: do not accept subpage code FFh in MODE SELECT
Niklas Cassel <cassel@kernel.org>
ata: libata-scsi: fix MODE SELECT handling of data after the mode page
Alexei Starovoitov <ast@kernel.org>
ipv6: Check the Home Address option again before its address is used
Eric Dumazet <edumazet@kernel.org>
calipso: do not charge request socket options to the listener
Or Har-Toov <ohartoov@nvidia.com>
net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum
Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
net/mlx5e: IPoIB, Fix QPN lookup race
Kyle Pepper <cochcoder@proton.me>
Bluetooth: reject invalid LE supervision timeout relationships
Christian Loehle <christian.loehle@arm.com>
cpufreq: Serialize global boost updates
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: Force sync policy boost with global boost on sysfs update
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: staticize cpufreq_boost_trigger_state()
Dhruva Gole <d-gole@ti.com>
cpufreq: make cpufreq_boost_enabled() return bool
Sandipan Das <sandipan.das@amd.com>
perf/x86/amd/uncore: Avoid context migration from non-owners
Sandipan Das <sandipan.das@amd.com>
perf/x86/amd/uncore: Move discovery and registration
Peter Zijlstra <peterz@infradead.org>
locking/osq: Fix unlink queue corruption
Peter Zijlstra <peterz@infradead.org>
locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering
David Laight <David.Laight@ACULAB.COM>
locking/osq_lock: Clarify osq_wait_next() calling convention
Thomas Fourier <fourier.thomas@gmail.com>
net/mlx5e: TC, Fix double free of branch in failure
Eric Dumazet <edumazet@kernel.org>
tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND
Hui Su <sh_def@163.com>
sched/pelt: Fix u32 truncation of the PELT period count
Jeff Layton <jlayton@kernel.org>
statx: don't leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask
Hungyu Lin <dennylin0707@gmail.com>
vfs: preserve subsecond timestamps at filesystem time limits
Abbott Liu <liuwenliang@huawei.com>
initrd: flush deferred fput() before mounting root
Christian Brauner <brauner@kernel.org>
init: flush async file closing
Florian Fainelli <f.fainelli@gmail.com>
MIPS: SB1250: Validate and update IRQ affinity
Florian Fainelli <f.fainelli@gmail.com>
MIPS: Alchemy: Save the Ethernet address before reusing PROM memory
Rosen Penev <rosenp@gmail.com>
MIPS: Avoid dead code/data elimination when using recordmcount
Eric Dumazet <edumazet@kernel.org>
tcp: ipv6: free ireq->ipv6_opt after an RCU grace period
Florian Westphal <fw@strlen.de>
netfilter: nat: zero newrange before filling it in
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload
Joas Antonio dos Santos <joasantonio108@gmail.com>
netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport()
Fernando Fernandez Mancera <fmancera@suse.de>
netfilter: x_tables: check target name before accessing verdict
Laveesh Bansal <laveeshb@laveeshbansal.com>
netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag()
Qingfang Deng <qingfang.deng@linux.dev>
tcp: initialize send sequence numbers before deferring TFO
Cheng Yongkang <teel4res@gmail.com>
net: bridge: disable MRP ports before the FDB flush in del_nbp()
Kyle Zeng <kylebot@openai.com>
ip6mr: Serialize multicast router socket ownership
Timur Stukan <timur.stukan.linux@gmail.com>
bonding: 3ad: don't set BOND_LINK_FAIL on a slave that is not up
Colton Pawielski <colton.pawielski@gmail.com>
net: 8139cp: keep Rx masked while NAPI is scheduled
Richard Fitzgerald <rf@opensource.cirrus.com>
ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()
Michał Kopeć <michal.kopec@3mdeb.com>
ALSA: hda/core: Stop capability walk on empty capability header
Munique Feitoza <muniquefeitoz4@gmail.com>
drm/nouveau: Fix CE channel creation on pre-Kepler GPUs
Rosen Penev <rosenp@gmail.com>
drm/nouveau/fifo: map Kepler video engine contexts non-privileged
Frederic Konrad <fkonrad@amd.com>
spi: cadence-quadspi: Fix race between DMA completion and transfer start
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: Fix not updating of hdev->commands[] after reset
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: restore the NSP IMP port 2 Gbps mode
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: Force flow control for BCM5301X CPU port(s)
Florian Fainelli <florian.fainelli@broadcom.com>
net: ethernet: bgmac: preserve forced 2.5 Gbps link speed
Zhao Li <enderaoelyther@gmail.com>
Bluetooth: L2CAP: Clear request identifiers on incoming LE connections
Zijun Hu <zijun.hu@oss.qualcomm.com>
Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path
Richard Fitzgerald <rf@opensource.cirrus.com>
ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add()
Sasha Levin <sashal@kernel.org>
ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online()
Sasha Levin <sashal@kernel.org>
ACPI: scan: Print the offline failure message in acpi_bus_offline()
Richard Fitzgerald <rf@opensource.cirrus.com>
firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
Mario Limonciello <mario.limonciello@amd.com>
drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence
Kuniyuki Iwashima <kuniyu@google.com>
ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow().
Zhou Minqiang <zhouminqiang2@huawei.com>
PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove
Avi Weiss <thnkslprpt@gmail.com>
net: skbuff: reject zero MPLS TTL before decrementing
Guillaume Nault <gnault@redhat.com>
tcp: Fix dup-ack detection on non-SACK bidirectional data transfer.
James Clark <jjc@jclark.com>
net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes
Chris Mason <mason@kernel.org>
nvmet-rdma: disconnect a queue on device removal
Bjorn Helgaas <bhelgaas@google.com>
nvme: fix various comment typos
Chris Mason <mason@kernel.org>
nvmet-rdma: queue the release work under the mutex
Chris Mason <mason@kernel.org>
nvmet-rdma: take a device off the list last
Josef Bacik <josef@toxicpanda.com>
nvmet-tcp: limit the connections accepted per work run
Chris Mason <mason@kernel.org>
nvmet-rdma: disconnect only established queues
Alexander Goodkind <alex@goodkind.io>
net: ethernet: mediatek: preserve sibling PPE bindings
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: Enable IGMP and MLD control packet CPU copies
Kyle Zeng <kylebot@openai.com>
tcp: wait for TIME_WAIT teardown before freeing per-netns ehash
Niklas Cassel <cassel@kernel.org>
null_blk: don't finish zones to set them read-only or offline
Niklas Cassel <cassel@kernel.org>
null_blk: fix opening closed zones at the active zone limit
Nguyen Dinh Phi <phind.uet@gmail.com>
vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT
Zizhi Wo <wozizhi@huawei.com>
block: partitions: reject GPT entries with starting_lba > ending_lba
Shao Mingyin <shao.mingyin@zte.com.cn>
virtio-blk: Fix zone append sector reporting in batched completion
Josef Bacik <josef@toxicpanda.com>
ext2: only flush DIRSYNC directories on every change
Linfeng Sun <linfeng.sun.dev@gmail.com>
vhost-vdpa: initialize state before publishing cdev
Linfeng Sun <linfeng.sun.dev@gmail.com>
vhost: reject backend enable without a kick file
Linfeng Sun <linfeng.sun.dev@gmail.com>
vhost-scsi: reject delayed virtqueue setup
Linfeng Sun <linfeng.sun.dev@gmail.com>
vhost-scsi: validate event queue descriptor direction
Eric Dumazet <edumazet@kernel.org>
soreuseport: annotate data-races around reuse->socks[] and num_socks
Yifan Zhang <yfzhang23@stu.pku.edu.cn>
ksmbd: require NUL-terminated EA names
Aaditya Kansal <aadityakansal390@gmail.com>
ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server
Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Bluetooth: validate retained LE Set CIG Parameters command length
Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Bluetooth: validate retained LE Create CIS command length
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: hci_core: Initialize advertising RPA work only once
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: hci_sync: Copy the resolving-list IRK under RCU
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: hci_core: Keep link-key filtering inside RCU
Tobias Wilken <tooangel@tooangel.de>
Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller
Shuai Zhang <shuai.zhang@oss.qualcomm.com>
Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: hci_sync: Protect resolving-list lookups
Kevin Dewald <kevin@simpleble.org>
Bluetooth: hci_event: Clear explicit connect state on LE connection
Catherine L <catherine.l@intel.com>
Bluetooth: btintel: fix buffer over-read in fw payload
Akhil Arul <akhilarul324@gmail.com>
Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained
Ying Hsu <yinghsu@chromium.org>
Bluetooth: Add vendor-specific packet classification for ISO data
Kiran K <kiran.k@intel.com>
Bluetooth: btintel: Add support for BlazarI
Binbin Deng <18983559317@163.com>
Bluetooth: hci_core: Initialize LTK before publication
Binbin Deng <18983559317@163.com>
Bluetooth: hci_core: Initialize link key before publication
Binbin Deng <18983559317@163.com>
Bluetooth: hci_core: Initialize IRK before publication
Jerome Brunet <jbrunet@baylibre.com>
ASoC: meson: axg-fifo: request the irq with the clock enabled
Bryam Vargas <hexlabsecurity@proton.me>
net/iucv: take a private, writable frame before rewriting it in place
Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
gpio: mpc8xxx: Fix potential use-after-free of IRQ domain
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
gpio: mpc8xxx: use a helper variable to store the address of pdev->dev
Martyn Welch <martyn.welch@collabora.com>
gpio: mpc8xxx: Add wake on GPIO support
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
gpio: mpc8xxx: Convert to platform remove callback returning void
Daniel Machon <daniel.machon@microchip.com>
net: sparx5/lan969x: release the in-flight slot of a stale TX skb
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
regulator: qcom_spmi: don't take a sleeping lock in the SAW IPI
Rob Herring (Arm) <robh@kernel.org>
regulator: qcom_spmi: Drop unnecessary of_find_property() call
Yuho Choi <oss.patchbox@gmail.com>
virtio_blk: Reset device on probe error paths after DRIVER_OK
Yu Zhang <yuz08559@gmail.com>
vhost-vdpa: drop the parent's vq callback before the call fd is released
Sean Christopherson <seanjc@google.com>
irqbypass: Take ownership of producer/consumer token tracking
Linfeng Sun <linfeng.sun.dev@gmail.com>
vhost: reject invalid IOTLB update permissions
Xiang Mei <xmei5@asu.edu>
vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit()
Jia Jia <physicalmtea@gmail.com>
vhost-scsi: do not relock event vq mutex on send_evt fallback
Jia Jia <physicalmtea@gmail.com>
vhost-scsi: preserve event ordering
Linfeng Sun <linfeng.sun.dev@gmail.com>
vdpa_sim: serialize IOTLB updates with dataplane access
Alex Austin <alex.austin@amd.com>
sfc: ptp: avoid racing PPS timestamp updates
Alex Austin <alex.austin@amd.com>
sfc: ptp: serialize host and MC synchronization transactions
Alex Austin <alex.austin@amd.com>
sfc: ptp: drop the stale frequency reset in efx_ptp_start()
Vladimir Zapolskiy <vz@kernel.org>
drm/panel: visionox-r66451: Wait longer after the panel reset
Vladimir Zapolskiy <vz@kernel.org>
drm/panel: visionox-r66451: Send the brightness value MSB first
Daniel Machon <daniel.machon@microchip.com>
net: lan966x: don't free XDP buffers in fdma tx clear with budget 0
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
net: stmmac: copy XDP metadata in AF_XDP zero-copy RX
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
net: stmmac: drop split frames on AF_XDP zero-copy RX
Furong Xu <0x1207@gmail.com>
net: stmmac: Set dma_sync_size to zero for discarded frames
Niklas Cassel <cassel@kernel.org>
ata: libata-eh: Retry non-NCQ commands when their sense data asks for it
Igor Pylypiv <ipylypiv@google.com>
ata: libata-sata: allow re-enabling NCQ with the same queue_depth
Eric Dumazet <edumazet@kernel.org>
tcp: do not let tcp_collapse() drive sk_forward_alloc negative
Joas Antonio dos Santos <joasantonio108@gmail.com>
net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period
Yuqiang Sun <izaiahsun@gmail.com>
bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom
Rosen Penev <rosenp@gmail.com>
spi: acpi: only look up the IRQ of confirmed SPI devices
Alban Bedel <alban.bedel@lht.dlh.de>
spi: Fix ACPI SPI resources using relative path
Chris Mason <mason@kernel.org>
bpf: Check the offset in bpf_skb_generic_{push,pop}()
Chris Mason <mason@kernel.org>
bpf: Move the transport header with the moved headers
Alexei Starovoitov <ast@kernel.org>
bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol
Alexei Starovoitov <ast@kernel.org>
bpf: Reset skb->cb after an lwt prog pushes an IP header
Guillaume Nault <gnault@redhat.com>
ipv4: Convert ip_route_input_noref() to dscp_t.
Ido Schimmel <idosch@nvidia.com>
ipv4: Unmask upper DSCP bits in input route lookup
Alexei Starovoitov <ast@kernel.org>
bpf: Don't leave a stale MAC header in bpf_lwt_push_ip_encap()
Chris Mason <mason@kernel.org>
bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh()
Alexei Starovoitov <ast@kernel.org>
bpf: Don't look for the SRH again in the End.BPF helpers
Chris Mason <mason@kernel.org>
bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh()
Chris Mason <mason@kernel.org>
bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6
Alexei Starovoitov <ast@kernel.org>
bpf: Don't let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS
Chris Mason <mason@kernel.org>
bpf, cgroup: Keep the skb network offset signed
Chris Mason <mason@kernel.org>
bpf: Require prog fd or capability for cgroup detach
Hongjian Dai <daihongjian@kylinsec.com.cn>
spi: pic32-sqi: fail transfer when the BD ring is exhausted
Tung Nguyen <tung.quang.nguyen@est.tech>
tipc: reject attaching bearer of different media to the same occupied device
Jia Jia <physicalmtea@gmail.com>
scsi: target: Validate REGISTER AND MOVE TransportID length
James Hilliard <james.hilliard1@gmail.com>
ptp: vclock: serialize extended samples with counter updates
James Hilliard <james.hilliard1@gmail.com>
ptp: vclock: propagate physical clock sampling errors
James Hilliard <james.hilliard1@gmail.com>
ptp: unwind partially completed virtual clock creation
James Hilliard <james.hilliard1@gmail.com>
ptp: drain virtual clock sysfs operations before unregistering children
Zhi-Jun You <hujy652@gmail.com>
net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986
Lorenzo Bianconi <lorenzo@kernel.org>
net: ethernet: mtk_wed: introduce versioning utility routines
Zhi-Jun You <hujy652@gmail.com>
net: ethernet: mtk_wed: free up rings during detach
Zhi-Jun You <hujy652@gmail.com>
net: ethernet: mtk_wed: fix reset condition for rx wdma
Thomas Fourier <fourier.thomas@gmail.com>
btrfs: zoned: fix double free of bitmaps on clone failure
Filipe Manana <fdmanana@suse.com>
btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing
guolingxing <guolingxing@tju.edu.cn>
btrfs: verity: propagate orphan insertion errors when enabling verity
Avi Weiss <thnkslprpt@gmail.com>
gpio: omap: Propagate runtime PM failures in probe and request
Andrea Mayer <andrea.mayer@uniroma2.it>
seg6: fix transport header for inner IPv4 with IP options
Filippo Falezza <effeffe99@gmail.com>
wifi: ath10k: Stop unanswered temperature reads
Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
9p: do not store the create fid on special files
Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
9p: fall back to the normal open path for non-regular files
Matthew Whitehead <tedheadster@gmail.com>
scsi: aha1542: Remove unneeded scsi_dma_unmap() call
Imre Kaloz <kaloz@kernel.org>
scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
Mehmet Fide <mehmet.fide@screeningeagle.com>
wifi: ath9k_htc: start ANI when an AP interface begins to beacon
Deepanshu Kartikey <kartikey406@gmail.com>
batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
Shubham Antil <shubham@octane.security>
xfrm: zero-initialise km_event in the replay-notify path
Haobin Wu <853555@gmail.com>
9p: skip intermediate directory entry name copy in p9dirent_read()
Eric Van Hensbergen <ericvh@kernel.org>
fs/9p: rework qid2ino logic
Eric Van Hensbergen <ericvh@kernel.org>
fs/9p: switch vfsmount to use v9fs_get_new_inode
Feng Ning <feng@innora.ai>
staging: media: atomisp: use array3_size() for overflow-safe allocation
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: destroy force-feedback device on input unregistration
Marek Behún <kabel@kernel.org>
net: sfp: add quirk for Lantech 8330-265D
Shakeel Butt <shakeel.butt@linux.dev>
io_uring/sqpoll: do the return-to-userspace work in the SQPOLL thread
Jens Axboe <axboe@kernel.dk>
io_uring: fix task_work add use-after-free with SQPOLL
Gabriel Krisman Bertazi <krisman@suse.de>
io_uring/sqpoll: Increase task_work submission batch size
Pavel Begunkov <asml.silence@gmail.com>
io_uring/sqpoll: zero sqd->thread on tctx errors
Pavel Begunkov <asml.silence@gmail.com>
io_uring: don't touch sqd->thread off tw add
Jens Axboe <axboe@kernel.dk>
io_uring/sqpoll: ensure task state is TASK_RUNNING when running task_work
Jens Axboe <axboe@kernel.dk>
io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI
Jens Axboe <axboe@kernel.dk>
io_uring/sqpoll: ensure that normal task_work is also run timely
Jens Axboe <axboe@kernel.dk>
io_uring/sqpoll: early exit thread if task_context wasn't allocated
Jens Axboe <axboe@kernel.dk>
io_uring/sqpoll: use the correct check for pending task_work
Jens Axboe <axboe@kernel.dk>
io_uring: wake SQPOLL task when task_work is added to an empty queue
Jens Axboe <axboe@kernel.dk>
io_uring/sqpoll: manage task_work privately
Jens Axboe <axboe@kernel.dk>
io_uring: pass in counter to handle_tw_list() rather than return it
Jens Axboe <axboe@kernel.dk>
io_uring: cleanup handle_tw_list() calling convention
Cheng Yongkang <teel4res@gmail.com>
io_uring/rsrc: keep the old file when a file update fails
Cheng Yongkang <teel4res@gmail.com>
io_uring/timeout: don't rearm a multishot timeout on cancel
Yang Xiuwei <yangxiuwei@kylinos.cn>
io_uring/rw: fail soft links on IOPOLL short or error IO
Yang Xiuwei <yangxiuwei@kylinos.cn>
io_uring: fail soft links on negative IOU_COMPLETE results
Jens Axboe <axboe@kernel.dk>
io_uring: enable toggle of iowait usage when waiting on CQEs
Hui Peng <benquike@gmail.com>
udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()
Jan Kara <jack@suse.cz>
udf: validate VAT inode size for old VAT format
Lance Yang <lance.yang@linux.dev>
mm/ksm: fix userfaultfd protection during merge and unmerge
Vladimir Petrzhikovskii <vladimir@dfb.sh>
virtio_net: check RX buffer length before DMA sync
Zizhi Wo <wozizhi@huawei.com>
fs: aio: reject partial mremap to avoid Null-pointer-dereference error
Jerome Marchand <jmarchan@redhat.com>
bpf: Specify access type of bpf_sysctl_get_name args
Shuran Liu <electronlsr@gmail.com>
bpf: Fix verifier assumptions of bpf_d_path's output buffer
Pengpeng Hou <hppiscas@163.com>
irqchip/sifive-plic: Avoid signed shift in interrupt enable mask
Johannes Weiner <hannes@cmpxchg.org>
mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES
Sasha Levin <sashal@kernel.org>
bpf: Drop inet_conn_established from lsm sleepable hooks
Zesen Liu <ftyghome@gmail.com>
bpf: Fix memory access flags in helper prototypes
Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
drm/amdgpu: Check cs flags.
Chris Mason <mason@kernel.org>
mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nft_ct: move custom expectation support to helper
Florian Westphal <fw@strlen.de>
netfilter: nft_ct: expectation timeouts are passed in milliseconds
-------------
Diffstat:
Documentation/arch/arm64/silicon-errata.rst | 4 +
.../bindings/iio/adc/aspeed,ast2600-adc.yaml | 17 +
Documentation/hwmon/coretemp.rst | 3 +
Documentation/networking/rxrpc.rst | 8 +-
Documentation/networking/tls-offload.rst | 16 +-
Documentation/trace/boottime-trace.rst | 8 +-
Documentation/trace/kprobes.rst | 2 +-
Makefile | 4 +-
arch/arc/include/asm/io.h | 13 +-
arch/arm/kernel/hw_breakpoint.c | 8 +-
arch/arm64/Kconfig | 32 ++
arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 4 +
arch/arm64/include/asm/kexec.h | 2 +
arch/arm64/kernel/cpu_errata.c | 20 +
arch/arm64/kernel/cpufeature.c | 3 +-
arch/arm64/kernel/hw_breakpoint.c | 4 +-
arch/arm64/kernel/machine_kexec.c | 7 +-
arch/arm64/kernel/ptrace.c | 8 +-
arch/arm64/kernel/relocate_kernel.S | 11 +-
arch/arm64/kernel/suspend.c | 23 +-
arch/arm64/kernel/topology.c | 3 +-
arch/arm64/kernel/vmlinux.lds.S | 5 +-
arch/arm64/tools/cpucaps | 1 +
arch/mips/Kconfig | 2 +-
arch/mips/alchemy/common/prom.c | 23 +-
arch/mips/sibyte/sb1250/irq.c | 3 +
arch/parisc/kernel/entry.S | 4 -
arch/parisc/kernel/ftrace.c | 2 +-
arch/parisc/kernel/irq.c | 4 +-
arch/powerpc/include/asm/hw_irq.h | 2 +-
arch/powerpc/include/asm/interrupt.h | 5 +-
arch/powerpc/kernel/eeh.c | 6 +-
arch/powerpc/kernel/module_32.c | 3 +
arch/powerpc/kernel/watchdog.c | 3 +
arch/powerpc/kvm/book3s_64_mmu_hv.c | 33 +-
arch/powerpc/kvm/book3s_hv.c | 4 +-
arch/powerpc/kvm/book3s_hv_nested.c | 34 +-
arch/powerpc/kvm/book3s_xive.c | 5 +-
arch/powerpc/xmon/xmon.c | 3 +-
arch/riscv/kernel/efi.c | 2 +-
arch/s390/appldata/appldata_base.c | 12 +-
arch/s390/kernel/cert_store.c | 108 ++--
arch/x86/events/amd/uncore.c | 570 +++++++++++++--------
arch/x86/include/asm/cpuid.h | 1 +
arch/x86/include/asm/vmx.h | 8 +
arch/x86/kernel/apic/msi.c | 2 +-
arch/x86/kernel/cpu/mce/core.c | 18 +-
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 3 +-
arch/x86/kernel/fpu/xstate.c | 8 +-
arch/x86/kernel/ldt.c | 12 +-
arch/x86/kvm/vmx/vmx.c | 4 +-
arch/x86/kvm/x86.c | 4 +-
arch/x86/kvm/xen.c | 4 +
block/blk-cgroup.c | 13 +-
block/blk-iocost.c | 117 ++++-
block/blk-iolatency.c | 3 +-
block/blk-mq.c | 12 +-
block/blk-throttle.c | 18 +
block/partitions/efi.c | 1 +
crypto/essiv.c | 2 +-
drivers/acpi/acpi_pcc.c | 13 +
drivers/acpi/apei/ghes.c | 41 ++
drivers/acpi/device_pm.c | 23 +-
drivers/acpi/glue.c | 140 +++--
drivers/acpi/scan.c | 108 +++-
drivers/ata/libata-eh.c | 16 +-
drivers/ata/libata-sata.c | 2 +-
drivers/ata/libata-scsi.c | 180 ++++---
drivers/base/power/runtime.c | 14 +-
drivers/base/swnode.c | 7 +-
drivers/block/null_blk/zoned.c | 48 +-
drivers/block/ublk_drv.c | 33 +-
drivers/block/virtio_blk.c | 25 +-
drivers/block/zram/zram_drv.c | 115 ++---
drivers/bluetooth/btintel.c | 52 +-
drivers/bluetooth/btmtk.c | 74 ++-
drivers/bluetooth/btusb.c | 10 +-
drivers/bluetooth/hci_qca.c | 6 +
drivers/char/tpm/eventlog/acpi.c | 4 +-
drivers/char/tpm/eventlog/tpm1.c | 7 +
drivers/char/tpm/tpm-dev-common.c | 12 +-
drivers/comedi/drivers/addi_apci_1500.c | 2 +-
drivers/comedi/drivers/comedi_bond.c | 24 +-
drivers/comedi/drivers/ni_660x.c | 3 +-
drivers/comedi/drivers/ni_tio.c | 2 +-
drivers/comedi/drivers/vmk80xx.c | 25 +-
drivers/cpufreq/acpi-cpufreq.c | 9 +-
drivers/cpufreq/cppc_cpufreq.c | 14 +-
drivers/cpufreq/cpufreq.c | 164 ++++--
drivers/cpufreq/freq_table.c | 4 +
drivers/cpufreq/intel_pstate.c | 40 +-
drivers/crypto/caam/caampkc.c | 75 ++-
drivers/crypto/inside-secure/safexcel_hash.c | 3 +
drivers/crypto/intel/qat/qat_common/adf_cfg.c | 49 +-
drivers/crypto/mxs-dcp.c | 3 +
drivers/crypto/omap-des.c | 2 +
drivers/cxl/core/hdm.c | 38 +-
drivers/cxl/core/port.c | 20 +-
drivers/cxl/core/region.c | 6 +-
drivers/dma/idxd/cdev.c | 1 +
drivers/dma/sh/rcar-dmac.c | 4 +-
drivers/dma/ste_dma40.c | 179 ++++++-
drivers/dma/ste_dma40_ll.c | 8 +-
drivers/dma/ste_dma40_ll.h | 2 +-
drivers/dma/stm32-mdma.c | 1 +
drivers/dma/xilinx/zynqmp_dma.c | 19 +-
drivers/edac/i5000_edac.c | 4 +-
drivers/firmware/arm_scmi/notify.c | 4 +-
drivers/firmware/cirrus/cs_dsp.c | 6 +
drivers/gpio/gpio-brcmstb.c | 1 +
drivers/gpio/gpio-davinci.c | 4 +-
drivers/gpio/gpio-ljca.c | 11 +-
drivers/gpio/gpio-mpc8xxx.c | 97 ++--
drivers/gpio/gpio-mvebu.c | 24 +-
drivers/gpio/gpio-omap.c | 13 +-
drivers/gpio/gpio-pcf857x.c | 16 +-
drivers/gpio/gpio-rockchip.c | 15 +-
drivers/gpio/gpio-sodaville.c | 9 +-
drivers/gpio/gpio-virtio.c | 13 +-
drivers/gpio/gpiolib-of.h | 2 +-
drivers/gpio/gpiolib.c | 2 +
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 13 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 33 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +-
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 +-
drivers/gpu/drm/amd/amdgpu/soc21.c | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 7 +-
.../drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 68 ++-
drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +
.../drm/amd/display/modules/freesync/freesync.c | 12 +-
.../gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 14 +-
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 20 +-
drivers/gpu/drm/bridge/sii902x.c | 8 +-
drivers/gpu/drm/gud/gud_drv.c | 13 +-
drivers/gpu/drm/i915/i915_vma.c | 2 +-
drivers/gpu/drm/i915/i915_vma_types.h | 3 +
drivers/gpu/drm/meson/meson_encoder_dsi.c | 2 +-
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 49 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 33 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +-
drivers/gpu/drm/nouveau/nouveau_sched.c | 6 +-
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 13 +
drivers/gpu/drm/panel/panel-visionox-r66451.c | 4 +-
drivers/gpu/drm/panfrost/panfrost_drv.c | 11 +
drivers/gpu/drm/radeon/radeon_atombios.c | 22 +-
drivers/gpu/drm/radeon/radeon_atpx_handler.c | 13 +-
drivers/gpu/drm/vc4/vc4_bo.c | 43 +-
drivers/gpu/drm/vc4/vc4_drv.h | 15 +-
drivers/gpu/drm/vc4/vc4_gem.c | 20 +-
drivers/gpu/drm/vc4/vc4_validate.c | 15 +-
drivers/gpu/drm/vc4/vc4_validate_shaders.c | 7 +-
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 200 ++++++++
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 11 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 5 +-
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 21 +-
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 28 +-
drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 13 +-
drivers/hid/hid-letsketch.c | 21 +-
drivers/hid/hid-sensor-custom.c | 133 +++--
drivers/hid/hid-sensor-hub.c | 27 +-
drivers/hid/hid-vivaldi-common.c | 91 ++--
drivers/hwmon/ads7871.c | 4 +-
drivers/hwmon/aht10.c | 2 +-
drivers/hwmon/coretemp.c | 21 +-
drivers/hwmon/dell-smm-hwmon.c | 3 +
drivers/hwmon/max31760.c | 12 +-
drivers/hwmon/nct6775-core.c | 16 +-
drivers/hwmon/pmbus/mp2975.c | 207 ++++----
drivers/hwmon/scmi-hwmon.c | 12 +-
drivers/hwmon/sht3x.c | 4 +-
drivers/hwmon/sy7636a-hwmon.c | 2 +-
drivers/hwmon/w83791d.c | 4 +-
drivers/hwmon/w83792d.c | 4 +-
drivers/i3c/master/mipi-i3c-hci/dma.c | 40 +-
drivers/iio/accel/kxsd9.c | 2 +-
drivers/iio/adc/ad7923.c | 1 +
drivers/iio/addac/ad74413r.c | 2 +-
drivers/iio/afe/iio-rescale.c | 3 +-
drivers/iio/chemical/atlas-ezo-sensor.c | 3 -
.../iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 +-
.../iio/common/hid-sensors/hid-sensor-attributes.c | 16 +-
.../iio/common/inv_sensors/inv_sensors_timestamp.c | 134 +++--
drivers/iio/common/ms_sensors/ms_sensors_i2c.c | 2 +-
drivers/iio/common/scmi_sensors/scmi_iio.c | 27 +-
drivers/iio/dac/mcp4725.c | 2 +
drivers/iio/gyro/bmg160_core.c | 2 +-
drivers/iio/humidity/am2315.c | 12 +-
drivers/iio/humidity/hid-sensor-humidity.c | 14 +-
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 24 +-
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 82 ++-
drivers/iio/imu/kmx61.c | 2 +-
drivers/iio/industrialio-trigger.c | 4 +-
drivers/iio/light/tsl2591.c | 32 +-
drivers/iio/light/vcnl4035.c | 4 +-
drivers/iio/magnetometer/mmc35240.c | 3 +-
drivers/iio/proximity/sx9324.c | 13 +-
drivers/iio/proximity/sx9360.c | 30 +-
drivers/iio/proximity/sx9500.c | 6 +
drivers/iio/temperature/hid-sensor-temperature.c | 14 +-
drivers/iio/temperature/mlx90614.c | 2 +-
drivers/infiniband/core/rdma_core.c | 2 +
drivers/infiniband/hw/hns/hns_roce_device.h | 1 +
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 15 +-
drivers/infiniband/hw/mlx5/devx.c | 6 +-
drivers/infiniband/hw/mlx5/fs.c | 3 +
drivers/infiniband/hw/mlx5/main.c | 50 +-
drivers/infiniband/hw/mlx5/qp.c | 22 +-
drivers/infiniband/hw/mlx5/qpc.c | 10 +
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 6 +-
drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c | 3 +-
drivers/infiniband/sw/siw/siw.h | 1 +
drivers/infiniband/sw/siw/siw_mem.c | 2 +-
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 45 +-
drivers/infiniband/ulp/srpt/ib_srpt.c | 21 +-
drivers/infiniband/ulp/srpt/ib_srpt.h | 4 +-
drivers/input/ff-core.c | 2 +-
drivers/input/ff-memless.c | 10 +-
drivers/input/input.c | 2 +
drivers/input/joystick/xpad.c | 1 +
drivers/input/misc/da7280.c | 1 -
drivers/input/mouse/cyapa.c | 4 +-
drivers/input/mouse/trackpoint.c | 2 +
drivers/input/mouse/trackpoint.h | 1 +
drivers/input/touchscreen/goodix_fwupload.c | 4 +-
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 +-
drivers/iommu/iommufd/device.c | 6 +-
drivers/irqchip/irq-gic-v4.c | 39 +-
drivers/irqchip/irq-mst-intc.c | 3 +
drivers/irqchip/irq-sifive-plic.c | 2 +-
drivers/mailbox/arm_mhu_db.c | 1 -
drivers/mailbox/qcom-ipcc.c | 5 +-
drivers/md/dm-cache-metadata.c | 4 +-
drivers/md/dm-cache-target.c | 15 +-
drivers/md/dm-crypt.c | 17 +-
drivers/md/dm-integrity.c | 30 +-
drivers/md/dm-ioctl.c | 2 +-
drivers/md/dm-log-userspace-base.c | 6 +-
drivers/md/dm-mpath.c | 6 +-
drivers/md/dm-raid.c | 10 +-
drivers/md/dm-snap.c | 18 +-
drivers/md/dm-sysfs.c | 17 +-
drivers/md/dm-table.c | 146 +++---
drivers/md/dm-thin-metadata.c | 5 +-
drivers/md/dm-thin.c | 7 +-
drivers/md/dm-verity-target.c | 27 +-
drivers/md/dm-zone.c | 2 +
drivers/md/dm-zoned-reclaim.c | 18 +-
drivers/md/dm.c | 4 +-
drivers/md/dm.h | 18 +-
drivers/md/md.c | 53 +-
drivers/md/md.h | 3 +-
drivers/md/persistent-data/dm-btree-remove.c | 13 +-
drivers/md/persistent-data/dm-btree.c | 8 +-
drivers/md/persistent-data/dm-space-map-common.c | 9 +-
drivers/md/raid5.c | 7 +
drivers/media/cec/core/cec-adap.c | 10 +-
drivers/media/platform/marvell/mcam-core.c | 14 +-
drivers/media/platform/verisilicon/imx8m_vpu_hw.c | 2 +-
drivers/memory/tegra/tegra210-emc-core.c | 16 +-
drivers/misc/bcm-vk/bcm_vk_sg.c | 43 +-
drivers/misc/ibmvmc.c | 16 +-
drivers/misc/vmw_vmci/vmci_event.c | 7 +-
drivers/mmc/host/jz4740_mmc.c | 5 +-
drivers/mmc/host/meson-gx-mmc.c | 26 +-
drivers/mmc/host/mmci.c | 4 +-
drivers/mmc/host/omap.c | 4 +-
drivers/mmc/host/sdhci-esdhc-imx.c | 17 +
drivers/mmc/host/sunxi-mmc.c | 36 +-
drivers/mtd/mtdcore.c | 1 +
drivers/mtd/spi-nor/spansion.c | 4 -
drivers/net/amt.c | 61 +--
drivers/net/bonding/bond_main.c | 24 +-
drivers/net/can/dev/skb.c | 6 +-
drivers/net/dsa/b53/b53_common.c | 112 +++-
drivers/net/dsa/b53/b53_priv.h | 1 +
drivers/net/dsa/b53/b53_regs.h | 18 +
drivers/net/dsa/b53/b53_srab.c | 2 +-
drivers/net/dsa/bcm_sf2.c | 5 +
drivers/net/dsa/microchip/ksz_common.c | 1 +
drivers/net/ethernet/amazon/ena/ena_netdev.c | 13 +-
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 119 +++--
drivers/net/ethernet/broadcom/bcm4908_enet.c | 143 ++++--
drivers/net/ethernet/broadcom/bcmsysport.c | 20 +-
drivers/net/ethernet/broadcom/bgmac-platform.c | 3 +-
drivers/net/ethernet/broadcom/bgmac.c | 8 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 17 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 21 +-
drivers/net/ethernet/broadcom/tg3.c | 43 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 4 +-
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 28 +-
drivers/net/ethernet/freescale/gianfar.c | 1 +
drivers/net/ethernet/intel/e1000/e1000_main.c | 3 +-
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 13 +-
drivers/net/ethernet/intel/iavf/iavf_adminq.c | 1 +
drivers/net/ethernet/intel/ice/ice_devlink.c | 2 +-
drivers/net/ethernet/intel/ice/ice_ptp.c | 35 +-
drivers/net/ethernet/intel/ice/ice_ptp.h | 6 +-
drivers/net/ethernet/intel/ice/ice_tc_lib.c | 3 +-
.../net/ethernet/marvell/prestera/prestera_main.c | 17 +-
drivers/net/ethernet/mediatek/mtk_ppe.c | 5 +-
drivers/net/ethernet/mediatek/mtk_wed.c | 65 ++-
drivers/net/ethernet/mediatek/mtk_wed.h | 10 +
drivers/net/ethernet/mediatek/mtk_wed_debugfs.c | 2 +-
drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 2 +-
.../net/ethernet/mellanox/mlx5/core/en/params.c | 5 +-
.../ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 2 +-
.../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 3 +
.../mellanox/mlx5/core/en_accel/ipsec_fs.c | 45 +-
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 19 +-
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 3 +-
.../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h | 2 +-
.../ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c | 26 +-
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 3 +-
.../net/ethernet/mellanox/mlx5/core/lag/mpesw.c | 2 +-
.../ethernet/mellanox/mlx5/core/lib/macsec_fs.c | 41 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
.../mellanox/mlx5/core/steering/dr_icm_pool.c | 32 +-
drivers/net/ethernet/microchip/encx24j600.c | 3 +-
.../net/ethernet/microchip/lan966x/lan966x_fdma.c | 11 +-
drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 10 +-
drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +-
drivers/net/ethernet/netronome/nfp/flower/main.h | 2 +
.../ethernet/netronome/nfp/flower/tunnel_conf.c | 24 +-
drivers/net/ethernet/qualcomm/qca_spi.c | 4 +-
drivers/net/ethernet/realtek/8139cp.c | 8 +-
drivers/net/ethernet/sfc/ptp.c | 108 ++--
.../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 10 +-
drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 +
.../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 11 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 115 +++--
drivers/net/ethernet/ti/am65-cpts.c | 67 ++-
drivers/net/gtp.c | 22 +-
drivers/net/hyperv/rndis_filter.c | 6 +-
drivers/net/ipvlan/ipvlan_core.c | 6 +-
drivers/net/ipvlan/ipvlan_l3s.c | 6 +-
drivers/net/macsec.c | 15 +-
drivers/net/phy/marvell.c | 97 +++-
drivers/net/phy/phy-c45.c | 46 +-
drivers/net/phy/qcom/at803x.c | 54 ++
drivers/net/phy/sfp.c | 8 +-
drivers/net/team/team_core.c | 12 +-
drivers/net/tun.c | 21 +-
drivers/net/usb/cdc_ncm.c | 4 +-
drivers/net/veth.c | 4 +
drivers/net/virtio_net.c | 51 +-
drivers/net/wireless/ath/ath11k/ahb.c | 5 +-
drivers/net/wireless/ath/ath11k/dp_tx.c | 16 +-
drivers/net/wireless/ath/ath11k/dp_tx.h | 4 +-
drivers/net/wireless/ath/ath11k/hal_tx.h | 4 +-
drivers/net/wireless/ath/ath11k/mac.c | 7 +-
drivers/net/wireless/ath/ath12k/core.c | 3 +-
drivers/net/wireless/ath/ath12k/dp_tx.c | 2 +-
drivers/net/wireless/ath/ath12k/mac.c | 12 +-
drivers/net/wireless/ath/ath12k/mac.h | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 8 +-
drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7921/main.c | 8 +-
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 5 +
drivers/net/wireless/mediatek/mt76/mt792x.h | 1 +
drivers/net/wireless/mediatek/mt76/mt7996/init.c | 6 +
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 12 +-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 140 ++---
drivers/net/wireless/realtek/rtw89/core.c | 12 -
drivers/net/wireless/virtual/mac80211_hwsim.c | 2 +-
drivers/nvme/common/auth.c | 6 +-
drivers/nvme/host/core.c | 12 +
drivers/nvme/host/fc.c | 4 +-
drivers/nvme/host/multipath.c | 7 +
drivers/nvme/host/sysfs.c | 3 +
drivers/nvme/host/tcp.c | 12 +-
drivers/nvme/target/fc.c | 19 +-
drivers/nvme/target/io-cmd-file.c | 47 +-
drivers/nvme/target/loop.c | 1 +
drivers/nvme/target/rdma.c | 57 ++-
drivers/nvme/target/tcp.c | 50 +-
drivers/nvme/target/zns.c | 3 +-
drivers/pci/p2pdma.c | 7 +-
drivers/phy/ingenic/phy-ingenic-usb.c | 1 -
drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 9 +-
drivers/phy/ti/phy-ti-pipe3.c | 63 ++-
drivers/pinctrl/stm32/pinctrl-stm32.c | 12 +-
drivers/platform/x86/amd/pmc/pmc.c | 4 +
drivers/power/supply/88pm860x_battery.c | 4 +-
drivers/power/supply/ab8500_btemp.c | 2 +-
drivers/power/supply/charger-manager.c | 2 +-
drivers/power/supply/da9030_battery.c | 4 +-
drivers/power/supply/max8925_power.c | 2 +-
drivers/power/supply/qcom_battmgr.c | 2 +-
drivers/power/supply/qcom_pmi8998_charger.c | 13 +-
drivers/ptp/ptp_clock.c | 5 +
drivers/ptp/ptp_kvm_x86.c | 7 +-
drivers/ptp/ptp_private.h | 7 +-
drivers/ptp/ptp_sysfs.c | 18 +-
drivers/ptp/ptp_vclock.c | 121 +++--
drivers/regulator/Kconfig | 1 +
drivers/regulator/qcom_spmi-regulator.c | 35 +-
drivers/reset/reset-scmi.c | 1 +
drivers/rtc/rtc-ftrtc010.c | 67 +--
drivers/s390/block/dasd.c | 1 +
drivers/s390/block/dasd_eckd.c | 55 +-
drivers/s390/block/dasd_int.h | 15 +
drivers/s390/block/dasd_ioctl.c | 4 +-
drivers/s390/block/dcssblk.c | 3 +-
drivers/s390/net/ism_drv.c | 3 +-
drivers/scsi/aha1542.c | 2 -
drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +-
drivers/scsi/ch.c | 26 +-
drivers/scsi/device_handler/scsi_dh_rdac.c | 6 +-
drivers/scsi/mpi3mr/mpi3mr.h | 1 +
drivers/scsi/mpi3mr/mpi3mr_fw.c | 18 +
drivers/scsi/scsi_debug.c | 74 ++-
drivers/scsi/sd_zbc.c | 9 +-
drivers/soc/qcom/pmic_glink.c | 3 +-
drivers/soundwire/qcom.c | 2 +
drivers/spi/spi-cadence-quadspi.c | 4 +-
drivers/spi/spi-pic32-sqi.c | 3 +-
drivers/spi/spi-tegra210-quad.c | 31 +-
drivers/spi/spi.c | 44 +-
.../staging/media/atomisp/pci/sh_css_param_dvs.c | 11 +-
.../media/atomisp/pci/sh_css_param_shading.c | 4 +-
drivers/staging/media/atomisp/pci/sh_css_params.c | 35 +-
drivers/target/iscsi/iscsi_target.c | 22 +-
drivers/target/iscsi/iscsi_target_nego.c | 6 +-
drivers/target/target_core_alua.c | 7 +
drivers/target/target_core_configfs.c | 16 +-
drivers/target/target_core_pr.c | 9 +-
drivers/tty/serial/8250/8250_lpss.c | 3 +
drivers/tty/serial/rda-uart.c | 36 +-
drivers/tty/serial/samsung_tty.c | 8 +-
drivers/tty/serial/serial_txx9.c | 56 +-
drivers/tty/serial/sh-sci.c | 10 +-
drivers/tty/tty_io.c | 3 +-
drivers/tty/vt/keyboard.c | 6 +
drivers/tty/vt/vt.c | 2 +
drivers/ufs/host/ufs-mediatek.c | 10 +
drivers/usb/cdns3/cdns3-gadget.c | 6 +-
drivers/usb/class/cdc-acm.c | 18 +-
drivers/usb/dwc3/core.h | 4 +-
drivers/usb/dwc3/dwc3-xilinx.c | 146 +++---
drivers/usb/dwc3/ep0.c | 2 +-
drivers/usb/dwc3/gadget.c | 160 ++++--
drivers/usb/gadget/function/f_mass_storage.c | 8 +-
drivers/usb/gadget/function/f_midi.c | 4 +
drivers/usb/gadget/function/f_ncm.c | 7 +-
drivers/usb/gadget/function/f_uac1_legacy.c | 8 +-
drivers/usb/gadget/function/storage_common.c | 7 +-
drivers/usb/gadget/function/storage_common.h | 3 +-
drivers/usb/gadget/function/u_serial.c | 170 ++++--
drivers/usb/gadget/function/u_uac1_legacy.c | 17 +-
drivers/usb/host/pci-quirks.c | 13 +-
drivers/usb/host/xhci.c | 2 +-
drivers/usb/misc/usbtest.c | 3 +
drivers/usb/serial/garmin_gps.c | 31 +-
drivers/usb/serial/io_edgeport.c | 141 +++--
drivers/usb/serial/oti6858.c | 16 +-
drivers/usb/serial/sierra.c | 18 +-
drivers/usb/serial/upd78f0730.c | 13 +-
drivers/usb/storage/uas-detect.h | 8 +-
drivers/usb/typec/mux/fsa4480.c | 9 +-
drivers/usb/typec/mux/nb7vpq904m.c | 1 +
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 8 +-
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 20 +
drivers/usb/typec/ucsi/ucsi.c | 10 +-
drivers/usb/typec/ucsi/ucsi.h | 1 +
drivers/usb/typec/ucsi/ucsi_acpi.c | 33 ++
drivers/vdpa/vdpa.c | 7 +-
drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 +
drivers/vfio/pci/vfio_pci_intrs.c | 9 +-
drivers/vhost/net.c | 2 +-
drivers/vhost/scsi.c | 42 +-
drivers/vhost/test.c | 4 +
drivers/vhost/vdpa.c | 55 +-
drivers/vhost/vhost.c | 3 +-
drivers/video/console/vgacon.c | 2 +
drivers/video/fbdev/aty/radeon_base.c | 3 +
drivers/video/fbdev/fm2fb.c | 2 +-
drivers/video/fbdev/macmodes.c | 2 +-
drivers/video/fbdev/smscufx.c | 26 +-
drivers/video/fbdev/sstfb.c | 3 +
drivers/video/fbdev/valkyriefb.c | 3 +-
drivers/video/fbdev/vfb.c | 18 +-
drivers/w1/masters/ds2482.c | 36 +-
drivers/w1/slaves/w1_ds2805.c | 8 +-
drivers/w1/slaves/w1_ds28e04.c | 18 +-
drivers/w1/slaves/w1_therm.c | 45 +-
drivers/w1/w1.c | 21 +-
drivers/w1/w1_int.c | 8 +-
drivers/w1/w1_netlink.c | 8 +-
drivers/watchdog/npcm_wdt.c | 35 +-
drivers/xen/gntdev.c | 8 +-
drivers/xen/grant-table.c | 37 +-
drivers/xen/privcmd.c | 15 +
drivers/xen/pvcalls-back.c | 26 +-
fs/9p/v9fs_vfs.h | 7 +-
fs/9p/vfs_dir.c | 10 +-
fs/9p/vfs_inode.c | 36 +-
fs/9p/vfs_inode_dotl.c | 42 +-
fs/9p/vfs_super.c | 29 +-
fs/adfs/dir_fplus.c | 2 +
fs/afs/rxrpc.c | 8 +-
fs/aio.c | 7 +-
fs/btrfs/accessors.c | 2 +-
fs/btrfs/block-group.c | 6 +-
fs/btrfs/delayed-inode.c | 69 +--
fs/btrfs/file.c | 7 +-
fs/btrfs/free-space-cache.c | 10 +
fs/btrfs/inode.c | 4 +-
fs/btrfs/scrub.c | 8 +-
fs/btrfs/send.c | 27 +-
fs/btrfs/verity.c | 2 +-
fs/btrfs/volumes.c | 38 ++
fs/btrfs/zoned.c | 5 +
fs/ceph/addr.c | 22 +-
fs/coredump.c | 3 +
fs/crypto/keysetup.c | 14 +-
fs/dcache.c | 18 +-
fs/direct-io.c | 15 +-
fs/dlm/config.c | 9 +-
fs/dlm/member.c | 17 +-
fs/eventpoll.c | 11 +-
fs/exfat/fatent.c | 3 +-
fs/ext2/dir.c | 3 +
fs/ext4/inline.c | 6 +
fs/ext4/xattr.c | 12 +
fs/fuse/file.c | 2 +-
fs/fuse/readdir.c | 22 +-
fs/fuse/xattr.c | 2 +-
fs/inode.c | 3 +-
fs/jbd2/journal.c | 3 +
fs/kernfs/dir.c | 40 +-
fs/nfs/dir.c | 4 +-
fs/nfs/flexfilelayout/flexfilelayout.c | 11 +
fs/nfs/flexfilelayout/flexfilelayout.h | 1 +
fs/nfs/nfs4proc.c | 5 +-
fs/nfs/pnfs.c | 2 +-
fs/nfsd/nfs4state.c | 1 +
fs/ntfs3/frecord.c | 9 +-
fs/ntfs3/index.c | 10 +
fs/ocfs2/dlmfs/userdlm.c | 12 +-
fs/ocfs2/dlmglue.c | 19 +-
fs/ocfs2/inode.c | 17 +-
fs/ocfs2/journal.c | 30 +-
fs/ocfs2/journal.h | 17 +-
fs/ocfs2/ocfs2.h | 1 +
fs/ocfs2/super.c | 1 +
fs/overlayfs/dir.c | 17 +-
fs/overlayfs/namei.c | 34 +-
fs/overlayfs/overlayfs.h | 11 +-
fs/overlayfs/ovl_entry.h | 2 +
fs/overlayfs/params.c | 48 +-
fs/overlayfs/super.c | 35 +-
fs/overlayfs/util.c | 12 +
fs/pnode.c | 117 +++--
fs/proc/base.c | 9 +-
fs/proc/proc_sysctl.c | 5 +-
fs/smb/client/cifsacl.c | 17 +-
fs/smb/client/cifsacl.h | 14 -
fs/smb/client/cifsproto.h | 1 +
fs/smb/client/connect.c | 6 +-
fs/smb/client/dfs.c | 2 +-
fs/smb/client/file.c | 68 ++-
fs/smb/client/netmisc.c | 3 +-
fs/smb/client/readdir.c | 3 +-
fs/smb/client/sess.c | 4 +-
fs/smb/client/smb2misc.c | 15 +
fs/smb/client/smb2ops.c | 6 +-
fs/smb/client/smb2pdu.c | 40 +-
fs/smb/server/mgmt/share_config.c | 43 +-
fs/smb/server/mgmt/share_config.h | 2 +
fs/smb/server/smb2pdu.c | 305 +++++++----
fs/smb/server/smb_common.c | 34 +-
fs/smb/server/smb_common.h | 5 +
fs/smb/server/smbacl.c | 70 ++-
fs/smb/server/transport_tcp.c | 7 +-
fs/smb/server/vfs.c | 4 +
fs/smb/server/vfs_cache.c | 31 +-
fs/smb/server/vfs_cache.h | 2 +
fs/splice.c | 8 +-
fs/stat.c | 9 +-
fs/udf/super.c | 19 +-
fs/userfaultfd.c | 22 +-
fs/xfs/xfs_aops.c | 2 +-
fs/xfs/xfs_bmap_util.c | 11 +-
fs/xfs/xfs_file.c | 2 +-
fs/xfs/xfs_iomap.c | 20 +-
fs/xfs/xfs_iomap.h | 3 +-
fs/xfs/xfs_pnfs.c | 9 +-
fs/zonefs/file.c | 9 +-
include/acpi/acpi_bus.h | 1 +
include/linux/arm-smccc.h | 7 +
include/linux/blk-mq.h | 3 +-
include/linux/bpf.h | 17 +-
include/linux/can/dev.h | 2 +-
include/linux/can/skb.h | 4 +-
include/linux/cpufreq.h | 20 +-
include/linux/dim.h | 7 +
include/linux/filter.h | 9 +
include/linux/iio/common/inv_sensors_timestamp.h | 43 +-
include/linux/irqbypass.h | 35 +-
include/linux/key.h | 7 +-
include/linux/mlx5/driver.h | 8 +-
include/linux/mmzone.h | 7 +-
include/linux/net.h | 2 +-
include/linux/netdevice.h | 5 +
include/linux/nsc_gpio.h | 2 +-
include/linux/page_counter.h | 4 +
include/linux/perf_event.h | 23 +-
include/linux/skbuff.h | 1 +
include/linux/stat.h | 3 +
include/linux/tcp.h | 6 +-
include/net/9p/client.h | 2 +-
include/net/af_rxrpc.h | 5 +-
include/net/bluetooth/hci_core.h | 24 +-
include/net/bluetooth/l2cap.h | 1 +
include/net/codel.h | 5 +
include/net/codel_impl.h | 16 +-
include/net/dropreason-core.h | 6 +
include/net/dst.h | 3 +-
include/net/dst_metadata.h | 2 +
include/net/gro.h | 8 +-
include/net/gso.h | 2 +-
include/net/inet_connection_sock.h | 1 +
include/net/inet_hashtables.h | 2 +
include/net/ip_vs.h | 2 +-
include/net/netfilter/nf_conntrack_helper.h | 1 +
include/net/netfilter/nf_queue.h | 1 +
include/net/netns/netfilter.h | 1 +
include/net/request_sock.h | 7 +-
include/net/route.h | 7 +-
include/net/sock.h | 24 +-
include/net/tcp.h | 9 +
include/net/xsk_buff_pool.h | 3 +
include/scsi/scsi_proto.h | 3 +
include/sound/hda_codec.h | 6 +-
include/sound/ump.h | 5 +
include/trace/events/huge_memory.h | 6 +-
include/trace/events/iocost.h | 7 +-
include/trace/events/oom.h | 8 +-
include/trace/events/rxrpc.h | 2 +-
include/uapi/linux/io_uring.h | 2 +
include/uapi/linux/mdio.h | 13 +-
init/do_mounts.c | 3 +
init/do_mounts.h | 9 +
init/do_mounts_rd.c | 5 +
init/initramfs.c | 6 +-
io_uring/io-wq.c | 44 +-
io_uring/io_uring.c | 104 ++--
io_uring/io_uring.h | 25 +-
io_uring/rsrc.c | 25 +-
io_uring/rw.c | 1 +
io_uring/sqpoll.c | 62 ++-
io_uring/timeout.c | 8 +-
kernel/bpf/arraymap.c | 2 +-
kernel/bpf/bpf_iter.c | 17 +-
kernel/bpf/bpf_lsm.c | 4 -
kernel/bpf/btf.c | 26 +-
kernel/bpf/cgroup.c | 28 +-
kernel/bpf/core.c | 52 +-
kernel/bpf/cpumap.c | 30 +-
kernel/bpf/devmap.c | 1 +
kernel/bpf/helpers.c | 2 +-
kernel/bpf/syscall.c | 47 +-
kernel/bpf/task_iter.c | 6 +-
kernel/bpf/trampoline.c | 19 +-
kernel/bpf/verifier.c | 50 +-
kernel/cgroup/cpuset.c | 4 +-
kernel/dma/coherent.c | 11 +-
kernel/dma/swiotlb.c | 20 +-
kernel/events/core.c | 200 ++++----
kernel/kprobes.c | 328 ++++++------
kernel/locking/osq_lock.c | 81 ++-
kernel/panic.c | 3 +-
kernel/rcu/tree_nocb.h | 6 +-
kernel/sched/core.c | 18 +-
kernel/sched/core_sched.c | 3 +-
kernel/sched/pelt.c | 2 +-
kernel/sched/sched.h | 19 +
kernel/time/timekeeping.c | 8 +-
kernel/trace/bpf_trace.c | 19 +-
kernel/trace/trace_eprobe.c | 83 ++-
kernel/trace/trace_events_filter.c | 81 ++-
kernel/trace/trace_events_hist.c | 5 +
kernel/trace/trace_events_user.c | 12 +
kernel/trace/trace_fprobe.c | 8 +-
kernel/trace/trace_kprobe.c | 11 +-
kernel/trace/trace_osnoise.c | 8 +
kernel/trace/trace_probe.c | 80 ++-
kernel/trace/trace_probe_tmpl.h | 14 +-
kernel/trace/trace_recursion_record.c | 17 +-
kernel/trace/trace_uprobe.c | 79 ++-
kernel/tsacct.c | 10 +-
lib/bootconfig.c | 7 +-
lib/dim/net_dim.c | 6 -
lib/errseq.c | 42 +-
lib/maple_tree.c | 45 +-
lib/seq_buf.c | 2 +-
lib/test_sysctl.c | 2 +-
lib/test_xarray.c | 70 +++
lib/xarray.c | 8 +-
mm/damon/core.c | 5 +-
mm/filemap.c | 7 +
mm/gup.c | 17 +-
mm/hugetlb.c | 13 +-
mm/internal.h | 32 +-
mm/khugepaged.c | 58 ++-
mm/ksm.c | 4 +
mm/list_lru.c | 28 +-
mm/memcontrol.c | 154 +-----
mm/memory_hotplug.c | 49 +-
mm/mempolicy.c | 6 +-
mm/migrate.c | 4 +
mm/mmap.c | 35 +-
mm/mmzone.c | 9 +-
mm/mremap.c | 7 +
mm/page_alloc.c | 133 +++--
mm/page_counter.c | 182 +++++++
net/9p/protocol.c | 12 +-
net/batman-adv/bat_iv_ogm.c | 2 +-
net/bluetooth/hci_conn.c | 47 +-
net/bluetooth/hci_core.c | 178 +++++--
net/bluetooth/hci_event.c | 138 +++--
net/bluetooth/hci_sync.c | 58 ++-
net/bluetooth/l2cap_core.c | 88 ++--
net/bluetooth/l2cap_sock.c | 3 +-
net/bluetooth/mgmt.c | 331 +++++++++---
net/bluetooth/mgmt_config.c | 10 +-
net/bluetooth/mgmt_util.c | 23 +-
net/bluetooth/msft.c | 118 +++--
net/bluetooth/smp.c | 37 +-
net/bridge/br_arp_nd_proxy.c | 6 +-
net/bridge/br_if.c | 6 +-
net/bridge/br_input.c | 18 +-
net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
net/core/dev.c | 44 +-
net/core/filter.c | 154 ++++--
net/core/gro.c | 8 +
net/core/lwt_bpf.c | 60 ++-
net/core/netdev-genl.c | 6 +
net/core/netpoll.c | 10 +-
net/core/skbuff.c | 35 +-
net/core/skmsg.c | 4 +-
net/core/sock.c | 4 +-
net/core/sock_reuseport.c | 33 +-
net/ieee802154/socket.c | 4 +
net/ipv4/af_inet.c | 5 +-
net/ipv4/fib_trie.c | 14 +-
net/ipv4/fou_core.c | 31 +-
net/ipv4/igmp.c | 2 +
net/ipv4/inet_connection_sock.c | 38 +-
net/ipv4/inet_hashtables.c | 11 +
net/ipv4/inet_timewait_sock.c | 6 +-
net/ipv4/ip_fragment.c | 6 +-
net/ipv4/ip_input.c | 8 +-
net/ipv4/ip_output.c | 8 +-
net/ipv4/ip_tunnel.c | 6 +-
net/ipv4/netfilter/arp_tables.c | 5 +-
net/ipv4/netfilter/ip_tables.c | 5 +-
net/ipv4/route.c | 31 +-
net/ipv4/syncookies.c | 12 +-
net/ipv4/tcp.c | 2 +-
net/ipv4/tcp_fastopen.c | 2 +
net/ipv4/tcp_input.c | 25 +-
net/ipv4/tcp_ipv4.c | 25 +-
net/ipv4/tcp_metrics.c | 3 +-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/udp.c | 5 +-
net/ipv4/udp_offload.c | 9 +-
net/ipv4/xfrm4_input.c | 2 +-
net/ipv4/xfrm4_protocol.c | 2 +-
net/ipv6/af_inet6.c | 8 +-
net/ipv6/calipso.c | 17 +-
net/ipv6/exthdrs.c | 5 +-
net/ipv6/exthdrs_core.c | 7 +-
net/ipv6/icmp.c | 7 +-
net/ipv6/ip6_fib.c | 16 +-
net/ipv6/ip6_input.c | 4 +
net/ipv6/ip6_output.c | 13 +-
net/ipv6/ip6mr.c | 45 +-
net/ipv6/ipv6_sockglue.c | 95 ----
net/ipv6/mcast.c | 10 +-
net/ipv6/mip6.c | 9 +-
net/ipv6/netfilter/ip6_tables.c | 5 +-
net/ipv6/route.c | 66 +--
net/ipv6/seg6_iptunnel.c | 46 +-
net/ipv6/seg6_local.c | 124 ++++-
net/ipv6/sit.c | 2 +-
net/ipv6/tcp_ipv6.c | 4 +-
net/ipv6/udp.c | 5 +-
net/iucv/af_iucv.c | 9 +
net/mac80211/ibss.c | 23 +-
net/mac80211/ieee80211_i.h | 3 +
net/mac80211/link.c | 13 +-
net/mac80211/ocb.c | 23 +-
net/mac80211/rx.c | 41 +-
net/mac80211/tx.c | 44 +-
net/mac80211/util.c | 3 +
net/mac802154/llsec.c | 2 +
net/mctp/af_mctp.c | 2 +-
net/mptcp/options.c | 12 +-
net/mptcp/protocol.c | 3 +-
net/netfilter/core.c | 17 +-
net/netfilter/ipvs/ip_vs_app.c | 2 +-
net/netfilter/ipvs/ip_vs_conn.c | 4 +-
net/netfilter/ipvs/ip_vs_core.c | 12 +-
net/netfilter/ipvs/ip_vs_ctl.c | 30 +-
net/netfilter/ipvs/ip_vs_ftp.c | 20 +-
net/netfilter/ipvs/ip_vs_lblc.c | 8 +-
net/netfilter/ipvs/ip_vs_lblcr.c | 13 +-
net/netfilter/ipvs/ip_vs_sync.c | 42 +-
net/netfilter/nf_conntrack_helper.c | 20 +-
net/netfilter/nf_conntrack_sip.c | 4 +-
net/netfilter/nf_flow_table_core.c | 1 +
net/netfilter/nf_flow_table_ip.c | 2 +
net/netfilter/nf_nat_masquerade.c | 4 +-
net/netfilter/nf_queue.c | 13 +-
net/netfilter/nf_tables_api.c | 21 +-
net/netfilter/nf_tables_offload.c | 3 +
net/netfilter/nfnetlink_hook.c | 20 +-
net/netfilter/nft_ct.c | 119 ++++-
net/netfilter/xt_NETMAP.c | 4 +-
net/netfilter/xt_recent.c | 7 +-
net/nsh/nsh.c | 7 +
net/openvswitch/flow.c | 19 +-
net/qrtr/ns.c | 34 +-
net/rds/rdma.c | 5 +-
net/rds/tcp.c | 4 +-
net/rxrpc/rxperf.c | 32 +-
net/rxrpc/sendmsg.c | 44 +-
net/sched/act_ife.c | 13 +-
net/sched/sch_teql.c | 9 +-
net/sctp/ipv6.c | 6 +-
net/sctp/sm_make_chunk.c | 67 +--
net/sctp/sm_statefuns.c | 18 +-
net/sctp/socket.c | 14 +-
net/sctp/stream.c | 2 +
net/sctp/stream_interleave.c | 38 +-
net/smc/af_smc.c | 21 +-
net/smc/smc.h | 1 +
net/smc/smc_close.c | 14 +
net/smc/smc_core.c | 86 +++-
net/smc/smc_core.h | 6 +-
net/smc/smc_diag.c | 12 +-
net/socket.c | 11 +-
net/sunrpc/clnt.c | 6 +-
net/sunrpc/rpc_pipe.c | 1 +
net/sunrpc/xprtrdma/frwr_ops.c | 89 ++--
net/sunrpc/xprtrdma/transport.c | 2 +
net/sunrpc/xprtrdma/verbs.c | 16 +-
net/sunrpc/xprtrdma/xprt_rdma.h | 10 +-
net/sunrpc/xprtsock.c | 12 +-
net/tipc/bearer.c | 33 ++
net/tls/tls_device.c | 34 +-
net/tls/tls_sw.c | 25 +-
net/unix/garbage.c | 3 -
net/vmw_vsock/af_vsock.c | 3 +-
net/vmw_vsock/virtio_transport.c | 16 +-
net/wireless/nl80211.c | 9 +-
net/wireless/scan.c | 3 +-
net/wireless/util.c | 6 +-
net/xdp/xsk.c | 5 +
net/xdp/xsk_buff_pool.c | 44 +-
net/xfrm/xfrm_interface_core.c | 8 +
net/xfrm/xfrm_output.c | 20 +-
net/xfrm/xfrm_replay.c | 6 +-
security/apparmor/include/match.h | 11 +-
security/apparmor/include/policy.h | 20 +
security/apparmor/lsm.c | 19 +
security/apparmor/match.c | 6 +-
security/apparmor/net.c | 1 +
security/apparmor/policy.c | 3 +
security/apparmor/policy_unpack.c | 4 +-
security/keys/big_key.c | 16 +-
security/keys/key.c | 14 +-
security/keys/keyctl.c | 2 -
security/keys/keyctl_pkey.c | 124 +++--
security/keys/keyring.c | 25 +-
security/keys/request_key.c | 14 +-
security/keys/trusted-keys/trusted_core.c | 15 +-
security/selinux/hooks.c | 5 +-
sound/core/control_led.c | 62 ++-
sound/core/jack.c | 6 +
sound/core/oss/pcm_oss.c | 4 +-
sound/core/pcm.c | 94 ++--
sound/core/pcm_compat.c | 29 +-
sound/core/pcm_memory.c | 30 +-
sound/core/pcm_native.c | 243 +++++----
sound/core/seq/seq_clientmgr.c | 16 +-
sound/core/seq/seq_ump_client.c | 5 +-
sound/core/sound_oss.c | 35 +-
sound/core/ump.c | 51 +-
sound/drivers/aloop.c | 12 +-
sound/drivers/pcmtest.c | 66 +--
sound/firewire/fcp.c | 5 +-
sound/firewire/fireworks/fireworks_transaction.c | 4 +-
sound/hda/hdac_controller.c | 10 +-
sound/pci/Kconfig | 1 +
sound/pci/hda/cs35l56_hda.c | 2 +
sound/pci/hda/hda_codec.c | 1 -
sound/pci/hda/hda_intel.c | 30 +-
sound/pci/hda/hda_jack.c | 79 +--
sound/pci/hda/hda_jack.h | 1 +
sound/pci/hda/hda_sysfs.c | 5 +-
sound/pci/hda/patch_realtek.c | 32 +-
sound/soc/codecs/max98090.c | 22 +-
sound/soc/codecs/rt1015.c | 81 ++-
sound/soc/codecs/rt5645.c | 7 +-
sound/soc/codecs/sta32x.c | 101 +++-
sound/soc/codecs/wm8962.c | 2 +-
sound/soc/codecs/wm_adsp.c | 10 +
sound/soc/fsl/fsl_asrc.c | 22 +
sound/soc/fsl/fsl_easrc.c | 10 +
sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 12 +-
sound/soc/mediatek/mt8188/mt8188-mt6359.c | 3 +
sound/soc/meson/axg-fifo.c | 30 +-
sound/soc/qcom/qdsp6/q6apm-dai.c | 3 +
sound/soc/qcom/qdsp6/q6asm-dai.c | 3 +
sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c | 14 +-
sound/soc/qcom/qdsp6/topology.c | 4 +-
sound/soc/rockchip/rk3288_hdmi_analog.c | 36 +-
sound/soc/soc-core.c | 16 +
sound/soc/sof/control.c | 5 +
sound/soc/sof/intel/hda-codec.c | 4 +-
sound/soc/sof/ipc4-topology.c | 2 +-
sound/usb/caiaq/device.c | 11 +-
sound/usb/misc/ua101.c | 29 +-
sound/usb/mixer.c | 23 +
sound/usb/mixer.h | 2 +
sound/usb/pcm.c | 6 +
tools/bootconfig/main.c | 29 +-
tools/bootconfig/samples/exp-good-mixed-kv1.bconf | 7 +
tools/bootconfig/samples/good-mixed-kv1.bconf | 5 +
tools/bootconfig/scripts/bconf2ftrace.sh | 21 +-
tools/bootconfig/scripts/ftrace2bconf.sh | 5 +-
tools/bootconfig/test-bootconfig.sh | 24 +
tools/bpf/bpftool/gen.c | 26 +-
tools/cgroup/iocost_monitor.py | 7 +-
tools/gpio/gpio-event-mon.c | 4 +-
tools/gpio/gpio-hammer.c | 4 +-
tools/gpio/lsgpio.c | 3 +-
tools/include/nolibc/types.h | 6 +-
tools/lib/bpf/btf.c | 14 +-
tools/lib/bpf/libbpf.c | 3 +-
tools/lib/bpf/skel_internal.h | 37 +-
tools/perf/Makefile.perf | 2 +-
tools/perf/builtin-lock.c | 59 ++-
tools/perf/tests/code-reading.c | 14 +-
tools/perf/tests/pe-file-parsing.c | 2 +-
tools/perf/util/evsel.c | 2 +-
tools/perf/util/jitdump.c | 4 +-
tools/perf/util/symbol.c | 9 +-
tools/testing/cxl/test/cxl.c | 6 +-
tools/testing/selftests/cgroup/test_zswap.c | 11 +-
.../selftests/drivers/s390x/uvdevice/Makefile | 19 +-
.../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 2 +-
.../tcp_bidir_fast_retransmit_nosack.pkt | 42 ++
tools/testing/selftests/net/reuseport_bpf_numa.c | 1 +
tools/testing/selftests/proc/proc-pid-vm.c | 2 -
virt/kvm/eventfd.c | 7 +-
virt/lib/irqbypass.c | 44 +-
965 files changed, 14181 insertions(+), 6470 deletions(-)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0001/1167] netfilter: nft_ct: expectation timeouts are passed in milliseconds
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0002/1167] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
` (656 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Westphal, Pablo Neira Ayuso,
Mark Bundschuh, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <fw@strlen.de>
[ Upstream commit 6fb421bd07f156cdf0cdede062d31f1c21def326 ]
Userspace passes '5000' in case user asks for 5 seconds.
Allowing for sub-second expectation lifetimes makes sense to me. so
fix up the kernel side instead of munging nft to send a value rounded
up to next second.
Also note that this violates nft convention of passing integers in
network byte order, but we can't change this anymore.
Fixes: 857b46027d6f ("netfilter: nft_ct: add ct expectations support")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: 3679da4ad8be ("netfilter: nft_ct: move custom expectation support to helper")
Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nft_ct.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index 3a4f5c4da0e35..13e47c7b42785 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -1198,11 +1198,23 @@ struct nft_ct_expect_obj {
u32 timeout;
};
+static int nft_ct_expect_timeout_get(const struct nlattr *attr, u32 *val)
+{
+ unsigned long jiffies_val = msecs_to_jiffies(nla_get_u32(attr));
+
+ if (jiffies_val > UINT_MAX)
+ return -ERANGE;
+
+ *val = jiffies_val;
+ return 0;
+}
+
static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
const struct nlattr * const tb[],
struct nft_object *obj)
{
struct nft_ct_expect_obj *priv = nft_obj_data(obj);
+ int err;
if (!tb[NFTA_CT_EXPECT_L4PROTO] ||
!tb[NFTA_CT_EXPECT_DPORT] ||
@@ -1238,8 +1250,11 @@ static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
return -EOPNOTSUPP;
}
+ err = nft_ct_expect_timeout_get(tb[NFTA_CT_EXPECT_TIMEOUT], &priv->timeout);
+ if (err)
+ return err;
+
priv->dport = nla_get_be16(tb[NFTA_CT_EXPECT_DPORT]);
- priv->timeout = nla_get_u32(tb[NFTA_CT_EXPECT_TIMEOUT]);
priv->size = nla_get_u8(tb[NFTA_CT_EXPECT_SIZE]);
return nf_ct_netns_get(ctx->net, ctx->family);
@@ -1259,7 +1274,7 @@ static int nft_ct_expect_obj_dump(struct sk_buff *skb,
if (nla_put_be16(skb, NFTA_CT_EXPECT_L3PROTO, htons(priv->l3num)) ||
nla_put_u8(skb, NFTA_CT_EXPECT_L4PROTO, priv->l4proto) ||
nla_put_be16(skb, NFTA_CT_EXPECT_DPORT, priv->dport) ||
- nla_put_u32(skb, NFTA_CT_EXPECT_TIMEOUT, priv->timeout) ||
+ nla_put_u32(skb, NFTA_CT_EXPECT_TIMEOUT, jiffies_to_msecs(priv->timeout)) ||
nla_put_u8(skb, NFTA_CT_EXPECT_SIZE, priv->size))
return -1;
@@ -1309,7 +1324,7 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
&ct->tuplehash[!dir].tuple.src.u3,
&ct->tuplehash[!dir].tuple.dst.u3,
priv->l4proto, NULL, &priv->dport);
- exp->timeout += priv->timeout * HZ;
+ exp->timeout += priv->timeout;
if (nf_ct_expect_related(exp, 0) != 0)
regs->verdict.code = NF_DROP;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0002/1167] netfilter: nft_ct: move custom expectation support to helper
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0001/1167] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0003/1167] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
` (655 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jaeyeong Lee, Pablo Neira Ayuso,
Mark Bundschuh, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <pablo@netfilter.org>
[ Upstream commit 3679da4ad8be84cddaf40bc307fef1fe13e051ff ]
Originally, the ct expectation support called nf_ct_helper_ext_add() for
confirmed conntracks, which is invalid, triggering a splat. This was
fixed by commit 1710eb913bdc ("netfilter: nft_ct: skip expectations for
confirmed conntrack") which restricted it to unconfirmed conntracks.
However, early insertion of expectations into the expectations list when
the conntrack is unconfirmed leads to stale entries pointing to the
wrong hlist_head through .pprev due to ct extension reallocation.
Commit 7c9664351980 ("netfilter: move nat hlist_head to nf_conn") moved
the nat hlist_head to nf_conn for this reason:
1. ...
2. When reallocation of extension area occurs we need to fixup the
bysource hash head via hlist_replace_rcu.
I'd rather not increase the size of the struct nf_conn for this feature
has very limited scope: only one expectation can be created at a time
given expect_clash() will make nf_ct_expect_related() reports EBUSY.
For this reason, relax nf_ct_expect_related() not to drop packets in
case expectation creation fails, therefore, expectation creation becomes
best effort.
To address this issue, add an internal ct helper and attach it to the
conntrack entry to streamline the custom ct expectation support with
existing ct helpers.
Expose a new nf_conntrack_helper_release() function to release the
internal helper that is allocated and attached to the conntrack entry to
create the custom expectations. The nft_ct module removal always waits
for rcu grace period, then the NULL helper callback is observed after
this.
This patch also restricts the creation of expectations to different
helpers other than this custom helper that is created for this type of
expectations.
Fixes: 857b46027d6f ("netfilter: nft_ct: add ct expectations support")
Reported-by: Jaeyeong Lee <iostreampy@proton.me>
Link: https://patch.msgid.link/20260715144755.00ea7dfcd9f@proton.me
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[ - ac46f3f35b6e ("netfilter: nf_conntrack_helper: add refcounting from
datapath") is not backported because it reworks helper lifetime
around a datapath ct_refcnt in 9 files, so one static nft_ct_expect
helper is unhelped at nft_ct module exit.
- d4beefc90a66 ("netfilter: nft_ct: support expectation creation for
natted flows") is not backported because it adds expectation support
for NATed flows, so the moved expectation code has no NAT
follow-master part.
- Context differs due to commit: 6031487d4e27 ]
Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netfilter/nf_conntrack_helper.h | 1 +
net/netfilter/nf_conntrack_helper.c | 20 ++--
net/netfilter/nft_ct.c | 100 +++++++++++++++-----
3 files changed, 89 insertions(+), 32 deletions(-)
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 24cf3d2d97450..5b76fa57fd76c 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -105,6 +105,7 @@ void nf_ct_helper_init(struct nf_conntrack_helper *helper,
int nf_conntrack_helper_register(struct nf_conntrack_helper *);
void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
+void nf_conntrack_helper_release(struct nf_conntrack_helper *);
int nf_conntrack_helpers_register(struct nf_conntrack_helper *, unsigned int);
void nf_conntrack_helpers_unregister(struct nf_conntrack_helper *,
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
index 2caf728408a70..8f5e79e35f682 100644
--- a/net/netfilter/nf_conntrack_helper.c
+++ b/net/netfilter/nf_conntrack_helper.c
@@ -430,6 +430,18 @@ static bool expect_iter_me(struct nf_conntrack_expect *exp, void *data)
return this == me;
}
+void nf_conntrack_helper_release(struct nf_conntrack_helper *me)
+{
+ nf_ct_expect_iterate_destroy(expect_iter_me, me);
+ nf_ct_iterate_destroy(unhelp, me);
+
+ /* nf_ct_iterate_destroy() does an unconditional synchronize_rcu() as
+ * last step, this ensures rcu readers of exp->helper are done.
+ * No need for another synchronize_rcu() here.
+ */
+}
+EXPORT_SYMBOL_GPL(nf_conntrack_helper_release);
+
void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
{
mutex_lock(&nf_ct_helper_mutex);
@@ -442,13 +454,7 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
*/
synchronize_rcu();
- nf_ct_expect_iterate_destroy(expect_iter_me, me);
- nf_ct_iterate_destroy(unhelp, me);
-
- /* nf_ct_iterate_destroy() does an unconditional synchronize_rcu() as
- * last step, this ensures rcu readers of exp->helper are done.
- * No need for another synchronize_rcu() here.
- */
+ nf_conntrack_helper_release(me);
}
EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister);
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index 13e47c7b42785..79a7d99385f47 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -1209,6 +1209,65 @@ static int nft_ct_expect_timeout_get(const struct nlattr *attr, u32 *val)
return 0;
}
+struct nft_ct_expect_data {
+ struct nft_ct_expect_obj obj;
+ enum ip_conntrack_dir dir;
+};
+
+static int ct_expect_help(struct sk_buff *skb, unsigned int protoff,
+ struct nf_conn *ct, enum ip_conntrack_info ctinfo)
+{
+ enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
+ struct nft_ct_expect_data *expect_data;
+ struct nf_conntrack_expect *exp;
+ int ret = NF_ACCEPT;
+ u16 l3num;
+
+ if (nf_ct_is_confirmed(ct))
+ return NF_ACCEPT;
+
+ expect_data = nfct_help_data(ct);
+ if (!expect_data)
+ return NF_ACCEPT;
+
+ if (expect_data->dir != dir)
+ return NF_ACCEPT;
+
+ exp = nf_ct_expect_alloc(ct);
+ if (!exp)
+ return NF_DROP;
+
+ if (expect_data->obj.l3num == NFPROTO_INET)
+ l3num = nf_ct_l3num(ct);
+ else
+ l3num = expect_data->obj.l3num;
+
+ nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, l3num,
+ &ct->tuplehash[!dir].tuple.src.u3,
+ &ct->tuplehash[!dir].tuple.dst.u3,
+ expect_data->obj.l4proto, NULL, &expect_data->obj.dport);
+ exp->timeout += expect_data->obj.timeout;
+
+ if (nf_ct_expect_related(exp, 0) != 0)
+ ret = NF_ACCEPT;
+
+ nf_ct_expect_put(exp);
+
+ return ret;
+}
+
+static const struct nf_conntrack_expect_policy nft_ct_expect_helper_policy = {
+ .max_expected = NF_CT_EXPECT_MAX_CNT,
+};
+
+/* No need to register this helper, this is internal. */
+static struct nf_conntrack_helper nft_ct_expect_helper = {
+ .name = "nft_ct_expect",
+ .me = THIS_MODULE,
+ .expect_policy = &nft_ct_expect_helper_policy,
+ .help = ct_expect_help,
+};
+
static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
const struct nlattr * const tb[],
struct nft_object *obj)
@@ -1216,6 +1275,8 @@ static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
struct nft_ct_expect_obj *priv = nft_obj_data(obj);
int err;
+ NF_CT_HELPER_BUILD_BUG_ON(sizeof(struct nft_ct_expect_data));
+
if (!tb[NFTA_CT_EXPECT_L4PROTO] ||
!tb[NFTA_CT_EXPECT_DPORT] ||
!tb[NFTA_CT_EXPECT_TIMEOUT] ||
@@ -1261,7 +1322,7 @@ static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
}
static void nft_ct_expect_obj_destroy(const struct nft_ctx *ctx,
- struct nft_object *obj)
+ struct nft_object *obj)
{
nf_ct_netns_put(ctx->net, ctx->family);
}
@@ -1286,11 +1347,9 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
const struct nft_pktinfo *pkt)
{
const struct nft_ct_expect_obj *priv = nft_obj_data(obj);
- struct nf_conntrack_expect *exp;
+ struct nft_ct_expect_data *expect_data;
enum ip_conntrack_info ctinfo;
struct nf_conn_help *help;
- enum ip_conntrack_dir dir;
- u16 l3num = priv->l3num;
struct nf_conn *ct;
ct = nf_ct_get(pkt->skb, &ctinfo);
@@ -1298,38 +1357,28 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
regs->verdict.code = NFT_BREAK;
return;
}
- dir = CTINFO2DIR(ctinfo);
help = nfct_help(ct);
- if (!help)
- help = nf_ct_helper_ext_add(ct, GFP_ATOMIC);
- if (!help) {
- regs->verdict.code = NF_DROP;
- return;
- }
-
- if (help->expecting[NF_CT_EXPECT_CLASS_DEFAULT] >= priv->size) {
+ if (help) {
regs->verdict.code = NFT_BREAK;
return;
}
- if (l3num == NFPROTO_INET)
- l3num = nf_ct_l3num(ct);
- exp = nf_ct_expect_alloc(ct);
- if (exp == NULL) {
+ help = nf_ct_helper_ext_add(ct, GFP_ATOMIC);
+ if (!help) {
regs->verdict.code = NF_DROP;
return;
}
- nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, l3num,
- &ct->tuplehash[!dir].tuple.src.u3,
- &ct->tuplehash[!dir].tuple.dst.u3,
- priv->l4proto, NULL, &priv->dport);
- exp->timeout += priv->timeout;
- if (nf_ct_expect_related(exp, 0) != 0)
- regs->verdict.code = NF_DROP;
+ expect_data = nfct_help_data(ct);
+ if (!expect_data) {
+ regs->verdict.code = NFT_BREAK;
+ return;
+ }
+ expect_data->obj = *priv;
+ expect_data->dir = CTINFO2DIR(ctinfo);
- nf_ct_expect_put(exp);
+ rcu_assign_pointer(help->helper, &nft_ct_expect_helper);
}
static const struct nla_policy nft_ct_expect_policy[NFTA_CT_EXPECT_MAX + 1] = {
@@ -1409,6 +1458,7 @@ static void __exit nft_ct_module_exit(void)
nft_unregister_obj(&nft_ct_helper_obj_type);
nft_unregister_expr(&nft_notrack_type);
nft_unregister_expr(&nft_ct_type);
+ nf_conntrack_helper_release(&nft_ct_expect_helper);
}
module_init(nft_ct_module_init);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0003/1167] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0001/1167] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0002/1167] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0004/1167] drm/amdgpu: Check cs flags Greg Kroah-Hartman
` (654 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Pedro Falcato,
Gregory Price (Meta), Muhammad Usama Anjum, Lance Yang,
Baolin Wang, David Hildenbrand (Arm), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit fe2817e3d5ea347214342c9a5cd8bcbff20c0574 ]
try_collapse_pte_mapped_thp() clears PTEs without transferring their dirty
bits to the folio. A shmem read fault can map a clean folio writable, so
a later store only dirties the PTE. Losing that dirty bit allows reclaim
to discard modified data.
The assumption that regular files are read-only is also obsolete since
commit 1b6444331bebb ("mm/khugepaged: enable clean pagecache folio collapse
for writable files"). In any case, transferring PTE dirty bits to the folio
when removing mappings (and while the folio is still mapped) is the right
thing to do.
Use get_and_clear_ptes() to collect the dirty bits and mark the folio
dirty before unmapping it. Update the comment.
This was reproduced with shmem using MADV_COLLAPSE followed by
MADV_PAGEOUT.
Fix generated by an LLM and sent by Chris Mason in private.
Fixes: 27e1f8273113 ("khugepaged: enable collapse pmd for pte-mapped THP")
Fixes: 1b6444331bebb ("mm/khugepaged: enable clean pagecache folio collapse for writable files")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Mason <mason@kernel.org>
[ david: adjust comment; simplify description; cover file-thp as well ]
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-17-d6437171ecc3@kernel.org
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: adapted batched folio-based PTE handling to the existing per-PTE loop using ptep_get_and_clear() and set_page_dirty() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/khugepaged.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 25fb56d4d13f9..76a1145d2f191 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1612,9 +1612,10 @@ int collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr,
/*
* Must clear entry, or a racing truncate may re-remove it.
* TLB flush can be left until pmdp_collapse_flush() does it.
- * PTE dirty? Shmem page is already dirty; file is read-only.
*/
- ptep_clear(mm, addr, pte);
+ ptent = ptep_get_and_clear(mm, addr, pte);
+ if (pte_dirty(ptent))
+ set_page_dirty(page);
page_remove_rmap(page, vma, false);
nr_ptes++;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0004/1167] drm/amdgpu: Check cs flags.
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0003/1167] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0005/1167] bpf: Fix memory access flags in helper prototypes Greg Kroah-Hartman
` (653 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bas Nieuwenhuizen, Faith Ekstrand,
Alex Deucher, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
[ Upstream commit f5ea64f9fcd921bc4e2307a262e19450b8a58524 ]
Had no validation before. libdrm_amdgpu memsets this, even
for the raw/raw2 functions.
We have a lot of functions touching the ioctl struct, no
strong opinion on where this is placed, but I thought
early would be good.
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4d01e15e76358f60ef6734462d2b6d9972b9dfbc)
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 6d42290d68fb3..f4e983d8e3fe2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -208,6 +208,9 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
int ret;
int i;
+ if (cs->in.flags)
+ return -EINVAL;
+
chunk_array = memdup_array_user(u64_to_user_ptr(cs->in.chunks),
cs->in.num_chunks,
sizeof(uint64_t));
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0005/1167] bpf: Fix memory access flags in helper prototypes
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0004/1167] drm/amdgpu: Check cs flags Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0006/1167] bpf: Drop inet_conn_established from lsm sleepable hooks Greg Kroah-Hartman
` (652 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shuran Liu, Peili Gao, Haoran Ni,
Zesen Liu, Eduard Zingerman, Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zesen Liu <ftyghome@gmail.com>
[ Upstream commit 802eef5afb1865bc5536a5302c068ba2215a1f72 ]
After commit 37cce22dbd51 ("bpf: verifier: Refactor helper access type tracking"),
the verifier started relying on the access type flags in helper
function prototypes to perform memory access optimizations.
Currently, several helper functions utilizing ARG_PTR_TO_MEM lack the
corresponding MEM_RDONLY or MEM_WRITE flags. This omission causes the
verifier to incorrectly assume that the buffer contents are unchanged
across the helper call. Consequently, the verifier may optimize away
subsequent reads based on this wrong assumption, leading to correctness
issues.
For bpf_get_stack_proto_raw_tp, the original MEM_RDONLY was incorrect
since the helper writes to the buffer. Change it to ARG_PTR_TO_UNINIT_MEM
which correctly indicates write access to potentially uninitialized memory.
Similar issues were recently addressed for specific helpers in commit
ac44dcc788b9 ("bpf: Fix verifier assumptions of bpf_d_path's output buffer")
and commit 2eb7648558a7 ("bpf: Specify access type of bpf_sysctl_get_name args").
Fix these prototypes by adding the correct memory access flags.
Fixes: 37cce22dbd51 ("bpf: verifier: Refactor helper access type tracking")
Co-developed-by: Shuran Liu <electronlsr@gmail.com>
Signed-off-by: Shuran Liu <electronlsr@gmail.com>
Co-developed-by: Peili Gao <gplhust955@gmail.com>
Signed-off-by: Peili Gao <gplhust955@gmail.com>
Co-developed-by: Haoran Ni <haoran.ni.cs@gmail.com>
Signed-off-by: Haoran Ni <haoran.ni.cs@gmail.com>
Signed-off-by: Zesen Liu <ftyghome@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20260120-helper_proto-v3-1-27b0180b4e77@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/helpers.c | 2 +-
kernel/bpf/syscall.c | 2 +-
kernel/trace/bpf_trace.c | 6 +++---
net/core/filter.c | 20 ++++++++++----------
4 files changed, 15 insertions(+), 15 deletions(-)
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -1092,7 +1092,7 @@ const struct bpf_func_proto bpf_snprintf
.func = bpf_snprintf,
.gpl_only = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_MEM_OR_NULL,
+ .arg1_type = ARG_PTR_TO_MEM_OR_NULL | MEM_WRITE,
.arg2_type = ARG_CONST_SIZE_OR_ZERO,
.arg3_type = ARG_PTR_TO_CONST_STR,
.arg4_type = ARG_PTR_TO_MEM | PTR_MAYBE_NULL | MEM_RDONLY,
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -5862,7 +5862,7 @@ static const struct bpf_func_proto bpf_k
.func = bpf_kallsyms_lookup_name,
.gpl_only = false,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_MEM,
+ .arg1_type = ARG_PTR_TO_MEM | MEM_RDONLY,
.arg2_type = ARG_CONST_SIZE_OR_ZERO,
.arg3_type = ARG_ANYTHING,
.arg4_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_UNINIT | MEM_WRITE | MEM_ALIGNED,
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1026,7 +1026,7 @@ const struct bpf_func_proto bpf_snprintf
.func = bpf_snprintf_btf,
.gpl_only = false,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_MEM,
+ .arg1_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg2_type = ARG_CONST_SIZE,
.arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY,
.arg4_type = ARG_CONST_SIZE,
@@ -1790,7 +1790,7 @@ static const struct bpf_func_proto bpf_r
.gpl_only = true,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM_OR_NULL,
+ .arg2_type = ARG_PTR_TO_MEM_OR_NULL | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
.arg4_type = ARG_ANYTHING,
};
@@ -1925,7 +1925,7 @@ static const struct bpf_func_proto bpf_g
.gpl_only = true,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
+ .arg2_type = ARG_PTR_TO_UNINIT_MEM,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
.arg4_type = ARG_ANYTHING,
};
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6271,7 +6271,7 @@ static const struct bpf_func_proto bpf_x
.gpl_only = true,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE,
.arg4_type = ARG_ANYTHING,
};
@@ -6326,7 +6326,7 @@ static const struct bpf_func_proto bpf_s
.gpl_only = true,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE,
.arg4_type = ARG_ANYTHING,
};
@@ -7881,9 +7881,9 @@ static const struct bpf_func_proto bpf_t
.gpl_only = true, /* __cookie_v4_init_sequence() is GPL */
.pkt_access = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg1_size = sizeof(struct iphdr),
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
};
@@ -7913,9 +7913,9 @@ static const struct bpf_func_proto bpf_t
.gpl_only = true, /* __cookie_v6_init_sequence() is GPL */
.pkt_access = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg1_size = sizeof(struct ipv6hdr),
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
};
@@ -7935,9 +7935,9 @@ static const struct bpf_func_proto bpf_t
.gpl_only = true, /* __cookie_v4_check is GPL */
.pkt_access = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg1_size = sizeof(struct iphdr),
- .arg2_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg2_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg2_size = sizeof(struct tcphdr),
};
@@ -7961,9 +7961,9 @@ static const struct bpf_func_proto bpf_t
.gpl_only = true, /* __cookie_v6_check is GPL */
.pkt_access = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg1_size = sizeof(struct ipv6hdr),
- .arg2_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg2_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg2_size = sizeof(struct tcphdr),
};
#endif /* CONFIG_SYN_COOKIES */
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0006/1167] bpf: Drop inet_conn_established from lsm sleepable hooks
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0005/1167] bpf: Fix memory access flags in helper prototypes Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0007/1167] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
` (651 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, BoBppy, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
The backport of commit beaf0e96b1da ("bpf: Drop task_to_inode and
inet_conn_established from lsm sleepable hooks") to this tree removed
only bpf_lsm_task_to_inode from sleepable_lsm_hooks.
bpf_lsm_inet_conn_established is still listed there, although the hook
is called from softirq context and cannot be used by sleepable LSM
programs.
Remove it too, which completes the backport.
Fixes: 26b380a3ca0b ("bpf: Drop task_to_inode and inet_conn_established from lsm sleepable hooks")
Reported-by: BoBppy <inkxiao12@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/bpf_lsm.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c
index 7904513373672..411622162659e 100644
--- a/kernel/bpf/bpf_lsm.c
+++ b/kernel/bpf/bpf_lsm.c
@@ -305,10 +305,6 @@ BTF_ID(func, bpf_lsm_file_lock)
BTF_ID(func, bpf_lsm_file_open)
BTF_ID(func, bpf_lsm_file_receive)
-#ifdef CONFIG_SECURITY_NETWORK
-BTF_ID(func, bpf_lsm_inet_conn_established)
-#endif /* CONFIG_SECURITY_NETWORK */
-
BTF_ID(func, bpf_lsm_inode_create)
BTF_ID(func, bpf_lsm_inode_free_security)
BTF_ID(func, bpf_lsm_inode_getattr)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0007/1167] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0006/1167] bpf: Drop inet_conn_established from lsm sleepable hooks Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0008/1167] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
` (650 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Johannes Weiner, Andrew Morton,
Balbir Singh, Vlastimil Babka (SUSE), Matthew Wilcox (Oracle),
Salvatore Dipietro, Christoph Hellwig, Dave Chinner, Matt Fleming,
Mel Gorman, Michal Hocko, Suren Baghdasaryan, Brendan Jackman,
Zi Yan, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Weiner <hannes@cmpxchg.org>
[ Upstream commit fe21f930d1e64d121191673076fc4ebe79fc82d5 ]
1ebbb21811b7 ("mm/page_alloc: explicitly define how __GFP_HIGH
non-blocking allocations accesses reserves") stopped handing out reserve
access for ALLOC_NON_BLOCK on its own: the extra 25% below the min
watermark is now only granted on top of ALLOC_MIN_RESERVE. But the flag
was left in ALLOC_RESERVES, which produces something odd:
With the ALLOC_RESERVES match, __zone_watermark_unusable_free() doesn't
subtract the free highatomic pages for them. So in the slowpath, they get
to consume regular blocks below the min watermark by the number of free
highatomic pages. The highatomic reserve is capped at 1% of the zone,
which on any decently sized machine is a multiple of the min watermark:
GFP_NOWAIT can drain regular memory to zero.
The user-visible result is brutal hiccups during bursts of GFP_NOWAIT
allocations under memory pressure. This was found in review and
reproduced with a synthetic burst, not observed in production, but the
sequence of events is a realistic one: On a 32G box with an anonymous
working set, swap, and a filled 290M highatomic reserve, a GFP_NOWAIT
burst drove regular free memory in the 28G Normal zone (min=60M) to 28M,
0.8M and 0.6M in three runs. Swapout failed to allocate its swap table,
reclaim scanned 13M pages to reclaim 200k, page faults stalled for tens to
hundreds of milliseconds. The machine survives it, but not by design:
direct reclaimers eventually fail and start unreserving highatomic blocks,
until the allocation succeeds or the reserve is gone and the OOM killer
runs. That reserve exists for high-order atomic allocations; here it is
destroyed to bail out a GFP_NOWAIT consumer that was never entitled to the
memory.
Remove ALLOC_NON_BLOCK from ALLOC_RESERVES. With that, the GFP_NOWAIT
burst is stopped short at the min watermark. No direct reclaim, no
stalls, no failed allocations, and the highatomic reserve stays intact for
the requests it exists for.
__zone_watermark_ok() is unaffected, since everything it keys on
ALLOC_NON_BLOCK is already nested under ALLOC_MIN_RESERVE. Update the
flag comments accordingly: ALLOC_NON_BLOCK just means the caller can't
block; the reserve math belongs with ALLOC_MIN_RESERVE.
GFP_ATOMIC order-0 requests have a milder version of the same problem.
Through ALLOC_MIN_RESERVE they also count the free highatomic pages in
their watermark check, but rmqueue_buddy() serves them regular pages first
and only falls back to the reserve once those are gone. They can still
push regular free memory to 37.5% of min minus the free highatomic pages
before the reserve is touched. Unlike GFP_NOWAIT they are entitled to the
reserve, so this needs the watermark check and the freelist order reworked
together, and is left to a separate patch.
Link: https://lore.kernel.org/20261028171719.2043421-3-hannes@cmpxchg.org
Fixes: 1ebbb21811b7 ("mm/page_alloc: explicitly define how __GFP_HIGH non-blocking allocations accesses reserves")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Balbir Singh <balbirs@nvidia.com>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Salvatore Dipietro <dipiets@amazon.it>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <dgc@kernel.org>
Cc: Matt Fleming <matt@readmodwrite.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: Zi Yan <ziy@nvidia.com>
Cc: <stable@vger.kernel.org>
[ sashal: Moved the ALLOC_* flag edits from mm/page_alloc.h to mm/internal.h, since the older tree lacks that header, with identical content changes and different surrounding context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/internal.h | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/mm/internal.h b/mm/internal.h
index 1106bab6abc9e..7e7102969f3a0 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -896,12 +896,11 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
#define ALLOC_OOM ALLOC_NO_WATERMARKS
#endif
-#define ALLOC_NON_BLOCK 0x10 /* Caller cannot block. Allow access
- * to 25% of the min watermark or
- * 62.5% if __GFP_HIGH is set.
- */
+#define ALLOC_NON_BLOCK 0x10 /* Caller cannot block. */
#define ALLOC_MIN_RESERVE 0x20 /* __GFP_HIGH set. Allow access to 50%
- * of the min watermark.
+ * of the min watermark, or 62.5% if
+ * the caller cannot block either
+ * (ALLOC_NON_BLOCK).
*/
#define ALLOC_CPUSET 0x40 /* check for correct cpuset */
#define ALLOC_CMA 0x80 /* allow allocations from CMA areas */
@@ -914,7 +913,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
#define ALLOC_KSWAPD 0x800 /* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */
/* Flags that allow allocations below the min watermark. */
-#define ALLOC_RESERVES (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM)
+#define ALLOC_RESERVES (ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM)
/* Flags that mean GFP_ATOMIC */
#define ALLOC_MASK_ATOMIC (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0008/1167] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0007/1167] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0009/1167] bpf: Fix verifier assumptions of bpf_d_paths output buffer Greg Kroah-Hartman
` (649 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Thomas Gleixner,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 0f214e5bbee59d5952d3c061fd65ed9a1e175981 ]
__plic_toggle() builds a 32-bit interrupt enable mask using a signed
integer literal. A valid interrupt selecting bit 31 evaluates 1 << 31,
which shifts a signed int into its sign bit.
Use BIT(), matching the equivalent mask construction in plic_irq_eoi().
The resulting mask remains representable in u32 on both RV32 and RV64.
The issue was found by our static-analysis tool.
Fixes: 8237f8bc4f6e ("irqchip: add a SiFive PLIC driver")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: gpt 5
Link: https://patch.msgid.link/caplitmus-rv.v2.plic.87a8fc444de44e109889ba28703c76f3@163.com
[ sashal: adjusted context because __plic_toggle() here takes an enable_base pointer instead of a handler struct; the one-line BIT() mask change is identical. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-sifive-plic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index 794bdb6d4d1e3..a9f1e87fec166 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -93,7 +93,7 @@ static int plic_irq_set_type(struct irq_data *d, unsigned int type);
static void __plic_toggle(void __iomem *enable_base, int hwirq, int enable)
{
u32 __iomem *reg = enable_base + (hwirq / 32) * sizeof(u32);
- u32 hwirq_mask = 1 << (hwirq % 32);
+ u32 hwirq_mask = BIT(hwirq % 32);
if (enable)
writel(readl(reg) | hwirq_mask, reg);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0009/1167] bpf: Fix verifier assumptions of bpf_d_paths output buffer
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0008/1167] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0010/1167] bpf: Specify access type of bpf_sysctl_get_name args Greg Kroah-Hartman
` (648 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zesen Liu, Peili Gao, Haoran Ni,
Shuran Liu, Matt Bobrowski, Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuran Liu <electronlsr@gmail.com>
[ Upstream commit ac44dcc788b950606793e8f9690c30925f59df02 ]
Commit 37cce22dbd51 ("bpf: verifier: Refactor helper access type
tracking") started distinguishing read vs write accesses performed by
helpers.
The second argument of bpf_d_path() is a pointer to a buffer that the
helper fills with the resulting path. However, its prototype currently
uses ARG_PTR_TO_MEM without MEM_WRITE.
Before 37cce22dbd51, helper accesses were conservatively treated as
potential writes, so this mismatch did not cause issues. Since that
commit, the verifier may incorrectly assume that the buffer contents
are unchanged across the helper call and base its optimizations on this
wrong assumption. This can lead to misbehaviour in BPF programs that
read back the buffer, such as prefix comparisons on the returned path.
Fix this by marking the second argument of bpf_d_path() as
ARG_PTR_TO_MEM | MEM_WRITE so that the verifier correctly models the
write to the caller-provided buffer.
Fixes: 37cce22dbd51 ("bpf: verifier: Refactor helper access type tracking")
Co-developed-by: Zesen Liu <ftyg@live.com>
Signed-off-by: Zesen Liu <ftyg@live.com>
Co-developed-by: Peili Gao <gplhust955@gmail.com>
Signed-off-by: Peili Gao <gplhust955@gmail.com>
Co-developed-by: Haoran Ni <haoran.ni.cs@gmail.com>
Signed-off-by: Haoran Ni <haoran.ni.cs@gmail.com>
Signed-off-by: Shuran Liu <electronlsr@gmail.com>
Reviewed-by: Matt Bobrowski <mattbobrowski@google.com>
Link: https://lore.kernel.org/r/20251206141210.3148-2-electronlsr@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/bpf_trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index d9fc981f9ada9..4b13ab0daa5f9 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -969,7 +969,7 @@ static const struct bpf_func_proto bpf_d_path_proto = {
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_BTF_ID,
.arg1_btf_id = &bpf_d_path_btf_ids[0],
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
.allowed = bpf_d_path_allowed,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0010/1167] bpf: Specify access type of bpf_sysctl_get_name args
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0009/1167] bpf: Fix verifier assumptions of bpf_d_paths output buffer Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0011/1167] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
` (647 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jerome Marchand, Yonghong Song,
Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Marchand <jmarchan@redhat.com>
[ Upstream commit 2eb7648558a7911f2208e8940cd22ca40e93cc76 ]
The second argument of bpf_sysctl_get_name() helper is a pointer to a
buffer that is being written to. However that isn't specify in the
prototype.
Until commit 37cce22dbd51a ("bpf: verifier: Refactor helper access
type tracking"), all helper accesses were considered as a possible
write access by the verifier, so no big harm was done. However, since
then, the verifier might make wrong asssumption about the content of
that address which might lead it to make faulty optimizations (such as
removing code that was wrongly labeled dead). This is what happens in
test_sysctl selftest to the tests related to sysctl_get_name.
Add MEM_WRITE flag the second argument of bpf_sysctl_get_name().
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20250619140603.148942-2-jmarchan@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 790de12ca57ff..433ecc6579b1a 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -2147,7 +2147,7 @@ static const struct bpf_func_proto bpf_sysctl_get_name_proto = {
.gpl_only = false,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE,
.arg4_type = ARG_ANYTHING,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0011/1167] fs: aio: reject partial mremap to avoid Null-pointer-dereference error
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0010/1167] bpf: Specify access type of bpf_sysctl_get_name args Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0012/1167] virtio_net: check RX buffer length before DMA sync Greg Kroah-Hartman
` (646 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zizhi Wo, Jan Kara,
Christian Brauner, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zizhi Wo <wozizhi@huawei.com>
[ Upstream commit 3adf7ae18bf42601246031002287c103a27df307 ]
[BUG]
Recently, our internal syzkaller testing uncovered a null pointer
dereference issue:
BUG: kernel NULL pointer dereference, address: 0000000000000000
...
[ 51.111664] filemap_read_folio+0x25/0xe0
[ 51.112410] filemap_fault+0xad7/0x1250
[ 51.113112] __do_fault+0x4b/0x460
[ 51.113699] do_pte_missing+0x5bc/0x1db0
[ 51.114250] ? __pte_offset_map+0x23/0x170
[ 51.114822] __handle_mm_fault+0x9f8/0x1680
...
Crash analysis showed the file involved was an AIO ring file. The
phenomenon triggered is the same as the issue described in [1].
[CAUSE]
Consider the following scenario: userspace sets up an AIO context via
io_setup(), which creates a VMA covering the entire ring buffer. Then
userspace calls mremap() with the AIO ring address as the source, a smaller
old_len (less than the full ring size), MREMAP_MAYMOVE set, and without
MREMAP_DONTUNMAP. The kernel will relocate the requested portion to a new
destination address.
During this move, __split_vma() splits the original AIO ring VMA. The
requested portion is unmapped from the source and re-established at the
destination, while the remainder stays at the original source address as
an orphan VMA. The aio_ring_mremap() callback fires on the new destination
VMA, updating ctx->mmap_base to the destination address. But the callback
is unaware that only a partial region was moved and that an orphan VMA
still exists at the source:
source(AIO):
+-------------------+---------------------+
| moved to dest | orphan VMA (AIO) |
+-------------------+---------------------+
A A+partial_len A+ctx->mmap_size
dest:
+-------------------+
| moved VMA (AIO) |
+-------------------+
B B+partial_len
Later, io_destroy() calls vm_munmap(ctx->mmap_base, ctx->mmap_size), which
unmaps the destination. This not only fails to unmap the orphan VMA at the
source, but also overshoots the destination VMA and may unmap unrelated
mappings adjacent to it! After put_aio_ring_file() calls truncate_setsize()
to remove all pages from the pagecache, any subsequent access to the orphan
VMA triggers filemap_fault(), which calls a_ops->read_folio(). Since aio
does not implement read_folio, this results in a NULL pointer dereference.
[FIX]
Note that expanding mremap (new_len > old_len) is already rejected because
AIO ring VMAs are created with VM_DONTEXPAND. The only problematic case is
a partial move where "old_len == new_len" but both are smaller than the
full ring size.
Fix this by checking in aio_ring_mremap() that the new VMA covers the
entire ring. This ensures the AIO ring is always moved as a whole,
preventing orphan VMAs and the subsequent crash.
[1]: https://lore.kernel.org/all/20260413010814.548568-1-wozizhi@huawei.com/
Signed-off-by: Zizhi Wo <wozizhi@huaweicloud.com>
Link: https://patch.msgid.link/20260418060634.3713620-1-wozizhi@huaweicloud.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/aio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/aio.c b/fs/aio.c
index 8a4d95a825678..a7309c2250138 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -369,7 +369,8 @@ static int aio_ring_mremap(struct vm_area_struct *vma)
ctx = rcu_dereference(table->table[i]);
if (ctx && ctx->aio_ring_file == file) {
- if (!atomic_read(&ctx->dead)) {
+ if (!atomic_read(&ctx->dead) &&
+ (ctx->mmap_size == (vma->vm_end - vma->vm_start))) {
ctx->user_id = ctx->mmap_base = vma->vm_start;
res = 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0012/1167] virtio_net: check RX buffer length before DMA sync
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0011/1167] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0013/1167] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
` (645 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nikolai Kalinin,
Vladimir Petrzhikovskii, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Petrzhikovskii <vladimir@dfb.sh>
[ Upstream commit 29dfa436bc488056a84ee423ba82336db453e2a6 ]
An RX queue that uses the DMA API (rq->use_page_pool_dma, for example
with VIRTIO_F_ACCESS_PLATFORM) syncs each received buffer with
page_pool_dma_sync_for_cpu() using the length the device wrote to the
used ring, and checks that length against the posted buffer only after
the sync.
With SWIOTLB bouncing (swiotlb=force, or a confidential-computing
guest), the sync copies from the shared bounce buffer into the guest's
private page, so an oversized length also copies the bytes the device
wrote past the posted buffer over the neighbouring page pool fragments.
The later check drops the packet, but the copy has already happened. A
malicious device, such as a host the confidential guest does not
trust, can overwrite guest kernel memory next to an RX buffer with
bytes it chooses, which is enough to take an unprivileged guest
process to root.
Check the length before the sync in the per-fragment loops.
receive_buf() has to sync the header before the length check, because
the mergeable error path reads num_buffers from it, so limit that sync
to the posted length. A device that reports correct lengths sees no
change.
The driver has synced with the device's length since
commit 295525e29a5b ("virtio_net: merge dma operations when filling
mergeable buffers"), at first in virtnet_rq_unmap(). Commit 24fbd3967f3f
("virtio_net: add page_pool support for buffer allocation") moved the
sync to the page_pool call sites that this patch changes, so the patch
applies to v7.1 and later. Older kernels need a separate backport that
limits the sync in virtnet_rq_unmap().
Found by an LLM code review agent auditing users of the DMA API; the
fix and this changelog were also written with an LLM coding assistant
and reviewed by us. Reproduced in QEMU with swiotlb=force and
iommu_platform=on, a test-only device change that reports a used length
64 bytes past the posted buffer and writes a marker there, and a guest
kprobe module that reads the buffer after the sync: without this patch
the marker reaches the guest page for small and mergeable buffers; with
it the packets are dropped and counted in rx_length_errors. The
virtio_net selftest basic_features.sh passes with and without mergeable
buffers.
Fixes: 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers")
Cc: stable@vger.kernel.org
Co-developed-by: Nikolai Kalinin <nikolai@kalinidze.me>
Signed-off-by: Nikolai Kalinin <nikolai@kalinidze.me>
Signed-off-by: Vladimir Petrzhikovskii <vladimir@dfb.sh>
Link: https://patch.msgid.link/20261110-b4-virtionet-rxlen-v2-1-6ec5aa0edf9f@dfb.sh
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ vladimir: 6.6.y has no page_pool RX buffers. A queue in premapped
mode (rq->do_dma) syncs small and mergeable RX buffers in
virtnet_rq_get_buf() with the length from the used ring, before any
length check. Limit that sync to the length of the posted buffer; the
existing checks then drop the packet. Tested with the reproducer
described above: without this patch the marker reaches the guest page
for small and mergeable buffers; with it the sync stops at the posted
length and the packets are counted in rx_length_errors. ]
Signed-off-by: Vladimir Petrzhikovskii <vladimir@dfb.sh>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/virtio_net.c | 51 +++++++++++++++++++++++++++++++---------
1 file changed, 40 insertions(+), 11 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b8a966f03ef65..acc6b5cdd7927 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -488,19 +488,32 @@ static unsigned int mergeable_ctx_to_truesize(void *mrg_ctx)
return (unsigned long)mrg_ctx & ((1 << MRG_CTX_HEADER_SHIFT) - 1);
}
-static int check_mergeable_len(struct net_device *dev, void *mrg_ctx,
- unsigned int len)
+/* Length of the mergeable buffer that add_recvbuf_mergeable() posted. */
+static unsigned int mergeable_ctx_to_buflen(void *mrg_ctx)
{
- unsigned int headroom, tailroom, room, truesize;
+ unsigned int headroom, tailroom, room;
- truesize = mergeable_ctx_to_truesize(mrg_ctx);
headroom = mergeable_ctx_to_headroom(mrg_ctx);
tailroom = headroom ? sizeof(struct skb_shared_info) : 0;
room = SKB_DATA_ALIGN(headroom + tailroom);
- if (len > truesize - room) {
- pr_debug("%s: rx error: len %u exceeds truesize %lu\n",
- dev->name, len, (unsigned long)(truesize - room));
+ return mergeable_ctx_to_truesize(mrg_ctx) - room;
+}
+
+/* Length of the small buffer that add_recvbuf_small() posts. */
+static unsigned int small_buflen(const struct virtnet_info *vi)
+{
+ return vi->hdr_len + GOOD_PACKET_LEN;
+}
+
+static int check_mergeable_len(struct net_device *dev, void *mrg_ctx,
+ unsigned int len)
+{
+ unsigned int buflen = mergeable_ctx_to_buflen(mrg_ctx);
+
+ if (len > buflen) {
+ pr_debug("%s: rx error: len %u exceeds buffer length %u\n",
+ dev->name, len, buflen);
DEV_STATS_INC(dev, rx_length_errors);
return -1;
}
@@ -654,11 +667,27 @@ static void virtnet_rq_unmap(struct receive_queue *rq, void *buf, u32 len)
static void *virtnet_rq_get_buf(struct receive_queue *rq, u32 *len, void **ctx)
{
+ struct virtnet_info *vi = rq->vq->vdev->priv;
+ void *buf_ctx;
+ u32 buflen;
void *buf;
- buf = virtqueue_get_buf_ctx(rq->vq, len, ctx);
- if (buf && rq->do_dma)
- virtnet_rq_unmap(rq, buf, *len);
+ if (!rq->do_dma)
+ return virtqueue_get_buf_ctx(rq->vq, len, ctx);
+
+ buf = virtqueue_get_buf_ctx(rq->vq, len, &buf_ctx);
+ if (!buf)
+ return NULL;
+
+ /* The device chooses *len. Sync only the buffer that was posted, so
+ * that a larger *len cannot copy over the buffers next to it.
+ */
+ buflen = vi->mergeable_rx_bufs ? mergeable_ctx_to_buflen(buf_ctx) :
+ small_buflen(vi);
+ virtnet_rq_unmap(rq, buf, min(*len, buflen));
+
+ if (ctx)
+ *ctx = buf_ctx;
return buf;
}
@@ -1914,7 +1943,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, struct receive_queue *rq,
buf += VIRTNET_RX_PAD + xdp_headroom;
- virtnet_rq_init_one_sg(rq, buf, vi->hdr_len + GOOD_PACKET_LEN);
+ virtnet_rq_init_one_sg(rq, buf, small_buflen(vi));
err = virtqueue_add_inbuf_ctx(rq->vq, rq->sg, 1, buf, ctx, gfp);
if (err < 0) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0013/1167] mm/ksm: fix userfaultfd protection during merge and unmerge
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0012/1167] virtio_net: check RX buffer length before DMA sync Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0014/1167] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
` (644 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Samarth Narang, Lance Yang,
Andrew Morton, Lorenzo Stoakes (ARM), Kiryl Shutsemau (Meta),
David Hildenbrand (Arm), Mel Gorman, Xu Xin, Chengming Zhou,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Jérôme Glisse,
Andrea Arcangeli, Peter Xu, Bobby Powers, Brian Geffon,
Denis Plotnikov, Doug Gilbert, Hugh Dickins, Johannes Weiner,
Martin Cracauer, Marty McFadden, Maya Gokhale, Pavel Emelyanov,
Rik van Riel, Shaohua Li, James Houghton, Jonathan Corbet,
Paolo Bonzini, Sean Christopherson, SJ Park, Zi Yan,
Mohammed EL Kadiri, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lance Yang <lance.yang@linux.dev>
[ Upstream commit 990d6c2194a938a19a8cf94c6cfd75171345089b ]
KSM loses userfaultfd protection when replace_page() builds a new PTE from
vma->vm_page_prot. Dropping its uffd bit lets a subsequent write go
through ordinary COW instead of userfaultfd write protection handling.
For RWP, a merged page also becomes readable without faulting.
Keeping the uffd bit and restoring PAGE_NONE fixes merging, but we also
have to handle unmerging. An existing KSM page can be protected with RWP
before MADV_UNMERGEABLE, so unmerging already needs fixing independently
of preserving RWP during merging.
Unsharing replaces a shared page with a private one and should leave
userfaultfd protection in place, as do_wp_page() already does for write
protection. Currently, an unshare fault reaches do_uffd_rwp() before it
can proceed to do_wp_page().
- With synchronous RWP, handle_userfault() returns VM_FAULT_SIGBUS.
break_ksm() then reports success with a KSM page still merged.
- With asynchronous RWP, protection is cleared before unsharing.
Preserve the uffd bit when merging, and restore PAGE_NONE for RWP. Let
FAULT_FLAG_UNSHARE skip RWP fault handling and keep PAGE_NONE on each
private copy as well. Unsharing can then complete with RWP still armed
for a subsequent access.
Link: https://lore.kernel.org/20261026130054.91461-1-lance.yang@linux.dev
Link: https://lore.kernel.org/all/20261019010934.697895-1-samarth.colleges@gmail.com/
Link: https://lore.kernel.org/all/20261020055518.36087-1-lance.yang@linux.dev/
Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl")
Fixes: 2d427bb01639 ("mm/userfaultfd: add RWP fault delivery and expose UFFDIO_REGISTER_MODE_RWP")
Signed-off-by: Samarth Narang <samarth.colleges@gmail.com>
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Co-developed-by: Samarth Narang <samarth.colleges@gmail.com>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Xu Xin <xu.xin@linux.dev>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Bobby Powers <bobbypowers@gmail.com>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Denis Plotnikov <dplotnikov@virtuozzo.com>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Martin Cracauer <cracauer@cons.org>
Cc: Marty McFadden <mcfadden8@llnl.gov>
Cc: Maya Gokhale <gokhale2@llnl.gov>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Shaohua Li <shli@fb.com>
Cc: James Houghton <jthoughton@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: SJ Park <sj@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Mohammed EL Kadiri <med08elkadiri@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/ksm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mm/ksm.c b/mm/ksm.c
index cd68f44754af1..13208e214d234 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1258,6 +1258,10 @@ static int replace_page(struct vm_area_struct *vma, struct page *page,
if (pte_soft_dirty(orig_pte))
newpte = pte_mksoft_dirty(newpte);
+ /* Preserve uffd-wp when replacing the page. */
+ if (pte_uffd_wp(orig_pte))
+ newpte = pte_mkuffd_wp(newpte);
+
flush_cache_page(vma, addr, pte_pfn(ptep_get(ptep)));
/*
* No need to notify as we are replacing a read only page with another
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0014/1167] udf: validate VAT inode size for old VAT format
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0013/1167] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0015/1167] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
` (643 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
[ Upstream commit 5163e6ee1ea744d412fe516235bfd9cab15141dc ]
Validate VAT inode is large enough to contain at least the header for
pre-2.00 UDF media format.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/udf/super.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 7f71ce6b9b491..9f2b319a754b5 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1288,6 +1288,11 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
if (map->s_partition_type == UDF_VIRTUAL_MAP15) {
map->s_type_specific.s_virtual.s_start_offset = 0;
+ if (sbi->s_vat_inode->i_size < 36) {
+ udf_err(sb, "Too short VAT inode size %lld\n",
+ sbi->s_vat_inode->i_size);
+ return -EFSCORRUPTED;
+ }
map->s_type_specific.s_virtual.s_num_entries =
(sbi->s_vat_inode->i_size - 36) >> 2;
} else if (map->s_partition_type == UDF_VIRTUAL_MAP20) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0015/1167] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0014/1167] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0016/1167] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
` (642 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hui Peng, Jan Kara, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Peng <benquike@gmail.com>
[ Upstream commit 49f771d14578733a350c45e34e1bc6ad14f56952 ]
In udf_load_vat() (fs/udf/super.c), validate that vat20->lengthHeader is
at least sizeof(struct virtualAllocationTable20) and does not exceed the
mapped buffer or VAT inode size so computing the VAT table pointer and
entry count cannot underflow or read out of bounds.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://patch.msgid.link/20260919222600.3793513-1-benquike@gmail.com
Signed-off-by: Hui Peng <benquike@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/udf/super.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 9f2b319a754b5..3263b57d61fc6 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1297,6 +1297,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
(sbi->s_vat_inode->i_size - 36) >> 2;
} else if (map->s_partition_type == UDF_VIRTUAL_MAP20) {
vati = UDF_I(sbi->s_vat_inode);
+ if (sbi->s_vat_inode->i_size <
+ sizeof(struct virtualAllocationTable20)) {
+ udf_err(sb, "Too short VAT inode size %lld\n",
+ sbi->s_vat_inode->i_size);
+ return -EFSCORRUPTED;
+ }
if (vati->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
int err = 0;
@@ -1314,8 +1320,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
map->s_type_specific.s_virtual.s_start_offset =
le16_to_cpu(vat20->lengthHeader);
- if (map->s_type_specific.s_virtual.s_start_offset
- > sbi->s_vat_inode->i_size) {
+ if (map->s_type_specific.s_virtual.s_start_offset <
+ sizeof(struct virtualAllocationTable20) ||
+ map->s_type_specific.s_virtual.s_start_offset >
+ sb->s_blocksize ||
+ map->s_type_specific.s_virtual.s_start_offset >
+ sbi->s_vat_inode->i_size) {
udf_err(sb, "Corrupted VAT header length %u (VAT inode size %lld)\n",
map->s_type_specific.s_virtual.s_start_offset,
sbi->s_vat_inode->i_size);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0016/1167] io_uring: enable toggle of iowait usage when waiting on CQEs
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0015/1167] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0017/1167] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
` (641 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit 07754bfd9aee59063f8549f6e4d455eae636ecc7 upstream.
By default, io_uring marks a waiting task as being in iowait, if it's
sleeping waiting on events and there are pending requests. This isn't
necessarily always useful, and may be confusing on non-storage setups
where iowait isn't expected. It can also cause extra power usage, by
preventing the CPU from entering lower sleep states.
This adds a new enter flag, IORING_ENTER_NO_IOWAIT. If set, then
io_uring will not account the sleeping task as being in iowait. If the
kernel supports this feature, then it will be marked by having the
IORING_FEAT_NO_IOWAIT feature flag set.
As the kernel currently does not support separating the iowait
accounting and CPU frequency boosting, the IORING_ENTER_NO_IOWAIT
controls both of these at the same time. In the future, if those do end
up being split, then it'd be possible to control them separately.
However, it seems more likely that the kernel will decouple iowait and
CPU frequency boosting anyway.
[ 6.6: no struct ext_arg here. Pass the enter flags to io_cqring_wait()
and keep the setting in struct io_wait_queue. Flag bits match
upstream. ]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/uapi/linux/io_uring.h | 2 ++
io_uring/io_uring.c | 16 ++++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index 333769bc6abf0..7c8c70859c944 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -466,6 +466,7 @@ struct io_cqring_offsets {
#define IORING_ENTER_SQ_WAIT (1U << 2)
#define IORING_ENTER_EXT_ARG (1U << 3)
#define IORING_ENTER_REGISTERED_RING (1U << 4)
+#define IORING_ENTER_NO_IOWAIT (1U << 7)
/*
* Passed in for io_uring_setup(2). Copied back with updated info on success
@@ -500,6 +501,7 @@ struct io_uring_params {
#define IORING_FEAT_CQE_SKIP (1U << 11)
#define IORING_FEAT_LINKED_FILE (1U << 12)
#define IORING_FEAT_REG_REG_RING (1U << 13)
+#define IORING_FEAT_NO_IOWAIT (1U << 17)
/*
* io_uring_register(2) opcodes and arguments
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 43860048d2bf3..b14651c187d4f 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2520,6 +2520,7 @@ struct io_wait_queue {
unsigned cq_tail;
unsigned nr_timeouts;
ktime_t timeout;
+ bool iowait;
};
static inline bool io_has_work(struct io_ring_ctx *ctx)
@@ -2601,7 +2602,7 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
* can take into account that the task is waiting for IO - turns out
* to be important for low QD IO.
*/
- if (current_pending_io())
+ if (iowq->iowait && current_pending_io())
current->in_iowait = 1;
ret = 0;
if (iowq->timeout == KTIME_MAX)
@@ -2616,7 +2617,7 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
* Wait until events become available, if we don't already have some. The
* application must reap them itself, as they reside on the shared cq ring.
*/
-static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
+static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, u32 flags,
const sigset_t __user *sig, size_t sigsz,
struct __kernel_timespec __user *uts)
{
@@ -2638,6 +2639,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
iowq.wq.private = current;
INIT_LIST_HEAD(&iowq.wq.entry);
iowq.ctx = ctx;
+ iowq.iowait = !(flags & IORING_ENTER_NO_IOWAIT);
iowq.nr_timeouts = atomic_read(&ctx->cq_timeouts);
iowq.cq_tail = READ_ONCE(ctx->rings->cq.head) + min_events;
iowq.timeout = KTIME_MAX;
@@ -3828,7 +3830,8 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
if (unlikely(flags & ~(IORING_ENTER_GETEVENTS | IORING_ENTER_SQ_WAKEUP |
IORING_ENTER_SQ_WAIT | IORING_ENTER_EXT_ARG |
- IORING_ENTER_REGISTERED_RING)))
+ IORING_ENTER_REGISTERED_RING |
+ IORING_ENTER_NO_IOWAIT)))
return -EINVAL;
/*
@@ -3928,8 +3931,8 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
if (likely(!ret2)) {
min_complete = min(min_complete,
ctx->cq_entries);
- ret2 = io_cqring_wait(ctx, min_complete, sig,
- argsz, ts);
+ ret2 = io_cqring_wait(ctx, min_complete, flags,
+ sig, argsz, ts);
}
}
@@ -4211,7 +4214,8 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,
IORING_FEAT_POLL_32BITS | IORING_FEAT_SQPOLL_NONFIXED |
IORING_FEAT_EXT_ARG | IORING_FEAT_NATIVE_WORKERS |
IORING_FEAT_RSRC_TAGS | IORING_FEAT_CQE_SKIP |
- IORING_FEAT_LINKED_FILE | IORING_FEAT_REG_REG_RING;
+ IORING_FEAT_LINKED_FILE | IORING_FEAT_REG_REG_RING |
+ IORING_FEAT_NO_IOWAIT;
if (copy_to_user(params, p, sizeof(*p))) {
ret = -EFAULT;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0017/1167] io_uring: fail soft links on negative IOU_COMPLETE results
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0016/1167] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0018/1167] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
` (640 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Xiuwei, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Xiuwei <yangxiuwei@kylinos.cn>
Commit 9ed19503a7b34e1ffb2b81236843204c473b0ae0 upstream.
Handlers such as fsync return IOU_COMPLETE with a negative cqe.res.
The old io_req_complete() path called req_set_fail() for res < 0.
After completions moved into the core, that check was dropped,
so IOSQE_IO_LINK dependents kept running after the head failed.
Fixes: 97b388d70b53 ("io_uring: handle completions in the core")
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Link: https://patch.msgid.link/20261114041123.109163-1-yangxiuwei@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 has IOU_OK rather than IOU_COMPLETE]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index b14651c187d4f..8bbcab4d1d7c4 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1921,9 +1921,11 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
}
if (ret == IOU_OK) {
- /* not all handlers take care of the internal restart codes */
- if (unlikely(req->cqe.res <= -ERESTARTSYS))
- req->cqe.res = io_fixup_restart_res(req->cqe.res);
+ if (unlikely(req->cqe.res < 0)) {
+ if (req->cqe.res <= -ERESTARTSYS)
+ req->cqe.res = io_fixup_restart_res(req->cqe.res);
+ req_set_fail(req);
+ }
if (issue_flags & IO_URING_F_COMPLETE_DEFER)
io_req_complete_defer(req);
else
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0018/1167] io_uring/rw: fail soft links on IOPOLL short or error IO
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0017/1167] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0019/1167] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
` (639 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Xiuwei, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Xiuwei <yangxiuwei@kylinos.cn>
Commit 4d3db66c5363dcf42c3d43ebaea330ac2d1888bb upstream.
io_complete_rw_iopoll() updates cqe.res when the transfer does not
match the requested length, but it does not call req_set_fail().
Soft linked requests then still run after a short or failed IOPOLL
read or write.
Fixes: b66ceaf324b3 ("io_uring: move iopoll reissue into regular IO path")
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Link: https://patch.msgid.link/20261114072246.741950-3-yangxiuwei@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 reissues from inside the res != cqe.res branch, fail the
request after the reissue check there]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/rw.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/io_uring/rw.c b/io_uring/rw.c
index 102f92dce6721..ec8e719a93864 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -318,6 +318,7 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO;
return;
}
+ req_set_fail(req);
req->cqe.res = res;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0019/1167] io_uring/timeout: dont rearm a multishot timeout on cancel
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0018/1167] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0020/1167] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
` (638 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cheng Yongkang, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
Commit 97d4a585db2b91d855f957be0a9f126068c5be93 upstream.
io_timeout_complete() does not check tw.cancel. When it runs from
io_cancel_local_task_work(), a multishot timeout that has not reached
its count still posts an IORING_CQE_F_MORE completion and rearms its
timer. With a zero interval the timer expires again right away and
queues new task work, so the drain keeps running it until posting a
CQE fails.
Normally the CQ fills up quickly and the request then completes. But
if userspace moves the CQ head far ahead of the tail, for example to
cq.tail + 0x7fffffff, posting keeps succeeding and ring teardown is
delayed for a long time.
Don't post another CQE or rearm the timer when tw.cancel is set, so
the request completes through io_req_task_complete(), like the poll and
linked timeout task work does when cancelled.
Fixes: ea97f6c8558e ("io_uring: add support for multishot timeouts")
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Link: https://patch.msgid.link/20261116044519.281756-1-teel4res@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 has no tw.cancel, use io_should_terminate_tw() like
io_req_task_link_timeout() does]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/timeout.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/io_uring/timeout.c b/io_uring/timeout.c
index df9ef01ebf191..4eec4445fafb8 100644
--- a/io_uring/timeout.c
+++ b/io_uring/timeout.c
@@ -72,9 +72,11 @@ static void io_timeout_complete(struct io_kiocb *req, struct io_tw_state *ts)
struct io_ring_ctx *ctx = req->ctx;
if (!io_timeout_finish(timeout, data)) {
- bool filled;
- filled = io_fill_cqe_req_aux(req, ts->locked, -ETIME,
- IORING_CQE_F_MORE);
+ bool filled = false;
+
+ if (!io_should_terminate_tw(ctx))
+ filled = io_fill_cqe_req_aux(req, ts->locked, -ETIME,
+ IORING_CQE_F_MORE);
if (filled) {
/* re-arm timer */
spin_lock_irq(&ctx->timeout_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0020/1167] io_uring/rsrc: keep the old file when a file update fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0019/1167] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0021/1167] io_uring: cleanup handle_tw_list() calling convention Greg Kroah-Hartman
` (637 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cheng Yongkang, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
Commit e5a346e4309d720c47fe8331a00068608fad47dd upstream.
__io_sqe_files_update() resets the slot before it calls fget() on the
new fd. If fget() fails, the fd is an io_uring file, or the node
allocation fails, the update stops and reports that entry as not done,
but the old file has already been removed. Later requests that use the
slot fail with -EBADF, and if the old file was registered with a tag,
its tag CQE is posted as if it had been removed on purpose.
Reset the slot only after the new file has been checked and its node
allocated, as io_install_fixed_file() does. Removal with fd == -1 still
resets the slot right away.
Fixes: c3a31e605620 ("io_uring: add support for IORING_REGISTER_FILES_UPDATE")
Cc: stable@vger.kernel.org
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Link: https://patch.msgid.link/20261116044531.281978-1-teel4res@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 has no rsrc nodes for files, the old file is queued for
removal with io_queue_rsrc_removal(), which can fail. Get and check the
new file first, and only remove the old one once that has succeeded]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/rsrc.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index ba1dedaaa7c42..0cc498a0673dd 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -369,6 +369,7 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
return -EINVAL;
for (done = 0; done < nr_args; done++) {
+ struct file *file = NULL;
u64 tag = 0;
if ((tags && copy_from_user(&tag, &tags[done], sizeof(tag))) ||
@@ -386,17 +387,8 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
i = array_index_nospec(up->offset + done, ctx->nr_user_files);
file_slot = io_fixed_file_slot(&ctx->file_table, i);
- if (file_slot->file_ptr) {
- err = io_queue_rsrc_removal(data, i,
- io_slot_file(file_slot));
- if (err)
- break;
- file_slot->file_ptr = 0;
- io_file_bitmap_clear(&ctx->file_table, i);
- }
if (fd != -1) {
- struct file *file = fget(fd);
-
+ file = fget(fd);
if (!file) {
err = -EBADF;
break;
@@ -409,6 +401,19 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
err = -EBADF;
break;
}
+ }
+ if (file_slot->file_ptr) {
+ err = io_queue_rsrc_removal(data, i,
+ io_slot_file(file_slot));
+ if (err) {
+ if (file)
+ fput(file);
+ break;
+ }
+ file_slot->file_ptr = 0;
+ io_file_bitmap_clear(&ctx->file_table, i);
+ }
+ if (file) {
*io_get_tag_slot(data, i) = tag;
io_fixed_file_set(file_slot, file);
io_file_bitmap_set(&ctx->file_table, i);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0021/1167] io_uring: cleanup handle_tw_list() calling convention
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0020/1167] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0022/1167] io_uring: pass in counter to handle_tw_list() rather than return it Greg Kroah-Hartman
` (636 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit 42c0905f0cac9a86d2cb8138665a6d62ea607078 upstream.
Now that we don't loop around task_work anymore, there's no point in
maintaining the ring and locked state outside of handle_tw_list(). Get
rid of passing in those pointers (and pointers to pointers) and just do
the management internally in handle_tw_list().
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 runs normal task_work in LIFO order, as it doesn't have
170539bdf109 ("io_uring: handle traditional task_work in FIFO order"),
so call handle_tw_list() without llist_reverse_order()]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 8bbcab4d1d7c4..96474d9ebef82 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1197,10 +1197,10 @@ static void ctx_flush_and_put(struct io_ring_ctx *ctx, struct io_tw_state *ts)
percpu_ref_put(&ctx->refs);
}
-static unsigned int handle_tw_list(struct llist_node *node,
- struct io_ring_ctx **ctx,
- struct io_tw_state *ts)
+static unsigned int handle_tw_list(struct llist_node *node)
{
+ struct io_ring_ctx *ctx = NULL;
+ struct io_tw_state ts = { };
unsigned int count = 0;
do {
@@ -1210,25 +1210,26 @@ static unsigned int handle_tw_list(struct llist_node *node,
prefetch(container_of(next, struct io_kiocb, io_task_work.node));
- if (req->ctx != *ctx) {
- ctx_flush_and_put(*ctx, ts);
- *ctx = req->ctx;
+ if (req->ctx != ctx) {
+ ctx_flush_and_put(ctx, &ts);
+ ctx = req->ctx;
/* if not contended, grab and improve batching */
- ts->locked = mutex_trylock(&(*ctx)->uring_lock);
- percpu_ref_get(&(*ctx)->refs);
+ ts.locked = mutex_trylock(&ctx->uring_lock);
+ percpu_ref_get(&ctx->refs);
}
INDIRECT_CALL_2(req->io_task_work.func,
io_poll_task_func, io_req_rw_complete,
- req, ts);
+ req, &ts);
node = next;
count++;
if (unlikely(need_resched())) {
- ctx_flush_and_put(*ctx, ts);
- *ctx = NULL;
+ ctx_flush_and_put(ctx, &ts);
+ ctx = NULL;
cond_resched();
}
} while (node);
+ ctx_flush_and_put(ctx, &ts);
return count;
}
@@ -1277,8 +1278,6 @@ static __cold void io_fallback_tw(struct io_uring_task *tctx, bool sync)
void tctx_task_work(struct callback_head *cb)
{
- struct io_tw_state ts = {};
- struct io_ring_ctx *ctx = NULL;
struct io_uring_task *tctx = container_of(cb, struct io_uring_task,
task_work);
struct llist_node *node;
@@ -1291,9 +1290,7 @@ void tctx_task_work(struct callback_head *cb)
node = llist_del_all(&tctx->task_list);
if (node)
- count = handle_tw_list(node, &ctx, &ts);
-
- ctx_flush_and_put(ctx, &ts);
+ count = handle_tw_list(node);
/* relaxed read is enough as only the task itself sets ->in_cancel */
if (unlikely(atomic_read(&tctx->in_cancel)))
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0022/1167] io_uring: pass in counter to handle_tw_list() rather than return it
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0021/1167] io_uring: cleanup handle_tw_list() calling convention Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0023/1167] io_uring/sqpoll: manage task_work privately Greg Kroah-Hartman
` (635 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit 2708af1adc11700c6c3ce4109e3b133079a36a78 upstream.
No functional changes in this patch, just in preparation for returning
something other than count from this helper.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 runs normal task_work in LIFO order, as it doesn't have
170539bdf109 ("io_uring: handle traditional task_work in FIFO order"),
so call handle_tw_list() without llist_reverse_order()]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 96474d9ebef82..ddae460e06c05 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1197,11 +1197,10 @@ static void ctx_flush_and_put(struct io_ring_ctx *ctx, struct io_tw_state *ts)
percpu_ref_put(&ctx->refs);
}
-static unsigned int handle_tw_list(struct llist_node *node)
+static void handle_tw_list(struct llist_node *node, unsigned int *count)
{
struct io_ring_ctx *ctx = NULL;
struct io_tw_state ts = { };
- unsigned int count = 0;
do {
struct llist_node *next = node->next;
@@ -1221,7 +1220,7 @@ static unsigned int handle_tw_list(struct llist_node *node)
io_poll_task_func, io_req_rw_complete,
req, &ts);
node = next;
- count++;
+ (*count)++;
if (unlikely(need_resched())) {
ctx_flush_and_put(ctx, &ts);
ctx = NULL;
@@ -1230,7 +1229,6 @@ static unsigned int handle_tw_list(struct llist_node *node)
} while (node);
ctx_flush_and_put(ctx, &ts);
- return count;
}
/**
@@ -1290,7 +1288,7 @@ void tctx_task_work(struct callback_head *cb)
node = llist_del_all(&tctx->task_list);
if (node)
- count = handle_tw_list(node);
+ handle_tw_list(node, &count);
/* relaxed read is enough as only the task itself sets ->in_cancel */
if (unlikely(atomic_read(&tctx->in_cancel)))
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0023/1167] io_uring/sqpoll: manage task_work privately
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0022/1167] io_uring: pass in counter to handle_tw_list() rather than return it Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0024/1167] io_uring: wake SQPOLL task when task_work is added to an empty queue Greg Kroah-Hartman
` (634 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit af5d68f8892f8ee8f137648b79ceb2abc153a19b upstream.
Decouple from task_work running, and cap the number of entries we process
at the time. If we exceed that number, push remaining entries to a retry
list that we'll process first next time.
We cap the number of entries to process at 8, which is fairly random.
We just want to get enough per-ctx batching here, while not processing
endlessly.
Since we manually run PF_IO_WORKER related task_work anyway as the task
never exits to userspace, with this we no longer need to add an actual
task_work item to the per-process list.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 runs normal task_work in LIFO order, so don't reverse the
list in tctx_task_work_run(), and its trace_io_uring_task_work_run()
still takes the 'loops' argument. Run the retry_list in io_sq_thread()
before the IO_SQ_THREAD_EXITING marking that 6.6 has]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.c | 42 +++++++++++++++++++++++++++++++++---------
io_uring/io_uring.h | 24 ++++++++++++++++++------
io_uring/sqpoll.c | 29 ++++++++++++++++++++++++++++-
3 files changed, 79 insertions(+), 16 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index ddae460e06c05..3fd27002f4f7e 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1197,7 +1197,14 @@ static void ctx_flush_and_put(struct io_ring_ctx *ctx, struct io_tw_state *ts)
percpu_ref_put(&ctx->refs);
}
-static void handle_tw_list(struct llist_node *node, unsigned int *count)
+/*
+ * Run queued task_work, returning the number of entries processed in *count.
+ * If more entries than max_entries are available, stop processing once this
+ * is reached and return the rest of the list.
+ */
+struct llist_node *io_handle_tw_list(struct llist_node *node,
+ unsigned int *count,
+ unsigned int max_entries)
{
struct io_ring_ctx *ctx = NULL;
struct io_tw_state ts = { };
@@ -1226,9 +1233,10 @@ static void handle_tw_list(struct llist_node *node, unsigned int *count)
ctx = NULL;
cond_resched();
}
- } while (node);
+ } while (node && *count < max_entries);
ctx_flush_and_put(ctx, &ts);
+ return node;
}
/**
@@ -1274,27 +1282,39 @@ static __cold void io_fallback_tw(struct io_uring_task *tctx, bool sync)
}
}
-void tctx_task_work(struct callback_head *cb)
+struct llist_node *tctx_task_work_run(struct io_uring_task *tctx,
+ unsigned int max_entries,
+ unsigned int *count)
{
- struct io_uring_task *tctx = container_of(cb, struct io_uring_task,
- task_work);
struct llist_node *node;
- unsigned int count = 0;
if (unlikely(current->flags & PF_EXITING)) {
io_fallback_tw(tctx, true);
- return;
+ return NULL;
}
node = llist_del_all(&tctx->task_list);
if (node)
- handle_tw_list(node, &count);
+ node = io_handle_tw_list(node, count, max_entries);
/* relaxed read is enough as only the task itself sets ->in_cancel */
if (unlikely(atomic_read(&tctx->in_cancel)))
io_uring_drop_tctx_refs(current);
- trace_io_uring_task_work_run(tctx, count, 1);
+ trace_io_uring_task_work_run(tctx, *count, 1);
+ return node;
+}
+
+void tctx_task_work(struct callback_head *cb)
+{
+ struct io_uring_task *tctx;
+ struct llist_node *ret;
+ unsigned int count = 0;
+
+ tctx = container_of(cb, struct io_uring_task, task_work);
+ ret = tctx_task_work_run(tctx, UINT_MAX, &count);
+ /* can't happen */
+ WARN_ON_ONCE(ret);
}
static void io_poll_wq_wake_rcu(struct rcu_head *rcu)
@@ -1388,6 +1408,10 @@ static void io_req_normal_work_add(struct io_kiocb *req)
if (ctx->flags & IORING_SETUP_TASKRUN_FLAG)
atomic_or(IORING_SQ_TASKRUN, &ctx->rings->sq_flags);
+ /* SQPOLL doesn't need the task_work added, it'll run it itself */
+ if (ctx->flags & IORING_SETUP_SQPOLL)
+ return;
+
if (likely(!task_work_add(req->task, &tctx->task_work, ctx->notify_method)))
return;
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index a3c97ffb4d146..0d749588ab21b 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -77,6 +77,8 @@ void io_req_task_queue(struct io_kiocb *req);
void io_req_task_complete(struct io_kiocb *req, struct io_tw_state *ts);
void io_req_task_queue_fail(struct io_kiocb *req, int ret);
void io_req_task_submit(struct io_kiocb *req, struct io_tw_state *ts);
+struct llist_node *io_handle_tw_list(struct llist_node *node, unsigned int *count, unsigned int max_entries);
+struct llist_node *tctx_task_work_run(struct io_uring_task *tctx, unsigned int max_entries, unsigned int *count);
void tctx_task_work(struct callback_head *cb);
__cold void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd);
int io_uring_alloc_task_context(struct task_struct *task,
@@ -338,6 +340,8 @@ static inline unsigned int io_sqring_entries(struct io_ring_ctx *ctx)
static inline int io_run_task_work(void)
{
+ bool ret = false;
+
/*
* Always check-and-clear the task_work notification signal. With how
* signaling works for task_work, we can find it set with nothing to
@@ -349,18 +353,26 @@ static inline int io_run_task_work(void)
* PF_IO_WORKER never returns to userspace, so check here if we have
* notify work that needs processing.
*/
- if (current->flags & PF_IO_WORKER &&
- test_thread_flag(TIF_NOTIFY_RESUME)) {
- __set_current_state(TASK_RUNNING);
- resume_user_mode_work(NULL);
+ if (current->flags & PF_IO_WORKER) {
+ if (test_thread_flag(TIF_NOTIFY_RESUME)) {
+ __set_current_state(TASK_RUNNING);
+ resume_user_mode_work(NULL);
+ }
+ if (current->io_uring) {
+ unsigned int count = 0;
+
+ tctx_task_work_run(current->io_uring, UINT_MAX, &count);
+ if (count)
+ ret = true;
+ }
}
if (task_work_pending(current)) {
__set_current_state(TASK_RUNNING);
task_work_run();
- return 1;
+ ret = true;
}
- return 0;
+ return ret;
}
static inline bool io_task_work_pending(struct io_ring_ctx *ctx)
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 75065de8d7d3c..716cb3cc7e2c0 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -19,6 +19,7 @@
#include "sqpoll.h"
#define IORING_SQPOLL_CAP_ENTRIES_VALUE 8
+#define IORING_TW_CAP_ENTRIES_VALUE 8
enum {
IO_SQ_THREAD_SHOULD_STOP = 0,
@@ -238,8 +239,31 @@ static bool io_sqd_handle_event(struct io_sq_data *sqd)
return did_sig || test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state);
}
+/*
+ * Run task_work, processing the retry_list first. The retry_list holds
+ * entries that we passed on in the previous run, if we had more task_work
+ * than we were asked to process. Newly queued task_work isn't run until the
+ * retry list has been fully processed.
+ */
+static unsigned int io_sq_tw(struct llist_node **retry_list, int max_entries)
+{
+ struct io_uring_task *tctx = current->io_uring;
+ unsigned int count = 0;
+
+ if (*retry_list) {
+ *retry_list = io_handle_tw_list(*retry_list, &count, max_entries);
+ if (count >= max_entries)
+ return count;
+ max_entries -= count;
+ }
+
+ *retry_list = tctx_task_work_run(tctx, max_entries, &count);
+ return count;
+}
+
static int io_sq_thread(void *data)
{
+ struct llist_node *retry_list = NULL;
struct io_sq_data *sqd = data;
struct io_ring_ctx *ctx;
unsigned long timeout = 0;
@@ -284,7 +308,7 @@ static int io_sq_thread(void *data)
if (!sqt_spin && (ret > 0 || !wq_list_empty(&ctx->iopoll_list)))
sqt_spin = true;
}
- if (io_run_task_work())
+ if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
sqt_spin = true;
if (sqt_spin || !time_after(jiffies, timeout)) {
@@ -346,6 +370,9 @@ static int io_sq_thread(void *data)
timeout = jiffies + sqd->sq_thread_idle;
}
+ if (retry_list)
+ io_sq_tw(&retry_list, UINT_MAX);
+
/*
* Cancelation drops sqd->lock while it waits, and a ring could attach
* to a thread that is on its way out. A fatal signal doesn't set the
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0024/1167] io_uring: wake SQPOLL task when task_work is added to an empty queue
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0023/1167] io_uring/sqpoll: manage task_work privately Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0025/1167] io_uring/sqpoll: use the correct check for pending task_work Greg Kroah-Hartman
` (633 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit 78f9b61bd8e5466f0e90823e64e3d87c41f6258c upstream.
If there's no current work on the list, we still need to potentially
wake the SQPOLL task if it is sleeping. This is ordered with the
wait queue addition in sqpoll, which adds to the wait queue before
checking for pending work items.
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 3fd27002f4f7e..895011a3d8ce3 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1409,8 +1409,13 @@ static void io_req_normal_work_add(struct io_kiocb *req)
atomic_or(IORING_SQ_TASKRUN, &ctx->rings->sq_flags);
/* SQPOLL doesn't need the task_work added, it'll run it itself */
- if (ctx->flags & IORING_SETUP_SQPOLL)
+ if (ctx->flags & IORING_SETUP_SQPOLL) {
+ struct io_sq_data *sqd = ctx->sq_data;
+
+ if (wq_has_sleeper(&sqd->wait))
+ wake_up(&sqd->wait);
return;
+ }
if (likely(!task_work_add(req->task, &tctx->task_work, ctx->notify_method)))
return;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0025/1167] io_uring/sqpoll: use the correct check for pending task_work
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0024/1167] io_uring: wake SQPOLL task when task_work is added to an empty queue Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0026/1167] io_uring/sqpoll: early exit thread if task_context wasnt allocated Greg Kroah-Hartman
` (632 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit c8d8fc3b2d9d4c81e3d3b23eca504ad713a91219 upstream.
A previous commit moved to using just the private task_work list for
SQPOLL, but it neglected to update the check for whether we have
pending task_work. Normally this is fine as we'll attempt to run it
unconditionally, but if we race with going to sleep AND task_work
being added, then we certainly need the right check here.
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/sqpoll.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 716cb3cc7e2c0..ecd336c373b15 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -261,6 +261,13 @@ static unsigned int io_sq_tw(struct llist_node **retry_list, int max_entries)
return count;
}
+static bool io_sq_tw_pending(struct llist_node *retry_list)
+{
+ struct io_uring_task *tctx = current->io_uring;
+
+ return retry_list || !llist_empty(&tctx->task_list);
+}
+
static int io_sq_thread(void *data)
{
struct llist_node *retry_list = NULL;
@@ -324,7 +331,7 @@ static int io_sq_thread(void *data)
}
prepare_to_wait(&sqd->wait, &wait, TASK_INTERRUPTIBLE);
- if (!io_sqd_events_pending(sqd) && !task_work_pending(current)) {
+ if (!io_sqd_events_pending(sqd) && !io_sq_tw_pending(retry_list)) {
bool needs_sched = true;
list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0026/1167] io_uring/sqpoll: early exit thread if task_context wasnt allocated
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0025/1167] io_uring/sqpoll: use the correct check for pending task_work Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0027/1167] io_uring/sqpoll: ensure that normal task_work is also run timely Greg Kroah-Hartman
` (631 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ubisectech Sirius, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit 1251d2025c3e1bcf1f17ec0f3c0dfae5e5bbb146 upstream.
Ideally we'd want to simply kill the task rather than wake it, but for
now let's just add a startup check that causes the thread to exit.
This can only happen if io_uring_alloc_task_context() fails, which
generally requires fault injection.
Reported-by: Ubisectech Sirius <bugreport@ubisectech.com>
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 has no sqd->exited, the thread drops its sqd reference with
io_sq_data_release() on exit, so put err_out before that]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/sqpoll.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index ecd336c373b15..3849252f61351 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -277,6 +277,10 @@ static int io_sq_thread(void *data)
char buf[TASK_COMM_LEN];
DEFINE_WAIT(wait);
+ /* offload context creation failed, just exit */
+ if (!current->io_uring)
+ goto err_out;
+
snprintf(buf, sizeof(buf), "iou-sqp-%d", sqd->task_pid);
set_task_comm(current, buf);
@@ -393,7 +397,7 @@ static int io_sq_thread(void *data)
atomic_or(IORING_SQ_NEED_WAKEUP, &ctx->rings->sq_flags);
io_run_task_work();
mutex_unlock(&sqd->lock);
-
+err_out:
io_sq_data_release(sqd);
do_exit(0);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0027/1167] io_uring/sqpoll: ensure that normal task_work is also run timely
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0026/1167] io_uring/sqpoll: early exit thread if task_context wasnt allocated Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0028/1167] io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI Greg Kroah-Hartman
` (630 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrew Udvare, Christian Heusel,
Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit d13ddd9c893f0e8498526bf88c6b5fad01f0edd8 upstream.
With the move to private task_work, SQPOLL neglected to also run the
normal task_work, if any is pending. This will eventually get run, but
we should run it with the private task_work to ensure that things like
a final fput() is processed in a timely fashion.
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/313824bc-799d-414f-96b7-e6de57c7e21d@gmail.com/
Reported-by: Andrew Udvare <audvare@gmail.com>
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Tested-by: Christian Heusel <christian@heusel.eu>
Tested-by: Andrew Udvare <audvare@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/sqpoll.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 3849252f61351..b1428f91b5ee9 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -253,11 +253,13 @@ static unsigned int io_sq_tw(struct llist_node **retry_list, int max_entries)
if (*retry_list) {
*retry_list = io_handle_tw_list(*retry_list, &count, max_entries);
if (count >= max_entries)
- return count;
+ goto out;
max_entries -= count;
}
-
*retry_list = tctx_task_work_run(tctx, max_entries, &count);
+out:
+ if (task_work_pending(current))
+ task_work_run();
return count;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0028/1167] io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0027/1167] io_uring/sqpoll: ensure that normal task_work is also run timely Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0029/1167] io_uring/sqpoll: ensure task state is TASK_RUNNING when running task_work Greg Kroah-Hartman
` (629 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit dbcabac138fdfc730ba458ed2199ff1f29a271fc upstream.
Before SQPOLL was transitioned to managing its own task_work, the core
used TWA_SIGNAL_NO_IPI to ensure that task_work was processed. If not,
we can't be sure that all task_work is processed at SQPOLL thread exit
time.
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 895011a3d8ce3..4c88bd805b8cb 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1412,8 +1412,8 @@ static void io_req_normal_work_add(struct io_kiocb *req)
if (ctx->flags & IORING_SETUP_SQPOLL) {
struct io_sq_data *sqd = ctx->sq_data;
- if (wq_has_sleeper(&sqd->wait))
- wake_up(&sqd->wait);
+ if (sqd->thread)
+ __set_notify_signal(sqd->thread);
return;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0029/1167] io_uring/sqpoll: ensure task state is TASK_RUNNING when running task_work
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0028/1167] io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0030/1167] io_uring: dont touch sqd->thread off tw add Greg Kroah-Hartman
` (628 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit 8f7033aa4089fbaf7a33995f0f2ee6c9d7b9ca1b upstream.
When the sqpoll is exiting and cancels pending work items, it may need
to run task_work. If this happens from within io_uring_cancel_generic(),
then it may be under waiting for the io_uring_task waitqueue. This
results in the below splat from the scheduler, as the ring mutex may be
attempted grabbed while in a TASK_INTERRUPTIBLE state.
Ensure that the task state is set appropriately for that, just like what
is done for the other cases in io_run_task_work().
do not call blocking ops when !TASK_RUNNING; state=1 set at [<0000000029387fd2>] prepare_to_wait+0x88/0x2fc
WARNING: CPU: 6 PID: 59939 at kernel/sched/core.c:8561 __might_sleep+0xf4/0x140
Modules linked in:
CPU: 6 UID: 0 PID: 59939 Comm: iou-sqp-59938 Not tainted 6.12.0-rc3-00113-g8d020023b155 #7456
Hardware name: linux,dummy-virt (DT)
pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
pc : __might_sleep+0xf4/0x140
lr : __might_sleep+0xf4/0x140
sp : ffff80008c5e7830
x29: ffff80008c5e7830 x28: ffff0000d93088c0 x27: ffff60001c2d7230
x26: dfff800000000000 x25: ffff0000e16b9180 x24: ffff80008c5e7a50
x23: 1ffff000118bcf4a x22: ffff0000e16b9180 x21: ffff0000e16b9180
x20: 000000000000011b x19: ffff80008310fac0 x18: 1ffff000118bcd90
x17: 30303c5b20746120 x16: 74657320313d6574 x15: 0720072007200720
x14: 0720072007200720 x13: 0720072007200720 x12: ffff600036c64f0b
x11: 1fffe00036c64f0a x10: ffff600036c64f0a x9 : dfff800000000000
x8 : 00009fffc939b0f6 x7 : ffff0001b6327853 x6 : 0000000000000001
x5 : ffff0001b6327850 x4 : ffff600036c64f0b x3 : ffff8000803c35bc
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000e16b9180
Call trace:
__might_sleep+0xf4/0x140
mutex_lock+0x84/0x124
io_handle_tw_list+0xf4/0x260
tctx_task_work_run+0x94/0x340
io_run_task_work+0x1ec/0x3c0
io_uring_cancel_generic+0x364/0x524
io_sq_thread+0x820/0x124c
ret_from_fork+0x10/0x20
Cc: stable@vger.kernel.org
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 0d749588ab21b..cdb35cb651dac 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -361,6 +361,7 @@ static inline int io_run_task_work(void)
if (current->io_uring) {
unsigned int count = 0;
+ __set_current_state(TASK_RUNNING);
tctx_task_work_run(current->io_uring, UINT_MAX, &count);
if (count)
ret = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0030/1167] io_uring: dont touch sqd->thread off tw add
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0029/1167] io_uring/sqpoll: ensure task state is TASK_RUNNING when running task_work Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0031/1167] io_uring/sqpoll: zero sqd->thread on tctx errors Greg Kroah-Hartman
` (627 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bui Quang Minh, lizetao,
Pavel Begunkov, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <asml.silence@gmail.com>
Commit bd2703b42decebdcddf76e277ba76b4c4a142d73 upstream.
With IORING_SETUP_SQPOLL all requests are created by the SQPOLL task,
which means that req->task should always match sqd->thread. Since
accesses to sqd->thread should be separately protected, use req->task
in io_req_normal_work_add() instead.
Note, in the eyes of io_req_normal_work_add(), the SQPOLL task struct
is always pinned and alive, and sqd->thread can either be the task or
NULL. It's only problematic if the compiler decides to reload the value
after the null check, which is not so likely.
Cc: stable@vger.kernel.org
Cc: Bui Quang Minh <minhquangbui99@gmail.com>
Reported-by: lizetao <lizetao1@huawei.com>
Fixes: 78f9b61bd8e54 ("io_uring: wake SQPOLL task when task_work is added to an empty queue")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/1cbbe72cf32c45a8fee96026463024cd8564a7d7.1736541357.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 has no tctx->task, use req->task like the commit message
says. With SQPOLL all requests are allocated by the SQPOLL task, so
req->task is that task]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 4c88bd805b8cb..3108af4514eb2 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1410,10 +1410,7 @@ static void io_req_normal_work_add(struct io_kiocb *req)
/* SQPOLL doesn't need the task_work added, it'll run it itself */
if (ctx->flags & IORING_SETUP_SQPOLL) {
- struct io_sq_data *sqd = ctx->sq_data;
-
- if (sqd->thread)
- __set_notify_signal(sqd->thread);
+ __set_notify_signal(req->task);
return;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0031/1167] io_uring/sqpoll: zero sqd->thread on tctx errors
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0030/1167] io_uring: dont touch sqd->thread off tw add Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0032/1167] io_uring/sqpoll: Increase task_work submission batch size Greg Kroah-Hartman
` (626 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+3d92cfcfa84070b0a470,
Pavel Begunkov, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <asml.silence@gmail.com>
Commit 4b7cfa8b6c28a9fa22b86894166a1a34f6d630ba upstream.
Syzkeller reports:
BUG: KASAN: slab-use-after-free in thread_group_cputime+0x409/0x700 kernel/sched/cputime.c:341
Read of size 8 at addr ffff88803578c510 by task syz.2.3223/27552
Call Trace:
<TASK>
...
kasan_report+0x143/0x180 mm/kasan/report.c:602
thread_group_cputime+0x409/0x700 kernel/sched/cputime.c:341
thread_group_cputime_adjusted+0xa6/0x340 kernel/sched/cputime.c:639
getrusage+0x1000/0x1340 kernel/sys.c:1863
io_uring_show_fdinfo+0xdfe/0x1770 io_uring/fdinfo.c:197
seq_show+0x608/0x770 fs/proc/fd.c:68
...
That's due to sqd->task not being cleared properly in cases where
SQPOLL task tctx setup fails, which can essentially only happen with
fault injection to insert allocation errors.
Cc: stable@vger.kernel.org
Fixes: 1251d2025c3e1 ("io_uring/sqpoll: early exit thread if task_context wasn't allocated")
Reported-by: syzbot+3d92cfcfa84070b0a470@syzkaller.appspotmail.com
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/efc7ec7010784463b2e7466d7b5c02c2cb381635.1736519461.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/sqpoll.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index b1428f91b5ee9..bde67560ace8d 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -280,8 +280,12 @@ static int io_sq_thread(void *data)
DEFINE_WAIT(wait);
/* offload context creation failed, just exit */
- if (!current->io_uring)
+ if (!current->io_uring) {
+ mutex_lock(&sqd->lock);
+ sqd->thread = NULL;
+ mutex_unlock(&sqd->lock);
goto err_out;
+ }
snprintf(buf, sizeof(buf), "iou-sqp-%d", sqd->task_pid);
set_task_comm(current, buf);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0032/1167] io_uring/sqpoll: Increase task_work submission batch size
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0031/1167] io_uring/sqpoll: zero sqd->thread on tctx errors Greg Kroah-Hartman
@ 2026-12-04 9:50 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0033/1167] io_uring: fix task_work add use-after-free with SQPOLL Greg Kroah-Hartman
` (625 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gabriel Krisman Bertazi, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabriel Krisman Bertazi <krisman@suse.de>
Commit 92835cebab120f8a5f023a26a792a2ac3f816c4f upstream.
Our QA team reported a 10%-23%, throughput reduction on an io_uring
sqpoll testcase doing IO to a null_blk, that I traced back to a
reduction of the device submission queue depth utilization. It turns out
that, after commit af5d68f8892f ("io_uring/sqpoll: manage task_work
privately"), we capped the number of task_work entries that can be
completed from a single spin of sqpoll to only 8 entries, before the
sqpoll goes around to (potentially) sleep. While this cap doesn't drive
the submission side directly, it impacts the completion behavior, which
affects the number of IO queued by fio per sqpoll cycle on the
submission side, and io_uring ends up seeing less ios per sqpoll cycle.
As a result, block layer plugging is less effective, and we see more
time spent inside the block layer in profilings charts, and increased
submission latency measured by fio.
There are other places that have increased overhead once sqpoll sleeps
more often, such as the sqpoll utilization calculation. But, in this
microbenchmark, those were not representative enough in perf charts, and
their removal didn't yield measurable changes in throughput. The major
overhead comes from the fact we plug less, and less often, when submitting
to the block layer.
My benchmark is:
fio --ioengine=io_uring --direct=1 --iodepth=128 --runtime=300 --bs=4k \
--invalidate=1 --time_based --ramp_time=10 --group_reporting=1 \
--filename=/dev/nullb0 --name=RandomReads-direct-nullb-sqpoll-4k-1 \
--rw=randread --numjobs=1 --sqthread_poll
In one machine, tested on top of Linux 6.15-rc1, we have the following
baseline:
READ: bw=4994MiB/s (5236MB/s), 4994MiB/s-4994MiB/s (5236MB/s-5236MB/s), io=439GiB (471GB), run=90001-90001msec
With this patch:
READ: bw=5762MiB/s (6042MB/s), 5762MiB/s-5762MiB/s (6042MB/s-6042MB/s), io=506GiB (544GB), run=90001-90001msec
which is a 15% improvement in measured bandwidth. The average
submission latency is noticeably lowered too. As measured by
fio:
Baseline:
lat (usec): min=20, max=241, avg=99.81, stdev=3.38
Patched:
lat (usec): min=26, max=226, avg=86.48, stdev=4.82
If we look at blktrace, we can also see the plugging behavior is
improved. In the baseline, we end up limited to plugging 8 requests in
the block layer regardless of the device queue depth size, while after
patching we can drive more io, and we manage to utilize the full device
queue.
In the baseline, after a stabilization phase, an ordinary submission
looks like:
254,0 1 49942 0.016028795 5977 U N [iou-sqp-5976] 7
After patching, I see consistently more requests per unplug.
254,0 1 4996 0.001432872 3145 U N [iou-sqp-3144] 32
Ideally, the cap size would at least be the deep enough to fill the
device queue, but we can't predict that behavior, or assume all IO goes
to a single device, and thus can't guess the ideal batch size. We also
don't want to let the tw run unbounded, though I'm not sure it would
really be a problem. Instead, let's just give it a more sensible value
that will allow for more efficient batching. I've tested with different
cap values, and initially proposed to increase the cap to 1024. Jens
argued it is too big of a bump and I observed that, with 32, I'm no
longer able to observe this bottleneck in any of my machines.
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/20250508181203.3785544-1-krisman@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/sqpoll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index bde67560ace8d..3d0fbae80938a 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -19,7 +19,7 @@
#include "sqpoll.h"
#define IORING_SQPOLL_CAP_ENTRIES_VALUE 8
-#define IORING_TW_CAP_ENTRIES_VALUE 8
+#define IORING_TW_CAP_ENTRIES_VALUE 32
enum {
IO_SQ_THREAD_SHOULD_STOP = 0,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0033/1167] io_uring: fix task_work add use-after-free with SQPOLL
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2026-12-04 9:50 ` [PATCH 6.6 0032/1167] io_uring/sqpoll: Increase task_work submission batch size Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0034/1167] io_uring/sqpoll: do the return-to-userspace work in the SQPOLL thread Greg Kroah-Hartman
` (624 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit a92193c91e8839fe5fc209616ea95465ae4b919d upstream.
For SQPOLL, the sqpoll thread runs task_work off its own list and
doesn't need to be told about it, so it can pop and complete a request
as soon as mpscq_push() has published it. If that was the last request
holding the ring alive, io_ring_exit_work() then frees the ctx, stops
the thread, and with it the tctx, while io_req_normal_work_add() is
still looking at both after the push:
BUG: KASAN: slab-use-after-free in io_req_normal_work_add+0x439/0x510
Read of size 4 at addr ff11000000ca0000 by task repro/55
(...)
BUG: KASAN: slab-use-after-free in queue_work_on+0x25/0x70
Write of size 8 at addr ff11000000c3bd00 by task repro/55
Hold an RCU read lock across the add, like io_req_local_work_add() already
does, and have io_ring_exit_work() wait for a grace period for SQPOLL rings
as well before freeing the ctx.
Reported-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Link: https://lore.kernel.org/io-uring/20260924205056.3759980-2-Jeremy.Jean@oss.cyber.gouv.fr/
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.6 has io_req_normal_work_add() in io_uring.c and adds with
llist_add(), not mpscq_push()]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io_uring.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 3108af4514eb2..fda288405e44f 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1401,6 +1401,9 @@ static void io_req_normal_work_add(struct io_kiocb *req)
struct io_uring_task *tctx = req->task->io_uring;
struct io_ring_ctx *ctx = req->ctx;
+ /* SQPOLL can retire the request on push, see io_ring_exit_work() */
+ guard(rcu)();
+
/* task_work already pending, we're done */
if (!llist_add(&req->io_task_work.node, &tctx->task_list))
return;
@@ -3369,8 +3372,8 @@ static __cold void io_ring_exit_work(struct work_struct *work)
spin_lock(&ctx->completion_lock);
spin_unlock(&ctx->completion_lock);
- /* pairs with RCU read section in io_req_local_work_add() */
- if (ctx->flags & IORING_SETUP_DEFER_TASKRUN)
+ /* pairs with the RCU read sections in the task_work add paths */
+ if (ctx->flags & (IORING_SETUP_DEFER_TASKRUN | IORING_SETUP_SQPOLL))
synchronize_rcu();
io_ring_ctx_free(ctx);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0034/1167] io_uring/sqpoll: do the return-to-userspace work in the SQPOLL thread
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0033/1167] io_uring: fix task_work add use-after-free with SQPOLL Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0035/1167] net: sfp: add quirk for Lantech 8330-265D Greg Kroah-Hartman
` (623 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shakeel Butt, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shakeel Butt <shakeel.butt@linux.dev>
Commit f013b695506491c5202a412a6568313549c81f50 upstream.
The SQPOLL thread never returns to userspace. io_sq_tw() runs its
task_work, but the rest of resume_user_mode_work(), like memory.high
reclaim and block cgroup throttling, only runs when the thread exits.
So memory.high reclaim only happens inside a charge, with sqd->lock and
ctx->uring_lock held, and not at all if the charges can't block.
This used to work. The loop called io_run_task_work(), which does this
work since commit b5d3ae202fbf ("io_uring: handle TIF_NOTIFY_RESUME
when checking for task_work"). Commit af5d68f8892f ("io_uring/sqpoll:
manage task_work privately") replaced that call with io_sq_tw().
Call resume_user_mode_work() at the top of the loop when
TIF_NOTIFY_RESUME is set, with sqd->lock dropped. It runs once per pass,
so a pass that charges two or more batches still reclaims inside the
charge, as before.
Tested in a VM with memory.high=64M and swap on zram. An SQPOLL ring
reads 256M from /dev/zero into untouched memory, 64K at a time. Before,
the thread made 337 calls to __mem_cgroup_handle_over_high(), all from
inside the charge. After, it makes 704, all from the top of the loop.
memory.peak stays at 64M. With 1M reads, 296 of its 385 calls still come
from inside the charge. Both runs take about 50% longer, and the extra
time is in the handler, which now runs more often. Without memory.high
pressure, the test never calls resume_user_mode_work() and the times
do not change. Lockdep showed no warnings, also with io_uring_register()
racing for sqd->lock.
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Cc: stable@vger.kernel.org
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://patch.msgid.link/20261101022146.309201-1-shakeel.butt@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/sqpoll.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 3d0fbae80938a..263da37d45ee0 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -318,6 +318,18 @@ static int io_sq_thread(void *data)
timeout = jiffies + sqd->sq_thread_idle;
}
+ /*
+ * The SQPOLL thread never returns to userspace, so do the
+ * return-to-userspace work, like memory.high reclaim, here.
+ * It can sleep for a long time, so drop sqd->lock.
+ */
+ if (test_thread_flag(TIF_NOTIFY_RESUME)) {
+ mutex_unlock(&sqd->lock);
+ resume_user_mode_work(NULL);
+ mutex_lock(&sqd->lock);
+ sqd->sq_cpu = raw_smp_processor_id();
+ }
+
cap_entries = !list_is_singular(&sqd->ctx_list);
list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
int ret = __io_sq_thread(ctx, cap_entries);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0035/1167] net: sfp: add quirk for Lantech 8330-265D
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0034/1167] io_uring/sqpoll: do the return-to-userspace work in the SQPOLL thread Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0036/1167] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
` (622 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marek Behún, Jakub Kicinski,
Josef Schlehofer, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Behún <kabel@kernel.org>
[ Upstream commit 86a8e8e0ddbc3d14c799536eb888180b84d002f3 ]
Similar to Lantech 8330-262D-E, the Lantech 8330-265D also reports
2500MBd instead of 3125MBd.
Also, all 8330-265D report normal RX_LOS in EEPROM, but some signal
inverted RX_LOS. We therefore need to ignore RX_LOS on these modules.
Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://patch.msgid.link/20260128170044.15576-1-kabel@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Adjusted context. 6.6.y uses SFP_QUIRK_M instead of SFP_QUIRK_S and has
other entries next to the Lantech one. The added lines are unchanged. ]
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/phy/sfp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 7d0cc601a56eb..6f69b00bd5bb3 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -533,9 +533,13 @@ static const struct sfp_quirk sfp_quirks[] = {
// FS 2.5G Base-T
SFP_QUIRK_M("FS", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
- // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report
- // 2500MBd NRZ in their EEPROM
+ // Lantech 8330-262D-E and 8330-265D can operate at 2500base-X, but
+ // incorrectly report 2500MBd NRZ in their EEPROM.
+ // Some 8330-265D modules have inverted LOS, while all of them report
+ // normal LOS in EEPROM. Therefore we need to ignore LOS entirely.
SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex),
+ SFP_QUIRK("Lantech", "8330-265D", sfp_quirk_2500basex,
+ sfp_fixup_ignore_los),
SFP_QUIRK_M("UBNT", "UF-INSTANT", sfp_quirk_ubnt_uf_instant),
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0036/1167] Input: destroy force-feedback device on input unregistration
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0035/1167] net: sfp: add quirk for Lantech 8330-265D Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0037/1167] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
` (621 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gideon Heinz, Dmitry Torokhov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit 2ae35f090d029d2d8491b0a7f98a04c5c05d0a44 ]
When an input device is unregistered while userspace holds an open file
descriptor to its event node, input_dev_release() is deferred until the
last file descriptor is closed. Because input_ff_destroy() was only
called from input_dev_release(), force-feedback teardown (ff->destroy
and freeing ff->private) could run after the parent driver had already
unbound, freed its device state, or even been unloaded via rmmod,
causing use-after-free errors or page faults in unmapped module text.
Commit ef166ce08801 ("Input: stop force-feedback timer when
unregistering input devices") added a separate ff->stop callback for
ff-memless, but left ff->destroy invoked from input_dev_release().
Once __input_unregister_device() has disconnected all input handlers
(which flushes effects, closes the device, and marks evdev dead) and
deleted the device from sysfs, nothing accesses dev->ff anymore. Call
input_ff_destroy() directly in __input_unregister_device() so that
ff->destroy() always runs synchronously while the driver and its module
are still active, and remove the now-redundant ff->stop callback. Keep
input_ff_destroy() in input_dev_release() (where it is a no-op once
dev->ff is NULL) to handle input_free_device() on devices that were
never registered.
Fixes: 509ca1a93836 ("Input: implement new force feedback interface")
Reported-by: Gideon Heinz <gideonheinz02@gmail.com>
Closes: https://lore.kernel.org/r/CAPb1+K2BxnfQ7VUQ15td5f9pVhn-ARSM9EjfOU8WuW72o+cvPg@mail.gmail.com
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Link: https://patch.msgid.link/2f722967b6db0692d4dd4164aff39b62@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ sashal: Dropped the ff->stop removal and its header hunk because that prerequisite is absent, and ml_ff_destroy() uses timer_shutdown_sync() instead of del_timer_sync(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/ff-core.c | 2 +-
drivers/input/ff-memless.c | 10 +---------
drivers/input/input.c | 2 ++
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index 609a5f01761bd..624f8defa5432 100644
--- a/drivers/input/ff-core.c
+++ b/drivers/input/ff-core.c
@@ -358,7 +358,7 @@ EXPORT_SYMBOL_GPL(input_ff_create);
*
* This function is only needed in error path as input core will
* automatically free force feedback structures when device is
- * destroyed.
+ * unregistered or destroyed.
*/
void input_ff_destroy(struct input_dev *dev)
{
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index c321cdabd2141..852ec2d4ddcda 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -486,15 +486,7 @@ static void ml_ff_destroy(struct ff_device *ff)
{
struct ml_device *ml = ff->private;
- /*
- * Even though we stop all playing effects when tearing down
- * an input device (via input_device_flush() that calls into
- * input_ff_flush() that stops and erases all effects), we
- * do not actually stop the timer, and therefore we should
- * do it here.
- */
- del_timer_sync(&ml->timer);
-
+ timer_shutdown_sync(&ml->timer);
kfree(ml->private);
}
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 9bb1d3de723ee..07be35612274c 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -2304,6 +2304,8 @@ static void __input_unregister_device(struct input_dev *dev)
mutex_unlock(&input_mutex);
device_del(&dev->dev);
+
+ input_ff_destroy(dev);
}
static void devm_input_device_unregister(struct device *dev, void *res)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0037/1167] staging: media: atomisp: use array3_size() for overflow-safe allocation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0036/1167] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0038/1167] fs/9p: switch vfsmount to use v9fs_get_new_inode Greg Kroah-Hartman
` (620 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Feng Ning, Sakari Ailus, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feng Ning <feng@innora.ai>
commit d178c7ca8fefc28115d35b94c3b1f4d653e34182 upstream.
Replace open-coded width * height * sizeof() multiplications with
array3_size() to prevent integer overflow in buffer allocations.
The atomisp driver computes DVS, morphing table, shading table and
statistics buffer sizes using unchecked arithmetic. When dimensions
are attacker-controlled or simply large, the product can silently wrap,
causing kvmalloc() to allocate an undersized buffer.
array3_size() saturates to SIZE_MAX on overflow, so kvmalloc() returns
NULL instead of succeeding with too few bytes.
Signed-off-by: Feng Ning <feng@innora.ai>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../media/atomisp/pci/sh_css_param_dvs.c | 11 +++---
.../media/atomisp/pci/sh_css_param_shading.c | 4 ++-
.../staging/media/atomisp/pci/sh_css_params.c | 35 +++++++++++--------
3 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c b/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
index 5174bc210ae17..f70dd99030e9e 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
@@ -13,6 +13,7 @@
* more details.
*/
+#include <linux/overflow.h>
#include "sh_css_param_dvs.h"
#include <assert_support.h>
#include <type_support.h>
@@ -58,7 +59,7 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
}
/* Generate Y buffers */
- dvs_config->xcoords_y = kvmalloc(width_y * height_y * sizeof(uint32_t),
+ dvs_config->xcoords_y = kvmalloc(array3_size(width_y, height_y, sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_y) {
IA_CSS_ERROR("out of memory");
@@ -66,7 +67,7 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
goto exit;
}
- dvs_config->ycoords_y = kvmalloc(width_y * height_y * sizeof(uint32_t),
+ dvs_config->ycoords_y = kvmalloc(array3_size(width_y, height_y, sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_y) {
IA_CSS_ERROR("out of memory");
@@ -77,7 +78,8 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
/* Generate UV buffers */
IA_CSS_LOG("UV W %d H %d", width_uv, height_uv);
- dvs_config->xcoords_uv = kvmalloc(width_uv * height_uv * sizeof(uint32_t),
+ dvs_config->xcoords_uv = kvmalloc(array3_size(width_uv, height_uv,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_uv) {
IA_CSS_ERROR("out of memory");
@@ -85,7 +87,8 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
goto exit;
}
- dvs_config->ycoords_uv = kvmalloc(width_uv * height_uv * sizeof(uint32_t),
+ dvs_config->ycoords_uv = kvmalloc(array3_size(width_uv, height_uv,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_uv) {
IA_CSS_ERROR("out of memory");
diff --git a/drivers/staging/media/atomisp/pci/sh_css_param_shading.c b/drivers/staging/media/atomisp/pci/sh_css_param_shading.c
index 5b43cc6562690..0441d7f47a610 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_param_shading.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_param_shading.c
@@ -13,6 +13,7 @@
* more details.
*/
+#include <linux/overflow.h>
#include <linux/math.h>
#include <linux/slab.h>
@@ -348,7 +349,8 @@ ia_css_shading_table_alloc(
me->fraction_bits = 0;
for (i = 0; i < IA_CSS_SC_NUM_COLORS; i++) {
me->data[i] =
- kvmalloc(width * height * sizeof(*me->data[0]),
+ kvmalloc(array3_size(width, height,
+ sizeof(*me->data[0])),
GFP_KERNEL);
if (!me->data[i]) {
unsigned int j;
diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c
index 760fe9bef2119..bd1d9e9a67209 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
@@ -13,6 +13,7 @@
* more details.
*/
+#include <linux/overflow.h>
#include "gdc_device.h" /* gdc_lut_store(), ... */
#include "isp.h" /* ISP_VEC_ELEMBITS */
#include "vamem.h"
@@ -1390,11 +1391,11 @@ struct ia_css_morph_table *ia_css_morph_table_allocate(
}
for (i = 0; i < IA_CSS_MORPH_TABLE_NUM_PLANES; i++) {
- me->coordinates_x[i] = kvmalloc(height * width *
- sizeof(*me->coordinates_x[i]),
+ me->coordinates_x[i] = kvmalloc(array3_size(height, width,
+ sizeof(*me->coordinates_x[i])),
GFP_KERNEL);
- me->coordinates_y[i] = kvmalloc(height * width *
- sizeof(*me->coordinates_y[i]),
+ me->coordinates_y[i] = kvmalloc(array3_size(height, width,
+ sizeof(*me->coordinates_y[i])),
GFP_KERNEL);
if ((!me->coordinates_x[i]) ||
@@ -4178,13 +4179,17 @@ ia_css_dvs_statistics_allocate(const struct ia_css_dvs_grid_info *grid)
goto err;
me->grid = *grid;
- me->hor_proj = kvmalloc(grid->height * IA_CSS_DVS_NUM_COEF_TYPES *
- sizeof(*me->hor_proj), GFP_KERNEL);
+ me->hor_proj = kvmalloc(array3_size(grid->height,
+ IA_CSS_DVS_NUM_COEF_TYPES,
+ sizeof(*me->hor_proj)),
+ GFP_KERNEL);
if (!me->hor_proj)
goto err;
- me->ver_proj = kvmalloc(grid->width * IA_CSS_DVS_NUM_COEF_TYPES *
- sizeof(*me->ver_proj), GFP_KERNEL);
+ me->ver_proj = kvmalloc(array3_size(grid->width,
+ IA_CSS_DVS_NUM_COEF_TYPES,
+ sizeof(*me->ver_proj)),
+ GFP_KERNEL);
if (!me->ver_proj)
goto err;
@@ -4451,24 +4456,26 @@ ia_css_dvs2_6axis_config_allocate(const struct ia_css_stream *stream)
params->pipe_dvs_6axis_config[IA_CSS_PIPE_ID_VIDEO]->height_uv;
IA_CSS_LOG("table Y: W %d H %d", width_y, height_y);
IA_CSS_LOG("table UV: W %d H %d", width_uv, height_uv);
- dvs_config->xcoords_y = kvmalloc(width_y * height_y * sizeof(uint32_t),
+ dvs_config->xcoords_y = kvmalloc(array3_size(width_y, height_y,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_y)
goto err;
- dvs_config->ycoords_y = kvmalloc(width_y * height_y * sizeof(uint32_t),
+ dvs_config->ycoords_y = kvmalloc(array3_size(width_y, height_y,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_y)
goto err;
- dvs_config->xcoords_uv = kvmalloc(width_uv * height_uv *
- sizeof(uint32_t),
+ dvs_config->xcoords_uv = kvmalloc(array3_size(width_uv, height_uv,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_uv)
goto err;
- dvs_config->ycoords_uv = kvmalloc(width_uv * height_uv *
- sizeof(uint32_t),
+ dvs_config->ycoords_uv = kvmalloc(array3_size(width_uv, height_uv,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_uv)
goto err;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0038/1167] fs/9p: switch vfsmount to use v9fs_get_new_inode
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0037/1167] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0039/1167] fs/9p: rework qid2ino logic Greg Kroah-Hartman
` (619 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Eric Van Hensbergen, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Van Hensbergen <ericvh@kernel.org>
[ Upstream commit fe1371d0f8c6a9aa4441ddd09ea6d4f31b975a81 ]
In the process of cleaning up inode number allocation, I noticed several functions which didn't use the standard helper
allocators. This patch fixes the allocation in the mount entrypoint.
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
Stable-dep-of: 8bb0279930cc ("9p: skip intermediate directory entry name copy in p9dirent_read()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/9p/vfs_super.c | 29 +----------------------------
1 file changed, 1 insertion(+), 28 deletions(-)
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 958efc8423334..4ee00da0ef9be 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -110,7 +110,6 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
struct inode *inode = NULL;
struct dentry *root = NULL;
struct v9fs_session_info *v9ses = NULL;
- umode_t mode = 0777 | S_ISVTX;
struct p9_fid *fid;
int retval = 0;
@@ -140,7 +139,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
else
sb->s_d_op = &v9fs_dentry_operations;
- inode = v9fs_get_inode(sb, S_IFDIR | mode, 0);
+ inode = v9fs_get_new_inode_from_fid(v9ses, fid, sb);
if (IS_ERR(inode)) {
retval = PTR_ERR(inode);
goto release_sb;
@@ -152,32 +151,6 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
goto release_sb;
}
sb->s_root = root;
- if (v9fs_proto_dotl(v9ses)) {
- struct p9_stat_dotl *st = NULL;
-
- st = p9_client_getattr_dotl(fid, P9_STATS_BASIC);
- if (IS_ERR(st)) {
- retval = PTR_ERR(st);
- goto release_sb;
- }
- d_inode(root)->i_ino = v9fs_qid2ino(&st->qid);
- v9fs_stat2inode_dotl(st, d_inode(root), 0);
- kfree(st);
- } else {
- struct p9_wstat *st = NULL;
-
- st = p9_client_stat(fid);
- if (IS_ERR(st)) {
- retval = PTR_ERR(st);
- goto release_sb;
- }
-
- d_inode(root)->i_ino = v9fs_qid2ino(&st->qid);
- v9fs_stat2inode(st, d_inode(root), sb, 0);
-
- p9stat_free(st);
- kfree(st);
- }
retval = v9fs_get_acl(inode, fid);
if (retval)
goto release_sb;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0039/1167] fs/9p: rework qid2ino logic
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0038/1167] fs/9p: switch vfsmount to use v9fs_get_new_inode Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0040/1167] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
` (618 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Eric Van Hensbergen, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Van Hensbergen <ericvh@kernel.org>
[ Upstream commit b91a26696ef38eae1442aa03104e60bb49d2ac99 ]
This changes from a function to a macro because we can
figure out if we are 32 or 64 bit at compile time.
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
Stable-dep-of: 8bb0279930cc ("9p: skip intermediate directory entry name copy in p9dirent_read()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/9p/v9fs_vfs.h | 7 ++++++-
fs/9p/vfs_dir.c | 4 ++--
fs/9p/vfs_inode.c | 26 ++------------------------
fs/9p/vfs_inode_dotl.c | 6 ++----
4 files changed, 12 insertions(+), 31 deletions(-)
diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h
index dcce42d55d68f..7f3074d439291 100644
--- a/fs/9p/v9fs_vfs.h
+++ b/fs/9p/v9fs_vfs.h
@@ -46,7 +46,12 @@ void v9fs_set_netfs_context(struct inode *inode);
int v9fs_init_inode(struct v9fs_session_info *v9ses,
struct inode *inode, umode_t mode, dev_t rdev);
void v9fs_evict_inode(struct inode *inode);
-ino_t v9fs_qid2ino(struct p9_qid *qid);
+#if (BITS_PER_LONG == 32)
+#define QID2INO(q) ((ino_t) (((q)->path+2) ^ (((q)->path) >> 32)))
+#else
+#define QID2INO(q) ((ino_t) ((q)->path+2))
+#endif
+
void v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
struct super_block *sb, unsigned int flags);
void v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode,
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index da87f1e5a153a..323f85352f6a4 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -133,7 +133,7 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
}
over = !dir_emit(ctx, st.name, strlen(st.name),
- v9fs_qid2ino(&st.qid), dt_type(&st));
+ QID2INO(&st.qid), dt_type(&st));
p9stat_free(&st);
if (over)
return 0;
@@ -195,7 +195,7 @@ static int v9fs_dir_readdir_dotl(struct file *file, struct dir_context *ctx)
if (!dir_emit(ctx, curdirent.d_name,
strlen(curdirent.d_name),
- v9fs_qid2ino(&curdirent.qid),
+ QID2INO(&curdirent.qid),
curdirent.d_type))
return 0;
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 6ce79084017fa..9b84b261f52e5 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -441,7 +441,6 @@ static struct inode *v9fs_qid_iget(struct super_block *sb,
dev_t rdev;
int retval;
umode_t umode;
- unsigned long i_ino;
struct inode *inode;
struct v9fs_session_info *v9ses = sb->s_fs_info;
int (*test)(struct inode *inode, void *data);
@@ -451,8 +450,7 @@ static struct inode *v9fs_qid_iget(struct super_block *sb,
else
test = v9fs_test_inode;
- i_ino = v9fs_qid2ino(qid);
- inode = iget5_locked(sb, i_ino, test, v9fs_set_inode, st);
+ inode = iget5_locked(sb, QID2INO(qid), test, v9fs_set_inode, st);
if (!inode)
return ERR_PTR(-ENOMEM);
if (!(inode->i_state & I_NEW))
@@ -462,7 +460,7 @@ static struct inode *v9fs_qid_iget(struct super_block *sb,
* FIXME!! we may need support for stale inodes
* later.
*/
- inode->i_ino = i_ino;
+ inode->i_ino = QID2INO(qid);
umode = p9mode2unixmode(v9ses, st, &rdev);
retval = v9fs_init_inode(v9ses, inode, umode, rdev);
if (retval)
@@ -1211,26 +1209,6 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
v9inode->cache_validity &= ~V9FS_INO_INVALID_ATTR;
}
-/**
- * v9fs_qid2ino - convert qid into inode number
- * @qid: qid to hash
- *
- * BUG: potential for inode number collisions?
- */
-
-ino_t v9fs_qid2ino(struct p9_qid *qid)
-{
- u64 path = qid->path + 2;
- ino_t i = 0;
-
- if (sizeof(ino_t) == sizeof(path))
- memcpy(&i, &path, sizeof(ino_t));
- else
- i = (ino_t) (path ^ (path >> 32));
-
- return i;
-}
-
/**
* v9fs_vfs_get_link - follow a symlink path
* @dentry: dentry for symlink
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index f309464aee4da..a834ac8ce58b2 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -100,7 +100,6 @@ static struct inode *v9fs_qid_iget_dotl(struct super_block *sb,
int new)
{
int retval;
- unsigned long i_ino;
struct inode *inode;
struct v9fs_session_info *v9ses = sb->s_fs_info;
int (*test)(struct inode *inode, void *data);
@@ -110,8 +109,7 @@ static struct inode *v9fs_qid_iget_dotl(struct super_block *sb,
else
test = v9fs_test_inode_dotl;
- i_ino = v9fs_qid2ino(qid);
- inode = iget5_locked(sb, i_ino, test, v9fs_set_inode_dotl, st);
+ inode = iget5_locked(sb, QID2INO(qid), test, v9fs_set_inode_dotl, st);
if (!inode)
return ERR_PTR(-ENOMEM);
if (!(inode->i_state & I_NEW))
@@ -121,7 +119,7 @@ static struct inode *v9fs_qid_iget_dotl(struct super_block *sb,
* FIXME!! we may need support for stale inodes
* later.
*/
- inode->i_ino = i_ino;
+ inode->i_ino = QID2INO(qid);
retval = v9fs_init_inode(v9ses, inode,
st->st_mode, new_decode_dev(st->st_rdev));
if (retval)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0040/1167] 9p: skip intermediate directory entry name copy in p9dirent_read()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0039/1167] fs/9p: rework qid2ino logic Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0041/1167] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
` (617 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haobin Wu, Christian Schoenebeck,
Dominique Martinet, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haobin Wu <853555@gmail.com>
[ Upstream commit 8bb0279930cc90975f03bad4d83282613e5f57fa ]
v9fs_dir_readdir_dotl() decodes each entry of a Rreaddir reply with
p9dirent_read(), which parses it through p9pdu_readf("Qqbs"). The 's'
conversion in p9pdu_vreadf() already allocates a NUL-terminated copy
of the name from the wire buffer; p9dirent_read() then strscpy()s that
copy into the fixed 256-byte p9_dirent::d_name and frees the original.
The wire format carries the name length in 16 bits, so a name longer
than 255 bytes is valid on the wire and may well be valid on the
server's filesystem, but it makes strscpy() return -E2BIG.
v9fs_dir_readdir_dotl() turns that into -EIO and aborts getdents64(),
so every entry after the long one disappears from the listing.
Drop the second copy: keep the string allocated by p9pdu_vreadf() in
p9_dirent and let v9fs_dir_readdir_dotl(), its only user, free it once
dir_emit() has consumed it. p9_dirent is a short-lived stack object, so
the string's lifetime does not change.
Note that the VFS only rejects names of PATH_MAX bytes or more in
verify_dirent_name(), so after this change a name between NAME_MAX and
PATH_MAX is returned by getdents64() even though any later lookup on it
fails with -ENAMETOOLONG. The next patch skips such entries.
Fixes: 7751bdb3a095 ("9p: readdir implementation for 9p2000.L")
Closes: https://github.com/microsoft/WSL/issues/41192
Signed-off-by: Haobin Wu <853555@gmail.com>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Message-ID: <20260918024851.51229-2-853555@gmail.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/9p/vfs_dir.c | 6 +++++-
include/net/9p/client.h | 2 +-
net/9p/protocol.c | 12 ++----------
3 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 323f85352f6a4..733ec42258bc6 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -196,8 +196,12 @@ static int v9fs_dir_readdir_dotl(struct file *file, struct dir_context *ctx)
if (!dir_emit(ctx, curdirent.d_name,
strlen(curdirent.d_name),
QID2INO(&curdirent.qid),
- curdirent.d_type))
+ curdirent.d_type)) {
+ kfree(curdirent.d_name);
return 0;
+ }
+
+ kfree(curdirent.d_name);
ctx->pos = curdirent.d_off;
rdir->head += err;
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 78ebcf782ce57..d0fc8046cbaa5 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -172,7 +172,7 @@ struct p9_dirent {
struct p9_qid qid;
u64 d_off;
unsigned char d_type;
- char d_name[256];
+ char *d_name;
};
struct iov_iter;
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 0e6603b1ec906..0a97b4de243ab 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -771,7 +771,7 @@ int p9dirent_read(struct p9_client *clnt, char *buf, int len,
{
struct p9_fcall fake_pdu;
int ret;
- char *nameptr;
+ char *nameptr = NULL;
fake_pdu.size = len;
fake_pdu.capacity = len;
@@ -786,15 +786,7 @@ int p9dirent_read(struct p9_client *clnt, char *buf, int len,
return ret;
}
- ret = strscpy(dirent->d_name, nameptr, sizeof(dirent->d_name));
- if (ret < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "On the wire dirent name too long: %s\n",
- nameptr);
- kfree(nameptr);
- return ret;
- }
- kfree(nameptr);
+ dirent->d_name = nameptr;
return fake_pdu.offset;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0041/1167] xfrm: zero-initialise km_event in the replay-notify path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0040/1167] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0042/1167] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
` (616 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giovanni Vignone, Shubham Antil,
Steffen Klassert, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shubham Antil <shubham@octane.security>
[ Upstream commit e35a12dffd5da67b6ca12bd23eebdd0570592205 ]
xfrm_replay_notify(), xfrm_replay_notify_bmp() and
xfrm_replay_notify_esn() declare a struct km_event on the stack and
initialise only its .event and .data.aevent fields, leaving .seq and
.portid uninitialised. build_aevent() then builds the XFRM_MSG_NEWAE
message with those fields:
nlmsg_put(skb, c->portid, c->seq, ...)
so the netlink header of a replay event carries uninitialised stack
values rather than defined ones. This was confirmed at runtime rather
than by inspection alone: the .seq and .portid carried in that header
hold values that nothing in the replay path assigns.
The request-driven paths set these header fields from the requester
(xfrm_get_ae() / xfrm_new_ae()); only the kernel-originated replay path
leaves them unset. Zero-initialise the event so the header fields are 0,
the correct value for a kernel-originated notification.
Fixes: f8cd54884e67 ("[IPSEC]: Sync series - core changes")
Reported-by: Giovanni Vignone <gio@octane.security>
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Shubham Antil <shubham@octane.security>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/xfrm/xfrm_replay.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
index 7f52bb2e14c13..ad54fe0b89ada 100644
--- a/net/xfrm/xfrm_replay.c
+++ b/net/xfrm/xfrm_replay.c
@@ -40,7 +40,7 @@ static void xfrm_replay_notify_esn(struct xfrm_state *x, int event);
void xfrm_replay_notify(struct xfrm_state *x, int event)
{
- struct km_event c;
+ struct km_event c = {};
/* we send notify messages in case
* 1. we updated on of the sequence numbers, and the seqno difference
* is at least x->replay_maxdiff, in this case we also update the
@@ -304,7 +304,7 @@ static void xfrm_replay_advance_bmp(struct xfrm_state *x, __be32 net_seq)
static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event)
{
- struct km_event c;
+ struct km_event c = {};
struct xfrm_replay_state_esn *replay_esn = x->replay_esn;
struct xfrm_replay_state_esn *preplay_esn = x->preplay_esn;
@@ -356,7 +356,7 @@ static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event)
static void xfrm_replay_notify_esn(struct xfrm_state *x, int event)
{
u32 seq_diff, oseq_diff;
- struct km_event c;
+ struct km_event c = {};
struct xfrm_replay_state_esn *replay_esn = x->replay_esn;
struct xfrm_replay_state_esn *preplay_esn = x->preplay_esn;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0042/1167] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0041/1167] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0043/1167] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
` (615 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+a079f084653164a652d1,
Deepanshu Kartikey, Sven Eckelmann, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepanshu Kartikey <kartikey406@gmail.com>
[ Upstream commit dfa953ba5366b0a80c303700dab2bbcbdc5c27e9 ]
batadv_orig_ifinfo_new() returns NULL only when its GFP_ATOMIC
allocation fails, which is a normal runtime condition and not a bug.
batadv_v_ogm_forward() already handles this the same way, simply
checking for NULL without a WARN_ON.
Do the same in batadv_iv_ogm_update_seqnos() to avoid a spurious
WARN_ON splat when the allocation fails (e.g. under fault injection).
Fixes: 7351a4822d42 ("batman-adv: split out router from orig_node")
Reported-by: syzbot+a079f084653164a652d1@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a079f084653164a652d1
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/batman-adv/bat_iv_ogm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index dd1f88af5b961..cf6ff9848a7bc 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -1296,7 +1296,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
return BATADV_NO_DUP;
orig_ifinfo = batadv_orig_ifinfo_new(orig_node, if_outgoing);
- if (WARN_ON(!orig_ifinfo)) {
+ if (!orig_ifinfo) {
batadv_orig_node_put(orig_node);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0043/1167] wifi: ath9k_htc: start ANI when an AP interface begins to beacon
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0042/1167] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0044/1167] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
` (614 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mehmet Fide,
Toke Høiland-Jørgensen, Jeff Johnson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mehmet Fide <mehmet.fide@screeningeagle.com>
[ Upstream commit 5c1b202d67a212c87e7389aaa093ce77828fa98f ]
ath9k_htc_vif_reconfig() re-arms ANI after a channel change when an AP
interface beacons. mac80211 configures the channel before it enables
the beacon, so during a normal AP start that never triggers, and the
start from add_interface that the previous patch removed was cancelled
by the same channel configuration: with hostapd, ANI and the periodic
calibration it drives did not run in AP mode until a later channel
change.
Start ANI when the beacon is enabled. The channel and its calibration
data are in place by then, which is the state vif_reconfig() re-arms
it in, and remove_interface() already stops it with the last AP
interface.
Fixes: a236254c35f0 ("ath9k_htc: Add ANI for AP mode")
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20261005072209.4101009-3-mehmet.fide@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 9a9b5212051af..7fe304c9b5fc9 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1552,6 +1552,9 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
ath9k_htc_set_tsfadjust(priv, vif);
priv->cur_beacon_conf.enable_beacon = 1;
ath9k_htc_beacon_config(priv, vif);
+ if (priv->ah->opmode == NL80211_IFTYPE_AP &&
+ !test_bit(ATH_OP_ANI_RUN, &common->op_flags))
+ ath9k_htc_start_ani(priv);
}
if ((changed & BSS_CHANGED_BEACON_ENABLED) && !bss_conf->enable_beacon) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0044/1167] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0043/1167] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0045/1167] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
` (613 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Imre Kaloz,
Martin K. Petersen (Oracle), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Imre Kaloz <kaloz@kernel.org>
[ Upstream commit 9a2690eb4bbea8d7fbc3dfe478fca75fe956abb4 ]
The REQUEST SENSE length was taken from sg->len after the AHC_DMA_LAST_SEG
flag was or-ed in and the value converted to little-endian, so the 8-bit
field is 0x80 on big-endian hosts and the target is asked for 128 bytes
into a 32-byte buffer. Use the buffer size, as aic79xx does. On an SGI O2
with a Fujitsu MAX3147NC, the sense data of its CHECK CONDITIONs during
probe was lost.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
Link: https://patch.msgid.link/20261013094253.2956-1-kaloz@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index d747d0b72a13a..989e8c9bda4ac 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -1097,7 +1097,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
sc->byte2 = SCB_GET_LUN(scb) << 5;
sc->unused[0] = 0;
sc->unused[1] = 0;
- sc->length = sg->len;
+ sc->length = ahc_get_sense_bufsize(ahc, scb);
sc->control = 0;
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0045/1167] scsi: aha1542: Remove unneeded scsi_dma_unmap() call
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0044/1167] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0046/1167] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
` (612 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurence Oberman, Matthew Whitehead,
Martin K. Petersen (Oracle), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Whitehead <tedheadster@gmail.com>
[ Upstream commit 9ec6671b137de06f0345962fb8091466b7d56a96 ]
aha1542 never DMA maps the command's scatterlist. Data is bounced
through a per-command buffer allocated with dma_alloc_coherent() in
aha1542_init_cmd_priv(), the adapter is programmed with
acmd->data_buffer_handle, and the payload is copied to and from the
request segments in aha1542_queuecommand() and aha1542_free_cmd().
The scsi_dma_unmap() call left in aha1542_free_cmd() therefore unmaps
a scatterlist that was never mapped. With CONFIG_DMA_API_DEBUG enabled
this results in:
device driver tries to free DMA memory it has not allocated
[device address=0x0000000000000000] [size=0 bytes]
Remove the call.
Verified by testing on real hardware.
Fixes: 2f2fef022c3e ("aha1542: use a local bounce buffer")
Suggested-by: Laurence Oberman <loberman@redhat.com>
Assisted-by: LLM
Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Link: https://patch.msgid.link/20260929144528.7061-1-tedheadster@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/aha1542.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 9503996c63256..8661056a920ee 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -271,8 +271,6 @@ static void aha1542_free_cmd(struct scsi_cmnd *cmd)
buf += bv.bv_len;
}
}
-
- scsi_dma_unmap(cmd);
}
static irqreturn_t aha1542_interrupt(int irq, void *dev_id)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0046/1167] 9p: fall back to the normal open path for non-regular files
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0045/1167] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0047/1167] 9p: do not store the create fid on special files Greg Kroah-Hartman
` (611 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuanfu Xie, Dominique Martinet,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
[ Upstream commit ff1baa01a6e1f24741f7428119e6f3a61b995604 ]
v9fs_vfs_atomic_open() and v9fs_vfs_atomic_open_dotl() call
finish_open(file, dentry, generic_file_open) regardless of the file
type the server reported for the created dentry. The supplied
callback replaces f_op->open in do_dentry_open(), so blkdev_open()
never runs for a server-reported device node: an open() with O_CREAT
succeeds with f_op = def_blk_fops while f_mapping still points at the
9p inode, because the bdev mapping swap only happens inside
blkdev_open(). The block file methods then derive their block_device
from that inode with I_BDEV(); the loads land at the tail of a
656-byte v9fs_inode_cache object (offsets +624 and +632), which KASAN
reports as slab-out-of-bounds, and the garbage they read is then
dereferenced, so the first read(), write(), ioctl() or close() ends
in a NULL pointer write and a panic. In the ioctl(BLKGETSIZE64)
variant the value read this way is returned to userspace.
The server controls the file type reported for the create, so a
malicious server can crash the client this way. KASAN report of the
read() variant, on a build of linux-stable 2709dd5ae32f:
BUG: KASAN: slab-out-of-bounds in blkdev_read_iter+0x3cd/0x440
Read of size 8 at addr ffff88800828ceb0 by task repro/1
Call Trace:
<TASK>
dump_stack_lvl+0x7b/0xa0
print_report+0xd0/0x630
kasan_report+0xe5/0x120
blkdev_read_iter+0x3cd/0x440
vfs_read+0x718/0xa50
ksys_read+0x10f/0x200
do_syscall_64+0xdd/0x4a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
</TASK>
The buggy address belongs to the object at ffff88800828cc40
which belongs to the cache v9fs_inode_cache of size 656
The buggy address is located 624 bytes inside of
allocated 656-byte region [ffff88800828cc40, ffff88800828ced0)
A plain open() without O_CREAT is not affected: it runs blkdev_open()
and either maps the device correctly or fails with -ENXIO for an rdev
with no registered device. When the created inode is not a regular
file, clunk the fid the create opened. The unopened fid is already
on the dentry. Set FMODE_CREATED and return finish_no_open(file, NULL)
so the VFS keeps its dentry reference and calls the inode's ->open.
Regular files still use finish_open() with generic_file_open.
Fixes: be12af3ef5e6 ("getting rid of 'opened' argument of ->atomic_open() - part 1")
Signed-off-by: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
Message-ID: <908FC420-EC1F-46FC-8526-698F646961A8@stu.pku.edu.cn>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/9p/vfs_inode.c | 10 ++++++++++
fs/9p/vfs_inode_dotl.c | 12 ++++++++++++
2 files changed, 22 insertions(+)
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 9b84b261f52e5..a84ecb3d39771 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -852,6 +852,16 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
v9fs_invalidate_inode_attr(dir);
inode = d_inode(dentry);
v9inode = V9FS_I(inode);
+ if (!S_ISREG(inode->i_mode)) {
+ /*
+ * Not a regular file. v9fs_create() already stored the
+ * unopened fid on the dentry. Clunk the opened fid from
+ * the create and let the VFS call ->open.
+ */
+ p9_fid_put(fid);
+ file->f_mode |= FMODE_CREATED;
+ return finish_no_open(file, NULL);
+ }
err = finish_open(file, dentry, generic_file_open);
if (err)
goto error;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index a834ac8ce58b2..e3fb95d726946 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -317,6 +317,18 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
v9fs_fid_add(dentry, &fid);
d_instantiate(dentry, inode);
+ if (!S_ISREG(inode->i_mode)) {
+ /*
+ * Not a regular file. The unopened fid is already on the
+ * dentry. Clunk the opened create fid and let the VFS call
+ * ->open.
+ */
+ p9_fid_put(ofid);
+ ofid = NULL;
+ file->f_mode |= FMODE_CREATED;
+ err = finish_no_open(file, NULL);
+ goto out;
+ }
/* Since we are opening a file, assign the open fid to the file */
err = finish_open(file, dentry, generic_file_open);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0047/1167] 9p: do not store the create fid on special files
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0046/1167] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0048/1167] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
` (610 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuanfu Xie, Dominique Martinet,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
[ Upstream commit 56894cadf21c34abbba7f74b8f5d78dabf69dd39 ]
v9fs_vfs_atomic_open_dotl() always stores the create fid in
file->private_data after finish_open(). FIFO and device inodes
already have type-specific file_operations that own that field.
Overwriting it with the fid makes later read/write/close treat the
p9_fid as a pipe_inode_info, which corrupts the fid and can use it
after it has been clunked. The non-dotl atomic_open path does not
assign the fid this way.
Only attach the fid for regular files and directories. Special
files do not need the create fid; leave it for the existing
p9_fid_put() on the out path so it is clunked before return.
KASAN report, linux-stable 4982d3552a3b:
BUG: KASAN: slab-use-after-free in anon_pipe_prefill_and_lock+0x376/0x3f0
Read of size 4 at addr ffff88800ab30538 by task repro/1
Call Trace:
<TASK>
anon_pipe_prefill_and_lock+0x376/0x3f0
anon_pipe_write+0x127/0x1600
fifo_pipe_write+0x24/0x300
vfs_write+0x659/0xd00
ksys_write+0x10f/0x200
do_syscall_64+0xdd/0x4a0
</TASK>
Fixes: 30d904947459 ("kill struct opendata")
Signed-off-by: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
Message-ID: <92377346-29E9-46D3-96F5-AABA8A64CD57@stu.pku.edu.cn>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/9p/vfs_inode_dotl.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index e3fb95d726946..b1254d7cb2ad9 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -333,16 +333,24 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
err = finish_open(file, dentry, generic_file_open);
if (err)
goto out;
- file->private_data = ofid;
+ /*
+ * Special files have type-specific fops that own
+ * file->private_data. The create fid is unused
+ * there: leave it for p9_fid_put() on the out
+ * path so it is clunked before we return.
+ */
+ if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) {
+ file->private_data = ofid;
#ifdef CONFIG_9P_FSCACHE
- if (v9ses->cache & CACHE_FSCACHE) {
- struct v9fs_inode *v9inode = V9FS_I(inode);
- fscache_use_cookie(v9fs_inode_cookie(v9inode),
- file->f_mode & FMODE_WRITE);
- }
+ if (v9ses->cache & CACHE_FSCACHE) {
+ struct v9fs_inode *v9inode = V9FS_I(inode);
+ fscache_use_cookie(v9fs_inode_cookie(v9inode),
+ file->f_mode & FMODE_WRITE);
+ }
#endif
- v9fs_fid_add_modes(ofid, v9ses->flags, v9ses->cache, flags);
- v9fs_open_fid_add(inode, &ofid);
+ v9fs_fid_add_modes(ofid, v9ses->flags, v9ses->cache, flags);
+ v9fs_open_fid_add(inode, &ofid);
+ }
file->f_mode |= FMODE_CREATED;
out:
p9_fid_put(dfid);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0048/1167] wifi: ath10k: Stop unanswered temperature reads
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0047/1167] 9p: do not store the create fid on special files Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0049/1167] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
` (609 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Filippo Falezza, Loic Poulain,
Jeff Johnson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filippo Falezza <effeffe99@gmail.com>
[ Upstream commit 2a87e367c62856b87a90f745c6b7d2eb91e0c51f ]
Reading the ath10k hwmon temperature sends WMI_PDEV_GET_TEMPERATURE and
waits up to 5 s (ATH10K_THERMAL_SYNC_TIMEOUT_HZ) for the reply event,
holding conf_mutex. Not all firmware answers: the WCN3990 firmware
WLAN.HL.3.3.1-00694-QCAHLSWMTPLZ-1 on a Motorola Moto G 5G Plus
codename nairo (SM7250) never sends the event, so every read of
temp1_input stalls for 5 s, logs
ath10k_snoc 18800000.wifi: failed to synchronize thermal read
and returns -ETIMEDOUT. Tools that read all hwmon sensors, such as
lm-sensors, hang for 5 s on every run, and configuration changes of the
interface wait for conf_mutex in the meantime.
Whether the firmware answers cannot be told from the chip: firmware that
answers and firmware that does not both advertise
WMI_SERVICE_THERM_THROT, and WCN3990 firmware differs between devices.
Instead, remember that the running firmware did not answer, and return
-EOPNOTSUPP right away on later reads. Forget it when the firmware
starts, so that a restarted or updated firmware is asked again.
The first read after each firmware start still takes 5 s when the
firmware does not answer. Reads on firmware that answers are unchanged.
Fixes: e98199a8c27f ("ath10k: enable QCA6174/QCA9377 to read the chip temperature")
Signed-off-by: Filippo Falezza <effeffe99@gmail.com>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-ath10k-temperature-v2-1-0793e80d73bc@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath10k/core.c | 1 +
drivers/net/wireless/ath/ath10k/thermal.c | 9 ++++++++-
drivers/net/wireless/ath/ath10k/thermal.h | 2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index c3a8b3496be2a..fac4abe847006 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2927,6 +2927,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
clear_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags);
ar->running_fw = fw;
+ ar->thermal.broken = false;
if (!test_bit(ATH10K_FW_FEATURE_NON_BMI,
ar->running_fw->fw_file.fw_features)) {
diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c
index 31c8d7fbb0955..f816142dd8888 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -75,6 +75,12 @@ static ssize_t ath10k_thermal_show_temp(struct device *dev,
goto out;
}
+ /* Don't stall every read on firmware that never answers */
+ if (ar->thermal.broken) {
+ ret = -EOPNOTSUPP;
+ goto out;
+ }
+
reinit_completion(&ar->thermal.wmi_sync);
ret = ath10k_wmi_pdev_get_temperature(ar);
if (ret) {
@@ -90,7 +96,8 @@ static ssize_t ath10k_thermal_show_temp(struct device *dev,
time_left = wait_for_completion_timeout(&ar->thermal.wmi_sync,
ATH10K_THERMAL_SYNC_TIMEOUT_HZ);
if (!time_left) {
- ath10k_warn(ar, "failed to synchronize thermal read\n");
+ ath10k_warn(ar, "failed to synchronize thermal read, not asking again until the firmware restarts\n");
+ ar->thermal.broken = true;
ret = -ETIMEDOUT;
goto out;
}
diff --git a/drivers/net/wireless/ath/ath10k/thermal.h b/drivers/net/wireless/ath/ath10k/thermal.h
index 1f4de9fbf2b30..d1fb5b958c37c 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.h
+++ b/drivers/net/wireless/ath/ath10k/thermal.h
@@ -19,6 +19,8 @@ struct ath10k_thermal {
/* protected by conf_mutex */
u32 throttle_state;
u32 quiet_period;
+ /* the running firmware did not answer a temperature request */
+ bool broken;
/* temperature value in Celsius degree
* protected by data_lock
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0049/1167] seg6: fix transport header for inner IPv4 with IP options
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0048/1167] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0050/1167] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
` (608 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hazley Samsudin, David Ahern,
Hangbin Liu, Andrea Mayer, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Mayer <andrea.mayer@uniroma2.it>
[ Upstream commit 5838f10563d58afca6711edb5e4eda968ca181d9 ]
The End.DT4, End.DT46 (its IPv4 path only) and End.DX4 behaviors set the
transport header of the decapsulated IPv4 packet at a fixed 20 bytes, the
size of an IPv4 header without options. They do not validate the header
length either. With options, the transport header points at the first
option byte. The effects include:
- ping -R sends an echo request with a 60-byte IPv4 header to a local
address through an End.DT4 or an End.DX4 SID. Since icmp_rcv()
computes the ICMP checksum from the first option byte, the request
fails the check and is counted in IcmpInCsumErrors.
- A UDP datagram can reach a port that an iptables rule drops. The rule
checks the UDP header after the full IPv4 header, while the socket
lookup reads it at the fixed 20-byte offset.
- With an inbound AH state, ah_input() reads the AH header at the fixed
20-byte offset, but copies the IPv4 header over it with the length in
the IHL field. A packet shorter than that length can make ah_input()
write past the end of the data, into skb_shared_info when the skb has
no tailroom.
Validate the inner IPv4 header length with the new helper
seg6_validate_iphdr_len() and set the transport header at that length. A
packet that is not IPv4, whose header length field is below 5, or whose
header is truncated, is dropped with a drop reason. The fix is limited to
the header length, which the transport header relies on. Other checks done
on IPv4 input, such as the header checksum, the total length and the IP
options, are not addressed here.
Found by code inspection while reviewing commit 44930446dde4 ("ipv6: seg6:
clear IPv4 control block on IPIP decapsulation"), as a pre-existing issue
that Sashiko also reported on v2 of that patch. Without this patch, a
bpftrace probe on ah_input() shows the reporter's reproducer packet
written into skb_shared_info. With it, that packet is dropped before
ah_input(), ping -R no longer fails the ICMP checksum, the UDP datagram
reaches its real port, and the SRv6 selftests still pass. These effects
reproduce on an unmodified kernel, without error injection.
Fixes: 891ef8dd2a8d ("ipv6: sr: implement additional seg6local actions")
Fixes: 664d6f86868b ("seg6: add support for the SRv6 End.DT4 behavior")
Reported-by: Hazley Samsudin <hazleycryilis@gmail.com>
Closes: https://lore.kernel.org/netdev/20260809221915.2ffc1ecd0f445fcb70270e31@uniroma2.it/
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Link: https://patch.msgid.link/20261028171511.35-1-andrea.mayer@uniroma2.it
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/seg6_local.c | 69 +++++++++++++++++++++++++++++++++----------
1 file changed, 53 insertions(+), 16 deletions(-)
diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index 6986553af342f..24f5ff3ae4286 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -149,9 +149,7 @@ struct seg6_end_dt_info {
int vrf_ifindex;
int vrf_table;
- /* tunneled packet family (IPv4 or IPv6).
- * Protocol and header length are inferred from family.
- */
+ /* tunneled packet family (IPv4 or IPv6) */
u16 family;
};
@@ -969,6 +967,40 @@ static int input_action_end_dx6(struct sk_buff *skb,
return -EINVAL;
}
+/* Validate the length of the IPv4 header at skb->data (which must point to
+ * the network header) and report that length, options included.
+ * Only the version, the header length and the presence of the whole header
+ * are checked.
+ * The length is written only when SKB_NOT_DROPPED_YET is returned.
+ *
+ * skb pointers may change: after this call, the caller must evaluate again
+ * any pointer into the packet data.
+ */
+static enum skb_drop_reason
+seg6_validate_iphdr_len(struct sk_buff *skb, int *hdrlen)
+{
+ enum skb_drop_reason reason;
+ const struct iphdr *iph;
+ int len;
+
+ reason = pskb_may_pull_reason(skb, sizeof(struct iphdr));
+ if (reason)
+ return reason;
+
+ iph = ip_hdr(skb);
+ if (iph->version != 4 || iph->ihl < 5)
+ return SKB_DROP_REASON_IP_INHDR;
+
+ len = ip_hdrlen(skb);
+
+ reason = pskb_may_pull_reason(skb, len);
+ if (reason)
+ return reason;
+
+ *hdrlen = len;
+ return SKB_NOT_DROPPED_YET;
+}
+
static int input_action_end_dx4_finish(struct net *net, struct sock *sk,
struct sk_buff *skb)
{
@@ -998,14 +1030,18 @@ static int input_action_end_dx4_finish(struct net *net, struct sock *sk,
static int input_action_end_dx4(struct sk_buff *skb,
struct seg6_local_lwt *slwt)
{
+ SKB_DR(reason);
+ int hdrlen;
+
if (!decap_and_validate(skb, IPPROTO_IPIP))
goto drop;
- if (!pskb_may_pull(skb, sizeof(struct iphdr)))
+ reason = seg6_validate_iphdr_len(skb, &hdrlen);
+ if (reason)
goto drop;
skb->protocol = htons(ETH_P_IP);
- skb_set_transport_header(skb, sizeof(struct iphdr));
+ skb_set_transport_header(skb, hdrlen);
nf_reset_ct(skb);
if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
@@ -1015,7 +1051,7 @@ static int input_action_end_dx4(struct sk_buff *skb,
return input_action_end_dx4_finish(dev_net(skb->dev), NULL, skb);
drop:
- kfree_skb(skb);
+ kfree_skb_reason(skb, reason);
return -EINVAL;
}
@@ -1150,16 +1186,24 @@ static struct sk_buff *end_dt_vrf_core(struct sk_buff *skb,
struct seg6_end_dt_info *info = &slwt->dt_info;
struct net_device *vrf;
__be16 protocol;
+ SKB_DR(reason);
int hdrlen;
vrf = end_dt_get_vrf_rcu(skb, info);
if (unlikely(!vrf))
goto drop;
+ if (unlikely(info->family != AF_UNSPEC && info->family != family)) {
+ pr_warn_once("seg6local: SRv6 End.DT* family mismatch");
+ goto drop;
+ }
+
switch (family) {
case AF_INET:
protocol = htons(ETH_P_IP);
- hdrlen = sizeof(struct iphdr);
+ reason = seg6_validate_iphdr_len(skb, &hdrlen);
+ if (unlikely(reason))
+ goto drop;
break;
case AF_INET6:
protocol = htons(ETH_P_IPV6);
@@ -1171,11 +1215,6 @@ static struct sk_buff *end_dt_vrf_core(struct sk_buff *skb,
goto drop;
}
- if (unlikely(info->family != AF_UNSPEC && info->family != family)) {
- pr_warn_once("seg6local: SRv6 End.DT* family mismatch");
- goto drop;
- }
-
skb->protocol = protocol;
skb_dst_drop(skb);
@@ -1186,7 +1225,7 @@ static struct sk_buff *end_dt_vrf_core(struct sk_buff *skb,
return end_dt_vrf_rcv(skb, family, vrf);
drop:
- kfree_skb(skb);
+ kfree_skb_reason(skb, reason);
return ERR_PTR(-EINVAL);
}
@@ -1199,9 +1238,7 @@ static int input_action_end_dt4(struct sk_buff *skb,
if (!decap_and_validate(skb, IPPROTO_IPIP))
goto drop;
- if (!pskb_may_pull(skb, sizeof(struct iphdr)))
- goto drop;
-
+ /* end_dt_vrf_core() validates the inner IPv4 header length */
skb = end_dt_vrf_core(skb, slwt, AF_INET);
if (!skb)
/* packet has been processed and consumed by the VRF */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0050/1167] gpio: omap: Propagate runtime PM failures in probe and request
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0049/1167] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0051/1167] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
` (607 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Bartosz Golaszewski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 05be1a99d6d68b24cbe24a191e1af67c70193ac3 ]
pm_runtime_get_sync() can fail when the OMAP PM domain cannot
resume a GPIO controller, but omap_gpio_probe() and
omap_gpio_request() ignore its return value.
Consequently, probe can register a GPIO controller despite a failed
resume, while a GPIO request can report success and modify GPIO
state even though runtime-PM acquisition failed.
Use pm_runtime_resume_and_get() in both paths and propagate
resume errors. On probe failure, disable runtime PM and unprepare
the debounce clock when applicable.
Reproduced both failures on QEMU N800 by injecting -EIO from the
OMAP PM-domain resume callback. The original driver continues
probe and accepts the GPIO request - while the patched driver
rejects both operations with -EIO. Normal GPIO controller
registration continues to work without fault injection.
Fixes: 77640aabd755 ("OMAP: GPIO: Implement GPIO as a platform device")
Fixes: 55b93c32520d ("gpio/omap: use pm-runtime framework")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Link: https://patch.msgid.link/20261029103626.1527919-2-thnkslprpt@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-omap.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 772fddc02b818..a23b3195af1d1 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -814,8 +814,11 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
{
struct gpio_bank *bank = gpiochip_get_data(chip);
unsigned long flags;
+ int ret;
- pm_runtime_get_sync(chip->parent);
+ ret = pm_runtime_resume_and_get(chip->parent);
+ if (ret < 0)
+ return ret;
raw_spin_lock_irqsave(&bank->lock, flags);
omap_enable_gpio_module(bank, offset);
@@ -1466,7 +1469,13 @@ static int omap_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, bank);
pm_runtime_enable(dev);
- pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0) {
+ pm_runtime_disable(dev);
+ if (bank->dbck_flag)
+ clk_unprepare(bank->dbck);
+ return ret;
+ }
if (bank->is_mpuio)
omap_mpuio_init(bank);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0051/1167] btrfs: verity: propagate orphan insertion errors when enabling verity
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0050/1167] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0052/1167] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
` (606 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, guolingxing, Qu Wenruo, David Sterba,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: guolingxing <guolingxing@tju.edu.cn>
[ Upstream commit 45a686dff6b91c3667cd8188d3a02c69f62f4d00 ]
btrfs_begin_enable_verity() ignores the return value of
btrfs_orphan_add() and unconditionally returns 0. If orphan insertion
fails, btrfs_orphan_add() aborts the transaction, but the generic
fs-verity code still proceeds with Merkle tree construction because
the begin_enable_verity callback reported success.
Return the error so that fs-verity stops immediately instead of
continuing after the initialization failure.
The transaction is already aborted by btrfs_orphan_add() and the
handle is released by btrfs_end_transaction(), so no additional
cleanup is needed.
Fixes: 705242538ff3 ("btrfs: verity metadata orphan items")
Signed-off-by: guolingxing <guolingxing@tju.edu.cn>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/verity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/verity.c b/fs/btrfs/verity.c
index a02e6664bd5d8..56fe19d063936 100644
--- a/fs/btrfs/verity.c
+++ b/fs/btrfs/verity.c
@@ -605,7 +605,7 @@ static int btrfs_begin_enable_verity(struct file *filp)
set_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &inode->runtime_flags);
btrfs_end_transaction(trans);
- return 0;
+ return ret;
}
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0052/1167] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0051/1167] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0053/1167] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
` (605 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Filipe Manana,
David Sterba, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <fdmanana@suse.com>
[ Upstream commit bda65e5115fe66ee0d8cf4ade11807f9fca4f0e1 ]
When scrub finishes, it does a wakeup on the fs_info->scrub_pause_wait
wait queue and then sets dev->scrub_sctx to NULL. On the other hand the
scrub cancel code (btrfs_scrub_cancel_dev()) waits on that wait queue
for dev->scrub_sctx to be NULL. So this means if btrfs_scrub_cancel_dev()
is called right when scrub is finishing and sees the wakeup before the
NULL is assigned to dev->scrub_sctx by btrfs_scrub_dev(), it hangs.
Fix this by doing the wakeup in btrfs_scrub_dev() after setting
dev->scrub_sctx to NULL.
Fixes: a2de733c78fa ("btrfs: scrub")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/scrub.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 0da80e65d798e..a841e57e78de8 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -2982,7 +2982,6 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
memalloc_nofs_restore(nofs_flag);
atomic_dec(&fs_info->scrubs_running);
- wake_up(&fs_info->scrub_pause_wait);
if (progress)
memcpy(progress, &sctx->stat, sizeof(*progress));
@@ -2995,6 +2994,13 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
dev->scrub_ctx = NULL;
mutex_unlock(&fs_info->scrub_lock);
+ /*
+ * We have set dev->scrub_ctx to NULL, now do the wakeup as a concurrent
+ * scrub cancel (btrfs_scrub_cancel_dev()) waits for dev->scrub_ctx to
+ * be set to NULL.
+ */
+ wake_up(&fs_info->scrub_pause_wait);
+
scrub_workers_put(fs_info);
scrub_put_ctx(sctx);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0053/1167] btrfs: zoned: fix double free of bitmaps on clone failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0052/1167] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0054/1167] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
` (604 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Johannes Thumshirn, Thomas Fourier,
David Sterba, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Fourier <fourier.thomas@gmail.com>
[ Upstream commit 8c66a6aa59a5df1d672d72b7cd379d897ff73200 ]
btrfs_clone_dev_zone_info() duplicates the original orig_dev->zone_info
with kmemdup(), which also copies the seq_zones, empty_zones and
active_zones pointers. The clone then replaces them one by one with
fresh bitmaps. If one of the allocations fails, the error path frees all
three pointers, including those not yet replaced, which still point to
the bitmaps owned by the original device.
Clear the three pointers right after kmemdup() so the error path only frees
what this function allocated.
Fixes: 21e61ec6d0bb ("btrfs: zoned: clone zoned device info when cloning a device")
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zoned.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 20d752eaefc97..12a11aafc16ca 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -642,6 +642,11 @@ struct btrfs_zoned_device_info *btrfs_clone_dev_zone_info(struct btrfs_device *o
if (!zone_info)
return NULL;
+ /* Don't let the error path free the bitmaps still owned by @orig_dev. */
+ zone_info->seq_zones = NULL;
+ zone_info->empty_zones = NULL;
+ zone_info->active_zones = NULL;
+
zone_info->seq_zones = bitmap_zalloc(zone_info->nr_zones, GFP_KERNEL);
if (!zone_info->seq_zones)
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0054/1167] net: ethernet: mtk_wed: fix reset condition for rx wdma
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0053/1167] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0055/1167] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
` (603 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Zhi-Jun You, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhi-Jun You <hujy652@gmail.com>
[ Upstream commit 7180a42d8e616f919dcff4b90a13b9a5ecea665b ]
In mtk_wdma_rx_reset, currently only resets the CPU index of the rings
that doesn't have a descriptor. This is wrong because no descriptor
means the ring is not configured.
Also mtk_wed_start makes sure that all rx_wdma rings are set up this
would lead to no ring getting their CPU index reset.
Fix this by inverting the reset condition so allocated rings will be
reset.
Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260724172040.1653-1-hujy652%40gmail.com
Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
Link: https://patch.msgid.link/20261026-wedfix-v6-2-a52f6b15d2fc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 525e2d365cd95..981292ef8f7fc 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -125,7 +125,7 @@ mtk_wdma_rx_reset(struct mtk_wed_device *dev)
wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++) {
- if (dev->rx_wdma[i].desc)
+ if (!dev->rx_wdma[i].desc)
continue;
wdma_w32(dev,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0055/1167] net: ethernet: mtk_wed: free up rings during detach
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0054/1167] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0056/1167] net: ethernet: mtk_wed: introduce versioning utility routines Greg Kroah-Hartman
` (602 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Zhi-Jun You, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhi-Jun You <hujy652@gmail.com>
[ Upstream commit 5b8d12512cbd3495dbd8c38e8047bb5d716f0f3f ]
During __mtk_wed_detach, rx_ring and tx_wdma aren't freed up.
Fix this by add them to mtk_wed_free_rx_rings.
This patch is pulled from mtk-openwrt-feeds to address Sashiko's review
and edit to rely on ring->desc instead of an extra flag.
Link: https://github.com/mediatek/mtk-openwrt-feeds/blob/main/25.12/files/target/linux/mediatek/patches-6.12/999-wed-04-Fix-reinsert-wifi-module-cause-memory-leak-issue.patch
Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/message/179000700034.2160803.10594281691384015089%40kernel.org
Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
Link: https://patch.msgid.link/20261026-wedfix-v6-3-a52f6b15d2fc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 981292ef8f7fc..0e4d0e9811e7c 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -478,6 +478,14 @@ mtk_wed_free_ring(struct mtk_wed_device *dev, struct mtk_wed_ring *ring)
static void
mtk_wed_free_rx_rings(struct mtk_wed_device *dev)
{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(dev->rx_ring); i++)
+ mtk_wed_free_ring(dev, &dev->rx_ring[i]);
+
+ for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++)
+ mtk_wed_free_ring(dev, &dev->tx_wdma[i]);
+
mtk_wed_free_rx_buffer(dev);
mtk_wed_free_ring(dev, &dev->rro.ring);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0056/1167] net: ethernet: mtk_wed: introduce versioning utility routines
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0055/1167] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0057/1167] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
` (601 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Paolo Abeni,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo@kernel.org>
[ Upstream commit d274d523c71c825fcd7738c6f401fc283bdad9ff ]
Similar to mtk_eth_soc, introduce the following wed versioning
utility routines:
- mtk_wed_is_v1
- mtk_wed_is_v2
This is a preliminary patch to introduce WED support for MT7988 SoC
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: dd6efae55291 ("net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 40 +++++++++----------
drivers/net/ethernet/mediatek/mtk_wed.h | 10 +++++
.../net/ethernet/mediatek/mtk_wed_debugfs.c | 2 +-
drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 2 +-
4 files changed, 32 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 0e4d0e9811e7c..6f1033705bbcf 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -278,7 +278,7 @@ mtk_wed_assign(struct mtk_wed_device *dev)
if (!hw->wed_dev)
goto out;
- if (hw->version == 1)
+ if (mtk_wed_is_v1(hw))
return NULL;
/* MT7986 WED devices do not have any pcie slot restrictions */
@@ -359,7 +359,7 @@ mtk_wed_tx_buffer_alloc(struct mtk_wed_device *dev)
desc->buf0 = cpu_to_le32(buf_phys);
desc->buf1 = cpu_to_le32(buf_phys + txd_size);
- if (dev->hw->version == 1)
+ if (mtk_wed_is_v1(dev->hw))
ctrl = FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN0, txd_size) |
FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN1,
MTK_WED_BUF_SIZE - txd_size) |
@@ -506,7 +506,7 @@ mtk_wed_set_ext_int(struct mtk_wed_device *dev, bool en)
{
u32 mask = MTK_WED_EXT_INT_STATUS_ERROR_MASK;
- if (dev->hw->version == 1)
+ if (mtk_wed_is_v1(dev->hw))
mask |= MTK_WED_EXT_INT_STATUS_TX_DRV_R_RESP_ERR;
else
mask |= MTK_WED_EXT_INT_STATUS_RX_FBUF_LO_TH |
@@ -585,7 +585,7 @@ mtk_wed_dma_disable(struct mtk_wed_device *dev)
MTK_WDMA_GLO_CFG_RX_INFO1_PRERES |
MTK_WDMA_GLO_CFG_RX_INFO2_PRERES);
- if (dev->hw->version == 1) {
+ if (mtk_wed_is_v1(dev->hw)) {
regmap_write(dev->hw->mirror, dev->hw->index * 4, 0);
wdma_clr(dev, MTK_WDMA_GLO_CFG,
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
@@ -614,7 +614,7 @@ mtk_wed_stop(struct mtk_wed_device *dev)
wdma_w32(dev, MTK_WDMA_INT_MASK, 0);
wdma_w32(dev, MTK_WDMA_INT_GRP2, 0);
- if (dev->hw->version == 1)
+ if (mtk_wed_is_v1(dev->hw))
return;
wed_w32(dev, MTK_WED_EXT_INT_MASK1, 0);
@@ -632,7 +632,7 @@ mtk_wed_deinit(struct mtk_wed_device *dev)
MTK_WED_CTRL_WED_TX_BM_EN |
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
- if (dev->hw->version == 1)
+ if (mtk_wed_is_v1(dev->hw))
return;
wed_clr(dev, MTK_WED_CTRL,
@@ -738,7 +738,7 @@ mtk_wed_bus_init(struct mtk_wed_device *dev)
static void
mtk_wed_set_wpdma(struct mtk_wed_device *dev)
{
- if (dev->hw->version == 1) {
+ if (mtk_wed_is_v1(dev->hw)) {
wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_phys);
} else {
mtk_wed_bus_init(dev);
@@ -769,7 +769,7 @@ mtk_wed_hw_init_early(struct mtk_wed_device *dev)
MTK_WED_WDMA_GLO_CFG_IDLE_DMAD_SUPPLY;
wed_m32(dev, MTK_WED_WDMA_GLO_CFG, mask, set);
- if (dev->hw->version == 1) {
+ if (mtk_wed_is_v1(dev->hw)) {
u32 offset = dev->hw->index ? 0x04000400 : 0;
wdma_set(dev, MTK_WDMA_GLO_CFG,
@@ -942,7 +942,7 @@ mtk_wed_hw_init(struct mtk_wed_device *dev)
wed_w32(dev, MTK_WED_TX_BM_BUF_LEN, MTK_WED_PKT_SIZE);
- if (dev->hw->version == 1) {
+ if (mtk_wed_is_v1(dev->hw)) {
wed_w32(dev, MTK_WED_TX_BM_TKID,
FIELD_PREP(MTK_WED_TX_BM_TKID_START,
dev->wlan.token_start) |
@@ -975,7 +975,7 @@ mtk_wed_hw_init(struct mtk_wed_device *dev)
mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
- if (dev->hw->version == 1) {
+ if (mtk_wed_is_v1(dev->hw)) {
wed_set(dev, MTK_WED_CTRL,
MTK_WED_CTRL_WED_TX_BM_EN |
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
@@ -1225,7 +1225,7 @@ mtk_wed_reset_dma(struct mtk_wed_device *dev)
}
dev->init_done = false;
- if (dev->hw->version == 1)
+ if (mtk_wed_is_v1(dev->hw))
return;
if (!busy) {
@@ -1351,7 +1351,7 @@ mtk_wed_configure_irq(struct mtk_wed_device *dev, u32 irq_mask)
MTK_WED_CTRL_WED_TX_BM_EN |
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
- if (dev->hw->version == 1) {
+ if (mtk_wed_is_v1(dev->hw)) {
wed_w32(dev, MTK_WED_PCIE_INT_TRIGGER,
MTK_WED_PCIE_INT_TRIGGER_STATUS);
@@ -1424,7 +1424,7 @@ mtk_wed_dma_enable(struct mtk_wed_device *dev)
MTK_WDMA_GLO_CFG_RX_INFO1_PRERES |
MTK_WDMA_GLO_CFG_RX_INFO2_PRERES);
- if (dev->hw->version == 1) {
+ if (mtk_wed_is_v1(dev->hw)) {
wdma_set(dev, MTK_WDMA_GLO_CFG,
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
} else {
@@ -1473,7 +1473,7 @@ mtk_wed_start(struct mtk_wed_device *dev, u32 irq_mask)
mtk_wed_set_ext_int(dev, true);
- if (dev->hw->version == 1) {
+ if (mtk_wed_is_v1(dev->hw)) {
u32 val = dev->wlan.wpdma_phys | MTK_PCIE_MIRROR_MAP_EN |
FIELD_PREP(MTK_PCIE_MIRROR_MAP_WED_ID,
dev->hw->index);
@@ -1558,7 +1558,7 @@ mtk_wed_attach(struct mtk_wed_device *dev)
}
mtk_wed_hw_init_early(dev);
- if (hw->version == 1) {
+ if (mtk_wed_is_v1(hw)) {
regmap_update_bits(hw->hifsys, HIFSYS_DMA_AG_MAP,
BIT(hw->index), 0);
} else {
@@ -1626,7 +1626,7 @@ static int
mtk_wed_txfree_ring_setup(struct mtk_wed_device *dev, void __iomem *regs)
{
struct mtk_wed_ring *ring = &dev->txfree_ring;
- int i, index = dev->hw->version == 1;
+ int i, index = mtk_wed_is_v1(dev->hw);
/*
* For txfree event handling, the same DMA ring is shared between WED
@@ -1684,7 +1684,7 @@ mtk_wed_irq_get(struct mtk_wed_device *dev, u32 mask)
{
u32 val, ext_mask = MTK_WED_EXT_INT_STATUS_ERROR_MASK;
- if (dev->hw->version == 1)
+ if (mtk_wed_is_v1(dev->hw))
ext_mask |= MTK_WED_EXT_INT_STATUS_TX_DRV_R_RESP_ERR;
else
ext_mask |= MTK_WED_EXT_INT_STATUS_RX_FBUF_LO_TH |
@@ -1848,7 +1848,7 @@ mtk_wed_setup_tc(struct mtk_wed_device *wed, struct net_device *dev,
{
struct mtk_wed_hw *hw = wed->hw;
- if (hw->version < 2)
+ if (mtk_wed_is_v1(hw))
return -EOPNOTSUPP;
switch (type) {
@@ -1921,9 +1921,9 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
hw->wdma = wdma;
hw->index = index;
hw->irq = irq;
- hw->version = mtk_is_netsys_v1(eth) ? 1 : 2;
+ hw->version = eth->soc->version;
- if (hw->version == 1) {
+ if (mtk_wed_is_v1(hw)) {
hw->mirror = syscon_regmap_lookup_by_phandle(eth_np,
"mediatek,pcie-mirror");
hw->hifsys = syscon_regmap_lookup_by_phandle(eth_np,
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.h b/drivers/net/ethernet/mediatek/mtk_wed.h
index 43ab77eaf6837..6f5db891a6b94 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.h
+++ b/drivers/net/ethernet/mediatek/mtk_wed.h
@@ -40,6 +40,16 @@ struct mtk_wdma_info {
};
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
+static inline bool mtk_wed_is_v1(struct mtk_wed_hw *hw)
+{
+ return hw->version == 1;
+}
+
+static inline bool mtk_wed_is_v2(struct mtk_wed_hw *hw)
+{
+ return hw->version == 2;
+}
+
static inline void
wed_w32(struct mtk_wed_device *dev, u32 reg, u32 val)
{
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
index e24afeaea0da8..674e919d0d3a7 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
@@ -261,7 +261,7 @@ void mtk_wed_hw_add_debugfs(struct mtk_wed_hw *hw)
debugfs_create_u32("regidx", 0600, dir, &hw->debugfs_reg);
debugfs_create_file_unsafe("regval", 0600, dir, hw, &fops_regval);
debugfs_create_file_unsafe("txinfo", 0400, dir, hw, &wed_txinfo_fops);
- if (hw->version != 1)
+ if (!mtk_wed_is_v1(hw))
debugfs_create_file_unsafe("rxinfo", 0400, dir, hw,
&wed_rxinfo_fops);
}
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
index 72bcdaed12a94..8216403e58347 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
@@ -207,7 +207,7 @@ int mtk_wed_mcu_msg_update(struct mtk_wed_device *dev, int id, void *data,
{
struct mtk_wed_wo *wo = dev->hw->wed_wo;
- if (dev->hw->version == 1)
+ if (mtk_wed_is_v1(dev->hw))
return 0;
if (WARN_ON(!wo))
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0057/1167] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0056/1167] net: ethernet: mtk_wed: introduce versioning utility routines Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0058/1167] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
` (600 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhi-Jun You, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhi-Jun You <hujy652@gmail.com>
[ Upstream commit dd6efae5529107cc8db277eaeaff5c5f15e6bc15 ]
WDMA_RING_TX(0) is required to set MTK_WED_WDMA_RING_TX for WED RX
but on a non-DBDC MT7986 it is never setup because idx is 1.
Setting MTK_WED_WDMA_RING_TX with WDMA_RING_TX(1) is not feasible because
WED still tries to send through WDMA_RING_TX(0). This is verified with
register dump.
Fix this by calling mtk_wed_wdma_tx_ring_setup if wed is v2 and
rx_ring[0] is not allocated and reset tx_wdma[0] if it's already
allocated also add error messages and bail when mtk_wed_start fails.
Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support")
Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
Link: https://patch.msgid.link/20261026-wedfix-v6-4-a52f6b15d2fc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 6f1033705bbcf..2f59ad04357a6 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -1466,7 +1466,20 @@ mtk_wed_start(struct mtk_wed_device *dev, u32 irq_mask)
for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
if (!dev->rx_wdma[i].desc)
- mtk_wed_wdma_rx_ring_setup(dev, i, 16, false);
+ if (mtk_wed_wdma_rx_ring_setup(dev, i, 16, false)) {
+ dev_err(dev->hw->dev, "wdma rx ring %d setup failed\n", i);
+ return;
+ }
+
+ /*
+ * non-DBDC MT7986 allocates only rx_ring[1] and tx_wdma[1] during setup
+ * but tx_wdma[0] is also needed for WED to function.
+ */
+ if (mtk_wed_is_v2(dev->hw) && !dev->rx_ring[0].desc)
+ if (mtk_wed_wdma_tx_ring_setup(dev, 0, MTK_WED_WDMA_RING_SIZE, !!dev->tx_wdma[0].desc)) {
+ dev_err(dev->hw->dev, "wdma tx ring 0 setup failed\n");
+ return;
+ }
mtk_wed_hw_init(dev);
mtk_wed_configure_irq(dev, irq_mask);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0058/1167] ptp: drain virtual clock sysfs operations before unregistering children
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0057/1167] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0059/1167] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
` (599 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vadim Fedorenko, James Hilliard,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hilliard <james.hilliard1@gmail.com>
[ Upstream commit 0e4a135aebc7686286d87e286499ce55e5bd5aad ]
Parent clock removal walks its virtual clocks before removing the
n_vclocks sysfs attribute. The mutex taken by ptp_vclock_in_use() is
released before that walk, so a concurrent sysfs deletion can pick the
same child and unregister and free its ptp_vclock a second time. A
reference held by the device iterator does not protect that separately
allocated virtual clock.
Remove n_vclocks before walking the children. Removing the attribute
prevents new stores and drains stores already running, without holding
n_vclocks_mux across a callback that needs that mutex. Skip virtual
clocks, which do not have this attribute.
This race was found by code inspection of virtual-clock registration
failure cleanup and parent removal.
Fixes: bfcbb76b0f59 ("ptp: unregister virtual clocks when unregistering physical clock.")
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-1-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ptp/ptp_clock.c | 5 +++++
drivers/ptp/ptp_private.h | 1 +
drivers/ptp/ptp_sysfs.c | 6 ++++++
3 files changed, 12 insertions(+)
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index d252d018bfe77..d8e956b663c9a 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -373,6 +373,11 @@ static int unregister_vclock(struct device *dev, void *data)
int ptp_clock_unregister(struct ptp_clock *ptp)
{
+ /*
+ * Stop and drain virtual-clock creation and deletion before walking the
+ * children. Do not hold n_vclocks_mux while waiting for sysfs callbacks.
+ */
+ ptp_vclock_remove_sysfs(ptp);
if (ptp_vclock_in_use(ptp)) {
device_for_each_child(&ptp->dev, NULL, unregister_vclock);
}
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index d5bf50ee33d48..5f3697c61e2b7 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -158,6 +158,7 @@ extern const struct attribute_group *ptp_groups[];
int ptp_populate_pin_groups(struct ptp_clock *ptp);
void ptp_cleanup_pin_groups(struct ptp_clock *ptp);
+void ptp_vclock_remove_sysfs(struct ptp_clock *ptp);
struct ptp_vclock *ptp_vclock_register(struct ptp_clock *pclock);
void ptp_vclock_unregister(struct ptp_vclock *vclock);
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 02111e6d87a10..5f81b06ebebc5 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -261,6 +261,12 @@ static ssize_t n_vclocks_store(struct device *dev,
}
static DEVICE_ATTR_RW(n_vclocks);
+void ptp_vclock_remove_sysfs(struct ptp_clock *ptp)
+{
+ if (!ptp->is_virtual_clock)
+ device_remove_file(&ptp->dev, &dev_attr_n_vclocks);
+}
+
static ssize_t max_vclocks_show(struct device *dev,
struct device_attribute *attr, char *page)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0059/1167] ptp: unwind partially completed virtual clock creation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0058/1167] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0060/1167] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
` (598 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hilliard <james.hilliard1@gmail.com>
[ Upstream commit 3dea778260e3dddf30651a6913d87a42861346a2 ]
n_vclocks_store() publishes the new clock count only after every child
has been registered. If a later registration fails, it returns without
unregistering the children already created by that request. Those clocks
are left out of n_vclocks, and a subsequent request can overwrite their
index entries without removing them.
Unregister the newly created children in reverse order and clear their
index entries on failure. Leave the previously installed clocks and
their count unchanged. The n_vclocks mutex serializes this rollback with
other sysfs changes, and parent removal drains the store before walking
the children.
This was found by code inspection while adding initial PHC sample error
handling to virtual clock registration.
Fixes: 73f37068d540 ("ptp: support ptp physical/virtual clocks conversion")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-2-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ptp/ptp_sysfs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 5f81b06ebebc5..31e176e91d78c 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -223,7 +223,7 @@ static ssize_t n_vclocks_store(struct device *dev,
for (i = 0; i < num - ptp->n_vclocks; i++) {
vclock = ptp_vclock_register(ptp);
if (!vclock)
- goto out;
+ goto err_register;
*(ptp->vclock_index + ptp->n_vclocks + i) =
vclock->clock->index;
@@ -255,6 +255,12 @@ static ssize_t n_vclocks_store(struct device *dev,
mutex_unlock(&ptp->n_vclocks_mux);
return count;
+err_register:
+ num = i;
+ if (num)
+ device_for_each_child_reverse(dev, &num, unregister_vclock);
+ for (num = 0; num < i; num++)
+ ptp->vclock_index[ptp->n_vclocks + num] = -1;
out:
mutex_unlock(&ptp->n_vclocks_mux);
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0060/1167] ptp: vclock: propagate physical clock sampling errors
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0059/1167] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0061/1167] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
` (597 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hilliard <james.hilliard1@gmail.com>
[ Upstream commit d1bdfdafd663dd00b01d43eb3391f87718f2a09d ]
The cyclecounter read callback cannot report errors. ptp_vclock_read()
ignores the return from the physical clock and consumes its output even
if the read failed. A zero sample followed by the real counter can add
an extra 32-bit wrap to virtual time. This was found by code inspection
of reset-time PHC access and the virtual clock callers.
Sample the parent before calling timecounter_read() or timecounter_init()
and have the cyclecounter callback return the cached successful sample.
On failure, leave the counter and frequency adjustment unchanged and
return the PHC error to the caller.
Retry the first failed refresh after 10 ms instead of waiting another two
seconds. With the existing 32-bit nanosecond mask, timecounter_cyc2time()
can interpret a fresh timestamp as being in the past once the last
successful refresh is about 2.147 seconds old. An isolated read failure
should not deliberately defer the next attempt until that sample is four
seconds old.
Double the retry delay after consecutive failures, up to the normal
two-second refresh interval, and reset it after a successful refresh.
Each virtual clock has its own worker, and a failed parent read can involve
bus traffic and error logging. Backoff limits that repeated work during a
persistent failure while retaining a prompt first retry.
Limit each retry delay to the next regular refresh deadline. Otherwise,
backoff can skip the next two-second refresh opportunity and lose a full
counter wrap even when the parent has recovered before that refresh was
due. Advance the deadline when an attempt reaches it without resetting the
backoff, so sustained failures still settle at the normal refresh interval.
Keep the retry state private to each clock's auxiliary worker.
Take the initial sample and initialize the counter before publishing the
clock. Return an error pointer from registration and propagate its errno
through n_vclocks, including when the initial sample fails. Queue the first
refresh immediately after registration so registration latency is not
followed by another full refresh interval.
Keep the existing cyclecounter mask and scaling. These scheduling changes
do not guarantee timely samples: prolonged read failures or worker delays
can still exceed the half-wrap conversion window, and a gap of about
4.295 seconds between successful samples can lose a full counter wrap.
Do not assume that getcycles64() exposes a full-width nanosecond counter.
Fixes: 5d43f951b1ac ("ptp: add ptp virtual clock driver framework")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-3-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ptp/ptp_private.h | 6 ++-
drivers/ptp/ptp_sysfs.c | 4 +-
drivers/ptp/ptp_vclock.c | 89 ++++++++++++++++++++++++++++++---------
3 files changed, 76 insertions(+), 23 deletions(-)
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index 5f3697c61e2b7..d69ab0106c9c3 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -72,7 +72,11 @@ struct ptp_vclock {
struct hlist_node vclock_hash_node;
struct cyclecounter cc;
struct timecounter tc;
- struct mutex lock; /* protects tc/cc */
+ u64 cycles;
+ struct mutex lock; /* protects tc/cc and the cached sample */
+ /* Owned by the auxiliary worker. */
+ unsigned long retry_delay;
+ unsigned long refresh_deadline;
};
/*
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 31e176e91d78c..77a0c1082cd93 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -222,8 +222,10 @@ static ssize_t n_vclocks_store(struct device *dev,
if (num > ptp->n_vclocks) {
for (i = 0; i < num - ptp->n_vclocks; i++) {
vclock = ptp_vclock_register(ptp);
- if (!vclock)
+ if (IS_ERR(vclock)) {
+ err = PTR_ERR(vclock);
goto err_register;
+ }
*(ptp->vclock_index + ptp->n_vclocks + i) =
vclock->clock->index;
diff --git a/drivers/ptp/ptp_vclock.c b/drivers/ptp/ptp_vclock.c
index a88c424593732..d112934351dc9 100644
--- a/drivers/ptp/ptp_vclock.c
+++ b/drivers/ptp/ptp_vclock.c
@@ -4,6 +4,7 @@
*
* Copyright 2021 NXP
*/
+#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/hashtable.h>
#include "ptp_private.h"
@@ -13,6 +14,7 @@
#define PTP_VCLOCK_FADJ_SHIFT 9
#define PTP_VCLOCK_FADJ_DENOMINATOR 15625ULL
#define PTP_VCLOCK_REFRESH_INTERVAL (HZ * 2)
+#define PTP_VCLOCK_RETRY_INTERVAL msecs_to_jiffies(10)
/* protects vclock_hash addition/deletion */
static DEFINE_SPINLOCK(vclock_hash_lock);
@@ -42,21 +44,39 @@ static void ptp_vclock_hash_del(struct ptp_vclock *vclock)
synchronize_srcu(&vclock_srcu);
}
+/* The caller holds vclock->lock, or has not published the clock yet. */
+static int ptp_vclock_sample(struct ptp_vclock *vclock)
+{
+ struct ptp_clock *ptp = vclock->pclock;
+ struct timespec64 ts;
+ int err;
+
+ err = ptp->info->getcycles64(ptp->info, &ts);
+ if (!err)
+ vclock->cycles = timespec64_to_ns(&ts);
+
+ return err;
+}
+
static int ptp_vclock_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{
struct ptp_vclock *vclock = info_to_vclock(ptp);
s64 adj;
+ int err;
adj = (s64)scaled_ppm << PTP_VCLOCK_FADJ_SHIFT;
adj = div_s64(adj, PTP_VCLOCK_FADJ_DENOMINATOR);
if (mutex_lock_interruptible(&vclock->lock))
return -EINTR;
- timecounter_read(&vclock->tc);
- vclock->cc.mult = PTP_VCLOCK_CC_MULT + adj;
+ err = ptp_vclock_sample(vclock);
+ if (!err) {
+ timecounter_read(&vclock->tc);
+ vclock->cc.mult = PTP_VCLOCK_CC_MULT + adj;
+ }
mutex_unlock(&vclock->lock);
- return 0;
+ return err;
}
static int ptp_vclock_adjtime(struct ptp_clock_info *ptp, s64 delta)
@@ -75,15 +95,16 @@ static int ptp_vclock_gettime(struct ptp_clock_info *ptp,
struct timespec64 *ts)
{
struct ptp_vclock *vclock = info_to_vclock(ptp);
- u64 ns;
+ int err;
if (mutex_lock_interruptible(&vclock->lock))
return -EINTR;
- ns = timecounter_read(&vclock->tc);
+ err = ptp_vclock_sample(vclock);
+ if (!err)
+ *ts = ns_to_timespec64(timecounter_read(&vclock->tc));
mutex_unlock(&vclock->lock);
- *ts = ns_to_timespec64(ns);
- return 0;
+ return err;
}
static int ptp_vclock_gettimex(struct ptp_clock_info *ptp,
@@ -115,13 +136,16 @@ static int ptp_vclock_settime(struct ptp_clock_info *ptp,
{
struct ptp_vclock *vclock = info_to_vclock(ptp);
u64 ns = timespec64_to_ns(ts);
+ int err;
if (mutex_lock_interruptible(&vclock->lock))
return -EINTR;
- timecounter_init(&vclock->tc, &vclock->cc, ns);
+ err = ptp_vclock_sample(vclock);
+ if (!err)
+ timecounter_init(&vclock->tc, &vclock->cc, ns);
mutex_unlock(&vclock->lock);
- return 0;
+ return err;
}
static int ptp_vclock_getcrosststamp(struct ptp_clock_info *ptp,
@@ -151,8 +175,24 @@ static long ptp_vclock_refresh(struct ptp_clock_info *ptp)
struct ptp_vclock *vclock = info_to_vclock(ptp);
struct timespec64 ts;
- ptp_vclock_gettime(&vclock->info, &ts);
+ /* Retry transient failures promptly, but back off during long outages. */
+ if (ptp_vclock_gettime(&vclock->info, &ts)) {
+ unsigned long now = jiffies;
+
+ /* Retries must not postpone the next regular refresh attempt. */
+ if (!vclock->retry_delay || time_after_eq(now, vclock->refresh_deadline))
+ vclock->refresh_deadline = now + PTP_VCLOCK_REFRESH_INTERVAL;
+
+ if (!vclock->retry_delay)
+ vclock->retry_delay = PTP_VCLOCK_RETRY_INTERVAL;
+ else
+ vclock->retry_delay = min_t(unsigned long,
+ vclock->retry_delay * 2,
+ PTP_VCLOCK_REFRESH_INTERVAL);
+ return min(vclock->retry_delay, vclock->refresh_deadline - now);
+ }
+ vclock->retry_delay = 0;
return PTP_VCLOCK_REFRESH_INTERVAL;
}
@@ -174,12 +214,9 @@ static const struct ptp_clock_info ptp_vclock_info = {
static u64 ptp_vclock_read(const struct cyclecounter *cc)
{
struct ptp_vclock *vclock = cc_to_vclock(cc);
- struct ptp_clock *ptp = vclock->pclock;
- struct timespec64 ts = {};
-
- ptp->info->getcycles64(ptp->info, &ts);
- return timespec64_to_ns(&ts);
+ /* The cyclecounter callback cannot report a failed PHC read. */
+ return vclock->cycles;
}
static const struct cyclecounter ptp_vclock_cc = {
@@ -192,10 +229,11 @@ static const struct cyclecounter ptp_vclock_cc = {
struct ptp_vclock *ptp_vclock_register(struct ptp_clock *pclock)
{
struct ptp_vclock *vclock;
+ int err;
vclock = kzalloc(sizeof(*vclock), GFP_KERNEL);
if (!vclock)
- return NULL;
+ return ERR_PTR(-ENOMEM);
vclock->pclock = pclock;
vclock->info = ptp_vclock_info;
@@ -214,20 +252,29 @@ struct ptp_vclock *ptp_vclock_register(struct ptp_clock *pclock)
mutex_init(&vclock->lock);
+ err = ptp_vclock_sample(vclock);
+ if (err)
+ goto free_vclock;
+ timecounter_init(&vclock->tc, &vclock->cc, 0);
+
vclock->clock = ptp_clock_register(&vclock->info, &pclock->dev);
- if (IS_ERR_OR_NULL(vclock->clock)) {
- kfree(vclock);
- return NULL;
+ if (IS_ERR(vclock->clock)) {
+ err = PTR_ERR(vclock->clock);
+ goto free_vclock;
}
ptp_vclock_set_subclass(vclock->clock);
- timecounter_init(&vclock->tc, &vclock->cc, 0);
- ptp_schedule_worker(vclock->clock, PTP_VCLOCK_REFRESH_INTERVAL);
+ /* The initial sample predates registration; refresh without more delay. */
+ ptp_schedule_worker(vclock->clock, 0);
ptp_vclock_hash_add(vclock);
return vclock;
+
+free_vclock:
+ kfree(vclock);
+ return ERR_PTR(err);
}
void ptp_vclock_unregister(struct ptp_vclock *vclock)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0061/1167] ptp: vclock: serialize extended samples with counter updates
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0060/1167] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0062/1167] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
` (596 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hilliard <james.hilliard1@gmail.com>
[ Upstream commit d3fcce5afe3bb62e8f7a2efb29e43da4fe4ae1f3 ]
The extended and cross-timestamp callbacks sample the physical clock
before taking the virtual clock mutex. A concurrent frequency adjustment
can advance the timecounter and change its multiplier in between, so the
older sample is converted using a different frequency than the one in
effect when it was taken.
Take the mutex before sampling and keep it held through the conversion.
Retain timecounter_cyc2time() and its existing conversion window. A PHC
sample need not advance the counter: for example, e1000e explicitly
allows non-monotonic SYSTIM readings. Treating a slightly older sample
as a forward delta would instead advance virtual time by nearly a full
counter wrap.
This race was found by code inspection of the virtual clock sampling
paths.
Fixes: f0067ebfc42b ("ptp: add gettimex64() to virtual clocks.")
Fixes: 21fad63084c2 ("ptp: add getcrosststamp() to virtual clocks.")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-4-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ptp/ptp_vclock.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/drivers/ptp/ptp_vclock.c b/drivers/ptp/ptp_vclock.c
index d112934351dc9..16c6eca5d2c16 100644
--- a/drivers/ptp/ptp_vclock.c
+++ b/drivers/ptp/ptp_vclock.c
@@ -115,20 +115,18 @@ static int ptp_vclock_gettimex(struct ptp_clock_info *ptp,
struct ptp_clock *pptp = vclock->pclock;
struct timespec64 pts;
int err;
- u64 ns;
-
- err = pptp->info->getcyclesx64(pptp->info, &pts, sts);
- if (err)
- return err;
if (mutex_lock_interruptible(&vclock->lock))
return -EINTR;
- ns = timecounter_cyc2time(&vclock->tc, timespec64_to_ns(&pts));
- mutex_unlock(&vclock->lock);
+ err = pptp->info->getcyclesx64(pptp->info, &pts, sts);
+ if (!err) {
+ u64 ns = timecounter_cyc2time(&vclock->tc, timespec64_to_ns(&pts));
- *ts = ns_to_timespec64(ns);
+ *ts = ns_to_timespec64(ns);
+ }
+ mutex_unlock(&vclock->lock);
- return 0;
+ return err;
}
static int ptp_vclock_settime(struct ptp_clock_info *ptp,
@@ -154,20 +152,18 @@ static int ptp_vclock_getcrosststamp(struct ptp_clock_info *ptp,
struct ptp_vclock *vclock = info_to_vclock(ptp);
struct ptp_clock *pptp = vclock->pclock;
int err;
- u64 ns;
-
- err = pptp->info->getcrosscycles(pptp->info, xtstamp);
- if (err)
- return err;
if (mutex_lock_interruptible(&vclock->lock))
return -EINTR;
- ns = timecounter_cyc2time(&vclock->tc, ktime_to_ns(xtstamp->device));
- mutex_unlock(&vclock->lock);
+ err = pptp->info->getcrosscycles(pptp->info, xtstamp);
+ if (!err) {
+ u64 ns = timecounter_cyc2time(&vclock->tc, ktime_to_ns(xtstamp->device));
- xtstamp->device = ns_to_ktime(ns);
+ xtstamp->device = ns_to_ktime(ns);
+ }
+ mutex_unlock(&vclock->lock);
- return 0;
+ return err;
}
static long ptp_vclock_refresh(struct ptp_clock_info *ptp)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0062/1167] scsi: target: Validate REGISTER AND MOVE TransportID length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0061/1167] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0063/1167] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
` (595 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Jia, Martin K. Petersen (Oracle),
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Jia <physicalmtea@gmail.com>
[ Upstream commit 5d5913710c81eed6fa275b6a24773059d9dbfdfa ]
REGISTER AND MOVE has a 24-byte parameter-list header followed by a
TransportID. A 24-byte parameter list with a zero TransportID length
passes the existing tid_len + 24 check, then the handler reads buf[24] for
the TransportID protocol identifier, one byte past the received parameter
list.
A TransportID is at least 24 bytes. Reject shorter TransportIDs and
compare the declared length with the bytes following the header before
reading buf[24].
A malformed PR OUT sent through vhost-scsi triggered this read on a KASAN
kernel. The command is now rejected with INVALID PARAMETER LIST before
buf[24] is accessed.
Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Link: https://patch.msgid.link/20261021094334.198599-1-physicalmtea@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/target_core_pr.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index 1e2dea10f5bb4..4402b650fbe1f 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -3219,10 +3219,11 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
transport_kunmap_data_sg(cmd);
buf = NULL;
- if ((tid_len + 24) != cmd->data_length) {
- pr_err("SPC-3 PR: Illegal tid_len: %u + 24 byte header"
- " does not equal CDB data_length: %u\n", tid_len,
- cmd->data_length);
+ /* TransportID is at least 24 bytes. buf[24] is its first byte. */
+ if (tid_len < 24 ||
+ tid_len != cmd->data_length - 24) {
+ pr_err("SPC-3 PR: Illegal tid_len: %u for data_length: %u\n",
+ tid_len, cmd->data_length);
ret = TCM_INVALID_PARAMETER_LIST;
goto out_put_pr_reg;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0063/1167] tipc: reject attaching bearer of different media to the same occupied device
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0062/1167] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0064/1167] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
` (594 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiakai Xu, Tung Nguyen,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tung Nguyen <tung.quang.nguyen@est.tech>
[ Upstream commit 0a0257228be902ff09608bcaf19ae7c6d58b028f ]
Currently, two bearers of different media types can be added to the
same device (e.g., "eth:eth0" and "ib:eth0") via tipc command:
tipc bearer enable media eth dev eth0
tipc bearer enable media ib dev eth0
For each command execution, tipc_enable_l2_media() is called:
tipc_enable_l2_media()
dev_get_by_name()
dev_hold()
As a result, device->dev_refcnt is incremented twice, but the second
bearer replaces the first one. This causes a leak in device->dev_refcnt.
Fix this by rejecting a bearer with a different media type when the
device is already occupied.
Fixes: cb30a63384bc ("tipc: refactor function tipc_enable_bearer()")
Reported-by: Jiakai Xu <xujiakai24@mails.ucas.ac.cn>
Closes: http://lore.kernel.org/netdev/20260918013509.1853952-1-xujiakai24@mails.ucas.ac.cn/
Signed-off-by: Tung Nguyen <tung.quang.nguyen@est.tech>
Link: https://patch.msgid.link/20261029030522.8306-1-tung.quang.nguyen@est.tech
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tipc/bearer.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 037b7bde82302..a557b105ed15a 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -285,17 +285,50 @@ static int tipc_enable_bearer(struct net *net, const char *name,
bearer_id = MAX_BEARERS;
i = MAX_BEARERS;
while (i-- != 0) {
+ struct net_device *dev;
+
b = rtnl_dereference(tn->bearer_list[i]);
if (!b) {
bearer_id = i;
continue;
}
if (!strcmp(name, b->name)) {
+duplicate:
errstr = "already enabled";
NL_SET_ERR_MSG(extack, "Already enabled");
goto rejected;
}
+ /* udp media can be used together with any media */
+ if (b->media->type_id == TIPC_MEDIA_TYPE_UDP ||
+ m->type_id == TIPC_MEDIA_TYPE_UDP)
+ goto priority;
+
+ dev = __dev_get_by_name(net, b_names.if_name);
+
+ if (!dev) {
+ res = -ENODEV;
+ errstr = "no device for the media";
+ NL_SET_ERR_MSG(extack, "No device for the media");
+ goto rejected;
+ }
+
+ if (rtnl_dereference(b->media_ptr) == dev) {
+ char *dev_name = strchr((const char *)b->name, ':') + 1;
+
+ /* Not allow altname of occupied device */
+ if (strcmp(dev_name, b_names.if_name) &&
+ b->media->type_id == m->type_id)
+ goto duplicate;
+
+ /* Not allow eth and ib to attach to the same device */
+ errstr = "same dev for different media";
+ NL_SET_ERR_MSG(extack,
+ "Same dev for different media");
+ goto rejected;
+ }
+
+priority:
if (b->priority == prio &&
(++with_this_prio > 2)) {
pr_warn("Bearer <%s>: already 2 bearers with priority %u\n",
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0064/1167] spi: pic32-sqi: fail transfer when the BD ring is exhausted
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0063/1167] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0065/1167] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
` (593 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hongjian Dai, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongjian Dai <daihongjian@kylinsec.com.cn>
[ Upstream commit 2066970324a1439e5a2e08c4599098367f8f82cc ]
pic32_sqi_one_transfer() silently stopped programming buffer descriptors
when ring_desc_get() returned NULL and still returned success. The caller
then marked the last programmed descriptor as the end of the list and
started the DMA engine, so the hardware transferred only a prefix of the
requested data while the message completed with status 0.
The ring holds PESQI_BD_COUNT (256) descriptors of at most
PESQI_BD_BUF_LEN_MAX (256) bytes each, so messages larger than 64 KiB (or
with enough SG entries) can exhaust it. Since the driver sets no
max_message_size/max_transfer_size, the SPI core does not prevent this.
Return -ENOMEM instead, and set msg->status so the failure reaches the
caller rather than being silently truncated.
Fixes: 3270ac230f66 ("spi: pic32-sqi: add SPI driver for PIC32 SQI controller.")
Signed-off-by: Hongjian Dai <daihongjian@kylinsec.com.cn>
Link: https://patch.msgid.link/F5276982A630220B+20261017075545.95854-1-daihongjian@kylinsec.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-pic32-sqi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c
index 883354d0ff526..0044d38b915e2 100644
--- a/drivers/spi/spi-pic32-sqi.c
+++ b/drivers/spi/spi-pic32-sqi.c
@@ -297,7 +297,7 @@ static int pic32_sqi_one_transfer(struct pic32_sqi *sqi,
/* get ring descriptor */
rdesc = ring_desc_get(sqi);
if (!rdesc)
- break;
+ return -ENOMEM;
bd = rdesc->bd;
@@ -387,6 +387,7 @@ static int pic32_sqi_one_message(struct spi_controller *host,
ret = pic32_sqi_one_transfer(sqi, msg, xfer);
if (ret) {
dev_err(&spi->dev, "xfer %p err\n", xfer);
+ msg->status = ret;
goto xfer_out;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0065/1167] bpf: Require prog fd or capability for cgroup detach
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0064/1167] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0066/1167] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
` (592 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 2962329f7c86fc51c177d4049c0f15a95ebd270c ]
Since the commit below a cgroup prog detach does not require CAP_NET_ADMIN.
The fd of the attached prog gives the permission instead. But the detach
requires this fd only with BPF_F_ALLOW_MULTI. Without this flag a cgroup
has only one prog per attach type. Then find_detach_entry() returns this
prog and does not compare it with the prog of the caller. Thus the kernel
detaches this prog for a caller with neither the fd nor a capability.
Compare the two progs. If they are different, require CAP_NET_ADMIN or
CAP_SYS_ADMIN in the initial user namespace. The error is -EPERM. A detach
from tcx or netkit without a prog fd already requires these capabilities.
With BPF_F_ALLOW_MULTI nothing changes.
Without these capabilities, a caller of bpf_prog_detach() of libbpf must
now use bpf_prog_detach2() with the fd of the attached prog.
Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-14-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/cgroup.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 433ecc6579b1a..1fb1831d102ac 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -954,9 +954,14 @@ static struct bpf_prog_list *find_detach_entry(struct hlist_head *progs,
return ERR_PTR(-ENOENT);
/* to maintain backward compatibility NONE and OVERRIDE cgroups
- * allow detaching with invalid FD (prog==NULL) in legacy mode
+ * allow detaching with invalid FD (prog==NULL) in legacy mode.
+ * Without the FD of the attached program the caller needs
+ * CAP_NET_ADMIN or CAP_SYS_ADMIN in the initial user namespace.
*/
- return hlist_entry(progs->first, typeof(*pl), node);
+ pl = hlist_entry(progs->first, typeof(*pl), node);
+ if (pl->prog != prog && !bpf_net_capable())
+ return ERR_PTR(-EPERM);
+ return pl;
}
if (!prog && !link)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0066/1167] bpf, cgroup: Keep the skb network offset signed
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0065/1167] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0067/1167] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
` (591 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 3f9780d62dd1112ca15b5ae73568d29d42ccc950 ]
cgroup_skb progs see a packet from its network header. While they run,
__cgroup_bpf_run_filter_skb() moves skb->data there. It assumes that the
network header is not after skb->data. It negates skb_network_offset(skb)
and pushes skb->data by this offset. The offset is an unsigned int.
But ip6mr_cache_report() and bpf_lwt_xmit_reroute() can pass an skb that
has data before the network header. Then the offset wraps. On a 64-bit
kernel skb->data is then far below skb->head.
skb->len has 32 bits and wraps to the correct value, thus only skb->data is
wrong. A read of packet data faults or gets other memory.
Keep the offset in an int. Pull skb->data when the network header is after
it. Otherwise push it, as today.
Fixes: 3007098494be ("cgroup: add support for eBPF programs")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-15-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/cgroup.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 1fb1831d102ac..0e2e64ce2a630 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -1438,7 +1438,7 @@ int __cgroup_bpf_run_filter_skb(struct sock *sk,
struct sk_buff *skb,
enum cgroup_bpf_attach_type atype)
{
- unsigned int offset = -skb_network_offset(skb);
+ int offset = skb_network_offset(skb);
struct sock *save_sk;
void *saved_data_end;
struct cgroup *cgrp;
@@ -1453,7 +1453,15 @@ int __cgroup_bpf_run_filter_skb(struct sock *sk,
cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
save_sk = skb->sk;
skb->sk = sk;
- __skb_push(skb, offset);
+
+ /*
+ * The program sees the packet from its network header on, on
+ * whichever side of skb->data that header lies.
+ */
+ if (offset > 0)
+ __skb_pull(skb, offset);
+ else
+ __skb_push(skb, -offset);
/* compute pointers for the bpf prog */
bpf_compute_and_save_data_end(skb, &saved_data_end);
@@ -1495,7 +1503,10 @@ int __cgroup_bpf_run_filter_skb(struct sock *sk,
ret = -EFAULT;
}
bpf_restore_data_end(skb, saved_data_end);
- __skb_pull(skb, offset);
+ if (offset > 0)
+ __skb_push(skb, offset);
+ else
+ __skb_pull(skb, -offset);
skb->sk = save_sk;
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0067/1167] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0066/1167] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0068/1167] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
` (590 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 6d8118937ba477e03fa2e94e9bd9abac7291a2a2 ]
When bpf_skb_adjust_room() shrinks a TCP GSO skb, it adds the number of
removed bytes to gso_size. gso_size has 16 bits, and nothing checks the
sum. Thus gso_size can wrap to 0 or to a small size, or it can be
GSO_BY_FRAGS. GSO_BY_FRAGS is not a size. It tells skb_segment() to read
the length of each segment from the frag_list. If the TCP GSO skb has no
frag_list, skb_segment() dereferences a NULL pointer.
Return -ENOTSUPP and do not change the skb if the sum is GSO_BY_FRAGS or
larger. With BPF_F_ADJ_ROOM_FIXED_GSO the helper does not change gso_size,
so it shrinks the skb as before.
Fixes: 2be7e212d541 ("bpf: add bpf_skb_adjust_room helper")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-16-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/core/filter.c b/net/core/filter.c
index 03da8fe9860a8..02419c79b3abb 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3666,6 +3666,14 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff,
return -ENOTSUPP;
}
+ /*
+ * The MSS is raised by len_diff. It has 16 bits, and GSO_BY_FRAGS is
+ * not a size.
+ */
+ if (skb_is_gso(skb) && !(flags & BPF_F_ADJ_ROOM_FIXED_GSO) &&
+ skb_shinfo(skb)->gso_size + len_diff >= GSO_BY_FRAGS)
+ return -ENOTSUPP;
+
ret = skb_unclone(skb, GFP_ATOMIC);
if (unlikely(ret < 0))
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0068/1167] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0067/1167] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0069/1167] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
` (589 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 58e39f8d58b141b96c030008a20dde9d625ec997 ]
The mode BPF_LWT_ENCAP_SEG6 of bpf_lwt_push_encap() pushes an IPv6 header
and an SRH, and it replaces the dst. The SRH says that IPv6 follows, and
skb->protocol does not change. Thus the mode assumes an IPv6 packet, but an
lwt_in prog also runs for IPv4 packets. After the prog, bpf_input() calls
orig_input() of the old dst. This IPv4 handler reads the pushed headers as
IPv4. It can write after the packet data, and the kernel crashes.
after the push orig_input() expects
--------------------- --------------------
skb->protocol ETH_P_IP ETH_P_IP
dst rt6_info rtable
packet | IPv6 | SRH | IPv4 | | IPv4 |
The mode BPF_LWT_ENCAP_SEG6_INLINE returns -EBADMSG for non-IPv6 packets.
Apply this check to both modes. End.BPF does not change, because
seg6_local_input() drops non-IPv6 packets.
Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-17-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 02419c79b3abb..50078e5549d79 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6461,11 +6461,15 @@ static int bpf_push_seg6_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len
if (!seg6_validate_srh(srh, len, false))
return -EINVAL;
+ /*
+ * The encap mode names IPv6 as the inner protocol, and neither mode
+ * updates skb->protocol.
+ */
+ if (skb->protocol != htons(ETH_P_IPV6))
+ return -EBADMSG;
+
switch (type) {
case BPF_LWT_ENCAP_SEG6_INLINE:
- if (skb->protocol != htons(ETH_P_IPV6))
- return -EBADMSG;
-
err = seg6_do_srh_inline(skb, srh);
break;
case BPF_LWT_ENCAP_SEG6:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0069/1167] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0068/1167] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0070/1167] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
` (588 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit ac159f39b252971141c49b68a27de0b637debfad ]
bpf_lwt_seg6_adjust_srh() lets an End.BPF prog change the size of the TLVs
in the SRH. The helper keeps the SRH length in srh_state->hdrlen, in bytes
and without the first 8 bytes. Later seg6_bpf_has_valid_srh() writes it to
srh->hdrlen, an 8-bit field in units of 8 bytes. But srh_state->hdrlen has
no upper limit, and the cast to u8 can truncate it. After that,
seg6_validate_srh() gets the SRH length from srh->hdrlen, and thus it can
accept the SRH. Then srh->hdrlen is too small, and a parser reads TLVs as
the subsequent header.
Return -EFAULT when the new srh_state->hdrlen is larger than 2040, the
largest length that srh->hdrlen can hold. To replace a TLV in the largest
SRH, a prog can no longer add bytes first. It must remove bytes first.
Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-19-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/core/filter.c b/net/core/filter.c
index 50078e5549d79..4b6b45da40400 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6710,6 +6710,9 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
return -EFAULT;
if (unlikely(len < 0 && (void *)((char *)ptr - len) > srh_end))
return -EFAULT;
+ /* The length field of the SRH has 8 bits, in units of 8 bytes. */
+ if (unlikely(len > (U8_MAX << 3) - srh_state->hdrlen))
+ return -EFAULT;
if (len > 0) {
ret = skb_cow_head(skb, len);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0070/1167] bpf: Dont look for the SRH again in the End.BPF helpers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0069/1167] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0071/1167] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
` (587 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 45bcc58d576705d2c001332766e10313f1c55bad ]
A packet can have two SRHs. Thus input_action_end_bpf() uses
IP6_FH_F_SKIP_RH to skip routing headers with segments_left 0. The helpers
bpf_lwt_seg6_store_bytes() and bpf_lwt_seg6_adjust_srh() can reallocate the
head of the skb. Thus they look for the SRH again, but without this flag.
+------------------------+ <- the helpers: srh_state->srh
| SRH 1, segments_left 0 |
+------------------------+ <- input_action_end_bpf(): srh_state->srh
| SRH 2 | and srh_state->hdrlen
+------------------------+
Then the helpers check offset against the wrong limits. If a helper changes
TLVs, seg6_bpf_has_valid_srh() writes the length of SRH 2 to SRH 1.
Neither helper changes the offset of the SRH from skb->data. Calculate the
new address from this offset. To add IP6_FH_F_SKIP_RH is not sufficient,
because advance_nextseg() can set segments_left of SRH 2 to 0. The helper
bpf_lwt_seg6_action() can change the headers and still looks for the SRH.
Fixes: fbbc5bc2ab8c ("seg6: ignore routing header with segments left equal to 0")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-20-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 4b6b45da40400..ab4eafeff72fc 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6558,11 +6558,12 @@ BPF_CALL_4(bpf_lwt_seg6_store_bytes, struct sk_buff *, skb, u32, offset,
this_cpu_ptr(&seg6_bpf_srh_states);
struct ipv6_sr_hdr *srh = srh_state->srh;
void *srh_tlvs, *srh_end, *ptr;
- int srhoff = 0;
+ int srhoff;
if (srh == NULL)
return -EINVAL;
+ srhoff = (unsigned char *)srh - skb->data;
srh_tlvs = (void *)((char *)srh + ((srh->first_segment + 1) << 4));
srh_end = (void *)((char *)srh + sizeof(*srh) + srh_state->hdrlen);
@@ -6575,8 +6576,7 @@ BPF_CALL_4(bpf_lwt_seg6_store_bytes, struct sk_buff *, skb, u32, offset,
if (unlikely(bpf_try_make_writable(skb, offset + len)))
return -EFAULT;
- if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
- return -EINVAL;
+ /* The head may have moved. */
srh_state->srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
memcpy(skb->data + offset, from, len);
@@ -6694,12 +6694,13 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
struct ipv6_sr_hdr *srh = srh_state->srh;
void *srh_end, *srh_tlvs, *ptr;
struct ipv6hdr *hdr;
- int srhoff = 0;
+ int srhoff;
int ret;
if (unlikely(srh == NULL))
return -EINVAL;
+ srhoff = (unsigned char *)srh - skb->data;
srh_tlvs = (void *)((unsigned char *)srh + sizeof(*srh) +
((srh->first_segment + 1) << 4));
srh_end = (void *)((unsigned char *)srh + sizeof(*srh) +
@@ -6731,8 +6732,7 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
hdr = (struct ipv6hdr *)skb->data;
hdr->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
- if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
- return -EINVAL;
+ /* The bytes in front of offset have moved together with skb->data. */
srh_state->srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
srh_state->hdrlen += len;
srh_state->valid = false;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0071/1167] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0070/1167] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0072/1167] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
` (586 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 0fcb3f11a93d740e7f9ae1aeb48fe4d25838be18 ]
bpf_skb_net_hdr_push() and bpf_skb_net_hdr_pop() change skb->data and
skb->mac_header by len. That is correct in a tc prog, where skb->data is
the MAC header. But bpf_lwt_seg6_adjust_srh() calls them in an End.BPF
prog, where skb->data is the network header. The MAC header does not move:
before push | free | MAC header | IPv6 | SRH | payload
^ head ^ mac_header ^ data
today | free | MAC h| IPv6 | SRH + len | payload
^ head ^ mac_header ^ data
this patch | free | MAC header | IPv6 | SRH + len | payload
^ head ^ mac_header ^ data
Users of skb_mac_header() get incorrect bytes until __dev_queue_xmit() sets
skb->mac_header again. skb_cow_head() reserves only len bytes. Thus the
16-bit offset skb->mac_header can wrap. A push also changes the "not set"
value. In both cases skb_mac_header() points after the skb.
Move the MAC header too. Pass len + skb->mac_len to skb_cow_head(). Keep
the "not set" value. The second Fixes tag is for this case. Since that
commit an End.BPF prog can get an skb with skb->mac_header not set.
Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Fixes: 20a081b7984c ("seg6: add VRF support for SRv6 End.DT6 behavior")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-21-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index ab4eafeff72fc..cd1960ec5bee8 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6691,6 +6691,7 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
{
struct seg6_bpf_srh_state *srh_state =
this_cpu_ptr(&seg6_bpf_srh_states);
+ bool mac_set = skb_mac_header_was_set(skb);
struct ipv6_sr_hdr *srh = srh_state->srh;
void *srh_end, *srh_tlvs, *ptr;
struct ipv6hdr *hdr;
@@ -6715,20 +6716,38 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
if (unlikely(len > (U8_MAX << 3) - srh_state->hdrlen))
return -EFAULT;
+ /*
+ * skb->data is the network header here. The MAC header is in front of
+ * it, so bpf_skb_net_hdr_push() and bpf_skb_net_hdr_pop() do not move
+ * it with the other headers.
+ */
if (len > 0) {
- ret = skb_cow_head(skb, len);
+ ret = skb_cow_head(skb, len + skb->mac_len);
if (unlikely(ret < 0))
return ret;
+ /* The push can write over the MAC header, so move it first. */
+ if (mac_set)
+ memmove(skb->data - len - skb->mac_len,
+ skb_mac_header(skb), skb->mac_len);
ret = bpf_skb_net_hdr_push(skb, offset, len);
} else {
ret = bpf_skb_net_hdr_pop(skb, offset, -1 * len);
+ /* The pop has added -len to skb->mac_header. */
+ if (likely(!ret) && mac_set)
+ memmove(skb->data - skb->mac_len,
+ skb_mac_header(skb) + len, skb->mac_len);
}
bpf_compute_data_pointers(skb);
if (unlikely(ret < 0))
return ret;
+ if (mac_set)
+ skb_set_mac_header(skb, -skb->mac_len);
+ else
+ skb_unset_mac_header(skb);
+
hdr = (struct ipv6hdr *)skb->data;
hdr->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0072/1167] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0071/1167] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0073/1167] ipv4: Unmask upper DSCP bits in input route lookup Greg Kroah-Hartman
` (585 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 701ffd202b9e32942c8cfc065c9fe76ceaccc302 ]
With BPF_LWT_ENCAP_IP, bpf_lwt_push_encap() pushes a new IP header. The new
header overwrites the MAC header of a received skb. But skb->mac_header
continues to point to the same bytes. Code that reads the MAC header after
the push, for example netfilter, gets bytes of the new header.
before the push | MAC header | old IP | payload
^ mac_header ^ network_header
today | new header | old IP | payload
network_header ^ ^ mac_header
this patch, lwt_in | MAC header | new header | old IP | payload
^ mac_header ^ network_header
this patch, lwt_xmit | new header | old IP | payload
network_header ^ mac_header is not set
For lwt_in, move the MAC header in front of the new header before the
memcpy(), as __seg6_do_srh_encap() does. skb_cow_head() already reserves
len + skb->mac_len bytes.
For lwt_xmit, the output path makes a new MAC header. Thus mark
skb->mac_header as not set. This is the state of a locally generated skb.
Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-22-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/lwt_bpf.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 8c83b34ed58af..87a892c1a587b 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -640,6 +640,14 @@ int bpf_lwt_push_ip_encap(struct sk_buff *skb, void *hdr, u32 len, bool ingress)
if (ingress)
skb_postpush_rcsum(skb, iph, len);
skb_reset_network_header(skb);
+ /*
+ * The new header goes over the MAC header. On ingress move it first.
+ * On egress the packet gets a new one, so forget the old one.
+ */
+ if (ingress)
+ skb_mac_header_rebuild(skb);
+ else
+ skb_unset_mac_header(skb);
if (is_udp_tunnel) {
size_t iph_sz = ipv4 ? iph->ihl * 4 : sizeof(struct ipv6hdr);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0073/1167] ipv4: Unmask upper DSCP bits in input route lookup
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0072/1167] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0074/1167] ipv4: Convert ip_route_input_noref() to dscp_t Greg Kroah-Hartman
` (584 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ido Schimmel, Guillaume Nault,
Florian Westphal, David Ahern, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <idosch@nvidia.com>
[ Upstream commit df9131c7fafdc0d4c85686f5c7711a4dd4f3ae60 ]
Unmask the upper DSCP bits in input route lookup so that in the future
the lookup could be performed according to the full DSCP value.
No functional changes intended since the upper DSCP bits are masked when
comparing against the TOS selectors in FIB rules and routes.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Acked-by: Florian Westphal <fw@strlen.de>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20240821125251.1571445-9-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: b3ad42f61832 ("bpf: Reset skb->cb after an lwt prog pushes an IP header")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 0b63f10bed8da..d163ae06cf8c6 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2549,7 +2549,7 @@ int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,
struct fib_result res;
int err;
- tos &= IPTOS_RT_MASK;
+ tos &= INET_DSCP_MASK;
rcu_read_lock();
err = ip_route_input_rcu(skb, daddr, saddr, tos, dev, &res);
rcu_read_unlock();
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0074/1167] ipv4: Convert ip_route_input_noref() to dscp_t.
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0073/1167] ipv4: Unmask upper DSCP bits in input route lookup Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0075/1167] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
` (583 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guillaume Nault, David Ahern,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <gnault@redhat.com>
[ Upstream commit 66fb6386d358a04edd5c640e38b4a02b323b89d8 ]
Pass a dscp_t variable to ip_route_input_noref(), instead of a plain
u8, to prevent accidental setting of ECN bits in ->flowi4_tos.
Callers of ip_route_input_noref() to consider are:
* arp_process() in net/ipv4/arp.c. This function sets the tos
parameter to 0, which is already a valid dscp_t value, so it
doesn't need to be adjusted for the new prototype.
* ip_route_input(), which already has a dscp_t variable to pass as
parameter. We just need to remove the inet_dscp_to_dsfield()
conversion.
* ipvlan_l3_rcv(), bpf_lwt_input_reroute(), ip_expire(),
ip_rcv_finish_core(), xfrm4_rcv_encap_finish() and
xfrm4_rcv_encap(), which get the DSCP directly from IPv4 headers
and can simply use the ip4h_dscp() helper.
While there, declare the IPv4 header pointers as const in
ipvlan_l3_rcv() and bpf_lwt_input_reroute().
Also, modify the declaration of ip_route_input_noref() in
include/net/route.h so that it matches the prototype of its
implementation in net/ipv4/route.c.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/a8a747bed452519c4d0cc06af32c7e7795d7b627.1727807926.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: b3ad42f61832 ("bpf: Reset skb->cb after an lwt prog pushes an IP header")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ipvlan/ipvlan_l3s.c | 6 ++++--
include/net/route.h | 7 +++----
net/core/lwt_bpf.c | 5 +++--
net/ipv4/ip_fragment.c | 4 ++--
net/ipv4/ip_input.c | 2 +-
net/ipv4/route.c | 6 +++---
net/ipv4/xfrm4_input.c | 2 +-
net/ipv4/xfrm4_protocol.c | 2 +-
8 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_l3s.c b/drivers/net/ipvlan/ipvlan_l3s.c
index ca35a50bb6405..7c017fe35522a 100644
--- a/drivers/net/ipvlan/ipvlan_l3s.c
+++ b/drivers/net/ipvlan/ipvlan_l3s.c
@@ -2,6 +2,8 @@
/* Copyright (c) 2014 Mahesh Bandewar <maheshb@google.com>
*/
+#include <net/ip.h>
+
#include "ipvlan.h"
static unsigned int ipvlan_netid __read_mostly;
@@ -48,11 +50,11 @@ static struct sk_buff *ipvlan_l3_rcv(struct net_device *dev,
switch (proto) {
case AF_INET:
{
- struct iphdr *ip4h = ip_hdr(skb);
+ const struct iphdr *ip4h = ip_hdr(skb);
int err;
err = ip_route_input_noref(skb, ip4h->daddr, ip4h->saddr,
- ip4h->tos, sdev);
+ ip4h_dscp(ip4h), sdev);
if (unlikely(err))
goto out;
break;
diff --git a/include/net/route.h b/include/net/route.h
index 7f37b8b96c920..9a634104b9bf9 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -187,8 +187,8 @@ static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4
int ip_mc_validate_source(struct sk_buff *skb, __be32 daddr, __be32 saddr,
u8 tos, struct net_device *dev,
struct in_device *in_dev, u32 *itag);
-int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src,
- u8 tos, struct net_device *devin);
+int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,
+ dscp_t dscp, struct net_device *dev);
int ip_route_use_hint(struct sk_buff *skb, __be32 dst, __be32 src,
u8 tos, struct net_device *devin,
const struct sk_buff *hint);
@@ -199,8 +199,7 @@ static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src,
int err;
rcu_read_lock();
- err = ip_route_input_noref(skb, dst, src, inet_dscp_to_dsfield(dscp),
- devin);
+ err = ip_route_input_noref(skb, dst, src, dscp, devin);
if (!err) {
skb_dst_force(skb);
if (!skb_dst(skb))
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 87a892c1a587b..ed5bafe584128 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -10,6 +10,7 @@
#include <linux/bpf.h>
#include <net/lwtunnel.h>
#include <net/gre.h>
+#include <net/ip.h>
#include <net/ip6_route.h>
#include <net/ipv6_stubs.h>
@@ -89,12 +90,12 @@ static int bpf_lwt_input_reroute(struct sk_buff *skb)
if (skb->protocol == htons(ETH_P_IP)) {
struct net_device *dev = skb_dst(skb)->dev;
- struct iphdr *iph = ip_hdr(skb);
+ const struct iphdr *iph = ip_hdr(skb);
dev_hold(dev);
skb_dst_drop(skb);
err = ip_route_input_noref(skb, iph->daddr, iph->saddr,
- iph->tos, dev);
+ ip4h_dscp(iph), dev);
dev_put(dev);
} else if (skb->protocol == htons(ETH_P_IPV6)) {
skb_dst_drop(skb);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 0dd8baacc0c89..e9f3dd9880d0f 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -168,8 +168,8 @@ static void ip_expire(struct timer_list *t)
/* skb has no dst, perform route lookup again */
iph = ip_hdr(head);
- err = ip_route_input_noref(head, iph->daddr, iph->saddr,
- iph->tos, head->dev);
+ err = ip_route_input_noref(head, iph->daddr, iph->saddr, ip4h_dscp(iph),
+ head->dev);
if (err)
goto out;
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 5e9c8156656a7..94eaa6611772a 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -363,7 +363,7 @@ static int ip_rcv_finish_core(struct net *net, struct sock *sk,
*/
if (!skb_valid_dst(skb)) {
err = ip_route_input_noref(skb, iph->daddr, iph->saddr,
- iph->tos, dev);
+ ip4h_dscp(iph), dev);
if (unlikely(err))
goto drop_error;
} else {
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d163ae06cf8c6..dc141635d4e0a 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2544,14 +2544,14 @@ static int ip_route_input_rcu(struct sk_buff *skb, __be32 daddr, __be32 saddr,
}
int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,
- u8 tos, struct net_device *dev)
+ dscp_t dscp, struct net_device *dev)
{
struct fib_result res;
int err;
- tos &= INET_DSCP_MASK;
rcu_read_lock();
- err = ip_route_input_rcu(skb, daddr, saddr, tos, dev, &res);
+ err = ip_route_input_rcu(skb, daddr, saddr, inet_dscp_to_dsfield(dscp),
+ dev, &res);
rcu_read_unlock();
return err;
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c
index 94fbcf4879fe6..c2f22d4f55fdf 100644
--- a/net/ipv4/xfrm4_input.c
+++ b/net/ipv4/xfrm4_input.c
@@ -31,7 +31,7 @@ static inline int xfrm4_rcv_encap_finish(struct net *net, struct sock *sk,
const struct iphdr *iph = ip_hdr(skb);
if (ip_route_input_noref(skb, iph->daddr, iph->saddr,
- iph->tos, skb->dev))
+ ip4h_dscp(iph), skb->dev))
goto drop;
}
diff --git a/net/ipv4/xfrm4_protocol.c b/net/ipv4/xfrm4_protocol.c
index b146ce88c5d0c..4ee624d8e66fc 100644
--- a/net/ipv4/xfrm4_protocol.c
+++ b/net/ipv4/xfrm4_protocol.c
@@ -76,7 +76,7 @@ int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
const struct iphdr *iph = ip_hdr(skb);
if (ip_route_input_noref(skb, iph->daddr, iph->saddr,
- iph->tos, skb->dev))
+ ip4h_dscp(iph), skb->dev))
goto drop;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0075/1167] bpf: Reset skb->cb after an lwt prog pushes an IP header
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0074/1167] ipv4: Convert ip_route_input_noref() to dscp_t Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0076/1167] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
` (582 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Daniel Borkmann,
Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit b3ad42f6183286ab376389a5d26edf7ee3bdba27 ]
IPCB(skb)->opt holds the offsets from the network header to the IPv4
options. But bpf_lwt_push_ip_encap() moves the network header and does not
change IPCB(skb). Then ip_forward_options() and __ip_options_echo() use the
old offsets on the pushed header. Thus the kernel corrupts the skb and the
stack. If the family changes, the kernel also reads IP6CB(skb) as
IPCB(skb), or the reverse. With CONFIG_IPV6_MIP6, it reads IPSKB_FORWARDED
as frag_max_size and adds a needless fragment header.
Reset skb->cb after the prog. bpf_lwt_push_ip_encap() cannot do it, because
bpf_prog_run_save_cb() can restore skb->cb. For IPv4 in IPv4, clear
IPCB(skb)->opt as ip_tunnel_xmit() does. If the family changes, clear the
cb of the new family but keep iif, because ip6_forward() gets the input
device from it. Behind a VRF, skb->skb_iif is the VRF device and cannot
replace iif. Do nothing for IPv6 in IPv6, as in seg6_do_srh_encap().
Do the reset in bpf_input() only after a push. Without a push,
ip_forward_options() needs the offsets. Do it in bpf_xmit() before each
reroute, because an lwt_xmit prog can also change the options. Thus after a
reroute without a push, ip_options_fragment() leaves the options in all
fragments, and ICMP errors echo none. After BPF_OK or BPF_REDIRECT the skb
goes to a device, thus bpf_xmit() does no reset. The inner IPv4 checksum
can still be wrong after ip_rcv_options() changes an option.
Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap")
Reported-by: Xiang Mei <xmei5@asu.edu>
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-23-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/lwt_bpf.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index ed5bafe584128..fde1b4a2f4aac 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -84,6 +84,32 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt,
return ret;
}
+/*
+ * skb->cb still describes the IP header that was the first one before the
+ * prog ran. The option offsets in IPCB(skb)->opt are wrong for a pushed
+ * header, and a header of the other family needs the other layout. iif
+ * stays: behind a VRF skb->skb_iif is the L3 master and not the port.
+ * bpf_lwt_push_encap() cannot do this, because bpf_prog_run_save_cb() can
+ * restore skb->cb after the prog.
+ */
+static void bpf_lwt_reset_cb(struct sk_buff *skb, __be16 proto)
+{
+ int iif;
+
+ if (skb->protocol == proto) {
+ if (proto == htons(ETH_P_IP))
+ memset(&IPCB(skb)->opt, 0, sizeof(IPCB(skb)->opt));
+ } else if (skb->protocol == htons(ETH_P_IP)) {
+ iif = IP6CB(skb)->iif;
+ memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
+ IPCB(skb)->iif = iif;
+ } else {
+ iif = IPCB(skb)->iif;
+ memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
+ IP6CB(skb)->iif = iif;
+ }
+}
+
static int bpf_lwt_input_reroute(struct sk_buff *skb)
{
int err = -EINVAL;
@@ -116,6 +142,8 @@ static int bpf_lwt_input_reroute(struct sk_buff *skb)
static int bpf_input(struct sk_buff *skb)
{
struct dst_entry *dst = skb_dst(skb);
+ __be16 proto = skb->protocol;
+ unsigned int len = skb->len;
struct bpf_lwt *bpf;
int ret;
@@ -124,6 +152,9 @@ static int bpf_input(struct sk_buff *skb)
ret = run_lwt_bpf(skb, &bpf->in, dst, NO_REDIRECT);
if (ret < 0)
return ret;
+ /* An lwt_in prog can change the length only with a push. */
+ if (skb->len != len)
+ bpf_lwt_reset_cb(skb, proto);
if (ret == BPF_LWT_REROUTE)
return bpf_lwt_input_reroute(skb);
}
@@ -303,6 +334,8 @@ static int bpf_xmit(struct sk_buff *skb)
case BPF_REDIRECT:
return LWTUNNEL_XMIT_DONE;
case BPF_LWT_REROUTE:
+ /* An lwt_xmit prog can also write to the options. */
+ bpf_lwt_reset_cb(skb, proto);
return bpf_lwt_xmit_reroute(skb);
default:
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0076/1167] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0075/1167] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0077/1167] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
` (581 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit d9618a6196953718f7470de5d2e84121bed063f7 ]
When an lwt_in prog returns BPF_OK, bpf_input() calls orig_input(), the
input handler of the route. This handler is for one IP version and needs a
dst of the same family. But BPF_LWT_ENCAP_IP lets the prog push a header of
the other IP version and thus change skb->protocol. Then the handler reads
and changes a header of the other IP version. The push of an SRH also
replaces the dst, because seg6_lookup_nexthop() puts an rt6_info into the
skb. Then ip_forward() uses the rt6_info as a struct rtable.
Drop the skb with -EINVAL when skb->protocol changes, as bpf_xmit() does.
Drop it also when the family of the dst changes, because skb->protocol does
not always show this change. Today no such skb leaves as the prog made it.
A prog works as before if it returns BPF_LWT_REROUTE, or if it pushes an
SRH on an IPv6 route.
The commit in the first Fixes tag lets a prog change skb->protocol. The
commit in the second tag adds the check to bpf_xmit() only.
Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap")
Fixes: 3bd0b15281af ("bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-24-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/lwt_bpf.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index fde1b4a2f4aac..87fae6fdeeba8 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -157,6 +157,16 @@ static int bpf_input(struct sk_buff *skb)
bpf_lwt_reset_cb(skb, proto);
if (ret == BPF_LWT_REROUTE)
return bpf_lwt_input_reroute(skb);
+ /*
+ * orig_input() is for the old protocol only, see bpf_xmit().
+ * It also needs a dst of the old family. BPF_LWT_ENCAP_SEG6
+ * puts an IPv6 dst into the skb.
+ */
+ if (skb->protocol != proto ||
+ skb_dst(skb)->ops->family != dst->ops->family) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
}
if (unlikely(!dst->lwtstate->orig_input)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0077/1167] bpf: Move the transport header with the moved headers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0076/1167] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0078/1167] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
` (580 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit a9d08fe60fa728ce0e3a99085241e8e790fb14c6 ]
bpf_skb_net_hdr_pop() removes len bytes at offset off.
bpf_skb_net_hdr_push() does the opposite.
skb->data off
before | A | removed | B |
after | A | B |
skb->data off
mac_header and network_header move with A. transport_header moves only when
it is equal to network_header. inner_transport_header never moves. This is
correct only for a header in B. In bpf_lwt_seg6_adjust_srh()
transport_header is in A. bpf_skb_adjust_room() can remove both transport
headers. With an incorrect header offset, the stack can drop the skb or
read outside of it.
Also move transport_header with A when it is in A. Set it to offset off
when it is in the removed bytes. In BPF_ADJ_ROOM_MAC mode it is then equal
to network_header. Do not unset it, because skb_gso_validate_mac_len() uses
it without a check. After a removal, set inner_transport_header to off when
it is not in B and skb->encapsulation is set. A has only outer headers.
Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Fixes: 868d523535c2 ("bpf: add bpf_skb_adjust_room encap flags")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-26-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 37 +++++++++++++++++++++++++++++++------
1 file changed, 31 insertions(+), 6 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index cd1960ec5bee8..d013cfa1e4857 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3328,9 +3328,25 @@ static int bpf_skb_generic_pop(struct sk_buff *skb, u32 off, u32 len)
return 0;
}
+/*
+ * bpf_skb_net_hdr_push() inserts bytes at @off, bpf_skb_net_hdr_pop() removes
+ * bytes at @off. Both move the bytes in front of @off together with skb->data,
+ * and leave the rest of the packet where it is. Return true if the transport
+ * header is in the part that moves. A transport header that is equal to the
+ * network header stays equal to it.
+ */
+static bool bpf_skb_trans_hdr_moves(const struct sk_buff *skb, u32 off)
+{
+ if (skb->transport_header == skb->network_header)
+ return true;
+
+ return skb_transport_header_was_set(skb) &&
+ (u32)skb_transport_offset(skb) < off;
+}
+
static int bpf_skb_net_hdr_push(struct sk_buff *skb, u32 off, u32 len)
{
- bool trans_same = skb->transport_header == skb->network_header;
+ bool trans_moves = bpf_skb_trans_hdr_moves(skb, off);
int ret;
/* There's no need for __skb_push()/__skb_pull() pair to
@@ -3341,8 +3357,8 @@ static int bpf_skb_net_hdr_push(struct sk_buff *skb, u32 off, u32 len)
if (likely(!ret)) {
skb->mac_header -= len;
skb->network_header -= len;
- if (trans_same)
- skb->transport_header = skb->network_header;
+ if (trans_moves)
+ skb->transport_header -= len;
}
return ret;
@@ -3350,7 +3366,7 @@ static int bpf_skb_net_hdr_push(struct sk_buff *skb, u32 off, u32 len)
static int bpf_skb_net_hdr_pop(struct sk_buff *skb, u32 off, u32 len)
{
- bool trans_same = skb->transport_header == skb->network_header;
+ bool trans_moves = bpf_skb_trans_hdr_moves(skb, off);
int ret;
/* Same here, __skb_push()/__skb_pull() pair not needed. */
@@ -3358,8 +3374,17 @@ static int bpf_skb_net_hdr_pop(struct sk_buff *skb, u32 off, u32 len)
if (likely(!ret)) {
skb->mac_header += len;
skb->network_header += len;
- if (trans_same)
- skb->transport_header = skb->network_header;
+ if (trans_moves) {
+ skb->transport_header += len;
+ } else if (skb_transport_header_was_set(skb) &&
+ skb_transport_offset(skb) < (int)off) {
+ /* It was in the removed bytes or before skb->data. */
+ skb_set_transport_header(skb, off);
+ }
+ /* Do not leave the inner transport header in front of @off. */
+ if (skb->encapsulation &&
+ skb_inner_transport_offset(skb) < (int)off)
+ skb_set_inner_transport_header(skb, off);
}
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0078/1167] bpf: Check the offset in bpf_skb_generic_{push,pop}()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0077/1167] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0079/1167] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
` (579 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit ee36c9aa44ef300cd651074bd97552b229337f85 ]
To make room for len bytes at offset off, bpf_skb_generic_push() moves the
first off bytes and clears len bytes after them. It assumes that the first
off bytes are in the linear part. But in bpf_skb_adjust_room() off can be
the end of the IP header, and this header can be in a frag. Then the
function reads and writes after skb->tail, and can damage skb_shared_info.
bpf_skb_generic_pop() checks off + len, but this u32 sum can wrap to a
small value. bpf_skb_adjust_room() and bpf_skb_change_proto() calculate off
from skb_mac_header_len(). This length is a very large u32 when
network_header < mac_header. Then the check can pass, and memmove() reads
and writes far outside the skb.
Return -ENOMEM from both functions, like the present check, when
off > skb->len. Thus the sum cannot wrap. In bpf_skb_generic_push() also
pull the first off bytes into the linear part. Now bpf_skb_adjust_room()
fails when a prog grows an skb that ends before off. network_header stays
wrong.
Fixes: 6578171a7ff0 ("bpf: add bpf_skb_change_proto helper")
Fixes: 2be7e212d541 ("bpf: add bpf_skb_adjust_room helper")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-28-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index d013cfa1e4857..34713be30ac5a 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3295,6 +3295,10 @@ static void bpf_skb_change_protocol(struct sk_buff *skb, u16 proto)
static int bpf_skb_generic_push(struct sk_buff *skb, u32 off, u32 len)
{
+ /* The bytes in front of @off are moved with skb->data. */
+ if (unlikely(off > skb->len || !pskb_may_pull(skb, off)))
+ return -ENOMEM;
+
/* Caller already did skb_cow() with meta_len+len as headroom,
* so no need to do it here.
*/
@@ -3315,9 +3319,10 @@ static int bpf_skb_generic_pop(struct sk_buff *skb, u32 off, u32 len)
void *old_data;
/* skb_ensure_writable() is not needed here, as we're
- * already working on an uncloned skb.
+ * already working on an uncloned skb. The first test
+ * keeps off + len from wrapping.
*/
- if (unlikely(!pskb_may_pull(skb, off + len)))
+ if (unlikely(off > skb->len || !pskb_may_pull(skb, off + len)))
return -ENOMEM;
old_data = skb->data;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0079/1167] spi: Fix ACPI SPI resources using relative path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0078/1167] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0080/1167] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
` (578 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alban Bedel, Mark Brown, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alban Bedel <alban.bedel@lht.dlh.de>
[ Upstream commit 4825287f6d2346e9273f35a928d1ef40e68bc58b ]
ACPI resources can use relative path when pointing to other
resources. This didn't work with SPISerialBus resources because the
device defining the resource was not passed to acpi_get_handle().
Pass the ACPI device handle through the lookup context to also allow
for relative paths.
Signed-off-by: Alban Bedel <alban.bedel@lht.dlh.de>
Link: https://patch.msgid.link/20261001153507.2011806-1-alban.bedel@lht.dlh.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 2d0953ab69d3 ("spi: acpi: only look up the IRQ of confirmed SPI devices")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9681b05e0d5b6..9cc5371326104 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2468,6 +2468,7 @@ EXPORT_SYMBOL_GPL(spi_new_ancillary_device);
#ifdef CONFIG_ACPI
struct acpi_spi_lookup {
struct spi_controller *ctlr;
+ acpi_handle device_handle;
u32 max_speed_hz;
u32 mode;
int irq;
@@ -2564,7 +2565,7 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
if (lookup->index != -1 && lookup->n++ != lookup->index)
return 1;
- status = acpi_get_handle(NULL,
+ status = acpi_get_handle(lookup->device_handle,
sb->resource_source.string_ptr,
&parent_handle);
@@ -2656,6 +2657,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
return ERR_PTR(-EINVAL);
lookup.ctlr = ctlr;
+ lookup.device_handle = acpi_device_handle(adev);
lookup.irq = -1;
lookup.index = index;
lookup.n = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0080/1167] spi: acpi: only look up the IRQ of confirmed SPI devices
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0079/1167] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0081/1167] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
` (577 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rosen Penev, Mark Brown, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 2d0953ab69d316589624b0517fdce01f8e630bf0 ]
When an SPI controller is registered, acpi_register_spi_device() is
called for every present ACPI device in the namespace and
acpi_spi_device_alloc() walks each device's _CRS. While doing so,
acpi_spi_add_resource() converts the first interrupt resource it finds,
even for devices that have no SpiSerialBus resource at all and are
discarded right afterwards. Converting an interrupt resource registers
its GSI, so this maps IRQs for arbitrary unrelated ACPI devices.
On a Dell Precision M4800 (Lynx Point, 24-pin IOAPIC) the DSDT reports
Haswell-ULT LPSS child devices (\_SB.PCI0.I2C0.ACD0 and
\_SB.PCI0.SDHC.WI01) as present with interrupts on GSI 37 and 38.
Registering the intel-spi controller then results in:
ERROR: Unable to locate IOAPIC for GSI 37
ERROR: Unable to locate IOAPIC for GSI 38
Do what the I2C core does and only parse the interrupt resource once the
device has been identified as an SPI device on this controller.
Fixes: 4c3c59544f33 ("spi/acpi: enumerate all SPI slaves in the namespace")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20261101200155.15740-1-rosenp@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi.c | 36 ++++++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9cc5371326104..aa594133e26fd 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2471,7 +2471,6 @@ struct acpi_spi_lookup {
acpi_handle device_handle;
u32 max_speed_hz;
u32 mode;
- int irq;
u8 bits_per_word;
u8 chip_select;
int n;
@@ -2616,17 +2615,25 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
if (sb->device_polarity == ACPI_SPI_ACTIVE_HIGH)
lookup->mode |= SPI_CS_HIGH;
}
- } else if (lookup->irq < 0) {
- struct resource r;
-
- if (acpi_dev_resource_interrupt(ares, 0, &r))
- lookup->irq = r.start;
}
/* Always tell the ACPI core to skip this resource */
return 1;
}
+static int acpi_spi_add_irq_resource(struct acpi_resource *ares, void *data)
+{
+ int *irq = data;
+ struct resource r;
+
+ if (*irq < 0 && ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS &&
+ acpi_dev_resource_interrupt(ares, 0, &r))
+ *irq = r.start;
+
+ /* Always tell the ACPI core to skip this resource */
+ return 1;
+}
+
/**
* acpi_spi_device_alloc - Allocate a spi device, and fill it in with ACPI information
* @ctlr: controller to which the spi device belongs
@@ -2651,6 +2658,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
struct list_head resource_list;
struct acpi_spi_lookup lookup = {};
struct spi_device *spi;
+ int irq = -1;
int ret;
if (!ctlr && index == -1)
@@ -2658,7 +2666,6 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
lookup.ctlr = ctlr;
lookup.device_handle = acpi_device_handle(adev);
- lookup.irq = -1;
lookup.index = index;
lookup.n = 0;
@@ -2681,6 +2688,19 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
if (!lookup.max_speed_hz)
return ERR_PTR(-ENODEV);
+ /*
+ * Only look up the IRQ once we know this is an SPI device for us.
+ * Parsing an interrupt resource maps its GSI, which must not be done
+ * for every unrelated ACPI device walked during enumeration.
+ */
+ INIT_LIST_HEAD(&resource_list);
+ ret = acpi_dev_get_resources(adev, &resource_list,
+ acpi_spi_add_irq_resource, &irq);
+ if (ret < 0)
+ return ERR_PTR(ret);
+
+ acpi_dev_free_resource_list(&resource_list);
+
spi = spi_alloc_device(lookup.ctlr);
if (!spi) {
dev_err(&lookup.ctlr->dev, "failed to allocate SPI device for %s\n",
@@ -2691,7 +2711,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
ACPI_COMPANION_SET(&spi->dev, adev);
spi->max_speed_hz = lookup.max_speed_hz;
spi->mode |= lookup.mode;
- spi->irq = lookup.irq;
+ spi->irq = irq;
spi->bits_per_word = lookup.bits_per_word;
spi_set_chipselect(spi, 0, lookup.chip_select);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0081/1167] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0080/1167] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0082/1167] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
` (576 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuqiang Sun, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuqiang Sun <izaiahsun@gmail.com>
[ Upstream commit 5e96760b25fdedbbf9312827f1f237d6b18b03e8 ]
When an LWT xmit program returns BPF_OK, bpf_xmit() makes sure that
the skb still has room for the link layer header. If
pskb_expand_head() fails there, bpf_xmit() returns -ENOMEM without
freeing the skb. Its callers, lwtunnel_xmit() and then
ip_finish_output2() or ip6_finish_output2(), take any return value
other than LWTUNNEL_XMIT_CONTINUE to mean that the skb has been
consumed, so nothing frees it.
Each such failure leaks the skb, together with what it holds: its dst
and its charge to the sending socket, so the socket is never freed
either. The other error paths of bpf_xmit() (BPF_DROP, an illegal
return code, a changed protocol, a failed reroute) all free the skb.
Free it here too.
The leak was found with kbound, a static analysis prototype for
ownership mismatches at kernel interfaces, on v7.2.12; it is present in
mainline.
Build-tested with x86_64 and arm64 allmodconfig (W=1, sparse): no new
warnings. Run-tested on QEMU (x86_64, KVM) with KASAN: a route through a
dummy device with an LWT xmit program that pushes one byte with
bpf_skb_change_head(), so the headroom check has to expand the head, and
failslab limited to allocations under bpf_xmit(). Each of 10 pings then
fails with ENOMEM. Without this patch each leaves a raw socket behind
(RAW slab objects 6 -> 16); with it none does (6 -> 6), and nothing else
is reported. Without injection both kernels go from 6 to 6.
Fixes: 3a0af8fd61f9 ("bpf: BPF for lightweight tunnel infrastructure")
Signed-off-by: Yuqiang Sun <izaiahsun@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101182343.17991-1-izaiahsun@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/lwt_bpf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 87fae6fdeeba8..14d76b527e134 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -337,8 +337,10 @@ static int bpf_xmit(struct sk_buff *skb)
* made before LWT xmit.
*/
ret = xmit_check_headroom(skb, hroom);
- if (unlikely(ret))
+ if (unlikely(ret)) {
+ kfree_skb(skb);
return ret;
+ }
return LWTUNNEL_XMIT_CONTINUE;
case BPF_REDIRECT:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0082/1167] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0081/1167] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0083/1167] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
` (575 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
Simon Horman, Dave Miller, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joas Antonio dos Santos <joasantonio108@gmail.com>
[ Upstream commit 902407bc588575af0ceae5de4f635fe1e024f258 ]
macsec_fs_id_del() removes a struct mlx5_fs_id from its rhashtable with
rhashtable_remove_fast() and then frees it with kfree() right away.
The TX (SCI) table is read locklessly from the transmit path:
mlx5e_macsec_handle_tx_skb() and mlx5e_macsec_tx_build_eseg() call
mlx5_macsec_fs_get_fs_id_from_hashtable(), which does
rhashtable_lookup() under rcu_read_lock() and then reads
mlx5_fs_id->id. A transmit that looked the entry up just before it was
removed reads freed memory.
Before commit d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec
device inside macsec steering") the SCI table held struct
mlx5e_macsec_sa directly, and mlx5e_macsec_del_txsa() freed it with
kfree_rcu_mightsleep(). That commit moved the table into macsec_fs.c
with the new struct mlx5_fs_id, but frees it with a plain kfree().
Add an rcu_head to struct mlx5_fs_id and free it with kfree_rcu().
The same issue was flagged by the Sashiko AI review as a pre-existing
problem while reviewing the HW-GRO for PSP series.
Fixes: d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering")
Link: https://lore.kernel.org/all/20260909065542.4B80D1F00ACA@smtp.kernel.org/
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Assisted-by: Yaga Agent HackerSec Claude:claude-opus-5-5
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
index 4a078113e292d..3d2473d9f3eac 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
@@ -98,6 +98,7 @@ struct mlx5_fs_id {
refcount_t refcnt;
sci_t sci;
struct rhash_head hash;
+ struct rcu_head rcu;
};
struct mlx5_macsec_device {
@@ -688,7 +689,7 @@ static void macsec_fs_id_del(struct list_head *macsec_devices_list, u32 fs_id,
xa_erase(fs_id_xa, fs_id);
- kfree(fs_id_found);
+ kfree_rcu(fs_id_found, rcu);
if (macsec_fs_is_macsec_device_empty(macsec_device)) {
list_del(&macsec_device->macsec_devices_list_entry);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0083/1167] tcp: do not let tcp_collapse() drive sk_forward_alloc negative
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0082/1167] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0084/1167] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
` (574 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Octavian Purdila, Dave Miller, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 031c403d13e5046750e2abebd4e770631e7c4627 ]
tcp_collapse() charges each newly allocated skb with skb_set_owner_r()
before the skbs it replaces are freed, without scheduling memory first.
Since sk_mem_uncharge() reclaims eagerly, sk->sk_forward_alloc has no
cushion and can become negative. This can be durable when the collapsed
skbs had a high payload/truesize ratio or were partially read, because
the new skbs can have a bigger total truesize than the old ones.
A negative sk_forward_alloc then confuses tcp_wmem_schedule(), which
can return a negative length to tcp_sendmsg_locked(), triggering
a WARN_ON_ONCE(bytes > INT_MAX) in check_copy_size().
Call sk_forced_mem_schedule() before charging nskb.
Fixes: 4890b686f408 ("net: keep sk->sk_forward_alloc as small as possible")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Octavian Purdila <tavip@google.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_input.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e911ad30d9a75..87a721a5b70d4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5422,6 +5422,10 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list, struct rb_root *root,
__skb_queue_before(list, skb, nskb);
else
__skb_queue_tail(&tmp, nskb); /* defer rbtree insertion */
+ /* nskb is charged before the skbs it replaces are freed.
+ * Make sure sk->sk_forward_alloc can not become negative.
+ */
+ sk_forced_mem_schedule(sk, nskb->truesize);
skb_set_owner_r(nskb, sk);
mptcp_skb_ext_move(nskb, skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0084/1167] ata: libata-sata: allow re-enabling NCQ with the same queue_depth
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0083/1167] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0085/1167] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
` (573 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Pylypiv, Niklas Cassel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Pylypiv <ipylypiv@google.com>
[ Upstream commit d7c5cc8cc21c1264cce07feb4a51be158688280e ]
When ata_eh_speed_down() disables NCQ due to excessive errors, it sets
ATA_DFLAG_NCQ_OFF without changing sdev->queue_depth. Userspace can
re-enable NCQ by writing a queue depth > 1 to the sysfs queue_depth
attribute, which invokes ata_change_queue_depth() to clear
ATA_DFLAG_NCQ_OFF.
However, ata_change_queue_depth() returns early if the requested
queue_depth is equal to sdev->queue_depth before clearing
ATA_DFLAG_NCQ_OFF. As a result, writing a different queue depth > 1
re-enables NCQ, whereas writing the current sdev->queue_depth value
leaves ATA_DFLAG_NCQ_OFF set.
Since ata_change_queue_depth() already checks whether queue_depth equals
sdev->queue_depth before calling scsi_change_queue_depth(), remove the
early check so that writing the current queue_depth > 1 clears
ATA_DFLAG_NCQ_OFF and re-enables NCQ.
Fixes: 45623d33bfc0 ("ata: libata-sata: Improve ata_change_queue_depth()")
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20261029184445.1615717-1-ipylypiv@google.com
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-sata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
index 9e0a820d6961d..bb796ce0b456c 100644
--- a/drivers/ata/libata-sata.c
+++ b/drivers/ata/libata-sata.c
@@ -1067,7 +1067,7 @@ int ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
spin_lock_irqsave(ap->lock, flags);
dev = ata_scsi_find_dev(ap, sdev);
- if (!dev || queue_depth < 1 || queue_depth == sdev->queue_depth) {
+ if (!dev || queue_depth < 1) {
spin_unlock_irqrestore(ap->lock, flags);
return sdev->queue_depth;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0085/1167] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0084/1167] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0086/1167] net: stmmac: Set dma_sync_size to zero for discarded frames Greg Kroah-Hartman
` (572 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Pylypiv, Niklas Cassel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 597be4104c4045d73979c05307fa5fc778d1dbde ]
When a failed command has valid sense data, ata_eh_analyze_tf() asks
scsi_check_sense() whether the command should be retried, and sets
ATA_QCFLAG_RETRY if it should. ata_eh_link_autopsy() then clears
AC_ERR_DEV and AC_ERR_OTHER from qc->err_mask, relying on that decision.
For an NCQ command, qc->err_mask still has AC_ERR_NCQ, so
ata_eh_finish() honors ATA_QCFLAG_RETRY. For a non-NCQ command, whose
sense data comes from REQUEST SENSE DATA EXT, qc->err_mask is now zero,
and ata_eh_finish() completes the command with scmd->retries set to
scmd->allowed, without looking at ATA_QCFLAG_RETRY. Such a command is
thus never retried, even when its sense data asks for a retry, e.g. a
transient error reported as ABORTED COMMAND.
Make ata_eh_finish() honor ATA_QCFLAG_RETRY for commands with valid
sense data. ata_eh_qc_retry() cannot be used for this: as qc->err_mask
is zero, it increments scmd->allowed, so every retry would allow one
more, and a persistent error would be retried forever. Instead,
complete the command without touching scmd->allowed or scmd->retries,
so that the SCSI midlayer retries it at most scmd->allowed times, like
any other failed command.
Fixes: 3852e3738266 ("libata: evaluate SCSI sense code")
Reviewed-by: Igor Pylypiv <ipylypiv@google.com>
Link: https://lore.kernel.org/r/20261030090047.407906-2-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-eh.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index b3dfd882a7dd3..6638ebd46e454 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -3960,8 +3960,20 @@ void ata_eh_finish(struct ata_port *ap)
ata_eh_qc_complete(qc);
}
} else {
- if (qc->flags & ATA_QCFLAG_SENSE_VALID ||
- qc->flags & ATA_QCFLAG_EH_SUCCESS_CMD) {
+ if (qc->flags & ATA_QCFLAG_SENSE_VALID &&
+ qc->flags & ATA_QCFLAG_RETRY) {
+ /*
+ * The sense data asks for a retry, see
+ * ata_eh_analyze_tf(). ata_eh_link_autopsy()
+ * cleared qc->err_mask, so ata_eh_qc_retry()
+ * would increment scmd->allowed. Leave
+ * scmd->allowed alone, so that upper layer
+ * only retries the command if it has not
+ * already been retried too many times.
+ */
+ __ata_eh_qc_complete(qc);
+ } else if (qc->flags & ATA_QCFLAG_SENSE_VALID ||
+ qc->flags & ATA_QCFLAG_EH_SUCCESS_CMD) {
ata_eh_qc_complete(qc);
} else {
/* feed zero TF to sense generation */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0086/1167] net: stmmac: Set dma_sync_size to zero for discarded frames
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0085/1167] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0087/1167] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
` (571 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Furong Xu, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Furong Xu <0x1207@gmail.com>
[ Upstream commit 51cfbed198ca4aa140babde816387db0e71f09e7 ]
If a frame is going to be discarded by driver, this frame is never touched
by driver and the cache lines never become dirty obviously,
page_pool_recycle_direct() wastes CPU cycles on unnecessary calling of
page_pool_dma_sync_for_device() to sync entire frame.
page_pool_put_page() with sync_size setting to 0 is the proper method.
Signed-off-by: Furong Xu <0x1207@gmail.com>
Link: https://patch.msgid.link/20250103093733.3872939-1-0x1207@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 834ec9530832 ("net: stmmac: drop split frames on AF_XDP zero-copy RX")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 2e6623fa585af..8131cae372ed5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5399,7 +5399,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
status);
}
if (unlikely(status == discard_frame)) {
- page_pool_recycle_direct(rx_q->page_pool, buf->page);
+ page_pool_put_page(rx_q->page_pool, buf->page, 0, true);
buf->page = NULL;
error = 1;
if (!priv->hwts_rx_en)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0087/1167] net: stmmac: drop split frames on AF_XDP zero-copy RX
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0086/1167] net: stmmac: Set dma_sync_size to zero for discarded frames Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0088/1167] net: stmmac: copy XDP metadata in " Greg Kroah-Hartman
` (570 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nicolai Buchwitz, Lorenzo Bianconi,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
[ Upstream commit 834ec95308320cbd8c162d86788ab95cc3fd6bf8 ]
stmmac_rx_zc() assumes a 1:1 mapping between a received frame and an
XSK pool buffer and drops any frame that spans more than one RX
descriptor:
/* XSK pool expects RX frame 1:1 mapped to XSK buffer */
if (likely(status & rx_not_ls)) {
xsk_buff_free(buf->xdp);
buf->xdp = NULL;
dirty++;
count++;
goto read_again;
}
The non-last descriptors are freed and dropped, but the frame is not
marked as errored. When the poll reaches the last descriptor of the
same frame, error is still 0, so the fragment is handled as a complete
frame: it is passed to the XDP program, copied into an skb on XDP_PASS,
or converted for XDP_TX. The tail starts in the middle of the original
payload at a predictable offset and, parsed as a fresh frame (len == 0),
stmmac_rx_buf1_len() reports the full dma_buf_sz length for it even
though the DMA engine only wrote the tail remainder into that buffer, so
the reads extend past the received bytes and can reach beyond the end of
the XSK pool buffer. GMAC4 always enables jumbo frames (GMAC_CONFIG_JE
in GMAC_CORE_INIT), so an on-link peer can trigger such a split even
when the interface MTU is left at 1500.
Set error when the 1:1 mapping check drops a descriptor, so the
remaining descriptors of the frame - including the last one - are
drained and released with xsk_buff_free() instead of being processed as
a new frame. Account every freed buffer with dirty and count the
dropped frame once in the poll budget / rx_pkt_n. The direct 1:1
mapping drop also increments rx_dropped.
Use a bit test instead of an equality test for discard_frame.
Commit 644b8437ccef9e ("net: stmmac: dwmac4: report Rx checksum errors
in status") made dwmac4_wrback_get_rx_status() set discard_frame on
RDES3_ERROR_SUMMARY and OR in csum_none on RDES1_IP_HDR_ERROR or
RDES1_IP_PAYLOAD_ERROR, so it can return discard_frame | csum_none.
The old "status == discard_frame" test missed that value and delivered
frames with CRC, overflow, watchdog or giant errors to the stack in
stmmac_rx() - or to XDP/XSK in stmmac_rx_zc() - when they also failed
the IP checksum. The change therefore affects the regular RX path, not
only zero-copy. The bit test is also required for the
discard_frame | rx_not_ls value returned for non-last legacy
descriptors below.
Normalize the legacy normal and enhanced descriptor callbacks to report
rx_not_ls together with discard_frame for non-last descriptors. This
allows both stmmac_rx_zc() and stmmac_rx() to drain split frames on
dwmac100 and dwmac1000 instead of reparsing the final fragment as a new
packet.
Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy")
Fixes: 644b8437ccef9e ("net: stmmac: dwmac4: report Rx checksum errors in status")
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-2-10eae8a093a8@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/stmicro/stmmac/enh_desc.c | 2 +-
.../net/ethernet/stmicro/stmmac/norm_desc.c | 2 +-
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 21 ++++++++++++-------
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
index 963579518405c..9833db1fed0c4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
@@ -210,7 +210,7 @@ static int enh_desc_get_rx_status(struct stmmac_extra_stats *x,
if (unlikely(!(rdes0 & RDES0_LAST_DESCRIPTOR))) {
x->rx_length++;
- return discard_frame;
+ return discard_frame | rx_not_ls;
}
if (unlikely(rdes0 & RDES0_ERROR_SUMMARY)) {
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index 68a7cfcb1d8f3..c08846da03eb7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -77,7 +77,7 @@ static int ndesc_get_rx_status(struct stmmac_extra_stats *x,
if (unlikely(!(rdes0 & RDES0_LAST_DESCRIPTOR))) {
x->rx_length++;
- return discard_frame;
+ return discard_frame | rx_not_ls;
}
if (unlikely(rdes0 & RDES0_ERROR_SUMMARY)) {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8131cae372ed5..0e81bc73a9341 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5200,18 +5200,21 @@ static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
&rx_q->dma_erx[entry],
status);
}
- if (unlikely(status == discard_frame)) {
- xsk_buff_free(buf->xdp);
- buf->xdp = NULL;
- dirty++;
+
+ if (unlikely(!error && (status & discard_frame))) {
error = 1;
if (!priv->hwts_rx_en)
rx_errors++;
}
- if (unlikely(error && (status & rx_not_ls)))
- goto read_again;
if (unlikely(error)) {
+ xsk_buff_free(buf->xdp);
+ buf->xdp = NULL;
+ dirty++;
+
+ if (status & rx_not_ls)
+ goto read_again;
+
count++;
continue;
}
@@ -5220,8 +5223,9 @@ static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
if (likely(status & rx_not_ls)) {
xsk_buff_free(buf->xdp);
buf->xdp = NULL;
+ rx_dropped++;
+ error = 1;
dirty++;
- count++;
goto read_again;
}
@@ -5398,7 +5402,8 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
&rx_q->dma_erx[entry],
status);
}
- if (unlikely(status == discard_frame)) {
+
+ if (unlikely(status & discard_frame)) {
page_pool_put_page(rx_q->page_pool, buf->page, 0, true);
buf->page = NULL;
error = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0088/1167] net: stmmac: copy XDP metadata in AF_XDP zero-copy RX
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0087/1167] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0089/1167] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
` (569 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Paolo Abeni,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
[ Upstream commit 41d78e9ac0984f0e9577e5312e62400b5a6760c8 ]
stmmac_construct_skb_zc() reserves headroom for the XDP metadata and
records the length reported by the XDP program, but only copies the
packet data starting at xdp->data. The bytes in
[xdp->data_meta, xdp->data) are never copied into the new skb, so the
skb advertises metadata that is not there: after eth_type_trans()
anchors mac_header, data_meta points at uninitialized headroom instead
of what the program wrote.
Copy the metadata together with the packet data starting at
xdp->data_meta, leaving skb->data at the start of the frame and the
metadata immediately before it, and record its length. This keeps
data_meta valid for the stack and TC BPF after eth_type_trans() anchors
mac_header.
Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-4-10eae8a093a8@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 0e81bc73a9341..c3ba4c5f81754 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4989,7 +4989,8 @@ static struct sk_buff *stmmac_construct_skb_zc(struct stmmac_channel *ch,
return NULL;
skb_reserve(skb, xdp->data - xdp->data_hard_start);
- memcpy(__skb_put(skb, datasize), xdp->data, datasize);
+ __skb_put(skb, datasize);
+ memcpy(skb->data - metasize, xdp->data_meta, datasize + metasize);
if (metasize)
skb_metadata_set(skb, metasize);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0089/1167] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0088/1167] net: stmmac: copy XDP metadata in " Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0090/1167] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
` (568 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Machon, Simon Horman,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Machon <daniel.machon@microchip.com>
[ Upstream commit 263a5514cb9535380734b5e300b298f82570eb57 ]
lan966x_fdma_tx_clear_buf() runs from the NAPI poll and frees the
buffers of completed tx DCBs with napi_consume_skb(),
page_pool_recycle_direct() and xdp_return_frame_bulk().
netpoll calls the NAPI poll with a budget of 0 and hardirqs disabled.
With a budget of 0, a driver cannot call any XDP or page pool API.
Before this patch, the XDP_TX pages and ndo_xdp_xmit frames are freed
regardless of the budget. With netconsole on the port that owns the
FDMA NAPI, such a buffer is freed with hardirqs disabled, and
__page_pool_put_page() warns via lockdep_assert_no_hardirq().
Leave the XDP buffers of completed DCBs in place when the budget is 0,
and free them in the next NAPI poll. napi_consume_skb() already handles
a budget of 0, so skbs are still freed.
Found by an AI code review agent. Reproduced on a lan9668 board with a
modified kernel that runs the NAPI poll with a budget of 0 and hardirqs
disabled. With the fix the warning is gone.
Fixes: 19c6f534f636 ("net: lan966x: Add support for XDP_TX")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261029-lan966x-fdma-tx-clear-budget-v1-1-38c52d7aab8c@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
index a99feb266c36c..4bebf0c91f30b 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
@@ -416,6 +416,12 @@ static void lan966x_fdma_tx_clear_buf(struct lan966x *lan966x, int weight)
if (!(db->status & FDMA_DCB_STATUS_DONE))
continue;
+ /* XDP and page pool APIs can't be used with a budget of 0.
+ * Leave these buffers for the next NAPI poll.
+ */
+ if (!weight && !dcb_buf->use_skb)
+ continue;
+
dcb_buf->dev->stats.tx_packets++;
dcb_buf->dev->stats.tx_bytes += dcb_buf->len;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0090/1167] drm/panel: visionox-r66451: Send the brightness value MSB first
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0089/1167] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0091/1167] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
` (567 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vladimir Zapolskiy, Neil Armstrong,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Zapolskiy <vz@kernel.org>
[ Upstream commit 00fe6be187ffde738fdb71ea7deb671fc939e583 ]
The panel expects to get two bytes of the DCS Set Display Brightness
command with the most significant byte first, and it uses the lower
12 bits of the value, use mipi_dsi_dcs_set_display_brightness_large()
to correct the programmed brightness values.
Tested on the SM8350-HDK display card, the display brightness increases
gradually with:
for v in $(seq 16 16 4095); do sleep 0.1; \
echo $v > /sys/class/backlight/ae94000.dsi.0/brightness; \
done
while without the change the display is dark during all writes.
Fixes: a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel")
Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20261101212458.2431191-2-vz@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panel/panel-visionox-r66451.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-visionox-r66451.c b/drivers/gpu/drm/panel/panel-visionox-r66451.c
index 00fc28ad3d07b..5df24372d510c 100644
--- a/drivers/gpu/drm/panel/panel-visionox-r66451.c
+++ b/drivers/gpu/drm/panel/panel-visionox-r66451.c
@@ -270,7 +270,7 @@ static int visionox_r66451_bl_update_status(struct backlight_device *bl)
struct mipi_dsi_device *dsi = bl_get_data(bl);
u16 brightness = backlight_get_brightness(bl);
- return mipi_dsi_dcs_set_display_brightness(dsi, brightness);
+ return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
}
static const struct backlight_ops visionox_r66451_bl_ops = {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0091/1167] drm/panel: visionox-r66451: Wait longer after the panel reset
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0090/1167] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0092/1167] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
` (566 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vladimir Zapolskiy, Neil Armstrong,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Zapolskiy <vz@kernel.org>
[ Upstream commit b4b2778d5e175b166e4a27e5df5d61da468ad004 ]
The initialization sequence is sent 10ms after the panel reset is
deasserted, however on the SM8350-HDK display card the panel does not
answer a DCS read at that time, as a result the panel initialization
commands are lost, and the panel does not exit sleep mode and the display
stays black. With the first command sent about 15ms after the reset
the panel comes up reliably, so wait 20ms after deasserting the reset.
Fixes: a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel")
Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20261101212458.2431191-3-vz@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panel/panel-visionox-r66451.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-visionox-r66451.c b/drivers/gpu/drm/panel/panel-visionox-r66451.c
index 5df24372d510c..9f1900d6c8587 100644
--- a/drivers/gpu/drm/panel/panel-visionox-r66451.c
+++ b/drivers/gpu/drm/panel/panel-visionox-r66451.c
@@ -37,7 +37,7 @@ static void visionox_r66451_reset(struct visionox_r66451 *ctx)
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(10000, 10100);
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
- usleep_range(10000, 10100);
+ usleep_range(20000, 21000);
}
static int visionox_r66451_on(struct visionox_r66451 *ctx)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0092/1167] sfc: ptp: drop the stale frequency reset in efx_ptp_start()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0091/1167] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
@ 2026-12-04 9:51 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0093/1167] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
` (565 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Austin, Paolo Abeni,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Austin <alex.austin@amd.com>
[ Upstream commit 21d4917cfc8b6837c44d8aa186941a6a16ec17a0 ]
FW does not touch the clock frequency state on MC_CMD_PTP_OP_DISABLE or
MC_CMD_PTP_OP_ENABLE, so the driver doesn't need to either. Doing so
just desyncs the driver's cached current_adjfreq from what FW still has
programmed.
Resetting current_adjfreq to 0 here means the first efx_phc_adjtime()
call after efx_ptp_start() reprograms the NIC's clock frequency to 0,
since efx_phc_adjtime() always sends current_adjfreq to FW alongside
the time step. efx_ptp_start() runs on every SIOCSHWTSTAMP mode change,
on ifup, and on the reset_required path in efx_ptp_worker(), so each of
those silently drops any frequency correction the PTP servo had already
applied.
efx_ptp_start() is also reached from reset recovery, but that is fine:
on an FLR or PCIe reset FW does not touch the NIC clock, and on a full
MC reboot the clock is reset to 1970, so a stale current_adjfreq from
before the reset is hardly consequential - especially as it is bound to
MAX_PPB, 1000000 ppb.
Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP")
Signed-off-by: Alex Austin <alex.austin@amd.com>
Link: https://patch.msgid.link/20261026123023.3566549-2-alex.austin@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/sfc/ptp.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index f5227ae8cc436..6a1b1e03910f5 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1445,7 +1445,6 @@ static int efx_ptp_start(struct efx_nic *efx)
goto fail;
ptp->evt_frag_idx = 0;
- ptp->current_adjfreq = 0;
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0093/1167] sfc: ptp: serialize host and MC synchronization transactions
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2026-12-04 9:51 ` [PATCH 6.6 0092/1167] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0094/1167] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
` (564 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alex Austin, Alejandro Lucero,
Pieter Jansen van Vuuren, Edward Cree, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Austin <alex.austin@amd.com>
[ Upstream commit f707347b33feebdd67633bccea52f96807c18d6e ]
efx_ptp_synchronize() clears the MC-ready DMA flag before
efx_mcdi_rpc_start() acquires the MCDI interface, and processes results
into ptp->timeset[] after efx_mcdi_rpc_finish() has released it. The PPS
worker and the hwtstamp enable path can therefore clobber each other's
handshake flag and timesets.
Hold a PHC mutex across the whole transaction and over the clock
operations, so efx_phc_settime() reads and adjusts atomically and
current_adjfreq is consistently read and written under one lock. Also
bail out when efx_mcdi_rpc_start() fails rather than finishing an RPC
that was never acquired.
Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP")
Signed-off-by: Alex Austin <alex.austin@amd.com>
Reviewed-by: Alejandro Lucero <alucerop@amd.com>
Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20261026123023.3566549-3-alex.austin@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/sfc/ptp.c | 81 +++++++++++++++++++++++-----------
1 file changed, 55 insertions(+), 26 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 6a1b1e03910f5..ebb3a9dfa6793 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -36,6 +36,7 @@
#include <linux/errno.h>
#include <linux/ktime.h>
#include <linux/module.h>
+#include <linux/mutex.h>
#include <linux/pps_kernel.h>
#include <linux/ptp_clock_kernel.h>
#include "net_driver.h"
@@ -266,6 +267,8 @@ struct efx_ptp_rxfilter {
* frequency adjustment into a fixed point fractional nanosecond format.
* @current_adjfreq: Current ppb adjustment.
* @phc_clock: Pointer to registered phc device (if primary function)
+ * @phc_lock: Serializes PHC commands and synchronization, and protects
+ * @current_adjfreq
* @phc_clock_info: Registration structure for phc device
* @pps_work: pps work task for handling pps events
* @pps_workwq: pps work queue
@@ -325,6 +328,7 @@ struct efx_ptp_data {
unsigned int adjfreq_ppb_shift;
s64 current_adjfreq;
struct ptp_clock *phc_clock;
+ struct mutex phc_lock;
struct ptp_clock_info phc_clock_info;
struct work_struct pps_work;
struct workqueue_struct *pps_workwq;
@@ -1002,7 +1006,14 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
return 0;
}
-/* Synchronize times between the host and the MC */
+/* Synchronize times between the host and the MC.
+ *
+ * The MC serializes PTP requests, so MC_CMD_PTP_OP_ADJUST cannot be applied
+ * while MC_CMD_PTP_OP_SYNCHRONIZE is collecting timesets. This holds across
+ * functions of a controller, which share the clock but adjust it only through
+ * the function that registered it, so a secondary function can capture here
+ * without serializing against the primary.
+ */
static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
{
struct efx_ptp_data *ptp = efx->ptp_data;
@@ -1021,11 +1032,14 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
MCDI_SET_QWORD(synch_buf, PTP_IN_SYNCHRONIZE_START_ADDR,
ptp->start.dma_addr);
+ mutex_lock(&ptp->phc_lock);
+
/* Clear flag that signals MC ready */
WRITE_ONCE(*start, 0);
rc = efx_mcdi_rpc_start(efx, MC_CMD_PTP, synch_buf,
MC_CMD_PTP_IN_SYNCHRONIZE_LEN);
- EFX_WARN_ON_ONCE_PARANOID(rc);
+ if (rc)
+ goto out;
/* Wait for start from MCDI (or timeout) */
timeout = jiffies + msecs_to_jiffies(MAX_SYNCHRONISE_WAIT_MS);
@@ -1056,11 +1070,13 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
++ptp->no_time_syncs;
}
+out:
/* Increment the bad syncs counter if the synchronize fails, whatever
* the reason.
*/
if (rc != 0)
++ptp->bad_syncs;
+ mutex_unlock(&ptp->phc_lock);
return rc;
}
@@ -1568,6 +1584,7 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
if (!efx->ptp_data)
return -ENOMEM;
+ mutex_init(&ptp->phc_lock);
ptp->efx = efx;
ptp->channel = channel;
@@ -1639,6 +1656,7 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
efx_nic_free_buffer(efx, &ptp->start);
fail1:
+ mutex_destroy(&ptp->phc_lock);
kfree(efx->ptp_data);
efx->ptp_data = NULL;
@@ -1693,6 +1711,7 @@ void efx_ptp_remove(struct efx_nic *efx)
destroy_workqueue(efx->ptp_data->workwq);
efx_nic_free_buffer(efx, &efx->ptp_data->start);
+ mutex_destroy(&efx->ptp_data->phc_lock);
kfree(efx->ptp_data);
efx->ptp_data = NULL;
}
@@ -2109,23 +2128,23 @@ static int efx_phc_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
MCDI_SET_QWORD(inadj, PTP_IN_ADJUST_FREQ, adjustment_ns);
MCDI_SET_DWORD(inadj, PTP_IN_ADJUST_SECONDS, 0);
MCDI_SET_DWORD(inadj, PTP_IN_ADJUST_NANOSECONDS, 0);
+ mutex_lock(&ptp_data->phc_lock);
rc = efx_mcdi_rpc(efx, MC_CMD_PTP, inadj, sizeof(inadj),
NULL, 0, NULL);
- if (rc != 0)
- return rc;
-
- ptp_data->current_adjfreq = adjustment_ns;
- return 0;
+ if (!rc)
+ ptp_data->current_adjfreq = adjustment_ns;
+ mutex_unlock(&ptp_data->phc_lock);
+ return rc;
}
-static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
+static int _efx_phc_adjtime(struct efx_ptp_data *ptp_data, s64 delta)
+ __must_hold(&ptp_data->phc_lock)
{
- u32 nic_major, nic_minor;
- struct efx_ptp_data *ptp_data = container_of(ptp,
- struct efx_ptp_data,
- phc_clock_info);
- struct efx_nic *efx = ptp_data->efx;
MCDI_DECLARE_BUF(inbuf, MC_CMD_PTP_IN_ADJUST_LEN);
+ struct efx_nic *efx = ptp_data->efx;
+ u32 nic_major, nic_minor;
+
+ lockdep_assert_held(&ptp_data->phc_lock);
efx->ptp_data->ns_to_nic_time(delta, &nic_major, &nic_minor);
@@ -2138,6 +2157,18 @@ static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
NULL, 0, NULL);
}
+static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
+{
+ struct efx_ptp_data *ptp_data = container_of(ptp, struct efx_ptp_data,
+ phc_clock_info);
+ int rc;
+
+ mutex_lock(&ptp_data->phc_lock);
+ rc = _efx_phc_adjtime(ptp_data, delta);
+ mutex_unlock(&ptp_data->phc_lock);
+ return rc;
+}
+
static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
{
struct efx_ptp_data *ptp_data = container_of(ptp,
@@ -2169,23 +2200,21 @@ static int efx_phc_settime(struct ptp_clock_info *ptp,
{
/* Get the current NIC time, efx_phc_gettime.
* Subtract from the desired time to get the offset
- * call efx_phc_adjtime with the offset
+ * call _efx_phc_adjtime with the offset
*/
+ struct efx_ptp_data *ptp_data = container_of(ptp, struct efx_ptp_data,
+ phc_clock_info);
+ struct timespec64 time_now, delta;
int rc;
- struct timespec64 time_now;
- struct timespec64 delta;
+ mutex_lock(&ptp_data->phc_lock);
rc = efx_phc_gettime(ptp, &time_now);
- if (rc != 0)
- return rc;
-
- delta = timespec64_sub(*e_ts, time_now);
-
- rc = efx_phc_adjtime(ptp, timespec64_to_ns(&delta));
- if (rc != 0)
- return rc;
-
- return 0;
+ if (!rc) {
+ delta = timespec64_sub(*e_ts, time_now);
+ rc = _efx_phc_adjtime(ptp_data, timespec64_to_ns(&delta));
+ }
+ mutex_unlock(&ptp_data->phc_lock);
+ return rc;
}
static int efx_phc_enable(struct ptp_clock_info *ptp,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0094/1167] sfc: ptp: avoid racing PPS timestamp updates
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0093/1167] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0095/1167] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
` (563 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alex Austin, Alejandro Lucero,
Pieter Jansen van Vuuren, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Austin <alex.austin@amd.com>
[ Upstream commit 23d23e6c6517d0fea4f64340a23e33c89f82c03c ]
efx_ptp_pps_worker() can race with SIOCHWTSTAMP via
efx_ptp_change_mode(). After the worker completes synchronization, the
ioctl can start another synchronization and update host_time_pps while
the worker copies it into the PPS event. This can report a partially
updated timestamp. Serializing synchronization transactions alone does
not protect this copy, which happens after phc_lock is released.
Return the timestamp through the caller's own pps_event_time rather
than the shared field in efx_ptp_data, so the worker reads storage no
one else can write.
Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP")
Signed-off-by: Alex Austin <alex.austin@amd.com>
Reviewed-by: Alejandro Lucero <alucerop@amd.com>
Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>
Link: https://patch.msgid.link/20261026123023.3566549-4-alex.austin@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/sfc/ptp.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index ebb3a9dfa6793..6e8c0da35e04c 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -262,7 +262,6 @@ struct efx_ptp_rxfilter {
* @evt_frag_idx: Current fragment number
* @evt_code: Last event code
* @start: Address at which MC indicates ready for synchronisation
- * @host_time_pps: Host time at last PPS
* @adjfreq_ppb_shift: Shift required to convert scaled parts-per-billion
* frequency adjustment into a fixed point fractional nanosecond format.
* @current_adjfreq: Current ppb adjustment.
@@ -324,7 +323,6 @@ struct efx_ptp_data {
int evt_frag_idx;
int evt_code;
struct efx_buffer start;
- struct pps_event_time host_time_pps;
unsigned int adjfreq_ppb_shift;
s64 current_adjfreq;
struct ptp_clock *phc_clock;
@@ -906,7 +904,8 @@ static void efx_ptp_read_timeset(MCDI_DECLARE_STRUCT_PTR(data),
static int
efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
size_t response_length,
- const struct pps_event_time *last_time)
+ const struct pps_event_time *last_time,
+ struct pps_event_time *host_time_pps)
{
unsigned number_readings =
MCDI_VAR_ARRAY_LEN(response_length,
@@ -984,6 +983,10 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
"PTP bad synchronisation seconds\n");
return -EAGAIN;
}
+
+ if (!host_time_pps)
+ return 0;
+
delta.tv_sec = (last_sec - start_sec) & 1;
delta.tv_nsec =
last_time->ts_real.tv_nsec -
@@ -1000,8 +1003,8 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
delta.tv_nsec += ktime_to_timespec64(mc_time).tv_nsec;
/* Set PPS timestamp to match NIC top of second */
- ptp->host_time_pps = *last_time;
- pps_sub_ts(&ptp->host_time_pps, delta);
+ *host_time_pps = *last_time;
+ pps_sub_ts(host_time_pps, delta);
return 0;
}
@@ -1014,7 +1017,8 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
* the function that registered it, so a secondary function can capture here
* without serializing against the primary.
*/
-static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
+static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings,
+ struct pps_event_time *host_time_pps)
{
struct efx_ptp_data *ptp = efx->ptp_data;
MCDI_DECLARE_BUF(synch_buf, MC_CMD_PTP_OUT_SYNCHRONIZE_LENMAX);
@@ -1063,7 +1067,7 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
&response_length);
if (rc == 0) {
rc = efx_ptp_process_times(efx, synch_buf, response_length,
- &last_time);
+ &last_time, host_time_pps);
if (rc == 0)
++ptp->good_syncs;
else
@@ -1500,14 +1504,15 @@ static void efx_ptp_pps_worker(struct work_struct *work)
{
struct efx_ptp_data *ptp =
container_of(work, struct efx_ptp_data, pps_work);
+ struct pps_event_time host_time_pps = {};
struct efx_nic *efx = ptp->efx;
struct ptp_clock_event ptp_evt;
- if (efx_ptp_synchronize(efx, PTP_SYNC_ATTEMPTS))
+ if (efx_ptp_synchronize(efx, PTP_SYNC_ATTEMPTS, &host_time_pps))
return;
ptp_evt.type = PTP_CLOCK_PPSUSR;
- ptp_evt.pps_times = ptp->host_time_pps;
+ ptp_evt.pps_times = host_time_pps;
ptp_clock_event(ptp->phc_clock, &ptp_evt);
}
@@ -1848,7 +1853,8 @@ int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
rc = efx_ptp_start(efx);
if (rc == 0) {
rc = efx_ptp_synchronize(efx,
- PTP_SYNC_ATTEMPTS * 2);
+ PTP_SYNC_ATTEMPTS * 2,
+ NULL);
if (rc != 0)
efx_ptp_stop(efx);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0095/1167] vdpa_sim: serialize IOTLB updates with dataplane access
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0094/1167] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0096/1167] vhost-scsi: preserve event ordering Greg Kroah-Hartman
` (562 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linfeng Sun <linfeng.sun.dev@gmail.com>
[ Upstream commit 8517ed4429a2eefd002dce00ea46e23e6714350b ]
The simulator translates IOTLB entries into iovecs or bvecs under
iommu_lock, then drops the lock before copying data. A concurrent DMA
unmap can delete the mapping and release its pinned backing pages while
the copy is still in progress, leading to a UAF in _copy_from_iter().
Use the existing simulator mutex to serialize DMA map changes with the
full backend work function. Also make vhost-vdpa stop device access before
unpinning the backing pages. Otherwise, waiting in the simulator DMA unmap
callback happens after the pages have already been released and cannot
protect their lifetime.
Keep iommu_lock for the IOTLB table itself and avoid adding a second
long-lived lock to the simulator.
I found this bug myself, though the patch was written with AI assistance.
Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator")
Assisted-by: OpenAI-Codex:GPT-5
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Message-ID: <20260911-fix-vdpa-iotlb-lifetime-v3-1-8766d371748e@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++++
drivers/vhost/vdpa.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index b7d24faa8af3e..f11e73123f403 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -671,6 +671,7 @@ static int vdpasim_dma_map(struct vdpa_device *vdpa, unsigned int asid,
if (asid >= vdpasim->dev_attr.nas)
return -EINVAL;
+ mutex_lock(&vdpasim->mutex);
spin_lock(&vdpasim->iommu_lock);
if (vdpasim->iommu_pt[asid]) {
vhost_iotlb_reset(&vdpasim->iommu[asid]);
@@ -679,6 +680,7 @@ static int vdpasim_dma_map(struct vdpa_device *vdpa, unsigned int asid,
ret = vhost_iotlb_add_range_ctx(&vdpasim->iommu[asid], iova,
iova + size - 1, pa, perm, opaque);
spin_unlock(&vdpasim->iommu_lock);
+ mutex_unlock(&vdpasim->mutex);
return ret;
}
@@ -691,6 +693,7 @@ static int vdpasim_dma_unmap(struct vdpa_device *vdpa, unsigned int asid,
if (asid >= vdpasim->dev_attr.nas)
return -EINVAL;
+ mutex_lock(&vdpasim->mutex);
spin_lock(&vdpasim->iommu_lock);
if (vdpasim->iommu_pt[asid]) {
vhost_iotlb_reset(&vdpasim->iommu[asid]);
@@ -698,6 +701,7 @@ static int vdpasim_dma_unmap(struct vdpa_device *vdpa, unsigned int asid,
}
vhost_iotlb_del_range(&vdpasim->iommu[asid], iova, iova + size - 1);
spin_unlock(&vdpasim->iommu_lock);
+ mutex_unlock(&vdpasim->mutex);
return 0;
}
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 72a60ab7465e4..f0d63e3b5f176 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -916,6 +916,8 @@ static void vhost_vdpa_pa_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
unsigned long pfn, pinned;
while ((map = vhost_iotlb_itree_first(iotlb, start, last)) != NULL) {
+ /* Stop device access before releasing the pinned pages. */
+ vhost_vdpa_general_unmap(v, map, asid);
pinned = PFN_DOWN(map->size);
for (pfn = PFN_DOWN(map->addr);
pinned > 0; pfn++, pinned--) {
@@ -925,7 +927,6 @@ static void vhost_vdpa_pa_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
unpin_user_page(page);
}
atomic64_sub(PFN_DOWN(map->size), &dev->mm->pinned_vm);
- vhost_vdpa_general_unmap(v, map, asid);
vhost_iotlb_map_free(iotlb, map);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0096/1167] vhost-scsi: preserve event ordering
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0095/1167] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0097/1167] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
` (561 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Jia, Mike Christie,
Michael S. Tsirkin, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Jia <physicalmtea@gmail.com>
[ Upstream commit a9a428115b7d8aa45e12e41899f90f60551bfa82 ]
vhost_scsi_send_evt() uses llist_add(), so pending events are LIFO.
vhost_scsi_complete_events() walks the detached list directly.
This can deliver a later hotplug or hotunplug event before an earlier
one.
Reverse the detached list before processing it.
This keeps delivery in enqueue order.
Fixes: a6c9af87363c ("tcm_vhost: Add hotplug/hotunplug support")
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260915094244.7900-2-physicalmtea@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/scsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 29ebb83b52ca8..48c1a2518466e 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -504,7 +504,7 @@ static void vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
struct llist_node *llnode;
mutex_lock(&vq->mutex);
- llnode = llist_del_all(&vs->vs_event_list);
+ llnode = llist_reverse_order(llist_del_all(&vs->vs_event_list));
llist_for_each_entry_safe(evt, t, llnode, list) {
if (!drop)
vhost_scsi_do_evt_work(vs, evt);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0097/1167] vhost-scsi: do not relock event vq mutex on send_evt fallback
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0096/1167] vhost-scsi: preserve event ordering Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0098/1167] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
` (560 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Jia, Mike Christie,
Michael S. Tsirkin, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Jia <physicalmtea@gmail.com>
[ Upstream commit a016d03a9cfe29aeeba438f32f8e8f63291e3275 ]
vhost_scsi_send_evt() is called with the event virtqueue mutex held.
If the worker is gone, the fallback currently calls
vhost_scsi_complete_events(), which tries to acquire the same mutex again
and deadlocks the caller.
Split event completion into a helper for callers that already hold the
mutex and a locking wrapper for the event worker. Use the helper on the
fallback path.
Link: https://lore.kernel.org/all/20260905005352.1E5B01F00A3D@smtp.kernel.org/
Fixes: b1b2ce58ed23 ("vhost-scsi: Handle vhost_vq_work_queue failures for events")
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260915094244.7900-3-physicalmtea@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/scsi.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 48c1a2518466e..a0d407c49694b 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -497,19 +497,26 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt)
vq_err(vq, "Faulted on vhost_scsi_send_event\n");
}
-static void vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
+/* Caller must hold the event virtqueue mutex. */
+static void __vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
{
- struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq;
struct vhost_scsi_evt *evt, *t;
struct llist_node *llnode;
- mutex_lock(&vq->mutex);
llnode = llist_reverse_order(llist_del_all(&vs->vs_event_list));
llist_for_each_entry_safe(evt, t, llnode, list) {
if (!drop)
vhost_scsi_do_evt_work(vs, evt);
vhost_scsi_free_evt(vs, evt);
}
+}
+
+static void vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
+{
+ struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq;
+
+ mutex_lock(&vq->mutex);
+ __vhost_scsi_complete_events(vs, drop);
mutex_unlock(&vq->mutex);
}
@@ -1532,7 +1539,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
llist_add(&evt->list, &vs->vs_event_list);
if (!vhost_vq_work_queue(vq, &vs->vs_event_work))
- vhost_scsi_complete_events(vs, true);
+ __vhost_scsi_complete_events(vs, true);
}
static void vhost_scsi_evt_handle_kick(struct vhost_work *work)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0098/1167] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0097/1167] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0099/1167] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
` (559 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, co+6dcbccedc9ec6452, Xiang Mei,
Michael S. Tsirkin, Paul Moses, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei <xmei5@asu.edu>
[ Upstream commit 1f8824fe7f6eaaf2355404db08d3cd05a28aa576 ]
genlmsg_reply() consumes the reply skb on every outcome: netlink_unicast()
frees it whether it queues it, drops it, or bails out early.
vdpa_nl_cmd_dev_config_get_doit() lets its return value fall through to the
shared error label, which calls nlmsg_free(msg) again and double-frees the
sk_buff on any reply failure. The failure is reachable unprivileged:
VDPA_CMD_DEV_CONFIG_GET carries no GENL_ADMIN_PERM, so batching several
requests into one sendto() on a socket with a shrunken SO_RCVBUF fills the
receive queue, and netlink_attachskb() then takes its MSG_DONTWAIT path,
freeing the skb and returning -EAGAIN.
Set msg to NULL once genlmsg_reply() has consumed it so the shared exit
path frees the skb only on the early error gotos that still own it;
nlmsg_free(NULL) is a no-op.
BUG: KASAN: slab-use-after-free in sk_skb_reason_drop (net/core/skbuff.c:1220)
Read of size 4 at addr ffff88800d99d49c by task exploit/147
Call Trace:
sk_skb_reason_drop (net/core/skbuff.c:1220)
vdpa_nl_cmd_dev_config_get_doit (drivers/vdpa/vdpa.c:1324)
genl_family_rcv_msg_doit (net/netlink/genetlink.c:1114)
genl_rcv_msg (net/netlink/genetlink.c:1194)
netlink_rcv_skb (net/netlink/af_netlink.c:2556)
genl_rcv (net/netlink/genetlink.c:1218)
netlink_unicast (net/netlink/af_netlink.c:1345)
netlink_sendmsg (net/netlink/af_netlink.c:1900)
__sys_sendto (net/socket.c:2281)
__x64_sys_sendto (net/socket.c:2284)
entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
The buggy address belongs to the object at ffff88800d99d3c0
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 220 bytes inside of
freed 232-byte region [ffff88800d99d3c0, ffff88800d99d4a8)
Fixes: ad69dd0bf26b ("vdpa: Introduce query of device config layout")
Reported-by: co+6dcbccedc9ec6452@bugs.sh
Closes: https://lore.kernel.org/all/ILTHcT8oe1HP47sY25JVxssvKmkCTjYlX9Hs%40bugs.sh/
Assisted-by: Claude:claude-opus-5
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reported-by: Paul Moses <p@1g4.org>
Message-ID: <20260912215401.126194-1-xmei5@asu.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vdpa/vdpa.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
index 28a2fb1d0fa45..9c280fcf9df2e 100644
--- a/drivers/vdpa/vdpa.c
+++ b/drivers/vdpa/vdpa.c
@@ -1099,15 +1099,16 @@ static int vdpa_nl_cmd_dev_config_get_doit(struct sk_buff *skb, struct genl_info
}
err = vdpa_dev_config_fill(vdev, msg, info->snd_portid, info->snd_seq,
0, info->extack);
- if (!err)
+ if (!err) {
err = genlmsg_reply(msg, info);
+ msg = NULL;
+ }
mdev_err:
put_device(dev);
dev_err:
up_read(&vdpa_dev_lock);
- if (err)
- nlmsg_free(msg);
+ nlmsg_free(msg);
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0099/1167] vhost: reject invalid IOTLB update permissions
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0098/1167] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0100/1167] irqbypass: Take ownership of producer/consumer token tracking Greg Kroah-Hartman
` (558 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linfeng Sun <linfeng.sun.dev@gmail.com>
[ Upstream commit b179f21d2d8a60ede29a00472bffdefb0284ef39 ]
vhost_chr_write_iter() validates the type and size of an IOTLB update, but
does not validate its permission field. An invalid permission can therefore
reach perm_to_iommu_flags() and trigger its warning in vhost_vdpa_map().
Reject IOTLB UPDATE messages whose permission field is empty or contains
bits outside VHOST_ACCESS_RW before dispatching them to a backend.
Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend")
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260913-fix-vhost_chr_write_iter-v1-1-76bf1f436cfe@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/vhost.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 7e7f80cb5dabb..8fc9bf3783c8b 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1569,7 +1569,8 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
goto done;
}
- if (msg.type == VHOST_IOTLB_UPDATE && msg.size == 0) {
+ if (msg.type == VHOST_IOTLB_UPDATE &&
+ (!msg.size || !msg.perm || (msg.perm & ~VHOST_ACCESS_RW))) {
ret = -EINVAL;
goto done;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0100/1167] irqbypass: Take ownership of producer/consumer token tracking
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (98 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0099/1167] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0101/1167] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
` (557 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Tian, Michael S. Tsirkin,
Alex Williamson, Sean Christopherson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <seanjc@google.com>
[ Upstream commit 2b521d86ee80a436a92445b8206d38d75aeb39ea ]
Move ownership of IRQ bypass token tracking into irqbypass.ko, and
explicitly require callers to pass an eventfd_ctx structure instead of a
completely opaque token. Relying on producers and consumers to set the
token appropriately is error prone, and hiding the fact that the token must
be an eventfd_ctx pointer (for all intents and purposes) unnecessarily
obfuscates the code and makes it more brittle.
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Link: https://lore.kernel.org/r/20250516230734.2564775-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Stable-dep-of: c9c1c1b7b31f ("vhost-vdpa: drop the parent's vq callback before the call fd is released")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/x86.c | 4 +--
drivers/vfio/pci/vfio_pci_intrs.c | 9 +++----
drivers/vhost/vdpa.c | 8 +++---
include/linux/irqbypass.h | 35 +++++++++++++-----------
virt/kvm/eventfd.c | 7 +++--
virt/lib/irqbypass.c | 44 ++++++++++++++++++++-----------
6 files changed, 58 insertions(+), 49 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index cc50327a0f137..08db68c29ffad 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -13460,8 +13460,8 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *cons,
ret = static_call(kvm_x86_pi_update_irte)(irqfd->kvm, prod->irq, irqfd->gsi, 0);
if (ret)
- printk(KERN_INFO "irq bypass consumer (token %p) unregistration"
- " fails: %d\n", irqfd->consumer.token, ret);
+ printk(KERN_INFO "irq bypass consumer (eventfd %p) unregistration"
+ " fails: %d\n", irqfd->consumer.eventfd, ret);
spin_unlock_irq(&kvm->irqfds.lock);
diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
index b05620236f708..f0d34a483cd43 100644
--- a/drivers/vfio/pci/vfio_pci_intrs.c
+++ b/drivers/vfio/pci/vfio_pci_intrs.c
@@ -514,15 +514,12 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_core_device *vdev,
if (ret)
goto out_put_eventfd_ctx;
- ctx->producer.token = trigger;
ctx->producer.irq = irq;
- ret = irq_bypass_register_producer(&ctx->producer);
+ ret = irq_bypass_register_producer(&ctx->producer, trigger);
if (unlikely(ret)) {
dev_info(&pdev->dev,
- "irq bypass producer (token %p) registration fails: %d\n",
- ctx->producer.token, ret);
-
- ctx->producer.token = NULL;
+ "irq bypass producer (eventfd %p) registration fails: %d\n",
+ trigger, ret);
}
ctx->trigger = trigger;
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index f0d63e3b5f176..9a4f33b0ccf7a 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -207,10 +207,10 @@ static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid)
return;
vq->call_ctx.producer.irq = irq;
- ret = irq_bypass_register_producer(&vq->call_ctx.producer);
+ ret = irq_bypass_register_producer(&vq->call_ctx.producer, vq->call_ctx.ctx);
if (unlikely(ret))
- dev_info(&v->dev, "vq %u, irq bypass producer (token %p) registration fails, ret = %d\n",
- qid, vq->call_ctx.producer.token, ret);
+ dev_info(&v->dev, "vq %u, irq bypass producer (eventfd %p) registration fails, ret = %d\n",
+ qid, vq->call_ctx.ctx, ret);
}
static void vhost_vdpa_unsetup_vq_irq(struct vhost_vdpa *v, u16 qid)
@@ -711,7 +711,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
if (ops->get_status(vdpa) &
VIRTIO_CONFIG_S_DRIVER_OK)
vhost_vdpa_unsetup_vq_irq(v, idx);
- vq->call_ctx.producer.token = NULL;
}
break;
}
@@ -746,7 +745,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
cb.callback = vhost_vdpa_virtqueue_cb;
cb.private = vq;
cb.trigger = vq->call_ctx.ctx;
- vq->call_ctx.producer.token = vq->call_ctx.ctx;
if (ops->get_status(vdpa) &
VIRTIO_CONFIG_S_DRIVER_OK)
vhost_vdpa_setup_vq_irq(v, idx);
diff --git a/include/linux/irqbypass.h b/include/linux/irqbypass.h
index 9bdb2a7818418..1b57d15ac4cf2 100644
--- a/include/linux/irqbypass.h
+++ b/include/linux/irqbypass.h
@@ -10,6 +10,7 @@
#include <linux/list.h>
+struct eventfd_ctx;
struct irq_bypass_consumer;
/*
@@ -18,20 +19,20 @@ struct irq_bypass_consumer;
* The IRQ bypass manager is a simple set of lists and callbacks that allows
* IRQ producers (ex. physical interrupt sources) to be matched to IRQ
* consumers (ex. virtualization hardware that allows IRQ bypass or offload)
- * via a shared token (ex. eventfd_ctx). Producers and consumers register
- * independently. When a token match is found, the optional @stop callback
- * will be called for each participant. The pair will then be connected via
- * the @add_* callbacks, and finally the optional @start callback will allow
- * any final coordination. When either participant is unregistered, the
- * process is repeated using the @del_* callbacks in place of the @add_*
- * callbacks. Match tokens must be unique per producer/consumer, 1:N pairings
- * are not supported.
+ * via a shared eventfd_ctx. Producers and consumers register independently.
+ * When a producer and consumer are paired, i.e. an eventfd match is found, the
+ * optional @stop callback will be called for each participant. The pair will
+ * then be connected via the @add_* callbacks, and finally the optional @start
+ * callback will allow any final coordination. When either participant is
+ * unregistered, the process is repeated using the @del_* callbacks in place of
+ * the @add_* callbacks. eventfds must be unique per producer/consumer, 1:N
+ * pairings are not supported.
*/
/**
* struct irq_bypass_producer - IRQ bypass producer definition
* @node: IRQ bypass manager private list management
- * @token: opaque token to match between producer and consumer (non-NULL)
+ * @eventfd: eventfd context used to match producers and consumers
* @irq: Linux IRQ number for the producer device
* @add_consumer: Connect the IRQ producer to an IRQ consumer (optional)
* @del_consumer: Disconnect the IRQ producer from an IRQ consumer (optional)
@@ -44,7 +45,7 @@ struct irq_bypass_consumer;
*/
struct irq_bypass_producer {
struct list_head node;
- void *token;
+ struct eventfd_ctx *eventfd;
int irq;
int (*add_consumer)(struct irq_bypass_producer *,
struct irq_bypass_consumer *);
@@ -57,7 +58,7 @@ struct irq_bypass_producer {
/**
* struct irq_bypass_consumer - IRQ bypass consumer definition
* @node: IRQ bypass manager private list management
- * @token: opaque token to match between producer and consumer (non-NULL)
+ * @eventfd: eventfd context used to match producers and consumers
* @add_producer: Connect the IRQ consumer to an IRQ producer
* @del_producer: Disconnect the IRQ consumer from an IRQ producer
* @stop: Perform any quiesce operations necessary prior to add/del (optional)
@@ -70,7 +71,7 @@ struct irq_bypass_producer {
*/
struct irq_bypass_consumer {
struct list_head node;
- void *token;
+ struct eventfd_ctx *eventfd;
int (*add_producer)(struct irq_bypass_consumer *,
struct irq_bypass_producer *);
void (*del_producer)(struct irq_bypass_consumer *,
@@ -79,9 +80,11 @@ struct irq_bypass_consumer {
void (*start)(struct irq_bypass_consumer *);
};
-int irq_bypass_register_producer(struct irq_bypass_producer *);
-void irq_bypass_unregister_producer(struct irq_bypass_producer *);
-int irq_bypass_register_consumer(struct irq_bypass_consumer *);
-void irq_bypass_unregister_consumer(struct irq_bypass_consumer *);
+int irq_bypass_register_producer(struct irq_bypass_producer *producer,
+ struct eventfd_ctx *eventfd);
+void irq_bypass_unregister_producer(struct irq_bypass_producer *producer);
+int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer,
+ struct eventfd_ctx *eventfd);
+void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer);
#endif /* IRQBYPASS_H */
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index c0a8fa1aa9d6d..a8a0b78981f17 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -441,15 +441,14 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS
if (kvm_arch_has_irq_bypass()) {
- irqfd->consumer.token = (void *)irqfd->eventfd;
irqfd->consumer.add_producer = kvm_arch_irq_bypass_add_producer;
irqfd->consumer.del_producer = kvm_arch_irq_bypass_del_producer;
irqfd->consumer.stop = kvm_arch_irq_bypass_stop;
irqfd->consumer.start = kvm_arch_irq_bypass_start;
- ret = irq_bypass_register_consumer(&irqfd->consumer);
+ ret = irq_bypass_register_consumer(&irqfd->consumer, irqfd->eventfd);
if (ret)
- pr_info("irq bypass consumer (token %p) registration fails: %d\n",
- irqfd->consumer.token, ret);
+ pr_info("irq bypass consumer (eventfd %p) registration fails: %d\n",
+ irqfd->eventfd, ret);
}
#endif
diff --git a/virt/lib/irqbypass.c b/virt/lib/irqbypass.c
index 28fda42e471bb..cce0111b1fd4e 100644
--- a/virt/lib/irqbypass.c
+++ b/virt/lib/irqbypass.c
@@ -77,17 +77,19 @@ static void __disconnect(struct irq_bypass_producer *prod,
/**
* irq_bypass_register_producer - register IRQ bypass producer
* @producer: pointer to producer structure
+ * @eventfd: pointer to the eventfd context associated with the producer
*
* Add the provided IRQ producer to the list of producers and connect
- * with any matching token found on the IRQ consumers list.
+ * with any matching eventfd found on the IRQ consumers list.
*/
-int irq_bypass_register_producer(struct irq_bypass_producer *producer)
+int irq_bypass_register_producer(struct irq_bypass_producer *producer,
+ struct eventfd_ctx *eventfd)
{
struct irq_bypass_producer *tmp;
struct irq_bypass_consumer *consumer;
int ret;
- if (!producer->token)
+ if (WARN_ON_ONCE(producer->eventfd))
return -EINVAL;
might_sleep();
@@ -98,14 +100,14 @@ int irq_bypass_register_producer(struct irq_bypass_producer *producer)
mutex_lock(&lock);
list_for_each_entry(tmp, &producers, node) {
- if (tmp->token == producer->token) {
+ if (tmp->eventfd == eventfd) {
ret = -EBUSY;
goto out_err;
}
}
list_for_each_entry(consumer, &consumers, node) {
- if (consumer->token == producer->token) {
+ if (consumer->eventfd == eventfd) {
ret = __connect(producer, consumer);
if (ret)
goto out_err;
@@ -113,6 +115,7 @@ int irq_bypass_register_producer(struct irq_bypass_producer *producer)
}
}
+ producer->eventfd = eventfd;
list_add(&producer->node, &producers);
mutex_unlock(&lock);
@@ -137,7 +140,7 @@ void irq_bypass_unregister_producer(struct irq_bypass_producer *producer)
struct irq_bypass_producer *tmp;
struct irq_bypass_consumer *consumer;
- if (!producer->token)
+ if (!producer->eventfd)
return;
might_sleep();
@@ -148,21 +151,23 @@ void irq_bypass_unregister_producer(struct irq_bypass_producer *producer)
mutex_lock(&lock);
list_for_each_entry(tmp, &producers, node) {
- if (tmp->token != producer->token)
+ if (tmp->eventfd != producer->eventfd)
continue;
list_for_each_entry(consumer, &consumers, node) {
- if (consumer->token == producer->token) {
+ if (consumer->eventfd == producer->eventfd) {
__disconnect(producer, consumer);
break;
}
}
+ producer->eventfd = NULL;
list_del(&producer->node);
module_put(THIS_MODULE);
break;
}
+ WARN_ON_ONCE(producer->eventfd);
mutex_unlock(&lock);
module_put(THIS_MODULE);
@@ -172,18 +177,22 @@ EXPORT_SYMBOL_GPL(irq_bypass_unregister_producer);
/**
* irq_bypass_register_consumer - register IRQ bypass consumer
* @consumer: pointer to consumer structure
+ * @eventfd: pointer to the eventfd context associated with the consumer
*
* Add the provided IRQ consumer to the list of consumers and connect
- * with any matching token found on the IRQ producer list.
+ * with any matching eventfd found on the IRQ producer list.
*/
-int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
+int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer,
+ struct eventfd_ctx *eventfd)
{
struct irq_bypass_consumer *tmp;
struct irq_bypass_producer *producer;
int ret;
- if (!consumer->token ||
- !consumer->add_producer || !consumer->del_producer)
+ if (WARN_ON_ONCE(consumer->eventfd))
+ return -EINVAL;
+
+ if (!consumer->add_producer || !consumer->del_producer)
return -EINVAL;
might_sleep();
@@ -194,14 +203,14 @@ int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
mutex_lock(&lock);
list_for_each_entry(tmp, &consumers, node) {
- if (tmp->token == consumer->token || tmp == consumer) {
+ if (tmp->eventfd == eventfd) {
ret = -EBUSY;
goto out_err;
}
}
list_for_each_entry(producer, &producers, node) {
- if (producer->token == consumer->token) {
+ if (producer->eventfd == eventfd) {
ret = __connect(producer, consumer);
if (ret)
goto out_err;
@@ -209,6 +218,7 @@ int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
}
}
+ consumer->eventfd = eventfd;
list_add(&consumer->node, &consumers);
mutex_unlock(&lock);
@@ -233,7 +243,7 @@ void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer)
struct irq_bypass_consumer *tmp;
struct irq_bypass_producer *producer;
- if (!consumer->token)
+ if (!consumer->eventfd)
return;
might_sleep();
@@ -248,17 +258,19 @@ void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer)
continue;
list_for_each_entry(producer, &producers, node) {
- if (producer->token == consumer->token) {
+ if (producer->eventfd == consumer->eventfd) {
__disconnect(producer, consumer);
break;
}
}
+ consumer->eventfd = NULL;
list_del(&consumer->node);
module_put(THIS_MODULE);
break;
}
+ WARN_ON_ONCE(consumer->eventfd);
mutex_unlock(&lock);
module_put(THIS_MODULE);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0101/1167] vhost-vdpa: drop the parents vq callback before the call fd is released
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (99 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0100/1167] irqbypass: Take ownership of producer/consumer token tracking Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0102/1167] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
` (556 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yu Zhang, Michael S. Tsirkin,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Zhang <yuz08559@gmail.com>
[ Upstream commit c9c1c1b7b31fc8b9a5d6c04f5f0ae647d081a39d ]
VHOST_SET_VRING_CALL releases the previous call eventfd inside
vhost_vring_ioctl() -- it swaps the new context into vq->call_ctx.ctx
and then eventfd_ctx_put()s the old one, which is a synchronous
kfree(). The parent vdpa device is only told about the change
afterwards, when vhost_vdpa_vring_ioctl() reaches ops->set_vq_cb().
Parent drivers cache the pointer handed to them in
vdpa_callback::trigger and do not take a reference on it, so
throughout that window the parent holds a dangling eventfd_ctx and may
signal it. The documentation added with the field describes what
signalling it means but says nothing about how long it stays valid.
This is the same hazard that "vhost_vdpa: assign irq bypass producer
token correctly" addressed for the irq bypass producer token, by
moving vhost_vdpa_unsetup_vq_irq() ahead of the vhost_vring_ioctl()
call. The producer token was only one of the two consumers of that
pointer; the one the parent keeps via ->set_vq_cb() was left behind
the free.
With VDUSE the window is directly reachable from userspace, because
the device emulation daemon can inject an interrupt at any time from a
different fd, and neither side shares a lock with the other: VDUSE
takes vq->irq_lock, vhost takes vhost_dev.mutex + vq->mutex.
BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x76/0xe0
Write of size 4 at addr ffff8881084e8788 by task vduse_uaf/2987
_raw_spin_lock_irqsave+0x76/0xe0
eventfd_signal_mask+0x69/0x120
vduse_dev_ioctl+0x337/0x1a60 <- vduse_vq_signal_irqfd(), inlined
__x64_sys_ioctl+0x120/0x170 <- VDUSE_VQ_INJECT_IRQ
Allocated by task 2986:
do_eventfd+0x50/0x200
__x64_sys_eventfd2+0x2e/0x40
kmalloc-64, freed 64-byte region [ffff8881084e8780, ffff8881084e87c0)
One thread loops VHOST_SET_VRING_CALL on /dev/vhost-vdpa-N with a
fresh eventfd and then unbinds it, while another loops
VDUSE_VQ_INJECT_IRQ on /dev/vduse/<name>. This reproduces in 5 out of
5 ten-second runs on v7.1.6 and 3 out of 3 on v7.2-rc6. With the patch
there are no reports in 3 out of 3 runs on either, while the same
workload still gets ~30000 interrupts per run delivered into live
eventfds, so the path is still being exercised.
Tell the parent to drop the callback before vhost_vring_ioctl() can
free the eventfd, mirroring what is already done for the bypass
producer, and restore it if the ioctl fails -- on failure the swap
never happened, the old context is still installed, and leaving the
parent without a callback would silently drop that vq's interrupts.
Clearing the callback only stops a parent from starting to use the
context; a handler that already loaded it can still be running. For
parents with a real interrupt, wait for it with synchronize_irq() on
the vq's irq. VDUSE does not implement get_vq_irq, so that case stays
covered by the teardown above.
Fixes: 5e68470f4e80 ("vdpa: Add eventfd for the vdpa callback")
Signed-off-by: Yu Zhang <yuz08559@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260918040436.47982-1-yuz08559@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/vdpa.c | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 9a4f33b0ccf7a..ac0da85b6df81 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -711,13 +711,46 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
if (ops->get_status(vdpa) &
VIRTIO_CONFIG_S_DRIVER_OK)
vhost_vdpa_unsetup_vq_irq(v, idx);
+ /*
+ * The parent caches call_ctx.ctx in cb.trigger without
+ * holding a reference, so it has to stop using it
+ * before vhost_vring_ioctl() drops the last one.
+ */
+ cb.callback = NULL;
+ cb.private = NULL;
+ cb.trigger = NULL;
+ ops->set_vq_cb(vdpa, idx, &cb);
+
+ /*
+ * A parent interrupt handler that loaded the callback
+ * before that store can still be running, so wait for
+ * it to finish with the context too.
+ */
+ if (ops->get_vq_irq) {
+ int irq = ops->get_vq_irq(vdpa, idx);
+
+ if (irq >= 0)
+ synchronize_irq(irq);
+ }
}
break;
}
r = vhost_vring_ioctl(&v->vdev, cmd, argp);
- if (r)
+ if (r) {
+ /*
+ * A failure here means the swap never happened and the old
+ * context is still installed, so give the parent back the
+ * callback that was torn down above.
+ */
+ if (cmd == VHOST_SET_VRING_CALL && vq->call_ctx.ctx) {
+ cb.callback = vhost_vdpa_virtqueue_cb;
+ cb.private = vq;
+ cb.trigger = vq->call_ctx.ctx;
+ ops->set_vq_cb(vdpa, idx, &cb);
+ }
return r;
+ }
switch (cmd) {
case VHOST_SET_VRING_ADDR:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0102/1167] virtio_blk: Reset device on probe error paths after DRIVER_OK
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (100 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0101/1167] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0103/1167] regulator: qcom_spmi: Drop unnecessary of_find_property() call Greg Kroah-Hartman
` (555 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuho Choi, Stefan Hajnoczi,
Michael S. Tsirkin, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuho Choi <oss.patchbox@gmail.com>
[ Upstream commit f4f6e9a9cb349003d333f0776de94f12ac95b8d2 ]
virtblk_probe() marks the device ready before revalidating zones and
adding the disk, and either of those can fail. The out_cleanup_disk path
they take goes on to delete the virtqueues, but nothing tells the device
to stop first, so it is still live when the rings are freed.
Reset the device at out_cleanup_disk, which is only reachable after
virtio_device_ready(). virtblk_remove() and virtblk_freeze_priv() both
reset before deleting the virtqueues for the same reason.
Fixes: dbb301f91fc8 ("virtio_blk: add error handling support for add_disk()")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260922211207.523999-1-oss.patchbox@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/virtio_blk.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 1aeb44304f37a..49ce9ef8e8cfb 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1580,6 +1580,7 @@ static int virtblk_probe(struct virtio_device *vdev)
return 0;
out_cleanup_disk:
+ virtio_reset_device(vdev);
put_disk(vblk->disk);
out_free_tags:
blk_mq_free_tag_set(&vblk->tag_set);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0103/1167] regulator: qcom_spmi: Drop unnecessary of_find_property() call
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (101 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0102/1167] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0104/1167] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
` (554 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rob Herring (Arm), Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring (Arm) <robh@kernel.org>
[ Upstream commit 7540bd3398675e54cbd7324c47be8cd3c7a6d9c5 ]
There's no need to check for presence of "qcom,saw-reg" before parsing
it. If the property doesn't exist, parsing it will return NULL.
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240828130056.3481050-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 053c50a70525 ("regulator: qcom_spmi: don't take a sleeping lock in the SAW IPI")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/qcom_spmi-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index c95f6e9c7ab57..6cd000d727824 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -2399,8 +2399,8 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
if (!match)
return -ENODEV;
- if (of_find_property(node, "qcom,saw-reg", &lenp)) {
- syscon = of_parse_phandle(node, "qcom,saw-reg", 0);
+ syscon = of_parse_phandle(node, "qcom,saw-reg", 0);
+ if (syscon) {
saw_regmap = syscon_node_to_regmap(syscon);
of_node_put(syscon);
if (IS_ERR(saw_regmap))
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0104/1167] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (102 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0103/1167] regulator: qcom_spmi: Drop unnecessary of_find_property() call Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0105/1167] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
` (553 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Konrad Dybcio,
Mark Brown, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
[ Upstream commit 053c50a7052549aab0d310ad505947db3e211592 ]
The SAW voltage change runs on CPU 0 from an IPI, but it reaches the SAW
registers through the syscon regmap, which is protected by a spinlock_t.
That is a sleeping lock on PREEMPT_RT, and lockdep complains as soon as
VDD_APCC actually changes voltage:
BUG: Invalid wait context
...
regmap_lock_spinlock+0x18/0x30
regmap_read+0x3c/0x78
spmi_saw_set_vdd+0x50/0x1ac
__flush_smp_call_function_queue+0x1ac/0x334
Map the SAW with a regmap of our own that uses a raw spinlock, and fail
the probe when that cannot be done instead of carrying an error pointer
around as the SAW regmap.
Fixes: 0caecaa87202 ("regulator: qcom_spmi: Add support for SAW")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20261019-fix-qcom-saw-v1-3-9c7ba3fc2493@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/Kconfig | 1 +
drivers/regulator/qcom_spmi-regulator.c | 35 +++++++++++++++++++------
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 9c61842d8367a..b56bdb12a6b8a 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -1056,6 +1056,7 @@ config REGULATOR_QCOM_SMD_RPM
config REGULATOR_QCOM_SPMI
tristate "Qualcomm SPMI regulator driver"
depends on SPMI || COMPILE_TEST
+ select REGMAP_MMIO
help
If you say yes to this option, support will be included for the
regulators found in Qualcomm SPMI PMICs.
diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 6cd000d727824..4a7f380334110 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -12,13 +12,13 @@
#include <linux/bitops.h>
#include <linux/slab.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/ktime.h>
#include <linux/regulator/driver.h>
#include <linux/regmap.h>
#include <linux/list.h>
-#include <linux/mfd/syscon.h>
#include <linux/io.h>
/* Pin control enable input pins. */
@@ -1332,6 +1332,14 @@ static irqreturn_t spmi_regulator_vs_ocp_isr(int irq, void *data)
static struct regmap *saw_regmap;
+static const struct regmap_config saw_regmap_config = {
+ .name = "saw",
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+ .use_raw_spinlock = true,
+};
+
static void spmi_saw_set_vdd(void *data)
{
u32 vctl, data3, avs_ctl, pmic_sts;
@@ -2380,7 +2388,8 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
const char *name;
struct device *dev = &pdev->dev;
struct device_node *node = pdev->dev.of_node;
- struct device_node *syscon, *reg_node;
+ struct device_node *saw, *reg_node;
+ void __iomem *saw_base;
struct property *reg_prop;
int ret, lenp;
struct list_head *vreg_list;
@@ -2399,12 +2408,22 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
if (!match)
return -ENODEV;
- syscon = of_parse_phandle(node, "qcom,saw-reg", 0);
- if (syscon) {
- saw_regmap = syscon_node_to_regmap(syscon);
- of_node_put(syscon);
- if (IS_ERR(saw_regmap))
- dev_err(dev, "ERROR reading SAW regmap\n");
+ saw = of_parse_phandle(node, "qcom,saw-reg", 0);
+ if (saw) {
+ saw_base = devm_of_iomap(dev, saw, 0, NULL);
+ of_node_put(saw);
+ if (IS_ERR(saw_base))
+ return dev_err_probe(dev, PTR_ERR(saw_base),
+ "failed to map the SAW\n");
+
+ saw_regmap = devm_regmap_init_mmio(dev, saw_base,
+ &saw_regmap_config);
+ if (IS_ERR(saw_regmap)) {
+ ret = PTR_ERR(saw_regmap);
+ saw_regmap = NULL;
+ return dev_err_probe(dev, ret,
+ "failed to set the SAW regmap up\n");
+ }
}
for (reg = match->data; reg->name; reg++) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0105/1167] net: sparx5/lan969x: release the in-flight slot of a stale TX skb
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (103 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0104/1167] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0106/1167] gpio: mpc8xxx: Convert to platform remove callback returning void Greg Kroah-Hartman
` (552 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Machon, Simon Horman,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Machon <daniel.machon@microchip.com>
[ Upstream commit 873363ac591a1774aa3ced84f7ea3d93a3eb9b07 ]
sparx5_ptp_txtstamp_request() counts every two step TX skb waiting for
its timestamp in sparx5->ptp_skbs, and refuses new ones once
SPARX5_MAX_PTP_ID are in flight. sparx5_ptp_txtstamp_old_release()
frees the skbs that have waited longer than SPARX5_PTP_TIMEOUT.
Before this patch, old_release() does not decrement ptp_skbs, so every
skb whose timestamp never arrives, for example because the switch
discarded the frame, keeps its slot forever. Once SPARX5_MAX_PTP_ID
slots are lost, two step frames fail to transmit on every port of the
switch.
Return the number of released skbs from old_release() and subtract it
from ptp_skbs in txtstamp_request(), under the ptp_ts_id_lock it already
takes.
This fixes the accounting only. A port's stale skbs are still aged out
only when that port sends a two step frame, so a port that stops sending
them keeps its stale skbs, and their slots, until it sends one again.
That behaviour is unchanged by this patch.
Found by an AI code review agent. Reproduced on a lan9696 board with a
modified kernel that drops the TX timestamps of two step frames, after
which two step timestamping stopped working on the port. With the fix,
timestamping keeps working on that board and on a sparx5 PCB135 board.
Fixes: 70dfe25cd866 ("net: sparx5: Update extraction/injection for timestamping")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261029-sparx5-ptp-stale-tx-slot-v1-1-ec15f391bbb7@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c b/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
index 6b2dbfbeef377..7e665e0892021 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
@@ -200,9 +200,10 @@ static void sparx5_ptp_classify(struct sparx5_port *port, struct sk_buff *skb,
*rew_op = IFH_REW_OP_TWO_STEP_PTP;
}
-static void sparx5_ptp_txtstamp_old_release(struct sparx5_port *port)
+static unsigned int sparx5_ptp_txtstamp_old_release(struct sparx5_port *port)
{
struct sk_buff *skb, *skb_tmp;
+ unsigned int purged = 0;
unsigned long flags;
spin_lock_irqsave(&port->tx_skbs.lock, flags);
@@ -213,8 +214,11 @@ static void sparx5_ptp_txtstamp_old_release(struct sparx5_port *port)
__skb_unlink(skb, &port->tx_skbs);
dev_kfree_skb_any(skb);
+ purged++;
}
spin_unlock_irqrestore(&port->tx_skbs.lock, flags);
+
+ return purged;
}
int sparx5_ptp_txtstamp_request(struct sparx5_port *port,
@@ -222,6 +226,7 @@ int sparx5_ptp_txtstamp_request(struct sparx5_port *port,
{
struct sparx5 *sparx5 = port->sparx5;
u8 rew_op, pdu_type, pdu_w16_offset;
+ unsigned int purged;
unsigned long flags;
sparx5_ptp_classify(port, skb, &rew_op, &pdu_type, &pdu_w16_offset);
@@ -232,9 +237,10 @@ int sparx5_ptp_txtstamp_request(struct sparx5_port *port,
if (rew_op != IFH_REW_OP_TWO_STEP_PTP)
return 0;
- sparx5_ptp_txtstamp_old_release(port);
+ purged = sparx5_ptp_txtstamp_old_release(port);
spin_lock_irqsave(&sparx5->ptp_ts_id_lock, flags);
+ sparx5->ptp_skbs -= purged;
if (sparx5->ptp_skbs == SPARX5_MAX_PTP_ID) {
spin_unlock_irqrestore(&sparx5->ptp_ts_id_lock, flags);
return -EBUSY;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0106/1167] gpio: mpc8xxx: Convert to platform remove callback returning void
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (104 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0105/1167] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0107/1167] gpio: mpc8xxx: Add wake on GPIO support Greg Kroah-Hartman
` (551 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Uwe Kleine-König, Linus Walleij,
Bartosz Golaszewski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[ Upstream commit 7a222f57d856c30433e5a526fc1bcc42fc8d92b1 ]
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Stable-dep-of: 9e4b35c95fed ("gpio: mpc8xxx: Fix potential use-after-free of IRQ domain")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mpc8xxx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index ebf2f511df597..c0125ac739066 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -419,7 +419,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
return ret;
}
-static int mpc8xxx_remove(struct platform_device *pdev)
+static void mpc8xxx_remove(struct platform_device *pdev)
{
struct mpc8xxx_gpio_chip *mpc8xxx_gc = platform_get_drvdata(pdev);
@@ -427,8 +427,6 @@ static int mpc8xxx_remove(struct platform_device *pdev)
irq_set_chained_handler_and_data(mpc8xxx_gc->irqn, NULL, NULL);
irq_domain_remove(mpc8xxx_gc->irq);
}
-
- return 0;
}
#ifdef CONFIG_ACPI
@@ -441,7 +439,7 @@ MODULE_DEVICE_TABLE(acpi, gpio_acpi_ids);
static struct platform_driver mpc8xxx_plat_driver = {
.probe = mpc8xxx_probe,
- .remove = mpc8xxx_remove,
+ .remove_new = mpc8xxx_remove,
.driver = {
.name = "gpio-mpc8xxx",
.of_match_table = mpc8xxx_gpio_ids,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0107/1167] gpio: mpc8xxx: Add wake on GPIO support
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (105 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0106/1167] gpio: mpc8xxx: Convert to platform remove callback returning void Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0108/1167] gpio: mpc8xxx: use a helper variable to store the address of pdev->dev Greg Kroah-Hartman
` (550 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Martyn Welch, Bartosz Golaszewski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martyn Welch <martyn.welch@collabora.com>
[ Upstream commit e9482dc50ab2cb81b7735180345c48ada87205a5 ]
The mpc8xxx GPIO can generate an interrupt on state change. This
interrupt can be used to wake up the device from its sleep state if
enabled to do so. Add required support to the driver so that the GPIO
can be used in this way.
In order for the GPIO to actually function in this way, it is necessary
to also set the GPIO bit in the RCPM. This can be done via the device
tree fsl,rcpm-wakeup property.
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Link: https://lore.kernel.org/r/20240820143328.1987442-1-martyn.welch@collabora.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Stable-dep-of: 9e4b35c95fed ("gpio: mpc8xxx: Fix potential use-after-free of IRQ domain")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mpc8xxx.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index c0125ac739066..ab30c911c9d50 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -413,6 +413,8 @@ static int mpc8xxx_probe(struct platform_device *pdev)
goto err;
}
+ device_init_wakeup(&pdev->dev, true);
+
return 0;
err:
irq_domain_remove(mpc8xxx_gc->irq);
@@ -429,6 +431,31 @@ static void mpc8xxx_remove(struct platform_device *pdev)
}
}
+#ifdef CONFIG_PM
+static int mpc8xxx_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct mpc8xxx_gpio_chip *mpc8xxx_gc = platform_get_drvdata(pdev);
+
+ if (mpc8xxx_gc->irqn && device_may_wakeup(&pdev->dev))
+ enable_irq_wake(mpc8xxx_gc->irqn);
+
+ return 0;
+}
+
+static int mpc8xxx_resume(struct platform_device *pdev)
+{
+ struct mpc8xxx_gpio_chip *mpc8xxx_gc = platform_get_drvdata(pdev);
+
+ if (mpc8xxx_gc->irqn && device_may_wakeup(&pdev->dev))
+ disable_irq_wake(mpc8xxx_gc->irqn);
+
+ return 0;
+}
+#else
+#define mpc8xxx_suspend NULL
+#define mpc8xxx_resume NULL
+#endif
+
#ifdef CONFIG_ACPI
static const struct acpi_device_id gpio_acpi_ids[] = {
{"NXP0031",},
@@ -440,6 +467,8 @@ MODULE_DEVICE_TABLE(acpi, gpio_acpi_ids);
static struct platform_driver mpc8xxx_plat_driver = {
.probe = mpc8xxx_probe,
.remove_new = mpc8xxx_remove,
+ .suspend = mpc8xxx_suspend,
+ .resume = mpc8xxx_resume,
.driver = {
.name = "gpio-mpc8xxx",
.of_match_table = mpc8xxx_gpio_ids,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0108/1167] gpio: mpc8xxx: use a helper variable to store the address of pdev->dev
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (106 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0107/1167] gpio: mpc8xxx: Add wake on GPIO support Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0109/1167] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
` (549 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Bartosz Golaszewski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
[ Upstream commit 2707a028c9b9c54a6dff22c9dcfebf3083ea095e ]
Instead of repeatedly dereferencing pdev, just store the address of the
embedded struct device in a local variable and use it instead for
improved readability.
While at it: rearrange variable declarations.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20241009162910.33477-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Stable-dep-of: 9e4b35c95fed ("gpio: mpc8xxx: Fix potential use-after-free of IRQ domain")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mpc8xxx.c | 48 +++++++++++++++++--------------------
1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index ab30c911c9d50..6116035dca557 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -298,14 +298,15 @@ static const struct of_device_id mpc8xxx_gpio_ids[] = {
static int mpc8xxx_probe(struct platform_device *pdev)
{
+ const struct mpc8xxx_gpio_devtype *devtype = NULL;
struct device_node *np = pdev->dev.of_node;
struct mpc8xxx_gpio_chip *mpc8xxx_gc;
- struct gpio_chip *gc;
- const struct mpc8xxx_gpio_devtype *devtype = NULL;
+ struct device *dev = &pdev->dev;
struct fwnode_handle *fwnode;
+ struct gpio_chip *gc;
int ret;
- mpc8xxx_gc = devm_kzalloc(&pdev->dev, sizeof(*mpc8xxx_gc), GFP_KERNEL);
+ mpc8xxx_gc = devm_kzalloc(dev, sizeof(*mpc8xxx_gc), GFP_KERNEL);
if (!mpc8xxx_gc)
return -ENOMEM;
@@ -318,32 +319,28 @@ static int mpc8xxx_probe(struct platform_device *pdev)
return PTR_ERR(mpc8xxx_gc->regs);
gc = &mpc8xxx_gc->gc;
- gc->parent = &pdev->dev;
-
- if (device_property_read_bool(&pdev->dev, "little-endian")) {
- ret = bgpio_init(gc, &pdev->dev, 4,
- mpc8xxx_gc->regs + GPIO_DAT,
- NULL, NULL,
- mpc8xxx_gc->regs + GPIO_DIR, NULL,
- BGPIOF_BIG_ENDIAN);
+ gc->parent = dev;
+
+ if (device_property_read_bool(dev, "little-endian")) {
+ ret = bgpio_init(gc, dev, 4, mpc8xxx_gc->regs + GPIO_DAT,
+ NULL, NULL, mpc8xxx_gc->regs + GPIO_DIR,
+ NULL, BGPIOF_BIG_ENDIAN);
if (ret)
return ret;
- dev_dbg(&pdev->dev, "GPIO registers are LITTLE endian\n");
+ dev_dbg(dev, "GPIO registers are LITTLE endian\n");
} else {
- ret = bgpio_init(gc, &pdev->dev, 4,
- mpc8xxx_gc->regs + GPIO_DAT,
- NULL, NULL,
- mpc8xxx_gc->regs + GPIO_DIR, NULL,
- BGPIOF_BIG_ENDIAN
+ ret = bgpio_init(gc, dev, 4, mpc8xxx_gc->regs + GPIO_DAT,
+ NULL, NULL, mpc8xxx_gc->regs + GPIO_DIR,
+ NULL, BGPIOF_BIG_ENDIAN
| BGPIOF_BIG_ENDIAN_BYTE_ORDER);
if (ret)
return ret;
- dev_dbg(&pdev->dev, "GPIO registers are BIG endian\n");
+ dev_dbg(dev, "GPIO registers are BIG endian\n");
}
mpc8xxx_gc->direction_output = gc->direction_output;
- devtype = device_get_match_data(&pdev->dev);
+ devtype = device_get_match_data(dev);
if (!devtype)
devtype = &mpc8xxx_gpio_devtype_default;
@@ -368,7 +365,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
* associated input enable must be set (GPIOxGPIE[IEn]=1) to propagate
* the port value to the GPIO Data Register.
*/
- fwnode = dev_fwnode(&pdev->dev);
+ fwnode = dev_fwnode(dev);
if (of_device_is_compatible(np, "fsl,qoriq-gpio") ||
of_device_is_compatible(np, "fsl,ls1028a-gpio") ||
of_device_is_compatible(np, "fsl,ls1088a-gpio") ||
@@ -379,9 +376,9 @@ static int mpc8xxx_probe(struct platform_device *pdev)
gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR);
}
- ret = devm_gpiochip_add_data(&pdev->dev, gc, mpc8xxx_gc);
+ ret = devm_gpiochip_add_data(dev, gc, mpc8xxx_gc);
if (ret) {
- dev_err(&pdev->dev,
+ dev_err(dev,
"GPIO chip registration failed with status %d\n", ret);
return ret;
}
@@ -402,18 +399,17 @@ static int mpc8xxx_probe(struct platform_device *pdev)
gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, 0xffffffff);
gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, 0);
- ret = devm_request_irq(&pdev->dev, mpc8xxx_gc->irqn,
+ ret = devm_request_irq(dev, mpc8xxx_gc->irqn,
mpc8xxx_gpio_irq_cascade,
IRQF_NO_THREAD | IRQF_SHARED, "gpio-cascade",
mpc8xxx_gc);
if (ret) {
- dev_err(&pdev->dev,
- "failed to devm_request_irq(%d), ret = %d\n",
+ dev_err(dev, "failed to devm_request_irq(%d), ret = %d\n",
mpc8xxx_gc->irqn, ret);
goto err;
}
- device_init_wakeup(&pdev->dev, true);
+ device_init_wakeup(dev, true);
return 0;
err:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0109/1167] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (107 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0108/1167] gpio: mpc8xxx: use a helper variable to store the address of pdev->dev Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0110/1167] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
` (548 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Bartosz Golaszewski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
[ Upstream commit 9e4b35c95fede87bad36f68b7ff1eae94ea6b910 ]
GPIO chip cleanup can call the to_irq callback while releasing requested
GPIOs. Removing the IRQ domain first leaves that callback using a freed
domain, both on removal and after an IRQ request failure.
Register domain cleanup before GPIO chip registration so devres removes
the chip before freeing the domain.
This issue was found by our static analysis tool under development.
Fixes: 257e10752c13 ("gpio: mpc8xxx: Use of_mm_gpiochip_remove")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
Link: https://patch.msgid.link/a4fec7fe970d6fc9135b488f57ba7e145b809359.1793377433.git.liguangshuo@mail.sdu.edu.cn
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mpc8xxx.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index 6116035dca557..2817bc966285b 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -296,6 +296,14 @@ static const struct of_device_id mpc8xxx_gpio_ids[] = {
{}
};
+static void mpc8xxx_irq_domain_remove(void *data)
+{
+ struct mpc8xxx_gpio_chip *mpc8xxx_gc = data;
+
+ if (mpc8xxx_gc->irq)
+ irq_domain_remove(mpc8xxx_gc->irq);
+}
+
static int mpc8xxx_probe(struct platform_device *pdev)
{
const struct mpc8xxx_gpio_devtype *devtype = NULL;
@@ -376,6 +384,11 @@ static int mpc8xxx_probe(struct platform_device *pdev)
gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR);
}
+ /* GPIO chip cleanup still needs the IRQ domain. */
+ ret = devm_add_action_or_reset(dev, mpc8xxx_irq_domain_remove, mpc8xxx_gc);
+ if (ret)
+ return ret;
+
ret = devm_gpiochip_add_data(dev, gc, mpc8xxx_gc);
if (ret) {
dev_err(dev,
@@ -406,25 +419,20 @@ static int mpc8xxx_probe(struct platform_device *pdev)
if (ret) {
dev_err(dev, "failed to devm_request_irq(%d), ret = %d\n",
mpc8xxx_gc->irqn, ret);
- goto err;
+ return ret;
}
device_init_wakeup(dev, true);
return 0;
-err:
- irq_domain_remove(mpc8xxx_gc->irq);
- return ret;
}
static void mpc8xxx_remove(struct platform_device *pdev)
{
struct mpc8xxx_gpio_chip *mpc8xxx_gc = platform_get_drvdata(pdev);
- if (mpc8xxx_gc->irq) {
+ if (mpc8xxx_gc->irq)
irq_set_chained_handler_and_data(mpc8xxx_gc->irqn, NULL, NULL);
- irq_domain_remove(mpc8xxx_gc->irq);
- }
}
#ifdef CONFIG_PM
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0110/1167] net/iucv: take a private, writable frame before rewriting it in place
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (108 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0109/1167] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0111/1167] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
` (547 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bryam Vargas, Simon Horman,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryam Vargas <hexlabsecurity@proton.me>
[ Upstream commit f38bce9af9e2a3cced7d303a1476f21c1f42bcb7 ]
afiucv_hs_rcv() rewrites the frame in place -- EBCASC() on four name
fields, then afiucv_swap_src_dest() swaps them and pushes an Ethernet
header -- and can hand the same skb to dev_queue_xmit(), without making
it private first, so a packet socket that also gets the frame reads the
rewritten names. An ETH_P_ALL tap runs first and leaves af_iucv a
cloned skb; a socket opened for ETH_P_AF_IUCV sits on a ptype_specific
list, walked after ptype_base[], so deliver_skb() takes a reference and
af_iucv runs on an skb that is shared but not cloned.
Unshare, then cow, in that order: skb_cow() can reach
pskb_expand_head(), which has BUG_ON(skb_shared()). skb_cow() tests
skb_cloned(), which is what a rewrite of the data needs; skb_cow_head()
tests only the header. Asking for ETH_HLEN also covers the unchecked
push in afiucv_swap_src_dest(); on the ordinary path eth_type_trans()
has already pulled that much, so it only compares.
Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
Closes: https://sashiko.dev/#/patchset/20260813-b4-disp-60433a46-v1-1-509e1200533e@proton.me?part=1
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261028-b4-disp-1edbbc34-v3-1-13495411f5b9@proton.me
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/iucv/af_iucv.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index c56bf6d96ac01..ae459478c1eca 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -2073,11 +2073,20 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev,
int err = NET_RX_SUCCESS;
char nullstring[8];
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
+ return NET_RX_SUCCESS;
+
if (!pskb_may_pull(skb, sizeof(*trans_hdr))) {
kfree_skb(skb);
return NET_RX_SUCCESS;
}
+ if (skb_cow(skb, ETH_HLEN)) {
+ kfree_skb(skb);
+ return NET_RX_SUCCESS;
+ }
+
trans_hdr = iucv_trans_hdr(skb);
EBCASC(trans_hdr->destAppName, sizeof(trans_hdr->destAppName));
EBCASC(trans_hdr->destUserID, sizeof(trans_hdr->destUserID));
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0111/1167] ASoC: meson: axg-fifo: request the irq with the clock enabled
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (109 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0110/1167] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0112/1167] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
` (546 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jerome Brunet, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Brunet <jbrunet@baylibre.com>
[ Upstream commit 82fa7bfab6b961a03d6575348334e0ec15fdc712 ]
The fifo irq handler accesses registers which need pclk, but the irq is
requested before pclk is enabled on open and freed after it is disabled
on close.
Request the irq after enabling pclk and masking the fifo irqs.
Free it before disabling pclk.
Fixes: 6dc4fa179fb8 ("ASoC: meson: add axg fifo base driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-30e88a8a-f33a-40f0-92aa-9ea62c5b7299
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20261030-asoc-axg-fifo-irq-clock-v1-1-f8c170ac8b0d@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/meson/axg-fifo.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c
index 5218e40aeb1bb..4a81aa3f384f0 100644
--- a/sound/soc/meson/axg-fifo.c
+++ b/sound/soc/meson/axg-fifo.c
@@ -244,17 +244,10 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
if (ret)
return ret;
- /* Use the threaded irq handler only with non-atomic links */
- ret = request_threaded_irq(fifo->irq, NULL,
- axg_fifo_pcm_irq_block,
- IRQF_ONESHOT, dev_name(dev), ss);
- if (ret)
- return ret;
-
/* Enable pclk to access registers and clock the fifo ip */
ret = clk_prepare_enable(fifo->pclk);
if (ret)
- goto free_irq;
+ return ret;
/* Setup status2 so it reports the memory pointer */
regmap_update_bits(fifo->map, FIFO_CTRL1,
@@ -271,17 +264,24 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
/* Clear any pending interrupt */
axg_fifo_ack_irq(fifo, FIFO_INT_MASK);
+ /* Use the threaded irq handler only with non-atomic links */
+ ret = request_threaded_irq(fifo->irq, NULL,
+ axg_fifo_pcm_irq_block,
+ IRQF_ONESHOT, dev_name(dev), ss);
+ if (ret)
+ goto free_clk;
+
/* Take memory arbitror out of reset */
ret = reset_control_deassert(fifo->arb);
if (ret)
- goto free_clk;
+ goto free_irq;
return 0;
-free_clk:
- clk_disable_unprepare(fifo->pclk);
free_irq:
free_irq(fifo->irq, ss);
+free_clk:
+ clk_disable_unprepare(fifo->pclk);
return ret;
}
EXPORT_SYMBOL_GPL(axg_fifo_pcm_open);
@@ -295,12 +295,12 @@ int axg_fifo_pcm_close(struct snd_soc_component *component,
/* Put the memory arbitror back in reset */
ret = reset_control_assert(fifo->arb);
- /* Disable fifo ip and register access */
- clk_disable_unprepare(fifo->pclk);
-
/* remove IRQ */
free_irq(fifo->irq, ss);
+ /* Disable fifo ip and register access */
+ clk_disable_unprepare(fifo->pclk);
+
return ret;
}
EXPORT_SYMBOL_GPL(axg_fifo_pcm_close);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0112/1167] Bluetooth: hci_core: Initialize IRK before publication
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (110 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0111/1167] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0113/1167] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
` (545 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Binbin Deng <18983559317@163.com>
[ Upstream commit f0cf5a24cefeb629876bd15d668ff062c8655e28 ]
hci_add_irk() initializes the identity address and address type of a newly
allocated IRK, publishes it on hdev->identity_resolving_keys, and only then
initializes its value and RPA. RCU readers such as hci_find_irk_by_rpa()
and the debugfs identity_resolving_keys_show() can traverse the new entry
during that window and see a zero or partially initialized IRK.
The race is reachable by racing an IRK addition with another CPU resolving
or dumping IRKs. In particular, userspace can issue MGMT_OP_LOAD_IRKS
while another process reads the corresponding debugfs file or triggers RPA
resolution.
Initialize the IRK value and RPA before publishing a newly allocated IRK.
Existing IRKs remain published and continue to be updated in place.
Found during a static-analysis-assisted audit: candidate sites were
surfaced by a Coccinelle rule, and the reader/writer paths were
confirmed by LLM-assisted (GLM-5.3) code inspection. The issue was
not observed at runtime; it is identified by code inspection only.
Fixes: adae20cb2d20 ("Bluetooth: Convert IRK list to RCU")
Assisted-by: GLM-5.3 coccinelle
Signed-off-by: Binbin Deng <18983559317@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 5f58b24ec900b..d8e95cd09d091 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1347,9 +1347,10 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr,
u8 addr_type, u8 val[16], bdaddr_t *rpa)
{
- struct smp_irk *irk;
+ struct smp_irk *irk, *old_irk;
- irk = hci_find_irk_by_addr(hdev, bdaddr, addr_type);
+ old_irk = hci_find_irk_by_addr(hdev, bdaddr, addr_type);
+ irk = old_irk;
if (!irk) {
irk = kzalloc(sizeof(*irk), GFP_KERNEL);
if (!irk)
@@ -1358,12 +1359,14 @@ struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr,
bacpy(&irk->bdaddr, bdaddr);
irk->addr_type = addr_type;
- list_add_rcu(&irk->list, &hdev->identity_resolving_keys);
}
memcpy(irk->val, val, 16);
bacpy(&irk->rpa, rpa);
+ if (!old_irk)
+ list_add_rcu(&irk->list, &hdev->identity_resolving_keys);
+
return irk;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0113/1167] Bluetooth: hci_core: Initialize link key before publication
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (111 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0112/1167] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0114/1167] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
` (544 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Binbin Deng <18983559317@163.com>
[ Upstream commit ae9c8df1ffb84560ac01cbdc26cfb19027f4d25f ]
hci_add_link_key() allocates a new link key with kzalloc(), inserts it into
hdev->link_keys with list_add_rcu(), and only then initializes its address,
value, type, and PIN length. RCU readers such as hci_find_link_key()
and the debugfs link_keys_show() do not take hci_dev_lock, so they can
traverse the new entry during that initialization window and observe
a zero or partially initialized key.
This can be triggered by racing a link-key update with another CPU looking
up or dumping keys. In particular, userspace can issue
MGMT_OP_LOAD_LINK_KEYS while another process reads the corresponding
debugfs file.
Complete all fields of a newly allocated key before publishing it with
list_add_rcu(). Existing keys remain visible and keep their current
in-place update behavior.
Found during a static-analysis-assisted audit: candidate sites were
surfaced by a Coccinelle rule, and the reader/writer paths were
confirmed by LLM-assisted (GLM-5.3) code inspection. The issue was
not observed at runtime; it is identified by code inspection only.
Fixes: 0378b5977013 ("Bluetooth: Convert link keys list to use RCU")
Signed-off-by: Binbin Deng <18983559317@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index d8e95cd09d091..e344085aa5f7e 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1284,7 +1284,6 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
key = kzalloc(sizeof(*key), GFP_KERNEL);
if (!key)
return NULL;
- list_add_rcu(&key->list, &hdev->link_keys);
}
BT_DBG("%s key for %pMR type %u", hdev->name, bdaddr, type);
@@ -1308,6 +1307,9 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
else
key->type = type;
+ if (!old_key)
+ list_add_rcu(&key->list, &hdev->link_keys);
+
if (persistent)
*persistent = hci_persistent_key(hdev, conn, type,
old_key_type);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0114/1167] Bluetooth: hci_core: Initialize LTK before publication
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (112 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0113/1167] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0115/1167] Bluetooth: btintel: Add support for BlazarI Greg Kroah-Hartman
` (543 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Binbin Deng <18983559317@163.com>
[ Upstream commit 4335849380aa1081ee9a1c2b934cbdda0961fa57 ]
hci_add_ltk() publishes a newly allocated LTK on hdev->long_term_keys
before initializing its address, type, value, authentication state,
encryption size, EDIV, and random value. hci_find_ltk() and the debugfs
long_term_keys_show() traverse this list under RCU and can therefore see
a zero or partially initialized key before those stores complete.
The race is reachable by racing an LTK addition with another CPU looking
up or dumping long-term keys. For example, userspace can issue
MGMT_OP_LOAD_LONG_TERM_KEYS while another process reads the corresponding
debugfs file.
Initialize all fields of a new LTK before list_add_rcu() makes it visible
to RCU readers. Existing LTKs remain published and continue to be updated
in place.
Found during a static-analysis-assisted audit: candidate sites were
surfaced by a Coccinelle rule, and the reader/writer paths were
confirmed by LLM-assisted (GLM-5.3) code inspection. The issue was
not observed at runtime; it is identified by code inspection only.
Fixes: 970d0f1b2803 ("Bluetooth: Convert LTK list to RCU")
Assisted-by: GLM-5.3 coccinelle
Signed-off-by: Binbin Deng <18983559317@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index e344085aa5f7e..42b1f40c86542 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1331,7 +1331,6 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
key = kzalloc(sizeof(*key), GFP_KERNEL);
if (!key)
return NULL;
- list_add_rcu(&key->list, &hdev->long_term_keys);
}
bacpy(&key->bdaddr, bdaddr);
@@ -1343,6 +1342,9 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
key->enc_size = enc_size;
key->type = type;
+ if (!old_key)
+ list_add_rcu(&key->list, &hdev->long_term_keys);
+
return key;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0115/1167] Bluetooth: btintel: Add support for BlazarI
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (113 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0114/1167] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0116/1167] Bluetooth: Add vendor-specific packet classification for ISO data Greg Kroah-Hartman
` (542 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kiran K, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kiran K <kiran.k@intel.com>
[ Upstream commit 87ad06a20f1c8b521070ebe4cb78f68673c14a8c ]
Add support for BlazarI (cnvi) bluetooth core.
Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: 19b4e5701712 ("Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bluetooth/btintel.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 48c956c608043..8286397b96845 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -486,6 +486,7 @@ int btintel_version_info_tlv(struct hci_dev *hdev,
case 0x19: /* Slr-F */
case 0x1b: /* Mgr */
case 0x1c: /* Gale Peak (GaP) */
+ case 0x1e: /* BlazarI (Bzr) */
break;
default:
bt_dev_err(hdev, "Unsupported Intel hardware variant (0x%x)",
@@ -2666,6 +2667,7 @@ void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant)
case 0x19:
case 0x1b:
case 0x1c:
+ case 0x1e:
hci_set_msft_opcode(hdev, 0xFC1E);
break;
default:
@@ -2888,6 +2890,7 @@ static int btintel_setup_combined(struct hci_dev *hdev)
case 0x19:
case 0x1b:
case 0x1c:
+ case 0x1e:
/* Display version information of TLV type */
btintel_version_info_tlv(hdev, &ver_tlv);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0116/1167] Bluetooth: Add vendor-specific packet classification for ISO data
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (114 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0115/1167] Bluetooth: btintel: Add support for BlazarI Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0117/1167] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
` (541 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ying Hsu, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ying Hsu <yinghsu@chromium.org>
[ Upstream commit f25b7fd36cc3a850e006aed686f5bbecd200de1b ]
When HCI raw sockets are opened, the Bluetooth kernel module doesn't
track CIS/BIS connections. User-space applications have to identify
ISO data by maintaining connection information and look up the mapping
for each ACL data packet received. Besides, btsnoop log captured in
kernel couldn't tell ISO data from ACL data in this case.
To avoid additional lookups, this patch introduces vendor-specific
packet classification for Intel BT controllers to distinguish
ISO data packets from ACL data packets.
Signed-off-by: Ying Hsu <yinghsu@chromium.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: 19b4e5701712 ("Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bluetooth/btintel.c | 25 +++++++++++++++++++++++--
include/net/bluetooth/hci_core.h | 1 +
net/bluetooth/hci_core.c | 16 ++++++++++++++++
3 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 8286397b96845..6aadd6547970d 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -2581,6 +2581,24 @@ static void btintel_set_dsm_reset_method(struct hci_dev *hdev,
data->acpi_reset_method = btintel_acpi_reset_method;
}
+#define BTINTEL_ISODATA_HANDLE_BASE 0x900
+
+static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)
+{
+ /*
+ * Distinguish ISO data packets form ACL data packets
+ * based on their connection handle value range.
+ */
+ if (hci_skb_pkt_type(skb) == HCI_ACLDATA_PKT) {
+ __u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
+
+ if (hci_handle(handle) >= BTINTEL_ISODATA_HANDLE_BASE)
+ return HCI_ISODATA_PKT;
+ }
+
+ return hci_skb_pkt_type(skb);
+}
+
int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
struct intel_version_tlv *ver)
{
@@ -2885,11 +2903,14 @@ static int btintel_setup_combined(struct hci_dev *hdev)
err = btintel_bootloader_setup(hdev, &ver);
btintel_register_devcoredump_support(hdev);
break;
+ case 0x18: /* GfP2 */
+ case 0x1c: /* GaP */
+ /* Re-classify packet type for controllers with LE audio */
+ hdev->classify_pkt_type = btintel_classify_pkt_type;
+ fallthrough;
case 0x17:
- case 0x18:
case 0x19:
case 0x1b:
- case 0x1c:
case 0x1e:
/* Display version information of TLV type */
btintel_version_info_tlv(hdev, &ver_tlv);
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 62804d98d3ee2..b13687023a0f2 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -651,6 +651,7 @@ struct hci_dev {
int (*get_codec_config_data)(struct hci_dev *hdev, __u8 type,
struct bt_codec *codec, __u8 *vnd_len,
__u8 **vnd_data);
+ u8 (*classify_pkt_type)(struct hci_dev *hdev, struct sk_buff *skb);
};
#define HCI_PHY_HANDLE(handle) (handle & 0xff)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 42b1f40c86542..7248e98e23cff 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2914,15 +2914,31 @@ int hci_reset_dev(struct hci_dev *hdev)
}
EXPORT_SYMBOL(hci_reset_dev);
+static u8 hci_dev_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)
+{
+ if (hdev->classify_pkt_type)
+ return hdev->classify_pkt_type(hdev, skb);
+
+ return hci_skb_pkt_type(skb);
+}
+
/* Receive frame from HCI drivers */
int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
{
+ u8 dev_pkt_type;
+
if (!hdev || (!test_bit(HCI_UP, &hdev->flags)
&& !test_bit(HCI_INIT, &hdev->flags))) {
kfree_skb(skb);
return -ENXIO;
}
+ /* Check if the driver agree with packet type classification */
+ dev_pkt_type = hci_dev_classify_pkt_type(hdev, skb);
+ if (hci_skb_pkt_type(skb) != dev_pkt_type) {
+ hci_skb_pkt_type(skb) = dev_pkt_type;
+ }
+
switch (hci_skb_pkt_type(skb)) {
case HCI_EVENT_PKT:
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0117/1167] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (115 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0116/1167] Bluetooth: Add vendor-specific packet classification for ISO data Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0118/1167] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
` (540 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+2344fb8002f3ef5b1712,
Akhil Arul, Luiz Augusto von Dentz, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akhil Arul <akhilarul324@gmail.com>
[ Upstream commit 19b4e5701712f74d005cc66a36374559e8dfd281 ]
hci_recv_frame() drops a frame unless HCI_UP or HCI_INIT is set, but the
check is not synchronized with hci_dev_close_sync(). A driver can pass
the check, then close clears HCI_UP, flushes rx_work and starts
drain_workqueue(), and the late queue_work() of rx_work hits the
draining workqueue:
workqueue: cannot queue hci_rx_work on wq hci0
WARNING: kernel/workqueue.c:2352 at __queue_work+0x2c0/0x780
Call Trace:
queue_work_on+0xb2/0xc0
hci_recv_frame+0x18f/0x330
vhci_write+0x174/0x240
vfs_write+0x271/0x680
ksys_write+0x7c/0x110
Skipping the queue_work() while HCI_CMD_DRAIN_WORKQUEUE is set, as done
for tx_work, does not work for rx_work: the flag covers the whole close,
and events still have to be received in that window, for the commands
sent by hdev->shutdown() and for the reset done with
HCI_QUIRK_RESET_ON_CLOSE.
Run hci_recv_frame() under rcu_read_lock() and wait with
synchronize_rcu() once HCI_UP has been cleared, so that every caller
which still saw HCI_UP has queued its work before the workqueue is
drained, and later callers drop the frame.
HCI_INIT does not reopen that window. Apart from the
HCI_QUIRK_RESET_ON_CLOSE reset, which runs after drain_workqueue() has
returned, it is only set by hci_dev_init_sync() during open, and open
and close are serialized by hci_req_sync_lock. So once the grace period
has ended, nothing can pass the check and queue rx_work until the drain
is over.
Tested in qemu with the syzbot C reproducer, one run per boot: the
warning showed up on 12 of 30 boots before and on none of 42 boots after.
Bringing a vhci controller up and down 50 times behaves the same with
and without this change.
Fixes: 76727c02c1e1 ("Bluetooth: Call drain_workqueue() before resetting state")
Reported-by: syzbot+2344fb8002f3ef5b1712@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2344fb8002f3ef5b1712
Signed-off-by: Akhil Arul <akhilarul324@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 9 +++++++++
net/bluetooth/hci_sync.c | 5 +++++
2 files changed, 14 insertions(+)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 7248e98e23cff..722ddf4176a7b 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2927,8 +2927,14 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
{
u8 dev_pkt_type;
+ /* Pairs with synchronize_rcu() in hci_dev_close_sync(), so rx_work is
+ * not queued once the workqueue is being drained.
+ */
+ rcu_read_lock();
+
if (!hdev || (!test_bit(HCI_UP, &hdev->flags)
&& !test_bit(HCI_INIT, &hdev->flags))) {
+ rcu_read_unlock();
kfree_skb(skb);
return -ENXIO;
}
@@ -2959,6 +2965,7 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
case HCI_ISODATA_PKT:
break;
default:
+ rcu_read_unlock();
kfree_skb(skb);
return -EINVAL;
}
@@ -2972,6 +2979,8 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
skb_queue_tail(&hdev->rx_q, skb);
queue_work(hdev->workqueue, &hdev->rx_work);
+ rcu_read_unlock();
+
return 0;
}
EXPORT_SYMBOL(hci_recv_frame);
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index d9e8352020893..5c3deb35f4eb5 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -5433,6 +5433,11 @@ int hci_dev_close_sync(struct hci_dev *hdev)
return err;
}
+ /* Wait for hci_recv_frame() callers that still saw HCI_UP, so that
+ * none of them queues rx_work while the workqueue is drained below.
+ */
+ synchronize_rcu();
+
hci_leds_update_powered(hdev, false);
/* Flush RX and TX works */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0118/1167] Bluetooth: btintel: fix buffer over-read in fw payload
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (116 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0117/1167] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0119/1167] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
` (539 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Catherine L, Kiran K,
Luiz Augusto von Dentz, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Catherine L <catherine.l@intel.com>
[ Upstream commit f92b7bca985205082c86140d0bd7c86c5be00efc ]
The firmware decoder cast fw_ptr + frag_len to struct
hci_command_hdr and read cmd->plen before confirming the
header and payload still fit in the remaining firmware
buffer.
Add explicit bounds checks before each dereference:
1. Reject if the command header is not fully contained
in remain.
2. Reject if the full command including payload exceeds
remain.
3. Log the offending fragment length and remaining size
before returning -EINVAL.
Fixes: fbbe83c52bc0d ("Bluetooth: btintel: Create common function for firmware download")
Signed-off-by: Catherine L <catherine.l@intel.com>
Tested-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bluetooth/btintel.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 6aadd6547970d..10340df63009e 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -1070,7 +1070,29 @@ static int btintel_download_firmware_payload(struct hci_dev *hdev,
err = -EINVAL;
while (fw_ptr - fw->data < fw->size) {
- struct hci_command_hdr *cmd = (void *)(fw_ptr + frag_len);
+ struct hci_command_hdr *cmd;
+ size_t remain = fw->size - (fw_ptr - fw->data);
+
+ /* Ensure the header fits before dereferencing */
+ if (frag_len + sizeof(*cmd) > remain) {
+ bt_dev_err(hdev,
+ "Firmware buffer overrun at header (frag_len %u, need %zu, remain %zu)",
+ frag_len, frag_len + sizeof(*cmd), remain);
+ err = -EINVAL;
+ goto done;
+ }
+
+ cmd = (void *)(fw_ptr + frag_len);
+
+ /* Ensure the full command (header + payload) fits before use */
+ if (frag_len + sizeof(*cmd) + cmd->plen > remain) {
+ bt_dev_err(hdev,
+ "Firmware buffer overrun at payload (frag_len %u, plen %u, need %zu, remain %zu)",
+ frag_len, cmd->plen,
+ frag_len + sizeof(*cmd) + cmd->plen, remain);
+ err = -EINVAL;
+ goto done;
+ }
frag_len += sizeof(*cmd) + cmd->plen;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0119/1167] Bluetooth: hci_event: Clear explicit connect state on LE connection
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (117 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0118/1167] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0120/1167] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
` (538 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Dewald <kevin@simpleble.org>
[ Upstream commit f5cd268af1c6f87fb3847e98274e22b8c6324aa4 ]
Since commit 6cd29ec6ae5e ("Bluetooth: hci_sync: Wait for proper events
when connecting LE"), create_le_conn_complete() only runs once the LE
Connection Complete event has been handled, and le_conn_complete_evt()
has already removed the connection parameters from pend_le_conns by
then. hci_connect_le_scan_cleanup() looks the parameters up in
pend_le_conns, so after a successful connection it no longer clears
explicit_connect, nor deletes the parameters that were only created for
the explicit connect.
The parameters of every device connected through an explicit connect,
such as an L2CAP or ATT connect or MGMT Pair Device, are thus left with
explicit_connect set. MGMT Remove Device for all devices then keeps
them as HCI_AUTO_CONN_EXPLICIT instead of freeing them, and if the
device was set to auto-connect and is disconnected, they also stay on
pend_le_conns: the kernel keeps scanning for the device and connects to
it as soon as it advertises, although no one asked for it any more.
Do the cleanup in le_conn_complete_evt() instead, where the explicit
connect request is fulfilled: clear explicit_connect, delete the
parameters if they only existed for it, and put report parameters back
on pend_le_reports. Auto-connect parameters are added back to
pend_le_conns on disconnection, as before. Update the comment in
hci_explicit_conn_params_set() that names hci_connect_le_scan_cleanup()
as the only place deleting them.
Fixes: 6cd29ec6ae5e ("Bluetooth: hci_sync: Wait for proper events when connecting LE")
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Kevin Dewald <kevin@simpleble.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_conn.c | 5 +++--
net/bluetooth/hci_event.c | 22 ++++++++++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 7e209176d7db2..987f780a5acd8 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1414,8 +1414,9 @@ static int hci_explicit_conn_params_set(struct hci_dev *hdev,
if (!params)
return -ENOMEM;
- /* If we created new params, mark them to be deleted in
- * hci_connect_le_scan_cleanup. It's different case than
+ /* If we created new params, mark them to be deleted once the
+ * explicit connect is done, see le_conn_complete_evt() and
+ * hci_connect_le_scan_cleanup(). It's different case than
* existing disabled params, those will stay after cleanup.
*/
params->auto_connect = HCI_AUTO_CONN_EXPLICIT;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 982f96c1acb28..33e513f033c26 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5826,6 +5826,28 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
hci_conn_put(params->conn);
params->conn = NULL;
}
+
+ /* An explicit connect request is complete once connected, so
+ * clean it up here: hci_connect_le_scan_cleanup() no longer
+ * finds the params since they have just been removed from
+ * pend_le_conns.
+ */
+ if (params->explicit_connect) {
+ params->explicit_connect = false;
+
+ switch (params->auto_connect) {
+ case HCI_AUTO_CONN_EXPLICIT:
+ hci_conn_params_del(hdev, &conn->dst,
+ conn->dst_type);
+ break;
+ case HCI_AUTO_CONN_REPORT:
+ hci_pend_le_list_add(params,
+ &hdev->pend_le_reports);
+ break;
+ default:
+ break;
+ }
+ }
}
unlock:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0120/1167] Bluetooth: hci_sync: Protect resolving-list lookups
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (118 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0119/1167] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0121/1167] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
` (537 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit f05bd61a3213613de7848c8df2865492d5225023 ]
The host resolving list is updated under hdev->lock, and each
bdaddr_list_with_irk entry must remain alive throughout a lookup.
hci_le_del_resolve_list_sync() and hci_le_add_resolve_list_sync()
traverse that list without taking the lock.
On an LE privacy-capable controller with a programmed entry, passive
scan reconciliation can reach hci_le_del_resolve_list_sync() while a
privileged HCI_RAW client sends LE Clear Resolving List. The raw
command does not take req_lock, and its successful completion runs
on the controller workqueue independently of request work:
Request work Raw HCI / event work
hci_le_del_resolve_list_sync()
lookup loads a list node
hci_sock_sendmsg()
queue LE Clear Resolving List
hci_cc_le_clear_resolv_list()
take hdev->lock
unlink and free the node
release hdev->lock
read the node's address/type
The clear can free the node after the lookup loads it and before its
address/type read, causing a use-after-free. The report below shows
this access with the delete helper on the faulting stack. The add
helper uses the same unprotected lookup.
Take hdev->lock around each resolving-list membership lookup and
retain only a boolean result. This serializes traversal with clear
completion and keeps entry pointers inside the protected section.
Release the lock before issuing a synchronous HCI command, whose
completion also needs the lock.
KASAN report as below:
==================================================================
BUG: KASAN: slab-use-after-free in
hci_bdaddr_list_lookup_with_irk+0x106/0x120
Read of size 1 at addr ffff88810b036e16 by task kworker/u17:0/495
CPU: 2 UID: 0 PID: 495 Comm: kworker/u17:0 Not tainted
7.2.0-rc6-pmb-bt-functional-v1+ #3 PREEMPT(lazy)
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix,
1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Workqueue: hci0 hci_cmd_sync_work
Call Trace:
<TASK>
dump_stack_lvl+0x93/0xd0
print_report+0xce/0x630
? hci_bdaddr_list_lookup_with_irk+0x106/0x120
? srso_alias_return_thunk+0x5/0xfbef5
? __virt_addr_valid+0x20d/0x410
? hci_bdaddr_list_lookup_with_irk+0x106/0x120
kasan_report+0xe0/0x110
? hci_bdaddr_list_lookup_with_irk+0x106/0x120
hci_bdaddr_list_lookup_with_irk+0x106/0x120
hci_le_del_resolve_list_sync.isra.0+0xd6/0x3f0
? __pfx_hci_le_del_resolve_list_sync.isra.0+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
hci_le_del_accept_list_sync.isra.0+0x11c/0x290
? __pfx_hci_le_del_accept_list_sync.isra.0+0x10/0x10
? hci_passive_scan_sync+0x551/0x1e80
? srso_alias_return_thunk+0x5/0xfbef5
? lock_release+0xc8/0x280
hci_passive_scan_sync+0x71c/0x1e80
? __pfx_hci_passive_scan_sync+0x10/0x10
? find_held_lock+0x2b/0x80
? hci_lookup_le_connect+0xe1/0x3c0
? srso_alias_return_thunk+0x5/0xfbef5
? find_held_lock+0x2b/0x80
? hci_update_passive_scan_sync+0x437/0x950
? srso_alias_return_thunk+0x5/0xfbef5
? lock_release+0xc8/0x280
hci_update_passive_scan_sync+0x461/0x950
hci_cmd_sync_work+0x1b3/0x450
? srso_alias_return_thunk+0x5/0xfbef5
process_one_work+0x908/0x19c0
? __pfx_process_one_work+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? lock_is_held_type+0x8f/0x100
? srso_alias_return_thunk+0x5/0xfbef5
worker_thread+0x65c/0xe40
? __pfx_worker_thread+0x10/0x10
kthread+0x34f/0x460
? srso_alias_return_thunk+0x5/0xfbef5
? __pfx_kthread+0x10/0x10
ret_from_fork+0x659/0x940
? __pfx_ret_from_fork+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? __switch_to+0x74f/0xf80
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1a/0x30
</TASK>
Allocated by task 495:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
__kasan_kmalloc+0xaa/0xb0
__kmalloc_cache_noprof+0x251/0x610
hci_bdaddr_list_add_with_irk+0x183/0x3e0
hci_cc_le_add_to_resolv_list+0x18c/0x240
hci_cmd_complete_evt+0x373/0xab0
hci_event_packet+0x4e8/0xc70
hci_rx_work+0x367/0xf00
process_one_work+0x908/0x19c0
worker_thread+0x65c/0xe40
kthread+0x34f/0x460
ret_from_fork+0x659/0x940
ret_from_fork_asm+0x1a/0x30
Freed by task 497:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
kasan_save_free_info+0x3b/0x60
__kasan_slab_free+0x5f/0x80
kfree+0x307/0x580
hci_bdaddr_list_clear+0x134/0x230
hci_cc_le_clear_resolv_list+0x13d/0x240
hci_cmd_complete_evt+0x373/0xab0
hci_event_packet+0x4e8/0xc70
hci_rx_work+0x367/0xf00
process_one_work+0x908/0x19c0
worker_thread+0x65c/0xe40
kthread+0x34f/0x460
ret_from_fork+0x659/0x940
ret_from_fork_asm+0x1a/0x30
The buggy address belongs to the object at ffff88810b036e00
which belongs to the cache kmalloc-64 of size 64
The buggy address is located 22 bytes inside of
freed 64-byte region [ffff88810b036e00, ffff88810b036e40)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
pfn:0x10b036
flags: 0x200000000000000(node=0|zone=2)
page_type: f5(slab)
raw: 0200000000000000 ffff8881000428c0 dead000000000100
dead000000000122
raw: 0000000000000000 0000000000200020 00000000f5000000
0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88810b036d00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
ffff88810b036d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88810b036e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff88810b036e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff88810b036f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================
Disabling lock debugging due to kernel taint
Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_sync.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 5c3deb35f4eb5..7b84c156b56b5 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2481,15 +2481,17 @@ static int hci_le_del_resolve_list_sync(struct hci_dev *hdev,
bdaddr_t *bdaddr, u8 bdaddr_type)
{
struct hci_cp_le_del_from_resolv_list cp;
- struct bdaddr_list_with_irk *entry;
+ bool exists;
if (!use_ll_privacy(hdev))
return 0;
/* Check if the IRK has been programmed */
- entry = hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list, bdaddr,
- bdaddr_type);
- if (!entry)
+ hci_dev_lock(hdev);
+ exists = hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list,
+ bdaddr, bdaddr_type);
+ hci_dev_unlock(hdev);
+ if (!exists)
return 0;
cp.bdaddr_type = bdaddr_type;
@@ -2545,8 +2547,8 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
{
struct hci_cp_le_add_to_resolv_list cp;
struct smp_irk *irk;
- struct bdaddr_list_with_irk *entry;
struct hci_conn_params *p;
+ bool exists;
if (!use_ll_privacy(hdev))
return 0;
@@ -2568,10 +2570,11 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
return 0;
/* Check if the IK has _not_ been programmed yet. */
- entry = hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list,
- ¶ms->addr,
- params->addr_type);
- if (entry)
+ hci_dev_lock(hdev);
+ exists = hci_bdaddr_list_lookup_with_irk(
+ &hdev->le_resolv_list, ¶ms->addr, params->addr_type);
+ hci_dev_unlock(hdev);
+ if (exists)
return 0;
cp.bdaddr_type = params->addr_type;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0121/1167] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (119 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0120/1167] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0122/1167] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
` (536 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shuai Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
[ Upstream commit c0bb764fc082672678d371c375597a6a9f614cf9 ]
The kernel sets HCI_AUTO_OFF when a controller is first registered and
starts a 2-second timer. On slower boots bluetoothd and the HCI_AUTO_OFF
timer can race: hci_power_off() is already queued while bluetoothd is
still in the middle of its adapter setup sequence. hci_cmd_sync_clear()
then cancels any pending mgmt commands with -ECANCELED, including the
MGMT_OP_REMOVE_ADV_MONITOR sent by reset_adv_monitors() early in the
setup sequence.
When auto_off=1, hci_dev_close_sync() skips __mgmt_power_off() entirely,
so there is no fallback path to reply to the cancelled commands.
mgmt_remove_adv_monitor_complete() silently returns on -ECANCELED, leaving
the command with no reply. Since bluez's mgmt queue is strictly serialised,
this stalls all subsequent commands indefinitely, leaving bluetoothd unable
to register the adapter.
Fix by mapping -ECANCELED to MGMT_STATUS_CANCELLED in mgmt_errno_status()
and replying to the cancelled command in mgmt_remove_adv_monitor_complete()
instead of returning early.
Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: 7eac80614300 ("Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/mgmt.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 3307a86709280..50fb92103a7d3 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -304,6 +304,8 @@ static u8 mgmt_errno_status(int err)
return MGMT_STATUS_ALREADY_CONNECTED;
case -ENOTCONN:
return MGMT_STATUS_DISCONNECTED;
+ case -ECANCELED:
+ return MGMT_STATUS_CANCELLED;
}
return MGMT_STATUS_FAILED;
@@ -5648,8 +5650,18 @@ static void mgmt_remove_adv_monitor_complete(struct hci_dev *hdev,
struct mgmt_pending_cmd *cmd = data;
struct mgmt_cp_remove_adv_monitor *cp;
- if (status == -ECANCELED)
+ /* Reply to a cancelled command so bluetoothd's serialised mgmt queue
+ * is not blocked.
+ */
+ if (status == -ECANCELED) {
+ cp = cmd->param;
+ rp.monitor_handle = cp->monitor_handle;
+
+ mgmt_cmd_complete(cmd->sk, cmd->hdev->id, cmd->opcode,
+ mgmt_status(status), &rp, sizeof(rp));
+ mgmt_pending_free(cmd);
return;
+ }
hci_dev_lock(hdev);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0122/1167] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (120 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0121/1167] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0123/1167] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
` (535 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tobias Wilken,
Luiz Augusto von Dentz, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tobias Wilken <tooangel@tooangel.de>
[ Upstream commit 7eac80614300563470cffabf4df2b63616787ee7 ]
Since MGMT_OP_SET_POWERED runs through hci_cmd_sync, powering on a
controller that is blocked by rfkill fails with -ERFKILL from
hci_dev_open_sync(), and mgmt_set_powered_complete() reports it with
mgmt_status(err). mgmt_errno_status() has no case for -ERFKILL, so
userspace gets MGMT_STATUS_FAILED instead of MGMT_STATUS_RFKILLED.
Before that conversion, power on went through hci_power_on(), whose
error path mgmt_set_powered_failed() still maps -ERFKILL to
MGMT_STATUS_RFKILLED. bluetoothd relies on that status: for
RFKILLED it sets the adapter PowerState to "off-blocked" and returns
org.bluez.Error.Blocked for the Powered property, for any other status
it returns org.bluez.Error.Failed.
With the controller soft blocked, "bluetoothctl power on" printed
"Failed to set power on: org.bluez.Error.Failed" and btmon showed
"Set Powered (0x0005) Status: Failed (0x03)". With this change it
prints org.bluez.Error.Blocked and btmon shows "Status: RFKilled
(0x12)".
Map -ERFKILL to MGMT_STATUS_RFKILLED in mgmt_errno_status().
Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED")
Assisted-by: LLM
Signed-off-by: Tobias Wilken <tooangel@tooangel.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/mgmt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 50fb92103a7d3..306dc70ec3528 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -306,6 +306,8 @@ static u8 mgmt_errno_status(int err)
return MGMT_STATUS_DISCONNECTED;
case -ECANCELED:
return MGMT_STATUS_CANCELLED;
+ case -ERFKILL:
+ return MGMT_STATUS_RFKILLED;
}
return MGMT_STATUS_FAILED;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0123/1167] Bluetooth: hci_core: Keep link-key filtering inside RCU
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (121 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0122/1167] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0124/1167] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
` (534 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit 281ddc4e01ab54cab07995f2a1b72cf81bf90eb5 ]
hci_find_link_key() must keep the matching link key allocated while it
checks the key against the blocked-key list. It currently leaves the
key-list RCU read-side section before passing k->val to
hci_is_blocked_key(). That helper's own RCU section protects the
blocked-key list, but it cannot keep an unlinked link key from being
reclaimed.
The SMP receive path calls the finder without hdev->lock: Secure
Connections key distribution over BR/EDR reaches it through
smp_distribute_keys() and sc_generate_ltk(). With a stored peer link
key and a link-key entry in the blocked-key list,
MGMT_OP_LOAD_LINK_KEYS can free the selected key before the comparison:
HCI RX worker (SMP) Management / RCU reclamation
hci_find_link_key()
rcu_read_lock()
select k
rcu_read_unlock()
load_link_keys()
hci_dev_lock(hdev)
hci_link_keys_clear(hdev)
list_del_rcu(), kfree_rcu()
hci_dev_unlock(hdev)
grace period ends, k is freed
hci_is_blocked_key(hdev, ..., k->val)
memcmp() reads the freed key
Keep the RCU read-side section active through the blocked-key
comparison and the warning that prints k->bdaddr, and release it before
returning on both matched-key paths. hci_find_ltk() already handles its
blocked-key check this way.
KASAN reported this on a test kernel whose scheduling hook paused the
receive worker after the lookup until the key had been freed.
KASAN report as below:
==================================================================
BUG: KASAN: slab-use-after-free in hci_is_blocked_key+0x2db/0x300
Read of size 1 at addr ffff88810b5f89a7 by task kworker/u17:0/502
CPU: 1 UID: 0 PID: 502 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #5 PREEMPT(lazy)
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Workqueue: hci1 hci_rx_work
Call Trace:
<TASK>
dump_stack_lvl+0x93/0xd0
print_report+0xce/0x630
? hci_is_blocked_key+0x2db/0x300
? srso_alias_return_thunk+0x5/0xfbef5
? __virt_addr_valid+0x20d/0x410
? hci_is_blocked_key+0x2db/0x300
kasan_report+0xe0/0x110
? hci_is_blocked_key+0x2db/0x300
hci_is_blocked_key+0x2db/0x300
hci_find_link_key+0x12e/0x400
smp_distribute_keys+0x1830/0x2950
? trace_hardirqs_on+0x18/0x160
? srso_alias_return_thunk+0x5/0xfbef5
? queue_delayed_work_on+0xb3/0xf0
? __pfx_smp_distribute_keys+0x10/0x10
? __pfx_smp_send_cmd.isra.0+0x10/0x10
? __cancel_work+0x1b0/0x290
? __entry_text_end+0x1020f7/0x1020f9
? lockdep_hardirqs_on_prepare+0xea/0x1a0
? srso_alias_return_thunk+0x5/0xfbef5
? __asan_memset+0x23/0x50
? smp_recv_cb+0x12c7/0x8d80
? srso_alias_return_thunk+0x5/0xfbef5
smp_recv_cb+0x12c7/0x8d80
? __pfx_smp_recv_cb+0x10/0x10
? __pfx___might_resched+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? stack_depot_save_flags+0x29/0x9a0
? srso_alias_return_thunk+0x5/0xfbef5
? __mutex_lock+0x182c/0x2590
? kasan_save_stack+0x42/0x60
? l2cap_recv_frame+0x9ef/0x8830
? __kasan_slab_free+0x5f/0x80
? kmem_cache_free+0x242/0x580
? kfree_skbmem+0x15e/0x1d0
? sk_skb_reason_drop+0x12f/0x490
? hci_event_packet+0x556/0xc70
? hci_rx_work+0x367/0xf00
? process_one_work+0x908/0x19c0
? worker_thread+0x65c/0xe40
? __pfx___mutex_lock+0x10/0x10
? __lock_acquire+0x466/0x2260
? __pfx_l2cap_chan_hold_unless_zero+0x10/0x10
? l2cap_recv_frame+0x13cc/0x8830
? __pfx_smp_recv_cb+0x10/0x10
l2cap_recv_frame+0x13cc/0x8830
? srso_alias_return_thunk+0x5/0xfbef5
? __mutex_lock+0x182c/0x2590
? __pfx_l2cap_recv_frame+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? find_held_lock+0x2b/0x80
? l2cap_recv_acldata+0x1eb/0x10e0
? __pfx___mutex_lock+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? __mutex_unlock_slowpath+0x147/0x920
? __pfx_l2cap_conn_hold_unless_zero+0x10/0x10
? __pfx_hci_conn_enter_active_mode+0x10/0x10
? l2cap_recv_acldata+0x13d/0x10e0
? srso_alias_return_thunk+0x5/0xfbef5
l2cap_recv_acldata+0xe9f/0x10e0
? srso_alias_return_thunk+0x5/0xfbef5
hci_rx_work+0x5a6/0xf00
? srso_alias_return_thunk+0x5/0xfbef5
process_one_work+0x908/0x19c0
? __pfx_process_one_work+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? lock_is_held_type+0x8f/0x100
? srso_alias_return_thunk+0x5/0xfbef5
worker_thread+0x65c/0xe40
? __pfx_worker_thread+0x10/0x10
kthread+0x34f/0x460
? srso_alias_return_thunk+0x5/0xfbef5
? __pfx_kthread+0x10/0x10
ret_from_fork+0x659/0x940
? __pfx_ret_from_fork+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? __switch_to+0x74f/0xf80
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1a/0x30
</TASK>
Allocated by task 504:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
__kasan_kmalloc+0xaa/0xb0
__kmalloc_cache_noprof+0x251/0x610
hci_add_link_key+0x474/0x840
hci_link_key_notify_evt+0x492/0xce0
hci_event_packet+0x894/0xc70
hci_rx_work+0x367/0xf00
process_one_work+0x908/0x19c0
worker_thread+0x65c/0xe40
kthread+0x34f/0x460
ret_from_fork+0x659/0x940
ret_from_fork_asm+0x1a/0x30
Freed by task 29:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
kasan_save_free_info+0x3b/0x60
__kasan_slab_free+0x5f/0x80
__rcu_free_sheaf_prepare+0x65/0x2a0
rcu_free_sheaf_nobarn+0x1d/0x50
rcu_core+0x661/0x1d10
handle_softirqs+0x201/0x930
run_ksoftirqd+0x33/0x60
smpboot_thread_fn+0x3bd/0x9a0
kthread+0x34f/0x460
ret_from_fork+0x659/0x940
ret_from_fork_asm+0x1a/0x30
The buggy address belongs to the object at ffff88810b5f8980
which belongs to the cache kmalloc-64 of size 64
The buggy address is located 39 bytes inside of
freed 64-byte region [ffff88810b5f8980, ffff88810b5f89c0)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10b5f8
flags: 0x200000000000000(node=0|zone=2)
page_type: f5(slab)
raw: 0200000000000000 ffff8881000428c0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88810b5f8880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff88810b5f8900: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
>ffff88810b5f8980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff88810b5f8a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff88810b5f8a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================
Fixes: 600a87490ff9 ("Bluetooth: Implementation of MGMT_OP_SET_BLOCKED_KEYS.")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 722ddf4176a7b..d5aeede6c623f 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1105,17 +1105,16 @@ struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr)
rcu_read_lock();
list_for_each_entry_rcu(k, &hdev->link_keys, list) {
if (bacmp(bdaddr, &k->bdaddr) == 0) {
- rcu_read_unlock();
-
if (hci_is_blocked_key(hdev,
HCI_BLOCKED_KEY_TYPE_LINKKEY,
k->val)) {
bt_dev_warn_ratelimited(hdev,
"Link key blocked for %pMR",
&k->bdaddr);
- return NULL;
+ k = NULL;
}
+ rcu_read_unlock();
return k;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0124/1167] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (122 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0123/1167] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0125/1167] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
` (533 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit 9ff737119177a6c1ce6083ef8c0fc06355f11869 ]
hci_le_add_resolve_list_sync() copies the peer IRK into the LE Add
Device To Resolving List command after hci_find_irk_by_addr() has
returned. The finder ends its RCU read-side section before returning
the borrowed entry, and neither the request worker nor
interleave_scan_work() holds hdev->lock here. The resolving-list
membership check between the lookup and the copy takes hdev->lock and
may sleep on it, which widens the window.
When LL privacy programs a peer with address resolution enabled,
MGMT_OP_LOAD_IRKS can free its IRK before the copy:
Request worker Management / RCU reclamation
hci_le_add_resolve_list_sync()
irk = hci_find_irk_by_addr()
load_irks()
hci_dev_lock(hdev)
hci_smp_irks_clear(hdev)
list_del_rcu(), kfree_rcu()
hci_dev_unlock(hdev)
grace period ends, irk is freed
resolving-list membership check
memcpy(cp.peer_irk, irk->val, 16)
Copy the IRK value in an RCU read-side section right after the lookup,
as hci_le_set_privacy_mode_sync() does for the identity address. The
section ends before hdev->lock is taken and before the synchronous HCI
command is sent.
KASAN reported this on a test kernel with scheduling hooks, whose
frames appear in the trace. The report predates the hdev->lock taken
by the membership check.
KASAN report as below:
==================================================================
BUG: KASAN: slab-use-after-free in hci_le_add_resolve_list_sync+0x8d9/0x910
Read of size 16 at addr ffff88810d21452d by task kworker/u17:0/504
CPU: 2 UID: 0 PID: 504 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #2 PREEMPT(lazy)
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Workqueue: hci0 interleave_scan_work
Call Trace:
<TASK>
dump_stack_lvl+0x93/0xd0
print_report+0xce/0x630
? hci_le_add_resolve_list_sync+0x8d9/0x910
? srso_alias_return_thunk+0x5/0xfbef5
? __virt_addr_valid+0x20d/0x410
? hci_le_add_resolve_list_sync+0x8d9/0x910
kasan_report+0xe0/0x110
? hci_le_add_resolve_list_sync+0x8d9/0x910
hci_le_add_resolve_list_sync+0x8d9/0x910
? __pfx_hci_le_add_resolve_list_sync+0x10/0x10
? pmbd_probe_hit_cookie+0xe7/0x1c0
? srso_alias_return_thunk+0x5/0xfbef5
? pmbd_probe_hit_cookie+0xee/0x1c0
? __pfx_pmbd_probe_hit_cookie+0x10/0x10
hci_le_add_accept_list_sync+0x18e/0x820
? conn_params_copy+0x36e/0x650
? __pfx_hci_le_add_accept_list_sync+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? conn_params_copy+0x3a0/0x650
hci_passive_scan_sync+0x95f/0x1f10
? __pfx_hci_passive_scan_sync+0x10/0x10
? debug_object_deactivate+0x2f8/0x3c0
? pwq_dec_nr_in_flight+0x880/0xdf0
? srso_alias_return_thunk+0x5/0xfbef5
? lock_acquire+0x17b/0x2f0
? process_one_work+0x895/0x19c0
interleave_scan_work+0x11b/0x470
process_one_work+0x908/0x19c0
? __pfx_process_one_work+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? lock_is_held_type+0x8f/0x100
? srso_alias_return_thunk+0x5/0xfbef5
worker_thread+0x65c/0xe40
? __pfx_worker_thread+0x10/0x10
kthread+0x34f/0x460
? srso_alias_return_thunk+0x5/0xfbef5
? __pfx_kthread+0x10/0x10
ret_from_fork+0x659/0x940
? __pfx_ret_from_fork+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? __switch_to+0x74f/0xf80
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1a/0x30
</TASK>
Allocated by task 535:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
__kasan_kmalloc+0xaa/0xb0
__kmalloc_cache_noprof+0x251/0x610
hci_add_irk+0xb6/0x220
load_irks+0x5f9/0x840
hci_sock_sendmsg+0x128b/0x22e0
__sys_sendto+0x425/0x470
__x64_sys_sendto+0xe5/0x1c0
do_syscall_64+0x115/0x6a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 0:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
kasan_save_free_info+0x3b/0x60
__kasan_slab_free+0x5f/0x80
__rcu_free_sheaf_prepare+0x65/0x2a0
rcu_free_sheaf+0x1f/0xe0
rcu_core+0x661/0x1d10
handle_softirqs+0x201/0x930
__irq_exit_rcu+0x110/0x1e0
irq_exit_rcu+0xe/0x20
sysvec_apic_timer_interrupt+0x6c/0x80
asm_sysvec_apic_timer_interrupt+0x1a/0x20
The buggy address belongs to the object at ffff88810d214500
which belongs to the cache kmalloc-64 of size 64
The buggy address is located 45 bytes inside of
freed 64-byte region [ffff88810d214500, ffff88810d214540)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10d214
flags: 0x200000000000000(node=0|zone=2)
page_type: f5(slab)
raw: 0200000000000000 ffff8881000428c0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88810d214400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff88810d214480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88810d214500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff88810d214580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff88810d214600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================
Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_sync.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 7b84c156b56b5..2b5923493aef5 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2565,9 +2565,17 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
goto done;
}
+ rcu_read_lock();
+
irk = hci_find_irk_by_addr(hdev, ¶ms->addr, params->addr_type);
- if (!irk)
+ if (!irk) {
+ rcu_read_unlock();
return 0;
+ }
+
+ memcpy(cp.peer_irk, irk->val, 16);
+
+ rcu_read_unlock();
/* Check if the IK has _not_ been programmed yet. */
hci_dev_lock(hdev);
@@ -2579,7 +2587,6 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
cp.bdaddr_type = params->addr_type;
bacpy(&cp.bdaddr, ¶ms->addr);
- memcpy(cp.peer_irk, irk->val, 16);
/* Default privacy mode is always Network */
params->privacy_mode = HCI_NETWORK_PRIVACY;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0125/1167] Bluetooth: hci_core: Initialize advertising RPA work only once
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (123 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0124/1167] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0126/1167] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
` (532 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit a7c5c18b7cc30dcd2a9ae5a0fb38378d3998417e ]
hci_add_adv_instance() also updates existing instances and calls
INIT_DELAYED_WORK() on their rpa_expired_cb every time, even when the
work is pending or running. cancel_delayed_work_sync() then no longer
finds the work, so hci_remove_adv_instance() can free the instance
under it:
hdev->workqueue MGMT_OP_ADD_EXT_ADV_PARAMS
adv_instance_rpa_expired()
hci_dev_lock(hdev)
hci_add_adv_instance()
INIT_DELAYED_WORK()
mgmt_pending_new() fails
hci_remove_adv_instance()
cancel_delayed_work_sync()
returns without waiting
kfree(adv)
hci_dev_unlock(hdev)
adv->rpa_expired = true
The work has been initialized on every update since it was added.
Initialize it only when the instance is allocated.
KASAN report as below:
BUG: KASAN: slab-use-after-free in adv_instance_rpa_expired+0x139/0x160
Write of size 1 at addr ffff888108d84b2e by task kworker/u17:0/504
Workqueue: hci0 adv_instance_rpa_expired
Call Trace:
adv_instance_rpa_expired+0x139/0x160
Allocated by task 560:
hci_add_adv_instance+0x68d/0x9d0
add_ext_adv_params+0x4d4/0xb60
hci_sock_sendmsg+0x128b/0x22e0
Freed by task 594:
kfree+0x307/0x580
hci_remove_adv_instance+0x230/0x540
add_ext_adv_params+0xa43/0xb60
hci_sock_sendmsg+0x128b/0x22e0
Last potentially related work creation:
insert_work+0x37/0x210
__queue_work+0xaba/0x1270
call_timer_fn+0x171/0x500
The buggy address belongs to the object at ffff888108d84800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 814 bytes inside of
freed 1024-byte region [ffff888108d84800, ffff888108d84c00)
Fixes: a73c046a2869 ("Bluetooth: Implement Set ADV set random address")
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index d5aeede6c623f..eaceb86b5c3cd 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1719,6 +1719,9 @@ struct adv_info *hci_add_adv_instance(struct hci_dev *hdev, u8 instance,
if (!adv)
return ERR_PTR(-ENOMEM);
+ INIT_DELAYED_WORK(&adv->rpa_expired_cb,
+ adv_instance_rpa_expired);
+
adv->pending = true;
adv->instance = instance;
list_add(&adv->list, &hdev->adv_instances);
@@ -1746,8 +1749,6 @@ struct adv_info *hci_add_adv_instance(struct hci_dev *hdev, u8 instance,
else
adv->duration = duration;
- INIT_DELAYED_WORK(&adv->rpa_expired_cb, adv_instance_rpa_expired);
-
BT_DBG("%s for %dMR", hdev->name, instance);
return adv;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0126/1167] Bluetooth: validate retained LE Create CIS command length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (124 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0125/1167] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0127/1167] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
` (531 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yifan Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
[ Upstream commit 1eb52f35fc8fb06ab7f2973fff29cba81f96b947 ]
hci_cs_le_create_cis() retrieves the parameters of the previously sent
command without their length. It then trusts num_cis and walks the
flexible cis[] array when a controller reports a failed command.
A five-byte HCI command containing only num_cis can therefore make the
handler read beyond the command skb. KASAN reports:
BUG: KASAN: slab-out-of-bounds in hci_cs_le_create_cis
Read of size 2
hci_cs_le_create_cis
hci_cmd_status_evt
hci_event_packet
Add a length-returning saved-command helper and require the fixed header
and complete CIS array before walking it.
The reproducer no longer triggers a KASAN report with this change.
Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Closes: https://lore.kernel.org/linux-bluetooth/179317462624.87574.6271582002629080499@stu.pku.edu.cn/
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/bluetooth/hci_core.h | 2 ++
net/bluetooth/hci_core.c | 18 ++++++++++++++----
net/bluetooth/hci_event.c | 7 ++++++-
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index b13687023a0f2..9599656b33b11 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2208,6 +2208,8 @@ void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);
void hci_send_iso(struct hci_conn *conn, struct sk_buff *skb);
void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode);
+void *hci_sent_cmd_data_len(struct hci_dev *hdev, __u16 opcode,
+ size_t *len);
void *hci_recv_event_data(struct hci_dev *hdev, __u8 event);
u32 hci_conn_get_phy(struct hci_conn *conn);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index eaceb86b5c3cd..4c2289103ff92 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3142,7 +3142,8 @@ int __hci_cmd_send(struct hci_dev *hdev, u16 opcode, u32 plen,
EXPORT_SYMBOL(__hci_cmd_send);
/* Get data from the previously sent command */
-static void *hci_cmd_data(struct sk_buff *skb, __u16 opcode)
+static void *hci_cmd_data(struct sk_buff *skb, __u16 opcode,
+ size_t *len)
{
struct hci_command_hdr *hdr;
@@ -3154,23 +3155,32 @@ static void *hci_cmd_data(struct sk_buff *skb, __u16 opcode)
if (hdr->opcode != cpu_to_le16(opcode))
return NULL;
+ if (len)
+ *len = skb->len - HCI_COMMAND_HDR_SIZE;
+
return skb->data + HCI_COMMAND_HDR_SIZE;
}
/* Get data from the previously sent command */
-void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode)
+void *hci_sent_cmd_data_len(struct hci_dev *hdev, __u16 opcode, size_t *len)
{
void *data;
/* Check if opcode matches last sent command */
- data = hci_cmd_data(hdev->sent_cmd, opcode);
+ data = hci_cmd_data(hdev->sent_cmd, opcode, len);
if (!data)
/* Check if opcode matches last request */
- data = hci_cmd_data(hdev->req_skb, opcode);
+ data = hci_cmd_data(hdev->req_skb, opcode, len);
return data;
}
+/* Get data from the previously sent command */
+void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode)
+{
+ return hci_sent_cmd_data_len(hdev, opcode, NULL);
+}
+
/* Get data from last received event */
void *hci_recv_event_data(struct hci_dev *hdev, __u8 event)
{
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 33e513f033c26..e8b504959bd5f 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4259,6 +4259,7 @@ static void hci_cs_le_create_cis(struct hci_dev *hdev, u8 status)
{
struct hci_cp_le_create_cis *cp;
bool pending = false;
+ size_t len;
int i;
bt_dev_dbg(hdev, "status 0x%2.2x", status);
@@ -4266,10 +4267,14 @@ static void hci_cs_le_create_cis(struct hci_dev *hdev, u8 status)
if (!status)
return;
- cp = hci_sent_cmd_data(hdev, HCI_OP_LE_CREATE_CIS);
+ cp = hci_sent_cmd_data_len(hdev, HCI_OP_LE_CREATE_CIS, &len);
if (!cp)
return;
+ if (len < sizeof(*cp) ||
+ len < struct_size(cp, cis, cp->num_cis))
+ return;
+
hci_dev_lock(hdev);
/* Remove connection if command failed */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0127/1167] Bluetooth: validate retained LE Set CIG Parameters command length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (125 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0126/1167] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0128/1167] ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server Greg Kroah-Hartman
` (530 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yifan Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
[ Upstream commit ed4d302af778b9e2ead28134a2196c09a4ad248a ]
hci_cc_le_set_cig_params() validates the controller response but not the
parameters of the previously sent command. A short command can claim a
large num_cis without containing the corresponding cis[] array. A
complete successful response then makes the handler read beyond the
command skb while looking up each CIS ID.
KASAN reports:
BUG: KASAN: slab-out-of-bounds in hci_cc_le_set_cig_params
Read of size 1
hci_cc_le_set_cig_params
hci_cmd_complete_evt
hci_event_packet
Obtain the retained parameter length and require both the fixed header and
the complete CIS array before using the command data.
The reproducer no longer triggers a KASAN report with this change.
Fixes: 71e9588435c3 ("Bluetooth: ISO: use correct CIS order in Set CIG Parameters event")
Closes: https://lore.kernel.org/linux-bluetooth/179317463153.87610.8996555110609321376@stu.pku.edu.cn/
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_event.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index e8b504959bd5f..2407ff299f8e9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3809,13 +3809,16 @@ static u8 hci_cc_le_set_cig_params(struct hci_dev *hdev, void *data,
struct hci_conn *conn;
u8 status = rp->status;
bool pending = false;
+ size_t len;
int i;
bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
- cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_CIG_PARAMS);
+ cp = hci_sent_cmd_data_len(hdev, HCI_OP_LE_SET_CIG_PARAMS, &len);
if (!rp->status &&
- (!cp || rp->num_handles != cp->num_cis ||
+ (!cp || len < sizeof(*cp) ||
+ len < struct_size(cp, cis, cp->num_cis) ||
+ rp->num_handles != cp->num_cis ||
rp->cig_id != cp->cig_id ||
skb->len < array_size(rp->num_handles, sizeof(*rp->handle)))) {
bt_dev_err(hdev, "unexpected Set CIG Parameters response data");
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0128/1167] ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (126 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0127/1167] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0129/1167] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
` (529 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aaditya Kansal, Namjae Jeon,
Steve French, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaditya Kansal <aadityakansal390@gmail.com>
[ Upstream commit e4442b2e95baf0901830c924d0a197b100aca970 ]
Add STATUS_INFO_LENGTH_MISMATCH mapping to EMSGSIZE.
Currently, STATUS_INFO_LENGTH_MISMATCH has no mapping to any error code,
making it difficult to distinguish between invalid parameters and length
mismatch.
Map STATUS_INFO_LENGTH_MISMATCH to EMSGSIZE while keeping the EINVAL for
invalid parameters. Although the buf_len check only checks for buf_size
being less than required, there was no error code for lower buf_size.
Hence, EMSGSIZE is used.
Signed-off-by: Aaditya Kansal <aadityakansal390@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Stable-dep-of: e49296d51ccb ("ksmbd: require NUL-terminated EA names")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 7794a35ba3552..d9491573fc845 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6686,7 +6686,6 @@ static int set_file_mode_info(struct ksmbd_file *fp,
* @share: ksmbd_share_config pointer
*
* Return: 0 on success, otherwise error
- * TODO: need to implement an error handling for STATUS_INFO_LENGTH_MISMATCH
*/
static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
struct smb2_set_info_req *req,
@@ -6699,14 +6698,14 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_BASIC_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_basic_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_basic_info(fp, (struct smb2_file_basic_info *)buffer, share);
}
case FILE_ALLOCATION_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_alloc_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_allocation_info(work, fp,
(struct smb2_file_alloc_info *)buffer);
@@ -6714,7 +6713,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_END_OF_FILE_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_eof_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_end_of_file_info(work, fp,
(struct smb2_file_eof_info *)buffer);
@@ -6722,7 +6721,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_RENAME_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_rename_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_rename_info(work, fp,
(struct smb2_file_rename_info *)buffer,
@@ -6733,7 +6732,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
struct smb2_file_link_info *file_info;
if (buf_len < sizeof(struct smb2_file_link_info))
- return -EINVAL;
+ return -EMSGSIZE;
file_info = (struct smb2_file_link_info *)buffer;
if (file_info->ReplaceIfExists && !(fp->daccess & FILE_DELETE_LE)) {
@@ -6748,7 +6747,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_DISPOSITION_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_disposition_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_disposition_info(work, fp,
(struct smb2_file_disposition_info *)buffer);
@@ -6762,7 +6761,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
}
if (buf_len < sizeof(struct smb2_ea_info))
- return -EINVAL;
+ return -EMSGSIZE;
return smb2_set_ea((struct smb2_ea_info *)buffer,
buf_len, &fp->filp->f_path, true);
@@ -6770,14 +6769,14 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_POSITION_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_pos_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_position_info(fp, (struct smb2_file_pos_info *)buffer);
}
case FILE_MODE_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_mode_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_mode_info(fp, (struct smb2_file_mode_info *)buffer);
}
@@ -6885,6 +6884,8 @@ int smb2_set_info(struct ksmbd_work *work)
rsp->hdr.Status = STATUS_ACCESS_DENIED;
else if (rc == -EINVAL)
rsp->hdr.Status = STATUS_INVALID_PARAMETER;
+ else if (rc == -EMSGSIZE)
+ rsp->hdr.Status = STATUS_INFO_LENGTH_MISMATCH;
else if (rc == -ESHARE)
rsp->hdr.Status = STATUS_SHARING_VIOLATION;
else if (rc == -ENOENT)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0129/1167] ksmbd: require NUL-terminated EA names
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (127 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0128/1167] ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0130/1167] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
` (528 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Yifan Zhang,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
[ Upstream commit e49296d51ccbf2ad0ed0484db1382f1d7217bd6e ]
smb2_set_ea() verifies that the byte reserved for the declared EA-name
terminator lies inside the request, but it does not verify that the byte is
zero. With SMB debug logging enabled, the name is passed to %s and the
diagnostic reads beyond the request allocation.
KASAN reports:
BUG: KASAN: slab-out-of-bounds in string
Read of size 1
string
vsnprintf
_printk
smb2_set_ea
smb2_set_info
Reject an EA entry whose declared terminator byte is nonzero. Return
-EBADMSG for the malformed buffer, and map that error to
STATUS_EA_LIST_INCONSISTENT for both SET_INFO and CREATE.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Suggested-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index d9491573fc845..16e7ff0b618a1 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2432,6 +2432,11 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
if (!eabuf->EaNameLength)
goto next;
+ if (eabuf->name[eabuf->EaNameLength]) {
+ rc = -EBADMSG;
+ break;
+ }
+
ksmbd_debug(SMB,
"name : <%s>, name_len : %u, value_len : %u, next : %u\n",
eabuf->name, eabuf->EaNameLength,
@@ -3896,6 +3901,8 @@ int smb2_open(struct ksmbd_work *work)
if (rc) {
if (rc == -EINVAL)
rsp->hdr.Status = STATUS_INVALID_PARAMETER;
+ else if (rc == -EBADMSG)
+ rsp->hdr.Status = STATUS_EA_LIST_INCONSISTENT;
else if (rc == -EOPNOTSUPP)
rsp->hdr.Status = STATUS_NOT_SUPPORTED;
else if (rc == -EACCES || rc == -ESTALE || rc == -EXDEV) {
@@ -6884,6 +6891,8 @@ int smb2_set_info(struct ksmbd_work *work)
rsp->hdr.Status = STATUS_ACCESS_DENIED;
else if (rc == -EINVAL)
rsp->hdr.Status = STATUS_INVALID_PARAMETER;
+ else if (rc == -EBADMSG)
+ rsp->hdr.Status = STATUS_EA_LIST_INCONSISTENT;
else if (rc == -EMSGSIZE)
rsp->hdr.Status = STATUS_INFO_LENGTH_MISMATCH;
else if (rc == -ESHARE)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0130/1167] soreuseport: annotate data-races around reuse->socks[] and num_socks
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (128 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0129/1167] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0131/1167] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
` (527 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kuniyuki Iwashima, Eric Dumazet,
Jiayuan Chen, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 213d491308b99d026514c93980cf8dd572226b1b ]
reuseport_select_sock() and reuseport_migrate_sock() read
reuse->num_socks and reuse->socks[] locklessly under RCU, while
writers holding reuseport_lock can change them.
Readers snapshot num_socks once, then index socks[] with it.
Meanwhile, writers can perform several operations, storing into
slots below the reader's stale count:
- __reuseport_detach_sock() moves the last socket into slot i.
- __reuseport_add_sock() then writes the new socket at the
(now smaller) num_socks index.
- reuseport_stop_listen_sock() calls __reuseport_detach_sock()
then __reuseport_add_closed_sock(), which writes slot
max_socks - num_closed_socks - 1. This can be the slot a reader
still considers part of the listener region when the array is full.
- __reuseport_detach_closed_sock() can then rewrite that slot.
All pointers stored in socks[] remain valid for the RCU grace period,
but without annotations the compiler is allowed to tear or reload
these accesses. For instance, reuseport_select_sock_by_hash() could
reload reuse->socks[i] between the sk_state/sk_incoming_cpu checks
and the return, returning a socket that did not pass them.
Use WRITE_ONCE() for all socks[] stores done while the array is
visible to readers, and for num_socks updates (readers already use
READ_ONCE()). Use READ_ONCE() in the two lockless readers.
Fixes: ef456144da8e ("soreuseport: define reuseport groups")
Link: https://lore.kernel.org/netdev/20260902071900.395567-1-ruanjinjie@huawei.com/
Cc: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20261030120956.3026324-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/sock_reuseport.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c
index 5a165286e4d8e..e7685956b09d7 100644
--- a/net/core/sock_reuseport.c
+++ b/net/core/sock_reuseport.c
@@ -124,10 +124,10 @@ static int reuseport_sock_index(struct sock *sk,
static void __reuseport_add_sock(struct sock *sk,
struct sock_reuseport *reuse)
{
- reuse->socks[reuse->num_socks] = sk;
+ WRITE_ONCE(reuse->socks[reuse->num_socks], sk);
/* paired with smp_rmb() in reuseport_(select|migrate)_sock() */
smp_wmb();
- reuse->num_socks++;
+ WRITE_ONCE(reuse->num_socks, reuse->num_socks + 1);
reuseport_get_incoming_cpu(sk, reuse);
}
@@ -139,8 +139,8 @@ static bool __reuseport_detach_sock(struct sock *sk,
if (i == -1)
return false;
- reuse->socks[i] = reuse->socks[reuse->num_socks - 1];
- reuse->num_socks--;
+ WRITE_ONCE(reuse->socks[i], reuse->socks[reuse->num_socks - 1]);
+ WRITE_ONCE(reuse->num_socks, reuse->num_socks - 1);
reuseport_put_incoming_cpu(sk, reuse);
return true;
@@ -149,7 +149,7 @@ static bool __reuseport_detach_sock(struct sock *sk,
static void __reuseport_add_closed_sock(struct sock *sk,
struct sock_reuseport *reuse)
{
- reuse->socks[reuse->max_socks - reuse->num_closed_socks - 1] = sk;
+ WRITE_ONCE(reuse->socks[reuse->max_socks - reuse->num_closed_socks - 1], sk);
/* paired with READ_ONCE() in inet_csk_bind_conflict() */
WRITE_ONCE(reuse->num_closed_socks, reuse->num_closed_socks + 1);
reuseport_get_incoming_cpu(sk, reuse);
@@ -163,7 +163,8 @@ static bool __reuseport_detach_closed_sock(struct sock *sk,
if (i == -1)
return false;
- reuse->socks[i] = reuse->socks[reuse->max_socks - reuse->num_closed_socks];
+ WRITE_ONCE(reuse->socks[i],
+ reuse->socks[reuse->max_socks - reuse->num_closed_socks]);
/* paired with READ_ONCE() in inet_csk_bind_conflict() */
WRITE_ONCE(reuse->num_closed_socks, reuse->num_closed_socks - 1);
reuseport_put_incoming_cpu(sk, reuse);
@@ -522,7 +523,7 @@ static struct sock *run_bpf_filter(struct sock_reuseport *reuse, u16 socks,
if (index >= socks)
return NULL;
- return reuse->socks[index];
+ return READ_ONCE(reuse->socks[index]);
}
static struct sock *reuseport_select_sock_by_hash(struct sock_reuseport *reuse,
@@ -533,7 +534,7 @@ static struct sock *reuseport_select_sock_by_hash(struct sock_reuseport *reuse,
i = j = reciprocal_scale(hash, num_socks);
do {
- struct sock *sk = reuse->socks[i];
+ struct sock *sk = READ_ONCE(reuse->socks[i]);
if (sk->sk_state != TCP_ESTABLISHED) {
/* Paired with WRITE_ONCE() in __reuseport_(get|put)_incoming_cpu(). */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0131/1167] vhost-scsi: validate event queue descriptor direction
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (129 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0130/1167] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0132/1167] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
` (526 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Jia, Linfeng Sun,
Michael S. Tsirkin, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linfeng Sun <linfeng.sun.dev@gmail.com>
[ Upstream commit 3d8c5b714c186d08c8fe8c8cfd1f9b89525ab067 ]
vhost_get_vq_desc() returns the number of device readable (output) and
device writable (input) iovec segments. A guest can submit an eventq
descriptor chain that fills vq->iov with output segments, setting out
to ARRAY_SIZE(vq->iov) and in to zero.
When the host later queues a vhost-scsi event, vhost_scsi_do_evt_work()
uses out as the index of the first input segment. This accesses one element
beyond vq->iov and triggers an array-index-out-of-bounds report. With
panic_on_warn enabled, the report panics the host.
The event queue accepts device writable buffers only. Reject chains that
contain output segments or lack an input segment before using out as an
index. The input check prevents the out-of-bounds access, while the output
check validates the eventq descriptor direction.
I found the descriptor direction issue myself, though the patch was
written with AI assistance. The out-of-bounds read with an
output-only chain was separately reported by Jia Jia.
Fixes: a6c9af87363c ("tcm_vhost: Add hotplug/hotunplug support")
Reported-by: Jia Jia <physicalmtea@gmail.com>
Assisted-by: OpenAI-Codex:GPT-5
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Message-ID: <20261009-fix-arrary-index-out-of-bounds-in-vhost_scsi_complete_events-v2-1-1f7689a54735@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/scsi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index a0d407c49694b..95273ef5da9f4 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -477,6 +477,16 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt)
return;
}
+ /*
+ * Eventq buffers are device-writable only. A nonzero in count
+ * guarantees that out is within the bounds of vq->iov.
+ */
+ if (unlikely(out || !in)) {
+ vq_err(vq, "Invalid event buffer: out %u, in %u\n", out, in);
+ vs->vs_events_missed = true;
+ return;
+ }
+
if ((vq->iov[out].iov_len != sizeof(struct virtio_scsi_event))) {
vq_err(vq, "Expecting virtio_scsi_event, got %zu bytes\n",
vq->iov[out].iov_len);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0132/1167] vhost-scsi: reject delayed virtqueue setup
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (130 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0131/1167] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0133/1167] vhost: reject backend enable without a kick file Greg Kroah-Hartman
` (525 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linfeng Sun <linfeng.sun.dev@gmail.com>
[ Upstream commit a543346b96a174fcee6812ac2764acc8dc993358 ]
vhost_scsi_set_endpoint() allocates command pools only for I/O
virtqueues that are already set up, but publishes the backend for every
virtqueue. Userspace can complete a skipped queue after attaching the
endpoint, then kick it with scsi_tags uninitialized and trigger the
alloc_hint warning in sbitmap_get().
Delayed virtqueue setup is not supported. Leave skipped I/O virtqueues
inactive and reject changes to the vring size or addresses while an
endpoint is attached. Userspace must clear the endpoint before changing
the vring configuration.
I found this bug myself, though the patch was written with AI assistance.
Fixes: 25b98b64e284 ("vhost scsi: alloc cmds per vq instead of session")
Assisted-by: OpenAI-Codex:GPT-5.6
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261010-fix-warning-in-sbitmap_get-v3-1-33de562d1359@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/scsi.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 95273ef5da9f4..7b55a9a9248f1 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1782,6 +1782,9 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
for (i = 0; i < vs->dev.nvqs; i++) {
vq = &vs->vqs[i].vq;
+ if (i >= VHOST_SCSI_VQ_IO && !vs->vqs[i].scsi_cmds)
+ continue;
+
mutex_lock(&vq->mutex);
vhost_vq_set_backend(vq, vs_tpg);
vhost_vq_init_access(vq);
@@ -2113,10 +2116,16 @@ vhost_scsi_ioctl(struct file *f,
default:
mutex_lock(&vs->dev.mutex);
r = vhost_dev_ioctl(&vs->dev, ioctl, argp);
- if (r == -ENOIOCTLCMD)
- r = vhost_vring_ioctl(&vs->dev, ioctl, argp);
- else
+ if (r == -ENOIOCTLCMD) {
+ if (vs->vs_tpg &&
+ (ioctl == VHOST_SET_VRING_NUM ||
+ ioctl == VHOST_SET_VRING_ADDR))
+ r = -EBUSY;
+ else
+ r = vhost_vring_ioctl(&vs->dev, ioctl, argp);
+ } else {
vhost_scsi_flush(vs);
+ }
mutex_unlock(&vs->dev.mutex);
return r;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0133/1167] vhost: reject backend enable without a kick file
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (131 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0132/1167] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0134/1167] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
` (524 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linfeng Sun <linfeng.sun.dev@gmail.com>
[ Upstream commit 509f6bd229e94fc39506e01be692c4aa22338b49 ]
Enabling a backend without VHOST_SET_VRING_KICK dereferences a NULL
vq->kick in vhost_poll_start(). Reject the request with -EINVAL.
Fixes: 264ee5aa81ec ("tools/virtio: Add --reset")
Assisted-by: OpenAI-Codex:GPT-5.6
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261011-fix-null-pointer-in-vhost_test_set_backend-v1-1-60b2f12d64c6@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/test.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c
index 42c955a5b2111..997f869284377 100644
--- a/drivers/vhost/test.c
+++ b/drivers/vhost/test.c
@@ -281,6 +281,10 @@ static long vhost_test_set_backend(struct vhost_test *n, unsigned index, int fd)
r = -EFAULT;
goto err_vq;
}
+ if (enable && !vq->kick) {
+ r = -EINVAL;
+ goto err_vq;
+ }
if (!enable) {
vhost_poll_stop(&vq->poll);
backend = vhost_vq_get_backend(vq);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0134/1167] vhost-vdpa: initialize state before publishing cdev
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (132 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0133/1167] vhost: reject backend enable without a kick file Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0135/1167] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
` (523 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linfeng Sun <linfeng.sun.dev@gmail.com>
[ Upstream commit 4b03d1e7f13613af708441a061556de99891a516 ]
Initialize the completion and as hash buckets before cdev_device_add()
makes the device accessible.
Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend")
Assisted-by: OpenAI-Codex:GPT-5.6
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261011-fix-null-pointer-in-vhost_vdpa_release-v2-1-66ba929971ce@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/vdpa.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index ac0da85b6df81..36e0c8b314593 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -1622,7 +1622,7 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
return minor;
}
- atomic_set(&v->opened, 0);
+ atomic_set(&v->opened, 1);
spin_lock_init(&v->config_lock);
v->minor = minor;
v->vdpa = vdpa;
@@ -1646,16 +1646,17 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
cdev_init(&v->cdev, &vhost_vdpa_fops);
v->cdev.owner = THIS_MODULE;
+ init_completion(&v->completion);
+ for (i = 0; i < VHOST_VDPA_IOTLB_BUCKETS; i++)
+ INIT_HLIST_HEAD(&v->as[i]);
r = cdev_device_add(&v->cdev, &v->dev);
if (r)
goto err;
- init_completion(&v->completion);
vdpa_set_drvdata(vdpa, v);
- for (i = 0; i < VHOST_VDPA_IOTLB_BUCKETS; i++)
- INIT_HLIST_HEAD(&v->as[i]);
+ atomic_set_release(&v->opened, 0);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0135/1167] ext2: only flush DIRSYNC directories on every change
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (133 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0134/1167] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0136/1167] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
` (522 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Bacik, Jan Kara, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 3f57fc2c49ed05ccfc56e4dc9eda41be95925bbd ]
Every change of an ext2 directory is written to disk before the system call
returns, whether the directory is DIRSYNC or not: its pages with
filemap_write_and_wait() and its inode with sync_inode_metadata().
Writes which reach the device for 2000 files, and 200 directories, in a
directory without DIRSYNC, with the flusher turned off:
create rename unlink mkdir
before 4000 8000 4000 800
after 0 0 0 0
In a directory with chattr +D the numbers are those of "before", before and
after.
commit bc943f4872a7 ("ext2: Don't flush page immediately for DIRSYNC
directories") moved the flush from ext2_commit_chunk() to the new
ext2_handle_dirsync(). The IS_DIRSYNC() check which was around it didn't
move along.
Fix by putting the check into ext2_handle_dirsync().
Fixes: bc943f4872a7 ("ext2: Don't flush page immediately for DIRSYNC directories")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-b4-ext2-dirsync-v1-1-3dcd012d518d@toxicpanda.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ext2/dir.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index b335f17f682f7..73c14858eabaa 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -445,6 +445,9 @@ static int ext2_handle_dirsync(struct inode *dir)
{
int err;
+ if (!IS_DIRSYNC(dir))
+ return 0;
+
err = filemap_write_and_wait(dir->i_mapping);
if (!err)
err = sync_inode_metadata(dir, 1);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0136/1167] virtio-blk: Fix zone append sector reporting in batched completion
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (134 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0135/1167] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0137/1167] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
` (521 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Michael S. Tsirkin,
Stefan Hajnoczi, Christoph Hellwig, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shao Mingyin <shao.mingyin@zte.com.cn>
[ Upstream commit 08a6572441a4e646c96c2b8d8ead9eea0e458332 ]
For zone append, the block layer copies req->__sector back into the
bio in blk_zone_append_update_request_bio(), so the driver must update
req->__sector with the sector reported by the device.
virtblk_request_done() does that, but the batched completion path used
by virtblk_poll() only unmaps and cleans up the requests before calling
blk_mq_end_request_batch().
A zone append completed through polling therefore keeps the sector that
was assigned at submission time, and the file system or application sees
the wrong LBA for the written data.
Move the sector update into a helper and call it from both completion
paths.
Fixes: 95bfec41bd3d ("virtio-blk: add support for zoned block devices")
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/202610261955196384aSLGuy3_0MiTvlYXVdiC@zte.com.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/virtio_blk.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 49ce9ef8e8cfb..bf9fbe2f4efbc 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -332,18 +332,25 @@ static inline u8 virtblk_vbr_status(struct virtblk_req *vbr)
return *((u8 *)&vbr->in_hdr + vbr->in_hdr_len - 1);
}
+static inline void virtblk_update_zone_append_sector(struct request *req,
+ struct virtblk_req *vbr)
+{
+ struct virtio_blk *vblk = req->mq_hctx->queue->queuedata;
+
+ if (req_op(req) == REQ_OP_ZONE_APPEND)
+ req->__sector = virtio64_to_cpu(vblk->vdev,
+ vbr->in_hdr.zone_append.sector);
+}
+
static inline void virtblk_request_done(struct request *req)
{
struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
blk_status_t status = virtblk_result(virtblk_vbr_status(vbr));
- struct virtio_blk *vblk = req->mq_hctx->queue->queuedata;
virtblk_unmap_data(req, vbr);
virtblk_cleanup_cmd(req);
- if (req_op(req) == REQ_OP_ZONE_APPEND)
- req->__sector = virtio64_to_cpu(vblk->vdev,
- vbr->in_hdr.zone_append.sector);
+ virtblk_update_zone_append_sector(req, vbr);
blk_mq_end_request(req, status);
}
@@ -1250,8 +1257,11 @@ static void virtblk_complete_batch(struct io_comp_batch *iob)
struct request *req;
rq_list_for_each(&iob->req_list, req) {
- virtblk_unmap_data(req, blk_mq_rq_to_pdu(req));
+ struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
+
+ virtblk_unmap_data(req, vbr);
virtblk_cleanup_cmd(req);
+ virtblk_update_zone_append_sector(req, vbr);
}
blk_mq_end_request_batch(iob);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0137/1167] block: partitions: reject GPT entries with starting_lba > ending_lba
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (135 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0136/1167] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0138/1167] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
` (520 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zizhi Wo, Christoph Hellwig,
Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zizhi Wo <wozizhi@huawei.com>
[ Upstream commit 7e3801d12ebabaa3db6e2685ccc80b6e6f6d1ff7 ]
A GPT entry whose starting_lba is greater than its ending_lba is accepted,
and the kernel creates a partition with a bogus size. The bogus sector
count defeats the end-of-device check, so I/O through that partition is not
confined to it and can access sectors outside the partition on the same
disk.
is_pte_valid() only rejects an entry when its type is NULL or when
starting_lba or ending_lba is greater than lastlba; it never checks that
starting_lba <= ending_lba. For a reversed entry both field checks still
pass, but efi_partition() computes size = ending_lba - starting_lba + 1 in
u64, which underflows to a huge value. That value also wraps in the
end-of-device check in blk_add_partition() (from + size) and does not fit
the signed i_size, which turns negative.
Reject entries with starting_lba > ending_lba in is_pte_valid(), matching
the head-level check against last_usable_lba < first_usable_lba.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20261102080442.3775061-1-wozizhi@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/partitions/efi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index 7acba66eed481..d88321f6400ab 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -461,6 +461,7 @@ static inline int
is_pte_valid(const gpt_entry *pte, const u64 lastlba)
{
if ((!efi_guidcmp(pte->partition_type_guid, NULL_GUID)) ||
+ le64_to_cpu(pte->starting_lba) > le64_to_cpu(pte->ending_lba) ||
le64_to_cpu(pte->starting_lba) > lastlba ||
le64_to_cpu(pte->ending_lba) > lastlba)
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0138/1167] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (136 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0137/1167] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0139/1167] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
` (519 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nguyen Dinh Phi, Stefano Garzarella,
Bobby Eshleman, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nguyen Dinh Phi <phind.uet@gmail.com>
[ Upstream commit c0ef6144b4d60afb90bc6d8db3ffdac043cd6ffc ]
The timeval validation checks tv_usec < USEC_PER_SEC but not
tv_usec >= 0, so a negative tv_usec makes the timeout computation
wrap into a bogus value, later tripping "schedule_timeout: wrong
timeout value" instead of being rejected.
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20261030064428.73930-1-phind.uet@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/vmw_vsock/af_vsock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 9d6dce5311990..3448a838b02f3 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1842,7 +1842,8 @@ static int vsock_connectible_setsockopt(struct socket *sock,
optname == SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD);
if (err)
break;
- if (tv.tv_sec >= 0 && tv.tv_usec < USEC_PER_SEC &&
+ if (tv.tv_sec >= 0 && tv.tv_usec >= 0 &&
+ tv.tv_usec < USEC_PER_SEC &&
tv.tv_sec < (MAX_SCHEDULE_TIMEOUT / HZ - 1)) {
vsk->connect_timeout = tv.tv_sec * HZ +
DIV_ROUND_UP((unsigned long)tv.tv_usec, (USEC_PER_SEC / HZ));
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0139/1167] null_blk: fix opening closed zones at the active zone limit
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (137 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0138/1167] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0140/1167] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
` (518 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 6f2b59737bf9cf3623719857ac149f0d431db109 ]
When the open zone limit is reached, null_check_open() closes an
implicitly open zone only if the active zone limit is not reached.
Closing an implicitly open zone does not change the number of active
zones, so this check is wrong. For an empty zone, the active zone limit
was already checked by null_check_zone_resources(). For a closed zone,
the check makes writing to, opening or finishing the zone fail with
BLK_STS_ZONE_OPEN_RESOURCE at the active zone limit, whereas ZBC-3
(4.5.3.2.7.2) and NVMe ZNS (2.1.1.4.1) require closing an implicitly
open zone instead.
Remove the check, and update the comment above
null_check_zone_resources() accordingly.
Fixes: dc4d137ee3b7 ("null_blk: add support for max open/active zone limit for zoned devices")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20261022092158.2248831-6-cassel@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/null_blk/zoned.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c
index 6ed46db23cb2d..50e04fffb92b9 100644
--- a/drivers/block/null_blk/zoned.c
+++ b/drivers/block/null_blk/zoned.c
@@ -335,10 +335,8 @@ static blk_status_t null_check_open(struct nullb_device *dev)
return BLK_STS_OK;
if (dev->nr_zones_imp_open) {
- if (null_check_active(dev) == BLK_STS_OK) {
- null_close_imp_open_zone(dev);
- return BLK_STS_OK;
- }
+ null_close_imp_open_zone(dev);
+ return BLK_STS_OK;
}
return BLK_STS_ZONE_OPEN_RESOURCE;
@@ -354,8 +352,11 @@ static blk_status_t null_check_open(struct nullb_device *dev)
*
* ZBC states that an implicit open zone shall be closed only if there is not
* room within the open limit. However, with the addition of an active limit,
- * it is not certain that closing an implicit open zone will allow a new zone
- * to be opened, since we might already be at the active limit capacity.
+ * it is not certain that closing an implicit open zone will allow an empty
+ * zone to be opened, since we might already be at the active limit capacity.
+ * Therefore, the active limit is checked first for an empty zone. A closed
+ * zone already holds an active zone resource, so only the open limit has to
+ * be checked for a closed zone.
*/
static blk_status_t null_check_zone_resources(struct nullb_device *dev,
struct nullb_zone *zone)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0140/1167] null_blk: dont finish zones to set them read-only or offline
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (138 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0139/1167] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0141/1167] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
` (517 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 973bf587d79f061beffdd392e77012a07f25fcd6 ]
null_set_zone_cond() calls null_finish_zone() to release the zone
resources held by a zone before setting it read-only or offline.
For an empty or closed zone, null_finish_zone() first runs the zone
resource checks, which can close an unrelated implicitly open zone, or
fail. As the error is ignored, a failure for a closed zone leaks
nr_zones_closed, permanently lowering the effective active zone limit.
Setting a zone read-only or offline requires no zone resources, so
release the zone resources held by the zone directly instead, using a
new helper, null_release_zone_resources().
Fixes: d3a5738849e0 ("null_blk: support read-only and offline zone conditions")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20261022092158.2248831-7-cassel@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/null_blk/zoned.c | 35 +++++++++++++++++++++++++++++-----
1 file changed, 30 insertions(+), 5 deletions(-)
diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c
index 50e04fffb92b9..339dc07eef15b 100644
--- a/drivers/block/null_blk/zoned.c
+++ b/drivers/block/null_blk/zoned.c
@@ -707,6 +707,33 @@ blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd, enum req_op op,
}
}
+/*
+ * Release the zone resources held by a zone, before changing the condition of
+ * the zone to a condition that does not hold any zone resources.
+ */
+static void null_release_zone_resources(struct nullb_device *dev,
+ struct nullb_zone *zone)
+{
+ if (!dev->need_zone_res_mgmt)
+ return;
+
+ spin_lock(&dev->zone_res_lock);
+ switch (zone->cond) {
+ case BLK_ZONE_COND_IMP_OPEN:
+ dev->nr_zones_imp_open--;
+ break;
+ case BLK_ZONE_COND_EXP_OPEN:
+ dev->nr_zones_exp_open--;
+ break;
+ case BLK_ZONE_COND_CLOSED:
+ dev->nr_zones_closed--;
+ break;
+ default:
+ break;
+ }
+ spin_unlock(&dev->zone_res_lock);
+}
+
/*
* Set a zone in the read-only or offline condition.
*/
@@ -723,8 +750,8 @@ static void null_set_zone_cond(struct nullb_device *dev,
* If the read-only condition is requested again to zones already in
* read-only condition, restore back normal empty condition. Do the same
* if the offline condition is requested for offline zones. Otherwise,
- * set the specified zone condition to the zones. Finish the zones
- * beforehand to free up zone resources.
+ * set the specified zone condition to the zones. Release the zone
+ * resources held by the zones beforehand.
*/
if (zone->cond == cond) {
zone->cond = BLK_ZONE_COND_EMPTY;
@@ -732,9 +759,7 @@ static void null_set_zone_cond(struct nullb_device *dev,
if (dev->memory_backed)
null_handle_discard(dev, zone->start, zone->len);
} else {
- if (zone->cond != BLK_ZONE_COND_READONLY &&
- zone->cond != BLK_ZONE_COND_OFFLINE)
- null_finish_zone(dev, zone);
+ null_release_zone_resources(dev, zone);
zone->cond = cond;
zone->wp = (sector_t)-1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0141/1167] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (139 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0140/1167] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0142/1167] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
` (516 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jiayuan Chen, Kuniyuki Iwashima, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 647b81ddefc6364290e67bf33c89d54971f8995e ]
inet_twsk_kill() removes a TIME_WAIT socket from the established hash
before it finishes using the ehash lock, hashinfo and bind tables, and
before it drops the death-row reference. A running timer can therefore
unhash its socket before inet_twsk_purge() reaches it. The purge cannot
synchronize with that timer, and tcp_sk_exit_batch() can free the
private ehash and hashinfo while inet_twsk_kill() is still using them.
An unprivileged reproducer using user and network namespaces, a private
TCP ehash and a FIN_WAIT2 timer triggers a KASAN slab-use-after-free in
inet_twsk_kill(). The allocation and free stacks point to
inet_pernet_hashinfo_alloc() and inet_pernet_hashinfo_free().
Wait for an RCU grace period after purging the whole batch, if one
netns in the batch uses a private ehash. TIME_WAIT removal runs with
bottom halves disabled, so this also waits for removers that were
already invisible to the purge. Keep the wait under
tcp_exit_batch_mutex, before freeing any private hashinfo.
The same window exists with the shared tcp_hashinfo. There, the
hashinfo memory stays valid, but tcp_sk_exit_batch() can decrement
tcp_death_row.tw_refcount from 2 to 1 before inet_twsk_kill() drops its
own reference. This triggers the WARN_ON_ONCE() in tcp_sk_exit_batch(),
then a refcount_t "decrement hit 0" warning from inet_twsk_kill().
Adding a grace period for the shared case would be costly on busy
hosts. It is not needed: struct net is freed by a later cleanup_net(),
after the synchronize_rcu() in ops_undo_list(), so inet_twsk_kill()
can safely drop the last tw_refcount reference itself.
Use refcount_dec_if_one() and only warn if tw_refcount is not 1
after a grace period.
Fixes: d1e5e6408b30 ("tcp: Introduce optional per-netns ehash.")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
[edumazet: only call synchronize_net() if one netns in the batch uses a private ehash,
use refcount_dec_if_one() to avoid a false WARN with the shared ehash]
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261030075843.2567707-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_ipv4.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 0b055eaacf3ab..a31c9e228cdc9 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -3469,6 +3469,7 @@ static int __net_init tcp_sk_init(struct net *net)
static void __net_exit tcp_sk_exit_batch(struct list_head *net_exit_list)
{
+ bool synced = false;
struct net *net;
/* make sure concurrent calls to tcp_sk_exit_batch from net_cleanup_work
@@ -3483,9 +3484,27 @@ static void __net_exit tcp_sk_exit_batch(struct list_head *net_exit_list)
tcp_twsk_purge(net_exit_list);
+ /* inet_twsk_kill() unhashes a twsk before it is done with ehash
+ * and bhash, and before it drops its tw_refcount reference,
+ * so tcp_twsk_purge() can miss it. Such callers run with BH
+ * disabled: wait for them before freeing a private ehash.
+ */
+ list_for_each_entry(net, net_exit_list, exit_list) {
+ if (net->ipv4.tcp_death_row.hashinfo->pernet) {
+ synchronize_net();
+ synced = true;
+ break;
+ }
+ }
+
list_for_each_entry(net, net_exit_list, exit_list) {
inet_pernet_hashinfo_free(net->ipv4.tcp_death_row.hashinfo);
- WARN_ON_ONCE(!refcount_dec_and_test(&net->ipv4.tcp_death_row.tw_refcount));
+ /* Without a grace period, a concurrent inet_twsk_kill() might
+ * still hold a tw_refcount reference. Let it drop it: struct net
+ * is freed by a later cleanup_net(), after an RCU grace period.
+ */
+ if (!refcount_dec_if_one(&net->ipv4.tcp_death_row.tw_refcount))
+ WARN_ON_ONCE(synced);
tcp_fastopen_ctx_destroy(net);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0142/1167] net: dsa: b53: Enable IGMP and MLD control packet CPU copies
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (140 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0141/1167] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0143/1167] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
` (515 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Paolo Abeni,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <florian.fainelli@broadcom.com>
[ Upstream commit 3362cb822ea750399a15b741713181fd8560bd17 ]
IGMPv2 reports and MLDv1 reports are addressed to the multicast group
itself. Once the first listener is installed in the ARL table, subsequent
reports can follow that entry without reaching the CPU. The bridge then
fails to learn additional listeners, although static MDB forwarding works.
Enable the high-level protocol classifiers so that IGMP and MLD control
packets are copied to the CPU independently of the multicast ARL lookup.
Retain normal L2 forwarding by clearing the CPU-only forwarding modes,
and preserve unrelated protocol-control fields.
Handle the BCM5395's 16-bit register and different classifier fields
separately from the 32-bit layout on the BCM531xx, BCM5301x and newer
integrated RoboSwitch families, including BCM7445, BCM7278 and BCM4908.
Export the helper and call it from bcm_sf2_sw_setup() as well, since SF2
uses its own setup operation instead of b53_setup(). This also restores
the classifiers after the switch reset on resume. Leave older devices
with different IGMP controls untouched, and propagate register access
failures during setup.
The SF2 setup integration and BCM4908 chip gate were updated with
assistance from OpenAI Codex in response to review feedback.
Fixes: 5d65b64a3d97 ("net: dsa: b53: Add support for MDB")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20261028235100.3892374-2-florian.fainelli@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/dsa/b53/b53_common.c | 57 ++++++++++++++++++++++++++++++++
drivers/net/dsa/b53/b53_priv.h | 1 +
drivers/net/dsa/b53/b53_regs.h | 17 ++++++++++
drivers/net/dsa/bcm_sf2.c | 5 +++
4 files changed, 80 insertions(+)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 41961e3809b20..83d73fcd733bc 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -709,6 +709,59 @@ void b53_brcm_hdr_setup(struct dsa_switch *ds, int port)
}
EXPORT_SYMBOL(b53_brcm_hdr_setup);
+int b53_enable_mcast_snooping(struct b53_device *dev)
+{
+ u16 val16;
+ u32 val;
+ int ret;
+
+ /* Older switches use different IGMP controls, not HL_PRTC_CTRL. */
+ if (is5325(dev) || is5365(dev) || dev->chip_id == BCM5389_DEVICE_ID ||
+ is5397_98(dev) || is63xx(dev))
+ return 0;
+
+ /* IGMPv2 and MLDv1 reports use the group's destination MAC. Once
+ * the first listener is offloaded, ordinary multicast forwarding
+ * can keep subsequent reports from reaching the bridge CPU.
+ */
+
+ /* BCM5395 has a narrower register and a single IGMP classifier.
+ * Its ICMPv6 classifier also covers MLD.
+ */
+ if (dev->chip_id == BCM5395_DEVICE_ID) {
+ ret = b53_read16(dev, B53_MGMT_PAGE, B53_HL_PRTC_CTRL, &val16);
+ if (ret)
+ return ret;
+
+ val16 |= HL_PRTC_IGMP_IP_EN_5395 | HL_PRTC_ICMPV6_EN;
+ /* Zero forwarding modes copy control traffic to the CPU
+ * independently of the ARL lookup, retaining L2 forwarding.
+ */
+ val16 &= ~(HL_PRTC_IGMP_FWD_MODE_5395 |
+ HL_PRTC_ICMPV6_FWD_MODE);
+
+ return b53_write16(dev, B53_MGMT_PAGE, B53_HL_PRTC_CTRL,
+ val16);
+ }
+
+ ret = b53_read32(dev, B53_MGMT_PAGE, B53_HL_PRTC_CTRL, &val);
+ if (ret)
+ return ret;
+
+ val |= HL_PRTC_IGMP_RPTLVE_EN | HL_PRTC_IGMP_QRY_EN |
+ HL_PRTC_IGMP_UKN_EN | HL_PRTC_MLD_RPTDONE_EN |
+ HL_PRTC_MLD_QRY_EN;
+ /* Zero forwarding modes copy control traffic to the CPU
+ * independently of the ARL lookup, retaining L2 forwarding.
+ */
+ val &= ~(HL_PRTC_IGMP_RPTLVE_FWD_MODE | HL_PRTC_IGMP_QRY_FWD_MODE |
+ HL_PRTC_IGMP_UKN_FWD_MODE | HL_PRTC_MLD_RPTDONE_FWD_MODE |
+ HL_PRTC_MLD_QRY_FWD_MODE);
+
+ return b53_write32(dev, B53_MGMT_PAGE, B53_HL_PRTC_CTRL, val);
+}
+EXPORT_SYMBOL(b53_enable_mcast_snooping);
+
static void b53_enable_cpu_port(struct b53_device *dev, int port)
{
u8 port_ctrl;
@@ -1159,6 +1212,10 @@ static int b53_setup(struct dsa_switch *ds)
b53_disable_port(ds, port);
}
+ ret = b53_enable_mcast_snooping(dev);
+ if (ret)
+ return ret;
+
return b53_setup_devlink_resources(ds);
}
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index fdcfd5081c284..97d8a18f754ec 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -334,6 +334,7 @@ static inline int b53_switch_get_reset_gpio(struct b53_device *dev)
/* Exported functions towards other drivers */
void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port);
int b53_configure_vlan(struct dsa_switch *ds);
+int b53_enable_mcast_snooping(struct b53_device *dev);
void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset,
uint8_t *data);
void b53_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data);
diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h
index 38e2d60dab7d5..0a2a0f4f4f5d8 100644
--- a/drivers/net/dsa/b53/b53_regs.h
+++ b/drivers/net/dsa/b53/b53_regs.h
@@ -256,6 +256,23 @@
/* Revision ID register (8 bit) */
#define B53_REV_ID 0x40
+/* High-level protocol control (16 bit on BCM5395, otherwise 32 bit) */
+#define B53_HL_PRTC_CTRL 0x50
+#define HL_PRTC_ICMPV6_EN BIT(4)
+#define HL_PRTC_ICMPV6_FWD_MODE BIT(5)
+#define HL_PRTC_IGMP_IP_EN_5395 BIT(6)
+#define HL_PRTC_IGMP_FWD_MODE_5395 BIT(8)
+#define HL_PRTC_IGMP_RPTLVE_EN BIT(9)
+#define HL_PRTC_IGMP_RPTLVE_FWD_MODE BIT(10)
+#define HL_PRTC_IGMP_QRY_EN BIT(11)
+#define HL_PRTC_IGMP_QRY_FWD_MODE BIT(12)
+#define HL_PRTC_IGMP_UKN_EN BIT(13)
+#define HL_PRTC_IGMP_UKN_FWD_MODE BIT(14)
+#define HL_PRTC_MLD_RPTDONE_EN BIT(15)
+#define HL_PRTC_MLD_RPTDONE_FWD_MODE BIT(16)
+#define HL_PRTC_MLD_QRY_EN BIT(17)
+#define HL_PRTC_MLD_QRY_FWD_MODE BIT(18)
+
/* Broadcom header RX control (16 bit) */
#define B53_BRCM_HDR_RX_DIS 0x60
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 7defcfd1c213f..b3feb6e36629a 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -1050,6 +1050,7 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
{
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
unsigned int port;
+ int ret;
/* Enable all valid ports and disable those unused */
for (port = 0; port < priv->hw_params.num_ports; port++) {
@@ -1065,6 +1066,10 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
b53_configure_vlan(ds);
bcm_sf2_enable_acb(ds);
+ ret = b53_enable_mcast_snooping(priv->dev);
+ if (ret)
+ return ret;
+
return b53_setup_devlink_resources(ds);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0143/1167] net: ethernet: mediatek: preserve sibling PPE bindings
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (141 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0142/1167] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0144/1167] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
` (514 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Goodkind, Simon Horman,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Goodkind <alex@goodkind.io>
[ Upstream commit 34cc22a9ce6ae0228dcd09a57df23aea62e22b04 ]
__mtk_ppe_check_skb() clears entry->hash for flows bound to other
hardware slots in the same software hash bucket. mtk_flow_offload_stats()
then skips their hardware counter updates. L2 cleanup also frees sibling
subflows without invalidating their hardware rules.
Restrict both cleanup paths to entries assigned to the inspected slot.
Two UDP trials reproduced the counter failure on a GL-MT3000/MT7981
running unmodified OpenWrt 25.12.5 with Linux 6.12.94:
1. Start a UDP connection.
2. Add a control connection in a different hash bucket.
3. Add a connection in the first connection's hash bucket.
AI code review of the original patch identified the cleanup problem
in L2 subflows.
Full ARM64 builds with allmodconfig and allyesconfig passed before
and after the patch using GCC 14.2.0 and W=1, without new warnings.
The builds used CONFIG_WERROR=n because the unmodified ARM64 kernel
already emits warnings. Hardware testing has not run for this revision.
Fixes: c4f033d9e03e ("net: ethernet: mtk_eth_soc: rework hardware flow table management")
Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries")
Link: https://github.com/openwrt/openwrt/pull/26107
Signed-off-by: Alexander Goodkind <alex@goodkind.io>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261030010517.45639-1-alex@goodkind.io
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_ppe.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
index eb4df95fe9d0f..b3e6006a0c035 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -752,8 +752,7 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
hlist_for_each_entry_safe(entry, n, head, list) {
if (entry->type == MTK_FLOW_TYPE_L2_SUBFLOW) {
- if (unlikely(FIELD_GET(MTK_FOE_IB1_STATE, hwe->ib1) ==
- MTK_FOE_STATE_BIND))
+ if (entry->hash != hash)
continue;
entry->hash = 0xffff;
@@ -762,7 +761,7 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
}
if (found || !mtk_flow_entry_match(ppe->eth, entry, hwe)) {
- if (entry->hash != 0xffff)
+ if (entry->hash == hash)
entry->hash = 0xffff;
continue;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0144/1167] nvmet-rdma: disconnect only established queues
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (142 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0143/1167] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0145/1167] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
` (513 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 000a9f4492abad6008682b55571ddc31941963e3 ]
Over iWARP, rdma_disconnect() sleeps in iw_cm_disconnect() until the
ESTABLISHED event of the connection has been handled, and iw_cm handles
all events of all connections one at a time on iw_cm_wq.
nvmet_rdma_destroy_port_queues(), nvmet_rdma_remove_one() and
nvmet_rdma_delete_ctrl() walk the queue list with
nvmet_rdma_queue_mutex held and call rdma_disconnect() for each, while
nvmet_rdma_cm_handler() takes the same mutex. If the walk sleeps on a
queue whose ESTABLISHED is queued behind another queue's event, both
are stuck and iWARP connection handling is dead until reboot. A peer
sets that up by connecting in a loop, or over siw by asking for MPA
peer-to-peer mode and then staying silent, which delays ESTABLISHED
indefinitely.
Only call rdma_disconnect() for a queue in NVMET_RDMA_Q_LIVE, which the
handler sets when it gets ESTABLISHED. A queue that never got there is
left to the release work: ib_drain_qp() moves the QP to the error
state, which ends the connection, and rdma_destroy_id() tells the peer.
Over IB and RoCE the skipped call did nothing more than that.
Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal")
Fixes: fcf73a804c7d ("nvmet-rdma: fix use-after-free when a port is removed")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/target/rdma.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 87f1a4b6f4b9e..7e595b8dcdc75 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1691,7 +1691,7 @@ static void nvmet_rdma_queue_established(struct nvmet_rdma_queue *queue)
static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
{
- bool disconnect = false;
+ bool disconnect = false, live = false;
unsigned long flags;
pr_debug("cm_id= %p queue->state= %d\n", queue->cm_id, queue->state);
@@ -1710,6 +1710,7 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
}
fallthrough;
case NVMET_RDMA_Q_LIVE:
+ live = queue->state == NVMET_RDMA_Q_LIVE;
queue->state = NVMET_RDMA_Q_DISCONNECTING;
disconnect = true;
break;
@@ -1719,7 +1720,17 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
spin_unlock_irqrestore(&queue->state_lock, flags);
if (disconnect) {
- rdma_disconnect(queue->cm_id);
+ /*
+ * Over iWARP rdma_disconnect() sleeps until the CM has handled
+ * the ESTABLISHED event of this connection. The CM handles the
+ * events of all connections one at a time, and our handler
+ * takes nvmet_rdma_queue_mutex, which callers of this function
+ * hold. So a queue that has not seen the event is left to the
+ * release work: ib_drain_qp() moves the queue pair to the error
+ * state, which ends the connection.
+ */
+ if (live)
+ rdma_disconnect(queue->cm_id);
queue_work(nvmet_wq, &queue->release_work);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0145/1167] nvmet-tcp: limit the connections accepted per work run
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (143 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0144/1167] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0146/1167] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
` (512 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Hannes Reinecke, Josef Bacik, Jens Axboe,
Keith Busch, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit a029f1b2fb13e6ac6e1c2f27fba1d80b6e7cac51 ]
nvmet_tcp_accept_work() loops until there's nothing left to accept, and
anyone opening and closing connections fast enough keeps it running
indefinitely, since tearing down a dead connection takes long enough for
more to arrive. Whoever flushes nvmet_wq waits for it: removing any
other port of the target does in nvmet_port_release(), and so does
unloading the rdma and fc modules.
Accept a bounded number of connections per run and requeue the work. A
flush doesn't wait for work queued behind it.
Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/target/tcp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 7134c54592dcd..9a7ee3f0c7073 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -70,6 +70,7 @@ MODULE_PARM_DESC(idle_poll_period_usecs,
#define NVMET_TCP_RECV_BUDGET 8
#define NVMET_TCP_SEND_BUDGET 8
#define NVMET_TCP_IO_WORK_BUDGET 64
+#define NVMET_TCP_ACCEPT_BUDGET 16
enum nvmet_tcp_send_state {
NVMET_TCP_SEND_DATA_PDU,
@@ -1816,9 +1817,9 @@ static void nvmet_tcp_accept_work(struct work_struct *w)
struct nvmet_tcp_port *port =
container_of(w, struct nvmet_tcp_port, accept_work);
struct socket *newsock;
- int ret;
+ int ret, i;
- while (true) {
+ for (i = 0; i < NVMET_TCP_ACCEPT_BUDGET; i++) {
ret = kernel_accept(port->sock, &newsock, O_NONBLOCK);
if (ret < 0) {
if (ret != -EAGAIN)
@@ -1827,6 +1828,9 @@ static void nvmet_tcp_accept_work(struct work_struct *w)
}
nvmet_tcp_alloc_queue(port, newsock);
}
+
+ /* There may be more. Come to an end for those who flush nvmet_wq. */
+ queue_work(nvmet_wq, &port->accept_work);
}
static void nvmet_tcp_listen_data_ready(struct sock *sk)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0146/1167] nvmet-rdma: take a device off the list last
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (144 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0145/1167] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0147/1167] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
` (511 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 86ae3841aea4e29d7ac08d5614ca3823dc8dfbc9 ]
nvmet_rdma_remove_one() disconnects the queues of a device and flushes
nvmet-wq, but since commit a3dd7d0022c3 it returns right away if the
device isn't on device_list. nvmet_rdma_free_dev(), run by the release
work of the last queue, takes the device off that list first and frees
the SRQs and the PD afterwards. A device removal in between finds
nothing on the list, returns, and the RDMA core frees the device under
ib_dealloc_pd().
Free the SRQs and the PD first and unlist the device last, so the
remove callback finds it and its flush waits for the release work.
Fixes: a3dd7d0022c3 ("nvmet-rdma: Don't flush system_wq by default during remove_one")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/target/rdma.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 7e595b8dcdc75..53214a092c62f 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1200,13 +1200,18 @@ static void nvmet_rdma_free_dev(struct kref *ref)
struct nvmet_rdma_device *ndev =
container_of(ref, struct nvmet_rdma_device, ref);
+ nvmet_rdma_destroy_srqs(ndev);
+ ib_dealloc_pd(ndev->pd);
+
+ /*
+ * Only delete from the device list once all RDMA resources are torn
+ * down because nvmet_rdma_remove_one waits for the release work only
+ * if the device still is on the list.
+ */
mutex_lock(&device_list_mutex);
list_del(&ndev->entry);
mutex_unlock(&device_list_mutex);
- nvmet_rdma_destroy_srqs(ndev);
- ib_dealloc_pd(ndev->pd);
-
kfree(ndev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0147/1167] nvmet-rdma: queue the release work under the mutex
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (145 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0146/1167] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0148/1167] nvme: fix various comment typos Greg Kroah-Hartman
` (510 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 80095787f776967361cca76357f19e5445e0cd75 ]
nvmet_rdma_remove_one() takes the queue mutex, unlists each queue of
the device and queues its release work, then flushes nvmet-wq. So a
queue that still holds objects on the device must either be on the
list or have its release work queued. nvmet_rdma_queue_disconnect()
breaks that: it unlists the queue under the mutex, drops it, and only
then calls __nvmet_rdma_queue_disconnect() to queue the work. A device
removal in that window finds nothing to wait for, and the release work
then destroys the QP and CQ share on a freed device.
Queue the work before dropping the mutex, as nvmet_rdma_remove_one()
itself does. That's safe now that rdma_disconnect() no longer sleeps on
an iWARP event that needs the same mutex.
Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/target/rdma.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 53214a092c62f..d99d76a327559 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1742,17 +1742,17 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
static void nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
{
- bool disconnect = false;
-
+ /*
+ * Queue the release work with &nvmet_rdma_queue_mutex held, so that
+ * nvmet_rdma_remove_one() either finds the queue on the list or the
+ * work has already been queued.
+ */
mutex_lock(&nvmet_rdma_queue_mutex);
if (!list_empty(&queue->queue_list)) {
list_del_init(&queue->queue_list);
- disconnect = true;
+ __nvmet_rdma_queue_disconnect(queue);
}
mutex_unlock(&nvmet_rdma_queue_mutex);
-
- if (disconnect)
- __nvmet_rdma_queue_disconnect(queue);
}
static void nvmet_rdma_queue_connect_fail(struct rdma_cm_id *cm_id,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0148/1167] nvme: fix various comment typos
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (146 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0147/1167] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0149/1167] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
` (509 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bjorn Helgaas, Chaitanya Kulkarni,
Christoph Hellwig, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Helgaas <bhelgaas@google.com>
[ Upstream commit 367c240b0a99c7ada700a44345dd3144a02b6164 ]
Fix typos in comments.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stable-dep-of: a4387799d422 ("nvmet-rdma: disconnect a queue on device removal")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/fc.c | 4 ++--
drivers/nvme/host/tcp.c | 2 +-
drivers/nvme/target/fc.c | 6 +++---
drivers/nvme/target/rdma.c | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 506802d39a245..ec3c12f2e52ea 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -1364,7 +1364,7 @@ nvme_fc_disconnect_assoc_done(struct nvmefc_ls_req *lsreq, int status)
* down, and the related FC-NVME Association ID and Connection IDs
* become invalid.
*
- * The behavior of the fc-nvme initiator is such that it's
+ * The behavior of the fc-nvme initiator is such that its
* understanding of the association and connections will implicitly
* be torn down. The action is implicit as it may be due to a loss of
* connectivity with the fc-nvme target, so you may never get a
@@ -2771,7 +2771,7 @@ nvme_fc_queue_rq(struct blk_mq_hw_ctx *hctx,
* as WRITE ZEROES will return a non-zero rq payload_bytes yet
* there is no actual payload to be transferred.
* To get it right, key data transmission on there being 1 or
- * more physical segments in the sg list. If there is no
+ * more physical segments in the sg list. If there are no
* physical segments, there is no payload.
*/
if (blk_rq_nr_phys_segments(rq)) {
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 83347e01929ff..9ccf33dc45a38 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2012,7 +2012,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)
/*
* Only start IO queues for which we have allocated the tagset
- * and limitted it to the available queues. On reconnects, the
+ * and limited it to the available queues. On reconnects, the
* queue number might have changed.
*/
nr_queues = min(ctrl->tagset->nr_hw_queues + 1, ctrl->queue_count);
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 4539e25963afc..cdc1a8b7897ab 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -460,7 +460,7 @@ nvmet_fc_disconnect_assoc_done(struct nvmefc_ls_req *lsreq, int status)
* down, and the related FC-NVME Association ID and Connection IDs
* become invalid.
*
- * The behavior of the fc-nvme target is such that it's
+ * The behavior of the fc-nvme target is such that its
* understanding of the association and connections will implicitly
* be torn down. The action is implicit as it may be due to a loss of
* connectivity with the fc-nvme host, so the target may never get a
@@ -2290,7 +2290,7 @@ nvmet_fc_transfer_fcp_data(struct nvmet_fc_tgtport *tgtport,
ret = tgtport->ops->fcp_op(&tgtport->fc_target_port, fod->fcpreq);
if (ret) {
/*
- * should be ok to set w/o lock as its in the thread of
+ * should be ok to set w/o lock as it's in the thread of
* execution (not an async timer routine) and doesn't
* contend with any clearing action
*/
@@ -2608,7 +2608,7 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
* and the api of the FC LLDD which may issue a hw command to send the
* response, but the LLDD may not get the hw completion for that command
* and upcall the nvmet_fc layer before a new command may be
- * asynchronously received - its possible for a command to be received
+ * asynchronously received - it's possible for a command to be received
* before the LLDD and nvmet_fc have recycled the job structure. It gives
* the appearance of more commands received than fits in the sq.
* To alleviate this scenario, a temporary queue is maintained in the
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index d99d76a327559..9bf61e7448e41 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1782,7 +1782,7 @@ static void nvmet_rdma_queue_connect_fail(struct rdma_cm_id *cm_id,
* We registered an ib_client to handle device removal for queues,
* so we only need to handle the listening port cm_ids. In this case
* we nullify the priv to prevent double cm_id destruction and destroying
- * the cm_id implicitely by returning a non-zero rc to the callout.
+ * the cm_id implicitly by returning a non-zero rc to the callout.
*/
static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
struct nvmet_rdma_queue *queue)
@@ -1793,7 +1793,7 @@ static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
/*
* This is a queue cm_id. we have registered
* an ib_client to handle queues removal
- * so don't interfear and just return.
+ * so don't interfere and just return.
*/
return 0;
}
@@ -1811,7 +1811,7 @@ static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
/*
* We need to return 1 so that the core will destroy
- * it's own ID. What a great API design..
+ * its own ID. What a great API design..
*/
return 1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0149/1167] nvmet-rdma: disconnect a queue on device removal
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (147 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0148/1167] nvme: fix various comment typos Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0150/1167] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
` (508 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit a4387799d4228866dc1746b466cd17e1c638d050 ]
cma_remove_one() sends DEVICE_REMOVAL to the owner of every cm_id on
the device and then waits, without timeout, until they're all
destroyed. nvmet_rdma_device_removal() does nothing for a queue cm_id
and leaves the queues to nvmet_rdma_remove_one(), which only works if
that runs first. As a module it does, nvmet-rdma registers after
rdma_cm. Built in, both register at the same initcall level and
drivers/Makefile lists nvme/ ahead of infiniband/, so cma_remove_one()
runs first and waits for cm_ids that only the later callback would
destroy. Since the RDMA CM drops all later events for a cm_id once it
has sent DEVICE_REMOVAL, a peer closing its connection doesn't help
either. One connection from anyone who can reach the port hangs "rdma
link delete" until something else ends the queue.
Call nvmet_rdma_queue_disconnect() for the queue. It unlists the queue
and queues the release work, which destroys the cm_id. Don't wait for
it, rdma_destroy_id() waits for the handler to return, which was the
deadlock before commit f1d4ef7d8883.
Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/target/rdma.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 9bf61e7448e41..f3a4123b1d69b 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1779,10 +1779,13 @@ static void nvmet_rdma_queue_connect_fail(struct rdma_cm_id *cm_id,
* queue cm_id and/or a device bound listener cm_id (where in this
* case queue will be null).
*
- * We registered an ib_client to handle device removal for queues,
- * so we only need to handle the listening port cm_ids. In this case
- * we nullify the priv to prevent double cm_id destruction and destroying
- * the cm_id implicitly by returning a non-zero rc to the callout.
+ * The RDMA CM waits until each cm_id of the device is destroyed, so a queue
+ * has to go now. Our ib_client also removes the queues, but it cannot be
+ * relied on here: built in, it is called after the RDMA CM's client.
+ *
+ * For a listening port cm_id we nullify the priv to prevent double cm_id
+ * destruction and destroying the cm_id implicitly by returning a non-zero
+ * rc to the callout.
*/
static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
struct nvmet_rdma_queue *queue)
@@ -1790,11 +1793,7 @@ static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
struct nvmet_rdma_port *port;
if (queue) {
- /*
- * This is a queue cm_id. we have registered
- * an ib_client to handle queues removal
- * so don't interfere and just return.
- */
+ nvmet_rdma_queue_disconnect(queue);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0150/1167] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (148 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0149/1167] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0151/1167] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
` (507 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Clark, Jacob Keller,
Dave Miller, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Clark <jjc@jclark.com>
[ Upstream commit 3f1054a0cb09552dd54db024694f74747f9f1d49 ]
A periodic output requested by PTP_PEROUT_REQUEST2 drifts away from
the PHC as soon as the PHC frequency is adjusted, for example by ptp4l
or ts2phc: at +10 ppm each edge is 10 us later than the one before.
The GenF that generates the output counts its period in ref_clk
cycles, which the PPM correction of the CPTS clock does not reach;
each GenF has its own PPM registers. am65_cpts_ptp_adjfine() programs
them only for the GenF used for PPS, and am65_cpts_perout_enable_hw()
starts every GenF with them cleared, so a GenF used for a periodic
output is never corrected.
Commit eb9233ce6751 ("net: ethernet: ti: am65-cpts: adjust pps following
ptp changes") added the correction for the PPS GenF, and
commit 7849c42da2ca ("net: ethernet: ti: am65-cpts: adjust estf following
ptp changes") passed the same values to the ESTFs.
In am65_cpts_ptp_adjfine(), update every enabled GenF the way the PPS
GenF was updated: read its control register, set or clear the PPM
direction bit and write it back with the PPM value. The PPS GenF and the
ESTFs get exactly the values they got before. In
am65_cpts_perout_enable_hw(), start a GenF with the current correction
instead of none; this applies to the PPS GenF too.
Tested on a BeagleY-AI (J722S) with the GENF0 output looped back to
the HW1_TS_PUSH input (EXTTS 0). With the PHC frequency adjusted by
+10 ppm before the periodic output is started, the edges drift 10 us
per second against the PHC without this patch (290 us after 29 s);
with it, they stay 20 to 23 ns after the PHC second. This also works
if the frequency is adjusted after the periodic output has started.
Fixes: f6bd59526ca5 ("net: ethernet: ti: introduce am654 common platform time sync driver")
Signed-off-by: James Clark <jjc@jclark.com>
Reviewed-by: Jacob Keller <Jacob.e.keller@intel.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ti/am65-cpts.c | 67 +++++++++++++++++++----------
1 file changed, 45 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c
index f89716b1cfb64..852521a696ebd 100644
--- a/drivers/net/ethernet/ti/am65-cpts.c
+++ b/drivers/net/ethernet/ti/am65-cpts.c
@@ -174,6 +174,9 @@ struct am65_cpts {
struct mutex ptp_clk_lock; /* PHC access sync */
u64 timestamp;
u32 genf_enable;
+ bool genf_neg_adj;
+ u32 genf_ppm_hi;
+ u32 genf_ppm_low;
u32 hw_ts_enable;
u32 estf_enable;
struct sk_buff_head txq;
@@ -407,9 +410,11 @@ static int am65_cpts_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{
struct am65_cpts *cpts = container_of(ptp, struct am65_cpts, ptp_info);
u32 estf_ctrl_val = 0, estf_ppm_hi = 0, estf_ppm_low = 0;
+ u32 genf_ctrl_val[AM65_CPTS_GENF_MAX_NUM];
+ u32 genf_ppm_hi, genf_ppm_low;
s32 ppb = scaled_ppm_to_ppb(scaled_ppm);
int pps_index = cpts->pps_genf_idx;
- u64 adj_period, pps_adj_period;
+ u64 adj_period, genf_adj_period;
u32 ctrl_val, ppm_hi, ppm_low;
unsigned long flags;
int neg_adj = 0, i;
@@ -441,20 +446,33 @@ static int am65_cpts_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
ppm_hi = upper_32_bits(adj_period) & 0x3FF;
ppm_low = lower_32_bits(adj_period);
+ /* GenF PPM will do correction using cpts refclk tick which is
+ * (cpts->ts_add_val + 1) ns, so GenF length PPM adj period
+ * need to be corrected.
+ */
+ genf_adj_period = adj_period * (cpts->ts_add_val + 1);
+ genf_ppm_hi = upper_32_bits(genf_adj_period) & 0x3FF;
+ genf_ppm_low = lower_32_bits(genf_adj_period);
+ cpts->genf_neg_adj = neg_adj;
+ cpts->genf_ppm_hi = genf_ppm_hi;
+ cpts->genf_ppm_low = genf_ppm_low;
+
+ for (i = 0; i < AM65_CPTS_GENF_MAX_NUM; i++) {
+ if (cpts->genf_enable & BIT(i)) {
+ genf_ctrl_val[i] = am65_cpts_read32(cpts,
+ genf[i].control);
+ if (neg_adj)
+ genf_ctrl_val[i] &= ~BIT(1);
+ else
+ genf_ctrl_val[i] |= BIT(1);
+ }
+ }
+
if (cpts->pps_enabled) {
- estf_ctrl_val = am65_cpts_read32(cpts, genf[pps_index].control);
- if (neg_adj)
- estf_ctrl_val &= ~BIT(1);
- else
- estf_ctrl_val |= BIT(1);
-
- /* GenF PPM will do correction using cpts refclk tick which is
- * (cpts->ts_add_val + 1) ns, so GenF length PPM adj period
- * need to be corrected.
- */
- pps_adj_period = adj_period * (cpts->ts_add_val + 1);
- estf_ppm_hi = upper_32_bits(pps_adj_period) & 0x3FF;
- estf_ppm_low = lower_32_bits(pps_adj_period);
+ /* am65_cpts_perout_enable_hw() sets pps_index in genf_enable */
+ estf_ctrl_val = genf_ctrl_val[pps_index];
+ estf_ppm_hi = genf_ppm_hi;
+ estf_ppm_low = genf_ppm_low;
}
spin_lock_irqsave(&cpts->lock, flags);
@@ -471,10 +489,13 @@ static int am65_cpts_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
am65_cpts_write32(cpts, ppm_hi, ts_ppm_hi);
am65_cpts_write32(cpts, ppm_low, ts_ppm_low);
- if (cpts->pps_enabled) {
- am65_cpts_write32(cpts, estf_ctrl_val, genf[pps_index].control);
- am65_cpts_write32(cpts, estf_ppm_hi, genf[pps_index].ppm_hi);
- am65_cpts_write32(cpts, estf_ppm_low, genf[pps_index].ppm_low);
+ for (i = 0; i < AM65_CPTS_GENF_MAX_NUM; i++) {
+ if (cpts->genf_enable & BIT(i)) {
+ am65_cpts_write32(cpts, genf_ctrl_val[i],
+ genf[i].control);
+ am65_cpts_write32(cpts, genf_ppm_hi, genf[i].ppm_hi);
+ am65_cpts_write32(cpts, genf_ppm_low, genf[i].ppm_low);
+ }
}
for (i = 0; i < AM65_CPTS_ESTF_MAX_NUM; i++) {
@@ -484,7 +505,6 @@ static int am65_cpts_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
am65_cpts_write32(cpts, estf_ppm_low, estf[i].ppm_low);
}
}
- /* All GenF/EstF can be updated here the same way */
spin_unlock_irqrestore(&cpts->lock, flags);
mutex_unlock(&cpts->ptp_clk_lock);
@@ -650,9 +670,12 @@ static void am65_cpts_perout_enable_hw(struct am65_cpts *cpts,
val = lower_32_bits(cycles);
am65_cpts_write32(cpts, val, genf[req->index].length);
- am65_cpts_write32(cpts, 0, genf[req->index].control);
- am65_cpts_write32(cpts, 0, genf[req->index].ppm_hi);
- am65_cpts_write32(cpts, 0, genf[req->index].ppm_low);
+ am65_cpts_write32(cpts, cpts->genf_neg_adj ? 0 : BIT(1),
+ genf[req->index].control);
+ am65_cpts_write32(cpts, cpts->genf_ppm_hi,
+ genf[req->index].ppm_hi);
+ am65_cpts_write32(cpts, cpts->genf_ppm_low,
+ genf[req->index].ppm_low);
cpts->genf_enable |= BIT(req->index);
} else {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0151/1167] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer.
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (149 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0150/1167] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0152/1167] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
` (506 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tom Williams, Guillaume Nault,
Kuniyuki Iwashima, Neal Cardwell, Eric Dumazet, Paolo Abeni,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <gnault@redhat.com>
[ Upstream commit 11140c51df12e594d6bf2c8d2af5dec63b0219ac ]
When receiving a pure ack from a peer that also sends data, we can
have SEG.SEQ > SND.WL1, even though the segment contains no data. This
makes tcp_may_update_window() return true (because of the
"after(ack_seq, tp->snd_wl1)" condition), and tcp_ack_update_window()
then adds FLAG_WIN_UPDATE to the segment set of flags, even when
there's no window update.
Since FLAG_WIN_UPDATE prevents the segment from being considered as
dup-ack (as it's part of FLAG_NOT_DUP), this can inhibit fast
retransmit on non-SACK connections, making recovery very slow as it
now entirely relies on RTO.
The "DUPLICATE ACKNOWLEDGMENT" definition of RFC 5681, section 2,
says that lack of window update is a necessary condition for a dup ack:
"(e) the advertised window in the incoming acknowledgment equals the
advertised window in the last incoming acknowledgment.". Spurious
window updates can thus prevent dup ack detection and, in the end, fast
retransmit.
Avoid this scenario by setting FLAG_WIN_UPDATE only when a window
update actually occurs. Pure acks with SEG.SEQ > SND.WL1 can now
be detected as dup-ack and trigger fast retransmission.
Also, stop setting FLAG_WIN_UPDATE in tcp_ack()'s header prediction
path. One of the conditions for header prediction to happen is that
received segments don't trigger a window update. This flag update was
thus wrong to begin with. Now that tcp_ack_update_window() sets
FLAG_WIN_UPDATE only if a window update actually occurred, we need the
header prediction path to stop reporting spurious window updates too.
Otherwise BPF programs would get inconsistent window update information
(CA_ACK_WIN_UPDATE) between fast an slow paths.
Finally, add FLAG_SND_UNA_ADVANCED to the definition of FLAG_NOT_DUP.
This is necessary for the case where an incoming segment acknowledges
less than a full segment of the retransmit queue. Such segments were
not considered dubious by tcp_ack_is_dubious() because of the spurious
FLAG_WIN_UPDATE flag, which prevented the segment from being seen as a
duplicate ack. Now that FLAG_WIN_UPDATE doesn't cover this scenario
anymore, we need another way to mark these acks as non-duplicate.
Adding FLAG_SND_UNA_ADVANCED to FLAG_NOT_DUP is the natural way of
doing this, since, by definition, a segment advancing SND.UNA, even by
a small amount, cannot be a duplicate ack.
A side effect of this patch is that repeated zero window acks received
from peer can now be considered duplicate acks (because of the the
"|| !win" condition in tcp_may_update_window()). Therefore, they can
now trigger fast retransmission and fast recovery, including congestion
window reduction, when the peer is stalled. This is RFC compliant and
shouldn't have any negative effect.
Add packetdrill selftest. Before this patch, the 1001:2001 segment was
retransmitted upon RTO, now it's sent right after reception of the
third duplicate ack.
Thanks to Tom Williams for the investigation help and initial
reproducer.
Reported-by: Tom Williams <Tom.D.Williams@MorganStanley.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/6426d558e45fc6ab724c40af62e4a8793215dd8a.1793219189.git.gnault@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_input.c | 6 +--
.../tcp_bidir_fast_retransmit_nosack.pkt | 42 +++++++++++++++++++
2 files changed, 45 insertions(+), 3 deletions(-)
create mode 100644 tools/testing/selftests/net/packetdrill/tcp_bidir_fast_retransmit_nosack.pkt
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 87a721a5b70d4..4c4fd70f5e742 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -103,7 +103,8 @@ int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
#define FLAG_DSACK_TLP 0x20000 /* DSACK for tail loss probe */
#define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED)
-#define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
+#define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED| \
+ FLAG_SND_UNA_ADVANCED)
#define FLAG_CA_ALERT (FLAG_DATA_SACKED|FLAG_ECE|FLAG_DSACKING_ACK)
#define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED)
@@ -3670,11 +3671,11 @@ static int tcp_ack_update_window(struct sock *sk, const struct sk_buff *skb, u32
nwin <<= tp->rx_opt.snd_wscale;
if (tcp_may_update_window(tp, ack, ack_seq, nwin)) {
- flag |= FLAG_WIN_UPDATE;
tcp_update_wl(tp, ack_seq);
if (tp->snd_wnd != nwin) {
tp->snd_wnd = nwin;
+ flag |= FLAG_WIN_UPDATE;
/* Note, it is the only place, where
* fast path is recovered for sending TCP.
@@ -3989,7 +3990,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
*/
tcp_update_wl(tp, ack_seq);
tcp_snd_una_update(tp, ack);
- flag |= FLAG_WIN_UPDATE;
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPHPACKS);
} else {
diff --git a/tools/testing/selftests/net/packetdrill/tcp_bidir_fast_retransmit_nosack.pkt b/tools/testing/selftests/net/packetdrill/tcp_bidir_fast_retransmit_nosack.pkt
new file mode 100644
index 0000000000000..5c66b7171d229
--- /dev/null
+++ b/tools/testing/selftests/net/packetdrill/tcp_bidir_fast_retransmit_nosack.pkt
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Verify that non-SACK connections properly detect duplicate acks when mixed
+// with other data segments from peer.
+
+`./defaults.sh`
+
+ 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4
+ +0...0 connect(4, ..., ...) = 0
+
+ // Three-way handshake, SACK not supported by peer
+ +0 > S 0:0(0) <mss 1460,sackOK,TS val 0 ecr 0,nop,wscale 8>
+ +0 < S. 0:0(0) ack 1 win 65535 <mss 1000>
+ +0 > . 1:1(0) ack 1
+
+ // Send 1000 bytes, peer acks everything
+ +0 send(4, ..., 1000, 0) = 1000
+ +0 > P. 1:1001(1000) ack 1
+ +0 < . 1:1(0) ack 1001 win 65535
+
+ // Send 4000 more bytes
+ +0 send(4, ..., 4000, 0) = 4000
+ +0 > P. 1001:5001(4000) ack 1
+
+ // Receive first dup-ack (considering segment 1001-2001 was lost)
+ +0 < . 1:1(0) ack 1001 win 65535
+
+ // Receive unrelated data segment from peer and ack it
+ +0 < P. 1:11(10) ack 1001 win 65535
+ +0 > . 5001:5001(0) ack 11
+
+ // Receive second dup-ack
+ +0 < . 11:11(0) ack 1001 win 65535
+
+ // Receive another data segment from peer and ack it
+ +0 < P. 11:21(10) ack 1001 win 65535
+ +0 > . 5001:5001(0) ack 21
+
+ // Receive third dup-ack, which should trigger fast retransmit (without
+ // waiting for RTO)
+ +0 < . 21:21(0) ack 1001 win 65535
+ +0 > . 1001:2001(1000) ack 21
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0152/1167] net: skbuff: reject zero MPLS TTL before decrementing
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (150 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0151/1167] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
@ 2026-12-04 9:52 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0153/1167] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
` (505 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:52 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Xia Yan, Simon Horman,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 24614e72df484ad50ecba98aaa88c7df2448c122 ]
skb_mpls_dec_ttl() decrements the u8 TTL before checking whether it
expired. An incoming TTL of zero wraps to 255, causing the TC MPLS
dec_ttl action to pass an expired packet instead of dropping it.
Reject a zero TTL before the decrement while preserving the existing
behavior for TTL one and valid TTL values.
Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Xia Yan <yanxia@cmss.chinamobile.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261031114135.3784868-2-thnkslprpt@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/skbuff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 74d24551fd8d0..ba3ed28fea478 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6341,7 +6341,7 @@ int skb_mpls_dec_ttl(struct sk_buff *skb)
lse = be32_to_cpu(mpls_hdr(skb)->label_stack_entry);
ttl = (lse & MPLS_LS_TTL_MASK) >> MPLS_LS_TTL_SHIFT;
- if (!--ttl)
+ if (!ttl || !--ttl)
return -EINVAL;
lse &= ~MPLS_LS_TTL_MASK;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0153/1167] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (151 preceding siblings ...)
2026-12-04 9:52 ` [PATCH 6.6 0152/1167] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0154/1167] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
` (504 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhou Minqiang, Rafael J. Wysocki,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhou Minqiang <zhouminqiang2@huawei.com>
[ Upstream commit 1f65b45f0f16e1c80a68a5757c9556f78bb39f19 ]
When a WQ_MEM_RECLAIM workqueue (e.g. iscsi_ctrl) triggers device removal
via device_del -> pm_runtime_remove, the unconditional flush_work inside
pm_runtime_remove can trigger a check_flush_dependency warning:
CPU1: pm_wq worker CPU2: iscsi_ctrl wq
-------- --------
pm_runtime_work(starget) pm_runtime_remove(starget)
spin_lock_irq(&starget->lock) __pm_runtime_disable(starget, false)
request_pending = false spin_lock_irq(&starget->lock)
(blocked, CPU1 holds the lock)
rpm_suspend(starget, RPM_NOWAIT)
status = RPM_SUSPENDING
rpm_callback(cb, starget)
spin_unlock_irq(&starget->lock)
(acquires lock)
disable_depth 0→1
__pm_runtime_barrier():
request_pending == false
→ skip cancel_work_sync
status == RPM_SUSPENDING
→ enter wait_queue, sleep
spin_unlock_irq(&starget->lock)
cb(starget) → 0
spin_lock_irq(&starget->lock)
status = RPM_SUSPENDED
wake_up_all(&wait_queue)
(woken up, waiting for lock)
spin_unlock(&starget->lock) spin_lock_irq(&starget->lock)
status == RPM_SUSPENDED
spin_lock(&parent->lock) → exit wait_queue
rpm_idle(parent, RPM_ASYNC) barrier returns
spin_unlock(&parent->lock) flush_work(&starget->work)
spin_lock(&starget->lock) __flush_work(from_cancel=false)
spin_unlock_irq(&starget->lock) check_flush_dependency()
← WARNING!
Replace flush_work with cancel_work_sync in pm_runtime_remove.
cancel_work_sync internally calls __flush_work with from_cancel=true,
which causes check_flush_dependency to return early before the warning.
This preserves the use-after-free fix from commit 29ab76827761
("PM: runtime: Fix a race condition related to device removal")
without the warning.
Fixes: 29ab76827761 ("PM: runtime: Fix a race condition related to device removal")
Signed-off-by: Zhou Minqiang <zhouminqiang2@huawei.com>
Link: https://patch.msgid.link/20261104115641.2682786-1-zhouminqiang2@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/power/runtime.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 2766bdc9158ab..6e03928ccf03a 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1854,7 +1854,7 @@ void pm_runtime_reinit(struct device *dev)
void pm_runtime_remove(struct device *dev)
{
__pm_runtime_disable(dev, false);
- flush_work(&dev->power.work);
+ cancel_work_sync(&dev->power.work);
pm_runtime_reinit(dev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0154/1167] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow().
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (152 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0153/1167] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0155/1167] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
` (503 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jason Zhang, Kuniyuki Iwashima,
Ido Schimmel, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <kuniyu@google.com>
[ Upstream commit 4019af3afd72864ec6abbfde2d76e416a64456c2 ]
Since the cited commit, ip_route_input_slow() could call
rt_dst_alloc() with vrf in the local_input: path.
If res->fi != NULL and one of the following is true,
- a non-zero itag from fib_validate_source_reason()
(realms/classid)
- RTN_BROADCAST with BC_FORWARDING enabled
do_cache is set to false.
Then, the route is not added to rt_uncached_list, so the
route cannot be removed from rt_flush_dev().
If the route is cached in sk->sk_rx_dst, removing the
vrf device gets stuck. [0]
Let's call rt_add_uncached_list() if !do_cache in
ip_route_input_slow().
[0]:
unregister_netdevice: waiting for vrf0 to become free. Usage count = 2
ref_tracker: netdev@000000008b304ac4 has 1/1 users at
dst_alloc+0x14b/0x490
ip_route_input_rcu+0x1540/0x2530
ip_route_input_noref+0x5a/0x90
ip_rcv_finish_core+0x4b0/0x1140
ip_rcv_finish+0xe6/0x190
ip_rcv+0x6c/0x130
__netif_receive_skb+0x121/0x300
process_backlog+0x2df/0x5e0
__napi_poll+0x8c/0x380
net_rx_action+0x43c/0xab0
handle_softirqs+0x19f/0x520
do_softirq+0x46/0x60
__local_bh_enable_ip+0x79/0x80
__dev_queue_xmit+0x1b0e/0x24c0
ip_finish_output2+0x8b2/0xcd0
ip_output+0xf2/0x1e0
Fixes: f5a0aab84b74 ("net: ipv4: dst for local input routes should use l3mdev if relevant")
Reported-by: Jason Zhang <jdz@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261101064418.2055158-4-kuniyu@google.com
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/route.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index dc141635d4e0a..d9a44430df72d 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2456,6 +2456,8 @@ out: return err;
if (unlikely(!rt_cache_route(nhc, rth)))
rt_add_uncached_list(rth);
+ } else {
+ rt_add_uncached_list(rth);
}
skb_dst_set(skb, &rth->dst);
err = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0155/1167] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (153 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0154/1167] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0156/1167] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
` (502 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nathan Blomquist, Alex Deucher,
Mario Limonciello, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <mario.limonciello@amd.com>
[ Upstream commit a26ec190925733dd205507493e936e59dbcd2b19 ]
On Navi1x/Sienna Cichlid with runtime PM, when the audio function is
enabled, BACO entry and exit are delegated to PMFW by sending
SMU_MSG_ArmD3 instead of going through smu_v11_0_baco_set_state().
Unlike the v13/v14/v15 helpers, smu_v11_0_baco_set_armd3_sequence()
does not update smu_baco->state, so the driver keeps reporting
SMU_BACO_STATE_EXIT while the ASIC is armed for / sitting in BACO.
At runtime resume amdgpu_device_baco_exit() checks
amdgpu_device_supports_baco(), which ends up in
smu_v11_0_get_bamaco_support(). Since the state never reads ENTER, the
"already in BACO" shortcut is skipped and the live BACO feature bit is
consulted instead. PMFW clears that bit once ArmD3(BACO) is armed, so
the check reports "supported but not enabled", the exit fails with
-ENOTSUPP and the ULPS ArmD3 message is never sent. The runtime resume
caller ignores the error, and a later secondary bus reset leaves the
device unreachable. This shows up on a Navi 23 being handed from amdgpu
to vfio-pci:
baco_enter: in_runpm=1 audio_enabled=1 armd3=1 baco_state=1 ret=0
bamaco: state=1 ... feat supported=1 enabled=0 in_runpm=1
baco_exit: supports=0 ...
runtime resume: baco_exit ret=-524
Update smu_baco->state in the helper, mirroring the v13 implementation,
so the capability check short-circuits while in BACO.
Reported-by: Nathan Blomquist <nblomquist@gmail.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/6076
Tested-by: Nathan Blomquist <nblomquist@gmail.com>
Fixes: 13d75eadfa1a ("drm/amd/pm: correct the runpm handling for BACO supported ASIC")
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20261103141457.2558235-1-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d515b2694eab5b35533c7fb7af5bddff53ff60d3)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 20 ++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
index 1b726489d86a0..827bf487b9539 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
@@ -1549,7 +1549,25 @@ int smu_v11_0_set_azalia_d3_pme(struct smu_context *smu)
int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu,
enum smu_baco_seq baco_seq)
{
- return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL);
+ struct smu_baco_context *smu_baco = &smu->smu_baco;
+ int ret;
+
+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL);
+ if (ret)
+ return ret;
+
+ /*
+ * PMFW owns the BACO transition once armed, so keep the driver's view
+ * in sync. Otherwise smu_v11_0_get_bamaco_support() falls back to the
+ * live BACO feature bit, which PMFW clears when armed, and the runtime
+ * resume wrongly concludes BACO is unsupported and skips the exit.
+ */
+ if (baco_seq == BACO_SEQ_BAMACO || baco_seq == BACO_SEQ_BACO)
+ smu_baco->state = SMU_BACO_STATE_ENTER;
+ else
+ smu_baco->state = SMU_BACO_STATE_EXIT;
+
+ return 0;
}
bool smu_v11_0_baco_is_support(struct smu_context *smu)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0156/1167] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (154 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0155/1167] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0157/1167] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
` (501 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Fitzgerald <rf@opensource.cirrus.com>
[ Upstream commit 39d31f76ad1b12f1b5e6ef4c15f89e6b3c3f603a ]
If cs_dsp_power_up() fails on or after cs_dsp_load() mark the controls
disabled and free the alg regions.
Fixes: f6bc909e7673c ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20261104152402.1153795-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/cirrus/cs_dsp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 575b2f509f726..76bd39949a2d6 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -2668,6 +2668,7 @@ int cs_dsp_power_up(struct cs_dsp *dsp,
const struct firmware *coeff_firmware, char *coeff_filename,
const char *fw_name)
{
+ struct cs_dsp_coeff_ctl *ctl;
int ret;
mutex_lock(&dsp->pwr_lock);
@@ -2712,6 +2713,11 @@ int cs_dsp_power_up(struct cs_dsp *dsp,
return 0;
err_ena:
+ list_for_each_entry(ctl, &dsp->ctl_list, list)
+ ctl->enabled = 0;
+
+ cs_dsp_free_alg_regions(dsp);
+
if (dsp->ops->disable_core)
dsp->ops->disable_core(dsp);
err_mem:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0157/1167] ACPI: scan: Print the offline failure message in acpi_bus_offline()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (155 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0156/1167] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0158/1167] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
` (500 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Sasha Levin,
Rafael J. Wysocki
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit b9ea1e921c2721546f53270cffdc6866e20576dd ]
When a physical node of an ACPI device being hot-removed cannot be
offlined, acpi_bus_offline() passes the physical device back to
acpi_scan_try_to_offline() through ret_p and the latter prints
"Offline failed." for it after the namespace walk. By then
physical_node_lock is not held anymore, so the device may have been
unbound from its ACPI companion and freed in the meantime.
Print the message in acpi_bus_offline() when device_offline() fails in
the second pass, while physical_node_lock keeps the device bound to its
ACPI companion and so the reference taken by acpi_bind_one() is still
held. acpi_scan_try_to_offline() only needs to know that something
could not be offlined, so pass the ACPI device back through ret_p
instead, like in the "Offline disabled." case.
Fixes: 303bfdb1a14d ("ACPI / scan: Add second pass of companion offlining to hot-remove code")
Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261029034507.2721580-2-sashal@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/scan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 73f2fc472b596..b6f8aed3706e7 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -164,8 +164,9 @@ static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
if (ret >= 0) {
pn->put_online = !ret;
} else {
- *ret_p = pn->dev;
+ *ret_p = &device->dev;
if (second_pass) {
+ dev_warn(pn->dev, "Offline failed.\n");
status = AE_ERROR;
break;
}
@@ -234,7 +235,6 @@ static int acpi_scan_try_to_offline(struct acpi_device *device)
(void **)&errdev);
if (errdev) {
- dev_warn(errdev, "Offline failed.\n");
acpi_bus_online(handle, 0, NULL, NULL);
acpi_walk_namespace(ACPI_TYPE_ANY, handle,
ACPI_UINT32_MAX, acpi_bus_online,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0158/1167] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (156 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0157/1167] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0159/1167] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
` (499 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+cea7285bc17b76ffe39f,
syzbot+a265816368571f78ab88, Sasha Levin, Rafael J. Wysocki
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 17654aa629cba9a70e31cc1b7226a4fc1a1c801a ]
acpi_bus_offline() and acpi_bus_online() hold the physical_node_lock of
the ACPI device being hot-removed while they call device_offline() and
device_online() for its physical nodes. Offlining a CPU this way takes
cpu_add_remove_lock and the CPU hotplug lock under physical_node_lock,
and lockdep connects that to the uevent attribute of platform devices,
whose store method takes physical_node_lock in
acpi_primary_dev_companion():
physical_node_lock (acpi_bus_offline())
-> cpu_add_remove_lock -> cpu_hotplug_lock
-> cpuhp_state-down (mce_cpu_pre_down() unregistering a device)
-> device_links_lock (device_links_purge())
-> kn->active of a uevent attribute (device link unregistration)
-> physical_node_lock (uevent_store() -> acpi_companion_match())
syzbot has reported this cycle twice. The uevent attribute waited for in
the link unregistration is the device link's, not a platform device's,
and the physical_node_lock taken at the end is that of the platform
device's ACPI companion, not of the processor being ejected, so lockdep
only connects them because they share lock classes and this is unlikely
to deadlock. However, lockdep turns itself off after reporting it.
It can be reproduced in a QEMU guest by writing to the uevent attribute
of an ACPI-enumerated platform device, reading the uevent attribute of a
device link while the link is removed, offlining a CPU and ejecting one
through sysfs.
physical_node_lock protects the list of physical nodes. Since
acpi_unbind_one() blocks on it, holding it also keeps device_offline()
and device_online() from running in parallel with whatever happens to a
device after it has been unbound from its ACPI companion, but that is not
necessary: a reference to each device is held while the lock is dropped,
and the removal of the devices that can actually be taken offline here
(CPUs, memory blocks and containers) is serialized by the device hotplug
lock or acpi_scan_lock, both of which acpi_device_hotplug() holds
throughout.
So drop physical_node_lock around device_offline() and device_online().
Mark the nodes to offline with a new offline_pending flag, hold a
reference to each device while the lock is dropped, and look its node up
again afterwards to record whether it needs to be put back online,
because it may have been unbound in the meantime. Physical nodes added
while the lock is not held are not offlined by the current pass, which is
no different from adding them right after it.
Since acpi_container_offline() no longer runs under the container's
physical_node_lock, the nesting annotation added to
acpi_scan_is_offline() by commit 4c533c801d1c ("ACPI / scan: Annotate
physical_node_lock in acpi_scan_is_offline()") is not needed anymore, so
drop it.
Fixes: 683058e315f0 ("ACPI / hotplug: Use device offline/online for graceful hot-removal")
Reported-by: syzbot+cea7285bc17b76ffe39f@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/6ae18ed0.6200f071.51519.0f60.GAE@google.com
Reported-by: syzbot+a265816368571f78ab88@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/6adf293a.67317f00.38c4bc.00af.GAE@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261029034507.2721580-3-sashal@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/scan.c | 106 +++++++++++++++++++++++++++++++++-------
include/acpi/acpi_bus.h | 1 +
2 files changed, 88 insertions(+), 19 deletions(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index b6f8aed3706e7..dabc4f985211c 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -113,11 +113,7 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
bool offline = true;
char *envp[] = { "EVENT=offline", NULL };
- /*
- * acpi_container_offline() calls this for all of the container's
- * children under the container's physical_node_lock lock.
- */
- mutex_lock_nested(&adev->physical_node_lock, SINGLE_DEPTH_NESTING);
+ mutex_lock(&adev->physical_node_lock);
list_for_each_entry(pn, &adev->physical_node_list, node)
if (device_supports_offline(pn->dev) && !pn->dev->offline) {
@@ -132,6 +128,59 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
return offline;
}
+static struct acpi_device_physical_node *
+acpi_find_physical_node(struct acpi_device *adev, struct device *dev)
+{
+ struct acpi_device_physical_node *pn;
+
+ lockdep_assert_held(&adev->physical_node_lock);
+
+ list_for_each_entry(pn, &adev->physical_node_list, node)
+ if (pn->dev == dev)
+ return pn;
+
+ return NULL;
+}
+
+static struct device *acpi_next_offline_pending(struct acpi_device *adev)
+{
+ struct acpi_device_physical_node *pn;
+
+ lockdep_assert_held(&adev->physical_node_lock);
+
+ /*
+ * Find the first physical node that is still to be offlined, clear its
+ * offline_pending flag and return its device with a reference held.
+ */
+ list_for_each_entry(pn, &adev->physical_node_list, node)
+ if (pn->offline_pending) {
+ pn->offline_pending = false;
+ return get_device(pn->dev);
+ }
+
+ return NULL;
+}
+
+static struct device *acpi_next_put_online(struct acpi_device *adev)
+{
+ struct acpi_device_physical_node *pn;
+
+ lockdep_assert_held(&adev->physical_node_lock);
+
+ /*
+ * Find the first physical node that has been offlined by
+ * acpi_bus_offline(), clear its put_online flag and return its device
+ * with a reference held.
+ */
+ list_for_each_entry(pn, &adev->physical_node_list, node)
+ if (pn->put_online) {
+ pn->put_online = false;
+ return get_device(pn->dev);
+ }
+
+ return NULL;
+}
+
static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
void **ret_p)
{
@@ -139,6 +188,7 @@ static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
struct acpi_device_physical_node *pn;
bool second_pass = (bool)data;
acpi_status status = AE_OK;
+ struct device *dev;
if (!device)
return AE_OK;
@@ -151,26 +201,43 @@ static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
mutex_lock(&device->physical_node_lock);
list_for_each_entry(pn, &device->physical_node_list, node) {
- int ret;
-
if (second_pass) {
/* Skip devices offlined by the first pass. */
- if (pn->put_online)
- continue;
+ pn->offline_pending = !pn->put_online;
} else {
+ pn->offline_pending = true;
pn->put_online = false;
}
- ret = device_offline(pn->dev);
+ }
+
+ /*
+ * Drop physical_node_lock around device_offline(), because the latter
+ * acquires locks, like the CPU hotplug ones, that must not nest under
+ * it.
+ */
+ while ((dev = acpi_next_offline_pending(device))) {
+ int ret;
+
+ mutex_unlock(&device->physical_node_lock);
+ ret = device_offline(dev);
+ mutex_lock(&device->physical_node_lock);
+
if (ret >= 0) {
- pn->put_online = !ret;
+ /* The device may have been unbound in the meantime. */
+ pn = acpi_find_physical_node(device, dev);
+ if (pn)
+ pn->put_online = !ret;
} else {
*ret_p = &device->dev;
if (second_pass) {
- dev_warn(pn->dev, "Offline failed.\n");
+ dev_warn(dev, "Offline failed.\n");
status = AE_ERROR;
- break;
}
}
+
+ put_device(dev);
+ if (ACPI_FAILURE(status))
+ break;
}
mutex_unlock(&device->physical_node_lock);
@@ -182,18 +249,19 @@ static acpi_status acpi_bus_online(acpi_handle handle, u32 lvl, void *data,
void **ret_p)
{
struct acpi_device *device = acpi_fetch_acpi_dev(handle);
- struct acpi_device_physical_node *pn;
+ struct device *dev;
if (!device)
return AE_OK;
mutex_lock(&device->physical_node_lock);
- list_for_each_entry(pn, &device->physical_node_list, node)
- if (pn->put_online) {
- device_online(pn->dev);
- pn->put_online = false;
- }
+ while ((dev = acpi_next_put_online(device))) {
+ mutex_unlock(&device->physical_node_lock);
+ device_online(dev);
+ mutex_lock(&device->physical_node_lock);
+ put_device(dev);
+ }
mutex_unlock(&device->physical_node_lock);
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 6e47b6f44c4b3..dbdd105bf17ae 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -344,6 +344,7 @@ struct acpi_device_physical_node {
struct list_head node;
struct device *dev;
bool put_online:1;
+ bool offline_pending:1;
};
struct acpi_device_properties {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0159/1167] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (157 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0158/1167] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0160/1167] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
` (498 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Fitzgerald <rf@opensource.cirrus.com>
[ Upstream commit 4d07af76ca41cc1a03240cd3b5f44dc428856214 ]
Check that avail does not become < 1 in wm_adsp_control_add(). This
prevents overflows during subsequent operations.
The main aim is to trap a negative value in avail, but a zero length
would mean that the control ends up without a name, so 1 is the smallest
valid value.
Fixes: b7ede5af62ab6 ("ASoC: wm_adsp: Take prefix into account in control name length")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20261104133322.1085061-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wm_adsp.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 2da19de4800e2..7768f57c7191d 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -42,6 +42,9 @@
#define adsp_dbg(_dsp, fmt, ...) \
dev_dbg(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
+#define adsp_warn_once(_dsp, fmt, ...) \
+ dev_warn_once(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
+
#define compr_err(_obj, fmt, ...) \
adsp_err(_obj->dsp, "%s: " fmt, _obj->name ? _obj->name : "legacy", \
##__VA_ARGS__)
@@ -638,6 +641,13 @@ static int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl)
if (dsp->component->name_prefix)
avail -= strlen(dsp->component->name_prefix) + 1;
+ if (avail < 1) {
+ adsp_warn_once(dsp,
+ "%.*s: ALSA prefix too long: control not created\n",
+ cs_ctl->subname_len, cs_ctl->subname);
+ return -EINVAL;
+ }
+
/* Truncate the subname from the start if it is too long */
if (cs_ctl->subname_len > avail)
skip = cs_ctl->subname_len - avail;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0160/1167] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (158 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0159/1167] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0161/1167] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
` (497 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zijun Hu, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <zijun.hu@oss.qualcomm.com>
[ Upstream commit 3efdadae3a252b14ca1f62b16e31a9aa7c5d30cf ]
Correct (Input|Output)_Transport_Unit_Size based on Core spec v6.3,
Vol 4, Part E, 7.1.45:
"The Host shall set the Input_Transport_Unit_Size and
Output_Transport_Unit_Size to be equal. For HCI Host transport
the Host shall set them to 0."
Fixes: b2af264ad3af ("Bluetooth: Add support for HCI_Enhanced_Setup_Synchronous_Connection command")
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_conn.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 987f780a5acd8..11066b6b84bfc 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -332,8 +332,10 @@ static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data)
cp.out_pcm_sample_payload_msb_pos = 0;
cp.in_data_path = conn->codec.data_path;
cp.out_data_path = conn->codec.data_path;
- cp.in_transport_unit_size = 1;
- cp.out_transport_unit_size = 1;
+ if (conn->codec.data_path) {
+ cp.in_transport_unit_size = 1;
+ cp.out_transport_unit_size = 1;
+ }
break;
case BT_CODEC_TRANSPARENT:
@@ -358,8 +360,10 @@ static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data)
cp.out_pcm_sample_payload_msb_pos = 0;
cp.in_data_path = conn->codec.data_path;
cp.out_data_path = conn->codec.data_path;
- cp.in_transport_unit_size = 1;
- cp.out_transport_unit_size = 1;
+ if (conn->codec.data_path) {
+ cp.in_transport_unit_size = 1;
+ cp.out_transport_unit_size = 1;
+ }
break;
case BT_CODEC_CVSD:
@@ -389,8 +393,10 @@ static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data)
cp.out_pcm_sample_payload_msb_pos = 0;
cp.in_data_path = conn->codec.data_path;
cp.out_data_path = conn->codec.data_path;
- cp.in_transport_unit_size = 16;
- cp.out_transport_unit_size = 16;
+ if (conn->codec.data_path) {
+ cp.in_transport_unit_size = 16;
+ cp.out_transport_unit_size = 16;
+ }
break;
default:
goto unlock;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0161/1167] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (159 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0160/1167] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0162/1167] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
` (496 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhao Li, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
[ Upstream commit 15a80cc8263abd50132a05d1b06824de8e28abcb ]
Incoming LE and ECRED channels retain the peer's request identifier
after an immediate response. The deferred LE response also leaves the
identifier set, unlike the deferred ECRED response.
A later ECRED request can reuse that identifier and include an unrelated
channel in its shared-response handling. That walk matches on the
identifier alone, so an LE channel is selected too. If the old channel is
closing, the checks can refuse the new connection. The check at request
receipt rejects it with L2CAP_CR_LE_INVALID_PARAMS; the check before a
deferred response returns L2CAP_CR_LE_AUTHORIZATION.
Store the identifier only when deferring the response, and clear it
after sending the deferred LE response. Keep deferred ECRED identifiers
until the shared response is sent, since a partially accepted group
still needs them.
AI assistance was used.
Fixes: 27e2d4c8d28b ("Bluetooth: Add basic LE L2CAP connect request receiving support")
Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/l2cap_core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index d6dfcb197365e..3fec67f521d10 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -3867,6 +3867,7 @@ void __l2cap_le_connect_rsp_defer(struct l2cap_chan *chan)
l2cap_send_cmd(conn, chan->ident, L2CAP_LE_CONN_RSP, sizeof(rsp),
&rsp);
+ chan->ident = 0;
}
static void l2cap_ecred_list_defer(struct l2cap_chan *chan, void *data)
@@ -5090,10 +5091,10 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
__set_chan_timer(chan, chan->ops->get_sndtimeo(chan));
- chan->ident = cmd->ident;
chan->mode = L2CAP_MODE_LE_FLOWCTL;
if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) {
+ chan->ident = cmd->ident;
l2cap_state_change(chan, BT_CONNECT2);
/* The following result value is actually not defined
* for LE CoC but we use it to let the function know
@@ -5324,10 +5325,10 @@ static inline int l2cap_ecred_conn_req(struct l2cap_conn *conn,
__set_chan_timer(chan, chan->ops->get_sndtimeo(chan));
- chan->ident = cmd->ident;
chan->mode = L2CAP_MODE_EXT_FLOWCTL;
if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) {
+ chan->ident = cmd->ident;
l2cap_state_change(chan, BT_CONNECT2);
defer = true;
chan->ops->defer(chan);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0162/1167] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (160 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0161/1167] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0163/1167] net: dsa: b53: Force flow control for BCM5301X CPU port(s) Greg Kroah-Hartman
` (495 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Simon Horman,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <florian.fainelli@broadcom.com>
[ Upstream commit d4f3d2c04624854d27aa948cd7bfc9d946faaac5 ]
Northstar and Northstar Plus use a 2.5 Gbps internal link between the
AMAC and the switch. BGMAC_FEAT_FORCE_SPEED_2500 makes bgmac_miiconfig()
configure that speed, but bgmac_adjust_link() subsequently replaces it
with the synthetic fixed PHY's 1 Gbps speed.
Use the forced speed when processing link changes so the MAC remains at
2.5 Gbps. Together with configuring the switch IMP port for its 2 Gbps
mode, this eliminates the output queue discards that caused approximately
1000 TCP retransmissions per second during an iperf3 transmit test.
Restrict the platform forced-speed flag to Northstar Plus using the SoC
compatible, since Hurricane2 shares the AMAC compatible. Other platform
AMACs without a phy-handle must continue following the fixed PHY speed.
The BCMA path already selects the flag only for the Northstar family.
Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261029211540.4123250-2-florian.fainelli@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/bgmac-platform.c | 3 ++-
drivers/net/ethernet/broadcom/bgmac.c | 8 ++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac-platform.c b/drivers/net/ethernet/broadcom/bgmac-platform.c
index 3f4e8bac40c19..f7ff7ddc690eb 100644
--- a/drivers/net/ethernet/broadcom/bgmac-platform.c
+++ b/drivers/net/ethernet/broadcom/bgmac-platform.c
@@ -243,7 +243,8 @@ static int bgmac_probe(struct platform_device *pdev)
bgmac->phy_connect = platform_phy_connect;
} else {
bgmac->phy_connect = bgmac_phy_connect_direct;
- bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;
+ if (of_machine_is_compatible("brcm,nsp"))
+ bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;
}
return bgmac_enet_probe(bgmac);
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index a09548cb81b6b..e331d1efe144b 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1429,11 +1429,15 @@ void bgmac_adjust_link(struct net_device *net_dev)
{
struct bgmac *bgmac = netdev_priv(net_dev);
struct phy_device *phy_dev = net_dev->phydev;
+ int speed = phy_dev->speed;
bool update = false;
+ if (bgmac->feature_flags & BGMAC_FEAT_FORCE_SPEED_2500)
+ speed = SPEED_2500;
+
if (phy_dev->link) {
- if (phy_dev->speed != bgmac->mac_speed) {
- bgmac->mac_speed = phy_dev->speed;
+ if (speed != bgmac->mac_speed) {
+ bgmac->mac_speed = speed;
update = true;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0163/1167] net: dsa: b53: Force flow control for BCM5301X CPU port(s)
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (161 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0162/1167] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0164/1167] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
` (494 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli,
Russell King (Oracle), Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <florian.fainelli@broadcom.com>
[ Upstream commit 93a2579ed08c76835514d2a7f6e5bf3a9bc377ef ]
Just like what b53_adjust_link() does, force flow control for the
BCM5301X CPU port(s) by forcing rx_pause and tx_pause in
b53_phylink_mac_link_up(). Preparatory step for getting rid of
b53_adjust_link().
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20240423183339.1368511-5-florian.fainelli@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 41af38324341 ("net: dsa: b53: restore the NSP IMP port 2 Gbps mode")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/dsa/b53/b53_common.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 83d73fcd733bc..3d98b1e892c78 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1544,6 +1544,10 @@ void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
return;
if (mode == MLO_AN_FIXED) {
+ /* Force flow control on BCM5301x's CPU port */
+ if (is5301x(dev) && dsa_is_cpu_port(ds, port))
+ tx_pause = rx_pause = true;
+
b53_force_port_config(dev, port, speed, duplex,
tx_pause, rx_pause);
b53_force_link(dev, port, true);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0164/1167] net: dsa: b53: restore the NSP IMP port 2 Gbps mode
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (162 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0163/1167] net: dsa: b53: Force flow control for BCM5301X CPU port(s) Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0165/1167] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
` (493 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Simon Horman,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <florian.fainelli@broadcom.com>
[ Upstream commit 41af38324341df9d769641d6485abb67fd5209ed ]
The Northstar Plus IMP port uses the switch's proprietary 2 Gbps mode for
its internal link to the AMAC. Its fixed-link description reports 1 Gbps,
so applying that speed clears PORT_OVERRIDE_SPEED_2000M and leaves the two
ends of the internal link configured at different speeds.
Force the 2 Gbps mode and flow control for BCM5301x and NSP CPU ports. The
mismatch caused switch output queue discards on both copper and SerDes
ports, with one discard for every TCP retransmission. With both ends
restored to their high-speed modes, iperf3 reports no retransmissions.
Fixes: b6a8a5477fe9 ("net: dsa: b53: fix resetting speed and pause on forced link")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261029211540.4123250-3-florian.fainelli@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/dsa/b53/b53_common.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 3d98b1e892c78..6cb080712df80 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1544,9 +1544,15 @@ void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
return;
if (mode == MLO_AN_FIXED) {
- /* Force flow control on BCM5301x's CPU port */
- if (is5301x(dev) && dsa_is_cpu_port(ds, port))
- tx_pause = rx_pause = true;
+ /* Force flow control and 2Gbits/sec on BCM5301x and NSP CPU
+ * ports
+ */
+ if ((is5301x(dev) || dev->chip_id == BCM58XX_DEVICE_ID) &&
+ dsa_is_cpu_port(ds, port)) {
+ tx_pause = true;
+ rx_pause = true;
+ speed = 2000;
+ }
b53_force_port_config(dev, port, speed, duplex,
tx_pause, rx_pause);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0165/1167] Bluetooth: Fix not updating of hdev->commands[] after reset
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (163 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0164/1167] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0166/1167] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
` (492 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ Upstream commit e00aa1a33f81a5e25b510f569ab9cb9f97eb41b9 ]
Read Local Supported Commands was only read once during the INIT/SETUP
flow, but the supported commands bits may change at runtime, for
example after a firmware change applied with vendor commands, so update
hdev->commands[] every time the response is received.
Fixes: 6a070e6e81ad ("Bluetooth: Store supported commands only during setup procedure")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_event.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 2407ff299f8e9..af1592b82d299 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -782,9 +782,7 @@ static u8 hci_cc_read_local_commands(struct hci_dev *hdev, void *data,
if (rp->status)
return rp->status;
- if (hci_dev_test_flag(hdev, HCI_SETUP) ||
- hci_dev_test_flag(hdev, HCI_CONFIG))
- memcpy(hdev->commands, rp->commands, sizeof(hdev->commands));
+ memcpy(hdev->commands, rp->commands, sizeof(hdev->commands));
return rp->status;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0166/1167] spi: cadence-quadspi: Fix race between DMA completion and transfer start
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (164 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0165/1167] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0167/1167] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
` (491 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frederic Konrad, Srikanth Boyapally,
Radhey Shyam Pandey, Mark Brown, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frederic Konrad <fkonrad@amd.com>
[ Upstream commit 059518f775baecc9803fc97787bd0b17558f8047 ]
In cqspi_versal_indirect_read_dma(), the DMA transfer is started by
writing CQSPI_REG_INDIRECTRD_START_MASK to the indirect read control
register. Under certain timing conditions, the DMA completion interrupt
may be triggered and complete the transfer before the completion
structure is reinitialized.
This creates a race where the completion event is lost, causing
wait_for_completion_timeout() to time out even though the transfer has
already completed, resulting in errors such as:
spi-nor spi0.0: CS0: operation failed with -110
Fix this by reinitializing the completion structure before starting the
DMA transfer, ensuring that any completion event generated after the
transfer begins is correctly observed.
Fixes: 1a6f854f7daa ("spi: cadence-quadspi: Add Xilinx Versal external DMA support")
Signed-off-by: Frederic Konrad <fkonrad@amd.com>
Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://patch.msgid.link/20261104071958.2405117-1-radhey.shyam.pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-cadence-quadspi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 33090e69ec215..b8d810e95945a 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -895,11 +895,11 @@ static int cqspi_versal_indirect_read_dma(struct cqspi_flash_pdata *f_pdata,
writel(CQSPI_REG_VERSAL_DMA_DST_CTRL_VAL,
reg_base + CQSPI_REG_VERSAL_DMA_DST_CTRL);
+ reinit_completion(&cqspi->transfer_complete);
+
writel(CQSPI_REG_INDIRECTRD_START_MASK,
reg_base + CQSPI_REG_INDIRECTRD);
- reinit_completion(&cqspi->transfer_complete);
-
if (!wait_for_completion_timeout(&cqspi->transfer_complete,
msecs_to_jiffies(max_t(size_t, bytes_to_dma, 500)))) {
ret = -ETIMEDOUT;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0167/1167] drm/nouveau/fifo: map Kepler video engine contexts non-privileged
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (165 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0166/1167] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0168/1167] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
` (490 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rosen Penev, Dave Airlie,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 0820004c342af7ca1b01d0b21e0d5d99ad5c10eb ]
Since the engine context rework, gk104_ectx_ctor() maps every engine
context into the channel's VMM as a privileged page. The MSVLD,
MSPDEC and MSPPP falcons on Kepler fetch their context with
non-privileged requests, so the first method sent to any of them
faults and the channel is killed:
fifo: fault 00 [READ] at 0000000001050000 engine 10 [MSVLD] client 0d [HUB/MSVLD] reason 05 [PRIV_VIOLATION] on channel 9
fifo: fault 00 [READ] at 0000000001051000 engine 14 [MSPDEC] client 0b [HUB/MSPDEC] reason 05 [PRIV_VIOLATION] on channel 10
fifo: fault 00 [READ] at 0000000001052000 engine 11 [MSPPP] client 0c [HUB/MSPPP] reason 05 [PRIV_VIOLATION] on channel 11
Before the rework, gk104_fifo_gpfifo_engine_ctor() mapped engine
contexts without the privileged bit. Restore that for the three video
engines, and keep the privileged mapping for everything else.
Fixes: 8ab849d6dd4c ("drm/nouveau/fifo: add new engine context handling")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patch.msgid.link/20261103221529.585436-1-rosenp@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
index d8a4d773a58ca..1a5e54f5636ed 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
@@ -180,6 +180,19 @@ gk104_ectx_ctor(struct nvkm_engn *engn, struct nvkm_vctx *vctx)
struct gf100_vmm_map_v0 args = { .priv = 1 };
int ret;
+ /* The video falcons access their context with non-privileged
+ * requests, and fault with PRIV_VIOLATION on a privileged mapping.
+ */
+ switch (engn->engine->subdev.type) {
+ case NVKM_ENGINE_MSVLD:
+ case NVKM_ENGINE_MSPDEC:
+ case NVKM_ENGINE_MSPPP:
+ args.priv = 0;
+ break;
+ default:
+ break;
+ }
+
ret = nvkm_vmm_get(vctx->vmm, 12, vctx->inst->size, &vctx->vma);
if (ret)
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0168/1167] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (166 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0167/1167] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0169/1167] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
` (489 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Munique Feitoza, Dave Airlie,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Munique Feitoza <muniquefeitoz4@gmail.com>
[ Upstream commit a2b7b707d75e605d31fb3d85a6b27f8bb2a01413 ]
Commit 04e0481526e3 ("nouveau/dmem: Fix privileged error in copy engine
channel") changed nouveau_accel_ce_init() to unconditionally request a
privileged channel (priv = true) when calling nouveau_channel_new().
However, privileged channels (func->ramfc->priv) are only supported on
Kepler (gk104_chan_ramfc) and newer FIFO implementations. On pre-Kepler
GPUs that expose a Copy Engine runlist, func->ramfc->priv is false,
which causes nvkm_chan_new_() to reject the channel creation with
-EINVAL:
nouveau 0000:01:00.0: DRM: failed to create ce channel, -22
Only request a privileged CE channel when device->info.family >=
NV_DEVICE_INFO_V0_KEPLER.
Fixes: 04e0481526e3 ("nouveau/dmem: Fix privileged error in copy engine channel")
Signed-off-by: Munique Feitoza <muniquefeitoz4@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patch.msgid.link/20261030202809.28723-1-muniquefeitoz4@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/nouveau/nouveau_drm.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 66142db74e5cd..04e26aff2a884 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -331,6 +331,7 @@ static void
nouveau_accel_ce_init(struct nouveau_drm *drm)
{
struct nvif_device *device = &drm->client.device;
+ bool priv;
u64 runm;
int ret = 0;
@@ -343,7 +344,11 @@ nouveau_accel_ce_init(struct nouveau_drm *drm)
return;
}
- ret = nouveau_channel_new(&drm->client, true, runm, NvDmaFB, NvDmaTT, &drm->cechan);
+ /* priv copy engine only works on kepler and newer. */
+ priv = device->info.family >= NV_DEVICE_INFO_V0_KEPLER;
+
+ ret = nouveau_channel_new(&drm->client, priv, runm, NvDmaFB, NvDmaTT,
+ &drm->cechan);
if (ret)
NV_ERROR(drm, "failed to create ce channel, %d\n", ret);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0169/1167] ALSA: hda/core: Stop capability walk on empty capability header
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (167 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0168/1167] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0170/1167] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
` (488 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michał Kopeć, Takashi Iwai,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michał Kopeć <michal.kopec@3mdeb.com>
[ Upstream commit f65c917397c77daeb7e6d0893ebe89107ddd5692 ]
snd_hdac_bus_parse_capabilities() walks the controller's linked
capability list starting at LLCH. On some platforms one of the entries
reads back as all zeros. Such a header does not describe a capability,
but the walk still treats it as one: it falls into the default case and
reports an error, printing the raw register value instead of the
capability ID:
snd_hda_intel 0000:00:1f.3: Unknown capability 0
The walk then stops anyway, because the next pointer of a zero header
is 0, so the message is only noise.
Treat an all-zero header as the end of the list, the same way a failed
read (-1) is already handled, and log it at debug level only. Also
print the capability ID in hex for a genuinely unknown capability,
instead of the full header value.
Fixes: 0b00a5615dc4 ("ALSA: hdac_ext: add hdac extended controller")
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Link: https://patch.msgid.link/20261102114939.2182131-1-michal.kopec@3mdeb.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/hda/hdac_controller.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
index 7f3a000fab0ce..fdea6d2102e1e 100644
--- a/sound/hda/hdac_controller.c
+++ b/sound/hda/hdac_controller.c
@@ -325,6 +325,13 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
break;
}
+ /* An all-zero header means no capability is present here */
+ if (!cur_cap) {
+ dev_dbg(bus->dev, "Empty capability header at offset 0x%x\n",
+ offset);
+ break;
+ }
+
switch ((cur_cap & AZX_CAP_HDR_ID_MASK) >> AZX_CAP_HDR_ID_OFF) {
case AZX_ML_CAP_ID:
dev_dbg(bus->dev, "Found ML capability\n");
@@ -355,7 +362,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
break;
default:
- dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
+ dev_err(bus->dev, "Unknown capability ID 0x%x\n",
+ (cur_cap & AZX_CAP_HDR_ID_MASK) >> AZX_CAP_HDR_ID_OFF);
cur_cap = 0;
break;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0170/1167] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (168 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0169/1167] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0171/1167] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
` (487 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Takashi Iwai,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Fitzgerald <rf@opensource.cirrus.com>
[ Upstream commit 8c63987ac7fe605c337edbf9052cf97e2a415558 ]
In cs35l56_hda_unbind() call cs_dsp_stop() before cs_dsp_power_down()
if cs_dsp is in a running state.
cs35l56_hda_runtime_resume() calls cs_dsp_run() if cs_dsp_power_up() has
previously run successfully. If cs35l56_hda_unbind() is then called while
in this runtime-resumed state cs_dsp will be running. The code wasn't
checking for this and was calling cs_dsp_power_down() while still in a
running state, which is illegal. This is currently fairly harmless for
the cs35l56 driver. But it doesn't comply with the API, so potentially
could break with any future changes that expect the correct API use.
Fixes: fb78d73dde2d4 ("ALSA: hda/cs35l56: Call cs_dsp_power_down() before calling cs_dsp_remove()")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20261104122337.1072468-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/cs35l56_hda.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
index afb397c32361f..badb150050a3e 100644
--- a/sound/pci/hda/cs35l56_hda.c
+++ b/sound/pci/hda/cs35l56_hda.c
@@ -704,6 +704,8 @@ static void cs35l56_hda_unbind(struct device *dev, struct device *master, void *
cs_dsp_cleanup_debugfs(&cs35l56->cs_dsp);
debugfs_remove_recursive(cs35l56->debugfs_root);
#endif
+ if (cs35l56->cs_dsp.running)
+ cs_dsp_stop(&cs35l56->cs_dsp);
if (cs35l56->base.fw_patched)
cs_dsp_power_down(&cs35l56->cs_dsp);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0171/1167] net: 8139cp: keep Rx masked while NAPI is scheduled
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (169 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0170/1167] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0172/1167] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
` (486 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Colton Pawielski, Daniel Machon,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colton Pawielski <colton.pawielski@gmail.com>
[ Upstream commit 547b1ae5ec50b7d81b05b4219e0db7e56279d65f ]
cp_rx_poll() calls napi_complete_done() and only then takes cp->lock
with interrupts disabled to unmask the Rx interrupts. An interrupt
that is not masked while polling (TxOK, TxErr, ...) can arrive in
between. cp_interrupt() then sees the Rx status bits, which are still
set, finds NAPI no longer scheduled, masks Rx and schedules NAPI again.
cp_rx_poll() then carries on and unmasks Rx anyway.
>From that point Rx interrupts are enabled while NAPI is scheduled:
cp_interrupt() leaves the Rx bits for the poll routine, does not mask
them because napi_schedule_prep() fails, and the level-triggered
interrupt fires again as soon as it returns. On an SH7751 LANDISK
under combined Tx/Rx load this interrupt storm was captured with a RAM
trace right before the board locked up hard.
Mask Rx in cp_interrupt() whenever Rx status is pending, not only when
NAPI gets scheduled. If the race leaves Rx unmasked, the next interrupt
masks it again, and the pending poll unmasks it when it completes.
Fixes: ab1e7e1d2666 ("8139cp: use napi_complete_done()")
Signed-off-by: Colton Pawielski <colton.pawielski@gmail.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261031-b4-8139cp-napi-v2-1-5824797c0fe6@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/realtek/8139cp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 4091762275d6a..4b70a95567e45 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -600,11 +600,11 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance)
goto out_unlock;
}
- if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr))
- if (napi_schedule_prep(&cp->napi)) {
- cpw16_f(IntrMask, cp_norx_intr_mask);
+ if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) {
+ cpw16_f(IntrMask, cp_norx_intr_mask);
+ if (napi_schedule_prep(&cp->napi))
__napi_schedule(&cp->napi);
- }
+ }
if (status & (TxOK | TxErr | TxEmpty | SWInt))
cp_tx(cp);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0172/1167] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (170 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0171/1167] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0173/1167] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
` (485 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Timur Stukan, Hangbin Liu,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timur Stukan <timur.stukan.linux@gmail.com>
[ Upstream commit 9a65b9c2a97594bcaaf393329807653eff895bbf ]
In 802.3ad mode, when bond_update_speed_duplex() fails on NETDEV_UP or
NETDEV_CHANGE, bond_slave_netdev_event() sets the slave link to FAIL if
the slave has ever been up (last_link_up != 0), and to DOWN otherwise,
so that miimon can set it right once speed/duplex are valid.
last_link_up is never cleared, so a slave that is currently DOWN but
was up before is set to FAIL as well. miimon then treats it as a slave
that is still in use and takes it through the full down path again:
the link failure count is incremented, "link status definitely down"
is logged and the 802.3ad port is disabled a second time, although the
slave has not been up since it went down.
Reproduced in 802.3ad mode with miimon=100 by setting a slave down and
up again. On NETDEV_UP the speed is still unknown, so the notifier sets
FAIL, and the next miimon pass sees no carrier and proposes DOWN:
ip link add bond0 type bond mode 802.3ad miimon 100 lacp_rate 1
ip link set enp0s3 down
ip link set enp0s4 down
ip link set enp0s3 master bond0
ip link set enp0s4 master bond0
ip link set enp0s3 up
ip link set enp0s4 up
ip link set bond0 up
# wait for LACP to settle
ip link set enp0s3 down
ip link set enp0s3 up
procfs then shows "Link Failure Count: 2" in enp0s3 slave part. Also in
dmesg wrote twice: "link status definitely down, disabling slave".
Fix this by setting FAIL only for a slave that is currently UP and
leaving other states alone. An up slave that loses speed/duplex still
goes through FAIL as before, and DOWN/BACK slaves are left to miimon,
as in the other modes.
Fixes: ea53abfab960 ("bonding/802.3ad: fix link_failure_count tracking")
Signed-off-by: Timur Stukan <timur.stukan.linux@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Link: https://patch.msgid.link/20261101145653.63648-1-timur.stukan.linux@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/bonding/bond_main.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7acf6afb29b03..e3b10368b149c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3956,18 +3956,13 @@ static int bond_slave_netdev_event(unsigned long event,
case NETDEV_CHANGE:
/* For 802.3ad mode only:
* Getting invalid Speed/Duplex values here will put slave
- * in weird state. Mark it as link-fail if the link was
- * previously up or link-down if it hasn't yet come up, and
- * let link-monitoring (miimon) set it right when correct
- * speeds/duplex are available.
+ * in weird state. Mark an up slave as link-fail and let
+ * miimon set it right when correct speed/duplex are available.
*/
if (bond_update_speed_duplex(slave) &&
- BOND_MODE(bond) == BOND_MODE_8023AD) {
- if (slave->last_link_up)
- slave->link = BOND_LINK_FAIL;
- else
- slave->link = BOND_LINK_DOWN;
- }
+ BOND_MODE(bond) == BOND_MODE_8023AD &&
+ slave->link == BOND_LINK_UP)
+ slave->link = BOND_LINK_FAIL;
if (BOND_MODE(bond) == BOND_MODE_8023AD)
bond_3ad_adapter_speed_duplex_changed(slave);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0173/1167] ip6mr: Serialize multicast router socket ownership
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (171 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0172/1167] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0174/1167] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
` (484 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Ido Schimmel, Paolo Abeni,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit c6b41de4dd9f2d6856d8d8d292348f7961034152 ]
MRT6_TABLE checks whether the socket owns its current table before
acquiring RTNL. MRT6_INIT also looks up its table before taking RTNL.
Consequently, concurrent TABLE and INIT calls can initialize the old
table and then change the socket's selected table. Another INIT can
register the same socket in the new table.
rawv6_close() calls ip6mr_sk_done(), which clears only the first table
owned by the socket. After the socket's RCU-delayed free, the other
table retains a dangling mroute_sk pointer. A subsequent multicast cache
report passes that pointer to sock_queue_rcv_skb_reason(). This produces
a KASAN slab-use-after-free in sk_filter_trim_cap().
Look up the selected table in ip6mr_sk_init() after acquiring RTNL.
Likewise, re-read the current table and check its owner under RTNL in
MRT6_TABLE before updating the selection. This preserves the single-table
ownership invariant shared with ip6mr_sk_done(), without changing the
locking of the other multicast socket options.
Fixes: d1db275dd3f6 ("ipv6: ip6mr: support multiple tables")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261030042221.73996-1-kylebot@openai.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/ip6mr.c | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index f24ebb942c64e..26152a710d4ad 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1578,12 +1578,20 @@ static void mroute_clean_tables(struct mr_table *mrt, int flags)
}
}
-static int ip6mr_sk_init(struct mr_table *mrt, struct sock *sk)
+static int ip6mr_sk_init(struct sock *sk)
{
- int err = 0;
struct net *net = sock_net(sk);
+ struct mr_table *mrt;
+ int err = 0;
rtnl_lock();
+ mrt = __ip6mr_get_table(net,
+ raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT);
+ if (!mrt) {
+ err = -ENOENT;
+ goto out_unlock;
+ }
+
spin_lock(&mrt_lock);
if (rtnl_dereference(mrt->mroute_sk)) {
err = -EADDRINUSE;
@@ -1599,6 +1607,7 @@ static int ip6mr_sk_init(struct mr_table *mrt, struct sock *sk)
NETCONFA_MC_FORWARDING,
NETCONFA_IFINDEX_ALL,
net->ipv6.devconf_all);
+out_unlock:
rtnl_unlock();
return err;
@@ -1697,7 +1706,7 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
if (optlen < sizeof(int))
return -EINVAL;
- return ip6mr_sk_init(mrt, sk);
+ return ip6mr_sk_init(sk);
case MRT6_DONE:
return ip6mr_sk_done(sk);
@@ -1818,16 +1827,21 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
/* "pim6reg%u" should not exceed 16 bytes (IFNAMSIZ) */
if (v != RT_TABLE_DEFAULT && v >= 100000000)
return -EINVAL;
- if (sk == rcu_access_pointer(mrt->mroute_sk))
- return -EBUSY;
-
rtnl_lock();
ret = 0;
- mrt = ip6mr_new_table(net, v);
- if (IS_ERR(mrt))
- ret = PTR_ERR(mrt);
- else
- raw6_sk(sk)->ip6mr_table = v;
+ mrt = __ip6mr_get_table(net,
+ raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT);
+ if (!mrt) {
+ ret = -ENOENT;
+ } else if (sk == rtnl_dereference(mrt->mroute_sk)) {
+ ret = -EBUSY;
+ } else {
+ mrt = ip6mr_new_table(net, v);
+ if (IS_ERR(mrt))
+ ret = PTR_ERR(mrt);
+ else
+ raw6_sk(sk)->ip6mr_table = v;
+ }
rtnl_unlock();
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0174/1167] net: bridge: disable MRP ports before the FDB flush in del_nbp()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (172 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0173/1167] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0175/1167] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
` (483 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ido Schimmel, Cheng Yongkang,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
[ Upstream commit 37dfd0efbfffc20a57e41c2eb349ac49b1ca1ff8 ]
del_nbp() flushes the port's FDB entries before it unregisters the RX
handler. For a normal port, br_stp_disable_port() moves the port to
BR_STATE_DISABLED before this cleanup.
That does not hold for an MRP ring port. br_set_state() ignores state
changes while BR_MRP_AWARE_BIT is set, so br_stp_disable_port() leaves
the port state alone. br_mrp_port_del() then restores forwarding when
the bridge is up before clearing the bit. A frame received between
br_fdb_cleanup_by_dst() and netdev_rx_handler_unregister() can therefore
create a new FDB entry referencing the dying port. Nothing removes that
entry before destroy_nbp_rcu() frees the port, so a later frame to the
learned MAC can be forwarded through the freed port.
Remove the MRP and CFM instances before disabling the port, so that
br_stp_disable_port() actually transitions it to BR_STATE_DISABLED.
With CONFIG_BRIDGE_VLAN_FILTERING=y, synchronize_net() in
nbp_vlan_group_unpublish() also drains receive paths that could still
learn with the old state before the final FDB cleanup.
Found through an LLM-assisted source code analysis workflow and
reproduced on net with KASAN and CONFIG_BRIDGE_VLAN_FILTERING=y in QEMU.
A diagnostic switchdev module accepts MRP objects and delays the
NETDEV_CHANGEUPPER callback for 1.5 s, holding del_nbp() after the FDB
cleanup and before RX handler removal. The reproducer floods the MRP
port with rotating source MACs, waits for the port's RCU callback
through the module's rcu_barrier(), then sends frames to those MACs
from another port. The unpatched kernel reports:
BUG: KASAN: slab-use-after-free in br_forward+0xb1/0x820
Call Trace:
<IRQ>
br_forward+0xb1/0x820
br_handle_frame_finish+0x148b/0x1e50
br_handle_frame+0x90a/0x15c0
With this patch, three runs of six cycles each reach the delay without
a KASAN report.
Fixes: 6536993371fa ("bridge: mrp: Integrate MRP into the bridge")
Suggested-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/netdev/20261012123051.GA714215@shredder/
Closes: https://lore.kernel.org/netdev/20261022090431.3641707-1-teel4res@gmail.com/
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261101044840.1595584-1-1020691186@qq.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bridge/br_if.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index eee6ceb7cddab..82447f7071312 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -339,13 +339,13 @@ static void del_nbp(struct net_bridge_port *p)
nbp_delete_promisc(p);
+ br_mrp_port_del(br, p);
+ br_cfm_port_del(br, p);
+
spin_lock_bh(&br->lock);
br_stp_disable_port(p);
spin_unlock_bh(&br->lock);
- br_mrp_port_del(br, p);
- br_cfm_port_del(br, p);
-
br_ifinfo_notify(RTM_DELLINK, NULL, p);
list_del_rcu(&p->list);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0175/1167] tcp: initialize send sequence numbers before deferring TFO
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (173 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0174/1167] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0176/1167] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
` (482 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qingfang Deng, Eric Dumazet,
Kuniyuki Iwashima, Neal Cardwell, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qingfang Deng <qingfang.deng@linux.dev>
[ Upstream commit 57889a8f6d49fc153aa0017d13086ab736567f8a ]
TCP_FASTOPEN_CONNECT can return from connect() before tcp_connect_init()
when a cached cookie or cookieless Fast Open allows deferring the SYN.
At this point write_seq contains the initial sequence number, while
snd_una and snd_nxt have not been initialized to that sequence number.
Consequently, inet_diag and /proc/net/tcp{,6} report the initial
sequence number as the send queue length despite no SYN or payload being
queued.
Initialize snd_una and snd_nxt to write_seq before marking the
connection as deferred. Both sequence-based queue lengths then remain
zero until the first write starts the connection and runs
tcp_connect_init().
Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20261102035943.9700-1-qingfang.deng@linux.dev
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_fastopen.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c
index d36a1ceb75101..9ba9e5d2aba14 100644
--- a/net/ipv4/tcp_fastopen.c
+++ b/net/ipv4/tcp_fastopen.c
@@ -455,6 +455,8 @@ bool tcp_fastopen_defer_connect(struct sock *sk, int *err)
if (tp->fastopen_connect && !tp->fastopen_req) {
if (tcp_fastopen_cookie_check(sk, &mss, &cookie)) {
+ WRITE_ONCE(tp->snd_una, tp->write_seq);
+ WRITE_ONCE(tp->snd_nxt, tp->write_seq);
inet_set_bit(DEFER_CONNECT, sk);
return true;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0176/1167] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (174 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0175/1167] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0177/1167] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
` (481 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laveesh Bansal, Pablo Neira Ayuso,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laveesh Bansal <laveeshb@laveeshbansal.com>
[ Upstream commit 683ff28ab18accb25268741a724645eee839d41a ]
nf_ct_bridge_refrag() warns when skb->protocol is neither IPv4 nor IPv6.
A vlan filtering bridge can get there with a vlan ethertype: if the
protocol of the tag of a frame differs from the vlan_protocol of the
bridge, br_allowed_ingress() moves the tag back into the packet after
NF_BR_PRE_ROUTING, where bridge conntrack has already defragmented it.
Anyone who can send fragments into a port of such a bridge can trigger the
warning, which takes the machine down with panic_on_warn. The packet is
dropped either way, so only warn on kernels built with CONFIG_DEBUG_NET.
This only avoids the warning. Such fragmented packets are still dropped.
syzbot reported the warning. It keeps triggering on CONFIG_DEBUG_NET
kernels until the vlan tag is handled, which is left for a follow-up:
https://syzkaller.appspot.com/bug?extid=a8ba738fe2db6b4bb27f
Fixes: 3c171f496ef5 ("netfilter: bridge: add connection tracking system")
Assisted-by: LLM
Signed-off-by: Laveesh Bansal <laveeshb@laveeshbansal.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
index 381638ee9ac5f..c339d2406abe6 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -359,7 +359,7 @@ nf_ct_bridge_refrag(struct sk_buff *skb, const struct nf_hook_state *state,
nf_br_ip6_fragment(state->net, state->sk, skb, &data, output);
break;
default:
- WARN_ON_ONCE(1);
+ DEBUG_NET_WARN_ON_ONCE(1);
return NF_DROP;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0177/1167] netfilter: x_tables: check target name before accessing verdict
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (175 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0176/1167] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0178/1167] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
` (480 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, VEGA, Fernando Fernandez Mancera,
Pablo Neira Ayuso, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fernando Fernandez Mancera <fmancera@suse.de>
[ Upstream commit 364b200285bb2cc518e3c5efe6591951c05b8e01 ]
Non-standard targets may contain only struct xt_entry_target.
mark_source_chains() nevertheless reads the target as an
xt_standard_target before checking its name, potentially reading four
bytes beyond a header-only target.
Check that the target is standard before reading its verdict.
Non-standard targets remain handled as fallthrough rules.
See the following KASAN trace:
BUG: KASAN: slab-out-of-bounds in translate_table+0x1660/0x1a40 [ip6_tables]
Read of size 4 at addr ffff88800ed56ff8 by task rep/432
Call Trace:
kasan_report+0xfa/0x120
translate_table+0x1660/0x1a40 [ip6_tables]
do_ip6t_set_ctl+0x667/0xa76 [ip6_tables]
nf_setsockopt+0x77/0xd0
do_sock_setsockopt+0x118/0x490
__sys_setsockopt+0xe4/0x160
__x64_sys_setsockopt+0xbd/0x190
do_syscall_64+0xde/0x4f0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Allocated by task 432:
kasan_save_stack+0x2f/0x50
__kasan_kmalloc+0x7f/0x90
__kvmalloc_node_noprof+0x1b1/0x5c0
xt_alloc_table_info+0x3c/0xa0
do_ip6t_set_ctl+0x5ee/0xa76 [ip6_tables]
nf_setsockopt+0x77/0xd0
do_sock_setsockopt+0x118/0x490
__sys_setsockopt+0xe4/0x160
__x64_sys_setsockopt+0xbd/0x190
do_syscall_64+0xde/0x4f0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: VEGA <vega@nebusec.ai>
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/netfilter/arp_tables.c | 5 +++--
net/ipv4/netfilter/ip_tables.c | 5 +++--
net/ipv6/netfilter/ip6_tables.c | 5 +++--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index 480a7e89a0f1e..b7b8b55645de0 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -372,11 +372,12 @@ static int mark_source_chains(const struct xt_table_info *newinfo,
e->counters.pcnt = pos;
pos += size;
} else {
- int newpos = t->verdict;
+ int newpos;
if (strcmp(t->target.u.user.name,
XT_STANDARD_TARGET) == 0 &&
- newpos >= 0) {
+ t->verdict >= 0) {
+ newpos = t->verdict;
/* This a jump; chase it. */
if (!xt_find_jump_offset(offsets, newpos,
newinfo->number))
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index e01f040b7eefc..f8f9e9140d216 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -422,11 +422,12 @@ mark_source_chains(const struct xt_table_info *newinfo,
e->counters.pcnt = pos;
pos += size;
} else {
- int newpos = t->verdict;
+ int newpos;
if (strcmp(t->target.u.user.name,
XT_STANDARD_TARGET) == 0 &&
- newpos >= 0) {
+ t->verdict >= 0) {
+ newpos = t->verdict;
/* This a jump; chase it. */
if (!xt_find_jump_offset(offsets, newpos,
newinfo->number))
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 551d3ca1036d7..fb375ce7f916d 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -440,11 +440,12 @@ mark_source_chains(const struct xt_table_info *newinfo,
e->counters.pcnt = pos;
pos += size;
} else {
- int newpos = t->verdict;
+ int newpos;
if (strcmp(t->target.u.user.name,
XT_STANDARD_TARGET) == 0 &&
- newpos >= 0) {
+ t->verdict >= 0) {
+ newpos = t->verdict;
/* This a jump; chase it. */
if (!xt_find_jump_offset(offsets, newpos,
newinfo->number))
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0178/1167] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (176 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0177/1167] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0179/1167] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
` (479 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
Fernando Fernandez Mancera, Pablo Neira Ayuso, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joas Antonio dos Santos <joasantonio108@gmail.com>
[ Upstream commit 7af52bda65c0bbbf40894aa3df36ac1bb5697984 ]
ct_sip_parse_transport() compares the value of the "transport=" header
parameter against "TCP"/"UDP" with strncasecmp(..., 3), but it never
checks that the parsed value is at least 3 bytes long.
ct_sip_parse_param() returns matchlen = end - start, where end is the
next ';' or, when there is no ';', the end of the payload buffer
(limit = dptr + datalen). If the "transport=" value is only 1 or 2
bytes long and runs exactly to the end of the payload (e.g. a REGISTER
request whose Contact header ends in ";transport=T" with no trailing
CRLF), matchlen is less than 3 while strncasecmp() still reads up to 3
bytes, reading 1-2 bytes past the end of the linearized skb data.
Add a matchlen check before the comparison, mirroring the
sdp_media_type() pattern a few lines below, so short values cannot reach
strncasecmp().
The bug was found by LLM-assisted manual review of the SIP helper's
parsers and confirmed with a userspace ASan harness built from the
verbatim parser functions, which reports a heap-buffer-overflow read of
size 2 in strncasecmp() called from ct_sip_parse_transport().
Fixes: ea45f12a2766d ("[NETFILTER]: nf_conntrack_sip: parse SIP headers properly")
Link: https://patch.msgid.link/20260815133104.50369-1-joasantonio108@gmail.com/
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nf_conntrack_sip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 449a6e53feae4..12b8c7fcca640 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -707,9 +707,9 @@ static int ct_sip_parse_transport(struct nf_conn *ct, const char *dptr,
if (ct_sip_parse_param(ct, dptr, dataoff, datalen, "transport=",
&matchoff, &matchlen)) {
- if (!strncasecmp(dptr + matchoff, "TCP", strlen("TCP")))
+ if (matchlen >= 3 && !strncasecmp(dptr + matchoff, "TCP", 3))
*proto = IPPROTO_TCP;
- else if (!strncasecmp(dptr + matchoff, "UDP", strlen("UDP")))
+ else if (matchlen >= 3 && !strncasecmp(dptr + matchoff, "UDP", 3))
*proto = IPPROTO_UDP;
else
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0179/1167] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (177 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0178/1167] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0180/1167] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
` (478 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xingyuan Mo, Pablo Neira Ayuso,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <pablo@netfilter.org>
[ Upstream commit e95b3be75ae0652d40a48a210f0cf5197b3b3783 ]
Allocate flow rule object after transaction has been allocation and rule
deactivation has been performed, otherwise memleak is possible. Let the
transaction unwind the existing rule deactivation from the abort path,
this needs to update nft_flow_rule_destroy() to skip release if
flow_rule is null.
While at this, remove check for non-null flow_rule in newrule error path
now that nft_flow_rule_destroy() is skipped if flow_rule is null.
Fixes: 63b48c73ff56 ("netfilter: nf_tables_offload: undo updates if transaction fails")
Reported-by: Xingyuan Mo <hdthky0@gmail.com>
Link: https://patch.msgid.link/20261028062204.1079089-1-hdthky0@gmail.com/
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nf_tables_api.c | 21 +++++++++------------
net/netfilter/nf_tables_offload.c | 3 +++
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index a036deb93781a..d9d017d97bb72 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -543,16 +543,6 @@ static int nft_delrule(struct nft_ctx *ctx, struct nft_rule *rule)
if (trans == NULL)
return -ENOMEM;
- if (ctx->chain->flags & NFT_CHAIN_HW_OFFLOAD) {
- flow = nft_flow_rule_create(ctx->net, rule);
- if (IS_ERR(flow)) {
- nft_trans_destroy(trans);
- return PTR_ERR(flow);
- }
-
- nft_trans_flow_rule(trans) = flow;
- }
-
err = nf_tables_delrule_deactivate(ctx, rule);
if (err < 0) {
nft_trans_destroy(trans);
@@ -560,6 +550,14 @@ static int nft_delrule(struct nft_ctx *ctx, struct nft_rule *rule)
}
nft_rule_expr_deactivate(ctx, rule, NFT_TRANS_PREPARE);
+ if (ctx->chain->flags & NFT_CHAIN_HW_OFFLOAD) {
+ flow = nft_flow_rule_create(ctx->net, rule);
+ if (IS_ERR(flow))
+ return PTR_ERR(flow);
+
+ nft_trans_flow_rule(trans) = flow;
+ }
+
return 0;
}
@@ -4165,8 +4163,7 @@ static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info,
err_destroy_flow_rule:
nft_use_dec_restore(&chain->use);
err_destroy_flow:
- if (flow)
- nft_flow_rule_destroy(flow);
+ nft_flow_rule_destroy(flow);
err_release_rule:
nft_rule_expr_deactivate(&ctx, rule, NFT_TRANS_PREPARE_ERROR);
nf_tables_rule_destroy(&ctx, rule);
diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c
index 27530bad6619d..ead668d52de0a 100644
--- a/net/netfilter/nf_tables_offload.c
+++ b/net/netfilter/nf_tables_offload.c
@@ -148,6 +148,9 @@ void nft_flow_rule_destroy(struct nft_flow_rule *flow)
struct flow_action_entry *entry;
int i;
+ if (!flow)
+ return;
+
flow_action_for_each(i, entry, &flow->rule->action) {
switch (entry->id) {
case FLOW_ACTION_REDIRECT:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0180/1167] netfilter: nat: zero newrange before filling it in
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (178 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0179/1167] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0181/1167] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
` (477 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Westphal, Pablo Neira Ayuso,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <fw@strlen.de>
[ Upstream commit d1bb235aa409a4e5aeba6c748d953d948625b1e9 ]
nf_nat_masquerade_ipv4(), nf_nat_masquerade_ipv6(), netmap_tg4() and
netmap_tg6() each build a stack-local struct nf_nat_range2 from the
caller-supplied range, inheriting range->flags unmodified. Two of them
only memset() the min_addr/max_addr members, the other two don't
memset() anything at all, so newrange.base_proto is left as stack
garbage.
If the inherited flags include NF_NAT_RANGE_PROTO_OFFSET,
nf_nat_l4proto_unique_tuple() reads range->base_proto.all to compute
the NAT port offset. Neither the NETMAP nor the MASQUERADE targets
mask the flags field in their checkentry callback, so this
uninitialized stack value can end up feeding the NAT port selection.
The per-member memset()s are not enough: they have to enumerate every
field that must be cleared, and base_proto was missed when
NF_NAT_RANGE_PROTO_OFFSET/base_proto was added to the struct. memset()
the whole struct instead, so every member is covered regardless of
which ones get explicitly assigned afterwards.
There are other places that miss this, but those hardcode .flags so
nat core won't read from the uninitialized fields.
C99 initializers would be preferrable, but this is a more intrusive
change. Lets followup in nf-next and convert others as well.
This is an LLM finding.
Fixes: 2eb0f624b709 ("netfilter: add NAT support for shifted portmap ranges")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nf_nat_masquerade.c | 4 ++--
net/netfilter/xt_NETMAP.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/nf_nat_masquerade.c b/net/netfilter/nf_nat_masquerade.c
index 1a506b0c6511a..2506aace39bcf 100644
--- a/net/netfilter/nf_nat_masquerade.c
+++ b/net/netfilter/nf_nat_masquerade.c
@@ -62,8 +62,7 @@ nf_nat_masquerade_ipv4(struct sk_buff *skb, unsigned int hooknum,
nat->masq_index = out->ifindex;
/* Transfer from original range. */
- memset(&newrange.min_addr, 0, sizeof(newrange.min_addr));
- memset(&newrange.max_addr, 0, sizeof(newrange.max_addr));
+ memset(&newrange, 0, sizeof(newrange));
newrange.flags = range->flags | NF_NAT_RANGE_MAP_IPS;
newrange.min_addr.ip = newsrc;
newrange.max_addr.ip = newsrc;
@@ -259,6 +258,7 @@ nf_nat_masquerade_ipv6(struct sk_buff *skb, const struct nf_nat_range2 *range,
if (nat)
nat->masq_index = out->ifindex;
+ memset(&newrange, 0, sizeof(newrange));
newrange.flags = range->flags | NF_NAT_RANGE_MAP_IPS;
newrange.min_addr.in6 = src;
newrange.max_addr.in6 = src;
diff --git a/net/netfilter/xt_NETMAP.c b/net/netfilter/xt_NETMAP.c
index cb2ee80d84fa8..591a6af6c61fa 100644
--- a/net/netfilter/xt_NETMAP.c
+++ b/net/netfilter/xt_NETMAP.c
@@ -42,6 +42,7 @@ netmap_tg6(struct sk_buff *skb, const struct xt_action_param *par)
netmask.ip6[i];
}
+ memset(&newrange, 0, sizeof(newrange));
newrange.flags = range->flags | NF_NAT_RANGE_MAP_IPS;
newrange.min_addr = new_addr;
newrange.max_addr = new_addr;
@@ -89,8 +90,7 @@ netmap_tg4(struct sk_buff *skb, const struct xt_action_param *par)
new_ip = ip_hdr(skb)->saddr & ~netmask;
new_ip |= mr->range[0].min_ip & netmask;
- memset(&newrange.min_addr, 0, sizeof(newrange.min_addr));
- memset(&newrange.max_addr, 0, sizeof(newrange.max_addr));
+ memset(&newrange, 0, sizeof(newrange));
newrange.flags = mr->range[0].flags | NF_NAT_RANGE_MAP_IPS;
newrange.min_addr.ip = new_ip;
newrange.max_addr.ip = new_ip;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0181/1167] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (179 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0180/1167] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0182/1167] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
` (476 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Eric Dumazet, Hangbin Liu,
Jiayuan Chen, Kuniyuki Iwashima, Linkui Xiao, Paolo Abeni,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit fafbc4051123d5459ea6950899cec08ed946e278 ]
ireq->ipv6_opt is only set by calipso_req_setattr(), when a CALIPSO
NetLabel mapping is configured.
Request socket migration (net.ipv4.tcp_migrate_req=1, or a
BPF_SK_REUSEPORT_SELECT_OR_MIGRATE program) clones the request
socket with inet_reqsk_clone(), so that the old request socket and
its clone share the same ipv6_opt, then reqsk_migrate_reset() clears
the pointer in the old one.
Another cpu holding a reference on the old request socket can still
be using these options, sending a SYNACK from tcp_v6_send_synack()
or creating a child in tcp_v6_syn_recv_sock(), when the clone
is freed. tcp_v6_reqsk_destructor() frees ipv6_opt with a plain
kfree(), leading to a use-after-free.
Both readers already run under RCU, like their IPv4 counterparts.
Use kfree_rcu() in tcp_v6_reqsk_destructor(), as commit e3f33b0a1d89
("ipv4: free inet_opt and ireq_opt after an RCU grace period") did
for ireq_opt.
Fixes: c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179369559062.488856.15441115725436277776@kernel.org/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Tested-by: Linkui Xiao <xiaolinkui@kylinos.cn>
Link: https://patch.msgid.link/20261103090011.4128420-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/tcp_ipv6.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 7adeb623cfb2b..6c5d0d8c65f9e 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -570,7 +570,7 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
static void tcp_v6_reqsk_destructor(struct request_sock *req)
{
- kfree(inet_rsk(req)->ipv6_opt);
+ kfree_rcu(inet_rsk(req)->ipv6_opt, rcu);
consume_skb(inet_rsk(req)->pktopts);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0182/1167] MIPS: Avoid dead code/data elimination when using recordmcount
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (180 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0181/1167] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0183/1167] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
` (475 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Thomas Bogendoerfer,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 255d9dbd936f7db8b963e82429f6e57cd9d48999 ]
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION builds with -ffunction-sections,
placing every function in its own section. recordmcount refuses to use
weak symbols as section bases, as a strong definition could override
them, so a weak function alone in its section, such as the generic
pcibios_fixup_bus() stub, breaks the build:
Cannot find symbol for section 88: .text.pcibios_fixup_bus.
drivers/pci/probe.o: failed
MIPS always records mcount locations with recordmcount, so this hits
any config with the function tracer and dead code elimination enabled,
e.g. malta_defconfig built with LLVM=1.
Only offer dead code elimination when recordmcount is not used, as
powerpc does since commit f8b2336f15f3 ("powerpc: Avoid dead code/data
elimination when using recordmcount"). In practice this makes it
unavailable together with the function tracer on MIPS.
Fixes: c0436b503591 ("MIPS: Enable dead code elimination")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 91c3a502156b3..2d6677fed5407 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -78,7 +78,7 @@ config MIPS
select HAVE_IRQ_TIME_ACCOUNTING
select HAVE_KPROBES
select HAVE_KRETPROBES
- select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
+ select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !FTRACE_MCOUNT_USE_RECORDMCOUNT
select HAVE_MOD_ARCH_SPECIFIC
select HAVE_NMI
select HAVE_PERF_EVENTS
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0183/1167] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (181 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0182/1167] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0184/1167] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
` (474 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli,
Thomas Bogendoerfer, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <f.fainelli@gmail.com>
[ Upstream commit 792ac17faa0503448f3ef85b49f16456ac54ab84 ]
Alchemy keeps pointers into the firmware environment and looks up ethaddr
when initializing the Ethernet devices. By that point, memory allocation
can have overwritten the environment, causing prom_getenv() to pass an
invalid pointer to strchr() and panic during boot.
On the MTX-1, the struct page layout change in 9ddb3c14afba reduces struct
page from 40 to 32 bytes and exposes this unreserved firmware memory.
Bisection and boot tests confirmed that the parent boots while the change
reproduces the panic.
Parse the Ethernet address during prom_init(), before registering RAM
with memblock, and keep the six bytes in kernel-owned init data. Return
the saved address during device initialization, preserving the existing
YAMON formats and command-line fallback without reserving a fixed
low-memory region.
Fixes: b93ddc4f9156 ("mips: Reserve memory for the kernel image resources")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/alchemy/common/prom.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/arch/mips/alchemy/common/prom.c b/arch/mips/alchemy/common/prom.c
index b13d8adf3be47..11dc800f75663 100644
--- a/arch/mips/alchemy/common/prom.c
+++ b/arch/mips/alchemy/common/prom.c
@@ -45,6 +45,11 @@ int prom_argc;
char **prom_argv;
char **prom_envp;
+static char prom_ethaddr[6] __initdata;
+static bool prom_ethaddr_valid __initdata;
+
+static void __init prom_init_ethernet_addr(void);
+
void __init prom_init_cmdline(void)
{
int i;
@@ -94,6 +99,9 @@ void __init prom_init(void)
if (!memsize_str || kstrtoul(memsize_str, 0, &memsize))
memsize = SZ_64M; /* minimum memsize is 64MB RAM */
+ /* Save the MAC before the allocator can reuse the PROM environment. */
+ prom_init_ethernet_addr();
+
memblock_add(0, memsize);
}
@@ -124,7 +132,7 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str)
}
}
-int __init prom_get_ethernet_addr(char *ethernet_addr)
+static void __init prom_init_ethernet_addr(void)
{
char *ethaddr_str;
@@ -134,12 +142,21 @@ int __init prom_get_ethernet_addr(char *ethernet_addr)
/* Check command line */
ethaddr_str = strstr(arcs_cmdline, "ethaddr=");
if (!ethaddr_str)
- return -1;
+ return;
ethaddr_str += strlen("ethaddr=");
}
- str2eaddr(ethernet_addr, ethaddr_str);
+ str2eaddr(prom_ethaddr, ethaddr_str);
+ prom_ethaddr_valid = true;
+}
+
+int __init prom_get_ethernet_addr(char *ethernet_addr)
+{
+ if (!prom_ethaddr_valid)
+ return -1;
+
+ memcpy(ethernet_addr, prom_ethaddr, sizeof(prom_ethaddr));
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0184/1167] MIPS: SB1250: Validate and update IRQ affinity
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (182 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0183/1167] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0185/1167] init: flush async file closing Greg Kroah-Hartman
` (473 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli,
Thomas Bogendoerfer, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <f.fainelli@gmail.com>
[ Upstream commit 456c965ca46c59a4a241c755e6565fd883a522f4 ]
sb1250_set_affinity() selects the first online CPU in the requested
affinity mask without checking whether such a CPU exists. If the
intersection is empty, the resulting CPU index is invalid and must
not be passed to cpu_logical_map().
Reject affinity masks containing no online CPU with -EINVAL before
accessing the CPU mapping or interrupt mapper registers.
Also update the effective affinity mask to reflect the single logical
CPU selected as the interrupt target.
Fixes: 421d1563c662 ("mips: Validate online cpus in irq_set_affinity() callbacks")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/sibyte/sb1250/irq.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 2f08ad267a11e..d7a656cd7ec0c 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -76,6 +76,8 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask,
unsigned long flags;
i = cpumask_first_and(mask, cpu_online_mask);
+ if (i >= nr_cpu_ids)
+ return -EINVAL;
/* Convert logical CPU to physical CPU */
cpu = cpu_logical_map(i);
@@ -103,6 +105,7 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask,
____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
R_IMR_INTERRUPT_MASK));
}
+ irq_data_update_effective_affinity(d, cpumask_of(i));
raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0185/1167] init: flush async file closing
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (183 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0184/1167] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0186/1167] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
` (472 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marek Szyprowski, Srikanth Aithal,
Christian Brauner, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit 386dc41cf54dcf44ea40de1aca900f02b756cec0 ]
When unpacking the initramfs or when mounting block devices we need to
ensure that any delayed fput() finished to prevent spurious errors.
The init process can be a proper kernel thread or a user mode helper.
In the latter case PF_KTHREAD isn't set. So we need to do both
flush_delayed_work() and task_work_run().
Since we'll port block device opening and closing to regular file open
and closing we need to ensure the same as for the initramfs. So just
make that a little helper.
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Srikanth Aithal <sraithal@amd.com>
Link: https://lore.kernel.org/r/CA+G9fYttTwsbFuVq10igbSvP5xC6bf_XijM=mpUqrJV=uvUirQ@mail.gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
init/do_mounts.c | 3 +++
init/do_mounts.h | 9 +++++++++
init/initramfs.c | 6 +++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 21d065a55ad88..ce8fc1c2b715c 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -208,6 +208,9 @@ void __init mount_root_generic(char *name, char *pretty_name, int flags)
goto out;
case -EACCES:
case -EINVAL:
+#ifdef CONFIG_BLOCK
+ init_flush_fput();
+#endif
continue;
}
/*
diff --git a/init/do_mounts.h b/init/do_mounts.h
index 15e372b00ce70..6069ea3eb80d7 100644
--- a/init/do_mounts.h
+++ b/init/do_mounts.h
@@ -9,6 +9,8 @@
#include <linux/major.h>
#include <linux/root_dev.h>
#include <linux/init_syscalls.h>
+#include <linux/task_work.h>
+#include <linux/file.h>
void mount_root_generic(char *name, char *pretty_name, int flags);
void mount_root(char *root_device_name);
@@ -41,3 +43,10 @@ static inline bool initrd_load(char *root_device_name)
}
#endif
+
+/* Ensure that async file closing finished to prevent spurious errors. */
+static inline void init_flush_fput(void)
+{
+ flush_delayed_fput();
+ task_work_run();
+}
diff --git a/init/initramfs.c b/init/initramfs.c
index 148988bd8ab27..35480c5053311 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -16,9 +16,10 @@
#include <linux/mm.h>
#include <linux/namei.h>
#include <linux/init_syscalls.h>
-#include <linux/task_work.h>
#include <linux/umh.h>
+#include "do_mounts.h"
+
static __initdata bool csum_present;
static __initdata u32 io_csum;
@@ -735,8 +736,7 @@ static void __init do_populate_rootfs(void *unused, async_cookie_t cookie)
initrd_start = 0;
initrd_end = 0;
- flush_delayed_fput();
- task_work_run();
+ init_flush_fput();
}
static ASYNC_DOMAIN_EXCLUSIVE(initramfs_domain);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0186/1167] initrd: flush deferred fput() before mounting root
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (184 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0185/1167] init: flush async file closing Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0187/1167] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
` (471 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abbott Liu,
Christian Brauner (Amutable), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abbott Liu <liuwenliang@huawei.com>
[ Upstream commit 807c1d7125a2b3ca5705a803aa2e19f9d53d1ea3 ]
Booting an old-style initrd, i.e. a filesystem image instead of a cpio
archive, with "root=/dev/ram rootfstype=squashfs" can fail to mount the
root filesystem:
RAMDISK: squashfs filesystem found at block 0
RAMDISK: Loading 68449KiB [1 disk] into ram disk... done.
No filesystem could mount root, tried:
squashfs
Kernel panic - not syncing: VFS: Unable to mount root fs on
"/dev/ram" or unknown-block(1,0)
rd_load_image() copies the image into /dev/ram with kernel_write() and
then drops the file with fput(). The data only reaches the ramdisk once
the final __fput() releases the block device and bdev_release() calls
sync_blockdev(). But that __fput() is deferred. Since commit
343f4c49f243 ("kthread: Don't allocate kthread_struct for init and
umh") init is a user mode task, so the __fput() is queued as task work
and only runs once init returns to userspace, i.e. long after
mount_root(). Before that it ran as delayed fput work at least a jiffy
later, which doesn't help either.
Whether the mount survives this depends on the block size. Squashfs
calls sb_min_blocksize() first and set_blocksize() syncs and drops the
page cache when the requested block size differs from the current one.
That hides the problem for most configurations. With
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y and 4K pages both block sizes are 4K
because set_init_blocksize() gives a page-aligned ramdisk a PAGE_SIZE
block size on the first open. So set_blocksize() does nothing and
squashfs reads the superblock with bios that bypass the page cache. brd
has no page for that range yet and returns zeroes, so the magic check
fails and the mount returns -EINVAL. With rootfstype= naming a single
filesystem there is nothing left to retry and mount_root_generic()
panics.
Fixing this in squashfs would be the wrong end. Most block-backed
filesystems read their superblock or their file data with bios that
bypass the block device page cache, so they are exposed to the same
race, just less loudly.
So flush the deferred fput() in rd_load_image() right after dropping the
ramdisk file, the same way mount_root_generic() already does before it
retries with another filesystem type. All deferred closes at this point
belong to files the boot itself created.
Verified on arm64 QEMU with an openEuler Embedded rootfs image packed as
squashfs.
Fixes: 93e72b3c612a ("squashfs: migrate from ll_rw_block usage to BIO")
Signed-off-by: Abbott Liu <liuwenliang@huawei.com>
Link: https://patch.msgid.link/20260930084632.2965573-1-liuwenliang@huawei.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
init/do_mounts_rd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index ac021ae6e6fa7..285afe68dbc76 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -270,6 +270,11 @@ int __init rd_load_image(char *from)
fput(in_file);
noclose_input:
fput(out_file);
+ /*
+ * The image only reaches the ramdisk when the deferred __fput()
+ * syncs the block device. Flush it before mount_root() reads it.
+ */
+ init_flush_fput();
out:
kfree(buf);
init_unlink("/dev/ram");
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0187/1167] vfs: preserve subsecond timestamps at filesystem time limits
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (185 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0186/1167] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0188/1167] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
` (470 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hungyu Lin, Jeff Layton,
Christian Brauner (Amutable), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hungyu Lin <dennylin0707@gmail.com>
[ Upstream commit 55a0c91000646b008261e3b1e15d1e774f3026e4 ]
timestamp_truncate() clears tv_nsec whenever the clamped seconds equal
either filesystem time limit. This also drops the fractional part of
timestamps whose seconds were already within the supported range.
For example, setting a JFS mtime to 0.123456789 produces 0.000000000,
although the filesystem can store the requested value. Utilities such
as touch and cp -p consequently lose valid subsecond timestamps when
preserving these endpoint values. Timestamps strictly between the
filesystem limits are unaffected.
Only clear tv_nsec when clamping actually changes tv_sec. Continue to
truncate in-range nanoseconds to the filesystem's timestamp granularity,
including when the seconds equal either endpoint.
Ben Hutchings suggested comparing clamped and original seconds in the
2019 utimes review. That caller was switched to timestamp_truncate(),
but the helper retained its endpoint equality check.
Link: https://lore.kernel.org/lkml/12c095e595836a7ff7f2c7b2a32cb5544dd29b55.camel@codethink.co.uk/
Fixes: 50e17c000c46 ("vfs: Add timestamp_truncate() api")
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Link: https://patch.msgid.link/20261101113815.52911-1-dennylin0707@gmail.com
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/inode.c b/fs/inode.c
index 2147bd9fba43b..ab53dbedf24b0 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2543,9 +2543,10 @@ struct timespec64 timestamp_truncate(struct timespec64 t, struct inode *inode)
{
struct super_block *sb = inode->i_sb;
unsigned int gran = sb->s_time_gran;
+ time64_t seconds = t.tv_sec;
t.tv_sec = clamp(t.tv_sec, sb->s_time_min, sb->s_time_max);
- if (unlikely(t.tv_sec == sb->s_time_max || t.tv_sec == sb->s_time_min))
+ if (unlikely(t.tv_sec != seconds))
t.tv_nsec = 0;
/* Avoid division in the common cases 1 ns and 1 s. */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0188/1167] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (186 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0187/1167] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0189/1167] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
` (469 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jan Kara, Jeff Layton,
Christoph Hellwig, Christian Brauner (Amutable), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@kernel.org>
[ Upstream commit 925d238324c79bcb75ad0add1d1b9d31d5f48115 ]
STATX_ATTR_CHANGE_MONOTONIC is kernel-internal. cp_statx() strips it
from stx_attributes but copies attributes_mask verbatim, so it leaks to
userland on filesystems that advertise it (nfs, ceph), e.g.
stx_attributes_mask = 0x8000000000303000 on NFS.
Add a new mask constant and apply it to both fields.
Fixes: a1175d6b1bda ("vfs: plumb i_version handling into struct kstat")
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20261103-statx-v2-1-8b09aa8118ab@kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/stat.c | 6 +++---
include/linux/stat.h | 3 +++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/stat.c b/fs/stat.c
index 7c20f34207d20..95ab7120e2ed9 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -632,8 +632,7 @@ cp_statx(const struct kstat *stat, struct statx __user *buffer)
/* STATX_CHANGE_COOKIE is kernel-only for now */
tmp.stx_mask = stat->result_mask & ~STATX_CHANGE_COOKIE;
tmp.stx_blksize = stat->blksize;
- /* STATX_ATTR_CHANGE_MONOTONIC is kernel-only for now */
- tmp.stx_attributes = stat->attributes & ~STATX_ATTR_CHANGE_MONOTONIC;
+ tmp.stx_attributes = stat->attributes & ~STATX_ATTR_INTERNAL_MASK;
tmp.stx_nlink = stat->nlink;
tmp.stx_uid = from_kuid_munged(current_user_ns(), stat->uid);
tmp.stx_gid = from_kgid_munged(current_user_ns(), stat->gid);
@@ -641,7 +640,8 @@ cp_statx(const struct kstat *stat, struct statx __user *buffer)
tmp.stx_ino = stat->ino;
tmp.stx_size = stat->size;
tmp.stx_blocks = stat->blocks;
- tmp.stx_attributes_mask = stat->attributes_mask;
+ tmp.stx_attributes_mask = stat->attributes_mask &
+ ~STATX_ATTR_INTERNAL_MASK;
tmp.stx_atime.tv_sec = stat->atime.tv_sec;
tmp.stx_atime.tv_nsec = stat->atime.tv_nsec;
tmp.stx_btime.tv_sec = stat->btime.tv_sec;
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 52150570d37a5..122c75d8fb3cb 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -63,4 +63,7 @@ struct kstat {
/* file attribute values */
#define STATX_ATTR_CHANGE_MONOTONIC 0x8000000000000000ULL /* version monotonically increases */
+/* mask of STATX_ATTR_* bits that is private to the kernel */
+#define STATX_ATTR_INTERNAL_MASK (STATX_ATTR_CHANGE_MONOTONIC)
+
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0189/1167] sched/pelt: Fix u32 truncation of the PELT period count
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (187 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0188/1167] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0190/1167] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
` (468 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hui Su, Peter Zijlstra (Intel),
Ingo Molnar, Vincent Guittot, Kayra Cizmeci, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Su <sh_def@163.com>
[ Upstream commit a0c755e574e37fddb59edf175f27dc3877e7fe23 ]
accumulate_sum() computes the number of elapsed PELT periods in a
u64 but returns u32. When the count is a multiple of 2^32, it is
truncated to zero even though the PELT sums have been updated.
The caller interprets zero as no period boundary crossed and skips
recomputing the averages, leaving *_avg stale relative to *_sum.
Return the period count as u64 so the caller can test it without
truncation.
Fixes: a481db34b9be ("sched/fair: Optimize ___update_sched_avg()")
Signed-off-by: Hui Su <sh_def@163.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Kayra Cizmeci <kayracizmeci@gmail.com>
Link: https://patch.msgid.link/20261023025207.2967903-1-sh_def@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/pelt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
index 0f310768260c1..e7433f87c6294 100644
--- a/kernel/sched/pelt.c
+++ b/kernel/sched/pelt.c
@@ -98,7 +98,7 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3)
* d1 y^p + 1024 \Sum y^n + d3 y^0 (Step 2)
* n=1
*/
-static __always_inline u32
+static __always_inline u64
accumulate_sum(u64 delta, struct sched_avg *sa,
unsigned long load, unsigned long runnable, int running)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0190/1167] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (188 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0189/1167] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0191/1167] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
` (467 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Eric Dumazet,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 475ff14ba558bb8857bca878f1d593784ccc4f0f ]
snd_cwnd has no practical upper bound: snd_cwnd_clamp defaults to ~0,
and RTAX_INITCWND, a locked RTAX_CWND metric, TCP_BPF_IW and
TCP_BPF_SNDCWND_CLAMP accept any positive value.
Congestion control modules do u32 arithmetic on cwnd that assumes
much smaller values. For instance, ssthresh() handlers compute:
CUBIC, BIC, ROCCET: cwnd * (BICTCP_BETA_SCALE + beta), up to 2047
DCTCP: cwnd * dctcp_alpha, up to 1024
CDG, NV, CUBIC, ...: cwnd * beta, below 1024
With a large initcwnd route or TCP_BPF_IW, cwnd is set directly to
such values, and the next RTO or recovery calls ->ssthresh() with it.
The product then wraps: DCTCP with cwnd = 2^24 and alpha = 1024 gets
ssthresh == cwnd, and CUBIC computes a wrong ssthresh and Wmax.
CUBIC bictcp_update() also expects cwnd below about one million packets.
The paths that can grow cwnd by large amounts (tcp_slow_start(),
tcp_cong_avoid_ai(), bbr_set_cwnd() and tcp_init_cwnd()) already
bound it by snd_cwnd_clamp, so give snd_cwnd_clamp a finite default
of 2^20 packets, and cap the metric and BPF paths that set it or set
cwnd directly.
2^20 packets do not limit real flows: with the maximum window scale
of 14, a peer can not advertise more than 65535 << 14 bytes (~1GB),
which is less than 2^20 packets for any MSS of 1024 bytes or more.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Chris Mason <mason@kernel.org>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261030111528.2850082-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/tcp.h | 9 +++++++++
net/core/filter.c | 3 ++-
net/ipv4/tcp.c | 2 +-
net/ipv4/tcp_metrics.c | 3 ++-
4 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 1df0e2d66bfc1..925544ed1ee14 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1219,6 +1219,15 @@ static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp)
#define TCP_INFINITE_SSTHRESH 0x7fffffff
+/* Default and maximum snd_cwnd_clamp, in packets.
+ * A peer can not advertise more than 65535 << 14 bytes, so a larger
+ * cwnd is useless with any MSS of 1024 bytes or more.
+ * Congestion control modules multiply cwnd by u32 factors up to 2047
+ * (cwnd * (BICTCP_BETA_SCALE + beta) in CUBIC), and CUBIC's
+ * bictcp_update() expects cwnd to stay below about one million packets.
+ */
+#define TCP_MAX_SND_CWND (1U << 20)
+
static inline u32 tcp_snd_cwnd(const struct tcp_sock *tp)
{
return tp->snd_cwnd;
diff --git a/net/core/filter.c b/net/core/filter.c
index 34713be30ac5a..356bf50afabea 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -5374,11 +5374,12 @@ static int bpf_sol_tcp_setsockopt(struct sock *sk, int optname,
case TCP_BPF_IW:
if (val <= 0 || tp->data_segs_out > tp->syn_data)
return -EINVAL;
- tcp_snd_cwnd_set(tp, val);
+ tcp_snd_cwnd_set(tp, min_t(u32, val, tp->snd_cwnd_clamp));
break;
case TCP_BPF_SNDCWND_CLAMP:
if (val <= 0)
return -EINVAL;
+ val = min_t(u32, val, TCP_MAX_SND_CWND);
tp->snd_cwnd_clamp = val;
tp->snd_ssthresh = val;
break;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index a427a6ceec136..f5db8eabb8258 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -442,7 +442,7 @@ void tcp_init_sock(struct sock *sk)
* initialization of these values.
*/
tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
- tp->snd_cwnd_clamp = ~0;
+ tp->snd_cwnd_clamp = TCP_MAX_SND_CWND;
tp->mss_cache = TCP_MSS_DEFAULT;
tp->reordering = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reordering);
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index d28ef811f0efa..13a73b1b7a61f 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -495,7 +495,8 @@ void tcp_init_metrics(struct sock *sk)
}
if (tcp_metric_locked(tm, TCP_METRIC_CWND))
- tp->snd_cwnd_clamp = tcp_metric_get(tm, TCP_METRIC_CWND);
+ tp->snd_cwnd_clamp = min(tcp_metric_get(tm, TCP_METRIC_CWND),
+ TCP_MAX_SND_CWND);
val = READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) ?
0 : tcp_metric_get(tm, TCP_METRIC_SSTHRESH);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0191/1167] net/mlx5e: TC, Fix double free of branch in failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (189 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0190/1167] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0192/1167] locking/osq_lock: Clarify osq_wait_next() calling convention Greg Kroah-Hartman
` (466 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Fourier, Tariq Toukan,
Dave Miller, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Fourier <fourier.thomas@gmail.com>
[ Upstream commit 31f9b43a3bb3d2201eadd147440252d0912dab21 ]
When allocating the false branch fails in parse_branch_ctrl(), the
already allocated true branch is freed but attr->branch_true is left
pointing to it. The caller parse_tc_actions() fails the flow, and
free_flow_post_acts(), mlx5_free_flow_attr_actions() which calls again
free_branch_attr() on attr->branch_true.
Clear the pointer after freeing it.
This bug is theoretical and was compile tested only.
Fixes: f86488cb4685 ("net/mlx5e: TC, initialize branch flow attributes")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Tested-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 8c52bbeabb7e0..00e269b2bc86a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -3893,6 +3893,7 @@ parse_branch_ctrl(struct flow_action_entry *act, struct mlx5e_tc_act *tc_act,
err_branch_false:
free_branch_attr(flow, attr->branch_true);
+ attr->branch_true = NULL;
out_err:
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0192/1167] locking/osq_lock: Clarify osq_wait_next() calling convention
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (190 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0191/1167] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0193/1167] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
` (465 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Laight, Linus Torvalds,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Laight <David.Laight@ACULAB.COM>
[ Upstream commit 563adbfc351b2af9f1406b809ba60b9f1673a882 ]
osq_wait_next() is passed 'prev' from osq_lock() and NULL from
osq_unlock() but only needs the 'cpu' value to write to lock->tail.
Just pass prev->cpu or OSQ_UNLOCKED_VAL instead.
Should have no effect on the generated code since gcc manages to assume
that 'prev != NULL' due to an earlier dereference.
Signed-off-by: David Laight <david.laight@aculab.com>
[ Changed 'old' to 'old_cpu' by request from Waiman Long - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stable-dep-of: 1b9e01fcc47a ("locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/locking/osq_lock.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c
index d5610ad52b92b..ebb1493915ce9 100644
--- a/kernel/locking/osq_lock.c
+++ b/kernel/locking/osq_lock.c
@@ -37,26 +37,23 @@ static inline struct optimistic_spin_node *decode_cpu(int encoded_cpu_val)
/*
* Get a stable @node->next pointer, either for unlock() or unqueue() purposes.
* Can return NULL in case we were the last queued and we updated @lock instead.
+ *
+ * If osq_lock() is being cancelled there must be a previous node
+ * and 'old_cpu' is its CPU #.
+ * For osq_unlock() there is never a previous node and old_cpu is
+ * set to OSQ_UNLOCKED_VAL.
*/
static inline struct optimistic_spin_node *
osq_wait_next(struct optimistic_spin_queue *lock,
struct optimistic_spin_node *node,
- struct optimistic_spin_node *prev)
+ int old_cpu)
{
struct optimistic_spin_node *next = NULL;
int curr = encode_cpu(smp_processor_id());
- int old;
-
- /*
- * If there is a prev node in queue, then the 'old' value will be
- * the prev node's CPU #, else it's set to OSQ_UNLOCKED_VAL since if
- * we're currently last in queue, then the queue will then become empty.
- */
- old = prev ? prev->cpu : OSQ_UNLOCKED_VAL;
for (;;) {
if (atomic_read(&lock->tail) == curr &&
- atomic_cmpxchg_acquire(&lock->tail, curr, old) == curr) {
+ atomic_cmpxchg_acquire(&lock->tail, curr, old_cpu) == curr) {
/*
* We were the last queued, we moved @lock back. @prev
* will now observe @lock and will complete its
@@ -186,7 +183,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
* back to @prev.
*/
- next = osq_wait_next(lock, node, prev);
+ next = osq_wait_next(lock, node, prev->cpu);
if (!next)
return false;
@@ -226,7 +223,7 @@ void osq_unlock(struct optimistic_spin_queue *lock)
return;
}
- next = osq_wait_next(lock, node, NULL);
+ next = osq_wait_next(lock, node, OSQ_UNLOCKED_VAL);
if (next)
WRITE_ONCE(next->locked, 1);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0193/1167] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (191 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0192/1167] locking/osq_lock: Clarify osq_wait_next() calling convention Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0194/1167] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
` (464 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Laight, Peter Zijlstra (Intel),
Ingo Molnar, Linus Torvalds, Waiman Long, linux-kernel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 1b9e01fcc47aff00d2fd64693c5dcd620eff5865 ]
The atomic_cmpxchg() in osq_wait_next() removes the current CPU's node
from the tail of the queue and puts @old_cpu back.
This is very much like an 'unlock', which is RELEASE, rather than
ACQUIRE.
Additionally, on success (the only case where the ordering is
effective), this returns NULL which means both callsites will do nothing
more, there are no subsequent operations to order against.
Furthermore, the osq_lock() caller will then return false, indicating
failure to acquire -- the mutex must go block. Again, not making a case
for ACQUIRE. Neither atomics nor locks provide ordering on failure.
Since ACQUIRE makes no sense, while RELEASE makes it more symmetric with
osq_unlock(), switch the ordering. This then makes osq_unlock()
consistently RELEASE.
Fixes: c55a6ffa6285 ("locking/osq: Relax atomic semantics")
Suggested-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Waiman Long <longman@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/locking/osq_lock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c
index ebb1493915ce9..b3748ed287ebb 100644
--- a/kernel/locking/osq_lock.c
+++ b/kernel/locking/osq_lock.c
@@ -53,7 +53,7 @@ osq_wait_next(struct optimistic_spin_queue *lock,
for (;;) {
if (atomic_read(&lock->tail) == curr &&
- atomic_cmpxchg_acquire(&lock->tail, curr, old_cpu) == curr) {
+ atomic_cmpxchg_release(&lock->tail, curr, old_cpu) == curr) {
/*
* We were the last queued, we moved @lock back. @prev
* will now observe @lock and will complete its
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0194/1167] locking/osq: Fix unlink queue corruption
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (192 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0193/1167] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0195/1167] perf/x86/amd/uncore: Move discovery and registration Greg Kroah-Hartman
` (463 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Laight, Peter Zijlstra (Intel),
Ingo Molnar, Linus Torvalds, Waiman Long, linux-kernel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 408b129aac48b574c0c9d11137a89eefba825d5d ]
Very similar to commit 50972fe78f24 ("locking/osq_lock: Fix osq_lock
queue corruption"), make sure to order the prev->next store against
the next->prev store.
Fixes: 50972fe78f24 ("locking/osq_lock: Fix osq_lock queue corruption")
Suggested-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Waiman Long <longman@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/locking/osq_lock.c | 60 +++++++++++++++++++++++++++++----------
1 file changed, 45 insertions(+), 15 deletions(-)
diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c
index b3748ed287ebb..29597052f442c 100644
--- a/kernel/locking/osq_lock.c
+++ b/kernel/locking/osq_lock.c
@@ -84,6 +84,49 @@ osq_wait_next(struct optimistic_spin_queue *lock,
return next;
}
+/*
+ * Set prev->next; this is the counterpart of osq_wait_next() in that
+ * by setting ->next the wait is terminated and progress is resumed.
+ */
+static inline void osq_link_next(struct optimistic_spin_node *prev,
+ struct optimistic_spin_node *next)
+{
+ /*
+ * Suppose:
+ *
+ * tail
+ * |
+ * V
+ * CPU1 -> CPU2 -> CPU3:
+ * n: 2 n: 3 n: nil
+ * p: nil p: 1 p: 2
+ *
+ * And this is CPU2 doing the self-unqueue concurrent against CPU1s
+ * unlock()/unqueue(). Since 'prev->next == NULL' and CPU1 will be
+ * stuck in osq_wait_next() until the below store of 'prev->next'.
+ *
+ * CPU2 CPU1
+ *
+ * next->prev = prev; osq_wait_next()
+ * WMB MB
+ * prev->next = next; next->prev = prev
+ *
+ * Without the WMB it would be possible to have conflicting stores
+ * like:
+ *
+ * CPU2 CPU1
+ *
+ * prev->next = next // CPU1.n = 3
+ * next = osq_wait_next() // = 3
+ * next->prev = prev // CPU3.p = nil
+ * next->prev = prev // CPU3.p = 1
+ *
+ * Which would result in list corruption.
+ */
+ smp_wmb();
+ WRITE_ONCE(prev->next, next);
+}
+
bool osq_lock(struct optimistic_spin_queue *lock)
{
struct optimistic_spin_node *node = this_cpu_ptr(&osq_node);
@@ -107,20 +150,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
prev = decode_cpu(old);
node->prev = prev;
-
- /*
- * osq_lock() unqueue
- *
- * node->prev = prev osq_wait_next()
- * WMB MB
- * prev->next = node next->prev = prev // unqueue-C
- *
- * Here 'node->prev' and 'next->prev' are the same variable and we need
- * to ensure these stores happen in-order to avoid corrupting the list.
- */
- smp_wmb();
-
- WRITE_ONCE(prev->next, node);
+ osq_link_next(prev, node);
/*
* Normally @prev is untouchable after the above store; because at that
@@ -196,7 +226,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
*/
WRITE_ONCE(next->prev, prev);
- WRITE_ONCE(prev->next, next);
+ osq_link_next(prev, next);
return false;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0195/1167] perf/x86/amd/uncore: Move discovery and registration
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (193 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0194/1167] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0196/1167] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
` (462 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sandipan Das, Peter Zijlstra (Intel),
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sandipan Das <sandipan.das@amd.com>
[ Upstream commit 07888daa056e809de0b6b234116b575c11f9f99d ]
Uncore PMUs have traditionally been registered in the module init path.
This is fine for the existing DF and L3 PMUs since the CPUID information
does not vary across CPUs but not for the memory controller (UMC) PMUs
since information like active memory channels can vary for each socket
depending on how the DIMMs have been physically populated.
To overcome this, the discovery of PMU information using CPUID is moved
to the startup of UNCORE_STARTING. This cannot be done in the startup of
UNCORE_PREP since the hotplug callback does not run on the CPU that is
being brought online.
Previously, the startup of UNCORE_PREP was used for allocating uncore
contexts following which, the startup of UNCORE_STARTING was used to
find and reuse an existing sibling context, if possible. Any unused
contexts were added to a list for reclaimation later during the startup
of UNCORE_ONLINE.
Since all required CPUID info is now available only after the startup of
UNCORE_STARTING has completed, context allocation has been moved to the
startup of UNCORE_ONLINE. Before allocating contexts, the first CPU that
comes online has to take up the additional responsibility of registering
the PMUs. This is a one-time process though. Since sibling discovery now
happens prior to deciding whether a new context is required, there is no
longer a need to track and free up unused contexts.
The teardown of UNCORE_ONLINE and UNCORE_PREP functionally remain the
same.
Overall, the flow of control described above is achieved using the
following handlers for managing uncore PMUs. It is mandatory to define
them for each type of uncore PMU.
* scan() runs during startup of UNCORE_STARTING and collects PMU info
using CPUID.
* init() runs during startup of UNCORE_ONLINE, registers PMUs and sets
up uncore contexts.
* move() runs during teardown of UNCORE_ONLINE and migrates uncore
contexts to a shared sibling, if possible.
* free() runs during teardown of UNCORE_PREP and frees up uncore
contexts.
Signed-off-by: Sandipan Das <sandipan.das@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/e6c447e48872fcab8452e0dd81b1c9cb09f39eb4.1696425185.git.sandipan.das@amd.com
Stable-dep-of: 0ae655bce193 ("perf/x86/amd/uncore: Avoid context migration from non-owners")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/events/amd/uncore.c | 494 +++++++++++++++++++++--------------
1 file changed, 305 insertions(+), 189 deletions(-)
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index 33ccd42328207..f24122c41c430 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -26,8 +26,6 @@
#define RDPMC_BASE_LLC 10
#define COUNTER_SHIFT 16
-
-#define NUM_UNCORES_MAX 2 /* DF (or NB) and L3 (or L2) */
#define UNCORE_NAME_LEN 16
#undef pr_fmt
@@ -35,10 +33,7 @@
static int pmu_version;
-static HLIST_HEAD(uncore_unused_list);
-
struct amd_uncore_ctx {
- int id;
int refcnt;
int cpu;
struct perf_event **events;
@@ -53,11 +48,36 @@ struct amd_uncore_pmu {
cpumask_t active_mask;
struct pmu pmu;
struct amd_uncore_ctx * __percpu *ctx;
- int (*id)(unsigned int cpu);
};
-static struct amd_uncore_pmu pmus[NUM_UNCORES_MAX];
-static int num_pmus __read_mostly;
+enum {
+ UNCORE_TYPE_DF,
+ UNCORE_TYPE_L3,
+
+ UNCORE_TYPE_MAX
+};
+
+union amd_uncore_info {
+ struct {
+ u64 aux_data:32; /* auxiliary data */
+ u64 num_pmcs:8; /* number of counters */
+ u64 cid:8; /* context id */
+ } split;
+ u64 full;
+};
+
+struct amd_uncore {
+ union amd_uncore_info * __percpu info;
+ struct amd_uncore_pmu *pmus;
+ unsigned int num_pmus;
+ bool init_done;
+ void (*scan)(struct amd_uncore *uncore, unsigned int cpu);
+ int (*init)(struct amd_uncore *uncore, unsigned int cpu);
+ void (*move)(struct amd_uncore *uncore, unsigned int cpu);
+ void (*free)(struct amd_uncore *uncore, unsigned int cpu);
+};
+
+static struct amd_uncore uncores[UNCORE_TYPE_MAX];
static struct amd_uncore_pmu *event_to_amd_uncore_pmu(struct perf_event *event)
{
@@ -363,182 +383,192 @@ static const struct attribute_group *amd_uncore_l3_attr_update[] = {
NULL,
};
-static int amd_uncore_cpu_up_prepare(unsigned int cpu)
+static __always_inline
+int amd_uncore_ctx_cid(struct amd_uncore *uncore, unsigned int cpu)
{
- struct amd_uncore_pmu *pmu;
- struct amd_uncore_ctx *ctx;
- int node = cpu_to_node(cpu), i;
-
- for (i = 0; i < num_pmus; i++) {
- pmu = &pmus[i];
- *per_cpu_ptr(pmu->ctx, cpu) = NULL;
- ctx = kzalloc_node(sizeof(struct amd_uncore_ctx), GFP_KERNEL,
- node);
- if (!ctx)
- goto fail;
-
- ctx->cpu = cpu;
- ctx->events = kzalloc_node(sizeof(struct perf_event *) *
- pmu->num_counters, GFP_KERNEL,
- node);
- if (!ctx->events)
- goto fail;
-
- ctx->id = -1;
- *per_cpu_ptr(pmu->ctx, cpu) = ctx;
- }
-
- return 0;
-
-fail:
- /* Rollback */
- for (; i >= 0; i--) {
- pmu = &pmus[i];
- ctx = *per_cpu_ptr(pmu->ctx, cpu);
- if (!ctx)
- continue;
-
- kfree(ctx->events);
- kfree(ctx);
- }
+ union amd_uncore_info *info = per_cpu_ptr(uncore->info, cpu);
+ return info->split.cid;
+}
- return -ENOMEM;
+static __always_inline
+int amd_uncore_ctx_num_pmcs(struct amd_uncore *uncore, unsigned int cpu)
+{
+ union amd_uncore_info *info = per_cpu_ptr(uncore->info, cpu);
+ return info->split.num_pmcs;
}
-static struct amd_uncore_ctx *
-amd_uncore_find_online_sibling(struct amd_uncore_ctx *this,
- struct amd_uncore_pmu *pmu)
+static void amd_uncore_ctx_free(struct amd_uncore *uncore, unsigned int cpu)
{
- unsigned int cpu;
- struct amd_uncore_ctx *that;
+ struct amd_uncore_pmu *pmu;
+ struct amd_uncore_ctx *ctx;
+ int i;
- for_each_online_cpu(cpu) {
- that = *per_cpu_ptr(pmu->ctx, cpu);
+ if (!uncore->init_done)
+ return;
- if (!that)
+ for (i = 0; i < uncore->num_pmus; i++) {
+ pmu = &uncore->pmus[i];
+ ctx = *per_cpu_ptr(pmu->ctx, cpu);
+ if (!ctx)
continue;
- if (this == that)
- continue;
+ if (cpu == ctx->cpu)
+ cpumask_clear_cpu(cpu, &pmu->active_mask);
- if (this->id == that->id) {
- hlist_add_head(&this->node, &uncore_unused_list);
- this = that;
- break;
+ if (!--ctx->refcnt) {
+ kfree(ctx->events);
+ kfree(ctx);
}
- }
- this->refcnt++;
- return this;
+ *per_cpu_ptr(pmu->ctx, cpu) = NULL;
+ }
}
-static int amd_uncore_cpu_starting(unsigned int cpu)
+static int amd_uncore_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
{
+ struct amd_uncore_ctx *curr, *prev;
struct amd_uncore_pmu *pmu;
- struct amd_uncore_ctx *ctx;
- int i;
+ int node, cid, i, j;
- for (i = 0; i < num_pmus; i++) {
- pmu = &pmus[i];
- ctx = *per_cpu_ptr(pmu->ctx, cpu);
- ctx->id = pmu->id(cpu);
- ctx = amd_uncore_find_online_sibling(ctx, pmu);
- *per_cpu_ptr(pmu->ctx, cpu) = ctx;
- }
+ if (!uncore->init_done || !uncore->num_pmus)
+ return 0;
- return 0;
-}
+ cid = amd_uncore_ctx_cid(uncore, cpu);
-static void uncore_clean_online(void)
-{
- struct amd_uncore_ctx *ctx;
- struct hlist_node *n;
+ for (i = 0; i < uncore->num_pmus; i++) {
+ pmu = &uncore->pmus[i];
+ *per_cpu_ptr(pmu->ctx, cpu) = NULL;
+ curr = NULL;
- hlist_for_each_entry_safe(ctx, n, &uncore_unused_list, node) {
- hlist_del(&ctx->node);
- kfree(ctx->events);
- kfree(ctx);
- }
-}
+ /* Find a sibling context */
+ for_each_online_cpu(j) {
+ if (cpu == j)
+ continue;
-static int amd_uncore_cpu_online(unsigned int cpu)
-{
- struct amd_uncore_pmu *pmu;
- struct amd_uncore_ctx *ctx;
- int i;
+ prev = *per_cpu_ptr(pmu->ctx, j);
+ if (!prev)
+ continue;
- uncore_clean_online();
+ if (cid == amd_uncore_ctx_cid(uncore, j)) {
+ curr = prev;
+ break;
+ }
+ }
+
+ /* Allocate context if sibling does not exist */
+ if (!curr) {
+ node = cpu_to_node(cpu);
+ curr = kzalloc_node(sizeof(*curr), GFP_KERNEL, node);
+ if (!curr)
+ goto fail;
+
+ curr->cpu = cpu;
+ curr->events = kzalloc_node(sizeof(*curr->events) *
+ pmu->num_counters,
+ GFP_KERNEL, node);
+ if (!curr->events) {
+ kfree(curr);
+ goto fail;
+ }
- for (i = 0; i < num_pmus; i++) {
- pmu = &pmus[i];
- ctx = *per_cpu_ptr(pmu->ctx, cpu);
- if (cpu == ctx->cpu)
cpumask_set_cpu(cpu, &pmu->active_mask);
+ }
+
+ curr->refcnt++;
+ *per_cpu_ptr(pmu->ctx, cpu) = curr;
}
return 0;
+
+fail:
+ amd_uncore_ctx_free(uncore, cpu);
+
+ return -ENOMEM;
}
-static int amd_uncore_cpu_down_prepare(unsigned int cpu)
+static void amd_uncore_ctx_move(struct amd_uncore *uncore, unsigned int cpu)
{
- struct amd_uncore_ctx *this, *that;
+ struct amd_uncore_ctx *curr, *next;
struct amd_uncore_pmu *pmu;
int i, j;
- for (i = 0; i < num_pmus; i++) {
- pmu = &pmus[i];
- this = *per_cpu_ptr(pmu->ctx, cpu);
+ if (!uncore->init_done)
+ return;
- /* this cpu is going down, migrate to a shared sibling if possible */
- for_each_online_cpu(j) {
- that = *per_cpu_ptr(pmu->ctx, j);
+ for (i = 0; i < uncore->num_pmus; i++) {
+ pmu = &uncore->pmus[i];
+ curr = *per_cpu_ptr(pmu->ctx, cpu);
+ if (!curr)
+ continue;
- if (cpu == j)
+ /* Migrate to a shared sibling if possible */
+ for_each_online_cpu(j) {
+ next = *per_cpu_ptr(pmu->ctx, j);
+ if (!next || cpu == j)
continue;
- if (this == that) {
+ if (curr == next) {
perf_pmu_migrate_context(&pmu->pmu, cpu, j);
cpumask_clear_cpu(cpu, &pmu->active_mask);
cpumask_set_cpu(j, &pmu->active_mask);
- that->cpu = j;
+ next->cpu = j;
break;
}
}
}
+}
+
+static int amd_uncore_cpu_starting(unsigned int cpu)
+{
+ struct amd_uncore *uncore;
+ int i;
+
+ for (i = 0; i < UNCORE_TYPE_MAX; i++) {
+ uncore = &uncores[i];
+ uncore->scan(uncore, cpu);
+ }
return 0;
}
-static int amd_uncore_cpu_dead(unsigned int cpu)
+static int amd_uncore_cpu_online(unsigned int cpu)
{
- struct amd_uncore_ctx *ctx;
- struct amd_uncore_pmu *pmu;
+ struct amd_uncore *uncore;
int i;
- for (i = 0; i < num_pmus; i++) {
- pmu = &pmus[i];
- ctx = *per_cpu_ptr(pmu->ctx, cpu);
- if (cpu == ctx->cpu)
- cpumask_clear_cpu(cpu, &pmu->active_mask);
+ for (i = 0; i < UNCORE_TYPE_MAX; i++) {
+ uncore = &uncores[i];
+ if (uncore->init(uncore, cpu))
+ break;
+ }
- if (!--ctx->refcnt) {
- kfree(ctx->events);
- kfree(ctx);
- }
+ return 0;
+}
- *per_cpu_ptr(pmu->ctx, cpu) = NULL;
+static int amd_uncore_cpu_down_prepare(unsigned int cpu)
+{
+ struct amd_uncore *uncore;
+ int i;
+
+ for (i = 0; i < UNCORE_TYPE_MAX; i++) {
+ uncore = &uncores[i];
+ uncore->move(uncore, cpu);
}
return 0;
}
-static int amd_uncore_df_id(unsigned int cpu)
+static int amd_uncore_cpu_dead(unsigned int cpu)
{
- unsigned int eax, ebx, ecx, edx;
+ struct amd_uncore *uncore;
+ int i;
- cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
+ for (i = 0; i < UNCORE_TYPE_MAX; i++) {
+ uncore = &uncores[i];
+ uncore->free(uncore, cpu);
+ }
- return ecx & 0xff;
+ return 0;
}
static int amd_uncore_df_event_init(struct perf_event *event)
@@ -578,41 +608,66 @@ static int amd_uncore_df_add(struct perf_event *event, int flags)
return 0;
}
-static int amd_uncore_df_init(void)
+static
+void amd_uncore_df_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
{
- struct attribute **df_attr = amd_uncore_df_format_attr;
- struct amd_uncore_pmu *pmu = &pmus[num_pmus];
union cpuid_0x80000022_ebx ebx;
- int ret;
+ union amd_uncore_info info;
if (!boot_cpu_has(X86_FEATURE_PERFCTR_NB))
- return 0;
+ return;
+
+ info.split.aux_data = 0;
+ info.split.num_pmcs = NUM_COUNTERS_NB;
+ info.split.cid = topology_die_id(cpu);
+
+ if (pmu_version >= 2) {
+ ebx.full = cpuid_ebx(EXT_PERFMON_DEBUG_FEATURES);
+ info.split.num_pmcs = ebx.split.num_df_pmc;
+ }
+
+ *per_cpu_ptr(uncore->info, cpu) = info;
+}
+
+static
+int amd_uncore_df_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
+{
+ struct attribute **df_attr = amd_uncore_df_format_attr;
+ struct amd_uncore_pmu *pmu;
+
+ /* Run just once */
+ if (uncore->init_done)
+ return amd_uncore_ctx_init(uncore, cpu);
+
+ /* No grouping, single instance for a system */
+ uncore->pmus = kzalloc(sizeof(*uncore->pmus), GFP_KERNEL);
+ if (!uncore->pmus) {
+ uncore->num_pmus = 0;
+ goto done;
+ }
/*
* For Family 17h and above, the Northbridge counters are repurposed
* as Data Fabric counters. The PMUs are exported based on family as
* either NB or DF.
*/
+ pmu = &uncore->pmus[0];
strscpy(pmu->name, boot_cpu_data.x86 >= 0x17 ? "amd_df" : "amd_nb",
sizeof(pmu->name));
-
- pmu->num_counters = NUM_COUNTERS_NB;
+ pmu->num_counters = amd_uncore_ctx_num_pmcs(uncore, cpu);
pmu->msr_base = MSR_F15H_NB_PERF_CTL;
pmu->rdpmc_base = RDPMC_BASE_NB;
- pmu->id = amd_uncore_df_id;
if (pmu_version >= 2) {
*df_attr++ = &format_attr_event14v2.attr;
*df_attr++ = &format_attr_umask12.attr;
- ebx.full = cpuid_ebx(EXT_PERFMON_DEBUG_FEATURES);
- pmu->num_counters = ebx.split.num_df_pmc;
} else if (boot_cpu_data.x86 >= 0x17) {
*df_attr = &format_attr_event14.attr;
}
pmu->ctx = alloc_percpu(struct amd_uncore_ctx *);
if (!pmu->ctx)
- return -ENOMEM;
+ goto done;
pmu->pmu = (struct pmu) {
.task_ctx_nr = perf_invalid_context,
@@ -628,25 +683,22 @@ static int amd_uncore_df_init(void)
.module = THIS_MODULE,
};
- ret = perf_pmu_register(&pmu->pmu, pmu->pmu.name, -1);
- if (ret) {
+ if (perf_pmu_register(&pmu->pmu, pmu->pmu.name, -1)) {
free_percpu(pmu->ctx);
pmu->ctx = NULL;
- return ret;
+ goto done;
}
- pr_info("%d %s %s counters detected\n", pmu->num_counters,
- boot_cpu_data.x86_vendor == X86_VENDOR_HYGON ? "HYGON" : "",
+ pr_info("%d %s%s counters detected\n", pmu->num_counters,
+ boot_cpu_data.x86_vendor == X86_VENDOR_HYGON ? "HYGON " : "",
pmu->pmu.name);
- num_pmus++;
+ uncore->num_pmus = 1;
- return 0;
-}
+done:
+ uncore->init_done = true;
-static int amd_uncore_l3_id(unsigned int cpu)
-{
- return get_llc_id(cpu);
+ return amd_uncore_ctx_init(uncore, cpu);
}
static int amd_uncore_l3_event_init(struct perf_event *event)
@@ -688,27 +740,52 @@ static int amd_uncore_l3_event_init(struct perf_event *event)
return 0;
}
-static int amd_uncore_l3_init(void)
+static
+void amd_uncore_l3_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
{
- struct attribute **l3_attr = amd_uncore_l3_format_attr;
- struct amd_uncore_pmu *pmu = &pmus[num_pmus];
- int ret;
+ union amd_uncore_info info;
if (!boot_cpu_has(X86_FEATURE_PERFCTR_LLC))
- return 0;
+ return;
+
+ info.split.aux_data = 0;
+ info.split.num_pmcs = NUM_COUNTERS_L2;
+ info.split.cid = get_llc_id(cpu);
+
+ if (boot_cpu_data.x86 >= 0x17)
+ info.split.num_pmcs = NUM_COUNTERS_L3;
+
+ *per_cpu_ptr(uncore->info, cpu) = info;
+}
+
+static
+int amd_uncore_l3_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
+{
+ struct attribute **l3_attr = amd_uncore_l3_format_attr;
+ struct amd_uncore_pmu *pmu;
+
+ /* Run just once */
+ if (uncore->init_done)
+ return amd_uncore_ctx_init(uncore, cpu);
+
+ /* No grouping, single instance for a system */
+ uncore->pmus = kzalloc(sizeof(*uncore->pmus), GFP_KERNEL);
+ if (!uncore->pmus) {
+ uncore->num_pmus = 0;
+ goto done;
+ }
/*
* For Family 17h and above, L3 cache counters are available instead
* of L2 cache counters. The PMUs are exported based on family as
* either L2 or L3.
*/
+ pmu = &uncore->pmus[0];
strscpy(pmu->name, boot_cpu_data.x86 >= 0x17 ? "amd_l3" : "amd_l2",
sizeof(pmu->name));
-
- pmu->num_counters = NUM_COUNTERS_L2;
+ pmu->num_counters = amd_uncore_ctx_num_pmcs(uncore, cpu);
pmu->msr_base = MSR_F16H_L2I_PERF_CTL;
pmu->rdpmc_base = RDPMC_BASE_LLC;
- pmu->id = amd_uncore_l3_id;
if (boot_cpu_data.x86 >= 0x17) {
*l3_attr++ = &format_attr_event8.attr;
@@ -716,12 +793,11 @@ static int amd_uncore_l3_init(void)
*l3_attr++ = boot_cpu_data.x86 >= 0x19 ?
&format_attr_threadmask2.attr :
&format_attr_threadmask8.attr;
- pmu->num_counters = NUM_COUNTERS_L3;
}
pmu->ctx = alloc_percpu(struct amd_uncore_ctx *);
if (!pmu->ctx)
- return -ENOMEM;
+ goto done;
pmu->pmu = (struct pmu) {
.task_ctx_nr = perf_invalid_context,
@@ -738,43 +814,45 @@ static int amd_uncore_l3_init(void)
.module = THIS_MODULE,
};
- ret = perf_pmu_register(&pmu->pmu, pmu->pmu.name, -1);
- if (ret) {
+ if (perf_pmu_register(&pmu->pmu, pmu->pmu.name, -1)) {
free_percpu(pmu->ctx);
pmu->ctx = NULL;
- return ret;
+ goto done;
}
- pr_info("%d %s %s counters detected\n", pmu->num_counters,
- boot_cpu_data.x86_vendor == X86_VENDOR_HYGON ? "HYGON" : "",
+ pr_info("%d %s%s counters detected\n", pmu->num_counters,
+ boot_cpu_data.x86_vendor == X86_VENDOR_HYGON ? "HYGON " : "",
pmu->pmu.name);
- num_pmus++;
-
- return 0;
-}
-
-static void uncore_free(void)
-{
- struct amd_uncore_pmu *pmu;
- int i;
+ uncore->num_pmus = 1;
- for (i = 0; i < num_pmus; i++) {
- pmu = &pmus[i];
- if (!pmu->ctx)
- continue;
-
- perf_pmu_unregister(&pmu->pmu);
- free_percpu(pmu->ctx);
- pmu->ctx = NULL;
- }
+done:
+ uncore->init_done = true;
- num_pmus = 0;
+ return amd_uncore_ctx_init(uncore, cpu);
}
+static struct amd_uncore uncores[UNCORE_TYPE_MAX] = {
+ /* UNCORE_TYPE_DF */
+ {
+ .scan = amd_uncore_df_ctx_scan,
+ .init = amd_uncore_df_ctx_init,
+ .move = amd_uncore_ctx_move,
+ .free = amd_uncore_ctx_free,
+ },
+ /* UNCORE_TYPE_L3 */
+ {
+ .scan = amd_uncore_l3_ctx_scan,
+ .init = amd_uncore_l3_ctx_init,
+ .move = amd_uncore_ctx_move,
+ .free = amd_uncore_ctx_free,
+ },
+};
+
static int __init amd_uncore_init(void)
{
- int ret;
+ struct amd_uncore *uncore;
+ int ret, i;
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)
@@ -786,20 +864,27 @@ static int __init amd_uncore_init(void)
if (boot_cpu_has(X86_FEATURE_PERFMON_V2))
pmu_version = 2;
- ret = amd_uncore_df_init();
- if (ret)
- goto fail;
+ for (i = 0; i < UNCORE_TYPE_MAX; i++) {
+ uncore = &uncores[i];
- ret = amd_uncore_l3_init();
- if (ret)
- goto fail;
+ BUG_ON(!uncore->scan);
+ BUG_ON(!uncore->init);
+ BUG_ON(!uncore->move);
+ BUG_ON(!uncore->free);
+
+ uncore->info = alloc_percpu(union amd_uncore_info);
+ if (!uncore->info) {
+ ret = -ENOMEM;
+ goto fail;
+ }
+ };
/*
* Install callbacks. Core will call them for each online cpu.
*/
if (cpuhp_setup_state(CPUHP_PERF_X86_AMD_UNCORE_PREP,
"perf/x86/amd/uncore:prepare",
- amd_uncore_cpu_up_prepare, amd_uncore_cpu_dead))
+ NULL, amd_uncore_cpu_dead))
goto fail;
if (cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
@@ -818,17 +903,48 @@ static int __init amd_uncore_init(void)
fail_prep:
cpuhp_remove_state(CPUHP_PERF_X86_AMD_UNCORE_PREP);
fail:
- uncore_free();
+ for (i = 0; i < UNCORE_TYPE_MAX; i++) {
+ uncore = &uncores[i];
+ if (uncore->info) {
+ free_percpu(uncore->info);
+ uncore->info = NULL;
+ }
+ }
return ret;
}
static void __exit amd_uncore_exit(void)
{
+ struct amd_uncore *uncore;
+ struct amd_uncore_pmu *pmu;
+ int i, j;
+
cpuhp_remove_state(CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE);
cpuhp_remove_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING);
cpuhp_remove_state(CPUHP_PERF_X86_AMD_UNCORE_PREP);
- uncore_free();
+
+ for (i = 0; i < UNCORE_TYPE_MAX; i++) {
+ uncore = &uncores[i];
+ if (!uncore->info)
+ continue;
+
+ free_percpu(uncore->info);
+ uncore->info = NULL;
+
+ for (j = 0; j < uncore->num_pmus; j++) {
+ pmu = &uncore->pmus[j];
+ if (!pmu->ctx)
+ continue;
+
+ perf_pmu_unregister(&pmu->pmu);
+ free_percpu(pmu->ctx);
+ pmu->ctx = NULL;
+ }
+
+ kfree(uncore->pmus);
+ uncore->pmus = NULL;
+ }
}
module_init(amd_uncore_init);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0196/1167] perf/x86/amd/uncore: Avoid context migration from non-owners
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (194 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0195/1167] perf/x86/amd/uncore: Move discovery and registration Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0197/1167] cpufreq: make cpufreq_boost_enabled() return bool Greg Kroah-Hartman
` (461 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sandipan Das, Peter Zijlstra (Intel),
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sandipan Das <sandipan.das@amd.com>
[ Upstream commit 0ae655bce1934857fa3e316ddcb4be38c30dbd38 ]
Each uncore context is owned by a single CPU that hosts all events for
the corresponding uncore domain and is advertised through the sysfs
cpumask attribute. When a CPU goes offline, the context is migrated to
an online sibling if the departing CPU is the owner.
Before commit d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore
management"), uncore_down_prepare() checked whether the CPU going
offline owned the context. The check was lost when the function was
replaced by amd_uncore_ctx_move(). Hence, when a CPU that is not the
owner goes offline, ownership is always handed over to the first online
sibling in the uncore domain irrespective of whether another sibling
already owns it. This goes unnoticed as long as the owner is the
lowest-numbered online CPU in the domain, since the first online
sibling is then the owner itself. Once ownership has moved, that no
longer holds.
For example, consider an L3 domain spanning CPUs 8-15,136-143 and owned
by CPU 8.
$ cat /sys/bus/event_source/devices/amd_l3/cpumask
0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120
$ echo 0 | sudo tee /sys/devices/system/cpu/cpu8/online
$ cat /sys/bus/event_source/devices/amd_l3/cpumask
0,9,16,24,32,40,48,56,64,72,80,88,96,104,112,120
$ echo 1 | sudo tee /sys/devices/system/cpu/cpu8/online
$ cat /sys/bus/event_source/devices/amd_l3/cpumask
0,9,16,24,32,40,48,56,64,72,80,88,96,104,112,120
$ echo 0 | sudo tee /sys/devices/system/cpu/cpu10/online
$ cat /sys/bus/event_source/devices/amd_l3/cpumask
0,8-9,16,24,32,40,48,56,64,72,80,88,96,104,112,120
Offlining CPU 8 correctly moves ownership to CPU 9 and onlining it
again leaves CPU 9 as the owner. However, offlining CPU 10 then makes
CPU 8 the owner while existing events remain on CPU 9. Both CPUs are
now advertised for the same domain, so tools that open an event on
every CPU in the cpumask count the domain twice, and the context gets
modified from two CPUs without any synchronization.
Restore the ownership check that was lost during the refactor.
Fixes: d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore management")
Signed-off-by: Sandipan Das <sandipan.das@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/273135a6d33a40f442fb18e140a90689fae7cd32.1793614726.git.sandipan.das@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/events/amd/uncore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index f24122c41c430..80edb04c28c77 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -498,7 +498,7 @@ static void amd_uncore_ctx_move(struct amd_uncore *uncore, unsigned int cpu)
for (i = 0; i < uncore->num_pmus; i++) {
pmu = &uncore->pmus[i];
curr = *per_cpu_ptr(pmu->ctx, cpu);
- if (!curr)
+ if (!curr || curr->cpu != cpu)
continue;
/* Migrate to a shared sibling if possible */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0197/1167] cpufreq: make cpufreq_boost_enabled() return bool
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (195 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0196/1167] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0198/1167] cpufreq: staticize cpufreq_boost_trigger_state() Greg Kroah-Hartman
` (460 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dhruva Gole, Mario Limonciello,
Rafael J. Wysocki, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dhruva Gole <d-gole@ti.com>
[ Upstream commit 43c0226c9ba56ffebdef9a858dbcf6eb0d376291 ]
Since this function is supposed to return boost_enabled which is anyway
a bool type make sure that it's return value is also marked as bool.
This helps maintain better consistency in data types being used.
Signed-off-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20240627060117.1809477-1-d-gole@ti.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 3d5720dff09f ("cpufreq: Serialize global boost updates")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 2 +-
include/linux/cpufreq.h | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 7dfd152e802f3..fb4c02a6893bb 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2869,7 +2869,7 @@ int cpufreq_enable_boost_support(void)
}
EXPORT_SYMBOL_GPL(cpufreq_enable_boost_support);
-int cpufreq_boost_enabled(void)
+bool cpufreq_boost_enabled(void)
{
return cpufreq_driver->boost_enabled;
}
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 445b68efe49fe..afb7e1ef705dd 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -799,7 +799,7 @@ ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
#ifdef CONFIG_CPU_FREQ
int cpufreq_boost_trigger_state(int state);
-int cpufreq_boost_enabled(void);
+bool cpufreq_boost_enabled(void);
int cpufreq_enable_boost_support(void);
bool policy_has_boost_freq(struct cpufreq_policy *policy);
@@ -1200,9 +1200,9 @@ static inline int cpufreq_boost_trigger_state(int state)
{
return 0;
}
-static inline int cpufreq_boost_enabled(void)
+static inline bool cpufreq_boost_enabled(void)
{
- return 0;
+ return false;
}
static inline int cpufreq_enable_boost_support(void)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0198/1167] cpufreq: staticize cpufreq_boost_trigger_state()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (196 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0197/1167] cpufreq: make cpufreq_boost_enabled() return bool Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0199/1167] cpufreq: Force sync policy boost with global boost on sysfs update Greg Kroah-Hartman
` (459 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Viresh Kumar, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <viresh.kumar@linaro.org>
[ Upstream commit 1f04815057a4c1ca557448b56ad5ab536978540e ]
cpufreq_boost_trigger_state() is only used by cpufreq core, mark it
static.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Stable-dep-of: 3d5720dff09f ("cpufreq: Serialize global boost updates")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 3 ++-
include/linux/cpufreq.h | 5 -----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index fb4c02a6893bb..a592d515f75ea 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -87,6 +87,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
struct cpufreq_governor *new_gov,
unsigned int new_pol);
static bool cpufreq_boost_supported(void);
+static int cpufreq_boost_trigger_state(int state);
/*
* Two notifier lists: the "policy" list is involved in the
@@ -2792,7 +2793,7 @@ static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state)
return 0;
}
-int cpufreq_boost_trigger_state(int state)
+static int cpufreq_boost_trigger_state(int state)
{
struct cpufreq_policy *policy;
unsigned long flags;
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index afb7e1ef705dd..a77efb227bc27 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -798,7 +798,6 @@ int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy,
ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
#ifdef CONFIG_CPU_FREQ
-int cpufreq_boost_trigger_state(int state);
bool cpufreq_boost_enabled(void);
int cpufreq_enable_boost_support(void);
bool policy_has_boost_freq(struct cpufreq_policy *policy);
@@ -1196,10 +1195,6 @@ static inline int of_perf_domain_get_sharing_cpumask(int pcpu, const char *list_
return 0;
}
#else
-static inline int cpufreq_boost_trigger_state(int state)
-{
- return 0;
-}
static inline bool cpufreq_boost_enabled(void)
{
return false;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0199/1167] cpufreq: Force sync policy boost with global boost on sysfs update
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (197 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0198/1167] cpufreq: staticize cpufreq_boost_trigger_state() Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0200/1167] cpufreq: Serialize global boost updates Greg Kroah-Hartman
` (458 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lifeng Zheng, Viresh Kumar,
Rafael J. Wysocki, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <viresh.kumar@linaro.org>
[ Upstream commit 121baab7b88ed865532dadb7ef1aee6e2bea86f5 ]
If the global boost flag is enabled and policy boost flag is disabled, a
call to `cpufreq_boost_trigger_state(true)` must enable the policy's
boost state.
The current code misses that because of an optimization. Fix it.
Suggested-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/852ff11c589e6300730d207baac195b2d9d8b95f.1745511526.git.viresh.kumar@linaro.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 3d5720dff09f ("cpufreq: Serialize global boost updates")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index a592d515f75ea..7caf975a29614 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2799,8 +2799,10 @@ static int cpufreq_boost_trigger_state(int state)
unsigned long flags;
int ret = 0;
- if (cpufreq_driver->boost_enabled == state)
- return 0;
+ /*
+ * Don't compare 'cpufreq_driver->boost_enabled' with 'state' here to
+ * make sure all policies are in sync with global boost flag.
+ */
write_lock_irqsave(&cpufreq_driver_lock, flags);
cpufreq_driver->boost_enabled = state;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0200/1167] cpufreq: Serialize global boost updates
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (198 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0199/1167] cpufreq: Force sync policy boost with global boost on sysfs update Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0201/1167] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
` (457 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Loehle, Pengjie Zhang,
Zhongqiu Han, Sumit Gupta, Rafael J. Wysocki, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Loehle <christian.loehle@arm.com>
[ Upstream commit 3d5720dff09f3b90d9ab2a6707e4bb8d69542f4a ]
Concurrent global boost sysfs writes can interleave their global flag
and per-policy updates. An enabling write can set the global flag, then
a disabling write can clear it and finish before the enabling write
updates the policies. Both writes succeed, leaving boost enabled on
the policies while the global flag is disabled.
Serialize the complete global boost update, including rollback on
failure, with a mutex.
Fixes: 6f19efc0a1ca ("cpufreq: Add boost frequency support in core")
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Reviewed-by: Pengjie Zhang <zhangpengjie2@huawei.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Link: https://patch.msgid.link/20261105215223.1263415-3-christian.loehle@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 7caf975a29614..bcdeba41a5e58 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2793,12 +2793,16 @@ static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state)
return 0;
}
+static DEFINE_MUTEX(cpufreq_boost_mutex);
+
static int cpufreq_boost_trigger_state(int state)
{
struct cpufreq_policy *policy;
unsigned long flags;
int ret = 0;
+ guard(mutex)(&cpufreq_boost_mutex);
+
/*
* Don't compare 'cpufreq_driver->boost_enabled' with 'state' here to
* make sure all policies are in sync with global boost flag.
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0201/1167] Bluetooth: reject invalid LE supervision timeout relationships
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (199 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0200/1167] cpufreq: Serialize global boost updates Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0202/1167] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
` (456 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Pepper, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Pepper <cochcoder@proton.me>
[ Upstream commit c1d50a71cdee90a0c68b7a67221d8aae96d14a0c ]
The LE parameter validator calculates an unsigned maximum latency by
subtracting one from a truncated quotient. If the quotient is zero,
this wraps and accepts invalid parameters. Exact quotient boundaries
also accept equality where the supervision timeout must be greater.
Compare the products directly after checking the field bounds. The
validated interval and latency limits keep the products within int.
This enforces the strict timeout relationship without division or
unsigned subtraction.
Sashiko identified the underflow while reviewing the soft interval
preference RFC. The bug is already present in its unpatched base; keep
this common-validator fix independent of that preference policy.
Fixes: 8757825b128e ("Bluetooth: hci_check_conn_params() check proper range")
Assisted-by: LLM
Signed-off-by: Kyle Pepper <cochcoder@proton.me>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/bluetooth/hci_core.h | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 9599656b33b11..3d44f6bc6b3f3 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2149,8 +2149,6 @@ static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
static inline int hci_check_conn_params(u16 min, u16 max, u16 latency,
u16 to_multiplier)
{
- u16 max_latency;
-
if (min > max) {
BT_WARN("min %d > max %d", min, max);
return -EINVAL;
@@ -2176,19 +2174,14 @@ static inline int hci_check_conn_params(u16 min, u16 max, u16 latency,
return -EINVAL;
}
- if (max >= to_multiplier * 8) {
- BT_WARN("max %d >= to_multiplier %d * 8", max, to_multiplier);
- return -EINVAL;
- }
-
- max_latency = (to_multiplier * 4 / max) - 1;
if (latency > 499) {
BT_WARN("latency %d > 499", latency);
return -EINVAL;
}
- if (latency > max_latency) {
- BT_WARN("latency %d > max_latency %d", latency, max_latency);
+ if ((latency + 1) * max >= to_multiplier * 4) {
+ BT_WARN("latency %d, max %d and timeout %d are incompatible",
+ latency, max, to_multiplier);
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0202/1167] net/mlx5e: IPoIB, Fix QPN lookup race
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (200 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0201/1167] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0203/1167] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum Greg Kroah-Hartman
` (455 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Prathamesh Deshpande, Tariq Toukan,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
[ Upstream commit 29066b0fc046a2965129a74325b98d9abb4647a9 ]
The parent RX completion path can load a QPN hash entry before
mlx5i_pkey_del_qpn() unlinks and frees it, then dereference freed memory.
Use RCU hlist operations and defer freeing with kfree_rcu(). The existing
RCU read-side section in mlx5e_napi_poll() covers the lookup. Keep ht_lock
for writers and acquire it before looking up the entry to delete.
Fixes: 7e7f4780c340 ("net/mlx5e: IPoIB, Use hash-table to map between QPN to child netdev")
Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261031225749.14214-1-prathameshdeshpande7@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/mellanox/mlx5/core/ipoib/ipoib.h | 2 +-
.../mellanox/mlx5/core/ipoib/ipoib_vlan.c | 26 +++++++++++--------
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h
index f3f2af972020a..ffdbbae87fc14 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h
@@ -80,7 +80,7 @@ void mlx5i_pkey_qpn_ht_cleanup(struct net_device *netdev);
int mlx5i_pkey_add_qpn(struct net_device *netdev, u32 qpn);
int mlx5i_pkey_del_qpn(struct net_device *netdev, u32 qpn);
-/* Get the net-device corresponding to the given underlay QPN */
+/* Get the net-device for a QPN. Caller must hold rcu_read_lock(). */
struct net_device *mlx5i_pkey_get_netdev(struct net_device *netdev, u32 qpn);
/* Shared ndo functions */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
index 03e681297937f..fc77e38c43e1c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
@@ -31,6 +31,7 @@
*/
#include <linux/hash.h>
+#include <linux/rculist.h>
#include "ipoib.h"
#define MLX5I_MAX_LOG_PKEY_SUP 7
@@ -39,11 +40,12 @@ struct qpn_to_netdev {
struct net_device *netdev;
struct hlist_node hlist;
u32 underlay_qpn;
+ struct rcu_head rcu;
};
struct mlx5i_pkey_qpn_ht {
struct hlist_head buckets[1 << MLX5I_MAX_LOG_PKEY_SUP];
- spinlock_t ht_lock; /* Synchronise with NAPI */
+ spinlock_t ht_lock; /* Serialize hash table updates */
};
int mlx5i_pkey_qpn_ht_init(struct net_device *netdev)
@@ -68,13 +70,14 @@ void mlx5i_pkey_qpn_ht_cleanup(struct net_device *netdev)
kfree(ipriv->qpn_htbl);
}
-static struct qpn_to_netdev *mlx5i_find_qpn_to_netdev_node(struct hlist_head *buckets,
- u32 qpn)
+static struct qpn_to_netdev *
+mlx5i_find_qpn_to_netdev_node(struct mlx5i_pkey_qpn_ht *ht, u32 qpn)
{
- struct hlist_head *h = &buckets[hash_32(qpn, MLX5I_MAX_LOG_PKEY_SUP)];
+ struct hlist_head *h = &ht->buckets[hash_32(qpn, MLX5I_MAX_LOG_PKEY_SUP)];
struct qpn_to_netdev *node;
- hlist_for_each_entry(node, h, hlist) {
+ hlist_for_each_entry_rcu(node, h, hlist,
+ lockdep_is_held(&ht->ht_lock)) {
if (node->underlay_qpn == qpn)
return node;
}
@@ -96,7 +99,7 @@ int mlx5i_pkey_add_qpn(struct net_device *netdev, u32 qpn)
new_node->netdev = netdev;
new_node->underlay_qpn = qpn;
spin_lock_bh(&ht->ht_lock);
- hlist_add_head(&new_node->hlist, &ht->buckets[key]);
+ hlist_add_head_rcu(&new_node->hlist, &ht->buckets[key]);
spin_unlock_bh(&ht->ht_lock);
return 0;
@@ -109,16 +112,17 @@ int mlx5i_pkey_del_qpn(struct net_device *netdev, u32 qpn)
struct mlx5i_pkey_qpn_ht *ht = ipriv->qpn_htbl;
struct qpn_to_netdev *node;
- node = mlx5i_find_qpn_to_netdev_node(ht->buckets, qpn);
+ spin_lock_bh(&ht->ht_lock);
+ node = mlx5i_find_qpn_to_netdev_node(ht, qpn);
if (!node) {
+ spin_unlock_bh(&ht->ht_lock);
mlx5_core_warn(epriv->mdev, "QPN to netdev delete from HT failed\n");
return -EINVAL;
}
- spin_lock_bh(&ht->ht_lock);
- hlist_del_init(&node->hlist);
+ hlist_del_rcu(&node->hlist);
spin_unlock_bh(&ht->ht_lock);
- kfree(node);
+ kfree_rcu(node, rcu);
return 0;
}
@@ -128,7 +132,7 @@ struct net_device *mlx5i_pkey_get_netdev(struct net_device *netdev, u32 qpn)
struct mlx5i_priv *ipriv = netdev_priv(netdev);
struct qpn_to_netdev *node;
- node = mlx5i_find_qpn_to_netdev_node(ipriv->qpn_htbl->buckets, qpn);
+ node = mlx5i_find_qpn_to_netdev_node(ipriv->qpn_htbl, qpn);
if (!node)
return NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0203/1167] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (201 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0202/1167] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0204/1167] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
` (454 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Or Har-Toov, Maher Sanalla,
Tariq Toukan, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Or Har-Toov <ohartoov@nvidia.com>
[ Upstream commit 9c1adbe7fa6cbc02c25db2039532918acf846400 ]
mlx5e_rep_update_hw_counters() adds transmitted_eth_multicast.packets
to vport_rx_packets but does not add transmitted_eth_multicast.octets
to vport_rx_bytes. As a result, Ethernet multicast sent by a VF/SF is
counted in its representor's rx_packets but not in rx_bytes.
Fix by adding transmitted_eth_multicast.octets to the vport_rx_bytes
sum.
Fixes: 64b68e369649 ("net/mlx5: Refactor and expand rep vport stat group")
Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261101065833.282261-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 4e299fa313422..98a3225a51ebf 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -221,6 +221,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
MLX5_GET_CTR(out, transmitted_ib_unicast.octets) +
MLX5_GET_CTR(out, transmitted_eth_unicast.octets) +
MLX5_GET_CTR(out, transmitted_ib_multicast.octets) +
+ MLX5_GET_CTR(out, transmitted_eth_multicast.octets) +
MLX5_GET_CTR(out, transmitted_eth_broadcast.octets);
rep_stats->vport_tx_bytes =
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0204/1167] calipso: do not charge request socket options to the listener
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (202 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0203/1167] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0205/1167] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
` (453 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Eric Dumazet,
Kuniyuki Iwashima, Paul Moore, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit b4a2cc6d748d3056a25812dcf5f5377a59afd02f ]
calipso_req_setattr() and calipso_req_delattr() allocate ireq->ipv6_opt
with ipv6_renew_options(), which charges the listener sk_omem_alloc
through sock_kmalloc().
tcp_v6_reqsk_destructor() frees ireq->ipv6_opt without uncharging it,
so each request socket leaks its options size from the listener
budget. Once sysctl_optmem_max is reached, sock_kmalloc() fails,
calipso_req_setattr() returns -ENOBUFS, and tcp_v6_route_req() drops
all subsequent SYN packets. __sk_destruct() also reports an optmem
leakage when the listener is destroyed.
Uncharging in tcp_v6_reqsk_destructor() would not be correct: after a
migration, req->rsk_listener is no longer the socket that was charged.
These options belong to the request socket, there is no reason to
charge them to the listener. Change ipv6_renew_options() to use
kmalloc() when its sk argument is NULL, and use this from
calipso_req_setattr() and calipso_req_delattr(),
like cipso_v4_req_setattr() which uses kzalloc().
Note:
After this patch, calipso_req_setattr() and calipso_req_delattr()
no longer need the listener. Commit 10876da918fa ("calipso: Fix
null-ptr-deref in calipso_req_{set,del}attr().") could be reverted
in net-next (also removing the then unused sk variables), so that
CALIPSO works with SYN cookies.
Fixes: e1adea927080 ("calipso: Allow request sockets to be relabelled by the lsm.")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179378292255.488856.6917577451813010963@kernel.org/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Link: https://patch.msgid.link/20261104150318.1156620-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/calipso.c | 12 ++++--------
net/ipv6/exthdrs.c | 5 +++--
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c
index 60f921edbc71b..3a994a0331805 100644
--- a/net/ipv6/calipso.c
+++ b/net/ipv6/calipso.c
@@ -1223,7 +1223,7 @@ static int calipso_req_setattr(struct request_sock *req,
if (IS_ERR(new))
return PTR_ERR(new);
- txopts = ipv6_renew_options(sk, req_inet->ipv6_opt, IPV6_HOPOPTS, new);
+ txopts = ipv6_renew_options(NULL, req_inet->ipv6_opt, IPV6_HOPOPTS, new);
kfree(new);
@@ -1231,10 +1231,8 @@ static int calipso_req_setattr(struct request_sock *req,
return PTR_ERR(txopts);
txopts = xchg(&req_inet->ipv6_opt, txopts);
- if (txopts) {
- atomic_sub(txopts->tot_len, &sk->sk_omem_alloc);
+ if (txopts)
txopt_put(txopts);
- }
return 0;
}
@@ -1264,14 +1262,12 @@ static void calipso_req_delattr(struct request_sock *req)
if (calipso_opt_del(req_inet->ipv6_opt->hopopt, &new))
return; /* Nothing to do */
- txopts = ipv6_renew_options(sk, req_inet->ipv6_opt, IPV6_HOPOPTS, new);
+ txopts = ipv6_renew_options(NULL, req_inet->ipv6_opt, IPV6_HOPOPTS, new);
if (!IS_ERR(txopts)) {
txopts = xchg(&req_inet->ipv6_opt, txopts);
- if (txopts) {
- atomic_sub(txopts->tot_len, &sk->sk_omem_alloc);
+ if (txopts)
txopt_put(txopts);
- }
}
kfree(new);
}
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 0f9d8119b34c6..7b679c8fa3650 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -1286,7 +1286,7 @@ static void ipv6_renew_option(int renewtype,
* not copied into the new set of options.
*
* The new set of options is allocated from the socket option memory
- * buffer of @sk.
+ * buffer of @sk, or with kmalloc() if @sk is NULL.
*/
struct ipv6_txoptions *
ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
@@ -1314,7 +1314,8 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
return NULL;
tot_len += sizeof(*opt2);
- opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC);
+ opt2 = sk ? sock_kmalloc(sk, tot_len, GFP_ATOMIC) :
+ kmalloc(tot_len, GFP_ATOMIC);
if (!opt2)
return ERR_PTR(-ENOBUFS);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0205/1167] ipv6: Check the Home Address option again before its address is used
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (203 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0204/1167] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0206/1167] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
` (452 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Ido Schimmel,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 30c71476d842b094651bd7712f6c8ee8716147d0 ]
ipv6_dest_hao() checks the Home Address option and sets IP6CB(skb)->dsthao
to the offset of the destination options header. Later mip6_addr_swap() and
mip6_destopt_reject() call ipv6_find_tlv() with that offset and use the 16
address bytes. They assume that the same header is still there.
But the seg6 and ioam6 lwtunnels, the End.B6 actions, ipv6_rpl_srh_rcv()
and BPF lwt progs move or rewrite the IPv6 headers and keep IP6CB(skb).
Then ipv6_find_tlv() parses other bytes. It returns when the type matches,
before it checks that the option is inside the header. Nobody checks the
length of the option again. Thus mip6_addr_swap() can write after the data
of the skb. mip6_destopt_reject() can copy that memory to an xfrm report.
In ipv6_find_tlv(), check the length of an option before its type. The
returned option is then inside the header, and the header is inside the
linear data. In both callers, ignore an option with a length other than 16,
as if ipv6_find_tlv() found none. Then the ICMPv6 error goes to the source
address of the IPv6 header, and the xfrm report has no XFRMA_COADDR
attribute. Nothing changes for a header that ip6_parse_tlv() accepted and
that is still in its place. For the other callers an incomplete option is
now absent:
- ip6_find_1stfragopt() and mip6_rthdr_offset() can return another offset
for the fragment header or the xfrm header, also in a forwarded packet.
- calipso_skbuff_optptr() returns NULL. netlbl_skbuff_getattr() and
netlbl_cache_add() then see no option. calipso_skbuff_delattr() returns
0 and the packet continues unchanged. Today it returns -EINVAL and
SELinux drops the packet. It already returns 0 when an earlier option is
incomplete. The receiver drops such a header in ip6_parse_tlv().
The code that moves the headers still does not reset the offset or the
other fields of IP6CB(skb). If the bytes there look like a header with a
Home Address option of length 16, both callers still use its address.
The first tag also covers ipv6_find_tlv(), because its early return did no
harm before mip6_addr_swap(). The second tag is for mip6_destopt_reject().
Fixes: 793832361fe7 ("[IPV6] MIP6: Revert address to send ICMPv6 error.")
Fixes: 70182ed23d25 ("[IPV6] MIP6: Report to user-space when home address option is rejected.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261102064922.2636027-1-alexei.starovoitov@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/exthdrs_core.c | 7 ++++---
net/ipv6/icmp.c | 7 ++++++-
net/ipv6/mip6.c | 9 ++++++++-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
index ce3724f49e33a..f5b6e25580e83 100644
--- a/net/ipv6/exthdrs_core.c
+++ b/net/ipv6/exthdrs_core.c
@@ -135,9 +135,6 @@ int ipv6_find_tlv(const struct sk_buff *skb, int offset, int type)
int opttype = nh[offset];
int optlen;
- if (opttype == type)
- return offset;
-
switch (opttype) {
case IPV6_TLV_PAD1:
optlen = 1;
@@ -150,6 +147,10 @@ int ipv6_find_tlv(const struct sk_buff *skb, int offset, int type)
goto bad;
break;
}
+ /* Some callers read the option, so it must be in the header. */
+ if (opttype == type)
+ return offset;
+
offset += optlen;
len -= optlen;
}
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 9c56612c66211..135e90edbfedd 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -343,7 +343,12 @@ static void mip6_addr_swap(struct sk_buff *skb, const struct inet6_skb_parm *opt
if (likely(off >= 0)) {
hao = (struct ipv6_destopt_hao *)
(skb_network_header(skb) + off);
- swap(iph->saddr, hao->addr);
+ /*
+ * The header can have moved or changed after
+ * ipv6_dest_hao() checked the length.
+ */
+ if (hao->length == 16)
+ swap(iph->saddr, hao->addr);
}
}
}
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index 83d2a8be263fb..d4daadd2b72bf 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -211,9 +211,16 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
if (likely(opt->dsthao)) {
offset = ipv6_find_tlv(skb, opt->dsthao, IPV6_TLV_HAO);
- if (likely(offset >= 0))
+ if (likely(offset >= 0)) {
hao = (struct ipv6_destopt_hao *)
(skb_network_header(skb) + offset);
+ /*
+ * The header can have moved or changed after
+ * ipv6_dest_hao() checked the length.
+ */
+ if (hao->length != 16)
+ hao = NULL;
+ }
}
stamp = skb_get_ktime(skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0206/1167] ata: libata-scsi: fix MODE SELECT handling of data after the mode page
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (204 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0205/1167] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0207/1167] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
` (451 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 6fde0444d07ec954f3d885375e0402ff2f2e5064 ]
ata_scsi_mode_select_xlat() only supports one mode page per MODE SELECT
command, and rejects a parameter list with data after the mode page with
INVALID FIELD IN PARAMETER LIST. However:
- It does not set the field pointer, so the sense data reports 0xffff as
the FIELD POINTER.
- It only checks for data after the mode page after the mode page
handler has been called. ata_mselect_control_ata_feature() has then
already updated the CDL enabled flag of the device, even though the
command is rejected and the CDL setting of the device is not changed.
- For the control mode page, ata_mselect_control_spg0() does not need an
ATA command, so the check is skipped, and the data after the mode page
is silently ignored.
Check for data after the mode page before calling the mode page
handlers, and set the FIELD POINTER to the first byte after the mode
page, i.e. to the first byte of the next mode page.
The reason why only one mode page per command is supported is that a
MODE SELECT command is translated into at most one ATA command, so
update the comment accordingly.
Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-11-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-scsi.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index b9c6d953af8e6..189c9c1d77208 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4036,6 +4036,17 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
if (pg_len > len)
goto invalid_param_len;
+ /*
+ * A MODE SELECT command is translated into at most one ATA command, so
+ * only one mode page per command is supported. Reject any data after
+ * the mode page before calling the mode page handlers, which may
+ * already update the device flags.
+ */
+ if (len > pg_len) {
+ fp = p - buffer + pg_len;
+ goto invalid_param;
+ }
+
switch (pg) {
case CACHE_MPAGE:
if (ata_mselect_caching(qc, p, pg_len, &fp) < 0) {
@@ -4058,13 +4069,6 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
goto invalid_param;
}
- /*
- * Only one page has changeable data, so we only support setting one
- * page at a time.
- */
- if (len > pg_len)
- goto invalid_param;
-
return 0;
invalid_fld:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0207/1167] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (205 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0206/1167] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0208/1167] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
` (450 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit b29c40dc150b0b4218c4d6844770892eb6b2f6b5 ]
When the SUBPAGE CODE of the mode page in a MODE SELECT parameter list
is FFh, ata_scsi_mode_select_xlat() rejects it for the control mode
page, but accepts it for all other mode pages, i.e. for the caching
mode page, the only other mode page that it supports.
However, FFh is not the subpage code of an actual mode page: SPC-7
(7.5.2) only defines it as the MODE SENSE request code for all
subpages. SUBPAGE CODE FFh only means "all subpages" in requests, i.e.
in the MODE SENSE CDB for mode pages and in the LOG SELECT CDB for log
pages (see SPC-5, 6.8), while the SUBPAGE CODE of a mode page in a MODE
SELECT parameter list identifies a specific mode page. Also, SAT-2 and
later versions of SAT define the Caching mode page with the SPF bit set
to zero (see SAT-6, 10.4.9), i.e. without a SUBPAGE CODE field.
Remove the ALL_SUB_MPAGES case, so that SUBPAGE CODE FFh is rejected
like any other unsupported subpage.
Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-12-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-scsi.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 189c9c1d77208..4840907441330 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4009,19 +4009,11 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
}
/*
- * Supported subpages: all subpages and ATA feature sub-page f2h of
- * the control page.
+ * The only supported subpage is the ATA feature sub-page f2h of the
+ * control page.
*/
if (spg) {
switch (spg) {
- case ALL_SUB_MPAGES:
- /* All subpages is not supported for the control page */
- if (pg == CONTROL_MPAGE) {
- fp = (p[0] & 0x40) ? 1 : 0;
- fp += hdr_len + bd_len;
- goto invalid_param;
- }
- break;
case ATA_FEATURE_SUB_MPAGE:
if (qc->dev->flags & ATA_DFLAG_CDL &&
pg == CONTROL_MPAGE)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0208/1167] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (206 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0207/1167] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0209/1167] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
` (449 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Niklas Cassel, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit a1eb72c477ec1320c540f27ce1e2f717d4518e62 ]
ata_scsi_mode_select_xlat() accepts the caching and control mode pages
both in page_0 format and in sub_page format with SUBPAGE CODE 00h.
However, SAT-2 and later versions of SAT define the SPF bit of the
Caching mode page and of the Control mode page as not changeable and
set to zero (see SAT-6, 10.4.9 and 10.4.6), and SPC-7 (6.12, MODE
SELECT(10) command) requires the device server to terminate a MODE
SELECT command with INVALID FIELD IN PARAMETER LIST if the application
client sets any field that is reported as not changeable to a value
other than its current value.
Reject a mode page with the SPF bit set to one and SUBPAGE CODE 00h,
with the FIELD POINTER set to the byte containing the SPF bit. The only
mode page with the SPF bit set to one that remains accepted is the ATA
Feature Control mode page (control mode page, sub-page f2h), for which
SAT-6 (12.3.4) requires the SPF bit to be set to one. The opposite case
does not need a check: a mode page in page_0 format always has subpage
code 00h, so it can never be the ATA Feature Control mode page.
This also allows the mode page handlers to rely on the format of their
mode page, which a later patch will make use of.
Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command")
Link: https://lore.kernel.org/r/20261103205448.931471-13-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-scsi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 4840907441330..ddfeaf6b7bcd4 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3994,7 +3994,17 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
if (len < 4)
goto invalid_param_len;
+ /*
+ * Mode pages with subpage code 00h use the page_0 format: SAT
+ * defines the SPF bit of the Caching and Control mode pages,
+ * for subpage code 00h, as not changeable and set to zero.
+ */
spg = p[1];
+ if (!spg) {
+ fp = hdr_len + bd_len;
+ goto invalid_param;
+ }
+
pg_len = get_unaligned_be16(&p[2]);
p += 4;
len -= 4;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0209/1167] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (207 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0208/1167] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0210/1167] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
` (448 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 2a4c61cf94d48ec8560473d4fd5383583ce8809c ]
When the mode page of a MODE SELECT parameter list has an unsupported
SUBPAGE CODE, ata_scsi_mode_select_xlat() sets the FIELD POINTER of the
INVALID FIELD IN PARAMETER LIST sense data to the SUBPAGE CODE byte of
the mode page header (byte 1 of the page) if the SPF bit is set, and to
the PAGE CODE byte (byte 0 of the page) otherwise.
However, the SPF bit is tested on p[0] after p has already been advanced
past the mode page header, so the test reads bit 6 of the first byte of
the mode page data instead. If the parameter list ends with the mode
page header, it even reads the byte that follows the parameter list in
buffer, which is not initialized when no data beyond the parameter list
was transferred.
The test is not needed anyway: spg can only be non-zero for a mode page
in sub_page format, i.e. with the SPF bit set, and the field in error is
the SUBPAGE CODE. Always set the FIELD POINTER to the SUBPAGE CODE byte,
which follows the mode parameter header, the block descriptors and the
PAGE CODE byte.
Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-14-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-scsi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index ddfeaf6b7bcd4..b43fb3de1213d 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4030,8 +4030,7 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
break;
fallthrough;
default:
- fp = (p[0] & 0x40) ? 1 : 0;
- fp += hdr_len + bd_len;
+ fp = hdr_len + bd_len + 1;
goto invalid_param;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0210/1167] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (208 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0209/1167] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0211/1167] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
` (447 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit a3e52dcf0fbaa1a103accef3e8861cdc250ee5d6 ]
ata_scsi_mode_select_xlat() only accepts MODE SELECT parameter lists
without block descriptors or with a single 8 byte block descriptor. For
any other BLOCK DESCRIPTOR LENGTH, it terminates the command with
INVALID FIELD IN PARAMETER LIST, and the FIELD POINTER should point at
the BLOCK DESCRIPTOR LENGTH field, i.e. at byte 3 of the mode parameter
header(6) or at byte 6 of the mode parameter header(10), as SPC requires
the FIELD POINTER of a multiple-byte field to point at its first byte.
However, the mode parameter header length and the BLOCK DESCRIPTOR
LENGTH are added to the offset of the field, so the FIELD POINTER points
3 or 6 bytes after the end of the block descriptors instead. For
example, a MODE SELECT(10) with a BLOCK DESCRIPTOR LENGTH of 16 reports
byte 30 instead of byte 6.
Do not add the mode parameter header length and the BLOCK DESCRIPTOR
LENGTH to the offset of the BLOCK DESCRIPTOR LENGTH field.
Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-15-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-scsi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index b43fb3de1213d..57e7d04b98bb0 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3979,7 +3979,6 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
goto invalid_param_len;
if (bd_len != 0 && bd_len != 8) {
fp = (six_byte) ? 3 : 6;
- fp += bd_len + hdr_len;
goto invalid_param;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0211/1167] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (209 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0210/1167] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0212/1167] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
` (446 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 0fdb8eef88a886751e33600d446a66c529384f11 ]
ata_scsi_mode_select_xlat() strips the mode page header before calling
the mode page handlers, which report the position of an invalid field
as an offset relative to the mode page data. It then converts this
offset into an offset in the parameter list by adding the length of the
mode parameter header and of the block descriptors, but not the length
of the mode page header. As a result, the FIELD POINTER of the INVALID
FIELD IN PARAMETER LIST sense data points 2 bytes (page_0 format) or 4
bytes (sub_page format) before the byte that is actually invalid. For
example, changing byte 3 of the caching mode page in a MODE SELECT(10)
parameter list without block descriptors reports byte 9 instead of
byte 11.
Pass the whole mode page, starting with its mode page header, to the
handlers instead, like the ata_msense_*() functions, which generate the
whole mode page. Offsets in buf are then the byte numbers of the mode
page, as used in the mode page definitions of SPC, SBC and SAT, the
handlers can compare buf with the mode page generated by the matching
ata_msense_*() function without adjusting offsets, and the conversion
done by ata_scsi_mode_select_xlat() becomes correct. This also allows
reporting an invalid PAGE LENGTH at the PAGE LENGTH field, which was not
part of buf before. As ata_scsi_mode_select_xlat() rejects SUBPAGE CODE
FFh and mode pages with a wrong SPF bit, each handler only gets its mode
page in a single format, so the mode page header length is known.
Document what buf, len and fp are, and the return values, in kernel-doc
comments for all the handlers.
Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-16-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-scsi.c | 133 +++++++++++++++++++++++---------------
1 file changed, 82 insertions(+), 51 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 57e7d04b98bb0..74a3c7aedca91 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3732,14 +3732,22 @@ static unsigned int ata_scsi_zbc_out_xlat(struct ata_queued_cmd *qc)
/**
* ata_mselect_caching - Simulate MODE SELECT for caching info page
* @qc: Storage for translated ATA taskfile
- * @buf: input buffer
- * @len: number of valid bytes in the input buffer
- * @fp: out parameter for the failed field on error
+ * @buf: Mode page, starting with the mode page header
+ * @len: Length of the mode page, including the mode page header
+ * @fp: Out parameter, offset in @buf of the first invalid byte on error
*
* Prepare a taskfile to modify caching information for the device.
*
+ * The caller has stripped the mode parameter header and the block
+ * descriptors, so @buf points at the mode page header, like the buffer
+ * filled by the ata_msense_*() functions, and offsets in @buf, including
+ * the one returned in @fp, are the byte numbers of the mode page.
+ *
* LOCKING:
* None.
+ *
+ * RETURNS:
+ * 0 if a taskfile was prepared, -EINVAL if the mode page is invalid.
*/
static int ata_mselect_caching(struct ata_queued_cmd *qc,
const u8 *buf, int len, u16 *fp)
@@ -3750,26 +3758,19 @@ static int ata_mselect_caching(struct ata_queued_cmd *qc,
u8 wce;
int i;
- /*
- * The first two bytes of def_cache_mpage are a header, so offsets
- * in mpage are off by 2 compared to buf. Same for len.
- */
-
- if (len != CACHE_MPAGE_LEN - 2) {
- *fp = min(len, CACHE_MPAGE_LEN - 2);
+ if (len != CACHE_MPAGE_LEN) {
+ *fp = 1;
return -EINVAL;
}
- wce = buf[0] & (1 << 2);
+ wce = buf[2] & (1 << 2);
/*
* Check that read-only bits are not modified.
*/
ata_msense_caching(dev->id, mpage, false);
- for (i = 0; i < CACHE_MPAGE_LEN - 2; i++) {
- if (i == 0)
- continue;
- if (mpage[i + 2] != buf[i]) {
+ for (i = 3; i < CACHE_MPAGE_LEN; i++) {
+ if (mpage[i] != buf[i]) {
*fp = i;
return -EINVAL;
}
@@ -3783,8 +3784,26 @@ static int ata_mselect_caching(struct ata_queued_cmd *qc,
return 0;
}
-/*
- * Simulate MODE SELECT control mode page, sub-page 0.
+/**
+ * ata_mselect_control_spg0 - Simulate MODE SELECT for control sub-page 0
+ * @qc: Storage for translated ATA taskfile
+ * @buf: Mode page, starting with the mode page header
+ * @len: Length of the mode page, including the mode page header
+ * @fp: Out parameter, offset in @buf of the first invalid byte on error
+ *
+ * Simulate MODE SELECT control mode page, sub-page 0.
+ *
+ * The caller has stripped the mode parameter header and the block
+ * descriptors, so @buf points at the mode page header, like the buffer
+ * filled by the ata_msense_*() functions, and offsets in @buf, including
+ * the one returned in @fp, are the byte numbers of the mode page.
+ *
+ * LOCKING:
+ * None.
+ *
+ * RETURNS:
+ * 0, as no ATA command needs to be sent, or -EINVAL if the mode page is
+ * invalid.
*/
static int ata_mselect_control_spg0(struct ata_queued_cmd *qc,
const u8 *buf, int len, u16 *fp)
@@ -3794,26 +3813,19 @@ static int ata_mselect_control_spg0(struct ata_queued_cmd *qc,
u8 d_sense;
int i;
- /*
- * The first two bytes of def_control_mpage are a header, so offsets
- * in mpage are off by 2 compared to buf. Same for len.
- */
-
- if (len != CONTROL_MPAGE_LEN - 2) {
- *fp = min(len, CONTROL_MPAGE_LEN - 2);
+ if (len != CONTROL_MPAGE_LEN) {
+ *fp = 1;
return -EINVAL;
}
- d_sense = buf[0] & (1 << 2);
+ d_sense = buf[2] & (1 << 2);
/*
* Check that read-only bits are not modified.
*/
ata_msense_control_spg0(dev, mpage, false);
- for (i = 0; i < CONTROL_MPAGE_LEN - 2; i++) {
- if (i == 0)
- continue;
- if (mpage[2 + i] != buf[i]) {
+ for (i = 3; i < CONTROL_MPAGE_LEN; i++) {
+ if (mpage[i] != buf[i]) {
*fp = i;
return -EINVAL;
}
@@ -3825,9 +3837,27 @@ static int ata_mselect_control_spg0(struct ata_queued_cmd *qc,
return 0;
}
-/*
- * Translate MODE SELECT control mode page, sub-page f2h (ATA feature mode
- * page) into a SET FEATURES command.
+/**
+ * ata_mselect_control_ata_feature - Translate ATA Feature Control page
+ * @qc: Storage for translated ATA taskfile
+ * @buf: Mode page, starting with the mode page header
+ * @len: Length of the mode page, including the mode page header
+ * @fp: Out parameter, offset in @buf of the first invalid byte on error
+ *
+ * Translate MODE SELECT control mode page, sub-page f2h (ATA feature mode
+ * page) into a SET FEATURES command.
+ *
+ * The caller has stripped the mode parameter header and the block
+ * descriptors, so @buf points at the mode page header, like the buffer
+ * filled by the ata_msense_*() functions, and offsets in @buf, including
+ * the one returned in @fp, are the byte numbers of the mode page.
+ *
+ * LOCKING:
+ * None.
+ *
+ * RETURNS:
+ * 1 if a taskfile was prepared, -EINVAL if the mode page is invalid or if
+ * CDL cannot be enabled.
*/
static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
const u8 *buf, int len, u16 *fp)
@@ -3836,17 +3866,13 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
struct ata_taskfile *tf = &qc->tf;
u8 cdl_action;
- /*
- * The first four bytes of ATA Feature Control mode page are a header,
- * so offsets in mpage are off by 4 compared to buf. Same for len.
- */
- if (len != ATA_FEATURE_SUB_MPAGE_LEN - 4) {
- *fp = min(len, ATA_FEATURE_SUB_MPAGE_LEN - 4);
+ if (len != ATA_FEATURE_SUB_MPAGE_LEN) {
+ *fp = 2;
return -EINVAL;
}
/* Check cdl_ctrl */
- switch (buf[0] & 0x03) {
+ switch (buf[4] & 0x03) {
case 0:
/* Disable CDL */
ata_dev_dbg(dev, "Disabling CDL\n");
@@ -3868,7 +3894,7 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
dev->flags |= ATA_DFLAG_CDL_ENABLED;
break;
default:
- *fp = 0;
+ *fp = 4;
return -EINVAL;
}
@@ -3884,15 +3910,24 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
/**
* ata_mselect_control - Simulate MODE SELECT for control page
* @qc: Storage for translated ATA taskfile
- * @spg: target sub-page of the control page
- * @buf: input buffer
- * @len: number of valid bytes in the input buffer
- * @fp: out parameter for the failed field on error
+ * @spg: Sub-page of the control page, 0 or ATA_FEATURE_SUB_MPAGE
+ * @buf: Mode page, starting with the mode page header
+ * @len: Length of the mode page, including the mode page header
+ * @fp: Out parameter, offset in @buf of the first invalid byte on error
*
- * Prepare a taskfile to modify caching information for the device.
+ * Call the handler of sub-page @spg of the control mode page.
+ *
+ * The caller has stripped the mode parameter header and the block
+ * descriptors, so @buf points at the mode page header, like the buffer
+ * filled by the ata_msense_*() functions, and offsets in @buf, including
+ * the one returned in @fp, are the byte numbers of the mode page.
*
* LOCKING:
* None.
+ *
+ * RETURNS:
+ * 0 if no ATA command needs to be sent, 1 if a taskfile was prepared,
+ * -EINVAL if the mode page is invalid.
*/
static int ata_mselect_control(struct ata_queued_cmd *qc, u8 spg,
const u8 *buf, int len, u16 *fp)
@@ -4004,17 +4039,13 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
goto invalid_param;
}
- pg_len = get_unaligned_be16(&p[2]);
- p += 4;
- len -= 4;
+ pg_len = get_unaligned_be16(&p[2]) + 4;
} else {
if (len < 2)
goto invalid_param_len;
spg = 0;
- pg_len = p[1];
- p += 2;
- len -= 2;
+ pg_len = p[1] + 2;
}
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0212/1167] ata: libata-scsi: set the field pointer when rejecting CDL
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (210 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0211/1167] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
@ 2026-12-04 9:53 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0213/1167] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
` (445 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:53 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Damien Le Moal,
Niklas Cassel, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shao Mingyin <shao.mingyin@zte.com.cn>
[ Upstream commit 7c972e73641cbe5f77f63c336de15c7a30268d49 ]
ata_mselect_control_ata_feature() rejects enabling CDL while NCQ
priority is enabled, but unlike its other error branches it returns
without setting *fp.
ata_scsi_mode_select_xlat() initializes fp to 0xffff and, when the
handler fails, adds the offset of the mode page in the parameter list
to it, i.e. the length of the mode parameter header and of the block
descriptors. As fp is a u16, this wraps around, so the resulting sense
data reports the byte before the mode page, i.e. the last byte of the
mode parameter header or of the block descriptors, as the FIELD
POINTER, instead of the byte containing the CDL_CTRL field that
requests enabling CDL.
Set *fp to 4, i.e. to the byte containing the CDL_CTRL field, like the
branch rejecting an invalid CDL_CTRL value does.
Fixes: df60f9c64576 ("scsi: ata: libata: Add ATA feature control sub-page translation")
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
[cassel: set *fp to 4, the offset of CDL_CTRL in the mode page]
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-17-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-scsi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 74a3c7aedca91..b56f71948f701 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3887,6 +3887,7 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
if (dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED) {
ata_dev_err(dev,
"NCQ priority must be disabled to enable CDL\n");
+ *fp = 4;
return -EINVAL;
}
ata_dev_dbg(dev, "Enabling CDL\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0213/1167] tracing/probes: bound symstr stores to reserved length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (211 preceding siblings ...)
2026-12-04 9:53 ` [PATCH 6.6 0212/1167] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0214/1167] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
` (444 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yifan Zhang,
Masami Hiramatsu (Google), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
[ Upstream commit 2fc0b3070d6d5dcecfed43cd0e62aa0fd4b4315c ]
Traceprobe calculates dynamic string sizes before storing the values. A
probed pointer can change between those passes, so
fetch_store_symstrlen() can reserve space for a short symbol while
fetch_store_symstring() observes a longer one. The store path then
overwrites the trace record.
Format the symbol into a temporary KSYM_SYMBOL_LEN buffer and copy only
the bytes that fit in the reserved field, including a trailing NUL.
Update __data_loc with the length actually stored so consumers do not
read beyond the truncated value.
Link: https://lore.kernel.org/all/179378621331.55520.2052332247156241151@stu.pku.edu.cn/
Fixes: b26a124cbfa8 ("tracing/probes: Add symstr type for dynamic events")
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_probe_tmpl.h | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_probe_tmpl.h b/kernel/trace/trace_probe_tmpl.h
index 2caf0d2afb322..6991ab3b9e0b9 100644
--- a/kernel/trace/trace_probe_tmpl.h
+++ b/kernel/trace/trace_probe_tmpl.h
@@ -87,15 +87,27 @@ fetch_store_symstrlen(unsigned long addr)
static nokprobe_inline int
fetch_store_symstring(unsigned long addr, void *dest, void *base)
{
+ char namebuf[KSYM_SYMBOL_LEN];
int maxlen = get_loc_len(*(u32 *)dest);
void *__dest;
+ int len;
if (unlikely(!maxlen))
return -ENOMEM;
__dest = get_loc_data(dest, base);
+ len = sprint_symbol(namebuf, addr);
+ if (len < 0) {
+ *(u32 *)dest = make_data_loc(0, __dest - base);
+ return 0;
+ }
+
+ len = min(len, maxlen - 1);
+ memcpy(__dest, namebuf, len);
+ ((char *)__dest)[len] = '\0';
+ *(u32 *)dest = make_data_loc(len + 1, __dest - base);
- return sprint_symbol(__dest, addr);
+ return len + 1;
}
/* common part of process_fetch_insn*/
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0214/1167] gpiolib: of: return -ENOENT from of_gpio_count() stub
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (212 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0213/1167] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0215/1167] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
` (443 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andy Shevchenko, Dmitry Torokhov,
Bartosz Golaszewski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit e20e4b8cda2b4d7dd32dbd2c0875a15d92545f04 ]
gpiod_count() and its firmware backends are expected to return either a
positive number of GPIOs or a negative error code (-ENOENT) when no
GPIOs are assigned. However, the !CONFIG_OF_GPIO stub for
of_gpio_count() returns 0 instead of -ENOENT. This causes gpiod_count()
to skip the platform_gpio_count() fallback (which triggers when
count < 0) and erroneously return 0 to callers.
Change the stub to return -ENOENT to match the real of_gpio_count()
implementation and the other error-returning stubs in gpiolib-of.h.
Fixes: f626d6dfb709 ("gpio: of: Break out OF-only code")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20261105-b4-gpiolib-free-v3-3-bb47ad58642d@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib-of.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib-of.h b/drivers/gpio/gpiolib-of.h
index 6b3a5347c5d92..12937d843097a 100644
--- a/drivers/gpio/gpiolib-of.h
+++ b/drivers/gpio/gpiolib-of.h
@@ -34,7 +34,7 @@ static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
static inline int of_gpio_get_count(struct device *dev, const char *con_id)
{
- return 0;
+ return -ENOENT;
}
#endif /* CONFIG_OF_GPIO */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0215/1167] ASoC: soc-core: copy the DAI link names into the card
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (213 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0214/1167] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0216/1167] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
` (442 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tyler Baker, Mark Brown, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Baker <tyler.baker@oss.qualcomm.com>
[ Upstream commit 33a130f6ed8c75ed59b12889a417a57fb80d0abf ]
snd_soc_of_get_dai_link_codecs() and snd_soc_of_get_dai_link_cpus()
keep a DAI name owned by the component, which is freed when the
component unbinds, so the card cannot bind again afterwards.
Copy the name onto the card device, as simple-card and audio-graph-card
do since commit aa173b70d372 ("ASoC: generic: keep fallback dai_name
stable across rebind").
Fixes: e894efef9ac7 ("ASoC: core: add support to card rebind")
Fixes: 900dedd7e47c ("ASoC: Introduce snd_soc_of_get_dai_link_cpus")
Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
Link: https://patch.msgid.link/20261106054333.2748248-2-tyler.baker@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/soc-core.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9cebe0ff9c07d..7a6e54355de3d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3552,6 +3552,18 @@ void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link)
}
EXPORT_SYMBOL_GPL(snd_soc_of_put_dai_link_codecs);
+/* dai_name belongs to the component, which can unbind before the card. */
+static int snd_soc_of_dup_dai_name(struct device *dev,
+ struct snd_soc_dai_link_component *dlc)
+{
+ if (!dlc->dai_name)
+ return 0;
+
+ dlc->dai_name = devm_kstrdup_const(dev, dlc->dai_name, GFP_KERNEL);
+
+ return dlc->dai_name ? 0 : -ENOMEM;
+}
+
/*
* snd_soc_of_get_dai_link_codecs - Parse a list of CODECs in the devicetree
* @dev: Card device
@@ -3581,6 +3593,8 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
/* Parse the list */
for_each_link_codecs(dai_link, index, component) {
ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
+ if (!ret)
+ ret = snd_soc_of_dup_dai_name(dev, component);
if (ret)
goto err;
}
@@ -3636,6 +3650,8 @@ int snd_soc_of_get_dai_link_cpus(struct device *dev,
/* Parse the list */
for_each_link_cpus(dai_link, index, component) {
ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
+ if (!ret)
+ ret = snd_soc_of_dup_dai_name(dev, component);
if (ret)
goto err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0216/1167] NFSv4.1: retain MDS I/O until both thresholds are met
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (214 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0215/1167] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0217/1167] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
` (441 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit eab627dcd18a18a44a2cbee47df3058d3637ba0d ]
When both size and I/O thresholds are configured,
pnfs_within_mdsthreshold() uses size && io to decide whether to
keep I/O on the MDS. Both variables indicate an unmet threshold,
so reaching only one threshold returns false and may trigger
pNFS layout acquisition while the other threshold remains unmet.
Use logical OR instead of AND to stay with MDS I/O until both
thresholds are met, as recommended by RFC 8881 Section 5.12.6.
The new RFC contains the same threshold selection rule as RFC
5661 which is referenced in function comment.
Fixes: d23d61c8d351 ("NFSv4.1 test the mdsthreshold hint parameters")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/pnfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 6c322f4804589..66e7da21e286c 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1937,7 +1937,7 @@ static bool pnfs_within_mdsthreshold(struct nfs_open_context *ctx,
break;
}
if (size_set && io_set) {
- if (size && io)
+ if (size || io)
ret = true;
} else if (size || io)
ret = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0217/1167] NFS: Fix inverted cross-directory rename check
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (215 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0216/1167] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0218/1167] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
` (440 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit b9d518902ff1969f93d2b4787951d98e50ab0181 ]
nfs_rename_is_unsafe_cross_dir() returns false for cross-directory
renames, causing nfs_rename() to skip nfs_sync_inode() even when
filehandles may expire on rename. Same-directory renames may instead
trigger unnecessary synchronization.
Current condition directly contradicts the function name/comments.
Return false for same-directory renames so cross-directory renames
reach the existing filehandle-volatility check. Keep the conservative
fallback unchanged..
Fixes: dcd21b609d4ab ("NFS: Avoid flushing data while holding directory locks in nfs_rename()")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 9a718b8bf4b34..b51424a12a5ce 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2645,7 +2645,7 @@ static bool nfs_rename_is_unsafe_cross_dir(struct dentry *old_dentry,
{
struct nfs_server *server = NFS_SB(old_dentry->d_sb);
- if (old_dentry->d_parent != new_dentry->d_parent)
+ if (old_dentry->d_parent == new_dentry->d_parent)
return false;
if (server->fh_expire_type & NFS_FH_RENAME_UNSAFE)
return !(server->fh_expire_type & NFS_FH_NOEXPIRE_WITH_OPEN);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0218/1167] NFS: restore directory index when resuming readdir
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (216 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0217/1167] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0219/1167] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
` (439 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 89b91409b2342e7629b1271eba315a0f06495247 ]
nfs_readdir() restores the cached folio index and cookie when
resuming directory iteration, but leaves current_index at zero.
In 32-bit index mode, nfs_readdir_search_for_cookie() then
reports a folio-relative offset instead of the absolute entry
position.
Restore current_index from the saved logical folio index before
searching the cache.
This solution relies on the current behavior of
nfs_readdir_seek_next_array(), where folio_index advances by
one and current_index advances by nfs_readdir_array_maxentries()
for each full, nonterminal folio.
Fixes: f648022faa68e ("NFS: Convert readdir page cache to use a cookie based index")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/dir.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index b51424a12a5ce..77a55abd627dc 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1251,6 +1251,8 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
spin_lock(&file->f_lock);
desc->dir_cookie = dir_ctx->dir_cookie;
desc->folio_index = dir_ctx->page_index;
+ desc->current_index = (loff_t)desc->folio_index *
+ nfs_readdir_array_maxentries();
desc->last_cookie = dir_ctx->last_cookie;
desc->attr_gencount = dir_ctx->attr_gencount;
desc->eof = dir_ctx->eof;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0219/1167] SUNRPC: wake poll waiters when an empty pipe is unlinked
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (217 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0218/1167] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0220/1167] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
` (438 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Jeff Layton, NeilBrown,
Anna Schumaker, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 702d55edc017632a0c39c1d4bdd579bdbadfd730 ]
When an empty rpc_pipefs pipe is unlinked, rpc_purge_list() returns
without waking the pipe wait queue. An existing epoll waiter can
remain blocked even though rpc_pipe_poll() reports EPOLLHUP and
EPOLLERR for the disconnected pipe.
Wake the wait queue after clearing RPC_I(inode)->pipe so existing
poll waiters are notified regardless of whether messages were purged.
Fixes: 9842ef3557ab ("SUNRPC: rpc_timeout_upcall_queue should not sleep")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/rpc_pipe.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index f420d84573451..8f24f02028321 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -190,6 +190,7 @@ rpc_close_pipes(struct inode *inode)
cancel_delayed_work_sync(&pipe->queue_timeout);
rpc_inode_setowner(inode, NULL);
RPC_I(inode)->pipe = NULL;
+ wake_up(&RPC_I(inode)->waitq);
inode_unlock(inode);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0220/1167] SUNRPC: preserve timeout policy when cloning clients
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (218 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0219/1167] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0221/1167] SUNRPC: preserve transport security " Greg Kroah-Hartman
` (437 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 5b0ac1f82201c2ab2d9c31ed568cc782bac6a399 ]
rpc_clone_client() and rpc_clone_client_set_auth() leave the
timeout argument unset, causing rpc_new_client() to use the
transport defaults instead of the parent's configured
timeout. This also affects pNFS data-server clients and
changes their request timeout and initial RTT calculations.
Use the parent's cl_timeout when no timeout is specified.
Preserve explicitly supplied timeout overrides.
Fixes: 1b63a75180c6 ("SUNRPC: Refactor rpc_clone_client()")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 29b73519220fe..4026bf55c32ff 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -656,6 +656,8 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
}
args->servername = xprt->servername;
args->nodename = clnt->cl_nodename;
+ if (!args->timeout)
+ args->timeout = clnt->cl_timeout;
new = rpc_new_client(args, xps, xprt, clnt);
if (IS_ERR(new))
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0221/1167] SUNRPC: preserve transport security policy when cloning clients
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (219 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0220/1167] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0222/1167] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
` (436 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 7783534ce5fee57adf1b9025745c9af2e1ce2ccd ]
RPC client cloning does not copy the parent's transport security
policy into the new client. Clones consequently lose their TLS
policy and certificate/key serials, even though the shared
transport remains protected.
When NFSv4 migration replaces a cloned client's TLS transport, the
missing security policy causes xs_setup_tcp_tls() to return -EACCES.
Copy the parent's cl_xprtsec into the clone arguments before
creating the new client.
Fixes: 500053191297 ("SUNRPC: Plumb an API for setting transport layer security")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 4026bf55c32ff..e6b7ee48cad15 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -656,6 +656,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
}
args->servername = xprt->servername;
args->nodename = clnt->cl_nodename;
+ args->xprtsec = clnt->cl_xprtsec;
if (!args->timeout)
args->timeout = clnt->cl_timeout;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0222/1167] SUNRPC: Balance switch queue length on transport removal
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (220 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0221/1167] SUNRPC: preserve transport security " Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0223/1167] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
` (435 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 8acd94f02a960c8936df25a7af9c02c8ea87064d ]
When call_connect_status() moves a task off a transport marked for
removal, it decrements xprt->queuelen but leaves the switch's
xps_queuelen unchanged. The stale count persists after the task
finishes and skews multipath transport selection.
Decrement xps_queuelen alongside xprt->queuelen, matching the normal
transport release path.
Fixes: 6f081693e7b2 ("sunrpc: remove an offlined xprt using sysfs")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index e6b7ee48cad15..417037595f6fb 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2243,6 +2243,7 @@ call_connect_status(struct rpc_task *task)
xprt_release(task);
value = atomic_long_dec_return(&xprt->queuelen);
+ atomic_long_dec(&xps->xps_queuelen);
if (value == 0)
rpc_xprt_switch_remove_xprt(xps, saved,
true);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0223/1167] SUNRPC: Balance queue accounting when relocating a task
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (221 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0222/1167] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0224/1167] ublk: Limit dev_id/ub_number values Greg Kroah-Hartman
` (434 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit f14b157168ac106cfac6d577e08726488b1b886c ]
When rpc_task_set_transport() relocates a movable task from an
offline transport, it releases the request and drops the
transport reference without decrementing the old transport's
queuelen or the switch's xps_queuelen. Releasing the task
later only accounts for the replacement transport.
The stale counts affect transport selection and can prevent
xprt_delete_locked() from removing an otherwise idle transport.
Use rpc_task_release_xprt() to balance the previous assignment
before selecting a replacement. Pass clnt explicitly because
rpc_task_set_client() can assign a transport before tk_client
is initialized.
Fixes: 82ee41b85cef ("SUNRPC don't resend a task on an offlined transport")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 417037595f6fb..32042cb3d5c9d 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1184,7 +1184,7 @@ void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt)
(task->tk_flags & RPC_TASK_MOVEABLE)))
return;
xprt_release(task);
- xprt_put(task->tk_xprt);
+ rpc_task_release_xprt(clnt, task->tk_xprt);
}
if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN)
task->tk_xprt = rpc_task_get_first_xprt(clnt);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0224/1167] ublk: Limit dev_id/ub_number values
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (222 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0223/1167] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0225/1167] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
` (433 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Ming Lei, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Christie <michael.christie@oracle.com>
[ Upstream commit 56974c07f2c77d302fc311b0c6b95f45be76a3ae ]
The dev_id/ub_number is used for the ublk dev's char device's minor
number so it has to fit into MINORMASK. This patch adds checks to prevent
userspace from passing a number that's too large and limits what can be
allocated by the ublk_index_idr for the case where userspace has the
kernel allocate the dev_id/ub_number.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20231012150600.6198-2-michael.christie@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: e5c463e5074a ("ublk: publish a new device by its id only once it is set up")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/ublk_drv.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index ad1156e36d8aa..547492b56067a 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -504,6 +504,7 @@ static DEFINE_MUTEX(ublk_ctl_mutex);
* It can be extended to one per-user limit in future or even controlled
* by cgroup.
*/
+#define UBLK_MAX_UBLKS UBLK_MINORS
static unsigned int ublks_max = 64;
static unsigned int ublks_added; /* protected by ublk_ctl_mutex */
@@ -2158,7 +2159,8 @@ static int ublk_alloc_dev_number(struct ublk_device *ub, int idx)
if (err == -ENOSPC)
err = -EEXIST;
} else {
- err = idr_alloc(&ublk_index_idr, ub, 0, 0, GFP_NOWAIT);
+ err = idr_alloc(&ublk_index_idr, ub, 0, UBLK_MAX_UBLKS,
+ GFP_NOWAIT);
}
spin_unlock(&ublk_idr_lock);
@@ -2450,6 +2452,12 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd)
return -EINVAL;
}
+ if (header->dev_id != U32_MAX && header->dev_id >= UBLK_MAX_UBLKS) {
+ pr_warn("%s: dev id is too large. Max supported is %d\n",
+ __func__, UBLK_MAX_UBLKS - 1);
+ return -EINVAL;
+ }
+
ublk_dump_dev_info(&info);
ret = mutex_lock_killable(&ublk_ctl_mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0225/1167] ublk: publish a new device by its id only once it is set up
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (223 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0224/1167] ublk: Limit dev_id/ub_number values Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0226/1167] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
` (432 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Korenberg, Ming Lei, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Korenberg <socketpair@gmail.com>
[ Upstream commit e5c463e5074a940c644d54d8fc29aba06709aab0 ]
ADD_DEV stores the device in ublk_index_idr when it allocates the id,
and control commands find it there as soon as ublk_add_chdev() has
initialized its struct device, before the char device is added. If
dev_set_name() or cdev_device_add() then fails, ublk_add_chdev() drops
the initial reference to free the device. A DEL_DEV that found the
device meanwhile waits for ublk_ctl_mutex, then calls ublk_remove():
cdev_device_del() of a device that was never added, and a second put of
the initial reference, which frees the device under the callers still
holding references.
Reserve the id with a NULL entry, which idr_find() and the idr iterators
skip, and store the device once ublk_add_chdev() succeeded.
Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver")
Signed-off-by: Mark Korenberg <socketpair@gmail.com>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Link: https://patch.msgid.link/20261105-ublk-del-gendisk-hang-v1-1-913a91a4314d@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/ublk_drv.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 547492b56067a..2c31ab722361d 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -2152,14 +2152,18 @@ static int ublk_alloc_dev_number(struct ublk_device *ub, int idx)
int i = idx;
int err;
+ /*
+ * Only reserve the id: the device is published by
+ * ublk_publish_dev_number() once it is fully set up.
+ */
spin_lock(&ublk_idr_lock);
/* allocate id, if @id >= 0, we're requesting that specific id */
if (i >= 0) {
- err = idr_alloc(&ublk_index_idr, ub, i, i + 1, GFP_NOWAIT);
+ err = idr_alloc(&ublk_index_idr, NULL, i, i + 1, GFP_NOWAIT);
if (err == -ENOSPC)
err = -EEXIST;
} else {
- err = idr_alloc(&ublk_index_idr, ub, 0, UBLK_MAX_UBLKS,
+ err = idr_alloc(&ublk_index_idr, NULL, 0, UBLK_MAX_UBLKS,
GFP_NOWAIT);
}
spin_unlock(&ublk_idr_lock);
@@ -2170,6 +2174,19 @@ static int ublk_alloc_dev_number(struct ublk_device *ub, int idx)
return err;
}
+/*
+ * Make the device visible to control commands by its id. Before its char
+ * device is added, DEL_DEV could find it and remove a char device that was
+ * never added, and drop the reference that ublk_add_chdev() drops on
+ * failure.
+ */
+static void ublk_publish_dev_number(struct ublk_device *ub)
+{
+ spin_lock(&ublk_idr_lock);
+ WARN_ON_ONCE(idr_replace(&ublk_index_idr, ub, ub->ub_number) != NULL);
+ spin_unlock(&ublk_idr_lock);
+}
+
static void ublk_free_dev_number(struct ublk_device *ub)
{
spin_lock(&ublk_idr_lock);
@@ -2542,6 +2559,8 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd)
* ublk_add_chdev() will cleanup everything if it fails.
*/
ret = ublk_add_chdev(ub);
+ if (!ret)
+ ublk_publish_dev_number(ub);
goto out_unlock;
out_free_tag_set:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0226/1167] i40e: xsk: fix multi-buffer XDP_PASS skb construction
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (224 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0225/1167] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0227/1167] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
` (431 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chenguang Zhao, Aleksandr Loktionov,
Jason Xing, Maciej Fijalkowski, Patryk Holda, Tony Nguyen,
Björn Töpel, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chenguang Zhao <zhaochenguang@kylinos.cn>
[ Upstream commit 76b41e83e69ae4ab23cc3535e36b780ea17e76c2 ]
When AF_XDP ZC receives a multi-buffer frame and the XDP program
returns XDP_PASS, i40e_construct_skb_zc() copies frags into a new
skb. The copy used skb_frag_page() as the memcpy source (page
metadata instead of packet data) and passed a virtual address to
__skb_fill_page_desc_noacc(), which expects a struct page *.
Use skb_frag_address() for the copy, attach frags with
skb_add_rx_frag() so len/data_len/truesize are updated, and on
dev_alloc_page() failure free the skb via the shared out path so
xsk_buff_free() still runs and previously attached pages are
released by kfree_skb.
Fixes: 1c9ba9c14658 ("i40e: xsk: add RX multi-buffer support")
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Patryk Holda <patryk.holda@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-8-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
index 65f38a57b3dfe..b41537c43d678 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
@@ -318,22 +318,19 @@ static struct sk_buff *i40e_construct_skb_zc(struct i40e_ring *rx_ring,
goto out;
for (int i = 0; i < nr_frags; i++) {
- struct skb_shared_info *skinfo = skb_shinfo(skb);
skb_frag_t *frag = &sinfo->frags[i];
+ unsigned int frag_size = skb_frag_size(frag);
struct page *page;
- void *addr;
page = dev_alloc_page();
if (!page) {
dev_kfree_skb(skb);
- return NULL;
+ skb = NULL;
+ goto out;
}
- addr = page_to_virt(page);
- memcpy(addr, skb_frag_page(frag), skb_frag_size(frag));
-
- __skb_fill_page_desc_noacc(skinfo, skinfo->nr_frags++,
- addr, 0, skb_frag_size(frag));
+ memcpy(page_to_virt(page), skb_frag_address(frag), frag_size);
+ skb_add_rx_frag(skb, i, page, 0, frag_size, PAGE_SIZE);
}
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0227/1167] af_unix: Remove gc_in_progress check in unix_peek_fpl().
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (225 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0226/1167] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0228/1167] ipv6: ignore link state in gateway check Greg Kroah-Hartman
` (430 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qihang Tang, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <kuniyu@google.com>
[ Upstream commit 0edbc945eb9edd0086f25b151a79cfe4adc0dfa8 ]
unix_vertex_dead() and unix_peek_fpl() are synchronised
with unix_peek_seq to prevent GC from purging a live
socket's recvq.
unix_peek_fpl() skips the synchronisation if gc_in_progress
is false.
However, on weakly ordered arch, GC might have already
started working while the write to gc_in_progress is
buffered.
This does not occur on x86.
This is an unlikely path that happens only when AF_UNIX
fd is peeked so not worth complicating.
Instead of adding memory barriers in unix_gc() and
unix_peek_fpl(), let's simply remove the broken short-circuit.
Fixes: e5b31d988a41 ("af_unix: Give up GC if MSG_PEEK intervened.")
Reported-by: Qihang Tang <q.h.hack.winter@gmail.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261104162858.991930-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/unix/garbage.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index 338769200065e..9c1afd8507c57 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -317,9 +317,6 @@ void unix_peek_fpl(struct scm_fp_list *fpl)
if (!fpl || !fpl->count_unix)
return;
- if (!READ_ONCE(gc_in_progress))
- return;
-
/* Invalidate the final refcnt check in unix_vertex_dead(). */
spin_lock(&unix_peek_lock);
raw_write_seqcount_barrier(&unix_peek_seq);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0228/1167] ipv6: ignore link state in gateway check
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (226 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0227/1167] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0229/1167] team: Add matching error label for failed action Greg Kroah-Hartman
` (429 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yaroslav Dudkov, Hangbin Liu,
Ido Schimmel, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yaroslav Dudkov <aroslavdudkov622@gmail.com>
[ Upstream commit b76bcf3fff9332076d92de47a80d12fd3d5268e2 ]
IPv6 route cannot be added in table when all
following conditions are true:
- gateway is not link-local address
- ignore_routes_with_linkdown=1 on device
- nexthop has no carrier
- gateway is not present or covered by any route in table already
Also multipath routes addition is invalidated by kernel even
if only one of added nexthops satisfies all above conditions.
Reproducer:
ip netns add t
ip -n t link add va type veth peer name vb
ip -n t link set va up
ip -n t addr add fd00::1/64 dev va nodad
ip netns exec t sysctl -w \
net.ipv6.conf.va.ignore_routes_with_linkdown=1
ip -n t -6 route add 2001:db8::/64 via fd00::2 dev va
# added
ip -n t -6 route add 2001:db8::/64 table 100 via fd00::2 dev va
# RTNETLINK answers: No route to host
ip -n t -6 route show table all
ip netns del t
Route should be added because:
- RT6_LOOKUP_F_IGNORE_LINKSTATE in commit d5d32e4b7668
("net: ipv6: Do not consider link state for nexthop validation")
was added for this
- the same route is valid in main table (when no specifying table id
while adding route)
- fib6_nh_init() initializes nexthops with no carrier
- IPv4 already does this (fib_check_nh_v4_gw() ignores link state
using the FIB_LOOKUP_IGNORE_LINKSTATE flag)
Before commit b2c709cce682 ("ipv6: Convert gateway validation to
use fib6_info") rt6_lookup() was used for checking if nexthop is
valid, rt6_lookup called rt6_device_match() which does not check the
link state. After change rt6_lookup() to fib6_lookup()
find_match() under fib6_lookup() started to invalidate linkdown
devices, because RT6_LOOKUP_F_IGNORE_LINKSTATE is not passed to it.
Adding RT6_LOOKUP_F_IGNORE_LINKSTATE to flags for ip6_route_check_nh()
solves the problem. RT6_LOOKUP_F_IGNORE_LINKSTATE is already used
inside the first search ip6_nh_lookup_table() and fixes the
bug in second search fib6_lookup(). Also RT6_LOOKUP_F_IGNORE_LINKSTATE
isn't read inside fib6_select_path().
Fixes: b2c709cce682 ("ipv6: Convert gateway validation to use fib6_info")
Signed-off-by: Yaroslav Dudkov <aroslavdudkov622@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261104195655.1406837-2-aroslavdudkov622@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b65740b264689..1651ebf8573aa 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3436,9 +3436,9 @@ static int ip6_route_check_nh(struct net *net,
netdevice_tracker *dev_tracker,
struct inet6_dev **idev)
{
+ int flags = RT6_LOOKUP_F_IFACE | RT6_LOOKUP_F_IGNORE_LINKSTATE;
const struct in6_addr *gw_addr = &cfg->fc_gateway;
struct net_device *dev = _dev ? *_dev : NULL;
- int flags = RT6_LOOKUP_F_IFACE;
struct fib6_result res = {};
int err = -EHOSTUNREACH;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0229/1167] team: Add matching error label for failed action
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (227 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0228/1167] ipv6: ignore link state in gateway check Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0230/1167] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
` (428 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nikola Z. Ivanov, Simon Horman,
Jiri Pirko, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikola Z. Ivanov <zlatistiv@gmail.com>
[ Upstream commit aee0f01b4f118844cb126a5f27e91c2adf087c59 ]
Follow the "action" - "err_action" pairing of labels
found across the source code of team net device.
Currently in team_port_add the err_set_slave_promisc
label is reused for exiting on error when setting
allmulti level of the new slave.
Signed-off-by: Nikola Z. Ivanov <zlatistiv@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20251128072544.223645-1-zlatistiv@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: ff618cb00a64 ("team: fix promisc/allmulti leak in team_port_add error path")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/team/team_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index e9bce9cabf7ae..f28a9db42cabe 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -1310,7 +1310,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
if (err) {
if (dev->flags & IFF_PROMISC)
dev_set_promiscuity(port_dev, -1);
- goto err_set_slave_promisc;
+ goto err_set_slave_allmulti;
}
}
@@ -1337,6 +1337,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
return 0;
err_set_dev_type:
+err_set_slave_allmulti:
err_set_slave_promisc:
__team_option_inst_del_port(team, port);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0230/1167] team: fix promisc/allmulti leak in team_port_add error path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (228 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0229/1167] team: Add matching error label for failed action Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0231/1167] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
` (427 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Hangbin Liu,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit ff618cb00a645f1e3f89068c5fbda3f3a7f4ae63 ]
team_port_add() increments the port's promiscuity and allmulti
counts before calling team_dev_type_check_change(). If the latter
fails, the error path does not undo these increments, leaving the
port in promiscuous and allmulti mode even though it was not
successfully added to the team.
Undo the promiscuity increment under err_set_slave_allmulti and the
allmulti increment under err_set_dev_type, so each error label only
reverts what was successfully applied, matching the cleanup performed
by team_port_del().
With the promiscuity rollback now living under err_set_slave_allmulti,
the inline dev_set_promiscuity(port_dev, -1) in the dev_set_allmulti()
failure branch becomes redundant: that branch already jumps to
err_set_slave_allmulti, which undoes the promiscuity increment. Drop
the inline call to avoid doing it twice.
Found by source code audit.
Fixes: 0ae9cfc454ea ("team: Move team device type change at the end of team_port_add")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Link: https://patch.msgid.link/20261104015217.2222-1-lirongqing@baidu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/team/team_core.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index f28a9db42cabe..3ae6b6dab794a 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -1307,11 +1307,8 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
/* set allmulti level to new slave */
if (dev->flags & IFF_ALLMULTI) {
err = dev_set_allmulti(port_dev, 1);
- if (err) {
- if (dev->flags & IFF_PROMISC)
- dev_set_promiscuity(port_dev, -1);
+ if (err)
goto err_set_slave_allmulti;
- }
}
err = team_dev_type_check_change(dev, port_dev);
@@ -1337,7 +1334,11 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
return 0;
err_set_dev_type:
+ if (dev->flags & IFF_ALLMULTI)
+ dev_set_allmulti(port_dev, -1);
err_set_slave_allmulti:
+ if (dev->flags & IFF_PROMISC)
+ dev_set_promiscuity(port_dev, -1);
err_set_slave_promisc:
__team_option_inst_del_port(team, port);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0231/1167] net/mlx5: Lag, free steering resources on LAG destroy failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (229 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0230/1167] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0232/1167] net: protect negative destination advice with RCU Greg Kroah-Hartman
` (426 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Bloch, Shay Drori, Tariq Toukan,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Bloch <mbloch@nvidia.com>
[ Upstream commit deceb70d1303105e4368a19b251a6fd94428eb11 ]
When firmware fails to destroy LAG, driver returns before releasing the
steering resources, leaking the associated software objects.
The bond is no longer eligible for offload, and the driver cannot
prevent its teardown. Release the steering resources even if LAG
destruction fails. Preserve the error logging and return the original
error after cleanup.
Fixes: da6b0bb0fc73 ("net/mlx5: Lag, use steering to select the affinity port in LAG")
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261104183947.772195-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
index f6b1ac80c0af9..1b77440678be1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
@@ -700,7 +700,6 @@ int mlx5_deactivate_lag(struct mlx5_lag *ldev)
"Failed to deactivate VF LAG; driver restart required\n"
"Make sure all VFs are unbound prior to VF LAG activation or deactivation\n");
}
- return err;
}
if (test_bit(MLX5_LAG_MODE_FLAG_HASH_BASED, &flags)) {
@@ -710,7 +709,7 @@ int mlx5_deactivate_lag(struct mlx5_lag *ldev)
if (mlx5_lag_has_drop_rule(ldev))
mlx5_lag_drop_rule_cleanup(ldev);
- return 0;
+ return err;
}
#define MLX5_LAG_OFFLOADS_SUPPORTED_PORTS 4
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0232/1167] net: protect negative destination advice with RCU
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (230 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0231/1167] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0233/1167] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
` (425 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jiayuan Chen, Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 4b77d2792c3e482afa108c08f224ea6fa396d80b ]
SO_CNX_ADVICE calls __dst_negative_advice() while holding the socket
lock. Connected UDP sends can still invalidate or replace sk_dst_cache
without that lock. A concurrent sk_dst_check() can drop the final
destination reference and allow an RCU callback to destroy it while
__dst_negative_advice() retains only a borrowed pointer. This can cause
a use-after-free while accessing dst->ops or running the negative_advice
callback.
The writer-side ordering fixed by commit 92f1655aa2b2 ("net: fix
__dst_negative_advice() race") does not protect this reader from an
independent cache replacement.
Hold an RCU read-side critical section across the lookup and callback.
This follows the datagram release callbacks and covers IPv4, IPv6, and
XFRM advice without changing cache-reset or reference-ownership rules.
Fixes: a87cb3e48ee8 ("net: Facility to report route quality of connected sockets")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261104131744.1056562-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/sock.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 78e4bfbd3d7ae..0d31cf3652f7a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2250,10 +2250,13 @@ sk_dst_get(const struct sock *sk)
static inline void __dst_negative_advice(struct sock *sk)
{
- struct dst_entry *dst = __sk_dst_get(sk);
+ struct dst_entry *dst;
+ rcu_read_lock();
+ dst = __sk_dst_get(sk);
if (dst && dst->ops->negative_advice)
dst->ops->negative_advice(sk, dst);
+ rcu_read_unlock();
}
static inline void dst_negative_advice(struct sock *sk)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0233/1167] net: require a full socket in sock_confirm_neigh()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (231 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0232/1167] net: protect negative destination advice with RCU Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0234/1167] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
` (424 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit c78b47704934e44442f4e48bfdcc99039e3b85a5 ]
An skb can retain dst_pending_confirm after its original output and
socket owner have changed. For example, a raw MSG_CONFIRM packet can
cross veth, have a TCP request socket assigned by TPROXY, and be bridged
into gretap. Neighbor output for the outer packet then calls
sock_confirm_neigh() with the request socket in skb->sk.
The helper unconditionally treats a non-NULL skb->sk as a full socket
when accessing sk_dst_pending_confirm. TCP request and TIME_WAIT sockets
do not contain that field. This produces an out-of-bounds four-byte read
and, if the word is nonzero, an out-of-bounds four-byte zero write. A
KASAN-enabled kernel reports:
BUG: KASAN: slab-out-of-bounds in ip_finish_output2+0xc9f/0xd60
Read of size 4 at addr ffff8880bdc3d880 by task tproxy_dst_conf/1771
Require sk_fullsock() before accessing the socket field, moving the
existing helper earlier in the header to make it available here. Keep
neigh_confirm() independent of the socket type so the skb's neighbor
confirmation still works, including for socketless packets. This also
covers the IPv6, VRF, and BPF neighbor-output callers.
Fixes: 4ff0620354f2 ("net: add dst_pending_confirm flag to skbuff")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261104132900.1071940-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/sock.h | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 0d31cf3652f7a..3bec786cf6967 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2305,6 +2305,14 @@ struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
+/* This helper checks if a socket is a full socket,
+ * ie _not_ a timewait or request socket.
+ */
+static inline bool sk_fullsock(const struct sock *sk)
+{
+ return (1 << sk->sk_state) & ~(TCPF_TIME_WAIT | TCPF_NEW_SYN_RECV);
+}
+
static inline void sk_dst_confirm(struct sock *sk)
{
if (!READ_ONCE(sk->sk_dst_pending_confirm))
@@ -2316,7 +2324,8 @@ static inline void sock_confirm_neigh(struct sk_buff *skb, struct neighbour *n)
if (skb_get_dst_pending_confirm(skb)) {
struct sock *sk = skb->sk;
- if (sk && READ_ONCE(sk->sk_dst_pending_confirm))
+ if (sk && sk_fullsock(sk) &&
+ READ_ONCE(sk->sk_dst_pending_confirm))
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
neigh_confirm(n);
}
@@ -2921,14 +2930,6 @@ skb_sk_is_prefetched(struct sk_buff *skb)
#endif /* CONFIG_INET */
}
-/* This helper checks if a socket is a full socket,
- * ie _not_ a timewait or request socket.
- */
-static inline bool sk_fullsock(const struct sock *sk)
-{
- return (1 << sk->sk_state) & ~(TCPF_TIME_WAIT | TCPF_NEW_SYN_RECV);
-}
-
static inline bool
sk_is_refcounted(struct sock *sk)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0234/1167] ipvlan: make outbound skb headers writable
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (232 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0233/1167] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0235/1167] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
` (423 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit a45dbf182137275f44ad7c8bc8acd23f7af6b2cf ]
In L3 and L3S modes, ipvlan_process_v4_outbound() and
ipvlan_process_v6_outbound() hand the skb to ip_local_out() and
ip6_local_out(). The IP output path assumes it owns the network header:
__ip_local_out() rewrites tot_len and the header checksum, and
transport-mode XFRM can memmove the network header into the headroom
when xfrm_skb_check_space() finds enough room, without copying.
The skb reaching ipvlan can have its header shared with another skb,
for example after an AF_PACKET tap on the ipvlan device or a tc mirred
mirror action. pskb_network_may_pull() only makes the header linear;
it does not unshare an already linear head. The writes above then
modify the other skb. If that skb is on the receive path and its IPv4
header was already validated, IPv4 option processing can use the
modified header, write past the linear data, and corrupt
skb_shared_info.
Use skb_cow_head() before taking header pointers and entering the local
IP output path, like ip_forward() does with skb_cow() before it touches
the header. Only checking skb_header_cloned() is enough here: skbs that
TCP transmits are clones of the write-queue skb, whose header area has
been released with __skb_header_release(). Their headers are private,
so they are not copied, which avoids a reallocation for every TCP
segment sent through an ipvlan slave.
If the allocation fails, the existing error accounting and drop paths
are used. L2 mode is unaffected.
[edumazet: use skb_cow_head() instead of skb_unclone() to avoid
copying every TCP segment, reword changelog]
Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261104113530.986664-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ipvlan/ipvlan_core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 268ea41a17d52..fea77f2855e8c 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -425,7 +425,8 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)
.flowi4_mark = skb->mark,
};
- if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))
+ if (!pskb_network_may_pull(skb, sizeof(struct iphdr)) ||
+ skb_cow_head(skb, 0))
goto err;
ip4h = ip_hdr(skb);
@@ -491,7 +492,8 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
struct net_device *dev = skb->dev;
int err, ret = NET_XMIT_DROP;
- if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr))) {
+ if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr)) ||
+ skb_cow_head(skb, 0)) {
DEV_STATS_INC(dev, tx_errors);
kfree_skb(skb);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0235/1167] wifi: mac80211: mesh: dont linearize SKBs unnecessarily
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (233 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0234/1167] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0236/1167] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
` (422 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit 6a6db144d96352967623f38692dfc4b4fb814518 ]
If mesh fast-xmit cannot be used due to aggregation not
being fully set up yet, there's no need to linearize the
SKB. Avoid that, which addresses a stale pointer issue
in the caller.
Change-Id: I6b93e6c7587faf8749f8366ed574ee2b79fd47a5
Fixes: 8b0f5cb6bc7c ("wifi: mac80211: use mesh header cache to speed up mesh forwarding")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/rx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a58870b452720..30a32c8c8a564 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2755,9 +2755,6 @@ ieee80211_rx_mesh_fast_forward(struct ieee80211_sub_if_data *sdata,
if (!sta)
return false;
- if (skb_linearize(skb))
- return false;
-
tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
if (tid_tx) {
@@ -2768,6 +2765,10 @@ ieee80211_rx_mesh_fast_forward(struct ieee80211_sub_if_data *sdata,
tid_tx->last_tx = jiffies;
}
+ /* this function must not fail after this */
+ if (skb_linearize(skb))
+ return false;
+
ieee80211_aggr_check(sdata, sta, skb);
if (ieee80211_get_8023_tunnel_proto(skb->data + hdrlen,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0236/1167] ovl: release the upperdir/workdir in-use locks before the umount sync
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (234 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0235/1167] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0237/1167] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
` (421 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miklos Szeredi, Amir Goldstein,
Pavel Tikhomirov, Denis V. Lunev, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis V. Lunev <den@openvz.org>
[ Upstream commit cb6c084182d4c69b7eeff0bd519dd7e018749602 ]
The in-use locks on upperdir and workdir are released by ovl_free_fs()
from ->put_super(). generic_shutdown_super() calls sync_filesystem()
before that, and ovl_sync_fs() syncs the whole upper filesystem, so the
locks stay held across a journal commit and a cache flush of the upper
fs after the overlay is gone. With index=on a new overlay that uses the
same upperdir, or uses it as a lowerdir, fails to mount in that window:
overlayfs: upperdir is in-use as upperdir/workdir of another mount,
mount with '-o index=off' to override exclusive upperdir protection.
Userspace hits this when the last reference is not dropped by umount(2)
itself. Docker with the containerd snapshotter mounts a snapshot on a
thread with a private mount namespace for docker cp and for buildkit,
and the superblock dies when that thread exits, after the reply to the
client has gone out. The next request then gets EBUSY. The window grows
with the flush latency of the upper fs and is there even if nothing was
written through the overlay, as the mount itself dirties the upper.
->kill_sb() is called once s_active drops to zero, with no mount and no
open file left. Release the locks there, before generic_shutdown_super()
runs. What the dying superblock still does to the upper fs, the sync and
dropping its references to upper dentries and inodes, does not touch the
contents of upperdir or workdir. ovl_free_fs() still releases the locks
for a failed mount, so clear the *_locked flags to keep it from
unlocking a second time and dropping the lock of a newer mount.
This takes the sync out of the window but does not close it: the final
mntput of a dying mount namespace runs from task_work, after the exiting
thread may have reported completion. Userspace that needs the
directories free should umount(2) before saying the job is done.
Fixes: 2cac0c00a6cd ("ovl: get exclusive ownership on upper/work dirs")
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
[ sashal: refreshed the .fs_flags context line, since adedb6a00a1e (FS_ALLOW_IDMAP) is not queued ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/overlayfs.h | 1 +
fs/overlayfs/params.c | 5 +----
fs/overlayfs/super.c | 12 +++++++++++-
fs/overlayfs/util.c | 12 ++++++++++++
4 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index ceceefb6d2df5..aa48e260b7a8b 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -501,6 +501,7 @@ static inline int ovl_set_impure_dir(struct dentry *dentry)
bool ovl_inuse_trylock(struct dentry *dentry);
void ovl_inuse_unlock(struct dentry *dentry);
bool ovl_is_inuse(struct dentry *dentry);
+void ovl_inuse_unlock_all(struct ovl_fs *ofs);
bool ovl_need_index(struct dentry *dentry);
int ovl_nlink_start(struct dentry *dentry);
void ovl_nlink_end(struct dentry *dentry);
diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c
index 21d31aaef95d6..366f5bc93a071 100644
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -723,17 +723,14 @@ void ovl_free_fs(struct ovl_fs *ofs)
struct vfsmount **mounts;
unsigned i;
+ ovl_inuse_unlock_all(ofs);
iput(ofs->workbasedir_trap);
iput(ofs->indexdir_trap);
iput(ofs->workdir_trap);
dput(ofs->whiteout);
dput(ofs->indexdir);
dput(ofs->workdir);
- if (ofs->workdir_locked)
- ovl_inuse_unlock(ofs->workbasedir);
dput(ofs->workbasedir);
- if (ofs->upperdir_locked)
- ovl_inuse_unlock(ovl_upper_mnt(ofs)->mnt_root);
/* Reuse ofs->config.lowerdirs as a vfsmount array before freeing it */
mounts = (struct vfsmount **) ofs->config.lowerdirs;
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 8d00c2dc58d55..35c7ab918c314 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1524,13 +1524,23 @@ int ovl_fill_super(struct super_block *sb, struct fs_context *fc)
return err;
}
+static void ovl_kill_sb(struct super_block *sb)
+{
+ struct ovl_fs *ofs = OVL_FS(sb);
+
+ /* Nothing can modify them now, do not hold them across the sync */
+ if (ofs)
+ ovl_inuse_unlock_all(ofs);
+ kill_anon_super(sb);
+}
+
struct file_system_type ovl_fs_type = {
.owner = THIS_MODULE,
.name = "overlay",
.init_fs_context = ovl_init_fs_context,
.parameters = ovl_parameter_spec,
.fs_flags = FS_USERNS_MOUNT,
- .kill_sb = kill_anon_super,
+ .kill_sb = ovl_kill_sb,
};
MODULE_ALIAS_FS("overlay");
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 0a40a4950e9f6..77d2f712e271c 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -946,6 +946,18 @@ bool ovl_is_inuse(struct dentry *dentry)
return inuse;
}
+void ovl_inuse_unlock_all(struct ovl_fs *ofs)
+{
+ if (ofs->workdir_locked) {
+ ovl_inuse_unlock(ofs->workbasedir);
+ ofs->workdir_locked = false;
+ }
+ if (ofs->upperdir_locked) {
+ ovl_inuse_unlock(ovl_upper_mnt(ofs)->mnt_root);
+ ofs->upperdir_locked = false;
+ }
+}
+
/*
* Does this overlay dentry need to be indexed on copy up?
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0237/1167] bonding: fix slave_cnt leak on XDP enslave failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (235 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0236/1167] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0238/1167] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
` (420 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit a978095699641d4f83a32b499a981c419c94abca ]
bond_enslave() increments bond->slave_cnt before setting up XDP on the
new slave. If that setup fails (slave has no XDP support, already has
an XDP program, or dev_xdp_propagate() fails), the error path jumps to
err_sysfs_del, which never decrements slave_cnt.
Each failed enslave therefore leaves slave_cnt one too high:
- SIOCBONDINFOQUERY reports a wrong num_slaves,
- balance-rr picks slave ids beyond the end of the slave list, so
bond_get_slave_by_id() falls back to the first usable slave and
transmit is skewed toward it.
Reproducer:
ip link add bond0 type bond mode balance-rr
ip link set bond0 xdpdrv obj xdp_dummy.bpf.o sec xdp
for i in 0 1 2; do
ip link add d$i type dummy
ip link set d$i master bond0 # fails: Slave does not support XDP
done
num_slaves read via SIOCBONDINFOQUERY is 3 before this patch, 0 after.
Add an err_dec_slave_cnt label ahead of err_sysfs_del and use it from
the three XDP failure paths, which are the only failures after the
increment.
Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261104092851.688361-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/bonding/bond_main.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e3b10368b149c..32b3de334ec27 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2287,7 +2287,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
SLAVE_NL_ERR(bond_dev, slave_dev, extack,
"Slave does not support XDP");
res = -EOPNOTSUPP;
- goto err_sysfs_del;
+ goto err_dec_slave_cnt;
}
} else if (bond->xdp_prog) {
struct netdev_bpf xdp = {
@@ -2301,14 +2301,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
SLAVE_NL_ERR(bond_dev, slave_dev, extack,
"Slave has XDP program loaded, please unload before enslaving");
res = -EOPNOTSUPP;
- goto err_sysfs_del;
+ goto err_dec_slave_cnt;
}
res = slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp);
if (res < 0) {
/* ndo_bpf() sets extack error message */
slave_dbg(bond_dev, slave_dev, "Error %d calling ndo_bpf\n", res);
- goto err_sysfs_del;
+ goto err_dec_slave_cnt;
}
if (bond->xdp_prog)
bpf_prog_inc(bond->xdp_prog);
@@ -2330,6 +2330,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
return 0;
/* Undo stages on error */
+err_dec_slave_cnt:
+ WRITE_ONCE(bond->slave_cnt, bond->slave_cnt - 1);
+
err_sysfs_del:
bond_sysfs_slave_del(new_slave);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0238/1167] tun: delete the flow entries of the moved queue on detach
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (236 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0237/1167] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0239/1167] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
` (419 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Umang Pokhriyal, Willem de Bruijn,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Umang Pokhriyal <umangpokhriyall@gmail.com>
[ Upstream commit 4cc0a3f897074cea28dae38f1cd9bb230dae5d86 ]
When a queue is detached, __tun_detach() moves the last queue into the
freed slot and decrements tun->numqueues. The flow entries that point at
the old index of the moved queue, now tun->numqueues, are meant to be
deleted, but the call passes tun->numqueues + 1, an index that never
exists, so nothing is deleted.
Until those entries are refreshed by a write on their flow or age out,
tun_automq_select_queue() returns an index past the last queue, and
netdev_core_pick_tx() sends every such flow to queue 0 and warns:
tapq0 selects TX queue 3, but real number of TX queues is 3
Found with an LLM while testing how a VMM detaches tap queues when a
guest lowers its virtio-net queue pairs. With four queues, 30 flows
learned on queue 3 and queue 1 detached, all 30 went to queue 0 with the
warning; with this patch they are spread by hash and no warning is
printed (3 runs each, in a guest booted on net).
Pass tun->numqueues.
Fixes: 96442e42429e ("tuntap: choose the txq based on rxq")
Signed-off-by: Umang Pokhriyal <umangpokhriyall@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261104174240.138491-1-umangpokhriyall@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/tun.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index c3349bcff7ab1..df752791ecabd 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -671,7 +671,7 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
}
synchronize_net();
- tun_flow_delete_by_queue(tun, tun->numqueues + 1);
+ tun_flow_delete_by_queue(tun, tun->numqueues);
/* Drop read queue */
tun_queue_purge(tfile);
tun_set_real_num_queues(tun);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0239/1167] net/mlx5: macsec: Dont remove fs_id when adding a rule fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (237 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0238/1167] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0240/1167] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
` (418 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Changyul Lee, Tariq Toukan,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Changyul Lee <lcy8047@gmail.com>
[ Upstream commit 5175da73dd128520ad6d704d7fe54926ee5f658b ]
macsec_fs_tx_add_rule() and macsec_fs_rx_add_rule() clean up a failed
rule with macsec_fs_{tx,rx}_del_rule(), which also calls
macsec_fs_id_del(). The fs_id is never in the xarray at that point:
macsec_fs_id_add() is the last step of adding a rule and removes its
own entry when it fails.
macsec_fs_id_del() then dereferences NULL, through macsec_device for
the first SA of a MACsec netdev and through fs_id_found otherwise. On
RX, the SAs of one SC share an fs_id, so a failure while adding another
SA drops the reference that an existing SA holds.
Split the rule teardown from the fs_id removal and do only the teardown
on the error paths.
Fixes: d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105003419.4016283-1-lcy8047@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/lib/macsec_fs.c | 38 ++++++++++++-------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
index 3d2473d9f3eac..41cf27867fa85 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
@@ -768,13 +768,9 @@ static int macsec_fs_id_add(struct list_head *macsec_devices_list, u32 fs_id,
return err;
}
-static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
- struct mlx5_macsec_tx_rule *tx_rule,
- void *macdev)
+static void macsec_fs_tx_free_rule(struct mlx5_macsec_fs *macsec_fs,
+ struct mlx5_macsec_tx_rule *tx_rule)
{
- macsec_fs_id_del(&macsec_fs->macsec_devices_list, tx_rule->fs_id, macdev,
- &macsec_fs->sci_hash, true);
-
if (tx_rule->rule) {
mlx5_del_flow_rules(tx_rule->rule);
tx_rule->rule = NULL;
@@ -795,6 +791,15 @@ static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
macsec_fs_tx_ft_put(macsec_fs);
}
+static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
+ struct mlx5_macsec_tx_rule *tx_rule,
+ void *macdev)
+{
+ macsec_fs_id_del(&macsec_fs->macsec_devices_list, tx_rule->fs_id, macdev,
+ &macsec_fs->sci_hash, true);
+ macsec_fs_tx_free_rule(macsec_fs, tx_rule);
+}
+
#define MLX5_REFORMAT_PARAM_ADD_MACSEC_OFFSET_4_BYTES 1
static union mlx5_macsec_rule *
@@ -887,7 +892,7 @@ macsec_fs_tx_add_rule(struct mlx5_macsec_fs *macsec_fs,
goto out_spec;
err:
- macsec_fs_tx_del_rule(macsec_fs, tx_rule, macsec_ctx->secy->netdev);
+ macsec_fs_tx_free_rule(macsec_fs, tx_rule);
macsec_rule = NULL;
out_spec:
kvfree(spec);
@@ -1652,15 +1657,11 @@ static void macsec_fs_rx_ft_put(struct mlx5_macsec_fs *macsec_fs)
macsec_fs_rx_destroy(macsec_fs);
}
-static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
- struct mlx5_macsec_rx_rule *rx_rule,
- void *macdev, u32 fs_id)
+static void macsec_fs_rx_free_rule(struct mlx5_macsec_fs *macsec_fs,
+ struct mlx5_macsec_rx_rule *rx_rule)
{
int i;
- macsec_fs_id_del(&macsec_fs->macsec_devices_list, fs_id, macdev,
- &macsec_fs->fs_id_hash, false);
-
for (i = 0; i < RX_NUM_OF_RULES_PER_SA; ++i) {
if (rx_rule->rule[i]) {
mlx5_del_flow_rules(rx_rule->rule[i]);
@@ -1678,6 +1679,15 @@ static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
macsec_fs_rx_ft_put(macsec_fs);
}
+static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
+ struct mlx5_macsec_rx_rule *rx_rule,
+ void *macdev, u32 fs_id)
+{
+ macsec_fs_id_del(&macsec_fs->macsec_devices_list, fs_id, macdev,
+ &macsec_fs->fs_id_hash, false);
+ macsec_fs_rx_free_rule(macsec_fs, rx_rule);
+}
+
static void macsec_fs_rx_setup_fte(struct mlx5_flow_spec *spec,
struct mlx5_flow_act *flow_act,
struct mlx5_macsec_rule_attrs *attrs,
@@ -1837,7 +1847,7 @@ macsec_fs_rx_add_rule(struct mlx5_macsec_fs *macsec_fs,
return macsec_rule;
err:
- macsec_fs_rx_del_rule(macsec_fs, rx_rule, macsec_ctx->secy->netdev, fs_id);
+ macsec_fs_rx_free_rule(macsec_fs, rx_rule);
macsec_rule = NULL;
out_spec:
kvfree(spec);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0240/1167] ipv4: route: dont blackhole in-use routes when retiring fnhe routes
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (238 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0239/1167] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0241/1167] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
` (417 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Chase Hiltz,
Ido Schimmel, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chase Hiltz <me@chasehil.tz>
[ Upstream commit ae89f2724db1afa96a1f1b661174fc41ae1e88fa ]
When a route cached in a nexthop exception (fnhe) is replaced or
flushed, rt_bind_exception() and fnhe_flush_routes() call
dst_dev_put() on it. That sets dst->dev to blackhole_netdev and
dst->input/output to dst_discard*(), but other CPUs can still be
using the route, e.g. as a noref dst taken from the fnhe under RCU.
Packets that reach dst_input() or dst_output() after that are dropped.
If dst_dev_put() runs after a forwarded packet has entered ip_output(),
ip_skb_dst_mtu() in __ip_finish_output() can return the MTU of
blackhole_netdev (68), and ip_fragment() can then drop a DF packet and
send ICMP_FRAG_NEEDED with mtu 68 to its source.
Commit 5018c59607a5 ("ipv4: fix race condition between route lookup and
invalidation") fixed the same race in rt_cache_route() by putting the
old route on the uncached list instead of calling dst_dev_put(). Do the
same for routes retired from an fnhe. rt_flush_dev() still moves them
to blackhole_netdev when their device is unregistered.
fnhe routes are also retired on fnhe expiry (ip_del_fnhe()) and
eviction (fnhe_remove_oldest()). Those paths don't bump rt_genid, so
without the obsolete marking ipv4_dst_check() could still accept the
route. Keep marking retired routes DST_OBSOLETE_DEAD, as dst_dev_put()
did, so that users that cached them, such as sockets, look up again.
In a netns reproducer that forwards IPv4 traffic over an ip6tnl device,
with an fnhe for the destination, while the FIB keeps changing, this
patch stops the mtu 68 ICMPs and the drops.
Fixes: 95c47f9cf5e0 ("ipv4: call dst_dev_put() properly")
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Signed-off-by: Chase Hiltz <me@chasehil.tz>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261105182640.2999521-1-me@chasehil.tz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/route.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d9a44430df72d..8528786ec9603 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -583,6 +583,17 @@ static void ip_rt_build_flow_key(struct flowi4 *fl4, const struct sock *sk,
static DEFINE_SPINLOCK(fnhe_lock);
+/* Other CPUs may still be using @rt, so don't dst_dev_put() it.
+ * rt_flush_dev() handles it if its device is unregistered.
+ * Marking it dead makes ipv4_dst_check() fail for users that cached it.
+ */
+static void fnhe_retire_route(struct rtable *rt)
+{
+ WRITE_ONCE(rt->dst.obsolete, DST_OBSOLETE_DEAD);
+ rt_add_uncached_list(rt);
+ dst_release(&rt->dst);
+}
+
static void fnhe_flush_routes(struct fib_nh_exception *fnhe)
{
struct rtable *rt;
@@ -590,14 +601,12 @@ static void fnhe_flush_routes(struct fib_nh_exception *fnhe)
rt = rcu_dereference(fnhe->fnhe_rth_input);
if (rt) {
RCU_INIT_POINTER(fnhe->fnhe_rth_input, NULL);
- dst_dev_put(&rt->dst);
- dst_release(&rt->dst);
+ fnhe_retire_route(rt);
}
rt = rcu_dereference(fnhe->fnhe_rth_output);
if (rt) {
RCU_INIT_POINTER(fnhe->fnhe_rth_output, NULL);
- dst_dev_put(&rt->dst);
- dst_release(&rt->dst);
+ fnhe_retire_route(rt);
}
}
@@ -1510,10 +1519,8 @@ static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe,
if (do_cache) {
dst_hold(&rt->dst);
rcu_assign_pointer(*porig, rt);
- if (orig) {
- dst_dev_put(&orig->dst);
- dst_release(&orig->dst);
- }
+ if (orig)
+ fnhe_retire_route(orig);
ret = true;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0241/1167] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (239 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0240/1167] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0242/1167] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
` (416 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yuho Choi, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuho Choi <oss.patchbox@gmail.com>
[ Upstream commit 6a01fb125ba6474cb97f14b68fe5435d3cdd08e5 ]
In a confidential guest, kvm_arch_ptp_init() shares the clock_pair page
with the host using set_memory_decrypted(), and kvm_arch_ptp_exit()
makes it private again with set_memory_encrypted() before freeing it.
The untrusted host can make either call fail and leave the page shared.
Both paths still free the page: the init error path with __free_page(),
and kvm_arch_ptp_exit() after only a WARN_ON(). The page allocator can
then hand a page the host can still access to an unrelated user.
Leak the page in both cases instead, as was done for the same situation
in commit b9fa16949d18 ("dma-direct: Leak pages on dma_set_decrypted()
failure") and commit 03f5a999adba ("Drivers: hv: vmbus: Leak pages if
set_memory_encrypted() fails").
Fixes: 6365ba64b4dbe ("ptp: kvm: Use decrypted memory in confidential guest on x86")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
Link: https://patch.msgid.link/20261105164324.23501-2-oss.patchbox@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ptp/ptp_kvm_x86.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/ptp/ptp_kvm_x86.c b/drivers/ptp/ptp_kvm_x86.c
index 5e5b2ef785474..ab35b20dfb7df 100644
--- a/drivers/ptp/ptp_kvm_x86.c
+++ b/drivers/ptp/ptp_kvm_x86.c
@@ -36,7 +36,7 @@ int kvm_arch_ptp_init(void)
clock_pair = page_address(p);
ret = set_memory_decrypted((unsigned long)clock_pair, 1);
if (ret) {
- __free_page(p);
+ /* The page may be left shared, so leak it. */
clock_pair = NULL;
goto nofree;
}
@@ -68,8 +68,9 @@ int kvm_arch_ptp_init(void)
void kvm_arch_ptp_exit(void)
{
if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) {
- WARN_ON(set_memory_encrypted((unsigned long)clock_pair, 1));
- free_page((unsigned long)clock_pair);
+ /* Leak the page if it cannot be made private again. */
+ if (!WARN_ON(set_memory_encrypted((unsigned long)clock_pair, 1)))
+ free_page((unsigned long)clock_pair);
clock_pair = NULL;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0242/1167] net/mlx5e: Serialize TC and IPsec offload exclusion counters
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (240 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0241/1167] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0243/1167] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
` (415 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Dragos Tatulea, Tariq Toukan, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit 717dec565a5e7feab544da5aa77db9da71bc93fe ]
The counters enforcing TC and IPsec packet offload mutual exclusion are
not consistently serialized. IPsec admission conditionally takes
mode_lock for writing, while TC admission holds it only for read.
Neither release path takes the lock, and devices without an eswitch
cannot rely on it at all.
These are per-core-device counters, separate from the eswitch mode and
encapsulation reservations protected by mode_lock. Move them into
mdev->offload_block and protect their checks, increments and decrements
with a dedicated spinlock that is available even without an eswitch.
A spinlock is used because some of these functions are called from
atomic context and is a good fit because the critical sections are and
will stay really short.
IPsec admission then no longer needs mode_lock to update these counters.
Add warnings for unbalanced releases. Keep mlx5_esw_lock() for eswitch
operation admission and temporary mode/encapsulation reservations.
This was found by upstream Sashiko during review of [1], and spun-off
into a fix from the larger patch.
[1]
https://lore.kernel.org/netdev/178907726586.219967.4695695146458742597@kernel.org/
Fixes: c8e350e62fc5 ("net/mlx5e: Make TC and IPsec offloads mutually exclusive on a netdev")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-9-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/en_accel/ipsec_fs.c | 43 ++++++-------------
.../net/ethernet/mellanox/mlx5/core/en_tc.c | 18 +++++---
.../net/ethernet/mellanox/mlx5/core/main.c | 1 +
include/linux/mlx5/driver.h | 8 +++-
4 files changed, 31 insertions(+), 39 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
index 2382c71289857..3f188a834cdda 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -1825,45 +1825,26 @@ void mlx5e_accel_ipsec_fs_read_stats(struct mlx5e_priv *priv, void *ipsec_stats)
}
}
-#ifdef CONFIG_MLX5_ESWITCH
static int mlx5e_ipsec_block_tc_offload(struct mlx5_core_dev *mdev)
{
- struct mlx5_eswitch *esw = mdev->priv.eswitch;
- int err = 0;
-
- if (esw) {
- err = mlx5_esw_lock(esw);
- if (err)
- return err;
- }
-
- if (mdev->num_block_ipsec) {
- err = -EBUSY;
- goto unlock;
- }
+ int ret = 0;
- mdev->num_block_tc++;
-
-unlock:
- if (esw)
- mlx5_esw_unlock(esw);
-
- return err;
-}
-#else
-static int mlx5e_ipsec_block_tc_offload(struct mlx5_core_dev *mdev)
-{
- if (mdev->num_block_ipsec)
- return -EBUSY;
+ spin_lock_bh(&mdev->offload_block.lock);
+ if (mdev->offload_block.num_block_ipsec)
+ ret = -EBUSY;
+ else
+ mdev->offload_block.num_block_tc++;
+ spin_unlock_bh(&mdev->offload_block.lock);
- mdev->num_block_tc++;
- return 0;
+ return ret;
}
-#endif
static void mlx5e_ipsec_unblock_tc_offload(struct mlx5_core_dev *mdev)
{
- mdev->num_block_tc--;
+ spin_lock_bh(&mdev->offload_block.lock);
+ if (!WARN_ON_ONCE(!mdev->offload_block.num_block_tc))
+ mdev->offload_block.num_block_tc--;
+ spin_unlock_bh(&mdev->offload_block.lock);
}
int mlx5e_accel_ipsec_fs_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 00e269b2bc86a..4953f7883407c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -4677,16 +4677,19 @@ static bool is_tc_ipsec_order_check_needed(struct net_device *filter, struct mlx
static int mlx5e_tc_block_ipsec_offload(struct net_device *filter, struct mlx5e_priv *priv)
{
struct mlx5_core_dev *mdev = priv->mdev;
+ int ret = 0;
if (!is_tc_ipsec_order_check_needed(filter, priv))
return 0;
- if (mdev->num_block_tc)
- return -EBUSY;
-
- mdev->num_block_ipsec++;
+ spin_lock_bh(&mdev->offload_block.lock);
+ if (mdev->offload_block.num_block_tc)
+ ret = -EBUSY;
+ else
+ mdev->offload_block.num_block_ipsec++;
+ spin_unlock_bh(&mdev->offload_block.lock);
- return 0;
+ return ret;
}
static void mlx5e_tc_unblock_ipsec_offload(struct net_device *filter, struct mlx5e_priv *priv)
@@ -4694,7 +4697,10 @@ static void mlx5e_tc_unblock_ipsec_offload(struct net_device *filter, struct mlx
if (!is_tc_ipsec_order_check_needed(filter, priv))
return;
- priv->mdev->num_block_ipsec--;
+ spin_lock_bh(&priv->mdev->offload_block.lock);
+ if (!WARN_ON_ONCE(!priv->mdev->offload_block.num_block_ipsec))
+ priv->mdev->offload_block.num_block_ipsec--;
+ spin_unlock_bh(&priv->mdev->offload_block.lock);
}
int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 4b91ca429840d..b4794606a1ac4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1812,6 +1812,7 @@ int mlx5_mdev_init(struct mlx5_core_dev *dev, int profile_idx)
lockdep_register_key(&dev->lock_key);
mutex_init(&dev->intf_state_mutex);
lockdep_set_class(&dev->intf_state_mutex, &dev->lock_key);
+ spin_lock_init(&dev->offload_block.lock);
mutex_init(&dev->mlx5e_res.uplink_netdev_lock);
mutex_init(&priv->bfregs.reg_head.lock);
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index c29ecbfbf3da2..50c6a52e9f0da 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -807,8 +807,12 @@ struct mlx5_core_dev {
u32 vsc_addr;
struct mlx5_hv_vhca *hv_vhca;
struct mlx5_hwmon *hwmon;
- u64 num_block_tc;
- u64 num_block_ipsec;
+ struct {
+ /* Protects the fields below. */
+ spinlock_t lock;
+ u64 num_block_tc;
+ u64 num_block_ipsec;
+ } offload_block;
#ifdef CONFIG_MLX5_MACSEC
struct mlx5_macsec_fs *macsec_fs;
/* MACsec notifier chain to sync MACsec core and IB database */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0243/1167] fou: gue: check IP version of held packets for direct IP encapsulation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (241 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0242/1167] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0244/1167] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
` (414 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit c59f004734a2a7c0e427011db13aca524e781498 ]
For GUE version 0, gue_gro_receive() compares the base GUE header and
its optional fields with every held packet. For GUE version 1 (direct
IP encapsulation), it skips this comparison and selects the next GRO
handler only from the IP version of the incoming packet.
A held version 0 GUE packet from the same outer flow therefore stays
eligible. For example, a GUE/IPv4/UDP packet can be aggregated with a
direct IPv4/TCP packet, and inet_gro_receive() then parses the held
packet's GUE header as an IPv4 header.
Clear same_flow for held packets whose first nibble does not match the
incoming IP version. A valid version 0 GUE header always has a first
nibble between 0 and 3, so this also separates the two GUE formats.
The reverse case is already handled: the version 0 path compares the
whole base GUE header, including the version bits.
Fixes: c1e48af7960e ("gue: Implement direction IP encapsulation")
Reported-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261106195615.2498766-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/fou_core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c
index 78917f7261250..2899450bfb361 100644
--- a/net/ipv4/fou_core.c
+++ b/net/ipv4/fou_core.c
@@ -365,6 +365,18 @@ static struct sk_buff *gue_gro_receive(struct sock *sk,
default:
goto out;
}
+
+ /* Match the encapsulation format and IP version. */
+ list_for_each_entry(p, head, list) {
+ const struct iphdr *iph2;
+
+ if (!NAPI_GRO_CB(p)->same_flow)
+ continue;
+
+ iph2 = (const struct iphdr *)(p->data + off);
+ if (iph2->version != ((struct iphdr *)guehdr)->version)
+ NAPI_GRO_CB(p)->same_flow = 0;
+ }
goto next_proto;
default:
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0244/1167] udp: do not use a cross-family sk_rx_dst in early demux
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (242 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0243/1167] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0245/1167] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
` (413 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 5636e67320563be743d47706ef4914078c27edb2 ]
A dual-stack UDP socket connected to a v4-mapped address can receive
both IPv4 packets and IPv6 packets using v4-mapped addresses:
ip6_rcv_core() no longer rejects a v4-mapped source since commit
dcc32f4f183a ("ipv6: weaken the v4mapped source check"), which kept
that check only in tcp_v6_conn_request(). ipv6_portaddr_hash() hashes
v4-mapped addresses like IPv4 ones, so both early demux handlers find
the socket, and both __udp4_lib_rcv() and __udp6_lib_rcv() store their
input dst in the same sk->sk_rx_dst.
udp_v6_early_demux() validates the cached dst with dst_check(), but
ipv4_dst_check() ignores the cookie, so an IPv4 dst gets attached to
an IPv6 skb. ip6_rcv_finish_core() then skips the route lookup and
ip_local_deliver() parses the IPv6 header as an IPv4 one: the IPv6
next header and hop limit are read as a fragment offset, and the IPv4
protocol is taken from a source address byte.
The reverse direction looks possible too: per-cpu dsts of IPv6 routes
using nexthop objects have rt->sernum set, and ip6_dst_check() then
ignores the cookie, so udp_v4_early_demux() can attach an IPv6 dst to
an IPv4 skb.
Kyle Zeng reported that such a packet can reach XFRM input still
holding the prefetched, non refcounted, socket set by early demux,
which can then outlive its RCU grace period.
Only use the cached dst if its family matches the packet. Otherwise
fall back to a regular route lookup.
TCP does not have the same problem: sk_ehashfn() hashes a v4-mapped
socket with inet_ehashfn(), while IPv6 lookups use inet6_ehashfn(),
so IPv6 packets do not normally find a v4-mapped TCP socket.
Fixes: 5425077d73e0 ("net: ipv6: Add early demux handler for UDP unicast")
Fixes: c9f2c1ae123a ("udp6: fix socket leak on early demux")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261106110135.2161204-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/udp.c | 5 ++++-
net/ipv6/udp.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 025ff82addd68..56d733df392c7 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2673,8 +2673,11 @@ int udp_v4_early_demux(struct sk_buff *skb)
skb->destructor = sock_efree;
dst = rcu_dereference(sk->sk_rx_dst);
- if (dst)
+ /* A dual-stack socket can cache an IPv6 dst. */
+ if (dst && dst->ops->family == AF_INET)
dst = dst_check(dst, 0);
+ else
+ dst = NULL;
if (dst) {
u32 itag = 0;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 640452e6b6d0f..efda97a61b8b5 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1181,8 +1181,11 @@ void udp_v6_early_demux(struct sk_buff *skb)
skb->destructor = sock_efree;
dst = rcu_dereference(sk->sk_rx_dst);
- if (dst)
+ /* A dual-stack socket can cache an IPv4 dst. */
+ if (dst && dst->ops->family == AF_INET6)
dst = dst_check(dst, sk->sk_rx_dst_cookie);
+ else
+ dst = NULL;
if (dst) {
/* set noref for now.
* any place which wants to hold dst has to call
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0245/1167] net: gro: compare skb->protocol in gro_list_prepare()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (243 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0244/1167] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0246/1167] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
` (412 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Willem de Bruijn,
Eric Dumazet, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 511582022bfd07475d0daa209e6e6aa5a940740d ]
gro_list_prepare() checks whether a held packet may belong to the same
flow as the incoming one by comparing the device, VLAN tag, metadata
and the link-layer header, using dev->hard_header_len as its length.
On devices without a link-layer header (hard_header_len == 0), such as
L3 GRE tunnels, no compared byte carries the outer protocol:
skb->protocol comes from the tunnel header. Packets of different
protocols can then stay eligible, and the GRO handler selected from the
incoming skb->protocol parses the held packet with the wrong layout.
For example, take an IPv4/UDP packet held by UDP GRO and a
VLAN/IPv4/TCP packet received on the same ipgre device.
vlan_gro_receive() reads the first four bytes of the held IPv4 header
as a VLAN header. With crafted values, the held packet survives up to
tcp_gro_receive(), which uses its UDP header as a TCP header. With a
short linear part, the FIN/PSH update of the held packet's TCP flags
can then write into skb_shared_info.
The VLAN, GRE, IPv4 and IPv6 GRO handlers compare the next-protocol
field of their own header, so once the outer protocol matches, the
inner layers are checked too. Only the outermost protocol was not
compared.
Compare skb->protocol too. On Ethernet devices this is redundant with
compare_ether_header(), but it is cheap.
GUE direct IP encapsulation has a similar issue, but there both packets
have the same outer protocol, so it is fixed separately in
gue_gro_receive().
Fixes: 60769a5dcd87 ("ipv4: gre: add GRO capability")
Reported-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261109164540.3104392-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/gro.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/gro.c b/net/core/gro.c
index f2dc3e633044a..755496f53415e 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -378,6 +378,7 @@ static void gro_list_prepare(const struct list_head *head,
}
diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
+ diffs |= p->protocol != skb->protocol;
diffs |= p->vlan_all ^ skb->vlan_all;
diffs |= skb_metadata_differs(p, skb);
if (maclen == ETH_HLEN)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0246/1167] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (244 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0245/1167] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0247/1167] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
` (411 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anandu Padinhare, Lorenzo Bianconi,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anandu Padinhare <Anandu.Padinhare@electrifex.com>
[ Upstream commit 070411c1590c8172eb4d86f045d99c372f22fe23 ]
In the AF_XDP zero-copy RX path, frames that the XDP program passes to
the stack are handed over by stmmac_dispatch_skb_zc(). That function
increments rx_pkt_n instead of rx_packets since
commit 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics where necessary").
stmmac_rx_zc() already adds every processed frame to rx_pkt_n, so each
XDP_PASS frame is counted twice there, and rx_packets, which
ndo_get_stats64() reports, never counts them: on a zero-copy queue
rx_bytes grows with the passed frames while rx_packets stays still.
Count the frame in rx_packets, as the regular RX path and the code
before that commit did.
Found while testing AF_XDP zero-copy on an ADSP-SC598 (adi-dwmac,
100 Mbit/s link): rx_pkt_n grew almost twice as fast as the frames the
MAC delivered, while "ip -s link" counted almost none.
Tested on that board with a 6.18-based kernel, whose zero-copy RX
accounting matches net. An AF_XDP zero-copy socket on queue 0 received
frames of one EtherType while UDP traffic was passed to the stack. In a
run with 60 s of traffic before the change, rx_pkt_n was 1.88 times the
frames that reached the driver (MAC frames minus RX FIFO overflows) and
"ip -s link" counted 55 RX packets. In the same test with the change,
rx_pkt_n equals the frames that reached the driver and rx_packets equals
the frames passed to the stack.
Fixes: 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics where necessary")
Signed-off-by: Anandu Padinhare <Anandu.Padinhare@electrifex.com>
Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/PNYPR01MB11444552E41C2B17A992492C0FD762@PNYPR01MB11444.INDPRD01.PROD.OUTLOOK.COM
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c3ba4c5f81754..4bfddb31a512a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5031,7 +5031,7 @@ static void stmmac_dispatch_skb_zc(struct stmmac_priv *priv, u32 queue,
napi_gro_receive(&ch->rxtx_napi, skb);
u64_stats_update_begin(&rxq_stats->napi_syncp);
- u64_stats_inc(&rxq_stats->napi.rx_pkt_n);
+ u64_stats_inc(&rxq_stats->napi.rx_packets);
u64_stats_add(&rxq_stats->napi.rx_bytes, len);
u64_stats_update_end(&rxq_stats->napi_syncp);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0247/1167] udp: check frag_list IP family before using skb_segment_list()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (245 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0246/1167] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0248/1167] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
` (410 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Willem de Bruijn, Dave Miller, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 22b7cb932c6a0f7566d41072be6956cb6c8af4e1 ]
UDP fraglist GRO uses SKB_GSO_UDP_L4 for both IPv4 and IPv6.
__udp_gso_segment() reuses the frag_list skbs when the geometry of
the head skb was not modified. skb_segment_list() keeps the network
header of each frag_list skb as it was at GRO time and only adjusts
the transport header offset.
Nothing guarantees that the head skb still has the IP family of the
frag_list skbs: helpers like skb_mpls_pop() let the caller choose
the new protocol. In that case __udpv6_gso_segment_list_csum()
handles the 20 byte IPv4 header of each frag_list skb as a struct
ipv6hdr, and can write IPv6 addresses beyond its linear part.
Check the IP version of the first frag_list skb. All skbs in the
list belong to the same flow, so they share the same IP family.
Use the skb_segment() fallback on a mismatch. Regular fraglist GRO
traffic keeps the fast path.
Fixes: b936a9b8d4a5 ("net: ipv6: fix UDPv6 GSO segmentation with NAT")
Fixes: c3df39ac9b0e ("udp: ipv4: manipulate network header of NATed UDP GRO fraglist")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
[edumazet: simplified the fix, rewrote the comment and the changelog]
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/udp_offload.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index dec65fb8a0e42..0f08d7dfe6128 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -353,9 +353,14 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
}
if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) {
- /* Detect modified geometry and pass those to skb_segment. */
+ /* Detect modified geometry and pass those to skb_segment.
+ * SKB_GSO_UDP_L4 is used by both IPv4 and IPv6: also make sure
+ * the frag_list skbs still have the IP family we segment for,
+ * as their network headers are not rebuilt.
+ */
if ((skb_pagelen(gso_skb) - sizeof(*uh) == skb_shinfo(gso_skb)->gso_size) &&
- !(skb_shinfo(gso_skb)->gso_type & SKB_GSO_DODGY))
+ !(skb_shinfo(gso_skb)->gso_type & SKB_GSO_DODGY) &&
+ ip_hdr(skb_shinfo(gso_skb)->frag_list)->version == (is_ipv6 ? 6 : 4))
return __udp_gso_segment_list(gso_skb, features, is_ipv6);
ret = __skb_linearize(gso_skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0248/1167] drm/bridge: sii902x: validate I2S data lane values
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (246 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0247/1167] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0249/1167] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
` (409 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Luca Ceresoli,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 444b7116e7ef1fdb5f7db3bc1f74b20098d062d4 ]
The sil,i2s-data-lanes property reader bounds the number of entries, but
does not bound each entry's value. Those values index the four-entry
i2s_lane_id table when the audio FIFO sequence is built.
Reject unsupported lane values before indexing that table. Report the
property name and invalid value with dev_err_probe() so the diagnostic
identifies the faulty configuration.
The issue was found by our static-analysis tool.
Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20260920034833.18874-1-hppiscas@163.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/bridge/sii902x.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index 4560ae9cbce15..d72ceeaeae287 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -859,9 +859,15 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
}
codec_data.max_i2s_channels = 2 * num_lanes;
- for (i = 0; i < num_lanes; i++)
+ for (i = 0; i < num_lanes; i++) {
+ if (lanes[i] >= ARRAY_SIZE(i2s_lane_id))
+ return dev_err_probe(dev, -EINVAL,
+ "invalid sil,i2s-data-lanes value %u\n",
+ lanes[i]);
+
sii902x->audio.i2s_fifo_sequence[i] |= audio_fifo_id[i] |
i2s_lane_id[lanes[i]] | SII902X_TPI_I2S_FIFO_ENABLE;
+ }
sii902x->audio.mclk = devm_clk_get_optional(dev, "mclk");
if (IS_ERR(sii902x->audio.mclk)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0249/1167] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (247 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0248/1167] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0250/1167] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
` (408 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kavitha Daula, Juergen Gross,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kavitha Daula <kavi@edera.dev>
[ Upstream commit 704f812cdab8bbf30987653c1c76c0d2c1e135e7 ]
Both callers of gnttab_unmap_refs_sync(), free_persistent_gnts() and
xen_blkbk_unmap_purged_grants() in blkback, keep their struct
gntab_unmap_queue_data on the stack. gnttab_unmap_refs_async() sets up
the delayed work inside it with INIT_DELAYED_WORK(), so with
CONFIG_DEBUG_OBJECTS_WORK and CONFIG_DEBUG_OBJECTS_TIMERS every
persistent grant teardown warns twice, once for the work and once for
its timer:
[ 104.366085] ODEBUG: object ffffc9004020fad8 is on stack ffffc9004020c000, but NOT annotated.
[ 104.371551] WARNING: CPU: 1 PID: 48 at lib/debugobjects.c:672 lookup_object_or_alloc.part.0+0x12b/0x1f0
Call Trace:
<TASK>
__debug_object_init+0xfe/0x1a0
debug_object_init+0x38/0x50
__init_work+0x28/0x30
gnttab_unmap_refs_async+0x18/0xa0
gnttab_unmap_refs_sync+0x61/0x90
free_persistent_gnts+0x179/0x280
xen_blkbk_free_caches+0x16/0x30
xen_blkif_disconnect+0xfa/0x2d0
frontend_changed+0x90/0x680
xenbus_otherend_changed+0x80/0xb0
frontend_changed+0x14/0x20
xenwatch_thread+0x96/0x1a0
kthread+0x11d/0x250
ret_from_fork+0x29f/0x2d0
ret_from_fork_asm+0x1a/0x30
</TASK>
gnttab_unmap_refs_sync() waits for the unmap to complete before it
returns, so the work never outlives the caller's frame. Initialise it
with INIT_DELAYED_WORK_ONSTACK() when the item is on the stack and
destroy it before returning. The function is exported, so an item that
is not on the stack keeps INIT_DELAYED_WORK().
Fixes: b44166cd46e2 ("xen/grant: introduce func gnttab_unmap_refs_sync()")
Signed-off-by: Kavitha Daula <kavi@edera.dev>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261105000137.82224-1-kavithadaula@Kavithas-MacBook-Pro.local>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/xen/grant-table.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 35659bf707468..6678a38870517 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -38,6 +38,7 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/slab.h>
+#include <linux/sched/task_stack.h>
#include <linux/vmalloc.h>
#include <linux/uaccess.h>
#include <linux/io.h>
@@ -1362,12 +1363,21 @@ static void unmap_refs_callback(int result,
int gnttab_unmap_refs_sync(struct gntab_unmap_queue_data *item)
{
struct unmap_refs_callback_data data;
+ bool on_stack = object_is_on_stack(item);
init_completion(&data.completion);
item->data = &data;
item->done = &unmap_refs_callback;
- gnttab_unmap_refs_async(item);
+ /* blkback keeps @item, and so its retry work, on the stack. */
+ if (on_stack)
+ INIT_DELAYED_WORK_ONSTACK(&item->gnttab_work, gnttab_unmap_work);
+ else
+ INIT_DELAYED_WORK(&item->gnttab_work, gnttab_unmap_work);
+ item->age = 0;
+ __gnttab_unmap_refs_async(item);
wait_for_completion(&data.completion);
+ if (on_stack)
+ destroy_delayed_work_on_stack(&item->gnttab_work);
return data.result;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0250/1167] ASoC: max98090: keep the MIC boost across mic input power-up
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (248 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0249/1167] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0251/1167] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
` (407 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, LiangCheng Wang, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: LiangCheng Wang <zaq14760@gmail.com>
[ Upstream commit 58d51fa6ff1d21e79c3c340bfb3155dfa3025ca3 ]
PA1EN/PA2EN select both the MIC1/MIC2 preamp enable and its gain
(0 = off, 1 = 0 dB, 2 = +20 dB, 3 = +30 dB). "MICn Boost Volume" keeps
the selected gain in max98090->pa1en/pa2en while the input is off, and
max98090_micinput_event() writes it to the field when the "MICn Input"
widget powers up.
The event handler also reads the field back to keep the stored gain in
sync ("Update for volatile"), but it does so on POST_PMU and POST_PMD.
The widget drives PA1EN/PA2EN as a single enable bit, the low bit of
the field, so at both points DAPM has just rewritten it:
- POST_PMU: DAPM has set the field to 1, so the read-back stores
0 dB and the handler then restores 0 dB.
- POST_PMD: DAPM has cleared the low bit, so a +30 dB (3) gain reads
back as +20 dB (2).
As a result every capture starts at 0 dB: a boost set while the input is
powered down, e.g. restored by alsactl or an audio HAL at boot, never
takes effect, and one changed during capture is lost at the next
power-up.
Read the field back on PRE_PMD instead, while it still holds the active
gain, and only restore the stored gain on POST_PMU.
Tested on i.MX95 with a MAX98090 headset mic on MIC1, running NXP's
6.18.38 vendor kernel (max98090_micinput_event() is the same as in
mainline): with MIC1 Boost Volume set to 2 (+30 dB) before capture,
register 0x10 reads 0x20 (0 dB) during capture without this change and
0x60 (+30 dB) with it, and a boost changed during capture is kept for
the next capture.
Fixes: 685e42154dcf ("ASoC: Replace max98090 Device Driver")
Signed-off-by: LiangCheng Wang <zaq14760@gmail.com>
Link: https://patch.msgid.link/20261111-max98090-mic-boost-v1-1-20b9bd8816db@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/max98090.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 9253707bccde9..8d5a8bfde13b9 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -743,14 +743,6 @@ static int max98090_micinput_event(struct snd_soc_dapm_widget *w,
else
val = (val & M98090_MIC_PA2EN_MASK) >> M98090_MIC_PA2EN_SHIFT;
- if (val >= 1) {
- if (w->reg == M98090_REG_MIC1_INPUT_LEVEL) {
- max98090->pa1en = val - 1; /* Update for volatile */
- } else {
- max98090->pa2en = val - 1; /* Update for volatile */
- }
- }
-
switch (event) {
case SND_SOC_DAPM_POST_PMU:
/* If turning on, set to most recently selected volume */
@@ -759,6 +751,14 @@ static int max98090_micinput_event(struct snd_soc_dapm_widget *w,
else
val = max98090->pa2en + 1;
break;
+ case SND_SOC_DAPM_PRE_PMD:
+ if (val >= 1) {
+ if (w->reg == M98090_REG_MIC1_INPUT_LEVEL)
+ max98090->pa1en = val - 1;
+ else
+ max98090->pa2en = val - 1;
+ }
+ return 0;
case SND_SOC_DAPM_POST_PMD:
/* If turning off, turn off */
val = 0;
@@ -1108,11 +1108,13 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = {
SND_SOC_DAPM_PGA_E("MIC1 Input", M98090_REG_MIC1_INPUT_LEVEL,
M98090_MIC_PA1EN_SHIFT, 0, NULL, 0, max98090_micinput_event,
- SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD |
+ SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_PGA_E("MIC2 Input", M98090_REG_MIC2_INPUT_LEVEL,
M98090_MIC_PA2EN_SHIFT, 0, NULL, 0, max98090_micinput_event,
- SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD |
+ SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER("LINEA Mixer", SND_SOC_NOPM, 0, 0,
&max98090_linea_mixer_controls[0],
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0251/1167] tcp: Drop any segments if DEFER_CONNECT is set.
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (249 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0250/1167] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0252/1167] amt: tear down every amt device on an unregistering lower Greg Kroah-Hartman
` (406 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 44809e49177992b15708a150437d9aebc5beea9c ]
TCP Fast Open lets a client send data in its SYN. With
TCP_FASTOPEN_CONNECT and a cached Fast Open cookie, which the server
sent in the SYN-ACK of an earlier connection, the connection is set up
in two steps:
- connect() sends nothing, so that the SYN can carry the data of the
first write(). It only sets DEFER_CONNECT and inserts the socket into
the hash table in SYN_SENT.
- The first write() calls tcp_connect(), which runs tcp_connect_init()
and sends the SYN.
A socket must not accept any segment before it has sent its SYN. But
nothing on the receive path checks DEFER_CONNECT. So until the write(),
the half-initialised socket processes segments like any socket in
SYN_SENT, and a forged SYN is accepted.
Similarly, ICMP with seq matching ISN is accepted in the state.
Before commit 57889a8f6d49 ("tcp: initialize send sequence numbers
before deferring TFO"), even seq 0 message was accepted.
Drop any segments if DEFER_CONNECT is set.
Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Signed-off-by: Chris Mason <mason@kernel.org>
[kuniyu: revised DEFER_CONNECT tests and the commit message]
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261107235720.3129212-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_input.c | 9 +++++++++
net/ipv4/tcp_ipv4.c | 2 +-
net/ipv6/tcp_ipv6.c | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 4c4fd70f5e742..2efd492f40001 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6711,6 +6711,15 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
goto discard;
case TCP_SYN_SENT:
+ /* We sent nothing yet, so no segment belongs to this connection.
+ * Send no RST: it would be built from this socket, whose TCP-AO
+ * keys are not set up either.
+ */
+ if (unlikely(inet_test_bit(DEFER_CONNECT, sk))) {
+ SKB_DR_SET(reason, NOT_SPECIFIED);
+ goto discard;
+ }
+
tp->rx_opt.saw_tstamp = 0;
tcp_mstamp_refresh(tp);
queued = tcp_rcv_synsent_state_process(sk, skb, th);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index a31c9e228cdc9..6eb0270275343 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -527,7 +527,7 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED))
__NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
}
- if (sk->sk_state == TCP_CLOSE)
+ if (sk->sk_state == TCP_CLOSE || inet_test_bit(DEFER_CONNECT, sk))
goto out;
if (static_branch_unlikely(&ip4_min_ttl)) {
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 6c5d0d8c65f9e..5c7a992f291c1 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -413,7 +413,7 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (sock_owned_by_user(sk) && type != ICMPV6_PKT_TOOBIG)
__NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
- if (sk->sk_state == TCP_CLOSE)
+ if (sk->sk_state == TCP_CLOSE || inet_test_bit(DEFER_CONNECT, sk))
goto out;
if (static_branch_unlikely(&ip6_min_hopcount)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0252/1167] amt: tear down every amt device on an unregistering lower
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (250 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0251/1167] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0253/1167] net: ena: Keep the RX buffer mapped if skb allocation fails Greg Kroah-Hartman
` (405 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Omar Ramadan, Simon Horman,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Ramadan <omar@blockcast.net>
[ Upstream commit 7262e999ebec0a10ecc97ba4739f12255b7c6da8 ]
amt_device_event() acts only on the amt device that
amt_lookup_upper_dev() returns, which is the first amt device bound to
the event's lower. Several amt devices can share one lower, for
example two gateways.
On NETDEV_UNREGISTER, only the first device is unlinked and
unregistered. The others stay upper-linked to the lower, and
unregister_netdevice_many_notify() warns, because the notifier chain
must detach every upper device. They also still hold a reference on
the lower, so each is torn down only when netdev_wait_allrefs_any(),
called from netdev_run_todo(), rebroadcasts NETDEV_UNREGISTER. By then
the lower's sysfs directory is gone, so unlinking it trips a kernfs
WARN, and unregistering it from inside the rebroadcast trips the WARN
in __rtnl_unlock(). On NETDEV_CHANGEMTU, only the first device is
resized.
Walk every amt device in the lower's netns and act on each one bound
to the lower. On NETDEV_UNREGISTER, queue them all and unregister them
in one batch. amt_dellink() unlinks each device but leaves it on the
netns device list until unregister_netdevice_many(), so the walk stays
valid under RTNL.
To reproduce:
ip link add lower0 type dummy
ip link add amtg1 type amt mode gateway local 192.0.2.1 \
discovery 192.0.2.2 dev lower0
ip link add amtg2 type amt mode gateway local 192.0.2.1 \
discovery 192.0.2.2 dev lower0
ip link del lower0
Without this patch, the last command logs:
WARNING: net/core/dev.c:12773 at unregister_netdevice_many_notify+0x13e5/0x1940, CPU#3: ip/216
kernfs: can not remove 'upper_amtg2', no directory
WARNING: fs/kernfs/dir.c:1784 at kernfs_remove_by_name_ns+0xc9/0xd0, CPU#0: ip/216
WARNING: net/core/rtnetlink.c:141 at __rtnl_unlock+0xb2/0xf0, CPU#0: ip/216
WARNING: net/core/rtnetlink.c:141 at __rtnl_unlock+0xb2/0xf0, CPU#0: ip/216
With it, the commands log nothing and remove both amt devices, and
tools/testing/selftests/net/amt.sh passes on a KASAN and lockdep
kernel.
Found by a selftest for our upcoming AMT offload RFC, which deletes a
lower carrying two amt gateways, on our 6.18-based driver. The
commands above reproduce it on net.
Fixes: b9022b53adad ("amt: add control plane of amt interface")
Signed-off-by: Omar Ramadan <omar@blockcast.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261105232302.494171-1-omar@blockcast.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/amt.c | 56 ++++++++++++++++++++---------------------------
1 file changed, 24 insertions(+), 32 deletions(-)
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index ad855130b4300..d318dd9bf7671 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -3377,22 +3377,6 @@ static struct rtnl_link_ops amt_link_ops __read_mostly = {
.fill_info = amt_fill_info,
};
-static struct net_device *amt_lookup_upper_dev(struct net_device *dev)
-{
- struct net_device *upper_dev;
- struct amt_dev *amt;
-
- for_each_netdev(dev_net(dev), upper_dev) {
- if (netif_is_amt(upper_dev)) {
- amt = netdev_priv(upper_dev);
- if (amt->stream_dev == dev)
- return upper_dev;
- }
- }
-
- return NULL;
-}
-
static int amt_device_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{
@@ -3402,26 +3386,34 @@ static int amt_device_event(struct notifier_block *unused,
LIST_HEAD(list);
int new_mtu;
- upper_dev = amt_lookup_upper_dev(dev);
- if (!upper_dev)
- return NOTIFY_DONE;
- amt = netdev_priv(upper_dev);
+ /* amt_dellink() leaves each device on the netns device list until
+ * unregister_netdevice_many(), so the walk stays valid.
+ */
+ for_each_netdev(dev_net(dev), upper_dev) {
+ if (!netif_is_amt(upper_dev))
+ continue;
+ amt = netdev_priv(upper_dev);
+ if (amt->stream_dev != dev)
+ continue;
- switch (event) {
- case NETDEV_UNREGISTER:
- amt_dellink(amt->dev, &list);
- unregister_netdevice_many(&list);
- break;
- case NETDEV_CHANGEMTU:
- if (amt->mode == AMT_MODE_RELAY)
- new_mtu = dev->mtu - AMT_RELAY_HLEN;
- else
- new_mtu = dev->mtu - AMT_GW_HLEN;
+ switch (event) {
+ case NETDEV_UNREGISTER:
+ amt_dellink(amt->dev, &list);
+ break;
+ case NETDEV_CHANGEMTU:
+ if (amt->mode == AMT_MODE_RELAY)
+ new_mtu = dev->mtu - AMT_RELAY_HLEN;
+ else
+ new_mtu = dev->mtu - AMT_GW_HLEN;
- dev_set_mtu(amt->dev, new_mtu);
- break;
+ dev_set_mtu(amt->dev, new_mtu);
+ break;
+ }
}
+ if (event == NETDEV_UNREGISTER)
+ unregister_netdevice_many(&list);
+
return NOTIFY_DONE;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0253/1167] net: ena: Keep the RX buffer mapped if skb allocation fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (251 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0252/1167] amt: tear down every amt device on an unregistering lower Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0254/1167] net: ena: avoid RX copybreak for multi-descriptor packets Greg Kroah-Hartman
` (404 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Leitao, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <leitao@debian.org>
[ Upstream commit 3e8e22a1007a6337ba2400b3ea87077947005c20 ]
We are seeing the following issue in production on arm64 EC2 hosts
(m8g.metal-24xl, 64K pages, SMMUv3 in strict mode, 6.18 based kernel).
Right after a global OOM, the SMMU reports F_TRANSLATION write faults
from the ENA device, followed by a burst of:
WARNING: CPU: 48 PID: 1656834 at drivers/iommu/dma-iommu.c:1242 iommu_dma_unmap_phys+0xf4/0x108
Call trace:
iommu_dma_unmap_phys+0xf4/0x108 (P)
dma_unmap_phys+0x194/0x2a8
dma_unmap_page_attrs+0x1c/0x38
ena_io_poll+0x7bc/0x1790 [ena]
__napi_poll+0x54/0x220
net_rx_action+0x250/0x520
ena_rx_skb() unmaps the RX buffer, or takes an extra page reference to
reuse it, before napi_build_skb() allocates the skb. If the allocation
fails, it returns NULL with rx_info->page still set. ena_clean_rx_irq()
then puts the req_id back on the free list, and ena_alloc_rx_buffer()
treats the buffer as still mapped and posts its old DMA address to the
device again.
With the IOMMU in strict mode, the device then writes to an unmapped
IOVA, and the next completion of that buffer unmaps it a second time.
If the IOVA was handed to a new mapping in between, the device can
write into that buffer instead. On the reuse path, the extra page
reference is never dropped.
Allocate the skb before touching rx_info, so that a failed allocation
leaves the buffer mapped and unchanged for the refill.
Fixes: 9e5269a915a8 ("net: ena: use build_skb() in RX path")
Fixes: f7d625adeb7b ("net: ena: Add dynamic recycling mechanism for rx buffers")
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20261109-ena-rx-skb-alloc-fail-v1-1-aee2927cb51f@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/amazon/ena/ena_netdev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 2242fb1f3e0d7..f3a8b2f432248 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1006,6 +1006,10 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
buf_len = SKB_DATA_ALIGN(len + buf_offset + tailroom);
+ skb = ena_alloc_skb(rx_ring, buf_addr, buf_len);
+ if (unlikely(!skb))
+ return NULL;
+
/* If XDP isn't loaded try to reuse part of the RX buffer */
reuse_rx_buf_page = !is_xdp_loaded &&
ena_try_rx_buf_page_reuse(rx_info, buf_len, len, pkt_offset);
@@ -1013,10 +1017,6 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
if (!reuse_rx_buf_page)
ena_unmap_rx_buff_attrs(rx_ring, rx_info, DMA_ATTR_SKIP_CPU_SYNC);
- skb = ena_alloc_skb(rx_ring, buf_addr, buf_len);
- if (unlikely(!skb))
- return NULL;
-
/* Populate skb's linear part */
skb_reserve(skb, buf_offset);
skb_put(skb, len);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0254/1167] net: ena: avoid RX copybreak for multi-descriptor packets
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (252 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0253/1167] net: ena: Keep the RX buffer mapped if skb allocation fails Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0255/1167] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK Greg Kroah-Hartman
` (403 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit f3c790c34d228d46c4a05fe5d001d1bbea444e2b ]
ena_rx_skb() selects the copybreak path based on the first RX
descriptor's length without checking the number of descriptors. When
a packet spans multiple descriptors, this copies only the first
buffer into the skb and fails to recycle the remaining request IDs,
while RX cleanup advances by the full descriptor count.
Restrict copybreak to single-descriptor packets and apply the same
restriction to the rx_copybreak_pkt statistic. Multi-descriptor
packets then use the existing fragment-processing path.
Discovered by comparing the in-tree ENA driver with Amazon's
standalone ENA driver.
Compiled with W=1 under x86_64 defconfig.
Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Link: https://patch.msgid.link/20261109141343.920187-2-thnkslprpt@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index f3a8b2f432248..94937bf5d4f48 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -983,7 +983,7 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
page_offset = rx_info->page_offset;
buf_addr = page_address(rx_info->page) + page_offset;
- if (len <= rx_ring->rx_copybreak) {
+ if (len <= rx_ring->rx_copybreak && likely(descs == 1)) {
skb = ena_alloc_skb(rx_ring, NULL, len);
if (unlikely(!skb))
return NULL;
@@ -1290,7 +1290,8 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,
skb_record_rx_queue(skb, rx_ring->qid);
- if (rx_ring->ena_bufs[0].len <= rx_ring->rx_copybreak)
+ if (rx_ring->ena_bufs[0].len <= rx_ring->rx_copybreak &&
+ ena_rx_ctx.descs == 1)
rx_copybreak_pkt++;
total_len += skb->len;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0255/1167] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (253 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0254/1167] net: ena: avoid RX copybreak for multi-descriptor packets Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0256/1167] tls: fix async encryption race on weakly ordered architectures Greg Kroah-Hartman
` (402 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+9ea34da5ca6100593c90,
Kalpesh Solanki, Willem de Bruijn, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kalpesh Solanki <skalpesh942@gmail.com>
[ Upstream commit 968f2b94a5964b75d9c0da84523e42530c1891f0 ]
A userspace application can set the link type of a TUN/TAP interface
to ARPHRD_IEEE802154, ARPHRD_IEEE802154_MONITOR, or ARPHRD_6LOWPAN
via ioctl(fd, TUNSETLINK, arg) because tun_get_addr_len() explicitly
recognized these types.
However, TUN devices cannot function as genuine IEEE 802.15.4 or 6LoWPAN
interfaces:
1. They lack wpan_phy, channels, PAN IDs, and MLME operations, and tun
never initializes dev->ieee802154_ptr or dev->ml_priv. When an
unprivileged user creates a TUN interface in a user+net namespace,
changes its link type to ARPHRD_IEEE802154, and issues a netlink dump
request (such as IEEE802154_LLSEC_LIST_KEY),
ieee802154_llsec_dump_table() unconditionally dereferences
dev->ieee802154_ptr / ieee802154_mlme_ops(dev), triggering a supervisor
null-pointer dereference / general protection fault. Similar
dereferences occur across net/ieee802154/nl-phy.c (ieee802154_del_iface)
and net/ieee802154/socket.c.
2. Similarly, the 6LoWPAN subsystem assumes via lowpan_dev(dev) that
netdev_priv(dev) is struct lowpan_dev. On a TUN device, netdev_priv(dev)
is struct tun_struct. On netdev events (such as NETDEV_DOWN in
net/6lowpan/core.c:lowpan_device_event), it clears bits in
lowpan_dev(dev)->ctx.table flags, which corrupts private memory inside
tun_struct.
Rather than scattering checks across subsystems, fix the issue at the
source: disallow setting ARPHRD_IEEE802154, ARPHRD_IEEE802154_MONITOR, and
ARPHRD_6LOWPAN via TUNSETLINK by returning -EINVAL. Cast arg to unsigned
short in the comparison to prevent upper-bit truncation bypasses (e.g.
arg = ARPHRD_IEEE802154 | 0x10000).
Fixes: ff4cc3ac93e1 ("[TUNTAP]: Allow setting the linktype of the tap device from userspace")
Reported-by: syzbot+9ea34da5ca6100593c90@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9ea34da5ca6100593c90
Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261109083037.22337-1-skalpesh942@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/tun.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index df752791ecabd..e81a97944d7c9 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -3261,6 +3261,10 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
netif_info(tun, drv, tun->dev,
"Linktype set failed because interface is up\n");
ret = -EBUSY;
+ } else if ((unsigned short)arg == ARPHRD_IEEE802154 ||
+ (unsigned short)arg == ARPHRD_IEEE802154_MONITOR ||
+ (unsigned short)arg == ARPHRD_6LOWPAN) {
+ ret = -EINVAL;
} else {
ret = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE,
tun->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0256/1167] tls: fix async encryption race on weakly ordered architectures
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (254 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0255/1167] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0257/1167] igmp: use the joined device when leaving a multicast group Greg Kroah-Hartman
` (401 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ofri Zangi, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ofri Zangi <ofriz@xsightlabs.com>
[ Upstream commit a2fd526d644233d6a892c28173f07c61e21e4c93 ]
With async encryption, a record can be transmitted without its TLS
header on weakly ordered architectures such as arm64, because the
consumer may observe rec->tx_ready set while still seeing the old
scatterlist entry.
tls_encrypt_done() restores the TLS header in the scatterlist entry
(sge->offset -= prot->prepend_size, sge->length += prot->prepend_size)
and then publishes the record with smp_store_mb(rec->tx_ready, true).
On another CPU, tls_tx_records() checks rec->tx_ready with READ_ONCE()
and then reads the entry in tls_push_sg().
Nothing orders these accesses. The barrier in smp_store_mb() comes
after the tx_ready store, so it does not order the earlier scatterlist
update before it. On the reader side, READ_ONCE() does not order the
later loads of sge->offset and sge->length. The reader can therefore
see tx_ready set together with the old offset and length, and pushes
the record without its header.
Publish tx_ready with smp_store_release() in tls_encrypt_done() and read
it with smp_load_acquire() in tls_tx_records(), so that observing
tx_ready guarantees the restored scatterlist entry is visible. Keep the
full barrier that smp_store_mb() provided as an explicit smp_mb(), as
it is still needed to order the tx_ready store before the tx_list head
check.
The issue was discovered during development on an arm64 system.
A curl download test over kTLS failed with:
curl: (56) OpenSSL SSL_read: error:0A00010B:SSL routines::wrong version number, errno 0
Fixes: a42055e8d2c3 ("net/tls: Add support for async encryption of records for performance")
Signed-off-by: Ofri Zangi <ofriz@xsightlabs.com>
Link: https://patch.msgid.link/20261108-tls-async-tx-ordering-v1-1-f9a1844ca88e@xsightlabs.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tls/tls_sw.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index f797c740dcea9..e4990ccbe8ba0 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -436,7 +436,8 @@ int tls_tx_records(struct sock *sk, int flags)
/* Tx all ready records */
list_for_each_entry_safe(rec, tmp, &ctx->tx_list, list) {
- if (READ_ONCE(rec->tx_ready)) {
+ /* Pairs with smp_store_release() in tls_encrypt_done() */
+ if (smp_load_acquire(&rec->tx_ready)) {
if (flags == -1)
tx_flags = rec->tx_flags;
else
@@ -504,8 +505,14 @@ static void tls_encrypt_done(void *data, int err)
if (rec) {
struct tls_rec *first_rec;
- /* Mark the record as ready for transmission */
- smp_store_mb(rec->tx_ready, true);
+ /* Mark the record as ready for transmission. Pairs with
+ * smp_load_acquire() in tls_tx_records(): the sge
+ * offset/length update above must be visible before tx_ready.
+ */
+ smp_store_release(&rec->tx_ready, true);
+
+ /* Order the tx_ready store before the tx_list head check */
+ smp_mb();
/* If received record is at head of tx_list, schedule tx */
first_rec = list_first_entry(&ctx->tx_list,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0257/1167] igmp: use the joined device when leaving a multicast group
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (255 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0256/1167] tls: fix async encryption race on weakly ordered architectures Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0258/1167] net/mlx5: Lag, Return error when enabling MPESW without LAG support Greg Kroah-Hartman
` (400 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Junyoung Jang, Hangbin Liu,
Ido Schimmel, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junyoung Jang <graypanda.inzag@gmail.com>
[ Upstream commit 19ec8416a76c08326fe5f814410a1b43046e63be ]
When a socket joins a multicast group, the ifindex of the device is
stored in the socket's membership entry. When leaving,
ip_mc_leave_group() resolves the device again from the request. If the
request only specifies an interface address and that address is not
assigned to any device, no device is found. The membership is still
matched by address and removed from the socket, but the group is not
released on the device it was joined on.
The group is then leaked on the device until the device is unregistered.
An unprivileged user can trigger this by joining with an ifindex and a
non-local address and leaving with the address only. It can also happen
when a socket joins and leaves with the address only and the address is
removed in between.
Fix by resolving the device from the ifindex stored in the membership,
like ip_mc_drop_socket() does.
Fixes: 4eba7bb1d72d ("ipv4: igmp: Allow removing groups from a removed interface")
Signed-off-by: Junyoung Jang <graypanda.inzag@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261109125312.2208874-1-graypanda.inzag@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/igmp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 6647aa93276cb..b5737190fce34 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2354,6 +2354,8 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
iml->multi.imr_address.s_addr)
continue;
+ /* The drop request may not resolve to the joined device. */
+ in_dev = inetdev_by_index(net, iml->multi.imr_ifindex);
(void) ip_mc_leave_src(sk, iml, in_dev);
*imlp = iml->next_rcu;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0258/1167] net/mlx5: Lag, Return error when enabling MPESW without LAG support
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (256 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0257/1167] igmp: use the joined device when leaving a multicast group Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0259/1167] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Greg Kroah-Hartman
` (399 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Uri Dar, Shay Drori, Tariq Toukan,
Daniel Machon, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uri Dar <udar@nvidia.com>
[ Upstream commit a532a7049ba23edeb2e16f7bb5929314f2e47ca0 ]
When firmware reports a function as not LAG capable (lag_master=0 or
num_lag_ports < 2), mlx5_lag_add_mdev() creates no LAG object for it.
Enabling multiport E-Switch on such a device returns 0 from
mlx5_lag_mpesw_queue_work(), so
"devlink dev param set ... esw_multiport value true" reports success
although nothing was enabled, and a following "devlink dev param show"
still reports false.
Return -EOPNOTSUPP instead. mlx5_lag_mpesw_disable() ignores the return
value, so disabling keeps its current behavior.
Fixes: a32327a3a02c ("net/mlx5: Lag, Control MultiPort E-Switch single FDB mode")
Signed-off-by: Uri Dar <udar@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261110114350.2639891-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
index 8a07fdf295056..7d7b0b83435ff 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
@@ -157,7 +157,7 @@ static int mlx5_lag_mpesw_queue_work(struct mlx5_core_dev *dev,
int err = 0;
if (!ldev)
- return 0;
+ return -EOPNOTSUPP;
work = kzalloc(sizeof(*work), GFP_KERNEL);
if (!work)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0259/1167] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (257 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0258/1167] net/mlx5: Lag, Return error when enabling MPESW without LAG support Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0260/1167] amt: use ipv6_hdr() in amt_mldv1_leave_handler() Greg Kroah-Hartman
` (398 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kuniyuki Iwashima, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <kuniyu@google.com>
[ Upstream commit a9782a6f2bbd0c444689725a710d8b21eab61bc5 ]
When connection migration happens in tcp_v[46]_rcv(), a new
listener is passed to tcp_check_req().
When either of the following is true,
* the new listener queue is full and
net.ipv4.tcp_abort_on_overflow is set
* the packet has RST or (not stripped) SYN
tcp_check_req() sends RST and calls inet_csk_reqsk_queue_drop().
Here, the new listener is passed, and its qlen is decremented
wrongly while reqsk is tied to the old listener.
Once qlen underflows, inet_csk_reqsk_queue_is_full() always
return true, and the new listener stops serving.
Without the patch, this script times out while waiting for SYN+ACK
since the new listener drops SYN, but with the patch, 3WHS completes.
0 `sysctl -q net.ipv4.tcp_migrate_req=1`
+0 `sysctl -q net.ipv4.tcp_syncookies=0`
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
+0 bind(3, ..., ...) = 0
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4
+0 setsockopt(4, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
+0 bind(4, ..., ...) = 0
+0 listen(4, 128) = 0
+0 < S 0:0(0) win 32792 <mss 1000>
+0 > S. 0:0(0) ack 1 <...>
+0 listen(3, 128) = 0
+0 close(4) = 0
+.01 < R 1:1(0) win 0
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 5
+0 listen(5, 1) = 0
+.01 < S 0:0(0) win 32792 <mss 1000>
+0 > S. 0:0(0) ack 1 <...>
+0 < . 1:1(0) ack 1 win 32792
+0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0 accept(3, ..., ...) = 6
Let's pass req->rsk_listener instead.
Fixes: d4f2c86b2b7e ("tcp: Migrate TCP_NEW_SYN_RECV requests at receiving the final ACK.")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261111020304.1532064-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_minisocks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 9c7103b740f53..d1e71a60eeb09 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -858,7 +858,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
tcp_reset(sk, skb);
}
if (!fastopen) {
- bool unlinked = inet_csk_reqsk_queue_drop(sk, req);
+ bool unlinked = inet_csk_reqsk_queue_drop(req->rsk_listener, req);
if (unlinked)
__NET_INC_STATS(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0260/1167] amt: use ipv6_hdr() in amt_mldv1_leave_handler()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (258 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0259/1167] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0261/1167] net: usb: cdc_ncm: dont underflow the NDP room check Greg Kroah-Hartman
` (397 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wenbo Sun, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
[ Upstream commit 6730fe495c35f174a424ab58cf5fdf99ce4746e9 ]
In amt_mldv1_leave_handler(), which handles IPv6 MLDv1 Done
(ICMPV6_MGM_REDUCTION) messages, the source address is mistakenly
extracted via ip_hdr(skb)->saddr into host.ip4 instead of copying the
IPv6 source address from ipv6_hdr(skb)->saddr into host.ip6 as
amt_mldv1_report_handler() does.
Because amt_lookup_group() compares the full union amt_addr for v6
groups, looking up the group with a 32-bit IPv4 header slice fails to
match the group entry created by amt_mldv1_report_handler(). As a
result, amt_del_group() is not called when an MLDv1 listener leaves,
and the AMT relay continues forwarding multicast traffic until the
group timer expires.
Use ipv6_hdr(skb) and copy ip6h->saddr into host.ip6 so that MLDv1
Done messages properly match and delete the corresponding IPv6 group.
This issue was found via LLM-assisted code review, confirmed by
reproducing the stale group forwarding in a User-Mode Linux (ARCH=um)
environment, and verified in UML by testing that AMT relay multicast
forwarding stops immediately after receiving an MLDv1 Done message.
Fixes: b75f7095d4d4 ("amt: add mld report message handler")
Signed-off-by: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261111031147.105834-1-sunwenbo@cmss.chinamobile.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/amt.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index d318dd9bf7671..6d115a20a1a0c 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -2129,13 +2129,12 @@ static void amt_mldv1_leave_handler(struct amt_dev *amt, struct sk_buff *skb,
struct amt_tunnel_list *tunnel)
{
struct mld_msg *mld = (struct mld_msg *)icmp6_hdr(skb);
- struct iphdr *iph = ip_hdr(skb);
+ struct ipv6hdr *ip6h = ipv6_hdr(skb);
struct amt_group_node *gnode;
union amt_addr group, host;
memcpy(&group.ip6, &mld->mld_mca, sizeof(struct in6_addr));
- memset(&host, 0, sizeof(union amt_addr));
- host.ip4 = iph->saddr;
+ memcpy(&host.ip6, &ip6h->saddr, sizeof(struct in6_addr));
gnode = amt_lookup_group(tunnel, &group, &host, true);
if (gnode) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0261/1167] net: usb: cdc_ncm: dont underflow the NDP room check
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (259 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0260/1167] amt: use ipv6_hdr() in amt_mldv1_leave_handler() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0262/1167] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Greg Kroah-Hartman
` (396 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1994e2ecf323ed90f255,
Jiahao Xu, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiahao Xu <xujiahao@cmss.chinamobile.com>
[ Upstream commit b507828c7b6135ff7a4b69eba6e33502b4839fb9 ]
cdc_ncm_ndp16() and cdc_ncm_ndp32() verify that the new NDP and the
datagram fit into the NTB with an unsigned subtraction:
if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
return NULL;
Nothing guarantees that skb->len plus the reserve stays below
tx_curr_size, and when it does not the subtraction wraps around to a
huge value, the check passes, and the skb_put_zero() of max_ndp_size
bytes that follows overruns the NTB:
skbuff: skb_over_panic: text:ffff80000db33558 len:428 put:172
head:ffff0000c2c66100 tail:0x1ac end:0x140
kernel BUG at net/core/skbuff.c:200
skb_put_zero include/linux/skbuff.h:2595 [inline]
cdc_ncm_ndp16 drivers/net/usb/cdc_ncm.c:1132 [inline]
cdc_ncm_fill_tx_frame+0xdf0/0x30e0 drivers/net/usb/cdc_ncm.c:1309
Here tx_curr_size is 0x140 = 320, skb->len is already 256 and the
skb_put_zero() wants another 172 bytes.
Two device controlled settings make this reachable:
- dwNtbOutMaxSize = 320 caps tx_max at 320. The lower bound computed
in cdc_ncm_check_tx_max() is max_datagram_size + max_ndp_size + the
NTH header, but cdc_ncm_setup() clamps tx_max before
cdc_ncm_set_dgram_size() runs, so max_datagram_size is still 0 and
the bound is only max_ndp_size + the NTH header. It does not
reserve room for one datagram plus one NDP.
- wNdpOutAlignment = 256 is accepted by cdc_ncm_fix_modulus() as long
as it is smaller than tx_max, and cdc_ncm_align_tail() then pads the
12 byte NTH header up to 256 bytes right before this check.
An NDP can also be added to an NTB that already holds datagrams through
cdc_mbim_tx_fixup(), which uses a different signature per MBIM session.
On plain cdc_ncm the chain lookup in cdc_ncm_ndp16() returns the
existing NDP for the single signature, so there the create path is
normally reached for the first datagram of each NTB.
Rewrite the test as an addition, which cannot underflow and gives the
same answer whenever the original subtraction did not wrap.
Fixes: c78b7c586657 ("net: cdc_ncm: refactoring for tx multiplexing")
Fixes: 0fa81b304a79 ("cdc_ncm: Implement the 32-bit version of NCM Transfer Block")
Reported-by: syzbot+1994e2ecf323ed90f255@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1994e2ecf323ed90f255
Signed-off-by: Jiahao Xu <xujiahao@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261111124156.637661-1-xujiahao@cmss.chinamobile.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/usb/cdc_ncm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index e69c76cf3d667..d0deafb934383 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1125,7 +1125,7 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm_ndp16(struct cdc_ncm_ctx *ctx, struct s
cdc_ncm_align_tail(skb, ctx->tx_ndp_modulus, 0, ctx->tx_curr_size);
/* verify that there is room for the NDP and the datagram (reserve) */
- if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
+ if (skb->len + reserve + ctx->max_ndp_size > ctx->tx_curr_size)
return NULL;
/* link to it */
@@ -1180,7 +1180,7 @@ static struct usb_cdc_ncm_ndp32 *cdc_ncm_ndp32(struct cdc_ncm_ctx *ctx, struct s
cdc_ncm_align_tail(skb, ctx->tx_ndp_modulus, 0, ctx->tx_curr_size);
/* verify that there is room for the NDP and the datagram (reserve) */
- if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
+ if (skb->len + reserve + ctx->max_ndp_size > ctx->tx_curr_size)
return NULL;
/* link to it */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0262/1167] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (260 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0261/1167] net: usb: cdc_ncm: dont underflow the NDP room check Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0263/1167] net: phy: c45: select BASE-T1 type for the forced speed Greg Kroah-Hartman
` (395 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Leon Romanovsky,
Tariq Toukan, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit 5ed47bd79cebee8429d06c6640aac7ac7c4805ca ]
The mentioned commit introduced support for upper protocol selectors
(protocol & ports) to mlx5 IPsec offload. In crypto offload mode this
causes offloaded TX SAs to stop matching traffic.
In tx_add_rule(), setup_fte_upper_proto_match() is called for all
offload types and programs a match on the upper protocol (TCP/UDP) and
ports. For crypto offload, setup_fte_esp() is then called and sets
ip_protocol to ESP. The resulting rule requires both ESP as the IP
protocol and TCP/UDP ports, which no packet can satisfy, so TX crypto
offload silently stops working for such SAs.
In crypto offload mode the stack builds the ESP packet and the HW only
encrypts it, so the SA rule should only match on the SPI. Move the
setup_fte_upper_proto_match() call under the XFRM_DEV_OFFLOAD_PACKET
case, where the rule matches the plaintext packet and upper protocol
selectors apply.
The other three callers are unaffected: rx_add_rule_sa_selector() is
already only invoked for packet offload, and tx_add_policy() /
rx_add_policy() are only reachable in packet offload mode, since xfrm
policy offload is exclusively of type XFRM_DEV_OFFLOAD_PACKET.
Fixes: a7385187a386 ("net/mlx5e: IPsec, support upper protocol selector field offload")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261111081337.3129580-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
index 3f188a834cdda..27865213f3475 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -1443,7 +1443,6 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
}
setup_fte_no_frags(spec);
- setup_fte_upper_proto_match(spec, &attrs->upspec);
switch (attrs->type) {
case XFRM_DEV_OFFLOAD_CRYPTO:
@@ -1456,6 +1455,7 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
setup_fte_reg_a(spec);
break;
case XFRM_DEV_OFFLOAD_PACKET:
+ setup_fte_upper_proto_match(spec, &attrs->upspec);
setup_fte_reg_c4(spec, attrs->reqid);
err = setup_pkt_reformat(ipsec, attrs, &flow_act);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0263/1167] net: phy: c45: select BASE-T1 type for the forced speed
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (261 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0262/1167] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0264/1167] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
` (394 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Iustin Stolniceanu, Andrew Lunn,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
[ Upstream commit df501db9b18fae4d3edd534b992675f4673a938e ]
Commit 25108a834e14 ("net: phy: c45: add support for 1000BASE-T1 forced
setup") made genphy_c45_pma_setup_forced() write the type selection
field (bits 3:0) of the BASE-T1 PMA/PMD control register (1.2100) on
every forced setup: 1000BASE-T1 for SPEED_1000, and 0 for everything
else. 0 selects 100BASE-T1, so forcing a 10BASE-T1L PHY to 10 Mbit/s
now also switches its PMA to 100BASE-T1, a mode it does not implement.
Seen on an ADIN1110 (internal ADIN1100 PHY): after
ethtool -s ethX autoneg off speed 10 master-slave forced-master
1.2100 reads 0xc000 instead of the 0xc002. Since the field is not
restored by re-enabling autoneg, the PHY keeps the wrong type until
the next forced setup or reset.
Add a helper that returns the type selection value for the forced speed
and the supported link modes: 100BASE-T1, 1000BASE-T1, and 10BASE-T1L or
10BASE-T1S for SPEED_10 depending on the supported 10 Mbit/s modes. Fail
with -EINVAL when no type matches instead of writing 100BASE-T1. This
also applies to forced 2.5G, 5G and 10G on BASE-T1 capable PHYs, for
which there are no link modes yet.
The field is called "type selection" in IEEE 802.3-2022 (45.2.1.214,
Table 45-178). Keep the old STRAP names as aliases.
Tested on EVAL-ADIN1110EBZ: with this change, forcing 10 Mbit/s writes
1.2100 = 0xc002 (10BASE-T1L) instead of the invalid 0xc000.
Fixes: 25108a834e14 ("net: phy: c45: add support for 1000BASE-T1 forced setup")
Signed-off-by: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20261111100053.345196-1-iustin.stolniceanu@analog.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/phy/phy-c45.c | 46 ++++++++++++++++++++++++++++++++++-----
include/uapi/linux/mdio.h | 13 +++++++++--
2 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 747d14bf152c3..bff45e02df5e6 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -102,6 +102,36 @@ int genphy_c45_pma_baset1_setup_master_slave(struct phy_device *phydev)
}
EXPORT_SYMBOL_GPL(genphy_c45_pma_baset1_setup_master_slave);
+/* Type selection value for the BASE-T1 PMA/PMD control register (1.2100,
+ * 802.3-2022 Table 45-178) matching the forced speed. 10 Mbit/s is ambiguous
+ * between 10BASE-T1L and 10BASE-T1S, so the supported link modes decide.
+ * 2.5G, 5G and 10GBASE-T1 are not handled as there are no link modes for them
+ * yet.
+ */
+static int genphy_c45_baset1_type_sel(struct phy_device *phydev)
+{
+ switch (phydev->speed) {
+ case SPEED_10:
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT,
+ phydev->supported))
+ return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1L;
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_Full_BIT,
+ phydev->supported) ||
+ linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_Half_BIT,
+ phydev->supported) ||
+ linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT,
+ phydev->supported))
+ return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1S;
+ return -EINVAL;
+ case SPEED_100:
+ return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_100BT1;
+ case SPEED_1000:
+ return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_1000BT1;
+ default:
+ return -EINVAL;
+ }
+}
+
/**
* genphy_c45_pma_setup_forced - configures a forced speed
* @phydev: target phy_device struct
@@ -164,6 +194,16 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
return -EINVAL;
}
+ /* Resolve the type before the first write, so a speed without a
+ * matching type leaves the PHY untouched.
+ */
+ bt1_ctrl = 0;
+ if (genphy_c45_baset1_able(phydev)) {
+ bt1_ctrl = genphy_c45_baset1_type_sel(phydev);
+ if (bt1_ctrl < 0)
+ return bt1_ctrl;
+ }
+
ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1, ctrl1);
if (ret < 0)
return ret;
@@ -177,12 +217,8 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
if (ret < 0)
return ret;
- bt1_ctrl = 0;
- if (phydev->speed == SPEED_1000)
- bt1_ctrl = MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000;
-
ret = phy_modify_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_PMD_BT1_CTRL,
- MDIO_PMA_PMD_BT1_CTRL_STRAP, bt1_ctrl);
+ MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL, bt1_ctrl);
if (ret < 0)
return ret;
}
diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h
index d03863da180e7..37267437befd2 100644
--- a/include/uapi/linux/mdio.h
+++ b/include/uapi/linux/mdio.h
@@ -377,8 +377,17 @@
#define MDIO_AN_10BT1_AN_STAT_LPA_EEE_T1L 0x4000 /* 10BASE-T1L LP EEE ability advertisement */
/* BASE-T1 PMA/PMD control register */
-#define MDIO_PMA_PMD_BT1_CTRL_STRAP 0x000F /* Type selection (Strap) */
-#define MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000 0x0001 /* Select 1000BASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL 0x000F /* Type selection */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_100BT1 0x0000 /* Select 100BASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_1000BT1 0x0001 /* Select 1000BASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1L 0x0002 /* Select 10BASE-T1L */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1S 0x0003 /* Select 10BASE-T1S */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_2P5GBT1 0x0004 /* Select 2.5GBASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_5GBT1 0x0005 /* Select 5GBASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10GBT1 0x0006 /* Select 10GBASE-T1 */
+/* Legacy names, kept for userspace */
+#define MDIO_PMA_PMD_BT1_CTRL_STRAP MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL
+#define MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000 MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_1000BT1
#define MDIO_PMA_PMD_BT1_CTRL_CFG_MST 0x4000 /* MASTER-SLAVE config value */
/* 1000BASE-T1 PCS control register */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0264/1167] nsh: limit recursion in nsh_gso_segment()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (262 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0263/1167] net: phy: c45: select BASE-T1 type for the forced speed Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0265/1167] tracing: skip boot kprobe setup when no events were requested Greg Kroah-Hartman
` (393 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jiri Benc, Eric Dumazet,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 3921fb102d78a6d7aa61b8d273e097a1a8026b90 ]
nsh_gso_segment() calls skb_mac_gso_segment() for the inner packet,
which calls nsh_gso_segment() again when the next protocol is NSH,
either directly or behind an inner Ethernet header (ETH_P_TEB).
Nothing limits the depth: a GSO packet made of stacked 8-byte NSH
headers recurses once per header, and a 64KB packet can hold about
8000 of them, overflowing the kernel stack.
Such a packet can be injected with a packet socket using
PACKET_VNET_HDR, or with tun/tap or virtio_net, as nothing checks
that a GSO packet with VIRTIO_NET_HDR_F_NEEDS_CSUM carries the
protocol it claims. It is then segmented in software if the output
device does not support the GSO type:
BUG: TASK stack guard page was hit at ffffcad5c0ab3ff8 (stack is ffffcad5c0ab4000..ffffcad5c0ab8000)
Oops: stack guard page: 0000 [#1] SMP NOPTI
CPU: 3 UID: 0 PID: 337 Comm: nsh_gso Tainted: G E 7.4.0-rc1+ #118 PREEMPT(lazy)
RIP: 0010:lock_acquire (kernel/locking/lockdep.c:5902)
Call Trace:
<TASK>
skb_mac_gso_segment (include/linux/rcupdate.h:309 include/linux/rcupdate.h:849 net/core/gso.c:50)
nsh_gso_segment (net/nsh/nsh.c:110) nsh
skb_mac_gso_segment (net/core/gso.c:53)
nsh_gso_segment (net/nsh/nsh.c:110) nsh
[...]
skb_mac_gso_segment (net/core/gso.c:53)
__skb_gso_segment (net/core/gso.c:129)
validate_xmit_skb (net/core/dev.c:4238)
__dev_queue_xmit (net/core/dev.c:5087)
packet_sendmsg (net/packet/af_packet.c:3157 net/packet/af_packet.c:3189)
__sys_sendto (net/socket.c:800 net/socket.c:818 net/socket.c:2283)
__x64_sys_sendto (net/socket.c:2290 net/socket.c:2286 net/socket.c:2286)
do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:84)
entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
Use gso_recursion_inc_test(), added in commit 006c8b834aed ("net: gso:
limit recursive IP-in-IP segmentation"), with the same limit as IPv4
and IPv6. The counter is shared with them: a packet with four NSH
headers in front of an IPv4 header is still segmented, one more NSH
header and it is dropped.
The NSH -> ETH_P_TEB -> NSH route is covered as well, as each round
goes through nsh_gso_segment().
Fixes: c411ed854584 ("nsh: add GSO support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179443691180.2199510.148246238688217560@kernel.org/
Cc: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Jiri Benc <jbenc@redhat.com>
Link: https://patch.msgid.link/20261112102001.3744643-2-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/gso.h | 2 +-
net/nsh/nsh.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/net/gso.h b/include/net/gso.h
index 0749230d414ec..e311a8f5b5a72 100644
--- a/include/net/gso.h
+++ b/include/net/gso.h
@@ -19,7 +19,7 @@ struct skb_gso_cb {
int encap_level;
__wsum csum;
__u16 csum_start;
- /* Number of IPv4/IPv6 GSO handler entries for this packet. */
+ /* Number of IPv4/IPv6/NSH GSO handler entries for this packet. */
u8 recursion_counter;
};
#define SKB_GSO_CB_OFFSET 32
diff --git a/net/nsh/nsh.c b/net/nsh/nsh.c
index bfb7758063f31..dd4de50fc38c3 100644
--- a/net/nsh/nsh.c
+++ b/net/nsh/nsh.c
@@ -9,6 +9,7 @@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/gso.h>
+#include <net/ip_tunnels.h>
#include <net/nsh.h>
#include <net/tun_proto.h>
@@ -84,6 +85,12 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
skb_reset_network_header(skb);
+ /* NSH can carry NSH (directly, or in an inner Ethernet frame):
+ * limit the recursion, as IPv4 and IPv6 do.
+ */
+ if (unlikely(gso_recursion_inc_test(skb, IP_TUNNEL_RECURSION_LIMIT)))
+ goto out;
+
outer_proto = skb->protocol;
outer_hlen = skb_mac_header_len(skb);
mac_len = skb->mac_len;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0265/1167] tracing: skip boot kprobe setup when no events were requested
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (263 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0264/1167] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0266/1167] docs, kprobes: Fix bracket Greg Kroah-Hartman
` (392 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wenwen Fu, Masami Hiramatsu (Google),
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenwen Fu <wenwfu@qti.qualcomm.com>
[ Upstream commit 2388a673e9276de30c7e917fce50830e497d46cc ]
setup_boot_kprobe_events() calls enable_boot_kprobe_events() even when
the kprobe_event= boot parameter was not supplied. That call takes
event_mutex without any command-line probes to enable.
Asynchronous eval-map updates also hold event_mutex. A normal boot can
therefore wait in init_kprobe_trace() for this background work despite
having no boot probes to set up.
Return early when the boot-event buffer is empty. Keep the mutex
protection in trace_event_update_all() and retain setup for explicit
kprobe_event= parameters. Bootconfig handles its own probe enablement,
and the existing trace_eval_sync() still waits for background work
before init memory is freed.
Link: https://lore.kernel.org/all/20261106021457.2648231-1-wenwfu@qti.qualcomm.com/
Fixes: 970988e19eb0 ("tracing/kprobe: Add kprobe_event= boot parameter")
Signed-off-by: Wenwen Fu <wenwfu@qti.qualcomm.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_kprobe.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 20dbe40ab15e8..d39f41a9bdb2e 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -1911,6 +1911,9 @@ static __init void setup_boot_kprobe_events(void)
char *p, *cmd = kprobe_boot_events_buf;
int ret;
+ if (!kprobe_boot_events_buf[0])
+ return;
+
strreplace(kprobe_boot_events_buf, ',', ' ');
while (cmd && *cmd != '\0') {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0266/1167] docs, kprobes: Fix bracket
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (264 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0265/1167] tracing: skip boot kprobe setup when no events were requested Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0267/1167] KEYS: do not let an unmatched key decide the search result Greg Kroah-Hartman
` (391 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Manuel Ebner, Randy Dunlap,
Masami Hiramatsu (Google), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manuel Ebner <manuelebnerli@mailbox.org>
[ Upstream commit b91a5c16996d089cd07ceaf33b5a621cb94c2c2f ]
Remove needless ')'
Link: https://lore.kernel.org/all/20261112085511.690900-2-manuelebnerli@mailbox.org/
Fixes: a1dac767622c ("kprobes.txt: standardize document format")
Signed-off-by: Manuel Ebner <manuelebnerli@mailbox.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/trace/kprobes.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/trace/kprobes.rst b/Documentation/trace/kprobes.rst
index fc7ce76eab655..7f61c2dc56913 100644
--- a/Documentation/trace/kprobes.rst
+++ b/Documentation/trace/kprobes.rst
@@ -31,7 +31,7 @@ can trap at almost any kernel code address [1]_, specifying a handler
routine to be invoked when the breakpoint is hit.
.. [1] some parts of the kernel code can not be trapped, see
- :ref:`kprobes_blacklist`)
+ :ref:`kprobes_blacklist`
There are currently two types of probes: kprobes, and kretprobes
(also called return probes). A kprobe can be inserted on virtually
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0267/1167] KEYS: do not let an unmatched key decide the search result
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (265 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0266/1167] docs, kprobes: Fix bracket Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0268/1167] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
` (390 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jarkko Sakkinen, Guixiong Wei,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixiong Wei <weiguixiong@bytedance.com>
[ Upstream commit 143fe160178c73e43575bff4890d23f84e37146d ]
With the dns_resolver key type available, put a key named "foo" in a
fresh session keyring, revoke it, and search for "bar":
keyctl new_session >/dev/null
A=$(printf '127.0.0.1\0' | keyctl padd dns_resolver foo @s)
keyctl revoke "$A"
keyctl search @s dns_resolver bar
Results:
keyctl_search: Key has been revoked
The search returns -EKEYREVOKED even though there is no key named "bar".
It should return -ENOKEY.
A dns_resolver search walks the keys in the keyring and uses
dns_resolver_cmp() to compare their descriptions with the requested
name. When keyring_search_iterator() sees the revoked "foo" key, it
records -EKEYREVOKED in ctx->result and skips the key before comparing
its description. The search continues, but without a match it returns
the error recorded for "foo".
Call the match callback before checking for invalidated, revoked or
expired keys. A nonmatching key then leaves ctx->result alone.
Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring")
Reported-by: Jarkko Sakkinen <jarkko@kernel.org>
Closes: https://lore.kernel.org/lkml/avDG8G-Jl1YsmfCs@kernel.org/
Signed-off-by: Guixiong Wei <weiguixiong@bytedance.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261109032931.80406-2-weiguixiong@bytedance.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/keys/keyring.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index 74ed1372d22cf..c339b4073ea02 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -598,6 +598,12 @@ static int keyring_search_iterator(const void *object, void *iterator_data)
return 0;
}
+ /* A key the caller did not ask for must not decide the result. */
+ if (!ctx->match_data.cmp(key, &ctx->match_data)) {
+ kleave(" = 0 [!match]");
+ return 0;
+ }
+
/* skip invalidated, revoked and expired keys */
if (ctx->flags & KEYRING_SEARCH_DO_STATE_CHECK) {
time64_t expiry = READ_ONCE(key->expiry);
@@ -617,12 +623,6 @@ static int keyring_search_iterator(const void *object, void *iterator_data)
}
}
- /* keys that don't match */
- if (!ctx->match_data.cmp(key, &ctx->match_data)) {
- kleave(" = 0 [!match]");
- return 0;
- }
-
/* key must have search permissions */
if (!(ctx->flags & KEYRING_SEARCH_NO_CHECK_PERM) &&
key_task_permission(make_key_ref(key, ctx->possessed),
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0268/1167] ALSA: aw2-alsa: select SND_PCM
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (266 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0267/1167] KEYS: do not let an unmatched key decide the search result Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0269/1167] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() Greg Kroah-Hartman
` (389 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jude Gyimah, Takashi Iwai,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jude Gyimah <jude.gyimah87@gmail.com>
[ Upstream commit bca568589ad118a9b0bac086760baee2a41976a5 ]
Several stanzas in sound/pci/Kconfig select SND_PCM.
SND_AW2 selects nothing at all.
aw2-alsa calls snd_pcm_new, which sound/core/pcm.c provides under SND_PCM.
aw2-alsa.c:(.text+0x554): undefined reference to `snd_pcm_new'
4 symbols are undefined in all.
The driver can be built into vmlinux while SND_PCM is a module, in which
case the symbols are not there at link time.
Select rather than depend on: SND_PCM has no prompt of its own and is only
ever enabled by a select, so a depends on would leave SND_AW2
unselectable.
Reproduced on v7.3, arm64, with CONFIG_SND_AW2=y and CONFIG_SND_PCM=m.
Found with kreach, a static check that compares what Kconfig allows
against the symbols the compiled objects actually reference.
Fixes: 98f2a97f207a ("[ALSA] Emagic Audiowerk 2 ALSA driver.")
Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com>
Link: https://patch.msgid.link/20261113064614.15045-1-jude.gyimah87@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 787868c9e91b0..cb8af8b54b280 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -141,6 +141,7 @@ config SND_AU8830
config SND_AW2
tristate "Emagic Audiowerk 2"
+ select SND_PCM
help
Say Y here to include support for Emagic Audiowerk 2 soundcards.
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0269/1167] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (267 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0268/1167] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0270/1167] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps Greg Kroah-Hartman
` (388 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Beulich, Juergen Gross,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Beulich <jbeulich@suse.com>
[ Upstream commit 2b66f2cc753243a6adb3e9a5c038b0fc59ba7ec9 ]
Both decrease-reservation and populate-physmap can succeed partially. For
the former this may be pretty unlikely, but clearly the latter can hit
both out-of-memory conditions in the hypervisor or denial because of the
allocation exceeding the domain's allowance (there's no interaction with
the balloon driver here either).
In gnttab_dma_free_pages() we simply can't give back to the system what
hasn't been re-filled with backing memory. For gnttab_dma_alloc_pages()
both parts of the overall region need dealing with differently.
While no present caller of gnttab_dma_free_pages() checks its return
value, also don't use -EFAULT there: It really is an out-of-memory
condition. (In gnttab_dma_alloc_pages() -EFAULT doesn't look quite right
either, but I couldn't think of a clearly better error code there.)
Fixes: 9bdc7304f536 ("xen/grant-table: Allow allocating buffers suitable for DMA")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261110095605.369848-3-jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/xen/grant-table.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 6678a38870517..4193f0f0b7a95 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1098,6 +1098,24 @@ int gnttab_dma_alloc_pages(struct gnttab_dma_alloc_args *args)
ret = xenmem_reservation_decrease(args->nr_pages, args->frames);
if (ret != args->nr_pages) {
pr_debug("Failed to decrease reservation for DMA buffer\n");
+ if (ret >= 0) {
+ /* Free the part where decrease didn't work. */
+ size_t done = ret << PAGE_SHIFT;
+
+ if (args->coherent)
+ dma_free_coherent(args->dev, size - done,
+ args->vaddr + done,
+ args->dev_bus_addr + done);
+ else
+ dma_free_wc(args->dev, size - done,
+ args->vaddr + done,
+ args->dev_bus_addr + done);
+
+ if (!ret) /* Nothing else to do? */
+ return -EFAULT;
+
+ args->nr_pages = ret;
+ }
ret = -EFAULT;
goto fail;
}
@@ -1131,7 +1149,12 @@ int gnttab_dma_free_pages(struct gnttab_dma_alloc_args *args)
ret = xenmem_reservation_increase(args->nr_pages, args->frames);
if (ret != args->nr_pages) {
pr_debug("Failed to increase reservation for DMA buffer\n");
- ret = -EFAULT;
+ /* Can only free what has been re-filled. */
+ if (!ret)
+ return -ENOMEM;
+ if (ret > 0)
+ args->nr_pages = ret;
+ ret = -ENOMEM;
} else {
ret = 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0270/1167] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (268 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0269/1167] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0271/1167] ksmbd: deny access for an empty DACL instead of granting the request Greg Kroah-Hartman
` (387 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Nesterov,
Christian Brauner (Amutable), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit a58d647acfdc62561f3570d114025b3bf38ae41b ]
TIF_NOTIFY_SIGNAL is used to kick a task in uninterruptible sleep to
return to userspace and run task work and then go back to sleep. This
mechanism works well but breaks coredumps. dump_interrupted() only
allows fatal signals to interrupt a coredump and the whole regular write
path going to actual filesystems is impervious to TIF_NOTIFY_SIGNAL as
well.
However, both the usermodehelper pipe and the coredump socket will bail
early on TIF_NOTIFY_SIGNAL. This affects the following codepaths:
- coredump_sock_recv() -> unix_stream_read_generic()
The request/ack handshake is abandoned before any coredump data is
sent.
- anon_pipe_write() returning -ERESTARTSYS
Once the pipe is full this truncates the coredump.
- unix_stream_sendmsg() returning -ERESTARTSYS
Once the send buffer is full this truncates the coredump.
- coredump_sock_wait() -> __kernel_read()
This reports a failure that didn't happen.
- wait_for_dump_helpers() -> wait_event_interruptible()
This stops waiting for the coredump helpers.
Such truncation is entirely invisible to userspace and all uapi bits
still indicate that a successful coredump happened. A crashing process
with a bunch of file backed mappings and io_uring thrown in loses most
of the coredump data. If the NT_FILE note goes past PAGE_SIZE mappings
it's gonzo.
TIF_NOTIFY_SIGNAL is sent by io_uring for the common case. And it uses
poll without sleeping so a completion callback runs task_work_add() from
interrupt context against the task that submitted the request. This is
the task that is running the coredump. Since that task hasn't set
work_exited (it hasn't exited yet after all) TIF_NOTIFY_SIGNAL keeps
reappearing.
A coredumping task doesn't return to userspace. The task work is run at
exit. So interrupting it doesn't buy anything and just loses the
coredump which is quite valuable.
Note that this isn't specific to io_uring. There's also
klp_send_signals(), bpf_task_work_schedule_signal(), landlock's tsync
and then technically, kthread_stop() and the printk kunit test set the
bit raw.
Link: https://patch.msgid.link/20260824-work-tif_notify_signal-v2-2-6609e42b3157@kernel.org
Fixes: 12db8b690010 ("entry: Add support for TIF_NOTIFY_SIGNAL")
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Moved the guard to the top of do_coredump() (before any goto) instead of after coredump_wait(), since the monolithic function has gotos that would otherwise bypass it under clang. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/coredump.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/coredump.c b/fs/coredump.c
index 326b30421eec3..b6e9e7913bb31 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -615,6 +615,9 @@ void do_coredump(const kernel_siginfo_t *siginfo)
.cpu = raw_smp_processor_id(),
};
+ /* Task work must not cut the dump short, see signal_pending(). */
+ guard(no_notify_signal)();
+
audit_core_dumps(siginfo->si_signo);
binfmt = mm->binfmt;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0271/1167] ksmbd: deny access for an empty DACL instead of granting the request
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (269 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0270/1167] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0272/1167] media: marvell: mcam: stop DMA and cancel s_bh_work before freeing DMA buffers Greg Kroah-Hartman
` (386 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aamir Ahmed, Namjae Jeon,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aamir Ahmed <elb12345@hotmail.co.uk>
[ Upstream commit de0cffef897c1c232ed973f89928cd6c93d0b1e3 ]
smb_check_perm_dacl() returns the access mask it computes to the SMB2
CREATE handler, which uses it as the granted access for the open. For a
security descriptor whose DACL is present but contains no ACEs, the
function is supposed to deny access: an empty (non-NULL) DACL grants no
access to anyone except the object owner's implicit READ_CONTROL and
WRITE_DAC (MS-DTYP 2.4.5).
The empty-DACL branch only denies when both
- the DACL has no trailing bytes (pdacl_size == sizeof(struct smb_acl)),
and
- the request contains bits beyond READ_CONTROL / WRITE_DAC.
In every other case it takes the shared "goto err_out" with rc still 0,
which returns success without modifying *pdaccess, so the caller grants
the full requested access. Three problems follow:
- The READ_CONTROL / WRITE_DAC carve-out models the owner's implicit
rights, but the check runs before is_owner is computed, so those
rights are handed to *every* caller, not just the owner. For
READ_CONTROL the SMB2 CREATE path does not fall back to
inode_permission(), so any user can read the security descriptor of
an object whose empty DACL is meant to deny them.
- A request of exactly READ_CONTROL and/or WRITE_DAC is granted to any
caller. WRITE_DAC lets the handle rewrite the DACL.
- A DACL that declares zero ACEs but carries trailing bytes
(pdacl_size > sizeof(struct smb_acl)) skips the deny entirely and is
granted whatever was requested.
On shares where the NT ACL is the authoritative access control -- e.g.
"force user" shares, where every client maps to one POSIX identity so
POSIX cannot distinguish users -- this is an access-control bypass.
Compute is_owner before the empty-DACL branch and deny access from an
empty DACL unless the caller is the owner requesting no more than
READ_CONTROL / WRITE_DAC.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Aamir Ahmed <elb12345@hotmail.co.uk>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Moved the sid/is_owner/vfsuid setup ahead of the empty-DACL check and added the is_owner and vfsuid declarations, since the older context lacked them. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smbacl.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c
index 6147322bb4b0d..0fe46d3dd9f81 100644
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -1469,6 +1469,8 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
struct posix_acl_entry *pa_entry;
unsigned int sid_type = SIDOWNER;
unsigned short ace_size;
+ bool is_owner;
+ vfsuid_t vfsuid;
ksmbd_debug(SMB, "check permission using windows acl\n");
pntsd_size = ksmbd_vfs_get_sd_xattr(conn, idmap,
@@ -1489,19 +1491,27 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
if (pdacl_size > acl_size || pdacl_size < sizeof(struct smb_acl))
goto err_out;
+ if (!uid)
+ sid_type = SIDUNIX_USER;
+ id_to_sid(uid, sid_type, &sid);
+ vfsuid = i_uid_into_vfsuid(idmap, d_inode(path->dentry));
+ is_owner = uid == from_kuid(&init_user_ns, vfsuid_into_kuid(vfsuid));
+
if (!pdacl->num_aces) {
- if (!(pdacl_size - sizeof(struct smb_acl)) &&
- *pdaccess & ~(FILE_READ_CONTROL_LE | FILE_WRITE_DAC_LE)) {
+ /*
+ * An empty (present, zero-ACE) DACL grants no access to
+ * anyone except the object owner's implicit READ_CONTROL
+ * and WRITE_DAC (MS-DTYP 2.4.5). Deny every other caller,
+ * deny the owner any access beyond those two bits, and do
+ * not let trailing bytes after a zero-ACE DACL become an
+ * implicit grant.
+ */
+ if (!is_owner ||
+ (*pdaccess & ~(FILE_READ_CONTROL_LE | FILE_WRITE_DAC_LE)))
rc = -EACCES;
- goto err_out;
- }
goto err_out;
}
- if (!uid)
- sid_type = SIDUNIX_USER;
- id_to_sid(uid, sid_type, &sid);
-
if (*pdaccess & FILE_MAXIMAL_ACCESS_LE) {
access_bits = READ_CONTROL | WRITE_DAC | FILE_READ_ATTRIBUTES |
DELETE;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0272/1167] media: marvell: mcam: stop DMA and cancel s_bh_work before freeing DMA buffers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (270 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0271/1167] ksmbd: deny access for an empty DACL instead of granting the request Greg Kroah-Hartman
@ 2026-12-04 9:54 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0273/1167] mm: khugepaged: fix folio is used after pte_unmap_unlock() Greg Kroah-Hartman
` (385 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:54 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Fan Wu, Hans Verkuil, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fan Wu <fanwu01@zju.edu.cn>
[ Upstream commit 0f29f84317c1e35f6a9265277be33e60d3fc8c1c ]
In vmalloc mode the frame-completion IRQ queues mcam_frame_work() on
cam->s_bh_work, which memcpy()s from the dma_bufs[] that
mcam_free_dma_bufs() frees with dma_free_coherent(). mccic_shutdown()
frees those buffers without stopping the controller, so while streaming
a late frame IRQ can re-arm the work after the buffers are gone, causing a
use-after-free.
Stop the controller in mccic_shutdown() when streaming is still active
(gated on an open fd, which holds a runtime-PM reference, so the device
is powered), cancel s_bh_work in mcam_free_dma_bufs(), and move
INIT_WORK() into mccic_register() before the device can be published.
Fixes: 67a8dbbc4e04 ("[media] marvell-cam: Basic working MMP camera driver")
Cc: stable@vger.kernel.org
Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
[ sashal: Replaced cancel_work_sync() and INIT_WORK() on the bottom-half work item with tasklet_kill() and tasklet_setup() on the existing s_tasklet, since this tree still uses a tasklet. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/marvell/mcam-core.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/marvell/mcam-core.c b/drivers/media/platform/marvell/mcam-core.c
index 555f560238c9a..a1d5ea4b82889 100644
--- a/drivers/media/platform/marvell/mcam-core.c
+++ b/drivers/media/platform/marvell/mcam-core.c
@@ -406,6 +406,8 @@ static void mcam_free_dma_bufs(struct mcam_camera *cam)
{
int i;
+ tasklet_kill(&cam->s_tasklet);
+
for (i = 0; i < cam->nbufs; i++) {
dma_free_coherent(cam->dev, cam->dma_buf_size,
cam->dma_bufs[i], cam->dma_handles[i]);
@@ -1310,7 +1312,6 @@ static int mcam_setup_vb2(struct mcam_camera *cam)
break;
case B_vmalloc:
#ifdef MCAM_MODE_VMALLOC
- tasklet_setup(&cam->s_tasklet, mcam_frame_tasklet);
vq->ops = &mcam_vb2_ops;
vq->mem_ops = &vb2_vmalloc_memops;
cam->dma_setup = mcam_ctlr_dma_vmalloc;
@@ -1868,6 +1869,12 @@ int mccic_register(struct mcam_camera *cam)
goto out;
}
+#ifdef MCAM_MODE_VMALLOC
+ /* Init before sensor bind: armed by IRQ, cancelled on probe-error paths. */
+ if (cam->buffer_mode == B_vmalloc)
+ tasklet_setup(&cam->s_tasklet, mcam_frame_tasklet);
+#endif
+
mutex_init(&cam->s_mutex);
cam->state = S_NOTREADY;
mcam_set_config_needed(cam, 1);
@@ -1926,10 +1933,15 @@ void mccic_shutdown(struct mcam_camera *cam)
* take it down again will wedge the machine, which is frowned
* upon.
*/
+ mutex_lock(&cam->s_mutex);
if (!list_empty(&cam->vdev.fh_list)) {
cam_warn(cam, "Removing a device with users!\n");
+ /* Stop so the IRQ can't re-arm s_tasklet after the buffers are freed. */
+ if (cam->state == S_STREAMING)
+ mcam_ctlr_stop_dma(cam);
sensor_call(cam, core, s_power, 0);
}
+ mutex_unlock(&cam->s_mutex);
if (cam->buffer_mode == B_vmalloc)
mcam_free_dma_bufs(cam);
v4l2_ctrl_handler_free(&cam->ctrl_handler);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0273/1167] mm: khugepaged: fix folio is used after pte_unmap_unlock()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (271 preceding siblings ...)
2026-12-04 9:54 ` [PATCH 6.6 0272/1167] media: marvell: mcam: stop DMA and cancel s_bh_work before freeing DMA buffers Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0274/1167] smb: client: reclaim credits for decrypted reads with no matching mid Greg Kroah-Hartman
` (384 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vernon Yang, Andrew Morton,
David Hildenbrand (Arm), Lorenzo Stoakes (ARM), Barry Song,
Dev Jain, Lance Yang, Ryan Roberts, Zach OKeefe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vernon Yang <yanglincheng@kylinos.cn>
[ Upstream commit ba2f1f92ddfabd340c9248fd2380104f717ee8b1 ]
After the page table lock has dropped, the folio can be freed
concurrently. The trace_mm_khugepaged_scan_pmd() is left with a dangling
folio pointer.
So using the folio_pfn() before dropping the page table lock, closing
use-after-free window.
And other pre-existing bug, When the `for (i = 0; i < HPAGE_PMD_NR; i++)`
iteration to terminate and the folio operation preceding is normal, but
pfn will be incorrect. so we really only trace the PFN if it really was
problematic.
Link: https://lore.kernel.org/20260909025804.3233645-3-vernon2gm@gmail.com
Fixes: 7d2eba0557c1 ("mm: add tracepoint for scanning pages")
Signed-off-by: Vernon Yang <yanglincheng@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Cc: Barry Song <baohua@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Cc: <stable@vger.kernel.org>
[ sashal: adapted the tracepoint prototype and callers to the older code, and used folio_pfn(page_folio(page)) on the shared-PTE path since folio isn't yet assigned there. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/trace/events/huge_memory.h | 6 +++---
mm/khugepaged.c | 9 ++++++++-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h
index bf5dcc388f327..069c318130f24 100644
--- a/include/trace/events/huge_memory.h
+++ b/include/trace/events/huge_memory.h
@@ -55,10 +55,10 @@ SCAN_STATUS
TRACE_EVENT(mm_khugepaged_scan_pmd,
- TP_PROTO(struct mm_struct *mm, struct page *page, bool writable,
+ TP_PROTO(struct mm_struct *mm, unsigned long pfn, bool writable,
int referenced, int none_or_zero, int status, int unmapped),
- TP_ARGS(mm, page, writable, referenced, none_or_zero, status, unmapped),
+ TP_ARGS(mm, pfn, writable, referenced, none_or_zero, status, unmapped),
TP_STRUCT__entry(
__field(struct mm_struct *, mm)
@@ -72,7 +72,7 @@ TRACE_EVENT(mm_khugepaged_scan_pmd,
TP_fast_assign(
__entry->mm = mm;
- __entry->pfn = page ? page_to_pfn(page) : -1;
+ __entry->pfn = pfn;
__entry->writable = writable;
__entry->referenced = referenced;
__entry->none_or_zero = none_or_zero;
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 76a1145d2f191..4933bafe61760 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1243,6 +1243,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
int none_or_zero = 0, shared = 0;
struct page *page = NULL;
struct folio *folio = NULL;
+ unsigned long failed_pfn = -1;
unsigned long _address;
spinlock_t *ptl;
int node = NUMA_NO_NODE, unmapped = 0;
@@ -1324,6 +1325,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
if (cc->is_khugepaged &&
shared > khugepaged_max_ptes_shared) {
result = SCAN_EXCEED_SHARED_PTE;
+ failed_pfn = folio_pfn(page_folio(page));
count_vm_event(THP_SCAN_EXCEED_SHARED_PTE);
goto out_unmap;
}
@@ -1339,19 +1341,23 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
node = folio_nid(folio);
if (hpage_collapse_scan_abort(node, cc)) {
result = SCAN_SCAN_ABORT;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
cc->node_load[node]++;
if (!folio_test_lru(folio)) {
result = SCAN_PAGE_LRU;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
if (folio_test_locked(folio)) {
result = SCAN_PAGE_LOCK;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
if (!folio_test_anon(folio)) {
result = SCAN_PAGE_ANON;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
@@ -1367,6 +1373,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
*/
if (!is_refcount_suitable(&folio->page)) {
result = SCAN_PAGE_COUNT;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
@@ -1398,7 +1405,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
*mmap_locked = false;
}
out:
- trace_mm_khugepaged_scan_pmd(mm, &folio->page, writable, referenced,
+ trace_mm_khugepaged_scan_pmd(mm, failed_pfn, writable, referenced,
none_or_zero, result, unmapped);
return result;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0274/1167] smb: client: reclaim credits for decrypted reads with no matching mid
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (272 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0273/1167] mm: khugepaged: fix folio is used after pte_unmap_unlock() Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0275/1167] smb: client: reject short SESSION_SETUP responses Greg Kroah-Hartman
` (383 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paulo Alcantara, David Howells,
Namjae Jeon, Ronnie Sahlberg, Shyam Prasad N, Tom Talpey,
Bharath SM, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
[ Upstream commit 78f73985846465a25a7bd1d89904053661f3ca92 ]
When a decrypted SMB2 READ response carries a MessageId that matches no
outstanding request, both the inline receive_encrypted_read() and the
offloaded smb2_decrypt_offload() paths drop the frame without accounting
the credits the server granted in it. The plaintext unknown-frame path in
cifs_demultiplex_thread() already reclaims them with
smb2_add_credits_from_hdr(), so encrypted reads leak credits that the
plaintext path would not.
This also happens for legitimate frames - e.g. a reply that arrives after
the client has timed out and dropped the mid - so over a long-lived
connection the client's credit count drifts down and can eventually starve
it of the ability to issue requests. The frame is AEAD-authenticated, so
the granted credits in the decrypted header come from the real server and
are safe to apply.
Reclaim the credits from the decrypted header before dropping the frame,
and export smb2_add_credits_from_hdr() so the SMB2 receive paths can use it.
Fixes: c42a6abe3012 ("CIFS: Add capability to decrypt big read responses")
Fixes: 35cf94a39728 ("smb3: allow parallelizing decryption of reads")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: stable@vger.kernel.org
[ sashal: Adjusted the cifsproto.h context: the prototype for smb2_add_credits_from_hdr() is added in the older extern-style header, without extern as upstream has it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/cifsproto.h | 1 +
fs/smb/client/connect.c | 3 +--
fs/smb/client/smb2ops.c | 6 ++++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h
index 1f37bc2923fb8..f7b282b9e4be4 100644
--- a/fs/smb/client/cifsproto.h
+++ b/fs/smb/client/cifsproto.h
@@ -145,6 +145,7 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
bool mark_smb_session);
extern int cifs_reconnect(struct TCP_Server_Info *server,
bool mark_smb_session);
+void smb2_add_credits_from_hdr(char *buffer, struct TCP_Server_Info *server);
extern int checkSMB(char *buf, unsigned int len, struct TCP_Server_Info *srvr);
extern bool is_valid_oplock_break(char *, struct TCP_Server_Info *);
extern bool backup_cred(struct cifs_sb_info *);
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index dd76198a4a45d..3d922f5c1c0b6 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -1170,8 +1170,7 @@ cifs_handle_standard(struct TCP_Server_Info *server, struct mid_q_entry *mid)
return 0;
}
-static void
-smb2_add_credits_from_hdr(char *buffer, struct TCP_Server_Info *server)
+void smb2_add_credits_from_hdr(char *buffer, struct TCP_Server_Info *server)
{
struct smb2_hdr *shdr = (struct smb2_hdr *)buffer;
int scredits, in_flight;
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index 84acf669f88a2..186c7035f2349 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -4914,9 +4914,10 @@ static void smb2_decrypt_offload(struct work_struct *work)
dw->server->lstrp = jiffies;
mid = smb2_find_dequeue_mid(dw->server, dw->buf);
- if (mid == NULL)
+ if (mid == NULL) {
cifs_dbg(FYI, "mid not found\n");
- else {
+ smb2_add_credits_from_hdr(dw->buf, dw->server);
+ } else {
mid->decrypted = true;
rc = handle_read_data(dw->server, mid, dw->buf,
dw->server->vals->read_rsp_size,
@@ -5051,6 +5052,7 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid,
*mid = smb2_find_mid(server, buf);
if (*mid == NULL) {
cifs_dbg(FYI, "mid not found\n");
+ smb2_add_credits_from_hdr(buf, server);
rc = -1;
} else {
cifs_dbg(FYI, "mid found\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0275/1167] smb: client: reject short SESSION_SETUP responses
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (273 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0274/1167] smb: client: reclaim credits for decrypted reads with no matching mid Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0276/1167] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data() Greg Kroah-Hartman
` (382 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abdifatah Suruur, Namjae Jeon,
Paulo Alcantara, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdifatah Suruur <suruurism@gmail.com>
[ Upstream commit 4d8930afa3446041358a7db33e7b23a0bb9459b5 ]
smb2_check_message() accepts frames shorter than struct smb2_pdu when
the SMB2 status is non-zero, before the minimum-PDU check added by
b4694f269e66d. A 64-byte STATUS_MORE_PROCESSING_REQUIRED SESSION_SETUP
response is therefore accepted even though it cannot contain the
SecurityBufferOffset and SecurityBufferLength fields.
The parser then reads those fields from stale bytes left in the reused
receive buffer by an earlier frame. With a long stale
SecurityBufferLength, decode_ntlmssp_challenge() copies up to about
64 KB from beyond the receive object and sends the data back to the
server in the NTLMv2 AUTHENTICATE target info.
Reject short MPR SESSION_SETUP responses before the short-error path,
and validate SecurityBufferOffset + SecurityBufferLength against the
received response length before decoding the challenge.
The ordering bypass is not new: the short-error early return predates
b4694f269e66d, and the unvalidated SecurityBufferLength read predates
the 2016 raw NTLMSSP split in 166cea4dc3a4, so all supported stable
trees are affected. Reproduced on 6.6.87.2; the path is unchanged on
mainline.
Fixes: 5478f9ba9a34 ("CIFS: Add session setup/logoff capability for SMB2")
Cc: stable@vger.kernel.org
Signed-off-by: Abdifatah Suruur <suruurism@gmail.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
[ sashal: Replaced the missing min-PDU-length table lookup with sizeof(struct smb2_sess_setup_rsp) and adapted the offset/length check in the rawntlmssp negotiate path to the tree's older code without boff or smb_EIO1. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/smb2misc.c | 15 +++++++++++++++
fs/smb/client/smb2pdu.c | 12 ++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/fs/smb/client/smb2misc.c b/fs/smb/client/smb2misc.c
index 23320b794b177..7be338ad755b1 100644
--- a/fs/smb/client/smb2misc.c
+++ b/fs/smb/client/smb2misc.c
@@ -193,6 +193,21 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)
return 1;
}
+ /*
+ * A SESSION_SETUP response that asks for more processing carries a
+ * security blob and is parsed as a normal reply. Do not let the
+ * short-error path below accept a frame that cannot hold the fixed
+ * response fields.
+ */
+ if (command == SMB2_SESSION_SETUP_HE &&
+ shdr->Status == STATUS_MORE_PROCESSING_REQUIRED &&
+ len < sizeof(struct smb2_sess_setup_rsp)) {
+ cifs_server_dbg(VFS,
+ "%s: session setup response too short: %u < %zu\n",
+ __func__, len, sizeof(struct smb2_sess_setup_rsp));
+ return 1;
+ }
+
if (len < pdu_size) {
if ((len >= hdr_size)
&& (shdr->Status != 0)) {
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index a93421b8c3828..24863ba8a0926 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -1764,6 +1764,8 @@ SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data)
if (rc)
goto out;
+ u16 blen = le16_to_cpu(rsp->SecurityBufferLength);
+
if (offsetof(struct smb2_sess_setup_rsp, Buffer) !=
le16_to_cpu(rsp->SecurityBufferOffset)) {
cifs_dbg(VFS, "Invalid security buffer offset %d\n",
@@ -1771,8 +1773,14 @@ SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data)
rc = -EIO;
goto out;
}
- rc = decode_ntlmssp_challenge(rsp->Buffer,
- le16_to_cpu(rsp->SecurityBufferLength), ses);
+ if ((u32)le16_to_cpu(rsp->SecurityBufferOffset) + blen >
+ sess_data->iov[0].iov_len) {
+ cifs_dbg(VFS, "%s: invalid security buffer length: %u\n",
+ __func__, blen);
+ rc = -EINVAL;
+ goto out;
+ }
+ rc = decode_ntlmssp_challenge(rsp->Buffer, blen, ses);
if (rc)
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0276/1167] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (274 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0275/1167] smb: client: reject short SESSION_SETUP responses Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0277/1167] x86/cpuid: Mark CPUID function 0x23 as being indexed Greg Kroah-Hartman
` (381 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Laight, David Howells,
Marc Dionne, Eric Dumazet, David S. Miller, Jakub Kicinski,
Paolo Abeni, Simon Horman, linux-afs, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <dhowells@redhat.com>
[ Upstream commit af208f36ae22440cf6011a43cb3064fd525d85b4 ]
Fix rxrpc_kernel_send_data() to loop around if it detects a short send.
David Laight suggested doing it here rather than wrapping all the calls in
loops. Further, remove the len argument and use the iterator count instead
and return 0 on success, not the amount copied.
Note this is also a prerequisite for changing the way rxrpc_send_data()
works to return a short send rather than an error if some data was
buffered.
Fixes: 651350d10f93 ("[AF_RXRPC]: Add an interface to the AF_RXRPC module for the AFS filesystem to use")
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260824091645.415423-1-dhowells%40redhat.com
Suggested-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261006133011.531806-5-dhowells@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Kept the branch's existing abort_call/afs_abort_send_error error handling in the two AFS reply functions and only dropped the len argument from the rxrpc_kernel_send_data() calls. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/networking/rxrpc.rst | 8 +++++---
fs/afs/rxrpc.c | 8 +++-----
include/net/af_rxrpc.h | 5 ++---
net/rxrpc/rxperf.c | 25 ++++++++++---------------
net/rxrpc/sendmsg.c | 27 +++++++++++++++++++--------
5 files changed, 39 insertions(+), 34 deletions(-)
diff --git a/Documentation/networking/rxrpc.rst b/Documentation/networking/rxrpc.rst
index 257513e446184..cbb77e2fbd34a 100644
--- a/Documentation/networking/rxrpc.rst
+++ b/Documentation/networking/rxrpc.rst
@@ -873,7 +873,6 @@ The kernel interface functions are as follows:
int rxrpc_kernel_send_data(struct socket *sock,
struct rxrpc_call *call,
struct msghdr *msg,
- size_t len,
rxrpc_notify_end_tx_t notify_end_rx);
This is used to supply either the request part of a client call or the
@@ -882,14 +881,17 @@ The kernel interface functions are as follows:
exclusively to in-kernel virtual addresses. msg.msg_flags may be given
MSG_MORE if there will be subsequent data sends for this call.
- The msg must not specify a destination address, control data or any flags
- other than MSG_MORE. len is the total amount of data to transmit.
+ msg must not specify a destination address, control data or any flags
+ other than MSG_MORE or MSG_WAITALL.
notify_end_rx can be NULL or it can be used to specify a function to be
called when the call changes state to end the Tx phase. This function is
called with a spinlock held to prevent the last DATA packet from being
transmitted until the function returns.
+ It returns 0 if all the provided data has been buffered and a negative
+ error code on failure.
+
(#) Receive data from a call::
int rxrpc_kernel_recv_data(struct socket *sock,
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 9f312f29bb4bd..22f2b22bd0455 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -411,8 +411,7 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp)
msg.msg_controllen = 0;
msg.msg_flags = MSG_WAITALL | (call->write_iter ? MSG_MORE : 0);
- ret = rxrpc_kernel_send_data(call->net->socket, rxcall,
- &msg, call->request_size,
+ ret = rxrpc_kernel_send_data(call->net->socket, rxcall, &msg,
afs_notify_end_request_tx);
if (ret < 0)
goto error_do_abort;
@@ -424,7 +423,6 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp)
ret = rxrpc_kernel_send_data(call->net->socket,
call->rxcall, &msg,
- iov_iter_count(&msg.msg_iter),
afs_notify_end_request_tx);
*call->write_iter = msg.msg_iter;
@@ -883,7 +881,7 @@ void afs_send_empty_reply(struct afs_call *call)
msg.msg_controllen = 0;
msg.msg_flags = 0;
- ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, 0,
+ ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg,
afs_notify_end_reply_tx);
if (ret < 0) {
rxrpc_kernel_abort_call(net->socket, call->rxcall,
@@ -916,7 +914,7 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len)
msg.msg_controllen = 0;
msg.msg_flags = 0;
- ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, len,
+ ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg,
afs_notify_end_reply_tx);
if (ret < 0) {
rxrpc_kernel_abort_call(net->socket, call->rxcall,
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h
index 051429e8987c8..4716bfb5ecce2 100644
--- a/include/net/af_rxrpc.h
+++ b/include/net/af_rxrpc.h
@@ -56,9 +56,8 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,
bool upgrade,
enum rxrpc_interruptibility interruptibility,
unsigned int debug_id);
-int rxrpc_kernel_send_data(struct socket *, struct rxrpc_call *,
- struct msghdr *, size_t,
- rxrpc_notify_end_tx_t);
+int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
+ struct msghdr *msg, rxrpc_notify_end_tx_t notify_end_tx);
int rxrpc_kernel_recv_data(struct socket *, struct rxrpc_call *,
struct iov_iter *, size_t *, bool, u32 *, u16 *);
bool rxrpc_kernel_abort_call(struct socket *, struct rxrpc_call *,
diff --git a/net/rxrpc/rxperf.c b/net/rxrpc/rxperf.c
index 25903cd294637..c16afe540d09c 100644
--- a/net/rxrpc/rxperf.c
+++ b/net/rxrpc/rxperf.c
@@ -512,8 +512,8 @@ static int rxperf_process_call(struct rxperf_call *call)
struct msghdr msg = {};
struct bio_vec bv;
struct kvec iov[1];
- ssize_t n;
size_t reply_len = call->reply_len, len;
+ int ret;
rxrpc_kernel_set_tx_length(rxperf_socket, call->rxcall,
reply_len + sizeof(rxperf_magic_cookie));
@@ -523,13 +523,11 @@ static int rxperf_process_call(struct rxperf_call *call)
bvec_set_page(&bv, ZERO_PAGE(0), len, 0);
iov_iter_bvec(&msg.msg_iter, WRITE, &bv, 1, len);
msg.msg_flags = MSG_MORE;
- n = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
- len, rxperf_notify_end_reply_tx);
- if (n < 0)
- return n;
- if (n == 0)
- return -EIO;
- reply_len -= n;
+ ret = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
+ rxperf_notify_end_reply_tx);
+ if (ret < 0)
+ return ret;
+ reply_len -= len;
}
len = sizeof(rxperf_magic_cookie);
@@ -537,16 +535,13 @@ static int rxperf_process_call(struct rxperf_call *call)
iov[0].iov_len = len;
iov_iter_kvec(&msg.msg_iter, WRITE, iov, 1, len);
msg.msg_flags = 0;
- n = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg, len,
- rxperf_notify_end_reply_tx);
- if (n >= 0)
- return 0; /* Success */
-
- if (n == -ENOMEM)
+ ret = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
+ rxperf_notify_end_reply_tx);
+ if (ret == -ENOMEM)
rxrpc_kernel_abort_call(rxperf_socket, call->rxcall,
RXGEN_SS_MARSHAL, -ENOMEM,
rxperf_abort_oom);
- return n;
+ return ret;
}
/*
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index dc86edb9bd3a8..7ba5a6de3e4e1 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -745,7 +745,6 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
* @sock: The socket the call is on
* @call: The call to send data through
* @msg: The data to send
- * @len: The amount of data to send
* @notify_end_tx: Notification that the last packet is queued.
*
* Allow a kernel service to send data on a call. The call must be in an state
@@ -754,8 +753,7 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
* more data to come, otherwise this data will end the transmission phase.
*/
int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
- struct msghdr *msg, size_t len,
- rxrpc_notify_end_tx_t notify_end_tx)
+ struct msghdr *msg, rxrpc_notify_end_tx_t notify_end_tx)
{
int ret;
@@ -764,12 +762,25 @@ int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
ASSERTCMP(msg->msg_name, ==, NULL);
ASSERTCMP(msg->msg_control, ==, NULL);
- mutex_lock(&call->user_mutex);
+ for (;;) {
+ mutex_lock(&call->user_mutex);
+
+ ret = rxrpc_send_data(rxrpc_sk(sock->sk), call, msg,
+ msg_data_left(msg), notify_end_tx);
+ if (ret == -ESHUTDOWN)
+ ret = call->error;
+ if (ret < 0)
+ break;
+ if (msg_data_left(msg) == 0) {
+ ret = 0;
+ break;
+ }
+ if (ret == 0) {
+ ret = -EIO;
+ break;
+ }
+ }
- ret = rxrpc_send_data(rxrpc_sk(sock->sk), call, msg, len,
- notify_end_tx);
- if (ret == -ESHUTDOWN)
- ret = call->error;
_leave(" = %d", ret);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0277/1167] x86/cpuid: Mark CPUID function 0x23 as being indexed
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (275 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0276/1167] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data() Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0278/1167] KVM: VMX: Formally define KVMs "0xdead" exit reason used for failed VM-Enter Greg Kroah-Hartman
` (380 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rick Edgecombe, Sean Christopherson,
Borislav Petkov (AMD), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <seanjc@google.com>
[ Upstream commit 108775fa28fe04a16f19a828a779689f3d0ea9f0 ]
Add function 0x23 to the set of CPUID functions that are indexed, as per
the SDM and the many sub-leafs defined in leaf_types.h.
Closes: https://lore.kernel.org/all/213d614fe73e183a230c8f4e0c8fa1cc3d45df39.camel@intel.com
Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261022210134.612848-2-seanjc@google.com
[ sashal: Added case 0x23: to the older cpuid.h header, since the cpuid/api.h file doesn't exist here, and the trailing context differs because case 0x24: is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/cpuid.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/cpuid.h b/arch/x86/include/asm/cpuid.h
index 9bee3e7bf9736..148dd9645abea 100644
--- a/arch/x86/include/asm/cpuid.h
+++ b/arch/x86/include/asm/cpuid.h
@@ -143,6 +143,7 @@ static __always_inline bool cpuid_function_is_indexed(u32 function)
case 0x1d:
case 0x1e:
case 0x1f:
+ case 0x23:
case 0x8000001d:
return true;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0278/1167] KVM: VMX: Formally define KVMs "0xdead" exit reason used for failed VM-Enter
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (276 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0277/1167] x86/cpuid: Mark CPUID function 0x23 as being indexed Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0279/1167] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration Greg Kroah-Hartman
` (379 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiaoyao Li, Yan Zhao, Binbin Wu,
Rick Edgecombe, Sean Christopherson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <seanjc@google.com>
[ Upstream commit d85f7dc8cf3c91a131946dae4c3aa8d9c97322d7 ]
Add EXIT_REASON_UNDEFINED to track KVM's magic "0xdead" value that's used
to stuff the exit reason on a failed VM-Enter so that the magic can be
reused by TDX, and to make it more obvious that it's an arbitrary, KVM-
defined value (though the whole "dead" thing makes it pretty darn obvious).
Opportunistically add a compile-time assert to ensure the KVM-defined exit
reason never collides with a "real" exit reason.
No functional change intended.
Cc: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Yan Zhao <yan.y.zhao@intel.com>
Cc: Binbin Wu <binbin.wu@linux.intel.com>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://patch.msgid.link/20260921235656.1107929-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
[ sashal: Placed the new EXIT_REASON_UNDEFINED define after the includes in vmx.h and used the branch's non-vt exit_reason field and static vmx_get_exit_info context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/vmx.h | 8 ++++++++
arch/x86/kvm/vmx/vmx.c | 4 +++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index 0e73616b82f34..ff14badb156ab 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -19,6 +19,14 @@
#include <uapi/asm/vmx.h>
#include <asm/vmxfeatures.h>
+/*
+ * UNDEFINED is a KVM-defined value used to indicate that the basic exit reason
+ * is undefined/invalid, e.g. on VM-Fail or if TDX never attempted VM-Enter.
+ * The value itself is arbitrary, it just needs to not collide with a real exit
+ * reason.
+ */
+#define EXIT_REASON_UNDEFINED 0xdead
+
#define VMCS_CONTROL_BIT(x) BIT(VMX_FEATURE_##x & 0x1f)
/*
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index bf95123701461..81aa80a8e7bc9 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -6168,6 +6168,8 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu) = {
static const int kvm_vmx_max_exit_handlers =
ARRAY_SIZE(kvm_vmx_exit_handlers);
+static_assert(EXIT_REASON_UNDEFINED >= ARRAY_SIZE(kvm_vmx_exit_handlers));
+
static void vmx_get_exit_info(struct kvm_vcpu *vcpu, u32 *reason,
u64 *info1, u64 *info2,
u32 *intr_info, u32 *error_code)
@@ -7309,7 +7311,7 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu,
vmx_enable_fb_clear(vmx);
if (unlikely(vmx->fail)) {
- vmx->exit_reason.full = 0xdead;
+ vmx->exit_reason.full = EXIT_REASON_UNDEFINED;
goto out;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0279/1167] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (277 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0278/1167] KVM: VMX: Formally define KVMs "0xdead" exit reason used for failed VM-Enter Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0280/1167] fs: make sure to call fsnotify_inoderemove() only once when inode is dead Greg Kroah-Hartman
` (378 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, David Woodhouse,
Paul Durrant, Paolo Bonzini, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <dwmw@amazon.co.uk>
[ Upstream commit eacdb76c5f04956035c5d7f7e1973028f30684a2 ]
Xen's map_guest_area() enforces that vcpu_info is aligned to
sizeof(xen_ulong_t). KVM has no such check, allowing a guest to
register vcpu_info at an arbitrary byte alignment.
Enforce unconditional 4-byte alignment regardless of the current
shinfo mode. This is sufficient because subsequent commits ensure
that all locked atomic operations on vcpu_info fields use at most
32-bit accesses. Return -ENXIO on failure, matching Xen's
map_guest_area() behaviour for unaligned requests.
Originally observed in review of an unrelated patch:
https://lore.kernel.org/all/20260604193554.1BA311F00893@smtp.kernel.org/
Cc: stable@vger.kernel.org
Fixes: 73e69a86347a ("KVM: x86/xen: register vcpu info")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/all/20260604193554.1BA311F00893@smtp.kernel.org
Assisted-by: Kiro:claude-opus-4.6-1m
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Link: https://patch.msgid.link/20260831213632.81023-7-dwmw2@infradead.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[ sashal: Dropped the HVA-variant hunk, which depends on a skipped pfncache feature, and applied the alignment check only to the GPA path, one indent level shallower since the if/else is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/xen.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c
index 335e046c68365..9dad266350609 100644
--- a/arch/x86/kvm/xen.c
+++ b/arch/x86/kvm/xen.c
@@ -742,6 +742,10 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct kvm_xen_vcpu_attr *data)
break;
}
+ r = -ENXIO;
+ if (!IS_ALIGNED(data->u.gpa, sizeof(u32)))
+ break;
+
r = kvm_gpc_activate(&vcpu->arch.xen.vcpu_info_cache,
data->u.gpa, sizeof(struct vcpu_info));
if (!r)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0280/1167] fs: make sure to call fsnotify_inoderemove() only once when inode is dead
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (278 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0279/1167] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0281/1167] crypto: omap-des - fix crypto engine cleanup Greg Kroah-Hartman
` (377 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Amir Goldstein, Jan Kara,
Christian Brauner (Amutable), Sasha Levin, Daehyeon Ko
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
[ Upstream commit 669bb5af15d41a21359d00a441490f87a88eb52a ]
Daehyeon reported a race wherein fsnotify_removeinode() can be called
when inode still has a live alias. This can lead to several undesired
outcomes such as crashes in fsnotify code or avoidance of inode mark
notifications.
Check that inode is really "dead", meaning no nlink and no more aliases
before calling fsnotify_inoderemove() for final cleanup of inode marks.
Also do not allow open_by_handle() to add new aliases to a "dead" inode.
Ideally, we'd call fsnotify_inoderemove() once last inode reference is
dropped to make things simpler. Alas fsnotify inode marks currently hold
inode references and thus this doesn't work. Once we teach fsnotify to
avoid holding inode references, these games with dead inodes can go as
well.
Reported-and-tested-by: Daehyeon Ko <4ncienth@gmail.com>
Closes: https://lore.kernel.org/linux-fsdevel/20260827045007.3831259-1-4ncienth@gmail.com/
CC: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260902164924.1333135-2-jack@suse.cz
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Adapted the recheck to the __d_instantiate_anon() helper present in this tree, with older d_u.d_alias and d_u.d_rcu field names and no waiters reset. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dcache.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index c0d7ab8c5aab0..2a15d88527916 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -382,6 +382,17 @@ static void dentry_free(struct dentry *dentry)
call_rcu(&dentry->d_u.d_rcu, __d_free);
}
+/*
+ * If inode is unlinked and doesn't have any aliases (i.e., all fds pointing to
+ * it are closed), it is pretty much dead. Except that file handle lookup could
+ * still revive it which causes issues to fsnotify. So once inode reaches this
+ * state we make sure to block creating any new aliases.
+ */
+static bool inode_notify_dead(struct inode *inode)
+{
+ return !inode->i_nlink && hlist_empty(&inode->i_dentry);
+}
+
/*
* Release the dentry's inode, using the filesystem
* d_iput() operation if defined.
@@ -391,14 +402,16 @@ static void dentry_unlink_inode(struct dentry * dentry)
__releases(dentry->d_inode->i_lock)
{
struct inode *inode = dentry->d_inode;
+ bool notify_dead;
raw_write_seqcount_begin(&dentry->d_seq);
__d_clear_type_and_inode(dentry);
hlist_del_init(&dentry->d_u.d_alias);
raw_write_seqcount_end(&dentry->d_seq);
+ notify_dead = inode_notify_dead(inode);
spin_unlock(&dentry->d_lock);
spin_unlock(&inode->i_lock);
- if (!inode->i_nlink)
+ if (notify_dead)
fsnotify_inoderemove(inode);
if (dentry->d_op && dentry->d_op->d_iput)
dentry->d_op->d_iput(dentry, inode);
@@ -2098,7 +2111,10 @@ static struct dentry *__d_instantiate_anon(struct dentry *dentry,
security_d_instantiate(dentry, inode);
spin_lock(&inode->i_lock);
- res = __d_find_any_alias(inode);
+ if (!inode_notify_dead(inode))
+ res = __d_find_any_alias(inode); /* recheck under lock */
+ else
+ res = ERR_PTR(-ESTALE);
if (res) {
spin_unlock(&inode->i_lock);
dput(dentry);
@@ -2145,7 +2161,12 @@ static struct dentry *__d_obtain_alias(struct inode *inode, bool disconnected)
if (IS_ERR(inode))
return ERR_CAST(inode);
- res = d_find_any_alias(inode);
+ spin_lock(&inode->i_lock);
+ if (!inode_notify_dead(inode))
+ res = __d_find_any_alias(inode); /* existing alias? */
+ else
+ res = ERR_PTR(-ESTALE);
+ spin_unlock(&inode->i_lock);
if (res)
goto out_iput;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0281/1167] crypto: omap-des - fix crypto engine cleanup
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (279 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0280/1167] fs: make sure to call fsnotify_inoderemove() only once when inode is dead Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0282/1167] mm/page_counter: move calculating protection values to page_counter Greg Kroah-Hartman
` (376 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Herbert Xu,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit 5d69ed4cd4f9c68ff9a6ebb2e8a1079223a4ec6e ]
omap_des_probe() allocates and starts a crypto engine, but the remove
path does not call the matching crypto_engine_exit(). The probe failure
path already performs this cleanup.
crypto_engine_alloc_init() creates a kthread worker for processing
requests. Without crypto_engine_exit() during driver removal, the
worker is left running after the device is removed.
Call crypto_engine_exit() after unregistering the algorithms and before
tearing down the remaining request handling resources. This stops the
engine and destroys its worker.
This issue was found by manual code inspection.
Fixes: f1b77aaca85a ("crypto: omap-des - Integrate with the crypto engine framework")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ sashal: Kept the tree's tasklet_kill() context line instead of upstream's cancel_work_sync() and inserted the crypto_engine_exit() call before it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/omap-des.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index c5e7064be9c55..d689a15edffc0 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -1092,6 +1092,8 @@ static int omap_des_remove(struct platform_device *pdev)
omap_des_unregister_algs(dd->pdata);
+ crypto_engine_exit(dd->engine);
+
tasklet_kill(&dd->done_task);
omap_des_dma_cleanup(dd);
pm_runtime_disable(dd->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0282/1167] mm/page_counter: move calculating protection values to page_counter
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (280 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0281/1167] crypto: omap-des - fix crypto engine cleanup Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0283/1167] mm/page_counter: avoid integer overflow in effective_protection() Greg Kroah-Hartman
` (375 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maarten Lankhorst, Roman Gushchin,
Shakeel Butt, Michal Hocko, Johannes Weiner, Muchun Song,
Jeff Johnson, Andrew Morton, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
[ Upstream commit a8585ac68621983587f1701b7567978fcbcd9573 ]
It's a lot of math, and there is nothing memcontrol specific about it.
This makes it easier to use inside of the drm cgroup controller.
[akpm@linux-foundation.org: fix kerneldoc, per Jeff Johnson]
Link: https://lkml.kernel.org/r/20240703112510.36424-1-maarten.lankhorst@linux.intel.com
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 7809ce47b056 ("mm/page_counter: avoid integer overflow in effective_protection()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/page_counter.h | 4 +
mm/memcontrol.c | 154 +------------------------------
mm/page_counter.c | 173 +++++++++++++++++++++++++++++++++++
3 files changed, 180 insertions(+), 151 deletions(-)
diff --git a/include/linux/page_counter.h b/include/linux/page_counter.h
index c141ea9a95ef8..d44a250a55742 100644
--- a/include/linux/page_counter.h
+++ b/include/linux/page_counter.h
@@ -81,4 +81,8 @@ static inline void page_counter_reset_watermark(struct page_counter *counter)
counter->watermark = page_counter_read(counter);
}
+void page_counter_calculate_protection(struct page_counter *root,
+ struct page_counter *counter,
+ bool recursive_protection);
+
#endif /* _LINUX_PAGE_COUNTER_H */
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index a5fb60f74a10f..77a38cec6d338 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6952,122 +6952,6 @@ struct cgroup_subsys memory_cgrp_subsys = {
.early_init = 0,
};
-/*
- * This function calculates an individual cgroup's effective
- * protection which is derived from its own memory.min/low, its
- * parent's and siblings' settings, as well as the actual memory
- * distribution in the tree.
- *
- * The following rules apply to the effective protection values:
- *
- * 1. At the first level of reclaim, effective protection is equal to
- * the declared protection in memory.min and memory.low.
- *
- * 2. To enable safe delegation of the protection configuration, at
- * subsequent levels the effective protection is capped to the
- * parent's effective protection.
- *
- * 3. To make complex and dynamic subtrees easier to configure, the
- * user is allowed to overcommit the declared protection at a given
- * level. If that is the case, the parent's effective protection is
- * distributed to the children in proportion to how much protection
- * they have declared and how much of it they are utilizing.
- *
- * This makes distribution proportional, but also work-conserving:
- * if one cgroup claims much more protection than it uses memory,
- * the unused remainder is available to its siblings.
- *
- * 4. Conversely, when the declared protection is undercommitted at a
- * given level, the distribution of the larger parental protection
- * budget is NOT proportional. A cgroup's protection from a sibling
- * is capped to its own memory.min/low setting.
- *
- * 5. However, to allow protecting recursive subtrees from each other
- * without having to declare each individual cgroup's fixed share
- * of the ancestor's claim to protection, any unutilized -
- * "floating" - protection from up the tree is distributed in
- * proportion to each cgroup's *usage*. This makes the protection
- * neutral wrt sibling cgroups and lets them compete freely over
- * the shared parental protection budget, but it protects the
- * subtree as a whole from neighboring subtrees.
- *
- * Note that 4. and 5. are not in conflict: 4. is about protecting
- * against immediate siblings whereas 5. is about protecting against
- * neighboring subtrees.
- */
-static unsigned long effective_protection(unsigned long usage,
- unsigned long parent_usage,
- unsigned long setting,
- unsigned long parent_effective,
- unsigned long siblings_protected)
-{
- unsigned long protected;
- unsigned long ep;
-
- protected = min(usage, setting);
- /*
- * If all cgroups at this level combined claim and use more
- * protection than what the parent affords them, distribute
- * shares in proportion to utilization.
- *
- * We are using actual utilization rather than the statically
- * claimed protection in order to be work-conserving: claimed
- * but unused protection is available to siblings that would
- * otherwise get a smaller chunk than what they claimed.
- */
- if (siblings_protected > parent_effective)
- return protected * parent_effective / siblings_protected;
-
- /*
- * Ok, utilized protection of all children is within what the
- * parent affords them, so we know whatever this child claims
- * and utilizes is effectively protected.
- *
- * If there is unprotected usage beyond this value, reclaim
- * will apply pressure in proportion to that amount.
- *
- * If there is unutilized protection, the cgroup will be fully
- * shielded from reclaim, but we do return a smaller value for
- * protection than what the group could enjoy in theory. This
- * is okay. With the overcommit distribution above, effective
- * protection is always dependent on how memory is actually
- * consumed among the siblings anyway.
- */
- ep = protected;
-
- /*
- * If the children aren't claiming (all of) the protection
- * afforded to them by the parent, distribute the remainder in
- * proportion to the (unprotected) memory of each cgroup. That
- * way, cgroups that aren't explicitly prioritized wrt each
- * other compete freely over the allowance, but they are
- * collectively protected from neighboring trees.
- *
- * We're using unprotected memory for the weight so that if
- * some cgroups DO claim explicit protection, we don't protect
- * the same bytes twice.
- *
- * Check both usage and parent_usage against the respective
- * protected values. One should imply the other, but they
- * aren't read atomically - make sure the division is sane.
- */
- if (!(cgrp_dfl_root.flags & CGRP_ROOT_MEMORY_RECURSIVE_PROT))
- return ep;
- if (parent_effective > siblings_protected &&
- parent_usage > siblings_protected &&
- usage > protected) {
- unsigned long unclaimed;
-
- unclaimed = parent_effective - siblings_protected;
- unclaimed *= usage - protected;
- unclaimed /= parent_usage - siblings_protected;
-
- ep += unclaimed;
- }
-
- return ep;
-}
-
/**
* mem_cgroup_calculate_protection - check if memory consumption is in the normal range
* @root: the top ancestor of the sub-tree being checked
@@ -7079,8 +6963,8 @@ static unsigned long effective_protection(unsigned long usage,
void mem_cgroup_calculate_protection(struct mem_cgroup *root,
struct mem_cgroup *memcg)
{
- unsigned long usage, parent_usage;
- struct mem_cgroup *parent;
+ bool recursive_protection =
+ cgrp_dfl_root.flags & CGRP_ROOT_MEMORY_RECURSIVE_PROT;
if (mem_cgroup_disabled())
return;
@@ -7088,39 +6972,7 @@ void mem_cgroup_calculate_protection(struct mem_cgroup *root,
if (!root)
root = root_mem_cgroup;
- /*
- * Effective values of the reclaim targets are ignored so they
- * can be stale. Have a look at mem_cgroup_protection for more
- * details.
- * TODO: calculation should be more robust so that we do not need
- * that special casing.
- */
- if (memcg == root)
- return;
-
- usage = page_counter_read(&memcg->memory);
- if (!usage)
- return;
-
- parent = parent_mem_cgroup(memcg);
-
- if (parent == root) {
- memcg->memory.emin = READ_ONCE(memcg->memory.min);
- memcg->memory.elow = READ_ONCE(memcg->memory.low);
- return;
- }
-
- parent_usage = page_counter_read(&parent->memory);
-
- WRITE_ONCE(memcg->memory.emin, effective_protection(usage, parent_usage,
- READ_ONCE(memcg->memory.min),
- READ_ONCE(parent->memory.emin),
- atomic_long_read(&parent->memory.children_min_usage)));
-
- WRITE_ONCE(memcg->memory.elow, effective_protection(usage, parent_usage,
- READ_ONCE(memcg->memory.low),
- READ_ONCE(parent->memory.elow),
- atomic_long_read(&parent->memory.children_low_usage)));
+ page_counter_calculate_protection(&root->memory, &memcg->memory, recursive_protection);
}
#ifdef CONFIG_LRU_GEN
diff --git a/mm/page_counter.c b/mm/page_counter.c
index db20d6452b715..0153f5bb31611 100644
--- a/mm/page_counter.c
+++ b/mm/page_counter.c
@@ -262,3 +262,176 @@ int page_counter_memparse(const char *buf, const char *max,
return 0;
}
+
+
+/*
+ * This function calculates an individual page counter's effective
+ * protection which is derived from its own memory.min/low, its
+ * parent's and siblings' settings, as well as the actual memory
+ * distribution in the tree.
+ *
+ * The following rules apply to the effective protection values:
+ *
+ * 1. At the first level of reclaim, effective protection is equal to
+ * the declared protection in memory.min and memory.low.
+ *
+ * 2. To enable safe delegation of the protection configuration, at
+ * subsequent levels the effective protection is capped to the
+ * parent's effective protection.
+ *
+ * 3. To make complex and dynamic subtrees easier to configure, the
+ * user is allowed to overcommit the declared protection at a given
+ * level. If that is the case, the parent's effective protection is
+ * distributed to the children in proportion to how much protection
+ * they have declared and how much of it they are utilizing.
+ *
+ * This makes distribution proportional, but also work-conserving:
+ * if one counter claims much more protection than it uses memory,
+ * the unused remainder is available to its siblings.
+ *
+ * 4. Conversely, when the declared protection is undercommitted at a
+ * given level, the distribution of the larger parental protection
+ * budget is NOT proportional. A counter's protection from a sibling
+ * is capped to its own memory.min/low setting.
+ *
+ * 5. However, to allow protecting recursive subtrees from each other
+ * without having to declare each individual counter's fixed share
+ * of the ancestor's claim to protection, any unutilized -
+ * "floating" - protection from up the tree is distributed in
+ * proportion to each counter's *usage*. This makes the protection
+ * neutral wrt sibling cgroups and lets them compete freely over
+ * the shared parental protection budget, but it protects the
+ * subtree as a whole from neighboring subtrees.
+ *
+ * Note that 4. and 5. are not in conflict: 4. is about protecting
+ * against immediate siblings whereas 5. is about protecting against
+ * neighboring subtrees.
+ */
+static unsigned long effective_protection(unsigned long usage,
+ unsigned long parent_usage,
+ unsigned long setting,
+ unsigned long parent_effective,
+ unsigned long siblings_protected,
+ bool recursive_protection)
+{
+ unsigned long protected;
+ unsigned long ep;
+
+ protected = min(usage, setting);
+ /*
+ * If all cgroups at this level combined claim and use more
+ * protection than what the parent affords them, distribute
+ * shares in proportion to utilization.
+ *
+ * We are using actual utilization rather than the statically
+ * claimed protection in order to be work-conserving: claimed
+ * but unused protection is available to siblings that would
+ * otherwise get a smaller chunk than what they claimed.
+ */
+ if (siblings_protected > parent_effective)
+ return protected * parent_effective / siblings_protected;
+
+ /*
+ * Ok, utilized protection of all children is within what the
+ * parent affords them, so we know whatever this child claims
+ * and utilizes is effectively protected.
+ *
+ * If there is unprotected usage beyond this value, reclaim
+ * will apply pressure in proportion to that amount.
+ *
+ * If there is unutilized protection, the cgroup will be fully
+ * shielded from reclaim, but we do return a smaller value for
+ * protection than what the group could enjoy in theory. This
+ * is okay. With the overcommit distribution above, effective
+ * protection is always dependent on how memory is actually
+ * consumed among the siblings anyway.
+ */
+ ep = protected;
+
+ /*
+ * If the children aren't claiming (all of) the protection
+ * afforded to them by the parent, distribute the remainder in
+ * proportion to the (unprotected) memory of each cgroup. That
+ * way, cgroups that aren't explicitly prioritized wrt each
+ * other compete freely over the allowance, but they are
+ * collectively protected from neighboring trees.
+ *
+ * We're using unprotected memory for the weight so that if
+ * some cgroups DO claim explicit protection, we don't protect
+ * the same bytes twice.
+ *
+ * Check both usage and parent_usage against the respective
+ * protected values. One should imply the other, but they
+ * aren't read atomically - make sure the division is sane.
+ */
+ if (!recursive_protection)
+ return ep;
+
+ if (parent_effective > siblings_protected &&
+ parent_usage > siblings_protected &&
+ usage > protected) {
+ unsigned long unclaimed;
+
+ unclaimed = parent_effective - siblings_protected;
+ unclaimed *= usage - protected;
+ unclaimed /= parent_usage - siblings_protected;
+
+ ep += unclaimed;
+ }
+
+ return ep;
+}
+
+
+/**
+ * page_counter_calculate_protection - check if memory consumption is in the normal range
+ * @root: the top ancestor of the sub-tree being checked
+ * @counter: the page_counter the counter to update
+ * @recursive_protection: Whether to use memory_recursiveprot behavior.
+ *
+ * Calculates elow/emin thresholds for given page_counter.
+ *
+ * WARNING: This function is not stateless! It can only be used as part
+ * of a top-down tree iteration, not for isolated queries.
+ */
+void page_counter_calculate_protection(struct page_counter *root,
+ struct page_counter *counter,
+ bool recursive_protection)
+{
+ unsigned long usage, parent_usage;
+ struct page_counter *parent = counter->parent;
+
+ /*
+ * Effective values of the reclaim targets are ignored so they
+ * can be stale. Have a look at mem_cgroup_protection for more
+ * details.
+ * TODO: calculation should be more robust so that we do not need
+ * that special casing.
+ */
+ if (root == counter)
+ return;
+
+ usage = page_counter_read(counter);
+ if (!usage)
+ return;
+
+ if (parent == root) {
+ counter->emin = READ_ONCE(counter->min);
+ counter->elow = READ_ONCE(counter->low);
+ return;
+ }
+
+ parent_usage = page_counter_read(parent);
+
+ WRITE_ONCE(counter->emin, effective_protection(usage, parent_usage,
+ READ_ONCE(counter->min),
+ READ_ONCE(parent->emin),
+ atomic_long_read(&parent->children_min_usage),
+ recursive_protection));
+
+ WRITE_ONCE(counter->elow, effective_protection(usage, parent_usage,
+ READ_ONCE(counter->low),
+ READ_ONCE(parent->elow),
+ atomic_long_read(&parent->children_low_usage),
+ recursive_protection));
+}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0283/1167] mm/page_counter: avoid integer overflow in effective_protection()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (281 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0282/1167] mm/page_counter: move calculating protection values to page_counter Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0284/1167] panic: flatten nmi_panic control flow Greg Kroah-Hartman
` (374 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Barry Song, Johannes Weiner,
Ridong Chen, Andrew Morton, Axel Rasmussen, Chris Down,
David Hildenbrand, Kairui Song, Lorenzo Stoakes, Michal Hocko,
Muchun Song, Roman Gushchin, Shakeel Butt, Tejun Heo, Wei Xu,
Yuanchu Xie, Yu Zhao, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ridong Chen <chenridong@xiaomi.com>
[ Upstream commit 7809ce47b05671e1fa6d74bead892d6ad6c1403b ]
Patch series "mm/mglru: fix ineffective memory protection for non-kswapd
reclaim", v4.
For MGLRU, memory.min/low is not honored during non-kswapd global reclaim
(global direct reclaim and root-level memory.reclaim), because these paths
shrink memcgs using stale protection (emin/elow).
Patch 2 is the actual fix. Patch 1 is a prerequisite: an integer overflow
in effective_protection(), spotted by the sashiko review tool, which patch
2's new caller would also be exposed to.
This patch (of 2):
effective_protection() scales a parent's protection by a ratio of page
counts, e.g. for recursive protection:
(parent_effective - siblings_protected) * (usage - protected)
/ (parent_usage - siblings_protected)
The multiply is done at unsigned long width before dividing. On systems
with >= 16TB RAM the product can exceed 2^64 and wrap, giving a bogus
protection value and silently breaking memory.min/low enforcement.
Use mul_u64_u64_div_u64() to multiply in a 128-bit intermediate. Because
usage and parent_usage are not read atomically (a child is charged before
its parent), usage - protected can briefly exceed the divisor, making the
quotient overflow 64 bits and trap (#DE on x86). Cap it so the ratio
stays <= 1.
Reported by the sashiko review tool [1].
Link: https://lore.kernel.org/20260907025445.1836238-1-ridong.chen@linux.dev
Link: https://lore.kernel.org/20260907025445.1836238-2-ridong.chen@linux.dev
Link: https://sashiko.dev/#/patchset/20260826133054.88529-1-ridong.chen@linux.dev?part=1 [1]
Fixes: bc50bcc6e00b ("mm: memcontrol: clean up and document effective low/min calculations")
Fixes: 8a931f801340 ("mm: memcontrol: recursive memory.low protection")
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Ridong Chen <chenridong@xiaomi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Assisted-by: Claude:claude-opus-4-8
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Chris Down <chris@chrisdown.name>
Cc: David Hildenbrand <david@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_counter.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/mm/page_counter.c b/mm/page_counter.c
index 0153f5bb31611..34f2a3ac1f32d 100644
--- a/mm/page_counter.c
+++ b/mm/page_counter.c
@@ -8,6 +8,7 @@
#include <linux/page_counter.h>
#include <linux/atomic.h>
#include <linux/kernel.h>
+#include <linux/math64.h>
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/bug.h>
@@ -329,7 +330,8 @@ static unsigned long effective_protection(unsigned long usage,
* otherwise get a smaller chunk than what they claimed.
*/
if (siblings_protected > parent_effective)
- return protected * parent_effective / siblings_protected;
+ return mul_u64_u64_div_u64(protected, parent_effective,
+ siblings_protected);
/*
* Ok, utilized protection of all children is within what the
@@ -370,13 +372,20 @@ static unsigned long effective_protection(unsigned long usage,
if (parent_effective > siblings_protected &&
parent_usage > siblings_protected &&
usage > protected) {
- unsigned long unclaimed;
+ unsigned long parent_unclaimed, parent_unprotected, unprotected;
- unclaimed = parent_effective - siblings_protected;
- unclaimed *= usage - protected;
- unclaimed /= parent_usage - siblings_protected;
+ parent_unclaimed = parent_effective - siblings_protected;
+ parent_unprotected = parent_usage - siblings_protected;
- ep += unclaimed;
+ /*
+ * The usages aren't read atomically, so a child can transiently
+ * appear to use more than its parent, making the ratio exceed 1
+ * and the quotient overflow 64 bits (#DE on x86). Cap it.
+ */
+ unprotected = min(usage - protected, parent_unprotected);
+
+ ep += mul_u64_u64_div_u64(parent_unclaimed, unprotected,
+ parent_unprotected);
}
return ep;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0284/1167] panic: flatten nmi_panic control flow
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (282 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0283/1167] mm/page_counter: avoid integer overflow in effective_protection() Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0285/1167] power: supply: Correct multiple typos in comments Greg Kroah-Hartman
` (373 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bradley Morgan, Andrew Morton,
Petr Mladek, Guenetr Roeck, Sashiko, Wang Jinchao,
Wim Van Sebroeck, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bradley Morgan <brads@mainlining.org>
[ Upstream commit 75eb687ff2bcec9fba31bbe266e5f91e5c283efe ]
panic() is __noreturn, so the else after panic_try_start() is dead. Drop
it so the force_cpu path can be added cleanly on top.
Link: https://lore.kernel.org/20260916182957.7788-3-brads@mainlining.org
Signed-off-by: Bradley Morgan <brads@mainlining.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: Guenetr Roeck <linux@roeck-us.net>
Cc: Sashiko <sashiko-bot@kernel.org>
Cc: Wang Jinchao <wangjinchao600@gmail.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: <stable@vger.kernel.org>
[ sashal: Replaced the missing panic_try_start() and panic_on_other_cpu() helpers with the open-coded old_cpu == PANIC_CPU_INVALID and old_cpu != cpu checks when removing the else. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/panic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index d7973e9754748..3698d2f8c925e 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -199,7 +199,8 @@ void nmi_panic(struct pt_regs *regs, const char *msg)
if (old_cpu == PANIC_CPU_INVALID)
panic("%s", msg);
- else if (old_cpu != cpu)
+
+ if (old_cpu != cpu)
nmi_panic_self_stop(regs);
}
EXPORT_SYMBOL(nmi_panic);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0285/1167] power: supply: Correct multiple typos in comments
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (283 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0284/1167] panic: flatten nmi_panic control flow Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0286/1167] power: supply: qcom_smbx: set the charge enable after software control Greg Kroah-Hartman
` (372 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shen Lichuan, Sebastian Reichel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shen Lichuan <shenlichuan@vivo.com>
[ Upstream commit 570c2234d5d62d52be7e8e35169b96d98378a7ce ]
Fixed some spelling errors, the details are as follows:
-in the code comments:
dettached->detached
meausered->measured
meausurement->measurement
sholuld->should
Tempreture->Temperature
measuremnts->measurements
detecing->detecting
persent->percent
Parallell->Parallel
Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Link: https://lore.kernel.org/r/20240914085415.3886-1-shenlichuan@vivo.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Stable-dep-of: 1fba78714201 ("power: supply: qcom_smbx: set the charge enable after software control")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/88pm860x_battery.c | 4 ++--
drivers/power/supply/ab8500_btemp.c | 2 +-
drivers/power/supply/charger-manager.c | 2 +-
drivers/power/supply/da9030_battery.c | 4 ++--
drivers/power/supply/max8925_power.c | 2 +-
drivers/power/supply/qcom_battmgr.c | 2 +-
drivers/power/supply/qcom_pmi8998_charger.c | 2 +-
7 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/power/supply/88pm860x_battery.c b/drivers/power/supply/88pm860x_battery.c
index f3f3f8cd1a7f8..3ed8667d79db7 100644
--- a/drivers/power/supply/88pm860x_battery.c
+++ b/drivers/power/supply/88pm860x_battery.c
@@ -422,7 +422,7 @@ static irqreturn_t pm860x_batt_handler(int irq, void *data)
info->temp_type = PM860X_TEMP_TINT;
}
mutex_unlock(&info->lock);
- /* clear ccnt since battery is attached or dettached */
+ /* clear ccnt since battery is attached or detached */
clear_ccnt(info, &ccnt_data);
return IRQ_HANDLED;
}
@@ -566,7 +566,7 @@ static int measure_temp(struct pm860x_battery_info *info, int *data)
ret = measure_12bit_voltage(info, PM8607_GPADC1_MEAS1, data);
if (ret)
return ret;
- /* meausered Vtbat(mV) / Ibias_current(11uA)*/
+ /* measured Vtbat(mV) / Ibias_current(11uA)*/
*data = (*data * 1000) / GPBIAS2_GPADC1_UA;
if (*data > TBAT_NEG_25D) {
diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c
index 9083c7c56aed4..ef77a65d9a645 100644
--- a/drivers/power/supply/ab8500_btemp.c
+++ b/drivers/power/supply/ab8500_btemp.c
@@ -283,7 +283,7 @@ static void ab8500_btemp_periodic_work(struct work_struct *work)
dev_warn(di->dev, "failed to identify the battery\n");
}
- /* Failover if a reading is erroneous, use last meausurement */
+ /* Failover if a reading is erroneous, use last measurement */
ret = thermal_zone_get_temp(di->tz, &bat_temp);
if (ret) {
dev_err(di->dev, "error reading temperature\n");
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 48b706c876464..d8a16782260ee 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -221,7 +221,7 @@ static bool is_charging(struct charger_manager *cm)
/* If at least one of the charger is charging, return yes */
for (i = 0; cm->desc->psy_charger_stat[i]; i++) {
- /* 1. The charger sholuld not be DISABLED */
+ /* 1. The charger should not be DISABLED */
if (cm->emergency_stop)
continue;
if (!cm->charger_enabled)
diff --git a/drivers/power/supply/da9030_battery.c b/drivers/power/supply/da9030_battery.c
index 0deba48d22d31..051801687ab3d 100644
--- a/drivers/power/supply/da9030_battery.c
+++ b/drivers/power/supply/da9030_battery.c
@@ -269,7 +269,7 @@ static void da9030_charger_check_state(struct da9030_charger *charger)
}
if (charger->adc.vchmax_res > charger->thresholds.vcharge_max ||
charger->adc.vchmin_res < charger->thresholds.vcharge_min ||
- /* Tempreture readings are negative */
+ /* Temperature readings are negative */
charger->adc.tbat_res < charger->thresholds.tbat_high ||
charger->adc.tbat_res > charger->thresholds.tbat_low) {
/* disable charger */
@@ -470,7 +470,7 @@ static int da9030_battery_charger_init(struct da9030_charger *charger)
if (ret)
return ret;
- /* enable auto ADC measuremnts */
+ /* enable auto ADC measurements */
return da903x_write(charger->master, DA9030_ADC_AUTO_CONTROL,
DA9030_ADC_TBAT_ENABLE | DA9030_ADC_VBAT_IN_TXON |
DA9030_ADC_VCH_ENABLE | DA9030_ADC_ICH_ENABLE |
diff --git a/drivers/power/supply/max8925_power.c b/drivers/power/supply/max8925_power.c
index 8878f9131184f..4837628ce08cc 100644
--- a/drivers/power/supply/max8925_power.c
+++ b/drivers/power/supply/max8925_power.c
@@ -73,7 +73,7 @@ struct max8925_power_info {
unsigned usb_online:1;
unsigned bat_online:1;
unsigned chg_mode:2;
- unsigned batt_detect:1; /* detecing MB by ID pin */
+ unsigned batt_detect:1; /* detecting MB by ID pin */
unsigned topoff_threshold:2;
unsigned fast_charge:3;
unsigned no_temp_support:1;
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index bfff97756e7d5..f0beb3c0eb3a2 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -153,7 +153,7 @@ struct qcom_battmgr_message {
__le32 capacity_low;
__le32 capacity_warning;
__le32 cycle_count;
- /* thousandth of persent */
+ /* thousandth of percent */
__le32 accuracy;
__le32 max_sample_time_ms;
__le32 min_sample_time_ms;
diff --git a/drivers/power/supply/qcom_pmi8998_charger.c b/drivers/power/supply/qcom_pmi8998_charger.c
index 3c91d5a0c8c94..2927eced240a4 100644
--- a/drivers/power/supply/qcom_pmi8998_charger.c
+++ b/drivers/power/supply/qcom_pmi8998_charger.c
@@ -842,7 +842,7 @@ static const struct smb2_register smb2_init_seq[] = {
AUTO_RECHG_BIT | EN_ANALOG_DROP_IN_VBATT_BIT |
CHARGER_INHIBIT_BIT,
.val = CHARGER_INHIBIT_BIT },
- /* STAT pin software override, match downstream. Parallell charging? */
+ /* STAT pin software override, match downstream. Parallel charging? */
{ .addr = STAT_CFG,
.mask = STAT_SW_OVERRIDE_CFG_BIT,
.val = STAT_SW_OVERRIDE_CFG_BIT },
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0286/1167] power: supply: qcom_smbx: set the charge enable after software control
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (284 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0285/1167] power: supply: Correct multiple typos in comments Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0287/1167] hwmon: (coretemp) Return -ENODATA for invalid temperature readings Greg Kroah-Hartman
` (371 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fabricio Akio, Sebastian Reichel,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabricio Akio <fabricioakio@gmail.com>
[ Upstream commit 1fba787142011145e1071cee9448b3677fb2323d ]
The init sequence sets CHARGING_ENABLE_CMD before CHGR_CFG2 selects
software control of the charge enable.
The Motorola Moto X4's bootloader leaves the charger watchdog armed to
disable charging when it bites, which it does after a few minutes in
fastboot. Charging then stays disabled in the next boot until the cable
is replugged. Setting the command after CHGR_CFG2 re-enables it.
Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Cc: stable@vger.kernel.org
Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
Link: https://patch.msgid.link/20261002-qcom-smbx-enable-order-v1-1-7df92bd809db@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/qcom_pmi8998_charger.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/power/supply/qcom_pmi8998_charger.c b/drivers/power/supply/qcom_pmi8998_charger.c
index 2927eced240a4..e405709f2395b 100644
--- a/drivers/power/supply/qcom_pmi8998_charger.c
+++ b/drivers/power/supply/qcom_pmi8998_charger.c
@@ -817,11 +817,7 @@ static const struct smb2_register smb2_init_seq[] = {
.mask = SOC_LT_CHG_RECHARGE_THRESH_SEL_BIT |
VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT,
.val = VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT },
- /* Enable charging */
{ .addr = USBIN_OPTIONS_1_CFG, .mask = HVDCP_EN_BIT, .val = 0 },
- { .addr = CHARGING_ENABLE_CMD,
- .mask = CHARGING_ENABLE_CMD_BIT,
- .val = CHARGING_ENABLE_CMD_BIT },
/*
* Match downstream defaults
* CHG_EN_SRC_BIT - charger enable is controlled by software
@@ -842,6 +838,13 @@ static const struct smb2_register smb2_init_seq[] = {
AUTO_RECHG_BIT | EN_ANALOG_DROP_IN_VBATT_BIT |
CHARGER_INHIBIT_BIT,
.val = CHARGER_INHIBIT_BIT },
+ /*
+ * Set the enable command only once CHGR_CFG2 has selected software
+ * control, or a charger its watchdog has disabled stays disabled.
+ */
+ { .addr = CHARGING_ENABLE_CMD,
+ .mask = CHARGING_ENABLE_CMD_BIT,
+ .val = CHARGING_ENABLE_CMD_BIT },
/* STAT pin software override, match downstream. Parallel charging? */
{ .addr = STAT_CFG,
.mask = STAT_SW_OVERRIDE_CFG_BIT,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0287/1167] hwmon: (coretemp) Return -ENODATA for invalid temperature readings
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (285 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0286/1167] power: supply: qcom_smbx: set the charge enable after software control Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0288/1167] mm/hugetlb: dont clear the resv_map of a VMA whose lock is held Greg Kroah-Hartman
` (370 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Ricardo Neri,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
[ Upstream commit f63aaa529cbc73146ff0d52235e5479042285cae ]
IA32_THERM_STATUS and IA32_PACKAGE_THERM_STATUS have a valid bit, bit 31.
The Intel SDM documents it only for the former, but the package register
implements it too: x86_pkg_temp_thermal has required it since commit
f1a18a105660 ("Thermal: CPU Package temperature thermal").
This driver checked the bit for both registers as well, until
commit bf6ea084ebb5 ("hwmon: (coretemp) Do not return -EAGAIN for low
temperatures") made it ignore the bit because some CPUs clear it while
the temperature is too low to be measured. Since then, temp%d_input
reports such a reading as a real temperature. Userspace cannot tell it
apart from a genuinely low one.
Fail the read with -ENODATA while the CPU reports the reading as invalid.
On a CPU that clears the bit, reading temp%d_input now fails where it
used to return a low value. sensors(1) shows N/A in its place.
Cc: stable@vger.kernel.org
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/all/46f9f319-de71-412f-a424-6cb801478456@roeck-us.net/
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Link: https://patch.msgid.link/20261006-coretemp-enodata-v2-1-64e788acc7dc@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[ sashal: Kept this tree's existing msr/jiffies code (rdmsr_on_cpu with eax, get_jiffies_64, 0x7f mask, core_data lookup) and applied the valid-bit and -ENODATA changes on top, plus a doc context adjustment. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/hwmon/coretemp.rst | 3 +++
drivers/hwmon/coretemp.c | 21 +++++++++++++++------
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/Documentation/hwmon/coretemp.rst b/Documentation/hwmon/coretemp.rst
index c609329e3bc45..6089bee1159f1 100644
--- a/Documentation/hwmon/coretemp.rst
+++ b/Documentation/hwmon/coretemp.rst
@@ -47,6 +47,9 @@ All Sysfs entries are named with their core_id (represented here by 'X').
================= ========================================================
tempX_input Core temperature (in millidegrees Celsius).
+ Reading fails with -ENODATA while the CPU reports the
+ temperature as invalid. Some CPUs do this when the
+ temperature is too low to be measured.
tempX_max All cooling devices should be turned on (on Core2).
tempX_crit Maximum junction temperature (in millidegrees Celsius).
tempX_crit_alarm Set when Out-of-spec bit is set, never clears.
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index a8b16b6eeca73..4c14c1433daa8 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -56,6 +56,8 @@ MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius");
/*
* Per-Core Temperature Data
+ * @temp_valid: Whether the CPU reported @temp as valid. @temp is not
+ * reported when this is false.
* @tjmax: The static tjmax value when tjmax cannot be retrieved from
* IA32_TEMPERATURE_TARGET MSR.
* @last_updated: The time when the current temperature value was updated
@@ -70,6 +72,7 @@ MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius");
*/
struct temp_data {
int temp;
+ bool temp_valid;
int tjmax;
u64 last_updated;
unsigned int cpu;
@@ -396,7 +399,8 @@ static ssize_t show_temp(struct device *dev,
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct platform_data *pdata = dev_get_drvdata(dev);
struct temp_data *tdata = pdata->core_data[attr->index];
- int tjmax;
+ int tjmax, temp;
+ bool valid;
mutex_lock(&tdata->update_lock);
@@ -405,17 +409,22 @@ static ssize_t show_temp(struct device *dev,
if (time_after64(get_jiffies_64(), tdata->last_updated + HZ)) {
rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx);
/*
- * Ignore the valid bit. In all observed cases the register
- * value is either low or zero if the valid bit is 0.
- * Return it instead of reporting an error which doesn't
- * really help at all.
+ * Bit 31 indicates whether the reading is valid. Some CPUs
+ * clear it while the temperature is too low to be measured.
+ * Such a reading is not a temperature. Do not report it.
*/
+ tdata->temp_valid = (eax >> 31) & 1;
tdata->temp = tjmax - ((eax >> 16) & 0x7f) * 1000;
tdata->last_updated = get_jiffies_64();
}
+ valid = tdata->temp_valid;
+ temp = tdata->temp;
mutex_unlock(&tdata->update_lock);
- return sprintf(buf, "%d\n", tdata->temp);
+
+ if (!valid)
+ return -ENODATA;
+ return sprintf(buf, "%d\n", temp);
}
static int create_core_attrs(struct temp_data *tdata, struct device *dev,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0288/1167] mm/hugetlb: dont clear the resv_map of a VMA whose lock is held
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (286 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0287/1167] hwmon: (coretemp) Return -ENODATA for invalid temperature readings Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0289/1167] ALSA: ua101: Bound packet copies by the PCM buffer size Greg Kroah-Hartman
` (369 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Andrew Morton, Chris Mason, Lorenzo Stoakes (ARM), Muchun Song,
Lance Yang, Liam R. Howlett, Vlastimil Babka, Jann Horn,
Pedro Falcato, Oscar Salvador, Miaohe Lin, Naoya Horiguchi,
Adam Litke, Mel Gorman, Rik van Riel, Peter Xu, Kiryl Shutsemau,
Mike Rapoport, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit d42032c0fe3ca007986c1229128775af0340fbec ]
Since commit bf4916922c60 ("hugetlbfs: extend hugetlb_vma_lock to private
VMAs") the lock of a private hugetlb VMA that owns a reservation is the
rw_sema of its resv_map. The hugetlb_vma_*lock*() helpers find it through
vma->vm_private_data, anew for every lock and every unlock.
At the end of mremap() the old VMA has to let go of the resv_map, which
now belongs to the new VMA: clear_vma_resv_huge_pages() stores NULL into
vm_private_data. mremap() holds mmap_lock for writing and has write
locked the VMA, which keeps away everybody who comes through the mm. It
does not keep away those who find the VMA through the file. For hole
punch and truncation hugetlb_vmdelete_list() does
hugetlb_vma_trylock_write(vma); locks resv_map->rw_sema
unmap_hugepage_range(vma, ...);
vm_private_data = NULL
hugetlb_vma_unlock_write(vma); no resv_map: does nothing
and the rw_sema stays write locked for ever:
WARNING: lock held when returning to user space!
mremap_punch/116 is leaving the kernel with locks still held!
locks held by mremap_punch/116: 1, last CPU#1:
#0: (&resv_map->rw_sema){+.+.}-{4:4}, at:
hugetlb_vmdelete_list+0x46/0x160
The next fault in the new VMA sleeps in hugetlb_vma_lock_read(),
uninterruptibly, and it holds its entry of hugetlb_fault_mutex_table[].
That table is global, so a fault of any other process on a page that
hashes to the same entry sleeps uninterruptibly as well.
All those who take the lock of a private VMA without taking the mmap/vma
lock are affected: rmap walks. So hold i_mmap_rwsem around the clearing
of the resv_map.
No change of behaviour, other than that mremap() of a hugetlb VMA takes
i_mmap_rwsem once more.
Original fix generated by an LLM and sent in private by Josef.
[david: avoid local variable, move and refine comment, description cleanups+simplifications]
Link: https://lore.kernel.org/20261015-urgent_fixes-v1-5-42796911043b@kernel.org
Fixes: bf4916922c60 ("hugetlbfs: extend hugetlb_vma_lock to private VMAs")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Chris Mason <mason@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: Muchun Song <muchun.song@linux.dev>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Rik van Riel <riel@surriel.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: <stable@vger.kernel.org>
[ sashal: Moved the hugetlb resv_map clearing lock into move_vma()'s direct clear_vma_resv_huge_pages() call, since fixup_hugetlb_reservations() doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/mremap.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/mremap.c b/mm/mremap.c
index 19734461d39dc..29a56a72571ed 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -742,7 +742,14 @@ static unsigned long move_vma(struct vm_area_struct *vma,
}
if (is_vm_hugetlb_page(vma)) {
+ /*
+ * Rmap walks might still find this VMA and take the lock
+ * inside the reservation map for __vma_private_lock(). Don't clear
+ * the reservation map while that is possible.
+ */
+ i_mmap_lock_write(vma->vm_file->f_mapping);
clear_vma_resv_huge_pages(vma);
+ i_mmap_unlock_write(vma->vm_file->f_mapping);
}
/* Conceal VM_ACCOUNT so old reservation is not undone */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0289/1167] ALSA: ua101: Bound packet copies by the PCM buffer size
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (287 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0288/1167] mm/hugetlb: dont clear the resv_map of a VMA whose lock is held Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0290/1167] apparmor: fix profile leak when a policy load fails Greg Kroah-Hartman
` (368 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sinan Turunc, Takashi Iwai,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sinan Turunc <enscrpt@pm.me>
[ Upstream commit 493a77a9f20fca07ca5654f61c1b03bef035df25 ]
copy_capture_data() and copy_playback_data() wrap the ring buffer
position once and split the memcpy() in two at the buffer end, which is
only correct when one packet holds at most buffer_size frames. The
capture packet size is the device's (actual_length up to wMaxPacketSize,
divided by 3 * bNrChannels from its own descriptor), the playback packet
size is taken from the capture packets, and set_stream_hw() lets the
PCM client pick period_bytes_min 1, periods_min 2 and a period time of
1.5 packet intervals: 9 frames at 44.1 kHz high speed, an 18-frame
buffer. A device sending 672-byte mono 24-bit packets delivers 224
frames per packet.
After the first packet buffer_pos is 206 and stays beyond buffer_size.
On the next packet frames1 = buffer_size - buffer_pos wraps and memcpy()
runs away:
snd-ua101 2-1:1.0: invalid position: , pos = 206, buffer size = 18,
period size = 9
BUG: KASAN: slab-out-of-bounds in capture_urb_complete+0x9eb/0xcb0
Read of size 4294966732 at addr ffff88800d73e7e0 by task vhci_rx/81
and for playback:
BUG: KASAN: vmalloc-out-of-bounds in playback_work+0x789/0xac0
Read of size 4294966732 at addr ffffc9000002626a by task kworker/0:1H/80
Clamp the capture copy to buffer_size. On playback, copy at most one
buffer and fill the rest of the packet with silence, so the URB length,
the delay accounting and the data sent stay consistent. With that bound
the single wrap and both memcpy() halves stay inside the buffer. A
device whose packets do not fit the buffer never played correctly
anyway.
Reproduced on 7.3-rc7 with a USB/IP device presenting the UA-101
interface layout and a 672-byte isochronous endpoint.
Fixes: 63978ab3e3e9 ("sound: add Edirol UA-101 support")
Cc: stable@vger.kernel.org
Signed-off-by: Sinan Turunc <enscrpt@pm.me>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261026223543.620-3-enscrpt@pm.me
[ sashal: Adapted the playback hunk to the older code: explicit spin_lock_irqsave, urb->urb. field access, and min_t(unsigned int, ...) in place of min(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/misc/ua101.c | 29 ++++++++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
index c43f4e4a8d670..430dac0b00820 100644
--- a/sound/usb/misc/ua101.c
+++ b/sound/usb/misc/ua101.c
@@ -285,13 +285,29 @@ static void playback_work(struct work_struct *work)
/* fill packet with data or silence */
urb->urb.iso_frame_desc[0].length =
frames * ua->playback.frame_bytes;
- if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states))
+ if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) {
+ /*
+ * The packet size comes from the capture stream,
+ * i.e. from the device, while the ring buffer can
+ * be as small as two tiny periods. The single wrap
+ * in copy_playback_data() is only valid for
+ * frames <= buffer_size, so copy at most one
+ * buffer and send silence for the rest.
+ */
+ unsigned int copy_frames = min_t(unsigned int, frames,
+ ua->playback.substream->runtime->buffer_size);
+
do_period_elapsed |= copy_playback_data(&ua->playback,
&urb->urb,
- frames);
- else
+ copy_frames);
+ memset(urb->urb.transfer_buffer +
+ copy_frames * ua->playback.frame_bytes, 0,
+ (frames - copy_frames) *
+ ua->playback.frame_bytes);
+ } else {
memset(urb->urb.transfer_buffer, 0,
urb->urb.iso_frame_desc[0].length);
+ }
/* and off you go ... */
err = usb_submit_urb(&urb->urb, GFP_ATOMIC);
@@ -320,6 +336,13 @@ static bool copy_capture_data(struct ua101_stream *stream, struct urb *urb,
runtime = stream->substream->runtime;
frame_bytes = stream->frame_bytes;
+ /*
+ * A packet can carry up to max_packet_bytes, the device's
+ * wMaxPacketSize, which may exceed the whole ring buffer; keep what
+ * fits so the single wrap below stays valid.
+ */
+ if (unlikely(frames > runtime->buffer_size))
+ frames = runtime->buffer_size;
dest = runtime->dma_area + stream->buffer_pos * frame_bytes;
if (stream->buffer_pos + frames <= runtime->buffer_size) {
memcpy(dest, urb->transfer_buffer, frames * frame_bytes);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0290/1167] apparmor: fix profile leak when a policy load fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (288 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0289/1167] ALSA: ua101: Bound packet copies by the PCM buffer size Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0291/1167] fs: dont fail __d_obtain_alias() for unlinked inodes Greg Kroah-Hartman
` (367 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Georgia Garcia, John Johansen,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georgia Garcia <georgia.garcia@canonical.com>
[ Upstream commit ce94927fa4173fcc1eca27bdc65a140064c8f1e6 ]
The error paths of aa_replace_profiles() and aa_unpack() do not break
the refcount cycle between label and proxy. They just aa_put_profile()
the new profiles, which drops the label refcount from 2 to 1, and the
proxy keeps the profile alive. Every failed atomic policy load
(e.g. "profile can not be replaced", or a later profile in the blob
failing to unpack) leaks every new profile in the set, along with its
proxy, rules and its loaddata reference.
The leak is usually not visible from userspace, because the raw_data
directory for a failed load is not created, but it becomes visible
when the blob is deduplicated onto an existing loaddata, which then
keeps its policy/raw_data/<rev> directory forever.
Add aa_put_unpublished_profile(), which drops the profile's own proxy
before putting the profile, and use it on those error paths. The
proxy of an unpacked profile is always freshly allocated and not
referenced by anything else before the profile is published, so
putting it is safe.
Fixes: 637f688dc3dc ("apparmor: switch from profiles to using labels on contexts")
Cc: stable@vger.kernel.org
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
[ sashal: Context lines adjusted for the older base: AUDIT_MODE() takes a non-const profile pointer and aa_unpack() lacks the compressed_data cleanup lines; the functional hunks are unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/apparmor/include/policy.h | 20 ++++++++++++++++++++
security/apparmor/policy.c | 3 +++
security/apparmor/policy_unpack.c | 4 +++-
3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h
index 17d5492fdc832..70581be3138fc 100644
--- a/security/apparmor/include/policy.h
+++ b/security/apparmor/include/policy.h
@@ -391,6 +391,26 @@ static inline void aa_put_profile(struct aa_profile *p)
kref_put(&p->label.count.count, aa_label_kref);
}
+/**
+ * aa_put_unpublished_profile - put a profile that was never made visible
+ * @p: profile (MAYBE NULL)
+ *
+ * A newly allocated profile and its proxy reference each other
+ * (proxy->label holds a label refcount). That cycle is normally broken
+ * when the profile is replaced or removed, which redirects the proxy.
+ * A profile that is discarded before being added to the policy tree
+ * never goes through either path, so break the cycle here, otherwise
+ * the profile, its proxy and its rawdata are leaked.
+ */
+static inline void aa_put_unpublished_profile(struct aa_profile *p)
+{
+ if (p && p->label.proxy) {
+ aa_put_proxy(p->label.proxy);
+ p->label.proxy = NULL;
+ }
+ aa_put_profile(p);
+}
+
static inline int AUDIT_MODE(struct aa_profile *profile)
{
if (aa_g_audit != AUDIT_NORMAL)
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index eeece851c2c57..c04a77fc103f8 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -1387,6 +1387,9 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,
}
list_for_each_entry_safe(ent, tmp, &lh, list) {
list_del_init(&ent->list);
+ /* new was never added to the policy tree */
+ aa_put_unpublished_profile(ent->new);
+ ent->new = NULL;
aa_load_ent_free(ent);
}
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 2514672214dd9..8557dc014dbf9 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -1504,11 +1504,13 @@ int aa_unpack(struct aa_loaddata *udata, struct list_head *lh,
fail_profile:
kfree(ns_name);
- aa_put_profile(profile);
+ aa_put_unpublished_profile(profile);
fail:
list_for_each_entry_safe(ent, tmp, lh, list) {
list_del_init(&ent->list);
+ aa_put_unpublished_profile(ent->new);
+ ent->new = NULL;
aa_load_ent_free(ent);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0291/1167] fs: dont fail __d_obtain_alias() for unlinked inodes
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (289 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0290/1167] apparmor: fix profile leak when a policy load fails Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0292/1167] ksmbd: let the owner read and change the DACL when no ACE names it Greg Kroah-Hartman
` (366 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daehyeon Ko, Amir Goldstein,
Jan Kara, Christian Brauner (Amutable), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
[ Upstream commit a522dd871024a0f065bfa7638afdb929607f58fc ]
Commit 669bb5af15d4 ("fs: make sure to call fsnotify_inoderemove() only
once when inode is dead") did two things. It made dentry_unlink_inode()
call fsnotify_inoderemove() only once the inode has neither links nor
aliases left. And it made __d_obtain_alias() fail with -ESTALE for an
inode in that state so that open_by_handle_at() can't create a new alias
after FS_DELETE_SELF has been reported and the inode marks are gone.
The second part is wrong for network filesystems. __d_obtain_alias()
backs d_obtain_alias() and d_obtain_root(). Those are what the
->fh_to_dentry() and ->get_parent() methods use to turn the inode they
looked up into a dentry for exportfs_decode_fh_raw(), i.e., for
open_by_handle_at() and for nfsd file handle decoding.
For a local filesystem an in-core inode without links and aliases is an
orphan that goes away on the final iput(). For a network filesystem
that's not true. i_nlink is just the link count the server last
reported and whether the object is still reachable through its file
handle is up to the server. If a file is unlinked while it is still
open elsewhere, e.g., by another NFSv4 client or by a process on the
server, the server keeps the object alive and its file handle stays
valid. nfs_fh_to_dentry() fetches the attributes for such a handle,
nfs_fhget() sets i_nlink to 0 from them, the new inode has no aliases
yet and so __d_obtain_alias() now fails with -ESTALE. The same applies
to fuse_get_dentry() which takes i_nlink from the fuse server.
Filesystems that care about unlinked inodes already make that decision
themselves in ->fh_to_dentry(), e.g., ceph's __fh_to_dentry() fetches
the link count with CEPH_CAP_LINK_SHARED and only refuses an unlinked
inode if it isn't open.
Note that on a network filesystem i_nlink drops to zero through
attribute updates when another client unlinks the file. So the inode
might never have gone through dentry_unlink_inode() with i_nlink == 0,
i.e., fsnotify_inoderemove() might never have been called for it and
there's nothing for the -ESTALE to protect.
So drop the two checks from __d_obtain_alias() again and go back to the
unconditional alias lookup. While at it, update the comment above
inode_notify_dead() since it no longer blocks new aliases.
Amir sent this as v3 to replace 669bb5af15d4 but that commit was already
in mainline by then. So do it as a fix on top. The resulting code is
identical to v3.
This means open_by_handle_at() can again create a new alias for an
unlinked inode after FS_DELETE_SELF has been reported. Closing that file
reports a second FS_DELETE_SELF and the file has none of the inode marks
that were torn down. That's what Daehyeon's open_by_handle_at() LTP test
checks so it is expected to fail again. This needs to be handled
separately. A mark that is added through such a file while
fsnotify_destroy_marks() is still running is rejected with -ENOENT since
36ebddca56b9 ("fsnotify: prevent mark additions during connector
teardown") so it can't end up on a detached connector.
Christian Brauner <brauner@kernel.org> says:
Amir's v3 replaced 669bb5af15d4 as a whole. I turned it into an
incremental fix on top of mainline and wrote a new commit message.
Jan's Reviewed-by was given on v3 and the resulting code is identical.
Fixes: 669bb5af15d4 ("fs: make sure to call fsnotify_inoderemove() only once when inode is dead")
Cc: stable@vger.kernel.org
Reported-by: Daehyeon Ko <4ncienth@gmail.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://patch.msgid.link/CAOQ4uxg7Qt436SiKhKEJKOjtCjeB_XyTjazYF7HMyQAGGcgx2A@mail.gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261030-work-dcache-obtain_alias-v1-1-a1f7e44536d2@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Applied the revert's second hunk in the __d_instantiate_anon() helper rather than inline in __d_obtain_alias(), since this tree had split the recheck out into that helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dcache.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index 2a15d88527916..818a9cb8f016d 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -383,10 +383,9 @@ static void dentry_free(struct dentry *dentry)
}
/*
- * If inode is unlinked and doesn't have any aliases (i.e., all fds pointing to
- * it are closed), it is pretty much dead. Except that file handle lookup could
- * still revive it which causes issues to fsnotify. So once inode reaches this
- * state we make sure to block creating any new aliases.
+ * When inode is unlinked and doesn't have any aliases (i.e., all fds pointing
+ * to it are closed) we report FS_DELETE_SELF to fsnotify and cleanup all inode
+ * marks.
*/
static bool inode_notify_dead(struct inode *inode)
{
@@ -2111,10 +2110,7 @@ static struct dentry *__d_instantiate_anon(struct dentry *dentry,
security_d_instantiate(dentry, inode);
spin_lock(&inode->i_lock);
- if (!inode_notify_dead(inode))
- res = __d_find_any_alias(inode); /* recheck under lock */
- else
- res = ERR_PTR(-ESTALE);
+ res = __d_find_any_alias(inode); /* recheck under lock */
if (res) {
spin_unlock(&inode->i_lock);
dput(dentry);
@@ -2161,12 +2157,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, bool disconnected)
if (IS_ERR(inode))
return ERR_CAST(inode);
- spin_lock(&inode->i_lock);
- if (!inode_notify_dead(inode))
- res = __d_find_any_alias(inode); /* existing alias? */
- else
- res = ERR_PTR(-ESTALE);
- spin_unlock(&inode->i_lock);
+ res = d_find_any_alias(inode); /* existing alias? */
if (res)
goto out_iput;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0292/1167] ksmbd: let the owner read and change the DACL when no ACE names it
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (290 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0291/1167] fs: dont fail __d_obtain_alias() for unlinked inodes Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0293/1167] xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks Greg Kroah-Hartman
` (365 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Bridges, Namjae Jeon,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
[ Upstream commit ffc855fe16afe02b22305111aa68cd8d07360941 ]
smb_check_perm_dacl() refuses the owner when neither its DACL lookup nor
the POSIX ACL fallback matches. The owner then cannot read or replace
the DACL over SMB. MS-DTYP 2.5.3.2 grants the owner READ_CONTROL and
WRITE_DAC unless an OWNER RIGHTS ACE applies.
An empty DACL allows the owner's explicit requests for these rights but
refuses MAXIMUM_ALLOWED. smb2_open() uses that check for the maximal
access reply (MS-SMB2 3.3.5.9.5), so even a READ_CONTROL open fails when
it asks for that reply.
Grant the owner's implicit rights on both paths, for explicit requests
and MAXIMUM_ALLOWED, unless an OWNER RIGHTS ACE applies.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Added the sid_owner_rights constant, which upstream gets from a separate prerequisite commit that isn't in this tree; the rest of the patch applied unchanged apart from line offsets. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smbacl.c | 37 +++++++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c
index 0fe46d3dd9f81..cf429f6bf0573 100644
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -27,6 +27,9 @@ static const struct smb_sid creator_owner = {
/* security id for everyone/world system group */
static const struct smb_sid creator_group = {
1, 1, {0, 0, 0, 0, 0, 3}, {cpu_to_le32(1)} };
+/* security id for owner rights */
+static const struct smb_sid sid_owner_rights = {
+ 1, 1, {0, 0, 0, 0, 0, 3}, {cpu_to_le32(4)} };
/* security id for everyone/world system group */
static const struct smb_sid sid_everyone = {
@@ -1466,6 +1469,7 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
int i, found = 0;
unsigned int access_bits = 0, denied = 0;
struct smb_ace *others_ace = NULL;
+ bool or_ace = false;
struct posix_acl_entry *pa_entry;
unsigned int sid_type = SIDOWNER;
unsigned short ace_size;
@@ -1498,6 +1502,8 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
is_owner = uid == from_kuid(&init_user_ns, vfsuid_into_kuid(vfsuid));
if (!pdacl->num_aces) {
+ unsigned int allowed = 0;
+
/*
* An empty (present, zero-ACE) DACL grants no access to
* anyone except the object owner's implicit READ_CONTROL
@@ -1506,9 +1512,14 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
* not let trailing bytes after a zero-ACE DACL become an
* implicit grant.
*/
- if (!is_owner ||
- (*pdaccess & ~(FILE_READ_CONTROL_LE | FILE_WRITE_DAC_LE)))
+ if (is_owner)
+ allowed = READ_CONTROL | WRITE_DAC;
+ if (*pdaccess & FILE_MAXIMAL_ACCESS_LE)
+ requested |= allowed;
+ if (!allowed || requested & ~allowed)
rc = -EACCES;
+ else
+ *pdaccess = cpu_to_le32(requested);
goto err_out;
}
@@ -1585,6 +1596,9 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
found = 1;
break;
}
+ if (!compare_sids(&sid_owner_rights, &ace->sid) &&
+ !(ace->flags & INHERIT_ONLY_ACE))
+ or_ace = true;
if (!compare_sids(&sid_everyone, &ace->sid) ||
!compare_sids(&sid_authusers, &ace->sid))
others_ace = ace;
@@ -1629,8 +1643,23 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
if (others_ace) {
ace = others_ace;
} else {
- ksmbd_debug(SMB, "Can't find corresponding sid\n");
- rc = -EACCES;
+ unsigned int allowed = 0;
+
+ /*
+ * No ACE names the owner, who may still read and
+ * change the DACL unless OWNER RIGHTS applies
+ * (MS-DTYP 2.5.3.2).
+ */
+ if (is_owner && !or_ace)
+ allowed = READ_CONTROL | WRITE_DAC;
+ if (*pdaccess & FILE_MAXIMAL_ACCESS_LE)
+ requested |= allowed;
+ if (!allowed || requested & ~allowed) {
+ ksmbd_debug(SMB, "Can't find corresponding sid\n");
+ rc = -EACCES;
+ goto err_out;
+ }
+ *pdaccess = cpu_to_le32(requested);
goto err_out;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0293/1167] xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (291 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0292/1167] ksmbd: let the owner read and change the DACL when no ACE names it Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0294/1167] can: skb: make echo skb freeing safe in any IRQ context Greg Kroah-Hartman
` (364 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daejun Park, Christoph Hellwig,
Carlos Maiolino, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daejun Park <daejun7.park@samsung.com>
[ Upstream commit bcf0b7f18ad11e1d410e82ffef678705eff0a317 ]
A client can commit a hole in a LAYOUTCOMMIT, because nfsd does not
check the extents against its layouts. xfs_iomap_write_unwritten() then
allocates written blocks there. A large hole overruns the block
reservation and shuts XFS down. A small one exposes stale data.
Refuse such a range with -EIO, using XFS_BMAPI_CONVERT_ONLY.
Link: https://lore.kernel.org/r/20261014130834.GB15773@lst.de
Fixes: 527851124d10 ("xfs: implement pNFS export operations")
Cc: stable@vger.kernel.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
[ sashal: Moved the xfs_ioend.c hunk to xfs_aops.c (in xfs_end_ioend()), because the older tree has no xfs_ioend.c; the new 0 argument is added at that call site. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/xfs_aops.c | 2 +-
fs/xfs/xfs_file.c | 2 +-
fs/xfs/xfs_iomap.c | 20 +++++++++++++++++---
fs/xfs/xfs_iomap.h | 3 ++-
fs/xfs/xfs_pnfs.c | 9 ++++++++-
5 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 688ac031d3a1c..aed3851fcf9be 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -128,7 +128,7 @@ xfs_end_ioend(
if (ioend->io_flags & IOMAP_F_SHARED)
error = xfs_reflink_end_cow(ip, offset, size);
else if (ioend->io_type == IOMAP_UNWRITTEN)
- error = xfs_iomap_write_unwritten(ip, offset, size, false);
+ error = xfs_iomap_write_unwritten(ip, offset, size, false, 0);
if (!error && xfs_ioend_is_append(ioend))
error = xfs_setfilesize(ip, ioend->io_offset, ioend->io_size);
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 3b9d43d5c7466..f612ea09b80a8 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -526,7 +526,7 @@ xfs_dio_write_end_io(
* they are converted.
*/
if (flags & IOMAP_DIO_UNWRITTEN) {
- error = xfs_iomap_write_unwritten(ip, offset, size, true);
+ error = xfs_iomap_write_unwritten(ip, offset, size, true, 0);
goto out;
}
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index f7c10a8e254a2..188fd210146f0 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -548,7 +548,8 @@ xfs_iomap_write_unwritten(
xfs_inode_t *ip,
xfs_off_t offset,
xfs_off_t count,
- bool update_isize)
+ bool update_isize,
+ uint32_t bmapi_flags)
{
xfs_mount_t *mp = ip->i_mount;
xfs_fileoff_t offset_fsb;
@@ -613,8 +614,21 @@ xfs_iomap_write_unwritten(
*/
nimaps = 1;
error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb,
- XFS_BMAPI_CONVERT, resblks, &imap,
- &nimaps);
+ XFS_BMAPI_CONVERT | bmapi_flags,
+ resblks, &imap, &nimaps);
+ if (error == -ENOSR && (bmapi_flags & XFS_BMAPI_CONVERT_ONLY)) {
+ /*
+ * Nothing was mapped: the rest of the range starts
+ * with a hole or a delalloc extent. Nothing was
+ * changed either, but xfs_iext_count_extend() may
+ * have logged the inode, and cancelling a dirty
+ * transaction shuts the filesystem down. Commit it,
+ * as xfs_alloc_file_space() does on -ENOSR.
+ */
+ error = xfs_trans_commit(tp);
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
+ return error ? error : -EIO;
+ }
if (error)
goto error_on_bmapi_transaction;
diff --git a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h
index 4da13440bae9b..eb70f1653776a 100644
--- a/fs/xfs/xfs_iomap.h
+++ b/fs/xfs/xfs_iomap.h
@@ -14,7 +14,8 @@ struct xfs_bmbt_irec;
int xfs_iomap_write_direct(struct xfs_inode *ip, xfs_fileoff_t offset_fsb,
xfs_fileoff_t count_fsb, unsigned int flags,
struct xfs_bmbt_irec *imap, u64 *sequence);
-int xfs_iomap_write_unwritten(struct xfs_inode *, xfs_off_t, xfs_off_t, bool);
+int xfs_iomap_write_unwritten(struct xfs_inode *ip, xfs_off_t offset,
+ xfs_off_t count, bool update_isize, uint32_t bmapi_flags);
xfs_fileoff_t xfs_iomap_eof_align_last_fsb(struct xfs_inode *ip,
xfs_fileoff_t end_fsb);
diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
index fa027574d6de1..4cc5c8b0f935c 100644
--- a/fs/xfs/xfs_pnfs.c
+++ b/fs/xfs/xfs_pnfs.c
@@ -315,7 +315,14 @@ xfs_fs_commit_blocks(
(end - 1) >> PAGE_SHIFT);
WARN_ON_ONCE(error);
- error = xfs_iomap_write_unwritten(ip, start, length, false);
+ /*
+ * A client may only write to blocks that a layout handed out,
+ * and xfs_fs_map_blocks() allocates blocks for any hole in a
+ * write layout, so refuse to allocate blocks for a hole or a
+ * delalloc extent in the committed range.
+ */
+ error = xfs_iomap_write_unwritten(ip, start, length, false,
+ XFS_BMAPI_CONVERT_ONLY);
if (error)
goto out_drop_iolock;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0294/1167] can: skb: make echo skb freeing safe in any IRQ context
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (292 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0293/1167] xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0295/1167] mm/userfaultfd: wake all waiters on unregister Greg Kroah-Hartman
` (363 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cunhao Lu, stable, Marc Kleine-Budde,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cunhao Lu <1579567540@qq.com>
[ Upstream commit d743071964920c92af598c87a9e6f4369263ee09 ]
can_put_echo_skb() can be called with hardware interrupts disabled. Its
direct drop paths use kfree_skb(), while can_create_echo_skb() uses
kfree_skb() when cloning fails and consume_skb() after a successful clone.
None of these helpers is safe in every IRQ context.
Use dev_kfree_skb_any() for all drop paths and dev_consume_skb_any() when
consuming a successfully cloned skb. This preserves the respective skb drop
and consumed semantics regardless of the caller IRQ context.
Signed-off-by: Cunhao Lu <1579567540@qq.com>
Link: https://patch.msgid.link/tencent_E84809CF236D0137885E7E4E4D58340B3208@qq.com
Cc: stable@kernel.org
Fixes: ae64438be192 ("can: dev: fix skb drop check")
Fixes: 0ae89beb283a ("can: add destructor for self generated skbs")
Fixes: 3ccd4c6167d3 ("can: Unify droping of invalid tx skbs and netdev stats")
Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface")
[mkl: also convert can_dropped_invalid_skb(), can_dev_dropped_skb()]
[mkl: add stable on Cc + add Fixes tags]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/can/dev/skb.c | 6 +++---
include/linux/can/dev.h | 2 +-
include/linux/can/skb.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/can/dev/skb.c b/drivers/net/can/dev/skb.c
index 4f5eec05db220..d4111394af247 100644
--- a/drivers/net/can/dev/skb.c
+++ b/drivers/net/can/dev/skb.c
@@ -61,7 +61,7 @@ int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
(skb->protocol != htons(ETH_P_CAN) &&
skb->protocol != htons(ETH_P_CANFD) &&
skb->protocol != htons(ETH_P_CANXL))) {
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return 0;
}
@@ -87,7 +87,7 @@ int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
} else {
/* locking problem with netif_stop_queue() ?? */
netdev_err(dev, "%s: BUG! echo_skb %d is occupied!\n", __func__, idx);
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return -EBUSY;
}
@@ -369,7 +369,7 @@ bool can_dropped_invalid_skb(struct net_device *dev, struct sk_buff *skb)
return false;
inval_skb:
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
dev->stats.tx_dropped++;
return true;
}
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 982ba245eb41c..e8b9c69563135 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -160,7 +160,7 @@ static inline bool can_dev_dropped_skb(struct net_device *dev, struct sk_buff *s
if (priv->ctrlmode & CAN_CTRLMODE_LISTENONLY) {
netdev_info_once(dev,
"interface in listen only mode, dropping skb\n");
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
dev->stats.tx_dropped++;
return true;
}
diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h
index 27d0ca115c6c1..1f0c3e8cde907 100644
--- a/include/linux/can/skb.h
+++ b/include/linux/can/skb.h
@@ -92,12 +92,12 @@ static inline struct sk_buff *can_create_echo_skb(struct sk_buff *skb)
nskb = skb_clone(skb, GFP_ATOMIC);
if (unlikely(!nskb)) {
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return NULL;
}
can_skb_set_owner(nskb, skb->sk);
- consume_skb(skb);
+ dev_consume_skb_any(skb);
return nskb;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0295/1167] mm/userfaultfd: wake all waiters on unregister
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (293 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0294/1167] can: skb: make echo skb freeing safe in any IRQ context Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0296/1167] khugepaged: fix readahead lock inversion in collapse_file() Greg Kroah-Hartman
` (362 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik,
Mike Rapoport (Microsoft), Lorenzo Stoakes (ARM),
Muhammad Usama Anjum, David Hildenbrand (Arm), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 3afb19d68cc5e7851fdb1069c8094af97bd80417 ]
UFFDIO_UNREGISTER only wakes pending faults if VM_UFFD_MISSING is set.
Threads waiting on write-protect, minor or RWP faults can therefore remain
asleep after unregistering a range that does not track missing faults.
Wake pending faults regardless of the registration mode so they can retry
without an explicit UFFDIO_WAKE or closing the userfaultfd. This matches
the existing behavior for missing faults, including removing unread fault
messages for the woken waiters.
Fix generated by an LLM and sent by Josef Bacik in private.
Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
[ david: rebase; simplify description ]
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-24-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Replaced the unregister wake's ctx argument with vma->vm_userfaultfd_ctx.ctx, the VMA's own context, and the file path is fs/ instead of mm/. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/userfaultfd.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index ba138f968526f..460eb3017b23c 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1659,6 +1659,8 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,
ret = 0;
for_each_vma_range(vmi, vma, end) {
+ struct userfaultfd_wake_range range;
+
cond_resched();
BUG_ON(!vma_can_userfault(vma, vma->vm_flags));
@@ -1679,18 +1681,14 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,
/* Prevent new userfaults from being queued after the wakeup. */
vma_start_write(vma);
- if (userfaultfd_missing(vma)) {
- /*
- * Wake any concurrent pending userfault while
- * we unregister, so they will not hang
- * permanently and it avoids userland to call
- * UFFDIO_WAKE explicitly.
- */
- struct userfaultfd_wake_range range;
- range.start = start;
- range.len = vma_end - start;
- wake_userfault(vma->vm_userfaultfd_ctx.ctx, &range);
- }
+ /*
+ * Wake any concurrent pending userfault while we unregister,
+ * so they will not hang permanently and it avoids userland to
+ * call UFFDIO_WAKE explicitly.
+ */
+ range.start = start;
+ range.len = vma_end - start;
+ wake_userfault(vma->vm_userfaultfd_ctx.ctx, &range);
/* Reset ptes for the whole vma range if wr-protected */
if (userfaultfd_wp(vma))
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0296/1167] khugepaged: fix readahead lock inversion in collapse_file()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (294 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0295/1167] mm/userfaultfd: wake all waiters on unregister Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0297/1167] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations Greg Kroah-Hartman
` (361 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+16bf7cd0ebeb1de93aa5,
Lance Yang, Pedro Falcato, David Hildenbrand (Arm), Zi Yan,
Baolin Wang, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lance Yang <lance.yang@linux.dev>
[ Upstream commit eadce52a9ef657d561b3e76c9b5f178bd99735f5 ]
collapse_file() can call page_cache_sync_readahead() while still holding
source folios locked. If truncate holds mapping->invalidate_lock
exclusively and waits for one of those folios, readahead waits for
invalidate_lock and neither side can make progress.
We need to release those folio locks before starting readahead. On a page
cache miss, roll back first, populate the collapse range, and retry once.
Doing readahead after rollback avoids an extra pass when all folios are
already present. If another miss occurs on retry, give up rather than keep
retrying while truncate or reclaim removes folios.
Keep page_cache_sync_readahead() and wait for read I/O with
filemap_lock_folio(), releasing each folio before moving to the next. The
existing uptodate check during collapse still handles read errors.
Shmem uses shmem_get_folio() for swapin and fallocated folios without
taking mapping->invalidate_lock, so it is unaffected.
Reported-by: syzbot+16bf7cd0ebeb1de93aa5@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=16bf7cd0ebeb1de93aa5
Fixes: 730633f0b7f9 ("mm: Protect operations adding pages to page cache with invalidate_lock")
Cc: stable@vger.kernel.org
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://patch.msgid.link/20261026152013.10511-1-lance.yang@linux.dev
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: adapted collapse_file() to the older page-based code (struct page, int result, find_lock_page) instead of folios and enum scan_result, keeping the same readahead-after-rollback logic. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/khugepaged.c | 44 +++++++++++++++++++++++++++++++++-----------
1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 4933bafe61760..2eae83f34c76c 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1802,6 +1802,8 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
LIST_HEAD(pagelist);
XA_STATE_ORDER(xas, &mapping->i_pages, start, HPAGE_PMD_ORDER);
int nr_none = 0, result = SCAN_SUCCEED;
+ bool do_readahead = false;
+ bool readahead_done = false;
VM_BUG_ON(!IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS) && !is_shmem);
VM_BUG_ON(start & (HPAGE_PMD_NR - 1));
@@ -1813,6 +1815,10 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
mapping_set_update(&xas, mapping);
+retry:
+ result = SCAN_SUCCEED;
+ do_readahead = false;
+ xas_set_order(&xas, start, HPAGE_PMD_ORDER);
__folio_set_locked(new_folio);
if (is_shmem)
__folio_set_swapbacked(new_folio);
@@ -1877,17 +1883,9 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
}
} else { /* !is_shmem */
if (!page || xa_is_value(page)) {
- xas_unlock_irq(&xas);
- page_cache_sync_readahead(mapping, &file->f_ra,
- file, index,
- end - index);
- /* drain lru cache to help isolate_lru_page() */
- lru_add_drain();
- page = find_lock_page(mapping, index);
- if (unlikely(page == NULL)) {
- result = SCAN_FAIL;
- goto xa_unlocked;
- }
+ do_readahead = !readahead_done;
+ result = SCAN_FAIL;
+ goto xa_locked;
} else if (PageDirty(page)) {
/*
* khugepaged only works on read-only fd,
@@ -2218,6 +2216,30 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
new_folio->mapping = NULL;
folio_unlock(new_folio);
+
+ /* Readahead may take invalidate_lock; source folios are unlocked. */
+ if (do_readahead) {
+ for (index = start; index < end;) {
+ folio = filemap_lock_folio(mapping, index);
+ if (IS_ERR(folio)) {
+ page_cache_sync_readahead(mapping, &file->f_ra,
+ file, index, end - index);
+ folio = filemap_lock_folio(mapping, index);
+ if (IS_ERR(folio)) {
+ result = SCAN_FAIL;
+ goto out_put;
+ }
+ }
+ index = folio_next_index(folio);
+ folio_unlock(folio);
+ folio_put(folio);
+ }
+ /* Drain the local LRU batch before retrying isolation. */
+ lru_add_drain();
+ readahead_done = true;
+ goto retry;
+ }
+out_put:
folio_put(new_folio);
out:
VM_BUG_ON(!list_empty(&pagelist));
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0297/1167] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (295 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0296/1167] khugepaged: fix readahead lock inversion in collapse_file() Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0298/1167] perf evsel: Restrict incremental open error unwind Greg Kroah-Hartman
` (360 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Salvatore Dipietro, Andrew Morton,
Vlastimil Babka (SUSE), Zi Yan, Johannes Weiner,
Christoph Hellwig, David Hildenbrand, Michal Hocko,
Matthew Wilcox, Dave Chinner, Ritesh Harjani, Dmitry Ilvokhin,
Hazem Mohamed Abuelfotoh, Ali Saidi, Geoff Blake,
Christian Brauner, dipietro.salvatore, Darrick J. Wong,
Brendan Jackman, rvvandan, Suren Baghdasaryan, Garg, Shivank,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Salvatore Dipietro <dipiets@amazon.it>
[ Upstream commit 0e05a469c29400eb6e35448ce7318581688a1806 ]
Commit 5d8edfb900d5 ("iomap: Copy larger chunks from userspace")
introduced high-order folio allocations in the iomap buffered write path.
When memory is fragmented, each failed costly-order allocation enters
__alloc_pages_slowpath() which runs direct reclaim, direct compaction and
drain_all_pages(), causing a 0.38x throughput drop on PostgreSQL pgbench
(simple-update) with 1024 clients on a 96-vCPU arm64 system.
The root issue is that direct reclaim and direct compaction are too
expensive for hot allocation paths that have fallbacks to smaller
allocations. __filemap_get_folio_mpol() already marks higher-order
allocations with __GFP_NORETRY | __GFP_NOWARN, signalling that the caller
can handle failure. However, the page allocator still enters the full
blocking slowpath for costly orders with __GFP_NORETRY, which is
unnecessarily aggressive when the caller will simply retry at a lower
order.
For costly-order allocations with __GFP_NORETRY, clear
__GFP_DIRECT_RECLAIM at the very start of the slowpath, before
can_direct_reclaim, can_compact and the nofail checks are evaluated. This
makes the entire slowpath treat the request as non-blocking: no direct
reclaim, no direct compaction and no drain_all_pages() IPI across every
CPU. Reclaim and compaction move to the background instead: kswapd is
still woken for reclaim, and it wakes kcompactd for defragmentation. The
system keeps its long-term health while the latency-critical direct
allocation path no longer stalls.
Allocations that also request __GFP_THISNODE are exempted. That flag
pairing identifies the local-node-first THP attempt issued by
alloc_pages_mpol() (mempolicy.c), which relies on direct compaction to
form transparent huge pages.
Clearing __GFP_DIRECT_RECLAIM makes these allocations reach the
!can_direct_reclaim bailout, which since commit 4c0ed883e051
("mm/page_alloc: fix defrag_mode for non-reclaimable allocations") drops
ALLOC_NOFRAGMENT and retries instead of failing when defrag_mode is on.
With vm.defrag_mode=1 a __GFP_NORETRY allocation could therefore succeed
by fragmenting another migratetype's pageblock. That is the wrong trade
for a caller that has already communicated it can handle failure and has a
cheap lower-order fallback, so exclude __GFP_NORETRY from the relaxation.
The exclusion is not restricted to costly orders: any __GFP_NORETRY caller
has said it can cope with failure, so failing is preferable to fragmenting
for all of them.
Test environment:
Hardware: AWS EC2 m8g.24xlarge (96 vCPU, arm64)
12x 1TB IO2 32000 IOPS RAID0 XFS
OS: AL2023
Kernel: v7.3-rc1
Database: PostgreSQL 18.4
Workload: pgbench simple-update, 1024 clients, 96 threads, 1200s
Results (average of 3 runs, TPS):
Config Avg TPS % vs baseline
v7.3-rc1 baseline (vm.defrag_mode=0) 58,602 -
v7.3-rc1 + this patch (vm.defrag_mode=0) 157,246 +168.3%
v7.3-rc1 baseline (vm.defrag_mode=1) 109,012 -
v7.3-rc1 + this patch (vm.defrag_mode=1) 157,778 +44.7%
Link: https://lore.kernel.org/20261001082152.2879289-1-dipiets@amazon.it
Link: https://lore.kernel.org/all/20260403193535.9970-1-dipiets@amazon.it/T/#t [v1]
Link: https://lore.kernel.org/linux-mm/20260420161404.642-1-dipiets@amazon.it/T/#u [v2]
Link: https://lore.kernel.org/all/20260710143437.12379-1-dipiets@amazon.it/T/#u [v3]
Link: https://lore.kernel.org/all/20260904115629.3993331-1-dipiets@amazon.it/T/#u [v4]
Link: https://lore.kernel.org/all/20260911142102.2294202-1-dipiets@amazon.it/T/#u [v5]
Fixes: 5d8edfb900d5 ("iomap: Copy larger chunks from userspace")
Signed-off-by: Salvatore Dipietro <dipiets@amazon.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: David Hildenbrand <david@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Dave Chinner <dgc@kernel.org>
Cc: Ritesh Harjani <ritesh.list@gmail.com>
Cc: Dmitry Ilvokhin <d@ilvokhin.com>
Cc: Hazem Mohamed Abuelfotoh <abuehaze@amazon.com>
Cc: Ali Saidi <alisaidi@amazon.com>
Cc: Geoff Blake <blakgeof@amazon.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: <dipietro.salvatore@gmail.com>
Cc: Darrick J. Wong <djwong@kernel.org>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: <rvvandan@amazon.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: "Garg, Shivank" <shivankg@amd.com>
introduced high-order folio allocations in the iomap buffered write path.
When memory is fragmented, each failed costly-order allocation enters
__alloc_pages_slowpath() which runs direct reclaim, direct compaction and
drain_all_pages(), causing a 0.38x throughput drop on PostgreSQL pgbench
(simple-update) with 1024 clients on a 96-vCPU arm64 system.
The root issue is that direct reclaim and direct compaction are too
expensive for hot allocation paths that have fallbacks to smaller
allocations. __filemap_get_folio_mpol() already marks higher-order
allocations with __GFP_NORETRY | __GFP_NOWARN, signalling that the caller
can handle failure. However, the page allocator still enters the full
blocking slowpath for costly orders with __GFP_NORETRY, which is
unnecessarily aggressive when the caller will simply retry at a lower
order.
For costly-order allocations with __GFP_NORETRY, clear
__GFP_DIRECT_RECLAIM at the very start of the slowpath, before
can_direct_reclaim, can_compact and the nofail checks are evaluated. This
makes the entire slowpath treat the request as non-blocking: no direct
reclaim, no direct compaction and no drain_all_pages() IPI across every
CPU. Reclaim and compaction move to the background instead: kswapd is
still woken for reclaim, and it wakes kcompactd for defragmentation. The
system keeps its long-term health while the latency-critical direct
allocation path no longer stalls.
Allocations that also request __GFP_THISNODE are exempted. That flag
pairing identifies the local-node-first THP attempt issued by
alloc_pages_mpol() (mempolicy.c), which relies on direct compaction to
form transparent huge pages.
Clearing __GFP_DIRECT_RECLAIM makes these allocations reach the
!can_direct_reclaim bailout, which since commit 4c0ed883e051
("mm/page_alloc: fix defrag_mode for non-reclaimable allocations") drops
ALLOC_NOFRAGMENT and retries instead of failing when defrag_mode is on.
With vm.defrag_mode=1 a __GFP_NORETRY allocation could therefore succeed
by fragmenting another migratetype's pageblock. That is the wrong trade
for a caller that has already communicated it can handle failure and has a
cheap lower-order fallback, so exclude __GFP_NORETRY from the relaxation.
[ sashal: Dropped the defrag_mode hunk and its comment, since the older tree lacks defrag_mode, and left nofail inline and can_compact without the can_direct_reclaim && term. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e0d44b3f31678..0eec7b9d329ef 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3958,9 +3958,9 @@ static inline struct page *
__alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
struct alloc_context *ac)
{
- bool can_direct_reclaim = gfp_mask & __GFP_DIRECT_RECLAIM;
- bool can_compact = gfp_compaction_allowed(gfp_mask);
const bool costly_order = order > PAGE_ALLOC_COSTLY_ORDER;
+ bool can_direct_reclaim;
+ bool can_compact;
struct page *page = NULL;
unsigned int alloc_flags;
unsigned long did_some_progress;
@@ -3972,6 +3972,17 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
unsigned int zonelist_iter_cookie;
int reserve_flags;
+ /*
+ * Costly __GFP_NORETRY callers have a cheap fallback, so don't stall
+ * them in reclaim or compaction. __GFP_THISNODE callers are exempt.
+ */
+ if (costly_order && (gfp_mask & __GFP_NORETRY) &&
+ !(gfp_mask & __GFP_THISNODE))
+ gfp_mask &= ~__GFP_DIRECT_RECLAIM;
+
+ can_direct_reclaim = gfp_mask & __GFP_DIRECT_RECLAIM;
+ can_compact = gfp_compaction_allowed(gfp_mask);
+
restart:
compaction_retries = 0;
no_progress_loops = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0298/1167] perf evsel: Restrict incremental open error unwind
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (296 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0297/1167] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0299/1167] libbpf: Avoid overflow in BTF.ext bounds check Greg Kroah-Hartman
` (359 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Hui Su, Namhyung Kim,
Arnaldo Carvalho de Melo, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Su <sh_def@163.com>
[ Upstream commit d023b2110d0d7232ba952a486c497ba8817f6f66 ]
evsel__open_cpu(), evsel__tool_pmu_open() and
evsel__hwmon_pmu_open() support opening a subrange of a CPU map, bounded
by [start_cpu_map_idx, end_cpu_map_idx).
Their error paths, however, unwind using "while (--idx >= 0)" all the way
back to CPU index 0 regardless of start_cpu_map_idx. If lower CPU indices
were opened by an earlier invocation, a later incremental open failure
therefore closes those existing file descriptors and overwrites their
slots with -1.
Before this fix, running the new incremental open test demonstrates this
corruption:
$ perf test -v "Tool PMU"
12: Tool PMU:
12.1: Tool PMU : Ok
12.2: Tool PMU leader : Ok
12.3: Incremental open error unwind boundary:
FAILED: CPU 0 FD overwritten: FD(evsel, 0, 0)=-1, expected 4
FAILED!
Stop the unwind at start_cpu_map_idx so that only file descriptors
opened by the current invocation are rolled back.
After this fix:
$ perf test -v "Tool PMU"
12: Tool PMU:
12.1: Tool PMU : Ok
12.2: Tool PMU leader : Ok
12.3: Incremental open error unwind boundary : Ok
Fixes: 4804e0111662d7d8 ("perf stat: Use affinity for opening events")
Fixes: 240505b2d0adcdc8 ("perf tool_pmu: Factor tool events into their own PMU")
Fixes: 53cc0b351ec99278 ("perf hwmon_pmu: Add a tool PMU exposing events from hwmon in sysfs")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Hui Su <sh_def@163.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: Only the evsel.c hunk of the upstream change was applied, as the same one-line loop-bound fix; the tool_pmu.c, hwmon_pmu.c and new test hunks were dropped because those files don't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/evsel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index ff9ad7637562a..139956317a33a 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2174,7 +2174,7 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus,
FD(evsel, idx, thread) = -1;
}
thread = nthreads;
- } while (--idx >= 0);
+ } while (--idx >= start_cpu_map_idx);
errno = old_errno;
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0299/1167] libbpf: Avoid overflow in BTF.ext bounds check
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (297 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0298/1167] perf evsel: Restrict incremental open error unwind Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0300/1167] gpio: pcf857x: implement get_direction() Greg Kroah-Hartman
` (358 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Darren Carreras, Andrii Nakryiko,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darren Carreras <carrerasdarren@gmail.com>
[ Upstream commit e40f61a31688898e7cf81e91074a42f805883e4d ]
A malformed BTF.ext subsection length in an ELF input can wrap the
pointer addition used by btf_ext_parse_sec_info() on 32-bit builds. The
wrapped pointer passes the bounds check and parsing then reads beyond the
copied BTF.ext data.
Ensure the header fits in the copied data, then validate the subsection
offset and length with subtraction before forming its pointer.
Fixes: ae4ab4b4117d ("btf: expose API to work with raw btf_ext data")
Closes: https://issues.oss-fuzz.com/issues/477315119
Signed-off-by: Darren Carreras <carrerasdarren@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260813-b4-libbpf-v6-send-20260813-v6-1-56be61c52758@gmail.com
[ sashal: Moved the "start of the info sec" comment from the void *info; declaration to above the info = ... assignment, since the function here is named btf_ext_setup_info() and the context differed. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/lib/bpf/btf.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 54ad899a1e96c..78bc62be03fbd 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -2657,9 +2657,8 @@ static int btf_ext_setup_info(struct btf_ext *btf_ext,
{
const struct btf_ext_info_sec *sinfo;
struct btf_ext_info *ext_info;
- __u32 info_left, record_size;
+ __u32 data_left, info_left, record_size;
size_t sec_cnt = 0;
- /* The start of the info sec (including the __u32 record_size). */
void *info;
if (ext_sec->len == 0)
@@ -2671,15 +2670,20 @@ static int btf_ext_setup_info(struct btf_ext *btf_ext,
return -EINVAL;
}
- info = btf_ext->data + btf_ext->hdr->hdr_len + ext_sec->off;
- info_left = ext_sec->len;
+ if (btf_ext->hdr->hdr_len > btf_ext->data_size)
+ return -EINVAL;
- if (btf_ext->data + btf_ext->data_size < info + ext_sec->len) {
+ data_left = btf_ext->data_size - btf_ext->hdr->hdr_len;
+ if (ext_sec->off > data_left || ext_sec->len > data_left - ext_sec->off) {
pr_debug("%s section (off:%u len:%u) is beyond the end of the ELF section .BTF.ext\n",
ext_sec->desc, ext_sec->off, ext_sec->len);
return -EINVAL;
}
+ /* The start of the info sec (including the __u32 record_size). */
+ info = btf_ext->data + btf_ext->hdr->hdr_len + ext_sec->off;
+ info_left = ext_sec->len;
+
/* At least a record size */
if (info_left < sizeof(__u32)) {
pr_debug(".BTF.ext %s record size not found\n", ext_sec->desc);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0300/1167] gpio: pcf857x: implement get_direction()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (298 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0299/1167] libbpf: Avoid overflow in BTF.ext bounds check Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0301/1167] perf jitdump: Free event in jit_repipe_code_move() Greg Kroah-Hartman
` (357 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tapio Reijonen, Linus Walleij,
Bartosz Golaszewski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tapio Reijonen <tapio.reijonen@vaisala.com>
[ Upstream commit ed14364ae8c310cc3f3f649ffcbc7f82befe1579 ]
The GPIO core warns (and taints the kernel) when a gpiochip lacks
.get_direction() and a consumer queries a line's direction, for example
via /sys/kernel/debug/gpio. pcf857x provided direction_input/output but
no get_direction.
These quasi-bidirectional expanders cannot report direction in hardware,
and the 'out' software latch alone is ambiguous - a released (input)
line and an output driven high both read back as a set bit. Track the
direction explicitly in a 'dir' latch updated by the direction_input(),
direction_output() and set_multiple() paths, and return it from
get_direction(). Initialise it from the same reset state as 'out':
released lines are inputs, lines flagged in the power-on latch are
driven-low outputs.
Fixes: 15fae37d9f5f ("gpiolib: pcf857x i2c gpio expander support")
Signed-off-by: Tapio Reijonen <tapio.reijonen@vaisala.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260825-b4-gpio-pcf857x-get-direction-v1-1-de15996ae354@vaisala.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ sashal: Adjusted pcf857x_set_multiple() context: this tree's function returns void with a bare gpio->write(), so only the dir update was added, and the probe() context differs (no reset_gpio line). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-pcf857x.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c
index 53b69abe67871..2c3abf576f7a2 100644
--- a/drivers/gpio/gpio-pcf857x.c
+++ b/drivers/gpio/gpio-pcf857x.c
@@ -68,8 +68,9 @@ MODULE_DEVICE_TABLE(of, pcf857x_of_table);
struct pcf857x {
struct gpio_chip chip;
struct i2c_client *client;
- struct mutex lock; /* protect 'out' */
+ struct mutex lock; /* protect 'out' and 'dir' */
unsigned int out; /* software latch */
+ unsigned int dir; /* direction latch (1 = input) */
unsigned int status; /* current status */
unsigned int irq_enabled; /* enabled irqs */
@@ -122,12 +123,21 @@ static int pcf857x_input(struct gpio_chip *chip, unsigned int offset)
mutex_lock(&gpio->lock);
gpio->out |= (1 << offset);
+ gpio->dir |= (1 << offset);
status = gpio->write(gpio->client, gpio->out);
mutex_unlock(&gpio->lock);
return status;
}
+static int pcf857x_get_direction(struct gpio_chip *chip, unsigned int offset)
+{
+ struct pcf857x *gpio = gpiochip_get_data(chip);
+
+ return (gpio->dir & (1 << offset)) ? GPIO_LINE_DIRECTION_IN
+ : GPIO_LINE_DIRECTION_OUT;
+}
+
static int pcf857x_get(struct gpio_chip *chip, unsigned int offset)
{
struct pcf857x *gpio = gpiochip_get_data(chip);
@@ -163,6 +173,7 @@ static int pcf857x_output(struct gpio_chip *chip, unsigned int offset, int value
gpio->out |= bit;
else
gpio->out &= ~bit;
+ gpio->dir &= ~bit;
status = gpio->write(gpio->client, gpio->out);
mutex_unlock(&gpio->lock);
@@ -182,6 +193,7 @@ static void pcf857x_set_multiple(struct gpio_chip *chip, unsigned long *mask,
mutex_lock(&gpio->lock);
gpio->out &= ~*mask;
gpio->out |= *bits & *mask;
+ gpio->dir &= ~*mask;
gpio->write(gpio->client, gpio->out);
mutex_unlock(&gpio->lock);
}
@@ -295,6 +307,7 @@ static int pcf857x_probe(struct i2c_client *client)
gpio->chip.set_multiple = pcf857x_set_multiple;
gpio->chip.direction_input = pcf857x_input;
gpio->chip.direction_output = pcf857x_output;
+ gpio->chip.get_direction = pcf857x_get_direction;
gpio->chip.ngpio = (uintptr_t)i2c_get_match_data(client);
/* NOTE: the OnSemi jlc1562b is also largely compatible with
@@ -366,6 +379,7 @@ static int pcf857x_probe(struct i2c_client *client)
* reset state. Otherwise it flags pins to be driven low.
*/
gpio->out = ~n_latch;
+ gpio->dir = ~n_latch;
gpio->status = gpio->read(gpio->client);
/* Enable irqchip if we have an interrupt */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0301/1167] perf jitdump: Free event in jit_repipe_code_move()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (299 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0300/1167] gpio: pcf857x: implement get_direction() Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0302/1167] cxl/test: Map mock device nodes to an online node Greg Kroah-Hartman
` (356 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 7fc5851aac606b9e4143f6857710cc5f346770c5 ]
jit_repipe_code_move() allocates a perf_event with calloc but never
frees it — the 'out' label exits with only perf_sample__exit().
The sibling function jit_repipe_code_load() correctly calls
free(event) at its out label. Add the same free(event) to
jit_repipe_code_move().
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: Added an out: label with free(event); and changed the early return ret; after the mmap2 failure to goto out;, since this tree's function has no out: label or perf_sample__exit(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 58ba7d6806c4b..10505db63e386 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -672,12 +672,14 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
ret = perf_event__process_mmap2(tool, event, &sample, jd->machine);
if (ret)
- return ret;
+ goto out;
ret = jit_inject_event(jd, event);
if (!ret)
build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine);
+out:
+ free(event);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0302/1167] cxl/test: Map mock device nodes to an online node
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (300 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0301/1167] perf jitdump: Free event in jit_repipe_code_move() Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0303/1167] fuse: dont bump attr_version for async direct read completion Greg Kroah-Hartman
` (355 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Davidlohr Bueso, Dave Jiang,
Alison Schofield, Shaikh Kamaluddin, Gregory Price (Meta),
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Davidlohr Bueso <dave@stgolabs.net>
[ Upstream commit 6f057dea152574dd044382fd0ba5ed19e3ecba25 ]
cxl_type3_mem_init() and cxl_type2_mem_init() assign alternating NUMA
nodes to the mock memdevs to model multi-node topologies. On a
single-node host node 1 has no pgdat, and the first node-aware
allocation in an odd device's probe faults on a NULL zonelist:
Oops: general protection fault, probably for non-canonical address 0xdffffc00000006e3
KASAN: probably user-memory-access in range [0x0000000000003718-0x000000000000371f]
Workqueue: async async_run_entry_fn
RIP: __alloc_frozen_pages_noprof+0x288
new_slab
___slab_alloc
__kmalloc_node_track_caller_noprof
devm_kmalloc
cxl_mock_mem_probe
Map the requested node to an online one, as dax_hmem already does
for its target node.
Fixes: cf1f6877b088 ("cxl/memdev: Add numa_node attribute")
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Shaikh Kamaluddin <shaikhkamal2012@gmail.com>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20260831175119.3247915-1-dave@stgolabs.net
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: adapted the NUMA node change to the three set_dev_node() sites present here, dropping the type-2 hunk because that function doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/cxl/test/cxl.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
index 0bb93bff74be0..31af241758968 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -1041,7 +1041,7 @@ static __init int cxl_rch_init(void)
if (!pdev)
goto err_mem;
pdev->dev.parent = &rch->dev;
- set_dev_node(&pdev->dev, i % 2);
+ set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
rc = platform_device_add(pdev);
if (rc) {
@@ -1178,7 +1178,7 @@ static __init int cxl_single_init(void)
if (!pdev)
goto err_mem;
pdev->dev.parent = &dport->dev;
- set_dev_node(&pdev->dev, i % 2);
+ set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
rc = platform_device_add(pdev);
if (rc) {
@@ -1357,7 +1357,7 @@ static __init int cxl_test_init(void)
if (!pdev)
goto err_mem;
pdev->dev.parent = &dport->dev;
- set_dev_node(&pdev->dev, i % 2);
+ set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
rc = platform_device_add(pdev);
if (rc) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0303/1167] fuse: dont bump attr_version for async direct read completion
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (301 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0302/1167] cxl/test: Map mock device nodes to an online node Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0304/1167] RDMA/hns: Fix missing CQE when UD QP use different SL Greg Kroah-Hartman
` (354 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Horst Birthelmer, Jingbo Xu,
Miklos Szeredi, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jingbo Xu <jefflexu@linux.alibaba.com>
[ Upstream commit fc60668db85584da911e5d0a65c8698628f98bba ]
The attr_version counter should only be incremented when cached
attributes are actually modified (as documented in commit 1fb69e781729
("fuse: fix race between getattr and write")). Async direct reads do not
modify any cached inode attributes (size, mtime, ctime), so bumping
attr_version in fuse_aio_complete() for reads is incorrect.
This unconditional bump causes a livelock when auto_inval_data is
enabled together with writeback_cache: fuse_cache_read_iter() issues a
FUSE_GETATTR before every read, but by the time the response arrives,
an async DIO read completion has already incremented fi->attr_version
past the snapshot taken before the request. The GETATTR result is then
discarded (attr_version race), fi->i_time is never refreshed, and every
subsequent read triggers yet another GETATTR -- creating an infinite
loop of useless round-trips.
Fix this by only bumping attr_version for write completions, consistent
with the synchronous DIO write path (fuse_write_update_attr) and the
cached write path.
Fixes: 01e9d11a3e79 ("fuse: add support of async IO")
Reviewed-by: Horst Birthelmer <hbirthelmer@ddn.com>
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
[ sashal: Changed the condition to if (res >= 0 && io->write) with adjusted context, since this tree declares inode inside the block and has no mapping local. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fuse/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 50b25b5304f07..aa2da240e5ac7 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -724,7 +724,7 @@ static void fuse_aio_complete(struct fuse_io_priv *io, int err, ssize_t pos)
if (!left && !io->blocking) {
ssize_t res = fuse_get_res_by_io(io);
- if (res >= 0) {
+ if (res >= 0 && io->write) {
struct inode *inode = file_inode(io->iocb->ki_filp);
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_inode *fi = get_fuse_inode(inode);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0304/1167] RDMA/hns: Fix missing CQE when UD QP use different SL
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (302 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0303/1167] fuse: dont bump attr_version for async direct read completion Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0305/1167] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Greg Kroah-Hartman
` (353 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengchang Tang, Junxian Huang,
Leon Romanovsky, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengchang Tang <tangchengchang@huawei.com>
[ Upstream commit 3547f46c31993d41748f0f7936f9d4dc5b5d4b12 ]
Due to the hardware contraint, CQEs may be dropped when a UD QP
sends with multiple SLs. Pin the SL to the value from the first
post_send on the QP to avoid this issue.
Fixes: 66d86e529dd5 ("RDMA/hns: Add UD support for HIP09")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20260831020324.3540901-2-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Re-anchored the hunks to the older tree's context (different struct tail and the SL range check in fill_ud_av()); the added code is identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/hns/hns_roce_device.h | 1 +
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 15 ++++++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h
index 03b6546f63cdc..ce2c48f70ab09 100644
--- a/drivers/infiniband/hw/hns/hns_roce_device.h
+++ b/drivers/infiniband/hw/hns/hns_roce_device.h
@@ -638,6 +638,7 @@ struct hns_roce_qp {
struct hns_user_mmap_entry *dwqe_mmap_entry;
u32 config;
enum hns_roce_cong_type cong_type;
+ bool ud_sl_set;
};
struct hns_roce_ib_iboe {
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 2b8afc6fbe87a..e9a92a535f2b3 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -424,7 +424,8 @@ static int set_ud_opcode(struct hns_roce_v2_ud_send_wqe *ud_sq_wqe,
return 0;
}
-static int fill_ud_av(struct hns_roce_v2_ud_send_wqe *ud_sq_wqe,
+static int fill_ud_av(struct hns_roce_qp *qp,
+ struct hns_roce_v2_ud_send_wqe *ud_sq_wqe,
struct hns_roce_ah *ah)
{
struct ib_device *ib_dev = ah->ibah.device;
@@ -438,7 +439,12 @@ static int fill_ud_av(struct hns_roce_v2_ud_send_wqe *ud_sq_wqe,
if (WARN_ON(ah->av.sl > MAX_SERVICE_LEVEL))
return -EINVAL;
- hr_reg_write(ud_sq_wqe, UD_SEND_WQE_SL, ah->av.sl);
+ if (!qp->ud_sl_set) {
+ qp->sl = ah->av.sl;
+ qp->ud_sl_set = true;
+ }
+
+ hr_reg_write(ud_sq_wqe, UD_SEND_WQE_SL, qp->sl);
ud_sq_wqe->sgid_index = ah->av.gid_index;
@@ -488,12 +494,10 @@ static inline int set_ud_wqe(struct hns_roce_qp *qp,
qp->qkey : ud_wr(wr)->remote_qkey);
hr_reg_write(ud_sq_wqe, UD_SEND_WQE_DQPN, ud_wr(wr)->remote_qpn);
- ret = fill_ud_av(ud_sq_wqe, ah);
+ ret = fill_ud_av(qp, ud_sq_wqe, ah);
if (ret)
return ret;
- qp->sl = to_hr_ah(ud_wr(wr)->ah)->av.sl;
-
set_extend_sge(qp, wr->sg_list, &curr_idx, valid_num_sge);
/*
@@ -5234,6 +5238,7 @@ static void v2_set_flushed_fields(struct ib_qp *ibqp,
hr_reg_write(context, QPC_SQ_PRODUCER_IDX, hr_qp->sq.head);
hr_reg_clear(qpc_mask, QPC_SQ_PRODUCER_IDX);
hr_qp->state = IB_QPS_ERR;
+ hr_qp->ud_sl_set = false;
spin_unlock_irqrestore(&hr_qp->sq.lock, sq_flag);
if (ibqp->srq || ibqp->qp_type == IB_QPT_XRC_INI) /* no RQ */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0305/1167] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (303 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0304/1167] RDMA/hns: Fix missing CQE when UD QP use different SL Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0306/1167] wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup Greg Kroah-Hartman
` (352 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miaoqing Pan, Baochen Qiang,
Rameshkumar Sundaram, Jeff Johnson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
[ Upstream commit 1a7bcf5324c8e2de6512eca5b028b6b283181d3f ]
On WCN6750, if QMI messages never arrive (for example when qrtr_smd
is not ready), WLAN initialization stops before the device is fully
registered. In this case ATH11K_FLAG_QMI_FAIL is not set because no
QMI event handler is executed.
When the driver is removed, ath11k_ahb_remove() still calls
ath11k_core_deinit(), which eventually triggers
ath11k_ce_cleanup_pipes() on uninitialized CE pipes and results in a
NULL pointer dereference in ath11k_hal_srng_access_begin():
ath11k_hal_srng_access_begin+0x14/0x68 [ath11k]
ath11k_ce_cleanup_pipes+0x184/0x190 [ath11k]
ath11k_pcic_stop+0x24/0x38 [ath11k]
ath11k_core_deinit+0xfc/0x1c0 [ath11k]
ath11k_ahb_remove+0x38/0xa0 [ath11k_ahb]
Fix this by invoking ath11k_ahb_remove_prepare() before the state
check and skipping ath11k_core_deinit() if ATH11K_FLAG_REGISTERED
is not set, core initialization did not complete and CE pipes may
remain uninitialized, making ath11k_core_deinit() unsafe.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00204-QCAMSLSWPLZ-1
Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260806101331.484063-3-miaoqing.pan@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
[ sashal: Adjusted context for the older tree: ath11k_ahb_remove() returns int and ath11k_ahb_power_down() takes one argument, with no logic changes. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath11k/ahb.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index ef11c138bf307..892805b520f40 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1261,14 +1261,15 @@ static int ath11k_ahb_remove(struct platform_device *pdev)
{
struct ath11k_base *ab = platform_get_drvdata(pdev);
- if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) {
+ ath11k_ahb_remove_prepare(ab);
+
+ if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) {
ath11k_ahb_power_down(ab);
ath11k_debugfs_soc_destroy(ab);
ath11k_qmi_deinit_service(ab);
goto qmi_fail;
}
- ath11k_ahb_remove_prepare(ab);
ath11k_core_deinit(ab);
qmi_fail:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0306/1167] wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (304 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0305/1167] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0307/1167] ACPI: APEI: GHES: Validate memory error section length before payload access Greg Kroah-Hartman
` (351 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit e035900ffe9e8978f7c0d7b61811b6b578751697 ]
In ieee80211_build_hdr(), IEEE80211_TX_CTL_REQ_TX_STATUS is checked
in ctrl_flags, which is wrong - IEEE80211_TX_CTL_REQ_TX_STATUS is in
info->flags, so the check is for IEEE80211_TX_CTRL_PORT_CTRL_PROTO
instead. This works out OK because the only place setting _that_ at
a point before this gets called is in fact ieee80211_tx_control_port()
which was intended here. This is actually needed for correctness, if
jt were checking info->flags instead, TDLS would fill/leak the status
frames created here.
However, we can just fix it by using the cookie instead, that'll be
set for PREAUTH frames via ieee80211_tx_control_port() as well, and
no other frames.
Additionally, the code also erroneously set it, but that just caused
preauth frames to get it set, since storing the ACK SKB will also set
the correct flag. Drop this assignment entirely.
Fixes: a7528198add8 ("mac80211: support control port TX status reporting")
Link: https://patch.msgid.link/20260803141309.292711-10-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ sashal: Replaced the sk_requests_wifi_status(skb->sk) helper with the open-coded skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS check, since the helper doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f88613c811ac2..9e9b5ad93be18 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2954,7 +2954,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
if (unlikely(!multicast && ((skb->sk &&
skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS) ||
- ctrl_flags & IEEE80211_TX_CTL_REQ_TX_STATUS)))
+ cookie)))
info_id = ieee80211_store_ack_skb(local, skb, &info_flags,
cookie);
@@ -6310,9 +6310,6 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
if (unencrypted)
flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
- if (cookie)
- ctrl_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
-
flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX;
skb = dev_alloc_skb(local->hw.extra_tx_headroom +
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0307/1167] ACPI: APEI: GHES: Validate memory error section length before payload access
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (305 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0306/1167] wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0308/1167] ASoC: sta32x: make power restoration transactional Greg Kroah-Hartman
` (350 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Hanjun Guo, Shuai Xue,
Dave Jiang, Rafael J. Wysocki, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 10338c9085b4939a428a8dc78d2bbf62c161278b ]
ghes_do_proc() hands the CPER_SEC_PLATFORM_MEM payload to the report chain,
arch_apei_report_mem_error() and ghes_handle_memory_failure() without
checking gdata->error_data_length. All three read validation_bits and
physical_addr, at offsets 0 and 16, so a shorter section reads past the
record.
Check the length once in ghes_do_proc(), before any consumer runs. Take the
73-byte struct cper_sec_mem_err_old as the floor: older firmware
legitimately emits that UEFI 2.1/2.2 layout, and it makes validation_bits
safe to read.
The fields from "extended" on are absent from that layout, so also require
whatever length the validation bits claim. Derive it per field rather than
demanding the full 80 bytes: rank needs only 76, and the BANK_GROUP and
BANK_ADDRESS bits describe "bank" at offset 38, which every record carries.
Testing the whole mask against one size, as cper_print_mem() does, gets it
wrong both ways.
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260714231835.303081-1-dave.jiang@intel.com?part=7
Fixes: ca104edc1784 ("ACPI, APEI, GHES: Cleanup ghes memory error handling")
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260904172337.1409775-12-dave.jiang@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: adjusted hunk context for the older file layout (helper placed after ghes_defer_non_standard_event(), ghes_do_proc() returns bool), with the added code otherwise identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/apei/ghes.c | 41 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index fd491c5476dfe..5f5b9ec6512d6 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -679,6 +679,28 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata,
schedule_work(&entry->work);
}
+/*
+ * The fields from "extended" on are absent from the 73-byte UEFI 2.1/2.2
+ * layout that older firmware still emits. Return the length needed for the
+ * fields the validation bits claim, so over-claiming is rejected without
+ * rejecting an honest short record.
+ */
+static u32 ghes_mem_err_min_len(u64 validation_bits)
+{
+ u32 len = sizeof(struct cper_sec_mem_err_old);
+
+ if (validation_bits & (CPER_MEM_VALID_ROW_EXT | CPER_MEM_VALID_CHIP_ID))
+ len = offsetof(struct cper_sec_mem_err, rank);
+ if (validation_bits & CPER_MEM_VALID_RANK_NUMBER)
+ len = offsetof(struct cper_sec_mem_err, mem_array_handle);
+ if (validation_bits & CPER_MEM_VALID_CARD_HANDLE)
+ len = offsetof(struct cper_sec_mem_err, mem_dev_handle);
+ if (validation_bits & CPER_MEM_VALID_MODULE_HANDLE)
+ len = sizeof(struct cper_sec_mem_err);
+
+ return len;
+}
+
static bool ghes_do_proc(struct ghes *ghes,
const struct acpi_hest_generic_status *estatus)
{
@@ -703,6 +725,25 @@ static bool ghes_do_proc(struct ghes *ghes,
if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
struct cper_sec_mem_err *mem_err = acpi_hest_get_payload(gdata);
+ /*
+ * Check once for all three consumers below. The 73-byte
+ * UEFI 2.1/2.2 layout is the floor, matching
+ * cper_estatus_print_section() and making
+ * validation_bits safe to read.
+ */
+ if (gdata->error_data_length <
+ sizeof(struct cper_sec_mem_err_old))
+ continue;
+
+ /* Then require what the claimed fields actually need. */
+ if (gdata->error_data_length <
+ ghes_mem_err_min_len(mem_err->validation_bits)) {
+ pr_warn_ratelimited(FW_WARN GHES_PFX
+ "memory error section too small (%u) for the fields it claims\n",
+ gdata->error_data_length);
+ continue;
+ }
+
atomic_notifier_call_chain(&ghes_report_chain, sev, mem_err);
arch_apei_report_mem_error(sev, mem_err);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0308/1167] ASoC: sta32x: make power restoration transactional
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (306 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0307/1167] ACPI: APEI: GHES: Validate memory error section length before payload access Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0309/1167] dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure Greg Kroah-Hartman
` (349 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 3e71dc4508bc84862dc3644e3b6a5b966bff22ad ]
sta32x_set_bias_level() enables the codec supplies, restores the
coefficient and register state, and then starts the watchdog. Register
access errors in the mute and coefficient helpers and the cache replay
are discarded, allowing DAPM to publish STANDBY for a partially restored
codec.
Propagate every operation in the local restore transaction, including
the final standby-state write. Start the watchdog only after that write
succeeds. On failure, hold reset, mark the cache dirty, disable the
supplies and report a cleanup failure while preserving the primary
error. The DAPM bias callback consumes the returned error independently
of component resume handling.
Fixes: 54dc6cabe684 ("ASoC: sta32x: preserve coefficient RAM")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260830141521.33246-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Dropped the struct snd_soc_dapm_context *dapm declaration removal from sta32x_set_bias_level(), since this tree has no such variable; context offsets also shifted. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/sta32x.c | 101 +++++++++++++++++++++++++++++---------
1 file changed, 77 insertions(+), 24 deletions(-)
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index f896edb3c5c3c..57cdee25fd8f4 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -346,27 +346,48 @@ static int sta32x_sync_coef_shadow(struct snd_soc_component *component)
{
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
unsigned int cfud;
- int i;
+ int i, ret;
/* preserve reserved bits in STA32X_CFUD */
- regmap_read(sta32x->regmap, STA32X_CFUD, &cfud);
+ ret = regmap_read(sta32x->regmap, STA32X_CFUD, &cfud);
+ if (ret)
+ return ret;
+
cfud &= 0xf0;
for (i = 0; i < STA32X_COEF_COUNT; i++) {
- regmap_write(sta32x->regmap, STA32X_CFADDR2, i);
- regmap_write(sta32x->regmap, STA32X_B1CF1,
- (sta32x->coef_shadow[i] >> 16) & 0xff);
- regmap_write(sta32x->regmap, STA32X_B1CF2,
- (sta32x->coef_shadow[i] >> 8) & 0xff);
- regmap_write(sta32x->regmap, STA32X_B1CF3,
- (sta32x->coef_shadow[i]) & 0xff);
+ ret = regmap_write(sta32x->regmap, STA32X_CFADDR2, i);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_B1CF1,
+ (sta32x->coef_shadow[i] >> 16) & 0xff);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_B1CF2,
+ (sta32x->coef_shadow[i] >> 8) & 0xff);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_B1CF3,
+ sta32x->coef_shadow[i] & 0xff);
+ if (ret)
+ return ret;
+
/*
* chip documentation does not say if the bits are
* self-clearing, so do it explicitly
*/
- regmap_write(sta32x->regmap, STA32X_CFUD, cfud);
- regmap_write(sta32x->regmap, STA32X_CFUD, cfud | 0x01);
+ ret = regmap_write(sta32x->regmap, STA32X_CFUD, cfud);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_CFUD, cfud | 0x01);
+ if (ret)
+ return ret;
}
+
return 0;
}
@@ -374,15 +395,24 @@ static int sta32x_cache_sync(struct snd_soc_component *component)
{
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
unsigned int mute;
- int rc;
+ int restore_ret, ret;
/* mute during register sync */
- regmap_read(sta32x->regmap, STA32X_MMUTE, &mute);
- regmap_write(sta32x->regmap, STA32X_MMUTE, mute | STA32X_MMUTE_MMUTE);
- sta32x_sync_coef_shadow(component);
- rc = regcache_sync(sta32x->regmap);
- regmap_write(sta32x->regmap, STA32X_MMUTE, mute);
- return rc;
+ ret = regmap_read(sta32x->regmap, STA32X_MMUTE, &mute);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_MMUTE,
+ mute | STA32X_MMUTE_MMUTE);
+ if (ret)
+ return ret;
+
+ ret = sta32x_sync_coef_shadow(component);
+ if (!ret)
+ ret = regcache_sync(sta32x->regmap);
+
+ restore_ret = regmap_write(sta32x->regmap, STA32X_MMUTE, mute);
+ return ret ?: restore_ret;
}
/* work around ESD issue where sta32x resets and loses all configuration */
@@ -798,8 +828,8 @@ static int sta32x_startup_sequence(struct sta32x_priv *sta32x)
static int sta32x_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{
- int ret;
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
+ int cleanup_ret, ret;
dev_dbg(component->dev, "level = %d\n", level);
switch (level) {
@@ -823,15 +853,28 @@ static int sta32x_set_bias_level(struct snd_soc_component *component,
return ret;
}
- sta32x_startup_sequence(sta32x);
- sta32x_cache_sync(component);
+ ret = sta32x_startup_sequence(sta32x);
+ if (!ret)
+ ret = sta32x_cache_sync(component);
+ if (ret)
+ goto restore_failed;
+
+ ret = regmap_update_bits(sta32x->regmap, STA32X_CONFF,
+ STA32X_CONFF_PWDN | STA32X_CONFF_EAPD,
+ 0);
+ if (ret)
+ goto restore_failed;
+
sta32x_watchdog_start(sta32x);
+ break;
}
/* Power down */
- regmap_update_bits(sta32x->regmap, STA32X_CONFF,
- STA32X_CONFF_PWDN | STA32X_CONFF_EAPD,
- 0);
+ ret = regmap_update_bits(sta32x->regmap, STA32X_CONFF,
+ STA32X_CONFF_PWDN | STA32X_CONFF_EAPD,
+ 0);
+ if (ret)
+ return ret;
break;
@@ -849,6 +892,16 @@ static int sta32x_set_bias_level(struct snd_soc_component *component,
break;
}
return 0;
+
+restore_failed:
+ gpiod_set_value(sta32x->gpiod_nreset, 0);
+ regcache_mark_dirty(sta32x->regmap);
+ cleanup_ret = regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies),
+ sta32x->supplies);
+ if (cleanup_ret)
+ dev_warn(component->dev, "Failed to disable supplies: %d\n",
+ cleanup_ret);
+ return ret;
}
static const struct snd_soc_dai_ops sta32x_dai_ops = {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0309/1167] dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (307 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0308/1167] ASoC: sta32x: make power restoration transactional Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0310/1167] dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v " Greg Kroah-Hartman
` (348 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Golla Nagendra, Frank Li, Vinod Koul,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Golla Nagendra <nagendra.golla@amd.com>
[ Upstream commit f2f44b952ea6e0c600e92ea21fcaa83cafeedf6e ]
If sw_desc_pool allocation fails after pm_runtime_resume_and_get()
succeeds in zynqmp_dma_alloc_chan_resources(), the error path returns
without dropping the runtime PM reference.
Route that failure path through err_pm so the runtime PM reference is
balanced before returning the error.
Fixes: 8982d48af36d ("dmaengine: zynqmp_dma: Fix PM reference leak in zynqmp_dma_alloc_chan_resourc()")
Signed-off-by: Golla Nagendra <nagendra.golla@amd.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260814045616.1661199-2-nagendra.golla@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
[ sashal: kept the branch's existing kcalloc() allocation instead of the newer kzalloc_objs() helper in the context, then applied the err_pm rollback on top. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/xilinx/zynqmp_dma.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 400b086f7295a..fb2abc02803ea 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -484,8 +484,10 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
chan->sw_desc_pool = kcalloc(ZYNQMP_DMA_NUM_DESCS, sizeof(*desc),
GFP_KERNEL);
- if (!chan->sw_desc_pool)
- return -ENOMEM;
+ if (!chan->sw_desc_pool) {
+ ret = -ENOMEM;
+ goto err_pm;
+ }
chan->idle = true;
chan->desc_free_cnt = ZYNQMP_DMA_NUM_DESCS;
@@ -517,6 +519,10 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
}
return ZYNQMP_DMA_NUM_DESCS;
+
+err_pm:
+ pm_runtime_put_autosuspend(chan->dev);
+ return ret;
}
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0310/1167] dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v alloc failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (308 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0309/1167] dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0311/1167] wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor Greg Kroah-Hartman
` (347 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Golla Nagendra, Frank Li, Vinod Koul,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Golla Nagendra <nagendra.golla@amd.com>
[ Upstream commit 4ea99b14b3bd955d768666941e2e03ba186b52f5 ]
In zynqmp_dma_alloc_chan_resources(), sw_desc_pool is allocated before
desc_pool_v. If dma_alloc_coherent() for desc_pool_v fails, the function
currently exits through the runtime PM rollback path but leaves the
already allocated sw_desc_pool behind.
Add a dedicated err_free_sw_desc_pool label for the desc_pool_v failure
path, free sw_desc_pool there, then fall through to err_pm for
pm_runtime_put_autosuspend().
This keeps the error unwind symmetric and avoids leaking the software
descriptor pool on coherent descriptor allocation failure.
Fixes: b0cc417c1637 ("dmaengine: Add Xilinx zynqmp dma engine driver support")
Signed-off-by: Golla Nagendra <nagendra.golla@amd.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260814045616.1661199-3-nagendra.golla@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/xilinx/zynqmp_dma.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index fb2abc02803ea..371b498d66ad9 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -505,8 +505,10 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
(2 * ZYNQMP_DMA_DESC_SIZE(chan) *
ZYNQMP_DMA_NUM_DESCS),
&chan->desc_pool_p, GFP_KERNEL);
- if (!chan->desc_pool_v)
- return -ENOMEM;
+ if (!chan->desc_pool_v) {
+ ret = -ENOMEM;
+ goto err_free_sw_desc_pool;
+ }
for (i = 0; i < ZYNQMP_DMA_NUM_DESCS; i++) {
desc = chan->sw_desc_pool + i;
@@ -520,6 +522,9 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
return ZYNQMP_DMA_NUM_DESCS;
+err_free_sw_desc_pool:
+ kfree(chan->sw_desc_pool);
+ chan->sw_desc_pool = NULL;
err_pm:
pm_runtime_put_autosuspend(chan->dev);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0311/1167] wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (309 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0310/1167] dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v " Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0312/1167] arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON Greg Kroah-Hartman
` (346 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Baochen Qiang, Rameshkumar Sundaram,
Jeff Johnson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
[ Upstream commit 979ecb88ed3528e08dd7f87b90b029374226ca84 ]
ath12k_wifi7_hal_tx_cmd_ext_desc_setup() programs the low 32 bits of the
TX buffer physical address into HAL_TX_MSDU_EXT_INFO0_BUF_PTR_LO but
hardcodes the high bits field HAL_TX_MSDU_EXT_INFO1_BUF_PTR_HI to 0x0.
dma_addr_t is 64-bit on platforms with CONFIG_ARCH_DMA_ADDR_T_64BIT, so
whenever a TX buffer is mapped above the 4 GB boundary the upper bits of
paddr are dropped and the firmware is handed a truncated address,
leading to potential TX failures.
Write the upper bits of paddr into BUF_PTR_HI to fix this issue.
Issue found during code review, compile tested only.
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260818-ath12k-truncated-tx-dma-addr-v1-1-ead978969371@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
[ sashal: Applied the one-line upstream change to dp_tx.c at the pre-rename location, with the function named ath12k_hal_tx_cmd_ext_desc_setup(), since the wifi7 subdirectory and its function prefix don't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath12k/dp_tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index cd5cc64ed541a..ccf78073decd7 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -111,7 +111,7 @@ static void ath12k_hal_tx_cmd_ext_desc_setup(struct ath12k_base *ab,
{
tcl_ext_cmd->info0 = le32_encode_bits(ti->paddr,
HAL_TX_MSDU_EXT_INFO0_BUF_PTR_LO);
- tcl_ext_cmd->info1 = le32_encode_bits(0x0,
+ tcl_ext_cmd->info1 = le32_encode_bits((u64)ti->paddr >> HAL_ADDR_MSB_REG_SHIFT,
HAL_TX_MSDU_EXT_INFO1_BUF_PTR_HI) |
le32_encode_bits(ti->data_len,
HAL_TX_MSDU_EXT_INFO1_BUF_LEN);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0312/1167] arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (310 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0311/1167] wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0313/1167] sit: charge ip_tunnel_prl_entry allocations to memcg Greg Kroah-Hartman
` (345 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Luca Weiss, Abel Vesa, Konrad Dybcio,
Bjorn Andersson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Weiss <luca.weiss@fairphone.com>
[ Upstream commit 5c088a33e3a9bb236c475b7230df275fc1e51eda ]
Two PMICs on this phone have a PON block, the PM6350 and PMK8350. Only
one should be enabled at one time, so disable PMK8350 PON and keep the
PM6350 PON.
Fixes: 582e7c1026fa ("arm64: dts: qcom: sm7225-fairphone-fp4: Add pmk8350 PMIC")
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260901-fp4-pmk8350-pon-v1-1-e05937e9c860@fairphone.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
[ sashal: Added the &pmk8350_pon disable override by hand before &pmk8350_rtc, since the board file here lacks the upstream USB, PM8008 and thermal context lines. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index 2c6f37864a5de..fccbb05efb1f7 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -511,6 +511,10 @@ conn-therm@1 {
};
};
+&pmk8350_pon {
+ status = "disabled";
+};
+
&pmk8350_rtc {
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0313/1167] sit: charge ip_tunnel_prl_entry allocations to memcg
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (311 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0312/1167] arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0314/1167] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data Greg Kroah-Hartman
` (344 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Lorenzo Bianconi,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 40a2b90f5190fcc7b083809fa93f2799abefeeb1 ]
ipip6_tunnel_add_prl() allocates struct ip_tunnel_prl_entry for each
potential router entry added via SIOCADDPRL.
An unprivileged user with CAP_NET_ADMIN in a user namespace can add
an unbounded number of entries, consuming uncharged kernel memory.
Commit 1b51d8271973 ("memcg: ipv6/sit: account and don't WARN on
ip_tunnel_prl structs allocation") added accounting to the temporary
buffer in ipip6_tunnel_get_prl(), but missed the entry allocations
in ipip6_tunnel_add_prl().
Use GFP_KERNEL_ACCOUNT when allocating struct ip_tunnel_prl_entry.
Fixes: 1b51d8271973 ("memcg: ipv6/sit: account and don't WARN on ip_tunnel_prl structs allocation")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260907075846.2913645-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Kept the older kzalloc(sizeof(...), flags) form instead of upstream's kzalloc_obj() helper, changing only GFP_KERNEL to GFP_KERNEL_ACCOUNT. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/sit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 2c0d62ec8ec4f..f83b6488ded4c 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -391,7 +391,7 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg)
goto out;
}
- p = kzalloc(sizeof(struct ip_tunnel_prl_entry), GFP_KERNEL);
+ p = kzalloc(sizeof(struct ip_tunnel_prl_entry), GFP_KERNEL_ACCOUNT);
if (!p) {
err = -ENOBUFS;
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0314/1167] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (312 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0313/1167] sit: charge ip_tunnel_prl_entry allocations to memcg Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0315/1167] crypto: mxs-dcp - handle zero-length skcipher requests Greg Kroah-Hartman
` (343 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Antoine Tenart, Thomas Huth,
Herbert Xu, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Huth <thuth@redhat.com>
[ Upstream commit 5c87bcb2f98dbfe08efa016af037b0f9701ba381 ]
key_tmp[] in safexcel_xcbcmac_setkey() and consts[] / _const[] in
safexcel_cmac_setkey() contain crypto key material that should not
get exposed to the outside once the function is done. Scrub the
arrays with memzero_explicit() to avoid that the data could leak
via the stack.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260813134953.979481-1-thuth%40redhat.com
Fixes: 38f21b4bab11f ("crypto: inside-secure - Added support for the AES XCBC ahash")
Fixes: 7a627db9cafdb ("crypto: inside-secure - Added support for the AES-CMAC ahash")
Acked-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ sashal: Context adapted because this tree uses aes_expandkey() where upstream context has aes_prepareenckey(); the three memzero_explicit() additions are identical. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/inside-secure/safexcel_hash.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index af4b978189e51..af2b97fcb27f4 100644
--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -2081,6 +2081,7 @@ static int safexcel_xcbcmac_setkey(struct crypto_ahash *tfm, const u8 *key,
ret = aes_expandkey(ctx->aes,
(u8 *)key_tmp + 2 * AES_BLOCK_SIZE,
AES_MIN_KEY_SIZE);
+ memzero_explicit(key_tmp, sizeof(key_tmp));
if (ret)
return ret;
@@ -2192,6 +2193,8 @@ static int safexcel_cmac_setkey(struct crypto_ahash *tfm, const u8 *key,
}
ctx->cbcmac = false;
+ memzero_explicit(consts, sizeof(consts));
+ memzero_explicit(_const, sizeof(_const));
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0315/1167] crypto: mxs-dcp - handle zero-length skcipher requests
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (313 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0314/1167] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0316/1167] ACPI: glue: Reduce debug noise from acpi_device_notify() Greg Kroah-Hartman
` (342 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linmao Li, Herbert Xu, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linmao Li <lilinmao@kylinos.cn>
[ Upstream commit ac1d6a65a1e1f069f119df42c6b57dbdff5f6be8 ]
Zero-length skcipher requests are valid no-ops, but MXS-DCP queues them.
When such a request reaches the worker, last_out_len remains zero. The
CBC completion path then subtracts AES_BLOCK_SIZE from this unsigned
value when updating the IV, causing the offset to underflow. On
decryption, the resulting source address precedes aes_in_buf.
Return success before enqueueing zero-length requests. This avoids the
invalid source access and leaves the IV unchanged for a no-op.
Fixes: fadd7a6e616b ("crypto: mxs-dcp - Fix AES issues")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ sashal: Context-only adjustment: the early !req->cryptlen return was added above the key-size check, which here lacks the key_referenced condition, and the added lines match upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/mxs-dcp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
index 5994a10cec003..43e6f11273056 100644
--- a/drivers/crypto/mxs-dcp.c
+++ b/drivers/crypto/mxs-dcp.c
@@ -453,6 +453,9 @@ static int mxs_dcp_aes_enqueue(struct skcipher_request *req, int enc, int ecb)
struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
int ret;
+ if (!req->cryptlen)
+ return 0;
+
if (unlikely(actx->key_len != AES_KEYSIZE_128))
return mxs_dcp_block_fallback(req, enc);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0316/1167] ACPI: glue: Reduce debug noise from acpi_device_notify()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (314 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0315/1167] crypto: mxs-dcp - handle zero-length skcipher requests Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0317/1167] ACPI: glue: Rework the success message in acpi_device_notify() Greg Kroah-Hartman
` (341 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Andy Shevchenko,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 5bc1e72f80da4c20ce8b57851be4fad67e855ebd ]
When debug is enabled in the ACPI glue code that handles binding
devices to ACPI companions, acpi_device_notify() produces a lot of
message noise related to devices that have no ACPI companions.
Reduce that noise by checking the most obvious case, ACPI device
objects, directly and returning from acpi_device_notify() in that
case without printing any debug messages. Also avoid printing a
debug message when there is no matching ACPI bus type definition for
the given device, which is the case for the vast majority of devices.
Additionally, make the debug messages that get printed more informative.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/6325978.lOV4Wx5bFT@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: c94619c8a5b5 ("ACPI: glue: Carry out companion lookup under bus_type_sem")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index cc9ee8cb820fc..54cc709be3166 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -356,22 +356,27 @@ void acpi_device_notify(struct device *dev)
struct acpi_device *adev;
int ret;
+ /* ACPI devices have no ACPI companions. */
+ if (dev->bus == &acpi_bus_type)
+ return;
+
ret = acpi_bind_one(dev, NULL);
if (ret) {
struct acpi_bus_type *type = acpi_get_bus_type(dev);
if (!type)
- goto err;
+ return;
adev = type->find_companion(dev);
if (!adev) {
dev_dbg(dev, "ACPI companion not found\n");
- goto err;
+ return;
}
ret = acpi_bind_one(dev, adev);
- if (ret)
- goto err;
-
+ if (ret) {
+ dev_dbg(dev, "Binding to ACPI companion failed\n");
+ return;
+ }
if (type->setup) {
type->setup(dev);
goto done;
@@ -393,11 +398,6 @@ void acpi_device_notify(struct device *dev)
done:
acpi_handle_debug(ACPI_HANDLE(dev), "Bound to device %s\n",
dev_name(dev));
-
- return;
-
-err:
- dev_dbg(dev, "No ACPI support\n");
}
void acpi_device_notify_remove(struct device *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0317/1167] ACPI: glue: Rework the success message in acpi_device_notify()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (315 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0316/1167] ACPI: glue: Reduce debug noise from acpi_device_notify() Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0318/1167] ACPI: glue: Carry out companion lookup under bus_type_sem Greg Kroah-Hartman
` (340 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Andy Shevchenko,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit aef7792cddcac7ab400912c2947a595401d4a7e8 ]
Using an ACPI handle in the acpi_device_notify() success message is
somewhat misleading because the "physical" device is not bound to an
ACPI namespace object in that function, but to an ACPI device object
attached to it. Moreover, the message is outright confusing for the
"physical" devices bound to ACPI devices without ACPI namespace
objects (for example, fixed event buttons).
Address this by turning that message into a dev_dbg() one printed for
the "physical" device and mentioning the name of the ACPI companion.
Fixes: ab06eb920401 ("ACPI: scan: Register platform devices for fixed event buttons")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/2448150.ElGaqSPkdT@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: c94619c8a5b5 ("ACPI: glue: Carry out companion lookup under bus_type_sem")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 54cc709be3166..c01ebf20a9318 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -396,8 +396,7 @@ void acpi_device_notify(struct device *dev)
adev->handler->bind(dev);
done:
- acpi_handle_debug(ACPI_HANDLE(dev), "Bound to device %s\n",
- dev_name(dev));
+ dev_dbg(dev, "Bound to ACPI device %s\n", acpi_dev_name(adev));
}
void acpi_device_notify_remove(struct device *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0318/1167] ACPI: glue: Carry out companion lookup under bus_type_sem
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (316 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0317/1167] ACPI: glue: Rework the success message in acpi_device_notify() Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0319/1167] ACPI: glue: Rearrange acpi_bind_one() to avoid breakage Greg Kroah-Hartman
` (339 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit c94619c8a5b5d3b980433d247ac87a2d1c827cb6 ]
When acpi_device_notify() looks up an ACPI companion for the given
device, it invokes callbacks from struct acpi_bus_type() without
synchronization which may lead to a use-after-free if the driver
module containing those callbacks is unloaded at the same time.
Address this by holding bus_type_sem throughout the entire ACPI
companion lookup and the execution of the .setup() callback in
struct acpi_bus_type (if present) instead of dropping the semaphore
(prematurely) after finding a matching struct acpi_bus_type.
For this purpose, rename acpi_get_bus_type() to acpi_companion_lookup(),
make it return a struct acpi_device pointer, and move the relevant code
from acpi_device_notify() to it.
Also notice that the only case in which the .bind() callback from an
ACPI scan handler may need to be invoked is when the given device is
a platform one, so adjust acpi_device_notify() accordingly and drop
the "done" label that is not used any more from it.
Fixes: 2ef5236660b6 ("ACPI: glue: Look for ACPI bus type only if ACPI companion is not known")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3089807.e9J7NaK4W3@rafael.j.wysocki
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 61 +++++++++++++++++++++------------------------
1 file changed, 29 insertions(+), 32 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index c01ebf20a9318..e2a40847d24b6 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -59,19 +59,34 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type)
}
EXPORT_SYMBOL_GPL(unregister_acpi_bus_type);
-static struct acpi_bus_type *acpi_get_bus_type(struct device *dev)
+static struct acpi_device *acpi_companion_lookup(struct device *dev)
{
- struct acpi_bus_type *tmp, *ret = NULL;
+ struct acpi_bus_type *type;
- down_read(&bus_type_sem);
- list_for_each_entry(tmp, &bus_type_list, list) {
- if (tmp->match(dev)) {
- ret = tmp;
- break;
+ guard(rwsem_read)(&bus_type_sem);
+
+ list_for_each_entry(type, &bus_type_list, list) {
+ struct acpi_device *adev;
+
+ if (!type->match(dev))
+ continue;
+
+ adev = type->find_companion(dev);
+ if (!adev) {
+ dev_dbg(dev, "ACPI companion not found\n");
+ return NULL;
}
+ if (acpi_bind_one(dev, adev)) {
+ dev_dbg(dev, "Binding to ACPI companion failed\n");
+ return NULL;
+ }
+ if (type->setup)
+ type->setup(dev);
+
+ return adev;
}
- up_read(&bus_type_sem);
- return ret;
+
+ return NULL;
}
#define FIND_CHILD_MIN_SCORE 1
@@ -362,40 +377,22 @@ void acpi_device_notify(struct device *dev)
ret = acpi_bind_one(dev, NULL);
if (ret) {
- struct acpi_bus_type *type = acpi_get_bus_type(dev);
-
- if (!type)
+ adev = acpi_companion_lookup(dev);
+ if (!adev)
return;
-
- adev = type->find_companion(dev);
- if (!adev) {
- dev_dbg(dev, "ACPI companion not found\n");
- return;
- }
- ret = acpi_bind_one(dev, adev);
- if (ret) {
- dev_dbg(dev, "Binding to ACPI companion failed\n");
- return;
- }
- if (type->setup) {
- type->setup(dev);
- goto done;
- }
} else {
adev = ACPI_COMPANION(dev);
if (dev_is_pci(dev)) {
pci_acpi_setup(dev, adev);
- goto done;
} else if (dev_is_platform(dev)) {
acpi_configure_pmsi_domain(dev);
+
+ if (adev->handler && adev->handler->bind)
+ adev->handler->bind(dev);
}
}
- if (adev->handler && adev->handler->bind)
- adev->handler->bind(dev);
-
-done:
dev_dbg(dev, "Bound to ACPI device %s\n", acpi_dev_name(adev));
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0319/1167] ACPI: glue: Rearrange acpi_bind_one() to avoid breakage
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (317 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0318/1167] ACPI: glue: Carry out companion lookup under bus_type_sem Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0320/1167] PM: runtime: Only queue an idle check for RPM-linked suppliers Greg Kroah-Hartman
` (338 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit fcfb2b562115632e0a60a0928dca495f98eb335c ]
Rearange the code in acpi_bind_one() to avoid situations in which the
existing ACPI companion of the given device would be replaced with NULL
due to a memory allocation error or because somebody tries to bind a
physical device with an ACPI companion to a different ACPI device
erroneously.
Fixes: 7b1998116bbb ("ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ rjw: Merged two conditionals to avoid redundant check ]
Link: https://patch.msgid.link/3465482.44csPzL39Z@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: Replaced the kzalloc_obj(*physical_node) allocation with kzalloc(sizeof(*physical_node), GFP_KERNEL), since this tree lacks kzalloc_obj. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 58 +++++++++++++++++++--------------------------
1 file changed, 24 insertions(+), 34 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index e2a40847d24b6..f915a7c0e7cca 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -243,31 +243,25 @@ static void acpi_physnode_link_name(char *buf, unsigned int node_id)
int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
{
struct acpi_device_physical_node *physical_node, *pn;
+ struct acpi_device *comp_dev = ACPI_COMPANION(dev);
char physical_node_name[PHYSICAL_NODE_NAME_SIZE];
struct list_head *physnode_list;
unsigned int node_id;
int retval = -EINVAL;
- if (has_acpi_companion(dev)) {
- if (acpi_dev) {
- dev_warn(dev, "ACPI companion already set\n");
+ if (!acpi_dev) {
+ if (!comp_dev)
return -EINVAL;
- } else {
- acpi_dev = ACPI_COMPANION(dev);
- }
- }
- if (!acpi_dev)
- return -EINVAL;
- acpi_dev_get(acpi_dev);
- get_device(dev);
- physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL);
- if (!physical_node) {
- retval = -ENOMEM;
- goto err;
+ /* If the companion has been set upfront, pick it up. */
+ acpi_dev = comp_dev;
+ } else if (comp_dev && acpi_dev != comp_dev) {
+ dev_warn(dev, "ACPI companion already set to %s which is not %s\n",
+ acpi_dev_name(comp_dev), acpi_dev_name(acpi_dev));
+ return -EEXIST;
}
- mutex_lock(&acpi_dev->physical_node_lock);
+ guard(mutex)(&acpi_dev->physical_node_lock);
/*
* Keep the list sorted by node_id so that the IDs of removed nodes can
@@ -278,15 +272,12 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
list_for_each_entry(pn, &acpi_dev->physical_node_list, node) {
/* Sanity check. */
if (pn->dev == dev) {
- mutex_unlock(&acpi_dev->physical_node_lock);
-
- dev_warn(dev, "Already associated with ACPI node\n");
- kfree(physical_node);
- if (ACPI_COMPANION(dev) != acpi_dev)
- goto err;
-
- put_device(dev);
- acpi_dev_put(acpi_dev);
+ if (!comp_dev) {
+ /* Really unexpected. */
+ ACPI_COMPANION_SET(dev, acpi_dev);
+ dev_warn(&acpi_dev->dev,
+ "Physical device list corruption fixed up\n");
+ }
return 0;
}
if (pn->node_id == node_id) {
@@ -295,12 +286,19 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
}
}
+ physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL);
+ if (!physical_node)
+ return -ENOMEM;
+
+ acpi_dev_get(acpi_dev);
+ get_device(dev);
+
physical_node->node_id = node_id;
physical_node->dev = dev;
list_add(&physical_node->node, physnode_list);
acpi_dev->physical_node_count++;
- if (!has_acpi_companion(dev))
+ if (!comp_dev)
ACPI_COMPANION_SET(dev, acpi_dev);
acpi_physnode_link_name(physical_node_name, node_id);
@@ -316,18 +314,10 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
dev_err(dev, "Failed to create link firmware_node (%d)\n",
retval);
- mutex_unlock(&acpi_dev->physical_node_lock);
-
if (acpi_dev->wakeup.flags.valid)
device_set_wakeup_capable(dev, true);
return 0;
-
- err:
- ACPI_COMPANION_SET(dev, NULL);
- put_device(dev);
- acpi_dev_put(acpi_dev);
- return retval;
}
EXPORT_SYMBOL_GPL(acpi_bind_one);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0320/1167] PM: runtime: Only queue an idle check for RPM-linked suppliers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (318 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0319/1167] ACPI: glue: Rearrange acpi_bind_one() to avoid breakage Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0321/1167] libbpf: fix log level propagation for light skeleton loaders Greg Kroah-Hartman
` (337 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Norris <briannorris@chromium.org>
[ Upstream commit be5755f023e7e02ec90bbd1d4ca63a0abe594733 ]
When a device RPM-suspends, it queues up an idle check for all of its
suppliers, in case that device was the last consumer, and those
suppliers are now able to suspend. Today, we do this for all suppliers,
and not only for those suppliers that are marked for use by runtime PM.
This isn't directly harmful, but it is a bit wasteful, and also may
induce unexpected suspend attempts (e.g., if a device was purposely last
touched with pm_runtime_put_noidle()).
To avoid excess idle checks, only call pm_request_idle() on linked
suppliers that opted into runtime PM.
Noticed by inspection of trace logs.
This is not expected to have a functional impact on systems that are
using device links properly, and should only be considered an
optimization.
Fixes: 5244f5e2d801 ("PM: runtime: Defer suspending suppliers")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20260901013341.1417232-1-briannorris@chromium.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: Replaced the missing device_link_test(link, DL_FLAG_PM_RUNTIME) helper call with an open-coded link->flags & DL_FLAG_PM_RUNTIME test. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/power/runtime.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 6e03928ccf03a..cf128d062f072 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -347,7 +347,8 @@ static void rpm_suspend_suppliers(struct device *dev)
list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
device_links_read_lock_held())
- pm_request_idle(link->supplier);
+ if (link->flags & DL_FLAG_PM_RUNTIME)
+ pm_request_idle(link->supplier);
device_links_read_unlock(idx);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0321/1167] libbpf: fix log level propagation for light skeleton loaders
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (319 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0320/1167] PM: runtime: Only queue an idle check for RPM-linked suppliers Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0322/1167] mtd: spi-nor: spansion: Remove s25fs256s0 Greg Kroah-Hartman
` (336 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Borkmann, Mahe Tardy,
Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahe Tardy <mahe.tardy@gmail.com>
[ Upstream commit e18e82ba9ed53f60acce5f9995ee357a9f7ab91d ]
bpftool's -d option is documented to enable bpf_trace_printk() messages
from the generated syscall loader when used with -L as specified in
commit d510296d331a ("bpftool: Use syscall/loader program in "prog load"
and "gen skeleton" command.")
However commit b59e4ce8bcaa ("bpftool: Switch bpf_object__load_xattr()
to bpf_object__load()") changed bpftool to use bpf_object__load() which
call the internal bpf_object_load with extra_log_level to 0 instead of
bpf_object__load_xattr with the user request log_level.
All the plumbing was still there to generate the bpf_trace_printk()
instructions from the generator but was now unreachable because
bpf_gen__init() was called with extra_log_level to 0, leaving
gen->log_level at 0.
This uses the obj->log_level field introduced in commit e0e3ea888c69
("libbpf: Allow passing user log setting through bpf_object_open_opts")
set from reading verifier_logs in do_skeleton(). This preserves both
object-level and explicit load-time logging settings.
Fixes: b59e4ce8bcaa ("bpftool: Switch bpf_object__load_xattr() to bpf_object__load()")
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
Link: https://lore.kernel.org/r/20260907170536.9996-1-mahe.tardy@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
[ sashal: Context-only conflict: applied the log-level change to this branch's bare if (obj->gen_loader) bpf_gen__init(...) call instead of the upstream if/else-if endianness block. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/lib/bpf/libbpf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 41526f228586d..34045a13bc1dc 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -7952,7 +7952,8 @@ static int bpf_object_load(struct bpf_object *obj, int extra_log_level, const ch
}
if (obj->gen_loader)
- bpf_gen__init(obj->gen_loader, extra_log_level, obj->nr_programs, obj->nr_maps);
+ bpf_gen__init(obj->gen_loader, obj->log_level | extra_log_level,
+ obj->nr_programs, obj->nr_maps);
err = bpf_object__probe_loading(obj);
err = err ? : bpf_object__load_vmlinux_btf(obj, false);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0322/1167] mtd: spi-nor: spansion: Remove s25fs256s0
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (320 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0321/1167] libbpf: fix log level propagation for light skeleton loaders Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0323/1167] cxl/hdm: Make switch decoder target parsing endian-safe Greg Kroah-Hartman
` (335 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Takahiro Kuwano, Michael Walle,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takahiro Kuwano <takahiro.kuwano@infineon.com>
[ Upstream commit f917d9edf54c3dd578efc231b8fbcd35744f99cd ]
The Spansion ID table lists s25fs256s0 and s25fs256s1 as variants
distinguished by id[4] (0x00 for 256 KB sectors and 0x01 for 64 KB
sectors), following an incorrect statement in the datasheet.
The sector size of s25fs256s is configurable between 256 KB and 64 KB.
The factory default is 64 KB, and id[4] is always 0x01 regardless of the
configured sector size. Remove the invalid s25fs256s0 entry from the ID
table.
Fixes: 075fd6dff24a ("mtd: spi-nor: spansion: Differentiate between s25fl256s and s25fs256s")
Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
Signed-off-by: Michael Walle <mwalle@kernel.org>
[ sashal: adjusted by removing the old-format INFO6 s25fs256s0 entry instead of the SNOR_ID entry, because this tree's flash table predates the SNOR_ID conversion. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mtd/spi-nor/spansion.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index 828b442735ee8..757c5636d3e35 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -790,10 +790,6 @@ static const struct flash_info spansion_nor_parts[] = {
NO_SFDP_FLAGS(SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
MFR_FLAGS(USE_CLSR)
.fixups = &s25fs_s_nor_fixups, },
- { "s25fs256s0", INFO6(0x010219, 0x4d0081, 256 * 1024, 128)
- NO_SFDP_FLAGS(SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
- MFR_FLAGS(USE_CLSR)
- },
{ "s25fs256s1", INFO6(0x010219, 0x4d0181, 64 * 1024, 512)
NO_SFDP_FLAGS(SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
MFR_FLAGS(USE_CLSR)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0323/1167] cxl/hdm: Make switch decoder target parsing endian-safe
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (321 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0322/1167] mtd: spi-nor: spansion: Remove s25fs256s0 Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0324/1167] cxl/hdm: Restore commit_end when decoder enumeration fails Greg Kroah-Hartman
` (334 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alison Schofield, Li Ming,
Dave Jiang, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alison Schofield <alison.schofield@intel.com>
[ Upstream commit 3f846646b3d3b5699139e686e1107d231a725860 ]
Switch decoder target IDs are stored one per byte, starting with
target 0 in the least significant byte. The current code accesses
those bytes in memory order, which only matches register order on
little-endian hosts.
On big-endian hosts, the target IDs are reversed and the decoder is
associated with the wrong downstream ports.
Place the register values in a byte array in little-endian order and
index the target IDs from there, so the target mapping is independent
of host endianness.
Fixes: d17d0540a0db ("cxl/core/hdm: Add CXL standard decoder enumeration to the core")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Link: https://patch.msgid.link/b0526825b3c3ffdb78837563e178d9aa27b6bbb8.1786143520.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/hdm.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index 493c024eafc1a..f46e206724642 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright(c) 2022 Intel Corporation. All rights reserved. */
#include <linux/seq_file.h>
+#include <asm/unaligned.h>
#include <linux/device.h>
#include <linux/delay.h>
@@ -840,15 +841,12 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
u64 *dpa_base, struct cxl_endpoint_dvsec_info *info)
{
struct cxl_endpoint_decoder *cxled = NULL;
+ u8 target_id[CXL_HDM_DECODER0_TL_TARGETS];
u64 size, base, skip, dpa_size, lo, hi;
bool committed;
u32 remainder;
int i, rc;
u32 ctrl;
- union {
- u64 value;
- unsigned char target_id[8];
- } target_list;
if (should_emulate_decoders(info))
return cxl_setup_hdm_decoder_from_dvsec(port, cxld, dpa_base,
@@ -957,11 +955,12 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
return -ENXIO;
}
- lo = readl(hdm + CXL_HDM_DECODER0_TL_LOW(which));
- hi = readl(hdm + CXL_HDM_DECODER0_TL_HIGH(which));
- target_list.value = (hi << 32) + lo;
+ put_unaligned_le32(readl(hdm + CXL_HDM_DECODER0_TL_LOW(which)),
+ &target_id[0]);
+ put_unaligned_le32(readl(hdm + CXL_HDM_DECODER0_TL_HIGH(which)),
+ &target_id[4]);
for (i = 0; i < cxld->interleave_ways; i++)
- target_map[i] = target_list.target_id[i];
+ target_map[i] = target_id[i];
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0324/1167] cxl/hdm: Restore commit_end when decoder enumeration fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (322 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0323/1167] cxl/hdm: Make switch decoder target parsing endian-safe Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0325/1167] cxl/port: Bound switch decoder target array access by nr_targets Greg Kroah-Hartman
` (333 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jonathan Cameron, Dave Jiang,
Li Ming, Richard Cheng, Alison Schofield, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alison Schofield <alison.schofield@intel.com>
[ Upstream commit 7dae18c39e99813461db6ef3fc13f077452109ce ]
commit_end tracks the highest committed decoder on a port. It gets
advanced before decoder enumeration is complete, so a later failure
leaves it pointing at a decoder that was never added. The next probe
then rejects decoder0 as out of order and enumeration fails.
Reset commit_end to the uncommitted baseline once the decoders are
torn down, so a subsequent probe rebuilds it from scratch. Register
the reset before the decoders are added so that on unwind it runs
after every decoder has been unregistered. This prevents commit_end
from dropping below the highest committed decoder still registered and
exposing an inconsistent value to a concurrent reader.
Protect the commit_end advance in the DVSEC emulation path against
concurrent readers, matching the register-programmed path.
Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")
Fixes: b777e9bec960 ("cxl/hdm: Emulate HDM decoder from DVSEC range registers")
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/4802c5abc906b858a4754bfc4fa3e4c2c455d0c3.1786143520.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: Replaced upstream's cxl_rwsem.region lock with this tree's global cxl_region_rwsem, and kept the local target_map context line while dropping the inner rc. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/hdm.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index f46e206724642..18b4542657f22 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -821,7 +821,8 @@ static int cxl_setup_hdm_decoder_from_dvsec(
* change the range registers at run time.
*/
cxld->flags |= CXL_DECODER_F_ENABLE | CXL_DECODER_F_LOCK;
- port->commit_end = cxld->id;
+ scoped_guard(rwsem_write, &cxl_region_rwsem)
+ port->commit_end = cxld->id;
rc = devm_cxl_dpa_reserve(cxled, *dpa_base, len, 0);
if (rc) {
@@ -1020,6 +1021,14 @@ static void cxl_settle_decoders(struct cxl_hdm *cxlhdm)
msleep(20);
}
+static void cxl_reset_commit_end(void *data)
+{
+ struct cxl_port *port = data;
+
+ guard(rwsem_write)(&cxl_region_rwsem);
+ port->commit_end = -1;
+}
+
/**
* devm_cxl_enumerate_decoders - add decoder objects per HDM register set
* @cxlhdm: Structure to populate with HDM capabilities
@@ -1030,8 +1039,8 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
{
void __iomem *hdm = cxlhdm->regs.hdm_decoder;
struct cxl_port *port = cxlhdm->port;
- int i;
u64 dpa_base = 0;
+ int i, rc;
/*
* Per CXL 4.0 8.2.4.20.1 Target Count is the number of target ports
@@ -1047,9 +1056,17 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
cxl_settle_decoders(cxlhdm);
+ /*
+ * Reset commit_end after all decoders have been torn down so a
+ * subsequent probe rebuilds it from scratch.
+ */
+ rc = devm_add_action(&port->dev, cxl_reset_commit_end, port);
+ if (rc)
+ return rc;
+
for (i = 0; i < cxlhdm->decoder_count; i++) {
int target_map[CXL_DECODER_MAX_INTERLEAVE] = { 0 };
- int rc, target_count = cxlhdm->target_count;
+ int target_count = cxlhdm->target_count;
struct cxl_decoder *cxld;
if (is_cxl_endpoint(port)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0325/1167] cxl/port: Bound switch decoder target array access by nr_targets
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (323 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0324/1167] cxl/hdm: Restore commit_end when decoder enumeration fails Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0326/1167] ASoC: rt1015: make control calibration failures observable Greg Kroah-Hartman
` (332 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alison Schofield, Li Ming,
Dave Jiang, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alison Schofield <alison.schofield@intel.com>
[ Upstream commit 4e42c398af136d62fac8c19c9f410ec83a8dd34a ]
Switch decoder target lookups walk the target array using interleave
ways as the bound. The array is allocated with nr_targets entries, so a
decoder whose interleave ways exceeds nr_targets reads and writes past
the end of it. That happens during dport activation, during decoder
target population, and when userspace reads the target_list attribute.
Bounding by nr_targets alone is not correct either. Commit d6488fee6647
("cxl/port: Fix decoder initialization when nr_targets > interleave_ways")
moved target population to interleave ways precisely so that targets a
decoder does not use are left unpopulated. Neither field alone is a safe
bound, so add a helper that returns the minimum of the two and use it at
every walk of the target array.
Valid configurations keep interleave ways within nr_targets, so this is
not a behavior change for them.
Fixes: 40ba17afdfab ("cxl/acpi: Introduce cxl_decoder objects")
Fixes: d6488fee6647 ("cxl/port: Fix decoder initialization when nr_targets > interleave_ways")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Link: https://patch.msgid.link/d7577652cc6d414e1de0ee4045d4d6b2808172ce.1786143520.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: Dropped the update_decoder_targets() hunk because that function doesn't exist here, and adapted decoder_populate_targets() to its older target_map parameter and rwsem context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/port.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 6bc3dd4dcd8a8..f71ee86c8a085 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -142,20 +142,29 @@ static ssize_t target_type_show(struct device *dev,
}
static DEVICE_ATTR_RO(target_type);
+/*
+ * Interleave ways selects how many targets a decoder uses, but the target
+ * array is only nr_targets long. Bound array access by both.
+ */
+static int cxlsd_nr_used_targets(struct cxl_switch_decoder *cxlsd)
+{
+ return min(cxlsd->cxld.interleave_ways, cxlsd->nr_targets);
+}
+
static ssize_t emit_target_list(struct cxl_switch_decoder *cxlsd, char *buf)
{
- struct cxl_decoder *cxld = &cxlsd->cxld;
+ int nr_used = cxlsd_nr_used_targets(cxlsd);
ssize_t offset = 0;
int i, rc = 0;
- for (i = 0; i < cxld->interleave_ways; i++) {
+ for (i = 0; i < nr_used; i++) {
struct cxl_dport *dport = cxlsd->target[i];
struct cxl_dport *next = NULL;
if (!dport)
break;
- if (i + 1 < cxld->interleave_ways)
+ if (i + 1 < nr_used)
next = cxlsd->target[i + 1];
rc = sysfs_emit_at(buf, offset, "%d%s", dport->port_id,
next ? "," : "");
@@ -1581,7 +1590,7 @@ EXPORT_SYMBOL_NS_GPL(cxl_mem_find_port, CXL);
static int decoder_populate_targets(struct cxl_switch_decoder *cxlsd,
struct cxl_port *port, int *target_map)
{
- int i;
+ int i, nr_used;
if (!target_map)
return 0;
@@ -1592,7 +1601,8 @@ static int decoder_populate_targets(struct cxl_switch_decoder *cxlsd,
return -EINVAL;
guard(rwsem_write)(&cxl_region_rwsem);
- for (i = 0; i < cxlsd->cxld.interleave_ways; i++) {
+ nr_used = cxlsd_nr_used_targets(cxlsd);
+ for (i = 0; i < nr_used; i++) {
struct cxl_dport *dport = find_dport(port, target_map[i]);
if (!dport)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0326/1167] ASoC: rt1015: make control calibration failures observable
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (324 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0325/1167] cxl/port: Bound switch decoder target array access by nr_targets Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0328/1167] kernfs: dont repeat or skip an entry when readdir resumes Greg Kroah-Hartman
` (331 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 98fe8aab04cec6fcadeb10a757235225d550be36 ]
The bypass-boost control runs a hardware calibration while bypassing the
register cache. It ignores every register access and cache restore
failure, then publishes both the requested mode and calibration
completion.
Return failures from the complete calibration sequence, always restore
normal cache operation and unlock DAPM, and only publish the control
state after the calibration and final mode write both succeed. The mixer
control callback is an effective error consumer, independent of deferred
component resume.
Fixes: da145172b236 ("ASoC: rt1015: Fix DC calibration on bypass boost mode")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260830142118.36668-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Adapted context to this tree's DAPM and component lookup APIs (&component->dapm, snd_soc_kcontrol_component()), while the added and removed lines match upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt1015.c | 81 +++++++++++++++++++++++++++++++--------
1 file changed, 65 insertions(+), 16 deletions(-)
diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c
index 99ec0f9a83626..4cc03dfa59e4b 100644
--- a/sound/soc/codecs/rt1015.c
+++ b/sound/soc/codecs/rt1015.c
@@ -491,34 +491,71 @@ static int rt1015_bypass_boost_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static void rt1015_calibrate(struct rt1015_priv *rt1015)
+static int rt1015_calibrate(struct rt1015_priv *rt1015)
{
struct snd_soc_component *component = rt1015->component;
struct regmap *regmap = rt1015->regmap;
+ int ret, sync_ret;
snd_soc_dapm_mutex_lock(&component->dapm);
regcache_cache_bypass(regmap, true);
- regmap_write(regmap, RT1015_CLK_DET, 0x0000);
- regmap_write(regmap, RT1015_PWR4, 0x00B2);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0009);
+ ret = regmap_write(regmap, RT1015_CLK_DET, 0x0000);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_PWR4, 0x00B2);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0009);
+ if (ret)
+ goto restore_cache;
+
msleep(100);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000A);
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000A);
+ if (ret)
+ goto restore_cache;
+
msleep(100);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000C);
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000C);
+ if (ret)
+ goto restore_cache;
+
msleep(100);
- regmap_write(regmap, RT1015_CLSD_INTERNAL8, 0x2028);
- regmap_write(regmap, RT1015_CLSD_INTERNAL9, 0x0140);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000D);
+ ret = regmap_write(regmap, RT1015_CLSD_INTERNAL8, 0x2028);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_CLSD_INTERNAL9, 0x0140);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000D);
+ if (ret)
+ goto restore_cache;
+
msleep(300);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0008);
- regmap_write(regmap, RT1015_SYS_RST1, 0x05F5);
- regmap_write(regmap, RT1015_CLK_DET, 0x8000);
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0008);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_SYS_RST1, 0x05F5);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_CLK_DET, 0x8000);
+
+restore_cache:
regcache_cache_bypass(regmap, false);
regcache_mark_dirty(regmap);
- regcache_sync(regmap);
+ sync_ret = regcache_sync(regmap);
+ if (!ret)
+ ret = sync_ret;
snd_soc_dapm_mutex_unlock(&component->dapm);
+
+ return ret;
}
static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,
@@ -528,6 +565,8 @@ static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,
snd_soc_kcontrol_component(kcontrol);
struct rt1015_priv *rt1015 =
snd_soc_component_get_drvdata(component);
+ int bypass_boost = rt1015->bypass_boost;
+ int ret;
if (rt1015->dac_is_used) {
dev_err(component->dev, "DAC is being used!\n");
@@ -537,13 +576,23 @@ static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,
rt1015->bypass_boost = ucontrol->value.integer.value[0];
if (rt1015->bypass_boost == RT1015_Bypass_Boost &&
!rt1015->cali_done) {
- rt1015_calibrate(rt1015);
- rt1015->cali_done = 1;
+ ret = rt1015_calibrate(rt1015);
+ if (ret)
+ goto restore_boost;
+
+ ret = regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL,
+ 0x0010);
+ if (ret)
+ goto restore_boost;
- regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010);
+ rt1015->cali_done = 1;
}
return 0;
+
+restore_boost:
+ rt1015->bypass_boost = bypass_boost;
+ return ret;
}
static const struct snd_kcontrol_new rt1015_snd_controls[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0328/1167] kernfs: dont repeat or skip an entry when readdir resumes
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (325 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0326/1167] ASoC: rt1015: make control calibration failures observable Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0329/1167] cxl/region: Unregister the pmem region when the bridge is unbound Greg Kroah-Hartman
` (330 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejun Heo, Shakeel Butt,
Christian Brauner (Amutable), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shakeel Butt <shakeel.butt@linux.dev>
[ Upstream commit 5ebcb578adeec7407dd501108ab2f423ca8e3e55 ]
readdir keeps its place as a name hash in ctx->pos and pins the entry in
file->private_data. If that entry is gone when the listing comes back,
kernfs_dir_pos() searches the rbtree for the hash and keeps whatever
node the descent stopped on. That is the entry before or after the
missing one, depending on the shape of the tree.
Landing before it repeats an entry the previous getdents(2) call already
reported. Landing after it, kernfs_dir_next_pos() calls rb_next() and
steps over an unreported entry.
With children A(10), B(20), C(30):
report A, ctx->pos = 10
A removed
kernfs_dir_next_pos(10, A)
A is gone, the search for 10 stops at B
rb_next(B) -> C, so B is never reported
Only the repeat happens today, between two getdents(2) calls. The skip
needs the pinned entry to go away inside one call, which the next patch
allows when it drops kernfs_rwsem around dir_emit().
Before the commit 4e4d6d860b93 the descent kept a node only on the way
left, which is a search for the first entry at or after the hash. That
commit moved the assignment to the top of the loop, where it runs on
right turns too. Restore that search, and step forward only when the
pinned entry is still there rather than when the hash matches, since two
entries in one directory can share a hash.
While here, kernfs_dir_next_pos() called the hash @ino. It is never an
inode number, so name it @hash.
Fixes: 4e4d6d860b93 ("sysfs: Add s_hash to sysfs_dirent and order directory entries by hash")
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://patch.msgid.link/20260911182815.1992483-2-shakeel.butt@linux.dev
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Replaced the exact-match rbtree descent in the readdir position lookup with a first-entry-at-or-after-hash search, adapting the ns type to const void * and parent/name to the older non-RCU fields. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/kernfs/dir.c | 38 ++++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 96213e3c30d85..188453a79c14a 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -1796,27 +1796,42 @@ static int kernfs_dir_fop_release(struct inode *inode, struct file *filp)
return 0;
}
+/*
+ * Find where a listing left off. @resumed says whether @pos is still that
+ * entry; if not, the first entry at or after @hash is returned instead.
+ */
static struct kernfs_node *kernfs_dir_pos(const void *ns,
- struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos)
+ struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos,
+ bool *resumed)
{
+ if (resumed)
+ *resumed = false;
if (pos) {
int valid = kernfs_active(pos) &&
pos->parent == parent && hash == pos->hash;
kernfs_put(pos);
if (!valid)
pos = NULL;
+ else if (resumed)
+ *resumed = true;
}
if (!pos && (hash > 1) && (hash < INT_MAX)) {
struct rb_node *node = parent->dir.children.rb_node;
+
+ /*
+ * Keep a node only on the way left, so the search ends on the
+ * first entry at or after @hash. The empty name sorts before
+ * every entry sharing the hash, so it lands on the first.
+ */
while (node) {
- pos = rb_to_kn(node);
+ struct kernfs_node *kn = rb_to_kn(node);
- if (hash < pos->hash)
+ if (kernfs_name_compare(hash, "", ns, kn) < 0) {
+ pos = kn;
node = node->rb_left;
- else if (hash > pos->hash)
+ } else {
node = node->rb_right;
- else
- break;
+ }
}
}
/* Skip over entries which are dying/dead or in the wrong namespace */
@@ -1831,10 +1846,13 @@ static struct kernfs_node *kernfs_dir_pos(const void *ns,
}
static struct kernfs_node *kernfs_dir_next_pos(const void *ns,
- struct kernfs_node *parent, ino_t ino, struct kernfs_node *pos)
+ struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos)
{
- pos = kernfs_dir_pos(ns, parent, ino, pos);
- if (pos) {
+ bool resumed;
+
+ pos = kernfs_dir_pos(ns, parent, hash, pos, &resumed);
+ /* Step over @pos only if it survived; two entries can share a hash. */
+ if (pos && resumed) {
do {
struct rb_node *node = rb_next(&pos->rb);
if (!node)
@@ -1863,7 +1881,7 @@ static int kernfs_fop_readdir(struct file *file, struct dir_context *ctx)
if (kernfs_ns_enabled(parent))
ns = kernfs_info(dentry->d_sb)->ns;
- for (pos = kernfs_dir_pos(ns, parent, ctx->pos, pos);
+ for (pos = kernfs_dir_pos(ns, parent, ctx->pos, pos, NULL);
pos;
pos = kernfs_dir_next_pos(ns, parent, ctx->pos, pos)) {
const char *name = pos->name;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0329/1167] cxl/region: Unregister the pmem region when the bridge is unbound
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (326 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0328/1167] kernfs: dont repeat or skip an entry when readdir resumes Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0330/1167] bpftool: Compute map size of light skeletons at runtime Greg Kroah-Hartman
` (329 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guixin Liu, Richard Cheng, Li Ming,
Dave Jiang, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixin Liu <kanie@linux.alibaba.com>
[ Upstream commit bb26797c08d408ea7e8d3625045f0fe28714a425 ]
Removing cxl_acpi unbinds the nvdimm bridge before the regions it
serves. A region probe can therefore register its cxl_pmem_region and
only then find the bridge unbound, which leaves the new device with
nothing to remove it.
The orphan outlives the teardown and pins its region and its memdevs, so
a later cxl_acpi bind renumbers the root port, ports, endpoints,
decoders and the memdev.
Unregister the cxl_pmem_region when the bridge is unbound.
Found by code inspection. Racing a cxl_region bind against a cxl_acpi
unbind leaked a pmem_region device on 12 of 12 attempts, and none with
this patch.
Fixes: f17b558d6663 ("cxl/pmem: Refactor nvdimm device registration, delete the workqueue")
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260831061120.200790-1-kanie@linux.alibaba.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: Moved the fix from the split-out pmem region file into region.c and kept the existing device_lock()/device_unlock() calls instead of scoped_guard(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/region.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index 873ee24a34317..f93e5f03d60db 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -2872,11 +2872,13 @@ static int devm_cxl_add_pmem_region(struct cxl_region *cxlr)
dev_name(dev));
device_lock(&cxl_nvb->dev);
- if (cxl_nvb->dev.driver)
+ if (cxl_nvb->dev.driver) {
rc = devm_add_action_or_reset(&cxl_nvb->dev,
cxlr_pmem_unregister, cxlr_pmem);
- else
+ } else {
rc = -ENXIO;
+ cxlr_pmem_unregister(cxlr_pmem);
+ }
device_unlock(&cxl_nvb->dev);
if (rc)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0330/1167] bpftool: Compute map size of light skeletons at runtime
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (327 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0329/1167] cxl/region: Unregister the pmem region when the bridge is unbound Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0331/1167] i3c: mipi-i3c-hci: Process multiple IBIs per interrupt Greg Kroah-Hartman
` (328 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Hwang, Andrii Nakryiko,
Quentin Monnet, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Hwang <leon.hwang@linux.dev>
[ Upstream commit a885470df10b1c0dbc011177c19d3fd3bb8af2e9 ]
bpftool rounds memory-mapped data map sizes to the host page size when
generating a light skeleton. The generated code therefore uses a 64K
mapping size when bpftool runs on a 64K-page host, even if the skeleton
runs on a 4K-page target. The target rejects the oversized map mmap(),
causing failure of loading the light skeleton.
When try to run 64K-page selftests on 4K-page VM, the error message does
not provide the reason about page size.
test_atomics:PASS:atomics skeleton open 0 nsec
test_atomics:FAIL:atomics skeleton load unexpected error: -12 (errno 22)
#15 atomics:FAIL
Pass the original map value size and max entries to the generated code and
round mmap size to the runtime page size in the user-space light
skeleton helpers. This keeps generated light skeletons independent of the
build host page size.
Fixes: d510296d331a ("bpftool: Use syscall/loader program in "prog load" and "gen skeleton" command.")
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/bpf/20260915161450.96249-1-leon.hwang@linux.dev
[ sashal: Dropped upstream's PERCPU_ARRAY/skel_protect_map_data hunks and adapted the call sites to the older codegen format (no is_skel_data(), no __typeof__ cast, different include context). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bpf/bpftool/gen.c | 26 ++++++++----------------
tools/lib/bpf/skel_internal.h | 37 +++++++++++++++++++++++++----------
2 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index 7a75da8bbbb08..bf010702ed8a9 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -467,16 +467,6 @@ static void print_hex(const char *data, int data_sz)
}
}
-static size_t bpf_map_mmap_sz(const struct bpf_map *map)
-{
- long page_sz = sysconf(_SC_PAGE_SIZE);
- size_t map_sz;
-
- map_sz = (size_t)roundup(bpf_map__value_size(map), 8) * bpf_map__max_entries(map);
- map_sz = roundup(map_sz, page_sz);
- return map_sz;
-}
-
/* Emit type size asserts for all top-level fields in memory-mapped internal maps. */
static void codegen_asserts(struct bpf_object *obj, const char *obj_name)
{
@@ -654,8 +644,8 @@ static void codegen_destroy(struct bpf_object *obj, const char *obj_name)
continue;
if (bpf_map__is_internal(map) &&
(bpf_map__map_flags(map) & BPF_F_MMAPABLE))
- printf("\tskel_free_map_data(skel->%1$s, skel->maps.%1$s.initial_value, %2$zu);\n",
- ident, bpf_map_mmap_sz(map));
+ printf("\tskel_free_map_data(skel->%1$s, skel->maps.%1$s.initial_value, %2$u, %3$u);\n",
+ ident, bpf_map__value_size(map), bpf_map__max_entries(map));
codegen("\
\n\
skel_closenz(skel->maps.%1$s.map_fd); \n\
@@ -728,11 +718,11 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
print_hex(mmap_data, mmap_size);
codegen("\
\n\
- \", %1$zd, %2$zd); \n\
- if (!skel->%3$s) \n\
+ \", %1$u, %2$u, %3$zd); \n\
+ if (!skel->%4$s) \n\
goto cleanup; \n\
- skel->maps.%3$s.initial_value = (__u64) (long) skel->%3$s;\n\
- ", bpf_map_mmap_sz(map), mmap_size, ident);
+ skel->maps.%4$s.initial_value = (__u64) (long) skel->%4$s;\n\
+ ", bpf_map__value_size(map), bpf_map__max_entries(map), mmap_size, ident);
}
codegen("\
\n\
@@ -787,11 +777,11 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
codegen("\
\n\
skel->%1$s = skel_finalize_map_data(&skel->maps.%1$s.initial_value, \n\
- %2$zd, %3$s, skel->maps.%1$s.map_fd);\n\
+ %2$u, %3$u, %4$s, skel->maps.%1$s.map_fd);\n\
if (!skel->%1$s) \n\
return -ENOMEM; \n\
",
- ident, bpf_map_mmap_sz(map), mmap_flags);
+ ident, bpf_map__value_size(map), bpf_map__max_entries(map), mmap_flags);
}
codegen("\
\n\
diff --git a/tools/lib/bpf/skel_internal.h b/tools/lib/bpf/skel_internal.h
index 1e82ab06c3ebf..5aa1549257197 100644
--- a/tools/lib/bpf/skel_internal.h
+++ b/tools/lib/bpf/skel_internal.h
@@ -11,6 +11,7 @@
#include <linux/bpf.h>
#else
#include <unistd.h>
+#include <sys/param.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <stdlib.h>
@@ -121,7 +122,7 @@ static inline void skel_free(const void *p)
* either bpf_probe_read_kernel() or bpf_copy_from_user() from initial_value
* depending on bpf_loader_ctx->flags.
*/
-static inline void skel_free_map_data(void *p, __u64 addr, size_t sz)
+static inline void skel_free_map_data(void *p, __u64 addr, size_t val_sz, __u32 max_entries)
{
if (addr != ~0ULL)
kvfree(p);
@@ -130,18 +131,20 @@ static inline void skel_free_map_data(void *p, __u64 addr, size_t sz)
*/
}
-static inline void *skel_prep_map_data(const void *val, size_t mmap_sz, size_t val_sz)
+static inline void *skel_prep_map_data(const void *val, size_t val_sz, __u32 max_entries,
+ size_t data_sz)
{
void *addr;
- addr = kvmalloc(val_sz, GFP_KERNEL);
+ addr = kvmalloc(data_sz, GFP_KERNEL);
if (!addr)
return NULL;
- memcpy(addr, val, val_sz);
+ memcpy(addr, val, data_sz);
return addr;
}
-static inline void *skel_finalize_map_data(__u64 *init_val, size_t mmap_sz, int flags, int fd)
+static inline void *skel_finalize_map_data(__u64 *init_val, size_t val_sz, __u32 max_entries,
+ int flags, int fd)
{
struct bpf_map *map;
void *addr = NULL;
@@ -176,25 +179,39 @@ static inline void skel_free(void *p)
free(p);
}
-static inline void skel_free_map_data(void *p, __u64 addr, size_t sz)
+static inline size_t skel_map_mmap_sz(size_t val_sz, __u32 max_entries)
{
- munmap(p, sz);
+ const long page_sz = sysconf(_SC_PAGE_SIZE);
+ size_t mmap_sz;
+
+ mmap_sz = roundup(val_sz, 8) * max_entries;
+ mmap_sz = roundup(mmap_sz, page_sz);
+ return mmap_sz;
+}
+
+static inline void skel_free_map_data(void *p, __u64 addr, size_t val_sz, __u32 max_entries)
+{
+ munmap(p, skel_map_mmap_sz(val_sz, max_entries));
}
-static inline void *skel_prep_map_data(const void *val, size_t mmap_sz, size_t val_sz)
+static inline void *skel_prep_map_data(const void *val, size_t val_sz, __u32 max_entries,
+ size_t data_sz)
{
+ size_t mmap_sz = skel_map_mmap_sz(val_sz, max_entries);
void *addr;
addr = mmap(NULL, mmap_sz, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
if (addr == (void *) -1)
return NULL;
- memcpy(addr, val, val_sz);
+ memcpy(addr, val, data_sz);
return addr;
}
-static inline void *skel_finalize_map_data(__u64 *init_val, size_t mmap_sz, int flags, int fd)
+static inline void *skel_finalize_map_data(__u64 *init_val, size_t val_sz, __u32 max_entries,
+ int flags, int fd)
{
+ size_t mmap_sz = skel_map_mmap_sz(val_sz, max_entries);
void *addr;
addr = mmap((void *) (long) *init_val, mmap_sz, flags, MAP_SHARED | MAP_FIXED, fd, 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0331/1167] i3c: mipi-i3c-hci: Process multiple IBIs per interrupt
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (328 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0330/1167] bpftool: Compute map size of light skeletons at runtime Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0332/1167] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked() Greg Kroah-Hartman
` (327 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adrian Hunter, Frank Li,
Alexandre Belloni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <adrian.hunter@intel.com>
[ Upstream commit 5fbd0790af9484c251341e3ba2ebbb2887c570c8 ]
INTR_IBI_READY indicates that one or more IBI Status Descriptors are
present in the IBI ring. After clearing interrupt status, the interrupt
handler processes only a single IBI even though additional IBIs may
already be queued.
The controller does not reassert INTR_IBI_READY solely because entries
remain in the ring after interrupt status has been cleared. Consequently,
the remaining IBIs are not processed until some later interrupt occurs,
and can accumulate if IBIs arrive more often than the interrupt handler
runs.
Process all IBIs that are pending when the handler runs: capture the IBI
enqueue pointer up front and continue until the dequeue pointer reaches
that position.
Fixes: 9ad9a52cce28 ("i3c/master: introduce the mipi-i3c-hci driver")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260920151248.46936-10-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[ sashal: Kept the DBG macro and the existing rh->lock around the IBI dequeue-pointer update, re-reading RING_OPERATION1 under the lock instead of writing back the cached op1_val. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i3c/master/mipi-i3c-hci/dma.c | 40 +++++++++++++++++----------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c
index 60da4be20c5f2..7e273e22f9d6a 100644
--- a/drivers/i3c/master/mipi-i3c-hci/dma.c
+++ b/drivers/i3c/master/mipi-i3c-hci/dma.c
@@ -594,24 +594,23 @@ static void hci_dma_recycle_ibi_slot(struct i3c_hci *hci,
i3c_generic_ibi_recycle_slot(dev_ibi->pool, slot);
}
-static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
+static bool hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh,
+ u32 *op1_val, unsigned int enq_ptr)
{
struct i3c_dev_desc *dev;
struct i3c_hci_dev_data *dev_data;
struct hci_dma_dev_ibi_data *dev_ibi;
struct i3c_ibi_slot *slot;
- u32 op1_val, op2_val, ibi_status_error;
- unsigned int ptr, enq_ptr, deq_ptr;
+ u32 ibi_status_error;
+ unsigned int ptr, deq_ptr;
unsigned int ibi_size, ibi_chunks, ibi_data_offset, first_part;
int ibi_addr, last_ptr;
void *ring_ibi_data;
dma_addr_t ring_ibi_data_dma;
- op1_val = rh_reg_read(RING_OPERATION1);
- deq_ptr = FIELD_GET(RING_OP1_IBI_DEQ_PTR, op1_val);
-
- op2_val = rh_reg_read(RING_OPERATION2);
- enq_ptr = FIELD_GET(RING_OP2_IBI_ENQ_PTR, op2_val);
+ deq_ptr = FIELD_GET(RING_OP1_IBI_DEQ_PTR, *op1_val);
+ if (deq_ptr == enq_ptr)
+ return false;
ibi_status_error = 0;
ibi_addr = -1;
@@ -659,7 +658,7 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
if (last_ptr == -1) {
/* this IBI sequence is not yet complete */
DBG("no LAST_STATUS available (e=%d d=%d)", enq_ptr, deq_ptr);
- return;
+ return false;
}
deq_ptr = last_ptr + 1;
deq_ptr %= rh->ibi_status_entries;
@@ -732,10 +731,10 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
done:
/* take care to update the ibi dequeue pointer atomically */
spin_lock(&rh->lock);
- op1_val = rh_reg_read(RING_OPERATION1);
- op1_val &= ~RING_OP1_IBI_DEQ_PTR;
- op1_val |= FIELD_PREP(RING_OP1_IBI_DEQ_PTR, deq_ptr);
- rh_reg_write(RING_OPERATION1, op1_val);
+ *op1_val = rh_reg_read(RING_OPERATION1);
+ *op1_val &= ~RING_OP1_IBI_DEQ_PTR;
+ *op1_val |= FIELD_PREP(RING_OP1_IBI_DEQ_PTR, deq_ptr);
+ rh_reg_write(RING_OPERATION1, *op1_val);
spin_unlock(&rh->lock);
/* update the chunk pointer */
@@ -744,6 +743,19 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
/* and tell the hardware about freed chunks */
rh_reg_write(CHUNK_CONTROL, rh_reg_read(CHUNK_CONTROL) + ibi_chunks);
+
+ return true;
+}
+
+static void hci_dma_drain_ibi_ring(struct i3c_hci *hci, struct hci_rh_data *rh)
+{
+ u32 op1_val = rh_reg_read(RING_OPERATION1);
+ u32 op2_val = rh_reg_read(RING_OPERATION2);
+ unsigned int enq_ptr = FIELD_GET(RING_OP2_IBI_ENQ_PTR, op2_val);
+
+ /* Loop is bounded by enq_ptr. Further IBIs will re-assert INTR_IBI_READY */
+ while (hci_dma_process_ibi(hci, rh, &op1_val, enq_ptr))
+ ;
}
static bool hci_dma_irq_handler(struct i3c_hci *hci, unsigned int mask)
@@ -768,7 +780,7 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci, unsigned int mask)
rh_reg_write(INTR_STATUS, status);
if (status & INTR_IBI_READY)
- hci_dma_process_ibi(hci, rh);
+ hci_dma_drain_ibi_ring(hci, rh);
if (status & (INTR_TRANSFER_COMPLETION | INTR_TRANSFER_ERR))
hci_dma_xfer_done(hci, rh);
if (status & INTR_RING_OP)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0332/1167] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (329 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0331/1167] i3c: mipi-i3c-hci: Process multiple IBIs per interrupt Greg Kroah-Hartman
@ 2026-12-04 9:55 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0333/1167] wifi: rtl8xxxu: unwind incomplete receive startup Greg Kroah-Hartman
` (326 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:55 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrew Morton, David Hildenbrand,
Jason Gunthorpe, John Hubbard, Peter Xu, Lance Yang, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit da01399b90a73cd00b502f7903fa5acbfac4a103 ]
The !CONFIG_MMU implementation of __get_user_pages_locked() takes a bare
get_page() reference for each page regardless of foll_flags:
if (pages[i])
get_page(pages[i]);
This is reached from pin_user_pages*() with FOLL_PIN set.
unpin_user_page() is shared between MMU and NOMMU configurations and
unconditionally calls gup_put_folio(..., FOLL_PIN), which subtracts
GUP_PIN_COUNTING_BIAS (1024) from the folio refcount.
This means that pin adds 1, and then unpin will subtract 1024.
If a user maps a page (refcount 1), registers it 1023 times as an
io_uring fixed buffer (1023 pin_user_pages calls -> refcount 1024), then
unregisters: the first unpin_user_page subtracts 1024, refcount hits 0,
the page is freed and returned to the buddy allocator. The remaining
1022 unpins write into whatever was reallocated, and the user's VMA
still maps the freed page (NOMMU has no MMU to invalidate it).
Reallocating the page for an io_uring pbuf_ring then lets userspace
corrupt the new owner's data through the stale mapping.
Use try_grab_folio() which adds GUP_PIN_COUNTING_BIAS for FOLL_PIN and 1
for FOLL_GET, mirroring the CONFIG_MMU path so pin and unpin are
symmetric. Keep supporting the traditional behavior where users specify
a pages array but don't set FOLL_GET.
While at it, don't return NULL pointers in the page array,
as this is really not expected for GUP users; instead, just fail and return
-EFAULT.
[ david: support traditional behavior with no FOLL_GET, extend
description ]
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Lance Yang <lance.yang@linux.dev>
Reported-by: Anthropic
Fixes: 3faa52c03f44 ("mm/gup: track FOLL_PIN pages")
Assisted-by: gkh_clanker_t1000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Lance Yang <lance.yang@linux.dev>
Link: https://patch.msgid.link/20260921-nommu_gup_pin-v4-1-c410041cc479@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Kept unsigned long vm_flags; instead of upstream's vm_flags_t vm_flags; in the NOMMU __get_user_pages_locked() declarations context, since the vm_flags_t type is missing here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/gup.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/mm/gup.c b/mm/gup.c
index af2435cd73d66..05b0a06623dac 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1716,6 +1716,7 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
struct vm_area_struct *vma;
bool must_unlock = false;
unsigned long vm_flags;
+ int ret, err = -EFAULT;
long i;
if (!nr_pages)
@@ -1732,6 +1733,10 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
*locked = 1;
}
+ /* See the MMU variant: support the traditional behavior. */
+ if (pages && !(foll_flags & FOLL_PIN))
+ foll_flags |= FOLL_GET;
+
/* calculate required read or write permissions.
* If FOLL_FORCE is set, we only require the "MAY" flags.
*/
@@ -1752,8 +1757,14 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
if (pages) {
pages[i] = virt_to_page((void *)start);
- if (pages[i])
- get_page(pages[i]);
+ if (!pages[i])
+ break;
+ ret = try_grab_folio(page_folio(pages[i]), 1, foll_flags);
+ if (unlikely(ret)) {
+ pages[i] = NULL;
+ err = ret;
+ break;
+ }
}
start = (start + PAGE_SIZE) & PAGE_MASK;
@@ -1764,7 +1775,7 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
*locked = 0;
}
- return i ? : -EFAULT;
+ return i ? : err;
}
#endif /* !CONFIG_MMU */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0333/1167] wifi: rtl8xxxu: unwind incomplete receive startup
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (330 preceding siblings ...)
2026-12-04 9:55 ` [PATCH 6.6 0332/1167] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked() Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0334/1167] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors Greg Kroah-Hartman
` (325 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ping-Ke Shih, Kim Wooseok,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kim Wooseok <5mghybrid@khu.ac.kr>
[ Upstream commit 4c58fb8944a2cfbe5506534de0cf58646408d31a ]
rtl8xxxu_start() allocates and submits RX URBs one at a time. If a later
allocation fails, the error path frees the TX pool but leaves earlier RX
requests active. A partial TX or RX allocation failure can also leave
ret at zero, so start reports success despite the incomplete setup.
Allocate the RX pool before submitting any of it, and return ENOMEM
whenever a pool allocation fails. Pass start errors through
rtl8xxxu_stop(), including interrupt URB submission failures, so the
existing stop path cancels work and releases both active requests and
partially allocated pools.
Share the submission loop with the RX worker. Both callers keep requests
that fail with ENOMEM/EAGAIN. For a fatal error during startup, free the
rest of the unsubmitted batch and return the error so start can unwind.
In the worker, free only the failed request and continue with the rest
of the batch.
Keep the allocation loop in a small helper so the setup and error paths
in start remain easy to follow.
On an RTL8192EU, I exercised every error exit in rtl8xxxu_start()
except interrupt-URB allocation and submission failures, which this
adapter does not use.
Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)")
Assisted-by: GPT-6 Astra
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260921-codex-rtl-rx-v3-submit-v4-2-eeb09fe8f791@khu.ac.kr
[ sashal: adapted allocator calls to the older kmalloc(sizeof(), GFP_KERNEL) form and dropped the bool suspend argument from rtl8xxxu_stop() to match the older mac80211 stop callback. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 96 +++++++++++--------
1 file changed, 54 insertions(+), 42 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index b625de928ebd7..729f4e8b79710 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -76,6 +76,7 @@ MODULE_PARM_DESC(dma_agg_pages, "Set DMA aggregation pages (range 1-127, 0 to di
#define RTL8XXXU_TX_URB_LOW_WATER 25
#define RTL8XXXU_TX_URB_HIGH_WATER 32
+static void rtl8xxxu_stop(struct ieee80211_hw *hw);
static int rtl8xxxu_submit_rx_urb(struct rtl8xxxu_priv *priv,
struct rtl8xxxu_rx_urb *rx_urb);
@@ -5824,6 +5825,28 @@ static void rtl8xxxu_free_rx_resources(struct rtl8xxxu_priv *priv)
spin_unlock_irqrestore(&priv->rx_urb_lock, flags);
}
+static int rtl8xxxu_alloc_rx_urbs(struct rtl8xxxu_priv *priv)
+{
+ struct rtl8xxxu_rx_urb *rx_urb;
+ int i;
+
+ /* No RX work is active until the complete pool has been allocated. */
+ for (i = 0; i < RTL8XXXU_RX_URBS; i++) {
+ rx_urb = kmalloc(sizeof(struct rtl8xxxu_rx_urb), GFP_KERNEL);
+ if (!rx_urb)
+ return -ENOMEM;
+
+ usb_init_urb(&rx_urb->urb);
+ INIT_LIST_HEAD(&rx_urb->list);
+ rx_urb->hw = priv->hw;
+
+ list_add_tail(&rx_urb->list, &priv->rx_urb_pending_list);
+ priv->rx_urb_pending_count++;
+ }
+
+ return 0;
+}
+
static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
struct rtl8xxxu_rx_urb *rx_urb)
{
@@ -5851,32 +5874,21 @@ static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
spin_unlock_irqrestore(&priv->rx_urb_lock, flags);
}
-static void rtl8xxxu_rx_urb_work(struct work_struct *work)
+static int rtl8xxxu_submit_rx_urbs(struct rtl8xxxu_priv *priv, bool startup)
{
- struct rtl8xxxu_priv *priv;
struct rtl8xxxu_rx_urb *rx_urb, *tmp;
- struct list_head local;
unsigned long flags;
+ LIST_HEAD(local);
int ret;
- priv = container_of(work, struct rtl8xxxu_priv, rx_urb_wq);
- INIT_LIST_HEAD(&local);
-
spin_lock_irqsave(&priv->rx_urb_lock, flags);
-
list_splice_init(&priv->rx_urb_pending_list, &local);
priv->rx_urb_pending_count = 0;
-
spin_unlock_irqrestore(&priv->rx_urb_lock, flags);
list_for_each_entry_safe(rx_urb, tmp, &local, list) {
list_del_init(&rx_urb->list);
ret = rtl8xxxu_submit_rx_urb(priv, rx_urb);
- /*
- * If out of memory or temporary error, put it back on the
- * queue and try again. Otherwise the device is dead/gone
- * and we should drop it.
- */
switch (ret) {
case 0:
break;
@@ -5885,11 +5897,29 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)
rtl8xxxu_queue_rx_urb(priv, rx_urb);
break;
default:
+ usb_free_urb(&rx_urb->urb);
+ if (startup)
+ goto free_remaining;
dev_warn(&priv->udev->dev,
"failed to requeue urb with error %i\n", ret);
- usb_free_urb(&rx_urb->urb);
}
}
+
+ return 0;
+
+free_remaining:
+ list_for_each_entry_safe(rx_urb, tmp, &local, list) {
+ list_del(&rx_urb->list);
+ usb_free_urb(&rx_urb->urb);
+ }
+ return ret;
+}
+
+static void rtl8xxxu_rx_urb_work(struct work_struct *work)
+{
+ struct rtl8xxxu_priv *priv = container_of(work, struct rtl8xxxu_priv, rx_urb_wq);
+
+ rtl8xxxu_submit_rx_urbs(priv, false);
}
/*
@@ -7183,7 +7213,6 @@ static void rtl8xxxu_watchdog_callback(struct work_struct *work)
static int rtl8xxxu_start(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
- struct rtl8xxxu_rx_urb *rx_urb;
struct rtl8xxxu_tx_urb *tx_urb;
unsigned long flags;
int ret, i;
@@ -7198,14 +7227,13 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
if (priv->usb_interrupts) {
ret = rtl8xxxu_submit_int_urb(hw);
if (ret)
- goto exit;
+ goto error_out;
}
for (i = 0; i < RTL8XXXU_TX_URBS; i++) {
tx_urb = kmalloc(sizeof(struct rtl8xxxu_tx_urb), GFP_KERNEL);
if (!tx_urb) {
- if (!i)
- ret = -ENOMEM;
+ ret = -ENOMEM;
goto error_out;
}
@@ -7216,31 +7244,21 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
priv->tx_urb_free_count++;
}
+ ret = rtl8xxxu_alloc_rx_urbs(priv);
+ if (ret)
+ goto error_out;
+
priv->tx_stopped = false;
spin_lock_irqsave(&priv->rx_urb_lock, flags);
priv->shutdown = false;
spin_unlock_irqrestore(&priv->rx_urb_lock, flags);
- for (i = 0; i < RTL8XXXU_RX_URBS; i++) {
- rx_urb = kmalloc(sizeof(struct rtl8xxxu_rx_urb), GFP_KERNEL);
- if (!rx_urb) {
- if (!i)
- ret = -ENOMEM;
-
- goto error_out;
- }
- usb_init_urb(&rx_urb->urb);
- INIT_LIST_HEAD(&rx_urb->list);
- rx_urb->hw = hw;
-
- ret = rtl8xxxu_submit_rx_urb(priv, rx_urb);
- if (ret)
- rtl8xxxu_queue_rx_urb(priv, rx_urb);
- }
+ ret = rtl8xxxu_submit_rx_urbs(priv, true);
+ if (ret)
+ goto error_out;
schedule_delayed_work(&priv->ra_watchdog, 2 * HZ);
-exit:
/*
* Accept all data and mgmt frames
*/
@@ -7253,13 +7271,7 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
return ret;
error_out:
- rtl8xxxu_free_tx_resources(priv);
- /*
- * Disable all data and mgmt frames
- */
- rtl8xxxu_write16(priv, REG_RXFLTMAP2, 0x0000);
- rtl8xxxu_write16(priv, REG_RXFLTMAP0, 0x0000);
-
+ rtl8xxxu_stop(hw);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0334/1167] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (331 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0333/1167] wifi: rtl8xxxu: unwind incomplete receive startup Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0335/1167] crypto: qat - hold cfg->lock when accessing config sections Greg Kroah-Hartman
` (324 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kim Wooseok, Ping-Ke Shih,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kim Wooseok <5mghybrid@khu.ac.kr>
[ Upstream commit 2f77c66694108785a1f6ae6c5de06453e7f7a91f ]
rtl8xxxu resubmits completed RX requests when more than eight URBs are
waiting on the pending list. It starts with 32 URBs, but frees them on
completion errors. After enough errors, the remaining pool can no longer
reach the submission threshold. Reception then stays stopped even after
the errors end. Temporary submission failures can leave a small batch
waiting with no further work scheduled, too.
Keep the URB when a completion reports EPROTO, EILSEQ, ETIME, EOVERFLOW,
ECOMM or ENOSR. Free its receive buffer and return the request to the
same pending list used by normal completions. ENOMEM/EAGAIN from startup
or worker submission uses this path as well, so a submission failure
cannot strand a request during recovery.
Use one delayed work item to submit the pending requests. An error
queues a retry after 100 ms without moving an existing reservation back.
If a normal completion takes the pending count above eight,
mod_delayed_work(..., 0) brings the work forward. This limits repeated
retries when reception is not progressing, while allowing normal traffic
to replenish the pool promptly. The 100 ms delay is therefore not a
minimum wait for each failed URB.
Keep the shutdown check, queue insertion and scheduling under the RX
lock. Stop sets shutdown under that lock, cancels the delayed work
synchronously, then drains active and pending requests. Cancellation and
device removal continue to free their URBs.
Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)")
Assisted-by: GPT-6 Astra
Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260921-codex-rtl-rx-v3-submit-v4-3-eeb09fe8f791@khu.ac.kr
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
.../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 46 ++++++++++++-------
2 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index af541e52e683b..a6e83c340f401 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1798,7 +1798,7 @@ struct rtl8xxxu_priv {
struct list_head rx_urb_pending_list;
int rx_urb_pending_count;
bool shutdown;
- struct work_struct rx_urb_wq;
+ struct delayed_work rx_urb_wq;
u8 mac_addr[ETH_ALEN];
char chip_name[8];
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 729f4e8b79710..899d81cfe5420 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -72,6 +72,7 @@ MODULE_PARM_DESC(dma_agg_pages, "Set DMA aggregation pages (range 1-127, 0 to di
#define USB_VENDOR_ID_REALTEK 0x0bda
#define RTL8XXXU_RX_URBS 32
#define RTL8XXXU_RX_URB_PENDING_WATER 8
+#define RTL8XXXU_RX_URB_RETRY_DELAY_MS 100
#define RTL8XXXU_TX_URBS 64
#define RTL8XXXU_TX_URB_LOW_WATER 25
#define RTL8XXXU_TX_URB_HIGH_WATER 32
@@ -5848,9 +5849,8 @@ static int rtl8xxxu_alloc_rx_urbs(struct rtl8xxxu_priv *priv)
}
static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
- struct rtl8xxxu_rx_urb *rx_urb)
+ struct rtl8xxxu_rx_urb *rx_urb, bool defer_schedule)
{
- struct sk_buff *skb;
unsigned long flags;
spin_lock_irqsave(&priv->rx_urb_lock, flags);
@@ -5858,16 +5858,13 @@ static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
if (!priv->shutdown) {
list_add_tail(&rx_urb->list, &priv->rx_urb_pending_list);
priv->rx_urb_pending_count++;
- /*
- * Arm the worker under rx_urb_lock so this is atomic with the
- * shutdown check: moving it out of the lock would let a
- * completion arm the work after rtl8xxxu_stop() canceled it.
- */
- if (priv->rx_urb_pending_count > RTL8XXXU_RX_URB_PENDING_WATER)
- schedule_work(&priv->rx_urb_wq);
+ /* Serialize scheduling with the shutdown check and cancellation. */
+ if (defer_schedule)
+ schedule_delayed_work(&priv->rx_urb_wq,
+ msecs_to_jiffies(RTL8XXXU_RX_URB_RETRY_DELAY_MS));
+ else if (priv->rx_urb_pending_count > RTL8XXXU_RX_URB_PENDING_WATER)
+ mod_delayed_work(system_percpu_wq, &priv->rx_urb_wq, 0);
} else {
- skb = (struct sk_buff *)rx_urb->urb.context;
- dev_kfree_skb_irq(skb);
usb_free_urb(&rx_urb->urb);
}
@@ -5894,7 +5891,7 @@ static int rtl8xxxu_submit_rx_urbs(struct rtl8xxxu_priv *priv, bool startup)
break;
case -ENOMEM:
case -EAGAIN:
- rtl8xxxu_queue_rx_urb(priv, rx_urb);
+ rtl8xxxu_queue_rx_urb(priv, rx_urb, true);
break;
default:
usb_free_urb(&rx_urb->urb);
@@ -5917,7 +5914,8 @@ static int rtl8xxxu_submit_rx_urbs(struct rtl8xxxu_priv *priv, bool startup)
static void rtl8xxxu_rx_urb_work(struct work_struct *work)
{
- struct rtl8xxxu_priv *priv = container_of(work, struct rtl8xxxu_priv, rx_urb_wq);
+ struct rtl8xxxu_priv *priv = container_of(to_delayed_work(work),
+ struct rtl8xxxu_priv, rx_urb_wq);
rtl8xxxu_submit_rx_urbs(priv, false);
}
@@ -6492,10 +6490,24 @@ static void rtl8xxxu_rx_complete(struct urb *urb)
skb = NULL;
rx_urb->urb.context = NULL;
- rtl8xxxu_queue_rx_urb(priv, rx_urb);
+ rtl8xxxu_queue_rx_urb(priv, rx_urb, false);
} else {
dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
- goto cleanup;
+
+ switch (urb->status) {
+ case -EPROTO:
+ case -EILSEQ:
+ case -ETIME:
+ case -EOVERFLOW:
+ case -ECOMM:
+ case -ENOSR:
+ dev_kfree_skb(skb);
+ urb->context = NULL;
+ rtl8xxxu_queue_rx_urb(priv, rx_urb, true);
+ return;
+ default:
+ goto cleanup;
+ }
}
return;
@@ -7294,7 +7306,7 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw)
* it drained via rtl8xxxu_submit_rx_urb(), so a worker still running
* after the kill could submit a URB that escapes it.
*/
- cancel_work_sync(&priv->rx_urb_wq);
+ cancel_delayed_work_sync(&priv->rx_urb_wq);
usb_kill_anchored_urbs(&priv->rx_anchor);
usb_kill_anchored_urbs(&priv->tx_anchor);
@@ -7566,7 +7578,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
spin_lock_init(&priv->tx_urb_lock);
INIT_LIST_HEAD(&priv->rx_urb_pending_list);
spin_lock_init(&priv->rx_urb_lock);
- INIT_WORK(&priv->rx_urb_wq, rtl8xxxu_rx_urb_work);
+ INIT_DELAYED_WORK(&priv->rx_urb_wq, rtl8xxxu_rx_urb_work);
INIT_DELAYED_WORK(&priv->ra_watchdog, rtl8xxxu_watchdog_callback);
INIT_WORK(&priv->update_beacon_work, rtl8xxxu_update_beacon_work_callback);
skb_queue_head_init(&priv->c2hcmd_queue);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0335/1167] crypto: qat - hold cfg->lock when accessing config sections
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (332 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0334/1167] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0336/1167] serial: txx9: Drop noop probe function and dangerous remove callback Greg Kroah-Hartman
` (323 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ahsan Atta, Giovanni Cabiddu,
Herbert Xu, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahsan Atta <ahsan.atta@intel.com>
[ Upstream commit cb3a1364fed9ea7b063e3ae026177a145abb5940 ]
adf_cfg_sec_find() walks the per-device section list without holding
cfg->lock, and the returned section pointer is used later under the
lock. A concurrent section deletion under cfg->lock
(adf_cfg_del_all_except() on device down, or adf_cfg_dev_remove() on
removal) can free the section first, leading to a use-after-free.
The debugfs dev_cfg reader has the same problem: qat_dev_cfg_show()
walks both the section list and each section's param_head under the
global qat_cfg_read_lock mutex, not the per-device cfg->lock used by the
add and delete paths, so the two do not serialise. Updating an existing
key frees the old key_val under cfg->lock, so even a config write
concurrent with an open dev_cfg read can free an entry mid-walk, a wider
window than section deletion alone.
Take cfg->lock around the section lookup in adf_cfg_add_key_value_param()
and around the lookup and insert in adf_cfg_section_add(), and use
down_read()/up_read(&cfg->lock) in the debugfs start/stop callbacks.
Remove the now-unused qat_cfg_read_lock.
While here, return -ENOENT rather than -EFAULT when the section is not
found; EFAULT (bad userspace address) is not meaningful for this case.
Fixes: d8cba25d2c68 ("crypto: qat - Intel(R) QAT driver framework")
Signed-off-by: Ahsan Atta <ahsan.atta@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ sashal: Context adjusted for missing kzalloc_obj() helper, keeping the older kzalloc(sizeof(*sec), GFP_KERNEL) allocation in adf_cfg_section_add(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/intel/qat/qat_common/adf_cfg.c | 49 +++++++++++--------
1 file changed, 29 insertions(+), 20 deletions(-)
diff --git a/drivers/crypto/intel/qat/qat_common/adf_cfg.c b/drivers/crypto/intel/qat/qat_common/adf_cfg.c
index 2cf102ad4ca82..5d0b66f8dab1b 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_cfg.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_cfg.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
/* Copyright(c) 2014 - 2020 Intel Corporation */
-#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/seq_file.h>
@@ -8,13 +7,11 @@
#include "adf_cfg.h"
#include "adf_common_drv.h"
-static DEFINE_MUTEX(qat_cfg_read_lock);
-
static void *qat_dev_cfg_start(struct seq_file *sfile, loff_t *pos)
{
struct adf_cfg_device_data *dev_cfg = sfile->private;
- mutex_lock(&qat_cfg_read_lock);
+ down_read(&dev_cfg->lock);
return seq_list_start(&dev_cfg->sec_list, *pos);
}
@@ -42,7 +39,9 @@ static void *qat_dev_cfg_next(struct seq_file *sfile, void *v, loff_t *pos)
static void qat_dev_cfg_stop(struct seq_file *sfile, void *v)
{
- mutex_unlock(&qat_cfg_read_lock);
+ struct adf_cfg_device_data *dev_cfg = sfile->private;
+
+ up_read(&dev_cfg->lock);
}
static const struct seq_operations qat_dev_cfg_sops = {
@@ -252,13 +251,10 @@ int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev,
enum adf_cfg_val_type type)
{
struct adf_cfg_device_data *cfg = accel_dev->cfg;
+ struct adf_cfg_section *section;
struct adf_cfg_key_val *key_val;
- struct adf_cfg_section *section = adf_cfg_sec_find(accel_dev,
- section_name);
char temp_val[ADF_CFG_MAX_VAL_LEN_IN_BYTES];
-
- if (!section)
- return -EFAULT;
+ int ret = 0;
key_val = kzalloc(sizeof(*key_val), GFP_KERNEL);
if (!key_val)
@@ -291,20 +287,28 @@ int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev,
* anything (the newly created key_val is freed).
*/
down_write(&cfg->lock);
+
+ section = adf_cfg_sec_find(accel_dev, section_name);
+ if (!section) {
+ kfree(key_val);
+ ret = -ENOENT;
+ goto unlock;
+ }
+
if (!adf_cfg_key_val_get(accel_dev, section_name, key, temp_val)) {
if (strncmp(temp_val, key_val->val, sizeof(temp_val))) {
adf_cfg_keyval_remove(key, section);
} else {
kfree(key_val);
- goto out;
+ goto unlock;
}
}
adf_cfg_keyval_add(key_val, section);
-out:
+unlock:
up_write(&cfg->lock);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(adf_cfg_add_key_value_param);
@@ -322,21 +326,26 @@ EXPORT_SYMBOL_GPL(adf_cfg_add_key_value_param);
int adf_cfg_section_add(struct adf_accel_dev *accel_dev, const char *name)
{
struct adf_cfg_device_data *cfg = accel_dev->cfg;
- struct adf_cfg_section *sec = adf_cfg_sec_find(accel_dev, name);
+ struct adf_cfg_section *sec;
+ int ret = 0;
- if (sec)
- return 0;
+ down_write(&cfg->lock);
+
+ if (adf_cfg_sec_find(accel_dev, name))
+ goto unlock;
sec = kzalloc(sizeof(*sec), GFP_KERNEL);
- if (!sec)
- return -ENOMEM;
+ if (!sec) {
+ ret = -ENOMEM;
+ goto unlock;
+ }
strscpy(sec->name, name, sizeof(sec->name));
INIT_LIST_HEAD(&sec->param_head);
- down_write(&cfg->lock);
list_add_tail(&sec->list, &cfg->sec_list);
+unlock:
up_write(&cfg->lock);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(adf_cfg_section_add);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0336/1167] serial: txx9: Drop noop probe function and dangerous remove callback
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (333 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0335/1167] crypto: qat - hold cfg->lock when accessing config sections Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0337/1167] serial: sh-sci: Unregister UART on sysfs setup failure Greg Kroah-Hartman
` (322 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Atsushi Nemoto, Geert Uytterhoeven,
Andy Shevchenko, Uwe Kleine-König , Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
[ Upstream commit 22c6a6ac74c2434735638e7ef1101597ae263aec ]
The only platform device that can be bound to the driver is allocated by
the driver itself. That device doesn't have platdata, so the probe
function only consists of a loop that is never run and thus can be
dropped without loss of functionality.
The remove function then should better not undo things that were not
done in the first place. That happens because serial_txx9_init() calls
serial_txx9_register_ports() with the created platform device and so
up->dev == &dev->dev evaluates to true and uart_remove_one_port() is
called twice for each port.
So let serial_txx9_exit() undo exactly what serial_txx9_init() does and
remove the useless respectively wrong functions.
Fixes: 0970769aceb9 ("[SERIAL] serial_txx9 driver update")
Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/cd4fce2cef14907ebe4713c147f8896924380e44.1786697789.git.u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ sashal: Adjusted for the older API where the deleted serial_txx9_remove() returns int instead of void; all added code matches upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/serial_txx9.c | 56 ++------------------------------
1 file changed, 3 insertions(+), 53 deletions(-)
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c
index be08fb6f749c8..0c7267d78545e 100644
--- a/drivers/tty/serial/serial_txx9.c
+++ b/drivers/tty/serial/serial_txx9.c
@@ -1008,7 +1008,8 @@ static void serial_txx9_unregister_port(int line)
struct uart_port *uart = &serial_txx9_ports[line];
mutex_lock(&serial_txx9_mutex);
- uart_remove_one_port(&serial_txx9_reg, uart);
+ if (uart->iobase || uart->mapbase)
+ uart_remove_one_port(&serial_txx9_reg, uart);
uart->flags = 0;
uart->type = PORT_UNKNOWN;
uart->iobase = 0;
@@ -1018,53 +1019,6 @@ static void serial_txx9_unregister_port(int line)
mutex_unlock(&serial_txx9_mutex);
}
-/*
- * Register a set of serial devices attached to a platform device.
- */
-static int serial_txx9_probe(struct platform_device *dev)
-{
- struct uart_port *p = dev_get_platdata(&dev->dev);
- struct uart_port port;
- int ret, i;
-
- memset(&port, 0, sizeof(struct uart_port));
- for (i = 0; p && p->uartclk != 0; p++, i++) {
- port.iobase = p->iobase;
- port.membase = p->membase;
- port.irq = p->irq;
- port.uartclk = p->uartclk;
- port.iotype = p->iotype;
- port.flags = p->flags;
- port.mapbase = p->mapbase;
- port.dev = &dev->dev;
- port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_TXX9_CONSOLE);
- ret = serial_txx9_register_port(&port);
- if (ret < 0) {
- dev_err(&dev->dev, "unable to register port at index %d "
- "(IO%lx MEM%llx IRQ%d): %d\n", i,
- p->iobase, (unsigned long long)p->mapbase,
- p->irq, ret);
- }
- }
- return 0;
-}
-
-/*
- * Remove serial ports registered against a platform device.
- */
-static int serial_txx9_remove(struct platform_device *dev)
-{
- int i;
-
- for (i = 0; i < UART_NR; i++) {
- struct uart_port *up = &serial_txx9_ports[i];
-
- if (up->dev == &dev->dev)
- serial_txx9_unregister_port(i);
- }
- return 0;
-}
-
#ifdef CONFIG_PM
static int serial_txx9_suspend(struct platform_device *dev, pm_message_t state)
{
@@ -1096,8 +1050,6 @@ static int serial_txx9_resume(struct platform_device *dev)
#endif
static struct platform_driver serial_txx9_plat_driver = {
- .probe = serial_txx9_probe,
- .remove = serial_txx9_remove,
#ifdef CONFIG_PM
.suspend = serial_txx9_suspend,
.resume = serial_txx9_resume,
@@ -1251,9 +1203,7 @@ static void __exit serial_txx9_exit(void)
platform_driver_unregister(&serial_txx9_plat_driver);
platform_device_unregister(serial_txx9_plat_devs);
for (i = 0; i < UART_NR; i++) {
- struct uart_port *up = &serial_txx9_ports[i];
- if (up->iobase || up->mapbase)
- uart_remove_one_port(&serial_txx9_reg, up);
+ serial_txx9_unregister_port(i);
}
uart_unregister_driver(&serial_txx9_reg);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0337/1167] serial: sh-sci: Unregister UART on sysfs setup failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (334 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0336/1167] serial: txx9: Drop noop probe function and dangerous remove callback Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0338/1167] bpf: Keep target extended until its last freplace link detaches Greg Kroah-Hartman
` (321 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit c5b33c86d86da3ccff8c05e2a28719e3ec933f70 ]
sci_probe_single() registers the UART port before sci_probe() creates
the RX FIFO tuning attributes. If either device_create_file() call
fails, probe returns an error without removing the port from the serial
core. Device-managed resources are then released while the port remains
registered.
Unregister the UART port before returning either sysfs creation error.
If the second attribute fails, remove the first attribute before
unregistering the port. Keep the existing probe failure policy and leave
the successful initialization path unchanged.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260911031500.5745-1-mhun512@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ sashal: Split the single upstream hunk into two, since this tree has two separate if blocks for the sysfs attributes, and adjusted the trailing context because a different function follows sci_probe(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/sh-sci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 4becdd1b90f92..bbd0d0ae782b2 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3512,7 +3512,7 @@ static int sci_probe(struct platform_device *dev)
if (sp->port.fifosize > 1) {
ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_trigger);
if (ret)
- return ret;
+ goto err_remove_port;
}
if (sp->port.type == PORT_SCIFA || sp->port.type == PORT_SCIFB ||
sp->port.type == PORT_HSCIF) {
@@ -3522,7 +3522,7 @@ static int sci_probe(struct platform_device *dev)
device_remove_file(&dev->dev,
&dev_attr_rx_fifo_trigger);
}
- return ret;
+ goto err_remove_port;
}
}
@@ -3532,6 +3532,10 @@ static int sci_probe(struct platform_device *dev)
sci_ports_in_use |= BIT(dev_id);
return 0;
+
+err_remove_port:
+ uart_remove_one_port(&sci_uart_driver, &sp->port);
+ return ret;
}
static void sci_console_save(struct sci_port *s)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0338/1167] bpf: Keep target extended until its last freplace link detaches
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (335 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0337/1167] serial: sh-sci: Unregister UART on sysfs setup failure Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0339/1167] bpf: Look at frame 0 when telling async callback entries apart Greg Kroah-Hartman
` (320 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Chen, Jiri Olsa,
Kumar Kartikeya Dwivedi, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuan Chen <chenyuan@kylinos.cn>
[ Upstream commit c43c348a84460b003fa757dd43d8c89848ae220d ]
The is_extended / prog_array_member_cnt protocol introduced by commit
d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace")
keeps a prog extended by a freplace program out of prog_array maps, and
vice versa: once a tail call re-enters an extended subprogram, its
tail_call_cnt resets on every execution and the loop never terminates.
But is_extended is a plain boolean, while one target prog can carry
several freplace links at the same time, one on its entry and one on a
global subprogram. __bpf_trampoline_unlink_prog() cleared is_extended
whenever *any* freplace link detached, so detaching one of two links
re-armed the unbounded loop through the remaining one.
Replace the is_extended boolean with a count of the freplace links
attached to each target prog, so the target stays extended until its
last link detaches. Also rename bpf_freplace_check_tgt_prog() to
bpf_freplace_link_tgt_prog(), as the helper has never been a pure
check: it reserves the target prog on success.
Fixes: d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace")
Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20260924023737.1140521-2-chenyuan_fl@163.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
[ sashal: Replaced bool is_extended with u16 freplace_link_cnt in the same struct slot, and adjusted hunk context for the older bpf_tramp_link/link->link.prog naming. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/bpf.h | 4 ++--
kernel/bpf/arraymap.c | 2 +-
kernel/bpf/trampoline.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 64fd49b68725c..79e7005de178c 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1452,9 +1452,9 @@ struct bpf_prog_aux {
bool tail_call_reachable;
bool xdp_has_frags;
bool changes_pkt_data;
- bool is_extended; /* true if extended by freplace program */
+ u16 freplace_link_cnt; /* counts freplace links extending this prog */
u64 prog_array_member_cnt; /* counts how many times as member of prog_array */
- struct mutex ext_mutex; /* mutex for is_extended and prog_array_member_cnt */
+ struct mutex ext_mutex; /* mutex for freplace_link_cnt and prog_array_member_cnt */
/* BTF_KIND_FUNC_PROTO for valid attach_btf_id */
const struct btf_type *attach_func_proto;
/* function name for valid attach_btf_id */
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index ca135fa407b85..30d81ee37b859 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -921,7 +921,7 @@ static void *prog_fd_array_get_ptr(struct bpf_map *map,
}
mutex_lock(&prog->aux->ext_mutex);
- is_extended = prog->aux->is_extended;
+ is_extended = prog->aux->freplace_link_cnt > 0;
if (!is_extended)
prog->aux->prog_array_member_cnt++;
mutex_unlock(&prog->aux->ext_mutex);
diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
index 4eebb9e22d26e..7747708f13a63 100644
--- a/kernel/bpf/trampoline.c
+++ b/kernel/bpf/trampoline.c
@@ -515,7 +515,7 @@ static enum bpf_tramp_prog_type bpf_attach_type_to_tramp(struct bpf_prog *prog)
}
}
-static int bpf_freplace_check_tgt_prog(struct bpf_prog *tgt_prog)
+static int bpf_freplace_link_tgt_prog(struct bpf_prog *tgt_prog)
{
struct bpf_prog_aux *aux = tgt_prog->aux;
@@ -529,7 +529,7 @@ static int bpf_freplace_check_tgt_prog(struct bpf_prog *tgt_prog)
*/
return -EBUSY;
- aux->is_extended = true;
+ aux->freplace_link_cnt++;
return 0;
}
@@ -556,7 +556,7 @@ static int __bpf_trampoline_link_prog(struct bpf_tramp_link *link,
/* Cannot attach extension if fentry/fexit are in use. */
if (cnt)
return -EBUSY;
- err = bpf_freplace_check_tgt_prog(tgt_prog);
+ err = bpf_freplace_link_tgt_prog(tgt_prog);
if (err)
return err;
tr->extension_prog = link->link.prog;
@@ -611,7 +611,7 @@ static int __bpf_trampoline_unlink_prog(struct bpf_tramp_link *link,
tr->extension_prog->bpf_func, NULL);
tr->extension_prog = NULL;
guard(mutex)(&tgt_prog->aux->ext_mutex);
- tgt_prog->aux->is_extended = false;
+ tgt_prog->aux->freplace_link_cnt--;
return err;
}
hlist_del_init(&link->tramp_hlist);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0339/1167] bpf: Look at frame 0 when telling async callback entries apart
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (336 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0338/1167] bpf: Keep target extended until its last freplace link detaches Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0340/1167] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register Greg Kroah-Hartman
` (319 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Puranjay Mohan, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Puranjay Mohan <puranjay@kernel.org>
[ Upstream commit e55220162aae99622d9e80d4700e51c13a6f2a16 ]
push_async_cb() sets in_async_callback_fn and async_entry_cnt on the
callback's own frame, which is frame 0 of the fresh state it starts, and
setup_func_entry() copies neither, so a subprog called by the callback
carries neither. Two places read them from the innermost frame instead.
is_state_visited() skips the infinite loop check when two states differ
in async_entry_cnt, because seeing the same state on a second entry into
an async callback is not a loop. A callback which re-arms itself and
calls a subprog therefore compares the two entries at a loop inside that
subprog, where the innermost frame is the subprog's and has no flag set,
and the state is rejected:
infinite loop detected at insn 60
push_callback_call() numbers a new entry as the caller's count plus one.
When the callback re-arms itself from a subprog, the caller is that
subprog's frame with a count of 0, so every entry is numbered 1, the
check above never sees a difference, and a loop anywhere in such a
callback is rejected the same way.
Read the flag and the count from frame 0 in both places. A loop within a
single entry still has a matching count and is still caught, and frame 0
of a non-async state does not have the flag set, so nothing else changes.
The two other readers are already correct: check_return_code() reads
frame[0], and the one in do_check() is reached only after an early return
for curframe != 0.
Fixes: bfc6bb74e4f1 ("bpf: Implement verifier support for validation of async callbacks.")
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260924162609.1746610-2-puranjay@kernel.org
[ sashal: Applied the upstream three-line change to is_state_visited() in verifier.c, since the upstream states.c file doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index cf54ebba430d8..5d28bd3ece833 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -9512,7 +9512,7 @@ static int push_callback_call(struct bpf_verifier_env *env, struct bpf_insn *ins
if (!async_cb)
return -EFAULT;
callee = async_cb->frame[0];
- callee->async_entry_cnt = caller->async_entry_cnt + 1;
+ callee->async_entry_cnt = state->frame[0]->async_entry_cnt + 1;
/* Convert bpf_timer_set_callback() args into timer callback args */
err = set_callee_state_cb(env, caller, callee, insn_idx);
@@ -16995,10 +16995,10 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
goto next;
if (sl->state.branches) {
- struct bpf_func_state *frame = sl->state.frame[sl->state.curframe];
+ struct bpf_func_state *frame = sl->state.frame[0];
if (frame->in_async_callback_fn &&
- frame->async_entry_cnt != cur->frame[cur->curframe]->async_entry_cnt) {
+ frame->async_entry_cnt != cur->frame[0]->async_entry_cnt) {
/* Different async_entry_cnt means that the verifier is
* processing another entry into async callback.
* Seeing the same state is not an indication of infinite
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0340/1167] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (337 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0339/1167] bpf: Look at frame 0 when telling async callback entries apart Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0341/1167] bpf: Dont converge a loop on an iterator that was created anew Greg Kroah-Hartman
` (318 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
AngeloGioacchino Del Regno, Mark Brown, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 6cddf6e56d2539fd13c0ee9dd817c4e06a967173 ]
devm_add_action_or_reset() is called after the loop that registers gate
clocks. If kzalloc() fails mid-loop, the function returns -ENOMEM before
that call, so cleanup is never registered and all previously registered
clocks leak permanently.
Move devm_add_action_or_reset() before the loop so cleanup is always
scheduled. The clock from the current (failing) iteration is not yet
stored in afe_priv->lookup[i], so it still needs an explicit
clk_unregister_gate() call.
Fixes: fd67a7a1a22c ("ASoC: mediatek: mt8188: fix use-after-free in driver remove path")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260907120310.135693-8-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Kept the tree's kzalloc(sizeof(*cl), GFP_KERNEL) in place of upstream's kzalloc_obj(*cl), since that helper doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
index c796ad8b62eea..fd73f9d9f41a1 100644
--- a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
+++ b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
@@ -166,7 +166,7 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)
struct mt8188_afe_private *afe_priv = afe->platform_priv;
struct clk *clk;
struct clk_lookup *cl;
- int i;
+ int i, ret;
afe_priv->lookup = devm_kcalloc(afe->dev, CLK_AUD_NR_CLK,
sizeof(*afe_priv->lookup),
@@ -175,6 +175,10 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)
if (!afe_priv->lookup)
return -ENOMEM;
+ ret = devm_add_action_or_reset(afe->dev, mt8188_audsys_clk_unregister, afe);
+ if (ret)
+ return ret;
+
for (i = 0; i < ARRAY_SIZE(aud_clks); i++) {
const struct afe_gate *gate = &aud_clks[i];
@@ -190,8 +194,10 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)
/* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */
cl = kzalloc(sizeof(*cl), GFP_KERNEL);
- if (!cl)
+ if (!cl) {
+ clk_unregister_gate(clk);
return -ENOMEM;
+ }
cl->clk = clk;
cl->con_id = gate->name;
@@ -202,5 +208,5 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)
afe_priv->lookup[i] = cl;
}
- return devm_add_action_or_reset(afe->dev, mt8188_audsys_clk_unregister, afe);
+ return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0341/1167] bpf: Dont converge a loop on an iterator that was created anew
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (338 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0340/1167] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0342/1167] bpf: Fix uninit read for non-fetch atomics on partially spilled slots Greg Kroah-Hartman
` (317 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 6f3ee3516305da3043f1787e3890381a54151730 ]
When the verifier reaches bpf_iter_*_next() in a state that is equal to
a state that is still being explored it concludes that the loop
converged, since an active iterator will be drained eventually.
states_equal() matches ids through idmap, so the same is concluded for
an iterator that was destroyed and created again since the old state:
bpf_iter_num_new(&it, 0, 10);
loop:
if (bpf_ktime_get_ns())
goto remake;
next:
if (!bpf_iter_num_next(&it))
goto out;
goto loop;
remake:
bpf_iter_num_destroy(&it);
bpf_iter_num_new(&it, 0, 10);
goto next;
Such prog is accepted when the call of bpf_iter_num_next() is the first
prune point after bpf_iter_num_new() and it never returns. Otherwise
it's rejected with "infinite loop detected".
Require the iterator to have the same id in both states.
Fixes: 06accc8779c1 ("bpf: add support for open-coded iterator loops")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260924233130.1213812-8-alexei.starovoitov@gmail.com
[ sashal: Renamed the upstream states.c/bpf_is_state_visited() code to verifier.c/is_state_visited(), compared ref_obj_id instead of id, and added a NULL guard for old_iter when spi is out of range. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 5d28bd3ece833..a72d196bcbd29 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -17050,8 +17050,9 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
*/
if (is_iter_next_insn(env, insn_idx)) {
if (states_equal(env, &sl->state, cur, true)) {
- struct bpf_func_state *cur_frame;
+ struct bpf_func_state *cur_frame, *old_frame;
struct bpf_reg_state *iter_state, *iter_reg;
+ struct bpf_reg_state *old_iter;
int spi;
cur_frame = cur->frame[cur->curframe];
@@ -17065,7 +17066,17 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
*/
spi = __get_spi(iter_reg->off + iter_reg->var_off.value);
iter_state = &func(env, iter_reg)->stack[spi].spilled_ptr;
- if (iter_state->iter.state == BPF_ITER_STATE_ACTIVE) {
+ old_frame = sl->state.frame[iter_reg->frameno];
+ old_iter = spi < old_frame->allocated_stack / BPF_REG_SIZE ?
+ &old_frame->stack[spi].spilled_ptr : NULL;
+ /*
+ * states_equal() matches ids through idmap.
+ * The loop converged only if it's the same
+ * iterator. The one that was destroyed and
+ * created again starts from the beginning.
+ */
+ if (iter_state->iter.state == BPF_ITER_STATE_ACTIVE &&
+ old_iter && iter_state->ref_obj_id == old_iter->ref_obj_id) {
update_loop_entry(cur, &sl->state);
goto hit;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0342/1167] bpf: Fix uninit read for non-fetch atomics on partially spilled slots
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (339 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0341/1167] bpf: Dont converge a loop on an iterator that was created anew Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0343/1167] bpf: Fix uninit read for helper mem args " Greg Kroah-Hartman
` (316 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hao Sun, Kumar Kartikeya Dwivedi,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Sun <sunhao.th@gmail.com>
[ Upstream commit 5a84b4424db8ae07f0ac682ab031c37a91dce50b ]
check_stack_read_fixed_off() skips partial spill checks for non-fetch
atomics; the following prog can be loaded:
0: (b7) r1 = 1 ; R1=1
1: (63) *(u32 *)(r10 -8) = r1 ; R1=1 R10=fp0 fp-8=????1
2: (db) lock *(u64 *)(r10 -8) += r1 ; R1=1 R10=fp0 fp-8=mmmmmmmm
3: (79) r0 = *(u64 *)(r10 -8) ; R0=scalar() R10=fp0 fp-8=mmmmmmmm
4: (77) r0 >>= 32 ; R0=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
5: (95) exit
When test run:
retval=4294967295
Note fp-8 is ????1 at #1, yet it becomes fp-8=mmmmmmmm after the
non-fetching atomic add at #2; hence the high 32 bits are leaked.
Fix by applying the partial load check; after the patch, the
prog is rejected:
Verification failed: Memory Safety: Uninitialized stack read
Reason:
This rejected read uses 8 bytes at stack offset -8, but byte 4 in that range is uninitialized on
this path. Programs loaded with CAP_PERFMON can be allowed to read uninitialized stack bytes, but
this program is being rejected without that allowance.
At:
...
0 | (b7) r1 = 1
1 | (63) *(u32 *)(r10 -8) = r1
>>> 2 | (db) lock *(u64 *)(r10 -8) += r1
3 | (79) r0 = *(u64 *)(r10 -8)
4 | (77) r0 >>= 32
This affects CAP_BPF only.
Fixes: 354e8f1970f8 ("bpf: Support <8-byte scalar spill and refill")
Signed-off-by: Hao Sun <sunhao.th@gmail.com>
Link: https://lore.kernel.org/bpf/20260924131342.934290-1-sunhao.th@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
[ sashal: Moved the dst_regno < 0 early returns into the full-slot branch and after the partial-slot validation loop, since this tree's function body is shaped differently from upstream's. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index a72d196bcbd29..70ffa05a919d3 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -5027,10 +5027,10 @@ static int check_stack_read_fixed_off(struct bpf_verifier_env *env,
}
mark_reg_read(env, reg, reg->parent, REG_LIVE_READ64);
- if (dst_regno < 0)
- return 0;
-
if (!(off % BPF_REG_SIZE) && size == spill_size) {
+ if (dst_regno < 0)
+ return 0;
+
/* The earlier check_reg_arg() has decided the
* subreg_def for this insn. Save it first.
*/
@@ -5060,6 +5060,9 @@ static int check_stack_read_fixed_off(struct bpf_verifier_env *env,
return -EACCES;
}
+ if (dst_regno < 0)
+ return 0;
+
if (spill_cnt == size &&
tnum_is_const(reg->var_off) && reg->var_off.value == 0) {
__mark_reg_const_zero(&state->regs[dst_regno]);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0343/1167] bpf: Fix uninit read for helper mem args on partially spilled slots
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (340 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0342/1167] bpf: Fix uninit read for non-fetch atomics on partially spilled slots Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0344/1167] sysctl: unregister tables before freeing bitmap Greg Kroah-Hartman
` (315 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kumar Kartikeya Dwivedi, Hao Sun,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Sun <sunhao.th@gmail.com>
[ Upstream commit b3861495d2b2f7459cddf49e63fa0758ba430583 ]
check_stack_range_initialized() takes the spilled register path when
bpf_is_spilled_reg(ss) holds, which, however, only looks at the last
byte of the slot. Hence, a partially spilled scalar (on the lower part)
bypasses the check and the following loads:
0: (b7) r1 = 1 ; R1=1
1: (63) *(u32 *)(r10 -8) = r1 ; R1=1 R10=fp0 fp-8=????1
2: (18) r1 = 0x0 ; R1=map_ptr(map=rb,ks=0,vs=0)
4: (bf) r2 = r10 ; R2=fp0 R10=fp0
5: (07) r2 += -8 ; R2=fp-8
6: (b7) r3 = 8 ; R3=8
7: (b7) r4 = 0 ; R4=0
8: (85) call bpf_ringbuf_output#130
...
When executed, it dumps the uninit four bytes:
RINGBUF: 01 00 00 00 ff ff ff ff
This is the same root cause as the non-fetch atomic case fixed in
commit 5a84b4424db8 ("bpf: Fix uninit read for non-fetch atomics on
partially spilled slots").
Fix by only taking the spilled register path for the bytes marked
STACK_SPILL, so the rest of the slot goes through the usual checks.
Fixes: 354e8f1970f8 ("bpf: Support <8-byte scalar spill and refill")
Suggested-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Hao Sun <sunhao.th@gmail.com>
Link: https://lore.kernel.org/bpf/20260925082814.1554771-1-sunhao.th@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 70ffa05a919d3..687be68c728a9 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -7368,7 +7368,12 @@ static int check_stack_range_initialized(
goto mark;
}
- if (is_spilled_reg(&state->stack[spi]) &&
+ /*
+ * Only the bytes marked STACK_SPILL hold the spilled register.
+ * The rest of a narrowly spilled slot keeps its previous type
+ * and must be initialized on its own.
+ */
+ if (*stype == STACK_SPILL &&
(state->stack[spi].spilled_ptr.type == SCALAR_VALUE ||
env->allow_ptr_leaks)) {
if (clobber) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0344/1167] sysctl: unregister tables before freeing bitmap
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (341 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0343/1167] bpf: Fix uninit read for helper mem args " Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0345/1167] ACPI: PCC: Free channel on OpRegion deactivation Greg Kroah-Hartman
` (314 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yibo Tan, Joel Granados, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yibo Tan <lhfff@tju.edu.cn>
[ Upstream commit 238dfe02fb0a9f72d7fd275d74ce80f13923ef31 ]
The table registered for bitmap_0001 retains a pointer to
test_data.bitmap_0001. unregister_sysctl_table() prevents new handlers
from starting and waits for active handlers to finish.
test_sysctl_exit() currently frees the bitmap before unregistering the
table. A concurrent read during module removal can therefore enter
proc_do_large_bitmap() while the bitmap is freed. KASAN reports a
slab-use-after-free in _find_next_bit().
Unregister all tables before freeing the bitmap so the unregister rundown
provides the required lifetime boundary.
The unmodified module reproduced the use-after-free in three KASAN runs.
With this change, three runs each completed 100 load, read and unload race
rounds without a kernel diagnostic.
Fixes: 2ea622b887e7 ("tools/testing/selftests/sysctl/sysctl.sh: add proc_do_large_bitmap() test case")
Assisted-by: LLM
Signed-off-by: Yibo Tan <lhfff@tju.edu.cn>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/test_sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_sysctl.c b/lib/test_sysctl.c
index 8036aa91a1cbd..a56e0cdd4c528 100644
--- a/lib/test_sysctl.c
+++ b/lib/test_sysctl.c
@@ -241,13 +241,13 @@ module_init(test_sysctl_init);
static void __exit test_sysctl_exit(void)
{
- kfree(test_data.bitmap_0001);
if (sysctl_test_headers.test_h_setup_node)
unregister_sysctl_table(sysctl_test_headers.test_h_setup_node);
if (sysctl_test_headers.test_h_mnt)
unregister_sysctl_table(sysctl_test_headers.test_h_mnt);
if (sysctl_test_headers.test_h_mnterror)
unregister_sysctl_table(sysctl_test_headers.test_h_mnterror);
+ kfree(test_data.bitmap_0001);
}
module_exit(test_sysctl_exit);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0345/1167] ACPI: PCC: Free channel on OpRegion deactivation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (342 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0344/1167] sysctl: unregister tables before freeing bitmap Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0346/1167] x86/fpu: Fix potential underflow in xstate_calculate_size() Greg Kroah-Hartman
` (313 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Huisong Li, Sudeep Holla,
Rafael J. Wysocki, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
[ Upstream commit fa9c7ee692988edddc1da74bc5257d53dd3c7130 ]
ACPICA calls the address space setup callback with
ACPI_REGION_DEACTIVATE when a PCC OperationRegion is torn down.
The PCC setup callback currently allocates a fresh pcc_data and requests
the mailbox channel before looking at the function argument. If ACPICA
deactivates a region, this can leave the existing region context and
mailbox channel unreleased, and may also request a channel during
teardown.
Handle ACPI_REGION_DEACTIVATE before allocation. Free the PCC mailbox
channel, release the region context and clear the context pointer.
Fixes: 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype")
Reviewed-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Link: https://patch.msgid.link/20260922144302.3847593-4-sudeep.holla@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: Replaced kzalloc_obj(*data) with kzalloc(sizeof(*data), GFP_KERNEL) because the kzalloc_obj() helper doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/acpi_pcc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
index 683924a708ba0..04bb232603965 100644
--- a/drivers/acpi/acpi_pcc.c
+++ b/drivers/acpi/acpi_pcc.c
@@ -55,6 +55,19 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
struct pcc_mbox_chan *pcc_chan;
acpi_status ret;
+ if (function == ACPI_REGION_DEACTIVATE) {
+ data = *region_context;
+ if (data) {
+ pcc_mbox_free_channel(data->pcc_chan);
+ kfree(data);
+ *region_context = NULL;
+ }
+ return AE_OK;
+ }
+
+ if (function != ACPI_REGION_ACTIVATE)
+ return AE_BAD_PARAMETER;
+
data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data)
return AE_NO_MEMORY;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0346/1167] x86/fpu: Fix potential underflow in xstate_calculate_size()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (343 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0345/1167] ACPI: PCC: Free channel on OpRegion deactivation Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0347/1167] tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit Greg Kroah-Hartman
` (312 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrei Vagin, Borislav Petkov (AMD),
Alexander Mikhalitsyn, Chang S. Bae, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrei Vagin <avagin@google.com>
[ Upstream commit f1751b220bc8a9bd2dc38ecf61f5c29f3826ace0 ]
xstate_calculate_size() calculates the size required for a given set of
xfeatures. It determines the topmost feature by finding the most
significant bit in xfeatures using fls64(xfeatures) - 1.
If xfeatures is 0, fls64(0) returns 0, and topmost becomes -1.
Previously, topmost was unsigned int, so -1 underflowed to UINT_MAX.
This caused the subsequent check `topmost <= XFEATURE_SSE` to fail, and
the code proceeded to access xstate arrays using topmost (UINT_MAX) as
an index, leading to an out-of-bounds access.
[ bp: Remove text explaining what the patch does. ]
Fixes: d6d6d50f1e80 ("x86/fpu/xstate: Consolidate size calculations")
Signed-off-by: Andrei Vagin <avagin@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Alexander Mikhalitsyn <alexander@mihalicyn.com>
Reviewed-by: Chang S. Bae <chang.seok.bae@intel.com>
Link: https://patch.msgid.link/20260925162454.1403405-6-avagin@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/fpu/xstate.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 255ff8f6c5270..e0bcbbf7267a3 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -559,12 +559,14 @@ static bool __init check_xstate_against_struct(int nr)
static unsigned int xstate_calculate_size(u64 xfeatures, bool compacted)
{
- unsigned int topmost = fls64(xfeatures) - 1;
- unsigned int offset = xstate_offsets[topmost];
+ unsigned int topmost, offset;
- if (topmost <= XFEATURE_SSE)
+ if (!(xfeatures & ~XFEATURE_MASK_FPSSE))
return sizeof(struct xregs_state);
+ topmost = fls64(xfeatures) - 1;
+ offset = xstate_offsets[topmost];
+
if (compacted)
offset = xfeature_get_offset(xfeatures, topmost);
return offset + xstate_sizes[topmost];
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0347/1167] tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (344 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0346/1167] x86/fpu: Fix potential underflow in xstate_calculate_size() Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0348/1167] netfilter: nfnetlink: Fix for interrupted hook dumps Greg Kroah-Hartman
` (311 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Danish Khateeb,
Thomas Weißschuh, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danish Khateeb <danishkhateeb03@gmail.com>
[ Upstream commit 929ea5b3481fdbbb419f3986703280fb2b819504 ]
Since commit feaf75658783 ("nolibc: fix fd_set type"), an fd_set is an
array of unsigned long, but the FD_* macros still build their masks as
an int or an unsigned int: 1 << n in FD_SET(), 1U << n in FD_CLR() and
FD_ISSET(), where n is the fd modulo 64 on 64-bit architectures. So:
- FD_SET() of an fd with n == 31 sets the bits for n = 31-63, as
1 << 31 is negative and gets sign-extended.
- For n >= 32 the shifts are undefined. x86-64, for instance, masks
the shift count, so FD_SET(40) and FD_ISSET(40) use the bit of fd 8.
- FD_CLR() zero-extends ~(1U << n), so it also clears the bits for
n = 32-63, whichever fd it is given.
select() on fd 40, for instance, fails with EBADF, or watches fd 8
instead if that one is open.
Build the masks from 1UL.
Fixes: feaf75658783 ("nolibc: fix fd_set type")
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Link: https://patch.msgid.link/20260925211600.119116-3-danishkhateeb03@gmail.com
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
[ sashal: Applied the three 1UL mask changes to fd_set macros in types.h because the upstream sys/select.h file doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/nolibc/types.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index ff422a6d3277e..4305c2d1cb08a 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -128,7 +128,7 @@ typedef struct {
int __fd = (fd); \
if (__fd >= 0) \
__set->fds[__fd / FD_SETIDXMASK] &= \
- ~(1U << (__fd & FD_SETBITMASK)); \
+ ~(1UL << (__fd & FD_SETBITMASK)); \
} while (0)
#define FD_SET(fd, set) do { \
@@ -136,7 +136,7 @@ typedef struct {
int __fd = (fd); \
if (__fd >= 0) \
__set->fds[__fd / FD_SETIDXMASK] |= \
- 1 << (__fd & FD_SETBITMASK); \
+ 1UL << (__fd & FD_SETBITMASK); \
} while (0)
#define FD_ISSET(fd, set) ({ \
@@ -145,7 +145,7 @@ typedef struct {
int __r = 0; \
if (__fd >= 0) \
__r = !!(__set->fds[__fd / FD_SETIDXMASK] & \
-1U << (__fd & FD_SETBITMASK)); \
+1UL << (__fd & FD_SETBITMASK)); \
__r; \
})
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0348/1167] netfilter: nfnetlink: Fix for interrupted hook dumps
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (345 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0347/1167] tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0349/1167] RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access Greg Kroah-Hartman
` (310 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Phil Sutter, Pablo Neira Ayuso,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Sutter <phil@nwl.cc>
[ Upstream commit d3950004ba90350bcdf414c5f804da277178564a ]
Handling of concurrent hook changes with a dump in progress was
problematic in nfnl_hook_dump and entirely broken in nfnl_hook_dump_nat.
Address all issues in a single patch to please the review LLM.
Introduce sequence numbers in struct netns_nf to replace pointer
value-based modification detection which may fail due to memory buffer
reuse. This also eliminates the need for most manual cb->seq updates and
excessive array index value checks.
Since nat hook updates are protected by a different mutex than others,
they have to bump their own sequence number. nfnl_hook_dump_nat
therefore open-codes what nl_dump_check_consistent does but bumps
cb->seq instead of setting NLM_F_DUMP_INTR flag.
Dumps of many nat hooks was entirely broken since the array index was
not (re)stored. Use cb->args[1] for that and make sure it is reset upon
completion as the same dump may loop over multiple arrays of nat hooks.
In nfnl_hook_dump, don't signal NLM_F_DUMP_INTR if
nfnl_hook_entries_head returns error: This is a permanent condition
which does not change during a dump. It is already caught by
nfnl_hook_dump_start though, so should not happen anyway.
In general, access ops array pointer values using READ_ONCE since they
are assigned to using WRITE_ONCE.
Avoid setting NLM_F_DUMP_INTR flag in garbage memory by calling
nl_dump_check_consistent only for non-empty skbs. If not a single
netlink message was created, nfnetlink code will take care of setting
the flag.
Fixes: e2cf17d3774c ("netfilter: add new hook nfnl subsystem")
Fixes: b010e2a4a9ac ("netfilter: nfnetlink_hook: Dump nat type chains")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[ sashal: Omitted the NAT-specific parts (nat_hook_base_seq and the nfnl_hook_dump_nat rework), since that dump code is absent here, and dropped the priority argument from nfnl_hook_dump_one(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netns/netfilter.h | 1 +
net/netfilter/core.c | 17 ++++++++++++++++-
net/netfilter/nfnetlink_hook.c | 20 +++++---------------
3 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/include/net/netns/netfilter.h b/include/net/netns/netfilter.h
index a6a0bf4a247e5..6de1006a48655 100644
--- a/include/net/netns/netfilter.h
+++ b/include/net/netns/netfilter.h
@@ -33,5 +33,6 @@ struct netns_nf {
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
unsigned int defrag_ipv6_users;
#endif
+ unsigned int hook_base_seq;
};
#endif
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index b00fc285b3349..061f4fbd6fdd2 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -393,6 +393,15 @@ static void nf_static_key_dec(const struct nf_hook_ops *reg, int pf)
#endif
}
+static void bump_hook_base_seq(struct net *net)
+{
+ unsigned int base_seq = READ_ONCE(net->nf.hook_base_seq);
+
+ while (++base_seq == 0)
+ ;
+ smp_store_release(&net->nf.hook_base_seq, base_seq);
+}
+
static int __nf_register_net_hook(struct net *net, int pf,
const struct nf_hook_ops *reg)
{
@@ -437,6 +446,7 @@ static int __nf_register_net_hook(struct net *net, int pf,
if (!IS_ERR(new_hooks)) {
hooks_validate(new_hooks);
rcu_assign_pointer(*pp, new_hooks);
+ bump_hook_base_seq(net);
}
mutex_unlock(&nf_hook_mutex);
@@ -490,6 +500,7 @@ static void __nf_unregister_net_hook(struct net *net, int pf,
{
struct nf_hook_entries __rcu **pp;
struct nf_hook_entries *p;
+ bool found;
pp = nf_hook_entry_head(net, pf, reg->hooknum, reg->dev);
if (!pp)
@@ -503,7 +514,8 @@ static void __nf_unregister_net_hook(struct net *net, int pf,
return;
}
- if (nf_remove_net_hook(p, reg)) {
+ found = nf_remove_net_hook(p, reg);
+ if (found) {
#ifdef CONFIG_NETFILTER_INGRESS
if (nf_ingress_hook(reg, pf))
net_dec_ingress_queue();
@@ -518,6 +530,8 @@ static void __nf_unregister_net_hook(struct net *net, int pf,
}
p = __nf_hook_entries_try_shrink(p, pp);
+ if (found)
+ bump_hook_base_seq(net);
mutex_unlock(&nf_hook_mutex);
if (!p)
return;
@@ -793,6 +807,7 @@ static int __net_init netfilter_net_init(struct net *net)
return -ENOMEM;
}
#endif
+ net->nf.hook_base_seq = 1;
return 0;
}
diff --git a/net/netfilter/nfnetlink_hook.c b/net/netfilter/nfnetlink_hook.c
index ade8ee1988b1e..9d9468ec700de 100644
--- a/net/netfilter/nfnetlink_hook.c
+++ b/net/netfilter/nfnetlink_hook.c
@@ -54,7 +54,6 @@ static int nf_netlink_dump_start_rcu(struct sock *nlsk, struct sk_buff *skb,
struct nfnl_dump_hook_data {
char devname[IFNAMSIZ];
- unsigned long headv;
u8 hook;
};
@@ -311,30 +310,24 @@ static int nfnl_hook_dump(struct sk_buff *nlskb,
unsigned int i = cb->args[0];
rcu_read_lock();
+ cb->seq = smp_load_acquire(&net->nf.hook_base_seq);
e = nfnl_hook_entries_head(family, ctx->hook, net, ctx->devname);
- if (!e)
+ if (!e || IS_ERR(e))
goto done;
- if (IS_ERR(e)) {
- cb->seq++;
- goto done;
- }
-
- if ((unsigned long)e != ctx->headv || i >= e->num_hook_entries)
- cb->seq++;
-
ops = nf_hook_entries_get_hook_ops(e);
for (; i < e->num_hook_entries; i++) {
- err = nfnl_hook_dump_one(nlskb, ctx, ops[i], family,
+ err = nfnl_hook_dump_one(nlskb, ctx, READ_ONCE(ops[i]), family,
cb->nlh->nlmsg_seq);
if (err)
break;
}
done:
- nl_dump_check_consistent(cb, nlmsg_hdr(nlskb));
+ if (nlskb->len > 0)
+ nl_dump_check_consistent(cb, nlmsg_hdr(nlskb));
rcu_read_unlock();
cb->args[0] = i;
return nlskb->len;
@@ -375,10 +368,7 @@ static int nfnl_hook_dump_start(struct netlink_callback *cb)
return -ENOMEM;
strscpy(ctx->devname, name, sizeof(ctx->devname));
- ctx->headv = (unsigned long)head;
ctx->hook = hooknum;
-
- cb->seq = 1;
cb->data = ctx;
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0349/1167] RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (346 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0348/1167] netfilter: nfnetlink: Fix for interrupted hook dumps Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0350/1167] RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent Greg Kroah-Hartman
` (309 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit 89abac4b60b708037595255ea2614b6967c86ee5 ]
pvrdma embeds a pvrdma_ring_state header directly inside the QP and SRQ
ring buffers, and the hypervisor writes cons_head into that header.
Pinning with access=0 does not force a private page copy (no
FOLL_WRITE), so the hypervisor may write into a shared page.
Pass IB_ACCESS_LOCAL_WRITE for all three rings. The SRQ ring_state is
not currently used by the driver but is pinned writable for consistency.
Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-4-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Replaced upstream's ib_umem_get_va() calls with ib_umem_get() (same arguments) in the QP and SRQ ring pinning, and re-aligned the continuation lines. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 6 ++++--
drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
index 98b2a0090bf2a..3017a4080235d 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
@@ -270,7 +270,8 @@ int pvrdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
/* set qp->sq.wqe_cnt, shift, buf_size.. */
qp->rumem = ib_umem_get(ibqp->device,
ucmd.rbuf_addr,
- ucmd.rbuf_size, 0);
+ ucmd.rbuf_size,
+ IB_ACCESS_LOCAL_WRITE);
if (IS_ERR(qp->rumem)) {
ret = PTR_ERR(qp->rumem);
goto err_qp;
@@ -282,7 +283,8 @@ int pvrdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
}
qp->sumem = ib_umem_get(ibqp->device, ucmd.sbuf_addr,
- ucmd.sbuf_size, 0);
+ ucmd.sbuf_size,
+ IB_ACCESS_LOCAL_WRITE);
if (IS_ERR(qp->sumem)) {
if (!is_srq)
ib_umem_release(qp->rumem);
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
index bdc2703532c6c..99748f0f296dd 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
@@ -146,7 +146,8 @@ int pvrdma_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init_attr,
goto err_srq;
}
- srq->umem = ib_umem_get(ibsrq->device, ucmd.buf_addr, ucmd.buf_size, 0);
+ srq->umem = ib_umem_get(ibsrq->device, ucmd.buf_addr, ucmd.buf_size,
+ IB_ACCESS_LOCAL_WRITE);
if (IS_ERR(srq->umem)) {
ret = PTR_ERR(srq->umem);
goto err_srq;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0350/1167] RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (347 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0349/1167] RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0351/1167] RDMA/mlx5: Set QP event handler before firmware QPC insertion Greg Kroah-Hartman
` (308 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit 4354ab7a85d1ddd45a8a3337227fad5b37b44902 ]
mlx5_ib_dev_res_init() returns -EOPNOTSUPP when the firmware XRC
capability is absent, failing driver probe on XRC-less devices.
Make XRC optional throughout the devr resource path: initialize cq_lock
and srq_lock unconditionally (needed for every QP creation), skip xrcd
allocation and the XRC-type placeholder SRQ (s0) when xrc=0, and guard
their cleanup paths accordingly.
Fixes: f4375443b786 ("RDMA/mlx5: Get XRCD number directly for the internal use")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-9-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Wrapped the XRC-guarded s0 SRQ creation and its failure path as upstream does, but kept the older single-line err=%d with ret in the mlx5_ib_err messages instead of err=%pe. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/main.c | 52 +++++++++++++++++++------------
1 file changed, 32 insertions(+), 20 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 2b7c1746a2836..86512e9627045 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -2949,7 +2949,7 @@ int mlx5_ib_dev_res_srq_init(struct mlx5_ib_dev *dev)
{
struct mlx5_ib_resources *devr = &dev->devr;
struct ib_srq_init_attr attr;
- struct ib_srq *s0, *s1;
+ struct ib_srq *s0 = NULL, *s1;
int ret = 0;
/*
@@ -2967,17 +2967,25 @@ int mlx5_ib_dev_res_srq_init(struct mlx5_ib_dev *dev)
if (ret)
goto unlock;
- memset(&attr, 0, sizeof(attr));
- attr.attr.max_sge = 1;
- attr.attr.max_wr = 1;
- attr.srq_type = IB_SRQT_XRC;
- attr.ext.cq = devr->c0;
-
- s0 = ib_create_srq(devr->p0, &attr);
- if (IS_ERR(s0)) {
- ret = PTR_ERR(s0);
- mlx5_ib_err(dev, "Couldn't create SRQ 0 for res init, err=%d\n", ret);
- goto unlock;
+ /*
+ * s0 is an XRC-type placeholder SRQ used as the default XRQN for
+ * XRC QPs. Skip it when XRC is absent; all devr->s0 accesses in
+ * qp.c are inside XRC QP paths that the verbs layer blocks before
+ * reaching this driver when xrc=0, so NULL is safe.
+ */
+ if (MLX5_CAP_GEN(dev->mdev, xrc)) {
+ memset(&attr, 0, sizeof(attr));
+ attr.attr.max_sge = 1;
+ attr.attr.max_wr = 1;
+ attr.srq_type = IB_SRQT_XRC;
+ attr.ext.cq = devr->c0;
+
+ s0 = ib_create_srq(devr->p0, &attr);
+ if (IS_ERR(s0)) {
+ ret = PTR_ERR(s0);
+ mlx5_ib_err(dev, "Couldn't create SRQ 0 for res init, err=%d\n", ret);
+ goto unlock;
+ }
}
memset(&attr, 0, sizeof(attr));
@@ -2989,7 +2997,8 @@ int mlx5_ib_dev_res_srq_init(struct mlx5_ib_dev *dev)
if (IS_ERR(s1)) {
ret = PTR_ERR(s1);
mlx5_ib_err(dev, "Couldn't create SRQ 1 for res init, err=%d\n", ret);
- ib_destroy_srq(s0);
+ if (s0)
+ ib_destroy_srq(s0);
goto unlock;
}
@@ -3006,8 +3015,11 @@ static int mlx5_ib_dev_res_init(struct mlx5_ib_dev *dev)
struct mlx5_ib_resources *devr = &dev->devr;
int ret;
+ mutex_init(&devr->cq_lock);
+ mutex_init(&devr->srq_lock);
+
if (!MLX5_CAP_GEN(dev->mdev, xrc))
- return -EOPNOTSUPP;
+ return 0;
ret = mlx5_cmd_xrcd_alloc(dev->mdev, &devr->xrcdn0, 0);
if (ret)
@@ -3019,9 +3031,6 @@ static int mlx5_ib_dev_res_init(struct mlx5_ib_dev *dev)
return ret;
}
- mutex_init(&devr->cq_lock);
- mutex_init(&devr->srq_lock);
-
return 0;
}
@@ -3032,10 +3041,13 @@ static void mlx5_ib_dev_res_cleanup(struct mlx5_ib_dev *dev)
/* After s0/s1 init, they are not unset during the device lifetime. */
if (devr->s1) {
ib_destroy_srq(devr->s1);
- ib_destroy_srq(devr->s0);
+ if (devr->s0)
+ ib_destroy_srq(devr->s0);
+ }
+ if (MLX5_CAP_GEN(dev->mdev, xrc)) {
+ mlx5_cmd_xrcd_dealloc(dev->mdev, devr->xrcdn1, 0);
+ mlx5_cmd_xrcd_dealloc(dev->mdev, devr->xrcdn0, 0);
}
- mlx5_cmd_xrcd_dealloc(dev->mdev, devr->xrcdn1, 0);
- mlx5_cmd_xrcd_dealloc(dev->mdev, devr->xrcdn0, 0);
/* After p0/c0 init, they are not unset during the device lifetime. */
if (devr->c0) {
ib_destroy_cq(devr->c0);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0351/1167] RDMA/mlx5: Set QP event handler before firmware QPC insertion
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (348 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0350/1167] RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0352/1167] perf test code-reading: Fix duplicate kernel maps and machine leak Greg Kroah-Hartman
` (307 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit 05a078c97eb0bb7158526dae414b853737692485 ]
Four QP creation paths assigned base->container_mibqp and
base->mqp.event after the firmware create call that inserts the QP into
dev->qp_table.tree. A firmware error EQE in that window reaches
qp->event() with a NULL pointer.
Move both assignments before the firmware call.
Also set ibqp.qp_num inside mlx5_qpc_create_qp() before
create_resource_common() so an EQE arriving early does not observe
qp_num==0.
In addition, add a WARN_ON_ONCE(!qp->event) guard in
rsc_event_notifier() as a safeguard for future regressions.
Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-14-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Context adapted because the create_raw_packet_qp_sq() call has no attrs argument in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/qp.c | 22 ++++++++++------------
drivers/infiniband/hw/mlx5/qpc.c | 10 ++++++++++
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 41807be47224c..9cb96f4d2ac65 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -1601,6 +1601,8 @@ static int create_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
if (err)
return err;
+ sq->base.container_mibqp = qp;
+ sq->base.mqp.event = mlx5_ib_qp_event;
err = create_raw_packet_qp_sq(dev, udata, sq, in, pd,
to_mcq(init_attr->send_cq));
if (err)
@@ -1612,9 +1614,6 @@ static int create_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
resp->sqn = sq->base.mqp.qpn;
resp->comp_mask |= MLX5_IB_CREATE_QP_RESP_MASK_SQN;
}
-
- sq->base.container_mibqp = qp;
- sq->base.mqp.event = mlx5_ib_qp_event;
}
if (qp->rq.wqe_cnt) {
@@ -2060,13 +2059,13 @@ static int create_xrc_tgt_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
}
base = &qp->trans_qp.base;
+ base->container_mibqp = qp;
+ base->mqp.event = mlx5_ib_qp_event;
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
kvfree(in);
if (err)
return err;
- base->container_mibqp = qp;
- base->mqp.event = mlx5_ib_qp_event;
if (MLX5_CAP_GEN(mdev, ece_support))
params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
@@ -2204,14 +2203,14 @@ static int create_dci(struct mlx5_ib_dev *dev, struct ib_pd *pd,
qp->flags &= ~IB_QP_CREATE_PCI_WRITE_END_PADDING;
}
+ base->container_mibqp = qp;
+ base->mqp.event = mlx5_ib_qp_event;
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
kvfree(in);
if (err)
goto err_create;
- base->container_mibqp = qp;
- base->mqp.event = mlx5_ib_qp_event;
if (MLX5_CAP_GEN(mdev, ece_support))
params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
@@ -2400,6 +2399,8 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
qp->flags &= ~IB_QP_CREATE_PCI_WRITE_END_PADDING;
}
+ base->container_mibqp = qp;
+ base->mqp.event = mlx5_ib_qp_event;
if (init_attr->qp_type == IB_QPT_RAW_PACKET ||
qp->flags & IB_QP_CREATE_SOURCE_QPN) {
qp->raw_packet_qp.sq.ubuffer.buf_addr = ucmd->sq_buf_addr;
@@ -2413,8 +2414,6 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
if (err)
goto err_create;
- base->container_mibqp = qp;
- base->mqp.event = mlx5_ib_qp_event;
if (MLX5_CAP_GEN(mdev, ece_support))
params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
@@ -2543,14 +2542,13 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
MLX5_CAP_GEN(mdev, go_back_n))
MLX5_SET(qpc, qpc, retry_mode, MLX5_QP_RM_GO_BACK_N);
+ base->container_mibqp = qp;
+ base->mqp.event = mlx5_ib_qp_event;
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
kvfree(in);
if (err)
goto err_create;
- base->container_mibqp = qp;
- base->mqp.event = mlx5_ib_qp_event;
-
get_cqs(qp->type, attr->send_cq, attr->recv_cq,
&send_cq, &recv_cq);
spin_lock_irqsave(&dev->reset_flow_resource_lock, flags);
diff --git a/drivers/infiniband/hw/mlx5/qpc.c b/drivers/infiniband/hw/mlx5/qpc.c
index bba42790be37d..815c55f027c19 100644
--- a/drivers/infiniband/hw/mlx5/qpc.c
+++ b/drivers/infiniband/hw/mlx5/qpc.c
@@ -146,6 +146,8 @@ static int rsc_event_notifier(struct notifier_block *nb,
case MLX5_RES_RQ:
case MLX5_RES_SQ:
qp = (struct mlx5_core_qp *)common;
+ if (WARN_ON_ONCE(!qp->event))
+ goto out;
qp->event(qp, event_type);
/* Need to put resource in event handler */
return NOTIFY_OK;
@@ -258,6 +260,14 @@ int mlx5_qpc_create_qp(struct mlx5_ib_dev *dev, struct mlx5_core_qp *qp,
qp->uid = MLX5_GET(create_qp_in, in, uid);
qp->qpn = MLX5_GET(create_qp_out, out, qpn);
+ /* Set ibqp.qp_num before create_resource_common() inserts the QP into
+ * the radix tree and makes it visible to EQE processing. The
+ * assignment in create_qp() happens only after this function returns,
+ * leaving a window where an arriving EQE would observe qp_num == 0.
+ * create_qp() still overrides this with 0/1 for QP0/QP1, and sets it
+ * independently for DCT (which does not go through this function).
+ */
+ to_mibqp(qp)->ibqp.qp_num = qp->qpn;
err = create_resource_common(dev, qp, MLX5_RES_QP);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0352/1167] perf test code-reading: Fix duplicate kernel maps and machine leak
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (349 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0351/1167] RDMA/mlx5: Set QP event handler before firmware QPC insertion Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0353/1167] perf build: Clean libperf-gtk.so in make clean Greg Kroah-Hartman
` (306 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 58bf7b7af359d4c6f1af29fd8d2067bbcff1d8c7 ]
In do_test_code_reading(), machine__new_host(&host_env) already calls
machine__create_kernel_maps(machine). Calling
machine__create_kernel_maps(machine) a second time immediately
afterwards duplicates all kernel module maps in machine->kmaps, causing
dso__load_kcore()'s module validation (do_validate_kcore_modules()) to
fail and fall back to /proc/kallsyms.
Furthermore, when try_kcore is true and !have_kcore, returning
TEST_CODE_READING_NO_KCORE directly bypasses out_err, leaking the entire
struct machine, its kernel/module maps and DSOs, all kallsyms symbols,
and host_env.
Remove the redundant machine__create_kernel_maps() call, check for
!machine after machine__new_host(), and jump to out_err when returning
TEST_CODE_READING_NO_KCORE.
Fixes: 0fd4008ed755c52d ("perf test: Use machine__new_host in mmap thread code reading test")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: Dropped the host_env/perf_env__init() setup since this tree's machine__new_host() takes no arguments, keeping the manual machine->env = &perf_env placed after the new NULL check. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/code-reading.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index ff249555ca57a..dd5f668d86d63 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -579,13 +579,11 @@ static int do_test_code_reading(bool try_kcore)
pid = getpid();
machine = machine__new_host();
- machine->env = &perf_env;
-
- ret = machine__create_kernel_maps(machine);
- if (ret < 0) {
- pr_debug("machine__create_kernel_maps failed\n");
+ if (!machine) {
+ pr_debug("machine__new_host failed\n");
goto out_err;
}
+ machine->env = &perf_env;
/* Force the use of kallsyms instead of vmlinux to try kcore */
if (try_kcore)
@@ -603,8 +601,10 @@ static int do_test_code_reading(bool try_kcore)
have_kcore = dso__is_kcore(dso);
/* 2nd time through we just try kcore */
- if (try_kcore && !have_kcore)
- return TEST_CODE_READING_NO_KCORE;
+ if (try_kcore && !have_kcore) {
+ err = TEST_CODE_READING_NO_KCORE;
+ goto out_err;
+ }
/* No point getting kernel events if there is no kernel object */
if (!have_vmlinux && !have_kcore)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0353/1167] perf build: Clean libperf-gtk.so in make clean
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (350 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0352/1167] perf test code-reading: Fix duplicate kernel maps and machine leak Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0354/1167] cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only Greg Kroah-Hartman
` (305 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit fb0da4af899ab1d6a66d29b21189bda3c68c2ce0 ]
When GTK support was made opt-in (first via GTK2=1 and recently ported
to GTK4=1), $(OUTPUT)libperf-gtk.so is only added to ALL_PROGRAMS when
GTK4 is defined. As a result, running 'make clean' without GTK4=1 does
not remove $(OUTPUT)libperf-gtk.so.
Add $(OUTPUT)libperf-gtk.so explicitly to the core-progs clean list so
it is always removed by 'make clean'.
Fixes: 4751bddd3f983af2 ("perf tools: Make GTK2 support opt-in")
Closes: https://lore.kernel.org/linux-perf-users/CAP-5=fV6+mzN3Lf_mCAJ4aP42JFZsF55ekvt8XrX505xOWwrmA@mail.gmail.com/
Reported-by: Ian Rogers <irogers@google.com>
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: adjusted the core-progs clean line, which is a single long line in this tree rather than wrapped, by appending $(OUTPUT)libperf-gtk.so to the end. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/Makefile.perf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index ff72a0d9dea0c..36195f5013e5a 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -1158,7 +1158,7 @@ clean:: $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBSYMBOL)-clean $(
$(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-iostat $(LANG_BINDINGS)
$(Q)find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
$(Q)$(RM) $(OUTPUT).config-detected
- $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)$(LIBJVMTI).so
+ $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)$(LIBJVMTI).so $(OUTPUT)libperf-gtk.so
$(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
$(OUTPUT)util/intel-pt-decoder/inat-tables.c \
$(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0354/1167] cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (351 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0353/1167] perf build: Clean libperf-gtk.so in make clean Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0355/1167] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard Greg Kroah-Hartman
` (304 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Waiman Long, Ridong Chen,
Guopeng Zhang, Tejun Heo, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
[ Upstream commit 8a1c0f5c82843104d9bef2bc3726c89da70a9b91 ]
Commit f82f80426f7a ("sched/deadline: Ensure that updates to exclusive
cpusets don't break AC") adds a check in validate_change() to make
sure that there is enough bandwidth for SCHED_DEADLINE tasks if we
shrink a v1 exclusive cpuset that has CS_CPU_EXCLUSIVE flag set.
With the introduction of cpuset partition in cgroup v2, we keep setting
the CS_CPU_EXCLUSIVE flag for a partition root so that the SCHED_DEADLINE
check will continue to work as intended. However it turns out that the
current code isn't perfect and there are cases where a cpuset isn't
a valid partition root, but the exclusive flag is still incorrectly
set. This can leads to SCHED_DEADLINE check being incorrectly triggered
when there are deadline tasks in the system. This can result in unexpected
-EBUSY failure when making changes to cpuset control files. Fix that
by checking for a valid partition root for v2 and is_cpu_exclusive()
for v1. It is far easier and less cumbersome than to make sure that
the exclusive flag is only set for valid partition roots.
Even though commit a86ce68078b2 ("cgroup/cpuset: Extract out
CS_CPU_EXCLUSIVE & CS_SCHED_LOAD_BALANCE handling") is marked as a
commit to be fixed, the problem may exist before that.
Fixes: a86ce68078b2 ("cgroup/cpuset: Extract out CS_CPU_EXCLUSIVE & CS_SCHED_LOAD_BALANCE handling")
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Ridong Chen <ridong.chen@linux.dev>
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ sashal: Replaced upstream's cpuset_v2() with cgroup_subsys_on_dfl(cpuset_cgrp_subsys), and adapted to the older condition, which lacked is_sched_load_balance() and used cpus_allowed. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 7ccc0c3845ccf..ad1727f3390e7 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -591,7 +591,9 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
* tasks.
*/
ret = -EBUSY;
- if (is_cpu_exclusive(cur) &&
+ if ((is_partition_valid(cur) ||
+ (!cgroup_subsys_on_dfl(cpuset_cgrp_subsys) &&
+ is_cpu_exclusive(cur))) &&
!cpuset_cpumask_can_shrink(cur->cpus_allowed,
trial->cpus_allowed))
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0355/1167] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (352 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0354/1167] cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0356/1167] ALSA: usb-audio: Fix UAC2 mixer unit request handling Greg Kroah-Hartman
` (303 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Venkat Rao Bagalkote,
Mukesh Kumar Chaurasiya, Shrikanth Hegde, Madhavan Srinivasan,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
[ Upstream commit 644ffb02746690c0ebfe143e066f81c9bde2975e ]
radix_enabled() uses a jump label which is only valid after
setup_feature_keys() is called. Before that point, on a pSeries
hash guest, early_check_vec5() clears MMU_FTR_TYPE_RADIX in
cur_cpu_spec->mmu_features, but the jump label has not yet been patched,
so radix_enabled() incorrectly returns true.
The dangerous usage window where it goes wrong in early_setup():
early_setup:
configure_exceptions();
<exceptions can happen now, and handler enter/exit can be invoked>
<those could use radix_enabled(), which returns stale true>
setup_feature_keys();
<jump labels set up; post this it is safe to use radix_enabled()>
If an NMI occurs in this window, !radix_enabled() evaluates to false in
DEFINE_INTERRUPT_HANDLER_NMI. The handler fails to skip NMI entry in real
mode and attempts to access memory outside the Real Mode Area (RMA),
hanging the boot.
Since common interrupt wrappers do not have the context of early or late,
using early_radix_enabled() is the safer option. It does a plain bitmask
check against cur_cpu_spec->mmu_features and is correct at all times.
Console logs from a pSeries HASH guest showing values across boot stages:
[ 0.000000] DEBUG: after early_init_devtree: early_radix_enabled=0 radix_enabled=1 (mismatch means NMI real-mode check is unsafe!)
[ 0.000000] DEBUG: after configure_exceptions (DANGEROUS WINDOW): early_radix_enabled=0 radix_enabled=1
[ 0.000000] DEBUG: after setup_feature_keys (jump labels initialized): early_radix_enabled=0 radix_enabled=0 (should now match!)
[ 0.057124] DEBUG: post secondary CPU bringup: early_radix_enabled=0 radix_enabled=0 (should match!)
Console logs from a RADIX guest showing values across boot stages:
[ 0.000000] DEBUG: after early_init_devtree: early_radix_enabled=1 radix_enabled=1 (mismatch means NMI real-mode check is unsafe!)
[ 0.000000] DEBUG: after configure_exceptions (DANGEROUS WINDOW): early_radix_enabled=1 radix_enabled=1
[ 0.000000] DEBUG: after setup_feature_keys (jump labels initialized): early_radix_enabled=1 radix_enabled=1 (should now match!)
[ 0.057016] DEBUG: post secondary CPU bringup: early_radix_enabled=1 radix_enabled=1 (should match!)
Add the missing #include <asm/mmu.h> in alphabetical order since
early_radix_enabled() is declared there.
Fixes: 8d0e21012743 ("powerpc/mce: Avoid nmi_enter/exit in real mode on pseries hash")
Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Reviewed-by: Mukesh Kumar Chaurasiya <mkchauras@gmail.com>
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260909123240.58786-1-venkat88@linux.ibm.com
[ sashal: Replaced radix_enabled() with early_radix_enabled() in the two inline functions interrupt_nmi_enter_prepare() and interrupt_nmi_exit_prepare(), since there is no DEFINE_INTERRUPT_HANDLER_NMI macro guard here, and adjusted the include context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/powerpc/include/asm/interrupt.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h
index 5f9d61b2159cc..4e2b1ca5253e2 100644
--- a/arch/powerpc/include/asm/interrupt.h
+++ b/arch/powerpc/include/asm/interrupt.h
@@ -72,6 +72,7 @@
#include <asm/firmware.h>
#include <asm/ftrace.h>
#include <asm/kprobes.h>
+#include <asm/mmu.h>
#include <asm/runlatch.h>
#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
@@ -326,7 +327,7 @@ static inline void interrupt_nmi_enter_prepare(struct pt_regs *regs, struct inte
*/
if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) &&
firmware_has_feature(FW_FEATURE_LPAR) &&
- !radix_enabled())
+ !early_radix_enabled())
return;
/*
@@ -355,7 +356,7 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
nmi_exit();
} else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) &&
firmware_has_feature(FW_FEATURE_LPAR) &&
- !radix_enabled()) {
+ !early_radix_enabled()) {
// no nmi_exit for a pseries hash guest taking a real mode exception
} else if (IS_ENABLED(CONFIG_KASAN)) {
// no nmi_exit for KASAN in real mode
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0356/1167] ALSA: usb-audio: Fix UAC2 mixer unit request handling
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (353 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0355/1167] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0357/1167] s390/ism: Zerorize dmb at allocation Greg Kroah-Hartman
` (302 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zipdox, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 0458d97859840506c3688a963dcd4f72b4a23083 ]
For a request for a Mixer Unit on UAC2 (also UAC3), the wValue is
different from UAC1 and an incompatible value must be passed.
Namely, UAC1 takes a word consisting of 1-based input channel in the
high byte and 1-based output channel in the low byte.
Meanwhile, UAC2/3 takes UAC2_MU_MIXER in the high byte and a MCN
(0-based bit position of input/output channels) in the low byte.
The current driver implementation blindly assumes the UAC1 way, hence
it would cause a firmware error.
This patch attempts to implement the conversion to UAC2 MCN at
get_ctl_value_v2() and snd_usb_mixer_set_ctl_value() for mixer units.
At the points above, the old wValue containing ICN and OCN is
converted to the corresponding MCN, and it's used as the proper
wValue.
Reported-by: Zipdox <zipdox@zipdox.net>
Closes: https://lore.kernel.org/d46fcac6-bd7e-4fc4-95e1-4e8d39f92ad3@zipdox.net
Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260930155356.348608-3-tiwai@suse.de
[ sashal: Added the two new mixer.h fields without the neighbouring get_cur_broken context, which this tree lacks, and adjusted the first mixer.c hunk's context to match the older get_ctl_value_v1(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/mixer.c | 23 +++++++++++++++++++++++
sound/usb/mixer.h | 2 ++
2 files changed, 25 insertions(+)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 5487657ece939..8229f4028db3c 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -340,6 +340,17 @@ static int get_ctl_value_v1(struct usb_mixer_elem_info *cval, int request,
return err;
}
+/* convert the given UAC1 wValue (ICN|OCN) to UAC2 MCN */
+static unsigned char to_mcn(const struct usb_mixer_elem_info *cval,
+ unsigned int validx)
+{
+ unsigned char m = (validx >> 8) & 0xff; /* 1-based input channel */
+ unsigned char v = validx & 0xff; /* 1-based output channel */
+
+ /* num_inputs * num_outputs is guaranteed to be < 256 */
+ return (m - 1) * cval->num_outputs + (v - 1);
+}
+
static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request,
int validx, int *value_ret)
{
@@ -352,6 +363,10 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request,
val_size = uac2_ctl_value_size(cval->val_type);
+ /* correct wValue for UAC2 mixer control with MCN */
+ if (cval->v2_mixer)
+ validx = (UAC2_MU_MIXER << 8) | to_mcn(cval, validx);
+
if (request == UAC_GET_CUR) {
bRequest = UAC2_CS_CUR;
size = val_size;
@@ -476,6 +491,10 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
}
request = UAC2_CS_CUR;
+
+ /* correct wValue for UAC2 mixer control with MCN */
+ if (cval->v2_mixer)
+ validx = (UAC2_MU_MIXER << 8) | to_mcn(cval, validx);
}
value_set = convert_bytes_value(cval, value_set);
@@ -2203,6 +2222,10 @@ static void build_mixer_unit_ctl(struct mixer_build *state,
snd_usb_mixer_elem_init_std(&cval->head, state->mixer, unitid);
cval->control = in_ch + 1; /* based on 1 */
+ if (state->mixer->protocol == UAC_VERSION_2 ||
+ state->mixer->protocol == UAC_VERSION_3)
+ cval->v2_mixer = true;
+ cval->num_outputs = num_outs;
cval->val_type = USB_MIXER_S16;
for (i = 0; i < num_outs; i++) {
__u8 *c = uac_mixer_unit_bmControls(desc, state->mixer->protocol);
diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h
index 36cb4f7daee58..d9e8a0453d676 100644
--- a/sound/usb/mixer.h
+++ b/sound/usb/mixer.h
@@ -94,6 +94,8 @@ struct usb_mixer_elem_info {
int cache_val[MAX_CHANNELS];
u8 initialized;
u8 min_mute;
+ u8 num_outputs;
+ bool v2_mixer;
void *private_data;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0357/1167] s390/ism: Zerorize dmb at allocation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (354 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0356/1167] ALSA: usb-audio: Fix UAC2 mixer unit request handling Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0358/1167] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove Greg Kroah-Hartman
` (301 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandra Winter, Julian Ruess,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandra Winter <wintera@linux.ibm.com>
[ Upstream commit a0227fa24e8a2a0397cc4eb669731ff8d9161bbd ]
Sashiko reported [1] that 'Missing __GFP_ZERO in folio_alloc() causes
uninitialized kernel memory to be exposed in the receive message buffer'.
An ism dmb is receive-only, so the data is not leaked to a remote peer.
In general the smc kernel module (dibs client) will only push newly
received data to userspace. We still should not have uninitialized data
in a receive buffer.
Since
commit 750afb08ca71 ("cross-tree: phase out dma_zalloc_coherent()")
dma_alloc_coherent no longer required the __GFP_ZERO flag, but when
commit 83781384a96b ("s390/ism: Properly fix receive message buffer allocation")
switched to folio_alloc(), it should have added back the __GFP_ZERO flag.
Add __GFP_ZERO flag and state in dibs.h that register_dbm() provides
a zerorized buffer (dibs_lo already does).
Link: https://lore.kernel.org/linux-s390/20260903143746.A5CC41F00A3A@smtp.kernel.org/ [1]
Fixes: 83781384a96b ("s390/ism: Properly fix receive message buffer allocation")
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Julian Ruess <julianr@linux.ibm.com>
Link: https://patch.msgid.link/20260928151420.383105-1-wintera@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Adapted the hunk to the older driver, where ism_alloc_dmb() takes struct ism_dev/struct ism_dmb instead of dibs_* types, and dropped the dibs.h kernel-doc hunk because that file doesn't exist. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/net/ism_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c
index 183b2f274ebdd..4a76d6144f174 100644
--- a/drivers/s390/net/ism_drv.c
+++ b/drivers/s390/net/ism_drv.c
@@ -327,7 +327,8 @@ static int ism_alloc_dmb(struct ism_dev *ism, struct ism_dmb *dmb)
return -EINVAL;
folio = folio_alloc(GFP_KERNEL | __GFP_NOWARN | __GFP_NOMEMALLOC |
- __GFP_NORETRY, get_order(dmb->dmb_len));
+ __GFP_NORETRY | __GFP_ZERO,
+ get_order(dmb->dmb_len));
if (!folio) {
rc = -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0358/1167] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (355 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0357/1167] s390/ism: Zerorize dmb at allocation Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0359/1167] mm/memory_hotplug: fix missing rollback in __add_pages() Greg Kroah-Hartman
` (300 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Liu Dalin, Linus Walleij,
Alexandre Belloni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Dalin <liudalin@kylinsec.com.cn>
[ Upstream commit d41ee317c9907d714014d0d5e4726fbd6acf338e ]
The driver mixes devm_rtc_register_device() with manual clock
disabling in ftrtc010_rtc_remove(). Because the RTC device was
registered via devm, it remains registered until devres cleanup
runs after .remove() returns. An unprivileged process holding an
open /dev/rtc0 file descriptor could issue ioctl(RTC_RD_TIME)
during this window, triggering MMIO reads on clock-gated hardware
and causing a synchronous external abort.
Replace devm_clk_get() + clk_prepare_enable() with
devm_clk_get_enabled() to tie clock lifecycle to devres. Remove
the manual .remove() callback and the corresponding error handling
labels in ftrtc010_rtc_probe().
Fixes: 1d61d2592c1f ("rtc: ftrtc010: Rename to Faraday FTRTC010")
Assisted-by: Sashiko AI [static analysis]
Signed-off-by: Liu Dalin <liudalin@kylinsec.com.cn>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Tested-by: Liu Dalin <liudalin@kylinsec.com.cn>
Link: https://patch.msgid.link/0238203A74C9B9F6+20260827080320.3351155-3-liudalin@kylinsec.com.cn
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[ sashal: dropped the .remove_new line instead of upstream's .remove line, since this tree's platform driver still uses .remove_new for the void remove callback. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rtc/rtc-ftrtc010.c | 67 +++++++++-----------------------------
1 file changed, 16 insertions(+), 51 deletions(-)
diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c
index 29c2441c5927e..c989574b1fbc6 100644
--- a/drivers/rtc/rtc-ftrtc010.c
+++ b/drivers/rtc/rtc-ftrtc010.c
@@ -121,51 +121,33 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, rtc);
- rtc->pclk = devm_clk_get(dev, "PCLK");
- if (IS_ERR(rtc->pclk)) {
+ rtc->pclk = devm_clk_get_enabled(dev, "PCLK");
+ if (IS_ERR_OR_NULL(rtc->pclk)) {
dev_err(dev, "could not get PCLK\n");
- } else {
- ret = clk_prepare_enable(rtc->pclk);
- if (ret) {
- dev_err(dev, "failed to enable PCLK\n");
- return ret;
- }
+ return PTR_ERR_OR_ZERO(rtc->pclk);
}
- rtc->extclk = devm_clk_get(dev, "EXTCLK");
- if (IS_ERR(rtc->extclk)) {
+ rtc->extclk = devm_clk_get_enabled(dev, "EXTCLK");
+ if (IS_ERR_OR_NULL(rtc->extclk)) {
dev_err(dev, "could not get EXTCLK\n");
- } else {
- ret = clk_prepare_enable(rtc->extclk);
- if (ret) {
- dev_err(dev, "failed to enable EXTCLK\n");
- goto err_disable_pclk;
- }
+ return PTR_ERR_OR_ZERO(rtc->extclk);
}
rtc->rtc_irq = platform_get_irq(pdev, 0);
- if (rtc->rtc_irq < 0) {
- ret = rtc->rtc_irq;
- goto err_disable_extclk;
- }
+ if (rtc->rtc_irq < 0)
+ return rtc->rtc_irq;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- ret = -ENODEV;
- goto err_disable_extclk;
- }
+ if (!res)
+ return -ENODEV;
rtc->rtc_base = devm_ioremap(dev, res->start,
resource_size(res));
- if (!rtc->rtc_base) {
- ret = -ENOMEM;
- goto err_disable_extclk;
- }
+ if (!rtc->rtc_base)
+ return -ENOMEM;
rtc_dev = devm_rtc_allocate_device(dev);
- if (IS_ERR(rtc_dev)) {
- ret = PTR_ERR(rtc_dev);
- goto err_disable_extclk;
- }
+ if (IS_ERR(rtc_dev))
+ return PTR_ERR(rtc_dev);
rtc_dev->ops = &ftrtc010_rtc_ops;
@@ -180,29 +162,13 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, rtc->rtc_irq, ftrtc010_rtc_interrupt,
IRQF_SHARED, pdev->name, dev);
if (unlikely(ret))
- goto err_disable_extclk;
+ return ret;
ret = devm_rtc_register_device(rtc_dev);
if (ret)
- goto err_disable_extclk;
+ return ret;
return 0;
-
-err_disable_extclk:
- clk_disable_unprepare(rtc->extclk);
-err_disable_pclk:
- clk_disable_unprepare(rtc->pclk);
- return ret;
-}
-
-static void ftrtc010_rtc_remove(struct platform_device *pdev)
-{
- struct ftrtc010_rtc *rtc = platform_get_drvdata(pdev);
-
- if (!IS_ERR(rtc->extclk))
- clk_disable_unprepare(rtc->extclk);
- if (!IS_ERR(rtc->pclk))
- clk_disable_unprepare(rtc->pclk);
}
static const struct of_device_id ftrtc010_rtc_dt_match[] = {
@@ -218,7 +184,6 @@ static struct platform_driver ftrtc010_rtc_driver = {
.of_match_table = ftrtc010_rtc_dt_match,
},
.probe = ftrtc010_rtc_probe,
- .remove_new = ftrtc010_rtc_remove,
};
module_platform_driver_probe(ftrtc010_rtc_driver, ftrtc010_rtc_probe);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0359/1167] mm/memory_hotplug: fix missing rollback in __add_pages()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (356 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0358/1167] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0364/1167] scsi: scsi_debug: Report the residual of a write Greg Kroah-Hartman
` (299 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Muchun Song, Lance Yang,
David Hildenbrand (Arm), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lance Yang <lance.yang@linux.dev>
[ Upstream commit c31bb839fb829958101250ee5acfa4f94fdb7ecd ]
__add_pages() returns on a sparse_add_section() failure without removing
the sections already added in the same request.
For memremap_pages(), the failed range is not counted in pgmap->nr_range,
so memunmap_pages() skips it. The sections already added in that range
retain their vmemmap mappings and subsection bits. Retrying a
section-aligned range can then fail with -EEXIST.
Save the initial PFN and remove [start_pfn, pfn) on failure. For a vmemmap
population failure, section_activate() already cleans up the current
section, so the rollback excludes it. If the first section fails,
__remove_pages() receives an empty range and does nothing.
Link: https://lore.kernel.org/all/BAD58999-1EDD-4A37-ABA0-DB1BD8AB3453@linux.dev/
Suggested-by: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Fixes: ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug")
Acked-by: Muchun Song <muchun.song@linux.dev>
Link: https://patch.msgid.link/20260930160432.5564-1-lance.yang@linux.dev
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Dropped the params->pgmap argument from the __remove_pages() rollback call, and adjusted the hunk context for the __ref on __add_pages(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memory_hotplug.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 08444c40ed650..931879ec2c96f 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -369,6 +369,7 @@ EXPORT_SYMBOL_GPL(pfn_to_online_page);
int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
struct mhp_params *params)
{
+ const unsigned long start_pfn = pfn;
const unsigned long end_pfn = pfn + nr_pages;
unsigned long cur_nr_pages;
int err;
@@ -402,8 +403,10 @@ int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
SECTION_ALIGN_UP(pfn + 1) - pfn);
err = sparse_add_section(nid, pfn, cur_nr_pages, altmap,
params->pgmap);
- if (err)
+ if (err) {
+ __remove_pages(start_pfn, pfn - start_pfn, altmap);
break;
+ }
cond_resched();
}
vmemmap_populate_print_last();
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0364/1167] scsi: scsi_debug: Report the residual of a write
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (357 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0359/1167] mm/memory_hotplug: fix missing rollback in __add_pages() Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0365/1167] scsi: scsi_debug: Do not write a partial physical block to a zoned device Greg Kroah-Hartman
` (298 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Martin K. Petersen (Oracle), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 7c000c4ad2c0a7b2da06ffe28f5a7489fc52ca2d ]
Documentation/scsi/scsi_mid_low_api.rst defines the residual as the length
of the data buffer less the number of bytes actually transferred, so a
write whose data buffer is larger than its transfer length leaves
one. resp_read_dt0() and resp_write_tape() report it, but the write paths
for a disk do not, so such a write completes with GOOD status and a
residual of zero while a READ of the same length into the same buffer
reports it correctly.
Report it in resp_write_dt0(), resp_write_scat() and resp_atomic_write().
resp_write_scat() differs twice over. Its data-out buffer also holds the
parameter list header and the LBA range descriptors, so what the command
consumed is sg_off rather than the bytes that the last range transferred;
and sg_off counts what was asked for rather than what was transferred, so
it can exceed the buffer and needs a guard. A command with no LBA range
descriptors or a buffer transfer length of zero transfers nothing, so the
whole buffer is residual. An error, real or injected, can end the command
after some ranges have been written, so the residual is reported on every
exit once the parameter list has been fetched.
Assisted-by: LLM
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-22-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
[ sashal: Dropped the resp_atomic_write() hunk (function absent), and adapted context to use sdeb_write_unlock() and the older mk_sense_buffer()/THRESHOLD_EXCEEDED names. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 0d5dce648ff33..df9cd0352cb31 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3699,6 +3699,9 @@ static int resp_write_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
"%s: write: cdb indicated=%u, IO sent=%d bytes\n",
my_name, num * sdebug_sector_size, ret);
+ if (ret < scsi_bufflen(scp))
+ scsi_set_resid(scp, scsi_bufflen(scp) - ret);
+
if (unlikely((sdebug_opts & SDEBUG_OPT_RECOV_DIF_DIX) &&
atomic_read(&sdeb_inject_pending))) {
if (sdebug_opts & SDEBUG_OPT_RECOVERED_ERR) {
@@ -3766,8 +3769,10 @@ static int resp_write_scat(struct scsi_cmnd *scp,
"Unprotected WR to DIF device\n");
}
}
- if ((num_lrd == 0) || (bt_len == 0))
+ if (num_lrd == 0 || bt_len == 0) {
+ scsi_set_resid(scp, scsi_bufflen(scp));
return 0; /* T10 says these do-nothings are not errors */
+ }
if (lbdof == 0) {
if (sdebug_verbose)
sdev_printk(KERN_INFO, scp->device,
@@ -3859,6 +3864,8 @@ static int resp_write_scat(struct scsi_cmnd *scp,
if (unlikely((sdebug_opts & SDEBUG_OPT_RECOV_DIF_DIX) &&
atomic_read(&sdeb_inject_pending))) {
+ /* This range has been written */
+ sg_off += num_by;
if (sdebug_opts & SDEBUG_OPT_RECOVERED_ERR) {
mk_sense_buffer(scp, RECOVERED_ERROR, THRESHOLD_EXCEEDED, 0);
atomic_set(&sdeb_inject_pending, 0);
@@ -3882,6 +3889,13 @@ static int resp_write_scat(struct scsi_cmnd *scp,
}
ret = 0;
err_out_unlock:
+ /*
+ * sg_off counts what the command asked for, which can exceed the
+ * buffer: lbdof is not validated against it, and a range is counted
+ * in full even if do_device_access() copied less.
+ */
+ if (scsi_bufflen(scp) > sg_off)
+ scsi_set_resid(scp, scsi_bufflen(scp) - sg_off);
sdeb_write_unlock(sip);
err_out:
kfree(lrdp);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0365/1167] scsi: scsi_debug: Do not write a partial physical block to a zoned device
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (358 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0364/1167] scsi: scsi_debug: Report the residual of a write Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0366/1167] scsi: scsi_debug: Advance the write pointer over the data written Greg Kroah-Hartman
` (297 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Martin K. Petersen (Oracle), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit b8fad9f02485f179e35bc4677386b6608d8cefb0 ]
do_device_access() copies one logical block at a time and stops at the
first short copy, so a data-out buffer smaller than the transfer length of
the command can leave part of a physical block written. An initiator can
arrange that with SG_IO.
That is acceptable everywhere but a sequential write required zone, where
ZBC-3 r06 (T10/BSR INCITS 579), 4.5.3.3.2, requires a write to end on a
physical block boundary.
For such a zone, stop at the last whole physical block that the buffer
holds. The bytes left over are not written, and are reported to the
initiator as part of the residual.
Assisted-by: LLM
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-24-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 0a7dff23a4e90..3be6f38d473d1 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3020,6 +3020,8 @@ static int do_device_access(struct sdeb_store_info *sip, struct scsi_cmnd *scp,
u64 block, rest = 0;
enum dma_data_direction dir;
struct scsi_data_buffer *sdb = &scp->sdb;
+ struct scsi_device *sdp = scp->device;
+ struct sdebug_dev_info *devip = (struct sdebug_dev_info *)sdp->hostdata;
u8 *fsp;
if (do_write) {
@@ -3035,6 +3037,25 @@ static int do_device_access(struct sdeb_store_info *sip, struct scsi_cmnd *scp,
return -1;
fsp = sip->storep;
+ /*
+ * A write to a sequential write required zone has to end on a physical
+ * block boundary, so if the data-out buffer does not hold all of the
+ * data that the command asks for, write up to the last whole physical
+ * block that it does hold. What is left over is reported as part of
+ * the residual.
+ */
+ if (do_write && sdebug_dev_is_zoned(devip)) {
+ struct sdeb_zone_state *zsp = zbc_zone(devip, lba);
+
+ if (zsp->z_type == ZBC_ZTYPE_SWR) {
+ u32 avail = (sdb->length - sg_skip)
+ >> ilog2(sdebug_sector_size);
+
+ if (avail < num)
+ num = round_down(avail, 1U << sdebug_physblk_exp);
+ }
+ }
+
block = do_div(lba, sdebug_store_sectors);
if (block + num > sdebug_store_sectors)
rest = block + num - sdebug_store_sectors;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0366/1167] scsi: scsi_debug: Advance the write pointer over the data written
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (359 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0365/1167] scsi: scsi_debug: Do not write a partial physical block to a zoned device Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0367/1167] iommu/arm-smmu-v3: Dont rb_erase() a never-inserted stream node Greg Kroah-Hartman
` (296 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Martin K. Petersen (Oracle), Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit cb2d2a7c80c62d1e5e476609706f29dd9584d0e0 ]
resp_write_dt0() and resp_write_scat() advance the write pointer of a
sequential write required zone by the transfer length of the command
without looking at what do_device_access() returned, which is -1 when the
data direction of the command does not match the operation, and a short
byte count when the data-out buffer is smaller than the transfer length. An
initiator can produce both with SG_IO.
The zone then describes more data than is on the medium, and a write at the
position where the data really ends is terminated with UNALIGNED WRITE
COMMAND, so the zone has to be reset before it can be written to again.
Advance the write pointer over the data that was written instead. As
do_device_access() does not write a partial physical block to such a zone,
that leaves the write pointer where a write can end.
Assisted-by: LLM
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-25-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
[ sashal: Context lines adapted to the older tree (scsi_debug_lbp(), sdeb_write_unlock(sip), and no group/atomic arguments in do_device_access()); the changed lines match upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3708,9 +3708,9 @@ static int resp_write_dt0(struct scsi_cm
ret = do_device_access(sip, scp, 0, lba, num, true);
if (unlikely(scsi_debug_lbp()))
map_region(sip, lba, num);
- /* If ZBC zone then bump its write pointer */
- if (sdebug_dev_is_zoned(devip))
- zbc_inc_wp(devip, lba, num);
+ /* If ZBC zone then bump its write pointer over the data written */
+ if (sdebug_dev_is_zoned(devip) && ret > 0)
+ zbc_inc_wp(devip, lba, ret >> ilog2(sdebug_sector_size));
sdeb_write_unlock(sip);
if (unlikely(-1 == ret))
return DID_ERROR << 16;
@@ -3870,9 +3870,10 @@ static int resp_write_scat(struct scsi_c
ret = do_device_access(sip, scp,
min_t(u64, sg_off, scsi_bufflen(scp)),
lba, num, true);
- /* If ZBC zone then bump its write pointer */
- if (sdebug_dev_is_zoned(devip))
- zbc_inc_wp(devip, lba, num);
+ /* If ZBC zone then bump its write pointer over the data written */
+ if (sdebug_dev_is_zoned(devip) && ret > 0)
+ zbc_inc_wp(devip, lba,
+ ret >> ilog2(sdebug_sector_size));
if (unlikely(scsi_debug_lbp()))
map_region(sip, lba, num);
if (unlikely(-1 == ret)) {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0367/1167] iommu/arm-smmu-v3: Dont rb_erase() a never-inserted stream node
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (360 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0366/1167] scsi: scsi_debug: Advance the write pointer over the data written Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0368/1167] soc: qcom: pmic_glink: Avoid losing early rpmsg probe Greg Kroah-Hartman
` (295 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nicolin Chen, Mostafa Saleh,
Will Deacon, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolin Chen <nicolinc@nvidia.com>
[ Upstream commit 2888520bdcbe0599cfc77b2fad8dc6c95505a3cb ]
arm_smmu_insert_master() skips inserting a stream whose StreamID duplicates
one the same master already owns (bridged PCI devices can present duplicate
IDs), leaving that master->streams[i].node zeroed and unlinked from the
smmu->streams rb-tree.
Both the insert error-rollback loop and arm_smmu_remove_master() then call
rb_erase() on every master->streams[i].node unconditionally. rb_erase() on
a zeroed node sees a NULL parent, treats the node as the tree root and sets
root->rb_node = NULL, silently emptying the whole SID tree and breaking SID
lookups (and DMA) for every other master on the SMMU.
Mark each node with RB_CLEAR_NODE() after sort_nonatomic() reorders the
array, since sorting relocates the entries and would leave the earlier
self-referential RB_CLEAR_NODE() pointer stale. An un-inserted node then
stays RB_EMPTY_NODE() and is skipped in both erase loops; inserted nodes
are linked by rb_find_add() and erased as before.
Fixes: b00d24997a11 ("iommu/arm-smmu-v3: Fix iommu_device_probe bug due to duplicated stream ids")
Assisted-by: LLM
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
[ sashal: Placed the RB_CLEAR_NODE() loop right after master->num_streams is set, since this tree has no sort() call, no up-front ID fill and no build_invs, and dropped the sort comment. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index b9b1703a0132c..3131f86f143c2 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -2611,6 +2611,9 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
return -ENOMEM;
master->num_streams = fwspec->num_ids;
+ for (i = 0; i < fwspec->num_ids; i++)
+ RB_CLEAR_NODE(&master->streams[i].node);
+
mutex_lock(&smmu->streams_mutex);
for (i = 0; i < fwspec->num_ids; i++) {
struct arm_smmu_stream *new_stream = &master->streams[i];
@@ -2646,7 +2649,9 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
if (ret) {
for (i--; i >= 0; i--)
- rb_erase(&master->streams[i].node, &smmu->streams);
+ if (!RB_EMPTY_NODE(&master->streams[i].node))
+ rb_erase(&master->streams[i].node,
+ &smmu->streams);
kfree(master->streams);
}
mutex_unlock(&smmu->streams_mutex);
@@ -2665,7 +2670,8 @@ static void arm_smmu_remove_master(struct arm_smmu_master *master)
mutex_lock(&smmu->streams_mutex);
for (i = 0; i < fwspec->num_ids; i++)
- rb_erase(&master->streams[i].node, &smmu->streams);
+ if (!RB_EMPTY_NODE(&master->streams[i].node))
+ rb_erase(&master->streams[i].node, &smmu->streams);
mutex_unlock(&smmu->streams_mutex);
kfree(master->streams);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0368/1167] soc: qcom: pmic_glink: Avoid losing early rpmsg probe
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (361 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0367/1167] iommu/arm-smmu-v3: Dont rb_erase() a never-inserted stream node Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0369/1167] drm/msm/a5xx: dont read the GPMU registers on GPUs without a GPMU Greg Kroah-Hartman
` (294 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Dmitry Baryshkov,
Bjorn Andersson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
[ Upstream commit 0c79a829af36a94143c747a0ab8f0a8563b17cfa ]
The PMIC GLINK rpmsg device can appear before the platform device has
finished probing. In that case pmic_glink_rpmsg_probe() sees
__pmic_glink as NULL and returns -ENODEV, which is treated as a fatal
probe failure for the rpmsg endpoint.
If this race is hit, pg->ept is never installed and PMIC GLINK clients
never receive the service-up notification. This may leave the system
with no Type-C functionality and without battery/power supply
management.
Return -EPROBE_DEFER when the rpmsg endpoint arrives before the platform
device is ready.
Fixes: 58ef4ece1e41 ("soc: qcom: pmic_glink: Introduce base PMIC GLINK driver")
Assisted-by: Codex:GPT-5.5
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260720-topic-pmic_glink_defer-v1-1-94c0f233f2f7@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
[ sashal: Adapted to the older locking style: the error is assigned with ret = dev_err_probe(..., -EPROBE_DEFER, ...) and goto out_unlock, instead of upstream's return dev_err_probe(...) under a scoped guard. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/qcom/pmic_glink.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c
index ae8bf1f4116a8..c23ee5cc4813c 100644
--- a/drivers/soc/qcom/pmic_glink.c
+++ b/drivers/soc/qcom/pmic_glink.c
@@ -230,7 +230,8 @@ static int pmic_glink_rpmsg_probe(struct rpmsg_device *rpdev)
mutex_lock(&__pmic_glink_lock);
if (!pg) {
- ret = dev_err_probe(&rpdev->dev, -ENODEV, "no pmic_glink device to attach to\n");
+ ret = dev_err_probe(&rpdev->dev, -EPROBE_DEFER,
+ "no pmic_glink device to attach to\n");
goto out_unlock;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0369/1167] drm/msm/a5xx: dont read the GPMU registers on GPUs without a GPMU
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (362 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0368/1167] soc: qcom: pmic_glink: Avoid losing early rpmsg probe Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0370/1167] dlm: validate node weights before building member array Greg Kroah-Hartman
` (293 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Konrad Dybcio,
Rob Clark, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
[ Upstream commit 77e3ffcf69065c4ce92c725540e0b4db14f43ad7 ]
Only a530/a540 have a GPMU. On the other a5xx parts, reading the
0xa800-0xac60 GPMU aperture during a crashdump resets the board -- on
sda660 (a512) a GPU hang thus reboots the SoC instead of recovering.
Split the GPMU block into its own array and collect it only when a GPMU
is present.
Fixes: e20c9284c8f2 ("drm/msm/adreno: Add support for Adreno 510 GPU")
Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/754867/
Message-ID: <20260920-a5xx-no-gpmu-v1-1-714200254f76@oss.qualcomm.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
[ sashal: Kept this tree's kzalloc(sizeof(*a5xx_state), GFP_KERNEL) allocation instead of upstream's kzalloc_obj(), and added only the new adreno_gpu declaration above it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 49 +++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 8c2758a18a19c..9e315369ef523 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1334,9 +1334,14 @@ static const u32 a5xx_registers[] = {
0xE800, 0xE806, 0xE810, 0xE89A, 0xE8A0, 0xE8A4, 0xE8AA, 0xE8EB,
0xE900, 0xE905, 0xEB80, 0xEB8F, 0xEBB0, 0xEBB0, 0xEC00, 0xEC05,
0xEC08, 0xECE9, 0xECF0, 0xECF0, 0xEA80, 0xEA80, 0xEA82, 0xEAA3,
- 0xEAA5, 0xEAC2, 0xA800, 0xA800, 0xA820, 0xA828, 0xA840, 0xA87D,
- 0XA880, 0xA88D, 0xA890, 0xA8A3, 0xA8D0, 0xA8D8, 0xA8E0, 0xA8F5,
- 0xAC60, 0xAC60, ~0,
+ 0xEAA5, 0xEAC2, ~0,
+};
+
+/* GPMU registers, only valid on parts with a GPMU (a530/a540) */
+static const u32 a5xx_gpmu_registers[] = {
+ 0xA800, 0xA800, 0xA820, 0xA828, 0xA840, 0xA87D, 0xA880, 0xA88D,
+ 0xA890, 0xA8A3, 0xA8D0, 0xA8D8, 0xA8E0, 0xA8F5, 0xAC60, 0xAC60,
+ ~0,
};
static void a5xx_dump(struct msm_gpu *gpu)
@@ -1447,6 +1452,7 @@ struct a5xx_crashdumper {
struct a5xx_gpu_state {
struct msm_gpu_state base;
u32 *hlsqregs;
+ u32 *gpmuregs;
};
static int a5xx_crashdumper_init(struct msm_gpu *gpu,
@@ -1564,8 +1570,30 @@ static void a5xx_gpu_state_get_hlsq_regs(struct msm_gpu *gpu,
msm_gem_kernel_put(dumper.bo, gpu->aspace);
}
+static void a5xx_gpu_state_get_gpmu_regs(struct msm_gpu *gpu,
+ struct a5xx_gpu_state *a5xx_state)
+{
+ u32 count = 0, pos = 0;
+ int i;
+
+ for (i = 0; a5xx_gpmu_registers[i] != ~0; i += 2)
+ count += a5xx_gpmu_registers[i + 1] - a5xx_gpmu_registers[i] + 1;
+
+ a5xx_state->gpmuregs = kcalloc(count, sizeof(u32), GFP_KERNEL);
+ if (!a5xx_state->gpmuregs)
+ return;
+
+ for (i = 0; a5xx_gpmu_registers[i] != ~0; i += 2) {
+ u32 addr;
+
+ for (addr = a5xx_gpmu_registers[i]; addr <= a5xx_gpmu_registers[i + 1]; addr++)
+ a5xx_state->gpmuregs[pos++] = gpu_read(gpu, addr);
+ }
+}
+
static struct msm_gpu_state *a5xx_gpu_state_get(struct msm_gpu *gpu)
{
+ struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
struct a5xx_gpu_state *a5xx_state = kzalloc(sizeof(*a5xx_state),
GFP_KERNEL);
bool stalled = !!(gpu_read(gpu, REG_A5XX_RBBM_STATUS3) & BIT(24));
@@ -1581,6 +1609,9 @@ static struct msm_gpu_state *a5xx_gpu_state_get(struct msm_gpu *gpu)
a5xx_state->base.rbbm_status = gpu_read(gpu, REG_A5XX_RBBM_STATUS);
+ if (adreno_is_a530(adreno_gpu) || adreno_is_a540(adreno_gpu))
+ a5xx_gpu_state_get_gpmu_regs(gpu, a5xx_state);
+
/*
* Get the HLSQ regs with the help of the crashdumper, but only if
* we are not stalled in an iommu fault (in which case the crashdumper
@@ -1602,6 +1633,7 @@ static void a5xx_gpu_state_destroy(struct kref *kref)
struct a5xx_gpu_state, base);
kfree(a5xx_state->hlsqregs);
+ kfree(a5xx_state->gpmuregs);
adreno_gpu_state_destroy(state);
kfree(a5xx_state);
@@ -1630,6 +1662,17 @@ static void a5xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
adreno_show(gpu, state, p);
+ if (a5xx_state->gpmuregs) {
+ u32 o, pos = 0;
+
+ drm_printf(p, "registers-gpmu:\n");
+
+ for (i = 0; a5xx_gpmu_registers[i] != ~0; i += 2)
+ for (o = a5xx_gpmu_registers[i]; o <= a5xx_gpmu_registers[i + 1]; o++)
+ drm_printf(p, " - { offset: 0x%04x, value: 0x%08x }\n",
+ o << 2, a5xx_state->gpmuregs[pos++]);
+ }
+
/* Dump the additional a5xx HLSQ registers */
if (!a5xx_state->hlsqregs)
return;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0370/1167] dlm: validate node weights before building member array
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (363 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0369/1167] drm/msm/a5xx: dont read the GPMU registers on GPUs without a GPMU Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0371/1167] drm/msm/a6xx: check pm_runtime_resume_and_get during resume Greg Kroah-Hartman
` (292 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qing Ming, Alexander Aring,
David Teigland, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qing Ming <a0yami@mailbox.org>
[ Upstream commit 7f662eb1807ed732ac7d5e119753c8185f241bb8 ]
DLM node weights are parsed as signed integers and copied into the member
list. make_member_array() uses their sum as the allocation count, but only
positive weights contribute entries to the array. A negative weight can
therefore reduce the allocation without reducing the number of writes.
The issue was found through static analysis of the configfs input and
member array construction. With two recovery members weighted -31 and 32,
the sum is 1, so recovery allocates one int and then writes the positive
member's node ID 32 times. A reproducer using dlm_controld and dlm_tool
triggered the same report on a KASAN kernel:
BUG: KASAN: slab-out-of-bounds in dlm_recover_members [dlm]
Write of size 4 by task dlm_recoverd
Call Trace:
dlm_recover_members
dlm_recoverd
kthread
ret_from_fork
Reject negative weights at the configfs input boundary. Also detect
overflow when adding non-negative weights to the signed allocation count,
and propagate array construction errors to the recovery path.
Fixes: e7fd41792fc0 ("[DLM] The core of the DLM for GFS2/CLVM")
Signed-off-by: Qing Ming <a0yami@mailbox.org>
Assisted-by: Codex:gpt-5
Acked-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
[ sashal: Kept the branch's kmalloc_array() instead of upstream's kmalloc_objs() in make_member_array(), and dropped the early ls_total_weight assignment as upstream does. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dlm/config.c | 9 ++++++++-
fs/dlm/member.c | 17 +++++++++++------
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index e55e0a2cd2e86..ff9d418368bca 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -789,10 +789,17 @@ static ssize_t node_weight_show(struct config_item *item, char *buf)
static ssize_t node_weight_store(struct config_item *item, const char *buf,
size_t len)
{
- int rc = kstrtoint(buf, 0, &config_item_to_node(item)->weight);
+ struct dlm_node *node = config_item_to_node(item);
+ int weight;
+ int rc;
+ rc = kstrtoint(buf, 0, &weight);
if (rc)
return rc;
+ if (weight < 0)
+ return -EINVAL;
+
+ node->weight = weight;
return len;
}
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index be7909ead71b4..7d13f3683711f 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -404,7 +404,7 @@ void dlm_clear_members_gone(struct dlm_ls *ls)
clear_memb_list(&ls->ls_nodes_gone, NULL);
}
-static void make_member_array(struct dlm_ls *ls)
+static int make_member_array(struct dlm_ls *ls)
{
struct dlm_member *memb;
int i, w, x = 0, total = 0, all_zero = 0, *array;
@@ -413,8 +413,8 @@ static void make_member_array(struct dlm_ls *ls)
ls->ls_node_array = NULL;
list_for_each_entry(memb, &ls->ls_nodes, list) {
- if (memb->weight)
- total += memb->weight;
+ if (check_add_overflow(total, memb->weight, &total))
+ return -EOVERFLOW;
}
/* all nodes revert to weight of 1 if all have weight 0 */
@@ -424,10 +424,9 @@ static void make_member_array(struct dlm_ls *ls)
all_zero = 1;
}
- ls->ls_total_weight = total;
array = kmalloc_array(total, sizeof(*array), GFP_NOFS);
if (!array)
- return;
+ return -ENOMEM;
list_for_each_entry(memb, &ls->ls_nodes, list) {
if (!all_zero && !memb->weight)
@@ -444,7 +443,10 @@ static void make_member_array(struct dlm_ls *ls)
array[x++] = memb->nodeid;
}
+ ls->ls_total_weight = total;
ls->ls_node_array = array;
+
+ return 0;
}
/* send a status request to all members just to establish comms connections */
@@ -604,7 +606,10 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
}
ls->ls_low_nodeid = low;
- make_member_array(ls);
+ error = make_member_array(ls);
+ if (error)
+ return error;
+
*neg_out = neg;
error = ping_members(ls, rv->seq);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0371/1167] drm/msm/a6xx: check pm_runtime_resume_and_get during resume
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (364 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0370/1167] dlm: validate node weights before building member array Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0372/1167] dmaengine: ste_dma40: Fix cyclic transfer residue Greg Kroah-Hartman
` (291 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roman Demidov, Dmitry Baryshkov,
Konrad Dybcio, Rob Clark, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roman Demidov <roman.demidov.nn@gmail.com>
[ Upstream commit e2f57c576f14f96449cfee840860cb9707501d23 ]
The return values of pm_runtime_resume_and_get() calls in a6xx_pm_resume()
are not checked, which can lead to hardware access on suspended devices
and PM reference underflows.
Fix this by checking the return value of each pm_runtime_resume_and_get()
call and properly unwinding the previously acquired resources on failure.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 5a903a44a984 ("drm/msm/a6xx: Introduce GMU wrapper support")
Signed-off-by: Roman Demidov <roman.demidov.nn@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/757106/
Message-ID: <20260929142103.81854-2-roman.demidov.nn@gmail.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
[ sashal: Dropped the clk_bulk_prepare_enable() block and the a6xx_llc_activate() call from the context, since a6xx_pm_resume() in this tree has neither, and kept the rest of the fix. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 33 +++++++++++++++------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index fe223823deae8..e5b490104fbf9 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1946,36 +1946,41 @@ static int a6xx_pm_resume(struct msm_gpu *gpu)
opp = dev_pm_opp_find_freq_ceil(&gpu->pdev->dev, &freq);
if (IS_ERR(opp)) {
ret = PTR_ERR(opp);
- goto err_set_opp;
+ goto err_unlock;
}
/* Set the core clock and bus bw, having VDD scaling in mind */
dev_pm_opp_set_opp(&gpu->pdev->dev, opp);
dev_pm_opp_put(opp);
- pm_runtime_resume_and_get(gmu->dev);
- pm_runtime_resume_and_get(gmu->gxpd);
+ ret = pm_runtime_resume_and_get(gmu->dev);
+ if (ret < 0)
+ goto err_opp_clear;
+ ret = pm_runtime_resume_and_get(gmu->gxpd);
+ if (ret < 0)
+ goto err_put_dev;
ret = clk_bulk_prepare_enable(gpu->nr_clocks, gpu->grp_clks);
if (ret)
- goto err_bulk_clk;
+ goto err_put_gxpd;
if (adreno_is_a619_holi(adreno_gpu))
a6xx_sptprac_enable(gmu);
- /* If anything goes south, tear the GPU down piece by piece.. */
- if (ret) {
-err_bulk_clk:
- pm_runtime_put(gmu->gxpd);
- pm_runtime_put(gmu->dev);
- dev_pm_opp_set_opp(&gpu->pdev->dev, NULL);
- }
-err_set_opp:
mutex_unlock(&a6xx_gpu->gmu.lock);
+ msm_devfreq_resume(gpu);
- if (!ret)
- msm_devfreq_resume(gpu);
+ return 0;
+ /* If anything goes south, tear the GPU down piece by piece.. */
+err_put_gxpd:
+ pm_runtime_put(gmu->gxpd);
+err_put_dev:
+ pm_runtime_put(gmu->dev);
+err_opp_clear:
+ dev_pm_opp_set_opp(&gpu->pdev->dev, NULL);
+err_unlock:
+ mutex_unlock(&a6xx_gpu->gmu.lock);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0372/1167] dmaengine: ste_dma40: Fix cyclic transfer residue
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (365 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0371/1167] drm/msm/a6xx: check pm_runtime_resume_and_get during resume Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0373/1167] dmaengine: ste_dma40: Recover coalesced cyclic callbacks Greg Kroah-Hartman
` (290 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit c80edceff29ee212987c2d2c851b2cb2eb4b477a ]
DMA40 reads residue from the element count of the currently active LLI.
For a cyclic transfer this reports at most one period, not the bytes
remaining until the cyclic buffer wraps.
Once DMA40 advertises burst granularity, DMAengine PCM uses this residue
directly. For a four-period PCM buffer it consequently reports the
hardware pointer near three periods after every period interrupt. ALSA
eventually stops playback with -EIO although DMA period callbacks
continue.
Calculate cyclic residue from the current memory-side hardware pointer
instead. Read the destination pointer for capture and the source pointer
for playback. Sample the split logical channel pointer coherently and
retain the last valid residue during relink transitions.
Make at most three residue sampling attempts: one initial read plus two
retries. The retries let transient split-register updates or LLI relink
windows settle, while the limit prevents unbounded polling if hardware does
not yield a valid pointer.
This avoids counting terminal-count interrupts, which races with hardware
advancing to the next LLI and cannot account for coalesced interrupt
status. Also reject cyclic periods that expand into multiple LLIs because
logical cyclic LLIs each request a terminal-count interrupt and would
generate more than one callback per period.
Reject invalid cyclic geometries before dividing or constructing the
scatterlist as well.
Reported-by: Frank Li <Frank.li@oss.nxp.com>
Closes: https://lore.kernel.org/dmaengine/aq2wIPJW6viUxyy9@SMW015318/
Fixes: 15c606686541 ("dmaengine: ste_dma40: indicate granularity on channels")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-2-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
[ sashal: Replaced kzalloc_objs() with kcalloc() in dma40_prep_dma_cyclic() because kzalloc_objs() doesn't exist in this tree; the rest matches upstream apart from line offsets. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 106 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 101 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 49d1e907b3437..9e13b97fbc86e 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -71,6 +71,9 @@ struct stedma40_platform_data {
/* Maximum iterations taken before giving up suspending a channel */
#define D40_SUSPEND_MAX_IT 500
+/* Maximum attempts to sample a stable cyclic residue position */
+#define D40_RESIDUE_MAX_ATTEMPTS 3
+
/* Milliseconds */
#define DMA40_AUTOSUSPEND_DELAY 100
@@ -370,6 +373,9 @@ struct d40_lli_pool {
* @lli_len: Number of llis of current descriptor.
* @lli_current: Number of transferred llis.
* @lcla_alloc: Number of LCLA entries allocated.
+ * @cyclic_dma_addr: Start address of the cyclic buffer.
+ * @cyclic_buf_len: Length of the cyclic buffer.
+ * @cyclic_residue: Last valid cyclic residue sample.
* @txd: DMA engine struct. Used for among other things for communication
* during a transfer.
* @node: List entry.
@@ -388,6 +394,9 @@ struct d40_desc {
int lli_len;
int lli_current;
int lcla_alloc;
+ dma_addr_t cyclic_dma_addr;
+ size_t cyclic_buf_len;
+ size_t cyclic_residue;
struct dma_async_tx_descriptor txd;
struct list_head node;
@@ -1414,6 +1423,64 @@ static u32 d40_residue(struct d40_chan *d40c)
return num_elt * d40c->dma_cfg.dst_info.data_width;
}
+static bool d40_current_addr(struct d40_chan *d40c, dma_addr_t *addr)
+{
+ bool dst = d40c->dma_cfg.dir == DMA_DEV_TO_MEM;
+ void __iomem *high_reg;
+ void __iomem *low_reg;
+ u32 low;
+ u32 high;
+ u32 check;
+ int i;
+
+ if (chan_is_physical(d40c)) {
+ *addr = readl(chan_base(d40c) +
+ (dst ? D40_CHAN_REG_SDPTR : D40_CHAN_REG_SSPTR));
+ return true;
+ }
+
+ if (dst) {
+ low_reg = &d40c->lcpa->lcsp2;
+ high_reg = &d40c->lcpa->lcsp3;
+ } else {
+ low_reg = &d40c->lcpa->lcsp0;
+ high_reg = &d40c->lcpa->lcsp1;
+ }
+
+ for (i = 0; i < D40_RESIDUE_MAX_ATTEMPTS; i++) {
+ high = readl(high_reg) & D40_MEM_LCSP1_SPTR_MASK;
+ low = readl(low_reg) & D40_MEM_LCSP0_SPTR_MASK;
+ check = readl(high_reg) & D40_MEM_LCSP1_SPTR_MASK;
+ if (high == check) {
+ *addr = low | high;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static bool d40_cyclic_offset(struct d40_chan *d40c, struct d40_desc *d40d,
+ size_t *offset)
+{
+ dma_addr_t current_addr;
+ dma_addr_t current_offset;
+ int i;
+
+ for (i = 0; i < D40_RESIDUE_MAX_ATTEMPTS; i++) {
+ if (!d40_current_addr(d40c, ¤t_addr))
+ continue;
+
+ current_offset = current_addr - d40d->cyclic_dma_addr;
+ if (current_offset <= d40d->cyclic_buf_len) {
+ *offset = current_offset;
+ return true;
+ }
+ }
+
+ return false;
+}
+
static bool d40_tx_is_linked(struct d40_chan *d40c)
{
bool is_link;
@@ -2204,15 +2271,26 @@ static bool d40_is_paused(struct d40_chan *d40c)
}
-static u32 stedma40_residue(struct dma_chan *chan)
+static u32 stedma40_residue(struct dma_chan *chan, dma_cookie_t cookie)
{
struct d40_chan *d40c =
container_of(chan, struct d40_chan, chan);
+ struct d40_desc *d40d;
+ size_t offset;
u32 bytes_left;
unsigned long flags;
spin_lock_irqsave(&d40c->lock, flags);
- bytes_left = d40_residue(d40c);
+ d40d = d40_first_active_get(d40c);
+ if (d40d && d40d->txd.cookie == cookie && d40d->cyclic &&
+ d40d->cyclic_buf_len) {
+ if (d40_cyclic_offset(d40c, d40d, &offset))
+ d40d->cyclic_residue = d40d->cyclic_buf_len - offset;
+ bytes_left = d40d->cyclic_residue;
+ } else {
+ bytes_left = d40_residue(d40c);
+ }
+
spin_unlock_irqrestore(&d40c->lock, flags);
return bytes_left;
@@ -2348,8 +2426,13 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src,
if (desc == NULL)
goto unlock;
- if (sg_next(&sg_src[sg_len - 1]) == sg_src)
+ if (sg_next(&sg_src[sg_len - 1]) == sg_src) {
desc->cyclic = true;
+ if (desc->lli_len != sg_len) {
+ chan_err(chan, "Cyclic periods must fit in one LLI\n");
+ goto free_desc;
+ }
+ }
src_dev_addr = 0;
dst_dev_addr = 0;
@@ -2632,11 +2715,18 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
size_t buf_len, size_t period_len,
enum dma_transfer_direction direction, unsigned long flags)
{
- unsigned int periods = buf_len / period_len;
+ unsigned int periods;
struct dma_async_tx_descriptor *txd;
+ struct d40_desc *desc;
struct scatterlist *sg;
+ dma_addr_t buf_addr = dma_addr;
int i;
+ if (!buf_len || !period_len || buf_len % period_len)
+ return NULL;
+
+ periods = buf_len / period_len;
+
sg = kcalloc(periods + 1, sizeof(struct scatterlist), GFP_NOWAIT);
if (!sg)
return NULL;
@@ -2651,6 +2741,12 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
txd = d40_prep_sg(chan, sg, sg, periods, direction,
DMA_PREP_INTERRUPT);
+ if (txd) {
+ desc = container_of(txd, struct d40_desc, txd);
+ desc->cyclic_dma_addr = buf_addr;
+ desc->cyclic_buf_len = buf_len;
+ desc->cyclic_residue = buf_len;
+ }
kfree(sg);
@@ -2671,7 +2767,7 @@ static enum dma_status d40_tx_status(struct dma_chan *chan,
ret = dma_cookie_status(chan, cookie, txstate);
if (ret != DMA_COMPLETE && txstate)
- dma_set_residue(txstate, stedma40_residue(chan));
+ dma_set_residue(txstate, stedma40_residue(chan, cookie));
if (d40_is_paused(d40c))
ret = DMA_PAUSED;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0373/1167] dmaengine: ste_dma40: Recover coalesced cyclic callbacks
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (366 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0372/1167] dmaengine: ste_dma40: Fix cyclic transfer residue Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0374/1167] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass Greg Kroah-Hartman
` (289 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Frank Li, Vinod Koul,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit db28400d92cd97005065dad230b8a5d72ab121cb ]
DMA40 has one terminal-count status bit per channel, so cyclic period
interrupts can coalesce.
Use the memory-side pointer displacement to queue the minimum observable
number of callbacks. If sampling fails, queue one callback and invalidate
the saved position; the next successful sample resynchronizes without
recounting it.
The pointer is modulo the cyclic buffer: a displacement of d periods can
mean d plus n complete iterations of the buffer. Report d, so the driver
could have missed n iterations of the buffer; DMA40 has no counter to
recover them. For an unchanged pointer, report one callback rather than
risk a spurious full-buffer burst.
This condition has not been seen in practice and is only a product of
review comments that the buffer can miss interrupts.
The preceding cyclic-residue fix ensures that every cyclic period fits in
one LLI, so each boundary corresponds to one client callback.
Fixes: 0c842b551063 ("dma40: cyclic xfer support")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-3-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 69 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 68 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 9e13b97fbc86e..b645d83d0306b 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -376,11 +376,14 @@ struct d40_lli_pool {
* @cyclic_dma_addr: Start address of the cyclic buffer.
* @cyclic_buf_len: Length of the cyclic buffer.
* @cyclic_residue: Last valid cyclic residue sample.
+ * @cyclic_period_len: Length of one cyclic period.
+ * @cyclic_callback_pos: Position after the callbacks already queued.
* @txd: DMA engine struct. Used for among other things for communication
* during a transfer.
* @node: List entry.
* @is_in_client_list: true if the client owns this descriptor.
* @cyclic: true if this is a cyclic job
+ * @cyclic_callback_pos_valid: Whether cyclic_callback_pos is reliable.
*
* This descriptor is used for both logical and physical transfers.
*/
@@ -397,12 +400,15 @@ struct d40_desc {
dma_addr_t cyclic_dma_addr;
size_t cyclic_buf_len;
size_t cyclic_residue;
+ size_t cyclic_period_len;
+ size_t cyclic_callback_pos;
struct dma_async_tx_descriptor txd;
struct list_head node;
bool is_in_client_list;
bool cyclic;
+ bool cyclic_callback_pos_valid;
};
/**
@@ -1481,6 +1487,61 @@ static bool d40_cyclic_offset(struct d40_chan *d40c, struct d40_desc *d40d,
return false;
}
+static unsigned int d40_cyclic_periods_elapsed(struct d40_chan *d40c,
+ struct d40_desc *d40d)
+{
+ size_t current_pos;
+ size_t delta;
+ size_t offset;
+ unsigned int periods;
+
+ if (!d40d->cyclic_period_len)
+ return 1;
+
+ if (!d40_cyclic_offset(d40c, d40d, &offset)) {
+ d40d->cyclic_callback_pos_valid = false;
+ return 1;
+ }
+
+ current_pos = rounddown(offset, d40d->cyclic_period_len);
+ if (!d40_residue(d40c) && current_pos != offset)
+ current_pos += d40d->cyclic_period_len;
+ if (current_pos == d40d->cyclic_buf_len)
+ current_pos = 0;
+
+ if (!d40d->cyclic_callback_pos_valid) {
+ /*
+ * The previous interrupt was reported without a pointer
+ * sample. Resynchronize without using the stale position,
+ * which would count that callback again.
+ */
+ d40d->cyclic_callback_pos = current_pos;
+ d40d->cyclic_callback_pos_valid = true;
+ return 1;
+ }
+
+ /*
+ * The pointer wraps with the cyclic buffer, so its displacement is
+ * only the minimum number of elapsed periods. Complete buffer laps
+ * are not observable.
+ */
+ delta = (current_pos + d40d->cyclic_buf_len -
+ d40d->cyclic_callback_pos) % d40d->cyclic_buf_len;
+ periods = delta / d40d->cyclic_period_len;
+ if (!periods) {
+ /*
+ * The TC status is a single latched bit. An unchanged pointer
+ * cannot distinguish a complete lap from a repeated interrupt,
+ * so do not amplify it into a buffer's worth of callbacks.
+ */
+ periods = 1;
+ }
+
+ d40d->cyclic_callback_pos = current_pos;
+
+ return periods;
+}
+
static bool d40_tx_is_linked(struct d40_chan *d40c)
{
bool is_link;
@@ -1628,6 +1689,7 @@ static struct d40_desc *d40_queue_start(struct d40_chan *d40c)
static void dma_tc_handle(struct d40_chan *d40c)
{
struct d40_desc *d40d;
+ unsigned int callbacks = 1;
/* Get first active entry from list */
d40d = d40_first_active_get(d40c);
@@ -1652,6 +1714,8 @@ static void dma_tc_handle(struct d40_chan *d40c)
if (d40d->lli_current == d40d->lli_len)
d40d->lli_current = 0;
}
+
+ callbacks = d40_cyclic_periods_elapsed(d40c, d40d);
} else {
d40_lcla_free_all(d40c, d40d);
@@ -1672,7 +1736,7 @@ static void dma_tc_handle(struct d40_chan *d40c)
}
}
- d40c->pending_tx++;
+ d40c->pending_tx += callbacks;
tasklet_schedule(&d40c->tasklet);
}
@@ -2746,6 +2810,9 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
desc->cyclic_dma_addr = buf_addr;
desc->cyclic_buf_len = buf_len;
desc->cyclic_residue = buf_len;
+ desc->cyclic_period_len = period_len;
+ desc->cyclic_callback_pos = 0;
+ desc->cyclic_callback_pos_valid = true;
}
kfree(sg);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0374/1167] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (367 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0373/1167] dmaengine: ste_dma40: Recover coalesced cyclic callbacks Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0375/1167] proc: report SIGEV_NONE in /proc/pid/timers if target task has died Greg Kroah-Hartman
` (288 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wilson Felipe Pereira, Andrew Morton,
Michal Koutný, Chengming Zhou, Johannes Weiner, Nhat Pham,
Shuah Khan, Tejun Heo, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wilson Felipe Pereira <wfelipe@google.com>
[ Upstream commit 0567c7eaefd7ea1b26d76c46964f9a1d92120d7d ]
In test_no_kmem_bypass(), delta (stored_pages * page_size - zswapped) is
checked against stored_pages * page_size / 4 to verify that the pages
pushed to zswap belong to the test memory cgroup.
Due to slight stat update timing differences, delta can evaluate to a
small negative number (e.g. -5MB out of 1GB). Because delta is declared
as a signed int and stored_pages is an unsigned size_t, C's usual
arithmetic conversions implicitly promote a negative delta to a large
unsigned 64-bit integer, causing `delta < stored_pages * page_size / 4` to
falsely evaluate to 0 and fail the test.
Fix this by declaring zswapped and delta as signed long long and comparing
against a signed threshold, ensuring negative deltas correctly evaluate to
true.
Link: https://lore.kernel.org/20260828033741.2184560-3-wfelipe@google.com
Fixes: a549f9f31561a ("selftests: cgroup: add test_zswap with no kmem bypass test")
Signed-off-by: Wilson Felipe Pereira <wfelipe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michal Koutný <mkoutny@suse.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
[ sashal: Replaced the missing page_size variable with the literal 4096 in the delta and max_delta calculations, since this tree has no such variable. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_zswap.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index 6927b4a06dee6..b8bac796ff57e 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -212,11 +212,14 @@ static int test_no_kmem_bypass(const char *root)
break;
/* If memory was pushed to zswap, verify it belongs to memcg */
if (stored_pages > stored_pages_threshold) {
- int zswapped = cg_read_key_long(test_group, "memory.stat", "zswapped ");
- int delta = stored_pages * 4096 - zswapped;
- int result_ok = delta < stored_pages * 4096 / 4;
-
- ret = result_ok ? KSFT_PASS : KSFT_FAIL;
+ long zswapped = cg_read_key_long(
+ test_group, "memory.stat", "zswapped ");
+ long long delta =
+ (long long)stored_pages * 4096 - zswapped;
+ long long max_delta =
+ (long long)stored_pages * 4096 / 4;
+
+ ret = (delta < max_delta) ? KSFT_PASS : KSFT_FAIL;
break;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0375/1167] proc: report SIGEV_NONE in /proc/pid/timers if target task has died
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (368 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0374/1167] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0376/1167] wifi: mt76: mt7921: honour FIF_FCSFAIL instead of hardcoding drop_err Greg Kroah-Hartman
` (287 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrei Vagin, Andrew Morton,
Pavel Tikhomirov, Thomas Gleixner, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrei Vagin <avagin@google.com>
[ Upstream commit 0a27f795030ce6a2c71525b0544e3b13bba8828e ]
When a posix timer is created targeting a specific thread (using
SIGEV_SIGNAL | SIGEV_THREAD_ID), it takes a reference to the target struct
pid in timer->it_pid. If the target thread subsequently terminates, its
numeric tid is freed and can be recycled for an unrelated task. However,
the timer holds its reference to the original struct pid.
show_timer() in /proc/[pid]/timers previously called pid_nr_ns() directly
on timer->it_pid without checking whether any task remained attached to
that struct pid. As a result:
1. It reported the stale tid, which could mistakenly refer to a recycled
pid.
2. In the kernel, expired signals for dead target threads are dropped by
posixtimer_send_sigqueue() because posixtimer_get_target() returns
NULL, so the timer functionally acts as SIGEV_NONE.
3. Checkpoint/restore tools (CRIU) parsing /proc/[pid]/timers would try
to restore a timer with SIGEV_SIGNAL | SIGEV_THREAD_ID targeting a
non-existent or unrelated thread.
Check pid_has_task(timer->it_pid, timer->it_pid_type) in show_timer(). If
the target task has died, override notify to SIGEV_NONE and report PID 0
(e.g., 'notify: none/pid.0').
Link: https://lore.kernel.org/20260816161216.984580-1-avagin@google.com
Fixes: 57b8015e07a7 ("posix-timers: Show sigevent info in proc file")
Signed-off-by: Andrei Vagin <avagin@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
[ sashal: Replaced the missing it_pid_type with an inline (notify & SIGEV_THREAD_ID) ? PIDTYPE_PID : PIDTYPE_TGID, and kept this tree's older list_entry()/unlocked show_timer() instead of the hlist, guard() and posixtimer_valid() lines. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/proc/base.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 881c2d4846d7c..aa1cc9c5ee95c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2529,6 +2529,7 @@ static int show_timer(struct seq_file *m, void *v)
struct k_itimer *timer;
struct timers_private *tp = m->private;
int notify;
+ pid_t nr = 0;
static const char * const nstr[] = {
[SIGEV_SIGNAL] = "signal",
[SIGEV_NONE] = "none",
@@ -2538,6 +2539,12 @@ static int show_timer(struct seq_file *m, void *v)
timer = list_entry((struct list_head *)v, struct k_itimer, list);
notify = timer->it_sigev_notify;
+ if (timer->it_pid && pid_has_task(timer->it_pid,
+ (notify & SIGEV_THREAD_ID) ? PIDTYPE_PID : PIDTYPE_TGID))
+ nr = pid_nr_ns(timer->it_pid, tp->ns);
+ else
+ notify = SIGEV_NONE;
+
seq_printf(m, "ID: %d\n", timer->it_id);
seq_printf(m, "signal: %d/%px\n",
timer->sigq->info.si_signo,
@@ -2545,7 +2552,7 @@ static int show_timer(struct seq_file *m, void *v)
seq_printf(m, "notify: %s/%s.%d\n",
nstr[notify & ~SIGEV_THREAD_ID],
(notify & SIGEV_THREAD_ID) ? "tid" : "pid",
- pid_nr_ns(timer->it_pid, tp->ns));
+ nr);
seq_printf(m, "ClockID: %d\n", timer->it_clock);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0376/1167] wifi: mt76: mt7921: honour FIF_FCSFAIL instead of hardcoding drop_err
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (369 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0375/1167] proc: report SIGEV_NONE in /proc/pid/timers if target task has died Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0377/1167] wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown() Greg Kroah-Hartman
` (286 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Felix Fietkau,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit f8794eb3ff6dedbba0337c5197626b62da0ef057 ]
When a monitor interface asks to see frames that failed their checksum,
mac80211 passes the request down to the driver. mt7921 works out the
answer, sends it to the firmware as a receive filter, and then configures
the sniffer with a hardcoded byte telling it to drop those frames anyway.
The answer is used once and never kept, so the sniffer never gets to see
it.
That matters to anyone using monitor mode to judge a link honestly, which
is most of the reason to be in monitor mode at all.
Mark Anthony Agarro posted the same change for mt7925: keep what mac80211
asked for on the phy, and read it back when the sniffer is configured.
This does that for mt7921, and applies on top of it, since that patch is
what adds the field.
https://lore.kernel.org/linux-wireless/20260826091757.469953-1-markanthonyagarro@gmail.com/
The stored value is read in one place only, configuring the sniffer, which
has a single caller, and that call sits inside a branch reached only by a
monitor interface. Nothing else changes.
Measured on an MT7922 with a read-only probe on the command as the driver
sends it, so these are the driver's own bytes rather than an inference
from what came back:
request arm drop_err
none stock 1 1 1 1
none patched 1 1 1 1
fcsfail stock 1 1
fcsfail patched 0 0
Stock sends the drop byte whether or not anyone asked for it. Patched
sends it only when nobody did. Withdrawing the request and making it again
inside one driver load moves the byte back and forth, 0 then 1 then 0
across three changes, so nothing sticks once set.
If it does appear to stick when trying this against an MT7927, that is
mac80211 rather than the driver. It raises the filter count
unconditionally when a monitor comes up, but skips lowering it again for
drivers that set NO_VIRTUAL_MONITOR, and that is the only chip in this
family which does.
Fixes: 914189af23b8 ("wifi: mt76: mt7921: fix channel switch fail in monitor mode")
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20260826231029.39632-1-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[ sashal: added the missing u32 rxfilter field to struct mt792x_phy, since the prerequisite mt7925 patch that introduces it is absent; the rest matches upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7921/main.c | 8 +++-----
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 5 +++++
drivers/net/wireless/mediatek/mt76/mt792x.h | 1 +
4 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index aa112371c07ce..1d44922ae59e2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -647,12 +647,8 @@ static void mt7921_configure_filter(struct ieee80211_hw *hw,
unsigned int *total_flags,
u64 multicast)
{
-#define MT7921_FILTER_FCSFAIL BIT(2)
-#define MT7921_FILTER_CONTROL BIT(5)
-#define MT7921_FILTER_OTHER_BSS BIT(6)
-#define MT7921_FILTER_ENABLE BIT(31)
-
struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ struct mt792x_phy *phy = mt792x_hw_phy(hw);
u32 flags = MT7921_FILTER_ENABLE;
#define MT7921_FILTER(_fif, _type) do { \
@@ -664,6 +660,8 @@ static void mt7921_configure_filter(struct ieee80211_hw *hw,
MT7921_FILTER(FIF_CONTROL, CONTROL);
MT7921_FILTER(FIF_OTHER_BSS, OTHER_BSS);
+ phy->rxfilter = flags;
+
mt792x_mutex_acquire(dev);
mt7921_mcu_set_rxfilter(dev, flags, 0, 0);
mt792x_mutex_release(dev);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index f4e3c99bf729b..0c24831380060 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -1046,7 +1046,7 @@ int mt7921_mcu_config_sniffer(struct mt792x_vif *vif,
.len = cpu_to_le16(sizeof(req.tlv)),
.control_ch = chandef->chan->hw_value,
.center_ch = ieee80211_frequency_to_channel(freq1),
- .drop_err = 1,
+ .drop_err = !(vif->phy->rxfilter & MT7921_FILTER_FCSFAIL),
},
};
if (chandef->chan->band < ARRAY_SIZE(ch_band))
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
index bb54832358f56..c2aecb08669ab 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
@@ -7,6 +7,11 @@
#include "../mt792x.h"
#include "regs.h"
+#define MT7921_FILTER_FCSFAIL BIT(2)
+#define MT7921_FILTER_CONTROL BIT(5)
+#define MT7921_FILTER_OTHER_BSS BIT(6)
+#define MT7921_FILTER_ENABLE BIT(31)
+
#define MT7921_MAX_AID 20
#define MT7921_TX_RING_SIZE 2048
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
index 6c347495e1185..47761acaf3c40 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x.h
+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
@@ -106,6 +106,7 @@ struct mt792x_phy {
s16 coverage_class;
u8 slottime;
+ u32 rxfilter;
u32 rx_ampdu_ts;
u32 ampdu_ref;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0377/1167] wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (370 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0376/1167] wifi: mt76: mt7921: honour FIF_FCSFAIL instead of hardcoding drop_err Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0378/1167] wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup Greg Kroah-Hartman
` (285 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aamir Ahmed, Felix Fietkau,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aamir Ahmed <elb12345@hotmail.co.uk>
[ Upstream commit e75897e6cb8b900d095acf6fbff1ffb026c86c35 ]
mt7996_mcu_ie_countdown() iterates over TLV entries in the countdown
event but only checks for a non-zero tlv->len. A malformed event with
a TLV length smaller than the 4-byte TLV header advances the cursor by
less than a header size, causing misaligned reads on subsequent
iterations. A TLV whose declared length exceeds the remaining buffer
is also not caught, so the cursor can overshoot the end. The band
field of the event header is also read without checking that the event
is long enough to contain it.
This is the same class of bug fixed for mt7925 in
commit fc7801b7f11d ("wifi: mt76: mt7925: fix infinite loop in UNI
event TLV parsing").
Fix by checking that the event contains the header before reading the
band, and that each TLV is large enough to contain the countdown notify
payload and does not exceed the remaining buffer.
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Assisted-by: Claude (Anthropic)
Signed-off-by: Aamir Ahmed <elb12345@hotmail.co.uk>
Link: https://patch.msgid.link/AS8P251MB0001CCE8D1BEE1F330D9E57AC8B22@AS8P251MB0001.EURP251.PROD.OUTLOOK.COM
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[ sashal: Replaced the upstream payload-size check with a bare TLV-header minimum, because this tree has no countdown event struct or omac_idx read. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 276264c950a09..80f30ff796323 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -434,6 +434,9 @@ mt7996_mcu_ie_countdown(struct mt7996_dev *dev, struct sk_buff *skb)
struct header *hdr = (struct header *)data;
struct tlv *tlv = (struct tlv *)(data + 4);
+ if (skb->len < sizeof(*rxd) + sizeof(*hdr))
+ return;
+
if (hdr->band >= ARRAY_SIZE(dev->mt76.phys))
return;
@@ -442,7 +445,12 @@ mt7996_mcu_ie_countdown(struct mt7996_dev *dev, struct sk_buff *skb)
tail = skb->data + skb->len;
data += sizeof(struct header);
- while (data + sizeof(struct tlv) < tail && le16_to_cpu(tlv->len)) {
+ while (data + sizeof(*tlv) <= tail) {
+ u16 tag_len = le16_to_cpu(tlv->len);
+
+ if (tag_len < sizeof(*tlv) || data + tag_len > tail)
+ break;
+
switch (le16_to_cpu(tlv->tag)) {
case UNI_EVENT_IE_COUNTDOWN_CSA:
ieee80211_iterate_active_interfaces_atomic(mphy->hw,
@@ -456,7 +464,7 @@ mt7996_mcu_ie_countdown(struct mt7996_dev *dev, struct sk_buff *skb)
break;
}
- data += le16_to_cpu(tlv->len);
+ data += tag_len;
tlv = (struct tlv *)data;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0378/1167] wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (371 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0377/1167] wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown() Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0379/1167] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class Greg Kroah-Hartman
` (284 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, John Crispin, Felix Fietkau,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Crispin <john@phrozen.org>
[ Upstream commit 7a5a3843178c61d99d939b231318692d08fff79b ]
mt7996_unregister_device() leaves the RX NAPIs enabled, so
mt76_dma_cleanup() deletes enabled NAPIs and destroys page pools that
are still bound to them. On rmmod, the kernel warns in
__netif_napi_del_locked() for every RX queue and in
page_pool_disable_direct_recycling(). Until the IRQ tasklet is disabled,
an interrupt can still schedule a NAPI that was already deleted.
Disable every RX NAPI that was added before the MCU exit and the DMA
cleanup. This includes the host RRO queues: mt76_dma_init() skips them,
but mt7996_dma_rro_start() adds their NAPIs later when WED is not
active, so a check for mt76_queue_is_wed_rro() would miss them.
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: John Crispin <john@phrozen.org>
Link: https://patch.msgid.link/20261006205936.669125-27-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[ sashal: Dropped the WED RRO context (the wed_rro.work cancel and mt7996_wed_rro_free() call) since they don't exist here; the hunk context uses rc_work and unregister_phy instead, with the same RX NAPI disable loop. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7996/init.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/init.c b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
index 6acd7c10d28aa..38eef6fa154ce 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
@@ -930,6 +930,8 @@ int mt7996_register_device(struct mt7996_dev *dev)
void mt7996_unregister_device(struct mt7996_dev *dev)
{
+ int i;
+
cancel_work_sync(&dev->dump_work);
cancel_work_sync(&dev->reset_work);
cancel_work_sync(&dev->rc_work);
@@ -937,6 +939,10 @@ void mt7996_unregister_device(struct mt7996_dev *dev)
mt7996_unregister_phy(mt7996_phy2(dev), MT_BAND1);
mt7996_coredump_unregister(dev);
mt76_unregister_device(&dev->mt76);
+ for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++) {
+ if (dev->mt76.napi[i].dev)
+ napi_disable(&dev->mt76.napi[i]);
+ }
mt7996_mcu_exit(dev);
mt7996_tx_token_put(dev);
mt7996_dma_cleanup(dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0379/1167] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (372 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0378/1167] wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0380/1167] drm/amd/display: copy function name into dcn_fpu trace event Greg Kroah-Hartman
` (283 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Tvrtko Ursulin,
Dan Wheeler, Roman Li, Alex Deucher, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 6c4f8c5cc00326f6c709bff0d640d504c90862ca ]
Don't create an amdgpu_dm_atomic_state_template event since this is just
a template. Declare the template as an event class that will be used by
actual event tracers.
Fixes: e8a982355f96 ("drm/amd/display: Add tracepoint for amdgpu_dm")
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ sashal: Changed the drm_atomic_commit type name to drm_atomic_state in TP_PROTO and the __field entry, since this tree still uses the older name. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../amd/display/amdgpu_dm/amdgpu_dm_trace.h | 56 +++++++++----------
1 file changed, 26 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 6ec98d240fef7..6ed9f34a1d289 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -310,36 +310,32 @@ DEFINE_EVENT(amdgpu_dm_plane_state_template, amdgpu_dm_atomic_update_cursor,
TP_PROTO(const struct drm_plane_state *state),
TP_ARGS(state));
-TRACE_EVENT(amdgpu_dm_atomic_state_template,
- TP_PROTO(const struct drm_atomic_state *state),
- TP_ARGS(state),
-
- TP_STRUCT__entry(
- __field(const struct drm_atomic_state *, state)
- __field(bool, allow_modeset)
- __field(bool, legacy_cursor_update)
- __field(bool, async_update)
- __field(bool, duplicated)
- __field(int, num_connector)
- __field(int, num_private_objs)
- ),
-
- TP_fast_assign(
- __entry->state = state;
- __entry->allow_modeset = state->allow_modeset;
- __entry->legacy_cursor_update = state->legacy_cursor_update;
- __entry->async_update = state->async_update;
- __entry->duplicated = state->duplicated;
- __entry->num_connector = state->num_connector;
- __entry->num_private_objs = state->num_private_objs;
- ),
-
- TP_printk("state=%p allow_modeset=%d legacy_cursor_update=%d "
- "async_update=%d duplicated=%d num_connector=%d "
- "num_private_objs=%d",
- __entry->state, __entry->allow_modeset, __entry->legacy_cursor_update,
- __entry->async_update, __entry->duplicated, __entry->num_connector,
- __entry->num_private_objs)
+DECLARE_EVENT_CLASS(amdgpu_dm_atomic_state_template,
+ TP_PROTO(const struct drm_atomic_state *state),
+ TP_ARGS(state),
+ TP_STRUCT__entry(__field(const struct drm_atomic_state *, state)
+ __field(bool, allow_modeset)
+ __field(bool, legacy_cursor_update)
+ __field(bool, async_update)
+ __field(bool, duplicated)
+ __field(int, num_connector)
+ __field(int, num_private_objs)
+ ),
+ TP_fast_assign(__entry->state = state;
+ __entry->allow_modeset = state->allow_modeset;
+ __entry->legacy_cursor_update = state->legacy_cursor_update;
+ __entry->async_update = state->async_update;
+ __entry->duplicated = state->duplicated;
+ __entry->num_connector = state->num_connector;
+ __entry->num_private_objs = state->num_private_objs;
+ ),
+ TP_printk("state=%p allow_modeset=%d legacy_cursor_update=%d "
+ "async_update=%d duplicated=%d num_connector=%d "
+ "num_private_objs=%d",
+ __entry->state, __entry->allow_modeset,
+ __entry->legacy_cursor_update, __entry->async_update,
+ __entry->duplicated, __entry->num_connector,
+ __entry->num_private_objs)
);
DEFINE_EVENT(amdgpu_dm_atomic_state_template, amdgpu_dm_atomic_commit_tail_begin,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0380/1167] drm/amd/display: copy function name into dcn_fpu trace event
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (373 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0379/1167] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0381/1167] drm/amd/display: copy function name into dcn_optc_lock_unlock_state " Greg Kroah-Hartman
` (282 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Tvrtko Ursulin,
Dan Wheeler, Roman Li, Alex Deucher, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit b4d41522012d91cd875cebdfd1a3bbb04eb863dd ]
Userspace trace tools that use libtraceevent to read binary buffer only
see a kernel address when printing const char *. Use string macros in
dcn_fpu to copy the function name into the trace event.
Fixes: 96ee63730fa3 ("drm/amd/display: Add control mechanism for FPU")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ sashal: Changed the one-argument __assign_str(function) to the two-argument __assign_str(function, function), since this tree's macro needs both a destination and a source. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 6ed9f34a1d289..8b2f8c50eb934 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -637,20 +637,20 @@ TRACE_EVENT(dcn_fpu,
TP_STRUCT__entry(
__field(bool, begin)
- __field(const char *, function)
+ __string(function, function)
__field(int, line)
__field(int, recursion_depth)
),
TP_fast_assign(
__entry->begin = begin;
- __entry->function = function;
+ __assign_str(function, function);
__entry->line = line;
__entry->recursion_depth = recursion_depth;
),
TP_printk("%s: recursion_depth: %d: %s()+%d:",
__entry->begin ? "begin" : "end",
__entry->recursion_depth,
- __entry->function,
+ __get_str(function),
__entry->line
)
);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0381/1167] drm/amd/display: copy function name into dcn_optc_lock_unlock_state trace event
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (374 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0380/1167] drm/amd/display: copy function name into dcn_fpu trace event Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0382/1167] fs/ntfs3: check return values in indx_delete_entry() Greg Kroah-Hartman
` (281 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Dan Wheeler, Roman Li,
Alex Deucher, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 624a5a158c2a49f07edba7f8653eeecca114921f ]
Userspace trace tools that use libtraceevent to read binary buffer only
see a kernel address when printing const char *. Use string macros in
dcn_optc_lock_unlock_state to copy the function name into the trace
event.
Fixes: f1943a51f0f9 ("drm/amd/display: Add events log to trace OPTC lock and unlock")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Melissa Wen <mwen@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ sashal: Changed __assign_str(function); to the two-argument __assign_str(function, function);, since this tree's macro takes a destination and a source. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 8b2f8c50eb934..4d471461b86cc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -660,7 +660,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
TP_ARGS(optc_state, instance, lock, function, line),
TP_STRUCT__entry(
- __field(const char *, function)
+ __string(function, function)
__field(int, instance)
__field(bool, lock)
__field(int, line)
@@ -678,7 +678,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
__field(int, vready_offset)
),
TP_fast_assign(
- __entry->function = function;
+ __assign_str(function, function);
__entry->instance = instance;
__entry->lock = lock;
__entry->line = line;
@@ -700,7 +700,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
"min_v_blank_interlace=%d vstartup_start=%d vupdate_offset=%d vupdate_width=%d "
"vready_offset=%d",
__entry->lock ? "Lock" : "Unlock",
- __entry->function,
+ __get_str(function),
__entry->line,
__entry->instance,
__entry->opp_count,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0382/1167] fs/ntfs3: check return values in indx_delete_entry()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (375 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0381/1167] drm/amd/display: copy function name into dcn_optc_lock_unlock_state " Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0383/1167] net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path Greg Kroah-Hartman
` (280 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Morgun, Konstantin Komarov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Morgun <d.morgun@ispras.ru>
[ Upstream commit 131f7d7abf0f10edc6ea6b032f8a3908bdb13ce8 ]
When the index tree collapses down to an empty root,
indx_delete_entry() calls attr_set_size() and ni_remove_attr() for
both ATTR_ALLOC and ATTR_BITMAP, but their return values are
overwritten by the following call without being checked.
In most other call sites of these functions the return value is
checked, so add the same checks here in case an error at this point
is meaningful.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Dmitry Morgun <d.morgun@ispras.ru>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
[ sashal: Added a trailing NULL argument to the attr_set_size() calls to match this tree's 9-argument signature with the extra ret parameter. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/index.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
index 632e526187048..e32a6a0560e5c 100644
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -2693,18 +2693,28 @@ int indx_delete_entry(struct ntfs_index *indx, struct ntfs_inode *ni,
err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
&indx->alloc_run, 0, NULL, false, NULL);
+ if (err)
+ goto out;
+
if (in->name == I30_NAME)
i_size_write(&ni->vfs_inode, 0);
err = ni_remove_attr(ni, ATTR_ALLOC, in->name, in->name_len,
false, NULL);
run_close(&indx->alloc_run);
+ if (err)
+ goto out;
err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
&indx->bitmap_run, 0, NULL, false, NULL);
+ if (err)
+ goto out;
+
err = ni_remove_attr(ni, ATTR_BITMAP, in->name, in->name_len,
false, NULL);
run_close(&indx->bitmap_run);
+ if (err)
+ goto out;
root = indx_get_root(indx, ni, &attr, &mi);
if (!root) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0383/1167] net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (376 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0382/1167] fs/ntfs3: check return values in indx_delete_entry() Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0384/1167] ALSA: pcmtest: Fix leak at probe error Greg Kroah-Hartman
` (279 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
[ Upstream commit 237782c3d416b392a12642f32959e9d3c94e0c26 ]
tx_coal_frames[] is written by ethtool (stmmac_set_coalesce) and read
locklessly from the TX fast path (stmmac_xmit, stmmac_tso_xmit,
stmmac_xdp_xmit_zc and stmmac_xdp_xmit_xdpf), so pair every access
with READ_ONCE()/WRITE_ONCE() to mark the intentional data race and
read a consistent value into a local variable.
Moreover, ethtool allows disabling TX coalescing by setting
tx_max_coalesced_frames to 0: guard the modulo operation in
stmmac_xdp_xmit_xdpf() against a zero tx_coal_frames[queue] to avoid
a division by zero.
Both issues were found by code inspection while extending the XDP TX
path with multi-buff support, and neither has ever been triggered, so
they are only theoretical. Tested on the Qualcomm RB3-gen2 board.
Fixes: db2f2842e6f5 ("net: stmmac: add per-queue TX & RX coalesce ethtool support")
Fixes: be8b38a722e6 ("net: stmmac: Add support for XDP_TX action")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261001-b4-stmmac-xmit-mb-v4-1-664e0c3eb289@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Kept the 6.6 declaration blocks and added a standalone u32 tx_coal; in stmmac_tso_xmit() and stmmac_xmit(), and the XDP zero-copy hunk context lacks the xsk_tx_metadata block. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/stmicro/stmmac/stmmac_ethtool.c | 11 ++---
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 40 +++++++++----------
2 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 521b1b5ffebb4..24f147d2eda9d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -977,7 +977,8 @@ static int __stmmac_get_coalesce(struct net_device *dev,
if (queue < tx_cnt) {
ec->tx_coalesce_usecs = priv->tx_coal_timer[queue];
- ec->tx_max_coalesced_frames = priv->tx_coal_frames[queue];
+ ec->tx_max_coalesced_frames =
+ READ_ONCE(priv->tx_coal_frames[queue]);
} else {
ec->tx_coalesce_usecs = 0;
ec->tx_max_coalesced_frames = 0;
@@ -1066,14 +1067,14 @@ static int __stmmac_set_coalesce(struct net_device *dev,
int i;
for (i = 0; i < tx_cnt; i++) {
- priv->tx_coal_frames[i] =
- ec->tx_max_coalesced_frames;
+ WRITE_ONCE(priv->tx_coal_frames[i],
+ ec->tx_max_coalesced_frames);
priv->tx_coal_timer[i] =
ec->tx_coalesce_usecs;
}
} else if (queue < tx_cnt) {
- priv->tx_coal_frames[queue] =
- ec->tx_max_coalesced_frames;
+ WRITE_ONCE(priv->tx_coal_frames[queue],
+ ec->tx_max_coalesced_frames);
priv->tx_coal_timer[queue] =
ec->tx_coalesce_usecs;
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4bfddb31a512a..de19aa35818cb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2426,7 +2426,8 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
while (budget-- > 0) {
dma_addr_t dma_addr;
- bool set_ic;
+ bool set_ic = false;
+ u32 tx_coal;
/* We are sharing with slow path and stop XSK TX desc submission when
* available TX ring is less than threshold.
@@ -2468,12 +2469,9 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
tx_q->tx_count_frames++;
- if (!priv->tx_coal_frames[queue])
- set_ic = false;
- else if (tx_q->tx_count_frames % priv->tx_coal_frames[queue] == 0)
+ tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
+ if (tx_coal && !(tx_q->tx_count_frames % tx_coal))
set_ic = true;
- else
- set_ic = false;
if (set_ic) {
tx_q->tx_count_frames = 0;
@@ -3036,7 +3034,7 @@ static void stmmac_init_coalesce(struct stmmac_priv *priv)
for (chan = 0; chan < tx_channel_count; chan++) {
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[chan];
- priv->tx_coal_frames[chan] = STMMAC_TX_FRAMES;
+ WRITE_ONCE(priv->tx_coal_frames[chan], STMMAC_TX_FRAMES);
priv->tx_coal_timer[chan] = STMMAC_COAL_TX_TIMER;
hrtimer_init(&tx_q->txtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
@@ -4101,6 +4099,7 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
unsigned int first_entry, tx_packets;
struct stmmac_txq_stats *txq_stats;
int tmp_pay_len = 0, first_tx, ndesc;
+ u32 tx_coal;
struct stmmac_tx_queue *tx_q;
bool has_vlan, set_ic;
dma_addr_t tso_des, des;
@@ -4245,16 +4244,16 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
tx_packets = (tx_q->cur_tx + 1) - first_tx;
tx_q->tx_count_frames += tx_packets;
+ tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
if ((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)
set_ic = true;
- else if (!priv->tx_coal_frames[queue])
+ else if (!tx_coal)
set_ic = false;
else if (!netdev_xmit_more())
set_ic = true;
- else if (tx_packets > priv->tx_coal_frames[queue])
+ else if (tx_packets > tx_coal)
set_ic = true;
- else if ((tx_q->tx_count_frames %
- priv->tx_coal_frames[queue]) < tx_packets)
+ else if ((tx_q->tx_count_frames % tx_coal) < tx_packets)
set_ic = true;
else
set_ic = false;
@@ -4386,6 +4385,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
struct dma_desc *desc, *first;
struct stmmac_tx_queue *tx_q;
bool has_vlan, set_ic;
+ u32 tx_coal;
int entry, first_tx;
dma_addr_t des;
@@ -4508,16 +4508,16 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
tx_packets = (entry + 1) - first_tx;
tx_q->tx_count_frames += tx_packets;
+ tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
if ((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)
set_ic = true;
- else if (!priv->tx_coal_frames[queue])
+ else if (!tx_coal)
set_ic = false;
else if (!netdev_xmit_more())
set_ic = true;
- else if (tx_packets > priv->tx_coal_frames[queue])
+ else if (tx_packets > tx_coal)
set_ic = true;
- else if ((tx_q->tx_count_frames %
- priv->tx_coal_frames[queue]) < tx_packets)
+ else if ((tx_q->tx_count_frames % tx_coal) < tx_packets)
set_ic = true;
else
set_ic = false;
@@ -4789,7 +4789,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
unsigned int entry = tx_q->cur_tx;
struct dma_desc *tx_desc;
dma_addr_t dma_addr;
- bool set_ic;
+ u32 tx_coal;
if (stmmac_tx_avail(priv, queue) < STMMAC_TX_THRESH(priv))
return STMMAC_XDP_CONSUMED;
@@ -4835,12 +4835,8 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
tx_q->tx_count_frames++;
- if (tx_q->tx_count_frames % priv->tx_coal_frames[queue] == 0)
- set_ic = true;
- else
- set_ic = false;
-
- if (set_ic) {
+ tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
+ if (tx_coal && !(tx_q->tx_count_frames % tx_coal)) {
tx_q->tx_count_frames = 0;
stmmac_set_tx_ic(priv, tx_desc);
u64_stats_update_begin(&txq_stats->q_syncp);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0384/1167] ALSA: pcmtest: Fix leak at probe error
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (377 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0383/1167] net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0385/1167] ALSA: hda: Use linked list for jack table Greg Kroah-Hartman
` (278 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit d0f2ca62e89f3c666d0ec203eaa23b8d965e5443 ]
When an error happens at probe of pcmtest driver before
snd_card_register() succeeds, we have to release the card explicitly,
but it's not done, leading to a potential memory leak.
Also, pcmtest driver manages struct pcmtst object unnecessarily
complicatedly by a dynamic allocation and release.
This patch fixes and cleans up the resource management:
- Use card's private_data allocation for struct sndpcmtst at the card
creation, which is released automatically together with the card
- Since the allocation of pcmtest is gone, snd_pcmtst_create() is
rather pointless, so just directly calling snd_pcmtst_new_pcm()
- Use the new auto-clean mechanism to handle the error case at probe.
- Many release handlers became superfluous and dropped
In the end we got a good amount of code reduction.
Fixes: 315a3d57c64c ("ALSA: Implement the new Virtual PCM Test Driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172533.14667-3-tiwai@suse.de
[ sashal: adjusted context for older APIs: the deleted kzalloc() in snd_pcmtst_create() and the removed .remove_new field in the platform driver, in place of kzalloc_obj() and .remove. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/drivers/pcmtest.c | 66 +++++++----------------------------------
1 file changed, 10 insertions(+), 56 deletions(-)
diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c
index ac4a3149601ec..6b237d8274897 100644
--- a/sound/drivers/pcmtest.c
+++ b/sound/drivers/pcmtest.c
@@ -463,20 +463,6 @@ static snd_pcm_uframes_t snd_pcmtst_pcm_pointer(struct snd_pcm_substream *substr
return bytes_to_frames(substream->runtime, v_iter->buf_pos);
}
-static int snd_pcmtst_free(struct pcmtst *pcmtst)
-{
- if (!pcmtst)
- return 0;
- kfree(pcmtst);
- return 0;
-}
-
-// These callbacks are required, but empty - all freeing occurs in pdev_remove
-static int snd_pcmtst_dev_free(struct snd_device *device)
-{
- return 0;
-}
-
static void pcmtst_pdev_release(struct device *dev)
{
}
@@ -580,40 +566,9 @@ static int snd_pcmtst_new_pcm(struct pcmtst *pcmtst)
return err;
}
-static int snd_pcmtst_create(struct snd_card *card, struct platform_device *pdev,
- struct pcmtst **r_pcmtst)
-{
- struct pcmtst *pcmtst;
- int err;
- static const struct snd_device_ops ops = {
- .dev_free = snd_pcmtst_dev_free,
- };
-
- pcmtst = kzalloc(sizeof(*pcmtst), GFP_KERNEL);
- if (!pcmtst)
- return -ENOMEM;
- pcmtst->card = card;
- pcmtst->pdev = pdev;
-
- err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, pcmtst, &ops);
- if (err < 0)
- goto _err_free_chip;
-
- err = snd_pcmtst_new_pcm(pcmtst);
- if (err < 0)
- goto _err_free_chip;
-
- *r_pcmtst = pcmtst;
- return 0;
-
-_err_free_chip:
- snd_pcmtst_free(pcmtst);
- return err;
-}
-
static int pcmtst_probe(struct platform_device *pdev)
{
- struct snd_card *card;
+ struct snd_card *card __free(snd_card_free) = NULL;
struct pcmtst *pcmtst;
int err;
@@ -621,10 +576,16 @@ static int pcmtst_probe(struct platform_device *pdev)
if (err)
return err;
- err = snd_devm_card_new(&pdev->dev, index, id, THIS_MODULE, 0, &card);
+ err = snd_devm_card_new(&pdev->dev, index, id, THIS_MODULE,
+ sizeof(*pcmtst), &card);
if (err < 0)
return err;
- err = snd_pcmtst_create(card, pdev, &pcmtst);
+
+ pcmtst = card->private_data;
+ pcmtst->card = card;
+ pcmtst->pdev = pdev;
+
+ err = snd_pcmtst_new_pcm(pcmtst);
if (err < 0)
return err;
@@ -637,17 +598,11 @@ static int pcmtst_probe(struct platform_device *pdev)
return err;
platform_set_drvdata(pdev, pcmtst);
+ card = NULL; /* probe succeeded, don't release as error */
return 0;
}
-static void pdev_remove(struct platform_device *pdev)
-{
- struct pcmtst *pcmtst = platform_get_drvdata(pdev);
-
- snd_pcmtst_free(pcmtst);
-}
-
static struct platform_device pcmtst_pdev = {
.name = "pcmtest",
.dev.release = pcmtst_pdev_release,
@@ -655,7 +610,6 @@ static struct platform_device pcmtst_pdev = {
static struct platform_driver pcmtst_pdrv = {
.probe = pcmtst_probe,
- .remove_new = pdev_remove,
.driver = {
.name = "pcmtest",
},
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0385/1167] ALSA: hda: Use linked list for jack table
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (378 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0384/1167] ALSA: pcmtest: Fix leak at probe error Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0386/1167] ALSA: hda: Dont free card at probe error in vga_switcheroo handler Greg Kroah-Hartman
` (277 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 5676e013f16ac4b616d433af24647d0ce4b067aa ]
So far we've used snd_array infrastructure for managing the
hda_jack_tbl elements, but it turned out that this may lead to a UAF
when a different order of destruction procedure is applied; namely,
each hda_jack_tbl object creates a snd_jack object and sets the
private_data pointing to the hda_jack_tbl, and private_free to release
it. It looks harmless, but since snd_array may reallocate the whole
table at growing, the formerly referred jack pointer may become stale.
Fortunately, currently there is no call pattern that triggers this
issue, so it's only hypothetical, but we should address it in anyway.
There are several ways to address this, and at this time, we rather
redesign the hda_jack_tbl allocations: instead of snd_array(), do a
normal kmalloc() + linked list. There will be more kmalloc calls than
the original code, but as the number of jacks are usually at most
handful, it must not be a problem. This change allows us the
persistent jack pointer, so no stale pointer access can happen any
longer.
This also fixes another reported issue about the stale jack pointer
reference in snd_hda_jack_tbl_new(), too.
Fixes: 31ef22579302 ("ALSA: hda - Integrate input-jack stuff into kctl-jack")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007171057.7462-1-tiwai@suse.de
[ sashal: Replaced kzalloc_obj(*jack) with kzalloc(sizeof(*jack), GFP_KERNEL), dropped the missing struct hda_codec_ops context line, and kept the older SOF wake_enable body with only the jacktbl_used rename. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/sound/hda_codec.h | 6 ++-
sound/pci/hda/hda_codec.c | 1 -
sound/pci/hda/hda_jack.c | 79 ++++++++++++++++++---------------
sound/pci/hda/hda_jack.h | 1 +
sound/soc/sof/intel/hda-codec.c | 4 +-
5 files changed, 51 insertions(+), 40 deletions(-)
diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h
index de9fdfe35447a..0a7d13ede7977 100644
--- a/include/sound/hda_codec.h
+++ b/include/sound/hda_codec.h
@@ -27,6 +27,7 @@ struct hda_beep;
struct hda_codec;
struct hda_pcm;
struct hda_pcm_stream;
+struct hda_jack_tbl;
/*
* codec bus
@@ -274,7 +275,8 @@ struct hda_codec {
struct hda_codec *codec, hda_nid_t nid);
/* jack detection */
- struct snd_array jacktbl;
+ struct hda_jack_tbl *jacktbl, *jacktbl_last; /* linked list head/tail */
+ int jacktbl_used; /* number of jacktbl elements */
unsigned long jackpoll_interval; /* In jiffies. Zero means no poll, rely on unsol events */
struct delayed_work jackpoll_work;
@@ -506,7 +508,7 @@ static inline void snd_hda_set_power_save(struct hda_bus *bus, int delay) {}
static inline bool hda_codec_need_resume(struct hda_codec *codec)
{
- return !codec->relaxed_resume && codec->jacktbl.used;
+ return !codec->relaxed_resume && codec->jacktbl_used;
}
/*
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index a267724f631bb..0895d428e4591 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -942,7 +942,6 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr,
snd_array_init(&codec->driver_pins, sizeof(struct hda_pincfg), 16);
snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8);
snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16);
- snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16);
snd_array_init(&codec->verbs, sizeof(struct hda_verb *), 8);
INIT_LIST_HEAD(&codec->conn_list);
INIT_LIST_HEAD(&codec->pcm_list_head);
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 8c25c7d81128b..1ff67f839ce43 100644
--- a/sound/pci/hda/hda_jack.c
+++ b/sound/pci/hda/hda_jack.c
@@ -70,12 +70,11 @@ static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id)
struct hda_jack_tbl *
snd_hda_jack_tbl_get_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- if (!nid || !jack)
+ if (!nid)
return NULL;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid == nid && jack->dev_id == dev_id)
return jack;
return NULL;
@@ -92,12 +91,11 @@ struct hda_jack_tbl *
snd_hda_jack_tbl_get_from_tag(struct hda_codec *codec,
unsigned char tag, int dev_id)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- if (!tag || !jack)
+ if (!tag)
return NULL;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->tag == tag && jack->dev_id == dev_id)
return jack;
return NULL;
@@ -107,12 +105,11 @@ EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_get_from_tag);
static struct hda_jack_tbl *
any_jack_tbl_get_from_nid(struct hda_codec *codec, hda_nid_t nid)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- if (!nid || !jack)
+ if (!nid)
return NULL;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid == nid)
return jack;
return NULL;
@@ -136,12 +133,19 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
if (jack)
return jack;
- jack = snd_array_new(&codec->jacktbl);
+ jack = kzalloc(sizeof(*jack), GFP_KERNEL);
if (!jack)
return NULL;
jack->nid = nid;
jack->dev_id = dev_id;
jack->jack_dirty = 1;
+ if (!codec->jacktbl)
+ codec->jacktbl = jack;
+ else
+ codec->jacktbl_last->next = jack;
+ codec->jacktbl_last = jack;
+ codec->jacktbl_used++;
+
if (existing_nid_jack) {
jack->tag = existing_nid_jack->tag;
@@ -152,7 +156,7 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
*/
jack->jack_detect = existing_nid_jack->jack_detect;
} else {
- jack->tag = codec->jacktbl.used;
+ jack->tag = codec->jacktbl_used;
}
return jack;
@@ -160,10 +164,9 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
void snd_hda_jack_tbl_disconnect(struct hda_codec *codec)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- for (i = 0; i < codec->jacktbl.used; i++, jack++) {
+ for (jack = codec->jacktbl; jack; jack = jack->next) {
if (!codec->bus->shutdown && jack->jack)
snd_device_disconnect(codec->card, jack->jack);
}
@@ -171,22 +174,31 @@ void snd_hda_jack_tbl_disconnect(struct hda_codec *codec)
void snd_hda_jack_tbl_clear(struct hda_codec *codec)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack, *jack_next;
- for (i = 0; i < codec->jacktbl.used; i++, jack++) {
+ for (jack = codec->jacktbl; jack; jack = jack_next) {
struct hda_jack_callback *cb, *next;
- /* free jack instances manually when clearing/reconfiguring */
- if (!codec->bus->shutdown && jack->jack)
- snd_device_free(codec->card, jack->jack);
+ jack_next = jack->next;
+
+ if (jack->jack) {
+ /* fingers away from stale data */
+ jack->jack->private_data = NULL;
+ jack->jack->private_free = NULL;
+ /* free jack instances manually when clearing/reconfiguring */
+ if (!codec->bus->shutdown)
+ snd_device_free(codec->card, jack->jack);
+ }
for (cb = jack->callback; cb; cb = next) {
next = cb->next;
kfree(cb);
}
+ kfree(jack);
}
- snd_array_free(&codec->jacktbl);
+
+ codec->jacktbl = codec->jacktbl_last = NULL;
+ codec->jacktbl_used = 0;
}
#define get_jack_plug_state(sense) !!(sense & AC_PINSENSE_PRESENCE)
@@ -232,10 +244,9 @@ static void jack_detect_update(struct hda_codec *codec,
*/
void snd_hda_jack_set_dirty_all(struct hda_codec *codec)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid)
jack->jack_dirty = 1;
}
@@ -472,19 +483,17 @@ EXPORT_SYMBOL_GPL(snd_hda_jack_set_button_state);
void snd_hda_jack_report_sync(struct hda_codec *codec)
{
struct hda_jack_tbl *jack;
- int i, state;
+ int state;
/* update all jacks at first */
- jack = codec->jacktbl.list;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid)
jack_detect_update(codec, jack);
/* report the updated jacks; it's done after updating all jacks
* to make sure that all gating jacks properly have been set
*/
- jack = codec->jacktbl.list;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid) {
if (!jack->jack || jack->block_report)
continue;
@@ -752,10 +761,10 @@ EXPORT_SYMBOL_GPL(snd_hda_jack_unsol_event);
*/
void snd_hda_jack_poll_all(struct hda_codec *codec)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i, changes = 0;
+ struct hda_jack_tbl *jack;
+ int changes = 0;
- for (i = 0; i < codec->jacktbl.used; i++, jack++) {
+ for (jack = codec->jacktbl; jack; jack = jack->next) {
unsigned int old_sense;
if (!jack->nid || !jack->jack_dirty || jack->phantom_jack)
continue;
diff --git a/sound/pci/hda/hda_jack.h b/sound/pci/hda/hda_jack.h
index ff7d289c034bf..26bfaae393568 100644
--- a/sound/pci/hda/hda_jack.h
+++ b/sound/pci/hda/hda_jack.h
@@ -44,6 +44,7 @@ struct hda_jack_tbl {
int type;
int button_state;
struct snd_jack *jack;
+ struct hda_jack_tbl *next;
};
struct hda_jack_keymap {
diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 0bb9e547127ba..a33c00c093d14 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -84,7 +84,7 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable)
if (enable) {
list_for_each_codec(codec, hbus)
- if (codec->jacktbl.used)
+ if (codec->jacktbl_used)
mask |= BIT(codec->core.addr);
}
@@ -107,7 +107,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev)
* Wake up all jack-detecting codecs regardless whether an event
* has been recorded in STATESTS
*/
- if (codec->jacktbl.used)
+ if (codec->jacktbl_used)
pm_request_resume(&codec->core.dev);
}
EXPORT_SYMBOL_NS_GPL(hda_codec_jack_check, SND_SOC_SOF_HDA_AUDIO_CODEC);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0386/1167] ALSA: hda: Dont free card at probe error in vga_switcheroo handler
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (379 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0385/1167] ALSA: hda: Use linked list for jack table Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0387/1167] ASoC: mediatek: mt8188: Constrain UL8 FE to its back ends capabilities Greg Kroah-Hartman
` (276 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 7e1ad3c55baa80399f1727dfd2303fa4d1558d9a ]
The vga_switcheroo handler azx_vs_set_state() calls
azx_probe_contine() for enabling the audio, and if an error happens
during the probe, azx_probe_continue() releases its associated sound
card object at the error path. The card release procedure includes
the call of vga_switcheroo_unregister_client(), and this triggers the
vgasr_mutex lock again that had been already held by the caller
(vga_switcheroo_process_delayed_switch()) -- leading to a deadlock.
(Moreover, the card release will cause a potential UAF at the error
message in azx_vs_set_state() since the card object is already gone;
this was the original report by Sashiko.)
For avoiding the unneeded crash, it's better to avoid the card release
in this error path, so we make azx_probe_continue() behaving
conditionally. In return, set hda->init_failed flag, so that any
further (re-)attempts will be filtered after that point.
The check of hda->init_failed is dropped from azx_vs_can_switch().
It's because otherwise vga_switcheroo can't be switched to turn off
GPU once when a probe error happens at the audio side.
Fixes: 39173303c838 ("ALSA: hda: Free card instance properly at probe errors")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20261007213728.155092-1-tiwai%40suse.de
Link: https://patch.msgid.link/20261007223448.172443-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: added a free_on_error parameter to azx_probe_continue() and updated azx_firmware_cb() to pass true, since this tree still has that third caller. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/hda_intel.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index abef69c82a645..6cf99154e528c 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1178,7 +1178,7 @@ static const struct dev_pm_ops azx_pm = {
#endif /* CONFIG_PM */
-static int azx_probe_continue(struct azx *chip);
+static int azx_probe_continue(struct azx *chip, bool free_on_error);
#ifdef SUPPORT_VGA_SWITCHEROO
static struct pci_dev *get_bound_vga(struct pci_dev *pci);
@@ -1205,8 +1205,10 @@ static void azx_vs_set_state(struct pci_dev *pci,
if (!disabled) {
dev_info(chip->card->dev,
"Start delayed initialization\n");
- if (azx_probe_continue(chip) < 0)
+ if (azx_probe_continue(chip, false) < 0) {
+ hda->init_failed = 1;
dev_err(chip->card->dev, "initialization error\n");
+ }
}
} else {
dev_info(chip->card->dev, "%s via vga_switcheroo\n",
@@ -1245,8 +1247,6 @@ static bool azx_vs_can_switch(struct pci_dev *pci)
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
wait_for_completion(&hda->probe_wait);
- if (hda->init_failed)
- return false;
if (chip->disabled || !hda->probe_continued)
return true;
if (snd_hda_lock_devices(&chip->bus))
@@ -1740,7 +1740,7 @@ static void azx_check_snoop_available(struct azx *chip)
static void azx_probe_work(struct work_struct *work)
{
struct hda_intel *hda = container_of(work, struct hda_intel, probe_work.work);
- azx_probe_continue(&hda->chip);
+ azx_probe_continue(&hda->chip, true);
}
static int default_bdl_pos_adj(struct azx *chip)
@@ -2059,7 +2059,7 @@ static void azx_firmware_cb(const struct firmware *fw, void *context)
dev_err(card->dev, "Cannot load firmware, continue without patching\n");
if (!chip->disabled) {
/* continue probing */
- azx_probe_continue(chip);
+ azx_probe_continue(chip, true);
}
}
#endif
@@ -2305,7 +2305,7 @@ static const unsigned int azx_max_codecs[AZX_NUM_DRIVERS] = {
[AZX_DRIVER_TERA] = 1,
};
-static int azx_probe_continue(struct azx *chip)
+static int azx_probe_continue(struct azx *chip, bool free_on_error)
{
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
struct hdac_bus *bus = azx_bus(chip);
@@ -2416,10 +2416,12 @@ static int azx_probe_continue(struct azx *chip)
out_free:
if (err < 0) {
- pci_set_drvdata(pci, NULL);
if (hda->vga_switcheroo_registered)
dev_warn(&pci->dev, "GPU sound probed, but not operational: please add a quirk to driver_denylist\n");
- snd_card_free(chip->card);
+ if (free_on_error) {
+ pci_set_drvdata(pci, NULL);
+ snd_card_free(chip->card);
+ }
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0387/1167] ASoC: mediatek: mt8188: Constrain UL8 FE to its back ends capabilities
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (380 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0386/1167] ALSA: hda: Dont free card at probe error in vga_switcheroo handler Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0388/1167] wifi: nl80211: reject zero RNR/MBSSID elements Greg Kroah-Hartman
` (275 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michał Kopeć, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michał Kopeć <michal@nozomi.space>
[ Upstream commit 76775717c4adc283d5e7aed469468c8fa1ada4a7 ]
UL8 advertises up to 24 channels, but its only back end, ETDM1_IN,
supports at most 16, and its bit clock is limited to 24.576 MHz.
Without merged constraints, userspace can open UL8 with 48 kHz, 24
channels and 32-bit slots, which then fails in hw_params:
mtk_dai_etdm_configure bck rate 36864000 not support
ASoC error (-22): at snd_soc_dai_hw_params() on ETDM1_IN
Set dpcm_merged_chan/rate/format, as the DL front ends already do, so
the FE only offers configurations the back end can accept.
Fixes: 96035d46d4b4 ("ASoC: mediatek: mt8188: add machine driver with mt6359")
Signed-off-by: Michał Kopeć <michal@nozomi.space>
Link: https://patch.msgid.link/20261003194501.832558-4-michal@nozomi.space
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Kept the tree's .dpcm_capture = 1, in the UL8 front-end entry instead of upstream's .capture_only = 1, and added the three dpcm_merged flags after it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8188/mt8188-mt6359.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
index 61813b658e3b4..835b683d9108b 100644
--- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
+++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
@@ -900,6 +900,9 @@ static struct snd_soc_dai_link mt8188_mt6359_dai_links[] = {
},
.dynamic = 1,
.dpcm_capture = 1,
+ .dpcm_merged_chan = 1,
+ .dpcm_merged_rate = 1,
+ .dpcm_merged_format = 1,
SND_SOC_DAILINK_REG(capture8),
},
[DAI_LINK_UL9_FE] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0388/1167] wifi: nl80211: reject zero RNR/MBSSID elements
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (381 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0387/1167] ASoC: mediatek: mt8188: Constrain UL8 FE to its back ends capabilities Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0389/1167] wifi: mac80211: limit injected HT/VHT MCSes Greg Kroah-Hartman
` (274 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit c767e1173aeab7825a8dfb197041d3996db84e39 ]
That's a nonsensical configuration, and we get errors
reported further down in mac80211 for it; hostapd has
code that only adds the nested element if it'll not be
an empty list.
Remove an unnecessary NULL check while at it.
Fixes: dbbb27e183b1 ("cfg80211: support RNR for EMA AP")
Assisted-by: LLM
Link: https://patch.msgid.link/20261005224950.97db49d9d104.I5765a3310528b3d1cb1673dc90ad5ab5fc3ea571@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ sashal: adjusted context to keep the older kzalloc(struct_size(...), GFP_KERNEL) allocation instead of kzalloc_flex(), placing the zero-element checks before it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/wireless/nl80211.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 08d321ce1a64a..b895c14a8700f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5482,6 +5482,9 @@ nl80211_parse_mbssid_elems(struct wiphy *wiphy, struct nlattr *attrs,
num_elems++;
}
+ if (!num_elems)
+ return ERR_PTR(-EINVAL);
+
elems = kzalloc(struct_size(elems, elem, num_elems), GFP_KERNEL);
if (!elems)
return ERR_PTR(-ENOMEM);
@@ -5517,6 +5520,9 @@ nl80211_parse_rnr_elems(struct wiphy *wiphy, struct nlattr *attrs,
num_elems++;
}
+ if (!num_elems)
+ return ERR_PTR(-EINVAL);
+
elems = kzalloc(struct_size(elems, elem, num_elems), GFP_KERNEL);
if (!elems)
return ERR_PTR(-ENOMEM);
@@ -5665,7 +5671,8 @@ static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev,
if (IS_ERR(rnr))
return PTR_ERR(rnr);
- if (rnr && rnr->cnt < bcn->mbssid_ies->cnt) {
+ /* RNR elements are only used with MBSSID elements */
+ if (rnr->cnt < bcn->mbssid_ies->cnt) {
kfree(rnr);
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0389/1167] wifi: mac80211: limit injected HT/VHT MCSes
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (382 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0388/1167] wifi: nl80211: reject zero RNR/MBSSID elements Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0390/1167] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure Greg Kroah-Hartman
` (273 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit 22d8e38161c722fe6e7ffb2a4c7fadab0f111271 ]
With radiotap injection the HT/VHT MCSes can be just
about anything, but that can later get problematic.
Limit them to the rates the device reports, which is
presumably going to be a subset of what mac80211 can
do, except for HT MCS 32 which some devices report as
supported, but then TX status can't deal with it.
If it's not supported just ignore the config.
Assisted-by: LLM
Fixes: dfdfc2beb0dd ("mac80211: Parse legacy and HT rate in injected frames")
Fixes: 646e76bb5daf ("mac80211: parse VHT info in injected frames")
Link: https://patch.msgid.link/20261005224950.68e210b8487a.I2ee0e4664c54cf31002eb9e4f5190fd05ff4130f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ sashal: Dropped the antenna-reset and chandef/bandwidth context the tree lacks, and placed the new VHT helper before ieee80211_parse_tx_radiotap() instead of after ieee80211_rate_bw_usable(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 9e9b5ad93be18..96ee7798a6b49 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2144,6 +2144,27 @@ static bool ieee80211_validate_radiotap_len(struct sk_buff *skb)
return true;
}
+static bool
+ieee80211_vht_tx_rate_supported(const struct ieee80211_sta_vht_cap *vht_cap,
+ u8 mcs, u8 nss)
+{
+ u16 map = le16_to_cpu(vht_cap->vht_mcs.tx_mcs_map);
+
+ if (!vht_cap->vht_supported)
+ return false;
+
+ switch ((map >> (2 * (nss - 1))) & 3) {
+ case IEEE80211_VHT_MCS_SUPPORT_0_7:
+ return mcs <= 7;
+ case IEEE80211_VHT_MCS_SUPPORT_0_8:
+ return mcs <= 8;
+ case IEEE80211_VHT_MCS_SUPPORT_0_9:
+ return mcs <= 9;
+ default:
+ return false;
+ }
+}
+
bool ieee80211_parse_tx_radiotap(struct sk_buff *skb,
struct net_device *dev)
{
@@ -2322,10 +2343,16 @@ bool ieee80211_parse_tx_radiotap(struct sk_buff *skb,
}
if (rate_flags & IEEE80211_TX_RC_MCS) {
- info->control.rates[0].idx = rate;
+ /* MCS 32 and up aren't handled, e.g. by TX status */
+ if (sband && sband->ht_cap.ht_supported && rate < 32 &&
+ sband->ht_cap.mcs.rx_mask[rate / 8] & BIT(rate % 8))
+ info->control.rates[0].idx = rate;
} else if (rate_flags & IEEE80211_TX_RC_VHT_MCS) {
- ieee80211_rate_set_vht(info->control.rates, vht_mcs,
- vht_nss);
+ if (sband &&
+ ieee80211_vht_tx_rate_supported(&sband->vht_cap,
+ vht_mcs, vht_nss))
+ ieee80211_rate_set_vht(info->control.rates,
+ vht_mcs, vht_nss);
} else if (sband) {
for (i = 0; i < sband->n_bitrates; i++) {
if (rate * 5 != sband->bitrates[i].bitrate)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0390/1167] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (383 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0389/1167] wifi: mac80211: limit injected HT/VHT MCSes Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0391/1167] fs/resctrl: Ensure default group reports tasks on monitor-only systems Greg Kroah-Hartman
` (272 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Romanovsky, Bjorn Helgaas,
Tushar Dave, Logan Gunthorpe, Jason Gunthorpe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <leonro@nvidia.com>
[ Upstream commit 7c4d6505a1f8a1ebe8019b7f988ed494b696653b ]
pci_p2pdma_add_resource() installs pci_p2pdma_unmap_mappings() as a devres
action with the devres allocated p2p_pgmap as its data, and only then adds
the range to the pool:
error = devm_add_action_or_reset(&pdev->dev, pci_p2pdma_unmap_mappings,
p2p_pgmap);
if (error)
goto pages_free;
p2pdma = rcu_dereference_protected(pdev->p2pdma, 1);
error = gen_pool_add_owner(p2pdma->pool, ...);
if (error)
goto pages_free;
The action removes the allocate attribute for the whole device, which tears
down existing userspace mappings of every BAR already registered on it.
Both failures here get that wrong, in opposite ways.
devm_add_action_or_reset() runs the action when it cannot allocate its
devres node, so an -ENOMEM while registering a second BAR unmaps the first
one. Use devm_add_action() and let the error path unwind only what this
call created.
gen_pool_add_owner() allocates a chunk and can also fail with -ENOMEM.
There the action is registered, and the error path frees p2p_pgmap with
devm_kfree() while leaving the action pointing at it. On unbind devres
runs the action and pci_p2pdma_unmap_mappings() dereferences
p2p_pgmap->mem->owner->kobj, which is freed memory. Give that failure its
own label and drop the action with devm_remove_action(), which removes it
without running it.
Fixes: 7e9c7ef83d78 ("PCI/P2PDMA: Allow userspace VMA allocations through sysfs")
Fixes: f58ef9d1d135 ("PCI/P2PDMA: Separate the mmap() support from the core logic")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Tushar Dave <tdave@nvidia.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://patch.msgid.link/20260830-batch-p2p-fixes-v1-1-5044e8dfbe2e@nvidia.com
[ sashal: Passes this tree's pdev as the devres data to devm_add_action() and devm_remove_action() instead of upstream's p2p_pgmap, because the unmap callback here takes pdev. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/p2pdma.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index ffdf4360fdcf0..6527b86ee58a2 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -331,8 +331,7 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size,
goto pgmap_free;
}
- error = devm_add_action_or_reset(&pdev->dev, pci_p2pdma_unmap_mappings,
- pdev);
+ error = devm_add_action(&pdev->dev, pci_p2pdma_unmap_mappings, pdev);
if (error)
goto pages_free;
@@ -342,13 +341,15 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size,
range_len(&pgmap->range), dev_to_node(&pdev->dev),
&pgmap->ref);
if (error)
- goto pages_free;
+ goto mappings_remove;
pci_info(pdev, "added peer-to-peer DMA memory %#llx-%#llx\n",
pgmap->range.start, pgmap->range.end);
return 0;
+mappings_remove:
+ devm_remove_action(&pdev->dev, pci_p2pdma_unmap_mappings, pdev);
pages_free:
devm_memunmap_pages(&pdev->dev, pgmap);
pgmap_free:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0391/1167] fs/resctrl: Ensure default group reports tasks on monitor-only systems
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (384 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0390/1167] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0392/1167] RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq Greg Kroah-Hartman
` (271 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tony Luck,
Borislav Petkov (AMD), Reinette Chatre, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Luck <tony.luck@intel.com>
[ Upstream commit 2c10b3fa5bdf61e344bc522e6c2e00d870ce7ab8 ]
resctrl can be mounted on a system that supports monitoring but not allocation.
On such a system reading the "tasks" file in the default group reports no
tasks, even when there are tasks assigned to the default group. This problem
occurs because the check for whether a task belongs to a CTRL_MON group is
gated by a check for whether the system supports allocation.
The resctrl_arch_alloc_capable() check in is_closid_match() breaks task
reporting for the default group on monitor-only systems so remove this check.
On systems that support allocation the check is redundant.
Fixes: e6b2fac36fcc ("x86/resctrl: Use is_closid_match() in more places")
Closes: https://sashiko.dev/#/patchset/20260831174421.13921-1-tony.luck%40intel.com?part=9
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://patch.msgid.link/20261009193923.15498-1-tony.luck@intel.com
[ sashal: adapted the change to the old file location, using the rdt_alloc_capable flag context and a direct t->closid == r->closid comparison instead of the newer arch helpers ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 02394f49a7c93..11a11bc99ccec 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -606,8 +606,7 @@ static int __rdtgroup_move_task(struct task_struct *tsk,
static bool is_closid_match(struct task_struct *t, struct rdtgroup *r)
{
- return (rdt_alloc_capable &&
- (r->type == RDTCTRL_GROUP) && (t->closid == r->closid));
+ return ((r->type == RDTCTRL_GROUP) && (t->closid == r->closid));
}
static bool is_rmid_match(struct task_struct *t, struct rdtgroup *r)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0392/1167] RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (385 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0391/1167] fs/resctrl: Ensure default group reports tasks on monitor-only systems Greg Kroah-Hartman
@ 2026-12-04 9:56 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0393/1167] RDMA/core: Clear driver_udata before destroying objects in rdma_core Greg Kroah-Hartman
` (270 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:56 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Quanye Yang, Farhad Alemi, Jack Wang,
Leon Romanovsky, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quanye Yang <quanyeyang@proton.me>
[ Upstream commit 3255d6b83491574b115806ec958d8f6ca090fa9c ]
On disconnect the client error recovery path calls ib_drain_qp(), which
requires one free RQ slot and that no recv WQEs are posted while the
queue is being drained.
When the server is loaded with always_invalidate=N, the path does not
advertise RTRS_MSG_NEW_RKEY_F. A client-requested invalidation is then
a standalone SEND_WITH_INV. The recv completion path did not repost
that WQE; it posted two empty recv WQEs later, when the RDMA-with-IMM
response carried RTRS_IO_RSP_W_INV_IMM. If the invalidate receive
never arrived, each such response increased RQ occupancy by one until
ib_post_recv() started returning -ENOMEM and __ib_drain_rq() failed
with:
failed to drain recv queue: -12
Repost one empty recv WQE for every receive completion, including
SEND_WITH_INV completions on the always_invalidate=N path, and only
while the path is still connected so CQ polling cannot race with
ib_drain_qp(). Size IO connection RQs to 2 * queue_depth + 1 to match
the posted recv count and leave the drain slot.
Tested with a synthetic RTRS client flooding unpaired
RTRS_IO_RSP_W_INV_IMM messages; error recovery no longer triggers
__ib_drain_rq() warnings.
Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
Signed-off-by: Quanye Yang <quanyeyang@proton.me>
Link: https://lore.kernel.org/linux-rdma/CA+0ovCihE2_pxLimjmmR8NMz4g-ie8dvvq1jmAj-Om33y3Vzfg@mail.gmail.com
Link: https://patch.msgid.link/20261005-rtrs-fix-ib-drain-rq-v2-1-35535a3ed115@proton.me
Tested-by: Quanye Yang <quanyeyang@proton.me>
Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Kept the branch's min_t(int, ...) form and older error-message context, changing only the intended queue_depth * 3 + 1 to * 2 + 1 and dropping the old repost block in favor of the new helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 45 +++++++++-----------------
1 file changed, 15 insertions(+), 30 deletions(-)
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index 068016c3413be..1d113f39e0b8b 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -584,25 +584,21 @@ static struct ib_cqe io_comp_cqe = {
.done = rtrs_clt_rdma_done
};
-/*
- * Post x2 empty WRs: first is for this RDMA with IMM,
- * second is for RECV with INV, which happened earlier.
- */
-static int rtrs_post_recv_empty_x2(struct rtrs_con *con, struct ib_cqe *cqe)
+static int rtrs_clt_repost_recv(struct rtrs_clt_con *con)
{
- struct ib_recv_wr wr_arr[2], *wr;
- int i;
+ struct rtrs_clt_path *clt_path = to_clt_path(con->c.path);
+ int err;
- memset(wr_arr, 0, sizeof(wr_arr));
- for (i = 0; i < ARRAY_SIZE(wr_arr); i++) {
- wr = &wr_arr[i];
- wr->wr_cqe = cqe;
- if (i)
- /* Chain backwards */
- wr->next = &wr_arr[i - 1];
- }
+ if (READ_ONCE(clt_path->state) != RTRS_CLT_CONNECTED)
+ return 0;
- return ib_post_recv(con->qp, wr, NULL);
+ err = rtrs_post_recv_empty(&con->c, &io_comp_cqe);
+ if (err) {
+ rtrs_err(con->c.path, "rtrs_post_recv_empty(): %pe\n",
+ ERR_PTR(err));
+ rtrs_rdma_error_recovery(con);
+ }
+ return err;
}
static void rtrs_clt_rdma_done(struct ib_cq *cq, struct ib_wc *wc)
@@ -663,19 +659,7 @@ static void rtrs_clt_rdma_done(struct ib_cq *cq, struct ib_wc *wc)
rtrs_wrn(con->c.path, "Unknown IMM type %u\n",
imm_type);
}
- if (w_inval)
- /*
- * Post x2 empty WRs: first is for this RDMA with IMM,
- * second is for RECV with INV, which happened earlier.
- */
- err = rtrs_post_recv_empty_x2(&con->c, &io_comp_cqe);
- else
- err = rtrs_post_recv_empty(&con->c, &io_comp_cqe);
- if (err) {
- rtrs_err(con->c.path, "rtrs_post_recv_empty(): %d\n",
- err);
- rtrs_rdma_error_recovery(con);
- }
+ rtrs_clt_repost_recv(con);
break;
case IB_WC_RECV:
/*
@@ -691,6 +675,7 @@ static void rtrs_clt_rdma_done(struct ib_cq *cq, struct ib_wc *wc)
return rtrs_clt_rkey_rsp_done(con, wc);
}
+ rtrs_clt_repost_recv(con);
break;
case IB_WC_RDMA_WRITE:
/*
@@ -1709,7 +1694,7 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)
/* QD * (REQ + RSP + FR REGS or INVS) + drain */
clt_path->queue_depth * 4 + 1);
max_recv_wr = min_t(int, wr_limit,
- clt_path->queue_depth * 3 + 1);
+ clt_path->queue_depth * 2 + 1);
max_send_sge = 2;
}
atomic_set(&con->c.sq_wr_avail, max_send_wr);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0393/1167] RDMA/core: Clear driver_udata before destroying objects in rdma_core
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (386 preceding siblings ...)
2026-12-04 9:56 ` [PATCH 6.6 0392/1167] RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0394/1167] dmaengine: ste_dma40: Preserve the LCPA I/O address space Greg Kroah-Hartman
` (269 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jacob Moroni, Leon Romanovsky,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Moroni <jmoroni@google.com>
[ Upstream commit d37e98844afea39a9614cac0de837701263c90f7 ]
When uobject creation fails while copying user output data (i.e.,
after the HW object has been created), it calls
rdma_alloc_abort_uobject() with hw_obj_valid=true which then
invokes the object's destroy callback, but passes the
uverbs_attr_bundle from the original creation command.
The issue is that drivers are expected to validate the udata
and return an error if there's unexpected content, and data from
the wrong command counts as "unexpected content", so this ends
up causing the driver's destroy call to fail.
A similar issue exists in the rereg_mr path when a new MR
is created and the old one is destroyed.
Fix this by clearing driver_udata before invoking the driver's
destroy method.
Fixes: 6e0954b11c05 ("RDMA/uverbs: Allow drivers to create a new HW object during rereg_mr")
Fixes: 0ac8903cbbe6 ("RDMA/core: Allow the ioctl layer to abort a fully created uobject")
Signed-off-by: Jacob Moroni <jmoroni@google.com>
Link: https://patch.msgid.link/20261006152908.888059-1-jmoroni@google.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Only the two uverbs_get_cleared_udata(attrs) calls in rdma_core.c were applied. The upstream inline-helper move and the create_qp() cleanup were dropped because the helper already exists out-of-line here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/rdma_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c
index 29b1ab1d5f933..54d008e9ae85a 100644
--- a/drivers/infiniband/core/rdma_core.c
+++ b/drivers/infiniband/core/rdma_core.c
@@ -687,6 +687,7 @@ void rdma_assign_uobject(struct ib_uobject *to_uobj, struct ib_uobject *new_uobj
* If this fails then the uobject is still completely valid (though with
* a new ID) and we leak it until context close.
*/
+ uverbs_get_cleared_udata(attrs);
uverbs_destroy_uobject(to_uobj, RDMA_REMOVE_DESTROY, attrs);
}
@@ -702,6 +703,7 @@ void rdma_alloc_abort_uobject(struct ib_uobject *uobj,
int ret;
if (hw_obj_valid) {
+ uverbs_get_cleared_udata(attrs);
ret = uobj->uapi_object->type_class->destroy_hw(
uobj, RDMA_REMOVE_ABORT, attrs);
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0394/1167] dmaengine: ste_dma40: Preserve the LCPA I/O address space
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (387 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0393/1167] RDMA/core: Clear driver_udata before destroying objects in rdma_core Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0395/1167] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure Greg Kroah-Hartman
` (268 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Linus Walleij,
Frank Li, Vinod Koul, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 42c31fec1ca76b8b5f7759def122d418dff2cd4b ]
The LCPA area is mapped with devm_ioremap(), but lcpa_base and the
per-channel lcpa pointer lack __iomem annotations. This loses the I/O
address space and makes sparse warn when d40_current_addr() assigns
LCPA register addresses to its __iomem pointers.
Annotate both pointers and the LCPA argument of d40_log_lli_lcpa_write()
to preserve the I/O address space from the mapping to the register
accessors. This also fixes the existing LCPA read and write warnings
without changing the generated code.
Fixes: c80edceff29e ("dmaengine: ste_dma40: Fix cyclic transfer residue")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610090216.pjMRxhRL-lkp@intel.com/
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20261010-dma40-smatch-fix-v1-1-26ca10043957@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 4 ++--
drivers/dma/ste_dma40_ll.c | 8 ++++----
drivers/dma/ste_dma40_ll.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index b645d83d0306b..fe27e5ce296a0 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -511,7 +511,7 @@ struct d40_chan {
u32 src_def_cfg;
u32 dst_def_cfg;
struct d40_def_lcsp log_def;
- struct d40_log_lli_full *lcpa;
+ struct d40_log_lli_full __iomem *lcpa;
/* Runtime reconfiguration */
dma_addr_t runtime_addr;
enum dma_transfer_direction runtime_direction;
@@ -619,7 +619,7 @@ struct d40_base {
/* Physical half channels */
struct d40_phy_res *phy_res;
struct d40_lcla_pool lcla_pool;
- void *lcpa_base;
+ void __iomem *lcpa_base;
dma_addr_t phy_lcpa;
resource_size_t lcpa_size;
struct kmem_cache *desc_slab;
diff --git a/drivers/dma/ste_dma40_ll.c b/drivers/dma/ste_dma40_ll.c
index 4c489b126cb27..3be7f5b1abb08 100644
--- a/drivers/dma/ste_dma40_ll.c
+++ b/drivers/dma/ste_dma40_ll.c
@@ -333,10 +333,10 @@ static void d40_log_lli_link(struct d40_log_lli *lli_dst,
(dlos << D40_MEM_LCSP1_SLOS_POS);
}
-void d40_log_lli_lcpa_write(struct d40_log_lli_full *lcpa,
- struct d40_log_lli *lli_dst,
- struct d40_log_lli *lli_src,
- int next, unsigned int flags)
+void d40_log_lli_lcpa_write(struct d40_log_lli_full __iomem *lcpa,
+ struct d40_log_lli *lli_dst,
+ struct d40_log_lli *lli_src,
+ int next, unsigned int flags)
{
d40_log_lli_link(lli_dst, lli_src, next, flags);
diff --git a/drivers/dma/ste_dma40_ll.h b/drivers/dma/ste_dma40_ll.h
index b04c4e92b4ed0..171249527fde2 100644
--- a/drivers/dma/ste_dma40_ll.h
+++ b/drivers/dma/ste_dma40_ll.h
@@ -455,7 +455,7 @@ int d40_log_sg_to_lli(struct scatterlist *sg,
u32 lcsp13, /* src or dst*/
u32 data_width1, u32 data_width2);
-void d40_log_lli_lcpa_write(struct d40_log_lli_full *lcpa,
+void d40_log_lli_lcpa_write(struct d40_log_lli_full __iomem *lcpa,
struct d40_log_lli *lli_dst,
struct d40_log_lli *lli_src,
int next, unsigned int flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0395/1167] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (388 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0394/1167] dmaengine: ste_dma40: Preserve the LCPA I/O address space Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0396/1167] mailbox: arm_mhu_db: " Greg Kroah-Hartman
` (267 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anup Vishwakarma, Mukesh Ojha,
Jassi Brar, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
[ Upstream commit da988ac6afe152f802140ccaa0ad5e8f675b8814 ]
qcom_ipcc_probe() registers the mailbox controller via
devm_mbox_controller_register(), which automatically calls
mbox_controller_unregister() through devres when the device is removed
or probe fails. If devm_request_irq() subsequently fails, the
err_req_irq: label also manually calls mbox_controller_unregister(),
resulting in a double call that corrupts the global mailbox controller
list and causes a kernel panic.
Remove the redundant manual call and rely on devres for cleanup.
Fixes: e9d50e4b4d04 ("mailbox: qcom-ipcc: Dynamic alloc for channel arrangement")
Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
[ sashal: Changed the devm_request_irq() failure path to goto err_mbox while keeping this branch's braced dev_err block, which upstream's bare goto context didn't match. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mailbox/qcom-ipcc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
index 7426fc5e02e4b..a9bc524719201 100644
--- a/drivers/mailbox/qcom-ipcc.c
+++ b/drivers/mailbox/qcom-ipcc.c
@@ -321,16 +321,13 @@ static int qcom_ipcc_probe(struct platform_device *pdev)
IRQF_NO_THREAD, name, ipcc);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to register the irq: %d\n", ret);
- goto err_req_irq;
+ goto err_mbox;
}
platform_set_drvdata(pdev, ipcc);
return 0;
-err_req_irq:
- if (ipcc->num_chans)
- mbox_controller_unregister(&ipcc->mbox);
err_mbox:
irq_domain_remove(ipcc->irq_domain);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0396/1167] mailbox: arm_mhu_db: Remove redundant mbox_controller_unregister() on probe failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (389 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0395/1167] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0397/1167] seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk() Greg Kroah-Hartman
` (266 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anup Vishwakarma, Mukesh Ojha,
Jassi Brar, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
[ Upstream commit 8228ed61b6cbd6e79531c9ebfcad233c35eae562 ]
mhu_db_probe() registers the mailbox controller via
devm_mbox_controller_register(), which automatically calls
mbox_controller_unregister() through devres when the device is removed
or probe fails. If devm_request_threaded_irq() subsequently fails in
the channel setup loop, the error path also manually calls
mbox_controller_unregister(), resulting in a double call that corrupts
the global mailbox controller list and causes a kernel panic.
Remove the redundant manual call and rely on devres for cleanup.
Fixes: 7002ca237b21 ("mailbox: arm_mhu: Add ARM MHU doorbell driver")
Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
[ sashal: Dropped only the mbox_controller_unregister() line, keeping the braces and the dev_err() that upstream no longer has in that branch, since the older dev_err cleanup isn't in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mailbox/arm_mhu_db.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mailbox/arm_mhu_db.c b/drivers/mailbox/arm_mhu_db.c
index 27a510d469082..b6eeef867cbfc 100644
--- a/drivers/mailbox/arm_mhu_db.c
+++ b/drivers/mailbox/arm_mhu_db.c
@@ -319,7 +319,6 @@ static int mhu_db_probe(struct amba_device *adev, const struct amba_id *id)
IRQF_ONESHOT, "mhu_db_link", mhu);
if (err) {
dev_err(dev, "Can't claim IRQ %d\n", irq);
- mbox_controller_unregister(&mhu->mbox);
return err;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0397/1167] seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (390 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0396/1167] mailbox: arm_mhu_db: " Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0398/1167] ALSA: control_led: Fix deadlock between sysfs writes and card disconnect Greg Kroah-Hartman
` (265 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kees Cook, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <kees@kernel.org>
[ Upstream commit a09fb764832dd7dbb9ccc38a9830f7294889c8ae ]
seq_buf_do_printk() prints a buffer line by line, then prints whatever
follows the last newline. When a string has overflowed at exactly a
newline, an empty line is printed since the pointer hasn't reached the
overflow mark of the seq_buf. Switch to just check if the string is
already empty and only print if not.
The only caller is the memory cgroup OOM report, so this could only ever
add a blank line to a report whose statistics already did not fit.
Add a test that registers a console to count the records that
seq_buf_do_printk() emits. It counts the records carrying the test's
marker, and the records holding nothing but a line feed that arrive
after one, so that unrelated kernel messages do not disturb it. Both
states that reach the flaw are covered: exactly full, and overflowed.
Tests passed under qemu on ARCH=x86_64 with GCC 16.2.0 and CONFIG_KASAN=y,
and on big-endian ARCH=s390 with GCC s390x-linux-gnu 16.2.0.
Fixes: 96928d9032a7c ("seq_buf: Add seq_buf_do_printk() helper")
Assisted-by: LLM
Link: https://patch.msgid.link/20261005155708.1471260-1-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
[ sashal: Dropped the test-file hunk because the KUnit test file doesn't exist in this tree, and applied only the one-line seq_buf_do_printk() fix. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/seq_buf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/seq_buf.c b/lib/seq_buf.c
index 23518f77ea9c5..1cd32ae73ad32 100644
--- a/lib/seq_buf.c
+++ b/lib/seq_buf.c
@@ -118,7 +118,7 @@ void seq_buf_do_printk(struct seq_buf *s, const char *lvl)
}
/* No trailing LF */
- if (start < s->buffer + s->len)
+ if (*start)
printk("%s%s\n", lvl, start);
}
EXPORT_SYMBOL_GPL(seq_buf_do_printk);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0398/1167] ALSA: control_led: Fix deadlock between sysfs writes and card disconnect
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (391 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0397/1167] seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk() Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0399/1167] drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove Greg Kroah-Hartman
` (264 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ali Ahmet Memiş, Takashi Iwai,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ali Ahmet Memiş <aliamemis@disroot.org>
[ Upstream commit 682d6bb5f783adea7fa2a5b05166bff01b338081 ]
snd_ctl_led_disconnect() removes the ctl-led sysfs files while
holding card->controls_rwsem. device_unregister() waits for running
sysfs callbacks which can deadlock when a concurrent write causes
the attach or detach callback to wait for controls_rwsem.
Break kernfs active protection in the attach, detach and list
callbacks and hold a module reference instead.
Fixes: a135dfb5de15 ("ALSA: led control - add sysfs kcontrol LED marking layer")
Signed-off-by: Ali Ahmet Memiş <aliamemis@disroot.org>
Link: https://patch.msgid.link/20261011180627.1594051-1-aliamemis@disroot.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Adapted the snd_ctl_led_list() context to this tree's plain struct snd_card *card; declaration with manual snd_card_unref(), instead of the scoped-cleanup helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/control_led.c | 62 ++++++++++++++++++++++++++++++++++++----
1 file changed, 57 insertions(+), 5 deletions(-)
diff --git a/sound/core/control_led.c b/sound/core/control_led.c
index 639d86e4dd162..9ef65c89af5c9 100644
--- a/sound/core/control_led.c
+++ b/sound/core/control_led.c
@@ -584,12 +584,43 @@ static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, si
return count;
}
+/*
+ * snd_ctl_led_disconnect() removes these files with card->controls_rwsem
+ * held. so don't let the removal wait for a callback that takes it.
+ */
+static struct kernfs_node *snd_ctl_led_sysfs_enter(struct device *dev,
+ struct device_attribute *attr)
+{
+ struct kernfs_node *kn;
+
+ if (!try_module_get(THIS_MODULE))
+ return NULL;
+ kn = sysfs_break_active_protection(&dev->kobj, &attr->attr);
+ if (!kn)
+ module_put(THIS_MODULE);
+ return kn;
+}
+
+static void snd_ctl_led_sysfs_exit(struct kernfs_node *kn)
+{
+ sysfs_unbreak_active_protection(kn);
+ module_put(THIS_MODULE);
+}
+
static ssize_t attach_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct snd_ctl_led_card *led_card = container_of(dev, struct snd_ctl_led_card, dev);
- return set_led_id(led_card, buf, count, true);
+ struct kernfs_node *kn;
+ ssize_t ret;
+
+ kn = snd_ctl_led_sysfs_enter(dev, attr);
+ if (!kn)
+ return -ENODEV;
+ ret = set_led_id(led_card, buf, count, true);
+ snd_ctl_led_sysfs_exit(kn);
+ return ret;
}
static ssize_t detach_store(struct device *dev,
@@ -597,7 +628,15 @@ static ssize_t detach_store(struct device *dev,
const char *buf, size_t count)
{
struct snd_ctl_led_card *led_card = container_of(dev, struct snd_ctl_led_card, dev);
- return set_led_id(led_card, buf, count, false);
+ struct kernfs_node *kn;
+ ssize_t ret;
+
+ kn = snd_ctl_led_sysfs_enter(dev, attr);
+ if (!kn)
+ return -ENODEV;
+ ret = set_led_id(led_card, buf, count, false);
+ snd_ctl_led_sysfs_exit(kn);
+ return ret;
}
static ssize_t reset_store(struct device *dev,
@@ -615,10 +654,8 @@ static ssize_t reset_store(struct device *dev,
return count;
}
-static ssize_t list_show(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t snd_ctl_led_list(struct snd_ctl_led_card *led_card, char *buf)
{
- struct snd_ctl_led_card *led_card = container_of(dev, struct snd_ctl_led_card, dev);
struct snd_card *card;
struct snd_ctl_led_ctl *lctl;
size_t l = 0;
@@ -644,6 +681,21 @@ static ssize_t list_show(struct device *dev,
return l;
}
+static ssize_t list_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct snd_ctl_led_card *led_card = container_of(dev, struct snd_ctl_led_card, dev);
+ struct kernfs_node *kn;
+ ssize_t ret;
+
+ kn = snd_ctl_led_sysfs_enter(dev, attr);
+ if (!kn)
+ return -ENODEV;
+ ret = snd_ctl_led_list(led_card, buf);
+ snd_ctl_led_sysfs_exit(kn);
+ return ret;
+}
+
static DEVICE_ATTR_WO(attach);
static DEVICE_ATTR_WO(detach);
static DEVICE_ATTR_WO(reset);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0399/1167] drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (392 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0398/1167] ALSA: control_led: Fix deadlock between sysfs writes and card disconnect Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0400/1167] btrfs: roll back sprout setup after device add failure Greg Kroah-Hartman
` (263 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Boris Brezillon, Steven Price,
Adrián Larumbe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrián Larumbe <adrian.larumbe@collabora.com>
[ Upstream commit e9672bf9382ff80be21d586f88e50339b85f5766 ]
During device probe(), failure to do a PM get() will leave the usage_count
set to 0, which is the value assigned at device creation time. That means
when the autosuspend delay expires, runtime suspend callback won't be
invoked, so the device will remain powered on forever.
On top of that, failure to call PM put() during device unplug means
Panfrost device's PM usage_count increases monotonically for every new
module reload.
The outcome of both of the above meant that:
- Devfreq OPP transition notifications would be printed all the time,
even when no jobs are being submitted. This quickly fills the kernel
ring buffer with junk.
- Because MMU interrupts are only enabled when the device is reset,
the very first job targeting the tiler heap BO after device probe()
would always time out, since the driver's PM runtime resume callback
would not be invoked.
To fix the above:
- Manually adjust the PM refcnt at device probe and removal time.
- Ensure pm_runtime_dont_use_autosuspend is called in the wind-down path.
- Call pm_runtime_put_autosuspend() when device is ready to accept jobs
Fixes: 635430797d3f ("drm/panfrost: Rework runtime PM initialization")
Fixes: 876b15d2c88d ("drm/panfrost: Fix module unload")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20261012-claude-fixes-v15-6-bc0a6c498553@collabora.com
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
[ sashal: Replaced pfdev->base.dev with pfdev->dev and placed the new PM calls around this tree's existing shrinker init and drm_dev_put() code, since the upstream context differs. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panfrost/panfrost_drv.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index 0c30310da50e2..57f1d5f82a942 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -589,6 +589,11 @@ static int panfrost_probe(struct platform_device *pdev)
goto err_out0;
}
+ /* The reason we must manually set the PM status and usage counter is
+ * we have just powered the device up but did not go through the PM
+ * runtime resume callback, so we need to update these ourselves.
+ */
+ pm_runtime_get_noresume(pfdev->dev);
pm_runtime_set_active(pfdev->dev);
pm_runtime_mark_last_busy(pfdev->dev);
pm_runtime_enable(pfdev->dev);
@@ -605,12 +610,16 @@ static int panfrost_probe(struct platform_device *pdev)
panfrost_gem_shrinker_init(ddev);
+ pm_runtime_put_autosuspend(pfdev->dev);
+
return 0;
err_out1:
+ pm_runtime_dont_use_autosuspend(pfdev->dev);
pm_runtime_disable(pfdev->dev);
panfrost_device_fini(pfdev);
pm_runtime_set_suspended(pfdev->dev);
+ pm_runtime_put_noidle(pfdev->dev);
err_out0:
drm_dev_put(ddev);
return err;
@@ -625,9 +634,11 @@ static void panfrost_remove(struct platform_device *pdev)
panfrost_gem_shrinker_cleanup(ddev);
pm_runtime_get_sync(pfdev->dev);
+ pm_runtime_dont_use_autosuspend(pfdev->dev);
pm_runtime_disable(pfdev->dev);
panfrost_device_fini(pfdev);
pm_runtime_set_suspended(pfdev->dev);
+ pm_runtime_put_noidle(pfdev->dev);
drm_dev_put(ddev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0400/1167] btrfs: roll back sprout setup after device add failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (393 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0399/1167] drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0401/1167] btrfs: fix off-by-one end offset check in report_setget_bounds() Greg Kroah-Hartman
` (262 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Guanghui Yang,
David Sterba, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guanghui Yang <3497809730@qq.com>
[ Upstream commit f5166f53b60b4d1ee9957c0baccd3b09735001d4 ]
btrfs_init_new_device() calls btrfs_setup_sprout() before creating the
first writable chunks for a seed filesystem. That moves the seed devices
out of fs_info->fs_devices, clears the seeding state and installs a new
fsid for the sprout filesystem.
If a later step fails, the error path removes the new device but leaves
fs_info->fs_devices in the partially initialized sprout state. The
mounted filesystem can then be left with no open devices after the
failed device add.
Add the inverse of btrfs_setup_sprout() and use it from the error path
so the mounted seed filesystem is restored before the temporary
seed_devices copy is released.
Fixes: 2b82032c34ec ("Btrfs: Seed device support")
Assisted-by: Codex:gpt-5
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Guanghui Yang <3497809730@qq.com>
[ Fix a conflict with per-profile available space, revert sprout before
updating per-profile available space estimation. ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
[ sashal: Dropped the btrfs_update_per_profile_avail(fs_info) call and its context line, since that helper doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/volumes.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 626f6aa5ef2f3..1c2df0e24350d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2696,6 +2696,41 @@ static void btrfs_setup_sprout(struct btrfs_fs_info *fs_info,
btrfs_set_super_flags(disk_super, super_flags);
}
+static void btrfs_rollback_sprout(struct btrfs_fs_info *fs_info,
+ struct btrfs_fs_devices *seed_devices)
+{
+ struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;
+ struct btrfs_super_block *disk_super = fs_info->super_copy;
+ struct btrfs_device *device;
+ u64 super_flags;
+
+ lockdep_assert_held(&uuid_mutex);
+ lockdep_assert_held(&fs_devices->device_list_mutex);
+
+ list_del_init(&seed_devices->seed_list);
+ list_splice_init_rcu(&seed_devices->devices, &fs_devices->devices, synchronize_rcu);
+ list_for_each_entry(device, &fs_devices->devices, dev_list) {
+ device->fs_devices = fs_devices;
+ }
+
+ fs_devices->seeding = true;
+ fs_devices->num_devices = seed_devices->num_devices;
+ fs_devices->open_devices = seed_devices->open_devices;
+ fs_devices->missing_devices = seed_devices->missing_devices;
+ fs_devices->rotating = seed_devices->rotating;
+ fs_devices->latest_dev = seed_devices->latest_dev;
+
+ memcpy(fs_devices->fsid, seed_devices->fsid, BTRFS_FSID_SIZE);
+ memcpy(fs_devices->metadata_uuid, seed_devices->metadata_uuid, BTRFS_FSID_SIZE);
+ memcpy(disk_super->fsid, seed_devices->fsid, BTRFS_FSID_SIZE);
+
+ super_flags = (btrfs_super_flags(disk_super) | BTRFS_SUPER_FLAG_SEEDING);
+ btrfs_set_super_flags(disk_super, super_flags);
+
+ seed_devices->opened = 0;
+ free_fs_devices(seed_devices);
+}
+
/*
* Store the expected generation for seed devices in device items.
*/
@@ -3003,6 +3038,8 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
orig_super_total_bytes);
btrfs_set_super_num_devices(fs_info->super_copy,
orig_super_num_devices);
+ if (seeding_dev)
+ btrfs_rollback_sprout(fs_info, seed_devices);
mutex_unlock(&fs_info->chunk_mutex);
mutex_unlock(&fs_info->fs_devices->device_list_mutex);
error_trans:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0401/1167] btrfs: fix off-by-one end offset check in report_setget_bounds()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (394 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0400/1167] btrfs: roll back sprout setup after device add failure Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0402/1167] wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup Greg Kroah-Hartman
` (261 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Daniel Vacek,
Filipe Manana, David Sterba, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <fdmanana@suse.com>
[ Upstream commit 08f750d9f8930e4ca053913b5ca3fd49fd9268c9 ]
The addressable range with an extent buffer goes from byte 0 to byte
eb->len - 1, so if a byte address matches eb->len, it's already beyond
the addressable range and we should log that it's bad start address
and not end address.
Fixes: 234fdd2815ce ("btrfs: remove redundant check in up check_setget_bounds")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Daniel Vacek <neelx@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
[ sashal: Applied the same > to >= change inline in check_setget_bounds(), since the report_setget_bounds() helper doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/accessors.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/accessors.c b/fs/btrfs/accessors.c
index 206cf1612c1d0..7a9d8b8d648f3 100644
--- a/fs/btrfs/accessors.c
+++ b/fs/btrfs/accessors.c
@@ -16,7 +16,7 @@ static bool check_setget_bounds(const struct extent_buffer *eb,
if (unlikely(member_offset + size > eb->len)) {
btrfs_warn(eb->fs_info,
"bad eb member %s: ptr 0x%lx start %llu member offset %lu size %d",
- (member_offset > eb->len ? "start" : "end"),
+ (member_offset >= eb->len ? "start" : "end"),
(unsigned long)ptr, eb->start, member_offset, size);
return false;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0402/1167] wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (395 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0401/1167] btrfs: fix off-by-one end offset check in report_setget_bounds() Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0403/1167] ALSA: hda: intel: Dont free card in the probe work Greg Kroah-Hartman
` (260 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiale Yao, Baochen Qiang,
Rameshkumar Sundaram, Jeff Johnson, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 94c7b50351fd30e1dfe1b4051197a1445d8547e1 ]
The pending management TX cleanup walks txmgmt_idr with idr_for_each(),
and its callback removes the current entry. This can invalidate the
radix-tree iterator retained by idr_for_each().
Use idr_for_each_entry() so every iteration starts with a fresh lookup.
Continue to remove each entry under txmgmt_idr_lock before freeing its skb,
preventing concurrent TX completion from finding a stale skb pointer.
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20261003092104.520135-5-yaojiale02@163.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
[ sashal: Context-only adjustments for the older file layout: the core.c call sits in a flat loop, the unregister caller has an older function name, and mac.h lacks a neighboring declaration. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath12k/core.c | 3 +--
drivers/net/wireless/ath/ath12k/mac.c | 12 ++++++------
drivers/net/wireless/ath/ath12k/mac.h | 2 +-
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 1b07a183aaedc..1b3c6fbe766e0 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -709,8 +709,7 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
complete(&ar->bss_survey_done);
wake_up(&ar->dp.tx_empty_waitq);
- idr_for_each(&ar->txmgmt_idr,
- ath12k_mac_tx_mgmt_pending_free, ar);
+ ath12k_mac_tx_mgmt_pending_free(ar);
idr_destroy(&ar->txmgmt_idr);
wake_up(&ar->txmgmt_empty_waitq);
}
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 2c29aa63dfb07..fdbb0f4fa679d 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -4764,13 +4764,13 @@ static void ath12k_mac_tx_mgmt_free(struct ath12k *ar, int buf_id)
ath12k_mgmt_over_wmi_tx_drop(ar, msdu);
}
-int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx)
+void ath12k_mac_tx_mgmt_pending_free(struct ath12k *ar)
{
- struct ath12k *ar = ctx;
-
- ath12k_mac_tx_mgmt_free(ar, buf_id);
+ struct sk_buff *msdu;
+ int buf_id;
- return 0;
+ idr_for_each_entry(&ar->txmgmt_idr, msdu, buf_id)
+ ath12k_mac_tx_mgmt_free(ar, buf_id);
}
static void ath12k_mac_vif_txmgmt_cleanup(struct ath12k *ar,
@@ -7186,7 +7186,7 @@ static void __ath12k_mac_unregister(struct ath12k *ar)
ieee80211_unregister_hw(ar->hw);
- idr_for_each(&ar->txmgmt_idr, ath12k_mac_tx_mgmt_pending_free, ar);
+ ath12k_mac_tx_mgmt_pending_free(ar);
idr_destroy(&ar->txmgmt_idr);
kfree(ar->mac.sbands[NL80211_BAND_2GHZ].channels);
diff --git a/drivers/net/wireless/ath/ath12k/mac.h b/drivers/net/wireless/ath/ath12k/mac.h
index ec1be11cce7fc..f78cfe610680b 100644
--- a/drivers/net/wireless/ath/ath12k/mac.h
+++ b/drivers/net/wireless/ath/ath12k/mac.h
@@ -69,7 +69,7 @@ struct ath12k *ath12k_mac_get_ar_by_pdev_id(struct ath12k_base *ab, u32 pdev_id)
void ath12k_mac_drain_tx(struct ath12k *ar);
void ath12k_mac_peer_cleanup_all(struct ath12k *ar);
-int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
+void ath12k_mac_tx_mgmt_pending_free(struct ath12k *ar);
enum rate_info_bw ath12k_mac_bw_to_mac80211_bw(enum ath12k_supported_bw bw);
enum ath12k_supported_bw ath12k_mac_mac80211_bw_to_ath12k_bw(enum rate_info_bw bw);
enum hal_encrypt_type ath12k_dp_tx_get_encrypt_type(u32 cipher);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0403/1167] ALSA: hda: intel: Dont free card in the probe work
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (396 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0402/1167] wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0404/1167] platform/x86/amd/pmc: clear devm-managed pointers on remove to prevent stale reuse Greg Kroah-Hartman
` (259 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+40b06a86af225236fdb4,
Ali Ahmet Memiş, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ali Ahmet Memiş <aliamemis@disroot.org>
[ Upstream commit fbaccb1b19c79e79220e3bcc5bb18ca54ffb017b ]
If the delayed probe fails, azx_probe_work() frees the card and clears
the drvdata. azx_remove() reads the card before it waits for the probe
work with cancel_delayed_work_sync() so when the device is removed while
the probe work is running, it frees the card again after the work has
already freed it.
Only disconnect the card in the work so that its slot is released right
away and leave freeing it to azx_remove().
Fixes: 39173303c838 ("ALSA: hda: Free card instance properly at probe errors")
Reported-by: syzbot+40b06a86af225236fdb4@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=40b06a86af225236fdb4
Signed-off-by: Ali Ahmet Memiş <aliamemis@disroot.org>
Link: https://patch.msgid.link/20261012162841.1879278-1-aliamemis@disroot.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/hda_intel.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 6cf99154e528c..7d23b66baef32 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1740,7 +1740,12 @@ static void azx_check_snoop_available(struct azx *chip)
static void azx_probe_work(struct work_struct *work)
{
struct hda_intel *hda = container_of(work, struct hda_intel, probe_work.work);
- azx_probe_continue(&hda->chip, true);
+
+ if (azx_probe_continue(&hda->chip, false) < 0) {
+ hda->init_failed = 1;
+ complete_all(&hda->probe_wait);
+ snd_card_disconnect(hda->chip.card);
+ }
}
static int default_bdl_pos_adj(struct azx *chip)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0404/1167] platform/x86/amd/pmc: clear devm-managed pointers on remove to prevent stale reuse
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (397 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0403/1167] ALSA: hda: intel: Dont free card in the probe work Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0405/1167] ALSA: pcm: Protect delay DMA sync against concurrent HW_FREE Greg Kroah-Hartman
` (258 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shyam Sundar S K,
Mario Limonciello (AMD), Ilpo Järvinen, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
[ Upstream commit c9ba86f5411730ebd333d94b9e1aa8f652dc743f ]
The driver stores its state in a single file-scope static struct
amd_pmc_dev, which is reused on every bind. Its regbase, smu_virt_addr,
stb_virt_addr and fch_virt_addr members are MMIO mappings created with
devm_ioremap().
On unbind the driver core unmaps these mappings, but it does not clear
the pointers in the static struct. Since the struct is not freed, the
members keep pointing at the now-unmapped addresses.
On the next bind, the probe path re-maps a region only when its pointer
is still NULL, so the stale pointer is reused and the following
memcpy_fromio()/ioread32() touches freed MMIO, causing use-after-unmap
crash. Clear these pointers in amd_pmc_remove() so the next probe re-maps
them instead of reusing stale ones.
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Fixes: 156ec4731cb22b ("platform/x86: amd-pmc: Add AMD platform support for S2Idle")
Link: https://patch.msgid.link/20260929155609.1712638-1-Shyam-sundar.S-k@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ sashal: Added the four NULL assignments at the end of amd_pmc_remove() after mutex_destroy(), since the MP2 STB deinit call in the upstream context is not present in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/amd/pmc/pmc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index 19abca2e46763..690df8746cf52 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -1163,6 +1163,10 @@ static void amd_pmc_remove(struct platform_device *pdev)
amd_pmc_dbgfs_unregister(dev);
pci_dev_put(dev->rdev);
mutex_destroy(&dev->lock);
+ dev->regbase = NULL;
+ dev->smu_virt_addr = NULL;
+ dev->stb_virt_addr = NULL;
+ dev->fch_virt_addr = NULL;
}
static const struct acpi_device_id amd_pmc_acpi_ids[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0405/1167] ALSA: pcm: Protect delay DMA sync against concurrent HW_FREE
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (398 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0404/1167] platform/x86/amd/pmc: clear devm-managed pointers on remove to prevent stale reuse Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0406/1167] fs/ntfs3: do not mark frame pages uptodate on read error Greg Kroah-Hartman
` (257 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cen Zhang, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit 50f413b83b31ea8d8ee4276165ab95ed5ab0e10f ]
A PCM DMA buffer must remain allocated until explicit DMA synchronization
finishes. snd_pcm_delay() calls snd_pcm_dma_buffer_sync() after dropping
the stream lock, without participating in the buffer-access exclusion
used by HW_FREE.
With a managed NONCONTIG buffer requiring explicit sync, HW_PARAMS can
allocate a separate runtime descriptor when the requested ring exceeds
the preallocation. In PREPARED state with mmap_count zero, concurrent
HWSYNC and HW_FREE calls on the same open PCM file can interleave:
1. HWSYNC checks the state in snd_pcm_delay() under the stream lock and
releases that lock.
2. The sync helper fetches runtime->dma_buffer_p and enters
snd_dma_noncontig_sync() with that descriptor.
3. HW_FREE takes the negative buffer-access count, checks PREPARED under
the stream lock, releases the lock, and frees the DMA allocation and
dynamic descriptor through snd_pcm_lib_free_pages().
4. The sync callback resumes and reads the freed descriptor.
The stream lock does not cover the allocation's release, and the sync
operation has no positive buffer-access count to prevent it. The stale
read causes a use-after-free in snd_dma_noncontig_sync(). DELAY uses the
same snd_pcm_delay() path.
Take a positive buffer-access count before checking the state and keep it
until the DMA sync finishes, as the transfer and mmap paths already do.
HW_FREE then returns -EBUSY while this access is active. If a buffer
writer has already entered, snd_pcm_delay() returns -EBUSY before using
the buffer. Keep the sync outside the stream lock and balance the count
on the state-error path as well.
KASAN report as below:
BUG: KASAN: slab-use-after-free in snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]
Read of size 4 at addr ffff888108f58584 by task pcm-uaf-fixture/487
CPU: 1 UID: 0 PID: 487 Comm: pcm-uaf-fixture Not tainted 7.2.0-rc6-pmb-alsa-functional-v2+ #1 PREEMPT(lazy)
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0x93/0xd0
print_report+0xce/0x630
? snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]
? srso_alias_return_thunk+0x5/0xfbef5
? __virt_addr_valid+0x20d/0x410
? snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]
kasan_report+0xe0/0x110
? snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]
? __pfx_snd_dma_noncontig_sync+0x10/0x10 [snd_pcm]
snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]
? __pfx_snd_dma_noncontig_sync+0x10/0x10 [snd_pcm]
snd_dma_buffer_sync+0xc9/0x110 [snd_pcm]
snd_pcm_delay+0x3bd/0x550 [snd_pcm]
snd_pcm_common_ioctl+0x1e7/0x3aa0 [snd_pcm]
? srso_alias_return_thunk+0x5/0xfbef5
? do_vfs_ioctl+0x1f5/0x1280
? __pfx_do_vfs_ioctl+0x10/0x10
? ioctl_has_perm.constprop.0.isra.0+0x34f/0x500
? __pfx_snd_pcm_common_ioctl+0x10/0x10 [snd_pcm]
? srso_alias_return_thunk+0x5/0xfbef5
snd_pcm_ioctl+0x76/0xb0 [snd_pcm]
? __pfx_snd_pcm_ioctl+0x10/0x10 [snd_pcm]
__x64_sys_ioctl+0x163/0x1d0
do_syscall_64+0x115/0x6a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1cae7ab91b
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:00007ffe12d544f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f1cae7ab91b
RDX: 0000000000000000 RSI: 0000000000004122 RDI: 0000000000000003
RBP: 00000000000001ee R08: 0000000000000073 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000001 R14: 00005584f32b1398 R15: 00005584f32b2ce8
</TASK>
Allocated by task 487:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
__kasan_kmalloc+0xaa/0xb0
__kmalloc_cache_noprof+0x251/0x610
snd_pcm_lib_malloc_pages+0x27c/0x9f0 [snd_pcm]
snd_pcm_hw_params+0x171c/0x1d10 [snd_pcm]
snd_pcm_common_ioctl+0x1f62/0x3aa0 [snd_pcm]
snd_pcm_ioctl+0x76/0xb0 [snd_pcm]
__x64_sys_ioctl+0x163/0x1d0
do_syscall_64+0x115/0x6a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 499:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
kasan_save_free_info+0x3b/0x60
__kasan_slab_free+0x5f/0x80
kfree+0x307/0x580
snd_pcm_lib_free_pages+0x1c9/0x420 [snd_pcm]
snd_pcm_common_ioctl+0x2bd3/0x3aa0 [snd_pcm]
snd_pcm_ioctl+0x76/0xb0 [snd_pcm]
__x64_sys_ioctl+0x163/0x1d0
do_syscall_64+0x115/0x6a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888108f58580
which belongs to the cache kmalloc-64 of size 64
The buggy address is located 4 bytes inside of
freed 64-byte region [ffff888108f58580, ffff888108f585c0)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x108f58
flags: 0x200000000000000(node=0|zone=2)
page_type: f5(slab)
raw: 0200000000000000 ffff8881000428c0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888108f58480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff888108f58500: 00 00 00 00 00 06 fc fc fc fc fc fc fc fc fc fc
>ffff888108f58580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff888108f58600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff888108f58680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================
Disabling lock debugging due to kernel taint
------------[ cut here ]------------
kernel BUG at kernel/dma/mapping.c:417!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 1 UID: 0 PID: 487 Comm: pcm-uaf-fixture Tainted: G B 7.2.0-rc6-pmb-alsa-functional-v2+ #1 PREEMPT(lazy)
Tainted: [B]=BAD_PAGE
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__dma_sync_sg_for_cpu+0x230/0x360
Code: df 48 c1 e8 03 80 3c 10 00 0f 85 fa 00 00 00 4c 8b 35 d4 6b 7a 09 e8 7f e2 17 00 83 fd 02 0f 86 39 fe ff ff e8 71 e2 17 00 90 <0f> 0b e8 69 e2 17 00 be 08 00 00 00 4c 89 ff e8 bc 5f 77 00 4c 89
RSP: 0018:ffff888111f3fc50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffffffffc0250d10 RCX: ffffffff816d395f
RDX: ffff88810836ba00 RSI: ffff888108f58580 RDI: ffffffffc02510d8
RBP: 00000000ffff8881 R08: 0000000000000000 R09: fffffbfff804a239
R10: ffffffffc02511cf R11: 6e696c6261736944 R12: ffff888108f58580
R13: 0000000002ce00e5 R14: ffffffffc0258720 R15: 0000000000000000
FS: 00007f1cae69c780(0000) GS:ffff8881fd861000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055d1affa2480 CR3: 0000000108fc0003 CR4: 0000000000770ef0
PKRU: 55555554
Call Trace:
<TASK>
snd_dma_noncontig_sync+0x15a/0x310 [snd_pcm]
? __pfx_snd_dma_noncontig_sync+0x10/0x10 [snd_pcm]
snd_dma_buffer_sync+0xc9/0x110 [snd_pcm]
snd_pcm_delay+0x3bd/0x550 [snd_pcm]
snd_pcm_common_ioctl+0x1e7/0x3aa0 [snd_pcm]
? srso_alias_return_thunk+0x5/0xfbef5
? do_vfs_ioctl+0x1f5/0x1280
? __pfx_do_vfs_ioctl+0x10/0x10
? ioctl_has_perm.constprop.0.isra.0+0x34f/0x500
? __pfx_snd_pcm_common_ioctl+0x10/0x10 [snd_pcm]
? srso_alias_return_thunk+0x5/0xfbef5
snd_pcm_ioctl+0x76/0xb0 [snd_pcm]
? __pfx_snd_pcm_ioctl+0x10/0x10 [snd_pcm]
__x64_sys_ioctl+0x163/0x1d0
do_syscall_64+0x115/0x6a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1cae7ab91b
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:00007ffe12d544f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f1cae7ab91b
RDX: 0000000000000000 RSI: 0000000000004122 RDI: 0000000000000003
RBP: 00000000000001ee R08: 0000000000000073 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000001 R14: 00005584f32b1398 R15: 00005584f32b2ce8
</TASK>
Modules linked in: snd_pcmtest snd_pcm
---[ end trace 0000000000000000 ]---
RIP: 0010:__dma_sync_sg_for_cpu+0x230/0x360
Code: df 48 c1 e8 03 80 3c 10 00 0f 85 fa 00 00 00 4c 8b 35 d4 6b 7a 09 e8 7f e2 17 00 83 fd 02 0f 86 39 fe ff ff e8 71 e2 17 00 90 <0f> 0b e8 69 e2 17 00 be 08 00 00 00 4c 89 ff e8 bc 5f 77 00 4c 89
RSP: 0018:ffff888111f3fc50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffffffffc0250d10 RCX: ffffffff816d395f
RDX: ffff88810836ba00 RSI: ffff888108f58580 RDI: ffffffffc02510d8
RBP: 00000000ffff8881 R08: 0000000000000000 R09: fffffbfff804a239
R10: ffffffffc02511cf R11: 6e696c6261736944 R12: ffff888108f58580
R13: 0000000002ce00e5 R14: ffffffffc0258720 R15: 0000000000000000
FS: 00007f1cae69c780(0000) GS:ffff8881fd861000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055d1affa2480 CR3: 0000000108fc0003 CR4: 0000000000770ef0
PKRU: 55555554
Kernel panic - not syncing: Fatal exception
Kernel Offset: disabled
Rebooting in 1 seconds..
Fixes: a25684a95646 ("ALSA: memalloc: Support for non-contiguous page allocation")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Link: https://patch.msgid.link/pm-pmb-d74585d187e0b1810c08-v2-25432d0951f67fdaa1a9@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Kept the explicit snd_pcm_stream_lock_irq()/unlock_irq() calls in snd_pcm_delay() instead of upstream's scoped_guard(), since the scoped-guard cleanup is missing here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/pcm_native.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 96b1de0537d04..0d0f5af95faa8 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3096,14 +3096,19 @@ static snd_pcm_sframes_t snd_pcm_forward(struct snd_pcm_substream *substream,
static int snd_pcm_delay(struct snd_pcm_substream *substream,
snd_pcm_sframes_t *delay)
{
+ struct snd_pcm_runtime *runtime = substream->runtime;
int err;
+ /* Keep the DMA buffer alive through the sync below. */
+ if (!atomic_inc_unless_negative(&runtime->buffer_accessing))
+ return -EBUSY;
snd_pcm_stream_lock_irq(substream);
err = do_pcm_hwsync(substream);
if (delay && !err)
*delay = snd_pcm_calc_delay(substream);
snd_pcm_stream_unlock_irq(substream);
snd_pcm_dma_buffer_sync(substream, SNDRV_DMA_SYNC_CPU);
+ atomic_dec(&runtime->buffer_accessing);
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0406/1167] fs/ntfs3: do not mark frame pages uptodate on read error
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (399 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0405/1167] ALSA: pcm: Protect delay DMA sync against concurrent HW_FREE Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0407/1167] perf symbol: Fix symbol loading from libbfd Greg Kroah-Hartman
` (256 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Weiming Shi,
Konstantin Komarov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <bestswngs@gmail.com>
[ Upstream commit 80218408836fa6fc91a9c26a9c014f81abf9e41f ]
ni_read_frame() ends with a loop that marks every page of a compressed
frame uptodate regardless of whether the read succeeded:
out:
for (i = 0; i < pages_per_frame; i++) {
pg = pages[i];
SetPageUptodate(pg);
}
Non-critical frame pages come from __filemap_get_folio(FGP_CREAT) and are
not zeroed. On an error path that reaches out: before frame_mem is
written, these pages keep uninitialized page-allocator contents but are
still marked uptodate. A later read() is then served from the page cache
and returns that stale kernel memory to user space.
For an unprivileged user mounting a crafted NTFS image this is a
repeatable kernel memory disclosure.
Mark the pages uptodate only on success; on error leave them !uptodate so
the read path re-reads them or reports the error.
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")
Reported-by: Xiang Mei <xmei5@asu.edu>
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
[ sashal: Kept the existing struct page *pg; declaration that upstream removes, and adjusted the hunk context for the out1: label before vunmap(frame_mem), since this tree's ni_read_frame() still uses pg elsewhere. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/frecord.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 3e3c9caaddf54..230a731552e44 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2755,11 +2755,10 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,
out1:
vunmap(frame_mem);
out:
- for (i = 0; i < pages_per_frame; i++) {
- pg = pages[i];
- if (err)
- clear_highpage(pg);
- SetPageUptodate(pg);
+ if (!err) {
+ for (i = 0; i < pages_per_frame; i++) {
+ SetPageUptodate(pages[i]);
+ }
}
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0407/1167] perf symbol: Fix symbol loading from libbfd
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (400 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0406/1167] fs/ntfs3: do not mark frame pages uptodate on read error Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0408/1167] perf symbol: Add missing symsrc__destroy() for libbfd Greg Kroah-Hartman
` (255 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Ian Rogers, Namhyung Kim,
Remi Bernon, Arnaldo Carvalho de Melo, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <namhyung@kernel.org>
[ Upstream commit f814d9e6cdbef6413a72d6dd6d5e4e79e815cf44 ]
The dso__load() should return a positive number (number of symbols
loaded) when it succeded to load symbols. But dso__load_bfd_symbols()
only returns 0 and it's hard to check if it actually loaded symbols or
not. Let's return the value of dso__has_symbol() and check it in
dso__load() so that it can return 1 for success.
Closes: https://lore.kernel.org/r/sashiko-outbox-162540@kernel.org
Fixes: eac9a4342e5447ca ("perf symbols: Try reading the symbol table with libbfd")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Remi Bernon <rbernon@codeweavers.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: Moved the libbfd hunk into symbol.c (where dso__load_bfd_symbols() still lives) and used direct struct dso field access instead of accessor helpers in the context lines. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/pe-file-parsing.c | 2 +-
tools/perf/util/symbol.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/tests/pe-file-parsing.c b/tools/perf/tests/pe-file-parsing.c
index fff58b220c07b..69060aa1a62a1 100644
--- a/tools/perf/tests/pe-file-parsing.c
+++ b/tools/perf/tests/pe-file-parsing.c
@@ -59,7 +59,7 @@ static int run_dir(const char *d)
TEST_ASSERT_VAL("Failed to get dso", dso);
ret = dso__load_bfd_symbols(dso, debugfile);
- TEST_ASSERT_VAL("Failed to load symbols", ret == 0);
+ TEST_ASSERT_VAL("Failed to load symbols", ret > 0);
dso__sort_by_name(dso);
sym = dso__find_symbol_by_name(dso, "main", &idx);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 18556b7a76563..11afce318f89e 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1646,7 +1646,7 @@ int dso__load_bfd_symbols(struct dso *dso, const char *debugfile)
symbols__fixup_duplicate(&dso->symbols);
dso->adjust_symbols = 1;
- err = 0;
+ err = dso__has_symbols(dso);
out_free:
free(symbols);
out_close:
@@ -1866,8 +1866,8 @@ int dso__load(struct dso *dso, struct map *map)
if (nsexit)
nsinfo__mountns_enter(dso->nsinfo, &nsc);
- if (bfdrc == 0) {
- ret = 0;
+ if (bfdrc > 0) {
+ ret = 1;
break;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0408/1167] perf symbol: Add missing symsrc__destroy() for libbfd
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (401 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0407/1167] perf symbol: Fix symbol loading from libbfd Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0409/1167] ALSA: pcm: Protect delay DMA sync in forward and rewind, too Greg Kroah-Hartman
` (254 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Ian Rogers, Namhyung Kim,
Remi Bernon, Arnaldo Carvalho de Melo, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <namhyung@kernel.org>
[ Upstream commit 35477b351e6a697c85dc7d37e5081621889f8e40 ]
When libbfd loaded symbols and there's a pending syms_ss, it'd be lost
or overwrite existing symbols. Let's destroy it before breaking the
loop so that it can safely return from the function.
Closes: https://lore.kernel.org/r/sashiko-outbox-162540@kernel.org
Fixes: eac9a4342e5447ca ("perf symbols: Try reading the symbol table with libbfd")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Remi Bernon <rbernon@codeweavers.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/symbol.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 11afce318f89e..bf13da811df2a 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1868,7 +1868,7 @@ int dso__load(struct dso *dso, struct map *map)
if (bfdrc > 0) {
ret = 1;
- break;
+ goto out_destroy;
}
if (!is_reg || sirc < 0)
@@ -1921,6 +1921,7 @@ int dso__load(struct dso *dso, struct map *map)
ret += nr_plt;
}
+out_destroy:
for (; ss_pos > 0; ss_pos--)
symsrc__destroy(&ss_[ss_pos - 1]);
out_free:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0409/1167] ALSA: pcm: Protect delay DMA sync in forward and rewind, too
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (402 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0408/1167] perf symbol: Add missing symsrc__destroy() for libbfd Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0410/1167] Bluetooth: btmtk: Validate the firmware layout before parsing it Greg Kroah-Hartman
` (253 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit d5096bb9beacb448091c1c9541432021dd5c1fcd ]
Like the previous fix for snd_pcm_delay() (in the commit 50f413b83b31
"ALSA: pcm: Protect delay DMA sync against concurrent HW_FREE"), the
snd_pcm_dma_buffer_sync() call in snd_pcm_forward() and
snd_pcm_rewind() needs the similar protection against the concurrent
hw_free action for avoiding potential UAFs.
Fixes: a25684a95646 ("ALSA: memalloc: Support for non-contiguous page allocation")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://patch.msgid.link/20261013120528.52586-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Kept the existing explicit snd_pcm_stream_lock_irq()/unlock_irq() calls instead of upstream's scoped_guard form, adding the buffer_accessing check and atomic_dec() around them. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/pcm_native.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 0d0f5af95faa8..2a3e17fb208d1 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3058,11 +3058,15 @@ static snd_pcm_sframes_t rewind_appl_ptr(struct snd_pcm_substream *substream,
static snd_pcm_sframes_t snd_pcm_rewind(struct snd_pcm_substream *substream,
snd_pcm_uframes_t frames)
{
+ struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_sframes_t ret;
if (frames == 0)
return 0;
+ /* Keep the DMA buffer alive through the sync below. */
+ if (!atomic_inc_unless_negative(&runtime->buffer_accessing))
+ return -EBUSY;
snd_pcm_stream_lock_irq(substream);
ret = do_pcm_hwsync(substream);
if (!ret)
@@ -3071,17 +3075,22 @@ static snd_pcm_sframes_t snd_pcm_rewind(struct snd_pcm_substream *substream,
snd_pcm_stream_unlock_irq(substream);
if (ret >= 0)
snd_pcm_dma_buffer_sync(substream, SNDRV_DMA_SYNC_DEVICE);
+ atomic_dec(&runtime->buffer_accessing);
return ret;
}
static snd_pcm_sframes_t snd_pcm_forward(struct snd_pcm_substream *substream,
snd_pcm_uframes_t frames)
{
+ struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_sframes_t ret;
if (frames == 0)
return 0;
+ /* Keep the DMA buffer alive through the sync below. */
+ if (!atomic_inc_unless_negative(&runtime->buffer_accessing))
+ return -EBUSY;
snd_pcm_stream_lock_irq(substream);
ret = do_pcm_hwsync(substream);
if (!ret)
@@ -3090,6 +3099,7 @@ static snd_pcm_sframes_t snd_pcm_forward(struct snd_pcm_substream *substream,
snd_pcm_stream_unlock_irq(substream);
if (ret >= 0)
snd_pcm_dma_buffer_sync(substream, SNDRV_DMA_SYNC_DEVICE);
+ atomic_dec(&runtime->buffer_accessing);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0410/1167] Bluetooth: btmtk: Validate the firmware layout before parsing it
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (403 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0409/1167] ALSA: pcm: Protect delay DMA sync in forward and rewind, too Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0411/1167] Bluetooth: hci_sync: fix mesh adv timeout units Greg Kroah-Hartman
` (252 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Lu, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <chris.lu@mediatek.com>
[ Upstream commit 760ac9d02dce001f2e20c17deb18e7bb63d8355e ]
btmtk_setup_firmware_79xx() reads the section count out of the firmware's
global descriptor, then walks a 64-byte section map per section and hands
each section's file-supplied offset and length to the WMT download path.
None of that is checked against fw->size, so a truncated or corrupted
file makes the driver read past the end of request_firmware()'s buffer.
On 32-bit the section count can also wrap the section map size
calculation.
Add btmtk_fw_validate_layout() to check that the header, global
descriptor and section map array all fit, and btmtk_fw_validate_section()
to check one section's offset and length, both written so the size
arithmetic cannot wrap. A section count of zero is rejected as well: it
passes every size check but leaves the download loop with nothing to do,
so the function would report success on hardware it never programmed.
They are helpers rather than open-coded because the MT7928 CBMCU download
path added later needs the same arithmetic.
This is hardening against a corrupted /lib/firmware rather than a bug an
unprivileged user can trigger, hence bluetooth-next and no Fixes: tag.
Well-formed firmware files are unaffected.
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ sashal: Adjusted the include to the older <asm/unaligned.h> name and dropped the dev_id parameter and MT6639 context that this tree lacks; the validation logic is unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bluetooth/btmtk.c | 74 +++++++++++++++++++++++++++++++++++++--
1 file changed, 71 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index 9ab4157be92f9..bf894abd13ee4 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -6,6 +6,7 @@
#include <linux/firmware.h>
#include <linux/usb.h>
#include <linux/iopoll.h>
+#include <linux/overflow.h>
#include <asm/unaligned.h>
#include <net/bluetooth/bluetooth.h>
@@ -56,6 +57,67 @@ struct btmtk_section_map {
};
} __packed;
+/* Reject a firmware image whose header, global descriptor or section map
+ * array does not fit in the file, and hand back the validated section
+ * count, so that the section map walks stay inside the firmware buffer.
+ */
+static int btmtk_fw_validate_layout(struct hci_dev *hdev,
+ const struct firmware *fw,
+ u32 *section_num)
+{
+ const struct btmtk_global_desc *globaldesc;
+ size_t need;
+
+ if (fw->size < MTK_FW_ROM_PATCH_HEADER_SIZE + MTK_FW_ROM_PATCH_GD_SIZE) {
+ bt_dev_err(hdev, "Firmware too small: %zu bytes, need at least %u",
+ fw->size,
+ MTK_FW_ROM_PATCH_HEADER_SIZE + MTK_FW_ROM_PATCH_GD_SIZE);
+ return -EINVAL;
+ }
+
+ globaldesc = (const struct btmtk_global_desc *)(fw->data +
+ MTK_FW_ROM_PATCH_HEADER_SIZE);
+ *section_num = le32_to_cpu(globaldesc->section_num);
+
+ if (!*section_num) {
+ bt_dev_err(hdev, "Firmware declares no sections");
+ return -EINVAL;
+ }
+
+ if (check_mul_overflow((size_t)MTK_FW_ROM_PATCH_SEC_MAP_SIZE,
+ (size_t)*section_num, &need) ||
+ check_add_overflow(need,
+ (size_t)(MTK_FW_ROM_PATCH_HEADER_SIZE +
+ MTK_FW_ROM_PATCH_GD_SIZE),
+ &need)) {
+ bt_dev_err(hdev, "Firmware section count too large: %u",
+ *section_num);
+ return -EINVAL;
+ }
+
+ if (fw->size < need) {
+ bt_dev_err(hdev, "Firmware truncated: %zu bytes, need %zu for %u sections",
+ fw->size, need, *section_num);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+/* Reject a section whose payload does not lie within the firmware file. */
+static int btmtk_fw_validate_section(struct hci_dev *hdev,
+ const struct firmware *fw, int index,
+ u32 offset, u32 size)
+{
+ if (offset > fw->size || size > fw->size - offset) {
+ bt_dev_err(hdev, "Firmware section %d out of bounds: offset=%u, size=%u, fw_size=%zu",
+ index, offset, size, fw->size);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static void btmtk_coredump(struct hci_dev *hdev)
{
int err;
@@ -129,7 +191,6 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
{
struct btmtk_hci_wmt_params wmt_params;
struct btmtk_patch_header *hdr;
- struct btmtk_global_desc *globaldesc = NULL;
struct btmtk_section_map *sectionmap;
const struct firmware *fw;
const u8 *fw_ptr;
@@ -145,11 +206,13 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
return err;
}
+ err = btmtk_fw_validate_layout(hdev, fw, §ion_num);
+ if (err < 0)
+ goto err_release_fw;
+
fw_ptr = fw->data;
fw_bin_ptr = fw_ptr;
hdr = (struct btmtk_patch_header *)fw_ptr;
- globaldesc = (struct btmtk_global_desc *)(fw_ptr + MTK_FW_ROM_PATCH_HEADER_SIZE);
- section_num = le32_to_cpu(globaldesc->section_num);
bt_dev_info(hdev, "HW/SW Version: 0x%04x%04x, Build Time: %s",
le16_to_cpu(hdr->hwver), le16_to_cpu(hdr->swver), hdr->datetime);
@@ -164,6 +227,11 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
dl_size = le32_to_cpu(sectionmap->bin_info_spec.dlsize);
if (dl_size > 0) {
+ err = btmtk_fw_validate_section(hdev, fw, i,
+ section_offset, dl_size);
+ if (err < 0)
+ goto err_release_fw;
+
retry = 20;
while (retry > 0) {
cmd[0] = 0; /* 0 means legacy dl mode. */
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0411/1167] Bluetooth: hci_sync: fix mesh adv timeout units
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (404 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0410/1167] Bluetooth: btmtk: Validate the firmware layout before parsing it Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0412/1167] Bluetooth: hci_event: Fix LE link drop on remote features command status Greg Kroah-Hartman
` (251 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pauli Virtanen,
Luiz Augusto von Dentz, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pauli Virtanen <pav@iki.fi>
[ Upstream commit 8a8d51eeedebfa5aaaae7720f2fb2aa1a67b8587 ]
Mesh adv instance timeout and duration are in milliseconds, see
mesh_send_sync, hci_add_adv_instance. hci_schedule_adv_instance_sync()
and hci_enable_ext_advertising_sync() ignore this, and scale the timeout
wrong.
Fix for mesh instances by using msecs_to_jiffies() in
hci_schedule_adv_instance_sync and fixing the scaling in
hci_enable_ext_advertising_sync.
Fixes BlueZ "Mesh - Send cancel" test failures.
Fixes: b338d91703fa ("Bluetooth: Implement support for Mesh")
Assisted-by: opencode:qwen3.8-flash-next sashiko
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ sashal: Non-mesh case keeps the existing msecs_to_jiffies(timeout * 1000) form because secs_to_jiffies() does not exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_sync.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 2b5923493aef5..c21a9ffc26e43 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -1720,7 +1720,8 @@ int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance)
* scheduling it.
*/
if (adv && adv->timeout) {
- u16 duration = adv->timeout * MSEC_PER_SEC;
+ u16 duration = adv->mesh ? adv->timeout :
+ adv->timeout * MSEC_PER_SEC;
/* Time = N * 10 ms */
set->duration = cpu_to_le16(duration / 10);
@@ -2166,7 +2167,8 @@ int hci_schedule_adv_instance_sync(struct hci_dev *hdev, u8 instance,
hdev->adv_instance_timeout = timeout;
queue_delayed_work(hdev->req_workqueue,
&hdev->adv_instance_expire,
- msecs_to_jiffies(timeout * 1000));
+ adv->mesh ? msecs_to_jiffies(timeout) :
+ msecs_to_jiffies(timeout * 1000));
}
/* If we're just re-scheduling the same instance again then do not
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0412/1167] Bluetooth: hci_event: Fix LE link drop on remote features command status
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (405 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0411/1167] Bluetooth: hci_sync: fix mesh adv timeout units Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0413/1167] iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails Greg Kroah-Hartman
` (250 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Dewald <kevin@simpleble.org>
[ Upstream commit 91638f53ff2b8234195ff27ec913e068269a28e9 ]
When the local controller supports peripheral-initiated features
exchange, the LE Read Remote Features procedure also runs for incoming
connections, and it fails with Unsupported Remote Feature (0x1a) if the
central does not support that feature. hci_le_remote_feat_complete_evt()
and hci_le_read_all_remote_features_evt() handle this and let the
connection transition into connected state.
A controller can also return that error in the Command Status event
instead. An Intel controller does so for a central that does not
support peripheral-initiated features exchange, presumably because it
already has the features of the central. hci_cs_le_read_remote_features()
and hci_cs_le_read_all_remote_features() then confirm the connection as
failed while it is still in BT_CONFIG, and the hci_conn_drop() in
le_read_features_complete() disconnects it right away:
> HCI Event: LE Meta Event (0x3e) plen 31
LE Enhanced Connection Complete (0x0a)
Status: Success (0x00)
Role: Peripheral (0x01)
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2
> HCI Event: Command Status (0x0f) plen 4
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a)
< HCI Command: Disconnect (0x01|0x0006) plen 3
Reason: Remote User Terminated Connection (0x13)
Data the central sends afterwards is reported as:
Bluetooth: hci0: ACL packet for unknown connection handle 3585
Handle Unsupported Remote Feature in the command status the same way as
in the complete events.
Fixes: 0fe29fd1cd77 ("Bluetooth: Read LE remote features during connection establishment")
Fixes: a106e50be74b ("Bluetooth: HCI: Add support for LL Extended Feature Set")
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Kevin Dewald <kevin@simpleble.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ sashal: Dropped the hunk for the missing all-remote-features handler and added the fix inside the older nested if (conn) / BT_CONFIG structure, keeping its existing hci_conn_drop(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_event.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index af1592b82d299..4bdf1199dbb16 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2886,6 +2886,22 @@ static void hci_cs_le_read_remote_features(struct hci_dev *hdev, u8 status)
conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
if (conn) {
if (conn->state == BT_CONFIG) {
+ /* If the local controller supports peripheral-initiated
+ * features exchange, but the remote controller does not,
+ * then the controller may already return the error code
+ * 0x1a for unsupported remote feature in the command
+ * status.
+ *
+ * Handle it as hci_le_remote_feat_complete_evt() does and
+ * allow the connection to transition into connected state.
+ */
+ if (!conn->out &&
+ status == HCI_ERROR_UNSUPPORTED_REMOTE_FEATURE &&
+ (hdev->le_features[0] & HCI_LE_PERIPHERAL_FEATURES)) {
+ conn->state = BT_CONNECTED;
+ status = 0x00;
+ }
+
hci_connect_cfm(conn, status);
hci_conn_drop(conn);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0413/1167] iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (406 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0412/1167] Bluetooth: hci_event: Fix LE link drop on remote features command status Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0414/1167] veth: clear rx queue hint in veth_xmit Greg Kroah-Hartman
` (249 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Donggeun Yoo, Jason Gunthorpe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
[ Upstream commit 1e67cca28490f897788c128c650a6f2cbb565403 ]
iommufd_device_do_replace() installs the group's reserved IOVA ranges in
the new hwpt's IOAS only when it differs from the old hwpt's IOAS. If the
replace fails in iommufd_device_do_replace() or
iommufd_group_do_replace_reserved_iova(), the error paths remove the
ranges from the new hwpt's IOAS whether or not the IOAS is shared
between the old and new hwpt, which removes the ranges that the old hwpt
still needs.
For example, on x86 with intel-iommu, after a replace within a shared
IOAS fails with -ENODEV, IOMMU_IOAS_IOVA_RANGES goes from
0x0-0xfedfffff
0xfef00000-0xffffffffffff
to
0x0-0xffffffffffff
and IOMMU_IOAS_MAP at 0xfee00000 succeeds.
Remove the ranges on failure only when the replace installed them, and
look up the old hwpt_paging before the replace so that the error path
can compare the IOAS.
Fixes: e88d4ec154a8 ("iommufd: Add iommufd_device_replace()")
Assisted-by: LLM
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Link: https://patch.msgid.link/20260929031402.1998253-1-donggeunyoo.kernel@gmail.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ sashal: Open-coded the fix by guarding the error-path reserved-IOVA removal with hwpt->ioas != old_hwpt->ioas, since the helper functions and hwpt_paging upstream uses don't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/iommufd/device.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index ff6386fd1e8fe..127a14ec6733e 100644
--- a/drivers/iommu/iommufd/device.c
+++ b/drivers/iommu/iommufd/device.c
@@ -494,8 +494,10 @@ iommufd_device_do_replace(struct iommufd_device *idev,
/* Caller must destroy old_hwpt */
return old_hwpt;
err_unresv:
- list_for_each_entry(cur, &igroup->device_list, group_item)
- iopt_remove_reserved_iova(&hwpt->ioas->iopt, cur->dev);
+ if (hwpt->ioas != old_hwpt->ioas) {
+ list_for_each_entry(cur, &igroup->device_list, group_item)
+ iopt_remove_reserved_iova(&hwpt->ioas->iopt, cur->dev);
+ }
err_unlock:
mutex_unlock(&idev->igroup->lock);
return ERR_PTR(rc);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0414/1167] veth: clear rx queue hint in veth_xmit
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (407 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0413/1167] iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0415/1167] rxrpc: Fix aborting in rxperf test server Greg Kroah-Hartman
` (248 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiayuan Chen, Björn Töpel,
Toshiaki Makita, Lorenzo Bianconi, Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <jiayuan.chen@linux.dev>
[ Upstream commit 1b1c0e87cfe78d731bbab99c9c018655980b6790 ]
With more tx queues on one end of a veth pair than rx queues on the
other, and RPS or generic XDP enabled on the receiving end, we get:
veth1 received packet on queue 2, but number of RX queues is 2
WARNING: net/core/dev.c:5212 at get_rps_cpu+0x560/0x1360
Call Trace:
<TASK>
netif_rx_internal+0x1af/0x4c0
__netif_rx+0x99/0x350
veth_xmit+0x713/0xca0
dev_hard_start_xmit+0x166/0x5f0
__dev_queue_xmit+0x1797/0x42d0
ip_finish_output2+0xa34/0x1f40
__ip_finish_output+0x510/0x7e0
ip_finish_output+0x2f/0x320
ip_output+0x17a/0x3f0
ip_send_skb+0x1bc/0x220
......
Easy to hit with "ethtool -L veth0 tx 4", "ethtool -L veth1 rx 2",
rps_cpus set on veth1 and a few flows sent over the pair [1].
veth_xmit() uses skb->queue_mapping to pick the peer rq, but never
clears it before veth_forward_skb(), so the rx side still sees the tx
queue index. Everything on the rx side that goes through
skb_get_rx_queue(), like get_rps_cpu() and netif_get_rxqueue() for
generic XDP, takes it as a recorded rx queue and warns once it is out
of range.
Clear it before handing the skb to the peer:
- It is the tx queue index of this device, it says nothing about the
rx queue of the peer.
- The two sides don't even agree on the encoding. The tx side stores
the index as is, the rx side stores index + 1 so that 0 can mean
"not recorded". So tx queue k is read back as rx queue k - 1, and
tx queue 0 as "not recorded".
- Commit 710ad98c363a ("veth: Do not record rx queue hint in
veth_xmit") already decided that veth should not pass any queue
hint to the peer. There is no tx->rx queue mapping to preserve, so
nothing is lost by clearing it.
On NETDEV_TX_BUSY the skb goes back to the qdisc, which looks up the
txq from skb->queue_mapping to decide when to retry, so restore it
there, next to the existing __skb_push().
[1]: https://lore.kernel.org/netdev/156834bb-8e40-496e-9443-9d515fa18eab@linux.dev/
Fixes: 76ff5cc91935 ("rtnl: allow to specify number of rx and tx queues on device creation")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Reviewed-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261009040412.14571-1-jiayuan.chen@linux.dev
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Added the skb_set_queue_mapping(skb, 0) clear before forwarding, but dropped the NETDEV_TX_BUSY queue-mapping restore because this tree's veth_xmit() has no such path. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/veth.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 486eea7d060ec..1a8ff02fb050c 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -375,6 +375,10 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
}
skb_tx_timestamp(skb);
+
+ /* tx queue index of this device, meaningless as rx queue of the peer */
+ skb_set_queue_mapping(skb, 0);
+
if (likely(veth_forward_skb(rcv, skb, rq, use_napi) == NET_RX_SUCCESS)) {
if (!use_napi)
dev_sw_netstats_tx_add(dev, 1, length);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0415/1167] rxrpc: Fix aborting in rxperf test server
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (408 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0414/1167] veth: clear rx queue hint in veth_xmit Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0416/1167] rxrpc: Fix sendmsg length Greg Kroah-Hartman
` (247 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Marc Dionne,
Eric Dumazet, David S. Miller, Jakub Kicinski, Paolo Abeni,
Simon Horman, linux-afs, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <dhowells@redhat.com>
[ Upstream commit 7f15923909866e76608ea6474368570938e783fc ]
Fix rxperf_process_call() to always abort if it gets a send error rather
than only aborting on ENOMEM.
Fixes: 75bfdbf2fca3 ("rxrpc: Implement an in-kernel rxperf server for testing purposes")
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260824091645.415423-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20261006133011.531806-7-dhowells@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/trace/events/rxrpc.h | 2 +-
net/rxrpc/rxperf.c | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
index 1dbeabf143347..cbfcafff64725 100644
--- a/include/trace/events/rxrpc.h
+++ b/include/trace/events/rxrpc.h
@@ -27,8 +27,8 @@
EM(afs_abort_unmarshal_error, "afs-unmarshal") \
/* rxperf errors */ \
EM(rxperf_abort_general_error, "rxperf-error") \
- EM(rxperf_abort_oom, "rxperf-oom") \
EM(rxperf_abort_op_not_supported, "rxperf-op-notsupp") \
+ EM(rxperf_abort_send_error, "rxperf-send-error") \
EM(rxperf_abort_unmarshal_error, "rxperf-unmarshal") \
/* RxKAD security errors */ \
EM(rxkad_abort_1_short_check, "rxkad1-short-check") \
diff --git a/net/rxrpc/rxperf.c b/net/rxrpc/rxperf.c
index c16afe540d09c..d7215f939bdb3 100644
--- a/net/rxrpc/rxperf.c
+++ b/net/rxrpc/rxperf.c
@@ -526,7 +526,7 @@ static int rxperf_process_call(struct rxperf_call *call)
ret = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
rxperf_notify_end_reply_tx);
if (ret < 0)
- return ret;
+ goto send_error;
reply_len -= len;
}
@@ -537,10 +537,11 @@ static int rxperf_process_call(struct rxperf_call *call)
msg.msg_flags = 0;
ret = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
rxperf_notify_end_reply_tx);
- if (ret == -ENOMEM)
- rxrpc_kernel_abort_call(rxperf_socket, call->rxcall,
- RXGEN_SS_MARSHAL, -ENOMEM,
- rxperf_abort_oom);
+ if (ret == 0)
+ return 0;
+send_error:
+ rxrpc_kernel_abort_call(rxperf_socket, call->rxcall, RXGEN_SS_MARSHAL,
+ ret, rxperf_abort_send_error);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0416/1167] rxrpc: Fix sendmsg length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (409 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0415/1167] rxrpc: Fix aborting in rxperf test server Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0417/1167] irqchip/mst-intc: Validate the DT interrupt range Greg Kroah-Hartman
` (246 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Marc Dionne,
Jeffrey Altman, Eric Dumazet, David S. Miller, Jakub Kicinski,
Paolo Abeni, Simon Horman, linux-afs, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <dhowells@redhat.com>
[ Upstream commit ef369cacbd524931199078427ae152c63a826189 ]
rxrpc_send_data() is given two data lengths (len and msg->msg_iter.count)
and is inconsistent about how it uses them. Fix this by using len in
preference to msg->msg_iter.count. Also limit the amount copied to either
len or msg->msg_iter.count, whichever is smaller.
Note that, currently, all the callers have len and msg->msg_iter.count the
same and so the problem won't occur. This is a prerequisite for another
patch that fixes the handling of encryption errors.
Fixes: 382d7974de31 ("RxRPC: Use iov_iter_count() in rxrpc_send_data() instead of the len argument")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20261006133011.531806-8-dhowells@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Adapted the hunks to this tree's older allocation path and flag handling (how_much_data(), wire.flags, min_t), keeping the same length-counter logic. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rxrpc/sendmsg.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index 7ba5a6de3e4e1..dccbbbcc77361 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -324,9 +324,9 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
ret = -EMSGSIZE;
if (call->tx_total_len != -1) {
- if (len - copied > call->tx_total_len)
+ if (len > call->tx_total_len)
goto maybe_error;
- if (!more && len - copied != call->tx_total_len)
+ if (!more && len != call->tx_total_len)
goto maybe_error;
}
@@ -345,7 +345,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
* the security header is going to be in the padded
* region (enc blocksize), but the trailer is not.
*/
- remain = more ? INT_MAX : msg_data_left(msg);
+ remain = more ? INT_MAX : len;
ret = call->conn->security->how_much_data(call, remain,
&bufsize, &chunk, &offset);
if (ret < 0)
@@ -371,8 +371,8 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
_debug("append");
/* append next segment of data to the current buffer */
- if (msg_data_left(msg) > 0) {
- size_t copy = min_t(size_t, txb->space, msg_data_left(msg));
+ if (len > 0) {
+ size_t copy = min3(txb->space, len, msg_data_left(msg));
_debug("add %zu", copy);
if (!copy_from_iter_full(txb->data + txb->offset, copy,
@@ -383,6 +383,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
txb->len += copy;
txb->offset += copy;
copied += copy;
+ len -= copy;
if (call->tx_total_len != -1)
call->tx_total_len -= copy;
}
@@ -394,8 +395,8 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
/* add the packet to the send queue if it's now full */
if (!txb->space ||
- (msg_data_left(msg) == 0 && !more)) {
- if (msg_data_left(msg) == 0 && !more) {
+ (len == 0 && !more)) {
+ if (len == 0 && !more) {
txb->wire.flags |= RXRPC_LAST_PACKET;
__set_bit(RXRPC_TXBUF_LAST, &txb->flags);
}
@@ -410,7 +411,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
rxrpc_queue_packet(rx, call, txb, notify_end_tx);
call->tx_pending = NULL;
}
- } while (msg_data_left(msg) > 0);
+ } while (len > 0 && msg_data_left(msg) > 0);
success:
ret = copied;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0417/1167] irqchip/mst-intc: Validate the DT interrupt range
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (410 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0416/1167] rxrpc: Fix sendmsg length Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0418/1167] ASoC: rt5645: Shut down the button timer on removal Greg Kroah-Hartman
` (245 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Thomas Gleixner,
Radu Rendec, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 16f25d326e5d3b9fd51bc5e3916ecbffbca63e7b ]
The driver takes an inclusive interrupt range from the device tree
without checking its endpoints. A reversed range wraps the unsigned
count calculation, and a range larger than MST_INTC_MAX_IRQS exceeds the
controller capacity used by the driver.
Reject these ranges before calculating nr_irqs or creating the domain.
Check the difference after ordering the endpoints so the validation
itself cannot wrap.
The issue was found by our static-analysis tool.
Fixes: ad4c938c92af ("irqchip/irq-mst: Add MStar interrupt controller support")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: gpt 5
Reviewed-by: Radu Rendec <radu@rendec.net>
Link: https://patch.msgid.link/20260920034236.16229-1-hppiscas@163.com
[ sashal: adjusted context: the call is kzalloc(sizeof(*cd), GFP_KERNEL) here instead of upstream's kzalloc_obj(*cd), so the added range check was inserted before that call. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-mst-intc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/irqchip/irq-mst-intc.c b/drivers/irqchip/irq-mst-intc.c
index f6133ae281556..e30c91ab4790f 100644
--- a/drivers/irqchip/irq-mst-intc.c
+++ b/drivers/irqchip/irq-mst-intc.c
@@ -259,6 +259,9 @@ static int __init mst_intc_of_init(struct device_node *dn,
of_property_read_u32_index(dn, "mstar,irqs-map-range", 1, &irq_end))
return -EINVAL;
+ if (irq_end < irq_start || irq_end - irq_start >= MST_INTC_MAX_IRQS)
+ return -EINVAL;
+
cd = kzalloc(sizeof(*cd), GFP_KERNEL);
if (!cd)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0418/1167] ASoC: rt5645: Shut down the button timer on removal
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (411 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0417/1167] irqchip/mst-intc: Validate the DT interrupt range Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0419/1167] ASoC: rockchip: fix device node reference leak in rk3288_hdmi_analog Greg Kroah-Hartman
` (244 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit f0ecc305442f20a6df2575943e9897825d80cc5d ]
jack_detect_work can rearm btn_check_timer, and the timer callback can
queue jack_detect_work. Deleting the timer before cancelling the work
does not break this cycle: an already running worker can rearm the timer
after timer_delete_sync() returns. The timer can then outlive removal.
Use timer_shutdown_sync() before cancelling the delayed work so that
subsequent attempts to rearm the timer are ignored. The IRQ producer has
already been removed at this point. Keep the restartable timer deletion
in the suspend path.
This issue was identified as part of our ongoing research while
reviewing kernel code.
Fixes: 7ff6319e7da5 ("ASoC: rt5645: use polling to support HS button")
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/179203261324.2681924.5002100194676410503.rt5645-button-timer@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Replaced timer_delete_sync() with the older del_timer_sync() in the context, while the changed line itself still calls timer_shutdown_sync() as upstream does. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5645.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 4b35f6284d8c3..6b2250c89903d 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -18,6 +18,7 @@
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/regulator/consumer.h>
+#include <linux/timer.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -4220,10 +4221,10 @@ static void rt5645_i2c_remove(struct i2c_client *i2c)
free_irq(i2c->irq, rt5645);
/*
- * Since the rt5645_btn_check_callback() can queue jack_detect_work,
- * the timer need to be delted first
+ * The timer and jack_detect_work can rearm each other. Shut down the
+ * timer before cancelling the work.
*/
- del_timer_sync(&rt5645->btn_check_timer);
+ timer_shutdown_sync(&rt5645->btn_check_timer);
cancel_delayed_work_sync(&rt5645->jack_detect_work);
cancel_delayed_work_sync(&rt5645->rcclock_work);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0419/1167] ASoC: rockchip: fix device node reference leak in rk3288_hdmi_analog
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (412 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0418/1167] ASoC: rt5645: Shut down the button timer on removal Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0420/1167] ublk: use global index for reported zones Greg Kroah-Hartman
` (243 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Haotian Zhang, Mark Brown,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haotian Zhang <vulab@iscas.ac.cn>
[ Upstream commit f15b2df0b940cb2c01797f78791de3279d514086 ]
snd_rk_mc_probe() acquires references to the codec and CPU device nodes
with of_parse_phandle() and stores them in the static rk_dailink, but the
driver never calls of_node_put() on them. All error paths and the success
path simply return, and the driver has no remove callback, so the
references are leaked for the whole lifetime of the card and each failed
or repeated probe leaks another pair. The same pattern was fixed for the
sibling rockchip_rt5645.c driver.
Release the codec and CPU device nodes on every probe error path and in a
new remove callback, and also drop the extra reference placed in args.np
by of_parse_phandle_with_fixed_args().
Fixes: eaae2ea73593 ("ASoC: rockchip: Add machine driver for RK3288 boards that use analog/HDMI")
Assisted-by: DeepSeek-V4.1-Flash
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20261008181459.2762862-1-vulab@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Kept the existing dev_err() calls instead of dev_err_probe() in two hunks, and used .remove_new rather than .remove for the void remove callback. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/rockchip/rk3288_hdmi_analog.c | 36 ++++++++++++++++++++-----
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c b/sound/soc/rockchip/rk3288_hdmi_analog.c
index 0c6bd9a019dbe..58b2dbea473da 100644
--- a/sound/soc/rockchip/rk3288_hdmi_analog.c
+++ b/sound/soc/rockchip/rk3288_hdmi_analog.c
@@ -220,13 +220,14 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev,
"Unable to parse property 'rockchip,audio-codec'\n");
- return ret;
+ goto put_codec_of_node;
}
ret = snd_soc_get_dai_name(&args, &rk_dailink.codecs[0].dai_name);
+ of_node_put(args.np);
if (ret) {
dev_err(&pdev->dev, "Unable to get codec_dai_name\n");
- return ret;
+ goto put_codec_of_node;
}
rk_dailink.cpus->of_node = of_parse_phandle(np, "rockchip,i2s-controller",
@@ -234,7 +235,8 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
if (!rk_dailink.cpus->of_node) {
dev_err(&pdev->dev,
"Property 'rockchip,i2s-controller' missing or invalid\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto put_codec_of_node;
}
rk_dailink.platforms->of_node = rk_dailink.cpus->of_node;
@@ -243,17 +245,36 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev,
"Unable to parse 'rockchip,routing' property\n");
- return ret;
+ goto put_cpu_of_node;
}
snd_soc_card_set_drvdata(card, machine);
ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret)
- return dev_err_probe(&pdev->dev, ret,
- "Soc register card failed\n");
+ if (ret) {
+ dev_err_probe(&pdev->dev, ret,
+ "Soc register card failed\n");
+ goto put_cpu_of_node;
+ }
return 0;
+
+put_cpu_of_node:
+ of_node_put(rk_dailink.cpus->of_node);
+ rk_dailink.cpus->of_node = NULL;
+put_codec_of_node:
+ of_node_put(rk_dailink.codecs[0].of_node);
+ rk_dailink.codecs[0].of_node = NULL;
+
+ return ret;
+}
+
+static void snd_rk_mc_remove(struct platform_device *pdev)
+{
+ of_node_put(rk_dailink.cpus->of_node);
+ rk_dailink.cpus->of_node = NULL;
+ of_node_put(rk_dailink.codecs[0].of_node);
+ rk_dailink.codecs[0].of_node = NULL;
}
static const struct of_device_id rockchip_sound_of_match[] = {
@@ -265,6 +286,7 @@ MODULE_DEVICE_TABLE(of, rockchip_sound_of_match);
static struct platform_driver rockchip_sound_driver = {
.probe = snd_rk_mc_probe,
+ .remove_new = snd_rk_mc_remove,
.driver = {
.name = DRV_NAME,
.pm = &snd_soc_pm_ops,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0420/1167] ublk: use global index for reported zones
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (413 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0419/1167] ASoC: rockchip: fix device node reference leak in rk3288_hdmi_analog Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0421/1167] tcp: use the echoed source route in cookie_v4_check() Greg Kroah-Hartman
` (242 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Ming Lei, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit 80897c7e5ae5c56f37a2eb004328edcb4da7cdd1 ]
ublk_report_zones() may split a zone report into multiple requests when
the number of zones exceeds the temporary buffer capacity. The index
passed to disk_report_zone() must refer to the zone position in the
whole report, rather than the position within the current request.
Currently, the per-request loop index is used as the callback index,
causing each chunk after the first one to restart from zero. This can
make userspace callbacks receive duplicate zone indices and may result
in blk_revalidate_disk_zones() updating incorrect entries in its zone
state array.
Use the number of zones already reported as the base index for each
request so that zone indices remain continuous across all chunks.
Fixes: 29802d7ca33b ("ublk: enable zoned storage support")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Tested-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Link: https://patch.msgid.link/20261011063555.1142277-13-tom.leiming@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: Replaced the disk_report_zone(disk, zone, done_zones, args) call with the direct cb(zone, done_zones, data) call, since this tree has no disk_report_zone() helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/ublk_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 2c31ab722361d..2da3dfac9157b 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -384,7 +384,7 @@ static int ublk_report_zones(struct gendisk *disk, sector_t sector,
if (!zone->len)
break;
- ret = cb(zone, i, data);
+ ret = cb(zone, done_zones, data);
if (ret)
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0421/1167] tcp: use the echoed source route in cookie_v4_check()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (414 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0420/1167] ublk: use global index for reported zones Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0422/1167] pinctrl: stm32: Fix the unit of the hwspinlock timeout Greg Kroah-Hartman
` (241 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 54d574d4afd9de820c8a017665c8095f0f5fdbaa ]
When the ACK carries a source route option, cookie_v4_check() routes
the new socket to opt->faddr, where opt points to the options of the
received packet.
ip_options_compile() only fills faddr for options given by
setsockopt() (when called without an skb), so on receive faddr is 0
and the lookup is done for daddr 0, which gives a local route.
Use the options echoed by tcp_v4_save_options() instead, as
inet_csk_route_req() and inet_csk_route_child_sock() do with
ireq->ireq_opt. Read them after security_inet_conn_request(),
since CIPSO can replace ireq->ireq_opt there.
The route now goes to the first hop of the source route, so also
refuse a strict source route through a gateway, as
inet_csk_route_req() does.
Found by sashiko while reviewing the sk_mc_loop() fix.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261012101029.927296-3-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: adapted cookie_v4_check() context to the older single-function layout, using reqsk_free(req); goto out; for the new strict-route error path instead of SKB_DR_SET/out_free. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/syncookies.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 3140c7742b30f..ae79dd47f0fde 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -320,13 +320,13 @@ EXPORT_SYMBOL_GPL(cookie_tcp_reqsk_alloc);
*/
struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
{
- struct ip_options *opt = &TCP_SKB_CB(skb)->header.h4.opt;
struct tcp_options_received tcp_opt;
struct inet_request_sock *ireq;
struct tcp_request_sock *treq;
struct tcp_sock *tp = tcp_sk(sk);
const struct tcphdr *th = tcp_hdr(skb);
__u32 cookie = ntohl(th->ack_seq) - 1;
+ struct ip_options_rcu *opt;
struct sock *ret = sk;
struct request_sock *req;
int full_space, mss;
@@ -409,6 +409,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
reqsk_free(req);
goto out;
}
+ /* Load ireq->ireq_opt after the LSM hook, which can replace it. */
+ opt = rcu_dereference_protected(ireq->ireq_opt, true);
req->num_retrans = 0;
@@ -421,7 +423,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
flowi4_init_output(&fl4, ireq->ir_iif, ireq->ir_mark,
ip_sock_rt_tos(sk), ip_sock_rt_scope(sk),
IPPROTO_TCP, inet_sk_flowi_flags(sk),
- opt->srr ? opt->faddr : ireq->ir_rmt_addr,
+ (opt && opt->opt.srr) ? opt->opt.faddr : ireq->ir_rmt_addr,
ireq->ir_loc_addr, th->source, th->dest, sk->sk_uid);
security_req_classify_flow(req, flowi4_to_flowi_common(&fl4));
rt = ip_route_output_key(sock_net(sk), &fl4);
@@ -429,6 +431,12 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
reqsk_free(req);
goto out;
}
+ /* Same check as in inet_csk_route_req(). */
+ if (opt && opt->opt.is_strictroute && rt->rt_uses_gateway) {
+ ip_rt_put(rt);
+ reqsk_free(req);
+ goto out;
+ }
/* Try to redo what tcp_v4_send_synack did. */
req->rsk_window_clamp = READ_ONCE(tp->window_clamp) ? :
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0422/1167] pinctrl: stm32: Fix the unit of the hwspinlock timeout
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (415 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0421/1167] tcp: use the echoed source route in cookie_v4_check() Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0423/1167] ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912) Greg Kroah-Hartman
` (240 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ju Nan, Linus Walleij, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ju Nan <junan76@163.com>
[ Upstream commit 544b3f8042dd7c18baa48dcb1a393ff8b6742322 ]
HWSPNLCK_TIMEOUT is passed to hwspin_lock_timeout_in_atomic(), whose
timeout argument is in milliseconds, not microseconds:
atomic_delay += HWSPINLOCK_RETRY_DELAY_US;
if (atomic_delay > to * 1000)
return -ETIMEDOUT;
The hwspinlock core documents this explicitly:
If the mode is HWLOCK_IN_ATOMIC (called from an atomic context) the
timeout is handled with busy-waiting delays, hence shall not exceed
few msecs.
Fixes: 290a9f937e5a ("pinctrl: stm32: use the hwspin_lock_timeout_in_atomic() API")
Signed-off-by: Ju Nan <junan76@163.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
[ sashal: adapted to the older file layout; only the call sites present in this version are updated. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/stm32/pinctrl-stm32.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 170f0aa0d5381..218cf188d5982 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -68,7 +68,7 @@
#define gpio_range_to_bank(chip) \
container_of(chip, struct stm32_gpio_bank, range)
-#define HWSPNLCK_TIMEOUT 1000 /* usec */
+#define HWSPNLCK_TIMEOUT_MS 1
static const char * const stm32_gpio_functions[] = {
"gpio", "af0", "af1",
@@ -447,7 +447,7 @@ static int stm32_gpio_domain_activate(struct irq_domain *d,
if (pctl->hwlock) {
ret = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (ret) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
return ret;
@@ -783,7 +783,7 @@ static int stm32_pmx_set_mode(struct stm32_gpio_bank *bank,
if (pctl->hwlock) {
err = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (err) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
goto unlock;
@@ -915,7 +915,7 @@ static int stm32_pconf_set_driving(struct stm32_gpio_bank *bank,
if (pctl->hwlock) {
err = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (err) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
goto unlock;
@@ -966,7 +966,7 @@ static int stm32_pconf_set_speed(struct stm32_gpio_bank *bank,
if (pctl->hwlock) {
err = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (err) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
goto unlock;
@@ -1017,7 +1017,7 @@ static int stm32_pconf_set_bias(struct stm32_gpio_bank *bank,
if (pctl->hwlock) {
err = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (err) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
goto unlock;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0423/1167] ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912)
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (416 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0422/1167] pinctrl: stm32: Fix the unit of the hwspinlock timeout Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0424/1167] btrfs: drop the extent maps of the written part of a failed ordered extent Greg Kroah-Hartman
` (239 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Viktor Menshin, Takashi Iwai,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viktor Menshin <ripeeerr@gmail.com>
[ Upstream commit 2fc28b1186d6fce8b046e6118072cf3ca32f2960 ]
Commit 3a3e810e9108 ("ALSA: hda/realtek: Add quirk for Lenovo Xiaoxin
14 GT") added a quirk mapping SSID 17aa:3912 to
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, chosen by analogy with
neighboring SSIDs (0x390d, 0x3911, 0x391a) without being verified on
hardware, as noted in that commit's own message.
I have since tested it on the actual hardware (Lenovo Xiaoxin Pro 14
ASP10, same 17aa:3912 SSID) and confirmed it does not fix the reported
issue. ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN only repoints pin 0x17
and the preferred DAC pairs for the bass speaker; it does not touch
the codec's vendor processing coefficients. The actual symptom -
constant electrical hiss/crackle on both the headphone jack and the
internal speakers, independent of volume - is unrelated to pin/DAC
routing and is also present on stock Windows before the Realtek
driver is installed, which points at those coefficients being left
at their power-on default.
To find the correct values, I passed the physical HD Audio controller
through to a Windows 10 VM (VFIO, with QEMU patched to log CORB verb
traffic) and captured the coefficient writes the vendor Realtek driver
performs at init. Replaying a single one of them on Linux via hda-verb
reproducibly eliminates the headphone jack noise:
hda-verb /dev/snd/hwC#D0 0x20 SET_COEF_INDEX 0x36
hda-verb /dev/snd/hwC#D0 0x20 SET_PROC_COEF 0x77d7
This has held up across reboots and kernel updates for several weeks
(applied via a small systemd oneshot unit while testing).
Add a dedicated fixup that performs this coefficient write and chains
it with the existing ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN (which may
still be relevant for the bass speaker pin wiring on this board), and
point the 17aa:3912 quirk entry at it instead.
Honesty note: this fixes the headphone jack. The internal speakers
still have noise under certain conditions (notably worse on AC power)
that I have not been able to isolate via coefficient-table replay;
that part remains open. Sending what is verified to work rather than
holding this back.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221203
Fixes: 3a3e810e9108 ("ALSA: hda/realtek: Add quirk for Lenovo Xiaoxin 14 GT")
Signed-off-by: Viktor Menshin <ripeeerr@gmail.com>
Link: https://patch.msgid.link/20261015132157.57198-1-ripeeerr@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Moved the new Xiaoxin 14 GT fixup function into the older file layout, placing it after the yoga9 bass speaker fixup it chains to instead of before the yoga pro7 fixup. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/patch_realtek.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 17b81ffb6ff5b..4443b30e75b87 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7287,6 +7287,28 @@ static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
}
}
+/*
+ * The Lenovo Xiaoxin 14 GT (SSID 17aa:3912) uses the same bass-speaker
+ * pin wiring as its 0x390d/0x3911/0x391a siblings, but on this board the
+ * codec's vendor processing coefficients (node 0x20) are left at their
+ * power-on default instead of being programmed the way the vendor
+ * (Windows) driver programs them. That leaves audible hiss/crackle on
+ * both the headphone jack and the internal speakers, independent of
+ * volume, regardless of which pin/DAC routing is used.
+ *
+ * This single coefficient write was captured from the vendor driver's
+ * own init sequence (via a VFIO pass-through of the physical codec to a
+ * Windows VM) and confirmed to eliminate the headphone jack noise.
+ */
+static void alc287_fixup_lenovo_xiaoxin_14gt_hp_noise(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+{
+ if (action != HDA_FIXUP_ACT_INIT)
+ return;
+
+ alc_write_coef_idx(codec, 0x36, 0x77d7);
+}
+
static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
@@ -7634,6 +7656,7 @@ enum {
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
+ ALC287_FIXUP_LENOVO_XIAOXIN_14GT_HP_NOISE,
ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
ALC236_FIXUP_DELL_DUAL_CODECS,
ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
@@ -9883,6 +9906,12 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC287_FIXUP_CS35L41_I2C_2,
},
+ [ALC287_FIXUP_LENOVO_XIAOXIN_14GT_HP_NOISE] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc287_fixup_lenovo_xiaoxin_14gt_hp_noise,
+ .chained = true,
+ .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
+ },
[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc295_fixup_dell_inspiron_top_speakers,
@@ -10696,7 +10725,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
SND_PCI_QUIRK(0x17aa, 0x3911, "Lenovo Yoga Pro 7 14IAH10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
- SND_PCI_QUIRK(0x17aa, 0x3912, "Lenovo Xiaoxin 14 GT", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
+ SND_PCI_QUIRK(0x17aa, 0x3912, "Lenovo Xiaoxin 14 GT", ALC287_FIXUP_LENOVO_XIAOXIN_14GT_HP_NOISE),
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0424/1167] btrfs: drop the extent maps of the written part of a failed ordered extent
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (417 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0423/1167] ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912) Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0425/1167] btrfs: update the inode item when removing a free space inode Greg Kroah-Hartman
` (238 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tal Zussman, David Sterba,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tal Zussman <tz2294@columbia.edu>
[ Upstream commit bca2cf55a7331e6b0ff95ad47fc2a7e8ecc7dc74 ]
If a truncated ordered extent fails to complete, the extent maps for the
part that was written are kept while the extent itself is freed below.
A later read can follow them to blocks that have been reallocated.
Drop the maps for the whole range on error.
Fixes: 77cef2ec5484 ("Btrfs: allow partial ordered extent completion")
Assisted-by: LLM
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Signed-off-by: David Sterba <dsterba@suse.com>
[ sashal: adjusted the hunk to the existing unwritten_start declaration at the top of the if (ret || truncated) block, so the condition change also widens the clear_extent_uptodate() range on error. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/inode.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b6d40f0f0fb28..b99f485ce0516 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3329,12 +3329,14 @@ int btrfs_finish_one_ordered(struct btrfs_ordered_extent *ordered_extent)
&ordered_extent->flags))
mapping_set_error(ordered_extent->inode->i_mapping, -EIO);
- if (truncated)
+ if (truncated && !ret)
unwritten_start += logical_len;
clear_extent_uptodate(io_tree, unwritten_start, end, NULL);
/*
* Drop extent maps for the part of the extent we didn't write.
+ * On error the written part is freed below as well, so drop
+ * its maps too.
*
* We have an exception here for the free_space_inode, this is
* because when we do btrfs_get_extent() on the free space inode
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0425/1167] btrfs: update the inode item when removing a free space inode
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (418 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0424/1167] btrfs: drop the extent maps of the written part of a failed ordered extent Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0426/1167] bpf: Claim the per-CPU send_signal irq_work before filling it Greg Kroah-Hartman
` (237 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tal Zussman, David Sterba,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tal Zussman <tz2294@columbia.edu>
[ Upstream commit 4e89aff9ad6fcbec555c38169807c4023f93450f ]
btrfs_remove_free_space_inode() adds an orphan item for the free space
inode and clears its link count in memory, but never writes the inode
item. The item is only removed once the delayed iput evicts the inode,
which happens in a later transaction, from the cleaner thread or a
throttled transaction end.
If we crash in between, or if evict can't reserve space for the
truncation and leaves the orphan item for the next mount, the on-disk
inode still has a link count of 1. btrfs_orphan_cleanup() then treats it
as an inode with links and only deletes the orphan item. The free space
header item is already gone at that point, so nothing ever finds the
inode again, and its data extents are leaked.
Write the zero link count to the inode item in the same transaction as
the orphan item, so the orphan cleanup evicts the inode instead. Account
for the extra tree root item update when removing a block group.
Fixes: 455757c322cc ("Btrfs: delay iput when deleting a block group")
Assisted-by: LLM
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Signed-off-by: David Sterba <dsterba@suse.com>
[ sashal: Changed the new btrfs_update_inode() error branch to goto out instead of upstream's return ret, so the path is freed without the upstream scope-based auto-free cleanup. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/block-group.c | 6 ++++--
fs/btrfs/free-space-cache.c | 10 ++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 4ea1fb222ba90..fc44c65f1cbbb 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1328,12 +1328,14 @@ struct btrfs_trans_handle *btrfs_start_trans_remove_block_group(
ASSERT(em && em->start == chunk_offset);
/*
- * We need to reserve 3 + N units from the metadata space info in order
+ * We need to reserve 4 + N units from the metadata space info in order
* to remove a block group (done at btrfs_remove_chunk() and at
* btrfs_remove_block_group()), which are used for:
*
* 1 unit for adding the free space inode's orphan (located in the tree
* of tree roots).
+ * 1 unit for updating the free space inode's item (located in the tree
+ * of tree roots).
* 1 unit for deleting the block group item (located in the extent
* tree).
* 1 unit for deleting the free space item (located in tree of tree
@@ -1347,7 +1349,7 @@ struct btrfs_trans_handle *btrfs_start_trans_remove_block_group(
* btrfs_remove_chunk() through a call to check_system_chunk().
*/
map = em->map_lookup;
- num_items = 3 + map->num_stripes;
+ num_items = 4 + map->num_stripes;
free_extent_map(em);
return btrfs_start_transaction_fallback_global_rsv(root, num_items);
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index eb6d335493b16..6179a9c94d7f7 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -269,6 +269,16 @@ int btrfs_remove_free_space_inode(struct btrfs_trans_handle *trans,
goto out;
}
clear_nlink(inode);
+ /*
+ * Persist the zero link count, so that if the delayed iput below
+ * doesn't get to evict the inode, the orphan cleanup on the next mount
+ * evicts it instead of only deleting the orphan item.
+ */
+ ret = btrfs_update_inode(trans, BTRFS_I(inode));
+ if (ret) {
+ btrfs_add_delayed_iput(BTRFS_I(inode));
+ return ret;
+ }
/* One for the block groups ref */
spin_lock(&block_group->lock);
if (test_and_clear_bit(BLOCK_GROUP_FLAG_IREF, &block_group->runtime_flags)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0426/1167] bpf: Claim the per-CPU send_signal irq_work before filling it
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (419 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0425/1167] btrfs: update the inode item when removing a free space inode Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0427/1167] bpf: Use the frame mem type in devmap egress XDP Greg Kroah-Hartman
` (236 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Chen, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuan Chen <chenyuan@kylinos.cn>
[ Upstream commit 2d1f101ee619435873ed8a23fcb3bd09204a5024 ]
irq_work_is_busy() cannot see the per-CPU send_signal_work while
it is being filled: the check only matches after irq_work_queue()
has claimed the work. A concurrent caller therefore passes it, both
callers race for the same irq_work, and the loser's signal is
silently lost along with its task reference while the queued work
runs with a mix of both callers' fields.
kprobe, tracepoint and perf_event programs exclude each other on
the same CPU through bpf_prog_active, so for two callers to meet,
one of the programs has to be a raw tracepoint or an fentry one.
And since commit 87c544108b61 ("bpf: Send signals asynchronously
if !preemptible") this path runs with IRQs enabled too, so a hard
IRQ can interrupt the fill as well, not only an NMI. Found by code
inspection and reproduced with a perf_event NMI program racing an
fentry one.
Claim the work through work->task itself: cmpxchg() it from NULL
to the target task before touching the other fields, and set it
back to NULL once the callback has consumed them. A context
finding the work claimed returns the documented -EBUSY.
Fixes: 1bc7896e9ef4 ("bpf: Fix deadlock with rq_lock in bpf_send_signal()")
Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261009022427.968304-1-chenyuan@kylinos.cn
[ sashal: Backport uses cmpxchg(&work->task, NULL, current) and a plain get_task_struct(current) because the older bpf_send_signal_common() has no task argument and no siginfo handling. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/bpf_trace.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 4b13ab0daa5f9..64898a0672006 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -821,6 +821,7 @@ static const struct bpf_func_proto bpf_current_task_under_cgroup_proto = {
struct send_signal_irq_work {
struct irq_work irq_work;
+ /* The claim: NULL marks the slot free for the next caller. */
struct task_struct *task;
u32 sig;
enum pid_type type;
@@ -835,6 +836,8 @@ static void do_bpf_send_signal(struct irq_work *entry)
work = container_of(entry, struct send_signal_irq_work, irq_work);
group_send_sig_info(work->sig, SEND_SIG_PRIV, work->task, work->type);
put_task_struct(work->task);
+ /* Release once the fields are consumed. */
+ smp_store_release(&work->task, NULL);
}
static int bpf_send_signal_common(u32 sig, enum pid_type type)
@@ -862,14 +865,14 @@ static int bpf_send_signal_common(u32 sig, enum pid_type type)
return -EINVAL;
work = this_cpu_ptr(&send_signal_work);
- if (irq_work_is_busy(&work->irq_work))
+ if (cmpxchg(&work->task, NULL, current))
return -EBUSY;
/* Add the current task, which is the target of sending signal,
* to the irq_work. The current task may change when queued
* irq works get executed.
*/
- work->task = get_task_struct(current);
+ get_task_struct(current);
work->sig = sig;
work->type = type;
irq_work_queue(&work->irq_work);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0427/1167] bpf: Use the frame mem type in devmap egress XDP
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (420 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0426/1167] bpf: Claim the per-CPU send_signal irq_work before filling it Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0428/1167] bpf: Reject sleepable programs for task_vma iterator Greg Kroah-Hartman
` (235 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit b3ca872947ef322c475ceaa7a76a9ebb3356152e ]
A devmap egress program that removes a whole fragment of a redirected
xdp_frame with bpf_xdp_adjust_tail() or bpf_xdp_pull_data() frees it
with page_frag_free() whatever the frame's memory type is. For a
MEM_TYPE_PAGE_POOL frame from a page_pool based driver this drops the
page reference owned by the pool while the pool still accounts the
fragment ("page_pool leak" bad page, leaked pp reference).
kernel/bpf/devmap.c:dev_map_bpf_prog_run() points xdp.rxq at an
on-stack
struct xdp_rxq_info rxq = { .dev = rx_dev };
whose mem.type is 0, i.e. MEM_TYPE_PAGE_SHARED, and
net/core/filter.c:bpf_xdp_shrink_data() releases frags according to
rxq->mem.type. cpumap, which runs programs on xdp_frames the same way,
already copies xdpf->mem_type into its private rxq for each frame.
With 9000 byte frames from virtio_net and an egress program that cuts the
fragments off:
BUG: Bad page state in process swapper/3 pfn:10660b
page dumped because: page_pool leak
bad_page+0xbd/0x190
__free_frozen_pages+0x5c7/0x900
bpf_xdp_adjust_tail+0x3be/0x480
bpf_prog_dad43f894a3faff7_egress+0x15c/0x1cd
dev_map_bpf_prog_run+0x288/0x610
The pool waits for these pages for ever when its device is gone. That is
the harmless case. A page of the pool can hold more than one fragment
while its refcount is 1: the first page_frag_free() frees it under the
fragment which is still in use, and the second one runs into
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
kernel BUG at include/linux/mm.h:1846!
veth is not affected. It takes references of its own on the pages and
redirects the frame as MEM_TYPE_PAGE_SHARED.
Fix by setting rxq.mem.type from each frame before running the devmap
program, as cpu_map_bpf_prog_run_xdp() does.
Fixes: ca9984c5f0ab ("bpf: devmap: provide rxq after redirect")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-2-alexei.starovoitov@gmail.com
[ sashal: Changed rxq.mem.type = xdpf->mem_type to rxq.mem = xdpf->mem, since this tree's xdp_frame has no mem_type field and keeps the whole xdp_mem_info struct. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/devmap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index 8ce3b152dcd5b..f4cc948a7b86f 100644
--- a/kernel/bpf/devmap.c
+++ b/kernel/bpf/devmap.c
@@ -337,6 +337,7 @@ static int dev_map_bpf_prog_run(struct bpf_prog *xdp_prog,
xdp_convert_frame_to_buff(xdpf, &xdp);
xdp.txq = &txq;
+ rxq.mem = xdpf->mem;
xdp.rxq = &rxq;
act = bpf_prog_run_xdp(xdp_prog, &xdp);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0428/1167] bpf: Reject sleepable programs for task_vma iterator
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (421 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0427/1167] bpf: Use the frame mem type in devmap egress XDP Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0429/1167] bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit Greg Kroah-Hartman
` (234 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit dfcd1765911223df60845e288ad392d5237f47a3 ]
A sleepable "iter.s/task_vma" program can be attached, but its ->show()
callback runs with the mmap_lock of the iterated mm held for read. As soon
as the program runs, bpf_iter_run_prog() calls might_fault(), and any
bpf_copy_from_user() or bpf_copy_from_user_task() it does may really fault
or take mmap_lock again. With lockdep this is reported as recursive
locking of mmap_lock. Without lockdep, a fault on the reader's own mm, or
access_process_vm() on the iterated mm, has to take mmap_lock for read
again. If a writer queued up in the meantime that blocks behind the
writer, which in turn waits for the read lock the iterator already holds,
and the read() hangs:
reader (iter.s/task_vma) other thread of the same mm
task_vma_seq_get_next()
mmap_read_lock(mm)
mmap_write_lock(mm) <- waits
bpf prog: copy_from_user()
page fault
mmap_read_lock(mm) <- queued behind the writer
The reader waits killable, so the hang lasts until it gets a fatal signal.
bpf_iter_link_attach() allows sleepable programs for the targets that set
BPF_ITER_RESCHED, and task_vma sets it because cond_resched() between VMAs
is fine with mmap_lock held. Rescheduling between objects and running a
sleepable program inside ->show() are different properties, though, and
task_vma only has the first one. The open-coded task_vma iterator does not
have this problem since it hands out a snapshot of the VMA and holds no
lock when it returns to the program.
The vma handed to the program is only stable under mmap_lock, so the lock
can't be dropped around ->show(). Add a feature flag BPF_ITER_NOSLEEP for
targets which can't run sleepable programs although they can reschedule,
and set it for task_vma.
The check at attach time is not enough. BPF_LINK_UPDATE replaces the
program of a link, and bpf_iter_link_replace() only compares the type, the
attach type and the BTF id of the two programs, which are the same for a
sleepable and a non-sleepable one. Do the check there as well. That also
closes this way around the existing rule: so far a sleepable program could
be put on a link of a target that doesn't set BPF_ITER_RESCHED, like the
hash map element iterator, which runs it under rcu_read_lock().
BPF_LINK_CREATE of a sleepable program for the task_vma target, and
BPF_LINK_UPDATE to one, now fail with -EINVAL, also for programs that
don't touch user memory and have been working since sleepable iterator
programs exist. The programs can still be loaded. They have to be
loaded as non-sleepable programs, or use the open-coded iterator.
Fixes: b77fb25dcb34 ("bpf: Add support for bpf iterator programs to use sleepable helpers")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-6-alexei.starovoitov@gmail.com
[ sashal: Changed prog->sleepable to prog->aux->sleepable in the new helper and the attach check, since sleepable lives in bpf_prog_aux here; kzalloc_obj context left as kzalloc(sizeof()). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/bpf.h | 3 ++-
kernel/bpf/bpf_iter.c | 17 ++++++++++++++---
kernel/bpf/task_iter.c | 6 +++++-
3 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 79e7005de178c..d0f7dc46d43f7 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -2310,7 +2310,8 @@ typedef const struct bpf_func_proto *
const struct bpf_prog *prog);
enum bpf_iter_feature {
- BPF_ITER_RESCHED = BIT(0),
+ BPF_ITER_RESCHED = BIT(0), /* may cond_resched() between objects */
+ BPF_ITER_NOSLEEP = BIT(1), /* ->show() can't run sleepable progs */
};
#define BPF_ITER_CTX_ARG_MAX 2
diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c
index 852121dabe9e0..cf39e7edb2aec 100644
--- a/kernel/bpf/bpf_iter.c
+++ b/kernel/bpf/bpf_iter.c
@@ -73,6 +73,15 @@ static inline bool bpf_iter_target_support_resched(const struct bpf_iter_target_
return tinfo->reg_info->feature & BPF_ITER_RESCHED;
}
+/* Only allow sleepable program for resched-able iterator that can run one */
+static bool bpf_iter_target_support_prog(const struct bpf_iter_target_info *tinfo,
+ const struct bpf_prog *prog)
+{
+ return !prog->aux->sleepable ||
+ (bpf_iter_target_support_resched(tinfo) &&
+ !(tinfo->reg_info->feature & BPF_ITER_NOSLEEP));
+}
+
static bool bpf_iter_support_resched(struct seq_file *seq)
{
struct bpf_iter_priv_data *iter_priv;
@@ -419,6 +428,8 @@ static int bpf_iter_link_replace(struct bpf_link *link,
struct bpf_prog *new_prog,
struct bpf_prog *old_prog)
{
+ struct bpf_iter_link *iter_link =
+ container_of(link, struct bpf_iter_link, link);
int ret = 0;
mutex_lock(&link_mutex);
@@ -429,7 +440,8 @@ static int bpf_iter_link_replace(struct bpf_link *link,
if (link->prog->type != new_prog->type ||
link->prog->expected_attach_type != new_prog->expected_attach_type ||
- link->prog->aux->attach_btf_id != new_prog->aux->attach_btf_id) {
+ link->prog->aux->attach_btf_id != new_prog->aux->attach_btf_id ||
+ !bpf_iter_target_support_prog(iter_link->tinfo, new_prog)) {
ret = -EINVAL;
goto out_unlock;
}
@@ -554,8 +566,7 @@ int bpf_iter_link_attach(const union bpf_attr *attr, bpfptr_t uattr,
if (!tinfo)
return -ENOENT;
- /* Only allow sleepable program for resched-able iterator */
- if (prog->aux->sleepable && !bpf_iter_target_support_resched(tinfo))
+ if (!bpf_iter_target_support_prog(tinfo, prog))
return -EINVAL;
link = kzalloc(sizeof(*link), GFP_USER | __GFP_NOWARN);
diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c
index 481e2b43f0ed1..4163f8be43680 100644
--- a/kernel/bpf/task_iter.c
+++ b/kernel/bpf/task_iter.c
@@ -764,7 +764,11 @@ static const struct bpf_iter_seq_info task_vma_seq_info = {
static struct bpf_iter_reg task_vma_reg_info = {
.target = "task_vma",
.attach_target = bpf_iter_attach_task,
- .feature = BPF_ITER_RESCHED,
+ /*
+ * ->show() runs with the mmap_lock of the iterated mm held, which a
+ * sleepable program takes again when it faults on user memory.
+ */
+ .feature = BPF_ITER_RESCHED | BPF_ITER_NOSLEEP,
.ctx_arg_info_size = 2,
.ctx_arg_info = {
{ offsetof(struct bpf_iter__task_vma, task),
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0429/1167] bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (422 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0428/1167] bpf: Reject sleepable programs for task_vma iterator Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0430/1167] bpf: Assume no bounds for buffers behind a tail call Greg Kroah-Hartman
` (233 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit ee4f44e0e3c8125eebe9ac967b6984bc9253d489 ]
In the branch of a BPF_JSET which is taken, the verifier can learn
something about the register only if the mask has a single bit: then this
bit is set. regs_refine_cond_op() tests this with is_power_of_2(val) and
then ORs val into var_off.
val is a u64, but is_power_of_2() takes an unsigned long. On a 32-bit
kernel it only sees the lower half of the mask. For
if r1 & 0xffffffff80000000 goto l
which is a BPF_JSET | BPF_K with an immediate of 0x80000000, the lower
half is a power of two. So the verifier takes all 33 bits for set at l,
while the branch is taken if any of them is. A mask of 0x100000001 from a
register does the same for bit 0.
The log of an i386 kernel, for r6 = bpf_get_prandom_u32() << 31:
3: (45) if r6 & 0x80000000 goto pc+2
from 3 to 6: R6=0xffffffff80000000 R10=fp0
6: (77) r6 >>= 63 ; R6=1
When the program runs, r6 >> 63 is 0.
>From then on the verifier works with known bits which the register does
not have at run time. It accepts, for example, an offset into a map value
which it derives from these bits and believes to be constant, and the
program can access memory outside of the map value.
Count the bits of the whole value.
Only 32-bit kernels are affected. On a 64-bit kernel unsigned long holds
the whole mask, and this patch changes nothing.
Fixes: 960ea056561a ("bpf: verifier: teach the verifier to reason about the BPF_JSET instruction")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-8-alexei.starovoitov@gmail.com
[ sashal: Retargeted the change to reg_set_min_max() since regs_refine_cond_op() doesn't exist here, using hweight64(uval) == 1 in the BPF_JSET branch. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 687be68c728a9..771d0c5a46ac4 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -14406,7 +14406,7 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
tnum_const(uval32));
} else {
false_64off = tnum_and(false_64off, tnum_const(~uval));
- if (is_power_of_2(uval))
+ if (hweight64(uval) == 1)
true_64off = tnum_or(true_64off,
tnum_const(uval));
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0430/1167] bpf: Assume no bounds for buffers behind a tail call
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (423 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0429/1167] bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0431/1167] bpf: Assume no bounds for a writable tp with tail calls Greg Kroah-Hartman
` (232 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 7fa323d77688e8b62b2f0bf6c3208a2c96d4a5e7 ]
The bpf_map_elem, bpf_sk_storage_map and sockmap iterators hand the key
and the value of an element to the program as buffers. The verifier notes
how far a program reaches into them, and the iterator compares that with
the map when the program is attached. A program that does not touch the
buffers passes. It can tail-call another program of the same target,
which gets the same context, and whose reach nobody compares with the
map:
BUG: KASAN: slab-out-of-bounds in ___bpf_prog_run+0xa46a/0xae80
The program array can be filled at any time, so there is nothing to look
at when the link is made. For the same reason a program with a tail call
is taken to use the whole stack and the whole packet. Take it to reach
as far as can be into the buffers as well, so that these iterators refuse
it with -EACCES.
Fixes: d6c4503cc296 ("bpf: Implement bpf iterator for hash maps")
Fixes: 5ce6e77c7edf ("bpf: Implement bpf iterator for sock local storage map")
Fixes: 0365351524d7 ("net: Allow iterating sockmap and sockhash")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-26-alexei.starovoitov@gmail.com
[ sashal: adjusted the tail-call fixup to the older file and function names (verifier.c, do_misc_fixups) with the older allow_tail_call_in_subprogs() context line. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 771d0c5a46ac4..8d60218344b4d 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -19548,6 +19548,8 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
if (!allow_tail_call_in_subprogs(env))
prog->aux->stack_depth = MAX_BPF_STACK;
prog->aux->max_pkt_offset = MAX_PACKET_OFF;
+ prog->aux->max_rdonly_access = U32_MAX;
+ prog->aux->max_rdwr_access = U32_MAX;
/* mark bpf_tail_call as different opcode to avoid
* conditional branch in the interpreter for every normal
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0431/1167] bpf: Assume no bounds for a writable tp with tail calls
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (424 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0430/1167] bpf: Assume no bounds for buffers behind a tail call Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0432/1167] bpf: Dont let an extension reach further into the context than its target Greg Kroah-Hartman
` (231 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit cd0490e671d70326d70c7d36e82388939fd9b071 ]
A writable raw tracepoint hands a buffer to the program. The verifier
notes how far the program reaches into it, and bpf_probe_register() refuses
a program that reaches further than the tracepoint allows. A program that
does not touch the buffer passes, and can tail-call one of its type that
reads and writes behind it.
Take a BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE program with a tail call to
reach as far as can be, as for the stack, the packet and the buffers of
iterators. It cannot be attached any more. Plain raw tracepoint programs,
for which the limit is zero, cannot get at the buffer, and a tail call
stays within one type: they are left alone.
Fixes: 9df1c28bb752 ("bpf: add writable context for raw tracepoints")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-28-alexei.starovoitov@gmail.com
[ sashal: adjusted the tail-call fixup to the older file and function names (verifier.c, do_misc_fixups). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 8d60218344b4d..39f3e2aea0d9e 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -19550,6 +19550,8 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
prog->aux->max_pkt_offset = MAX_PACKET_OFF;
prog->aux->max_rdonly_access = U32_MAX;
prog->aux->max_rdwr_access = U32_MAX;
+ if (prog->type == BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE)
+ prog->aux->max_tp_access = U32_MAX;
/* mark bpf_tail_call as different opcode to avoid
* conditional branch in the interpreter for every normal
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0432/1167] bpf: Dont let an extension reach further into the context than its target
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (425 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0431/1167] bpf: Assume no bounds for a writable tp with tail calls Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0433/1167] bpf: Keep the symbols of a program until it has ended Greg Kroah-Hartman
` (230 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit fcbfa99aa657627528b75e7dc1023bcb0b84e558 ]
How large the context of a raw tracepoint, tracepoint or syscall program
is depends on what the program is attached to, or is run with.
bpf_probe_register(), perf_event_set_bpf_prog() and the test runs compare
that with max_ctx_offset of the program.
An extension of the program, or of one of its global functions, gets the
same context. How far it reaches is noted in its own max_ctx_offset, which
nobody looks at. On a tracepoint with one argument it reads the stack
behind the arguments, in a test run the memory behind the context, or
from NULL if there is none:
BUG: KASAN: stack-out-of-bounds in bpf_prog_954b5d2051843629_ts28_ext_far+0x7e/0x113
Read of size 8 at addr ffffc90000def7b8 by task ts28/104
BUG: KASAN: slab-out-of-bounds in bpf_prog_954b5d2051843629_ts28_ext_far+0x7e/0x113
Read of size 8 at addr ffff88810712c3e8 by task ts28/104
Refuse to attach an extension that reaches further than the program which
it extends. A program that leaves the context to its extensions has to
touch as much of it as they do.
Fixes: be8704ff07d2 ("bpf: Introduce dynamic program extensions")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-3-alexei.starovoitov@gmail.com
[ sashal: Dropped the unrelated kprobe_write_ctx context block from the conflict and kept only the patch's own hunk, since that block's feature isn't present in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/syscall.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 5c530940d212b..9cf95263a0213 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -3331,6 +3331,19 @@ static int bpf_tracing_prog_attach(struct bpf_prog *prog,
tr = prog->aux->dst_trampoline;
tgt_prog = prog->aux->dst_prog;
}
+ /*
+ * The size of these contexts depends on what the program is attached
+ * to, or run with. That is compared with max_ctx_offset of the program,
+ * and nobody looks at the one of its extensions.
+ */
+ if (prog->type == BPF_PROG_TYPE_EXT &&
+ (tgt_prog->type == BPF_PROG_TYPE_RAW_TRACEPOINT ||
+ tgt_prog->type == BPF_PROG_TYPE_TRACEPOINT ||
+ tgt_prog->type == BPF_PROG_TYPE_SYSCALL) &&
+ prog->aux->max_ctx_offset > tgt_prog->aux->max_ctx_offset) {
+ err = -EINVAL;
+ goto out_unlock;
+ }
err = bpf_link_prime(&link->link.link, &link_primer);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0433/1167] bpf: Keep the symbols of a program until it has ended
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (426 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0432/1167] bpf: Dont let an extension reach further into the context than its target Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0434/1167] bpf, cpumap: Hold the device of frames in the queue Greg Kroah-Hartman
` (229 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 4eaf4d71b91a983489227336adcab33d8eae58a5 ]
When the last reference to a program goes, __bpf_prog_put_noref() takes
its symbols out of the kallsyms tree and frees its line info at once, and
waits for the grace periods only with the rest. But the program may still
be running: the link or the array it was called from is gone, the call is
not over.
search_bpf_extables() finds the exception table of a program by its
symbol. A load that faults, and that the table is there to fix up, is
fatal from then on:
Oops: general protection fault, probably for non-canonical address
0xdead0000000006f8: 0000 [#1] SMP NOPTI
RIP: 0010:0xffffffffc06008f6
It takes a program that is detached and closed on one CPU while it runs on
another. Unwinders and bpf_prog_find_from_stack() do not know the program
any more either, and the stack dump of a BPF stream reads the freed line
info.
Free the line info behind the grace periods the program needs, as it is
done with the BTF that its text comes from. Remove the symbols in
bpf_prog_free_deferred(), which runs behind them as well. The symbols are
looked up under rcu_read_lock(), so the images and the program itself are
freed one more grace period later. All that the program refers to is
released when it was before.
Fixes: 3dec541b2e63 ("bpf: Add support for BTF pointers to x86 JIT")
Fixes: d7c431cafcb4 ("bpf: Add dump_stack() analogue to print to BPF stderr")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-6-alexei.starovoitov@gmail.com
[ sashal: Renamed real_func_cnt to func_cnt in the new helper and the ksyms line, and resolved the free-loop conflict by taking the patch's INIT_RCU_WORK/queue_rcu_work() tail. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/bpf.h | 1 +
kernel/bpf/core.c | 50 +++++++++++++++++++++++++++++++-------------
kernel/bpf/syscall.c | 5 ++---
3 files changed, 38 insertions(+), 18 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index d0f7dc46d43f7..1283266e02aee 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1512,6 +1512,7 @@ struct bpf_prog_aux {
union {
struct work_struct work;
struct rcu_head rcu;
+ struct rcu_work rwork;
};
};
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 4ad9435c915d7..fb22830ddcee0 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -2828,12 +2828,40 @@ static void bpf_free_used_btfs(struct bpf_prog_aux *aux)
kfree(aux->used_btfs);
}
-static void bpf_prog_free_deferred(struct work_struct *work)
+static void bpf_prog_free_images(struct work_struct *work)
{
struct bpf_prog_aux *aux;
int i;
+ aux = container_of(to_rcu_work(work), struct bpf_prog_aux, rwork);
+ for (i = 0; i < aux->func_cnt; i++) {
+ /* We can just unlink the subprog poke descriptor table as
+ * it was originally linked to the main program and is also
+ * released along with it.
+ */
+ aux->func[i]->aux->poke_tab = NULL;
+ bpf_jit_free(aux->func[i]);
+ }
+ if (aux->func_cnt) {
+ kfree(aux->func);
+ bpf_prog_unlock_free(aux->prog);
+ } else {
+ bpf_jit_free(aux->prog);
+ }
+}
+
+static void bpf_prog_free_deferred(struct work_struct *work)
+{
+ struct bpf_prog_aux *aux;
+ bool ksyms;
+
aux = container_of(work, struct bpf_prog_aux, work);
+ /*
+ * A prog that still runs when its last reference goes needs its symbols,
+ * by which its exception table is found. It has ended by now.
+ */
+ ksyms = aux->func_cnt || !list_empty(&aux->ksym.lnode);
+ bpf_prog_kallsyms_del_all(aux->prog);
#ifdef CONFIG_BPF_SYSCALL
bpf_free_kfunc_btf_tab(aux->kfunc_btf_tab);
#endif
@@ -2851,20 +2879,12 @@ static void bpf_prog_free_deferred(struct work_struct *work)
#endif
if (aux->dst_trampoline)
bpf_trampoline_put(aux->dst_trampoline);
- for (i = 0; i < aux->func_cnt; i++) {
- /* We can just unlink the subprog poke descriptor table as
- * it was originally linked to the main program and is also
- * released along with it.
- */
- aux->func[i]->aux->poke_tab = NULL;
- bpf_jit_free(aux->func[i]);
- }
- if (aux->func_cnt) {
- kfree(aux->func);
- bpf_prog_unlock_free(aux->prog);
- } else {
- bpf_jit_free(aux->prog);
- }
+ /* The symbols are looked up under rcu_read_lock() */
+ INIT_RCU_WORK(&aux->rwork, bpf_prog_free_images);
+ if (ksyms)
+ queue_rcu_work(system_percpu_wq, &aux->rwork);
+ else
+ bpf_prog_free_images(&aux->rwork.work);
}
void bpf_prog_free(struct bpf_prog *fp)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 9cf95263a0213..cd34ce0faa388 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2145,6 +2145,8 @@ static void __bpf_prog_put_rcu(struct rcu_head *rcu)
struct bpf_prog_aux *aux = container_of(rcu, struct bpf_prog_aux, rcu);
btf_put(aux->btf);
+ kvfree(aux->jited_linfo);
+ kvfree(aux->linfo);
kvfree(aux->func_info);
kfree(aux->func_info_aux);
free_uid(aux->user);
@@ -2154,10 +2156,7 @@ static void __bpf_prog_put_rcu(struct rcu_head *rcu)
static void __bpf_prog_put_noref(struct bpf_prog *prog, bool deferred)
{
- bpf_prog_kallsyms_del_all(prog);
module_put(prog->aux->mod);
- kvfree(prog->aux->jited_linfo);
- kvfree(prog->aux->linfo);
kfree(prog->aux->kfunc_tab);
if (prog->aux->attach_btf)
btf_put(prog->aux->attach_btf);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0434/1167] bpf, cpumap: Hold the device of frames in the queue
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (427 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0433/1167] bpf: Keep the symbols of a program until it has ended Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0435/1167] bpf: Let bpf_dynptr_write() mark a global function Greg Kroah-Hartman
` (228 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit f99351272933ba2e1221484a5e53b7a5d2c035f0 ]
A frame that is redirected to another CPU waits in the queue of the cpumap
entry with a plain pointer to the device it came from, and an skb from
generic XDP with skb->dev. Nothing keeps that device. Closing and
unregistering it waits for its NAPI and for RCU, but not for the kthread
of the entry. If the kthread is late by more than that, since its CPU is
busy with something of a higher priority, it builds skbs for a device that
has been freed and hands them to the stack:
BUG: KASAN: use-after-free in dev_gro_receive+0x1f51/0x2b30
Read of size 8 at addr ffff88800a7340b0 by task cpumap/1/map:1/54
Take a reference to the device for each entry of the queue. The kthread
cannot drop it at the end of the batch, since its GRO node may keep the skb
for longer. Let it note the devices and drop the references behind a full
GRO flush, which it does whenever the queue is empty, and from now on also
when it has noted about 2048 of them.
A device whose frames are stuck in a queue is now unregistered only when
the kthread has got to them. RTNL is not held meanwhile, but if the device
goes with its network namespace, the cleanup of all namespaces waits.
Fixes: 1c601d829ab0 ("bpf: cpumap xdp_buff to skb conversion and allocation")
Fixes: 11941f8a8536 ("bpf: cpumap: Implement generic cpumap")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-8-alexei.starovoitov@gmail.com
[ sashal: Shrunk the held-device array from 2048 to 8 entries (tied to the batch size) and release the device references at the end of each batch, since this tree has no GRO flush. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/cpumap.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
index df03e66a687c1..a93f5953283b0 100644
--- a/kernel/bpf/cpumap.c
+++ b/kernel/bpf/cpumap.c
@@ -43,6 +43,7 @@
*/
#define CPU_MAP_BULK_SIZE 8 /* 8 == one cacheline on 64-bit archs */
+#define CPU_MAP_HELD_DEVS 8
struct bpf_cpu_map_entry;
struct bpf_cpu_map;
@@ -70,6 +71,13 @@ struct bpf_cpu_map_entry {
struct completion kthread_running;
struct rcu_work free_work;
+
+ /*
+ * Every frame and skb in the queue holds a reference to its device.
+ * The kthread keeps it until the batch has been handed to the stack.
+ */
+ struct net_device *held[CPU_MAP_HELD_DEVS];
+ u32 nr_held;
};
struct bpf_cpu_map {
@@ -127,9 +135,11 @@ static void __cpu_map_ring_cleanup(struct ptr_ring *ring)
WARN_ON_ONCE(1);
if (unlikely(__ptr_test_bit(0, &ptr))) {
__ptr_clear_bit(0, &ptr);
+ dev_put(((struct sk_buff *)ptr)->dev);
kfree_skb(ptr);
continue;
}
+ dev_put(((struct xdp_frame *)ptr)->dev_rx);
xdp_return_frame(ptr);
}
}
@@ -233,7 +243,7 @@ static int cpu_map_bpf_prog_run_xdp(struct bpf_cpu_map_entry *rcpu,
return nframes;
}
-#define CPUMAP_BATCH 8
+#define CPUMAP_BATCH CPU_MAP_HELD_DEVS
static int cpu_map_bpf_prog_run(struct bpf_cpu_map_entry *rcpu, void **frames,
int xdp_n, struct xdp_cpumap_stats *stats,
@@ -312,10 +322,12 @@ static int cpu_map_kthread_run(void *data)
struct sk_buff *skb = f;
__ptr_clear_bit(0, &skb);
+ rcpu->held[rcpu->nr_held++] = skb->dev;
list_add_tail(&skb->list, &list);
continue;
}
+ rcpu->held[rcpu->nr_held++] = ((struct xdp_frame *)f)->dev_rx;
frames[xdp_n++] = f;
page = virt_to_page(f);
@@ -352,6 +364,8 @@ static int cpu_map_kthread_run(void *data)
list_add_tail(&skb->list, &list);
}
netif_receive_skb_list(&list);
+ while (rcpu->nr_held)
+ dev_put(rcpu->held[--rcpu->nr_held]);
/* Feedback loop via tracepoint */
trace_xdp_cpumap_kthread(rcpu->map_id, n, kmem_alloc_drops,
@@ -681,12 +695,14 @@ static void bq_flush_to_queue(struct xdp_bulk_queue *bq)
for (i = 0; i < bq->count; i++) {
struct xdp_frame *xdpf = bq->q[i];
- int err;
- err = __ptr_ring_produce(q, xdpf);
- if (err) {
+ if (__ptr_ring_full(q)) {
drops++;
xdp_return_frame_rx_napi(xdpf);
+ } else {
+ /* The device cannot go before the flush, from now on it can */
+ dev_hold(xdpf->dev_rx);
+ __ptr_ring_produce(q, xdpf);
}
processed++;
}
@@ -742,11 +758,15 @@ int cpu_map_generic_redirect(struct bpf_cpu_map_entry *rcpu,
__skb_pull(skb, skb->mac_len);
skb_set_redirected(skb, false);
+ dev_hold(skb->dev);
__ptr_set_bit(0, &skb);
ret = ptr_ring_produce(rcpu->queue, skb);
- if (ret < 0)
+ if (ret < 0) {
+ __ptr_clear_bit(0, &skb);
+ dev_put(skb->dev);
goto trace;
+ }
wake_up_process(rcpu->kthread);
trace:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0435/1167] bpf: Let bpf_dynptr_write() mark a global function
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (428 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0434/1167] bpf, cpumap: Hold the device of frames in the queue Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0436/1167] bpf: Follow the head if an skb is written from a slice Greg Kroah-Hartman
` (227 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 589998616e0f9190ba6f6644a19532c5b2ba66d0 ]
The caller of a global function loses its packet pointers if the function
may change packet data. That is found out by a scan for calls of the
helpers which bpf_helper_changes_pkt_data() lists.
bpf_dynptr_write() is not on the list, because it depends on the type of
the dynptr: check_helper_call() looks at it. The scan cannot do that, and
so a global function which makes a dynptr from the skb, or gets one as an
argument, and writes through it counts as harmless. The write can
reallocate the head of the skb, and the caller goes on with pointers into
the old one, which has been freed.
Let every call of bpf_dynptr_write() mark the function, as a tail call
does. The same mark decides whether a program may replace a function.
Fixes: 51081a3f25c7 ("bpf: track changes_pkt_data property for global functions")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-10-alexei.starovoitov@gmail.com
[ sashal: Moved the change from cfg.c to the matching visit_insn() call in verifier.c, folding the BPF_FUNC_dynptr_write check into the existing single-line bpf_helper_call() condition. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 39f3e2aea0d9e..e39b28012a44f 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -15668,7 +15668,10 @@ static int visit_insn(int t, struct bpf_verifier_env *env)
mark_prune_point(env, t);
mark_jmp_point(env, t);
}
- if (bpf_helper_call(insn) && bpf_helper_changes_pkt_data(insn->imm))
+ /* nobody knows yet whether the dynptr is that of an skb */
+ if (bpf_helper_call(insn) &&
+ (bpf_helper_changes_pkt_data(insn->imm) ||
+ insn->imm == BPF_FUNC_dynptr_write))
mark_subprog_changes_pkt_data(env, t);
if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
struct bpf_kfunc_call_arg_meta meta;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0436/1167] bpf: Follow the head if an skb is written from a slice
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (429 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0435/1167] bpf: Let bpf_dynptr_write() mark a global function Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0437/1167] bpf: Zero-extend the index in inlined bpf_get_func_arg() Greg Kroah-Hartman
` (226 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 1c19f2b3b2f3b55c8017092257634cb8229b7d97 ]
The source of bpf_dynptr_write() may be a slice of the skb which is
written to, that is a pointer into its head. bpf_dynptr_copy() does it by
itself for a copy inside of one skb, if the source is linear and the
destination is not.
__bpf_skb_store_bytes() and __bpf_skb_meta_store_bytes() make the skb
writable first. If that reallocates the head, the source points to the old
one, and freed memory is copied into the packet.
The offsets in the head do not change when it is reallocated here. Move
the source along with the head.
Fixes: 2012c867c800 ("bpf: verifier: Accept dynptr mem as mem in helpers")
Fixes: f38499ff45f5 ("bpf: Unclone skb head on bpf_dynptr_write to skb metadata")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-14-alexei.starovoitov@gmail.com
[ sashal: dropped the __bpf_skb_meta_store_bytes() hunk since that function doesn't exist here, so only the bpf_skb_store_bytes() call site is changed to use the new helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 356bf50afabea..93c87a0d0d7eb 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1708,6 +1708,24 @@ static inline void bpf_pull_mac_rcsum(struct sk_buff *skb)
skb_postpull_rcsum(skb, skb_mac_header(skb), skb->mac_len);
}
+/*
+ * The source of a write through a dynptr may be a slice of the same skb.
+ * Making the skb writable can move its head: follow the move.
+ */
+static int bpf_try_make_writable_from(struct sk_buff *skb, u32 write_len,
+ const void **from)
+{
+ const void *head = skb->head;
+ bool in_head = *from >= head &&
+ *from < (const void *)skb_end_pointer(skb);
+ int err;
+
+ err = bpf_try_make_writable(skb, write_len);
+ if (!err && in_head)
+ *from = skb->head + (*from - head);
+ return err;
+}
+
BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset,
const void *, from, u32, len, u64, flags)
{
@@ -1717,7 +1735,7 @@ BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset,
return -EINVAL;
if (unlikely(offset > INT_MAX))
return -EFAULT;
- if (unlikely(bpf_try_make_writable(skb, offset + len)))
+ if (unlikely(bpf_try_make_writable_from(skb, offset + len, &from)))
return -EFAULT;
ptr = skb->data + offset;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0437/1167] bpf: Zero-extend the index in inlined bpf_get_func_arg()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (430 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0436/1167] bpf: Follow the head if an skb is written from a slice Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0438/1167] gpiolib: clear the event clock flags when a line is released Greg Kroah-Hartman
` (225 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Woojin Ji, Alexei Starovoitov,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Woojin Ji <random6.xyz@gmail.com>
[ Upstream commit 1c1dda9ba9f3af9cd511a197dcc86de2465d8fe5 ]
bpf_get_func_arg() takes a u32 index, but the inlined expansion compared
only the low 32 bits of R2 with the argument count and then shifted the
full 64-bit register to compute the context address. R2 is ARG_ANYTHING,
so nothing guarantees that its upper bits are zero: an index of
1ULL << 32 passes the bounds check as index zero while the load is
performed at ctx + (1ULL << 35).
Shift the index as a 32-bit value. When the 32-bit bounds check passes,
the low 32 bits of R2 are below R0, and R0 is at most 255: the trampoline
arm masks the argument count with 0xFF and the raw_tp arm uses the BTF
argument count minus one, which the verifier caps at MAX_BPF_FUNC_ARGS.
The 3-bit shift therefore cannot overflow and it clears the upper bits of
the register. Widening the comparison instead would reject indices whose
low 32 bits are valid. The check itself is unchanged, so this cannot
change which programs are accepted, only the address that is computed.
Fixes: f92c1e183604 ("bpf: Add get_func_[arg|ret|arg_cnt] helpers")
Signed-off-by: Woojin Ji <random6.xyz@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261018-get-func-arg-v2-1-048848b3eddf@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index e39b28012a44f..8db60a01b5415 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -19802,7 +19802,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
/* Load nr_args from ctx - 8 */
insn_buf[0] = BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, -8);
insn_buf[1] = BPF_JMP32_REG(BPF_JGE, BPF_REG_2, BPF_REG_0, 6);
- insn_buf[2] = BPF_ALU64_IMM(BPF_LSH, BPF_REG_2, 3);
+ insn_buf[2] = BPF_ALU32_IMM(BPF_LSH, BPF_REG_2, 3);
insn_buf[3] = BPF_ALU64_REG(BPF_ADD, BPF_REG_2, BPF_REG_1);
insn_buf[4] = BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_2, 0);
insn_buf[5] = BPF_STX_MEM(BPF_DW, BPF_REG_3, BPF_REG_0, 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0438/1167] gpiolib: clear the event clock flags when a line is released
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (431 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0437/1167] bpf: Zero-extend the index in inlined bpf_get_func_arg() Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0439/1167] netfilter: flowtable: reset transport header after nf_flow_encap_pop() Greg Kroah-Hartman
` (224 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adrian Ambrozewicz,
Bartosz Golaszewski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
[ Upstream commit d35f61581ee67f8d4d58c325bac813cea528b6b9 ]
gpiod_free_commit() clears the flags that a request sets on a line, but
not GPIOD_FLAG_EVENT_CLOCK_REALTIME and GPIOD_FLAG_EVENT_CLOCK_HTE,
which gpio_v2_line_config_flags_to_desc_flags() sets from the uAPI v2
line config. Once a line requested with
GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME or
GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE is released, GPIO_V2_GET_LINEINFO_IOCTL
and the line info changed events, the "released" one included, keep
reporting that event clock for the free line:
GPIO_V2_GET_LINE_IOCTL, line 1, input, event clock realtime: ok
close()
GPIO_V2_GET_LINEINFO_IOCTL, line 1: input, event clock realtime
The flags are set before edge detection is set up, so a request that
fails in hte_ts_get(), for instance because no HTE provider handles the
line, leaves GPIOD_FLAG_EVENT_CLOCK_HTE behind as well. The next uAPI v2
request rewrites both flags, but requests through uAPI v1, sysfs exports
and in-kernel consumers do not, and the line info then shows the event
clock of an earlier user for them too.
Clear both flags together with the other flags of the request.
Reproduced under QEMU with a test GPIO chip: after a released request
with the realtime event clock, and on a kernel with CONFIG_HTE=y but no
HTE provider after a failed request with the HTE event clock, the line
info of the free line still reports that event clock. With this change
it reports none.
Fixes: 26d060e47e25 ("gpiolib: cdev: allow edge event timestamps to be configured as REALTIME")
Fixes: 2068339a6c35 ("gpiolib: cdev: Add hardware timestamp clock type")
Signed-off-by: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
Link: https://patch.msgid.link/20261012-gpiolib-event-clock-v1-1-aambrozewicz@nvidia.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ sashal: Renamed the GPIOD_FLAG_* flags to FLAG_* and changed the &flags clears to &desc->flags, to match this tree's older gpiod_free_commit(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 9b8a200423858..3a3025287dc13 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2227,6 +2227,8 @@ static bool gpiod_free_commit(struct gpio_desc *desc)
clear_bit(FLAG_BIAS_DISABLE, &desc->flags);
clear_bit(FLAG_EDGE_RISING, &desc->flags);
clear_bit(FLAG_EDGE_FALLING, &desc->flags);
+ clear_bit(FLAG_EVENT_CLOCK_REALTIME, &desc->flags);
+ clear_bit(FLAG_EVENT_CLOCK_HTE, &desc->flags);
clear_bit(FLAG_IS_HOGGED, &desc->flags);
#ifdef CONFIG_OF_DYNAMIC
desc->hog = NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0439/1167] netfilter: flowtable: reset transport header after nf_flow_encap_pop()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (432 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0438/1167] gpiolib: clear the event clock flags when a line is released Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0440/1167] ALSA: jack: Pin the module while debugfs files are open Greg Kroah-Hartman
` (223 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Pablo Neira Ayuso,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
[ Upstream commit 08f7882637f2db5b98f521498eeaf94770383a6e ]
nf_flow_encap_pop() pulls vlan/pppoe or ip tunnel headers and resets the
network header, but leaves the transport header pointing into the removed
outer header. Reset the transport header to the inner L4 header, otherwise
later consumers (e.g. GSO segmentation) parse a bogus header.
Fixes: 4cd91f7c290f ("netfilter: flowtable: add vlan support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[ sashal: Kept this branch's two-argument nf_flow_encap_pop(skb, tuplehash) call in the IPv6 hunk context, since the ctx argument and IP tunnel support don't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nf_flow_table_ip.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
index 9ca4c96b30d0e..dee36aaf5b399 100644
--- a/net/netfilter/nf_flow_table_ip.c
+++ b/net/netfilter/nf_flow_table_ip.c
@@ -418,6 +418,7 @@ static int nf_flow_offload_forward(struct nf_flowtable_ctx *ctx,
nf_flow_encap_pop(skb, tuplehash);
thoff -= ctx->offset;
+ skb_set_transport_header(skb, thoff);
iph = ip_hdr(skb);
nf_flow_nat_ip(flow, skb, thoff, dir, iph);
@@ -700,6 +701,7 @@ static int nf_flow_offload_ipv6_forward(struct nf_flowtable_ctx *ctx,
flow_offload_refresh(flow_table, flow, false);
nf_flow_encap_pop(skb, tuplehash);
+ skb_set_transport_header(skb, sizeof(*ip6h));
ip6h = ipv6_hdr(skb);
nf_flow_nat_ipv6(flow, skb, dir, ip6h);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0440/1167] ALSA: jack: Pin the module while debugfs files are open
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (433 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0439/1167] netfilter: flowtable: reset transport header after nf_flow_encap_pop() Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0441/1167] ALSA: aloop: Keep shared timer callbacks alive through close Greg Kroah-Hartman
` (222 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cen Zhang, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit 8b479b265301e97bfbec0ef25de1c1f7eb4d2f74 ]
With CONFIG_SND=m and CONFIG_SND_JACK_INJECTION_DEBUG enabled, an in-tree
HDA jack creates these debugfs files through snd_jack_new() and
snd_jack_add_debugfs(). Their file_operations live in snd, but none sets
.owner. full_proxy_open_regular() therefore takes no snd module reference
when it calls fops_get(real_fops).
A debugfs descriptor can outlive removal of its HDA card. Once the card
and dependent modules, including the OSS emulation modules, have been
removed, snd can be unloaded while that descriptor is still open:
Descriptor holder Card/module teardown
----------------- --------------------
open jack debugfs file
full_proxy_open_regular()
fops_get(real_fops)
owner == NULL: no snd pin
keep descriptor open
remove HDA card
snd_card_disconnect()
snd_jack_dev_disconnect()
remove debugfs nodes
snd_jack_dev_free()
unload dependent modules
rmmod snd
alsa_sound_exit()
free_module(): unmap snd
close descriptor
full_proxy_release()
read real_fops->release
fops_put(real_fops)
read real_fops->owner
debugfs_remove() drains active operations, but does not wait for idle
open descriptors. Release deliberately bypasses removal protection and
reads the real table even when no release callback is installed. The
last close can therefore access unloaded snd storage.
Set .owner to THIS_MODULE in all six tables. The existing proxy
fops_get()/fops_put() pair then keeps snd loaded through the final table
access on close.
Fixes: 2d670ea2bd53 ("ALSA: jack: implement software jack injection via debugfs")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Link: https://patch.msgid.link/pm-pmb-431ddb947e1a13b95d3a-v3-02d37dd7b4eb4774e100@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Context lines use this branch's .open = simple_open, style instead of upstream's tab-aligned members, and the added .owner = THIS_MODULE, lines match it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/jack.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sound/core/jack.c b/sound/core/jack.c
index d5b4330747f22..5147ab8cf9263 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -307,6 +307,7 @@ static ssize_t jack_type_read(struct file *file,
}
static const struct file_operations jack_type_fops = {
+ .owner = THIS_MODULE,
.open = simple_open,
.read = jack_type_read,
.llseek = default_llseek,
@@ -314,6 +315,7 @@ static const struct file_operations jack_type_fops = {
#endif
static const struct file_operations sw_inject_enable_fops = {
+ .owner = THIS_MODULE,
.open = simple_open,
.read = sw_inject_enable_read,
.write = sw_inject_enable_write,
@@ -321,24 +323,28 @@ static const struct file_operations sw_inject_enable_fops = {
};
static const struct file_operations jackin_inject_fops = {
+ .owner = THIS_MODULE,
.open = simple_open,
.write = jackin_inject_write,
.llseek = default_llseek,
};
static const struct file_operations jack_kctl_id_fops = {
+ .owner = THIS_MODULE,
.open = simple_open,
.read = jack_kctl_id_read,
.llseek = default_llseek,
};
static const struct file_operations jack_kctl_mask_bits_fops = {
+ .owner = THIS_MODULE,
.open = simple_open,
.read = jack_kctl_mask_bits_read,
.llseek = default_llseek,
};
static const struct file_operations jack_kctl_status_fops = {
+ .owner = THIS_MODULE,
.open = simple_open,
.read = jack_kctl_status_read,
.llseek = default_llseek,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0441/1167] ALSA: aloop: Keep shared timer callbacks alive through close
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (434 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0440/1167] ALSA: jack: Pin the module while debugfs files are open Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0442/1167] RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler Greg Kroah-Hartman
` (221 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cen Zhang, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit a7d4d780f34b9e43eefab6a7e6c9f4101f2c144e ]
The shared sound-timer callback must finish using the selected PCM
runtimes before a close can detach them. loopback_snd_timer_period_elapsed()
saves the active substreams under cable->lock, then drops the lock before
calling snd_pcm_period_elapsed() or snd_pcm_stop_xrun(). The sound-timer
backend has no per-stream close drain, and free_cable() keeps the timer
open when the paired endpoint remains attached.
With both directions running on a shared sound timer, playback can be
dropped and closed while a notification is pending. Capture keeps the
timer alive, allowing this order:
Timer callback Playback owner
-------------- --------------
select playback under cable->lock
unlock; delay notification
DROP; HW_FREE -> OPEN
close: snd_pcm_drop(); unlock
free_cable(); peer stays alive
snd_pcm_period_elapsed()
lock stream; cache runtime
snd_pcm_detach_substream()
free runtime and its fasync
read runtime->fasync
The stream lock taken by snd_pcm_drop() cannot protect a notification
that starts after it returns, and detach does not take it. The callback
can therefore read runtime->fasync after the runtime has been freed, and
an escaped notification can also reach a replacement runtime if the same
substream slot is reopened before the notification resumes.
Take the existing cable->stop_count reference under cable->lock when
selecting the targets and release it after the PCM callbacks finish,
including the XRUN path. free_cable() already removes the closing
endpoint under that lock and waits for stop_count before returning, so
runtime detach and slot reuse cannot overtake the notification.
Fixes: 26c53379f98d ("ALSA: aloop: Support selection of snd_timer instead of jiffies")
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Assisted-by: LLM
Link: https://patch.msgid.link/pm-pmb-275c4399f517e09d7188-v2-2f64c1328529ef7a8fec@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Replaced the snd_refcount get/put/sync calls with atomic_inc, atomic_dec_and_test plus wake_up, and the existing wait_event on stop_count, and adjusted the context for the non-scoped_guard locking. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/drivers/aloop.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index 0602b81275262..e66aef765c04c 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -98,7 +98,7 @@ struct loopback_ops {
struct loopback_cable {
spinlock_t lock;
struct loopback_pcm *streams[2];
- /* in-flight peer stops running outside cable->lock */
+ /* in-flight PCM callbacks running outside cable->lock */
atomic_t stop_count;
wait_queue_head_t stop_wait;
struct snd_pcm_hardware hw;
@@ -766,6 +766,8 @@ static void loopback_snd_timer_period_elapsed(struct loopback_cable *cable,
valid_runtime = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ?
dpcm_play->substream->runtime :
dpcm_capt->substream->runtime;
+ /* Keep runtimes alive through the PCM callbacks. */
+ atomic_inc(&cable->stop_count);
/* resolution is only valid for SNDRV_TIMER_EVENT_TICK events */
if (event == SNDRV_TIMER_EVENT_TICK) {
@@ -780,7 +782,7 @@ static void loopback_snd_timer_period_elapsed(struct loopback_cable *cable,
snd_pcm_stop_xrun(substream_play);
if (substream_capt)
snd_pcm_stop_xrun(substream_capt);
- return;
+ goto exit;
}
}
@@ -804,6 +806,10 @@ static void loopback_snd_timer_period_elapsed(struct loopback_cable *cable,
snd_pcm_period_elapsed(substream_play);
if (substream_capt)
snd_pcm_period_elapsed(substream_capt);
+
+exit:
+ if (atomic_dec_and_test(&cable->stop_count))
+ wake_up(&cable->stop_wait);
}
static void loopback_snd_timer_function(struct snd_timer_instance *timeri,
@@ -1048,7 +1054,7 @@ static void free_cable(struct snd_pcm_substream *substream)
other_alive = cable->streams[!substream->stream];
}
- /* Pair with the stop_count increment in loopback_check_format(). */
+ /* Wait for PCM callbacks running outside cable->lock. */
wait_event(cable->stop_wait, !atomic_read(&cable->stop_count));
if (other_alive)
return;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0442/1167] RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (435 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0441/1167] ALSA: aloop: Keep shared timer callbacks alive through close Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0443/1167] net: phy: qca83xx: read resolved QCA8337 link status Greg Kroah-Hartman
` (220 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Serhat Kumral, Leon Romanovsky,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Serhat Kumral <serhatkumral1@gmail.com>
[ Upstream commit bb75e5580b15cd23ededf15683a5ad67d7b61aab ]
In MLX5_IB_METHOD_STEERING_ANCHOR_CREATE, the user-supplied u16 priority
is passed directly to _get_flow_table() without an upper bound check.
This can lead to out-of-bounds array accesses on dev->flow_db priority
tables.
Check that priority does not exceed MLX5_IB_FLOW_LAST_PRIO before calling
_get_flow_table(), matching the existing validation in raw_fs_rule_add()
and mlx5_ib_create_flow().
Fixes: 0c6ab0ca9a66 ("RDMA/mlx5: Expose steering anchor to userspace")
Signed-off-by: Serhat Kumral <serhatkumral1@gmail.com>
Link: https://patch.msgid.link/20261018144907.20123-1-serhatkumral1@gmail.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Context line adapted: the backport keeps the older kzalloc(sizeof(*obj), GFP_KERNEL) call instead of upstream's kzalloc_obj(*obj), with the same priority bounds check inserted before it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/fs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c
index 186085cfb4e9b..369cea6b31857 100644
--- a/drivers/infiniband/hw/mlx5/fs.c
+++ b/drivers/infiniband/hw/mlx5/fs.c
@@ -2427,6 +2427,9 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_STEERING_ANCHOR_CREATE)(
if (err)
return err;
+ if (priority > MLX5_IB_FLOW_LAST_PRIO)
+ return -EINVAL;
+
obj = kzalloc(sizeof(*obj), GFP_KERNEL);
if (!obj)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0443/1167] net: phy: qca83xx: read resolved QCA8337 link status
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (436 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0442/1167] RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0444/1167] xsk: freeze deferred pool teardown without blocking unregister Greg Kroah-Hartman
` (219 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrew Lunn, Yongzhao Chen,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yongzhao Chen <yongzhao.derek@gmail.com>
[ Upstream commit 42a91cbfc7a3ab99d05cb2ed0de5a24b9652cfed ]
After a QCA8337 SmartSpeed downshift, genphy_read_status() can report
1000 Mbit/s from the advertised modes when the PHY is running at
100 Mbit/s. On a Redmi AX5400 running downstream OpenWrt Linux 6.18.52,
this caused qca8k to program the user-port MAC for 1000 Mbit/s and
traffic failed. An earlier prototype that read the resolved speed
from the PHY restored traffic.
Wrap genphy_read_status() and use at803x_read_specific_status() to
replace its speed and duplex result when an autonegotiated link comes
up. Resolve pause for the resulting duplex. Until the PHY reports a
resolved speed and duplex, report the link as down so that the next
poll reads them again, as marvell_read_status_page_an() does. In that
case also clear the duplex, master/slave state and link partner modes
that genphy_read_status() read for an up link. QCA8337's register
layout matches the helper (data sheet 80-Y0619-3 Rev. D, pages
327-328).
Keep the generic master/slave read order and the early return for a
steady autonegotiated link. This avoids additional reads of the
clear-on-read idle error count in MII_STAT1000. Forced mode continues
to use BMCR. Report the MDI-X state read at link-up and invalidate it
when the link goes down or autonegotiation is disabled. Clear
mdix_ctrl because this driver does not implement MDI-X configuration.
The QCA8327 entries keep genphy_read_status(). The AR8327 data sheet
(MKG-15791 Rev. 1.0) lists the QCA8327-A PHY ID and documents the same
PHY-specific status layout, with SmartSpeed enabled after a hardware
reset, so those PHYs may have the same problem. That is untested on
QCA8327 hardware, so limit this change to QCA8337.
Fixes: b3591c2a3661 ("net: dsa: qca8k: Switch to PHYLINK instead of PHYLIB")
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Yongzhao Chen <yongzhao.derek@gmail.com>
Assisted-by: LLM
Link: https://patch.msgid.link/20261013190339.51909-1-yongzhao.derek@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Added qca8337_read_status() to at803x.c instead of qca83xx.c, and called at803x_read_specific_status() without the mask argument since this tree's helper takes none. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/phy/qcom/at803x.c | 54 +++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/drivers/net/phy/qcom/at803x.c b/drivers/net/phy/qcom/at803x.c
index 0b01b6ff0a4b5..665adcb427d00 100644
--- a/drivers/net/phy/qcom/at803x.c
+++ b/drivers/net/phy/qcom/at803x.c
@@ -1591,6 +1591,59 @@ static int at803x_cable_test_start(struct phy_device *phydev)
return 0;
}
+static int qca8337_read_status(struct phy_device *phydev)
+{
+ int ret, old_link = phydev->link;
+
+ ret = genphy_read_status(phydev);
+ if (ret)
+ return ret;
+
+ /* Keep the state resolved at link-up while the link stays up */
+ if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link)
+ goto out;
+
+ phydev->mdix = ETH_TP_MDI_INVALID;
+
+ /* genphy_read_status() derives speed and duplex from the
+ * advertisements, which is wrong after a SmartSpeed downshift.
+ * Use what the PHY resolved instead.
+ */
+ if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete &&
+ phydev->link) {
+ phydev->speed = SPEED_UNKNOWN;
+ phydev->duplex = DUPLEX_UNKNOWN;
+ phydev->pause = false;
+ phydev->asym_pause = false;
+
+ ret = at803x_read_specific_status(phydev);
+ if (ret)
+ return ret;
+
+ /* Report the link down until speed and duplex are resolved,
+ * so that the next poll reads them again. Also clear what
+ * genphy_read_status() read for an up link, as the
+ * PHY_HALTED path of the state machine does.
+ */
+ if (phydev->speed == SPEED_UNKNOWN ||
+ phydev->duplex == DUPLEX_UNKNOWN) {
+ phydev->link = 0;
+ phydev->duplex = DUPLEX_UNKNOWN;
+ phydev->mdix = ETH_TP_MDI_INVALID;
+ phydev->master_slave_state = MASTER_SLAVE_STATE_UNKNOWN;
+ linkmode_zero(phydev->lp_advertising);
+ } else {
+ phy_resolve_aneg_pause(phydev);
+ }
+ }
+
+out:
+ /* MDI-X configuration is not implemented */
+ phydev->mdix_ctrl = ETH_TP_MDI_INVALID;
+
+ return 0;
+}
+
static int qca83xx_config_init(struct phy_device *phydev)
{
u8 switch_revision;
@@ -2168,6 +2221,7 @@ static struct phy_driver at803x_driver[] = {
.flags = PHY_IS_INTERNAL,
.config_init = qca83xx_config_init,
.soft_reset = genphy_soft_reset,
+ .read_status = qca8337_read_status,
.get_sset_count = at803x_get_sset_count,
.get_strings = at803x_get_strings,
.get_stats = at803x_get_stats,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0444/1167] xsk: freeze deferred pool teardown without blocking unregister
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (437 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0443/1167] net: phy: qca83xx: read resolved QCA8337 link status Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0445/1167] net: bcmasp: fix network filter lookup and wake filter pair allocation Greg Kroah-Hartman
` (218 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Hilliard,
Björn Töpel, Jason Xing, Stanislav Fomichev,
Paolo Abeni, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hilliard <james.hilliard1@gmail.com>
[ Upstream commit fece8420e76fe53ee84f0439f18d026b4c7641da ]
Deferred pool destruction calls ndo_bpf() under RTNL. system_wq is
not frozen during system sleep, so that callback can run after a
device has suspended and gated its clocks. Use system_freezable_wq
so running destruction finishes before device suspend and new work
waits until process thaw.
Keep assigned pools visible to NETDEV_UNREGISTER independently of
the socket list. A released socket has already left that list, but
its final pool put can queue destruction after workqueues freeze.
A resume-time unregister would then wait for a device reference
whose release cannot run until the resume completes.
Track assigned pools per netdev with netdev operations locking and detach
remaining pools after the notifier socket walk, including copy-mode pools.
This also covers leased queues without scanning pools from unrelated
devices or network namespaces. Remove the entry on assignment failure and
normal teardown. The deferred worker still owns the pool and later observes
the cleared device pointer, avoiding a second driver detach or put.
The lifetime problem was identified by code inspection of the deferred
release and system-sleep paths.
Fixes: 1c1efc2af158 ("xsk: Create and free buffer pool independently from umem")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20261014-xsk-suspend-teardown-v4-1-27795582e4a3@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Replaced netdev ops locking calls with RTNL equivalents (ASSERT_RTNL() in the helpers, no lock/unlock pair), since this tree lacks netdev_lock_ops() and relies on RTNL. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/netdevice.h | 5 +++++
include/net/xsk_buff_pool.h | 3 +++
net/xdp/xsk.c | 5 +++++
net/xdp/xsk_buff_pool.c | 44 ++++++++++++++++++++++++++++++++-----
4 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 61f1a64b72293..87f4e1f6e435a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2431,6 +2431,11 @@ struct net_device {
/* protected by rtnl_lock */
struct bpf_xdp_entity xdp_state[__MAX_XDP_MODE];
+#ifdef CONFIG_XDP_SOCKETS
+ /** @xsk_pools: assigned AF_XDP pools, ops protected */
+ struct hlist_head xsk_pools;
+#endif
+
u8 dev_addr_shadow[MAX_ADDR_LEN];
netdevice_tracker linkwatch_dev_tracker;
netdevice_tracker watchdog_dev_tracker;
diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h
index d3a109a79a1d6..67801913fdb27 100644
--- a/include/net/xsk_buff_pool.h
+++ b/include/net/xsk_buff_pool.h
@@ -47,6 +47,8 @@ struct xsk_buff_pool {
struct device *dev;
struct net_device *netdev;
struct list_head xsk_tx_list;
+ /* Assigned pools, including deferred releases; ops protected. */
+ struct hlist_node dev_node;
/* Protects modifications to the xsk_tx_list */
spinlock_t xsk_tx_list_lock;
refcount_t users;
@@ -111,6 +113,7 @@ bool xp_put_pool(struct xsk_buff_pool *pool);
void xp_clear_dev(struct xsk_buff_pool *pool);
void xp_add_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs);
void xp_del_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs);
+void xp_clear_dev_all(struct net_device *dev);
/* AF_XDP, and XDP core. */
void xp_free(struct xdp_buff_xsk *xskb);
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 95944ad2eaae6..6fa2320f751c7 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -1618,6 +1618,11 @@ static int xsk_notifier(struct notifier_block *this,
mutex_unlock(&xs->mutex);
}
mutex_unlock(&net->xdp.lock);
+ /*
+ * A released socket is no longer on xdp.list. Its pool can still
+ * hold a device reference on the frozen release workqueue.
+ */
+ xp_clear_dev_all(dev);
break;
}
return NOTIFY_DONE;
diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c
index e4261004c2c9d..1395dc3f4640d 100644
--- a/net/xdp/xsk_buff_pool.c
+++ b/net/xdp/xsk_buff_pool.c
@@ -189,6 +189,11 @@ int xp_assign_dev(struct xsk_buff_pool *pool,
pool->cached_need_wakeup = XDP_WAKEUP_TX;
dev_hold(netdev);
+ /*
+ * Socket removal precedes the final pool put. Keep the pool visible to
+ * NETDEV_UNREGISTER even while release work is waiting for process thaw.
+ */
+ hlist_add_head(&pool->dev_node, &netdev->xsk_pools);
if (force_copy)
/* For copy-mode, we are done. */
@@ -244,6 +249,8 @@ int xp_assign_dev(struct xsk_buff_pool *pool,
if (err) {
pool->umem->flags = umem_flags;
xsk_clear_pool_at_qid(netdev, queue_id);
+ hlist_del(&pool->dev_node);
+ pool->netdev = NULL;
dev_put(netdev);
}
return err;
@@ -270,15 +277,36 @@ int xp_assign_dev_shared(struct xsk_buff_pool *pool, struct xdp_sock *umem_xs,
return xp_assign_dev(pool, dev, queue_id, flags);
}
-void xp_clear_dev(struct xsk_buff_pool *pool)
+static void __xp_clear_dev(struct xsk_buff_pool *pool)
{
- if (!pool->netdev)
- return;
+ struct net_device *netdev = pool->netdev;
+ ASSERT_RTNL();
xp_disable_drv_zc(pool);
- xsk_clear_pool_at_qid(pool->netdev, pool->queue_id);
- dev_put(pool->netdev);
+ xsk_clear_pool_at_qid(netdev, pool->queue_id);
+ hlist_del(&pool->dev_node);
pool->netdev = NULL;
+ dev_put(netdev);
+}
+
+void xp_clear_dev(struct xsk_buff_pool *pool)
+{
+ struct net_device *netdev = pool->netdev;
+
+ if (!netdev)
+ return;
+
+ __xp_clear_dev(pool);
+}
+
+void xp_clear_dev_all(struct net_device *dev)
+{
+ struct xsk_buff_pool *pool;
+ struct hlist_node *next;
+
+ ASSERT_RTNL();
+ hlist_for_each_entry_safe(pool, next, &dev->xsk_pools, dev_node)
+ __xp_clear_dev(pool);
}
static void xp_release_deferred(struct work_struct *work)
@@ -316,7 +344,11 @@ bool xp_put_pool(struct xsk_buff_pool *pool)
if (refcount_dec_and_test(&pool->users)) {
INIT_WORK(&pool->work, xp_release_deferred);
- schedule_work(&pool->work);
+ /*
+ * Teardown calls ndo_bpf(), which may need powered hardware.
+ * RTNL alone does not exclude the device's system PM callbacks.
+ */
+ queue_work(system_freezable_wq, &pool->work);
return true;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0445/1167] net: bcmasp: fix network filter lookup and wake filter pair allocation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (438 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0444/1167] xsk: freeze deferred pool teardown without blocking unregister Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0446/1167] net: phy: marvell: keep WOL_EIE across interrupt reconfiguration Greg Kroah-Hartman
` (217 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <florian.fainelli@broadcom.com>
[ Upstream commit fa1459375794f14fb65039cd19c9398d759b491e ]
In bcmasp_netfilt_get_init(), when looking up an existing filter (!init)
for a specified location, if the filter at loc was not claimed, the
previous loop continued searching higher indices and could return an
arbitrary unrelated filter belonging to the port. This caused flow get or
delete operations on an empty rule location to return or delete an
unintended filter.
Fix this by checking only the requested location on lookup and rejecting
RX_CLS_LOC_ANY when !init. In addition, harden wake filter allocation
and release by ensuring wake filter pair searches stay on even boundaries
where both entries are free, checking that loc + 1 is free for positioned
wake filters, and validating parity and bounds on release.
Fixes: c5d511c49587 ("net: bcmasp: Add support for wake on net filters")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20261013204439.3494046-7-florian.fainelli@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 119 +++++++++++---------
1 file changed, 68 insertions(+), 51 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
index a419e71608872..d18e46b9d32d3 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
@@ -494,6 +494,13 @@ static int bcmasp_netfilt_wr_to_hw(struct bcmasp_priv *priv,
return 0;
}
+static bool bcmasp_netfilt_is_companion(struct bcmasp_priv *priv, int i)
+{
+ return i > 0 && (i % 2) &&
+ priv->net_filters[i].wake_filter &&
+ priv->net_filters[i - 1].wake_filter;
+}
+
void bcmasp_netfilt_suspend(struct bcmasp_intf *intf)
{
struct bcmasp_priv *priv = intf->parent;
@@ -507,9 +514,7 @@ void bcmasp_netfilt_suspend(struct bcmasp_intf *intf)
priv->net_filters[i].port != intf->port)
continue;
- if (i > 0 && (i % 2) &&
- priv->net_filters[i].wake_filter &&
- priv->net_filters[i - 1].wake_filter)
+ if (bcmasp_netfilt_is_companion(priv, i))
continue;
ret = bcmasp_netfilt_wr_to_hw(priv, &priv->net_filters[i]);
@@ -539,9 +544,7 @@ int bcmasp_netfilt_get_all_active(struct bcmasp_intf *intf, u32 *rule_locs,
priv->net_filters[i].port != intf->port)
continue;
- if (i > 0 && (i % 2) &&
- priv->net_filters[i].wake_filter &&
- priv->net_filters[i - 1].wake_filter)
+ if (bcmasp_netfilt_is_companion(priv, i))
continue;
if (j == *rule_cnt)
@@ -566,9 +569,7 @@ int bcmasp_netfilt_get_active(struct bcmasp_intf *intf)
continue;
/* Skip over a wake filter pair */
- if (i > 0 && (i % 2) &&
- priv->net_filters[i].wake_filter &&
- priv->net_filters[i - 1].wake_filter)
+ if (bcmasp_netfilt_is_companion(priv, i))
continue;
cnt++;
@@ -590,6 +591,9 @@ bool bcmasp_netfilt_check_dup(struct bcmasp_intf *intf,
priv->net_filters[i].port != intf->port)
continue;
+ if (bcmasp_netfilt_is_companion(priv, i))
+ continue;
+
cur = &priv->net_filters[i].fs;
if (cur->flow_type != fs->flow_type ||
@@ -642,7 +646,7 @@ bool bcmasp_netfilt_check_dup(struct bcmasp_intf *intf,
}
/* If no network filter found, return open filter.
- * If no more open filters return NULL
+ * If no more open filters return error.
*/
struct bcmasp_net_filter *bcmasp_netfilt_get_init(struct bcmasp_intf *intf,
u32 loc, bool wake_filter,
@@ -652,45 +656,55 @@ struct bcmasp_net_filter *bcmasp_netfilt_get_init(struct bcmasp_intf *intf,
struct bcmasp_priv *priv = intf->parent;
int i, open_index = -1;
- /* Check whether we exceed the filter table capacity */
+ if (!init) {
+ if (loc == RX_CLS_LOC_ANY || loc >= NUM_NET_FILTERS)
+ return ERR_PTR(-EINVAL);
+
+ if (priv->net_filters[loc].claimed &&
+ priv->net_filters[loc].port == intf->port &&
+ !bcmasp_netfilt_is_companion(priv, loc))
+ return &priv->net_filters[loc];
+
+ return ERR_PTR(-ENOENT);
+ }
+
if (loc != RX_CLS_LOC_ANY && loc >= NUM_NET_FILTERS)
return ERR_PTR(-EINVAL);
/* If the filter location is busy (already claimed) and we are initializing
* the filter (insertion), return a busy error code.
*/
- if (loc != RX_CLS_LOC_ANY && init && priv->net_filters[loc].claimed)
- return ERR_PTR(-EBUSY);
-
- /* We need two filters for wake-up, so we cannot use an odd filter */
- if (wake_filter && loc != RX_CLS_LOC_ANY && (loc % 2))
- return ERR_PTR(-EINVAL);
-
- /* Initialize the loop index based on the desired location or from 0 */
- i = loc == RX_CLS_LOC_ANY ? 0 : loc;
-
- for ( ; i < NUM_NET_FILTERS; i++) {
- /* Found matching network filter */
- if (!init &&
- priv->net_filters[i].claimed &&
- priv->net_filters[i].hw_index == i &&
- priv->net_filters[i].port == intf->port)
- return &priv->net_filters[i];
-
- /* If we don't need a new filter or new filter already found */
- if (!init || open_index >= 0)
- continue;
-
- /* Wake filter conslidates two filters to cover more bytes
- * Wake filter is open if...
- * 1. It is an even filter
- * 2. The current and next filter is not claimed
- */
- if (wake_filter && !(i % 2) && !priv->net_filters[i].claimed &&
- !priv->net_filters[i + 1].claimed)
- open_index = i;
- else if (!priv->net_filters[i].claimed)
- open_index = i;
+ if (loc != RX_CLS_LOC_ANY) {
+ if (priv->net_filters[loc].claimed)
+ return ERR_PTR(-EBUSY);
+
+ /* We need two filters for wake-up, so we cannot use an odd filter */
+ if (wake_filter) {
+ if ((loc % 2) || loc + 1 >= NUM_NET_FILTERS)
+ return ERR_PTR(-EINVAL);
+ if (priv->net_filters[loc + 1].claimed)
+ return ERR_PTR(-EBUSY);
+ }
+ open_index = loc;
+ } else {
+ for (i = 0; i < NUM_NET_FILTERS; i++) {
+ /* Wake filter consolidates two filters to cover more bytes.
+ * Wake filter is open if:
+ * 1. It is an even filter
+ * 2. The current and next filter is not claimed
+ */
+ if (wake_filter) {
+ if (!(i % 2) && (i + 1 < NUM_NET_FILTERS) &&
+ !priv->net_filters[i].claimed &&
+ !priv->net_filters[i + 1].claimed) {
+ open_index = i;
+ break;
+ }
+ } else if (!priv->net_filters[i].claimed) {
+ open_index = i;
+ break;
+ }
+ }
}
if (open_index >= 0) {
@@ -698,16 +712,18 @@ struct bcmasp_net_filter *bcmasp_netfilt_get_init(struct bcmasp_intf *intf,
nfilter->claimed = true;
nfilter->port = intf->port;
nfilter->hw_index = open_index;
- }
- if (wake_filter && open_index >= 0) {
- /* Claim next filter */
- priv->net_filters[open_index + 1].claimed = true;
- priv->net_filters[open_index + 1].wake_filter = true;
- nfilter->wake_filter = true;
+ if (wake_filter) {
+ /* Claim next filter */
+ priv->net_filters[open_index + 1].claimed = true;
+ priv->net_filters[open_index + 1].wake_filter = true;
+ priv->net_filters[open_index + 1].hw_index = open_index + 1;
+ priv->net_filters[open_index + 1].port = intf->port;
+ nfilter->wake_filter = true;
+ }
}
- return nfilter ? nfilter : ERR_PTR(-EINVAL);
+ return nfilter ? nfilter : ERR_PTR(-ENOSPC);
}
void bcmasp_netfilt_release(struct bcmasp_intf *intf,
@@ -715,7 +731,8 @@ void bcmasp_netfilt_release(struct bcmasp_intf *intf,
{
struct bcmasp_priv *priv = intf->parent;
- if (nfilt->wake_filter) {
+ if (nfilt->wake_filter && !(nfilt->hw_index % 2) &&
+ nfilt->hw_index + 1 < NUM_NET_FILTERS) {
memset(&priv->net_filters[nfilt->hw_index + 1], 0,
sizeof(struct bcmasp_net_filter));
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0446/1167] net: phy: marvell: keep WOL_EIE across interrupt reconfiguration
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (439 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0445/1167] net: bcmasp: fix network filter lookup and wake filter pair allocation Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0447/1167] ip6mr: clear skb->cb[] in reg_vif_xmit() Greg Kroah-Hartman
` (216 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Igor Velkov,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit f434191f93884c9de58c38f18ac7fc7f1fdf9e42 ]
marvell_config_intr() rewrites the whole interrupt enable register, so
the config_intr call from phy_init_hw() on resume silently cleared
WOL_EIE on the 88E1318S and 88E1510: m88e1318_get_wol() still reported
WAKE_MAGIC, but a matched magic packet was no longer routed to INTn and
the board did not wake.
Bit 7 of that register is WOL_EIE only on these two PHYs; on others,
such as the 88E1111, it enables a FIFO error interrupt. So give the
88E1318S and 88E1510 their own config_intr and handle_interrupt, and
leave the shared callbacks unchanged.
m88e1318_set_wol() now records whether WoL is enabled, and both it and
the new config_intr derive WOL_EIE from that state under the MDIO bus
lock. WOL_EIE stays set across config_intr while WoL is enabled, except
when the PHY has an interrupt line and interrupts are being disabled,
as in phy_free_interrupt(): INTn is then the PHY IRQ, and nothing would
read IEVENT after free_irq() to release it. The bit is set again once
interrupts are re-enabled. phy_probe() still clears a WOL_EIE left by a
previous boot, since WoL starts out disabled. The new handler also
claims WoL events, so they do not go unacknowledged when the PHY IRQ is
in use.
Helios4 (Armada 388, 88E1512), 7.2.9. With this patch WOL_EIE stays set
over 3 link down/up cycles, "wol d" clears it, and a magic packet on a
running board is a handled interrupt. Without it, WOL_EIE is lost on the
first down/up, survives "wol d", and the magic packet is an unhandled
interrupt.
Fixes: 3871c3876f80 ("mv643xx_eth with 88E1318S: support Wake on LAN")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Tested-by: Igor Velkov <iav@iav.lv>
Link: https://patch.msgid.link/20261014194818.11640-2-rosenp@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Adjusted the struct marvell_priv hunk context because the vct_phase field is missing; the added wol_enabled line is unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/phy/marvell.c | 97 ++++++++++++++++++++++++++++++---------
1 file changed, 75 insertions(+), 22 deletions(-)
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 760d0d2f791ca..4d25c6114c4ea 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -55,6 +55,8 @@
#define MII_M1011_IMASK 0x12
#define MII_M1011_IMASK_INIT 0x6400
#define MII_M1011_IMASK_CLEAR 0x0000
+/* WOL Event Interrupt Enable, 88E1318S and 88E1510 only */
+#define MII_M1011_IMASK_WOL BIT(7)
#define MII_M1011_PHY_SCR 0x10
#define MII_M1011_PHY_SCR_DOWNSHIFT_EN BIT(11)
@@ -139,11 +141,6 @@
#define MII_88E1318S_PHY_MSCR1_REG 16
#define MII_88E1318S_PHY_MSCR1_PAD_ODD BIT(6)
-/* Copper Specific Interrupt Enable Register */
-#define MII_88E1318S_PHY_CSIER 0x12
-/* WOL Event Interrupt Enable */
-#define MII_88E1318S_PHY_CSIER_WOL_EIE BIT(7)
-
#define MII_88E1318S_PHY_LED_FUNC 0x10
#define MII_88E1318S_PHY_LED_FUNC_OFF (0x8)
#define MII_88E1318S_PHY_LED_FUNC_ON (0x9)
@@ -310,6 +307,7 @@ struct marvell_priv {
u32 last;
u32 step;
s8 pair;
+ bool wol_enabled;
};
static int marvell_read_page(struct phy_device *phydev)
@@ -363,7 +361,8 @@ static int marvell_config_intr(struct phy_device *phydev)
return err;
}
-static irqreturn_t marvell_handle_interrupt(struct phy_device *phydev)
+static irqreturn_t __marvell_handle_interrupt(struct phy_device *phydev,
+ u16 mask)
{
int irq_status;
@@ -373,7 +372,7 @@ static irqreturn_t marvell_handle_interrupt(struct phy_device *phydev)
return IRQ_NONE;
}
- if (!(irq_status & MII_M1011_IMASK_INIT))
+ if (!(irq_status & mask))
return IRQ_NONE;
phy_trigger_machine(phydev);
@@ -381,6 +380,57 @@ static irqreturn_t marvell_handle_interrupt(struct phy_device *phydev)
return IRQ_HANDLED;
}
+static irqreturn_t marvell_handle_interrupt(struct phy_device *phydev)
+{
+ return __marvell_handle_interrupt(phydev, MII_M1011_IMASK_INIT);
+}
+
+/* WOL_EIE also routes WoL events to INTn. Keep it set while WoL is enabled,
+ * unless INTn is the PHY interrupt and that interrupt is being disabled:
+ * nothing would read IEVENT after free_irq() to release the line.
+ */
+static u16 m88e1318_wol_imask(struct phy_device *phydev)
+{
+ struct marvell_priv *priv = phydev->priv;
+
+ if (priv->wol_enabled &&
+ (phydev->interrupts == PHY_INTERRUPT_ENABLED ||
+ !phy_interrupt_is_valid(phydev)))
+ return MII_M1011_IMASK_WOL;
+
+ return 0;
+}
+
+static int m88e1318_config_intr(struct phy_device *phydev)
+{
+ bool enable = phydev->interrupts == PHY_INTERRUPT_ENABLED;
+ u16 imask;
+ int err;
+
+ if (enable) {
+ err = marvell_ack_interrupt(phydev);
+ if (err)
+ return err;
+ }
+
+ /* Serialise against m88e1318_set_wol() updating wol_enabled */
+ phy_lock_mdio_bus(phydev);
+ imask = enable ? MII_M1011_IMASK_INIT : MII_M1011_IMASK_CLEAR;
+ imask |= m88e1318_wol_imask(phydev);
+ err = __phy_write(phydev, MII_M1011_IMASK, imask);
+ phy_unlock_mdio_bus(phydev);
+ if (err || enable)
+ return err;
+
+ return marvell_ack_interrupt(phydev);
+}
+
+static irqreturn_t m88e1318_handle_interrupt(struct phy_device *phydev)
+{
+ return __marvell_handle_interrupt(phydev, MII_M1011_IMASK_INIT |
+ MII_M1011_IMASK_WOL);
+}
+
static int marvell_set_polarity(struct phy_device *phydev, int polarity)
{
u16 val;
@@ -1869,18 +1919,27 @@ static void m88e1318_get_wol(struct phy_device *phydev,
static int m88e1318_set_wol(struct phy_device *phydev,
struct ethtool_wolinfo *wol)
{
+ struct marvell_priv *priv = phydev->priv;
int err = 0, oldpage;
oldpage = phy_save_page(phydev);
if (oldpage < 0)
goto error;
- if (wol->wolopts & (WAKE_MAGIC | WAKE_PHY)) {
- /* Explicitly switch to page 0x00, just to be sure */
- err = marvell_write_page(phydev, MII_MARVELL_COPPER_PAGE);
- if (err < 0)
- goto error;
+ priv->wol_enabled = !!(wol->wolopts & (WAKE_MAGIC | WAKE_PHY));
+ /* Explicitly switch to page 0x00, just to be sure */
+ err = marvell_write_page(phydev, MII_MARVELL_COPPER_PAGE);
+ if (err < 0)
+ goto error;
+
+ /* Update the WOL interrupt enable */
+ err = __phy_modify(phydev, MII_M1011_IMASK, MII_M1011_IMASK_WOL,
+ m88e1318_wol_imask(phydev));
+ if (err < 0)
+ goto error;
+
+ if (priv->wol_enabled) {
/* If WOL event happened once, the LED[2] interrupt pin
* will not be cleared unless we reading the interrupt status
* register. If interrupts are in use, the normal interrupt
@@ -1890,12 +1949,6 @@ static int m88e1318_set_wol(struct phy_device *phydev,
if (!phy_interrupt_is_valid(phydev))
__phy_read(phydev, MII_M1011_IEVENT);
- /* Enable the WOL interrupt */
- err = __phy_set_bits(phydev, MII_88E1318S_PHY_CSIER,
- MII_88E1318S_PHY_CSIER_WOL_EIE);
- if (err < 0)
- goto error;
-
err = marvell_write_page(phydev, MII_MARVELL_LED_PAGE);
if (err < 0)
goto error;
@@ -3434,8 +3487,8 @@ static struct phy_driver marvell_drivers[] = {
.config_init = m88e1318_config_init,
.config_aneg = m88e1318_config_aneg,
.read_status = marvell_read_status,
- .config_intr = marvell_config_intr,
- .handle_interrupt = marvell_handle_interrupt,
+ .config_intr = m88e1318_config_intr,
+ .handle_interrupt = m88e1318_handle_interrupt,
.get_wol = m88e1318_get_wol,
.set_wol = m88e1318_set_wol,
.resume = genphy_resume,
@@ -3539,8 +3592,8 @@ static struct phy_driver marvell_drivers[] = {
.config_init = m88e1510_config_init,
.config_aneg = m88e1510_config_aneg,
.read_status = marvell_read_status,
- .config_intr = marvell_config_intr,
- .handle_interrupt = marvell_handle_interrupt,
+ .config_intr = m88e1318_config_intr,
+ .handle_interrupt = m88e1318_handle_interrupt,
.get_wol = m88e1318_get_wol,
.set_wol = m88e1318_set_wol,
.resume = m88e1510_resume,
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0447/1167] ip6mr: clear skb->cb[] in reg_vif_xmit()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (440 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0446/1167] net: phy: marvell: keep WOL_EIE across interrupt reconfiguration Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0448/1167] net: stmmac: Track the TX DMA threshold per queue Greg Kroah-Hartman
` (215 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 238164201431a425e48dfcb8e9a59de63caf175b ]
reg_vif_xmit() hands the skb to ip6mr_cache_report() as an
MRT6MSG_WHOLEPKT report. skb_realloc_headroom() copies skb->cb[]
into the report, which is queued to the mroute socket, where
rawv6_recvmsg() reads it as IP6CB.
By the time the pim6reg device transmits the packet, skb->cb[] is
not IP6CB anymore: qdisc_pkt_len_init() overwrites iif and ra,
and any qdisc installed on the device (fq, fq_codel, pie, cake...)
or a tc BPF program writing skb->cb[] fills the area holding
dst0, srcrt, dst1, lastopt and flags.
Since commit dd433671fef3 ("ipv6: validate extension header length
before copying to cmsg") these stale offsets can no longer cause
out-of-bounds reads, but the mroute socket can still receive bogus
IPV6_PKTINFO ifindex and extension header ancillary data.
Clear IP6CB before building the report. The skb is freed right
after, so nothing else depends on its control block.
Fixes: 14fb64e1f449 ("[IPV6] MROUTE: Support PIM-SM (SSM).")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: adjusted context to keep the existing rcu_read_lock() line after DEV_STATS_INC() where upstream had a blank line; the added comment and memset are identical. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/ip6mr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 26152a710d4ad..8ec6b72675929 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -625,6 +625,13 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb,
DEV_STATS_ADD(dev, tx_bytes, skb->len);
DEV_STATS_INC(dev, tx_packets);
rcu_read_lock();
+
+ /* skb->cb[] holds qdisc/tc state at this point, not IP6CB.
+ * ip6mr_cache_report() copies it to the report delivered to
+ * the mroute socket, where it is read as IP6CB.
+ */
+ memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
+
ip6mr_cache_report(mrt, skb, READ_ONCE(mrt->mroute_reg_vif_num),
MRT6MSG_WHOLEPKT);
rcu_read_unlock();
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0448/1167] net: stmmac: Track the TX DMA threshold per queue
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (441 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0447/1167] ip6mr: clear skb->cb[] in reg_vif_xmit() Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0449/1167] exfat: fix used_clusters accounting during cluster allocation Greg Kroah-Hartman
` (214 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Maxime Chevallier,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
[ Upstream commit 9dd53418781900f02897c805eed397555cf98417 ]
Commit 3a6c12a0c6c3 ("net: stmmac: bump tc when get underflow error from
DMA descriptor") made dwmac4 raise the DMA threshold of the queues that
report TX underflows. This is done by incrementing a module global
parameter 'tc' by 64 on each underflow.
This leads to inconsistent TX DMA thresholds between queues and causes
issues on platforms with multiple stmmac controllers, as 'tc' is shared
by all of them. Once 'tc' goes over 256 the bumping stops, and queues
that did not underflow before are left at the initial threshold.
On the Renesas RZ/V2H platform, which has two dwmac4 controllers, we
observed sporadic iperf3 TCP TX failures:
iperf3 -c <server> -t5 --bind-dev end1
...
[ 5] 0.00-5.00 sec 1.00 MBytes 1.68 Mbits/sec 87 sender
[ 5] 0.00-5.00 sec 768 KBytes 1.26 Mbits/sec receiver
This happens because the TX queues of end1 were underflowing on a large
fraction of the packets, but the DMA TX threshold was never raised from
the default of 64 bytes. The threshold was not raised because end0
had underflowed first and had already pushed 'tc' past 256. Which
controller is affected depends on which one underflows first.
To fix this, make the TX DMA threshold per queue instead of global.
Each time an underflow happens on a queue, its TX DMA threshold gets
incremented, without affecting other queues or controllers. With this
change, 'tc' is only used as the initial value, and the RX threshold
is no longer bumped together with the TX one, as TX underflows have
nothing to do with the RX side.
Fixes: 3a6c12a0c6c3 ("net: stmmac: bump tc when get underflow error from DMA descriptor")
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261013114503.57487-2-ovidiu.panait.rb@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Adjusted struct stmmac_priv context to the older neighbouring fields, and used the older probe function name and txfifosz context in the other hunks. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 +
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 33 +++++++++++--------
2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 61c8fc97a4212..2c60c7ee97cb9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -222,6 +222,7 @@ struct stmmac_priv {
unsigned int rx_copybreak;
u32 rx_riwt[MTL_MAX_TX_QUEUES];
+ u32 tx_threshold[MTL_MAX_TX_QUEUES];
int hwts_rx_en;
void __iomem *ioaddr;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index de19aa35818cb..0310a5e409772 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2358,7 +2358,6 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
txfifosz /= tx_channels_count;
if (priv->plat->force_thresh_dma_mode) {
- txmode = tc;
rxmode = tc;
} else if (priv->plat->force_sf_dma_mode || priv->plat->tx_coe) {
/*
@@ -2372,7 +2371,6 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
rxmode = SF_DMA_MODE;
priv->xstats.threshold = SF_DMA_MODE;
} else {
- txmode = tc;
rxmode = SF_DMA_MODE;
}
@@ -2401,8 +2399,11 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
for (chan = 0; chan < tx_channels_count; chan++) {
qmode = priv->plat->tx_queues_cfg[chan].mode_to_use;
- stmmac_dma_tx_mode(priv, priv->ioaddr, txmode, chan,
- txfifosz, qmode);
+ if (txmode == SF_DMA_MODE)
+ priv->tx_threshold[chan] = SF_DMA_MODE;
+
+ stmmac_dma_tx_mode(priv, priv->ioaddr, priv->tx_threshold[chan],
+ chan, txfifosz, qmode);
}
}
@@ -2507,17 +2508,20 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
static void stmmac_bump_dma_threshold(struct stmmac_priv *priv, u32 chan)
{
- if (unlikely(priv->xstats.threshold != SF_DMA_MODE) && tc <= 256) {
- tc += 64;
+ u32 thresh = priv->tx_threshold[chan];
- if (priv->plat->force_thresh_dma_mode)
- stmmac_set_dma_operation_mode(priv, tc, tc, chan);
- else
- stmmac_set_dma_operation_mode(priv, tc, SF_DMA_MODE,
- chan);
+ if (unlikely(thresh == SF_DMA_MODE) || thresh > 256)
+ return;
- priv->xstats.threshold = tc;
- }
+ thresh += 64;
+
+ if (priv->plat->force_thresh_dma_mode)
+ stmmac_set_dma_operation_mode(priv, thresh, tc, chan);
+ else
+ stmmac_set_dma_operation_mode(priv, thresh, SF_DMA_MODE, chan);
+
+ priv->tx_threshold[chan] = thresh;
+ priv->xstats.threshold = thresh;
}
/**
@@ -7600,6 +7604,9 @@ int stmmac_dvr_probe(struct device *device,
priv->xstats.threshold = tc;
+ for (i = 0; i < MTL_MAX_TX_QUEUES; i++)
+ priv->tx_threshold[i] = tc;
+
/* Initialize RSS */
rxq = priv->plat->rx_queues_to_use;
netdev_rss_key_fill(priv->rss.key, sizeof(priv->rss.key));
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0449/1167] exfat: fix used_clusters accounting during cluster allocation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (442 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0448/1167] net: stmmac: Track the TX DMA threshold per queue Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0450/1167] ksmbd: fix iface_list use-after-free during server reset Greg Kroah-Hartman
` (213 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chi Zhiling, Namjae Jeon,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chi Zhiling <chizhiling@kylinos.cn>
[ Upstream commit cb9dbf8a4e34b4fdf311598835ab4d76ed7e07c1 ]
In the current exfat_alloc_cluster(), p_chain->size is incremented as
each cluster is allocated so that the partially allocated chain can
be freed by __exfat_free_cluster() on the error path.
However, sbi->used_clusters is still updated only after all clusters
have been allocated, while __exfat_free_cluster() unconditionally
subtracts the number of freed clusters from sbi->used_clusters.
Therefore, when allocation fails partway through, the partially
allocated clusters are subtracted from sbi->used_clusters even
though they were never added to it. This corrupts the free-space
accounting and can cause sbi->used_clusters to underflow.
Increment sbi->used_clusters together with p_chain->size as each
cluster is allocated. This keeps the accounting consistent with
__exfat_free_cluster() on both the success and error paths.
This issue is caught by generic/476 with 256k cluster size:
Ran: generic/476
Failures: generic/476
Failed 1 of 1 tests
*** fsck.exfat output ***
ERROR: <path>: more clusters are allocated. truncate to N bytes
...
/dev/vdc: corrupted. directories 331, files 526
/dev/vdc: files corrupted 9, files fixed 0
*** end fsck.exfat output ***
Fixes: d5c514b6a0c0 ("exfat: fix the newly allocated clusters are not freed in error handling")
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Dropped the local sbi->used_clusters += num_alloc; line and its trailing blank line instead of upstream's p_chain->size form, since this tree has no done: label. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/exfat/fatent.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index e5f4ce8c38e1a..c25613fe4d948 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -402,13 +402,12 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
}
}
p_chain->size++;
+ sbi->used_clusters++;
last_clu = new_clu;
if (p_chain->size == num_alloc) {
sbi->clu_srch_ptr = hint_clu;
- sbi->used_clusters += num_alloc;
-
mutex_unlock(&sbi->bitmap_lock);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0450/1167] ksmbd: fix iface_list use-after-free during server reset
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (443 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0449/1167] exfat: fix used_clusters accounting during cluster allocation Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0451/1167] ksmbd: disconnect on invalid encryption transform flags Greg Kroah-Hartman
` (212 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Henry Hu, Namjae Jeon,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henry Hu <huhai@kylinos.cn>
[ Upstream commit d34d38ab0c62fe4eb9e746420c554e6d0e6f54db ]
ksmbd_find_netdev_name_iface_list() walks iface_list for
fsctl_query_iface_info_ioctl(), which holds RTNL. But during server
reset, ksmbd_tcp_destroy() unlinks and frees the entries without RTNL,
and queued SMB requests can still be running at that point. So an
FSCTL_QUERY_NETWORK_INTERFACE_INFO request can therefore race with
interface destruction and dereference a freed entry. With debug-only
instrumentation to make the race deterministic, KASAN reports:
BUG: KASAN: slab-use-after-free in
ksmbd_find_netdev_name_iface_list
ksmbd_find_netdev_name_iface_list
fsctl_query_iface_info_ioctl
smb2_ioctl
handle_ksmbd_work
Freed by:
kfree
ksmbd_tcp_destroy
ksmbd_conn_transport_destroy
kill_server_store
The fix is to detach iface_list to a temporary list under RTNL, then drop
RTNL before cleanup because the following cleanup may block and hold RTNL
for a long time.
Fixes: b2d99376c5d6 ("ksmbd: browse interfaces list on FSCTL_QUERY_INTERFACE_INFO IOCTL")
Reported-by: Sashiko <sashiko-bot+sashiko@kernel.org>
Link: https://sashiko.dev/#/patchset/20260911163516.6403-1-15815827059%40163.com
Assisted-by: LLM
Signed-off-by: Henry Hu <huhai@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Dropped the ksmbd_tcp_stop_listener() context line from the ksmbd_tcp_destroy() hunk, since that helper doesn't exist here; the rest of the fix is unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/transport_tcp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c
index 31a241043fb46..8d12b26c94b33 100644
--- a/fs/smb/server/transport_tcp.c
+++ b/fs/smb/server/transport_tcp.c
@@ -681,10 +681,15 @@ static void tcp_stop_kthread(struct task_struct *kthread)
void ksmbd_tcp_destroy(void)
{
struct interface *iface, *tmp;
+ LIST_HEAD(iface_list_to_free);
unregister_netdevice_notifier(&ksmbd_netdev_notifier);
- list_for_each_entry_safe(iface, tmp, &iface_list, entry) {
+ rtnl_lock();
+ list_splice_init(&iface_list, &iface_list_to_free);
+ rtnl_unlock();
+
+ list_for_each_entry_safe(iface, tmp, &iface_list_to_free, entry) {
list_del(&iface->entry);
kfree(iface->name);
kfree(iface);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0451/1167] ksmbd: disconnect on invalid encryption transform flags
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (444 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0450/1167] ksmbd: fix iface_list use-after-free during server reset Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0452/1167] ksmbd: cache the resolved share path for durable reconnects Greg Kroah-Hartman
` (211 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 0882f124ae329eefb66b00e63b9043f24c006b0e ]
MS-SMB2 3.3.5.2.1.1 requires the Flags/EncryptionAlgorithm field in an
SMB2 transform header to be 0x0001. The server must disconnect the
connection when it has any other value.
smb3_decrypt_req() currently ignores this field. A client with the
session key can therefore send a correctly authenticated encrypted
request with invalid flags and have it processed. Check the field
before looking up the session key or decrypting the request. The caller
aborts the connection when this check fails.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Inserted the new transform-flags check in smb3_decrypt_req() unchanged, but adapted context because this tree lacks the compression-header check and the original_msg_size local. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 16e7ff0b618a1..727b0bca9743f 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -9552,6 +9552,12 @@ int smb3_decrypt_req(struct ksmbd_work *work)
return -ECONNABORTED;
}
+ if (tr_hdr->Flags != cpu_to_le16(TRANSFORM_FLAG_ENCRYPTED)) {
+ pr_err_ratelimited("Invalid transform flags 0x%04x\n",
+ le16_to_cpu(tr_hdr->Flags));
+ return -ECONNABORTED;
+ }
+
if (buf_data_size < le32_to_cpu(tr_hdr->OriginalMessageSize)) {
pr_err("Transform message is broken\n");
return -ECONNABORTED;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0452/1167] ksmbd: cache the resolved share path for durable reconnects
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (445 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0451/1167] ksmbd: disconnect on invalid encryption transform flags Greg Kroah-Hartman
@ 2026-12-04 9:57 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0453/1167] ksmbd: fix durable reconnects for root shares Greg Kroah-Hartman
` (210 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:57 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dairui Zhang, Namjae Jeon,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 2a90ba573d41efa82e075ba9ac532bb3ec0519c4 ]
A share configured as /a/link/b, with /a/link pointing to /real, is
opened relative to share->vfs_path at /real/b. However,
ksmbd_validate_name_reconnect() compares the file's d_path() result
against the original /a/link/b string and rejects a valid reconnect.
Render share->vfs_path with d_path() after the existing kern_path()
lookup and cache a copy in real_path along with its length. Use the
resolved string for durable reconnect name validation. Keep path and
path_sz as the configured spelling for existing consumers, including
the volume serial calculation and path lookups.
Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
Reported-by: Dairui Zhang <zhangdairui@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: adjusted the call site to a plain share_config_resolve_path() call without scoped_with_init_fs(), and used GFP_KERNEL instead of KSMBD_DEFAULT_GFP. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/mgmt/share_config.c | 43 +++++++++++++++++++++++++++++--
fs/smb/server/mgmt/share_config.h | 2 ++
fs/smb/server/vfs_cache.c | 12 +++++----
3 files changed, 50 insertions(+), 7 deletions(-)
diff --git a/fs/smb/server/mgmt/share_config.c b/fs/smb/server/mgmt/share_config.c
index cb89e54c4da84..d1cc7fde739b8 100644
--- a/fs/smb/server/mgmt/share_config.c
+++ b/fs/smb/server/mgmt/share_config.c
@@ -8,6 +8,7 @@
#include <linux/slab.h>
#include <linux/rwsem.h>
#include <linux/parser.h>
+#include <linux/dcache.h>
#include <linux/namei.h>
#include <linux/sched.h>
#include <linux/mm.h>
@@ -50,6 +51,7 @@ static void kill_share(struct ksmbd_share_config *share)
path_put(&share->vfs_path);
kfree(share->name);
kfree(share->path);
+ kfree(share->real_path);
kfree(share);
}
@@ -124,6 +126,43 @@ static int parse_veto_list(struct ksmbd_share_config *share,
return 0;
}
+static int share_config_resolve_path(struct ksmbd_share_config *share)
+{
+ char *buf, *path;
+ int ret;
+
+ ret = kern_path(share->path, 0, &share->vfs_path);
+ if (ret)
+ return ret;
+
+ buf = kmalloc(PATH_MAX, GFP_KERNEL);
+ if (!buf) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ path = d_path(&share->vfs_path, buf, PATH_MAX);
+ if (IS_ERR(path)) {
+ ret = PTR_ERR(path);
+ goto out_buf;
+ }
+
+ path = kstrdup(path, GFP_KERNEL);
+ if (!path) {
+ ret = -ENOMEM;
+ goto out_buf;
+ }
+
+ share->real_path = path;
+ share->real_path_sz = strlen(path);
+out_buf:
+ kfree(buf);
+out:
+ if (ret)
+ path_put(&share->vfs_path);
+ return ret;
+}
+
static struct ksmbd_share_config *share_config_request(struct ksmbd_work *work,
const char *name)
{
@@ -212,12 +251,12 @@ static struct ksmbd_share_config *share_config_request(struct ksmbd_work *work,
goto out;
}
- ret = kern_path(share->path, 0, &share->vfs_path);
+ ret = share_config_resolve_path(share);
ksmbd_revert_fsids(work);
if (ret) {
ksmbd_debug(SMB, "failed to access '%s'\n",
share->path);
- /* Avoid put_path() */
+ /* No path reference is retained on failure. */
kfree(share->path);
share->path = NULL;
}
diff --git a/fs/smb/server/mgmt/share_config.h b/fs/smb/server/mgmt/share_config.h
index d4ac2dd4de204..baa9f9ed91cde 100644
--- a/fs/smb/server/mgmt/share_config.h
+++ b/fs/smb/server/mgmt/share_config.h
@@ -16,8 +16,10 @@ struct ksmbd_work;
struct ksmbd_share_config {
char *name;
char *path;
+ char *real_path;
unsigned int path_sz;
+ unsigned int real_path_sz;
unsigned int flags;
struct list_head veto_list;
diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c
index 42d2b9cbdd894..e2f7a7d9cca96 100644
--- a/fs/smb/server/vfs_cache.c
+++ b/fs/smb/server/vfs_cache.c
@@ -1354,6 +1354,8 @@ void ksmbd_free_global_file_table(void)
int ksmbd_validate_name_reconnect(struct ksmbd_share_config *share,
struct ksmbd_file *fp, char *name)
{
+ const char *share_path = share->real_path;
+ size_t share_path_sz = share->real_path_sz;
char *pathname, *ab_pathname;
int ret = 0;
@@ -1370,14 +1372,14 @@ int ksmbd_validate_name_reconnect(struct ksmbd_share_config *share,
if (name) {
size_t len = strlen(ab_pathname);
- if (len == share->path_sz && !strncmp(ab_pathname, share->path, len)) {
+ if (len == share_path_sz && !strncmp(ab_pathname, share_path, len)) {
/* the durable fp is the share root itself */
if (name[0])
ret = -EINVAL;
- } else if (len <= share->path_sz ||
- strncmp(ab_pathname, share->path, share->path_sz) ||
- ab_pathname[share->path_sz] != '/' ||
- strcmp(&ab_pathname[share->path_sz + 1], name)) {
+ } else if (len <= share_path_sz ||
+ strncmp(ab_pathname, share_path, share_path_sz) ||
+ ab_pathname[share_path_sz] != '/' ||
+ strcmp(&ab_pathname[share_path_sz + 1], name)) {
ret = -EINVAL;
}
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0453/1167] ksmbd: fix durable reconnects for root shares
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (446 preceding siblings ...)
2026-12-04 9:57 ` [PATCH 6.6 0452/1167] ksmbd: cache the resolved share path for durable reconnects Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0454/1167] ksmbd: fix fd_limit accounting across durable reconnects Greg Kroah-Hartman
` (209 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dairui Zhang, Namjae Jeon,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 25e36df831a47597c03c6239fbc71285e7d714c2 ]
When a share exports "/", ksmbd_validate_name_reconnect() expects
another slash after the share path. For a file at /foo, this rejects
the valid reconnect name "foo" even though the file is in the share.
Compare the requested name with the rendered file path after its
leading slash when the resolved share root is "/". Keep the
exact-root/empty-name check and reject rendered paths without an
initial slash.
Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
Reported-by: Dairui Zhang <zhangdairui@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/vfs_cache.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c
index e2f7a7d9cca96..142aa00499805 100644
--- a/fs/smb/server/vfs_cache.c
+++ b/fs/smb/server/vfs_cache.c
@@ -1376,6 +1376,10 @@ int ksmbd_validate_name_reconnect(struct ksmbd_share_config *share,
/* the durable fp is the share root itself */
if (name[0])
ret = -EINVAL;
+ } else if (share_path_sz == 1 && share_path[0] == '/') {
+ if (ab_pathname[0] != '/' ||
+ strcmp(ab_pathname + 1, name))
+ ret = -EINVAL;
} else if (len <= share_path_sz ||
strncmp(ab_pathname, share_path, share_path_sz) ||
ab_pathname[share_path_sz] != '/' ||
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0454/1167] ksmbd: fix fd_limit accounting across durable reconnects
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (447 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0453/1167] ksmbd: fix durable reconnects for root shares Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0455/1167] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86 Greg Kroah-Hartman
` (208 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mohammed, Namjae Jeon, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit df5c868f6b80ca16c171cfac5e4e6c9be83ba4c2 ]
A disconnected durable handle keeps its ksmbd_file and the fd_limit
reservation taken at its initial open. Reconnecting allocates another
volatile ID and takes another reservation for the same file. Final close
returns only one reservation, so repeated reconnects permanently reduce
the server-wide open-file budget.
Move reservation into ksmbd_open_fd() and release it on every creation
failure. Keep the reservation until final close, including while a durable
handle is disconnected. Make ID allocation independent of fd_limit so
reconnects neither consume nor return slots. This also avoids returning an
unreserved slot when persistent ID allocation fails.
New opens continue to return -EMFILE when the budget is exhausted, keeping
the existing STATUS_INSUFFICIENT_RESOURCES mapping.
Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
Reported-by: Mohammed <mohammed.saad.alquraini@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Context lines used the literal GFP_KERNEL instead of the KSMBD_DEFAULT_GFP macro, which this tree lacks, so both conflicting hunks were resolved with GFP_KERNEL. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/vfs_cache.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c
index 142aa00499805..ab47cee8a89ad 100644
--- a/fs/smb/server/vfs_cache.c
+++ b/fs/smb/server/vfs_cache.c
@@ -721,11 +721,6 @@ static int __open_id(struct ksmbd_file_table *ft, struct ksmbd_file *fp,
u64 id = 0;
int ret;
- if (type == OPEN_ID_TYPE_VOLATILE_ID && fd_limit_depleted()) {
- __open_id_set(fp, KSMBD_NO_FID, type);
- return -EMFILE;
- }
-
idr_preload(GFP_KERNEL);
write_lock(&ft->lock);
ret = idr_alloc_cyclic(ft->idr, fp, KSMBD_START_FID, INT_MAX - 1,
@@ -735,7 +730,6 @@ static int __open_id(struct ksmbd_file_table *ft, struct ksmbd_file *fp,
ret = 0;
} else {
id = KSMBD_NO_FID;
- fd_limit_close();
}
__open_id_set(fp, id, type);
@@ -755,10 +749,15 @@ struct ksmbd_file *ksmbd_open_fd(struct ksmbd_work *work, struct file *filp)
struct ksmbd_file *fp;
int ret;
+ /* Durable reconnects reuse the slot held for the lifetime of fp. */
+ if (fd_limit_depleted())
+ return ERR_PTR(-EMFILE);
+
fp = kmem_cache_zalloc(filp_cache, GFP_KERNEL);
if (!fp) {
pr_err("Failed to allocate memory\n");
- return ERR_PTR(-ENOMEM);
+ ret = -ENOMEM;
+ goto err_fd_limit;
}
INIT_LIST_HEAD(&fp->blocked_works);
@@ -801,6 +800,8 @@ struct ksmbd_file *ksmbd_open_fd(struct ksmbd_work *work, struct file *filp)
/* fp->conn was set and refcounted before every branch here. */
ksmbd_conn_put(fp->conn);
kmem_cache_free(filp_cache, fp);
+err_fd_limit:
+ fd_limit_close();
return ERR_PTR(ret);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0455/1167] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (448 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0454/1167] ksmbd: fix fd_limit accounting across durable reconnects Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0456/1167] perf lock contention: Filter events before creating lock_stat Greg Kroah-Hartman
` (207 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sasha Levin, Andrew Morton,
Shuah Khan, Alexey Dobriyan
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit c4d9005e7e1ee6ce277f47cf53d44fc5b90b287b ]
g_vsyscall is only used by the x86_64 test, so clang builds for other
architectures get:
proc-pid-vm.c:224:21: warning: unused variable 'g_vsyscall' [-Wunused-variable]
The vsyscall strings next to it had the same problem and were marked
__maybe_unused for it. Move all of the vsyscall variables into the
__x86_64__ block that uses them instead, and drop those annotations
along with the local __maybe_unused fallback that was added for them.
Link: https://lore.kernel.org/20261012115330.3777115-1-sashal@kernel.org
Fixes: 17415606f9d8 ("tools/testing/selftests/proc/proc-pid-vm.c: test with vsyscall in mind")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Assisted-by: LLM
Cc: Shuah Khan <shuah@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
[ sashal: Dropped the second #ifdef __x86_64__ and its preceding #endif to move the vsyscall variables into the x86 block, keeping the local ../kselftest.h include and omitting __maybe_unused removals the tree never had. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/proc/proc-pid-vm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/proc/proc-pid-vm.c b/tools/testing/selftests/proc/proc-pid-vm.c
index cacbd2a4aec91..fb4b4b648240a 100644
--- a/tools/testing/selftests/proc/proc-pid-vm.c
+++ b/tools/testing/selftests/proc/proc-pid-vm.c
@@ -209,7 +209,6 @@ static int make_exe(const uint8_t *payload, size_t len)
return fd1;
}
-#endif
/*
* 0: vsyscall VMA doesn't exist vsyscall=none
@@ -225,7 +224,6 @@ static const char str_vsyscall_1[] =
static const char str_vsyscall_2[] =
"ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]\n";
-#ifdef __x86_64__
static void sigaction_SIGSEGV(int _, siginfo_t *__, void *___)
{
_exit(g_vsyscall);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0456/1167] perf lock contention: Filter events before creating lock_stat
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (449 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0455/1167] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86 Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0457/1167] sctp: reject forged cookie peer_addr with unknown address family Greg Kroah-Hartman
` (206 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Namhyung Kim, Ian Rogers,
Arnaldo Carvalho de Melo, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit c58d1598e79554cc8f587668ab2ebcaeb616b076 ]
In report_lock_contention_begin_event(), lock_stat_findnew() was
called before checking filters.nr_types (-Y), filters.nr_addrs (-L),
and match_callstack_filter() (-S).
When a filtered-out lock event (such as a mutex contention when
running with -Y spinlock) shared the same aggregation key as a
subsequent matching event (for example, contention on the mutex's
internal wait_lock spinlock from the same caller), the first event
created the lock_stat entry with the filtered-out lock's flags and the
second event reused that entry, causing non-spinlock entries to appear
in -Y spinlock output.
Check the type, address, and callstack filters before looking up or
creating the lock_stat entry.
Fixes: b4a7eff93c39f985 ("perf lock contention: Add -Y/--type-filter option")
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: adjusted context for the 6.6 API: lock_contention_caller() keeps its evsel argument, and the moved lookup block has no LOCK_AGGR_CGROUP case. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-lock.c | 59 +++++++++++++++++++++------------------
1 file changed, 32 insertions(+), 27 deletions(-)
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index bd294fd574972..644057defa50b 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -1067,6 +1067,7 @@ static int report_lock_contention_begin_event(struct evsel *evsel,
struct machine *machine = &session->machines.host;
struct map *kmap;
struct symbol *sym;
+ u64 *callstack = NULL;
ret = get_key_by_aggr_mode(&key, addr, evsel, sample);
if (ret < 0)
@@ -1102,32 +1103,6 @@ static int report_lock_contention_begin_event(struct evsel *evsel,
}
}
- ls = lock_stat_find(key);
- if (!ls) {
- char buf[128];
- const char *name = "";
-
- switch (aggr_mode) {
- case LOCK_AGGR_ADDR:
- sym = machine__find_kernel_symbol(machine, key, &kmap);
- if (sym)
- name = sym->name;
- break;
- case LOCK_AGGR_CALLER:
- name = buf;
- if (lock_contention_caller(evsel, sample, buf, sizeof(buf)) < 0)
- name = "Unknown";
- break;
- case LOCK_AGGR_TASK:
- default:
- break;
- }
-
- ls = lock_stat_findnew(key, name, flags);
- if (!ls)
- return -ENOMEM;
- }
-
if (filters.nr_types) {
bool found = false;
@@ -1157,7 +1132,7 @@ static int report_lock_contention_begin_event(struct evsel *evsel,
}
if (needs_callstack()) {
- u64 *callstack = get_callstack(sample, max_stack_depth);
+ callstack = get_callstack(sample, max_stack_depth);
if (callstack == NULL)
return -ENOMEM;
@@ -1165,7 +1140,37 @@ static int report_lock_contention_begin_event(struct evsel *evsel,
free(callstack);
return 0;
}
+ }
+
+ ls = lock_stat_find(key);
+ if (!ls) {
+ char buf[128];
+ const char *name = "";
+
+ switch (aggr_mode) {
+ case LOCK_AGGR_ADDR:
+ sym = machine__find_kernel_symbol(machine, key, &kmap);
+ if (sym)
+ name = sym->name;
+ break;
+ case LOCK_AGGR_CALLER:
+ name = buf;
+ if (lock_contention_caller(evsel, sample, buf, sizeof(buf)) < 0)
+ name = "Unknown";
+ break;
+ case LOCK_AGGR_TASK:
+ default:
+ break;
+ }
+
+ ls = lock_stat_findnew(key, name, flags);
+ if (!ls) {
+ free(callstack);
+ return -ENOMEM;
+ }
+ }
+ if (callstack) {
if (ls->callstack == NULL)
ls->callstack = callstack;
else
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0457/1167] sctp: reject forged cookie peer_addr with unknown address family
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (450 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0456/1167] perf lock contention: Filter events before creating lock_stat Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0458/1167] net/mlx5e: IPsec, Fix out-of-bounds comparison of neighbour keys Greg Kroah-Hartman
` (205 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xingyuan Mo, Xin Long,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xingyuan Mo <hdthky0@gmail.com>
[ Upstream commit 9802123ceca818aa69284c615114ca55b9cc94a1 ]
When cookie authentication is disabled, COOKIE-ECHO peer_addr is
attacker-controlled. An invalid sa_family made sctp_get_af_specific()
return NULL and crash in sctp_transport_init() on
af_specific->sockaddr_len. Validate it with af->addr_valid() in
sctp_unpack_cookie(), which also rejects a mismatched family, e.g.
an AF_INET6 peer_addr on an IPv4 socket that would later crash in
sctp_v6_get_dst() on inet6_sk(sk)->opt. Validate a copy of peer_addr,
since addr_valid() rewrites a v4-mapped v6 address in place and the
cookie still lives in the received skb, which is not guaranteed to
be unshared. Store the validated copy in the new association and
pass it to sctp_process_init() instead of the raw cookie, so a
v4-mapped v6 address is normalised to AF_INET before the association
and its primary transport are built from it.
For that, sctp_v6_addr_valid() has to return 0 for a non-v4-mapped
address when it is called with a socket that is not PF_INET6, so that
IPv6 addresses are never used on IPv4 sockets. The check is done after
the v4-mapped handling, so v4-mapped addresses passed to an IPv4
socket through the socket API keep being accepted. As addr_valid()
now also checks sk_family and ipv6_only_sock, simplify the address
handling in sctp_process_param() with it, as it additionally filters
out non-unicast addresses. As a side effect, a v4-mapped address in
an IPv6 address parameter is now normalised to AF_INET before the
transport is created, matching what the socket API paths already do.
Also add the missing !af check in sctp_process_init(), as
sctp_get_af_specific(AF_INET6) returns NULL on CONFIG_IPV6=n builds.
BUG: KASAN: null-ptr-deref in sctp_transport_new+0xa7/0x350
Read of size 4 at addr 00000000000000b4 by task poc/682
Call Trace:
<IRQ>
sctp_transport_new+0xa7/0x350
sctp_assoc_add_peer+0x153/0x850
sctp_process_init+0xf9/0x1180
sctp_sf_do_5_1D_ce+0x464/0xbc0
sctp_do_sm+0x114/0x2990
sctp_endpoint_bh_rcv+0x280/0x430
sctp_inq_push+0xdd/0x100
sctp_rcv+0x17f5/0x1ae0
sctp4_rcv+0x2b/0x40
ip_protocol_deliver_rcu+0x25b/0x270
ip_local_deliver+0xd1/0xe0
</IRQ>
Kernel panic - not syncing: Fatal exception in interrupt
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Xingyuan Mo <hdthky0@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261019073747.178626-1-hdthky0@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: adjusted the sctp_unpack_cookie() local declarations to fit this tree's existing digest variable and ordering, adding only paddr and af; all other hunks apply unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sctp/ipv6.c | 6 +++++-
net/sctp/sm_make_chunk.c | 24 +++++++++++++-----------
net/sctp/sm_statefuns.c | 2 +-
3 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 4f0647e60dae4..819930cc4207c 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -725,7 +725,8 @@ static int sctp_v6_available(union sctp_addr *addr, struct sctp_sock *sp)
* SCTP.
*
* Output:
- * Return 0 - If the address is a non-unicast or an illegal address.
+ * Return 0 - If the address is a non-unicast or an illegal address,
+ * or a non-v4-mapped address on a non-PF_INET6 socket.
* Return 1 - If the address is a unicast.
*/
static int sctp_v6_addr_valid(union sctp_addr *addr,
@@ -749,6 +750,9 @@ static int sctp_v6_addr_valid(union sctp_addr *addr,
if (!(ret & IPV6_ADDR_UNICAST))
return 0;
+ if (sp && sctp_opt2sk(sp)->sk_family != PF_INET6)
+ return 0;
+
return 1;
}
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index c1a5384eed75f..aec4c04793d9a 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1759,8 +1759,10 @@ struct sctp_association *sctp_unpack_cookie(
struct sctp_cookie *bear_cookie;
__u8 *digest = ep->digest;
struct sctp_chunkhdr *ch;
+ union sctp_addr paddr;
enum sctp_scope scope;
unsigned int len, chlen;
+ struct sctp_af *af;
ktime_t kt;
/* Header size is static data prior to the actual cookie, including
@@ -1880,6 +1882,11 @@ struct sctp_association *sctp_unpack_cookie(
goto fail;
}
+ paddr = bear_cookie->peer_addr;
+ af = sctp_get_af_specific(paddr.sa.sa_family);
+ if (!af || !af->addr_valid(&paddr, sctp_sk(ep->base.sk), NULL))
+ goto malformed;
+
/* Make a new base association. */
scope = sctp_scope(sctp_source(chunk));
retval = sctp_association_new(ep, ep->base.sk, scope, gfp);
@@ -1896,6 +1903,7 @@ struct sctp_association *sctp_unpack_cookie(
/* Populate the association from the cookie. */
memcpy(&retval->c, bear_cookie, sizeof(*bear_cookie));
+ retval->c.peer_addr = paddr;
if (sctp_assoc_set_bind_addr_from_cookie(retval, bear_cookie,
GFP_ATOMIC) < 0) {
@@ -2420,8 +2428,8 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
(param.p->type == SCTP_PARAM_IPV4_ADDRESS ||
param.p->type == SCTP_PARAM_IPV6_ADDRESS)) {
af = sctp_get_af_specific(param_type2af(param.p->type));
- if (!af->from_addr_param(&addr, param.addr,
- chunk->sctp_hdr->source, 0))
+ if (!af || !af->from_addr_param(&addr, param.addr,
+ chunk->sctp_hdr->source, 0))
continue;
if (sctp_cmp_addr_exact(sctp_source(chunk), &addr))
src_match = 1;
@@ -2593,17 +2601,11 @@ static int sctp_process_param(struct sctp_association *asoc,
*/
switch (param.p->type) {
case SCTP_PARAM_IPV6_ADDRESS:
- if (PF_INET6 != asoc->base.sk->sk_family)
- break;
- goto do_addr_param;
-
case SCTP_PARAM_IPV4_ADDRESS:
- /* v4 addresses are not allowed on v6-only socket */
- if (ipv6_only_sock(asoc->base.sk))
- break;
-do_addr_param:
af = sctp_get_af_specific(param_type2af(param.p->type));
- if (!af->from_addr_param(&addr, param.addr, htons(asoc->peer.port), 0))
+ if (!af || !af->from_addr_param(&addr, param.addr,
+ htons(asoc->peer.port), 0) ||
+ !af->addr_valid(&addr, sctp_sk(asoc->base.sk), NULL))
break;
scope = sctp_scope(peer_addr);
if (sctp_in_scope(net, &addr, scope))
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 0b54e45f241c6..c5562d10d5657 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -813,7 +813,7 @@ enum sctp_disposition sctp_sf_do_5_1D_ce(struct net *net,
* effects--it is safe to run them here.
*/
if (!sctp_process_init(new_asoc, chunk,
- &chunk->subh.cookie_hdr->c.peer_addr,
+ &new_asoc->c.peer_addr,
peer_init, GFP_ATOMIC))
goto nomem_init;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0458/1167] net/mlx5e: IPsec, Fix out-of-bounds comparison of neighbour keys
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (451 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0457/1167] sctp: reject forged cookie peer_addr with unknown address family Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0459/1167] zram: fix short reads from block_state Greg Kroah-Hartman
` (204 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gal Pressman, Leon Romanovsky,
Yael Chemla, Tariq Toukan, Fernando Fernandez Mancera,
Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gal Pressman <gal@nvidia.com>
[ Upstream commit 520631554a689d2cd52452578f3140f045730ee0 ]
mlx5e_ipsec_netevent_event() keeps the L2 headers of offloaded tunnel
mode SAs up to date: on every neighbour change it looks for SAs whose
endpoint matches the neighbour's address. The compare width, 4 bytes for
IPv4 or 16 for IPv6, is chosen from the SA's address family, with no
check that the neighbour is of the same family.
An ARP entry only stores a 4-byte key, so with an IPv6 tunnel mode SA
offloaded, any IPv4 neighbour update in the system is compared as if it
were a 16-byte IPv6 address, reading past the end of the object:
BUG: KASAN: slab-out-of-bounds in mlx5e_ipsec_netevent_event+0x736/0x8d0 [mlx5_core]
Read of size 4 at addr ff110001260a4ad8 by task swapper/8/0
Call Trace:
<IRQ>
mlx5e_ipsec_netevent_event+0x736/0x8d0 [mlx5_core]
notifier_call_chain+0x97/0x2b0
atomic_notifier_call_chain+0x5d/0x130
neigh_timer_handler+0x35c/0x1140
call_timer_fn+0x164/0x490
__run_timers+0x5b9/0x960
run_timer_softirq+0xf0/0x1d0
handle_softirqs+0x189/0x8a0
__irq_exit_rcu+0x10d/0x250
...
Allocated by task 1015:
__kmalloc_noprof+0x2e6/0x8b0
___neigh_create+0xcc9/0x24c0
ip_finish_output2+0xfc7/0x1e80
ip_output+0x172/0x3b0
ip_send_skb+0xa5/0x1b0
udp_send_skb+0x852/0x10f0
udp_sendmsg+0x1333/0x2150
...
The opposite mix (IPv4 SA with IPv6 neighbour) stays in bounds, but only
the first 32 bits of the IPv6 address are compared, so an unrelated
neighbour can match.
Skip neighbours whose address family doesn't match the SA.
Fixes: 4c24272b4e2b ("net/mlx5e: Listen to ARP events to update IPsec L2 headers in tunnel mode")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Yael Chemla <ychemla@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20261021064231.3466989-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Replaced attrs->addrs.family with attrs->family because this tree's SA attrs struct has no addrs sub-struct. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
index 13c143610d6cf..ee4c02fd0a840 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
@@ -855,6 +855,9 @@ static int mlx5e_ipsec_netevent_event(struct notifier_block *nb,
xa_for_each_marked(&ipsec->sadb, idx, sa_entry, MLX5E_IPSEC_TUNNEL_SA) {
attrs = &sa_entry->attrs;
+ if (attrs->family != n->tbl->family)
+ continue;
+
if (attrs->family == AF_INET) {
if (!neigh_key_eq32(n, &attrs->saddr.a4) &&
!neigh_key_eq32(n, &attrs->daddr.a4))
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0459/1167] zram: fix short reads from block_state
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (452 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0458/1167] net/mlx5e: IPsec, Fix out-of-bounds comparison of neighbour keys Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0460/1167] maple_tree: fix maple_range_64 crashes in RCU mode Greg Kroah-Hartman
` (203 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pooyan Azad, Andrew Morton,
Sergey Senozhatsky, Minchan Kim, Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pooyan Azad <pooyan.azadparvar@gmail.com>
[ Upstream commit 372012202260db088b489ed00059c4571a602552 ]
read_block_state() formats each entry directly into the buffer supplied by
read(). If the remaining buffer is too small for one complete record,
snprintf() returns the full record length and the function stops without
copying data or advancing the file position. A read from this debugfs
file which is smaller than a record therefore returns zero at a non-EOF
position and cannot make progress.
Convert block_state to seq_file so formatted records are buffered
independently of the userspace read size. Keep dev_lock held across each
seq_file iteration and continue to protect individual entries with their
slot locks.
Link: https://lore.kernel.org/20260929071846.24829-1-pooyan.azadparvar@gmail.com
Fixes: c0265342bff4 ("zram: introduce zram memory tracking")
Signed-off-by: Pooyan Azad <pooyan.azadparvar@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Closes: https://lore.kernel.org/r/CANC3H+LdtoydSp+o2ecErAw7k6R2+gRf9LyxcaoHv_mGhJmyQQ@mail.gmail.com/
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
[ sashal: Replaced the debugfs block_state read handler with the seq_file version, using this tree's older helper names (init_lock, zram_slot_lock, zram_test_flag) and its ktime_t ac_time timestamp formatting. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/zram/zram_drv.c | 105 +++++++++++++++++-----------------
1 file changed, 53 insertions(+), 52 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 451908dd2d675..3e7e0d6eaa326 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -879,72 +879,73 @@ static void zram_debugfs_destroy(void)
debugfs_remove_recursive(zram_debugfs_root);
}
-static ssize_t read_block_state(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
+static void *zram_block_state_start(struct seq_file *seq, loff_t *pos)
{
- char *kbuf;
- ssize_t index, written = 0;
- struct zram *zram = file->private_data;
+ struct zram *zram = seq->private;
unsigned long nr_pages;
- kbuf = kvmalloc(count, GFP_KERNEL);
- if (!kbuf)
- return -ENOMEM;
-
down_read(&zram->init_lock);
- if (!init_done(zram)) {
- up_read(&zram->init_lock);
- kvfree(kbuf);
- return -EINVAL;
- }
+ if (!init_done(zram))
+ return ERR_PTR(-EINVAL);
nr_pages = zram->disksize >> PAGE_SHIFT;
+ if (*pos >= nr_pages)
+ return NULL;
- for (index = *ppos; index < nr_pages; index++) {
- int copied;
- struct timespec64 ts;
+ return pos;
+}
- zram_slot_lock(zram, index);
- if (!zram_allocated(zram, index))
- goto next;
+static void *zram_block_state_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct zram *zram = seq->private;
+ unsigned long nr_pages = zram->disksize >> PAGE_SHIFT;
- ts = ktime_to_timespec64(zram->table[index].ac_time);
- copied = snprintf(kbuf + written, count,
- "%12zd %12lld.%06lu %c%c%c%c%c%c\n",
- index, (s64)ts.tv_sec,
- ts.tv_nsec / NSEC_PER_USEC,
- zram_test_flag(zram, index, ZRAM_SAME) ? 's' : '.',
- zram_test_flag(zram, index, ZRAM_WB) ? 'w' : '.',
- zram_test_flag(zram, index, ZRAM_HUGE) ? 'h' : '.',
- zram_test_flag(zram, index, ZRAM_IDLE) ? 'i' : '.',
- zram_get_priority(zram, index) ? 'r' : '.',
- zram_test_flag(zram, index,
- ZRAM_INCOMPRESSIBLE) ? 'n' : '.');
-
- if (count <= copied) {
- zram_slot_unlock(zram, index);
- break;
- }
- written += copied;
- count -= copied;
-next:
- zram_slot_unlock(zram, index);
- *ppos += 1;
- }
+ ++*pos;
+ if (*pos >= nr_pages)
+ return NULL;
+
+ return pos;
+}
+
+static void zram_block_state_stop(struct seq_file *seq, void *v)
+{
+ struct zram *zram = seq->private;
up_read(&zram->init_lock);
- if (copy_to_user(buf, kbuf, written))
- written = -EFAULT;
- kvfree(kbuf);
+}
- return written;
+static int zram_block_state_show(struct seq_file *seq, void *v)
+{
+ struct zram *zram = seq->private;
+ unsigned long index = *(loff_t *)v;
+ struct timespec64 ts;
+
+ zram_slot_lock(zram, index);
+ if (zram_allocated(zram, index)) {
+ ts = ktime_to_timespec64(zram->table[index].ac_time);
+ seq_printf(seq, "%12lu %12lld.%06lu %c%c%c%c%c%c\n",
+ index, (s64)ts.tv_sec,
+ ts.tv_nsec / NSEC_PER_USEC,
+ zram_test_flag(zram, index, ZRAM_SAME) ? 's' : '.',
+ zram_test_flag(zram, index, ZRAM_WB) ? 'w' : '.',
+ zram_test_flag(zram, index, ZRAM_HUGE) ? 'h' : '.',
+ zram_test_flag(zram, index, ZRAM_IDLE) ? 'i' : '.',
+ zram_get_priority(zram, index) ? 'r' : '.',
+ zram_test_flag(zram, index,
+ ZRAM_INCOMPRESSIBLE) ? 'n' : '.');
+ }
+ zram_slot_unlock(zram, index);
+
+ return 0;
}
-static const struct file_operations proc_zram_block_state_op = {
- .open = simple_open,
- .read = read_block_state,
- .llseek = default_llseek,
+static const struct seq_operations zram_block_state_sops = {
+ .start = zram_block_state_start,
+ .next = zram_block_state_next,
+ .stop = zram_block_state_stop,
+ .show = zram_block_state_show,
};
+DEFINE_SEQ_ATTRIBUTE(zram_block_state);
static void zram_debugfs_register(struct zram *zram)
{
@@ -954,7 +955,7 @@ static void zram_debugfs_register(struct zram *zram)
zram->debugfs_dir = debugfs_create_dir(zram->disk->disk_name,
zram_debugfs_root);
debugfs_create_file("block_state", 0400, zram->debugfs_dir,
- zram, &proc_zram_block_state_op);
+ zram, &zram_block_state_fops);
}
static void zram_debugfs_unregister(struct zram *zram)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0460/1167] maple_tree: fix maple_range_64 crashes in RCU mode
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (453 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0459/1167] zram: fix short reads from block_state Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0461/1167] ALSA: ump: Drain sequencer callbacks before freeing their client Greg Kroah-Hartman
` (202 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dimitris Charisis, Andrew Morton,
Liam R. Howlett (Google), Florian Schmaus, Alice Ryhl,
Andrew Ballance, Suren Baghdasaryan, Matthew Wilcox (Oracle),
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dimitris Charisis <dchar@cslab.ece.ntua.gr>
[ Upstream commit baed735a956f2a7badb5436bef6810303034f920 ]
Patch series "maple_tree: fix maple_range_64 crashes in RCU mode", v3.
The patch series fixes two RCU destroy path issues on maple_range_64
nodes. Both arising from the fact that a maple_range_64 node repurposes
the last slot to hold metadata when the node is not full. Patch 1
addresses the issues, and patch 2 adds a test used to catch them.
Currently there is no in-tree user of maple_range_64 nodes in RCU mode.
All in-tree users of MT_FLAGS_USE_RCU also set MT_FLAGS_ALLOC_RANGE which
makes the internal nodes maple_arange_64.
Below is the minimal reproducer used during debugging:
static DEFINE_MTREE(tree);
static int __init maple_fix_init(void)
{
unsigned long i, j;
for (i = 10; i < 4000; i++) {
mt_init_flags(&tree, MT_FLAGS_USE_RCU);
for (j = 0; j < i; j++) {
mtree_insert_range(&tree, j * 10, j * 10 + 9,
xa_mk_value(j), GFP_KERNEL);
}
mtree_destroy(&tree);
rcu_barrier();
}
return 0;
}
The splat for the first issue addressed by the first patch is shown below.
mt_clear_meta() runs after the slots have been rewritten with raw
pointers by mte_dead_leaves(), so it cannot recognize a valid last pointer
because the type information is stripped. On my 64-bit LE machine, it
clears bytes 248 and 249 of the maple_range_64 which are the two least
significant bytes of the last pointer. The lowest byte is already zero,
since nodes are 256-byte aligned, but zeroing byte 249 corrupts the
pointer.
KASAN catches it as a double-free, because that corrupted pointer happens
to land on a node that was freed previously. The splat appears at 226
insertions in the reproducer. This is when the tree has a full root node
on a 64-bit build.
==================================================================
BUG: KASAN: double-free in mt_free_walk+0x138/0x3a0
Free of addr ffff0000f3d40000 by task swapper/2/0
[...]
Call trace:
[...]
kmem_cache_free_bulk+0x5b8/0xc18
mt_free_walk+0x138/0x3a0
rcu_core+0x5d0/0x1638
rcu_core_si+0x18/0x30
[...]
Allocated by task 1218:
[...]
kmem_cache_alloc_from_sheaf_noprof+0xa8/0x2f0
dst_setup+0x210/0x630
mas_wr_split+0x568/0x26e0
mas_wr_store_entry+0x98c/0x1de0
mas_insert.isra.0+0x3d0/0x5d8
mtree_insert_range+0xec/0x1c8
maple_fix_init+0x94/0xff8 [maple_fix_obj]
[...]
Freed by task 0:
[...]
__kasan_slab_free+0x88/0xb8
__rcu_free_sheaf_prepare+0x94/0x360
rcu_free_sheaf+0x30/0x138
rcu_core+0x5d0/0x1638
rcu_core_si+0x18/0x30
[...]
The buggy address belongs to the object at ffff0000f3d40000
which belongs to the cache maple_node of size 256
The buggy address is located 0 bytes inside of
256-byte region [ffff0000f3d40000, ffff0000f3d40100)
[...]
Memory state around the buggy address:
ffff0000f3d3ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000f3d3ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000f3d40000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000f3d40080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000f3d40100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
The second issue fixed in the first patch is in the mt_free_walk().
mt_free_walk() descends by checking if the corresponding slot[offset]
entry is non-zero. In a maple_range_64 node that has
MAPLE_RANGE64_SLOTS-1 valid pointers to child nodes, all slots will be
non-zero, since the last slot holds the metadata. Thus, mte_dead_walk()
dereferences the metadata as if it were a node and hits the
null-ptr-deref as shown in the splat below.
After fixing the first issue, the reproducer reaches this case at 3166
insertions. The affected node is the root on a tree with height 3 and it
has 15 valid child nodes on a 64-bit machine. The first fix does not
introduce this bug, but it exposes it for the root node because it no
longer clears the root metadata. On an unmodified kernel, the same bug
exists and is reachable when such a maple_range_64 node appears below
the root, where mt_clear_meta() is not called.
Second KASAN splat:
Unable to handle kernel paging request at virtual address dfff800000000006
KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037]
[...]
Call trace:
mte_dead_walk+0x78/0x140 (P)
mt_free_walk+0x1f8/0x3a0
rcu_core+0x5d0/0x1638
rcu_core_si+0x18/0x30
[..]
Both splats are from an arm64 QEMU guest. The test_maple_tree and the
userspace suite pass after each patch in the series.
This patch (of 2):
This commit fixes two issues in maple_range_64 nodes under RCU mode. A
maple_range_64 node repurposes its last slot to hold metadata whenever
the node is not full. Both issues arise from mishandling that last slot.
More specifically the two fixes are:
1. Remove mt_clear_meta() function. mt_clear_meta() decides whether the
last slot of a maple_range_64 node holds a child pointer or a
struct maple_metadata with the check
if (unlikely((mte_to_node(next) &&
mte_node_type(next))))
return; /* no metadata, could be node */
The check expects the pointer to be encoded. But the only callsite
of mt_clear_meta() is mt_destroy_walk() on the RCU destroy path, and
by the time it runs, mte_dead_leaves() has overwritten every slot on
a full node with a raw pointer, stripping the type information. Thus,
the check above never returns early for a full node as it should. It
falls through and then:
meta->gap = 0;
meta->end = 0;
zeroes two bytes of a valid child pointer. Later, mt_free_walk()
dereferences the corrupted pointer.
Fix this by removing mt_clear_meta() along with its only callsite.
mt_clear_meta() is only called for the root of each sub-tree destroyed
under RCU. Descendant nodes retain their metadata until they are
freed. RCU readers may use the metadata while traversing a node, but
do not use cleared metadata to detect that a node has been removed.
They detect a dead node via ma_dead_node().
2. Fix invalid memory access in mt_free_walk(). mt_free_walk() descends
to the left-most unvisited "parent-of-a-leaf" node by checking the
condition:
if ((offset < mt_slots[type]) &&
rcu_dereference_protected(slots[offset],
lock_is_held(&rcu_callback_map)))
slots = mte_dead_walk(&enode, offset);
On a maple_range_64 node with MAPLE_RANGE64_SLOTS-1 children *all*
slots are non-NULL. The first MAPLE_RANGE64_SLOTS-1 hold valid
pointers to child nodes, and the last slot contains metadata. The
above check therefore passes for all offsets, and mte_dead_walk()
dereferences the metadata as if it were a node.
To trigger this, a node at least two levels above the leaves has to
have exactly MAPLE_RANGE64_SLOTS-1 valid pointers to other nodes.
maple_arange_64 nodes cannot hit this since they store the metadata
in a separate field.
Fix this by bounding the descent with slot_len which holds the number
of children of a dead node.
Link: https://lore.kernel.org/20261005-fix-maple-tree-range64-rcu-v3-0-ebe7fb278e20@cslab.ece.ntua.gr
Link: https://lore.kernel.org/20261005-fix-maple-tree-range64-rcu-v3-1-ebe7fb278e20@cslab.ece.ntua.gr
Fixes: 54a611b60590 ("Maple Tree: add new data structure")
Fixes: 2e5b4921f8ef ("maple_tree: fix freeing of nodes in rcu mode")
Signed-off-by: Dimitris Charisis <dchar@cslab.ece.ntua.gr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Liam R. Howlett (Google) <liam@infradead.org>
Reviewed-by: Florian Schmaus <florian.schmaus@codasip.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Andrew Ballance <andrewjballance@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
[ sashal: Kept the tree's existing mt_free_rcu(&node->rcu) in mt_destroy_walk() instead of kfree(node), and deleted mt_clear_meta() along with its two extra kerneldoc lines. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/maple_tree.c | 45 +--------------------------------------------
1 file changed, 1 insertion(+), 44 deletions(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index e440ffd0e9996..db30cf319a4ac 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -901,45 +901,6 @@ static inline void ma_set_meta(struct maple_node *mn, enum maple_type mt,
meta->end = end;
}
-/*
- * mt_clear_meta() - clear the metadata information of a node, if it exists
- * @mt: The maple tree
- * @mn: The maple node
- * @type: The maple node type
- * @offset: The offset of the highest sub-gap in this node.
- * @end: The end of the data in this node.
- */
-static inline void mt_clear_meta(struct maple_tree *mt, struct maple_node *mn,
- enum maple_type type)
-{
- struct maple_metadata *meta;
- unsigned long *pivots;
- void __rcu **slots;
- void *next;
-
- switch (type) {
- case maple_range_64:
- pivots = mn->mr64.pivot;
- if (unlikely(pivots[MAPLE_RANGE64_SLOTS - 2])) {
- slots = mn->mr64.slot;
- next = mt_slot_locked(mt, slots,
- MAPLE_RANGE64_SLOTS - 1);
- if (unlikely((mte_to_node(next) &&
- mte_node_type(next))))
- return; /* no metadata, could be node */
- }
- fallthrough;
- case maple_arange_64:
- meta = ma_meta(mn, type);
- break;
- default:
- return;
- }
-
- meta->gap = 0;
- meta->end = 0;
-}
-
/*
* ma_meta_end() - Get the data end of a node from the metadata
* @mn: The maple node
@@ -5220,9 +5181,7 @@ static void mt_free_walk(struct rcu_head *head)
type = mte_node_type(enode);
slots = ma_slots(mte_to_node(enode), type);
- if ((offset < mt_slots[type]) &&
- rcu_dereference_protected(slots[offset],
- lock_is_held(&rcu_callback_map)))
+ if (offset < mte_to_node(enode)->slot_len)
slots = mte_dead_walk(&enode, offset);
node = mte_to_node(enode);
} while ((node != start) || (node->slot_len < offset));
@@ -5316,8 +5275,6 @@ static void mt_destroy_walk(struct maple_enode *enode, struct maple_tree *mt,
free_leaf:
if (free)
mt_free_rcu(&node->rcu);
- else
- mt_clear_meta(mt, node, node->type);
}
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0461/1167] ALSA: ump: Drain sequencer callbacks before freeing their client
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (454 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0460/1167] maple_tree: fix maple_range_64 crashes in RCU mode Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0462/1167] ceph: wait for pending fscache write in write_folio_nounlock() Greg Kroah-Hartman
` (201 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cen Zhang, Takashi Iwai, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit 9b30046de03acb3b3f2135d45af6be7ee0b565b6 ]
seq_ump_client_free() cancels group_notify_work while the endpoint still
publishes seq_ops and seq_client. A received Function Block update can
enter the sequencer callback after cancellation and queue the work again.
Even disabling the work cannot protect a callback that already loaded
seq_client and then resumes after the client has been freed.
A USB UMP endpoint can continue receiving while its sequencer binding
is removed. The following order uses the same endpoint and client:
Sequencer binding removal UMP input completion
------------------------- --------------------
cancel_work_sync()
load seq_ops and seq_client
delete sequencer client
clear endpoint binding
kfree(client)
schedule group_notify_work
read client->seq_client
Cover all calls through seq_ops with SRCU in the UMP core. Withdraw the
operations pointer and wait for those callbacks before canceling work
and deleting the client. No producer can then queue work after the final
cancellation, and both the client and callback code remain available
until the last in-flight callback returns.
Publish seq_ops with release/acquire ordering so the separately stored
seq_client is initialized before any callback uses it. Use SRCU because
sequencer notification delivery can sleep; no callback needs to change
its existing execution context or allocation behavior.
Fixes: 4a16a3af0571 ("ALSA: seq: ump: Handle FB info update")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Link: https://patch.msgid.link/pm-pmb-00625126b81966d1bf1d-v2-915f6bbabe1fd458c3ab@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Dropped the hunk that rewrote seq_notify_ep_change() and choose_default_protocol() to use the SRCU guard, since those functions don't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/sound/ump.h | 5 ++++
sound/core/seq/seq_ump_client.c | 5 ++--
sound/core/ump.c | 51 +++++++++++++++++++++++++++++----
3 files changed, 53 insertions(+), 8 deletions(-)
diff --git a/include/sound/ump.h b/include/sound/ump.h
index e380d86a51294..e0b5483b8a0bd 100644
--- a/include/sound/ump.h
+++ b/include/sound/ump.h
@@ -65,6 +65,7 @@ struct snd_ump_endpoint {
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
struct snd_seq_device *seq_dev;
+ /* Published after seq_client; calls are covered by UMP core SRCU. */
const struct snd_seq_ump_ops *seq_ops;
void *seq_client;
#endif
@@ -124,6 +125,10 @@ int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val);
int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol);
void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump);
+#if IS_ENABLED(CONFIG_SND_SEQUENCER)
+void snd_ump_detach_seq(struct snd_ump_endpoint *ump);
+#endif
+
/*
* Some definitions for UMP
*/
diff --git a/sound/core/seq/seq_ump_client.c b/sound/core/seq/seq_ump_client.c
index 914837929686f..b0f5accfa4e0c 100644
--- a/sound/core/seq/seq_ump_client.c
+++ b/sound/core/seq/seq_ump_client.c
@@ -344,12 +344,12 @@ static int create_ump_endpoint_port(struct seq_ump_client *client)
/* release the client resources */
static void seq_ump_client_free(struct seq_ump_client *client)
{
+ snd_ump_detach_seq(client->ump);
cancel_work_sync(&client->group_notify_work);
if (client->seq_client >= 0)
snd_seq_delete_kernel_client(client->seq_client);
- client->ump->seq_ops = NULL;
client->ump->seq_client = NULL;
kfree(client);
@@ -480,7 +480,8 @@ static int snd_seq_ump_probe(struct device *_dev)
snd_seq_kernel_client_put(cptr);
ump->seq_client = client;
- ump->seq_ops = &seq_ump_ops;
+ /* Publish the initialized client before callbacks can observe seq_ops. */
+ smp_store_release(&ump->seq_ops, &seq_ump_ops);
return 0;
error:
diff --git a/sound/core/ump.c b/sound/core/ump.c
index 14085bbb16034..7baa20d55e0fa 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <linux/export.h>
#include <linux/mm.h>
+#include <linux/srcu.h>
#include <sound/core.h>
#include <sound/rawmidi.h>
#include <sound/ump.h>
@@ -18,6 +19,31 @@
#define ump_info(ump, fmt, args...) dev_info((ump)->core.dev, fmt, ##args)
#define ump_dbg(ump, fmt, args...) dev_dbg((ump)->core.dev, fmt, ##args)
+#if IS_ENABLED(CONFIG_SND_SEQUENCER)
+DEFINE_STATIC_SRCU(ump_seq_srcu);
+
+static const struct snd_seq_ump_ops *seq_ops_load(struct snd_ump_endpoint *ump)
+{
+ /* Pair with publication after seq_client has been initialized. */
+ return smp_load_acquire(&ump->seq_ops);
+}
+
+/**
+ * snd_ump_detach_seq - stop callbacks to a sequencer binding
+ * @ump: UMP endpoint
+ *
+ * Withdraw the binding and wait for all callbacks already in progress.
+ * The caller can then drain binding work and free the sequencer client.
+ * Must not be called from one of the binding callbacks.
+ */
+void snd_ump_detach_seq(struct snd_ump_endpoint *ump)
+{
+ WRITE_ONCE(ump->seq_ops, NULL);
+ synchronize_srcu(&ump_seq_srcu);
+}
+EXPORT_SYMBOL_GPL(snd_ump_detach_seq);
+#endif
+
static int snd_ump_dev_register(struct snd_rawmidi *rmidi);
static int snd_ump_dev_unregister(struct snd_rawmidi *rmidi);
static long snd_ump_ioctl(struct snd_rawmidi *rmidi, unsigned int cmd,
@@ -348,8 +374,13 @@ int snd_ump_receive(struct snd_ump_endpoint *ump, const u32 *buffer, int count)
continue;
ump_handle_stream_msg(ump, ump->input_buf, n);
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
- if (ump->seq_ops)
- ump->seq_ops->input_receive(ump, ump->input_buf, n);
+ scoped_guard(srcu, &ump_seq_srcu) {
+ const struct snd_seq_ump_ops *ops;
+
+ ops = seq_ops_load(ump);
+ if (ops)
+ ops->input_receive(ump, ump->input_buf, n);
+ }
#endif
process_legacy_input(ump, ump->input_buf, n);
}
@@ -769,8 +800,12 @@ static int ump_handle_product_id_msg(struct snd_ump_endpoint *ump,
static void seq_notify_protocol(struct snd_ump_endpoint *ump)
{
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
- if (ump->seq_ops && ump->seq_ops->switch_protocol)
- ump->seq_ops->switch_protocol(ump);
+ const struct snd_seq_ump_ops *ops;
+
+ guard(srcu)(&ump_seq_srcu);
+ ops = seq_ops_load(ump);
+ if (ops && ops->switch_protocol)
+ ops->switch_protocol(ump);
#endif /* CONFIG_SND_SEQUENCER */
}
@@ -865,8 +900,12 @@ static void seq_notify_fb_change(struct snd_ump_endpoint *ump,
struct snd_ump_block *fb)
{
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
- if (ump->seq_ops && ump->seq_ops->notify_fb_change)
- ump->seq_ops->notify_fb_change(ump, fb);
+ const struct snd_seq_ump_ops *ops;
+
+ guard(srcu)(&ump_seq_srcu);
+ ops = seq_ops_load(ump);
+ if (ops && ops->notify_fb_change)
+ ops->notify_fb_change(ump, fb);
#endif
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0462/1167] ceph: wait for pending fscache write in write_folio_nounlock()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (455 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0461/1167] ALSA: ump: Drain sequencer callbacks before freeing their client Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0463/1167] ceph: fix writeback_count leak when a bounce page allocation fails Greg Kroah-Hartman
` (200 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tal Zussman, Alex Markuze,
Ilya Dryomov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tal Zussman <tz2294@columbia.edu>
[ Upstream commit 3f7655f0d9186656c6f1cbc012a39c866d4aaabf ]
write_folio_nounlock() marks the folio with PG_private_2 via
ceph_set_page_fscache() and starts an async write to the cache via
ceph_fscache_write_to_cache(). PG_private_2 is only cleared once that
write completes.
If the OSD write fails, the error paths return without waiting for the
cache write. On retry, ceph_find_incompatible() would wait for
writeback, but not for PG_private_2, before calling
write_folio_nounlock() again, which would trip the VM_BUG_ON_FOLIO() in
folio_start_private_2().
Wait for any pending cache write before starting writeback on the
folio. Do so before bumping the writeback congestion count and
allocating the possibly mempool-backed OSD request, so that a thread
sleeping on the cache I/O does not hold either while it waits.
Add ceph_folio_wait_fscache(), a wrapper for folio_wait_private_2(), and
use it.
Fixes: 1702e7973410 ("ceph: add fscache writeback support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260804-remove-wait-on-page-writeback-v2-0-81f0ab065284%40columbia.edu?part=7
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
[ sashal: Kept this tree's three-argument ceph_fscache_write_terminated() signature as context and applied the wait call in writepage_nounlock(), which is the older name for write_folio_nounlock(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ceph/addr.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 4957a40777821..63a4e6ffc8a76 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -543,6 +543,11 @@ static void ceph_set_page_fscache(struct page *page)
set_page_fscache(page);
}
+static void ceph_folio_wait_fscache(struct folio *folio)
+{
+ folio_wait_private_2(folio); /* [DEPRECATED] */
+}
+
static void ceph_fscache_write_terminated(void *priv, ssize_t error, bool was_async)
{
struct inode *inode = priv;
@@ -564,6 +569,10 @@ static inline void ceph_set_page_fscache(struct page *page)
{
}
+static inline void ceph_folio_wait_fscache(struct folio *folio)
+{
+}
+
static inline void ceph_fscache_write_to_cache(struct inode *inode, u64 off, u64 len, bool caching)
{
}
@@ -737,6 +746,9 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
ceph_vinop(inode), page, page->index, page_off, wlen, snapc,
snapc->seq);
+ /* wait for a cache write left pending by a previously failed attempt */
+ ceph_folio_wait_fscache(folio);
+
if (atomic_long_inc_return(&fsc->writeback_count) >
CONGESTION_ON_THRESH(fsc->mount_options->congestion_kb))
fsc->write_congested = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0463/1167] ceph: fix writeback_count leak when a bounce page allocation fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (456 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0462/1167] ceph: wait for pending fscache write in write_folio_nounlock() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0464/1167] net: lan966x: dont disable hardirqs in fdma tx clear path Greg Kroah-Hartman
` (199 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tal Zussman, Alex Markuze,
Ilya Dryomov, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tal Zussman <tz2294@columbia.edu>
[ Upstream commit 7807710d88ad03e7ca9b5f79f518f040db2a4e09 ]
ceph_process_folio_batch() calls is_write_congestion_happened(), which
increments fsc->writeback_count, before calling
move_dirty_folio_in_page_array(). If the fscrypt bounce page allocation
there fails, the folio is redirtied and never makes it into the page
array, but the count is never dropped.
write_congested is only cleared when a decrement falls below
CONGESTION_OFF_THRESH, so the leaked counts set congestion early and
eventually leave write_congested set for good. Every WB_SYNC_NONE
writeback then returns 0 and background writeback stops entirely.
Bump the count only once the folio is in the page array.
Fixes: d55207717ded ("ceph: add encryption support to writepage and writepages")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260902-remove-wait-on-page-writeback-v5-0-0b512e77e75b%40columbia.edu?part=1
Assisted-by: Claude:fable-5.1
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
[ sashal: Applied to ceph_writepages_start(), where this tree's page-array loop bumps the congestion count before the fscrypt bounce page allocation, rather than to ceph_process_folio_batch(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ceph/addr.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 63a4e6ffc8a76..24d3951b3646f 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1171,11 +1171,6 @@ static int ceph_writepages_start(struct address_space *mapping,
doutc(cl, "%llx.%llx will write page %p idx %lu\n",
ceph_vinop(inode), page, page->index);
- if (atomic_long_inc_return(&fsc->writeback_count) >
- CONGESTION_ON_THRESH(
- fsc->mount_options->congestion_kb))
- fsc->write_congested = true;
-
if (IS_ENCRYPTED(inode)) {
pages[locked_pages] =
fscrypt_encrypt_pagecache_blocks(page,
@@ -1202,6 +1197,11 @@ static int ceph_writepages_start(struct address_space *mapping,
pages[locked_pages++] = page;
}
+ if (atomic_long_inc_return(&fsc->writeback_count) >
+ CONGESTION_ON_THRESH(
+ fsc->mount_options->congestion_kb))
+ fsc->write_congested = true;
+
fbatch.folios[i] = NULL;
len += thp_size(page);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0464/1167] net: lan966x: dont disable hardirqs in fdma tx clear path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (457 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0463/1167] ceph: fix writeback_count leak when a bounce page allocation fails Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0465/1167] tls: keep TX and RX hardware offload on the same device Greg Kroah-Hartman
` (198 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Machon, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Machon <daniel.machon@microchip.com>
[ Upstream commit b2e17432e7ee75997657f99862eb83be0c78a6c1 ]
lan966x_fdma_tx_clear_buf() runs from the NAPI poll and frees the
buffers of completed tx DCBs with napi_consume_skb(),
page_pool_recycle_direct() and xdp_return_frame_bulk(), under
lan966x->tx_lock.
Before this patch, the lock is taken with spin_lock_irqsave(), so the
buffers are freed with hardirqs disabled. RX skbs are marked for
page_pool recycling, so when such an skb is forwarded back out and its
tx completion frees it here, the free path reaches __page_pool_put_page(),
which warns via lockdep_assert_no_hardirq().
Take tx_lock with a plain spin_lock(), as the other tx_lock users,
lan966x_port_xmit() and lan966x_fdma_xmit_xdpf(), already do.
tx_clear_buf() runs from the NAPI poll, so disabling hardirqs there is
not needed.
Found with lockdep enabled (CONFIG_PROVE_LOCKING), which the assert
depends on. Reproduced on a lan9668 board by redirecting received frames
out of another port with tc mirred.
Fixes: 11871aba1974 ("net: lan96x: Use page_pool API")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261026-lan966x-fdma-tx-clear-hardirq-v1-1-5f70f026a2e4@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Replaced spin_lock_irqsave()/spin_unlock_irqrestore() with plain spin_lock()/spin_unlock() in lan966x_fdma_tx_clear_buf(), keeping this tree's older struct lan966x_db declaration and FDMA_DCB_MAX loop bound. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
index 4bebf0c91f30b..3590b99a794ed 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
@@ -399,13 +399,12 @@ static void lan966x_fdma_tx_clear_buf(struct lan966x *lan966x, int weight)
struct lan966x_tx_dcb_buf *dcb_buf;
struct xdp_frame_bulk bq;
struct lan966x_db *db;
- unsigned long flags;
bool clear = false;
int i;
xdp_frame_bulk_init(&bq);
- spin_lock_irqsave(&lan966x->tx_lock, flags);
+ spin_lock(&lan966x->tx_lock);
for (i = 0; i < FDMA_DCB_MAX; ++i) {
dcb_buf = &tx->dcbs_buf[i];
@@ -456,7 +455,7 @@ static void lan966x_fdma_tx_clear_buf(struct lan966x *lan966x, int weight)
if (clear)
lan966x_fdma_wakeup_netdev(lan966x);
- spin_unlock_irqrestore(&lan966x->tx_lock, flags);
+ spin_unlock(&lan966x->tx_lock);
}
static bool lan966x_fdma_rx_more_frames(struct lan966x_rx *rx)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0465/1167] tls: keep TX and RX hardware offload on the same device
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (458 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0464/1167] net: lan966x: dont disable hardirqs in fdma tx clear path Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0466/1167] ksmbd: return complete and aligned stream information Greg Kroah-Hartman
` (197 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rishikesh Jethwani, Dave Miller,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rishikesh Jethwani <rjethwani@purestorage.com>
[ Upstream commit 1c8a70075235cd733095532a97f2405037c52a7b ]
After TX is offloaded on device A, a route change, or a change in the
usable-slave set of an 802.3ad or balance-xor (layer3+4) bond, can make
RX setup program device B. tls_device_attach() sees the existing TLS
destructor and keeps ctx->netdev pointing at A. The RX driver state on B
is then untracked: tls_dev_resync() and tls_dev_del() are invoked on A
for a context it never created, and neither socket close nor
NETDEV_DOWN on B calls tls_dev_del() for B, so the driver context leaks.
The reverse setup order has the same problem.
Check the shared device binding under device_offload_lock before each
tls_dev_add(). Permit the first attachment and a second direction on the
same device. Reject a different device, including when the old binding
was cleared by NETDEV_DOWN: the TLS destructor remains installed and
tls_device_attach() cannot establish a new binding. Setup then falls
back to software for the requested direction.
The RX check precedes allocation and software setup. TX uses its existing
resource unwind path without calling the driver. Document the shared
binding and clarify that fallback is per direction.
This issue was discovered during code review and subsequently
reproduced on hardware using mlx5 and TLS 1.2 AES-GCM-128.
Changing the route between TX and RX setup installed the second
direction on a different device. Driver traces showed successful adds
on both devices, but both deletes at socket close targeted the first
device, leaving an orphaned context on the second. Both setup orders
reproduced the leak, even though all current core TLS context counters
returned to zero. No crash was observed.
With the fix, the same tests correctly fall back to software for the
second direction and leave no orphaned hardware context.
Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload")
Signed-off-by: Rishikesh Jethwani <rjethwani@purestorage.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
[ sashal: Kept the older kzalloc(TLS_OFFLOAD_CONTEXT_SIZE_RX, GFP_KERNEL) allocation as context instead of kzalloc_obj(*context), and inserted the tls_device_can_attach() check before it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/networking/tls-offload.rst | 16 ++++++++++------
net/tls/tls_device.c | 24 ++++++++++++++++++++++++
2 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/Documentation/networking/tls-offload.rst b/Documentation/networking/tls-offload.rst
index 5f0dea3d571e3..371cbd2824c65 100644
--- a/Documentation/networking/tls-offload.rst
+++ b/Documentation/networking/tls-offload.rst
@@ -76,12 +76,16 @@ During driver initialization device sets the ``NETIF_F_HW_TLS_RX`` and
pointer in the :c:member:`tlsdev_ops` member of the
:c:type:`struct net_device <net_device>`.
-When TLS cryptographic connection state is installed on a ``ktls`` socket
-(note that it is done twice, once for RX and once for TX direction,
-and the two are completely independent), the kernel checks if the underlying
-network device is offload-capable and attempts the offload. In case offload
-fails the connection is handled entirely in software using the same mechanism
-as if the offload was never tried.
+TLS cryptographic connection state is installed separately for RX and TX
+on a ``ktls`` socket. For each direction, the kernel checks if the underlying
+network device is offload-capable and attempts the offload. If offload fails,
+that direction is handled in software as if offload had never been tried.
+
+Both hardware directions share one device binding. Once one direction is
+offloaded, the other direction must use the same device. If a route change
+selects a different device, or ``NETDEV_DOWN`` has cleared the binding,
+hardware offload of the other direction is declined and it uses software
+instead.
Offload request is performed via the :c:member:`tls_dev_add` callback of
:c:type:`struct tlsdev_ops <tlsdev_ops>`:
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index ea4f19d09b832..108bc3566f575 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -1042,6 +1042,20 @@ int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx)
return tls_device_reencrypt(sk, tls_ctx);
}
+/* Both directions share ctx->netdev. A second direction must use that
+ * device; after NETDEV_DOWN clears it, no new direction can be offloaded.
+ */
+static bool tls_device_can_attach(struct tls_context *ctx, struct sock *sk,
+ struct net_device *netdev)
+{
+ struct net_device *ctx_netdev;
+
+ ctx_netdev = rcu_dereference_protected(ctx->netdev,
+ lockdep_is_held(&device_offload_lock));
+ return sk->sk_destruct != tls_device_sk_destruct ||
+ ctx_netdev == netdev;
+}
+
static void tls_device_attach(struct tls_context *ctx, struct sock *sk,
struct net_device *netdev)
{
@@ -1184,6 +1198,11 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx)
goto release_lock;
}
+ if (!tls_device_can_attach(ctx, sk, netdev)) {
+ rc = -EOPNOTSUPP;
+ goto release_lock;
+ }
+
ctx->priv_ctx_tx = offload_ctx;
rc = netdev->tlsdev_ops->tls_dev_add(netdev, sk, TLS_OFFLOAD_CTX_DIR_TX,
&ctx->crypto_send.info,
@@ -1258,6 +1277,11 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx)
goto release_lock;
}
+ if (!tls_device_can_attach(ctx, sk, netdev)) {
+ rc = -EOPNOTSUPP;
+ goto release_lock;
+ }
+
context = kzalloc(TLS_OFFLOAD_CONTEXT_SIZE_RX, GFP_KERNEL);
if (!context) {
rc = -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0466/1167] ksmbd: return complete and aligned stream information
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (459 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0465/1167] tls: keep TX and RX hardware offload on the same device Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0467/1167] nfp: flower: fix use-after-free in neighbour update work Greg Kroah-Hartman
` (196 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 206fc30f71b005156085fd8523ccc84a2c67791b ]
FILE_STREAM_INFORMATION responses are assembled without aligning entries
and truncated to the client buffer length after the fact. A short query
can therefore return STATUS_BUFFER_OVERFLOW with an incomplete entry and
a nonzero NextEntryOffset, which clients may reject as an invalid
network response. Standalone queries can also exhaust the server
response buffer and silently omit streams while reporting success.
Allocate the same large response buffer used by other variable-length
QUERY_INFO classes for stream queries. Pack only complete entries within
the requested output length and available response space, aligning each
entry to eight bytes and sizing names after UTF-16 conversion. Return
STATUS_BUFFER_OVERFLOW when more entries remain, using an SMB2 error
response if no entry fits.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Fixes: 6b8b79226bc3 ("ksmbd: fix partial file information responses")
Link: https://github.com/namjaejeon/ksmbd/issues/522#issuecomment-6391152923
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Replaced KSMBD_DEFAULT_GFP with GFP_KERNEL, and kept the existing large-buffer condition by adding only the stream-info clause since the normalized-name clause is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 183 +++++++++++++++++++++++++---------------
1 file changed, 115 insertions(+), 68 deletions(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 727b0bca9743f..f35ce9f7c322b 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -554,7 +554,8 @@ int smb2_allocate_rsp_buf(struct ksmbd_work *work)
req = smb_get_msg(work->request_buf);
if ((req->InfoType == SMB2_O_INFO_FILE &&
(req->FileInfoClass == FILE_FULL_EA_INFORMATION ||
- req->FileInfoClass == FILE_ALL_INFORMATION)) ||
+ req->FileInfoClass == FILE_ALL_INFORMATION ||
+ req->FileInfoClass == FILE_STREAM_INFORMATION)) ||
req->InfoType == SMB2_O_INFO_SECURITY)
sz = large_sz;
}
@@ -5197,41 +5198,107 @@ static void get_file_alternate_info(struct ksmbd_work *work,
cpu_to_le32(sizeof(struct smb2_file_alt_name_info) + conv_len);
}
+struct smb2_stream_info_buffer {
+ struct smb2_query_info_rsp *rsp;
+ struct smb2_file_stream_info *last;
+ const struct nls_table *local_nls;
+ unsigned int length;
+ unsigned int capacity;
+};
+
+static int smb2_add_stream_info(struct smb2_stream_info_buffer *buf,
+ const char *name, loff_t size, u64 allocation_size)
+{
+ struct smb2_file_stream_info *file_info;
+ __le16 *utf16_name;
+ size_t name_len = strlen(name);
+ unsigned int offset = ALIGN(buf->length, 8), name_bytes;
+ int conv_len, ret = 0;
+
+ if (offset > buf->capacity ||
+ buf->capacity - offset < sizeof(*file_info))
+ return -ENOSPC;
+
+ utf16_name = kmalloc_array(name_len + 1, sizeof(*utf16_name),
+ GFP_KERNEL);
+ if (!utf16_name)
+ return -ENOMEM;
+
+ conv_len = smbConvertToUTF16(utf16_name, name, name_len,
+ buf->local_nls, 0);
+ if (conv_len < 0) {
+ ret = conv_len;
+ goto out;
+ }
+
+ name_bytes = conv_len * sizeof(*utf16_name);
+ if (name_bytes > buf->capacity - offset - sizeof(*file_info)) {
+ ret = -ENOSPC;
+ goto out;
+ }
+
+ file_info = (struct smb2_file_stream_info *)&buf->rsp->Buffer[offset];
+ if (buf->last) {
+ memset(&buf->rsp->Buffer[buf->length], 0, offset - buf->length);
+ buf->last->NextEntryOffset =
+ cpu_to_le32((char *)file_info - (char *)buf->last);
+ }
+ file_info->NextEntryOffset = 0;
+ file_info->StreamNameLength = cpu_to_le32(name_bytes);
+ file_info->StreamSize = cpu_to_le64(size);
+ file_info->StreamAllocationSize = cpu_to_le64(allocation_size);
+ memcpy(file_info->StreamName, utf16_name, name_bytes);
+
+ buf->last = file_info;
+ buf->length = offset + sizeof(*file_info) + name_bytes;
+out:
+ kfree(utf16_name);
+ return ret;
+}
+
static int get_file_stream_info(struct ksmbd_work *work,
+ struct smb2_query_info_req *req,
struct smb2_query_info_rsp *rsp,
- struct ksmbd_file *fp,
- void *rsp_org)
+ struct ksmbd_file *fp)
{
- struct ksmbd_conn *conn = work->conn;
- struct smb2_file_stream_info *file_info;
+ struct smb2_stream_info_buffer buf = {
+ .rsp = rsp,
+ .local_nls = work->conn->local_nls,
+ };
char *stream_name, *xattr_list = NULL, *stream_buf;
struct kstat stat;
const struct path *path = &fp->filp->f_path;
ssize_t xattr_list_len;
ssize_t slen;
loff_t ssize;
- int nbytes = 0, streamlen, stream_name_len, next, idx = 0;
+ unsigned int req_output_len = le32_to_cpu(req->OutputBufferLength);
+ int streamlen, idx = 0;
int buf_free_len;
int ret;
+ if (req_output_len < FILE_STREAM_INFORMATION_SIZE) {
+ rsp->hdr.Status = STATUS_INFO_LENGTH_MISMATCH;
+ return -EINVAL;
+ }
+
+ buf_free_len = smb2_calc_max_out_buf_len(work,
+ offsetof(struct smb2_query_info_rsp, Buffer),
+ req_output_len);
+ if (buf_free_len < 0)
+ return buf_free_len;
+ buf.capacity = buf_free_len;
+
ret = vfs_getattr(&fp->filp->f_path, &stat, STATX_BASIC_STATS,
AT_STATX_SYNC_AS_STAT);
if (ret)
return ret;
- file_info = (struct smb2_file_stream_info *)rsp->Buffer;
-
- buf_free_len = smb2_resp_buf_len(work,
- offsetof(struct smb2_query_info_rsp, Buffer));
- if (buf_free_len < 0)
- goto out;
-
xattr_list_len = ksmbd_vfs_listxattr(path->dentry, &xattr_list);
if (xattr_list_len < 0) {
- goto out;
+ goto default_stream;
} else if (!xattr_list_len) {
ksmbd_debug(SMB, "empty xattr in the file\n");
- goto out;
+ goto default_stream;
}
while (idx < xattr_list_len) {
@@ -5241,69 +5308,49 @@ static int get_file_stream_info(struct ksmbd_work *work,
ksmbd_debug(SMB, "%s, len %d\n", stream_name, streamlen);
- if (strncmp(&stream_name[XATTR_USER_PREFIX_LEN],
- STREAM_PREFIX, STREAM_PREFIX_LEN))
+ if (strncmp(stream_name, XATTR_NAME_STREAM,
+ XATTR_NAME_STREAM_LEN))
continue;
- stream_name_len = streamlen - (XATTR_USER_PREFIX_LEN +
- STREAM_PREFIX_LEN);
- streamlen = stream_name_len;
-
- /* plus : size */
- streamlen += 1;
- stream_buf = kmalloc(streamlen + 1, GFP_KERNEL);
- if (!stream_buf)
- break;
-
- streamlen = snprintf(stream_buf, streamlen + 1,
- ":%s", &stream_name[XATTR_NAME_STREAM_LEN]);
-
- next = sizeof(struct smb2_file_stream_info) + streamlen * 2;
- /* smbConvertToUTF16() also writes a terminating UTF-16 unit. */
- if (next + sizeof(__le16) > buf_free_len) {
- kfree(stream_buf);
- break;
+ stream_buf = kasprintf(GFP_KERNEL, ":%s",
+ &stream_name[XATTR_NAME_STREAM_LEN]);
+ if (!stream_buf) {
+ ret = -ENOMEM;
+ goto out;
}
-
- file_info = (struct smb2_file_stream_info *)&rsp->Buffer[nbytes];
- streamlen = smbConvertToUTF16((__le16 *)file_info->StreamName,
- stream_buf, streamlen,
- conn->local_nls, 0);
- streamlen *= 2;
- kfree(stream_buf);
- file_info->StreamNameLength = cpu_to_le32(streamlen);
slen = ksmbd_vfs_xattr_len(file_mnt_idmap(fp->filp),
path->dentry, stream_name);
ssize = slen < 0 ? 0 : (loff_t)slen;
- file_info->StreamSize = cpu_to_le64(ssize);
- file_info->StreamAllocationSize = cpu_to_le64(ssize);
+ ret = smb2_add_stream_info(&buf, stream_buf, ssize, ssize);
+ kfree(stream_buf);
+ if (ret == -ENOSPC)
+ goto overflow;
+ if (ret)
+ goto out;
+ }
- nbytes += next;
- buf_free_len -= next;
- file_info->NextEntryOffset = cpu_to_le32(next);
+default_stream:
+ if (!S_ISDIR(stat.mode)) {
+ ret = smb2_add_stream_info(&buf, "::$DATA", stat.size,
+ stat.blocks << 9);
+ if (ret == -ENOSPC)
+ goto overflow;
+ if (ret)
+ goto out;
}
+ ret = 0;
+ goto out;
+
+overflow:
+ rsp->hdr.Status = STATUS_BUFFER_OVERFLOW;
+ /* An empty overflow needs an SMB2 error response. */
+ ret = buf.length ? 0 : -EOVERFLOW;
out:
- if (!S_ISDIR(stat.mode) &&
- buf_free_len >= sizeof(struct smb2_file_stream_info) + (7 + 1) * 2) {
- file_info = (struct smb2_file_stream_info *)
- &rsp->Buffer[nbytes];
- streamlen = smbConvertToUTF16((__le16 *)file_info->StreamName,
- "::$DATA", 7, conn->local_nls, 0);
- streamlen *= 2;
- file_info->StreamNameLength = cpu_to_le32(streamlen);
- file_info->StreamSize = cpu_to_le64(stat.size);
- file_info->StreamAllocationSize = cpu_to_le64(stat.blocks << 9);
- nbytes += sizeof(struct smb2_file_stream_info) + streamlen;
- }
-
- /* last entry offset should be 0 */
- file_info->NextEntryOffset = 0;
+ if (!ret)
+ rsp->OutputBufferLength = cpu_to_le32(buf.length);
kvfree(xattr_list);
-
- rsp->OutputBufferLength = cpu_to_le32(nbytes);
-
- return 0;
+ return ret;
}
static int get_file_internal_info(struct smb2_query_info_rsp *rsp,
@@ -5578,7 +5625,7 @@ static int smb2_get_info_file(struct ksmbd_work *work,
break;
case FILE_STREAM_INFORMATION:
- rc = get_file_stream_info(work, rsp, fp, work->response_buf);
+ rc = get_file_stream_info(work, req, rsp, fp);
break;
case FILE_INTERNAL_INFORMATION:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0467/1167] nfp: flower: fix use-after-free in neighbour update work
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (460 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0466/1167] ksmbd: return complete and aligned stream information Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0468/1167] blk-throttle: pass the I/O counts of a dead group on Greg Kroah-Hartman
` (195 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sicong Huang, Daniel Machon,
Dave Miller, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sicong Huang <congei42@163.com>
[ Upstream commit 083aaafd453c3fb14411519d6ada9a8917573fdb ]
The netevent notifier handles neighbour updates and redirects by
queuing nfp_tun_neigh_update() on system_highpri_wq. Each work item
holds a reference to the neighbour, but only stores a pointer to the
flower app.
During device removal, nfp_tunnel_config_stop() unregisters the
notifier. This waits for notifier callbacks to return, but does not
wait for the work they queued. The teardown then frees app->priv and
app without waiting for these work items. Flushing cmsg_work in
nfp_flower_clean() does not cover the neighbour update work.
A pending work item can therefore run after the app has been freed.
Its call to nfp_flower_get_port_id_from_netdev() can then access freed
memory while checking whether the neighbour's device can be offloaded.
Even notifications for unrelated devices can reach this check. The
same problem affects shutdown and probe error paths that tear down the
app after the netevent notifier has been registered.
One possible interleaving is shown below. The neighbour belongs to
another network device that remains registered.
CPU0 (remove) CPU1 (notifier / kworker)
nfp_tun_neigh_event_handler()
queue_work(system_highpri_wq, ...)
return
/* Work has not run yet. */
nfp_tunnel_config_stop()
unregister_netevent_notifier()
/* Notifier callbacks have finished, but work may be pending. */
nfp_flower_clean()
vfree(app->priv)
app->priv = NULL
nfp_app_free()
kfree(app)
nfp_tun_neigh_update()
app = update_work->app
nfp_flower_get_port_id_from_netdev()
app->priv /* use-after-free */
The work items are allocated per event and free themselves, so they
cannot be cancelled individually, and flushing system_highpri_wq is
not allowed. Use a dedicated workqueue for neighbour updates instead.
In nfp_tunnel_config_stop(), unregister the notifier and destroy the
workqueue before cleaning up the tunnel state. This prevents new work
from being queued and waits for pending and running work to finish
while the app and its resources are still valid.
Found by code inspection.
Fixes: 0ad722bd9ee3 ("nfp: flower: fix for take a mutex lock in soft irq context and rcu lock")
Signed-off-by: Sicong Huang <congei42@163.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
[ sashal: Removed | WQ_PERCPU from the alloc_workqueue() call because that flag doesn't exist in this tree, and per-CPU is already the default. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/netronome/nfp/flower/main.h | 2 ++
.../netronome/nfp/flower/tunnel_conf.c | 24 ++++++++++++++-----
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.h b/drivers/net/ethernet/netronome/nfp/flower/main.h
index 2b7c947ff4f2a..bd4399758ed4d 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/main.h
+++ b/drivers/net/ethernet/netronome/nfp/flower/main.h
@@ -94,6 +94,7 @@ struct nfp_fl_stats_id {
* @ipv6_off_lock: Lock for the IPv6 address list
* @mac_off_ids: IDA to manage id assignment for offloaded MACs
* @neigh_nb: Notifier to monitor neighbour state
+ * @neigh_wq: Workqueue for neighbour updates
*/
struct nfp_fl_tunnel_offloads {
struct rhashtable offloaded_macs;
@@ -103,6 +104,7 @@ struct nfp_fl_tunnel_offloads {
struct mutex ipv6_off_lock;
struct ida mac_off_ids;
struct notifier_block neigh_nb;
+ struct workqueue_struct *neigh_wq;
};
/**
diff --git a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c
index 0d7d138d6e0d7..14321a5f51bce 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c
@@ -742,7 +742,7 @@ nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event,
if (!update_work)
return NOTIFY_DONE;
- queue_work(system_highpri_wq, &update_work->work);
+ queue_work(app_priv->tun.neigh_wq, &update_work->work);
return NOTIFY_DONE;
}
@@ -1516,6 +1516,13 @@ int nfp_tunnel_config_start(struct nfp_app *app)
if (err)
return err;
+ priv->tun.neigh_wq = alloc_workqueue("nfp-flower-neigh",
+ WQ_HIGHPRI, 0);
+ if (!priv->tun.neigh_wq) {
+ err = -ENOMEM;
+ goto err_free_macs;
+ }
+
ida_init(&priv->tun.mac_off_ids);
/* Initialise priv data for IPv4/v6 offloading. */
@@ -1528,13 +1535,17 @@ int nfp_tunnel_config_start(struct nfp_app *app)
priv->tun.neigh_nb.notifier_call = nfp_tun_neigh_event_handler;
err = register_netevent_notifier(&priv->tun.neigh_nb);
- if (err) {
- rhashtable_free_and_destroy(&priv->tun.offloaded_macs,
- nfp_check_rhashtable_empty, NULL);
- return err;
- }
+ if (err)
+ goto err_destroy_neigh_wq;
return 0;
+
+err_destroy_neigh_wq:
+ destroy_workqueue(priv->tun.neigh_wq);
+err_free_macs:
+ rhashtable_free_and_destroy(&priv->tun.offloaded_macs,
+ nfp_check_rhashtable_empty, NULL);
+ return err;
}
void nfp_tunnel_config_stop(struct nfp_app *app)
@@ -1544,6 +1555,7 @@ void nfp_tunnel_config_stop(struct nfp_app *app)
struct list_head *ptr, *storage;
unregister_netevent_notifier(&priv->tun.neigh_nb);
+ destroy_workqueue(priv->tun.neigh_wq);
ida_destroy(&priv->tun.mac_off_ids);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0468/1167] blk-throttle: pass the I/O counts of a dead group on
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (461 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0467/1167] nfp: flower: fix use-after-free in neighbour update work Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0469/1167] blk-throttle: make blkio.reset_stats reset I/O counts Greg Kroah-Hartman
` (194 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejun Heo, Josef Bacik, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 587edb931fdda032bcd63fdfb0db4ded75159ee9 ]
The recursive io_service_bytes and io_serviced files sum up the online
groups plus what dead descendants left in aux_cnt. That worked while the
counters lived in the blkg. Since commit 7ca464383aec they're in the
throtl_grp and nobody passes them up, so the files go backwards when a
child is removed. Add them to the parent in throtl_pd_offline().
Fixes: 7ca464383aec ("blk-throtl: stop using blkg->stat_bytes and ->stat_ios")
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://patch.msgid.link/20261028164415.1262013-26-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: added the parent-counter transfer to the existing throtl_pd_offline() instead, since this tree has no tg_flush_bios() or THROTL_TG_CANCELING handling for the upstream context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-throttle.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index a765db9fc46da..aee16769b3348 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -474,6 +474,7 @@ static void throtl_upgrade_state(struct throtl_data *td);
static void throtl_pd_offline(struct blkg_policy_data *pd)
{
struct throtl_grp *tg = pd_to_tg(pd);
+ struct throtl_grp *parent = blkg_to_tg(tg_to_blkg(tg)->parent);
tg->bps[READ][LIMIT_LOW] = 0;
tg->bps[WRITE][LIMIT_LOW] = 0;
@@ -484,6 +485,14 @@ static void throtl_pd_offline(struct blkg_policy_data *pd)
if (!tg->td->limit_valid[tg->td->limit_index])
throtl_upgrade_state(tg->td);
+
+ /* the recursive files of the ancestors go on counting what it did */
+ if (parent) {
+ blkg_rwstat_add_aux(&parent->stat_bytes, &tg->stat_bytes);
+ blkg_rwstat_add_aux(&parent->stat_ios, &tg->stat_ios);
+ blkg_rwstat_reset(&tg->stat_bytes);
+ blkg_rwstat_reset(&tg->stat_ios);
+ }
}
static void tg_release(struct rcu_head *rcu)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0469/1167] blk-throttle: make blkio.reset_stats reset I/O counts
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (462 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0468/1167] blk-throttle: pass the I/O counts of a dead group on Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0470/1167] block: dont enter reclaim under rq_qos_mutex Greg Kroah-Hartman
` (193 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejun Heo, Josef Bacik, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit ac81a07a0bd5e75e8edc0eb5be563be1b2d56554 ]
blkio.throttle.io_service_bytes and io_serviced were reset by
blkcg_reset_stats() while the counters were part of the blkg. Now that
they live in the throtl_grp, add a pd_reset_stats_fn for them.
Fixes: 7ca464383aec ("blk-throtl: stop using blkg->stat_bytes and ->stat_ios")
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://patch.msgid.link/20261028164415.1262013-27-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: Context lines around the new throtl_pd_reset_stats() hunk were adjusted, since throtl_pd_offline() sits elsewhere in this tree, and the duplicated functions from the conflict were dropped. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-throttle.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index aee16769b3348..8b7d6d9883d2d 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1724,6 +1724,14 @@ static void throtl_shutdown_wq(struct request_queue *q)
cancel_work_sync(&td->dispatch_work);
}
+static void throtl_pd_reset_stats(struct blkg_policy_data *pd)
+{
+ struct throtl_grp *tg = pd_to_tg(pd);
+
+ blkg_rwstat_reset(&tg->stat_bytes);
+ blkg_rwstat_reset(&tg->stat_ios);
+}
+
struct blkcg_policy blkcg_policy_throtl = {
.dfl_cftypes = throtl_files,
.legacy_cftypes = throtl_legacy_files,
@@ -1733,6 +1741,7 @@ struct blkcg_policy blkcg_policy_throtl = {
.pd_online_fn = throtl_pd_online,
.pd_offline_fn = throtl_pd_offline,
.pd_free_fn = throtl_pd_free,
+ .pd_reset_stats_fn = throtl_pd_reset_stats,
};
void blk_throtl_cancel_bios(struct gendisk *disk)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0470/1167] block: dont enter reclaim under rq_qos_mutex
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (463 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0469/1167] blk-throttle: make blkio.reset_stats reset I/O counts Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0471/1167] tls: Honor O_NONBLOCK in tls_sw_splice_read() Greg Kroah-Hartman
` (192 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejun Heo, Josef Bacik, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 045cbfc369f5929ed473f7c200dc2e8146569ce5 ]
ioc_qos_write() and the wbt_lat_usec writers take rq_qos_mutex with the
queue frozen, blkcg_deactivate_policy() does the same with blkcg_mutex,
so nothing holding either may wait for IO. blkg_conf_prep() got
GFP_NOIO for the blkg in commit 5d726c4dbeed, but the
radix_tree_preload() right after it, the policy init functions and the
GFP_KERNEL fallback in blkcg_activate_policy() can still enter reclaim
there. lockdep reports the cycle on the first write to io.max.
Use GFP_NOIO for all of them.
Fixes: 9730763f4756 ("block: correct locking order for protecting blk-wbt parameters")
Fixes: 5d726c4dbeed ("blk-cgroup: fix possible deadlock while configuring policy")
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://patch.msgid.link/20261028164415.1262013-35-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: Dropped the blk_throtl_init() GFP_NOIO hunk as unneeded here, and converted kzalloc_obj() calls to kzalloc(sizeof(*x), GFP_NOIO). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-cgroup.c | 13 +++++++++----
block/blk-iocost.c | 5 +++--
block/blk-iolatency.c | 3 ++-
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 98f2b3b968a3d..a660be846b091 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -891,7 +891,11 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
parent = blkcg_parent(parent);
}
- /* Drop locks to do new blkg allocation with GFP_KERNEL. */
+ /*
+ * Drop the spinlock to allocate the new blkg. rq_qos_mutex and
+ * blkcg_mutex stay held, and both are taken with the queue
+ * frozen elsewhere: GFP_NOIO.
+ */
spin_unlock_irq(&q->queue_lock);
new_blkg = blkg_alloc(pos, disk, GFP_NOIO);
@@ -900,7 +904,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
goto fail_exit;
}
- if (radix_tree_preload(GFP_KERNEL)) {
+ if (radix_tree_preload(GFP_NOIO)) {
blkg_free(new_blkg);
ret = -ENOMEM;
goto fail_exit;
@@ -1611,7 +1615,8 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
if (!pd) {
/*
* GFP_NOWAIT failed. Free the existing one and
- * prealloc for @blkg w/ GFP_KERNEL.
+ * prealloc for @blkg w/ GFP_NOIO: blkcg_mutex is held,
+ * and a bio based queue has not been frozen above.
*/
if (pinned_blkg)
blkg_put(pinned_blkg);
@@ -1623,7 +1628,7 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
if (pd_prealloc)
pol->pd_free_fn(pd_prealloc);
pd_prealloc = pol->pd_alloc_fn(disk, blkg->blkcg,
- GFP_KERNEL);
+ GFP_NOIO);
if (pd_prealloc)
goto retry;
else
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index bea08873a080c..61741e76c66f5 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -2892,11 +2892,12 @@ static int blk_iocost_init(struct gendisk *disk)
struct ioc *ioc;
int i, cpu, ret;
- ioc = kzalloc(sizeof(*ioc), GFP_KERNEL);
+ /* The caller holds rq_qos_mutex, which is taken with the queue frozen */
+ ioc = kzalloc(sizeof(*ioc), GFP_NOIO);
if (!ioc)
return -ENOMEM;
- ioc->pcpu_stat = alloc_percpu(struct ioc_pcpu_stat);
+ ioc->pcpu_stat = alloc_percpu_gfp(struct ioc_pcpu_stat, GFP_NOIO);
if (!ioc->pcpu_stat) {
kfree(ioc);
return -ENOMEM;
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
index 1fd2025ea8b6a..fa9ec4e5776b1 100644
--- a/block/blk-iolatency.c
+++ b/block/blk-iolatency.c
@@ -761,7 +761,8 @@ static int blk_iolatency_init(struct gendisk *disk)
struct blk_iolatency *blkiolat;
int ret;
- blkiolat = kzalloc(sizeof(*blkiolat), GFP_KERNEL);
+ /* The caller holds rq_qos_mutex, which is taken with the queue frozen */
+ blkiolat = kzalloc(sizeof(*blkiolat), GFP_NOIO);
if (!blkiolat)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0471/1167] tls: Honor O_NONBLOCK in tls_sw_splice_read()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (464 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0470/1167] block: dont enter reclaim under rq_qos_mutex Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0472/1167] ice: E822: keep Tx timestamps disabled during offset calibration Greg Kroah-Hartman
` (191 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <cel@kernel.org>
[ Upstream commit 78ded647d43e335891f981f68c5992a2e763cfcc ]
tls_sw_splice_read() takes its blocking behavior from
SPLICE_F_NONBLOCK alone. When splicing from a socket to a pipe,
do_splice() sets that flag from the pipe's O_NONBLOCK, not the
socket's. On a nonblocking socket, a splice(2) call without
SPLICE_F_NONBLOCK therefore sleeps in tls_rx_rec_wait() until a
record arrives. tcp_splice_read() instead reads sock->file->f_flags
and returns -EAGAIN.
Polling first does not avoid the sleep once tls_sw_splice_read()
consumes zero-length records, as it does after a later patch in this
series. tls_sw_sock_is_readable() reports the socket readable while
any record sits on rx_list, including a zero-length record that
delivers no bytes to the pipe. For TLS 1.3 the strparser announces a
record before decryption, when its plaintext length is still unknown,
so the readiness test cannot screen such a record out. A splice that
consumes the record and waits for the next stalls every connection
an event loop multiplexes.
An LLM audit of the TLS read paths found this defect.
Treat the socket's O_NONBLOCK as nonblocking too. A caller that
sets O_NONBLOCK on the socket and splices without SPLICE_F_NONBLOCK
now gets -EAGAIN where the splice blocked before. sendfile(2) from
a TLS socket changes the same way, because do_sendfile() leaves the
input file's O_NONBLOCK out of the splice flags. Both now behave as
they do on a plain TCP socket.
Fixes: c46234ebb4d1 ("tls: RX path for ktls")
Signed-off-by: Chuck Lever <cel@kernel.org>
Link: https://patch.msgid.link/20261027015215.605919-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Added a local bool nonblock as upstream does, but kept this tree's extra NULL psock argument in the tls_rx_rec_wait() call. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tls/tls_sw.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index e4990ccbe8ba0..3014a5bbeabab 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -2299,10 +2299,14 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
struct tls_msg *tlm;
struct sk_buff *skb;
ssize_t copied = 0;
+ bool nonblock;
int chunk;
int err;
- err = tls_rx_reader_lock(sk, ctx, flags & SPLICE_F_NONBLOCK);
+ nonblock = flags & SPLICE_F_NONBLOCK ||
+ sock->file->f_flags & O_NONBLOCK;
+
+ err = tls_rx_reader_lock(sk, ctx, nonblock);
if (err < 0)
return err;
@@ -2316,8 +2320,7 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
} else {
struct tls_decrypt_arg darg;
- err = tls_rx_rec_wait(sk, NULL, flags & SPLICE_F_NONBLOCK,
- true, false);
+ err = tls_rx_rec_wait(sk, NULL, nonblock, true, false);
if (err <= 0)
goto splice_read_end;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0472/1167] ice: E822: keep Tx timestamps disabled during offset calibration
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (465 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0471/1167] tls: Honor O_NONBLOCK in tls_sw_splice_read() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0473/1167] blk-mq: dont trust the cookie in blk_mq_poll() Greg Kroah-Hartman
` (190 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karol Kolacinski,
Aleksandr Loktionov, Arkadiusz Kubalewski, Przemyslaw Korba,
Jacob Keller, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karol Kolacinski <karol.kolacinski@intel.com>
[ Upstream commit 56af436b90acce7eaa7531189c827773983f7d07 ]
Do not clear the tx.calibrating flag immediately after starting the PHY
timer in ice_ptp_port_phy_restart(). Instead, keep Tx timestamps
disabled until the offset verification work (ice_ptp_wait_for_offsets)
has confirmed that the Tx PHY offset is properly configured.
Previously, tx.calibrating was set to true, then immediately back to
false right after ice_start_phy_timer_e82x() returned. This allowed Tx
timestamp requests to be served during the window where offset
verification was still pending. Timestamps produced during this window
should have their valid bit cleared, but it is better to prevent requests
until the driver has confirmed calibration is complete.
Rename the tx.calibrating field to tx.disabled, and change where it is
cleared. Only clear it in ice_ptp_wait_for_offsets(), and only after Tx
offset configuration has completed successfully. This ensures that new Tx
timestamp requests are only accepted after the PHY has properly calibrated
the Tx offset.
If ice_start_phy_timer_e82x() fails, do not restore disabled to false.
The device is in a state where timestamps cannot succeed properly anyways.
A dev_err message is already logged on failure to start the timer at the
end of the function.
Renaming the field improves clarity and will better reflect the nature of
the flag in a future change that also applies disabling Tx timestamps in
software in a following commit.
Log a debug message while offset calibration is still pending, including
the specific Tx/Rx error codes to aid debugging stalled calibration.
This path is expected on every routine link-up: ov_work is first queued
with no delay and the vernier offset cannot be computed until at least
one packet has been transmitted, so the first several invocations
normally land here. Use dev_dbg() rather than a rate-limited warning to
avoid emitting KERN_WARNING on every link-up during normal operation.
Log a debug message when calibration completes successfully.
Note that sashiko review has previously complained that leaving the
disabled flag set "permanently" disables Tx timestamps if vernier
calibration never completes. This is true, but its important to realize
that timestamps would still fail regardless of whether the flag is set.
Until vernier calibration completes the device will not report valid
timestamps regardless. Thus, keeping the calibrating flag set simply
prevents new timestamp requests from software while it is known that the
hardware will not complete them.
Fixes: 3a7496234d17 ("ice: implement basic E822 PTP support")
Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Przemyslaw Korba <przemyslaw.korba@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20261027-reduction-v1-3-81237c67a361@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Adapted to the older tree: the e82x helper names became e822, the restart function's flat control flow got the same edit as upstream's loop, and header doc context differs. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 35 ++++++++++++++++++------
drivers/net/ethernet/intel/ice/ice_ptp.h | 6 ++--
2 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 8427b36bd8b55..843ce309630af 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -613,7 +613,7 @@ ice_ptp_is_tx_tracker_up(struct ice_ptp_tx *tx)
{
lockdep_assert_held(&tx->lock);
- return tx->init && !tx->calibrating;
+ return tx->init && !tx->disabled;
}
/**
@@ -1250,6 +1250,7 @@ static int ice_ptp_check_tx_fifo(struct ice_ptp_port *port)
static void ice_ptp_wait_for_offsets(struct kthread_work *work)
{
struct ice_ptp_port *port;
+ unsigned long flags;
struct ice_pf *pf;
struct ice_hw *hw;
int tx_err;
@@ -1270,9 +1271,26 @@ static void ice_ptp_wait_for_offsets(struct kthread_work *work)
tx_err = ice_ptp_check_tx_fifo(port);
if (!tx_err)
tx_err = ice_phy_cfg_tx_offset_e822(hw, port->port_num);
+ if (!tx_err) {
+ /* Tx offset has been configured, re-enable Tx timestamps */
+ spin_lock_irqsave(&port->tx.lock, flags);
+ if (port->tx.disabled) {
+ port->tx.disabled = false;
+ dev_dbg(ice_pf_to_dev(pf), "PTP Tx offset valid for port %u, Tx timestamps enabled\n",
+ port->port_num);
+ }
+ spin_unlock_irqrestore(&port->tx.lock, flags);
+ }
+
rx_err = ice_phy_cfg_rx_offset_e822(hw, port->port_num);
if (tx_err || rx_err) {
- /* Tx and/or Rx offset not yet configured, try again later */
+ /* Tx and/or Rx offset not yet configured, try again later.
+ * This is expected during normal link-up: the vernier offset
+ * calibration cannot complete until at least one packet has
+ * been transmitted, so the first retries routinely land here.
+ */
+ dev_dbg(ice_pf_to_dev(pf), "PTP offset not yet valid for port %u (tx_err=%d rx_err=%d)\n",
+ port->port_num, tx_err, rx_err);
kthread_queue_delayed_work(pf->ptp.kworker,
&port->ov_work,
msecs_to_jiffies(100));
@@ -1335,9 +1353,9 @@ ice_ptp_port_phy_restart(struct ice_ptp_port *ptp_port)
kthread_cancel_delayed_work_sync(&ptp_port->ov_work);
- /* temporarily disable Tx timestamps while calibrating PHY offset */
+ /* Disable Tx timestamps until PHY calibration completes */
spin_lock(&ptp_port->tx.lock);
- ptp_port->tx.calibrating = true;
+ ptp_port->tx.disabled = true;
spin_unlock(&ptp_port->tx.lock);
ptp_port->tx_fifo_busy_cnt = 0;
@@ -1346,11 +1364,10 @@ ice_ptp_port_phy_restart(struct ice_ptp_port *ptp_port)
if (err)
goto out_unlock;
- /* Enable Tx timestamps right away */
- spin_lock(&ptp_port->tx.lock);
- ptp_port->tx.calibrating = false;
- spin_unlock(&ptp_port->tx.lock);
-
+ /* Do not clear disabled flag here. Tx timestamp requests
+ * remain disabled until ice_ptp_wait_for_offsets() has
+ * verified that the Tx offset calibration has completed.
+ */
kthread_queue_delayed_work(pf->ptp.kworker, &ptp_port->ov_work, 0);
out_unlock:
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h
index 3dd7584be0fa8..43b30be6d929f 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.h
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.h
@@ -134,8 +134,8 @@ enum ice_tx_tstamp_work {
* @offset: offset into timestamp block to get the real index
* @len: length of the tstamps and in_use fields.
* @init: if true, the tracker is initialized;
- * @calibrating: if true, the PHY is calibrating the Tx offset. During this
- * window, timestamps are temporarily disabled.
+ * @disabled: set to true when new Tx timestamp requests are disabled, such as
+ * while the PHY Tx offset configuration has not yet completed.
* @verify_cached: if true, verify new timestamp differs from last read value
*/
struct ice_ptp_tx {
@@ -147,7 +147,7 @@ struct ice_ptp_tx {
u8 offset;
u8 len;
u8 init : 1;
- u8 calibrating : 1;
+ u8 disabled : 1;
u8 verify_cached : 1;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0473/1167] blk-mq: dont trust the cookie in blk_mq_poll()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (466 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0472/1167] ice: E822: keep Tx timestamps disabled during offset calibration Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0474/1167] blk-iocost: publish hweights as one atomic value Greg Kroah-Hartman
` (189 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Christoph Hellwig,
Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 24974185999fd80b676fbe2a6c7a97bbd38aaf3a ]
blk_mq_poll() indexes queue_hw_ctx[] with bio->bi_cookie unchecked. Zone
write plugging keeps the segment count of a plugged write in
__bi_nr_segments, which shares a union with the cookie, and clears
REQ_POLLED, but bio_poll() only looks at the cookie. A plugged polled
write with more segments than there are hardware queues reads past the
array. The bio is also SLAB_TYPESAFE_BY_RCU, so a cookie from a bio
reused for another device can meet the wrong array as well.
Ignore a cookie that is out of range or doesn't name a poll queue.
Fixes: 3e08773c3841 ("block: switch polling to be bio based")
Fixes: dd291d77cc90 ("block: Introduce zone write plugging")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20261028164415.1262013-28-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-mq.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 72fd729ee9cd4..565c2c6082bb2 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -5071,8 +5071,15 @@ static int blk_hctx_poll(struct request_queue *q, struct blk_mq_hw_ctx *hctx,
int blk_mq_poll(struct request_queue *q, blk_qc_t cookie,
struct io_comp_batch *iob, unsigned int flags)
{
- struct blk_mq_hw_ctx *hctx = xa_load(&q->hctx_table, cookie);
+ struct blk_mq_hw_ctx *hctx;
+ /*
+ * The cookie is no more than a hint. iocb_bio_iopoll() may have read it
+ * from a bio that was reused for another queue right afterwards.
+ */
+ hctx = xa_load(&q->hctx_table, cookie);
+ if (!hctx || hctx->type != HCTX_TYPE_POLL)
+ return 0;
return blk_hctx_poll(q, hctx, iob, flags);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0474/1167] blk-iocost: publish hweights as one atomic value
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (467 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0473/1167] blk-mq: dont trust the cookie in blk_mq_poll() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0475/1167] apparmor: fix table_size() integer overflow on 32 bit Greg Kroah-Hartman
` (188 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kunhai Dai, Tao Cui, Tejun Heo,
Jens Axboe, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kunhai Dai <daikunhai@didiglobal.com>
[ Upstream commit 0150554a3f38e1850d5964102eb89a720c5fe789 ]
current_hweight() publishes the cache generation and both weights with
separate stores. Refreshers running on different CPUs can interleave
their stores and leave a new generation paired with weights from an older
calculation. The compiler can also reorder the generation store before
the weight stores, so a reader that sees the new generation can accept
stale weights.
A stale weight is not only a reporting artifact. It feeds the cost
calculation and the donation logic, where an inconsistent combination can
lead to a zero divisor in transfer_surpluses().
In addition, the slow path rereads iocg->hweight_active/inuse after
publishing them, so the value it returns can be the one written by another
refresher instead of the locally computed one.
Pack the generation and both weights into a single atomic64_t and publish
them with one atomic write. Readers take one atomic snapshot and return
the local values. Weights are in [1, WEIGHT_ONE]; storing each minus one
preserves the full range in 16 bits and leaves 32 bits for the generation.
The two weight fields remain as the donation workspace used under
ioc->lock. Tracepoints decode the packed cache without refreshing it and
iocost_monitor.py is updated accordingly.
Developed with assistance from Claude Code (Anthropic): the assistant
drafted the packed representation, the helpers and the tracepoint/monitor
changes, and ran the checks listed below. The author reviewed the result
and remains responsible for it.
Fixes: 7caa47151ab2 ("blkcg: implement blk-iocost")
Signed-off-by: Kunhai Dai <daikunhai@didiglobal.com>
Tested-by: Tao Cui <cuitao@kylinos.cn>
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://patch.msgid.link/20261019125412.3123895-3-daikunhai@didiglobal.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: Context adapted to older base: helpers placed after iocg_unlock(), kept the older iocg_activate() local declaration, and used the two-argument __assign_str() in the trace header. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-iocost.c | 109 +++++++++++++++++++++++++++------
include/trace/events/iocost.h | 7 ++-
tools/cgroup/iocost_monitor.py | 7 ++-
3 files changed, 99 insertions(+), 24 deletions(-)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 61741e76c66f5..41813da81b15d 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -173,6 +173,7 @@
*/
#include <linux/kernel.h>
+#include <linux/bitfield.h>
#include <linux/module.h>
#include <linux/timer.h>
#include <linux/time64.h>
@@ -472,8 +473,8 @@ struct ioc_gq {
*
* When an idle cgroup becomes active its `active` goes from 0 to
* `weight`. `inuse` is the surplus adjusted active weight.
- * `active` and `inuse` are used to calculate `hweight_active` and
- * `hweight_inuse`.
+ * `active` and `inuse` determine the hierarchical weights cached in
+ * `hweight_cache`.
*
* `last_inuse` remembers `inuse` while an iocg is idle to persist
* surplus adjustments.
@@ -520,7 +521,9 @@ struct ioc_gq {
u64 child_active_sum;
u64 child_inuse_sum;
u64 child_adjusted_sum;
- int hweight_gen;
+ /* Generation in bits 63:32; active - 1 and inuse - 1 in 31:16/15:0. */
+ atomic64_t hweight_cache;
+ /* Donation workspace, protected by ioc->lock. */
u32 hweight_active;
u32 hweight_inuse;
u32 hweight_donating;
@@ -747,6 +750,54 @@ static void iocg_unlock(struct ioc_gq *iocg, bool unlock_ioc, unsigned long *fla
}
}
+/*
+ * The hierarchical weights are in [1, WEIGHT_ONE] and the generation is a
+ * 32-bit counter. Pack generation and both weights into one 64-bit value so
+ * that a reader or a refresher always observes a complete snapshot:
+ *
+ * bits 63:32 generation
+ * bits 31:16 hweight_active - 1
+ * bits 15:0 hweight_inuse - 1
+ */
+#define HWEIGHT_GEN_MASK GENMASK_ULL(63, 32)
+#define HWEIGHT_ACTIVE_MASK GENMASK_ULL(31, 16)
+#define HWEIGHT_INUSE_MASK GENMASK_ULL(15, 0)
+
+static inline u64 hweight_cache_pack(u32 gen, u32 active, u32 inuse)
+{
+ return FIELD_PREP(HWEIGHT_GEN_MASK, gen) |
+ FIELD_PREP(HWEIGHT_ACTIVE_MASK, active - 1) |
+ FIELD_PREP(HWEIGHT_INUSE_MASK, inuse - 1);
+}
+
+static inline void hweight_cache_unpack(u64 cache, u32 *genp, u32 *activep,
+ u32 *inusep)
+{
+ if (genp)
+ *genp = FIELD_GET(HWEIGHT_GEN_MASK, cache);
+ if (activep)
+ *activep = FIELD_GET(HWEIGHT_ACTIVE_MASK, cache) + 1;
+ if (inusep)
+ *inusep = FIELD_GET(HWEIGHT_INUSE_MASK, cache) + 1;
+}
+
+/* Decode the published weights without refreshing the cache. */
+static inline void iocg_hweight_cache(struct ioc_gq *iocg, u32 *activep,
+ u32 *inusep)
+{
+ hweight_cache_unpack(atomic64_read(&iocg->hweight_cache), NULL,
+ activep, inusep);
+}
+
+/* Decode the cached inuse weight; only used by tracepoints. */
+static inline u32 iocg_hweight_cache_inuse(struct ioc_gq *iocg)
+{
+ u32 inuse;
+
+ iocg_hweight_cache(iocg, NULL, &inuse);
+ return inuse;
+}
+
#define CREATE_TRACE_POINTS
#include <trace/events/iocost.h>
@@ -1174,12 +1225,15 @@ static void current_hweight(struct ioc_gq *iocg, u32 *hw_activep, u32 *hw_inusep
{
struct ioc *ioc = iocg->ioc;
int lvl;
- u32 hwa, hwi;
- int ioc_gen;
+ u32 hwa, hwi, ioc_gen, cache_gen;
+ u64 cache;
+
+ ioc_gen = (u32)atomic_read(&ioc->hweight_gen);
- /* hot path - if uptodate, use cached */
- ioc_gen = atomic_read(&ioc->hweight_gen);
- if (ioc_gen == iocg->hweight_gen)
+ /* hot path - if uptodate, use the cached snapshot */
+ cache = atomic64_read(&iocg->hweight_cache);
+ hweight_cache_unpack(cache, &cache_gen, &hwa, &hwi);
+ if (cache_gen == ioc_gen)
goto out;
/*
@@ -1214,14 +1268,20 @@ static void current_hweight(struct ioc_gq *iocg, u32 *hw_activep, u32 *hw_inusep
hwi = div64_u64((u64)hwi * inuse, inuse_sum);
}
- iocg->hweight_active = max_t(u32, hwa, 1);
- iocg->hweight_inuse = max_t(u32, hwi, 1);
- iocg->hweight_gen = ioc_gen;
+ hwa = max_t(u32, hwa, 1);
+ hwi = max_t(u32, hwi, 1);
+ /*
+ * Publish the generation and both weights as one atomic snapshot.
+ * A concurrent refresher may overwrite this with its own snapshot,
+ * but the generation travels with the weights so the next reader
+ * detects the mismatch and refreshes again.
+ */
+ atomic64_set(&iocg->hweight_cache, hweight_cache_pack(ioc_gen, hwa, hwi));
out:
if (hw_activep)
- *hw_activep = iocg->hweight_active;
+ *hw_activep = hwa;
if (hw_inusep)
- *hw_inusep = iocg->hweight_inuse;
+ *hw_inusep = hwi;
}
/*
@@ -1269,7 +1329,8 @@ static bool iocg_activate(struct ioc_gq *iocg, struct ioc_now *now)
{
struct ioc *ioc = iocg->ioc;
u64 last_period, cur_period;
- u64 vtime, vtarget;
+ u64 vtime, vtarget, cache;
+ u32 active, inuse;
int i;
/*
@@ -1319,11 +1380,16 @@ static bool iocg_activate(struct ioc_gq *iocg, struct ioc_now *now)
vtime = vtarget;
/*
- * Activate, propagate weight and start period timer if not
- * running. Reset hweight_gen to avoid accidental match from
- * wrapping.
+ * Activate, propagate weight and start period timer if not running.
+ * Invalidate the cached generation to avoid an accidental match from
+ * wrapping. Keep the last published weights so that the activation
+ * tracepoint can report them; the next current_hweight() recomputes.
*/
- iocg->hweight_gen = atomic_read(&ioc->hweight_gen) - 1;
+ cache = atomic64_read(&iocg->hweight_cache);
+ hweight_cache_unpack(cache, NULL, &active, &inuse);
+ atomic64_set(&iocg->hweight_cache,
+ hweight_cache_pack((u32)(atomic_read(&ioc->hweight_gen) - 1),
+ active, inuse));
list_add(&iocg->active_list, &ioc->active_iocgs);
propagate_weights(iocg, iocg->weight,
@@ -2058,7 +2124,7 @@ static void transfer_surpluses(struct list_head *surpluses, struct ioc_now *now)
TRACE_IOCG_PATH(inuse_transfer, iocg, now,
iocg->inuse, inuse,
- iocg->hweight_inuse,
+ iocg_hweight_cache_inuse(iocg),
iocg->hweight_after_donation);
__propagate_weights(iocg, iocg->active, inuse, true, now);
@@ -2373,7 +2439,7 @@ static void ioc_timer_fn(struct timer_list *timer)
*/
TRACE_IOCG_PATH(inuse_shortage, iocg, &now,
iocg->inuse, iocg->active,
- iocg->hweight_inuse, new_hwi);
+ old_hwi, new_hwi);
__propagate_weights(iocg, iocg->active,
iocg->active, true, &now);
@@ -3008,6 +3074,9 @@ static void ioc_pd_init(struct blkg_policy_data *pd)
INIT_LIST_HEAD(&iocg->active_list);
INIT_LIST_HEAD(&iocg->walk_list);
INIT_LIST_HEAD(&iocg->surplus_list);
+ atomic64_set(&iocg->hweight_cache,
+ hweight_cache_pack((u32)(atomic_read(&ioc->hweight_gen) - 1),
+ WEIGHT_ONE, WEIGHT_ONE));
iocg->hweight_active = WEIGHT_ONE;
iocg->hweight_inuse = WEIGHT_ONE;
diff --git a/include/trace/events/iocost.h b/include/trace/events/iocost.h
index af8bfed528fcb..d8ea3a560b4d2 100644
--- a/include/trace/events/iocost.h
+++ b/include/trace/events/iocost.h
@@ -34,6 +34,9 @@ DECLARE_EVENT_CLASS(iocost_iocg_state,
),
TP_fast_assign(
+ u32 hwa, hwi;
+
+ iocg_hweight_cache(iocg, &hwa, &hwi);
__assign_str(devname, ioc_name(iocg->ioc));
__assign_str(cgroup, path);
__entry->now = now->now;
@@ -44,8 +47,8 @@ DECLARE_EVENT_CLASS(iocost_iocg_state,
__entry->vtime = vtime;
__entry->weight = iocg->weight;
__entry->inuse = iocg->inuse;
- __entry->hweight_active = iocg->hweight_active;
- __entry->hweight_inuse = iocg->hweight_inuse;
+ __entry->hweight_active = hwa;
+ __entry->hweight_inuse = hwi;
),
TP_printk("[%s:%s] now=%llu:%llu vrate=%llu "
diff --git a/tools/cgroup/iocost_monitor.py b/tools/cgroup/iocost_monitor.py
index 933c750b319b7..c6df7ac7ddf41 100644
--- a/tools/cgroup/iocost_monitor.py
+++ b/tools/cgroup/iocost_monitor.py
@@ -149,8 +149,11 @@ class IocgStat:
self.weight = iocg.weight.value_() / WEIGHT_ONE
self.active = iocg.active.value_() / WEIGHT_ONE
self.inuse = iocg.inuse.value_() / WEIGHT_ONE
- self.hwa_pct = iocg.hweight_active.value_() * 100 / WEIGHT_ONE
- self.hwi_pct = iocg.hweight_inuse.value_() * 100 / WEIGHT_ONE
+ hweight_cache = iocg.hweight_cache.counter.value_()
+ hwa = ((hweight_cache >> 16) & (WEIGHT_ONE - 1)) + 1
+ hwi = (hweight_cache & (WEIGHT_ONE - 1)) + 1
+ self.hwa_pct = hwa * 100 / WEIGHT_ONE
+ self.hwi_pct = hwi * 100 / WEIGHT_ONE
self.address = iocg.value_()
vdone = iocg.done_vtime.counter.value_()
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0475/1167] apparmor: fix table_size() integer overflow on 32 bit
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (468 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0474/1167] blk-iocost: publish hweights as one atomic value Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0476/1167] apparmor: check connect permission for SCTP Greg Kroah-Hartman
` (187 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maxime Bélair, John Johansen,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Bélair <maxime.belair@canonical.com>
[ Upstream commit 449195a4bb7d9c456c02b871eec6905edb449bd2 ]
table_size() checks ALIGN(sizeof(struct table_header) + len * el_size, 8)
in size_t, where @len is td_lolen, a u32 user-provided value from the
policy blob. On 32 bit kernels both operations can overflow.
Triggering this bug allows to:
- overflow a 16 byte allocation with up to 4GiB of policy data
- store the table header at address ZERO_SIZE_PTR (kvzalloc(0))
However, this bug requires CAP_MAC_ADMIN, only affects 32 bit kernels,
and the copy runs until the machine is destroyed, so it gives no
controllable primitive and is therefore not a security issue.
Compute the size with the checked helpers and return 0 when the result is
not representable, so the callers can reject the table. A valid table is
never 0 bytes, the header alone is 12.
64 bit kernels cannot overflow (these structs are 32 bit), and are hence
not affected.
Fixes: e06f75a6a2b4 ("AppArmor: dfa match engine")
Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
[ sashal: Dropped the upstream unpack_pdb() !tsize hunk because the ACCEPT2 table allocation block it guards doesn't exist in this tree; the match.h and match.c changes apply unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/apparmor/include/match.h | 11 ++++++++++-
security/apparmor/match.c | 6 +++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/security/apparmor/include/match.h b/security/apparmor/include/match.h
index da03d1404335a..1e511ed6b2630 100644
--- a/security/apparmor/include/match.h
+++ b/security/apparmor/include/match.h
@@ -12,6 +12,7 @@
#define __AA_MATCH_H
#include <linux/kref.h>
+#include <linux/overflow.h>
#define DFA_NOMATCH 0
#define DFA_START 1
@@ -120,7 +121,15 @@ struct aa_dfa {
static inline size_t table_size(size_t len, size_t el_size)
{
- return ALIGN(sizeof(struct table_header) + len * el_size, 8);
+ size_t size;
+
+ /* Need check_*_overflow for 32 bit machines */
+ if (check_mul_overflow(len, el_size, &size) ||
+ check_add_overflow(size, sizeof(struct table_header), &size) ||
+ size > SIZE_MAX - 7)
+ return 0;
+
+ return ALIGN(size, 8);
}
#define aa_state_t unsigned int
diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index 640c19315a0ed..c4b61568db8b5 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -58,7 +58,7 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
if (th.td_lolen == 0)
goto out;
tsize = table_size(th.td_lolen, th.td_flags);
- if (bsize < tsize)
+ if (!tsize || bsize < tsize)
goto out;
table = kvzalloc(tsize, GFP_KERNEL);
@@ -280,6 +280,10 @@ static struct table_header *remap_data16_to_data32(struct table_header *old)
u32 i;
tsize = table_size(old->td_lolen, YYTD_DATA32);
+ if (!tsize) {
+ kvfree(old);
+ return NULL;
+ }
new = kvzalloc(tsize, GFP_KERNEL);
if (!new) {
kvfree(old);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0476/1167] apparmor: check connect permission for SCTP
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (469 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0475/1167] apparmor: fix table_size() integer overflow on 32 bit Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0477/1167] netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts Greg Kroah-Hartman
` (186 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean, John Johansen,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
[ Upstream commit 2f764c08bb191a8c8f4051926dba0d25d195f39b ]
SCTP can start an association through sendmsg() or CONNECTX. These paths
call the SCTP-specific sctp_bind_connect hook instead of the normal socket
connect hook, but AppArmor does not register it. As a result, a profile can
deny connect and allow send or setopt, yet a task can still create an SCTP
association.
Register the SCTP hook. Ask for connect permission when SENDMSG_CONNECT
or CONNECTX creates an association.
Fixes: 56974a6fcfef ("apparmor: add base infastructure for socket mediation")
Assisted-by: LLM
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Signed-off-by: John Johansen <john.johansen@canonical.com>
[ sashal: adjusted context for a kernel-doc comment above apparmor_socket_listen() by placing the new function after apparmor_socket_connect() and keeping the comment attached to its function ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/apparmor/lsm.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 20b60b8d93159..d58250b56364c 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -15,6 +15,7 @@
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/ptrace.h>
+#include <linux/sctp.h>
#include <linux/ctype.h>
#include <linux/sysctl.h>
#include <linux/audit.h>
@@ -964,6 +965,18 @@ static int apparmor_socket_connect(struct socket *sock,
aa_sk_perm(OP_CONNECT, AA_MAY_CONNECT, sock->sk));
}
+static int apparmor_sctp_bind_connect(struct sock *sk, int optname,
+ struct sockaddr *address, int addrlen)
+{
+ switch (optname) {
+ case SCTP_SOCKOPT_CONNECTX:
+ case SCTP_SENDMSG_CONNECT:
+ return aa_sk_perm(OP_CONNECT, AA_MAY_CONNECT, sk);
+ }
+
+ return 0;
+}
+
/**
* apparmor_socket_listen - check perms before allowing listen
*/
@@ -1304,6 +1317,7 @@ static struct security_hook_list apparmor_hooks[] __ro_after_init = {
LSM_HOOK_INIT(socket_getsockopt, apparmor_socket_getsockopt),
LSM_HOOK_INIT(socket_setsockopt, apparmor_socket_setsockopt),
LSM_HOOK_INIT(socket_shutdown, apparmor_socket_shutdown),
+ LSM_HOOK_INIT(sctp_bind_connect, apparmor_sctp_bind_connect),
#ifdef CONFIG_NETWORK_SECMARK
LSM_HOOK_INIT(socket_sock_rcv_skb, apparmor_socket_sock_rcv_skb),
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0477/1167] netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (470 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0476/1167] apparmor: check connect permission for SCTP Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0478/1167] eth: bnxt: dont leak buffers when XDP agg buffer allocation fails Greg Kroah-Hartman
` (185 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1269fe6cc2016008124e,
Kuniyuki Iwashima, Naman Gulati, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naman Gulati <namangulati@google.com>
[ Upstream commit fd0909e963ed8f36967bd072ed484be7babe46de ]
netdev_wait_allrefs_any() re-sends NETDEV_UNREGISTER every second while
it waits for the last references on a device to be dropped. By then
netdev_run_todo() has already marked the device NETREG_UNREGISTERED and
RTNL has been dropped at least once since the initial notification sent
by unregister_netdevice_many_notify().
netdev_genl_netdevice_event() does not tell these rebroadcasts apart
from the initial notification and sends a NETDEV_CMD_DEV_DEL_NTF
multicast for each of them. At best this spams NETDEV_NLGRP_MGMT
listeners with duplicate notifications; at worst the pernet state of
the netns the device belongs to is already gone and the handler
dereferences a NULL pointer.
default_device_exit_batch() only unregisters the devices still listed
in the exiting netns; it does not wait for in-flight unregistrations of
devices that were already unlisted (the barrier doing that was removed
by commit 8a4fc54b07d7 ("net: get rid of rtnl_lock_unregistering()")).
So when a device is unregistered by something other than the
cleanup_net() of its own netns while references on it are still held,
e.g. a veth whose peer in another netns gets deleted, and that netns
exits while the device is stuck in netdev_wait_allrefs_any(), the
remaining pernet exit handlers run and genl_pernet_exit() sets
net->genl_sock to NULL. The next rebroadcast then crashes in
genl_has_listeners():
BUG: KASAN: null-ptr-deref in netlink_has_listeners+0x3d/0x3f0 net/netlink/af_netlink.c:1388
Read of size 8 at addr 0000000000000578 by task syz.0.0/5325
Call Trace:
<TASK>
netlink_has_listeners+0x3d/0x3f0 net/netlink/af_netlink.c:1388
genl_has_listeners include/net/genetlink.h:644 [inline]
netdev_genl_dev_notify+0x161/0x450 net/core/netdev-genl.c:93
netdev_genl_netdevice_event+0x98/0x3c0 net/core/netdev-genl.c:1491
notifier_call_chain+0x1a5/0x3d0 kernel/notifier.c:85
netdev_wait_allrefs_any net/core/dev.c:11690 [inline]
netdev_run_todo+0x731/0x1060 net/core/dev.c:11808
rtnl_unlock net/core/rtnetlink.c:157 [inline]
rtnl_dellink+0x68f/0x810 net/core/rtnetlink.c:3707
syzbot hit this by moving one end of a veth pair into a short-lived
netns while netdevsim's deferred FIB event processing still held a
reference on it, and then deleting the other end (repro [1]). While the
source of this bug is netdevsim deferring FIB processing for and holding
onto the device reference for O(seconds) which is being fixed
separately [2], any driver may introduce such a delay and trigger the
null-ptr-deref.
Skip the rebroadcasts, which are the only NETDEV_UNREGISTER events
delivered with reg_state == NETREG_UNREGISTERED. The notifications sent
by unregister_netdevice_many_notify() and, for a device leaving a netns,
by __dev_change_net_namespace() are issued under RTNL in the same
critical section that unlists the device, before its netns can be torn
down, and keep being handled. This mirrors what ip6_route_dev_notify()
already does to cope with the rebroadcasts.
This change should not break the UAPI spec as it defines dev-del-ntf as
a "Notification about device disappearing." which is a single event. The
rebroadcast in netdev_wait_allrefs_any() exists to re-kick in-kernel
subsystems holding references; netdev-genl happens to be on the notifier
chain and forwards it.
[1] https://gist.github.com/NamanGulati/2d1b49b8757f9a88b0bd6e55018c02ae
[2] https://lore.kernel.org/r/20261023191517.607834-1-kuniyu@google.com
Fixes: d3d854fd6a1d ("netdev-genl: create a simple family for netdev stuff")
Reported-by: syzbot+1269fe6cc2016008124e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Naman Gulati <namangulati@google.com>
Link: https://patch.msgid.link/20261026221306.3151025-1-namangulati@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Added the upstream NETDEV_UNREGISTER guard to the bare notify call, since this tree lacks the netdev_lock()/netdev_unlock() context that the upstream hunk expects. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/netdev-genl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index c1aea8b756b6c..4003efc5ddbba 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -129,6 +129,12 @@ static int netdev_genl_netdevice_event(struct notifier_block *nb,
netdev_genl_dev_notify(netdev, NETDEV_CMD_DEV_ADD_NTF);
break;
case NETDEV_UNREGISTER:
+ /* netdev_wait_allrefs_any() rebroadcasts NETDEV_UNREGISTER
+ * while waiting for the last references to be dropped; the
+ * netns may already be torn down by then. Notify only once.
+ */
+ if (READ_ONCE(netdev->reg_state) == NETREG_UNREGISTERED)
+ break;
netdev_genl_dev_notify(netdev, NETDEV_CMD_DEV_DEL_NTF);
break;
case NETDEV_XDP_FEAT_CHANGE:
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0478/1167] eth: bnxt: dont leak buffers when XDP agg buffer allocation fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (471 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0477/1167] netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0479/1167] apparmor: fix check SCTP bind, and connect permission checks Greg Kroah-Hartman
` (184 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michael Chan, Jakub Kicinski,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 1b2f02fb4ba92d01603c8261c94be8d348de65b0 ]
If a replacement agg buffer can't be allocated for a packet received
with XDP attached, bnxt_rx_pkt() drops the packet without returning
its head buffer to the ring. The head buffer leaks, and since rx_prod
still advances, the device gets a BD with a stale DMA address which
points at a buffer the driver no longer owns. When that BD completes
the driver finds no buffer in the slot.
The agg buffers consumed before the failing one have already been
replaced on the agg ring, they are referenced only by the frags of
the xdp_buff, which nobody frees. bnxt_xdp_buff_frags_free() would
skip them since the frags flag is set only on success, so set it
upfront.
Pointed out in LLM review of the first patch of the series.
Tested on a BCM57504 at MTU 9000 with a frags-capable XDP_PASS
program, receiving 8000B ICMPv6 echo requests (a head and two agg
buffers each) while page_pool_alloc_netmems() called from
bnxt_rx_agg_netmems_xdp() failed half of the time (bpftrace
override()). 44.7k packets were dropped, the page pools' inflight
count stayed flat and there were no KASAN or DEBUG_PAGEALLOC splats.
Fixes: 4c6c123c9af9 ("bnxt: adding bnxt_rx_agg_pages_xdp for aggregated xdp")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20261027234940.1267225-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Replaced this tree's __bnxt_rx_agg_pages(), bnxt_rx_agg_pages_xdp() and plain struct xdp_buff xdp for the upstream netmem names and bnxt_xdp wrapper in the context lines. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 9751ddcf416c0..00df2b34ba742 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1185,16 +1185,19 @@ static u32 bnxt_rx_agg_pages_xdp(struct bnxt *bp,
struct skb_shared_info *shinfo = xdp_get_shared_info_from_buff(xdp);
u32 total_frag_len = 0;
- if (!xdp_buff_has_frags(xdp))
+ if (!xdp_buff_has_frags(xdp)) {
+ xdp_buff_set_frags_flag(xdp);
shinfo->nr_frags = 0;
+ }
total_frag_len = __bnxt_rx_agg_pages(bp, cpr, shinfo,
idx, agg_bufs, tpa, xdp);
- if (total_frag_len) {
- xdp_buff_set_frags_flag(xdp);
- shinfo->nr_frags = agg_bufs;
- shinfo->xdp_frags_size = total_frag_len;
+ if (!total_frag_len) {
+ bnxt_xdp_buff_frags_free(cpr->bnapi->rx_ring, xdp);
+ return 0;
}
+ shinfo->nr_frags = agg_bufs;
+ shinfo->xdp_frags_size = total_frag_len;
return total_frag_len;
}
@@ -1967,8 +1970,10 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
u32 frag_len = bnxt_rx_agg_pages_xdp(bp, cpr, &xdp,
cp_cons, agg_bufs,
false);
- if (!frag_len)
+ if (!frag_len) {
+ bnxt_reuse_rx_data(rxr, cons, data);
goto oom_next_rx;
+ }
}
xdp_active = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0479/1167] apparmor: fix check SCTP bind, and connect permission checks
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (472 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0478/1167] eth: bnxt: dont leak buffers when XDP agg buffer allocation fails Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0480/1167] apparmor: advertise that sctp is being mediated Greg Kroah-Hartman
` (183 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, John Johansen, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Johansen <john.johansen@canonical.com>
[ Upstream commit 7a82f9a06459ff1c37b5e97b204430442cc076e3 ]
SCTP mediation of bind is not being checked correctly because bind
permission needs to be checked in the sctp_bind_connect() hook.
Require for bind permissions when CTP_SET_PEER_PRIMARY_ADDR, and
SCTP_SOCKOPT_BINDX_ADD are asked for.
The peer initialized ASCONF cases (SCTP_PARAM_ADD_IP and
SCTP_PARAM_SET_PRIMARY) are processed in softirq context and are not
mediated atm. SCTP_PRIMATEY_ADDR, and SCTP_SET_PEER_PRIMARY_ADDR only
select among address already in the association.
Fixes: 56974a6fcfef ("apparmor: add base infastructure for socket mediation")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/apparmor/lsm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index d58250b56364c..e5fc437e01499 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -969,6 +969,11 @@ static int apparmor_sctp_bind_connect(struct sock *sk, int optname,
struct sockaddr *address, int addrlen)
{
switch (optname) {
+ /* Bind checks */
+ case SCTP_SET_PEER_PRIMARY_ADDR:
+ case SCTP_SOCKOPT_BINDX_ADD:
+ return aa_sk_perm(OP_BIND, AA_MAY_BIND, sk);
+ /* Connect checks */
case SCTP_SOCKOPT_CONNECTX:
case SCTP_SENDMSG_CONNECT:
return aa_sk_perm(OP_CONNECT, AA_MAY_CONNECT, sk);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0480/1167] apparmor: advertise that sctp is being mediated
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (473 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0479/1167] apparmor: fix check SCTP bind, and connect permission checks Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0481/1167] PM: runtime: Only queue an idle check for RPM-linked suppliers (part 2) Greg Kroah-Hartman
` (182 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, John Johansen, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Johansen <john.johansen@canonical.com>
[ Upstream commit 35b8ab3f36ac0fcd8fc910da0bed889b6c75c426 ]
Enable the test harness to detect that the kernel should be properly
mediating sctp.
Fixes: 7a82f9a06459f ("apparmor: fix check SCTP bind, and connect permission checks")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/apparmor/net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/security/apparmor/net.c b/security/apparmor/net.c
index 6e989184e4086..662a1b58d7d72 100644
--- a/security/apparmor/net.c
+++ b/security/apparmor/net.c
@@ -22,6 +22,7 @@
struct aa_sfs_entry aa_sfs_entry_network[] = {
AA_SFS_FILE_STRING("af_mask", AA_SFS_AF_MASK),
AA_SFS_FILE_BOOLEAN("tcp-fast-open", 1),
+ AA_SFS_FILE_BOOLEAN("sctp", 1),
{ }
};
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0481/1167] PM: runtime: Only queue an idle check for RPM-linked suppliers (part 2)
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (474 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0480/1167] apparmor: advertise that sctp is being mediated Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0482/1167] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
` (181 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Norris <briannorris@chromium.org>
[ Upstream commit bd56424ce808fb1f92a4dc5bdeedc45b85c5d6cd ]
Commit be5755f023e7 ("PM: runtime: Only queue an idle check for
RPM-linked suppliers") was incomplete. There are two other cases where
we perform idle checks on non-DL_FLAG_PM_RUNTIME suppliers -- in
pm_runtime_set_suspended(), and in cases where we failed to resume
suppliers.
Fixes: be5755f023e7 ("PM: runtime: Only queue an idle check for RPM-linked suppliers")
Fixes: 5244f5e2d801 ("PM: runtime: Defer suspending suppliers")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20261103141442.v2.1.If69ddc515c2e9fd4338441e87688b9d690d2ef36@changeid
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: Replaced the missing device_link_test() helper with the open-coded link->flags & DL_FLAG_PM_RUNTIME test in __rpm_put_suppliers(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/power/runtime.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index cf128d062f072..fd02b8a206b2d 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -329,6 +329,9 @@ static void __rpm_put_suppliers(struct device *dev, bool try_to_suspend)
list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
device_links_read_lock_held()) {
+ if (!(link->flags & DL_FLAG_PM_RUNTIME))
+ continue;
+
pm_runtime_release_supplier(link);
if (try_to_suspend)
pm_request_idle(link->supplier);
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0482/1167] tun: clear stale skb->protocol of NAPI frags skbs
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (475 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0481/1167] PM: runtime: Only queue an idle check for RPM-linked suppliers (part 2) Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0483/1167] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
` (180 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Willem de Bruijn,
Eric Dumazet, Jakub Kicinski, Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 3287cd714a853d9443c4a743eca010aedcfbbcdd ]
With IFF_NAPI_FRAGS, tun_napi_alloc_frags() gets its skb from
napi_get_frags(). If GRO merged the previous frame with
GRO_MERGED_FREE, that skb was recycled by napi_reuse_skb(), which does
not reset skb->protocol set by napi_frags_skb() for the previous frame.
tun_get_user() calls tun_vnet_hdr_tnl_to_skb() before eth_type_trans(),
so the virtio header checks see the protocol of the previous frame:
GSO packets without VIRTIO_NET_HDR_F_NEEDS_CSUM are dissected with the
wrong protocol. A following change checks the outer protocol of UDP
tunnel GSO packets, which would then reject a valid frame when the two
ethertypes differ.
This needs GRO to hold packets across writes, and IFF_NAPI_FRAGS needs
CAP_NET_ADMIN.
Clear skb->protocol in tun_napi_alloc_frags(), like skbs allocated
by tun_alloc_skb() or build_skb(). eth_type_trans() sets it later.
Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179386753589.488856.11455181721004759454@kernel.org/
Suggested-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261110213628.3476051-3-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/tun.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index e81a97944d7c9..ea808985fbc4b 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1490,6 +1490,12 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile,
if (!skb)
return ERR_PTR(-ENOMEM);
+ /* An skb recycled by napi_reuse_skb() keeps the protocol of a
+ * previous frame. eth_type_trans() sets it after the virtio
+ * header checks, which must not see a stale one.
+ */
+ skb->protocol = 0;
+
linear = iov_iter_single_seg_count(it);
err = __skb_grow(skb, linear);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0483/1167] io_uring/io-wq: apply the current cpuset to new workers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (476 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0482/1167] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0484/1167] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
` (179 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mikhail Malyshev, Jens Axboe,
Sasha Levin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Malyshev <mike.malyshev@gmail.com>
[ Upstream commit 0659e44ce739ecd856164c75a5325b7959a2921d ]
Since commit 84eacf177faa ("io_uring/io-wq: inherit cpuset of cgroup in
io worker"), io_wq_create() copies the cpuset of the creating task into
wq->cpu_mask, and io_init_new_worker() gives each new worker that copy.
A cpuset change, or a move of the task to another cgroup, updates the
workers that exist but not the copy, so workers started later run on
the CPUs the cgroup had when the io-wq was created, which may since
have been given to other tasks. Workers come and go for the life of the
io-wq, and a worker that cpuset moved is also retired at its next idle
timeout and replaced on the old CPUs.
Keep wq->cpu_mask for the affinity of the io-wq itself, all CPUs or the
mask set with IORING_REGISTER_IOWQ_AFF, and intersect it with the cpuset
of the worker when the worker starts, falling back to the cpuset if the
two do not intersect, as __set_cpus_allowed_ptr() does. Use the same
mask in the idle exit test, and go back to all CPUs when the registered
affinity is removed.
Fixes: 84eacf177faa ("io_uring/io-wq: inherit cpuset of cgroup in io worker")
Cc: stable@vger.kernel.org
Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
Link: https://patch.msgid.link/20261111162705.1150983-1-mike.malyshev@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/io-wq.c | 44 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 39 insertions(+), 5 deletions(-)
diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 1a5f6ef2dbe19..ee0506b8de424 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -685,6 +685,34 @@ static bool io_worker_retire(struct io_wq *wq, struct io_wq_acct *acct,
return false;
}
+/*
+ * The CPUs a worker of @wq runs on: those of the io-wq affinity that the
+ * worker's cpuset allows, or the cpuset if they have none in common, as the
+ * scheduler does with a task's requested affinity when its cpuset changes.
+ * Read the cpuset each time: it can change while the io-wq exists.
+ */
+static void io_wq_worker_cpus(struct io_wq *wq, struct task_struct *tsk,
+ struct cpumask *cpus)
+{
+ cpuset_cpus_allowed(tsk, cpus);
+ if (cpumask_intersects(cpus, wq->cpu_mask))
+ cpumask_and(cpus, cpus, wq->cpu_mask);
+}
+
+/* Is the current worker on a CPU that a new worker would not get? */
+static bool io_wq_worker_off_cpus(struct io_wq *wq)
+{
+ cpumask_var_t cpus;
+ bool off;
+
+ if (!alloc_cpumask_var(&cpus, GFP_KERNEL))
+ return false;
+ io_wq_worker_cpus(wq, current, cpus);
+ off = !cpumask_test_cpu(raw_smp_processor_id(), cpus);
+ free_cpumask_var(cpus);
+ return off;
+}
+
static int io_wq_worker(void *data)
{
struct io_worker *worker = data;
@@ -746,8 +774,7 @@ static int io_wq_worker(void *data)
}
if (!ret) {
last_timeout = true;
- exit_mask = !cpumask_test_cpu(raw_smp_processor_id(),
- wq->cpu_mask);
+ exit_mask = io_wq_worker_off_cpus(wq);
}
}
@@ -797,9 +824,16 @@ void io_wq_worker_sleeping(struct task_struct *tsk)
static void io_init_new_worker(struct io_wq *wq, struct io_worker *worker,
struct task_struct *tsk)
{
+ cpumask_var_t cpus;
+
tsk->worker_private = worker;
worker->task = tsk;
- set_cpus_allowed_ptr(tsk, wq->cpu_mask);
+ /* Without a mask, the worker keeps its creator's CPUs. */
+ if (alloc_cpumask_var(&cpus, GFP_KERNEL)) {
+ io_wq_worker_cpus(wq, tsk, cpus);
+ set_cpus_allowed_ptr(tsk, cpus);
+ free_cpumask_var(cpus);
+ }
raw_spin_lock(&wq->lock);
hlist_nulls_add_head_rcu(&worker->nulls_node, &wq->free_list);
@@ -1267,7 +1301,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
if (!alloc_cpumask_var(&wq->cpu_mask, GFP_KERNEL))
goto err;
- cpuset_cpus_allowed(data->task, wq->cpu_mask);
+ cpumask_copy(wq->cpu_mask, cpu_possible_mask);
wq->acct[IO_WQ_ACCT_BOUND].max_workers = bounded;
wq->acct[IO_WQ_ACCT_UNBOUND].max_workers =
task_rlimit(current, RLIMIT_NPROC);
@@ -1451,7 +1485,7 @@ int io_wq_cpu_affinity(struct io_uring_task *tctx, cpumask_var_t mask)
else
ret = -EINVAL;
} else {
- cpumask_copy(tctx->io_wq->cpu_mask, allowed_mask);
+ cpumask_copy(tctx->io_wq->cpu_mask, cpu_possible_mask);
}
rcu_read_unlock();
--
2.53.0
^ permalink raw reply related [flat|nested] 659+ messages in thread
* [PATCH 6.6 0484/1167] tracing/eprobe: Install the trigger for every instance that enables the eprobe
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (477 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0483/1167] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0485/1167] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
` (178 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Carlier,
Masami Hiramatsu (Google)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Carlier <devnexen@gmail.com>
commit be94710b1f6ba1bea33e73129c110af80e999b2d upstream.
The eprobe trigger lives in the instance of the enabling file, but it is
only added when the eprobe is first enabled and only removed when the
last file goes away. A second instance then records nothing, and the
first instance's trigger is left behind once the eprobe is disabled
there, so the eprobe can be deleted while that trigger still uses it.
Add and remove the trigger for each file. The file is never NULL here,
so warn if it is and drop the dead perf paths.
Link: https://lore.kernel.org/all/20261107101233.151434-1-devnexen@gmail.com/
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Cc: stable@vger.kernel.org
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 58 ++++++++++++++------------------------------
1 file changed, 19 insertions(+), 39 deletions(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -647,37 +647,32 @@ static int enable_trace_eprobe(struct tr
{
struct trace_probe *tp;
struct trace_eprobe *ep;
- bool enabled;
int ret = 0;
int cnt = 0;
+ if (WARN_ON_ONCE(!file))
+ return -EINVAL;
+
tp = trace_probe_primary_from_call(call);
if (WARN_ON_ONCE(!tp))
return -ENODEV;
- enabled = trace_probe_is_enabled(tp);
/* This also changes "enabled" state */
- if (file) {
- ret = trace_probe_add_file(tp, file);
- if (ret)
- return ret;
- } else
- trace_probe_set_flag(tp, TP_FLAG_PROFILE);
-
- if (enabled)
- return 0;
+ ret = trace_probe_add_file(tp, file);
+ if (ret)
+ return ret;
+ /* The trigger lives in the instance of the file, add it for each file */
for_each_trace_eprobe_tp(ep, tp) {
ret = enable_eprobe(ep, file);
if (ret)
break;
- enabled = true;
cnt++;
}
if (ret) {
/* Failed to enable one of them. Roll back all */
- if (enabled) {
+ if (cnt) {
/*
* It's a bug if one failed for something other than memory
* not being available but another eprobe succeeded.
@@ -690,10 +685,7 @@ static int enable_trace_eprobe(struct tr
break;
}
}
- if (file)
- trace_probe_remove_file(tp, file);
- else
- trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
+ trace_probe_remove_file(tp, file);
}
return ret;
@@ -705,33 +697,21 @@ static int disable_trace_eprobe(struct t
struct trace_probe *tp;
struct trace_eprobe *ep;
+ if (WARN_ON_ONCE(!file))
+ return -EINVAL;
+
tp = trace_probe_primary_from_call(call);
if (WARN_ON_ONCE(!tp))
return -ENODEV;
- if (file) {
- if (!trace_probe_get_file_link(tp, file))
- return -ENOENT;
- if (!trace_probe_has_single_file(tp))
- goto out;
- trace_probe_clear_flag(tp, TP_FLAG_TRACE);
- } else
- trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
-
- if (!trace_probe_is_enabled(tp)) {
- for_each_trace_eprobe_tp(ep, tp)
- disable_eprobe(ep, file->tr);
- }
+ if (!trace_probe_get_file_link(tp, file))
+ return -ENOENT;
- out:
- if (file)
- /*
- * Synchronization is done in below function. For perf event,
- * file == NULL and perf_trace_event_unreg() calls
- * tracepoint_synchronize_unregister() to ensure synchronize
- * event. We don't need to care about it.
- */
- trace_probe_remove_file(tp, file);
+ for_each_trace_eprobe_tp(ep, tp)
+ disable_eprobe(ep, file->tr);
+
+ /* Synchronization is done in below function. */
+ trace_probe_remove_file(tp, file);
return 0;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0485/1167] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (478 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0484/1167] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0486/1167] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
` (177 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarkko Sakkinen <jarkko@kernel.org>
commit 094c53d2994975e36d4cab7cf5d9f34c1b0f1916 upstream.
KEY_MAX_DESC_SIZE includes the trailing NULL character. Descriptions
generated from payloads and in-kernel paths bypass the userspace limit.
Reject descriptions at or above KEY_MAX_DESC_SIZE with -EINVAL at the
following sites:
- key_alloc(): before quota calculation
- __key_create_or_update(): before key_set_index_key()
- keyring_search(): before match_preparse
- request_key_and_link(): before match_preparse
- request_key_rcu(): before check_cached_key()
Cc: stable@vger.kernel.org
Fixes: f771fde82051 ("keys: Simplify key description management")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/r/20261020174325.2229448-3-jarkko@kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/key.h | 3 +++
security/keys/key.c | 10 +++++++++-
security/keys/keyctl.c | 2 --
security/keys/keyring.c | 7 ++++++-
security/keys/request_key.c | 14 ++++++++++++--
5 files changed, 30 insertions(+), 6 deletions(-)
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -37,6 +37,9 @@ struct net;
#undef KEY_DEBUGGING
+/* Maximum length of a key description, including the trailing NUL */
+#define KEY_MAX_DESC_SIZE 4096
+
#define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */
#define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */
#define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -245,6 +245,8 @@ struct key *key_alloc(struct key_type *t
}
desclen = strlen(desc);
+ if (desclen >= KEY_MAX_DESC_SIZE)
+ goto error;
quotalen = desclen + 1 + type->def_datalen;
/* get hold of the key tracking for this user */
@@ -814,6 +816,7 @@ static key_ref_t __key_create_or_update(
key_ref_t key_ref;
int ret;
struct key_restriction *restrict_link = NULL;
+ size_t desclen;
/* look up the key type to see if it's one of the registered kernel
* types */
@@ -854,7 +857,12 @@ static key_ref_t __key_create_or_update(
if (!index_key.description)
goto error_free_prep;
}
- index_key.desc_len = strlen(index_key.description);
+ desclen = strlen(index_key.description);
+ if (desclen >= KEY_MAX_DESC_SIZE) {
+ key_ref = ERR_PTR(-EINVAL);
+ goto error_free_prep;
+ }
+ index_key.desc_len = desclen;
key_set_index_key(&index_key);
ret = __key_link_lock(keyring, &index_key);
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -24,8 +24,6 @@
#include <keys/request_key_auth-type.h>
#include "internal.h"
-#define KEY_MAX_DESC_SIZE 4096
-
static const unsigned char keyrings_capabilities[2] = {
[0] = (KEYCTL_CAPS0_CAPABILITIES |
(IS_ENABLED(CONFIG_PERSISTENT_KEYRINGS) ? KEYCTL_CAPS0_PERSISTENT_KEYRINGS : 0) |
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -957,7 +957,6 @@ key_ref_t keyring_search(key_ref_t keyri
struct keyring_search_context ctx = {
.index_key.type = type,
.index_key.description = description,
- .index_key.desc_len = strlen(description),
.cred = current_cred(),
.match_data.cmp = key_default_cmp,
.match_data.raw_data = description,
@@ -965,8 +964,14 @@ key_ref_t keyring_search(key_ref_t keyri
.flags = KEYRING_SEARCH_DO_STATE_CHECK,
};
key_ref_t key;
+ size_t desclen;
int ret;
+ desclen = strlen(description);
+ if (desclen >= KEY_MAX_DESC_SIZE)
+ return ERR_PTR(-EINVAL);
+ ctx.index_key.desc_len = desclen;
+
if (recurse)
ctx.flags |= KEYRING_SEARCH_RECURSE;
if (type->match_preparse) {
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -584,7 +584,6 @@ struct key *request_key_and_link(struct
.index_key.type = type,
.index_key.domain_tag = domain_tag,
.index_key.description = description,
- .index_key.desc_len = strlen(description),
.cred = current_cred(),
.match_data.cmp = key_default_cmp,
.match_data.raw_data = description,
@@ -595,8 +594,14 @@ struct key *request_key_and_link(struct
};
struct key *key;
key_ref_t key_ref;
+ size_t desclen;
int ret;
+ desclen = strlen(description);
+ if (desclen >= KEY_MAX_DESC_SIZE)
+ return ERR_PTR(-EINVAL);
+ ctx.index_key.desc_len = desclen;
+
kenter("%s,%s,%p,%zu,%p,%p,%lx",
ctx.index_key.type->name, ctx.index_key.description,
callout_info, callout_len, aux, dest_keyring, flags);
@@ -787,7 +792,6 @@ struct key *request_key_rcu(struct key_t
.index_key.type = type,
.index_key.domain_tag = domain_tag,
.index_key.description = description,
- .index_key.desc_len = strlen(description),
.cred = current_cred(),
.match_data.cmp = key_default_cmp,
.match_data.raw_data = description,
@@ -797,6 +801,12 @@ struct key *request_key_rcu(struct key_t
};
struct key *key;
key_ref_t key_ref;
+ size_t desclen;
+
+ desclen = strlen(description);
+ if (desclen >= KEY_MAX_DESC_SIZE)
+ return ERR_PTR(-EINVAL);
+ ctx.index_key.desc_len = desclen;
kenter("%s,%s", type->name, description);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0486/1167] KEYS: Verify the key identity in __key_unlink_begin
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (479 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0485/1167] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0487/1167] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
` (176 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarkko Sakkinen <jarkko@kernel.org>
commit 7a7f70ff7b26519c98b339a3e0cd9ee3c8d17f77 upstream.
When two keys have identical type and description, linking the second key
replaces the first in a keyring. However, attempting to unlink the first
key (no longer in the keyring) unlinks the second key.
This happens because __key_unlink_begin() calls assoc_array_delete() with
&key->index_key, matching only on type and description rather than the
key's identity.
Example:
keyctl new_session >/dev/null
keyctl newring ring_a @s
keyctl newring ring_b @s
A=$(keyctl add user A ss %:ring_a)
B=$(keyctl add user A qq %:ring_b)
keyctl newring R @s
keyctl link $A %:R
keyctl link $B %:R
keyctl unlink $A %:R
keyctl show
Verify the key identity before unlinking, and return -ENOENT on mismatch,
instead of unlinking the key with the wrong identity.
Cc: stable@vger.kernel.org
Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/r/20261020174325.2229448-4-jarkko@kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/keys/keyring.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -1506,9 +1506,15 @@ static int __key_unlink_begin(struct key
struct assoc_array_edit **_edit)
{
struct assoc_array_edit *edit;
+ const void *object;
BUG_ON(*_edit != NULL);
+ object = assoc_array_find(&keyring->keys, &keyring_assoc_array_ops,
+ &key->index_key);
+ if (!object || keyring_ptr_to_key(object) != key)
+ return -ENOENT;
+
edit = assoc_array_delete(&keyring->keys, &keyring_assoc_array_ops,
&key->index_key);
if (IS_ERR(edit))
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0487/1167] bootconfig: Allow keys with the maximum supported depth
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (480 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0486/1167] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0488/1167] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
` (175 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhiqi Zhang,
Masami Hiramatsu (Google)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhiqi Zhang <zhiqizhangg@gmail.com>
commit cab697164b47eecfa2f146024f5d661f99a1a1e7 upstream.
xbc_verify_tree() accepts keys with XBC_DEPTH_MAX (16) components,
but xbc_node_compose_key_after() returns -ERANGE immediately after
storing the sixteenth component. It rejects the key before discovering
that there are no more ancestors to collect.
For example, a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p = value can be attached
to an initrd successfully. However, bootconfig -l stops listing and
prints "Failed to compose key -34". In the kernel, the same error
propagates through copy_xbc_key_value_list() during its length probe,
so proc_boot_config_init() returns before creating /proc/bootconfig.
Check the array capacity before storing the next component. This lets
exactly XBC_DEPTH_MAX components be composed while retaining the check
before any out-of-bounds store.
I found this issue while reviewing bootconfig's depth handling and used
OpenAI Codex to verify the failure and develop the fix. I reviewed the
change and wrote and ran the regression tests.
Link: https://lore.kernel.org/all/20261104073742.21202-2-zhiqizhangg@gmail.com/
Fixes: 76db5a27a827 ("bootconfig: Add Extra Boot Config support")
Cc: stable@vger.kernel.org
Signed-off-by: Zhiqi Zhang <zhiqizhangg@gmail.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/bootconfig.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -304,9 +304,9 @@ int __init xbc_node_compose_key_after(st
node = xbc_node_get_parent(node);
while (node && node != root) {
- keys[depth++] = xbc_node_index(node);
if (depth == XBC_DEPTH_MAX)
return -ERANGE;
+ keys[depth++] = xbc_node_index(node);
node = xbc_node_get_parent(node);
}
if (!node && root)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0488/1167] ALSA: caiaq: Kill EP1 URB before unregistering the input device
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (481 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0487/1167] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0489/1167] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
` (174 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sergei Nizovtsev, Takashi Iwai
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergei Nizovtsev <snizovtsev@cloudlinux.com>
commit 5d325345185015024a86abca4cc5fa6a3f75294e upstream.
snd_disconnect() unregisters the input device via
snd_usb_caiaq_input_disconnect() and only afterwards kills the EP1
command URB (cdev->ep1_in_urb). The EP1 completion handler
usb_ep1_command_reply_dispatch() feeds snd_usb_caiaq_input_dispatch()
for EP1_CMD_READ_{ERP,ANALOG,IO} replies, which report into
cdev->input_dev. Since commit b04dcbb7f7b1 ("ALSA: caiaq: Use
snd_card_free_when_closed() at disconnection") the input device is
unregistered from snd_usb_caiaq_input_disconnect() but cdev->input_dev
is cleared only later, in snd_usb_caiaq_input_free() from the card
destructor. As the dispatch guard only tests cdev->input_dev for NULL,
an EP1 reply that completes after input_unregister_device() but before
cdev->ep1_in_urb is killed reports into an input device that has
already been unregistered and, with no evdev client holding it open,
freed.
Normally the window is closed by the USB core: usb_unbind_interface()
calls usb_disable_interface() before ->disconnect(), which flushes the
EP1 URB as long as endpoint 0x81 belongs to the interface being
unbound. But caiaq addresses EP1 through the device-wide pipe
usb_rcvbulkpipe(usb_dev, 0x1) without checking which interface owns
the endpoint. If a device declares it in another interface, the URB
stays live across snd_disconnect() of the interface that owns the card.
This needs a crafted device descriptor; a device that has EP1 in the
interface caiaq is bound to is not affected.
Kill cdev->ep1_in_urb (and the paired midi_out_urb) before the input
and audio disconnect helpers, so no EP1 completion can run once the
input device has been unregistered.
Reproduced under KASAN with raw-gadget + dummy_hcd emulating an Audio
Kontrol 1 (17cc:0815) with the EP1 bulk pair in interface 1: only
interface 0 was bound to snd-usb-caiaq and then unbound through sysfs
while the gadget flooded EP1 with EP1_CMD_READ_ERP replies. With no PCM
stream running the window is very short and was only hit by stalling
the unbinding CPU with a kgdb breakpoint at
snd_usb_caiaq_audio_disconnect(). With the fix applied, the same test
runs clean.
BUG: KASAN: slab-use-after-free in input_event+0x3a/0xc0
Read of size 8 at addr ffff8880151a4028 by task sh/118
Call Trace:
<IRQ>
input_event+0x3a/0xc0
snd_usb_caiaq_input_dispatch+0xab2/0xf00
usb_ep1_command_reply_dispatch+0x1f3/0x580
__usb_hcd_giveback_urb+0x246/0x400
dummy_timer+0x1415/0x3380
__hrtimer_run_queues+0x39d/0x800
hrtimer_run_softirq+0x187/0x2d0
handle_softirqs+0x1ff/0x930
__irq_exit_rcu+0x15b/0x210
irq_exit_rcu+0xe/0x20
sysvec_apic_timer_interrupt+0x81/0xb0
</IRQ>
<TASK>
asm_sysvec_apic_timer_interrupt+0x1a/0x20
RIP: 0010:snd_usb_caiaq_audio_disconnect+0x0/0x70
snd_disconnect+0x81/0x110
usb_unbind_interface+0x1a0/0x860
device_release_driver_internal+0x2c5/0x470
unbind_store+0xde/0x100
</TASK>
Allocated by task 80:
input_allocate_device+0x47/0x340
snd_usb_caiaq_input_init+0x4c/0x1ac0
snd_probe+0xab3/0x1160
usb_probe_interface+0x2ea/0x810
Freed by task 118:
kfree+0x1ea/0x5c0
input_dev_release+0xab/0xd0
device_release+0xcf/0x250
kobject_put+0x169/0x320
snd_disconnect+0x79/0x110
usb_unbind_interface+0x1a0/0x860
Fixes: b04dcbb7f7b1 ("ALSA: caiaq: Use snd_card_free_when_closed() at disconnection")
Cc: stable@vger.kernel.org
Signed-off-by: Sergei Nizovtsev <snizovtsev@cloudlinux.com>
Assisted-by: Claude:claude-opus-4-8
Link: https://patch.msgid.link/20261112094904.2430318-1-snizovtsev@cloudlinux.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/caiaq/device.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -593,14 +593,19 @@ static void snd_disconnect(struct usb_in
snd_card_disconnect(card);
+ /*
+ * Kill the EP1 URB before disconnecting the input device: its
+ * completion reports into cdev->input_dev, which input_disconnect()
+ * frees without clearing the pointer.
+ */
+ usb_kill_urb(cdev->ep1_in_urb);
+ usb_kill_urb(cdev->midi_out_urb);
+
#ifdef CONFIG_SND_USB_CAIAQ_INPUT
snd_usb_caiaq_input_disconnect(cdev);
#endif
snd_usb_caiaq_audio_disconnect(cdev);
- usb_kill_urb(cdev->ep1_in_urb);
- usb_kill_urb(cdev->midi_out_urb);
-
snd_card_free_when_closed(card);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0489/1167] ALSA: usb-audio: Drop capture packets with bogus actual_length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (482 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0488/1167] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0490/1167] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
` (173 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Gichoon Han, Takashi Iwai
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gichoon Han <gichoon.han@samsung.com>
commit eed0e9583a290e6adbe3a8480bdae911f31e1ed9 upstream.
retire_capture_urb() copies urb->iso_frame_desc[i].actual_length bytes
out of urb->transfer_buffer at the packet's offset, but never checks
that value against the requested packet length. A host controller
reporting more data than requested makes memcpy() read past the end
of the URB transfer buffer.
Commit 06be918062ad ("ALSA: usb-audio: Bound packet copies by the PCM
buffer size") clamps the count to the PCM ring buffer size, which
protects the destination. The source slot is only ep->curpacksize
bytes per packet, though, so the over-read remains.
This was hit on an ARM32 system (vendor 5.4 kernel; the code path is
unchanged in mainline) with a full-speed UAC1 microphone behind a
high-speed hub, i.e. the EHCI siTD path. sitd_complete() computes
actual_length as desc->length - SITD_LENGTH(t); the controller
reported a remaining length larger than the programmed one, the value
wrapped to ~4G, and the capture copy faulted on the first unmapped
page after the URB buffer:
Unable to handle kernel paging request at virtual address e8756000
Internal error: Oops: 7 [#1] PREEMPT SMP ARM
r3 : 00000000 r2 : 0001e700 r1 : e8756000 r0 : e878fc80
Code: ba000002 f5d1f03c f5d1f05c f5d1f07c (e8b151f8)
A packet can never legitimately carry more than its requested length,
so warn and skip it instead of copying.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Gichoon Han <gichoon.han@samsung.com>
Link: https://patch.msgid.link/20261110060021.2146383-1-gichoon.han@samsung.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/pcm.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -1286,6 +1286,12 @@ static void retire_capture_urb(struct sn
// continue;
}
bytes = urb->iso_frame_desc[i].actual_length;
+ if (unlikely(bytes > urb->iso_frame_desc[i].length)) {
+ dev_warn_ratelimited(&subs->dev->dev,
+ "packet %d: actual_length %u exceeds length %u, dropping\n",
+ i, bytes, urb->iso_frame_desc[i].length);
+ continue;
+ }
if (subs->stream_offset_adj > 0) {
unsigned int adj = min(subs->stream_offset_adj, bytes);
cp += adj;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0490/1167] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (483 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0489/1167] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0491/1167] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
` (172 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Steven Rostedt,
Masami Hiramatsu (Google), Shuah Khan
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <rostedt@goodmis.org>
commit 88d5f8cb8a6276194ac8c1de44f3ed77d7e938ce upstream.
The checkbashism is giving a false positive to the kprobe test of:
($"foo" should be eval_gettext "foo"):
if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}$" /proc/kallsyms)" -le '1' ]; then
This is because it sees the $" at the end of the grep as a bash symbol.
Instead, escape the '$' with a backslash as it is within quotes and that
'$' is for grep to process an end of line character and not a bash
variable.
Link: https://lore.kernel.org/r/20261029211218.3749963a@fedora
Cc: stable@vger.kernel.org
Fixes: d22c3e0088e85 ("selftests/ftrace: Fix unique symbol check in kprobe_non_uniq_symbol.tc")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
@@ -6,7 +6,7 @@
SYMBOL='name_show'
# We skip this test on kernel where SYMBOL is unique or does not exist.
-if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}$" /proc/kallsyms)" -le '1' ]; then
+if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}\$" /proc/kallsyms)" -le '1' ]; then
exit_unsupported
fi
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0491/1167] mmc: mmci: fix DMA channel leak when mmc_add_host() fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (484 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0490/1167] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0492/1167] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
` (171 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Anfernee Cao, Ulf Hansson
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anfernee Cao <anferneemelokc5@gmail.com>
commit 2d8927fadbf95e2d2dfa95bcc73882d6e19c2ce4 upstream.
mmci_probe() calls mmci_dma_setup(), which acquires the RX and TX DMA
channels via dma_request_chan(). These channels are not managed by
devres, and are released only by mmci_dma_release().
If the following mmc_add_host() fails, probe jumps to the clk_disable
label, which only disables the clock. As probe then fails,
mmci_remove() is never called, so both DMA channels are leaked.
Release them by adding a dedicated unwind label, reached only after
mmci_dma_setup().
This issue was found by manual code inspection.
Fixes: b38a20f29a49 ("mmc: mmci: fix return value check of mmc_add_host()")
Cc: stable@vger.kernel.org
Signed-off-by: Anfernee Cao <anferneemelokc5@gmail.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/mmci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -2418,11 +2418,13 @@ static int mmci_probe(struct amba_device
ret = mmc_add_host(mmc);
if (ret)
- goto clk_disable;
+ goto dma_release;
pm_runtime_put(&dev->dev);
return 0;
+dma_release:
+ mmci_dma_release(host);
clk_disable:
clk_disable_unprepare(host->clk);
host_free:
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0492/1167] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (485 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0491/1167] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0493/1167] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
` (170 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adrian Hunter, Ian Ray, Haibo Chen,
Ulf Hansson
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Ray <ian.ray@gehealthcare.com>
commit d35d93c2902592a84347a15deac4d67a323694c9 upstream.
Since commit 5a52c5701a67 ("mmc: core: Fix host controller programming
for fixed driver type"), the eMMC driver strength is passed directly to
mmc_set_driver_type(), which propagates the value through ios.drv_type
all the way to sdhci_set_ios(). For value 4, SDHCI correctly warns:
mmc2: invalid driver type, default to driver type B
The host driver type has no effect on this controller: esdhc_writew_le()
never programs the driver-type field of SDHCI_HOST_CONTROL2. Hook
set_ios() and force drv_type to the always-valid Type B, so that SDHCI
never sees an unsupported value.
Tested on i.MX8MP (usdhc3, eMMC in HS400) with
`fixed-emmc-driver-type = <4>`: the warning is gone and the HS_TIMING
register contains 0x43 as expected.
Fixes: 5a52c5701a67 ("mmc: core: Fix host controller programming for fixed driver type")
Link: https://lore.kernel.org/all/20260926122908.866-1-ian.ray@gehealthcare.com/
Cc: stable@vger.kernel.org
Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1088,6 +1088,20 @@ static void esdhc_reset_tuning(struct sd
}
}
+static void sdhci_esdhc_imx_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+{
+ /*
+ * This controller has no driver-type control: esdhc_writew_le()
+ * discards the driver-type field when writing SDHCI_HOST_CONTROL2.
+ * The programmed value is therefore irrelevant, but SDHCI rejects
+ * non-SD values such as 4 (eMMC 40 ohm, from fixed-emmc-driver-type).
+ * Force an always-valid Type B.
+ */
+ ios->drv_type = MMC_SET_DRIVER_TYPE_B;
+
+ sdhci_set_ios(mmc, ios);
+}
+
static void usdhc_init_card(struct mmc_host *mmc, struct mmc_card *card)
{
struct sdhci_host *host = mmc_priv(mmc);
@@ -1735,6 +1749,9 @@ static int sdhci_esdhc_imx_probe(struct
host->mmc_host_ops.init_card = usdhc_init_card;
}
+ /* No SDHCI driver type control */
+ host->mmc_host_ops.set_ios = sdhci_esdhc_imx_set_ios;
+
if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)
sdhci_esdhc_ops.platform_execute_tuning =
esdhc_executing_tuning;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0493/1167] mmc: meson-gx: report busy from DAT0 alone
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (486 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0492/1167] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0494/1167] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
` (169 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
commit 318fdb75f4dc9d18ae621b9fb25eb11160c95649 upstream.
meson_mmc_card_busy() reports busy only while DAT0..3 are all low. A
busy card drives DAT0 low and leaves DAT1..3 to the pull-ups, and the
callback is defined as "Check if the card is pulling dat[0] low". So a
busy card is reported free, and the core, which prefers card_busy over
CMD13 in mmc_busy_cb(), stops polling after CMD6 and erase at once. The
controller hides this on R1b commands, where it waits for busy itself.
Once max_busy_timeout is reported, the core sends the longer waits, the
120 s BKOPS and 240 s sanitize switches among them, as R1 and has only
the polling left.
Look at DAT0 only, as sdhci_card_busy() does. The checks around the
voltage switch in mmc_set_uhs_voltage() still hold: the card drives
DAT0..3 low together after CMD11 and keeps them low together on
failure.
Fixes: 186cd8b7f586 ("mmc: meson-gx: implement card_busy callback")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1079,8 +1079,8 @@ static int meson_mmc_card_busy(struct mm
regval = readl(host->regs + SD_EMMC_STATUS);
- /* We are only interrested in lines 0 to 3, so mask the other ones */
- return !(FIELD_GET(STATUS_DATI, regval) & 0xf);
+ /* The card signals busy on DAT0 alone. */
+ return !(FIELD_GET(STATUS_DATI, regval) & BIT(0));
}
static int meson_mmc_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0494/1167] mmc: meson-gx: honour the busy timeout for R1b commands
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (487 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0493/1167] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0495/1167] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
` (168 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
commit 7e3cc541aa5855bc36e6cbffa82efc2795955a10 upstream.
For a command without data the driver programs a fixed 1024 ms into the
CMD_CFG timeout field, and for R1b the controller waits for the card to
release busy within that time. The core sends erase and cache flush as
R1b with busy timeouts of up to 60 s and 30 s, and the controller gives
up after one second:
mmc_erase: erase error -110, status 0x0
mmc1: cache flush error -110
Program the timeout from cmd->busy_timeout, kept between 1024 ms, the
fixed value until now, and 32768 ms, the most the field holds, and
rounded up to a power of two. The clamp comes first: MMC_IOC_CMD passes
cmd_timeout_ms from user space straight into busy_timeout, and
roundup_pow_of_two() of a value above 2^31 does not fit in unsigned
int. sdhci takes its command timeout from cmd->busy_timeout in the
same way.
Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -214,6 +214,20 @@ static unsigned int meson_mmc_get_timeou
return min(timeout, 32768U); /* max. 2^15 ms */
}
+/* For R1b the controller waits for busy to be released within this timeout. */
+static unsigned int meson_mmc_get_cmd_timeout_msecs(struct mmc_command *cmd)
+{
+ unsigned int timeout = cmd->busy_timeout;
+
+ if (!timeout)
+ return SD_EMMC_CMD_TIMEOUT;
+
+ timeout = clamp_t(unsigned int, timeout, SD_EMMC_CMD_TIMEOUT,
+ SD_EMMC_CMD_TIMEOUT_MAX);
+
+ return roundup_pow_of_two(timeout);
+}
+
static struct mmc_command *meson_mmc_get_next_command(struct mmc_command *cmd)
{
if (cmd->opcode == MMC_SET_BLOCK_COUNT && !cmd->error)
@@ -840,7 +854,7 @@ static void meson_mmc_start_cmd(struct m
cmd_data = host->bounce_dma_addr & CMD_DATA_MASK;
} else {
cmd_cfg |= FIELD_PREP(CMD_CFG_TIMEOUT_MASK,
- ilog2(SD_EMMC_CMD_TIMEOUT));
+ ilog2(meson_mmc_get_cmd_timeout_msecs(cmd)));
}
/* Last descriptor */
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0495/1167] mmc: meson-gx: report the longest busy wait the controller can do
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (488 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0494/1167] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0496/1167] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
` (167 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
commit 18e9f7fb05ada68d491ff49165b9644f790e0e0c upstream.
The driver does not set max_busy_timeout, so the core takes the host
for one that can wait for busy indefinitely and sends erase and cache
flush as R1b with busy timeouts of up to 60 s and 30 s. The CMD_CFG
timeout field holds at most 32768 ms, so the controller times out first.
Report 32768 ms as max_busy_timeout. The core then sizes discards to
fit and, for a longer wait, sends R1 and polls for busy itself.
Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1180,6 +1180,9 @@ static int meson_mmc_probe(struct platfo
mmc->caps |= MMC_CAP_CMD23;
+ /* The longest busy wait the CMD_CFG timeout field can hold. */
+ mmc->max_busy_timeout = SD_EMMC_CMD_TIMEOUT_MAX;
+
if (mmc->caps & MMC_CAP_SDIO_IRQ)
mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0496/1167] mmc: meson-gx: name the limit of the CMD_CFG timeout field
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (489 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0495/1167] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0497/1167] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
` (166 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
commit e1644210d15f7f8adbe6315199b4b73bead63a2c upstream.
The data timeout is capped at a literal 32768 ms with a comment next to
it. Give the limit a name beside the other timeout constants.
Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -125,6 +125,7 @@
#define SD_EMMC_CFG_RESP_TIMEOUT 256 /* in clock cycles */
#define SD_EMMC_CMD_TIMEOUT 1024 /* in ms */
#define SD_EMMC_CMD_TIMEOUT_DATA 4096 /* in ms */
+#define SD_EMMC_CMD_TIMEOUT_MAX 32768 /* in ms, 2^15: limit of CMD_CFG_TIMEOUT_MASK */
#define SD_EMMC_CFG_CMD_GAP 16 /* in clock cycles */
#define SD_EMMC_DESC_BUF_LEN PAGE_SIZE
@@ -211,7 +212,7 @@ static unsigned int meson_mmc_get_timeou
timeout = roundup_pow_of_two(timeout);
- return min(timeout, 32768U); /* max. 2^15 ms */
+ return min_t(unsigned int, timeout, SD_EMMC_CMD_TIMEOUT_MAX);
}
/* For R1b the controller waits for busy to be released within this timeout. */
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0497/1167] eventpoll: wake the next waiter when a woken waiter is killed
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (490 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0496/1167] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0498/1167] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
` (165 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mani Tofigh,
Christian Brauner (Amutable)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mani Tofigh <mt4022@columbia.edu>
commit 9f4413e522faed76f4cf610098b2369eb3ba1f1c upstream.
Processes sharing an epoll instance can sleep forever while an event is
ready. An event wakes only one waiter, which then wakes the next one in
ep_done_scan() if events are still ready. Since commit c257a340ede0
("fs, epoll: short circuit fetching events if thread has been killed"),
ep_send_events() returns before the scan when the waiter has a fatal
signal. If the woken waiter is killed before it runs, nobody wakes the
next one:
Task A Task B Task C
epoll_wait(ep, -1) epoll_wait(ep, -1)
write(efd)
/* wakes A only */
kill(A, SIGKILL)
ep_send_events()
return -EINTR
/* skips ep_done_scan() */
/* still asleep */
B then sleeps until another file on the instance becomes ready, if ever.
This can hit eg a pre-fork server whose worker gets OOM killed. Commit
7fab29e35630 ("fs/epoll: restore waking from ep_done_scan()") fixed the
same kind of hang when the wakeup in ep_done_scan() was removed.
Keep the early return so that a dying task still doesn't take events
nobody will see, but wake the next waiter there if events are ready, as
ep_done_scan() would have. With the fix, B gets the event.
This bug was identified and confirmed with the help of a deterministic
hypervisor currently under development. The C reproducer below however
hits it within about 2s.
Fixes: c257a340ede0 ("fs, epoll: short circuit fetching events if thread has been killed")
Cc: stable@vger.kernel.org
Signed-off-by: Mani Tofigh <mt4022@columbia.edu>
Link: https://patch.msgid.link/20261103-epoll-killed-waiter-v1-1-36e08c16b8a2@columbia.edu
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/eventpoll.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1665,10 +1665,17 @@ static int ep_send_events(struct eventpo
/*
* Always short-circuit for fatal signals to allow threads to make a
* timely exit without the chance of finding more events available and
- * fetching repeatedly.
+ * fetching repeatedly. The wakeup that got us here may have been the
+ * only one for the events on ->rdllist, so pass it on to the next
+ * waiter, as ep_done_scan() would have.
*/
- if (fatal_signal_pending(current))
+ if (fatal_signal_pending(current)) {
+ spin_lock_irq(&ep->lock);
+ if (!list_empty(&ep->rdllist))
+ wake_up(&ep->wq);
+ spin_unlock_irq(&ep->lock);
return -EINTR;
+ }
init_poll_funcptr(&pt, NULL);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0498/1167] aio: dont let exit_aio() return before complete() is done
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (491 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0497/1167] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0499/1167] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
` (164 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Jan Kara,
Christian Brauner (Amutable)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit ac4b449b39e605123c12ea10042cafc9b6f39603 upstream.
exit_aio() kills all contexts in one go and waits for them with a
single on-stack struct ctx_rq_wait. The count starts at table->nr, each
killed context drops one count in free_ioctx_reqs() and exit_aio()
subtracts the empty slots afterwards. Whoever drops the last count
either calls complete() or, if it is exit_aio(), skips the wait.
With a full table skipped is zero and atomic_sub_and_test(0, ...) only
tells us whether the count already hit zero. free_ioctx_reqs() runs from
the percpu_ref RCU callback, so if exit_aio() is off the CPU long enough
the last callback can have done its atomic_dec_and_test() but not yet
called complete():
free_ioctx_reqs() exit_aio()
atomic_dec_and_test() // 1 -> 0
atomic_sub_and_test(0) // true
kfree(table)
return
complete(&wait.comp)
complete() then locks and writes a completion on a stack frame that is
gone. So hold an extra count for exit_aio() itself. Then the last count
is always dropped by exit_aio() after it waited, or by a callback while
exit_aio() waits for it. An unprivileged user gets there with four
io_setup() calls and an exit without io_destroy().
Reported-by: Kyle Zeng <kylebot@openai.com>
Fixes: dc48e56d7616 ("aio: fix serial draining in exit_aio()")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261030-work-aio-exit_aio-v1-1-83942022a4c4@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/aio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -917,7 +917,7 @@ void exit_aio(struct mm_struct *mm)
if (!table)
return;
- atomic_set(&wait.count, table->nr);
+ atomic_set(&wait.count, table->nr + 1);
init_completion(&wait.comp);
skipped = 0;
@@ -941,7 +941,7 @@ void exit_aio(struct mm_struct *mm)
kill_ioctx(mm, ctx, &wait);
}
- if (!atomic_sub_and_test(skipped, &wait.count)) {
+ if (!atomic_sub_and_test(skipped + 1, &wait.count)) {
/* Wait until all IO for the context are done. */
wait_for_completion(&wait.comp);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0499/1167] splice, net: avoid MSG_MORE when the bvec array fills
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (492 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0498/1167] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0500/1167] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
` (163 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss,
Christian Brauner (Amutable)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
commit 8eaa35c6c29ae669949f4b5b0814c3d34c8ed658 upstream.
splice_to_socket() leaves tail at the last included pipe buffer when
its 16-entry bvec array fills. If the requested length exceeds the
available pipe data, pipe_occupancy() counts that buffer again and sets
MSG_MORE even though the pipe is empty. Small TCP transfers can then be
delayed until the cork timeout expires.
Advance tail before checking the array limit so the occupancy test
counts only pipe buffers that have not been included in the send.
Fixes: ca2d49f77ce4 ("splice, net: Fix splice_to_socket() to handle pipe bufs larger than a page")
Cc: stable@vger.kernel.org
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Link: https://patch.msgid.link/20261031095922.3577591-2-thnkslprpt@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/splice.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -860,9 +860,9 @@ ssize_t splice_to_socket(struct pipe_ino
bvec_set_page(&bvec[bc++], buf->page, seg, buf->offset);
remain -= seg;
+ tail++;
if (remain == 0 || bc >= ARRAY_SIZE(bvec))
break;
- tail++;
}
if (!bc)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0500/1167] mm/mmzone: read the zoneref slot once in zonelist_zone()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (493 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0499/1167] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0501/1167] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
` (162 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta), Zi Yan,
Vlastimil Babka (SUSE)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit 9c52ebe9c89d41c56fcb5d94efe9e539414175a9 upstream.
Memory hotplug rebuilds zonelists in place while allocations walk them,
so a zoneref slot can change between two loads of it.
zonelist_zone() loads the slot with a plain access. The compiler may
load it again later instead of keeping the zone it already read, so a
caller can check one zone and then use another, or the NULL terminator.
Use READ_ONCE(). Callers that take a zone from a slot and keep using
it, such as get_page_from_freelist() with ac->preferred_zoneref, need
that single load.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-6-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/mmzone.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1593,7 +1593,8 @@ extern struct zone *next_zone(struct zon
static inline struct zone *zonelist_zone(struct zoneref *zoneref)
{
- return zoneref->zone;
+ /* Memory hotplug rewrites zonelists in place. */
+ return READ_ONCE(zoneref->zone);
}
static inline int zonelist_zone_idx(struct zoneref *zoneref)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0501/1167] mm/memory_hotplug: resize zones under their seqlock
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (494 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0500/1167] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0502/1167] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
` (161 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Vlastimil Babka (SUSE)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 58e81bb7de5aac8ec5e4aa21d401e7dafbd4058b upstream.
With CONFIG_DEBUG_VM the page allocator checks that a page which is
freed, split or allocated lies within its zone. The check reads
zone->zone_start_pfn and zone->spanned_pages under zone->span_seqlock, as
memory hotplug can change the two at any time.
Commit 27cacaad16c5 ("mm,memory_hotplug: drop unneeded locking") removed
the write side, since all resizing is serialized by the hotplug lock. That
leaves the reader without protection. When memory below the start of a
zone goes online, the start is lowered first and the size is raised
afterwards. When the lowest memory of a zone goes offline, the size is
reduced first. In between, the zone seems to end before its last pages. If
one of them goes through the allocator at that moment, it is reported as
being outside of the zone triggers VM_BUG_ON_PAGE().
Write the two fields in a write section of the seqlock. Interrupts are
disabled as pages are freed from interrupts, too, and the reader would
wait for the writer which it has interrupted.
Fixes: 27cacaad16c5 ("mm,memory_hotplug: drop unneeded locking")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-4-e0d2890ab74f@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/memory_hotplug.c | 44 ++++++++++++++++++++++++++++----------------
1 file changed, 28 insertions(+), 16 deletions(-)
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -459,6 +459,22 @@ static unsigned long find_biggest_sectio
return 0;
}
+/*
+ * The page allocator checks pages against the span of their zone while the
+ * zone is resized, see page_outside_zone_boundaries(). It must not see the
+ * new value of one field together with the old value of the other one.
+ */
+static void zone_set_span(struct zone *zone, unsigned long start_pfn,
+ unsigned long spanned_pages)
+{
+ unsigned long flags;
+
+ write_seqlock_irqsave(&zone->span_seqlock, flags);
+ zone->zone_start_pfn = start_pfn;
+ zone->spanned_pages = spanned_pages;
+ write_sequnlock_irqrestore(&zone->span_seqlock, flags);
+}
+
static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
unsigned long end_pfn)
{
@@ -474,13 +490,10 @@ static void shrink_zone_span(struct zone
*/
pfn = find_smallest_section_pfn(nid, zone, end_pfn,
zone_end_pfn(zone));
- if (pfn) {
- zone->spanned_pages = zone_end_pfn(zone) - pfn;
- zone->zone_start_pfn = pfn;
- } else {
- zone->zone_start_pfn = 0;
- zone->spanned_pages = 0;
- }
+ if (pfn)
+ zone_set_span(zone, pfn, zone_end_pfn(zone) - pfn);
+ else
+ zone_set_span(zone, 0, 0);
} else if (zone_end_pfn(zone) == end_pfn) {
/*
* If the section is biggest section in the zone, it need
@@ -491,11 +504,10 @@ static void shrink_zone_span(struct zone
pfn = find_biggest_section_pfn(nid, zone, zone->zone_start_pfn,
start_pfn);
if (pfn)
- zone->spanned_pages = pfn - zone->zone_start_pfn + 1;
- else {
- zone->zone_start_pfn = 0;
- zone->spanned_pages = 0;
- }
+ zone_set_span(zone, zone->zone_start_pfn,
+ pfn - zone->zone_start_pfn + 1);
+ else
+ zone_set_span(zone, 0, 0);
}
}
@@ -707,12 +719,12 @@ static void node_states_set_node(int nod
static void __meminit resize_zone_range(struct zone *zone, unsigned long start_pfn,
unsigned long nr_pages)
{
- unsigned long old_end_pfn = zone_end_pfn(zone);
+ unsigned long end_pfn = max(start_pfn + nr_pages, zone_end_pfn(zone));
- if (zone_is_empty(zone) || start_pfn < zone->zone_start_pfn)
- zone->zone_start_pfn = start_pfn;
+ if (!zone_is_empty(zone) && start_pfn > zone->zone_start_pfn)
+ start_pfn = zone->zone_start_pfn;
- zone->spanned_pages = max(start_pfn + nr_pages, old_end_pfn) - zone->zone_start_pfn;
+ zone_set_span(zone, start_pfn, end_pfn - start_pfn);
}
static void __meminit resize_pgdat_range(struct pglist_data *pgdat, unsigned long start_pfn,
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0502/1167] mm/page_alloc: keep the pagesets of an empty zone
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (495 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0501/1167] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0503/1167] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
` (160 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Johannes Weiner, Gregory Price (Meta), Zi Yan,
Vlastimil Babka (SUSE)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 7bfcf81b1cb469bc016fa8e07939c0924b9ff8db upstream.
When the last memory of a zone goes offline, zone_pcp_reset() frees
zone->per_cpu_pageset and zone->per_cpu_zonestats. Nothing waits for those
who found the zone populated and still use the two pointers. They take
neither the memory hotplug lock nor any other lock which offline_pages()
holds, and some of them can sleep:
CPU0 vmstat_update() CPU1 offline_pages()
refresh_cpu_vm_stats()
for_each_populated_zone(zone)
pcp = zone->per_cpu_pageset
cond_resched()
adjust_present_page_count()
zone_pcp_reset(zone)
free_percpu(zone->per_cpu_pageset)
decay_pcp_high(zone, pcp)
__this_cpu_write(pcp->expire, 0)
The same goes for drain_all_pages(NULL), which takes pcp->lock, for
zone_pcp_update(), show_free_areas() and the readers and writers of the
zonestats. If the per-cpu memory has got a new owner in the meantime, it
is corrupted.
The pagesets are only freed because setup_zone_pageset() would otherwise
leak them when the zone gets memory again. Keep them instead and let
setup_zone_pageset() and zone_pcp_init() use them again, like it is done
with pgdat->per_cpu_nodestats. Their lists are empty, and their limits
have been calculated for a zone without memory by the
init_per_zone_wmark_min() of offline_pages(), which is what
setup_zone_pageset() would come up with as well.
Fixes: 340175b7d14d ("mm/hotplug: free zone->pageset when a zone becomes empty")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-3-gourry@gourry.net
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5487,6 +5487,10 @@ void __meminit setup_zone_pageset(struct
{
int cpu;
+ /* The zone has been populated before, see zone_pcp_reset(). */
+ if (zone->per_cpu_pageset != &boot_pageset)
+ return;
+
/* Size may be 0 on !SMP && !NUMA */
if (sizeof(struct per_cpu_zonestat) > 0)
zone->per_cpu_zonestats = alloc_percpu(struct per_cpu_zonestat);
@@ -5549,6 +5553,10 @@ void __init setup_per_cpu_pageset(void)
__meminit void zone_pcp_init(struct zone *zone)
{
+ /* This initialization only needs to be done once */
+ if (zone->per_cpu_pageset)
+ return;
+
/*
* per cpu subsystem is not up at this point. The following code
* relies on the ability of the linker to provide the
@@ -6476,6 +6484,12 @@ void zone_pcp_enable(struct zone *zone)
mutex_unlock(&pcp_batch_high_lock);
}
+/*
+ * The zone has become empty. Its pagesets and zonestats are not freed: nothing
+ * keeps somebody who found the zone populated, such as refresh_cpu_vm_stats()
+ * or drain_all_pages(), from still using them. They are used again when the
+ * zone gets memory again.
+ */
void zone_pcp_reset(struct zone *zone)
{
int cpu;
@@ -6486,12 +6500,6 @@ void zone_pcp_reset(struct zone *zone)
pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu);
drain_zonestat(zone, pzstats);
}
- free_percpu(zone->per_cpu_pageset);
- zone->per_cpu_pageset = &boot_pageset;
- if (zone->per_cpu_zonestats != &boot_zonestats) {
- free_percpu(zone->per_cpu_zonestats);
- zone->per_cpu_zonestats = &boot_zonestats;
- }
}
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0503/1167] mm/page_alloc: detect zonelist rebuilds from memory hot-add
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (496 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0502/1167] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0504/1167] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
` (159 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vlastimil Babka (SUSE),
Gregory Price (Meta), Zi Yan
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit e5db040c3d09c5d85dda70f736d4d1a6714b741e upstream.
The zonelist_update_seq retry was limited to CONFIG_MEMORY_HOTREMOVE,
presumably because only hot-remove takes zones out of a zonelist.
However, build_zonerefs_node() rewrites the zonelists in place, so
onlining the first block of a zone shifts the entries that follow it
in every zonelist containing that zone. This can cause a spurious
allocation failure for a __GFP_THISNODE caller.
For a node with only ZONE_NORMAL, onlining its first ZONE_MOVABLE block
rewrites the node's ZONELIST_NOFALLBACK list as:
[NORMAL, NULL] -> [MOVABLE, NULL] -> [MOVABLE, NORMAL, NULL]
A concurrent GFP_KERNEL | __GFP_THISNODE allocation can observe the
intermediate list, skip ZONE_MOVABLE, and find no eligible zone. With
CONFIG_MEMORY_HOTREMOVE=n, check_retry_zonelist() returns 0 and the
allocation fails even though the node has free ZONE_NORMAL memory.
Gate the sequence checks on CONFIG_MEMORY_HOTPLUG, which covers every
configuration that rebuilds zonelists after boot.
Fixes: 3d36424b3b58 ("mm/page_alloc: fix race condition between build_all_zonelists and page allocation")
Cc: stable@vger.kernel.org
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-5-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3654,7 +3654,7 @@ static DEFINE_SEQLOCK(zonelist_update_se
static unsigned int zonelist_iter_begin(void)
{
- if (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
return read_seqbegin(&zonelist_update_seq);
return 0;
@@ -3662,7 +3662,7 @@ static unsigned int zonelist_iter_begin(
static unsigned int check_retry_zonelist(unsigned int seq)
{
- if (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
return read_seqretry(&zonelist_update_seq, seq);
return seq;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0504/1167] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (497 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0503/1167] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0505/1167] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
` (158 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ilya Maximets, Sasha Levin,
Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, Sridhar Samudrala, Kees Cook, Jean-Paul Sergent
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Paul Sergent <jpsergent@gmail.com>
commit 74a7db839308dd7d1c3f72dd1e3299784df3affb upstream.
Commit 3fcece12bc1b6 ("net: store port/representator id in
metadata_dst") dropped the options_len equality check when converting
skb_metadata_dst_cmp() to a type switch, so the memcmp length is taken
from skb a alone. When skb b carries fewer options than a, the
comparison reads past b's allocation.
Hit in practice with Cilium geneve GRO aggregation, comparing an skb
carrying 12 bytes of tunnel options against one carrying none:
memcmp: detected buffer overflow: 108 byte read of buffer size 96
WARNING: CPU: 0 PID: 15 at lib/string_helpers.c:1036 __fortify_report
__fortify_panic+0x9/0x10
skb_metadata_dst_cmp+0x11b/0x120
dev_gro_receive+0x303/0x620
gro_cell_poll+0x67/0xa0
Restore the check: unequal options_len means different metadata and no
aggregation; the memcmp only runs when both sides carry the same
options length.
Fixes: 3fcece12bc1b6 ("net: store port/representator id in metadata_dst")
Cc: stable@vger.kernel.org
Cc: Ilya Maximets <i.maximets@ovn.org>
Cc: Sasha Levin <sashal@kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>
Cc: Sridhar Samudrala <sridhar.samudrala@intel.com>
Cc: Kees Cook <kees@kernel.org>
Signed-off-by: Jean-Paul Sergent <jpsergent@gmail.com>
Link: https://patch.msgid.link/20261109082410.206140-1-jpsergent@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/dst_metadata.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/net/dst_metadata.h
+++ b/include/net/dst_metadata.h
@@ -115,6 +115,8 @@ static inline int skb_metadata_dst_cmp(c
return memcmp(&a->u.port_info, &b->u.port_info,
sizeof(a->u.port_info));
case METADATA_IP_TUNNEL:
+ if (a->u.tun_info.options_len != b->u.tun_info.options_len)
+ return 1;
return memcmp(&a->u.tun_info, &b->u.tun_info,
sizeof(a->u.tun_info) +
a->u.tun_info.options_len);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0505/1167] macsec: reject frames that decapsulate into runt Ethernet frames
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (498 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0504/1167] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0506/1167] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
` (157 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Dave Miller
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 1d5e2c57e9ffc134e14b3f837c8d7c53b508bd22 upstream.
When an SCI is unknown and the C bit is clear, macsec_handle_frame()
removes the SecTAG and the default ICV without checking how much of the
frame remains. A short frame can therefore become an skb shorter than
ETH_HLEN. eth_type_trans() cannot pull its Ethernet header, and a second
stacked MACsec device can copy stale skb headroom into a packet delivered
to a packet socket.
The matched-SCI path has a related hole: macsec_validate_skb() accepts a
short_length of one, so a frame that passes the existing length check can
still become a 13-byte Ethernet frame.
Require enough bytes for the MACsec overhead and a complete Ethernet
header before decapsulating an unknown-SCI frame. Apply the same bound
in macsec_validate_skb(), using the selected SecY's ICV length, to cover
the no-SA, synchronous-decrypt and asynchronous-decrypt delivery paths.
Leave other unknown-SCI handling unchanged.
Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/macsec.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -399,8 +399,10 @@ static bool macsec_validate_skb(struct s
int len = skb->len - 2 * ETH_ALEN;
int extra_len = macsec_extra_len(!!(h->tci_an & MACSEC_TCI_SC)) + icv_len;
- /* a) It comprises at least 17 octets */
- if (skb->len <= 16)
+ /* a) It comprises at least 17 octets. The SecTAG and ICV must
+ * also leave a complete Ethernet header.
+ */
+ if (skb->len < ETH_HLEN + extra_len)
return false;
/* b) MACsec EtherType: already checked */
@@ -1322,9 +1324,12 @@ drop_direct:
nosci:
/* 10.6.1 if the SC is not found */
cbit = !!(hdr->tci_an & MACSEC_TCI_C);
- if (!cbit)
- macsec_finalize_skb(skb, MACSEC_DEFAULT_ICV_LEN,
- macsec_extra_len(macsec_skb_cb(skb)->has_sci));
+ if (!cbit) {
+ len = macsec_extra_len(macsec_skb_cb(skb)->has_sci);
+ if (skb->len < ETH_HLEN + len + MACSEC_DEFAULT_ICV_LEN)
+ goto drop_nosc;
+ macsec_finalize_skb(skb, MACSEC_DEFAULT_ICV_LEN, len);
+ }
list_for_each_entry_rcu(macsec, &rxd->secys, secys) {
struct sk_buff *nskb;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0506/1167] mctp: accept MSG_CMSG_COMPAT in recvmsg
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (499 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0505/1167] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0507/1167] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
` (156 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Davidlohr Bueso, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Davidlohr Bueso <dave@stgolabs.net>
commit 350e1d0d3b386fcc0cff2d37aa920fab4800bf72 upstream.
32-bit userspace running on a 64-bit kernel is unable to receive MCTP
messages on an AF_MCTP socket, even though sending succeeds. There is
nothing for MCTP to do with it beyond not rejecting it, as af_packet,
af_key and can/isotp already do, for example.
Fixes: 833ef3b91de6 ("mctp: Populate socket implementation")
Cc: stable@vger.kernel.org
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://patch.msgid.link/20261105160704.2546031-1-dave@stgolabs.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mctp/af_mctp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -212,7 +212,7 @@ static int mctp_recvmsg(struct socket *s
u8 type;
int rc;
- if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
+ if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK | MSG_CMSG_COMPAT))
return -EOPNOTSUPP;
skb = skb_recv_datagram(sk, flags, &rc);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0507/1167] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (500 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0506/1167] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0508/1167] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
` (155 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dragos Tatulea, Tariq Toukan,
Jiabin Deng, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiabin Deng <dengjiabin2023@gmail.com>
commit 68c183619f24982a635930697bf8e148f2d78f71 upstream.
When SHAMPO and relaxed ordering writes are enabled, aligned RQ end
padding can corrupt received TCP data. Due to reordering, alignment
padding written at the end of one packet can overwrite data from the
next packet.
The current RQ end padding selection avoids alignment padding for LRO,
but not for SHAMPO. Extend the condition to SHAMPO to prevent this
corruption.
The issue was observed in a two-host test using a BlueField-3 NIC and
an NVIDIA H20 GPU. In the original test with MTU 1500, 354 of 400
transfers contained corrupted data before the fix. After applying this
change, all 400 transfers across eight message sizes from 32 KiB to
4 MiB, with 50 transfers per size, completed successfully, with no
incorrect bytes or corrupted intervals.
Fixes: e5ca8fb08ab2 ("net/mlx5e: Add control path for SHAMPO feature")
Closes: https://lore.kernel.org/r/CAFxp=AY2cVRQrZvB9WNnigbsobuw11NMG-cagHx0_V+ur2ToFw@mail.gmail.com
Link: https://lore.kernel.org/r/atZKOtjrb9HKSNHF@dtatulea-c5.nvidia.com
Suggested-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jiabin Deng <dengjiabin2023@gmail.com>
Link: https://patch.msgid.link/20261110035723.26587-1-dengjiabin2023@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
@@ -941,10 +941,11 @@ static void mlx5e_build_rx_cq_param(stru
static u8 rq_end_pad_mode(struct mlx5_core_dev *mdev, struct mlx5e_params *params)
{
- bool lro_en = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO;
+ bool no_pad = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO ||
+ params->packet_merge.type == MLX5E_PACKET_MERGE_SHAMPO;
bool ro = MLX5_CAP_GEN(mdev, relaxed_ordering_write);
- return ro && lro_en ?
+ return ro && no_pad ?
MLX5_WQ_END_PAD_MODE_NONE : MLX5_WQ_END_PAD_MODE_ALIGN;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0508/1167] net/rds: Do not unpin a page after a failed atomic pin
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (501 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0507/1167] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0509/1167] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
` (154 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Kyle Zeng, Allison Henderson,
Dave Miller
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 8d5ce4751fad9499ea408163af7f410f18a85782 upstream.
rds_cmsg_atomic() assumes that a non-NULL output from rds_pin_pages()
represents a pin that it owns. However, pin_user_pages_fast() can roll
back a fast-GUP pin after racing fork() and then fail in the slow path,
for example after a concurrent mprotect(PROT_NONE). The output slot can
still contain the already-unpinned page.
The common error path calls unpin_user_page() on that stale pointer.
This can consume another subsystem's pin and allow the page to be freed
while it is still in use. A local unprivileged reproducer triggers a
KASAN use-after-free write through an io_uring registered buffer.
Clear page when rds_pin_pages() does not return one. The error path
continues to release the page on errors after a successful pin, and
successful requests retain their existing ownership and behavior. All
four RDS atomic ancillary operations share this path.
The issue was found by an LLM.
Fixes: 15133f6e67d8 ("RDS: Implement atomic operations")
Cc: stable@kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Allison Henderson <achender@kernel.org>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/rds/rdma.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -960,8 +960,11 @@ int rds_cmsg_atomic(struct rds_sock *rs,
}
ret = rds_pin_pages(args->local_addr, 1, &page, 1);
- if (ret != 1)
+ if (ret != 1) {
+ /* A failed pin can leave a stale page pointer. */
+ page = NULL;
goto err;
+ }
ret = 0;
sg_set_page(rm->atomic.op_sg, page, 8, offset_in_page(args->local_addr));
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0509/1167] net/smc: fix lgr/lnk lifetime vs diag reader race
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (502 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0508/1167] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0510/1167] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
` (153 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mahanta Jambigi, Sidraya Jayagond,
Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahanta Jambigi <mjambigi@linux.ibm.com>
commit d7900fa51642fbc2a5a03354238e71050a7d391d upstream.
The diag dump walks the socket hash table under a read_lock and
dereferences conn->lgr and conn->lnk. Several paths expose a window
where a hashed socket has freed or partially freed conn/lgr/lnk state.
First, smc_conn_abort() calls smc_conn_free() during early handshake
aborts while the socket is still hashed in SMC_INIT, synchronously
freeing the lgr on the smc_lgr_cleanup_early() path without holding the
hash write_lock. A concurrent diag reader can load a non-NULL conn->lgr
and dereference it after the kfree. Skip the connection, link group and
DMB attributes in __smc_diag_dump() for sockets in SMC_INIT or
SMC_CLOSED or fallen back to TCP, and take diag_mode from an is_smcd
flag cached at connection creation.
The state filter alone does not close the race. A connection aborted by
a failed handshake can keep its alert token, because smc_conn_free()
skips the unregister when smc_lgr_terminate_sched() has emptied
lgr->list; close_work may also have been queued before the abort, as the
CDC receive path is not excluded by the handshake's socket lock.
smc_close_passive_work() would then move the hashed socket from SMC_INIT
to SMC_APPCLOSEWAIT1 or SMC_PROCESSABORT, states the filter does not
cover, and later run a passive-closing sock_put() that
smc_connect_decline_fallback() dropped already. Return early from
smc_close_passive_work() when the connection was freed; the check holds
the socket lock that every smc_conn_free() caller holds as well, so a
hashed socket with a freed connection stays in SMC_INIT or SMC_CLOSED
until release.
This changes the sock_diag output for such sockets: the connection, link
group and DMB attributes are omitted, which smcss does not read for
sockets in these states, while SMC_DIAG_FALLBACK is still reported and
an SMC-D socket in SMC_INIT or SMC_CLOSED still reports
SMC_DIAG_MODE_SMCD from the cached flag. A fallback socket is a plain
TCP socket with no SMC connection state to report; the stale conn fields
left behind by smc_conn_abort() must not be read.
Second, in smc_conn_kill() on SMC-D with dmb_nocopy, smcd_buf_detach()
NULLs and frees conn->sndbuf_desc while the socket is still hashed. A
concurrent diag reader entering the CONNINFO block can dereference the
freed descriptor. Unhash the socket right before smcd_buf_detach(). As a
result, killed ACTIVE and APPCLOSEWAIT sockets that are still open are
no longer visible to smcss on loopback-ism devices.
Third, in the terminal teardown branches of smc_close_active_abort()
(PEERCLOSEWAIT and PROCESSABORT groups) and in smc_close_passive_work(),
smc_conn_free() drops lgr and lnk references while the socket is still
hashed. Unhash immediately before each smc_conn_free() call at those
sites. Sockets killed in those close states are therefore unhashed, and
their inuse accounting dropped, before close(), even if the fd is still
open.
Fourth, use smp_load_acquire() / smp_store_release() on sk_state to
order these checks on weakly ordered CPUs. A reader that observes
SMC_ACTIVE is guaranteed to see the connection setup that preceded the
store; a reader that observes SMC_CLOSED from smc_listen_out_err() skips
the connection fields in any case, so that particular store is hardening
kept for uniformity, not a required ordering.
Additionally, in __smc_diag_dump(), use the cached link->ibname instead
of link->smcibdev->ibdev->name, avoiding a NULL pointer dereference or
use-after-free of the IB device when __smcr_link_clear() zeroes the link
during concurrent SMC-R link failover. The link data is still read
without conns_lock or send_lock, so a dump racing a failover may
transiently report zeroed or mixed link fields; this does not affect
memory safety and the next dump reports the new link. Like the SMC
netlink link dump and the tracepoints, the name is the one cached at
link creation time.
Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets")
Fixes: 2a0674fffb6b ("net/smc: improve abnormal termination of link groups")
Fixes: 46c28dbd4c23 ("net/smc: no socket state changes in tasklet context")
Fixes: 9dbe086c69b8 ("net/smc: fix invalid link access in dumping SMC-R connections")
Fixes: ae2be35cbed2 ("net/smc: {at|de}tach sndbuf to peer DMB if supported")
Cc: stable@vger.kernel.org
Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
Reviewed-by: Sidraya Jayagond <sidraya@linux.ibm.com>
Link: https://patch.msgid.link/20261102083122.1098393-1-mjambigi@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/smc/af_smc.c | 10 +++++-----
net/smc/smc.h | 1 +
net/smc/smc_close.c | 14 ++++++++++++++
net/smc/smc_core.c | 8 +++++++-
net/smc/smc_diag.c | 12 ++++++++----
5 files changed, 35 insertions(+), 10 deletions(-)
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -957,7 +957,7 @@ static int smc_connect_fallback(struct s
smc_copy_sock_settings_to_clc(smc);
smc->connect_nonblock = 0;
if (smc->sk.sk_state == SMC_INIT)
- smc->sk.sk_state = SMC_ACTIVE;
+ smp_store_release(&smc->sk.sk_state, SMC_ACTIVE);
return 0;
}
@@ -1361,7 +1361,7 @@ static int smc_connect_rdma(struct smc_s
smc_copy_sock_settings_to_clc(smc);
smc->connect_nonblock = 0;
if (smc->sk.sk_state == SMC_INIT)
- smc->sk.sk_state = SMC_ACTIVE;
+ smp_store_release(&smc->sk.sk_state, SMC_ACTIVE);
return 0;
connect_abort:
@@ -1464,7 +1464,7 @@ static int smc_connect_ism(struct smc_so
smc_copy_sock_settings_to_clc(smc);
smc->connect_nonblock = 0;
if (smc->sk.sk_state == SMC_INIT)
- smc->sk.sk_state = SMC_ACTIVE;
+ smp_store_release(&smc->sk.sk_state, SMC_ACTIVE);
return 0;
connect_abort:
@@ -1943,7 +1943,7 @@ static void smc_listen_out_connected(str
struct sock *newsmcsk = &new_smc->sk;
if (newsmcsk->sk_state == SMC_INIT)
- newsmcsk->sk_state = SMC_ACTIVE;
+ smp_store_release(&newsmcsk->sk_state, SMC_ACTIVE);
smc_listen_out(new_smc);
}
@@ -1957,7 +1957,7 @@ static void smc_listen_out_err(struct sm
this_cpu_inc(net->smc.smc_stats->srv_hshake_err_cnt);
if (newsmcsk->sk_state == SMC_INIT)
sock_put(&new_smc->sk); /* passive closing */
- newsmcsk->sk_state = SMC_CLOSED;
+ smp_store_release(&newsmcsk->sk_state, SMC_CLOSED);
smc_listen_out(new_smc);
}
--- a/net/smc/smc.h
+++ b/net/smc/smc.h
@@ -156,6 +156,7 @@ struct smc_connection {
struct rb_node alert_node;
struct smc_link_group *lgr; /* link group of connection */
struct smc_link *lnk; /* assigned SMC-R link */
+ bool is_smcd; /* SMC-R or SMC-D connection */
u32 alert_token_local; /* unique conn. id */
u8 peer_rmbe_idx; /* from tcp handshake */
int peer_rmbe_size; /* size of peer rx buffer */
--- a/net/smc/smc_close.c
+++ b/net/smc/smc_close.c
@@ -154,6 +154,7 @@ void smc_close_active_abort(struct smc_s
if (sk->sk_state != SMC_PEERABORTWAIT)
break;
sk->sk_state = SMC_CLOSED;
+ sk->sk_prot->unhash(sk);
smc_conn_free(&smc->conn);
release_clcsock = true;
sock_put(sk); /* passive closing */
@@ -165,6 +166,7 @@ void smc_close_active_abort(struct smc_s
if (sk->sk_state != SMC_PEERABORTWAIT)
break;
sk->sk_state = SMC_CLOSED;
+ sk->sk_prot->unhash(sk);
smc_conn_free(&smc->conn);
release_clcsock = true;
break;
@@ -367,6 +369,17 @@ static void smc_close_passive_work(struc
lock_sock(sk);
old_state = sk->sk_state;
+ if (conn->freed) {
+ /* conn->freed is set under the socket lock, which is
+ * held here as well, so this cannot race with the free; the
+ * state machine and its postponed sock_put() are not owed
+ * anymore
+ */
+ release_sock(sk);
+ sock_put(sk); /* sock_hold done by schedulers of close_work */
+ return;
+ }
+
rxflags = &conn->local_rx_ctrl.conn_state_flags;
if (rxflags->peer_conn_abort) {
/* peer has not received all data */
@@ -433,6 +446,7 @@ wakeup:
sk->sk_state_change(sk);
if ((sk->sk_state == SMC_CLOSED) &&
(sock_flag(sk, SOCK_DEAD) || !sk->sk_socket)) {
+ sk->sk_prot->unhash(sk);
smc_conn_free(conn);
if (smc->clcsock)
release_clcsock = true;
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -1460,8 +1460,10 @@ static void smc_conn_kill(struct smc_con
tasklet_kill(&conn->rx_tsklet);
else
tasklet_unlock_wait(&conn->rx_tsklet);
- if (smc_ism_support_dmb_nocopy(conn->lgr->smcd))
+ if (smc_ism_support_dmb_nocopy(conn->lgr->smcd)) {
+ smc->sk.sk_prot->unhash(&smc->sk);
smcd_buf_detach(conn);
+ }
} else {
smc_cdc_wait_pend_tx_wr(conn);
}
@@ -1981,6 +1983,10 @@ create:
goto out;
}
}
+ /* cache the connection type: smc_diag reads it after
+ * smc_conn_free() dropped the link group reference
+ */
+ conn->is_smcd = conn->lgr->is_smcd;
smc_lgr_hold(conn->lgr); /* lgr_put in smc_conn_free() */
if (!conn->lgr->is_smcd)
smcr_link_hold(conn->lnk); /* link_put in smc_conn_free() */
--- a/net/smc/smc_diag.c
+++ b/net/smc/smc_diag.c
@@ -87,10 +87,10 @@ static int __smc_diag_dump(struct sock *
r = nlmsg_data(nlh);
smc_diag_msg_common_fill(r, sk);
- r->diag_state = sk->sk_state;
+ r->diag_state = smp_load_acquire(&sk->sk_state);
if (smc->use_fallback)
r->diag_mode = SMC_DIAG_MODE_FALLBACK_TCP;
- else if (smc_conn_lgr_valid(&smc->conn) && smc->conn.lgr->is_smcd)
+ else if (smc->conn.is_smcd)
r->diag_mode = SMC_DIAG_MODE_SMCD;
else
r->diag_mode = SMC_DIAG_MODE_SMCR;
@@ -103,6 +103,10 @@ static int __smc_diag_dump(struct sock *
if (nla_put(skb, SMC_DIAG_FALLBACK, sizeof(fallback), &fallback) < 0)
goto errout;
+ if (r->diag_state == SMC_INIT || r->diag_state == SMC_CLOSED ||
+ smc->use_fallback)
+ goto out;
+
if ((req->diag_ext & (1 << (SMC_DIAG_CONNINFO - 1))) &&
smc->conn.alert_token_local) {
struct smc_connection *conn = &smc->conn;
@@ -154,8 +158,7 @@ static int __smc_diag_dump(struct sock *
.lnk[0].link_id = link->link_id,
};
- memcpy(linfo.lnk[0].ibname, link->smcibdev->ibdev->name,
- sizeof(link->smcibdev->ibdev->name));
+ memcpy(linfo.lnk[0].ibname, link->ibname, sizeof(link->ibname));
smc_gid_be16_convert(linfo.lnk[0].gid, link->gid);
smc_gid_be16_convert(linfo.lnk[0].peer_gid, link->peer_gid);
@@ -183,6 +186,7 @@ static int __smc_diag_dump(struct sock *
goto errout;
}
+out:
nlmsg_end(skb, nlh);
return 0;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0510/1167] net: bridge: use one headroom snapshot for ND replies
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (503 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0509/1167] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0511/1167] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
` (152 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, TencentOS Corvus AI,
Jun Yang, Nikolay Aleksandrov, Ido Schimmel, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jun Yang <junvyyang@tencent.com>
commit e573df093ef849bb7c763aed591cb6556b110671 upstream.
br_nd_send() calls LL_RESERVED_SPACE(dev) once to size the reply skb and
again to reserve its headroom. When a port requiring more headroom is
added to the bridge, br_add_if() can increase dev->needed_headroom
between the two calls. The reserved headroom can then exceed the space
accounted for by alloc_skb().
Take one headroom snapshot and use it for both the allocation size and
skb_reserve().
Fixes: ed842faeb2bd ("bridge: suppress nd pkts on BR_NEIGH_SUPPRESS ports")
Cc: stable@kernel.org
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Signed-off-by: Jun Yang <junvyyang@tencent.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261103075439.43644-1-juny24602@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bridge/br_arp_nd_proxy.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/bridge/br_arp_nd_proxy.c
+++ b/net/bridge/br_arp_nd_proxy.c
@@ -259,6 +259,7 @@ static void br_nd_send(struct net_bridge
struct sk_buff *reply;
struct ipv6hdr *pip6;
int na_olen = 8; /* opt hdr + ETH_ALEN for target */
+ int headroom;
int ns_olen;
int i, len;
u8 *daddr;
@@ -268,7 +269,8 @@ static void br_nd_send(struct net_bridge
if (!dev || skb_linearize(request))
return;
- len = LL_RESERVED_SPACE(dev) + sizeof(struct ipv6hdr) +
+ headroom = LL_RESERVED_SPACE(dev);
+ len = headroom + sizeof(struct ipv6hdr) +
sizeof(*na) + na_olen + dev->needed_tailroom;
reply = alloc_skb(len, GFP_ATOMIC);
@@ -277,7 +279,7 @@ static void br_nd_send(struct net_bridge
reply->protocol = htons(ETH_P_IPV6);
reply->dev = dev;
- skb_reserve(reply, LL_RESERVED_SPACE(dev));
+ skb_reserve(reply, headroom);
skb_push(reply, sizeof(struct ethhdr));
skb_set_mac_header(reply, 0);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0511/1167] net: dsa: microchip: initialize the IRQ access mutex
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (504 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0510/1167] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0512/1167] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
` (151 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tapio Reijonen, Daniel Machon,
Paolo Abeni
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tapio Reijonen <tapio.reijonen@vaisala.com>
commit ba1dc196502f3435f4ae53ed6745caacf066f83e upstream.
ksz_switch_register() initializes dev_mutex, regmap_mutex, alu_mutex and
vlan_mutex but not lock_irq, which the IRQ chip takes in its bus lock
callbacks on every mask and unmask of a switch interrupt, and the PTP
code takes the same way. The zeroed mutex happens to work on the
uncontended fast path, but with CONFIG_DEBUG_MUTEXES the first lock,
from the IRQ domain mapping during probe, warns:
DEBUG_LOCKS_WARN_ON(lock->magic != lock)
WARNING: kernel/locking/mutex.c:625 at __mutex_lock
...
ksz_irq_domain_map
irq_domain_associate_locked
irq_create_mapping_affinity
ksz_irq_common_setup
ksz9477_setup
dsa_register_switch
ksz_spi_probe
and turns lock debugging off for the rest of the boot.
Initialize it with the other mutexes.
Triggered at every boot of a KSZ9897S over SPI on an i.MX6 SoloX board
with CONFIG_DEBUG_MUTEXES, on v7.4-rc1 and earlier. With this patch the
same board boots with lock debugging enabled and it stays enabled
(debug_locks 1) through two hours of unrelated stress tests.
Fixes: c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link")
Cc: stable@vger.kernel.org
Signed-off-by: Tapio Reijonen <tapio.reijonen@vaisala.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261104-ksz-irq-mutex-init-v1-1-e3bb7d9dbd80@vaisala.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/dsa/microchip/ksz_common.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -3564,6 +3564,7 @@ int ksz_switch_register(struct ksz_devic
mutex_init(&dev->regmap_mutex);
mutex_init(&dev->alu_mutex);
mutex_init(&dev->vlan_mutex);
+ mutex_init(&dev->lock_irq);
ret = ksz_switch_detect(dev);
if (ret)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0512/1167] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (505 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0511/1167] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0513/1167] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
` (150 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lukáš Lalinský,
Jens Axboe, Dave Miller
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
commit bdc350ddbcbe4788158019d4d8e8e9345cb16235 upstream.
____sys_sendmsg() and ____sys_recvmsg() turn O_NONBLOCK on the socket
into MSG_DONTWAIT. That is right for the system calls, but io_uring uses
__sys_sendmsg_sock() and __sys_recvmsg_sock() for a blocking attempt
from io-wq as well, after the non-blocking attempts with MSG_DONTWAIT
have failed. On an O_NONBLOCK socket that attempt can't block either and
the request completes with -EAGAIN, unlike IORING_OP_SEND and RECV,
which call sock_sendmsg() and sock_recvmsg() directly and don't look at
O_NONBLOCK at all.
Move the O_NONBLOCK handling to ___sys_sendmsg() and ___sys_recvmsg(),
which the sendmsg, sendmmsg, recvmsg and recvmmsg system calls go
through. The io_uring helpers then pass the flags the caller asked for.
Cc: stable@vger.kernel.org
Fixes: 0fa03c624d8f ("io_uring: add support for sendmsg()")
Fixes: aa1fa28fc73e ("io_uring: add support for recvmsg()")
Link: https://lore.kernel.org/io-uring/a5589b66-9a20-4b1c-a0f1-1b5b31af3667@app.fastmail.com/
Reported-by: Lukáš Lalinský <lukas@lalinsky.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/socket.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--- a/net/socket.c
+++ b/net/socket.c
@@ -2577,8 +2577,6 @@ static int ____sys_sendmsg(struct socket
flags &= ~MSG_INTERNAL_SENDMSG_FLAGS;
msg_sys->msg_flags = flags;
- if (sock->file->f_flags & O_NONBLOCK)
- msg_sys->msg_flags |= MSG_DONTWAIT;
/*
* If this is sendmmsg() and current destination address is same as
* previously succeeded address, omit asking LSM's decision.
@@ -2642,6 +2640,9 @@ static int ___sys_sendmsg(struct socket
msg_sys->msg_name = &address;
+ if (sock->file->f_flags & O_NONBLOCK)
+ flags |= MSG_DONTWAIT;
+
err = sendmsg_copy_msghdr(msg_sys, msg, flags, &iov);
if (err < 0)
return err;
@@ -2805,9 +2806,6 @@ static int ____sys_recvmsg(struct socket
/* We assume all kernel code knows the size of sockaddr_storage */
msg_sys->msg_namelen = 0;
- if (sock->file->f_flags & O_NONBLOCK)
- flags |= MSG_DONTWAIT;
-
if (unlikely(nosec))
err = sock_recvmsg_nosec(sock, msg_sys, flags);
else
@@ -2849,6 +2847,9 @@ static int ___sys_recvmsg(struct socket
struct sockaddr __user *uaddr;
ssize_t err;
+ if (sock->file->f_flags & O_NONBLOCK)
+ flags |= MSG_DONTWAIT;
+
err = recvmsg_copy_msghdr(msg_sys, msg, flags, &uaddr, &iov);
if (err < 0)
return err;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0513/1167] net: mana: report RX checksum offload for IPv6
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (506 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.6 0512/1167] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0514/1167] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
` (149 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haiyang Zhang, Hamza Mahfooz,
Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
commit bbcd02741c4cfbf9e1c59b1906f21ef772bd15eb upstream.
The hardware validates TCP and UDP checksums for both IPv4 and IPv6 and
reports the result in rx_tcp_csum_succeed and rx_udp_csum_succeed.
However, mana_rx_skb() also requires rx_iphdr_csum_succeed before it
sets CHECKSUM_UNNECESSARY. That bit is only set for IPv4 (since IPv6
has no header checksum), so IPv6 TCP and UDP traffic is always
checksummed again in software.
So, only look at the L4 result. For IPv4 this makes no material
difference since CHECKSUM_UNNECESSARY only covers the L4 checksum, and
ip_rcv_core() always verifies the IPv4 header checksum in software.
Between two Azure Standard_E16s_v6 VMs (VF enabled), IPv6 TCP and UDP
packets (including VXLAN over IPv6), now arrive with
CHECKSUM_UNNECESSARY instead of CHECKSUM_NONE, so GRO no longer
checksums them in software. Calls to __skb_gro_checksum_complete() on
the receiver during an 8 second iperf3 run:
before after
TCP/IPv4, 12.2 Gbps 23 28
TCP/IPv6, 12.1 Gbps 8728419 25
UDP/IPv6, 1.5 Gbps 1071380 20
TCP/VXLAN/IPv6, 10.9 Gbps 7934373 18
Cc: stable@vger.kernel.org
Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Link: https://patch.msgid.link/20261109142856.779955-1-hamzamahfooz@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -1554,10 +1554,9 @@ static void mana_rx_skb(void *buf_va, bo
skb_checksum_none_assert(skb);
skb_record_rx_queue(skb, rxq_idx);
- if ((ndev->features & NETIF_F_RXCSUM) && cqe->rx_iphdr_csum_succeed) {
- if (cqe->rx_tcp_csum_succeed || cqe->rx_udp_csum_succeed)
- skb->ip_summed = CHECKSUM_UNNECESSARY;
- }
+ if ((ndev->features & NETIF_F_RXCSUM) &&
+ (cqe->rx_tcp_csum_succeed || cqe->rx_udp_csum_succeed))
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
if (cqe->rx_hashtype != 0 && (ndev->features & NETIF_F_RXHASH)) {
hash_value = cqe->ppi[0].pkt_hash;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0514/1167] tsacct: Keep task begin times stable across suspend
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (507 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0513/1167] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0515/1167] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
` (148 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Nesterov, Thomas Gleixner,
Hungyu Lin
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hungyu Lin <dennylin0707@gmail.com>
commit c49b3c20a2d0b22700e2100a527e68e829ece7f0 upstream.
bacct_add_tsk() derives ac_btime and ac_btime64 by subtracting a
CLOCK_MONOTONIC elapsed duration from CLOCK_REALTIME. MONOTONIC stops
during suspend while REALTIME continues, so querying an existing task
after resume moves its reported begin time forward by the time spent
suspended.
Calculate the begin time from the wall-clock boot timestamp and the
task's CLOCK_BOOTTIME start timestamp instead. This accounts for suspend
and adds the nanoseconds before truncating to seconds. Keep ac_etime and
ac_tgetime on CLOCK_MONOTONIC and retain the existing rebasing when the
wall clock is adjusted.
The new begin time can be negative: setting CLOCK_REALTIME is bounded
by CLOCK_MONOTONIC, which excludes suspend, rather than CLOCK_BOOTTIME.
A permitted backward clock adjustment after suspend can therefore put
the task's begin time before the epoch. Clamp ac_btime64 at zero too,
instead of wrapping in the unsigned field, and retain its positive range.
Fixes: f3cef7a99469 ("[PATCH] csa: basic accounting over taskstats")
Reported-by: Oleg Nesterov <oleg@redhat.com>
Suggested-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20130611200600.GA15168@redhat.com
Link: https://lore.kernel.org/r/alpine.DEB.2.21.1911071335320.4256@nanos.tec.linutronix.de
Link: https://patch.msgid.link/20261030054227.35453-3-dennylin0707@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/tsacct.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/kernel/tsacct.c
+++ b/kernel/tsacct.c
@@ -24,7 +24,7 @@ void bacct_add_tsk(struct user_namespace
const struct cred *tcred;
u64 utime, stime, utimescaled, stimescaled;
u64 now_ns, delta;
- time64_t btime;
+ struct timespec64 btime;
BUILD_BUG_ON(TS_COMM_LEN < TASK_COMM_LEN);
@@ -39,9 +39,11 @@ void bacct_add_tsk(struct user_namespace
do_div(delta, NSEC_PER_USEC);
stats->ac_etime = delta;
/* Convert to seconds for btime (note y2106 limit) */
- btime = ktime_get_real_seconds() - div_u64(delta, USEC_PER_SEC);
- stats->ac_btime = clamp_t(time64_t, btime, 0, U32_MAX);
- stats->ac_btime64 = btime;
+ getboottime64(&btime);
+ btime = timespec64_add(btime, ns_to_timespec64(tsk->start_boottime));
+ stats->ac_btime = clamp_t(time64_t, btime.tv_sec, 0, U32_MAX);
+ /* Setting the clock back after suspend can make btime negative. */
+ stats->ac_btime64 = max_t(time64_t, btime.tv_sec, 0);
if (tsk->flags & PF_EXITING)
stats->ac_exitcode = tsk->exit_code;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0515/1167] tls: only install push_pending_record for a TX context
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (508 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0514/1167] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0516/1167] seg6: validate state in netfilter continuations Greg Kroah-Hartman
` (147 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rishikesh Jethwani, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rishikesh Jethwani <rjethwani@purestorage.com>
commit c47e766c5307c06a78304582b2b5b5ab01ee1358 upstream.
tls_set_sw_offload() assigns ctx->push_pending_record for both
directions, but the hook is a TX-side dispatcher. On a socket whose TX
side is HW offloaded, tls_set_device_offload() installs
tls_device_push_pending_record(); any later TLS_RX setsockopt
overwrites it with tls_sw_push_pending_record(), because
tls_set_device_offload_rx() itself calls tls_set_sw_offload(sk, 0, NULL)
for the software half of a successful HW RX offload, and so does the
fallback when the RX offload is declined (NIC with TX-only offload,
tls_dev_add() failure).
>From then on tls_handle_open_record() (a TLS_SET_RECORD_TYPE cmsg after
a MSG_MORE send, or the close path with a pending writer) runs
tls_sw_push_pending_record() against priv_ctx_tx, which is a
struct tls_offload_context_tx, not a struct tls_sw_context_tx, and
reads open_rec from inside the offload context. On x86_64 without lock
debugging that field overlays sg_tx_data[2].dma_address, which is never
set, so the push is silently skipped and the data buffered by the
MSG_MORE send is later sent under the cmsg's record type, e.g.
application data in a handshake or alert record. Enabling
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_LOCK_ALLOC and CONFIG_LOCKDEP, but
not CONFIG_LOCK_STAT, in the tested x86_64 configuration moves open_rec
over sg_tx_data[5].page_link. Once populated, its page pointer and
scatterlist flags are interpreted as a tls_rec pointer and dereferenced
while reading msg_plaintext.sg.size.
Only set the hook when initialising the TX side.
Found by code review while developing TLS 1.3 HW offload rekey support.
Tested with HW TLS TX and RX offload on Mellanox ConnectX-6 Dx (Crypto
Enabled): after setting TLS_RX, send() "AAAA" with MSG_MORE, then
sendmsg() "BBBB" with a TLS_SET_RECORD_TYPE cmsg for a handshake
record. Without this patch the peer receives a single handshake record
"AAAABBBB"; with it, an application data record "AAAA" followed by a
handshake record "BBBB".
Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure")
Cc: stable@vger.kernel.org
Signed-off-by: Rishikesh Jethwani <rjethwani@purestorage.com>
Link: https://patch.msgid.link/20261102213011.4191020-1-rjethwani@purestorage.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/tls/tls_sw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -2896,7 +2896,8 @@ int tls_set_sw_offload(struct sock *sk,
}
}
- ctx->push_pending_record = tls_sw_push_pending_record;
+ if (tx)
+ ctx->push_pending_record = tls_sw_push_pending_record;
rc = crypto_aead_setkey(*aead, key, cipher_desc->key);
if (rc)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0516/1167] seg6: validate state in netfilter continuations
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (509 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0515/1167] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0517/1167] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
` (146 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vega, Sashiko, Zixuan Chai, Ren Wei,
Hangbin Liu, Pablo Neira Ayuso, Andrea Mayer, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zixuan Chai <petalzu987@gmail.com>
commit 549484dd3e80a721d51bd695f22a800d2e05bea1 upstream.
When nf_hooks_lwtunnel is enabled, End.DX4 sends decapsulated packets
through NF_INET_PRE_ROUTING. If DNAT changes the inner destination,
nf_nat_ipv4_pre_routing() drops skb_dst(), and the continuation then
dereferences the missing dst's lwtstate. This causes a KASAN NULL
pointer dereference and fatal exception panic.
End.DX6 has the same issue with IPv6 DNAT. In seg6_iptunnel,
POST_ROUTING SNAT with an outbound XFRM policy can replace the dst before
the continuation resumes.
Validate the current dst and expected lwtstate type in each NF_HOOK()
continuation before calling the existing handler. Drop packets with
missing or incompatible state while preserving direct no-hook paths.
The helpers return bool because callers only need a validity check.
Testing shows that the End.DX4 DNAT reproducer triggers a KASAN NULL
pointer dereference without this change and no longer does so with the
fix. The SNAT+ESP/XFRM reproducer also completes without the reported
fault. The in-tree End.DX4 netfilter forwarding selftest passes all four
bidirectional checks with nf_hooks_lwtunnel disabled and enabled.
Fixes: 7a3f5b0de364 ("netfilter: add netfilter hooks to SRv6 data plane")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260720204430.1886091-1-xmei5@asu.edu
Signed-off-by: Zixuan Chai <petalzu987@gmail.com>
Signed-off-by: Ren Wei <weir@nebusec.ai>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Reviewed-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Link: https://patch.msgid.link/8574739acd6f5d9eb0a5640e893122619e9f79ef.1793726355.git.petalzu987@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/seg6_iptunnel.c | 46 +++++++++++++++++++++++++++++++++++----
net/ipv6/seg6_local.c | 55 ++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 94 insertions(+), 7 deletions(-)
--- a/net/ipv6/seg6_iptunnel.c
+++ b/net/ipv6/seg6_iptunnel.c
@@ -18,6 +18,7 @@
#include <net/ip6_fib.h>
#include <net/route.h>
#include <net/seg6.h>
+#include <net/dst_metadata.h>
#include <linux/seg6.h>
#include <linux/seg6_iptunnel.h>
#include <net/addrconf.h>
@@ -58,6 +59,21 @@ static inline struct seg6_lwt *seg6_lwt_
return (struct seg6_lwt *)lwt->data;
}
+static bool seg6_skb_has_lwtstate(struct sk_buff *skb)
+{
+ struct dst_entry *dst;
+
+ if (unlikely(!skb_valid_dst(skb)))
+ return false;
+
+ dst = skb_dst(skb);
+ if (unlikely(!dst->lwtstate ||
+ dst->lwtstate->type != LWTUNNEL_ENCAP_SEG6))
+ return false;
+
+ return true;
+}
+
static inline struct seg6_iptunnel_encap *
seg6_encap_lwtunnel(struct lwtunnel_state *lwt)
{
@@ -534,6 +550,17 @@ drop:
return err;
}
+static int seg6_input_core_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return seg6_input_core(net, sk, skb);
+}
+
static int seg6_input_nf(struct sk_buff *skb)
{
struct net_device *dev = skb_dst(skb)->dev;
@@ -542,10 +569,10 @@ static int seg6_input_nf(struct sk_buff
switch (skb->protocol) {
case htons(ETH_P_IP):
return NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING, net, NULL,
- skb, NULL, dev, seg6_input_core);
+ skb, NULL, dev, seg6_input_core_nf);
case htons(ETH_P_IPV6):
return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, net, NULL,
- skb, NULL, dev, seg6_input_core);
+ skb, NULL, dev, seg6_input_core_nf);
}
return -EINVAL;
@@ -620,6 +647,17 @@ drop:
return err;
}
+static int seg6_output_core_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return seg6_output_core(net, sk, skb);
+}
+
static int seg6_output_nf(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct net_device *dev = skb_dst(skb)->dev;
@@ -627,10 +665,10 @@ static int seg6_output_nf(struct net *ne
switch (skb->protocol) {
case htons(ETH_P_IP):
return NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING, net, sk, skb,
- NULL, dev, seg6_output_core);
+ NULL, dev, seg6_output_core_nf);
case htons(ETH_P_IPV6):
return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, net, sk, skb,
- NULL, dev, seg6_output_core);
+ NULL, dev, seg6_output_core_nf);
}
return -EINVAL;
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -24,6 +24,7 @@
#include <net/addrconf.h>
#include <net/ip6_route.h>
#include <net/dst_cache.h>
+#include <net/dst_metadata.h>
#include <net/ip_tunnels.h>
#ifdef CONFIG_IPV6_SEG6_HMAC
#include <net/seg6_hmac.h>
@@ -211,6 +212,21 @@ static struct seg6_local_lwt *seg6_local
return (struct seg6_local_lwt *)lwt->data;
}
+static bool seg6_local_skb_has_lwtstate(struct sk_buff *skb)
+{
+ struct dst_entry *dst;
+
+ if (unlikely(!skb_valid_dst(skb)))
+ return false;
+
+ dst = skb_dst(skb);
+ if (unlikely(!dst->lwtstate ||
+ dst->lwtstate->type != LWTUNNEL_ENCAP_SEG6_LOCAL))
+ return false;
+
+ return true;
+}
+
static struct ipv6_sr_hdr *get_and_validate_srh(struct sk_buff *skb)
{
struct ipv6_sr_hdr *srh;
@@ -939,6 +955,17 @@ static int input_action_end_dx6_finish(s
return dst_input(skb);
}
+static int input_action_end_dx6_finish_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_local_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return input_action_end_dx6_finish(net, sk, skb);
+}
+
/* decapsulate and forward to specified nexthop */
static int input_action_end_dx6(struct sk_buff *skb,
struct seg6_local_lwt *slwt)
@@ -959,7 +986,7 @@ static int input_action_end_dx6(struct s
if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
return NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING,
dev_net(skb->dev), NULL, skb, skb->dev,
- NULL, input_action_end_dx6_finish);
+ NULL, input_action_end_dx6_finish_nf);
return input_action_end_dx6_finish(dev_net(skb->dev), NULL, skb);
drop:
@@ -1027,6 +1054,17 @@ static int input_action_end_dx4_finish(s
return dst_input(skb);
}
+static int input_action_end_dx4_finish_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_local_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return input_action_end_dx4_finish(net, sk, skb);
+}
+
static int input_action_end_dx4(struct sk_buff *skb,
struct seg6_local_lwt *slwt)
{
@@ -1047,7 +1085,7 @@ static int input_action_end_dx4(struct s
if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
return NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING,
dev_net(skb->dev), NULL, skb, skb->dev,
- NULL, input_action_end_dx4_finish);
+ NULL, input_action_end_dx4_finish_nf);
return input_action_end_dx4_finish(dev_net(skb->dev), NULL, skb);
drop:
@@ -1674,6 +1712,17 @@ static int seg6_local_input_core(struct
return rc;
}
+static int seg6_local_input_core_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_local_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return seg6_local_input_core(net, sk, skb);
+}
+
static int seg6_local_input(struct sk_buff *skb)
{
if (skb->protocol != htons(ETH_P_IPV6)) {
@@ -1684,7 +1733,7 @@ static int seg6_local_input(struct sk_bu
if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_IN,
dev_net(skb->dev), NULL, skb, skb->dev, NULL,
- seg6_local_input_core);
+ seg6_local_input_core_nf);
return seg6_local_input_core(dev_net(skb->dev), NULL, skb);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0517/1167] mptcp: reject DATA_ACKs against a reversed send interval
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (510 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0516/1167] seg6: validate state in netfilter continuations Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0518/1167] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
` (145 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Matthieu Baerts (NGI0), Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit d75e5cd72995ec2fa77ec77a593cea28e2490ff1 upstream.
ack_update_msk() samples snd_nxt before taking the data lock, but reads
snd_una after taking it. Concurrent transmission and ACK processing can
therefore leave the sampled upper bound behind snd_una. Active-open
completion also exposes a reversed interval when it initializes snd_una
to IDSN + 1 while the socket-owned state synchronization is deferred.
A peer-supplied 64-bit Data ACK half a sequence space away can pass both
wraparound comparisons against such an interval. The resulting snd_una
can make __mptcp_retrans() inflate a fragment's already_sent field. Later
ACKs can then underflow data_len and cause out-of-bounds page fragments
to be passed to TCP.
Read snd_nxt after acquiring the data lock and reject reversed intervals
before checking the received Data ACK. This keeps the interval shorter
than half the sequence space, so the existing upper-bound check cannot
accept an advance beyond snd_nxt. Preserve the existing handling of old
ACKs and keep the transmit fields under their existing socket locking.
Cc: stable@vger.kernel.org
Fixes: 7439d687b79c ("mptcp: avoid a few atomic ops in the rx path")
Fixes: 3f83d8a77eee ("mptcp: fix more tx path fields initialization")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20261104130747.1045741-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mptcp/options.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1137,9 +1137,9 @@ static void ack_update_msk(struct mptcp_
struct sock *ssk,
struct mptcp_options_received *mp_opt)
{
- u64 new_wnd_end, new_snd_una, snd_nxt = READ_ONCE(msk->snd_nxt);
+ u64 new_wnd_end, new_snd_una, old_snd_una;
struct sock *sk = (struct sock *)msk;
- u64 old_snd_una;
+ u64 snd_nxt;
mptcp_data_lock(sk);
@@ -1148,10 +1148,14 @@ static void ack_update_msk(struct mptcp_
* more dangerous than missing an ack
*/
old_snd_una = msk->snd_una;
+ snd_nxt = READ_ONCE(msk->snd_nxt);
new_snd_una = mptcp_expand_seq(old_snd_una, mp_opt->data_ack, mp_opt->ack64);
- /* ACK for data not even sent yet? Ignore.*/
- if (unlikely(after64(new_snd_una, snd_nxt)))
+ /* The active-open state sync can defer the snd_nxt update. Do not
+ * accept an ACK against a reversed interval, or beyond snd_nxt.
+ */
+ if (unlikely(before64(snd_nxt, old_snd_una) ||
+ after64(new_snd_una, snd_nxt)))
new_snd_una = old_snd_una;
new_wnd_end = new_snd_una + tcp_sk(ssk)->snd_wnd;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0518/1167] ipv4: keep XFRM headers out of corked skb lengths
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (511 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0517/1167] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0519/1167] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
` (144 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 0f47fce51a98d3d9f439c16861d519a7b833a176 upstream.
__ip_append_data() allocates space for dst.header_len in the first skb,
but includes that space in skb->len until __ip_make_skb() pulls it.
Fragment accounting uses an MTU that already excludes the XFRM headers.
As a result, the next skb can have a fraggap larger than its capped
datalen, and skb_copy_and_csum_bits() can overwrite its shared info.
For example, five AH tunnel states can reserve 500 bytes while leaving
an effective MTU of 348. With 40 bytes of IPv4 options, the second skb
has room for 288 bytes of fragment data but receives a 500-byte gap
copy. The overwritten shared info is subsequently consumed by the skb
release paths.
Reserve the XFRM headers together with the link-layer headroom instead.
This keeps skb->len, the gap-copy offsets and the trim lengths relative
to the IPv4 packet throughout corking. The network and transport header
addresses and the headroom available to XFRM at output are unchanged.
Both paged and linear allocations, including subsequent corked appends,
use the corrected accounting.
Fixes: 353e5c9abd90 ("ipv4: Fix IPsec slowpath fragmentation problem")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Link: https://patch.msgid.link/20261030042229.74068-1-kylebot@openai.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/ip_output.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1151,16 +1151,16 @@ alloc_new_skb:
*/
skb->ip_summed = csummode;
skb->csum = 0;
- skb_reserve(skb, hh_len);
+ skb_reserve(skb, hh_len + exthdrlen);
/*
* Find where to start putting bytes.
*/
- data = skb_put(skb, fraglen + exthdrlen - pagedlen);
- skb_set_network_header(skb, exthdrlen);
+ data = skb_put(skb, fraglen - pagedlen);
+ skb_reset_network_header(skb);
skb->transport_header = (skb->network_header +
fragheaderlen);
- data += fragheaderlen + exthdrlen;
+ data += fragheaderlen;
if (fraggap) {
skb->csum = skb_copy_and_csum_bits(
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0519/1167] ipv4: fib_trie: prevent speculative out-of-bounds child access
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (512 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0518/1167] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0520/1167] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
` (143 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Daniël Trujillo,
Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniël Trujillo <datrujillo@nvidia.com>
commit fd3d73286662950656f54616d0b3fea29e2dc99a upstream.
fib_table_lookup() checks the child index against the bounds before
passing it to get_child_rcu().
The index is derived from the lookup key, which in turn is derived from
flp->daddr. A userspace process can therefore influence the index by
triggering lookups for chosen destination IPv4 addresses.
If this bounds check is mispredicted as in-bounds, an out-of-bounds index
can be transiently passed to get_child_rcu(). The value loaded beyond the
child array is then treated as a node pointer. A later transient
dereference of that pointer can cause a data-dependent cache footprint.
This was found during Spectre-v1 research. Leakage was demonstrated with
instrumentation that delays branch resolution with a CLFLUSH before the
mispredicted branch and makes the leaked location deterministic for
reproducible measurement. In that setup, a userspace-controlled IPv4
lookup key was able to trigger a transient out-of-bounds child access.
The transient use of the loaded value as a pointer caused a
data-dependent cache footprint that was recoverable from userspace using
Prime+Probe. A real-world attacker would likely need to delay branch
resolution, which was not demonstrated end-to-end without the added
CLFLUSH.
Sanitize the index with array_index_nospec() before accessing the child
array. This removed the observed leakage in the described setup.
Apply the hardening before setting cindex in fib_table_lookup(), because
cindex can later be used by the backtrace path to load another child
pointer. fib_find_node() has the same pattern, with the checked index
derived from a user-provided key in fib_table_insert() and
fib_table_delete(). leaf_walk_rcu() has a similar checked cindex before
get_child_rcu(), and the traversed state can be influenced by userspace
actions. fib_find_node() runs under RTNL and leaf_walk_rcu() is not on
the packet lookup hot path, so harden those analogous accesses in the
same way. Also harden fib_trie_get_next(), where a mispredicted loop
condition could transiently read one child past the array.
I see a slowdown of roughly 10% in a microbenchmark where we call
fib_table_lookup() with 64 routes directly from inside the kernel. I
observed no slowdown in a loopback UDP sendto() microbenchmark.
Fixes: 9f9e636d4f89 ("fib_trie: Optimize fib_table_lookup to avoid wasting time on loops/variables")
Cc: stable@vger.kernel.org
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Signed-off-by: Daniël Trujillo <datrujillo@nvidia.com>
Link: https://patch.msgid.link/20261106-fib-trie-nospec-v3-1-53da6550dcf8@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/fib_trie.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -60,6 +60,7 @@
#include <linux/export.h>
#include <linux/vmalloc.h>
#include <linux/notifier.h>
+#include <linux/nospec.h>
#include <net/net_namespace.h>
#include <net/inet_dscp.h>
#include <net/ip.h>
@@ -966,6 +967,8 @@ static struct key_vector *fib_find_node(
break;
}
+ index = array_index_nospec(index, 1ul << n->bits);
+
/* keep searching until we find a perfect match leaf or NULL */
} while (IS_TNODE(n));
@@ -1471,6 +1474,8 @@ int fib_table_lookup(struct fib_table *t
if (IS_LEAF(n))
goto found;
+ index = array_index_nospec(index, 1ul << n->bits);
+
/* only record pn and cindex if we are going to be chopping
* bits later. Otherwise we are just wasting cycles.
*/
@@ -1772,6 +1777,8 @@ static struct key_vector *leaf_walk_rcu(
if (cindex >> pn->bits)
break;
+ cindex = array_index_nospec(cindex, 1ul << pn->bits);
+
/* descend into the next child */
n = get_child_rcu(pn, cindex++);
if (!n)
@@ -1793,6 +1800,8 @@ static struct key_vector *leaf_walk_rcu(
continue;
}
+ cindex = array_index_nospec(cindex, 1ul << pn->bits);
+
/* grab the next available node */
n = get_child_rcu(pn, cindex++);
if (!n)
@@ -2444,7 +2453,10 @@ static struct key_vector *fib_trie_get_n
while (!IS_TRIE(pn)) {
while (cindex < child_length(pn)) {
- struct key_vector *n = get_child_rcu(pn, cindex++);
+ struct key_vector *n;
+
+ cindex = array_index_nospec(cindex, child_length(pn));
+ n = get_child_rcu(pn, cindex++);
if (!n)
continue;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0520/1167] ipv6: fix cached route reuse for control messages
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (513 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0519/1167] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0521/1167] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
` (142 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Willem de Bruijn, Xia Yan,
Willem de Bruijn, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xia Yan <yanxia@cmss.chinamobile.com>
commit f778e80b3daf5033fb996f45c2b5d0ce1e82c0a7 upstream.
A connected IPv6 UDP or ping socket can reuse its cached route when an
SO_MARK cmsg requests another mark. A packet can then bypass a prohibit
rule instead of failing with EACCES.
ip6_sk_dst_lookup_flow() reads the cache even when connected is false.
UDP clears connected after parsing IP or socket control messages. Ping
always passes false.
Only read the cache when connected is true. Ordinary connected UDP
sends keep using the cache. Ping sends do a fresh lookup.
Found during code review of IPv6 UDP route caching. On UML, the same
connected-socket selftest fails four IPv6 cases before the fix and
passes all 54 with it.
Fixes: c6af0c227a22 ("ip: support SO_MARK cmsg")
Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Link: https://lore.kernel.org/netdev/willemdebruijn.kernel.1e0038bcc3ef8@gmail.com/
Cc: stable@vger.kernel.org
Signed-off-by: Xia Yan <yanxia@cmss.chinamobile.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261109014400.9025-1-yanxia@cmss.chinamobile.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/ip6_output.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1282,7 +1282,7 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow);
* @sk: socket which provides the dst cache and route info
* @fl6: flow to lookup
* @final_dst: final destination address for ipsec lookup
- * @connected: whether @sk is connected or not
+ * @connected: whether the flow can use and update the socket dst cache
*
* This function performs a route lookup on the given flow with the
* possibility of using the cached route in the socket if it is valid.
@@ -1299,11 +1299,14 @@ struct dst_entry *ip6_sk_dst_lookup_flow
const struct in6_addr *final_dst,
bool connected)
{
- struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
+ struct dst_entry *dst;
- dst = ip6_sk_dst_check(sk, dst, fl6);
- if (dst)
- return dst;
+ if (connected) {
+ dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
+ dst = ip6_sk_dst_check(sk, dst, fl6);
+ if (dst)
+ return dst;
+ }
dst = ip6_dst_lookup_flow(sock_net(sk), sk, fl6, final_dst);
if (connected && !IS_ERR(dst))
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0521/1167] ipv6: reject routes without an inet6_dev
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (514 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0520/1167] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0522/1167] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
` (141 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Hangbin Liu,
Yingjie Wang, Ido Schimmel, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <1075151112@qq.com>
commit 08a1eb7a634f665718ebe74e0960e242f597135e upstream.
ip6_route_output() and ip6_route_lookup() can return an error-free route
whose rt6i_idev is NULL. Lowering an external nexthop device's MTU below
IPV6_MIN_MTU tears down its inet6_dev, while fib6_ifdown() leaves routes
using nexthop objects in the FIB.
An unprivileged user with CAP_NET_ADMIN in a private user and network
namespace can construct this state. Consumers which treat a route without
an error as usable can then dereference the NULL rt6i_idev. This was
reproduced as a KASAN NULL pointer dereference in ip6_tnl_xmit().
An audit of IPv6 route and tunnel users found this unchecked
ip6_dst_idev() dereference.
A similar missing inet6_dev check was fixed in commit 1b9b5323725e
("netfilter: ip6t_rpfilter: reject routes without inet6_dev"). However,
the route construction path still marks routes without an inet6_dev as
successful, leaving every consumer responsible for the same check.
Acquire the inet6_dev reference before initializing the destination. If a
non-reject route has no inet6_dev, initialize it as RTN_UNREACHABLE instead
of a successful route. Explicit reject routes keep their original type and
error. This establishes that ordinary error-free IPv6 routes have an
inet6_dev while retaining the existing defensive checks at callers.
The modified route object builds cleanly with W=1. A full x86_64 KASAN
bzImage build completes; it reports two pre-existing kernel-doc warnings
outside this change.
Tests:
- `make W=1 net/ipv6/route.o`
- full x86_64 KASAN `bzImage` build with `W=1`
- KASAN QEMU with an unprivileged user and network namespace: after
lowering the MTU, the stale route returned `No route to host`, a normal
route still resolved, and the collect_md trigger completed without
KASAN, oops, or panic
- `tools/testing/selftests/net/ip6_tunnel.sh` in the same KASAN QEMU
Fixes: 5b98324ebe29 ("ipv6: Allow routes to use nexthop objects")
Closes: https://lore.kernel.org/netdev/DMP4WRIOGMBX.3VW2KNLBGDZ0K@gmail.com/
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Yingjie Wang <1075151112@qq.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/tencent_91DA7FD8277B509C55906702D1E425FBC906@qq.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/route.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1144,6 +1144,12 @@ static void ip6_rt_init_dst(struct rt6_i
return;
}
+ /* addrconf_ifdown() removed inet6_dev. The device can't do IPv6. */
+ if (!rt->rt6i_idev) {
+ ip6_rt_init_dst_reject(rt, RTN_UNREACHABLE);
+ return;
+ }
+
rt->dst.error = 0;
rt->dst.output = ip6_output;
@@ -1178,10 +1184,10 @@ static void ip6_rt_copy_init(struct rt6_
const struct net_device *dev = nh->fib_nh_dev;
struct fib6_info *f6i = res->f6i;
+ rt->rt6i_idev = dev ? in6_dev_get(dev) : NULL;
ip6_rt_init_dst(rt, res);
rt->rt6i_dst = f6i->fib6_dst;
- rt->rt6i_idev = dev ? in6_dev_get(dev) : NULL;
rt->rt6i_flags = res->fib6_flags;
if (nh->fib_nh_gw_family) {
rt->rt6i_gateway = nh->fib_nh_gw6;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0522/1167] ipvs: Defer application parent freeing until after RCU readers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (515 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0521/1167] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0523/1167] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
` (140 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Julian Anastasov,
Pablo Neira Ayuso
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <nicoyip.dev@gmail.com>
commit 1e0808008e44d736e57a897a51d14fa995099010 upstream.
unregister_ip_vs_app() removes each incarnation from its protocol list and
uses call_rcu() to defer freeing it, but frees the parent application
immediately. An RCU reader that already found an incarnation can still
access the parent through inc->app in ip_vs_app_inc_get().
During FTP helper module unload, the following interleaving is possible:
CPU 0 (RCU reader) CPU 1 (module unload)
tcp_app_conn_bind()
find inc in protocol list
unregister_ip_vs_app()
ip_vs_app_inc_release(inc)
list_del_rcu(&inc->p_list)
call_rcu(&inc->rcu_head, ...)
kfree(a)
ip_vs_app_inc_get(inc)
try_module_get(inc->app->module)
The helper module is already going away, so try_module_get() would fail,
but evaluating its argument first reads the freed parent. The subsequent
rcu_barrier() in pernet unregistration cannot protect this earlier free.
KASAN reported:
BUG: KASAN: slab-use-after-free in ip_vs_app_inc_get+0x7c/0x90
Call Trace:
ip_vs_app_inc_get+0x7c/0x90
tcp_app_conn_bind+0x1bc/0x290
ip_vs_conn_new+0x1915/0x20d0
ip_vs_schedule+0x697/0xea0
tcp_conn_schedule+0x489/0x820
ip_vs_in_hook+0x7bf/0x1f40
Allocated by task 88:
kmemdup_noprof+0x20/0x50
register_ip_vs_app+0x12d/0x2c0
__ip_vs_ftp_init+0x56/0x160 [ip_vs_ftp]
Freed by task 104:
kfree+0x131/0x3c0
unregister_ip_vs_app+0x2f4/0x5b0
unregister_pernet_operations+0x232/0x490
unregister_pernet_subsys+0x1c/0x30
__do_sys_delete_module+0x346/0x510
Use kfree_rcu() with the existing rcu_head to keep the parent alive until
these readers finish. Successful helper references already prevent normal
module unload, and incarnation RCU callbacks do not access the parent.
Fixes: 363c97d7435e ("ipvs: convert app locks")
Cc: stable@vger.kernel.org
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/ipvs/ip_vs_app.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -243,7 +243,7 @@ void unregister_ip_vs_app(struct netns_i
}
list_del(&a->a_list);
- kfree(a);
+ kfree_rcu(a, rcu_head);
/* decrease the module use count */
ip_vs_use_count_dec();
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0523/1167] ipvs: fix protocol data lifetime during namespace teardown
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (516 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0522/1167] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0524/1167] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
` (139 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Julian Anastasov,
Pablo Neira Ayuso
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <nicoyip.dev@gmail.com>
commit 832aa3e89e806bb2667fe4e656b705f4088b3c9d upstream.
IPVS frees its per-net protocol data before control cleanup cancels
defense work and unregisters the sysctl table. A defense worker can load
a protocol data pointer, then namespace cleanup can unlink and free that
object before the worker dereferences pd->pp or pd->next. The worker's
securetcp_lock does not serialize with protocol cleanup. A concurrent
defense-mode sysctl write can reach the same timeout update path.
KASAN reported:
BUG: KASAN: slab-use-after-free in ip_vs_protocol_timeout_change
Workqueue: events_long defense_work_handler
Call Trace:
ip_vs_protocol_timeout_change+0x1b4/0x1e0
update_defense_level+0x63e/0xd80
defense_work_handler+0x1e/0xc0
Allocated by task 125:
ip_vs_protocol_net_init+0xda/0x2f0
__ip_vs_init+0x16b/0x240
setup_net+0xfc/0x310
Freed by task 12:
ip_vs_protocol_net_cleanup+0x1d6/0x2e0
__ip_vs_cleanup_batch+0x7d/0x100
cleanup_net+0x38c/0x770
Run control cleanup before protocol cleanup so that defense work and
active sysctl handlers have finished before their protocol data is freed.
Initialize protocols before exposing the control interface, and unwind
in reverse order, to enforce the same lifetime on initialization failure.
Protocol initialization and exit do not depend on control state.
Fixes: 9330419d9aa4 ("IPVS: netns, use ip_vs_proto_data as param.")
Cc: stable@vger.kernel.org
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/ipvs/ip_vs_core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -2315,12 +2315,12 @@ static int __net_init __ip_vs_init(struc
if (ip_vs_estimator_net_init(ipvs) < 0)
goto estimator_fail;
- if (ip_vs_control_net_init(ipvs) < 0)
- goto control_fail;
-
if (ip_vs_protocol_net_init(ipvs) < 0)
goto protocol_fail;
+ if (ip_vs_control_net_init(ipvs) < 0)
+ goto control_fail;
+
if (ip_vs_app_net_init(ipvs) < 0)
goto app_fail;
@@ -2340,10 +2340,10 @@ sync_fail:
conn_fail:
ip_vs_app_net_cleanup(ipvs);
app_fail:
- ip_vs_protocol_net_cleanup(ipvs);
-protocol_fail:
ip_vs_control_net_cleanup(ipvs);
control_fail:
+ ip_vs_protocol_net_cleanup(ipvs);
+protocol_fail:
ip_vs_estimator_net_cleanup(ipvs);
estimator_fail:
net->ipvs = NULL;
@@ -2360,8 +2360,8 @@ static void __net_exit __ip_vs_cleanup_b
ipvs = net_ipvs(net);
ip_vs_conn_net_cleanup(ipvs);
ip_vs_app_net_cleanup(ipvs);
- ip_vs_protocol_net_cleanup(ipvs);
ip_vs_control_net_cleanup(ipvs);
+ ip_vs_protocol_net_cleanup(ipvs);
ip_vs_estimator_net_cleanup(ipvs);
IP_VS_DBG(2, "ipvs netns %d released\n", ipvs->gen);
net->ipvs = NULL;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0524/1167] hv_netvsc: Stop PPI parsing on invalid metadata
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (517 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0523/1167] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0525/1167] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
` (138 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Erni Sri Satya Vennela,
Haiyang Zhang, Wei Liu, Simon Horman, Dave Miller
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
commit 19a227903e65c7a9c179156485660a4e017575fe upstream.
rndis_get_ppi() uses continue when a per-packet information entry has an
invalid size or offset, or cannot hold the requested metadata. However,
the remaining length and entry pointer are only updated at the bottom
of the loop. Each error path therefore retries the same invalid entry
indefinitely, repeatedly logging the error and preventing receive
processing from completing.
Return NULL on these validation failures instead of continuing. This
terminates the lookup when malformed metadata is encountered while
preserving the existing behavior for valid entries.
The issue was reported through an internal bug-tracking system and
confirmed by manual code inspection. The pre-fix hang has not been
reproduced locally.
Fixes: 44144185951a ("hv_netvsc: Add validation for untrusted Hyper-V values")
Cc: stable@vger.kernel.org
Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Wei Liu <liuwe@microsoft.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/hyperv/rndis_filter.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -402,12 +402,12 @@ static inline void *rndis_get_ppi(struct
/* Validate ppi_offset and ppi_size */
if (ppi->size > len) {
netdev_err(ndev, "Invalid ppi size: %u\n", ppi->size);
- continue;
+ return NULL;
}
if (ppi->ppi_offset >= ppi->size) {
netdev_err(ndev, "Invalid ppi_offset: %u\n", ppi->ppi_offset);
- continue;
+ return NULL;
}
if (ppi->type == type && ppi->internal == internal) {
@@ -415,7 +415,7 @@ static inline void *rndis_get_ppi(struct
if (ppi->size - ppi->ppi_offset < ppi_size) {
netdev_err(ndev, "Invalid ppi: size %u ppi_offset %u\n",
ppi->size, ppi->ppi_offset);
- continue;
+ return NULL;
}
return (void *)((ulong)ppi + ppi->ppi_offset);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0525/1167] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (518 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0524/1167] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0526/1167] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
` (137 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
Cen Zhang (Microsoft), Pablo Neira Ayuso
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
commit 17c2e41736b62cfe444c64d67860b1fbc1e886ac upstream.
recent_proc_net_exit() removes the /proc/net/xt_recent/<name> entries of
a dying network namespace while holding spin_lock_bh(&recent_lock).
remove_proc_entry() may sleep: proc_entry_rundown() waits until every
task that is still inside the entry's file operations has left. A reader
of such an entry is counted in by proc_reg_read() before
recent_seq_start() takes recent_lock. So if a read is in flight when the
namespace is torn down, cleanup_net() sleeps in atomic context holding
the spinlock that the reader is spinning on, and neither side can ever
make progress.
An unprivileged user can trigger this from a user namespace by adding a
rule with the "recent" match and reading its proc file while the
namespace is being destroyed. As recent_lock is global, every later
attempt to take it spins forever too: the spinning can spread to all
CPUs, and network namespace teardown stops system-wide.
BUG: sleeping function called from invalid context at
kernel/sched/completion.c:116
#3: (recent_lock){+...}-{3:3}, at: recent_net_exit+0x2b/0x140
Workqueue: netns cleanup_net
Call Trace:
proc_entry_rundown+0x185/0x1b0
remove_proc_entry+0x21a/0x520
recent_net_exit+0x7f/0x140
cleanup_net+0x414/0x8f0
...
rcu: INFO: rcu_preempt self-detected stall on CPU
Call Trace:
queued_spin_lock_slowpath+0x313/0xc20
recent_seq_start+0x87/0x1b0
seq_read_iter+0x265/0x11e0
proc_reg_read+0x1ab/0x270
Fix by taking recent_mutex instead of recent_lock. According to
commit a0e889bb1bdc ("[NETFILTER]: recent match: fix "sleeping function
called from invalid context""), recent_mutex is the lock to use here: it
protects recent_net->tables and was introduced so that proc entries are
created and removed without recent_lock held, because those calls may
sleep. hashlimit_proc_net_exit() does the same for xt_hashlimit.
Fixes: 665e205c16c1 ("netfilter: xt_recent: fix namespace destroy path")
Cc: stable@vger.kernel.org
Cc: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/xt_recent.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -649,14 +649,15 @@ static void __net_exit recent_proc_net_e
/* recent_net_exit() is called before recent_mt_destroy(). Make sure
* that the parent xt_recent proc entry is empty before trying to
- * remove it.
+ * remove it. Use recent_mutex instead of recent_lock since
+ * remove_proc_entry() may sleep.
*/
- spin_lock_bh(&recent_lock);
+ mutex_lock(&recent_mutex);
list_for_each_entry(t, &recent_net->tables, list)
remove_proc_entry(t->name, recent_net->xt_recent);
recent_net->xt_recent = NULL;
- spin_unlock_bh(&recent_lock);
+ mutex_unlock(&recent_mutex);
remove_proc_entry("xt_recent", net->proc_net);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0526/1167] netfilter: flowtable: extend ct timeout of offloaded GRE flows
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (519 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0525/1167] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0527/1167] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
` (136 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+521f7e7e2b974abde99a,
Michail Andreas Michalopoulos, Pablo Neira Ayuso
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
commit 46ecda278f6eedffb2898d41e3e56757c996a41f upstream.
Since commit 03428ca5cee9 ("netfilter: conntrack: rework offload nf_conn
timeout extension logic"), the flowtable gc worker extends the timeout
of an offloaded conntrack entry from nf_flow_table_extend_ct_timeout()
once it falls below 5 minutes. That function only knows about TCP and
UDP and hits WARN_ON_ONCE() for any other layer 4 protocol. However,
GRE flows can be offloaded too, both via nft_flow_offload and act_ct,
since commit 4e8d9584d154 ("netfilter: flowtable: Support GRE").
The timeout of an offloaded GRE entry drops below that threshold as soon
as a packet of the flow still goes through conntrack. With ip6gre
tunnels using the default encapsulation limit this is ordinary traffic:
the flowtable does not parse the Destination Options header in front of
GRE, so every packet of the flow takes the classic forwarding path. It
also happens for a packet with ttl <= 1, which the flowtable fast path
passes up to the classic forwarding path. nf_conntrack_gre_packet() then
refreshes ct->timeout to the GRE stream timeout (180 seconds by default),
and the next gc run triggers, as reported by syzbot:
WARNING: net/netfilter/nf_flow_table_core.c:553 at nf_flow_table_extend_ct_timeout+0x1ee/0x2f0
Workqueue: events_power_efficient nf_flow_offload_work_gc
Call Trace:
nf_flow_offload_gc_step+0x545/0x7b0
nf_flow_table_iterate+0x13c/0x1f0
nf_flow_offload_work_gc+0x22/0x70
process_scheduled_works+0xc3d/0x1630
worker_thread+0xa47/0xfb0
kthread+0x38b/0x480
Besides the splat, which panics the machine with panic_on_warn, the
default branch sets the new timeout to 1 jiffy, so the conntrack entry
expires right away and the offloaded flow is torn down.
Handle GRE like UDP and extend the timeout to NF_CT_DAY. GRE conntrack
has no protocol state to take into account, and NF_CT_DAY is also what
flow_offload_add() already sets for every offloaded entry, GRE included.
This also restores the behaviour from before commit 03428ca5cee9, when
the conntrack gc worker extended offloaded entries of any protocol to
NF_CT_DAY.
Fixes: 03428ca5cee9 ("netfilter: conntrack: rework offload nf_conn timeout extension logic")
Reported-by: syzbot+521f7e7e2b974abde99a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=521f7e7e2b974abde99a
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_flow_table_core.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -496,6 +496,7 @@ static void nf_flow_table_extend_ct_time
switch (l4proto) {
case IPPROTO_UDP:
+ case IPPROTO_GRE:
new_timeout = NF_CT_DAY;
break;
case IPPROTO_TCP:
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0527/1167] net/sched: sch_teql: reject qdiscs from another network namespace
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (520 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0526/1167] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0528/1167] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
` (135 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, shaos, Victor Nogueira,
Jamal Hadi Salim, Simon Horman, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <jhs@mojatatu.com>
commit 1ae84bdd736f8fab30180159996e1d193f8029ff upstream.
Reported by shaos <shawnq1@163.com> with a reproducer, which was
reproduced and verified in our test environment.
The issue:
The teql master devices are created once in the initial network
namespace and their Qdisc_ops are global. teql_qdisc_init() takes the
teql_master embedded in the registered sch->ops and uses it without
checking whether the new qdisc's device lives in the same network
namespace as the master. A qdisc created in another netns can therefore
attach to the init-net master and change its MTU and flags.
The Fix:
Reject a teql qdisc whose device is not in the master's network
namespace with -EOPNOTSUPP and an extack message; same-netns teql still
works.
Initialize the private skb queue before any validation so every
constructor failure path, including qdisc_create_dflt(), which resets the
qdisc before destroying it, sees an initialized empty queue.
Conditions to recreate the bug:
CONFIG_NET_SCH_TEQL=y, CONFIG_DUMMY=y, CONFIG_USER_NS=y, CONFIG_NET_NS=y.
As an unprivileged UID, unshare a user and network namespace, create a
dummy device, set its MTU to 60000, and add a root teql0 qdisc:
unshare -Urn
ip link add dummy0 type dummy
ip link set dummy0 mtu 60000
tc qdisc add dev dummy0 root teql0
The init-net teql0 device changes from MTU 1500 to 60000. A pfifo control
on the same device leaves the MTU unchanged, and a direct MTU change on
init-net teql0 is denied. The namespace needs CAP_NET_ADMIN; no init-net
privilege is required. With the fix the attach fails with
"Operation not supported" and the init-net MTU stays 1500.
Fixes: 7316ae88c43d ("net_sched: make traffic control network namespace aware")
Reported-by: shaos <shawnq1@163.com>
Link: https://lore.kernel.org/netdev/20261022144830.67948-1-shawnq1@163.com/
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/SER-NSBD.v1.r2.20261031160050-3%40mojatatu.com
Link: https://lore.kernel.org/netdev/179366641863.488856.17368571591466000274@kernel.org/
Cc: stable@vger.kernel.org
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-3@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/sch_teql.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -198,6 +198,8 @@ static int teql_qdisc_init(struct Qdisc
struct Qdisc *first;
unsigned long flags;
+ skb_queue_head_init(&q->q);
+
if (dev->hard_header_len > m->dev->hard_header_len)
return -EINVAL;
@@ -209,9 +211,12 @@ static int teql_qdisc_init(struct Qdisc
return -EOPNOTSUPP;
}
- q->m = m;
+ if (dev_net(dev) != dev_net(m->dev)) {
+ NL_SET_ERR_MSG_MOD(extack, "teql master is in a different network namespace");
+ return -EOPNOTSUPP;
+ }
- skb_queue_head_init(&q->q);
+ q->m = m;
raw_spin_lock_irqsave(&m->slaves_lock, flags);
first = rcu_dereference_protected(m->slaves, lockdep_is_held(&m->slaves_lock));
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0528/1167] net/sched: act_ife: encode configured zero metadata values
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (521 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0527/1167] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0529/1167] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
` (134 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, shaos, Victor Nogueira,
Jamal Hadi Salim, Simon Horman, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <jhs@mojatatu.com>
commit 7d02c07c738bf5c4b9a7d7ef498fbf465c446853 upstream.
Reported by shaos <shawnq1@163.com> with a reproducer for the 32-bit
case, which was reproduced and verified in our test environment.
The issue:
ife_check_meta_u32() and ife_check_meta_u16() both reserve eight bytes
of metadata for a configured value even when that value is zero, but the
matching encoder returns without calling ife_tlv_meta_encode(). The
encoder therefore writes neither the TLV header nor its value, while the
enclosing IFE length still includes the reserved bytes, exposing stale
skb headroom contents to the peer.
The 32-bit helper has been present since the IFE action was introduced
(v4.6); the 16-bit helper was added with the 16-bit metadata helpers used
by the skbtcindex callback (v4.9). Both defects predate the oldest
supported stable kernel (5.10), so they are fixed together in this patch.
Each hunk keeps its own Fixes: tag for provenance.
The fix:
Encode any configured value, including zero; skip the TLV only when
there is neither a configured nor a runtime value. The runtime fallback
is unchanged.
A raw TCA_IFE_METALST netlink request is needed to express the
configured zero: the IFE_META_SKBMARK attribute carries four zero
payload bytes for the u32 helper, and IFE_META_TCINDEX two zero payload
bytes for the 16-bit helper (not an absent or zero-length attribute).
Stock tc cannot build these requests; "use mark 0x0" emits no mark
attribute and "allow mark" emits a zero-length one.
Conditions to recreate the bug:
CONFIG_NET_ACT_IFE=y, CONFIG_NET_IFE_SKBMARK=y,
CONFIG_NET_IFE_SKBTCINDEX=y, CONFIG_NET_CLS_MATCHALL=y,
CONFIG_NET_SCH_INGRESS=y, CONFIG_USER_NS=y, CONFIG_NET_NS=y,
CONFIG_VETH=y. In a fresh user and network namespace create a veth pair
and attach clsact to the egress side. Install a matchall filter whose
ife encode action carries a zero skb mark (or a zero tcindex) in
TCA_IFE_METALST. Send a frame through the veth and inspect the IFE
metadata in the received frame. The metadata region is eight bytes but
holds neither a valid TLV header nor a value; it exposes prior headroom
contents. Setting the value to a nonzero one does not trigger the leak.
The namespace needs CAP_NET_ADMIN; no additional privilege is required.
With the fix the zero TLVs are 0001000800000000 (u32) and
0005000600000000 (u16).
Fixes: ef6980b6becb ("introduce IFE action")
Fixes: 6a5d58b67e20 ("net sched ife action: add 16 bit helpers")
Reported-by: shaos <shawnq1@163.com>
Link: https://lore.kernel.org/netdev/20261022144739.61342-1-shawnq1@163.com/
Cc: stable@vger.kernel.org
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-1@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/act_ife.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -50,8 +50,7 @@ int ife_encode_meta_u16(u16 metaval, voi
edata = *(u16 *)mi->metaval;
else if (metaval)
edata = metaval;
-
- if (!edata) /* will not encode */
+ else
return 0;
edata = htons(edata);
@@ -94,8 +93,7 @@ int ife_encode_meta_u32(u32 metaval, voi
edata = *(u32 *)mi->metaval;
else if (metaval)
edata = metaval;
-
- if (!edata) /* will not encode */
+ else
return 0;
edata = htonl(edata);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0529/1167] net/sched: act_ife: require a full Ethernet header on egress
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (522 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0528/1167] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0530/1167] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
` (133 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko (nipa), shaos,
Victor Nogueira, Jamal Hadi Salim, Simon Horman, Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <jhs@mojatatu.com>
commit 11dbce09083473249c3843ff31bf8d8fa01bdeef upstream.
This is a followup of commit 5b483f7791b0 ("net/sched: act_ife: Only
operate on Ethernet frames") as reported by Sashiko.
The finding was raised by both Sashiko providers (nipa and gemini)
while reviewing the parent patchset. shaos <shawnq1@163.com>
independently reported the same undersized-egress path with a
reproducer, which was reproduced and verified in our test environment.
The issue:
On egress tcf_ife_is_eth_skb() only checks the device type; it does not
check that the skb carries a full Ethernet header. For an Ethernet or
loopback device it returns true even when the skb has no Ethernet
header. tcf_ife_encode() then calls ife_encode(), which copies ETH_HLEN
bytes from skb->data. A short skb therefore reads past its linear data
and the copied bytes, including stale kernel memory, are emitted in the
outer Ethernet header.
The parent commit fixed the reported ingress mac_len case but left the
egress path without a length check.
A total-length test is not sufficient: a non-GSO TUN skb can have a
large total length while only a single byte sits in the linear area, so
ife_encode() still reads past the linear header. Require instead that
the Ethernet header the encoder copies is present in the linear part of
the skb.
The Fix:
On egress require pskb_may_pull(skb, ETH_HLEN) before encoding, which
ensures the Ethernet header is present in the linear data ife_encode()
copies from; the ingress mac_len check is unchanged. A short egress skb
is now dropped instead of being encoded.
Conditions to recreate the bug:
CONFIG_NET_ACT_IFE=y, CONFIG_NET_CLS_MATCHALL=y, CONFIG_NET_SCH_INGRESS=y,
CONFIG_TUN=y, CONFIG_NET_ACT_MIRRED=y. In two user and network
namespaces (a victim and an attacker), open a TUN device in IFF_TUN mode
and attach clsact to it and to lo. Redirect ingress traffic from the TUN
device to lo egress with mirred, and install an ife encode action on lo
egress:
tc qdisc add dev <tun> clsact
tc qdisc add dev lo clsact
tc filter add dev <tun> ingress matchall action mirred egress \
redirect dev lo
tc filter add dev lo egress matchall action ife encode use mark 1 \
action ok
Send a TUN packet shorter than ETH_HLEN (a one-byte payload is enough)
and receive the emitted frame on the other side. Without the fix the
outer Ethernet header contains bytes copied past the short packet; with
the fix the short skb is dropped. The attacker needs CAP_NET_ADMIN in
its user namespace; no init-net privilege is required.
The same path is reachable when the total length is large but the
Ethernet header is not linear: write a non-GSO virtio header with
hdr_len=1 followed by an 8192-byte packet so that only one byte stays
linear. Without the fix the copied header reads past the linear data;
with the fix the header is pulled into the linear area before the copy.
Fixes: 295a6e06d21e ("net/sched: act_ife: Change to use ife module")
Reported-by: Sashiko (nipa) <sashiko-bot@kernel.org>
Reported-by: Sashiko (gemini) <sashiko-bot@kernel.org>
Reported-by: shaos <shawnq1@163.com>
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260821164031.32824-1-victor%40mojatatu.com
Link: https://sashiko.dev/#/patchset/20260821164031.32824-1-victor@mojatatu.com
Link: https://lore.kernel.org/netdev/20261022144736.61227-1-shawnq1@163.com/
Cc: stable@vger.kernel.org
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-2@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/act_ife.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -871,13 +871,16 @@ drop:
* is an Ethernet header because the skb could've been redirected with mirred
* from a non-Ethernet device.
*/
-static bool tcf_ife_is_eth_skb(const struct sk_buff *skb)
+static bool tcf_ife_is_eth_skb(struct sk_buff *skb)
{
if (skb->dev->type != ARPHRD_ETHER &&
skb->dev->type != ARPHRD_LOOPBACK)
return false;
- return !skb_at_tc_ingress(skb) || skb->mac_len == ETH_HLEN;
+ if (skb_at_tc_ingress(skb))
+ return skb->mac_len == ETH_HLEN;
+
+ return pskb_may_pull(skb, ETH_HLEN);
}
TC_INDIRECT_SCOPE int tcf_ife_act(struct sk_buff *skb,
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0530/1167] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (523 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0529/1167] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0531/1167] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
` (132 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Menninger, Anna Schumaker
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Menninger <tmenninger@everpuredata.com>
commit 151d95a1e696979a7d54b23c96338754be2fcc1f upstream.
When processing an out-of-order OPEN stateid on an NFSv4.1 or later
mount, nfs_set_open_stateid_locked() waits for stateid updates to be
processed in order. A five-second timeout is intended to prevent
indefinite waits when preceding updates never arrive.
However, each iteration calls schedule_timeout() with a fresh
five-second timeout. An update to the shared open state can wake the
caller without satisfying its ordering check. The remaining timeout
is then discarded, and the next iteration starts another full wait.
Under sustained concurrent OPEN/CLOSE activity on the same open state,
repeated wakeups can prevent the timeout from ever expiring. Some
tasks can remain stuck in update_open_stateid() while others continue
making progress.
Compute a single deadline on entry and pass only the remaining time
to schedule_timeout(). Once the deadline expires, take the existing
timeout path rather than starting another wait. This prevents
wakeups from extending the wait indefinitely.
Observed on Linux 6.8.0 and reproduced on 7.3.0 with 96 concurrent
O_RDWR|O_TRUNC open/close loops on one NFSv4.1/TCP file (nconnect=16).
Ten workers made no progress for over 300 seconds while others ran.
With the fix, all workers resumed after transient stalls.
Fixes: c9399f21c215 ("NFSv4: Fix OPEN / CLOSE race")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4proc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1695,6 +1695,8 @@ static void nfs_set_open_stateid_locked(
{
DEFINE_WAIT(wait);
int status = 0;
+ unsigned long deadline = jiffies + 5 * HZ;
+ signed long remaining;
for (;;) {
if (nfs_stateid_is_sequential(state, stateid))
@@ -1729,7 +1731,8 @@ static void nfs_set_open_stateid_locked(
if (!fatal_signal_pending(current) &&
!nfs_current_task_exiting()) {
- if (schedule_timeout(5*HZ) == 0)
+ remaining = (long)(deadline - jiffies);
+ if (remaining <= 0 || schedule_timeout(remaining) == 0)
status = -EAGAIN;
else
status = 0;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0531/1167] openvswitch: advance by the real header length in get_ipv6_ext_hdrs()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (524 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0530/1167] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0532/1167] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
` (131 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
Simon Horman, Aaron Conole, Eelco Chaudron, Paolo Abeni
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joas Antonio dos Santos <joasantonio108@gmail.com>
commit dbce972650ed6348e3d3856e49308aa5603e02a7 upstream.
get_ipv6_ext_hdrs() walks the IPv6 extension header chain to fill
key->ipv6.exthdrs, but advances to the next header with ipv6_optlen()
whatever the current header is. That is only right for Hop-by-Hop,
Destination Options and Routing headers:
- an Authentication Header is ((hdrlen + 2) << 2) bytes long
(ipv6_authlen()), so with hdrlen = 4 the walk skips 40 bytes instead
of 24 and reads the next "header" from the ICV and payload;
- a Fragment header is always 8 bytes, and the byte read as hdrlen is
its Reserved field, which the sender controls and receivers ignore,
so a non-zero value makes the walk skip up to 2048 bytes and miss
the headers that follow;
- in a non-first fragment nothing after the Fragment header is a
header at all, it is the middle of the fragmentable part, yet the
walk keeps parsing it as an extension header chain.
In all cases the OFPIEH12_* bits stored in key->ipv6.exthdrs depend on
bytes chosen by the sender rather than on the headers that are actually
present: payload bytes that look like another AH or a Hop-by-Hop header
add OFPIEH12_UNREP/OFPIEH12_UNSEQ, and real headers after a Fragment
header can go unreported. Flows that match on OVS_KEY_ATTR_IPV6_EXTHDRS
then classify such packets wrongly. There is no memory safety issue,
skb_header_pointer() bounds every read.
Advance by sizeof(struct frag_hdr) for Fragment headers and by
ipv6_authlen() for AH, and stop at the Fragment header if its offset is
non-zero, as ipv6_find_hdr() does.
Fixes: 28a3f0601727 ("net: openvswitch: IPv6: Add IPv6 extension header support")
Link: https://lore.kernel.org/all/178905555085.219967.6617611783437228045@kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Eelco Chaudron <echaudron@ovn.org>
Link: https://patch.msgid.link/20261102-ovs-exthdrs-v2-1-21ceef6a243d@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/openvswitch/flow.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -374,11 +374,28 @@ static void get_ipv6_ext_hdrs(struct sk_
return;
}
+ if (next_type == IPPROTO_FRAGMENT) {
+ struct frag_hdr _fh, *fh;
+
+ fh = skb_header_pointer(skb, start, sizeof(_fh), &_fh);
+ if (!fh)
+ break;
+ /* Only the first fragment has the headers that follow. */
+ if (fh->frag_off & htons(IP6_OFFSET))
+ break;
+ start += sizeof(_fh);
+ next_type = fh->nexthdr;
+ continue;
+ }
+
hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr);
if (!hp)
break;
+ if (next_type == IPPROTO_AH)
+ start += ipv6_authlen(hp);
+ else
+ start += ipv6_optlen(hp);
next_type = hp->nexthdr;
- start += ipv6_optlen(hp);
}
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0532/1167] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (525 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0531/1167] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0533/1167] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
` (130 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Phat Dinh, Peter Zijlstra (Intel)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phat Dinh <phatdt1116@gmail.com>
commit 59f1398140869432c7171b9a2a279ca315467c4e upstream.
perf_cgroup_switch() relies on:
/*
* cpuctx->cgrp is set when the first cgroup event enabled,
* and is cleared when the last cgroup event disabled.
*/
It computes the next task's cgroup, schedules out the CPU context and
then assigns cpuctx->cgrp unconditionally:
ctx_sched_out(&cpuctx->ctx, NULL, EVENT_ALL|EVENT_CGROUP);
/*
* must not be done before ctxswout due
* to update_cgrp_time_from_cpuctx() in
* ctx_sched_out()
*/
cpuctx->cgrp = cgrp;
However, ctx_sched_out() can disable events itself. If a cgroup event
has a pending disable from perf_event_disable_inatomic() (e.g. its
PERF_EVENT_IOC_REFRESH limit ran out) that the irq_work has not
handled yet, event_sched_out() consumes it inline:
if (event->pending_disable) {
event->pending_disable = 0;
perf_cgroup_event_disable(event, ctx);
state = PERF_EVENT_STATE_OFF;
}
If that was the last cgroup event, perf_cgroup_event_disable() clears
cpuctx->cgrp:
if (--ctx->nr_cgroups)
return;
cpuctx->cgrp = NULL;
and perf_cgroup_switch() then sets it again. cpuctx->cgrp is left
non-NULL with ctx.nr_cgroups == 0, so the NULL check in
perf_cgroup_switch() no longer catches it and the next switch trips:
WARN_ON_ONCE(cpuctx->ctx.nr_cgroups == 0);
cpuctx->cgrp does not hold a reference on the cgroup. Once that cgroup
is removed, the next ctx_sched_in() dereferences the stale pointer:
BUG: KASAN: slab-use-after-free in ctx_sched_in+0xb1f/0xfa0
Read of size 8 at addr ffff8881008972d0 by task swapper/3/0
Tainted: [W]=WARN
Call Trace:
<IRQ>
ctx_sched_in+0xb1f/0xfa0
perf_event_sched_in+0x1a/0x70
ctx_resched+0x32b/0xac0
__perf_install_in_context+0x475/0xab0
remote_function+0x105/0x200
__flush_smp_call_function_queue+0x179/0x8d0
__sysvec_call_function_single+0x1b/0x1c0
sysvec_call_function_single+0x66/0x80
</IRQ>
<TASK>
asm_sysvec_call_function_single+0x1a/0x20
Only assign cpuctx->cgrp when cgroup events remain after the context
has been scheduled out, so that it stays NULL as the invariant
requires.
Fixes: e19cd0b6fa59 ("perf/core: Always set cpuctx cgrp when enable cgroup event")
Signed-off-by: Phat Dinh <phatdt1116@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261106101642.494674-1-phatdt1116@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/events/core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -893,8 +893,13 @@ static void perf_cgroup_switch(struct ta
* must not be done before ctxswout due
* to update_cgrp_time_from_cpuctx() in
* ctx_sched_out()
+ *
+ * ctx_sched_out() can consume a pending disable and drop the last cgroup
+ * event, which clear the cpuctx->cgrp. Cgroup tracking follow active cgroup
+ * event, so do not resurrect it
*/
- cpuctx->cgrp = cgrp;
+ if (cpuctx->ctx.nr_cgroups)
+ cpuctx->cgrp = cgrp;
/*
* set cgrp before ctxsw in to allow
* perf_cgroup_set_timestamp() in ctx_sched_in()
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0533/1167] PM: runtime: Update last_busy in rpm_resume() for active devices
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (526 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0532/1167] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0534/1167] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
` (129 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
Alan Stern
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit 55b2b8af704f845e01fa2f31ee259b07641ce3a9 upstream.
Setting an autosuspend delay for a device can be expected to cause a
runtime suspend of the device after calling, say, pm_runtime_put() to
be deferred, so the time between the last successful attempt to resume
the device and its subsequent suspend is at least equal to the
autosuspend delay.
However, that expectation is only met after the device has been actually
resumed in rpm_resume() by invoking its runtime resume callback. If the
runtime PM status of the device is already "active" when rpm_resume()
runs for it, the device's last_busy timestamp is not updated which may
allow a subsequent pm_runtime_put() invocation (or similar) to suspend
it right away.
This is arguably inconsistent and confusing, so make rpm_resume() also
update the device's last_busy timestamp when it finds that the device is
already "active" and it is about to return 1 early.
Fixes: 56f487c78015 ("PM / Runtime: Update last_busy in rpm_resume")
Link: https://lore.kernel.org/linux-pm/CAJZ5v0jTX1FgeS9FCV=+V4uacSgLQBVsSPnU27ybgUGg57GUOA@mail.gmail.com/
Reported-by: Brian Norris <briannorris@chromium.org>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/13032301.O9o76ZdvQC@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/power/runtime.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -795,6 +795,12 @@ static int rpm_resume(struct device *dev
pm_runtime_deactivate_timer(dev);
if (dev->power.runtime_status == RPM_ACTIVE) {
+ /*
+ * The attempt to resume the device means that it is needed for
+ * something, so update its last_busy timestamp as in the case
+ * in which it actually resumes below.
+ */
+ pm_runtime_mark_last_busy(dev);
retval = 1;
goto out;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0534/1167] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (527 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0533/1167] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0535/1167] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
` (128 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Baoli Zhang, Peter Ujfalusi,
Mark Brown
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baoli Zhang <baoli.zhang@linux.intel.com>
commit e5c09fe3f9c8d9da33b177ee432db15b6ab46884 upstream.
sof_ipc4_widget_setup_comp_process() allocates the input and output pin
format arrays via sof_ipc4_get_audio_fmt(). When the following
sof_ipc4_widget_setup_msg() fails, e.g. because the firmware does not
provide a module matching the widget UUID, the error path jumps to the
'err' label, which frees the process struct and clears swidget->private
but skips sof_ipc4_free_audio_fmt(). The arrays are then unreachable and
are reported by kmemleak:
sof_ipc4_get_audio_fmt+0xc9/0x420 [snd_sof]
sof_ipc4_widget_setup_comp_process+0x8e/0x200 [snd_sof]
snd_sof_load_topology+0x71a/0x840 [snd_sof]
sof_pcm_probe+0x77/0x120 [snd_sof]
snd_soc_component_probe+0x21/0x60 [snd_soc_core]
...
Jump to 'free_available_fmt' instead, as the other process widget error
paths after sof_ipc4_get_audio_fmt() already do.
The other IPC4 widget setup functions (pga, mixer, src, asrc) free the
audio formats in their common error label and are not affected.
Fixes: f9efae954905 ("ASoC: SOF: ipc4-topology: Add support for base config extension")
Cc: stable@vger.kernel.org
Signed-off-by: Baoli Zhang <baoli.zhang@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20261109005604.1004362-1-baoli.zhang@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/sof/ipc4-topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -904,7 +904,7 @@ static int sof_ipc4_widget_setup_comp_pr
ret = sof_ipc4_widget_setup_msg(swidget, &process->msg);
if (ret)
- goto err;
+ goto free_available_fmt;
/* parse process init module payload config type from module info */
fw_module = swidget->module_info;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0535/1167] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (528 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0534/1167] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0536/1167] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
` (127 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, YuanZhe Liu, Bartosz Golaszewski,
Luiz Augusto von Dentz
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
commit eeca795cec6d9c6c193c2c1bd0cb26cde44f9fc3 upstream.
qca_debugfs_init() creates an "ibs" directory under hdev->debugfs and
stores pointers to fields of struct qca_data in the debugfs files.
qca_close() frees qca_data without removing that directory, while
hdev->debugfs is only removed when the HCI device is released. The HCI
device can outlive the driver data, for example when an HCI socket still
references it, so reading or writing one of the ibs files then
dereferences freed memory.
Store the directory dentry in struct qca_data and remove the directory
with debugfs_remove_recursive() before qca_data is freed.
debugfs_remove() waits for callers that are already inside the file
operations, and any later access fails with -EIO instead of reaching the
debugfs helpers. This covers the two writable files as well.
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261102113654.8724-1-25031212351%40stu.xidian.edu.cn
Fixes: 0ff252c1976d ("Bluetooth: hciuart: Add support QCA chipset for UART")
Cc: stable@vger.kernel.org
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/bluetooth/hci_qca.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -159,6 +159,7 @@ struct qca_data {
struct delayed_work ctrl_memdump_timeout;
struct qca_memdump_info *qca_memdump;
unsigned long flags;
+ struct dentry *debugfs_ibs_dir;
struct completion drop_ev_comp;
wait_queue_head_t suspend_wait_q;
enum qca_memdump_states memdump_state;
@@ -650,6 +651,7 @@ static void qca_debugfs_init(struct hci_
return;
ibs_dir = debugfs_create_dir("ibs", hdev->debugfs);
+ qca->debugfs_ibs_dir = ibs_dir;
/* read only */
mode = 0444;
@@ -725,6 +727,9 @@ static int qca_close(struct hci_uart *hu
hu->priv = NULL;
+ debugfs_remove_recursive(qca->debugfs_ibs_dir);
+ qca->debugfs_ibs_dir = NULL;
+
kfree(qca);
return 0;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0536/1167] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (529 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0535/1167] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0537/1167] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
` (126 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Luiz Augusto von Dentz
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 1f2ac56137c51be0601e18a163d817e02a15913f upstream.
Reading buffered ERTM data after ACL link loss can clear local busy and
send a supervisory frame after l2cap_conn_del() has destroyed the HCI
channel, which oopses on a NULL pointer in hci_send_acl(). The socket still
owns its L2CAP channel, so its lifetime does not protect the underlying HCI
channel.
Require BT_CONNECTED before clearing local busy in recvmsg. The socket lock
already held here serializes this check and send with teardown, which
closes the socket before the HCI channel is destroyed. Continue to allow
buffered data to be read after disconnection.
AI assistance was used.
Fixes: 61aa4f5b9f43 ("Bluetooth: Use the transmit state machine for busy state changes")
Cc: stable@vger.kernel.org # needs adjustments for 5.15
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bluetooth/l2cap_sock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1273,7 +1273,8 @@ static int l2cap_sock_recvmsg(struct soc
* available. This avoids resending large numbers of
* frames.
*/
- if (test_bit(CONN_LOCAL_BUSY, &pi->chan->conn_state) &&
+ if (sk->sk_state == BT_CONNECTED &&
+ test_bit(CONN_LOCAL_BUSY, &pi->chan->conn_state) &&
atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf >> 1)
l2cap_chan_busy(pi->chan, 0);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0537/1167] crypto: caam - reject overlong RSA CRT parameters
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (530 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0536/1167] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0538/1167] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
` (125 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean,
Sahil Malhotra, Herbert Xu
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit 828c3b265b6df877dced3dde56ea41daa2e6181e upstream.
caam_read_rsa_crt() right-aligns dP, dQ, and qInv in buffers sized
from the corresponding prime. rsa_parse_priv_key() only bounds these
integers against n, so a malformed key can provide, for example, a
two-byte dP with a one-byte p. dstlen - nbytes then underflows and
memcpy() writes outside the allocation during set_priv_key(). KASAN
reports a slab-out-of-bounds write in caam_read_rsa_crt().
Reject empty or overlong CRT parameters after stripping leading zeros.
qInv is consumed by CAAM as a p-sized value, so size it from p rather
than q to match the DMA mapping in set_rsa_priv_f3_pdb(). Let the
top-level key cleanup handle partial form-3 allocations and return the
specific error to the caller.
Also test nbytes before dereferencing it while stripping zeros, so an
all-zero integer does not read one byte beyond its input.
Fixes: 4a651b122adb ("crypto: caam - add support for RSA key form 3")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Reviewed-by: Sahil Malhotra <sahil.malhotra@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/crypto/caam/caampkc.c | 79 +++++++++++++++++-------------------------
1 file changed, 32 insertions(+), 47 deletions(-)
--- a/drivers/crypto/caam/caampkc.c
+++ b/drivers/crypto/caam/caampkc.c
@@ -880,7 +880,7 @@ static void caam_rsa_free_key(struct caa
static void caam_rsa_drop_leading_zeros(const u8 **ptr, size_t *nbytes)
{
- while (!**ptr && *nbytes) {
+ while (*nbytes && !**ptr) {
(*ptr)++;
(*nbytes)--;
}
@@ -896,22 +896,22 @@ static void caam_rsa_drop_leading_zeros(
* @ptr : pointer to {dP, dQ, qInv} CRT member
* @nbytes: length in bytes of {dP, dQ, qInv} CRT member
* @dstlen: length in bytes of corresponding p or q prime factor
+ * @dst : pointer to the zero-padded output buffer
*/
-static u8 *caam_read_rsa_crt(const u8 *ptr, size_t nbytes, size_t dstlen)
+static int caam_read_rsa_crt(const u8 *ptr, size_t nbytes, size_t dstlen,
+ u8 **dst)
{
- u8 *dst;
-
caam_rsa_drop_leading_zeros(&ptr, &nbytes);
- if (!nbytes)
- return NULL;
+ if (!nbytes || nbytes > dstlen)
+ return -EINVAL;
- dst = kzalloc(dstlen, GFP_KERNEL);
- if (!dst)
- return NULL;
+ *dst = kzalloc(dstlen, GFP_KERNEL);
+ if (!*dst)
+ return -ENOMEM;
- memcpy(dst + (dstlen - nbytes), ptr, nbytes);
+ memcpy(*dst + (dstlen - nbytes), ptr, nbytes);
- return dst;
+ return 0;
}
/**
@@ -991,6 +991,7 @@ static int caam_rsa_set_priv_key_form(st
size_t p_sz = raw_key->p_sz;
size_t q_sz = raw_key->q_sz;
unsigned aligned_size;
+ int ret;
rsa_key->p = caam_read_raw_data(raw_key->p, &p_sz);
if (!rsa_key->p)
@@ -999,57 +1000,39 @@ static int caam_rsa_set_priv_key_form(st
rsa_key->q = caam_read_raw_data(raw_key->q, &q_sz);
if (!rsa_key->q)
- goto free_p;
+ return -ENOMEM;
rsa_key->q_sz = q_sz;
aligned_size = ALIGN(raw_key->p_sz, dma_get_cache_alignment());
rsa_key->tmp1 = kzalloc(aligned_size, GFP_KERNEL);
if (!rsa_key->tmp1)
- goto free_q;
+ return -ENOMEM;
aligned_size = ALIGN(raw_key->q_sz, dma_get_cache_alignment());
rsa_key->tmp2 = kzalloc(aligned_size, GFP_KERNEL);
if (!rsa_key->tmp2)
- goto free_tmp1;
+ return -ENOMEM;
rsa_key->priv_form = FORM2;
- rsa_key->dp = caam_read_rsa_crt(raw_key->dp, raw_key->dp_sz, p_sz);
- if (!rsa_key->dp)
- goto free_tmp2;
-
- rsa_key->dq = caam_read_rsa_crt(raw_key->dq, raw_key->dq_sz, q_sz);
- if (!rsa_key->dq)
- goto free_dp;
-
- rsa_key->qinv = caam_read_rsa_crt(raw_key->qinv, raw_key->qinv_sz,
- q_sz);
- if (!rsa_key->qinv)
- goto free_dq;
+ ret = caam_read_rsa_crt(raw_key->dp, raw_key->dp_sz, p_sz,
+ &rsa_key->dp);
+ if (ret)
+ return ret;
+
+ ret = caam_read_rsa_crt(raw_key->dq, raw_key->dq_sz, q_sz,
+ &rsa_key->dq);
+ if (ret)
+ return ret;
+
+ ret = caam_read_rsa_crt(raw_key->qinv, raw_key->qinv_sz, p_sz,
+ &rsa_key->qinv);
+ if (ret)
+ return ret;
rsa_key->priv_form = FORM3;
return 0;
-
-free_dq:
- kfree_sensitive(rsa_key->dq);
- rsa_key->dq = NULL;
-free_dp:
- kfree_sensitive(rsa_key->dp);
- rsa_key->dp = NULL;
-free_tmp2:
- kfree_sensitive(rsa_key->tmp2);
- rsa_key->tmp2 = NULL;
-free_tmp1:
- kfree_sensitive(rsa_key->tmp1);
- rsa_key->tmp1 = NULL;
-free_q:
- kfree_sensitive(rsa_key->q);
- rsa_key->q = NULL;
-free_p:
- kfree_sensitive(rsa_key->p);
- rsa_key->p = NULL;
- return -ENOMEM;
}
static int caam_rsa_set_priv_key(struct crypto_akcipher *tfm, const void *key,
@@ -1067,6 +1050,8 @@ static int caam_rsa_set_priv_key(struct
if (ret)
return ret;
+ ret = -ENOMEM;
+
/* Copy key in DMA zone */
rsa_key->d = kmemdup(raw_key.d, raw_key.d_sz, GFP_KERNEL);
if (!rsa_key->d)
@@ -1103,7 +1088,7 @@ static int caam_rsa_set_priv_key(struct
err:
caam_rsa_free_key(rsa_key);
- return -ENOMEM;
+ return ret;
}
static unsigned int caam_rsa_max_size(struct crypto_akcipher *tfm)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0538/1167] crypto: essiv - fix use-after-free in AEAD path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (531 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0537/1167] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0539/1167] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
` (124 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Herbert Xu
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit e9ce64dce975a14700e835003847415e29918474 upstream.
The request that ESSIV submits to its wrapped AEAD transform may
finish before crypto_aead_encrypt() or crypto_aead_decrypt() returns.
In case this happens, essiv_aead_done() calls aead_request_complete()
on the original ESSIV request, which can end up freeing the request
before essiv_aead_crypt() resumes, creating a UAF:
BUG: KASAN: slab-use-after-free in essiv_aead_crypt+0x8e6/0x950
Read of size 8 at addr ffff888102af1360 by task init/66
Check the return status before dereferencing rctx after submitting that
request. If the operation did not return -EINPROGRESS or -EBUSY, then
the request cannot have been freed yet.
Fixes: be1eb7f78aa8 ("crypto: essiv - create wrapper template for ESSIV generation")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
crypto/essiv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/crypto/essiv.c
+++ b/crypto/essiv.c
@@ -250,7 +250,7 @@ static int essiv_aead_crypt(struct aead_
err = enc ? crypto_aead_encrypt(subreq) :
crypto_aead_decrypt(subreq);
- if (rctx->assoc && err != -EINPROGRESS && err != -EBUSY)
+ if (err != -EINPROGRESS && err != -EBUSY)
kfree(rctx->assoc);
return err;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0539/1167] fs/adfs: bound directory entry name length in adfs_fplus_getnext()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (532 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0538/1167] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0540/1167] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
` (123 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyungjung Joo, HyeongJun An,
Christian Brauner (Amutable)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
commit ebf5025b0d989f95542fc9da899b7de2fec499f2 upstream.
adfs_fplus_getnext() reads the per-entry name length bigdirobnamelen
straight from the on-disk big directory and passes it to
adfs_dir_copyfrom() as the copy length into obj->name[], a fixed
ADFS_MAX_NAME_LEN (260) byte buffer. adfs_dir_copyfrom() only bounds
the copy against the number of directory buffers, not the size of the
destination, so a crafted image with bigdirobnamelen larger than the
buffer overflows the stack-allocated object_info::name that
adfs_fplus_iterate() passes in.
adfs_object_fixup() may additionally append a four byte ",xyz" filetype
suffix, so the accepted length must also leave room for that.
The old-style directory parser (dir_f.c) already clamps names to
ADFS_F_NAME_LEN, and adfs_fplus_validate_header() validates the header
name fields, but the per-entry name length in the big directory format
was never checked. Reject over-long entries, using -EIO as elsewhere
in this file for a corrupt big directory.
Reported-by: Hyungjung Joo <jhj140711@gmail.com>
Closes: https://lore.kernel.org/all/CAP_j_b9BqyQrk3D5nj6RSa=eGcs2HkRYsWc3WdXeXp9O3=z4nQ@mail.gmail.com/
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20260715115231.1585166-1-sammiee5311@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/adfs/dir_fplus.c | 2 ++
1 file changed, 2 insertions(+)
--- a/fs/adfs/dir_fplus.c
+++ b/fs/adfs/dir_fplus.c
@@ -192,6 +192,8 @@ adfs_fplus_getnext(struct adfs_dir *dir,
obj->indaddr = le32_to_cpu(bde.bigdirindaddr);
obj->attr = le32_to_cpu(bde.bigdirattr);
obj->name_len = le32_to_cpu(bde.bigdirobnamelen);
+ if (obj->name_len > ADFS_MAX_NAME_LEN - 4) /* leave room for ,xyz suffix */
+ return -EIO;
offset = adfs_fplus_offset(h, le32_to_cpu(h->bigdirentries));
offset += le32_to_cpu(bde.bigdirobnameptr);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0540/1167] fs/proc: fix the write length returned by proc_sys_call_handler()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (533 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0539/1167] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0541/1167] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
` (122 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cheng Yongkang,
Christian Brauner (Amutable)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
commit fbdc020ee1b82079102e493aaa7200de5f497a38 upstream.
proc_sys_call_handler() reads the write length from iov_iter_count() and
copies that many bytes from the iterator into kbuf. A cgroup/sysctl BPF
program can replace the new value through bpf_sysctl_set_new_value() and
update count to the length of the replacement value. The handler then
returns that adjusted count as the number of bytes written, even though
the iterator originally held a different number of bytes.
If the replacement value is longer than the original input, ->write_iter()
reports more bytes than the iterator held. splice(2) passes that value to
iter_file_splice_write(), which subtracts it from the pipe length and
walks past the pipe head:
Splice Exceeded! ret=7 tot=1 left=0
Oops: general protection fault
RIP: 0010:iter_file_splice_write+0xb6f/0x1170
The write path consumes at most the original iterator length in
copy_from_iter_full() before the BPF hook runs. Return the smaller of the
adjusted and original counts on the write path, so an expanded BPF value
cannot exceed the iterator while a handler that reports a shorter parsed
length still produces a short write. The read path keeps using the
adjusted count for copy_to_iter().
Fixes: 4e63acdff864 ("bpf: Introduce bpf_sysctl_{get,set}_new_value helpers")
Cc: stable@vger.kernel.org
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Link: https://patch.msgid.link/179328314073.648427.7892850166511253762@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/proc/proc_sysctl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -556,6 +556,8 @@ static ssize_t proc_sys_call_handler(str
struct ctl_table_header *head = grab_header(inode);
struct ctl_table *table = PROC_I(inode)->sysctl_entry;
size_t count = iov_iter_count(iter);
+ /* ->write_iter() must never report more than the iterator held */
+ size_t orig_count = count;
char *kbuf;
ssize_t error;
@@ -606,7 +608,8 @@ static ssize_t proc_sys_call_handler(str
goto out_free_buf;
}
- error = count;
+ /* the write path consumed at most the original iterator length */
+ error = write ? min(count, orig_count) : count;
out_free_buf:
kvfree(kbuf);
out:
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0541/1167] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (534 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0540/1167] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0542/1167] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
` (121 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Beata Michalska, Catalin Marinas
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Beata Michalska <beata.michalska@arm.com>
commit be777145858218f591b4d9d19f3d40d3ecea9de3 upstream.
On Cortex-A715 (erratum 2738462) and Cortex-A720 (erratum 2738461),
the AMEVCNTR00 counter may continue incrementing while the core
remains in WFE with the clocks being enabled. The resulting core
cycle count may become unreliable.
Add a workaround that effectively treats the AMU counter
as unavailable.
Cc: <stable@vger.kernel.org>
Signed-off-by: Beata Michalska <beata.michalska@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/arch/arm64/silicon-errata.rst | 4 +++
arch/arm64/Kconfig | 32 ++++++++++++++++++++++++++++
arch/arm64/kernel/cpu_errata.c | 20 +++++++++++++++++
arch/arm64/kernel/cpufeature.c | 3 +-
arch/arm64/kernel/topology.c | 3 +-
arch/arm64/tools/cpucaps | 1
6 files changed, 61 insertions(+), 2 deletions(-)
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -155,8 +155,12 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A715 | #2645198 | ARM64_ERRATUM_2645198 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-A715 | #2738462 | ARM64_ERRATUM_2738461 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A715 | #3456084 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-A720 | #2738461 | ARM64_ERRATUM_2738461 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A725 | #3456106 | ARM64_ERRATUM_3194386 |
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1011,6 +1011,38 @@ config ARM64_WORKAROUND_BROKEN_AMU_CONST
# making it unreliable. As a result, AMU users should treat it as
# unavailable rather than relying on misleading counter values.
+config ARM64_WORKAROUND_BROKEN_AMU_CORECNT
+ bool
+ # Targeting errata affecting AMEVCNTR00, the AMU core cycle counter.
+ # On affected CPUs the counter may continue incrementing while core
+ # remains in WFE with the clocks enabled.
+ # This may lead to readings of said counter being unreliable.
+ # How much though depends on the sampling intervals.
+
+config ARM64_ERRATUM_2738461
+ bool "Cortex-A715/Cortex-A720: workaround for AMEVCNTR00 incrementing incorrectly"
+ depends on ARM64_AMU_EXTN
+ select ARM64_WORKAROUND_BROKEN_AMU_CORECNT
+ default y
+ help
+ This option adds the workaround for the following errata:
+
+ * ARM Cortex-A715 erratum 2738462
+ * ARM Cortex-A720 erratum 2738461
+
+ On affected cores the AMEVCNTR00 counter (AMU core frequency cycles
+ counter) may continue incrementing while the core remains in WFE
+ with the clocks being enabled.
+ This may result in inaccurate counter readings, with the magnitude
+ of the discrepancy depending on the sampling interval.
+
+ With this workaround, reads of the affected counter return 0 in
+ the relevant paths. This causes users of the counter to treat it
+ as unavailable and is functionally equivalent to firmware disabling
+ the affected counter.
+
+ If unsure, say Y.
+
config ARM64_ERRATUM_2457168
bool "Cortex-A510: 2457168: workaround for AMEVCNTR01 incrementing incorrectly"
depends on ARM64_AMU_EXTN
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -289,6 +289,18 @@ static const struct midr_range workaroun
};
#endif /* CONFIG_ARM64_WORKAROUND_BROKEN_AMU_CONSTCNT */
+#ifdef CONFIG_ARM64_WORKAROUND_BROKEN_AMU_CORECNT
+static const struct midr_range workaround_amu_corecnt_list[] = {
+#ifdef CONFIG_ARM64_ERRATUM_2738461
+ /* Cortex-A715 r0p0 - r1p3 */
+ MIDR_RANGE(MIDR_CORTEX_A715, 0, 0, 1, 3),
+ /* Cortex-A720 r0p0 - r0p1 */
+ MIDR_RANGE(MIDR_CORTEX_A720, 0, 0, 0, 1),
+#endif
+ {}
+};
+#endif /* CONFIG_ARM64_WORKAROUND_BROKEN_AMU_CORECNT */
+
#ifdef CONFIG_CAVIUM_ERRATUM_23154
static const struct midr_range cavium_erratum_23154_cpus[] = {
MIDR_ALL_VERSIONS(MIDR_THUNDERX),
@@ -788,6 +800,14 @@ const struct arm64_cpu_capabilities arm6
CAP_MIDR_RANGE_LIST(workaround_amu_constcnt_list)
},
#endif
+#ifdef CONFIG_ARM64_WORKAROUND_BROKEN_AMU_CORECNT
+ {
+ .desc = "Broken AMU AMEVCNTR00 (core cycle counter)",
+ .capability = ARM64_WORKAROUND_BROKEN_AMU_CORECNT,
+ .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
+ CAP_MIDR_RANGE_LIST(workaround_amu_corecnt_list)
+ },
+#endif
#ifdef CONFIG_ARM64_ERRATUM_2038923
{
.desc = "ARM erratum 2038923",
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1950,7 +1950,8 @@ static void cpu_amu_enable(struct arm64_
cpumask_set_cpu(smp_processor_id(), &amu_cpus);
/* 0 reference values signal broken/disabled counters */
- if (!this_cpu_has_cap(ARM64_WORKAROUND_BROKEN_AMU_CONSTCNT))
+ if (!this_cpu_has_cap(ARM64_WORKAROUND_BROKEN_AMU_CONSTCNT) &&
+ !this_cpu_has_cap(ARM64_WORKAROUND_BROKEN_AMU_CORECNT))
update_freq_counters_refs();
}
}
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -262,7 +262,8 @@ static void cpu_read_corecnt(void *val)
* counter read is properly handled as an error case by the users of the
* counter.
*/
- *(u64 *)val = read_corecnt();
+ *(u64 *)val = this_cpu_has_cap(ARM64_WORKAROUND_BROKEN_AMU_CORECNT) ?
+ 0UL : read_corecnt();
}
static void cpu_read_constcnt(void *val)
--- a/arch/arm64/tools/cpucaps
+++ b/arch/arm64/tools/cpucaps
@@ -101,3 +101,4 @@ WORKAROUND_SPECULATIVE_AT
WORKAROUND_SPECULATIVE_SSBS
WORKAROUND_SPECULATIVE_UNPRIV_LOAD
WORKAROUND_BROKEN_AMU_CONSTCNT
+WORKAROUND_BROKEN_AMU_CORECNT
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0542/1167] arm64: ptrace: dont warn on missing siginfo in a group-stop
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (535 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0541/1167] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0543/1167] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
` (120 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhao Gongyi, Oleg Nesterov,
Will Deacon, Catalin Marinas
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Gongyi <zhaogongyi@bytedance.com>
commit 5306f124f3171289b2ef5bac1e08aad175f66d1e upstream.
PTRACE_ATTACH to a group-stopped child can enter do_jobctl_trap(),
which calls ptrace_stop() without siginfo. If the tracer writes
NT_ARM_SYSTEM_CALL, system_call_set() can change syscallno from
NO_SYSCALL before update_syscall_orig_x0_after_ptrace() checks
last_siginfo. WARN_ON_ONCE(!info) then fires for a valid ptrace stop.
Keep the early return when siginfo is absent, but remove the warning.
This leaves orig_x0 untouched at a non-seized group-stop and preserves
the existing syscall-exit-stop handling.
Fixes: 88b839ce497c ("arm64: ptrace: Keep 'orig_x0' in-sync with x0 on syscall entry")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Gongyi <zhaogongyi@bytedance.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Will Deacon <will@kernel.org>
[catalin.marinas@arm.com: modified comment as per Will's suggestion]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/kernel/ptrace.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -572,8 +572,12 @@ static void update_syscall_orig_x0_after
if (regs->syscallno == NO_SYSCALL)
return;
- /* We should only be called when target is in a ptrace stop */
- if (WARN_ON_ONCE(!info))
+ /*
+ * For exit-stops, info is always non-NULL, but that's not true for other
+ * stops such as non-seized group-stops. In those cases, just return early
+ * as there's no need to update orig_x0 anyway.
+ */
+ if (!info)
return;
/*
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0543/1167] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (536 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0542/1167] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0544/1167] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
` (119 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Zhongqiu Han,
Rafael J. Wysocki
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
commit 6bc092a0fc4d331a4adbbb664078af149c580834 upstream.
When policy->freq_table is built in acpi_cpufreq_cpu_init(), entries
that are not lower in frequency than the previous one are skipped.
For each remaining entry, freq_table[].driver_data stores the
original ACPI P-state index, so the index space of freq_table no
longer matches perf->states[].
extract_io() currently walks perf->states[] with index i and uses the
same i to index policy->freq_table[i]. When duplicate frequencies
exist, this can associate a P-state status with the frequency of a
different P-state. It can also access an invalid or sentinel entry in
freq_table when the number of entries in perf->states[] is greater than
the number of entries remaining in the frequency table.
extract_io() is used on ACPI_ADR_SPACE_SYSTEM_IO platforms by the
frequency verification path, which is enabled by the
acpi_pstate_strict module parameter. With the mismatched lookup,
check_freqs() can fail to match the frequency of the P-state that
drv_write() has already programmed. It then sleeps through all 100
iterations - at least ~1 ms of usleep_range() plus 100 cross-CPU
calls and I/O port reads, all with policy->rwsem held, and
.target_index() returns -EAGAIN, leaving perf->state at its previous
value while the hardware is running at the newly requested P-state.
The cpufreq core consequently keeps policy->cur at the old frequency.
Since __cpufreq_driver_target() returns early when the requested
frequency equals policy->cur, the driver is not called again for that
frequency and the control register is not rewritten. The hardware can
therefore remain at a frequency that differs from the frequency known
to the cpufreq core.
Fix this by iterating over policy->freq_table and using
pos->driver_data as the original ACPI P-state index when accessing
perf->states[], as extract_msr() already does.
Fixes: fe27cb358835 ("[CPUFREQ][2/8] acpi: reorganize code to make MSR support addition easier")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Cc: All applicable <stable@vger.kernel.org>
Link: https://patch.msgid.link/20260910111329.2220-2-lirongqing@baidu.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/acpi-cpufreq.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -202,14 +202,13 @@ static unsigned extract_io(struct cpufre
{
struct acpi_cpufreq_data *data = policy->driver_data;
struct acpi_processor_performance *perf;
- int i;
+ struct cpufreq_frequency_table *pos;
perf = to_perf_data(data);
- for (i = 0; i < perf->state_count; i++) {
- if (value == perf->states[i].status)
- return policy->freq_table[i].frequency;
- }
+ cpufreq_for_each_entry(pos, policy->freq_table)
+ if (value == perf->states[pos->driver_data].status)
+ return pos->frequency;
return 0;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0544/1167] cpufreq: intel_pstate: Clear last written P-state value on suspend
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (537 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0543/1167] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0545/1167] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
` (118 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zak Brighton Knight, Doug Smythies,
Rafael J. Wysocki, Zhongqiu Han, Viresh Kumar, Christian Loehle
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit 02e77af824d5be3a94fdd885835a352f90d24c5c upstream.
Preserving cpu->pstate.current_pstate across system suspend-resume
cycles, when running in the passive mode with HWP disabled, is a mistake
because its value from before system suspend may become stale after the
subsequent system resume and in some cases it prevents MSR_IA32_PERF_CTL
from being updated properly after system resume [1].
Address this by clearing cpu->pstate.current_pstate after the governor
has been stopped during system suspend.
Fixes: 001c76f05b01 ("cpufreq: intel_pstate: Generic governors support")
Fixes: 4adcf2e5829f ("cpufreq: intel_pstate: Add ->offline and ->online callbacks")
Link: https://lore.kernel.org/linux-pm/20261027143725.3763827-1-zakbrightonknight@gmail.com/ [1]
Reported-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reported-by: Doug Smythies <dsmythies@telus.net>
Cc: All applicable <stable@vger.kernel.org> # 342d3a73c5db cpufreq: Force passing target frequency to driver during resume
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/14150222.uLZWGnKmhe@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/intel_pstate.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -3057,10 +3057,11 @@ static void intel_cpufreq_cpu_exit(struc
static int intel_cpufreq_suspend(struct cpufreq_policy *policy)
{
+ struct cpudata *cpu = all_cpu_data[policy->cpu];
+
intel_pstate_suspend(policy);
if (hwp_active) {
- struct cpudata *cpu = all_cpu_data[policy->cpu];
u64 value = READ_ONCE(cpu->hwp_req_cached);
/*
@@ -3071,6 +3072,17 @@ static int intel_cpufreq_suspend(struct
value &= ~HWP_DESIRED_PERF(~0L);
wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value);
WRITE_ONCE(cpu->hwp_req_cached, value);
+ } else {
+ /*
+ * Invalidate the cached P-state value that may be stale when
+ * the governor is started again during resume and may prevent
+ * MSR_IA32_PERF_CTL from being updated.
+ *
+ * This does not require synchronization because the core
+ * prevents frequency updates for suspended policies from
+ * occurring.
+ */
+ cpu->pstate.current_pstate = 0;
}
return 0;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0545/1167] cpufreq: Cache post-resolution target frequency in __resolve_freq()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (538 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0544/1167] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0546/1167] software node: only let the owner release a managed node Greg Kroah-Hartman
` (117 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Christian Loehle
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit 166207cac45191637c47a457a5c16ca6b6773a16 upstream.
get_next_freq() in the schedutil governor returns the resolved
frequency from cpufreq_driver_resolve_freq(), and that resolved value
is then passed to cpufreq_driver_fast_switch(). The only reader of
cached_target_freq, acpi_cpufreq_fast_switch(), compares it with the
post-resolution target frequency, but it holds the pre-resolution
clamped frequency, so any request that falls between table entries
misses the cache and falls back to a table scan.
Address this by making __resolve_freq() store the post-resolution
frequency in cached_target_freq.
Fixes: e3c062360870 ("cpufreq: add cpufreq_driver_resolve_freq()")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/14161745.uLZWGnKmhe@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/cpufreq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -548,8 +548,8 @@ static unsigned int __resolve_freq(struc
idx = cpufreq_frequency_table_target(policy, target_freq, min, max, relation);
policy->cached_resolved_idx = idx;
- policy->cached_target_freq = target_freq;
- return policy->freq_table[idx].frequency;
+ policy->cached_target_freq = policy->freq_table[idx].frequency;
+ return policy->cached_target_freq;
}
/**
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0546/1167] software node: only let the owner release a managed node
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (539 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0545/1167] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0547/1167] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
` (116 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Balasubramani Vivekanandan,
Bartosz Golaszewski, Heikki Krogerus, Johan Hovold
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit f8623ce596492d2e96ca57eeec992938d3d79f00 upstream.
device_create_managed_software_node() creates a node whose lifetime is
tied to the device it was created for. software_node_notify_remove() is
called for every device that has the node as its fwnode (primary OR
secondary) and, if the node is managed, unconditionally detaches it from
that device and drops the creation reference.
This breaks when the node is shared with another device. Example: the
i2c-designware copies the parent's fwnode to the adapter's struct device.
When the adapter is deleted, it releases the reference that belongs to
the owner and the latter ends up with a dangling pointer.
Record the device's "manager" and only perform the actual release when
notify is called for that "owner" device.
Note that it was never the intention that managed software nodes would
be shared, but descendants reusing ancestor firmware nodes is not
uncommon and such use is hard to predict when allocating software nodes.
Reported-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Closes: https://lore.kernel.org/all/20261009164241.923756-2-balasubramani.vivekanandan@intel.com/
Fixes: 151f6ff78cdf ("software node: Provide replacement for device_add_properties()")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Fixes: 0f485f88656a ("drm/xe/i2c: use device_create_managed_software_node()")
Reviewed-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Tested-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261102-swnode-only-owner-release-v1-1-ee4c9022a629@oss.qualcomm.com
[ johan: drop temporary variable; skip clearing owner field;
mention reuse not intended in commit message ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/swnode.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -18,6 +18,8 @@ struct swnode {
struct fwnode_handle fwnode;
const struct software_node *node;
int id;
+ /* Device the managed node's lifetime is tied to. */
+ struct device *owner;
/* hierarchy */
struct ida child_ids;
@@ -26,7 +28,6 @@ struct swnode {
struct swnode *parent;
unsigned int allocated:1;
- unsigned int managed:1;
};
static DEFINE_IDA(swnode_root_ids);
@@ -1049,7 +1050,7 @@ int device_create_managed_software_node(
if (IS_ERR(fwnode))
return PTR_ERR(fwnode);
- to_swnode(fwnode)->managed = true;
+ to_swnode(fwnode)->owner = dev;
set_secondary_fwnode(dev, fwnode);
if (device_is_registered(dev))
@@ -1093,7 +1094,7 @@ void software_node_notify_remove(struct
sysfs_remove_link(&dev->kobj, "software_node");
kobject_put(&swnode->kobj);
- if (swnode->managed) {
+ if (swnode->owner == dev) {
set_secondary_fwnode(dev, NULL);
kobject_put(&swnode->kobj);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0547/1167] SUNRPC: Fix TCP-with-TLS transport class identification
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (540 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0546/1167] software node: only let the owner release a managed node Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0548/1167] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
` (115 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Benjamin Coddington,
Anna Schumaker
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
commit 0502c7e7f171a8c9c892bdef89e6aa6f44d7b2a3 upstream.
xs_setup_tcp_tls() assigns the ordinary TCP transport class to
a TCP-with-TLS transport. When rpc_clnt_add_xprt() is called
with an unspecified transport type, it inherits the class
identifier and can create an unencrypted TCP transport.
Looks like a copy-paste error from the commit 3 years ago.
NFSv4 trunk discovery uses an unspecified transport type when
adding server-advertised addresses. If the additional transport
passes server-identity validation, it can be admitted to the
client's transport switch.
An isolated loopback test reproduced plaintext application RPC
transmission for TLS- and mTLS-configured clients, including
an unpinned TLS-client RPC that selected the added transport.
Assign the TCP-with-TLS class instead. With the fix, the
plaintext-only test peer receives TLS negotiation probes but
no application payloads.
Fixes: 75eb6af7acdf ("SUNRPC: Add a TCP-with-TLS RPC transport class")
Cc: stable@vger.kernel.org
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Benjamin Coddington <bcodding@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sunrpc/xprtsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -3527,7 +3527,7 @@ static struct rpc_xprt *xs_setup_tcp_tls
transport = container_of(xprt, struct sock_xprt, xprt);
xprt->prot = IPPROTO_TCP;
- xprt->xprt_class = &xs_tcp_transport;
+ xprt->xprt_class = &xs_tcp_tls_transport;
xprt->max_payload = RPC_MAX_FRAGMENT_SIZE;
xprt->bind_timeout = XS_BIND_TO;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0548/1167] timekeeping: Read getboottime64() offsets under the sequence counter
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (541 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0547/1167] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0549/1167] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
` (114 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hungyu Lin, Thomas Gleixner,
John Stultz
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hungyu Lin <dennylin0707@gmail.com>
commit 385b5ec1f31dd39297578eed42be74b07ae74017 upstream.
getboottime64() computes the wall-clock boot timestamp from offs_real
minus offs_boot without checking tk_core.seq. A concurrent timekeeping
update can leave the reader with an inconsistent pair of offsets or,
on 32-bit systems, a torn 64-bit offset, producing an incorrect boot
timestamp.
Read both offsets under tk_core.seq and retry if an update overlaps
the sample. Convert the resulting local value to a timespec64 afterward.
Fixes: 7c3f1a573237 ("Introduce boot based time")
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: John Stultz <jstultz@google.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261030054227.35453-2-dennylin0707@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/time/timekeeping.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -2252,7 +2252,13 @@ void update_wall_time(void)
void getboottime64(struct timespec64 *ts)
{
struct timekeeper *tk = &tk_core.timekeeper;
- ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot);
+ unsigned int seq;
+ ktime_t t;
+
+ do {
+ seq = read_seqcount_begin(&tk_core.seq);
+ t = ktime_sub(tk->offs_real, tk->offs_boot);
+ } while (read_seqcount_retry(&tk_core.seq, seq));
*ts = ktime_to_timespec64(t);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0549/1167] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (542 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0548/1167] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0550/1167] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
` (113 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Paul Menzel,
Jarkko Sakkinen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 03fcb358249dc715124b3616f814ea0ecc6ec36c upstream.
When devm_add_action() returns an error, tpm_read_log_acpi() clears
log->bios_event_log unnecessarily to NULL before calling
tpm_bios_log_free(), and it would lead to a memory leak of the
allocated log buffer.
Fix it by simply jumping to the err.
Cc: stable@vger.kernel.org # v6.18+
Fixes: a3a860bc0fd6 ("tpm: Change to kvalloc() in eventlog/acpi.c")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261109173756.742248-1-tiwai@suse.de
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/tpm/eventlog/acpi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/char/tpm/eventlog/acpi.c
+++ b/drivers/char/tpm/eventlog/acpi.c
@@ -168,10 +168,8 @@ int tpm_read_log_acpi(struct tpm_chip *c
}
ret = devm_add_action(&chip->dev, tpm_bios_log_free, log->bios_event_log);
- if (ret) {
- log->bios_event_log = NULL;
+ if (ret)
goto err;
- }
return format;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0550/1167] tpm: eventlog: check the payload size before reading tag events
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (543 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0549/1167] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0551/1167] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
` (112 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guanglei Zhu, Jarkko Sakkinen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guanglei Zhu <zhugl3@xiaopeng.com>
commit 0a385f668ba77d29ae167c1668fd452418ebc9d6 upstream.
The EVENT_TAG branch of get_event_name() casts the event payload to
struct tcpa_pc_event and reads from it:
pc_event = (struct tcpa_pc_event *)event_entry;
switch (do_endian_conversion(pc_event->event_id)) {
...
for (i = 0; i < 20; i++)
d_len += sprintf(&data[2*i], "%02x",
pc_event->event_data[i]);
The log iterators only verify that the event header plus the declared
event_size stays within the log buffer; they do not require the
payload of an EVENT_TAG entry to be large enough for the fields the
branch reads. A truncated entry makes the branch read up to 20 bytes
of event_data[] past the end of the entry, and, for the last entry in
the log, past the end of the buffer itself.
The legacy PC Client spec defines the EV_EVENT_TAG payload as a
TCPA_PC_EVENT - event_id, event_size and event-type-specific data -
so a conformant entry carries the 8-byte header and the hash-type
ids carry a full digest. The log itself, however, is an ACPI table
the firmware leaves in memory: the TPM never measures the log, so
the kernel cannot tell a conformant log from a corrupted one. The
iterators already work on that assumption - they stop once the
declared event_size runs past the buffer end - and the readers
should apply the same rule to what they take off the payload.
Skip entries whose payload cannot even hold the event id, and skip
the 20-byte digest dump when the payload cannot hold the full
tcpa_pc_event header plus the digest, so the branch never reads
beyond the entry it is formatting.
Cc: stable@vger.kernel.org
Fixes: 55a82ab3181b ("[PATCH] tpm: add bios measurement log")
Signed-off-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/tpm/eventlog/tpm1.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/char/tpm/eventlog/tpm1.c
+++ b/drivers/char/tpm/eventlog/tpm1.c
@@ -178,6 +178,10 @@ static int get_event_name(char *dest, st
}
break;
case EVENT_TAG:
+ if (do_endian_conversion(event->event_size) <
+ sizeof(pc_event->event_id))
+ break;
+
pc_event = (struct tcpa_pc_event *)event_entry;
/* ToDo Row data -> Base64 */
@@ -203,6 +207,9 @@ static int get_event_name(char *dest, st
name = tcpa_pc_event_id_strings[do_endian_conversion
(pc_event->event_id)];
n_len = strlen(name);
+ if (do_endian_conversion(event->event_size) <
+ sizeof(struct tcpa_pc_event) + 20)
+ break;
for (i = 0; i < 20; i++)
d_len += sprintf(&data[2*i], "%02x",
pc_event->event_data[i]);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0551/1167] x86/mm: Ensure write visibility during LDT installation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (544 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0550/1167] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0552/1167] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
` (111 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jaeyoung Chung, Dave Hansen,
Ingo Molnar, Linus Torvalds, Peter Zijlstra (Intel)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit 0dc2a4dac3d04e9e4479aeb0b46172feab1cca0a upstream.
During LDT installation, the intent is to overwrite the old per-mm
LDT value, then send an IPI to the mm user CPUs to have each load
the new value.
But there is an ordering problem: a new mm user CPU sets itself in
mm_cpumask() and then reads mm->context.ldt. The LDT-installing CPU
writes mm->context.ldt and then reads mm_cpumask(). But, there is
nothing which orders the LDT installation side actions. The CPU
can read mm_cpumask() before its write becomes visible.
Ensure that new mm user CPUs see the new mm->context.ldt. Make
mm->context.ldt visible before reading mm_cpumask().
Also convert the smp_store_release() over to a WRITE_ONCE().
smp_store_release() has an internal barrier which is weaker than
the new smp_mb(). Avoid an extra barrier by converting it to
WRITE_ONCE().
Also refresh/correct misleading comments. READ/WRITE_ONCE() do not
"synchronize" anything themselves.
Reported-by: Jaeyoung Chung <jjy600901@snu.ac.kr>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Jaeyoung Chung <jjy600901@snu.ac.kr>
Acked-by: Linus Torvalds <torvalds@linuxfoundation.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/ldt.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -43,7 +43,7 @@ void load_mm_ldt(struct mm_struct *mm)
{
struct ldt_struct *ldt;
- /* READ_ONCE synchronizes with smp_store_release */
+ /* Pairs with WRITE_ONCE() in install_ldt() */
ldt = READ_ONCE(mm->context.ldt);
/*
@@ -422,8 +422,14 @@ static void install_ldt(struct mm_struct
{
mutex_lock(&mm->context.lock);
- /* Synchronizes with READ_ONCE in load_mm_ldt. */
- smp_store_release(&mm->context.ldt, ldt);
+ /*
+ * Ensure that new mm user CPUs either see the new LDT value
+ * or get an IPI. Make the store visible before reading
+ * mm_cpumask(). New mm users make their mm_cpumask() writes
+ * visible before reading mm->context.ldt.
+ */
+ WRITE_ONCE(mm->context.ldt, ldt);
+ smp_mb();
/* Activate the LDT for all CPUs using currents mm. */
on_each_cpu_mask(mm_cpumask(mm), flush_ldt, mm, true);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0552/1167] xen/gntdev: fix deadlock between map ioctl and mmap
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (545 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0551/1167] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0553/1167] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
` (110 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrey Misiurov, Juergen Gross
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Misiurov <andrey.misyrov@gmail.com>
commit 7620a997e4854c94eacebf0c2d453fbd78ccdb46 upstream.
Commit 45ca1afe2fd1 ("xen/gntdev: fix error handling in ioctl") moved
copy_to_user() in gntdev_ioctl_map_grant_ref() under priv->lock. A
fault in copy_to_user() takes mmap_lock, while gntdev_mmap() is called
with mmap_lock held and takes priv->lock:
ioctl thread mmap thread
mutex_lock(&priv->lock)
mmap_write_lock(mm)
gntdev_mmap()
mutex_lock(&priv->lock)
copy_to_user() faults
mmap_read_lock(mm)
Reproduced on Debian 6.12.111 in a Xen guest, with the ioctl argument
on a MAP_PRIVATE file page that has not been written yet. sysrq-w:
task:repro state:D stack:0 pid:4479 tgid:4477 ppid:1 flags:0x00000000
rwsem_down_read_slowpath+0x25c/0x480
down_read_killable+0x48/0xc0
lock_mm_and_find_vma+0x96/0x250
do_user_addr_fault+0x12d/0x620
exc_page_fault+0x7e/0x180
asm_exc_page_fault+0x26/0x30
_copy_to_user+0x36/0x50
gntdev_ioctl+0x3b9/0xa00 [xen_gntdev]
__x64_sys_ioctl+0x97/0xc0
task:repro state:D stack:0 pid:4480 tgid:4477 ppid:1 flags:0x00000000
__mutex_lock.constprop.0+0x41b/0x720
gntdev_mmap+0x4d/0x330 [xen_gntdev]
__mmap_region+0x697/0xb10
mmap_region+0x78/0xa0
do_mmap+0x45d/0x630
vm_mmap_pgoff+0xf8/0x1c0
Drop priv->lock before copy_to_user() again. On failure, re-take it
and remove the map by index, as IOCTL_GNTDEV_UNMAP_GRANT_REF does,
since another thread may have unmapped it meanwhile.
Fixes: 45ca1afe2fd1 ("xen/gntdev: fix error handling in ioctl")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Misiurov <andrey.misyrov@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261013170745.583279-1-andrey.misyrov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/gntdev.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -678,15 +678,19 @@ static long gntdev_ioctl_map_grant_ref(s
mutex_lock(&priv->lock);
gntdev_add_map(priv, map);
op.index = map->index << PAGE_SHIFT;
+ mutex_unlock(&priv->lock);
if (copy_to_user(u, &op, sizeof(op)) != 0) {
- list_del(&map->next);
+ mutex_lock(&priv->lock);
+ map = gntdev_find_map_index(priv, op.index >> PAGE_SHIFT,
+ op.count);
+ if (map)
+ list_del(&map->next);
mutex_unlock(&priv->lock);
gntdev_put_map(priv, map);
return -EFAULT;
}
- mutex_unlock(&priv->lock);
return 0;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0553/1167] xen/privcmd: fix double free when an irqfd is shut down twice
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (546 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0552/1167] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0554/1167] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
` (109 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Qihang, Juergen Gross
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qihang <q.h.hack.winter@gmail.com>
commit 72a900c666adb97df77b05cf8540c4117f9c83ba upstream.
irqfd_deactivate() takes the irqfd off irqfds_list and queues
irqfd_shutdown(). queue_work() is not a once-only gate: it refuses to
enqueue a work item only while WORK_STRUCT_PENDING is set, and
process_one_work() clears that bit before it calls the work function. So
nothing records that the shutdown work has already been queued, and
nothing protects the window between the start of irqfd_shutdown() and the
kfree() at its end.
Two paths call irqfd_deactivate() for the same irqfd:
- privcmd_irqfd_deassign(), from the PRIVCMD_IRQFD_FLAG_DEASSIGN ioctl;
- irqfd_wakeup(), with EPOLLHUP set, when the last reference to the
eventfd file goes away, which runs wake_up_poll(&ctx->wqh, EPOLLHUP)
from eventfd_release().
irqfds_lock serialises the two calls, but it does not make the second one
a no-op, and eventfd_ctx_fdget() takes a reference to the eventfd_ctx,
not to the struct file, so the last fd can still be closed while the
ioctl is running:
CPU0 CPU1
eventfd_ctx_fdget()
spin_lock(irqfds_lock)
list_del_init(&kirqfd->list)
queue_work(&kirqfd->shutdown) close(fd)
eventfd_release()
wake_up_poll(EPOLLHUP)
irqfd_wakeup()
spin_lock(irqfds_lock)
irqfd_deactivate() again
If the work item has already started by then, its pending bit has been
cleared and the second queue_work() succeeds. irqfd_shutdown() then runs
twice, so eventfd_ctx_remove_wait_queue(), eventfd_ctx_put() and kfree()
each hit the same object a second time; and when the second queue_work()
lands after the irqfd has been freed, the workqueue list operations write
to freed memory.
virt/kvm/eventfd.c has the same two callers and has had this guard since
the original irqfd support (721eecbf4fe99): irqfd_wakeup() calls
irqfd_deactivate() only if irqfd_is_active(). The comment there explains
why that is enough: the other side deactivates the irqfd before it takes
it off the waitqueue, and irqfd_shutdown() needs the waitqueue lock,
which this callback holds, so the irqfd cannot be freed under it.
Do the same here. list_del_init() leaves the list head empty and the
irqfd stays off the list until kfree(), so it serves as a one-way
"active" flag. The test is in irqfd_deactivate() rather than in
irqfd_wakeup() because privcmd_irqfd_deassign() walks irqfds_list and can
therefore never reach an inactive irqfd; only the wakeup path can, and a
single test covers both callers.
Fixes: f8941e6c4c712 ("xen: privcmd: Add support for irqfd")
Cc: stable@vger.kernel.org
Signed-off-by: Qihang <q.h.hack.winter@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261101163251.55099-1-q.h.hack.winter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/privcmd.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -872,10 +872,25 @@ struct privcmd_kernel_irqfd {
poll_table pt;
};
+static bool irqfd_is_active(struct privcmd_kernel_irqfd *kirqfd)
+{
+ lockdep_assert_held(&irqfds_lock);
+
+ return !list_empty(&kirqfd->list);
+}
+
static void irqfd_deactivate(struct privcmd_kernel_irqfd *kirqfd)
{
lockdep_assert_held(&irqfds_lock);
+ /*
+ * Both the deassign ioctl and the eventfd wakeup path can reach
+ * this function. list_del_init() marks the irqfd inactive, so
+ * only the first caller may queue the shutdown work.
+ */
+ if (!irqfd_is_active(kirqfd))
+ return;
+
list_del_init(&kirqfd->list);
queue_work(irqfd_cleanup_wq, &kirqfd->shutdown);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0554/1167] xen/pvcalls: unwind pvcalls_new_active_socket() step by step
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (547 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0553/1167] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0555/1167] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
` (108 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Stabellini, Yehyeong Lee,
Juergen Gross
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 702ba3c80a8736898813a2c7484d695278aa114d upstream.
Every error path in pvcalls_new_active_socket() jumps to one shared label
that does list_del(&map->list) and then hands map to
pvcalls_back_release_active(). But map comes from kzalloc() and its
list_head is only published at the very end of the function, after the last
of those jumps:
down(&fedata->socket_lock);
list_add_tail(&map->list, &fedata->socket_mappings);
up(&fedata->socket_lock);
so on the error path map->list is still {NULL, NULL} and __list_del()
writes through a NULL pointer.
A frontend gets there with one value it owns: the ring_order field of the
page it granted. Anything above MAX_RING_ORDER takes the second goto, and
nothing else in the function has run by then.
The result is an oops in whichever context handled the request - the
pvcalls-back threaded IRQ handler for PVCALLS_CONNECT, mappass->wq for
PVCALLS_ACCEPT - and because it happens after down(&fedata->socket_lock)
that semaphore is never released, so every later operation on the frontend
blocks on it and the backend never completes backend_disconnect(). (With
CONFIG_DEBUG_LIST the list_del() only reports and returns, and
pvcalls_back_release_active() then runs on a map whose irq is still 0 and
whose bytes, ioworker.wq and saved_data_ready are all NULL.)
A frontend asking for ring_order 5, on a dom0 built with KASAN
(the request was issued by a test-only change to the frontend):
[ 133.728877] pvcalls_new_active_socket frontend requested ring_order 5, which is > MAX (4)
[ 133.732868] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
[ 133.737910] KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
[ 133.741666] CPU: 0 UID: 0 PID: 133 Comm: irq/39-pvcalls- Not tainted 7.3.0-kCTLblk2-15482-g21a7f44fd076-dirty #1 PREEMPT(full)
[ 133.746986] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 133.751512] RIP: 0010:pvcalls_new_active_socket+0x821/0xb90
[ 133.754237] Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 f6 01 00 00 48 8d 79 08 4c 8b 6b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 14 02 00 00 4c 89 ea 4c 89 69 08 48 b8 00 00 00
[ 133.763126] RSP: 0018:ffffc900004afb38 EFLAGS: 00010202
[ 133.765861] RAX: dffffc0000000000 RBX: ffff88810886c900 RCX: 0000000000000000
[ 133.769348] RDX: 0000000000000001 RSI: 0000000000000246 RDI: 0000000000000008
[ 133.772787] RBP: 1ffff92000095f6b R08: 0000000000000001 R09: fffff52000095f58
[ 133.776260] R10: 0000000000000003 R11: ffff888100077320 R12: ffff88810858b410
[ 133.779823] R13: 0000000000000000 R14: ffff88810858b460 R15: ffff88810858b400
[ 133.783382] FS: 0000000000000000(0000) GS:ffff8881b034c000(0000) knlGS:0000000000000000
[ 133.787351] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 133.790308] CR2: 00000000006042c0 CR3: 0000000108400001 CR4: 0000000000770ef0
[ 133.793822] PKRU: 55555554
[ 133.795347] Call Trace:
[ 133.796778] <TASK>
[ 133.798082] ? __pfx_pvcalls_new_active_socket+0x10/0x10
[ 133.800801] ? security_socket_post_create+0x4d/0x60
[ 133.803275] ? release_sock+0x1a/0x1d0
[ 133.805182] pvcalls_back_event+0x1b09/0x23e0
[ 133.807431] ? __pfx_pvcalls_back_event+0x10/0x10
[ 133.809814] ? __pfx__raw_spin_lock_irqsave+0x10/0x10
[ 133.812251] ? __pfx_pvcalls_back_event+0x10/0x10
[ 133.814554] irq_thread_fn+0x86/0x150
[ 133.816468] irq_thread+0x2da/0x580
[ 133.818363] ? __pfx_irq_thread_fn+0x10/0x10
[ 133.820586] ? __pfx_irq_thread+0x10/0x10
[ 133.822670] ? __kthread_parkme+0x88/0x170
[ 133.824803] ? __pfx_irq_thread+0x10/0x10
[ 133.827153] ? __pfx_irq_thread+0x10/0x10
[ 133.829304] kthread+0x2c8/0x3b0
[ 133.831176] ? recalc_sigpending+0x15c/0x1e0
[ 133.833570] ? __pfx_kthread+0x10/0x10
[ 133.835572] ret_from_fork+0x373/0x5b0
[ 133.837581] ? __pfx_ret_from_fork+0x10/0x10
[ 133.839978] ? __switch_to+0x3c4/0xb40
[ 133.841984] ? __pfx_kthread+0x10/0x10
[ 133.843970] ret_from_fork_asm+0x1a/0x30
[ 133.846031] </TASK>
[ 133.847420] Modules linked in:
[ 133.849240] ---[ end trace 0000000000000000 ]---
Give each failure its own label, so that only resources that were actually
acquired are released and the list the map was never added to is left
alone. The map is not published anywhere at that point, so the error path
needs no socket_lock at all. sock_release() stays in the callee on every
error path, the way
commit 8fafac202d18 ("xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()")
arranged it.
Fixes: 5db4d286a8ef ("xen/pvcalls: implement connect command")
Cc: stable@vger.kernel.org
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261110125002.46683-2-yhlee@isslab.korea.ac.kr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/pvcalls-back.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -337,7 +337,7 @@ static struct sock_mapping *pvcalls_new_
ret = xenbus_map_ring_valloc(fedata->dev, &ref, 1, &page);
if (ret < 0)
- goto out;
+ goto out_map;
map->ring = page;
map->ring_order = map->ring->ring_order;
/* first read the order, then map the data ring */
@@ -345,19 +345,19 @@ static struct sock_mapping *pvcalls_new_
if (map->ring_order > MAX_RING_ORDER) {
pr_warn("%s frontend requested ring_order %u, which is > MAX (%u)\n",
__func__, map->ring_order, MAX_RING_ORDER);
- goto out;
+ goto out_unmap_ring;
}
ret = xenbus_map_ring_valloc(fedata->dev, map->ring->ref,
(1 << map->ring_order), &page);
if (ret < 0)
- goto out;
+ goto out_unmap_ring;
map->bytes = page;
ret = bind_interdomain_evtchn_to_irqhandler_lateeoi(
fedata->dev, evtchn,
pvcalls_back_conn_event, 0, "pvcalls-backend", map);
if (ret < 0)
- goto out;
+ goto out_unmap_bytes;
map->irq = ret;
map->data.in = map->bytes;
@@ -365,7 +365,7 @@ static struct sock_mapping *pvcalls_new_
map->ioworker.wq = alloc_ordered_workqueue("pvcalls_io", 0);
if (!map->ioworker.wq)
- goto out;
+ goto out_unbind;
atomic_set(&map->io, 1);
INIT_WORK(&map->ioworker.register_work, pvcalls_back_ioworker);
@@ -381,11 +381,16 @@ static struct sock_mapping *pvcalls_new_
write_unlock_bh(&map->sock->sk->sk_callback_lock);
return map;
-out:
- down(&fedata->socket_lock);
- list_del(&map->list);
- pvcalls_back_release_active(fedata->dev, fedata, map);
- up(&fedata->socket_lock);
+
+out_unbind:
+ unbind_from_irqhandler(map->irq, map);
+out_unmap_bytes:
+ xenbus_unmap_ring_vfree(fedata->dev, map->bytes);
+out_unmap_ring:
+ xenbus_unmap_ring_vfree(fedata->dev, (void *)map->ring);
+out_map:
+ sock_release(sock);
+ kfree(map);
return NULL;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0555/1167] xen/pvcalls: destroy the per-socket workqueue on release
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (548 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0554/1167] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0556/1167] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
` (107 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Stabellini, Yehyeong Lee,
Juergen Gross
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 6b3feb6bfa9ac384f7a3ec25c40b9b4d3da96d25 upstream.
pvcalls_new_active_socket() gives every active socket its own ordered
workqueue:
map->ioworker.wq = alloc_ordered_workqueue("pvcalls_io", 0);
and nothing ever destroys it. pvcalls_back_release_active() flushes
map->ioworker.register_work and frees map, but the workqueue and its
pool_workqueues stay allocated, so a frontend leaks a workqueue per socket
it connects and releases - a loop a guest can run as long as it likes.
Destroy it right after flush_work(): the IRQ is disabled and sk_data_ready
restored by then, so nothing can queue new work, and the rings are still
mapped while it drains - pvcalls_conn_back_read() reads map->ring and
map->data, which xenbus_unmap_ring_vfree() takes away a few lines later.
pvcalls_back_ioworker() does not take fedata->socket_lock, which the
backend_disconnect() caller holds here - only the socket's own
sk_receive_queue lock - so draining it from this point is safe; the
flush_work() just above already has the same requirement.
Fixes: 5db4d286a8ef ("xen/pvcalls: implement connect command")
Cc: stable@vger.kernel.org
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261110125002.46683-3-yhlee@isslab.korea.ac.kr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/pvcalls-back.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -452,6 +452,7 @@ static int pvcalls_back_release_active(s
atomic_set(&map->release, 1);
flush_work(&map->ioworker.register_work);
+ destroy_workqueue(map->ioworker.wq);
xenbus_unmap_ring_vfree(dev, map->bytes);
xenbus_unmap_ring_vfree(dev, (void *)map->ring);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0556/1167] hwmon: (aht10) Fix update_interval overflow on 64-bit
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (549 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0555/1167] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0557/1167] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
` (106 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rupesh Majhi, Guenter Roeck
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rupesh Majhi <zoone.rupert@gmail.com>
commit b5c5b67e02406fb48acf57cf2c30a570230fd6aa upstream.
On 64-bit, update_interval writes are clamped to LONG_MAX ms, but
ms_to_ktime() overflows above 9223372036854 ms and the interval wraps.
LONG_MAX becomes -1 ms, so every read starts a new measurement and
update_interval reads back -1.
Clamp to INT_MAX like sht4x, so the limit is the same on all platforms.
Fixes: 8c78f0dee437 ("hwmon: Add AHT10 Temperature and Humidity Sensor Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
Link: https://patch.msgid.link/20261108172651.220121-1-zoone.rupert@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/aht10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/aht10.c
+++ b/drivers/hwmon/aht10.c
@@ -229,7 +229,7 @@ static int aht10_read_values(struct aht1
static ssize_t aht10_interval_write(struct aht10_data *data,
long val)
{
- data->min_poll_interval = ms_to_ktime(clamp_val(val, 2000, LONG_MAX));
+ data->min_poll_interval = ms_to_ktime(clamp_val(val, 2000, INT_MAX));
return 0;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0557/1167] hwmon: (pmbus/mp2975) Get vout fault limits dynamically
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (550 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0556/1167] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0558/1167] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
` (105 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Felix Radensky, Vadim Pasternak,
Guenter Roeck
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Radensky <fradensky@nvidia.com>
commit 00944852275efd39706fe7b9ce75c28edde983eb upstream.
The over- and under-voltage fault limits of the tracking mode are
relative to the voltage reference, which follows the VID/AVS requests
issued to the device and therefore changes at runtime.
The driver reads the voltage reference once during probe and derives the
limits from that snapshot, which the PMBus core caches in addition. As a
result in2_crit and in2_lcrit reflect the operating point at probe, rather
than the thresholds the device enforces. On systems where the device
supplies the CPU core voltage, in2_crit was reported anywhere between
1.15V and 1.70V across identical systems, causing false over-voltage
reports once the CPU voltage exceeded the value latched at probe.
Read the voltage reference and the over-voltage offset selector whenever
a limit is requested, and mark both limits with pmbus_set_update(), so
that the core does not cache them. The voltage reference is available on
page 3 only. Let the core change the page, so that the page it caches
matches the device, except for a single rail configuration, for which the
core does not issue PAGE commands, and the page is changed directly.
With the selector read at runtime, a device configured with an
unsupported selector no longer fails to probe. The OVP1 threshold, which
does not depend on the selector, is reported for it instead, with a
warning.
Clamp the under-voltage limit to zero, since the offset can exceed a low
voltage reference, while a negative value would be reported as a read
error.
Fixes: 2c6fcbb21149 ("hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Radensky <fradensky@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://patch.msgid.link/20261105193200.1570996-1-fradensky@nvidia.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/pmbus/mp2975.c | 207 +++++++++++++++++++++++--------------------
1 file changed, 115 insertions(+), 92 deletions(-)
--- a/drivers/hwmon/pmbus/mp2975.c
+++ b/drivers/hwmon/pmbus/mp2975.c
@@ -103,10 +103,7 @@ struct mp2975_data {
int vout_scale;
int max_phases[MP2975_PAGE_NUM];
int vid_step[MP2975_PAGE_NUM];
- int vref[MP2975_PAGE_NUM];
- int vref_off[MP2975_PAGE_NUM];
int vout_max[MP2975_PAGE_NUM];
- int vout_ov_fixed[MP2975_PAGE_NUM];
int curr_sense_gain[MP2975_PAGE_NUM];
};
@@ -379,12 +376,77 @@ static int mp2973_read_word_data(struct
return ret;
}
+/*
+ * Let the PMBus core change the page, so that the page it caches matches the
+ * device. The core does not issue PAGE commands for a single rail
+ * configuration, thus change the page directly then.
+ */
+static int
+mp2975_page_set(struct i2c_client *client, struct mp2975_data *data, int page)
+{
+ if (data->info.pages > 1)
+ return pmbus_set_page(client, page, 0xff);
+
+ return i2c_smbus_write_byte_data(client, PMBUS_PAGE, page);
+}
+
+/*
+ * Voltage reference is available on page 3 only. The callers read a register
+ * of the rail through the core first, thus the core caches the rail page.
+ */
+static int
+mp2975_vref_get(struct i2c_client *client, struct mp2975_data *data, int page)
+{
+ int ret, vref;
+
+ ret = mp2975_page_set(client, data, 3);
+ if (ret < 0)
+ return ret;
+
+ vref = i2c_smbus_read_word_data(client, page ? MP2975_MFR_READ_VREF_R2 :
+ MP2975_MFR_READ_VREF_R1);
+
+ ret = mp2975_page_set(client, data, page);
+ if (ret < 0)
+ return ret;
+
+ return (vref < 0) ? vref : vref * data->vid_step[page];
+}
+
+static int
+mp2975_ovp2_offset_get(int ovp_th_set)
+{
+ switch ((ovp_th_set & GENMASK(5, 3)) >> 3) {
+ case 1:
+ return 140;
+ case 2:
+ return 220;
+ case 4:
+ return 400;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int
+mp2975_vout_ovp2_get(struct i2c_client *client, struct mp2975_data *data,
+ int page, int vref_off)
+{
+ int vref;
+
+ vref = mp2975_vref_get(client, data, page);
+ if (vref < 0)
+ return vref;
+
+ return vref + DIV_ROUND_CLOSEST(vref_off * data->vout_scale, 10);
+}
+
static int mp2975_read_word_data(struct i2c_client *client, int page,
int phase, int reg)
{
const struct pmbus_driver_info *info = pmbus_get_driver_info(client);
struct mp2975_data *data = to_mp2975_data(info);
- int ret;
+ int ret, ovp1, vref_off, uv_off;
switch (reg) {
case PMBUS_OT_FAULT_LIMIT:
@@ -401,19 +463,35 @@ static int mp2975_read_word_data(struct
break;
case PMBUS_VOUT_OV_FAULT_LIMIT:
/*
- * Register provides two values for over-voltage protection
- * threshold for fixed (ovp2) and tracking (ovp1) modes. The
- * minimum of these two values is provided as over-voltage
- * fault alarm.
+ * Device provides dual over-voltage protection. OVP1 is
+ * referred to the maximum reference voltage, while OVP2 is
+ * referred to the current voltage reference, which is changed
+ * at runtime. Protection is tripped by any of them, thus the
+ * minimum of the two is exposed as over-voltage fault alarm,
+ * and OVP2 is obtained on each read.
*/
ret = mp2975_read_word_helper(client, page, phase,
MP2975_MFR_OVP_TH_SET,
- GENMASK(2, 0));
+ GENMASK(5, 0));
+ if (ret < 0)
+ return ret;
+
+ ovp1 = data->vout_max[page] + 50 * ((ret & GENMASK(2, 0)) + 1);
+
+ /* OVP1 still applies if the OVP2 threshold is unknown. */
+ vref_off = mp2975_ovp2_offset_get(ret);
+ if (vref_off < 0) {
+ dev_warn_once(&client->dev,
+ "unsupported OVP2 selector, reporting OVP1 threshold\n");
+ ret = ovp1;
+ break;
+ }
+
+ ret = mp2975_vout_ovp2_get(client, data, page, vref_off);
if (ret < 0)
return ret;
- ret = min_t(int, data->vout_max[page] + 50 * (ret + 1),
- data->vout_ov_fixed[page]);
+ ret = min_t(int, ovp1, ret);
break;
case PMBUS_VOUT_UV_FAULT_LIMIT:
ret = mp2975_read_word_helper(client, page, phase,
@@ -422,8 +500,17 @@ static int mp2975_read_word_data(struct
if (ret < 0)
return ret;
- ret = DIV_ROUND_CLOSEST(data->vref[page] * 10 - 50 *
- (ret + 1) * data->vout_scale, 10);
+ uv_off = 50 * (ret + 1) * data->vout_scale;
+
+ ret = mp2975_vref_get(client, data, page);
+ if (ret < 0)
+ return ret;
+
+ /*
+ * Offset can exceed the voltage reference, while a negative
+ * value would be reported as a read error.
+ */
+ ret = max_t(int, DIV_ROUND_CLOSEST(ret * 10 - uv_off, 10), 0);
break;
case PMBUS_VIRT_READ_POUT_MAX:
ret = mp2975_read_word_helper(client, page, phase,
@@ -673,60 +760,6 @@ mp2975_current_sense_gain_get(struct i2c
}
static int
-mp2975_vref_get(struct i2c_client *client, struct mp2975_data *data,
- struct pmbus_driver_info *info)
-{
- int ret;
-
- ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, 3);
- if (ret < 0)
- return ret;
-
- /* Get voltage reference value for rail 1. */
- ret = i2c_smbus_read_word_data(client, MP2975_MFR_READ_VREF_R1);
- if (ret < 0)
- return ret;
-
- data->vref[0] = ret * data->vid_step[0];
-
- /* Get voltage reference value for rail 2, if connected. */
- if (data->info.pages == MP2975_PAGE_NUM) {
- ret = i2c_smbus_read_word_data(client, MP2975_MFR_READ_VREF_R2);
- if (ret < 0)
- return ret;
-
- data->vref[1] = ret * data->vid_step[1];
- }
- return 0;
-}
-
-static int
-mp2975_vref_offset_get(struct i2c_client *client, struct mp2975_data *data,
- int page)
-{
- int ret;
-
- ret = i2c_smbus_read_word_data(client, MP2975_MFR_OVP_TH_SET);
- if (ret < 0)
- return ret;
-
- switch ((ret & GENMASK(5, 3)) >> 3) {
- case 1:
- data->vref_off[page] = 140;
- break;
- case 2:
- data->vref_off[page] = 220;
- break;
- case 4:
- data->vref_off[page] = 400;
- break;
- default:
- return -EINVAL;
- }
- return 0;
-}
-
-static int
mp2975_vout_max_get(struct i2c_client *client, struct mp2975_data *data,
struct pmbus_driver_info *info, int page)
{
@@ -830,25 +863,6 @@ mp2975_vout_per_rail_config_get(struct i
ret = mp2975_vout_max_get(client, data, info, i);
if (ret < 0)
return ret;
-
- /* Skip if reading Vref is unsupported */
- if (data->chip_id != mp2975)
- continue;
-
- /* Obtain voltage reference offsets. */
- ret = mp2975_vref_offset_get(client, data, i);
- if (ret < 0)
- return ret;
-
- /*
- * Set over-voltage fixed value. Thresholds are provided as
- * fixed value, and tracking value. The minimum of them are
- * exposed as over-voltage critical threshold.
- */
- data->vout_ov_fixed[i] = data->vref[i] +
- DIV_ROUND_CLOSEST(data->vref_off[i] *
- data->vout_scale,
- 10);
}
return 0;
@@ -955,11 +969,6 @@ static int mp2975_probe(struct i2c_clien
if (ret)
return ret;
- /* Obtain voltage reference values. */
- ret = mp2975_vref_get(client, data, info);
- if (ret)
- return ret;
-
/* Obtain vout over-voltage scales. */
ret = mp2975_vout_ov_scale_get(client, data, info);
if (ret < 0)
@@ -976,7 +985,21 @@ static int mp2975_probe(struct i2c_clien
if (ret)
return ret;
- return pmbus_do_probe(client, info);
+ ret = pmbus_do_probe(client, info);
+ if (ret)
+ return ret;
+
+ /*
+ * Vout over- and under-voltage fault limits are relative to the
+ * voltage reference, which is changed at runtime. Do not allow the
+ * PMBus core to cache them.
+ */
+ if (data->chip_id == mp2975) {
+ pmbus_set_update(client, PMBUS_VOUT_OV_FAULT_LIMIT, true);
+ pmbus_set_update(client, PMBUS_VOUT_UV_FAULT_LIMIT, true);
+ }
+
+ return 0;
}
static const struct of_device_id __maybe_unused mp2975_of_match[] = {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0558/1167] hwmon: (sy7636a) fix negative temperatures
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (551 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0557/1167] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0559/1167] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
` (104 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Mazzini, Guenter Roeck
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Mazzini <pmazzini@gmail.com>
commit fc8519fab34e162b0c29dacccf73031820878917 upstream.
The thermistor readout is a signed 8-bit value in degrees Celsius.
Fixes: de34a4053250 ("hwmon: sy7636a: Add temperature driver for sy7636a")
Cc: stable@vger.kernel.org
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
Link: https://patch.msgid.link/20261108093602.329554-3-pmazzini@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/sy7636a-hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/sy7636a-hwmon.c
+++ b/drivers/hwmon/sy7636a-hwmon.c
@@ -29,7 +29,7 @@ static int sy7636a_read(struct device *d
if (ret)
return ret;
- *temp = reg_val * 1000;
+ *temp = (s8)reg_val * 1000;
return 0;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0559/1167] hwmon: (scmi) Check channel config allocation
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (552 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0558/1167] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0560/1167] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
` (103 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Sudeep Holla, Guenter Roeck
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
commit a2996d892d0150d059d39c683d95d6fd7a37630a upstream.
scmi_hwmon_add_chan_info() can fail to allocate a channel's config
array. Ignoring that error leaves a channel with a NULL config pointer
in the hwmon chip info, which hwmon dereferences while registering the
device.
Check the helper's return value and abort probe on failure.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-d10ced6b-a6f0-403b-9619-f5a6573f9e7f
Fixes: b23688aefb8b ("hwmon: add support for sensors exported via ARM SCMI")
Cc: stable@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Link: https://patch.msgid.link/20261109151927.1672956-1-sudeep.holla@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/scmi-hwmon.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/hwmon/scmi-hwmon.c
+++ b/drivers/hwmon/scmi-hwmon.c
@@ -228,8 +228,8 @@ static int scmi_thermal_sensor_register(
static int scmi_hwmon_probe(struct scmi_device *sdev)
{
- int i, idx;
u16 nr_sensors;
+ int i, idx, ret;
enum hwmon_sensor_types type;
struct scmi_sensors *scmi_sensors;
const struct scmi_sensor_info *sensor;
@@ -297,8 +297,12 @@ static int scmi_hwmon_probe(struct scmi_
if (!nr_count[type])
continue;
- scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev, nr_count[type],
- type, hwmon_attributes[type]);
+ ret = scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev,
+ nr_count[type], type,
+ hwmon_attributes[type]);
+ if (ret)
+ return ret;
+
*ptr_scmi_ci++ = scmi_hwmon_chan++;
scmi_sensors->info[type] =
@@ -333,8 +337,6 @@ static int scmi_hwmon_probe(struct scmi_
return PTR_ERR(hwdev);
for (i = 0; i < nr_count_temp; i++) {
- int ret;
-
sensor = *(scmi_sensors->info[hwmon_temp] + i);
if (!sensor)
continue;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0560/1167] hwmon: (max31760) Fix the local temperature limit registers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (553 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0559/1167] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0561/1167] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
` (102 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Aleksandrov <lightofmysoul@gmail.com>
commit 028ed93145d9be88eee670088ef13482b5d36c1a upstream.
temp2_max and temp2_crit use each other's registers, so reading them
shows the local limits swapped and writing temp2_max changes the
overtemperature (SHDN) threshold.
Use the high limit (0x0C) for temp2_max and the overtemperature limit
(0x08) for temp2_crit.
Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislav Aleksandrov <lightofmysoul@gmail.com>
Link: https://patch.msgid.link/20261108-max31760-fixes-v1-1-a61450463059@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/max31760.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/hwmon/max31760.c
+++ b/drivers/hwmon/max31760.c
@@ -27,8 +27,8 @@
#define REG_TACH(ch) (0x52 + (ch) * 2)
#define REG_TEMP_INPUT(ch) (0x56 + (ch) * 2)
-#define REG_TEMP_MAX(ch) (0x06 + (ch) * 2)
-#define REG_TEMP_CRIT(ch) (0x0A + (ch) * 2)
+#define REG_TEMP_MAX(ch) ((ch) ? 0x0C : 0x06)
+#define REG_TEMP_CRIT(ch) ((ch) ? 0x08 : 0x0A)
#define TEMP11_FROM_REG(reg) ((reg) / 32 * 125)
#define TEMP11_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0561/1167] hwmon: (max31760) Leave standby mode at probe
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (554 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0560/1167] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0562/1167] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
` (101 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Aleksandrov <lightofmysoul@gmail.com>
commit 95bddc5252a4c0a2ed9d62e7e53a3461265d9603 upstream.
The driver never clears the standby bit (CR2_STBY) during probe.
While max31760_resume() clears this bit on resume, probe only
configured CR2_ALERTS.
If the chip was left in standby (for example, by boot firmware or a
previously running OS before a warm reboot), it remains in standby:
temperature sensing, fan speed counting, and PWM output are halted.
This occurs on the Samsung Galaxy XR, where the bootloader places the
chip in standby during boot.
Clear CR2_STBY alongside setting CR2_ALERTS in probe.
Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislav Aleksandrov <lightofmysoul@gmail.com>
Link: https://patch.msgid.link/20261108-max31760-fixes-v1-2-a61450463059@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/max31760.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/hwmon/max31760.c
+++ b/drivers/hwmon/max31760.c
@@ -533,8 +533,9 @@ static int max31760_probe(struct i2c_cli
dev_set_drvdata(dev, state);
- /* Set alert output to comparator mode */
- ret = regmap_set_bits(state->regmap, REG_CR2, CR2_ALERTS);
+ /* Leave standby mode, set alert output to comparator mode */
+ ret = regmap_update_bits(state->regmap, REG_CR2, CR2_STBY | CR2_ALERTS,
+ CR2_ALERTS);
if (ret)
return dev_err_probe(dev, ret, "cannot write register\n");
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0562/1167] hwmon: (max31760) Report 0 RPM before the first fan speed measurement
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (555 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0561/1167] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0563/1167] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
` (100 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Aleksandrov <lightofmysoul@gmail.com>
commit 33d58cbf2ab26bda81bc3052158d8b9867d5b9a6 upstream.
The tachometer count registers initialize to 0 until the first
measurement cycle completes after power-on. To prevent division by
zero, tach_to_rpm() clamped tach == 0 to 1, causing it to compute
and report 3,000,000 RPM (60 * 100000 / 1 / 2).
Return 0 RPM when tach == 0 instead.
Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislav Aleksandrov <lightofmysoul@gmail.com>
Link: https://patch.msgid.link/20261108-max31760-fixes-v1-3-a61450463059@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/max31760.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/hwmon/max31760.c
+++ b/drivers/hwmon/max31760.c
@@ -68,8 +68,9 @@ static const int max31760_pwm_freq[] = {
static int tach_to_rpm(u16 tach)
{
+ /* The count is 0 until the first measurement */
if (tach == 0)
- tach = 1;
+ return 0;
return 60 * 100000 / tach / 2;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0563/1167] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (556 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0562/1167] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0564/1167] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
` (99 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jan Höppner,
Stefan Haberland, Jens Axboe
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Haberland <sth@linux.ibm.com>
commit df56f7a6c20a5eb2794c0a7391bde50ba7c8c54b upstream.
dasd_eckd_build_check_tcw() allocates its request with
dasd_fmalloc_request(), but its out_err path frees it with
dasd_sfree_request(). The latter uses a different pool and therefor,
leading to invalid pointer arithmetic and a crash.
Use the matching dasd_ffree_request() instead.
The same error path also leaves start_priv->count incremented
without ever decrementing it again.
This leaks a permanent reference on every build failure.
Decrement it before freeing the request.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260722103704.1709668-1-sth@linux.ibm.com
Fixes: 8fd575200db5 ("s390/dasd: Add new ioctl BIODASDCHECKFMT")
Cc: stable@vger.kernel.org #4.7
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Fixes: 5e2b17e712cf ("s390/dasd: Add dynamic formatting support for ESE volumes")
Link: https://patch.msgid.link/20261112102608.1057852-4-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/block/dasd_eckd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -2607,7 +2607,8 @@ dasd_eckd_build_check_tcw(struct dasd_de
return cqr;
out_err:
- dasd_sfree_request(cqr, startdev);
+ start_priv->count--;
+ dasd_ffree_request(cqr, startdev);
return ERR_PTR(rc);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0564/1167] s390/dasd: Dont trust userspace-supplied result field in format check
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (557 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0563/1167] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0565/1167] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
` (98 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jan Höppner,
Stefan Haberland, Jens Axboe
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Haberland <sth@linux.ibm.com>
commit 7cc2dda4f7aaf596c1796184649007151ff98f8d upstream.
BIODASDCHECKFMT used to copy the entire format_check_t struct from
userspace, including the result/unit/rec/num_records/blksize/
key_length fields that are output fields only.
dasd_eckd_format_evaluate_tracks() relies on cdata->result being zero
to decide whether to apply an index correction (i--/pos--) after a
successful check. A caller that pre-sets result to a non-zero value
can suppress that correction, leaving pos advanced past the last valid
entry; the (partially out-of-bounds) fmt_buffer[pos] fields are then
copied back to userspace, leaking heap contents.
Only expect is an Input field; copy just that member in and zero
the rest of cdata.
Fixes: 8fd575200db5 ("s390/dasd: Add new ioctl BIODASDCHECKFMT")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260722103704.1709668-1-sth@linux.ibm.com
Cc: stable@vger.kernel.org #4.7
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20261112102608.1057852-5-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/block/dasd_ioctl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -309,7 +309,9 @@ static int dasd_ioctl_check_format(struc
goto out_err;
}
- if (copy_from_user(&cdata, argp, sizeof(cdata))) {
+ /* copy only input fields, clear the rest */
+ memset(&cdata, 0, sizeof(cdata));
+ if (copy_from_user(&cdata.expect, argp, sizeof(cdata.expect))) {
rc = -EFAULT;
goto out_err;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0565/1167] sctp: abort unordered partial delivery when its message is skipped
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (558 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0564/1167] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0566/1167] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
` (97 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Budding, Xin Long,
Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Budding <tim.budding@gmail.com>
commit 05852c8b70f2291a50bb3f740a66ce9caf9cb98d upstream.
When an I-FORWARD-TSN skips unordered messages on a stream,
sctp_intl_skip() only aborts the stream's unordered partial delivery if
the MID being delivered is lower than the skipped MID. If the skipped
message is the one being partially delivered, partial delivery stays in
progress: no PARTIAL_DELIVERY_ABORTED is sent, and the next unordered
message on the stream is delivered as the rest of the abandoned one.
Abort the partial delivery when the MID being delivered is at or below
the skipped MID, as the ordered case already does.
Reproduced on an unmodified kernel with the uo_pd test of the
sctp_ifwdtsn.sh selftest added later in this series; its partial
delivery checks pass with this fix. Reproduction and fix done with AI
assistance.
Fixes: de60fe910543 ("sctp: implement handle_ftsn for sctp_stream_interleave")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Budding <tim.budding@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261105050225.49292-2-tim.budding@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/stream_interleave.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sctp/stream_interleave.c
+++ b/net/sctp/stream_interleave.c
@@ -1255,7 +1255,7 @@ static void sctp_intl_skip(struct sctp_u
struct sctp_stream *stream = &ulpq->asoc->stream;
if (flags & SCTP_FTSN_U_BIT) {
- if (sin->pd_mode_uo && MID_lt(sin->mid_uo, mid)) {
+ if (sin->pd_mode_uo && !MID_lt(mid, sin->mid_uo)) {
sin->pd_mode_uo = 0;
sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x1,
GFP_ATOMIC);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0566/1167] sctp: avoid requeueing pending control chunks
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (559 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0565/1167] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0567/1167] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
` (96 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Xin Long, Kyle Zeng,
Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 665b4149e91b781a71bce8637c3a4d7d64dba05f upstream.
The T4 and RE-CONFIG timeout handlers take a reference to their cached
control chunk and submit it through SCTP_CMD_REPLY. A previous
transmission can still be on the control outqueue when output is corked
or suppressed, or when sctp_packet_transmit_chunk() could not append the
chunk.
sctp_outq_tail() then adds the same list node a second time. Re-adding a
non-tail entry can corrupt the list without being caught by the
insertion-time list checks. A subsequent flush or association teardown
can access an already freed chunk. The ASCONF path is reproducible by an
unprivileged SCTP socket owner in a user/network namespace, with KASAN
reporting a use-after-free in __sctp_outq_teardown().
Check sctp_chunk_pending() in both timeout handlers before taking the
extra reference and issuing SCTP_CMD_REPLY. If the chunk is already
linked, leave the existing entry for normal output processing. Keep
the remaining timer and error-handling commands unchanged. This also
covers RE-CONFIG retransmission after sctp_assoc_rm_peer() moves the
request to another transport and starts its timer.
The issue was found by an LLM.
Fixes: 2e3216cd54b1 ("sctp: Follow security requirement of responding with 1 packet")
Fixes: 7b9438de0cd4 ("sctp: add stream reconf timer")
Cc: stable@kernel.org
Suggested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261107030532.32310-1-kylebot@openai.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/sm_statefuns.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1121,9 +1121,11 @@ enum sctp_disposition sctp_sf_send_recon
return SCTP_DISPOSITION_DELETE_TCB;
}
- sctp_chunk_hold(asoc->strreset_chunk);
- sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
- SCTP_CHUNK(asoc->strreset_chunk));
+ if (!sctp_chunk_pending(asoc->strreset_chunk)) {
+ sctp_chunk_hold(asoc->strreset_chunk);
+ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+ SCTP_CHUNK(asoc->strreset_chunk));
+ }
sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE, SCTP_TRANSPORT(transport));
return SCTP_DISPOSITION_CONSUME;
@@ -6193,9 +6195,11 @@ enum sctp_disposition sctp_sf_t4_timer_e
* chunk, it MUST be the same (including its serial number) as the last
* ASCONF sent.
*/
- sctp_chunk_hold(asoc->addip_last_asconf);
- sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
- SCTP_CHUNK(asoc->addip_last_asconf));
+ if (!sctp_chunk_pending(asoc->addip_last_asconf)) {
+ sctp_chunk_hold(asoc->addip_last_asconf);
+ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+ SCTP_CHUNK(asoc->addip_last_asconf));
+ }
/* ADDIP 4.1 B5) Restart the T-4 RTO timer. Note that if a different
* destination is selected, then the RTO used will be that of the new
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0567/1167] sctp: fix ASCONF address change on single-homed hosts
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (560 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0566/1167] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0568/1167] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
` (95 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrey Misiurov, Xin Long,
Dave Miller
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Misiurov <andrey.misyrov@gmail.com>
commit 5175b2fb34c77cf2cd56a290affa45412cb3a228 upstream.
Commit 9b2854f86f0b ("sctp: don't free the ASCONF's own transport in
DEL-IP processing") refuses a DEL-IP of the transport the ASCONF was
located by, so that a later wildcard DEL-IP cannot use it after free.
This also breaks the single-homed address change (RFC 5061 5.3.2). The
host sends [Address Parameter L] [ADD-IP S] [DEL-IP L], the association
is located by L, and DEL-IP L is now refused. The sender never gets an
all-success ASCONF-ACK, keeps src_out_of_asoc_ok set and stops sending
data, so the association stalls.
Fix the wildcard DEL-IP instead: look up the transport of the packet
source rather than reusing asconf->transport. Both DEL-IP paths can
now free asconf->transport, and chunks bundled after the ASCONF still
use it, so point it at a surviving transport: the packet source for the
wildcard delete, the primary path for a plain one.
Found by manual code inspection while reviewing a backport of commit
9b2854f86f0b; reproduced on a two-namespace single-homed renumber.
Fixes: 9b2854f86f0b ("sctp: don't free the ASCONF's own transport in DEL-IP processing")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Misiurov <andrey.misyrov@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/sm_make_chunk.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3191,9 +3191,12 @@ static __be16 sctp_process_asconf_param(
* packet MUST be deleted.
*/
if (af->is_any(&addr)) {
- sctp_assoc_set_primary(asoc, asconf->transport);
- sctp_assoc_del_nonprimary_peers(asoc,
- asconf->transport);
+ peer = sctp_assoc_lookup_paddr(asoc, &asconf->source);
+ if (!peer)
+ return SCTP_ERROR_REQ_REFUSED;
+ sctp_assoc_set_primary(asoc, peer);
+ sctp_assoc_del_nonprimary_peers(asoc, peer);
+ asconf->transport = peer;
return SCTP_ERROR_NO_ERROR;
}
@@ -3206,13 +3209,9 @@ static __be16 sctp_process_asconf_param(
if (!peer)
return SCTP_ERROR_DNS_FAILED;
- /* Don't free asconf->transport; a later wildcard DEL-IP
- * parameter reuses it.
- */
- if (peer == asconf->transport)
- return SCTP_ERROR_REQ_REFUSED;
-
sctp_assoc_rm_peer(asoc, peer);
+ if (asconf->transport == peer)
+ asconf->transport = asoc->peer.primary_path;
break;
case SCTP_PARAM_SET_PRIMARY:
/* ADDIP Section 4.2.4
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0568/1167] sctp: fix I-FORWARD-TSN handling of fragments on other streams
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (561 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0567/1167] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0569/1167] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
` (94 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Budding, Xin Long,
Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Budding <tim.budding@gmail.com>
commit 5b9cfc6491a6e32e7315dc222992c7dbd5baa3e9 upstream.
sctp_report_iftsn() incorrectly frees queued I-DATA fragments in two
cases. First, it drops any queued fragments with TSN less than or equal
to the New Cumulative TSN. This prevents reconstruction of messages
still being received on other streams and can fully block an ordered
stream. Second, it calls sctp_intl_abort_pd() if the New Cumulative TSN
equals the highest TSN seen. This check exists for association resets
but can be inadvertently triggered by any I-FORWARD-TSN that arrives
before data with a higher TSN, causing data loss and, if a partial
delivery is in progress on an ordered stream, an aborted association.
Fix the first by freeing fragments from sctp_intl_skip() based on
stream, U bit, and MID instead of TSN. Fix the second by moving the call
to sctp_intl_abort_pd() from sctp_report_iftsn() to the corresponding
reset handlers.
Observed in real use as unexpected message loss. Reproduced on an
unmodified kernel with the sctp_ifwdtsn.sh selftest added later in this
series, which passes with this fix. Reproduction and fix done with AI
assistance.
Fixes: 47b20a88566f ("sctp: implement report_ftsn for sctp_stream_interleave")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Budding <tim.budding@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261105050225.49292-4-tim.budding@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/stream.c | 2 ++
net/sctp/stream_interleave.c | 32 +++++++++++---------------------
2 files changed, 13 insertions(+), 21 deletions(-)
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -749,6 +749,7 @@ struct sctp_chunk *sctp_process_strreset
*/
max_tsn_seen = sctp_tsnmap_get_max_tsn_seen(&asoc->peer.tsn_map);
asoc->stream.si->report_ftsn(&asoc->ulpq, max_tsn_seen);
+ asoc->stream.si->abort_pd(&asoc->ulpq, GFP_ATOMIC);
/* G1: Compute an appropriate value for the Receiver's Next TSN -- the
* TSN that the peer should use to send the next DATA chunk. The
@@ -1028,6 +1029,7 @@ struct sctp_chunk *sctp_process_strreset
LIST_HEAD(temp);
asoc->stream.si->report_ftsn(&asoc->ulpq, mtsn);
+ asoc->stream.si->abort_pd(&asoc->ulpq, GFP_ATOMIC);
sctp_tsnmap_init(&asoc->peer.tsn_map,
SCTP_TSN_MAP_INITIAL,
--- a/net/sctp/stream_interleave.c
+++ b/net/sctp/stream_interleave.c
@@ -1203,28 +1203,21 @@ static void sctp_report_fwdtsn(struct sc
sctp_ulpq_abort_pd(ulpq, GFP_ATOMIC);
}
-static void sctp_intl_reasm_flushtsn(struct sctp_ulpq *ulpq, __u32 ftsn)
+static void sctp_intl_reasm_flush_mid(struct sk_buff_head *reasm, __u16 sid,
+ __u32 mid)
{
struct sk_buff *pos, *tmp;
- skb_queue_walk_safe(&ulpq->reasm, pos, tmp) {
+ skb_queue_walk_safe(reasm, pos, tmp) {
struct sctp_ulpevent *event = sctp_skb2event(pos);
- __u32 tsn = event->tsn;
- if (TSN_lte(tsn, ftsn)) {
- __skb_unlink(pos, &ulpq->reasm);
- sctp_ulpevent_free(event);
- }
- }
+ if (event->stream < sid)
+ continue;
+ if (event->stream > sid || MID_lt(mid, event->mid))
+ break;
- skb_queue_walk_safe(&ulpq->reasm_uo, pos, tmp) {
- struct sctp_ulpevent *event = sctp_skb2event(pos);
- __u32 tsn = event->tsn;
-
- if (TSN_lte(tsn, ftsn)) {
- __skb_unlink(pos, &ulpq->reasm_uo);
- sctp_ulpevent_free(event);
- }
+ __skb_unlink(pos, reasm);
+ sctp_ulpevent_free(event);
}
}
@@ -1232,11 +1225,6 @@ static void sctp_report_iftsn(struct sct
{
/* Move the Cumulattive TSN Ack ahead. */
sctp_tsnmap_skip(&ulpq->asoc->peer.tsn_map, ftsn);
- /* purge the fragmentation queue */
- sctp_intl_reasm_flushtsn(ulpq, ftsn);
- /* abort only when it's for all data */
- if (ftsn == sctp_tsnmap_get_max_tsn_seen(&ulpq->asoc->peer.tsn_map))
- sctp_intl_abort_pd(ulpq, GFP_ATOMIC);
}
static void sctp_handle_fwdtsn(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk)
@@ -1260,6 +1248,7 @@ static void sctp_intl_skip(struct sctp_u
sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x1,
GFP_ATOMIC);
}
+ sctp_intl_reasm_flush_mid(&ulpq->reasm_uo, sid, mid);
return;
}
@@ -1271,6 +1260,7 @@ static void sctp_intl_skip(struct sctp_u
sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x0, GFP_ATOMIC);
}
+ sctp_intl_reasm_flush_mid(&ulpq->reasm, sid, mid);
sctp_mid_skip(stream, in, sid, mid);
sctp_intl_reap_ordered(ulpq, sid);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0569/1167] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (562 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0568/1167] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0570/1167] sctp: reset stored flag for each association Greg Kroah-Hartman
` (93 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tim Budding, Xin Long,
Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Budding <tim.budding@gmail.com>
commit 3097fba868019924e92b8786ebd473992565f015 upstream.
When an I-FORWARD-TSN skips the message being partially delivered on a
stream, sctp_intl_skip() passes the MID from the I-FORWARD-TSN to the
PARTIAL_DELIVERY_ABORTED notification as pdapi_seq. That MID is the
highest one skipped on the stream, so when more than one message is
skipped, the notification names a later message instead of the one
whose partial delivery was aborted.
Report the MID being partially delivered, sin->mid_uo or sin->mid,
instead.
Reproduced on an unmodified kernel with the pdapi and pdapi_uo tests of
the sctp_ifwdtsn.sh selftest added later in this series, which pass
with this fix. Reproduction and fix done with AI assistance.
Fixes: de60fe910543 ("sctp: implement handle_ftsn for sctp_stream_interleave")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/179293012867.3134.16497481637722705271@kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Tim Budding <tim.budding@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261105050225.49292-3-tim.budding@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/stream_interleave.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/sctp/stream_interleave.c
+++ b/net/sctp/stream_interleave.c
@@ -1245,7 +1245,7 @@ static void sctp_intl_skip(struct sctp_u
if (flags & SCTP_FTSN_U_BIT) {
if (sin->pd_mode_uo && !MID_lt(mid, sin->mid_uo)) {
sin->pd_mode_uo = 0;
- sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x1,
+ sctp_intl_stream_abort_pd(ulpq, sid, sin->mid_uo, 0x1,
GFP_ATOMIC);
}
sctp_intl_reasm_flush_mid(&ulpq->reasm_uo, sid, mid);
@@ -1257,7 +1257,7 @@ static void sctp_intl_skip(struct sctp_u
if (sin->pd_mode) {
sin->pd_mode = 0;
- sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x0, GFP_ATOMIC);
+ sctp_intl_stream_abort_pd(ulpq, sid, sin->mid, 0x0, GFP_ATOMIC);
}
sctp_intl_reasm_flush_mid(&ulpq->reasm, sid, mid);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0570/1167] sctp: reset stored flag for each association
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (563 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0569/1167] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0571/1167] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
` (92 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Weiming Shi, Xin Long,
Jakub Kicinski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <bestswngs@gmail.com>
commit 173712d868eb20628ad82deb07f6829a68a9e064 upstream.
sctp_send_asconf_del_ip() walks every association on an endpoint. The
stored flag records that the current association took the single-homed
deferral path and therefore did not allocate an ASCONF chunk. It is
currently scoped to the whole function. Once one association sets it,
later eligible multihomed associations allocate chunks but skip
sctp_send_asconf(), leaking each chunk and its skb.
Reset stored for every association so only an association taking the
deferral path skips transmission. In an A/B kmemleak test, the
vulnerable kernel reported 210 leaked objects from this call path and the
fixed kernel reported none.
Cc: stable@vger.kernel.org
Fixes: 8a07eb0a50ae ("sctp: Add ASCONF operation on the single-homed host")
Reported-by: Xiang Mei <xmei5@asu.edu>
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261108161149.2774119-1-bestswngs@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -808,7 +808,6 @@ static int sctp_send_asconf_del_ip(struc
struct sctp_sockaddr_entry *saddr;
int i;
int retval = 0;
- int stored = 0;
chunk = NULL;
sp = sctp_sk(sk);
@@ -821,6 +820,7 @@ static int sctp_send_asconf_del_ip(struc
__func__, sk, addrs, addrcnt);
list_for_each_entry(asoc, &ep->asocs, asocs) {
+ int stored = 0;
if (!asoc->peer.asconf_capable)
continue;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0571/1167] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (564 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0570/1167] sctp: reset stored flag for each association Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0572/1167] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
` (91 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit a0f836eea463d4c468edb58eedb03911c9c0791d upstream.
Because the kernel is built with -funsigned-char, plain 'char' is
unsigned on all architectures. Reading 1-byte signed trace event fields
via *(char *)addr in get_event_field() therefore zero-extends instead of
sign-extending negative s8 values.
Use explicit fixed-width integer types (s8/u8, s16/u16, s32/u32) when
reading event fields.
Link: https://lore.kernel.org/all/179455852542.403392.15666310371702309464.stgit@devnote2/
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -327,21 +327,21 @@ get_event_field(struct fetch_insn *code,
switch (field->size) {
case 1:
if (field->is_signed)
- val = *(char *)addr;
+ val = *(s8 *)addr;
else
- val = *(unsigned char *)addr;
+ val = *(u8 *)addr;
break;
case 2:
if (field->is_signed)
- val = *(short *)addr;
+ val = *(s16 *)addr;
else
- val = *(unsigned short *)addr;
+ val = *(u16 *)addr;
break;
case 4:
if (field->is_signed)
- val = *(int *)addr;
+ val = *(s32 *)addr;
else
- val = *(unsigned int *)addr;
+ val = *(u32 *)addr;
break;
default:
if (field->is_signed)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0572/1167] tracing/eprobe: Disallow attaching eprobes to fprobe events
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (565 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0571/1167] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0573/1167] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
` (90 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit 92d9fa0ed69e1f724feed908bd0a462a42df4b88 upstream.
Event probes (eprobes) are not allowed to attach to other dynamic probe
events (kprobes, uprobes, and eprobes) to avoid recursive probe chains
and lifecycle dependencies. However, when fprobe events were introduced,
TRACE_EVENT_FL_FPROBE was omitted from the exclusion mask in
find_and_get_event(), allowing eprobes to attach to fprobe and tprobe
events.
Exclude TRACE_EVENT_FL_FPROBE events in find_and_get_event().
Link: https://lore.kernel.org/all/179455853457.403392.14549390017750529531.stgit@devnote2/
Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -761,7 +761,8 @@ find_and_get_event(const char *system, c
(TRACE_EVENT_FL_IGNORE_ENABLE |
TRACE_EVENT_FL_KPROBE |
TRACE_EVENT_FL_UPROBE |
- TRACE_EVENT_FL_EPROBE))
+ TRACE_EVENT_FL_EPROBE |
+ TRACE_EVENT_FL_FPROBE))
continue;
if (!tp_event->class->system ||
strcmp(system, tp_event->class->system))
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0573/1167] tracing/probes: Check enabled and busy state before unlinking sibling probes
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (566 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.6 0572/1167] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0574/1167] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
` (89 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit f1d9b7a3fe99b4228acdbab3c744c29f7ffe86ef upstream.
When a multiprobe event is enabled or referenced (for example, by an
eprobe, trigger, or open tracefs file) and a user attempts to delete the
event or one of its probes via dynamic_events, checking
trace_probe_has_sibling() before the enabled and busy checks allows the
first probe to be unlinked and freed while the event is still active,
only returning -EBUSY on the last sibling probe. For uprobe events,
unlinking and freeing an enabled sibling probe without unregistering its
uprobe_consumer also causes a use-after-free.
Ensure all four probe types (kprobe, fprobe, uprobe, and eprobe) verify
that the event is neither enabled nor busy before unlinking any sibling
probe.
Link: https://lore.kernel.org/all/179455848898.403392.17675270675769076596.stgit@devnote2/
Fixes: ca89bc071d5e ("tracing/kprobe: Add multi-probe per event support")
Fixes: 41af3cf587f4 ("tracing/uprobe: Add multi-probe per uprobe event support")
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 12 ++++++++----
kernel/trace/trace_fprobe.c | 8 ++++----
kernel/trace/trace_kprobe.c | 8 ++++----
kernel/trace/trace_uprobe.c | 8 ++++++--
4 files changed, 22 insertions(+), 14 deletions(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -88,14 +88,18 @@ static int eprobe_dyn_event_show(struct
static int unregister_trace_eprobe(struct trace_eprobe *ep)
{
- /* If other probes are on the event, just unregister eprobe */
- if (trace_probe_has_sibling(&ep->tp))
- goto unreg;
-
/* Enabled event can not be unregistered */
if (trace_probe_is_enabled(&ep->tp))
return -EBUSY;
+ /* If there's a reference to the dynamic event */
+ if (trace_event_dyn_busy(trace_probe_event_call(&ep->tp)))
+ return -EBUSY;
+
+ /* If other probes are on the event, just unregister eprobe */
+ if (trace_probe_has_sibling(&ep->tp))
+ goto unreg;
+
/* Will fail if probe is being used by ftrace or perf */
if (trace_probe_unregister_event_call(&ep->tp))
return -EBUSY;
--- a/kernel/trace/trace_fprobe.c
+++ b/kernel/trace/trace_fprobe.c
@@ -738,10 +738,6 @@ static void __unregister_trace_fprobe(st
/* Unregister a trace_probe and probe_event */
static int unregister_trace_fprobe(struct trace_fprobe *tf)
{
- /* If other probes are on the event, just unregister fprobe */
- if (trace_probe_has_sibling(&tf->tp))
- goto unreg;
-
/* Enabled event can not be unregistered */
if (trace_probe_is_enabled(&tf->tp))
return -EBUSY;
@@ -750,6 +746,10 @@ static int unregister_trace_fprobe(struc
if (trace_event_dyn_busy(trace_probe_event_call(&tf->tp)))
return -EBUSY;
+ /* If other probes are on the event, just unregister fprobe */
+ if (trace_probe_has_sibling(&tf->tp))
+ goto unreg;
+
/* Will fail if probe is being used by ftrace or perf */
if (unregister_fprobe_event(tf))
return -EBUSY;
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -531,10 +531,6 @@ static void __unregister_trace_kprobe(st
/* Unregister a trace_probe and probe_event */
static int unregister_trace_kprobe(struct trace_kprobe *tk)
{
- /* If other probes are on the event, just unregister kprobe */
- if (trace_probe_has_sibling(&tk->tp))
- goto unreg;
-
/* Enabled event can not be unregistered */
if (trace_probe_is_enabled(&tk->tp))
return -EBUSY;
@@ -543,6 +539,10 @@ static int unregister_trace_kprobe(struc
if (trace_event_dyn_busy(trace_probe_event_call(&tk->tp)))
return -EBUSY;
+ /* If other probes are on the event, just unregister kprobe */
+ if (trace_probe_has_sibling(&tk->tp))
+ goto unreg;
+
/* Will fail if probe is being used by ftrace or perf */
if (unregister_kprobe_event(tk))
return -EBUSY;
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -383,13 +383,17 @@ static int unregister_trace_uprobe(struc
{
int ret;
- if (trace_probe_has_sibling(&tu->tp))
- goto unreg;
+ /* Enabled event can not be unregistered */
+ if (trace_probe_is_enabled(&tu->tp))
+ return -EBUSY;
/* If there's a reference to the dynamic event */
if (trace_event_dyn_busy(trace_probe_event_call(&tu->tp)))
return -EBUSY;
+ if (trace_probe_has_sibling(&tu->tp))
+ goto unreg;
+
ret = unregister_uprobe_event(tu);
if (ret)
return ret;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0574/1167] wifi: ath9k_htc: do not start ANI before the first channel is set
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (567 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0573/1167] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0575/1167] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
` (88 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mehmet Fide,
Toke Høiland-Jørgensen, Jeff Johnson
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mehmet Fide <mehmet.fide@screeningeagle.com>
commit dda63dd136ba2bc3b297079b190ac81a0aea40ae upstream.
ath9k_htc_add_interface() starts ANI for the first AP interface, before
any channel is configured. The per-channel calibration data only gets
attached by the first ath9k_htc_set_channel() that is not a fast
channel change, and that same call cancels the ANI work a few
milliseconds after add_interface, so normally the work never runs.
When the bring-up stalls for more than the 100 ms ANI poll interval in
between, it does run, and ar9002_hw_per_calibration() records the IQ
calibration result in the calibration data that does not exist yet:
Unable to handle kernel NULL pointer dereference at virtual address
00000008
PC is at ar9002_hw_calibrate+0x1f8/0x570 [ath9k_hw]
Workqueue: phy0 ath9k_htc_ani_work [ath9k_htc]
Seen about once per thousand AP starts with an AR9271 on a Cortex-A5
board that starts hostapd while still booting; a 500 ms delay after
add_interface reproduces it on every start. The crashed work never
completes, so the next cancel_delayed_work_sync() blocks for good.
Drop the start; it has nothing to calibrate against and is cancelled
anyway. The TSF adjust bit that shared its condition is now set for
every AP interface, which is harmless: the next reset applies it. The
next patch starts ANI once the interface beacons.
Fixes: a236254c35f0 ("ath9k_htc: Add ANI for AP mode")
Cc: stable@vger.kernel.org
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20261005072209.4101009-2-mehmet.fide@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1098,11 +1098,8 @@ static int ath9k_htc_add_interface(struc
ath9k_htc_set_opmode(priv);
- if ((priv->ah->opmode == NL80211_IFTYPE_AP) &&
- !test_bit(ATH_OP_ANI_RUN, &common->op_flags)) {
+ if (priv->ah->opmode == NL80211_IFTYPE_AP)
ath9k_hw_set_tsfadjust(priv->ah, true);
- ath9k_htc_start_ani(priv);
- }
ath_dbg(common, CONFIG, "Attach a VIF of type: %d at idx: %d\n",
vif->type, avp->index);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0575/1167] wifi: cfg80211: release rejected nontransmitted BSS reference
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (568 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0574/1167] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0576/1167] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
` (87 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit f3c45d5b741a7d7586e639c2f55d2557029f2e1a upstream.
Repeated MBSSID reports without an SSID can leak BSS entries outside the
scan cache, where the BSS entry limit cannot account for them.
__cfg80211_bss_update() returns a referenced BSS. If adding it to the
transmitting BSS list fails, unlinking drops the cache reference, but the
caller reference is lost when res is cleared.
Release the caller reference before discarding the unlinked BSS.
LLM assistance was used to find the bug and review.
Fixes: 0b7808818cb9 ("wifi: cfg80211: fix BSS refcounting bugs")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028141731.6185-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/wireless/scan.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2232,6 +2232,7 @@ cfg80211_inform_single_bss_data(struct w
if (cfg80211_add_nontrans_list(data->source_bss, &res->pub)) {
if (__cfg80211_unlink_bss(rdev, res)) {
rdev->bss_generation++;
+ bss_ref_put(rdev, res);
res = NULL;
}
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0576/1167] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (569 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0575/1167] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0577/1167] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
` (86 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 9083da9dd3223068237395432323b407012aec1f upstream.
A malformed mesh A-MSDU subframe with a declared payload length near
65535 bytes can pass validation against a much shorter aggregate.
ieee80211_amsdu_subframe_length() adds the mesh control length to the
declared length in a u16, and ieee80211_is_valid_amsdu() stores the
result in a u16 local. The sum therefore wraps before either walker
compares it with the remaining aggregate length. The decomposer then
splits and delivers the malformed aggregate instead of rejecting it.
Keep the computed length in unsigned int in both the helper and the
validator so oversized subframes cannot wrap.
LLM assistance was used to find the bug and review.
Fixes: 6e4c0d0460bd ("wifi: mac80211: add a workaround for receiving non-standard mesh A-MSDU")
Fixes: fe4a6d2db3ba ("wifi: mac80211: implement support for yet another mesh A-MSDU format")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142149.13834-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/wireless/util.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -778,12 +778,12 @@ __ieee80211_amsdu_copy(struct sk_buff *s
return frame;
}
-static u16
+static unsigned int
ieee80211_amsdu_subframe_length(void *field, u8 mesh_flags, u8 hdr_type)
{
__le16 *field_le = field;
__be16 *field_be = field;
- u16 len;
+ unsigned int len;
if (hdr_type >= 2)
len = le16_to_cpu(*field_le);
@@ -805,7 +805,7 @@ bool ieee80211_is_valid_amsdu(struct sk_
__be16 len;
u8 mesh_flags;
} hdr;
- u16 len;
+ unsigned int len;
if (sizeof(hdr) > remaining)
return false;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0577/1167] wifi: cfg80211: dont truncate the merged MBSSID profile length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (570 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0576/1167] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0578/1167] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
` (85 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wahid Khan, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wahid Khan <wahidzk0091@gmail.com>
commit 3ea152f3f77eeffc37b2f4423688b4df9136f90c upstream.
cfg80211_parse_mbssid_data() keeps the length of a non-transmitted BSSID
profile in a u8. cfg80211_merge_profile() returns a size_t, and it
concatenates a profile that is split over several Multiple BSSID
elements, so the merged length can be well above 255 even though every
single sub-element is at most 255 bytes long.
The value is then cut to its low 8 bits. A 300 byte profile is handled
as a 44 byte one: the elements after the cut are lost from the generated
non-transmitted BSS, and if the Multiple BSSID-Index element lies past
the cut the BSS is dropped altogether. Any AP in range can send such a
profile.
The multi-link code further down in the same file already uses a signed
size type for the profile length. Do the same here, cfg80211_find_ie()
and cfg80211_gen_new_ie() take a size_t anyway.
Fixes: fe806e4992c9 ("cfg80211: support profile split between elements")
Cc: stable@vger.kernel.org
Signed-off-by: Wahid Khan <wahidzk0091@gmail.com>
Link: https://patch.msgid.link/20261104211451.693451-1-wahidzk0091@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/wireless/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2373,7 +2373,7 @@ cfg80211_parse_mbssid_data(struct wiphy
if (elem->data[0] < 1 || (int)elem->data[0] > 8)
continue;
for_each_element(sub, elem->data + 1, elem->datalen - 1) {
- u8 profile_len;
+ size_t profile_len;
if (sub->id != 0 || sub->datalen < 4) {
/* not a valid BSS profile */
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0578/1167] wifi: mac80211: fix use-after-free when MLO link setup is rolled back
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (571 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0577/1167] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0579/1167] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
` (84 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit a155ef2ef79531c139244289c5b8f15c05d16a0e upstream.
Rolling back an MLO link addition can free link containers while RCU
readers still hold pointers to them. ieee80211_vif_update_links()
publishes new links before checking for duplicate addresses and calling
drv_change_vif_links(). If either fails, it restores the old pointers
and frees the new containers without waiting for readers.
During a non-MLO to MLO transition, the published link 0 replaces the
deflink, so existing link 0 users can acquire the new container. Readers
such as ieee80211_csa_finish() and
ieee80211_obss_color_collision_notify() can also queue work embedded in
the link. If they queue after ieee80211_link_stop() cancels that work,
it remains queued when the container is freed.
Wait for RCU readers after restoring the old pointers and before
stopping the new links, so their work is queued before it is cancelled.
Fixes: d3e2439b0f33 ("wifi: mac80211: fix link manipulation")
Cc: stable@vger.kernel.org # 7.2.x
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261026152654.80697-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/link.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -282,6 +282,8 @@ static int ieee80211_vif_update_links(st
memcpy(sdata->link, old_data, sizeof(old_data));
memcpy(sdata->vif.link_conf, old, sizeof(old));
ieee80211_set_vif_links_bitmaps(sdata, old_links, dormant_links);
+ /* drain RCU readers before cancelling work they may queue */
+ synchronize_rcu();
for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
ieee80211_link_debugfs_remove(&links[link_id]->data);
ieee80211_link_stop(&links[link_id]->data);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0579/1167] wifi: mac80211: drain link readers before stopping removed links
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (572 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0578/1167] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0580/1167] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
` (83 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 745f5d04395dfc4c311f443c7c04ccb00c436984 upstream.
Removing an MLO link can leave work queued on its link container after
the container is freed.
ieee80211_tear_down_links() stops each link before the RCU grace period.
A reader that fetched the link earlier can therefore queue work after
ieee80211_link_stop() has canceled it. ieee80211_request_smps() and
ieee80211_csa_finish() can both reach this window.
Record each removed link while removing its keys and debugfs state. Wait
for RCU readers, then stop the recorded links so cancellation includes
work queued by those readers. Free the detached keys after the grace
period as before.
LLM assistance was used to find the bug and review.
Fixes: efe9c2bfd1a8 ("wifi: mac80211: isolate driver from inactive links")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028141708.5532-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/link.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -95,6 +95,7 @@ struct link_container {
static void ieee80211_tear_down_links(struct ieee80211_sub_if_data *sdata,
struct link_container **links, u16 mask)
{
+ struct ieee80211_link_data *stop[IEEE80211_MLD_MAX_NUM_LINKS] = {};
struct ieee80211_link_data *link;
LIST_HEAD(keys);
unsigned int link_id;
@@ -109,11 +110,16 @@ static void ieee80211_tear_down_links(st
continue;
ieee80211_remove_link_keys(link, &keys);
ieee80211_link_debugfs_remove(link);
- ieee80211_link_stop(link);
+ stop[link_id] = link;
}
+ /* drain RCU readers before cancelling work they may queue */
synchronize_rcu();
+ for (link_id = 0; link_id < IEEE80211_MLD_MAX_NUM_LINKS; link_id++)
+ if (stop[link_id])
+ ieee80211_link_stop(stop[link_id]);
+
ieee80211_free_key_list(sdata->local, &keys);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0580/1167] wifi: mac80211: recheck injected headers after removing FCS
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (573 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0579/1167] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0581/1167] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
` (82 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 339564c7ac50464695dfed847f89d118f4cc1dc5 upstream.
Injecting a short frame with IEEE80211_RADIOTAP_F_FCS on a monitor
interface can pass a truncated 802.11 header to transmit handlers.
ieee80211_monitor_start_xmit() validates the linear 802.11 header before
parsing radiotap. Radiotap parsing then removes the four-byte FCS without
rechecking the remaining header length. Software encryption can subtract
the larger header length and pass the resulting negative length as an
unsigned size.
Recheck the required linear header length after pulling the radiotap
header and before handing the frame to the transmit path. Require at
least addr1, which the transmit path reads even for extension frames
whose header is shorter.
LLM assistance was used to find the bug and review.
Fixes: bddc0c411a45 ("mac80211: Fix NULL ptr deref for injected rate info")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142101.11994-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/tx.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2518,6 +2518,12 @@ netdev_tx_t ieee80211_monitor_start_xmit
/* remove the injection radiotap header */
skb_pull(skb, len_rthdr);
+ /* FCS removal may have shortened the 802.11 header. */
+ hdrlen = max_t(int, hdrlen,
+ offsetofend(struct ieee80211_hdr, addr1));
+ if (skb_headlen(skb) < hdrlen)
+ goto fail_rcu;
+
ieee80211_xmit(sdata, NULL, skb);
rcu_read_unlock();
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0581/1167] wifi: mac80211: recheck the IBSS station limit before insertion
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (574 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0580/1167] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0582/1167] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
` (81 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit f7670bcdf650b37551a9c5d084521f877d939f11 upstream.
Frames from successive unknown IBSS peers can make the deferred worker
install more than 128 stations.
The receive path checks local->num_sta before allocating each station,
but pending stations are not included in that count. Several allocations
can therefore pass before the worker inserts any of them, and the worker
then drains the list without rechecking the limit.
Recheck the installed-station limit in the worker under the wiphy mutex
and free entries that no longer fit.
LLM assistance was used to find the bug and review.
Fixes: 8bf11d8d0811 ("mac80211: delay IBSS station insertion")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142235.15428-2-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ibss.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1699,8 +1699,12 @@ void ieee80211_ibss_work(struct ieee8021
list_del(&sta->list);
spin_unlock_bh(&ifibss->incomplete_lock);
- ieee80211_ibss_finish_sta(sta);
- rcu_read_unlock();
+ if (sdata->local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) {
+ sta_info_free(sdata->local, sta);
+ } else {
+ ieee80211_ibss_finish_sta(sta);
+ rcu_read_unlock();
+ }
spin_lock_bh(&ifibss->incomplete_lock);
}
spin_unlock_bh(&ifibss->incomplete_lock);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0582/1167] wifi: mac80211: recheck the OCB station limit before insertion
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (575 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0581/1167] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0583/1167] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
` (80 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 27e29a077b4887d0e0a813337f8b7e06bd020c81 upstream.
Frames from successive unknown OCB peers can make the deferred worker
install more than 128 stations.
The receive path checks local->num_sta before allocating each station,
but pending stations are not included in that count. Several allocations
can therefore pass before the worker inserts any of them, and the worker
then drains the list without rechecking the limit.
Recheck the installed-station limit in the worker under the wiphy mutex
and free entries that no longer fit.
LLM assistance was used to find the bug and review.
Fixes: 239281f803e2 ("mac80211: 802.11p OCB mode support")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142302.16634-2-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ocb.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/net/mac80211/ocb.c
+++ b/net/mac80211/ocb.c
@@ -139,8 +139,12 @@ void ieee80211_ocb_work(struct ieee80211
list_del(&sta->list);
spin_unlock_bh(&ifocb->incomplete_lock);
- ieee80211_ocb_finish_sta(sta);
- rcu_read_unlock();
+ if (sdata->local->num_sta >= IEEE80211_OCB_MAX_STA_ENTRIES) {
+ sta_info_free(sdata->local, sta);
+ } else {
+ ieee80211_ocb_finish_sta(sta);
+ rcu_read_unlock();
+ }
spin_lock_bh(&ifocb->incomplete_lock);
}
spin_unlock_bh(&ifocb->incomplete_lock);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0583/1167] wifi: mac80211: restore dormant links when link updates fail
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (576 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0582/1167] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0584/1167] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
` (79 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit bb22f3b2d8f8a2f883944f24678cf84e18b162e8 upstream.
A failed MLO link update can leave the interface with the requested
dormant-links bitmap instead of its previous one. This can disable active
links or trigger a bitmap warning during rollback.
The error path restores the old valid-links bitmap but passes the new
dormant_links argument to ieee80211_set_vif_links_bitmaps().
Save the old dormant bitmap before changing link state and use it when
restoring the old configuration.
LLM assistance was used to find the bug and review.
Fixes: 6d543b34dbcf ("wifi: mac80211: Support disabled links during association")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142123.13072-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/link.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -199,6 +199,7 @@ static int ieee80211_vif_update_links(st
{
u16 old_links = sdata->vif.valid_links;
u16 old_active = sdata->vif.active_links;
+ u16 old_dormant = sdata->vif.dormant_links;
unsigned long add = new_links & ~old_links;
unsigned long rem = old_links & ~new_links;
unsigned int link_id;
@@ -287,7 +288,7 @@ static int ieee80211_vif_update_links(st
/* restore config */
memcpy(sdata->link, old_data, sizeof(old_data));
memcpy(sdata->vif.link_conf, old, sizeof(old));
- ieee80211_set_vif_links_bitmaps(sdata, old_links, dormant_links);
+ ieee80211_set_vif_links_bitmaps(sdata, old_links, old_dormant);
/* drain RCU readers before cancelling work they may queue */
synchronize_rcu();
for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0584/1167] wifi: mac80211: bound pending IBSS station allocations
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (577 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0583/1167] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0585/1167] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
` (78 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 3029ca2112d7bee4d3e3eadd02decdb3eddb9485 upstream.
Delaying the IBSS station worker while frames arrive from new peers can
retain an unbounded number of station allocations.
The receive-side limit counts installed stations, while new allocations
wait on incomplete_stations until process context inserts them. The list
lock does not cover the interval between allocation and list insertion.
Reserve one of 128 pending slots per interface before allocation. Release
the reservation on allocation failure, after the worker inserts or frees
the station, and when disconnect frees the pending list.
LLM assistance was used to find the bug and review.
Fixes: 8bf11d8d0811 ("mac80211: delay IBSS station insertion")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142235.15428-3-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ibss.c | 13 ++++++++++++-
net/mac80211/ieee80211_i.h | 1 +
2 files changed, 13 insertions(+), 1 deletion(-)
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -707,6 +707,7 @@ static void ieee80211_ibss_disconnect(st
spin_unlock_bh(&ifibss->incomplete_lock);
sta_info_free(local, sta);
+ atomic_dec(&ifibss->incomplete_sta_count);
spin_lock_bh(&ifibss->incomplete_lock);
}
spin_unlock_bh(&ifibss->incomplete_lock);
@@ -1235,9 +1236,18 @@ void ieee80211_ibss_rx_no_sta(struct iee
scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
rcu_read_unlock();
+ if (!atomic_add_unless(&ifibss->incomplete_sta_count, 1,
+ IEEE80211_IBSS_MAX_STA_ENTRIES)) {
+ net_info_ratelimited("%s: No room for a new IBSS STA entry %pM\n",
+ sdata->name, addr);
+ return;
+ }
+
sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
- if (!sta)
+ if (!sta) {
+ atomic_dec(&ifibss->incomplete_sta_count);
return;
+ }
/* make sure mandatory rates are always added */
sband = local->hw.wiphy->bands[band];
@@ -1705,6 +1715,7 @@ void ieee80211_ibss_work(struct ieee8021
ieee80211_ibss_finish_sta(sta);
rcu_read_unlock();
}
+ atomic_dec(&ifibss->incomplete_sta_count);
spin_lock_bh(&ifibss->incomplete_lock);
}
spin_unlock_bh(&ifibss->incomplete_lock);
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -591,6 +591,7 @@ struct ieee80211_if_ibss {
spinlock_t incomplete_lock;
struct list_head incomplete_stations;
+ atomic_t incomplete_sta_count;
enum {
IEEE80211_IBSS_MLME_SEARCH,
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0585/1167] wifi: mac80211: bound pending OCB station allocations
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (578 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0584/1167] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0586/1167] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
` (77 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit ee1a5e92dba0a98cabe476c780e3af4f0ab88b27 upstream.
Delaying the OCB station worker while frames arrive from new peers can
retain an unbounded number of station allocations.
The receive-side limit counts installed stations, while new allocations
wait on incomplete_stations until process context inserts them. The list
lock does not cover the interval between allocation and list insertion.
Reserve one of 128 pending slots per interface before allocation. Release
the reservation on allocation failure, after the worker inserts or frees
the station, and when leave frees the pending list.
LLM assistance was used to find the bug and review.
Fixes: 239281f803e2 ("mac80211: 802.11p OCB mode support")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142302.16634-3-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ieee80211_i.h | 2 ++
net/mac80211/ocb.c | 13 ++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -606,6 +606,7 @@ struct ieee80211_if_ibss {
* @wrkq_flags: OCB deferred task action
* @incomplete_lock: delayed STA insertion lock
* @incomplete_stations: list of STAs waiting for delayed insertion
+ * @incomplete_sta_count: pending entries and reserved allocations
* @joined: indication if the interface is connected to an OCB network
*/
struct ieee80211_if_ocb {
@@ -614,6 +615,7 @@ struct ieee80211_if_ocb {
spinlock_t incomplete_lock;
struct list_head incomplete_stations;
+ atomic_t incomplete_sta_count;
bool joined;
};
--- a/net/mac80211/ocb.c
+++ b/net/mac80211/ocb.c
@@ -72,9 +72,18 @@ void ieee80211_ocb_rx_no_sta(struct ieee
scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
rcu_read_unlock();
+ if (!atomic_add_unless(&ifocb->incomplete_sta_count, 1,
+ IEEE80211_OCB_MAX_STA_ENTRIES)) {
+ net_info_ratelimited("%s: No room for a new OCB STA entry %pM\n",
+ sdata->name, addr);
+ return;
+ }
+
sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
- if (!sta)
+ if (!sta) {
+ atomic_dec(&ifocb->incomplete_sta_count);
return;
+ }
/* Add only mandatory rates for now */
sband = local->hw.wiphy->bands[band];
@@ -145,6 +154,7 @@ void ieee80211_ocb_work(struct ieee80211
ieee80211_ocb_finish_sta(sta);
rcu_read_unlock();
}
+ atomic_dec(&ifocb->incomplete_sta_count);
spin_lock_bh(&ifocb->incomplete_lock);
}
spin_unlock_bh(&ifocb->incomplete_lock);
@@ -227,6 +237,7 @@ int ieee80211_ocb_leave(struct ieee80211
spin_unlock_bh(&ifocb->incomplete_lock);
sta_info_free(local, sta);
+ atomic_dec(&ifocb->incomplete_sta_count);
spin_lock_bh(&ifocb->incomplete_lock);
}
spin_unlock_bh(&ifocb->incomplete_lock);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0586/1167] gpio: brcmstb: fix UAF after IRQ domain setup failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (579 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0585/1167] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0587/1167] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
` (76 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Florian Fainelli,
Bartosz Golaszewski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
commit baa14758afb3e2828de1f76511edc1de50216f39 upstream.
When devm_request_irq() fails in brcmstb_gpio_irq_setup(), the error
path removes the IRQ domain but leaves priv->irq_domain non-NULL.
The probe error path subsequently calls brcmstb_gpio_remove(), which
checks priv->irq_domain and attempts to access the already-freed
domain through irq_find_mapping(). It also attempts to remove the
domain again, resulting in a use-after-free and potentially further
memory corruption.
Set priv->irq_domain to NULL after removing it so that the common
cleanup path skips the already-freed IRQ domain.
This issue was found by our static analysis tool under development.
Fixes: 0ba31dc201de ("gpio: brcmstb: consolidate interrupt domains")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20261026115227.41779-1-lgs201920130244@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-brcmstb.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -490,6 +490,7 @@ static int brcmstb_gpio_irq_setup(struct
out_free_domain:
irq_domain_remove(priv->irq_domain);
+ priv->irq_domain = NULL;
return err;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0587/1167] gpio: rockchip: Fix debounce arithmetic for GPIO v2
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (580 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0586/1167] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0588/1167] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
` (75 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cunhao Lu, Bartosz Golaszewski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cunhao Lu <1579567540@qq.com>
commit 13467fd6998f5da4f5b4f172f1af3d9c48d5de8f upstream.
The debounce interval calculations use unsigned long operands. On 32-bit
systems, the numerator used to calculate the maximum interval overflows
before division, while multiplying the requested interval by the clock
rate overflows before it is assigned to a u64. A zero debounce clock rate
also causes division by zero.
Use 64-bit arithmetic for both calculations and reject a zero clock rate
before division.
At 32768 Hz, a 1 us request rounds to zero divider periods. Subtracting
one then wraps the divider value to ULONG_MAX. Decrement only a nonzero
rounded period count so that such requests use the smallest divider
value.
Fixes: 3bcbd1a85b68 ("gpio/rockchip: support next version gpio controller")
Cc: stable@vger.kernel.org
Signed-off-by: Cunhao Lu <1579567540@qq.com>
Link: https://patch.msgid.link/20261023-fix-rockchip-gpio-v2-debounce-v1-1-f1141bd5b58f@qq.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-rockchip.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -192,20 +192,25 @@ static int rockchip_gpio_set_debounce(st
{
struct rockchip_pin_bank *bank = gpiochip_get_data(gc);
const struct rockchip_gpio_regs *reg = bank->gpio_regs;
- unsigned long flags, div_reg, freq, max_debounce;
+ unsigned long flags, div_reg, freq;
bool div_debounce_support;
unsigned int cur_div_reg;
- u64 div;
+ u64 div, max_debounce;
if (bank->gpio_type == GPIO_TYPE_V2 && !IS_ERR(bank->db_clk)) {
div_debounce_support = true;
freq = clk_get_rate(bank->db_clk);
- max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;
+ if (!freq)
+ return -EINVAL;
+
+ div = (u64)(GENMASK(23, 0) + 1) * 2 * USEC_PER_SEC;
+ max_debounce = div64_u64(div, freq);
if (debounce > max_debounce)
return -EINVAL;
- div = debounce * freq;
- div_reg = DIV_ROUND_CLOSEST_ULL(div, 2 * USEC_PER_SEC) - 1;
+ div = (u64)debounce * freq;
+ div_reg = DIV_ROUND_CLOSEST_ULL(div, 2 * USEC_PER_SEC);
+ div_reg = div_reg ? div_reg - 1 : 0;
} else {
div_debounce_support = false;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0588/1167] gpio: sodaville: fix use-after-free bug when registering the irqchip
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (581 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0587/1167] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0589/1167] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
` (74 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Bartosz Golaszewski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit ab9102375b7c77e0c4d33c7594e514454dc9f2b3 upstream.
In sdv_register_irqsupport(), if irq_domain_create_legacy() fails during
device probing, a generic IRQ chip is left registered in the global gc_list
while its underlying memory is freed, leading to a use-after-free. Use
the managed variant of irq_setup_generic_chip() to ensure that the chip
gets unregistered before the memory it uses is freed.
Cc: stable@vger.kernel.org
Fixes: 9381fc5d655d ("gpio: sodaville: Convert to use managed functions pcim_* and devm_*")
Closes: https://sashiko.dev/#/bug/linux-2f7ac8b6-5034-4ff1-9afa-5700ff44e3e9
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261105-gpio-sodaville-use-after-free-v1-1-f572f40feedd@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-sodaville.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/gpio/gpio-sodaville.c
+++ b/drivers/gpio/gpio-sodaville.c
@@ -165,9 +165,12 @@ static int sdv_register_irqsupport(struc
ct->chip.irq_eoi = irq_gc_eoi;
ct->chip.irq_set_type = sdv_gpio_pub_set_type;
- irq_setup_generic_chip(sd->gc, IRQ_MSK(SDV_NUM_PUB_GPIOS),
- IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
- IRQ_LEVEL | IRQ_NOPROBE);
+ ret = devm_irq_setup_generic_chip(&pdev->dev, sd->gc,
+ IRQ_MSK(SDV_NUM_PUB_GPIOS),
+ IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
+ IRQ_LEVEL | IRQ_NOPROBE);
+ if (ret)
+ return ret;
sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS,
sd->irq_base, 0, &irq_domain_sdv_ops, sd);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0589/1167] ovl: do not always clear absolute_redirect
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (582 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0588/1167] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0590/1167] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
` (73 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Giuseppe Scrivano, Amir Goldstein
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giuseppe Scrivano <giuseppe@scrivano.org>
commit 477449a7a5fd1b2fe973fe2978b0c921115a65f3 upstream.
ovl_check_redirect() clears d->absolute_redirect before it checks that
the path element has a redirect xattr. An element without one, such as
an intermediate directory in a lower layer, then clears the flag set by
the absolute redirect of a metacopy file found in a higher layer. The
lookup of the data in the data-only layers is not deferred any more and
the lookup fails with -EIO:
# l2/f: metacopy, redirect "/dir/file"; l1/dir/ exists, no "file"
mount -t overlay none -o metacopy=on,redirect_dir=on,\
lowerdir+=l2,lowerdir+=l1,datadir+=data m
cat m/f # Input/output error
Set d->absolute_redirect only when a redirect xattr was read.
Fixes: 5436ab0a864e ("ovl: implement lookup in data-only layers")
Closes: https://sashiko.dev/#/bug/linux-2cc24e0b-fbdc-4cf1-aded-cfd19c2918ee
Cc: stable@vger.kernel.org
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/namei.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -37,13 +37,12 @@ static int ovl_check_redirect(const stru
char *buf;
struct ovl_fs *ofs = OVL_FS(d->sb);
- d->absolute_redirect = false;
buf = ovl_get_redirect_xattr(ofs, path, prelen + strlen(post));
if (IS_ERR_OR_NULL(buf))
return PTR_ERR(buf);
- if (buf[0] == '/') {
- d->absolute_redirect = true;
+ d->absolute_redirect = buf[0] == '/';
+ if (d->absolute_redirect) {
/*
* One of the ancestor path elements in an absolute path
* lookup in ovl_lookup_layer() could have been opaque and
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0590/1167] ovl: reject different lower idmaps on the same fs
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (583 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0589/1167] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0591/1167] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
` (72 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner,
Jérémy Jean, Amir Goldstein
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit 720f40c05b2785406121da0151543751204f2953 upstream.
Overayfs mounted with index=on or nfs_export=on require file handle
support from backing filesystems.
Overlay file handles identify a backing filesystem, but not the lower
mount used to decode it. If lower layers share a superblock and use
different idmaps, a handle can decode through the wrong layer.
Record the first idmap on a private lower clone for each backing
filesystem. Fail if another clone has a different idmap. Comparing
the private clones prevents mount_setattr() from changing the checked
state. Distinct idmap objects are treated as ambiguous.
Fixes: bc70682a497c ("ovl: support idmapped layers")
Suggested-by: Christian Brauner <brauner@kernel.org>
Link: Link: https://lore.kernel.org/all/20260925-server-hager-riskieren-06116eded213@brauner/
Cc: stable@vger.kernel.org
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/ovl_entry.h | 2 ++
fs/overlayfs/super.c | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
--- a/fs/overlayfs/ovl_entry.h
+++ b/fs/overlayfs/ovl_entry.h
@@ -24,6 +24,8 @@ struct ovl_config {
struct ovl_sb {
struct super_block *sb;
dev_t pseudo_dev;
+ /* Idmap of the first lower layer on this fs */
+ const struct mnt_idmap *lower_idmap;
/* Unusable (conflicting) uuid */
bool bad_uuid;
/* Used as a lower layer (but maybe also as upper) */
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1117,6 +1117,29 @@ static int ovl_get_layers(struct super_b
}
/*
+ * Lower file handles identify the lower fs, but not the layer,
+ * so with different idmaps on the same lower fs, index and
+ * nfs_export may decode a file handle through a layer with the
+ * wrong idmap. Following copy up origin without index is only
+ * used for st_ino, which does not depend on the idmap.
+ */
+ if (i < nr_merged_lower &&
+ (ofs->config.index || ofs->config.nfs_export)) {
+ const struct mnt_idmap *idmap = mnt_idmap(mnt);
+ struct ovl_sb *fs = &ofs->fs[fsid];
+
+ if (!fs->lower_idmap) {
+ fs->lower_idmap = idmap;
+ } else if (fs->lower_idmap != idmap) {
+ pr_err("lower layer '%pd2' conflicts with idmap of another lower layer on the same fs, mount with '-o index=off,nfs_export=off' to override.\n",
+ l->path.dentry);
+ iput(trap);
+ kern_unmount(mnt);
+ return -EINVAL;
+ }
+ }
+
+ /*
* Make lower layers R/O. That way fchmod/fchown on lower file
* will fail instead of modifying lower fs.
*/
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0591/1167] ovl: report the requested redirect_dir mode in conflicting options
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (584 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0590/1167] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0592/1167] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
` (71 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Amir Goldstein
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
commit 248503755b3cab89742edcc3cfd53adbcf7bfec2 upstream.
Since the redirect_dir mode is stored as an enum, "off" is translated to
"follow" or "nofollow" when parsing the option and redirect_dir=follow is
translated to "on" for a non-upper mount, so the errors about options
that conflict with an explicit redirect_dir= report a mode that the user
did not request.
Translate "off" when verifying the mount options instead of when parsing
them and report the requested mode in those errors.
Fixes: af5f2396b671 ("ovl: store enum redirect_mode in config instead of a string")
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/overlayfs.h | 10 +++++++---
fs/overlayfs/params.c | 43 ++++++++++++++++++++++++++++++-------------
2 files changed, 37 insertions(+), 16 deletions(-)
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -62,9 +62,13 @@ enum ovl_entry_flag {
};
enum {
- OVL_REDIRECT_OFF, /* "off" mode is never used. In effect */
- OVL_REDIRECT_FOLLOW, /* ...it translates to either "follow" */
- OVL_REDIRECT_NOFOLLOW, /* ...or "nofollow". */
+ /*
+ * "off" mode is never used after mount options are verified. In effect
+ * it translates to either "follow" or "nofollow".
+ */
+ OVL_REDIRECT_OFF,
+ OVL_REDIRECT_FOLLOW,
+ OVL_REDIRECT_NOFOLLOW,
OVL_REDIRECT_ON,
};
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -110,18 +110,28 @@ const struct constant_table ovl_paramete
{}
};
+static const char *ovl_redirect_mode_name(int redirect_mode)
+{
+ return ovl_parameter_redirect_dir[redirect_mode].name;
+}
+
static const char *ovl_redirect_mode(struct ovl_config *config)
{
- return ovl_parameter_redirect_dir[config->redirect_mode].name;
+ return ovl_redirect_mode_name(config->redirect_mode);
}
-static int ovl_redirect_mode_def(void)
+static int ovl_redirect_follow_mode(void)
{
- return ovl_redirect_dir_def ? OVL_REDIRECT_ON :
- ovl_redirect_always_follow ? OVL_REDIRECT_FOLLOW :
+ return ovl_redirect_always_follow ? OVL_REDIRECT_FOLLOW :
OVL_REDIRECT_NOFOLLOW;
}
+static int ovl_redirect_mode_def(void)
+{
+ return ovl_redirect_dir_def ? OVL_REDIRECT_ON :
+ ovl_redirect_follow_mode();
+}
+
static const struct constant_table ovl_parameter_verity[] = {
{ "off", OVL_VERITY_OFF },
{ "on", OVL_VERITY_ON },
@@ -566,11 +576,6 @@ static int ovl_parse_param(struct fs_con
break;
case Opt_redirect_dir:
config->redirect_mode = result.uint_32;
- if (config->redirect_mode == OVL_REDIRECT_OFF) {
- config->redirect_mode = ovl_redirect_always_follow ?
- OVL_REDIRECT_FOLLOW :
- OVL_REDIRECT_NOFOLLOW;
- }
ctx->set.redirect = true;
break;
case Opt_index:
@@ -700,7 +705,13 @@ int ovl_init_fs_context(struct fs_contex
if (!ofs)
goto out_err;
- ofs->config.redirect_mode = ovl_redirect_mode_def();
+ /*
+ * The module default determines only if new redirects are created in
+ * upper dir. If they are not, the redirect follow mode will be
+ * determined after parsing mount options.
+ */
+ ofs->config.redirect_mode = ovl_redirect_dir_def ?
+ OVL_REDIRECT_ON : OVL_REDIRECT_OFF;
ofs->config.index = ovl_index_def;
ofs->config.uuid = ovl_uuid_def();
ofs->config.nfs_export = ovl_nfs_export_def;
@@ -757,6 +768,8 @@ int ovl_fs_params_verify(const struct ov
struct ovl_config *config)
{
struct ovl_opt_set set = ctx->set;
+ /* The requested redirect_dir=, for reporting conflicts with it */
+ int redirect_opt = config->redirect_mode;
/* Workdir/index are useless in non-upper mount */
if (!config->upperdir) {
@@ -795,6 +808,10 @@ int ovl_fs_params_verify(const struct ov
config->metacopy = true;
}
+ /* Resolve redirect_dir=off to the default redirect follow mode */
+ if (config->redirect_mode == OVL_REDIRECT_OFF)
+ config->redirect_mode = ovl_redirect_follow_mode();
+
/*
* This is to make the logic below simpler. It doesn't make any other
* difference, since redirect_dir=on is only used for upper.
@@ -806,7 +823,7 @@ int ovl_fs_params_verify(const struct ov
if (config->metacopy && config->redirect_mode != OVL_REDIRECT_ON) {
if (set.metacopy && set.redirect) {
pr_err("conflicting options: metacopy=on,redirect_dir=%s\n",
- ovl_redirect_mode(config));
+ ovl_redirect_mode_name(redirect_opt));
return -EINVAL;
}
if (config->verity_mode && set.redirect) {
@@ -820,7 +837,7 @@ int ovl_fs_params_verify(const struct ov
* in this conflict.
*/
pr_info("disabling metacopy due to redirect_dir=%s\n",
- ovl_redirect_mode(config));
+ ovl_redirect_mode_name(redirect_opt));
config->metacopy = false;
} else {
/* Automatically enable redirect otherwise. */
@@ -887,7 +904,7 @@ int ovl_fs_params_verify(const struct ov
if (set.redirect &&
config->redirect_mode != OVL_REDIRECT_NOFOLLOW) {
pr_err("conflicting options: userxattr,redirect_dir=%s\n",
- ovl_redirect_mode(config));
+ ovl_redirect_mode_name(redirect_opt));
return -EINVAL;
}
if (config->metacopy && set.metacopy) {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0592/1167] ovl: return EIO if the lowerdata is missing
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (585 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0591/1167] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0593/1167] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
` (70 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Giuseppe Scrivano, Amir Goldstein
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giuseppe Scrivano <giuseppe@scrivano.org>
commit 0d5e729c515f4ae4eacc179dbcf350d9b499a161 upstream.
The data of a metacopy file that redirects to a data-only layer is
looked up when the file is opened, and the error of the lookup is
returned as is. If the data file is missing, open() fails with ENOENT
even though the file is there and stat() works.
This can be an integrity problem when using composefs: a data file that
is changed or has the wrong fs-verity digest is reported with EIO, but
a missing one is not reported, the file just looks like it does not
exist, e.g. a configuration file that overrides the defaults.
Return EIO as it is already done in ovl_lookup() when no lower data is
found for a metacopy file. ENOMEM is not changed.
Fixes: 42dd69ae1af4 ("ovl: implement lazy lookup of lowerdata in data-only layers")
Cc: stable@vger.kernel.org
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/namei.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -991,6 +991,14 @@ out:
out_err:
pr_warn_ratelimited("lazy lowerdata lookup failed (%pd2, err=%i)\n",
dentry, err);
+ /*
+ * The data of a metacopy file is missing or is not a regular file in
+ * the data-only layers: the layers are corrupted. Do not return the
+ * error of the lookup (e.g. ENOENT) to the caller, it would make the
+ * file look like it does not exist.
+ */
+ if (err != -ENOMEM)
+ err = -EIO;
goto out;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0593/1167] smb: client: bound invalid NTLMSSP signature diagnostic
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (586 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0592/1167] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0594/1167] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
` (69 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Yifan Zhang,
Paulo Alcantara
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
commit 0584b02669c3e76188097174b4f25ed13723e94c upstream.
The NTLMSSP Signature field is an eight-byte binary value and need not be
NUL-terminated. decode_ntlmssp_challenge() prints it with %s on the
signature-mismatch path, so the diagnostic can continue beyond the received
blob until it encounters a zero byte.
KASAN reports:
BUG: KASAN: slab-out-of-bounds in string
Read of size 1
string
vsnprintf
_printk
decode_ntlmssp_challenge
Print the fixed-width field with the bounded hexadecimal format.
The patched kernel reaches the invalid-signature path and returns -EINVAL
without a KASAN report.
Fixes: 0b3cc858003b ("[CIFS] NTLMSSP reenabled after move from connect.c to sess.c")
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/sess.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/smb/client/sess.c
+++ b/fs/smb/client/sess.c
@@ -986,8 +986,8 @@ int decode_ntlmssp_challenge(char *bcc_p
}
if (memcmp(pblob->Signature, "NTLMSSP", 8)) {
- cifs_dbg(VFS, "blob signature incorrect %s\n",
- pblob->Signature);
+ cifs_dbg(VFS, "%s: blob signature incorrect: %8phN\n",
+ __func__, pblob->Signature);
return -EINVAL;
}
if (pblob->MessageType != NtLmChallenge) {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0594/1167] smb: client: compare owner and group SIDs using their encoded lengths
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (587 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0593/1167] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0595/1167] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
` (68 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, liuyong, Namjae Jeon,
Paulo Alcantara
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: liuyong <pkfxxxing@gmail.com>
commit a2dabe73ea05ad3b3f8e1cc08fb2e7c2ddc5564b upstream.
populate_new_aces() compares owner and group SIDs over sizeof(struct
smb_sid), including storage for all 15 possible subauthorities. Received
SIDs contain only their encoded subauthorities. The comparison can read
past the security descriptor, as shown by the supplied KASAN report for
a 44-byte descriptor during chmod.
The input SIDs have already been checked by sid_from_sd(). Require equal
subauthority counts, then compare only the fixed SID header and the
encoded subauthorities with memcmp(). The count check ensures that both
validated SIDs contain the number of bytes being compared.
These issues were discovered and fixed by Qihoo 360's Tulongfeng
multi-agent system.
Fixes: 0f22053e811c ("cifs: Fix unix perm bits to cifsacl conversion for "other" bits.")
Cc: stable@vger.kernel.org
Signed-off-by: liuyong <pkfxxxing@gmail.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifsacl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/smb/client/cifsacl.c
+++ b/fs/smb/client/cifsacl.c
@@ -1062,7 +1062,10 @@ static void populate_new_aces(char *nacl
* updated in the inode.
*/
- if (!memcmp(pownersid, pgrpsid, sizeof(struct smb_sid))) {
+ if (pownersid->num_subauth == pgrpsid->num_subauth &&
+ !memcmp(pownersid, pgrpsid,
+ CIFS_SID_BASE_SIZE +
+ pownersid->num_subauth * sizeof(__le32))) {
/*
* Case when owner and group SIDs are the same.
* Set the more restrictive of the two modes.
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0595/1167] smb: client: dont block dying tasks waiting for writeback on close
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (588 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0594/1167] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0596/1167] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
` (67 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 15ea186abbcd04157c62e0901701870b812bb2bd upstream.
cifs_flush() waits uninterruptibly for the writeback it starts. A task
that gets killed while closing a file on a hard mount with an
unresponsive server is stuck in D state until the server comes back. It
also consumes any writeback error for a caller that is about to exit,
hiding it from everyone else.
Wait killably instead. If the closer gets killed, stop waiting and leave
the error bits in the mapping for others to see; writeback already in
flight completes on its own. Don't wait at all, nor check for errors,
if it is already dying.
This is also needed before letting dying tasks issue their writes from a
worker, which would otherwise make them wait for every one of them.
Fixes: d3f1322af8f8 ("cifs: wait for writeback to complete in cifs_flush")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -3474,17 +3474,44 @@ fsync_exit:
return rc;
}
+static int cifs_wait_writeback_killable(struct address_space *mapping)
+{
+ struct folio_batch fbatch;
+ pgoff_t index = 0;
+ int rc = 0;
+
+ folio_batch_init(&fbatch);
+ while (!rc &&
+ filemap_get_folios_tag(mapping, &index, (pgoff_t)-1,
+ PAGECACHE_TAG_WRITEBACK, &fbatch)) {
+ for (unsigned int i = 0;
+ !rc && i < folio_batch_count(&fbatch); i++)
+ rc = folio_wait_writeback_killable(fbatch.folios[i]);
+ folio_batch_release(&fbatch);
+ cond_resched();
+ }
+ return rc;
+}
+
/*
* As file closes, flush all cached write data for this inode checking
* for write behind errors.
*/
int cifs_flush(struct file *file, fl_owner_t id)
{
+ struct address_space *mapping = file->f_mapping;
struct inode *inode = file_inode(file);
- int rc = 0;
+ int rc = 0, rc2;
- if (file->f_mode & FMODE_WRITE)
- rc = filemap_write_and_wait(inode->i_mapping);
+ if (file->f_mode & FMODE_WRITE) {
+ rc = filemap_fdatawrite(mapping);
+ if (fatal_signal_pending(current) ||
+ cifs_wait_writeback_killable(mapping))
+ return 0;
+ rc2 = filemap_check_errors(mapping);
+ if (!rc)
+ rc = rc2;
+ }
cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
if (rc) {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0596/1167] smb: client: dont block dying tasks waiting for writeback on fsync
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (589 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0595/1167] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0597/1167] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
` (66 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara, David Howells
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 0df0f24803061b6c2bef0d24de7c63c9cce46a49 upstream.
cifs_fsync() and cifs_strict_fsync() wait uninterruptibly for writeback
through file_write_and_wait_range(). As with close, a task killed in
fsync(2) on a hard mount with an unresponsive server is stuck in D state
until the server comes back.
Wait killably instead, using the same helper as cifs_flush(). The
writeback keeps going and its errors stay in the mapping; only the dying
caller stops waiting for it.
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 64 +++++++++++++++++++++++++++++++++------------------
1 file changed, 42 insertions(+), 22 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -3093,6 +3093,45 @@ err_xid:
return rc;
}
+static int cifs_wait_writeback_killable(struct address_space *mapping,
+ loff_t start, loff_t end)
+{
+ pgoff_t end_index = end >> PAGE_SHIFT;
+ pgoff_t index = start >> PAGE_SHIFT;
+ struct folio_batch fbatch;
+ int rc = 0;
+
+ folio_batch_init(&fbatch);
+ while (!rc &&
+ filemap_get_folios_tag(mapping, &index, end_index,
+ PAGECACHE_TAG_WRITEBACK, &fbatch)) {
+ for (unsigned int i = 0;
+ !rc && i < folio_batch_count(&fbatch); i++)
+ rc = folio_wait_writeback_killable(fbatch.folios[i]);
+ folio_batch_release(&fbatch);
+ cond_resched();
+ }
+ return rc;
+}
+
+static int cifs_file_write_and_wait_killable(struct file *file,
+ loff_t start, loff_t end)
+{
+ struct address_space *mapping = file->f_mapping;
+ int rc, rc2;
+
+ if (end < start)
+ return 0;
+
+ rc = filemap_fdatawrite_range(mapping, start, end);
+ if (cifs_wait_writeback_killable(mapping, start, end))
+ return -EINTR;
+ rc2 = file_check_and_advance_wb_err(file);
+ if (!rc)
+ rc = rc2;
+ return rc;
+}
+
/*
* write a region of pages back to the server
*/
@@ -3386,7 +3425,7 @@ int cifs_strict_fsync(struct file *file,
struct inode *inode = file_inode(file);
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
- rc = file_write_and_wait_range(file, start, end);
+ rc = cifs_file_write_and_wait_killable(file, start, end);
if (rc) {
trace_cifs_fsync_err(inode->i_ino, rc);
return rc;
@@ -3439,7 +3478,7 @@ int cifs_fsync(struct file *file, loff_t
struct inode *inode = file_inode(file);
struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
- rc = file_write_and_wait_range(file, start, end);
+ rc = cifs_file_write_and_wait_killable(file, start, end);
if (rc) {
trace_cifs_fsync_err(file_inode(file)->i_ino, rc);
return rc;
@@ -3474,25 +3513,6 @@ fsync_exit:
return rc;
}
-static int cifs_wait_writeback_killable(struct address_space *mapping)
-{
- struct folio_batch fbatch;
- pgoff_t index = 0;
- int rc = 0;
-
- folio_batch_init(&fbatch);
- while (!rc &&
- filemap_get_folios_tag(mapping, &index, (pgoff_t)-1,
- PAGECACHE_TAG_WRITEBACK, &fbatch)) {
- for (unsigned int i = 0;
- !rc && i < folio_batch_count(&fbatch); i++)
- rc = folio_wait_writeback_killable(fbatch.folios[i]);
- folio_batch_release(&fbatch);
- cond_resched();
- }
- return rc;
-}
-
/*
* As file closes, flush all cached write data for this inode checking
* for write behind errors.
@@ -3506,7 +3526,7 @@ int cifs_flush(struct file *file, fl_own
if (file->f_mode & FMODE_WRITE) {
rc = filemap_fdatawrite(mapping);
if (fatal_signal_pending(current) ||
- cifs_wait_writeback_killable(mapping))
+ cifs_wait_writeback_killable(mapping, 0, LLONG_MAX))
return 0;
rc2 = filemap_check_errors(mapping);
if (!rc)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0597/1167] smb: client: fix out-of-bounds read in dfs_parse_target_referral()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (590 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0596/1167] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0598/1167] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
` (65 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fredric Cover, Namjae Jeon,
Paulo Alcantara
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fredric Cover <fredric.cover.lkernel@gmail.com>
commit 86aacc2f3f6ba18e1d87feee24f37c94b3ce863a upstream.
dfs_parse_target_referral() decides whether a prefix path remains after
the consumed part of full_path with:
if (strlen(full_path) - ref->path_consumed)
strlen() returns size_t, so if path_consumed is larger than the length
of full_path, the subtraction wraps around to a huge non-zero value.
The branch is then taken, prepath is set to a pointer past the
terminating NUL of full_path, and *prepath reads out of bounds.
path_consumed can exceed strlen(full_path) when the mount charset is
not utf8. The referral code derives path_consumed from the canonical
path, which is in the DFS cache charset (utf8), but it is applied here
to full_path, which is in the mount charset. Each non-ASCII character
in the consumed part of the path that is longer in utf8 than in the
mount charset makes the count too large by the difference.
This was reproduced with iocharset=iso8859-1 against a Samba DFS root
containing a link named "café", mounting with the single Latin-1 byte
0xe9 in the path. On an unmodified tree such a mount fails earlier
with -ENOENT because the path is converted to utf8 twice in
setup_dfs_ref(); with that fixed ("smb: client: fix double conversion
of DFS path in setup_dfs_ref()"), the mount reaches this code.
full_path was 29 bytes while path_consumed was 30:
BUG: KASAN: slab-out-of-bounds in dfs_parse_target_referral+0x26a/0x270
Read of size 1 at addr ffff88810db89d5f by task mount/1743
...
The buggy address is located 0 bytes to the right of
allocated 31-byte region [ffff88810db89d40, ffff88810db89d5f)
Compare path_consumed against the string length instead of subtracting,
so that no prefix path is used when the consumed count covers the whole
string. With the bounds check in place the same mount succeeds and no
KASAN report is produced.
This only prevents the out-of-bounds access. path_consumed is still in
the wrong units, so a non-ASCII link followed by a path component can
still produce a wrong prefix path. That needs a separate fix.
Signed-off-by: Fredric Cover <fredric.cover.lkernel@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/dfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/smb/client/dfs.c
+++ b/fs/smb/client/dfs.c
@@ -31,7 +31,7 @@ int dfs_parse_target_referral(const char
if (WARN_ON_ONCE(!ref->node_name || ref->path_consumed < 0))
return -EINVAL;
- if (strlen(full_path) - ref->path_consumed) {
+ if ((size_t)ref->path_consumed < strlen(full_path)) {
prepath = full_path + ref->path_consumed;
/* skip initial delimiter */
if (*prepath == '/' || *prepath == '\\')
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0598/1167] smb: client: flush deferred handles of other names before a hard link open
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (591 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0597/1167] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0599/1167] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
` (64 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giuseppe Piscitelli, Namjae Jeon,
Paulo Alcantara
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 25912ed3b75dcf5ff623dcb549b925dd0d0948f7 upstream.
Opening a hard link of a file whose other name still holds a deferred,
leased handle fails with EINVAL over SMB3. The client caches lease keys
per inode, but the server ties a lease to the file name it was granted
under, so reusing the inode's lease key to open a different name of the
same inode is rejected with STATUS_INVALID_PARAMETER (MS-SMB2 3.3.5.9.11).
Commit 262b73ef442e ("smb3 client: fix open hardlink on deferred close
file error") already closes the inode's deferred handles before such an
open so the new name can take a fresh lease, but cifs_get_hardlink_path()
only triggered that flush when a cached handle had the same open flags as
the new open, so a differently accessed name - written then read, say -
slipped through and still failed.
Match on the name instead: flush when a cached handle for another name of
the inode is open, regardless of access mode.
Reported-by: Giuseppe Piscitelli <ooonea@gmail.com>
Closes: https://lore.kernel.org/r/CACmoRBbDZR3eyEM65j73sWMS7A=T89z1QAvCP=+u0WGzZhwW6g@mail.gmail.com
Fixes: 262b73ef442e ("smb3 client: fix open hardlink on deferred close file error")
Cc: stable@vger.kernel.org
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -1975,7 +1975,7 @@ cifs_get_hardlink_path(struct cifs_tcon
spin_lock(&cinode->open_file_lock);
list_for_each_entry(open_file, &cinode->openFileList, flist) {
- if (file->f_flags == open_file->f_flags) {
+ if (open_file->dentry != file_dentry(file)) {
rc = -EINVAL;
break;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0599/1167] smb: client: hold the inode across cifs_oplock_break()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (592 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0598/1167] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0600/1167] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
` (63 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Qi, Paulo Alcantara
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
commit fce78321f1b59531cf6fc94860550db1db8dec55 upstream.
cifs_oplock_break() drops the handle reference in the middle of the
handler and keeps using cinode afterwards, to send the break
acknowledgment and again in cifs_done_oplock_break(). The reference
cifs_queue_oplock_break() takes is the only pin: the handle holds the
dentry and the dentry is what keeps the inode alive.
When that put is the last reference, the dput() in
cifsFileInfo_put_final() kills an unhashed dentry, drops the last
i_count and evicts the inode, so the rest of the handler runs on an
object whose free is only RCU-deferred. An unhashed dentry that a
handle still references is an ordinary state: unlinking an open file
leaves the dentry that way, and so does the dcache teardown at unmount.
Take a reference on the inode for the lifetime of the handler and drop
it once the break has been reported. This also covers the
cifs_get_tlink() failure path, where the put is followed directly by
the out label.
Fixes: b98749cac4a6 ("CIFS: keep FileInfo handle live during oplock break")
Fixes: 23b26f4408ac ("smb: client: avoid leaking refcount when cifs_sb_tlink() fails")
Cc: stable@vger.kernel.org
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -5283,6 +5283,14 @@ void cifs_oplock_break(struct work_struc
__u64 persistent_fid, volatile_fid;
__u16 net_fid;
+ /*
+ * Dropping the handle reference below also drops the dentry
+ * reference that pins this inode, and cinode is still needed to
+ * acknowledge the break and to report it as complete. Hold the inode
+ * until that is done.
+ */
+ ihold(inode);
+
wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS,
TASK_UNINTERRUPTIBLE);
@@ -5358,6 +5366,7 @@ oplock_break_ack:
cifs_put_tlink(tlink);
out:
cifs_done_oplock_break(cinode);
+ iput(inode);
}
/*
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0600/1167] smb: client: skip NULL channel in __cifs_put_smb_ses()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (593 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0599/1167] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0601/1167] dm log userspace: drop the device reference on error Greg Kroah-Hartman
` (62 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Qi, Paulo Alcantara
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
commit 8deaf64a59a263161dfc5128f8398fb3dcba4fac upstream.
cifs_chan_skip_or_disable() clears a secondary channel's slot in the
session (ses->chans[chan_index].server = NULL) without lowering
chan_count when the server stops supporting multichannel. When the
session is later released, __cifs_put_smb_ses() walks every slot up to
chan_count and calls cifs_put_tcp_session() on it, which dereferences
the server pointer immediately, so a slot left NULL by the skip path
makes the release crash with a NULL pointer dereference.
Clearing a slot without lowering chan_count is older than
cifs_chan_skip_or_disable(): cifs_chan_update_iface() could already do
the same since commit b54034a73baf9 ("cifs: during reconnect, update
interface if necessary"), and the release loop has been unguarded
since then. Commit 12d1e301bdfd1 ("cifs: do not let
cifs_chan_update_iface deallocate channels") later removed that
trigger, but the crash is reachable through it on older kernels.
cifs_decrease_secondary_channels() already guards the same put with
if (server). Add the same guard to the release loop so a skipped
channel slot is left alone.
Fixes: b54034a73baf9 ("cifs: during reconnect, update interface if necessary")
Cc: stable@vger.kernel.org
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/connect.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -2157,7 +2157,8 @@ void __cifs_put_smb_ses(struct cifs_ses
kref_put(&ses->chans[i].iface->refcount, release_iface);
ses->chans[i].iface = NULL;
}
- cifs_put_tcp_session(ses->chans[i].server, 0);
+ if (ses->chans[i].server)
+ cifs_put_tcp_session(ses->chans[i].server, 0);
ses->chans[i].server = NULL;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0601/1167] dm log userspace: drop the device reference on error
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (594 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0600/1167] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0602/1167] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
` (61 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn>
commit 0550d3b14e008b033b02cfce668008ec6addffe4 upstream.
userspace_ctr() takes a reference on the log device with
dm_get_device(). When the integrated-flush workqueue allocation fails it
jumps to the shared error path, which frees the log context without
dropping that reference, so the device stays busy and cannot be removed.
userspace_dtr() drops the reference correctly; do the same here.
Fixes: 5066a4df1f42 ("dm log userspace: allow mark requests to piggyback on flush requests")
Cc: stable@vger.kernel.org
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-log-userspace-base.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-log-userspace-base.c
+++ b/drivers/md/dm-log-userspace-base.c
@@ -294,9 +294,11 @@ static int userspace_ctr(struct dm_dirty
}
r = dm_get_device(ti, devices_rdata,
dm_table_get_mode(ti->table), &lc->log_dev);
- if (r)
+ if (r) {
DMERR("Failed to register %s with device-mapper",
devices_rdata);
+ goto out;
+ }
}
if (lc->integrated_flush) {
@@ -314,6 +316,8 @@ static int userspace_ctr(struct dm_dirty
out:
kfree(devices_rdata);
if (r) {
+ if (lc->log_dev)
+ dm_put_device(lc->ti, lc->log_dev);
mempool_exit(&lc->flush_entry_pool);
kfree(lc);
kfree(ctr_str);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0602/1167] dm cache: reject kcopyd client destory if it setup failed
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (595 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0601/1167] dm log userspace: drop the device reference on error Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0603/1167] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
` (60 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+a2626a25eb2595e3ec3c,
Edward Adam Davis, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Adam Davis <eadavis@sina.com>
commit 8b97b168eb4d3affcf23d2980a0c3f35ed9262e2 upstream.
The value of cache->copier is -EINTR when failed to create a rescuer
kthread for wq kcopyd, in cache_create(), the code jumps directly to
__destroy(cache), it merely performs a simple check to see whether copier
is NULL, potentially hitting:
BUG: KASAN: null-ptr-deref in dm_kcopyd_client_destroy+0xae/0x480 drivers/md/dm-kcopyd.c:980
Read of size 4 at addr 0000000000000174 by task syz.2.19/6560
Call Trace:
dm_kcopyd_client_destroy+0xae/0x480 drivers/md/dm-kcopyd.c:980
__destroy+0x172/0x2f0 drivers/md/dm-cache-target.c:1973
cache_create drivers/md/dm-cache-target.c:2604 [inline]
cache_ctr+0x1674/0x2bf0 drivers/md/dm-cache-target.c:2649
dm_table_add_target+0x58d/0xc70 drivers/md/dm-table.c:749
populate_table drivers/md/dm-ioctl.c:1602 [inline]
table_load+0x325/0x8a0 drivers/md/dm-ioctl.c:1645
ctl_ioctl drivers/md/dm-ioctl.c:2221 [inline]
Set copier to NULL to avoid destroying a invalid kcopy client.
Cc: stable@vger.kernel.org
Fixes: c6b4fcbad044 ("dm: add cache target")
Reported-by: syzbot+a2626a25eb2595e3ec3c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a2626a25eb2595e3ec3c
Signed-off-by: Edward Adam Davis <eadavis@sina.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-target.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -2554,6 +2554,7 @@ static int cache_create(struct cache_arg
if (IS_ERR(cache->copier)) {
*error = "could not create kcopyd client";
r = PTR_ERR(cache->copier);
+ cache->copier = NULL;
goto bad;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0603/1167] dm crypt: fix use of uninitialized percpu_counter in ctr error path
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (596 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0602/1167] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0604/1167] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
` (59 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+4b232570d625662eaab4,
Zhao Feng, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
commit 8ba1ade3e6b595b9091040feaa3341d7e45ba95d upstream.
If percpu_counter_init() fails in crypt_ctr() (e.g. when the
underlying percpu allocation fails under memory pressure or fault
injection), the error path jumps to "bad", which calls
crypt_dtr(). crypt_dtr() then evaluates
WARN_ON(percpu_counter_sum(&cc->n_allocated_pages) != 0) and calls
percpu_counter_destroy() on a counter that was never initialized,
because __percpu_counter_init_many() returns -ENOMEM before
calling raw_spin_lock_init() on fbc->lock.
With lockdep enabled this triggers "INFO: trying to register
non-static key" in __percpu_counter_sum(), as reported by syzbot.
The console additionally shows "crypt: Unknown error (-ENOMEM)"
because this failure path sets no ti->error.
Move percpu_counter_init() to right after the allocation of cc,
before ti->private is set and before any "goto bad" can happen.
On failure, set ti->error and free cc directly, so that
crypt_dtr() is only ever called with an initialized counter.
Reported-by: syzbot+4b232570d625662eaab4@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=4b232570d625662eaab4
Fixes: 5059353df86e ("dm crypt: limit the number of allocated pages")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-crypt.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -3253,6 +3253,14 @@ static int crypt_ctr(struct dm_target *t
ti->error = "Cannot allocate encryption context";
return -ENOMEM;
}
+
+ ret = percpu_counter_init(&cc->n_allocated_pages, 0, GFP_KERNEL);
+ if (ret < 0) {
+ ti->error = "Cannot initialize page counter";
+ kfree_sensitive(cc);
+ return ret;
+ }
+
cc->key_size = key_size;
cc->sector_size = (1 << SECTOR_SHIFT);
cc->sector_shift = 0;
@@ -3264,10 +3272,6 @@ static int crypt_ctr(struct dm_target *t
crypt_calculate_pages_per_client();
spin_unlock(&dm_crypt_clients_lock);
- ret = percpu_counter_init(&cc->n_allocated_pages, 0, GFP_KERNEL);
- if (ret < 0)
- goto bad;
-
/* Optional parameters need to be read before cipher constructor */
if (argc > 5) {
ret = crypt_ctr_optional(ti, argc - 5, &argv[5]);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0604/1167] dm mpath: fix buffer overflow in parse_hw_handler()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (597 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0603/1167] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0605/1167] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
` (58 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn>
commit 8f611fe94a781c6fb658488cc7eab4e4923e6df6 upstream.
parse_hw_handler() builds the hw_handler parameter string in a buffer
sized with
len = 4;
plus one byte per argument. Those four bytes were meant for the decimal
form of the parameter count, three digits plus the terminating NUL.
dm_read_arg_group() accepts up to 1024 arguments and the count written is
'hw_argc - 1', so a count of 1000 or more needs four digits plus the NUL
and sprintf() writes one byte past the allocation.
Size the buffer from the actual string length instead.
Fixes: 2bfd2e1337f0 ("[SCSI] scsi_dh: Use scsi_dh_set_params() in multipath.")
Cc: stable@vger.kernel.org
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-mpath.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1083,8 +1083,9 @@ static int parse_hw_handler(struct dm_ar
if (hw_argc > 1) {
char *p;
- int i, j, len = 4;
+ int i, j, len;
+ len = snprintf(NULL, 0, "%d", hw_argc - 1) + 1;
for (i = 0; i <= hw_argc - 2; i++)
len += strlen(as->argv[i]) + 1;
p = m->hw_handler_params = kzalloc(len, GFP_KERNEL);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0605/1167] dm mpath: cap queue_if_no_path_timeout_secs
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (598 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0604/1167] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0606/1167] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
` (57 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <x-professor@outlook.com>
commit ae5b40accbc06f93e6a513e0e9a07fd32b197e49 upstream.
enable_nopath_timeout() arms the no-path timer with
jiffies + queue_if_no_path_timeout_secs * HZ. The module parameter is an
unbounded unsigned long, so the delay can exceed what mod_timer()
handles: a delay above LONG_MAX is treated as already expired, and
values above ULONG_MAX / HZ also wrap in the multiplication. The timer
then clears queue_if_no_path right away, and I/O queued after the last
path fails gets -EIO instead of waiting for the configured time.
On x86-64 with HZ=1000, 9223372036854776 seconds failed a write after
124 ms while one second less remained queued throughout a 4.2-second
observation window. A value of 18446744073709552 seconds wrapped to 384
jiffies and failed the write after 455 ms. On 32-bit kernels with
HZ=1000 the delay passes LONG_MAX above 2147483 seconds, a little under
25 days.
Cap the seconds value at the largest whole-second delay not exceeding
MAX_JIFFY_OFFSET before multiplying by HZ. This prevents signed-delta
overflow and multiplication wrap. The timer wheel's existing handling
of very long delays is unchanged.
Fixes: be240ff5e402 ("dm mpath: Add timeout mechanism for queue_if_no_path")
Cc: stable@vger.kernel.org
Signed-off-by: Yingjie Wang <x-professor@outlook.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-mpath.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -802,7 +802,8 @@ static void queue_if_no_path_timeout_wor
static void enable_nopath_timeout(struct multipath *m)
{
unsigned long queue_if_no_path_timeout =
- READ_ONCE(queue_if_no_path_timeout_secs) * HZ;
+ min_t(unsigned long, READ_ONCE(queue_if_no_path_timeout_secs),
+ MAX_JIFFY_OFFSET / HZ) * HZ;
lockdep_assert_held(&m->lock);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0606/1167] dm thin: avoid wrapping no_space_timeout
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (599 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0605/1167] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0607/1167] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
` (56 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <1075151112@qq.com>
commit bcb78d49620f666b4a9d62997691e8d031fd4ebc upstream.
set_pool_mode() converts the no_space_timeout module parameter with
READ_ONCE(no_space_timeout_secs) * HZ. The usual arithmetic conversions
evaluate the product as unsigned int, so it can wrap before being stored
in the unsigned long delay. With HZ=1000, 4294968 seconds becomes 704
jiffies: a pool that runs out of data space switches to
error_if_no_space and fails queued writes with -ENOSPC after about 0.7
seconds.
Widen the value before the multiplication and cap it at
MAX_JIFFY_OFFSET / HZ, so large timeouts no longer wrap into short
delays. On 32-bit kernels, values beyond the supported jiffies range
saturate at the largest whole-second delay not exceeding
MAX_JIFFY_OFFSET. The timer wheel's existing handling of very long
delays is unchanged.
Fixes: 80c578930ce7 ("dm thin: add 'no_space_timeout' dm-thin-pool module param")
Cc: stable@vger.kernel.org
Signed-off-by: Yingjie Wang <1075151112@qq.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-thin.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -2546,7 +2546,9 @@ static void set_pool_mode(struct pool *p
struct pool_c *pt = pool->ti->private;
bool needs_check = dm_pool_metadata_needs_check(pool->pmd);
enum pool_mode old_mode = get_pool_mode(pool);
- unsigned long no_space_timeout = READ_ONCE(no_space_timeout_secs) * HZ;
+ unsigned long no_space_timeout =
+ min_t(unsigned long, READ_ONCE(no_space_timeout_secs),
+ MAX_JIFFY_OFFSET / HZ) * HZ;
/*
* Never allow the pool to transition to PM_WRITE mode if user
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0607/1167] dm-sysfs: fix misbehavior if kobject_init_and_add fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (600 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0606/1167] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0608/1167] dm persistent data: test return value of node_copy Greg Kroah-Hartman
` (55 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka, Wentao Liang
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 406d576cc457203cf86eac7f17839b2efec81db4 upstream.
If kobject_init_and_add fails, we must call kobject_put (see the comment
at kobject_init_and_add).
Before calling kobject_init_and_add, we must zero the kobject (see
https://lwn.net/Articles/52085/). If the first call to dm_sysfs_init
failed, it may be called again, and that second call would see an
uninitialized kobject.
Cc: stable@vger.kernel.org
Fixes: 784aae735d9b ("dm: add name and uuid to sysfs")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-sysfs.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -132,9 +132,20 @@ static const struct kobj_type dm_ktype =
*/
int dm_sysfs_init(struct mapped_device *md)
{
- return kobject_init_and_add(dm_kobject(md), &dm_ktype,
- &disk_to_dev(dm_disk(md))->kobj,
- "%s", "dm");
+ struct kobject *kobj = dm_kobject(md);
+ int r;
+
+ /* The kobject must be zeroed before calling kobject_init */
+ memset(kobj, 0, sizeof(struct kobject));
+ r = kobject_init_and_add(kobj, &dm_ktype,
+ &disk_to_dev(dm_disk(md))->kobj,
+ "%s", "dm");
+ if (unlikely(r)) {
+ /* Weird semantics - we must call kobject_put on failure */
+ dm_sysfs_exit(md);
+ return r;
+ }
+ return 0;
}
/*
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0608/1167] dm persistent data: test return value of node_copy
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (601 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0607/1167] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0609/1167] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
` (54 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 624d146d97c5fbe7200ef4b2dd5350ecf57d6b79 upstream.
There were 3 places where the return value of node_copy was not tested.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: c671ffa55d8b ("dm btree remove: change a bunch of BUG_ON() calls to proper errors")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/persistent-data/dm-btree-remove.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--- a/drivers/md/persistent-data/dm-btree-remove.c
+++ b/drivers/md/persistent-data/dm-btree-remove.c
@@ -253,7 +253,9 @@ static int __rebalance2(struct dm_btree_
/*
* Merge
*/
- node_copy(left, right, -nr_right);
+ ret = node_copy(left, right, -nr_right);
+ if (unlikely(ret))
+ return ret;
left->header.nr_entries = cpu_to_le32(nr_left + nr_right);
delete_at(parent, r->index);
@@ -315,13 +317,16 @@ static int delete_center_node(struct dm_
{
uint32_t max_entries = le32_to_cpu(left->header.max_entries);
unsigned int shift = min(max_entries - nr_left, nr_center);
+ int ret;
if (nr_left + shift > max_entries) {
DMERR("node shift out of bounds");
return -EINVAL;
}
- node_copy(left, center, -shift);
+ ret = node_copy(left, center, -shift);
+ if (unlikely(ret))
+ return ret;
left->header.nr_entries = cpu_to_le32(nr_left + shift);
if (shift != nr_center) {
@@ -333,7 +338,9 @@ static int delete_center_node(struct dm_
}
node_shift(right, shift);
- node_copy(center, right, shift);
+ ret = node_copy(center, right, shift);
+ if (unlikely(ret))
+ return ret;
right->header.nr_entries = cpu_to_le32(nr_right + shift);
}
*key_ptr(parent, r->index) = right->keys[0];
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0609/1167] dm persistent data: dont ignore writeback errors
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (602 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0608/1167] dm persistent data: test return value of node_copy Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0610/1167] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
` (53 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit fa887f2ebee7aff97eb87b3365939616ade09774 upstream.
An error returned by ie_cache_writeback could be silently overwritten by
another successful ie_cache_writeback. This commit fixes disk_ll_commit,
so that it doesn't ignore the error and returns it immediatelly.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 6b06dd5a9722 ("dm space map disk: cache a small number of index entries")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/persistent-data/dm-space-map-common.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/md/persistent-data/dm-space-map-common.c
+++ b/drivers/md/persistent-data/dm-space-map-common.c
@@ -1190,17 +1190,20 @@ static dm_block_t disk_ll_max_entries(st
static int disk_ll_commit(struct ll_disk *ll)
{
- int r = 0;
+ int r;
unsigned int i;
for (i = 0; i < IE_CACHE_SIZE; i++) {
struct ie_cache *iec = ll->ie_cache + i;
- if (iec->valid && iec->dirty)
+ if (iec->valid && iec->dirty) {
r = ie_cache_writeback(ll, iec);
+ if (unlikely(r))
+ return r;
+ }
}
- return r;
+ return 0;
}
int sm_ll_new_disk(struct ll_disk *ll, struct dm_transaction_manager *tm)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0610/1167] dm persistent data: dont leak bufio buffer if find_leaf fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (603 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0609/1167] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0611/1167] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
` (52 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit b27523a0781aae0b51ac13f29dc65373d14b8434 upstream.
If find_leaf fails, the function dm_btree_cursor_begin would return an
error, but it would keep the dm-bufio buffers held. This would result in
a memory leak and a warning when releasing the dm-bufio cache.
This commit fixes it, so that dm_btree_cursor_begin releases the buffers
on error.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 7d111c81fa29 ("dm btree: introduce cursor api")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/persistent-data/dm-btree.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -1582,7 +1582,13 @@ int dm_btree_cursor_begin(struct dm_btre
if (r)
return r;
- return find_leaf(c);
+ r = find_leaf(c);
+ if (unlikely(r)) {
+ dm_btree_cursor_end(c);
+ return r;
+ }
+
+ return 0;
}
EXPORT_SYMBOL_GPL(dm_btree_cursor_begin);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0611/1167] dm snapshot: split discards on chunk boundaries
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (604 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0610/1167] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0612/1167] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
` (51 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Cheng, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Cheng <chencheng@fnnas.com>
commit 4fe2c2baad01da64d47f1a0c8fc093df994bcef5 upstream.
dm-snapshot did not set ti->max_discard_granularity when it allows
discards, so a discard could reach the target unaligned, or spanning
several chunks. Set the flag, so dm splits discards on chunk
boundaries.
Fixes: 2e6023850e17 ("dm snapshot: add optional discard support features")
Cc: stable@vger.kernel.org
Signed-off-by: Chen Cheng <chencheng@fnnas.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-snap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1364,8 +1364,10 @@ static int snapshot_ctr(struct dm_target
ti->private = s;
ti->num_flush_bios = num_flush_bios;
- if (s->discard_zeroes_cow)
+ if (s->discard_zeroes_cow) {
ti->num_discard_bios = (s->discard_passdown_origin ? 2 : 1);
+ ti->max_discard_granularity = true;
+ }
ti->per_io_data_size = sizeof(struct dm_snap_tracked_chunk);
/* Add snapshot to the list of snapshots for this origin */
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0612/1167] dm snapshot: fix discard writing into the next COW chunk
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (605 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0611/1167] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0613/1167] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
` (50 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Cheng, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Cheng <chencheng@fnnas.com>
commit 73174b4bb6fcd0e6cf973c9402a0fae2e567ad9f upstream.
zero_exception() zeroes one chunk of the COW device and takes the start
sector from bio->bi_iter.bi_sector. remap_exception() has already set
that to the COW chunk start plus the offset inside the chunk. That
offset is needed for reads and writes, but for a discard it is wrong:
the zeroing window is shifted, so the head of the target chunk keeps
its old data and the tail lands in the next COW chunk, which holds a
different exception.
io_overlaps_chunk() should have caught this, but it only compares the
length. "maps to entire chunks" in snapshot.rst also means the discard
has to start on a chunk boundary.
A discard that is not a full chunk has a second problem: after
remap_exception() it is sent to the COW device, where it hits a chunk
that still backs a live exception. After a discard the contents are
undefined, but the exception stays in the table and keeps pointing at
that chunk, so a later read returns whatever the discard left instead
of the snapshot's data.
Reproducer:
truncate -s 4M o.img c.img
o=$(losetup -f --show o.img)
c=$(losetup -f --show c.img)
dmsetup create snap --table \
"0 8192 snapshot $o $c P 512 1 discard_zeroes_cow"
# write two chunks, this creates two exceptions
head -c 256K /dev/zero | tr '\000' '\252' > pat
dd if=pat of=/dev/mapper/snap bs=256K seek=1 count=1 conv=notrunc
dd if=pat of=/dev/mapper/snap bs=256K seek=2 count=1 conv=notrunc
# shift the snapshot by 8 sectors, so a discard that is aligned on
# top is unaligned inside the snapshot
dmsetup create top --table "0 8184 linear /dev/mapper/snap 8"
blkdiscard -o 262144 -l 262144 /dev/mapper/top
sync
echo 3 > /proc/sys/vm/drop_caches
# chunk 1
dd if=/dev/mapper/snap bs=512 skip=512 count=8 | od -An -tx1 -N1
# chunk 2
dd if=/dev/mapper/snap bs=512 skip=1024 count=8 | od -An -tx1 -N1
Before: aa 00 <- chunk 2 was zeroed although it was not discarded
After: aa aa <- nothing written, a discard is only a hint
Fix it by requiring the discard to start on a chunk boundary in
io_overlaps_chunk(), and by finishing a discard that is not a full
chunk with bio_endio() instead of passing it down to the COW device.
Fixes: 2e6023850e17 ("dm snapshot: add optional discard support features")
Cc: stable@vger.kernel.org
Signed-off-by: Chen Cheng <chencheng@fnnas.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-snap.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1954,8 +1954,8 @@ static void zero_exception(struct dm_sna
static bool io_overlaps_chunk(struct dm_snapshot *s, struct bio *bio)
{
- return bio->bi_iter.bi_size ==
- (s->store->chunk_size << SECTOR_SHIFT);
+ return bio->bi_iter.bi_size == (s->store->chunk_size << SECTOR_SHIFT) &&
+ !(bio->bi_iter.bi_sector & s->store->chunk_mask);
}
static int snapshot_map(struct dm_target *ti, struct bio *bio)
@@ -2015,11 +2015,13 @@ static int snapshot_map(struct dm_target
e = dm_lookup_exception(&s->complete, chunk);
if (e) {
remap_exception(s, e, bio, chunk);
- if (unlikely(bio_op(bio) == REQ_OP_DISCARD) &&
- io_overlaps_chunk(s, bio)) {
+ if (unlikely(bio_op(bio) == REQ_OP_DISCARD)) {
dm_exception_table_unlock(&lock);
up_read(&s->lock);
- zero_exception(s, e, bio, chunk);
+ if (io_overlaps_chunk(s, bio))
+ zero_exception(s, e, bio, chunk);
+ else
+ bio_endio(bio);
r = DM_MAPIO_SUBMITTED; /* discard is not issued */
goto out;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0613/1167] dm zoned: back off when reclaim cannot make progress
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (606 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0612/1167] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0614/1167] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
` (49 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyrylo Biryuk, Damien Le Moal,
Hannes Reinecke, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyrylo Biryuk <illofspeed@gmail.com>
commit 9bb1d14877f4929be17f7fdbeb4cfdf5025d464b upstream.
When a reclaim pass cannot make progress, dmz_reclaim_work() still ends
with dmz_schedule_reclaim(). If the target is idle, dmz_should_reclaim()
keeps returning true, the work is queued again with no delay and the
worker spins on the same failing pass. This patch handles two such
cases:
- dmz_do_reclaim() fails with -ENOSPC because no free zone is
available to copy the data into, for example on a target without
cache zones that has no free sequential zone left. The next patch
also makes this the expected result when an idle target with cache
zones has random zones but no free sequential zone.
- dmz_do_reclaim() finds no zone it can lock for reclaim and returns
-EBUSY. Since commit 90a9b8693f1b ("dm zoned: reclaim random zones
when idle"), dmz_should_reclaim() returns true on an idle target
whenever the total number of random (and cache) zones is non-zero,
whether or not any of them holds data. Each pass then also runs
dmz_check_dev(), which checks every device for media events (a TEST
UNIT READY on SCSI disks).
The -EBUSY loop lasts as long as the target stays idle; it ends when a
pass finishes while the target is busy and has enough free zones. On
three 27 TB host-managed SATA drives used as md RAID5 members (7.2.10
with the module built out of tree, all random zones free, target idle
for 300 seconds, kprobes attached, two other drives on the controller
being zero-filled), each member's SCSI device counted about 108,000
requests per second with the stock module and the system used about
915 s of CPU time, against about 46 s with this series. libata completes
TEST UNIT READY in software, so these counters do not measure commands
sent to the drives; the cost is CPU time.
When a pass fails with -ENOSPC or -EBUSY, retrying at once is unlikely
to make progress: re-arm the idle poll instead, so that reclaim is
retried after DMZ_IDLE_PERIOD unless a zone allocation or a "reclaim"
message queues it earlier. On a busy target, zone allocations can
restart reclaim immediately when free space is low enough to require
reclaim. Re-arming also keeps the poll running after a complete idle
drain. The poll can still stop after a pass that ends while reclaim is
not needed; that is unchanged.
Skip the device check for these two results: they normally mean that
there is no zone to copy into or no zone to reclaim, not that a device
failed, and the I/O paths check the devices themselves. Use
queue_delayed_work() so that work an allocation has already queued is
not postponed.
A pass that fails with an I/O error, for example on an unreadable block
of a device that stays online, is still retried at once while the
target is idle; this patch does not change that.
Tested on 7.4-rc1 with this patch and the next one, on three emulated
host-managed drives (scsi_debug, 1 GiB, 32 MiB zones) each under
dm-zoned as md RAID5 members, all random zones free and the target idle
for 300 seconds. With the stock module each member's SCSI device counted
about 70.2 million requests and the reclaim workers used 726 s of CPU.
With this series: 75 requests per member, 30 passes per worker (one per
DMZ_IDLE_PERIOD) and 0.08 s of CPU. Data written during the tests read
back with matching checksums, and no kernel warnings were logged.
Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
Fixes: 90a9b8693f1b ("dm zoned: reclaim random zones when idle")
Cc: stable@vger.kernel.org
Signed-off-by: Kyrylo Biryuk <illofspeed@gmail.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-zoned-reclaim.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/md/dm-zoned-reclaim.c
+++ b/drivers/md/dm-zoned-reclaim.c
@@ -539,6 +539,16 @@ static void dmz_reclaim_work(struct work
dmz_nr_rnd_zones(zmd, zrc->dev_idx));
ret = dmz_do_reclaim(zrc);
+ if (ret == -ENOSPC || ret == -EBUSY) {
+ /*
+ * No zone to copy into (-ENOSPC) or no zone to reclaim
+ * (-EBUSY): retrying at once cannot make progress and would
+ * spin. Poll again after the idle period instead, without
+ * postponing work that an allocation has already queued.
+ */
+ queue_delayed_work(zrc->wq, &zrc->work, DMZ_IDLE_PERIOD);
+ return;
+ }
if (ret && ret != -EINTR) {
if (!dmz_check_dev(zmd))
return;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0614/1167] dm zoned: do not reclaim a random zone into another random zone
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (607 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0613/1167] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0615/1167] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
` (48 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Hannes Reinecke,
Kyrylo Biryuk, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyrylo Biryuk <illofspeed@gmail.com>
commit dab527d83462a618d99bfc96370ce45ae3428706 upstream.
dmz_reclaim_rnd_data() falls back to a random destination zone when no
free sequential zone is available and the target has cache zones. When
the target is idle and the cache zone list is empty,
dmz_get_rnd_zone_for_reclaim() selects random zones of the zoned device
as well, so a random zone is then copied into another random zone. That
frees nothing: the next pass picks the next random zone and copies it
again, for as long as the target stays idle.
Seen on a two-device target (256 GiB regular cache device plus a 27 TB
host-managed drive) used as an md RAID5 member: after a full rebuild
every chunk was mapped and no sequential zone was free, and the idle
drive kept reading and writing while the free zone counters
in "dmsetup status" did not change.
Only switch to a random destination zone when the zone being reclaimed
is a cache zone: moving it to the zoned device still frees cache space.
This depends on "dm zoned: back off when reclaim cannot make progress":
without it, dmz_reclaim_work() would retry the resulting -ENOSPC at
once, and run dmz_check_dev(), for as long as the target stays idle.
Tested on 7.4-rc1 together with the previous patch, on a two-device
target (a 512 MiB RAM-backed regular cache device plus a 1 GiB
scsi_debug host-managed drive) filled until no sequential zone was
free, then idle for 60 seconds: the stock module made 877
random-to-random copies; with this series it made none, and each pass
failed with -ENOSPC once per DMZ_IDLE_PERIOD without a device check.
Fixes: c5c788595292 ("dm zoned: start reclaim with sequential zones")
Cc: stable@vger.kernel.org
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Kyrylo Biryuk <illofspeed@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-zoned-reclaim.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-zoned-reclaim.c
+++ b/drivers/md/dm-zoned-reclaim.c
@@ -290,7 +290,13 @@ static int dmz_reclaim_rnd_data(struct d
again:
szone = dmz_alloc_zone(zmd, zrc->dev_idx,
alloc_flags | DMZ_ALLOC_RECLAIM);
- if (!szone && alloc_flags == DMZ_ALLOC_SEQ && dmz_nr_cache_zones(zmd)) {
+ /*
+ * If no free sequential zone is available, a cache zone can still be
+ * moved into a free random zone of the zoned device, which frees cache
+ * space. Do not do this for a random zone: moving it into another
+ * random zone frees nothing and, on an idle target, repeats forever.
+ */
+ if (!szone && alloc_flags == DMZ_ALLOC_SEQ && dmz_is_cache(dzone)) {
alloc_flags = DMZ_ALLOC_RND;
goto again;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0615/1167] dm-cache: fix NULL pointer dereference on open failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (608 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0614/1167] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0616/1167] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
` (47 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit d12afc2f9ed6e14019fed9c02a74ad699915dc85 upstream.
When __begin_transaction_flags in metadata_open fails,
dm_cache_metadata_close is called. dm_cache_metadata_close attempts to
execute list_del(&cmd->list);, but the "cmd" object is not on any list
yet, thus it crashes with NULL pointer dereference.
Fix this by initializing cmd->list after cmd is allocated.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 9b1cc9f251af ("dm cache: share cache-metadata object across inactive and active DM tables")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-metadata.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -766,6 +766,7 @@ static struct dm_cache_metadata *metadat
return ERR_PTR(-ENOMEM);
}
+ INIT_LIST_HEAD(&cmd->list);
cmd->version = metadata_version;
refcount_set(&cmd->ref_count, 1);
init_rwsem(&cmd->root_lock);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0616/1167] dm-cache: fix ending a cursor that never began
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (609 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0615/1167] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0617/1167] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
` (46 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 421420758be348cb90715bfaa26e1211a12ff1d0 upstream.
If dm_bitset_cursor_begin fails, dm_array_cursor_end(&cmd->hint_cursor)
is called. However, cmd->hint_cursor was only initialized if the variable
hints_valid is true. Thus, we must also destroy hint_cursor only if
hints_valid is true.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 629d0a8a1a10 ("dm cache metadata: add "metadata2" feature")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-metadata.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -1451,7 +1451,8 @@ static int __load_mappings(struct dm_cac
from_cblock(cmd->cache_blocks),
&cmd->dirty_cursor);
if (r) {
- dm_array_cursor_end(&cmd->hint_cursor);
+ if (hints_valid)
+ dm_array_cursor_end(&cmd->hint_cursor);
dm_array_cursor_end(&cmd->mapping_cursor);
return r;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0617/1167] dm-crypt: defer async write submission to write thread
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (610 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0616/1167] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0618/1167] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
` (45 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Schlehofer, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Schlehofer <pepe.schlehofer@gmail.com>
commit 6fed9e26810f0b466dbcebe35a73d1fd48793ff5 upstream.
With no_write_workqueue, kcryptd_crypt_write_io_submit() submits the
bio directly, even when called from kcryptd_async_done(). An async
cipher may run this callback in softirq or with BH disabled, where
submit_bio_noacct() must not be called because it can sleep.
Submit inline only when async is false. Async completions are sent to
the write thread, as is already done for submit_from_crypt_cpus. Use
the async flag rather than in_interrupt(), since callback context
depends on the cipher driver. Sync ciphers still submit inline.
Tested with cryptd in QEMU (x86_64 and arm64) with
CONFIG_DEBUG_ATOMIC_SLEEP, and on a P2020 running 6.18.55 without it.
In QEMU:
- 4k writes logging "sleeping function called from invalid context":
100/100 unpatched, 0/155 patched.
- nr_requests=4 on a loop device: 0/6 unpatched runs completed,
4/4 patched runs completed.
On the P2020, a warning in blk_mq_run_hw_queue() appeared in the
6th unpatched run and did not appear in 30 patched runs.
Fixes: 39d42fa96ba1 ("dm crypt: add flags to optionally bypass kcryptd workqueues")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-crypt.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -2017,8 +2017,9 @@ static void kcryptd_crypt_write_io_submi
clone->bi_iter.bi_sector = cc->start + io->sector;
- if ((likely(!async) && test_bit(DM_CRYPT_NO_OFFLOAD, &cc->flags)) ||
- test_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags)) {
+ if (likely(!async) &&
+ (test_bit(DM_CRYPT_NO_OFFLOAD, &cc->flags) ||
+ test_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags))) {
dm_submit_bio_remap(io->base_bio, clone);
return;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0618/1167] dm-integrity: dont recalculate with HMAC because of a dirty bitmap
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (611 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0617/1167] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0619/1167] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
` (44 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sinan Polat, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sinan Polat <sinan86polat@gmail.com>
commit 875a7161fe1574205293c36f7bbd0815023e48a1 upstream.
Commit 5c02406428d5 ("dm integrity: conditionally disable "recalculate"
feature") refuses a superblock with SB_FLAG_RECALCULATING if a keyed
hash is used without "legacy_recalculate". Otherwise someone who can
write to the device, but does not know the key, could modify data and
have the kernel compute valid tags for it.
dm_integrity_resume() can still start the same recalculation in J or D
mode: if SB_FLAG_DIRTY_BITMAP is set and the bitmap is not clear, or
log2_blocks_per_bitmap_bit does not match, it sets
SB_FLAG_RECALCULATING and recalc_sector = 0. The superblock is not
authenticated unless fix_hmac and journal_mac are both used, so the
flag can be set offline. Resume also runs on the first activation.
Apply the constructor's policy there. If recalculation is not allowed,
log an error and keep the existing tags, so modified blocks fail
verification. This also avoids queueing recalc_work on a NULL
recalc_wq when internal_hash is not used.
Fixes: 5c02406428d5 ("dm integrity: conditionally disable "recalculate" feature")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Sinan Polat <sinan86polat@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-integrity.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -3279,6 +3279,24 @@ static bool superblock_changed(struct dm
memcmp(ic->sb->salt, ic->sb_copy->salt, SALT_SIZE) != 0;
}
+/*
+ * The superblock is authenticated only if fix_hmac and journal_mac are used,
+ * so SB_FLAG_DIRTY_BITMAP may have been set by someone who doesn't know the
+ * key. Apply the policy that the constructor applies to SB_FLAG_RECALCULATING.
+ */
+static bool dm_integrity_may_recalc_dirty_bitmap(struct dm_integrity_c *ic)
+{
+ if (!ic->internal_hash) {
+ DMERR("Dirty bitmap found, but internal_hash is not used");
+ return false;
+ }
+ if (dm_integrity_disable_recalculate(ic)) {
+ DMERR("Dirty bitmap found, but HMAC recalculation requires \"legacy_recalculate\"");
+ return false;
+ }
+ return true;
+}
+
static void dm_integrity_resume(struct dm_target *ti)
{
struct dm_integrity_c *ic = ti->private;
@@ -3368,8 +3386,10 @@ static void dm_integrity_resume(struct d
if (!(ic->sb->log2_blocks_per_bitmap_bit == ic->log2_blocks_per_bitmap_bit &&
block_bitmap_op(ic, ic->journal, 0, ic->provided_data_sectors, BITMAP_OP_TEST_ALL_CLEAR)) ||
ic->reset_recalculate_flag) {
- ic->sb->flags |= cpu_to_le32(SB_FLAG_RECALCULATING);
- ic->sb->recalc_sector = cpu_to_le64(0);
+ if (dm_integrity_may_recalc_dirty_bitmap(ic)) {
+ ic->sb->flags |= cpu_to_le32(SB_FLAG_RECALCULATING);
+ ic->sb->recalc_sector = cpu_to_le64(0);
+ }
}
init_journal(ic, 0, ic->journal_sections, 0);
replay_journal(ic);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0619/1167] dm-integrity: dont attempt to commit journal on disabled device
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (612 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0618/1167] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0620/1167] dm-raid: bound array_position before indexing failed_devices Greg Kroah-Hartman
` (43 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+94dac3c75477e184f0b0,
Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit e5e03918fbec31f0c896f4f43c2bd2aadf35d43d upstream.
If the device is disabled due to an error, we shouldn't attempt to flush
the journal. We jump straight to the label release_flush_bios, that will
call do_endio on all queued bios. do_endio will terminate the bios with
the error.
This fixes WARN_ON in the function pad_uncommitted reported by syzkaller.
Reported-by: syzbot+94dac3c75477e184f0b0@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=94dac3c75477e184f0b0
Fixes: 7eada909bfd7 ("dm: add integrity target")
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-integrity.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -2444,6 +2444,11 @@ static void integrity_commit(struct work
spin_lock_irq(&ic->endio_wait.lock);
flushes = bio_list_get(&ic->flush_bio_list);
+ if (unlikely(dm_integrity_failed(ic))) {
+ wake_up_locked(&ic->endio_wait);
+ spin_unlock_irq(&ic->endio_wait.lock);
+ goto release_flush_bios;
+ }
if (unlikely(ic->mode != 'J')) {
spin_unlock_irq(&ic->endio_wait.lock);
dm_integrity_flush_buffers(ic, true);
@@ -4666,7 +4671,6 @@ try_smaller_buffer:
r = create_journal(ic, &ti->error);
if (r)
goto bad;
-
}
if (ic->mode == 'B') {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0620/1167] dm-raid: bound array_position before indexing failed_devices
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (613 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0619/1167] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0621/1167] dm-thin: fix data corruption if discard races with regular I/O Greg Kroah-Hartman
` (42 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jay Vadayath, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jay Vadayath <jay@artiphishell.com>
commit 11b5cd14c0eecae458cecbe53d21a3dbc10190f5 upstream.
super_init_validation() reads role = le32_to_cpu(sb2->array_position)
out of an on-disk dm_raid_superblock and then uses it as a bit index into
the failed_devices bitmap via test_bit(role, (void *)failed_devices).
failed_devices is a uint64_t[DISKS_ARRAY_ELEMS] (DISKS_ARRAY_ELEMS == 4,
i.e. 256 bits) living on the stack. The only guard is role < 0, so any
on-disk array_position >= 256 makes test_bit() read past the end of the
stack array (array_position == 256 reads failed_devices[4], 8 bytes past
the object). For a raid1 set the role != raid_disk reorder branch falls
through to the same test_bit().
A crafted dm-raid superblock therefore causes a stack out-of-bounds read
during table load. Reachable by anyone able to issue a dmsetup create
with attacker-controlled metadata (CAP_SYS_ADMIN in the target
namespace); the crash fires in the constructor / analyse_superblocks
path, before any md_run or array sizing.
BUG: KASAN: stack-out-of-bounds in super_validate+0x1cd0/0x3390
Read of size 8 at addr ffff888007b17828 by task poc/152
Call Trace:
dump_stack_lvl+0x64/0x80
print_report+0xd0/0x630
kasan_report+0xe5/0x120
kasan_check_range+0x105/0x1b0
super_validate+0x1cd0/0x3390 (super_init_validation, inlined)
raid_ctr+0x2c4b/0xa0f0
dm_table_add_target+0x66f/0xf80
table_load+0x2ee/0x780
ctl_ioctl+0x362/0x9f0
dm_ctl_ioctl+0x9/0x10
__x64_sys_ioctl+0x134/0x1c0
do_syscall_64+0xe2/0x4b0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
role is a device position that must refer to an actual member of the
array, so reject anything outside [0, rs->raid_disks) instead of only the
negative case. rs->raid_disks is always <= the 256-bit capacity of
failed_devices, so this both closes the out-of-bounds access and matches
the intended semantics.
This bug was discovered by Artiphishell's vTriage pipeline, which
generated a crafted raid1 superblock (magic "DmRd", compat_features=1,
num_devices=2, array_position=256, level=1) and a dmsetup-create
reproducer that reliably triggers the KASAN report on an unpatched kernel
(the precursor DMINFO "raid device #256 now at position #0" is visible in
the serial log just before the splat). The fix below was drafted with the
Claude coding assistant; a userspace reproducer is available on request.
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Jay Vadayath <jay@artiphishell.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-raid.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -2392,7 +2392,8 @@ static int super_init_validation(struct
*/
if (!test_bit(FirstUse, &r->flags) && (r->raid_disk >= 0)) {
role = le32_to_cpu(sb2->array_position);
- if (role < 0)
+ /* Bound @role before it indexes the failed_devices stack bitmap. */
+ if (role < 0 || role >= rs->raid_disks)
continue;
if (role != r->raid_disk) {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0621/1167] dm-thin: fix data corruption if discard races with regular I/O
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (614 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0620/1167] dm-raid: bound array_position before indexing failed_devices Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0622/1167] dm-thin: fix leak if __set_snapshot_details fails Greg Kroah-Hartman
` (41 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 62ee9c09366cad69410330087d990e469dd92314 upstream.
In the function break_up_discard_bio, if a discard hits the same block as
regular I/O, it was intended to skip the discard for the affected range.
However, the skip code only advances "data_begin", it doesn't advance
"virt_begin". So, the data_begin and virt_begin variables become
unsynchronized.
process_prepared_discard_passdown_pt1 calculates "data_end =
m->data_block + (m->virt_end - m->virt_begin);" - if m->data_block is
incremented and m->virt_begin isn't, it will overshoot the intended
discard range.
Cc: stable@vger.kernel.org
Fixes: e2dd8aca2d76 ("dm bio prison v1: improve concurrent IO performance")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-thin.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -1707,6 +1707,7 @@ static void break_up_discard_bio(struct
(void) build_key(tc->td, PHYSICAL, data_begin, data_begin + len, &data_key);
if (bio_detain(tc->pool, &data_key, NULL, &data_cell)) {
/* contention, we'll give up with this range */
+ virt_begin += len;
data_begin += len;
continue;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0622/1167] dm-thin: fix leak if __set_snapshot_details fails
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (615 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0621/1167] dm-thin: fix data corruption if discard races with regular I/O Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0623/1167] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
` (40 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit dfb95816cf6f2f2660af2ec64c65dc204c60b5e7 upstream.
If __set_snapshot_details fails, the variable td is leaked - this
prevents any other snapshot with the same id from being created.
Fix this by removing it from the list and freeing it.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 991d9fa02da0 ("dm: add thin provisioning target")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-thin-metadata.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -1225,10 +1225,13 @@ static int __create_snap(struct dm_pool_
__close_device(td);
if (r)
- goto bad;
+ goto bad2;
return 0;
+bad2:
+ list_del(&td->list);
+ kfree(td);
bad:
dm_btree_remove(&pmd->tl_info, pmd->root, &key, &pmd->root);
dm_btree_remove(&pmd->details_info, pmd->details_root,
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0623/1167] dm-thin: fix parsing of feature arguments
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (616 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0622/1167] dm-thin: fix leak if __set_snapshot_details fails Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0624/1167] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
` (39 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit c557fa19a83efad1e20eb733df821b745a4589ff upstream.
"struct dm_arg _args" limits the number of arguments to 4, but there are
5 possible arguments that can be specified.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 787a996cb251 ("dm thin: add error_if_no_space feature")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-thin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -3153,7 +3153,7 @@ static int parse_pool_features(struct dm
const char *arg_name;
static const struct dm_arg _args[] = {
- {0, 4, "Invalid number of pool feature arguments"},
+ {0, 5, "Invalid number of pool feature arguments"},
};
/*
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0624/1167] vt: serialise the producers of the flip buffer
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (617 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0623/1167] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0625/1167] comedi: addi_apci_1500: fix clearing of the gate enable Greg Kroah-Hartman
` (38 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiri Slaby, Nicolas Pitre,
Kees Cook, Joshua Rogers, Chris Mason, Helge Deller,
Thomas Zimmermann, Mingyu Wang, Randy Dunlap, Ronan Pigott,
Liav Mordouch
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
commit 5d1d814408c1c8e797031eac8ddd40de1a9e8e93 upstream.
Typing on a virtual console while the console replies to an escape
sequence can make the kernel write past the end of a buffer. A user who
can write to the foreground console can cause this on purpose if they
can also inject key events, through /dev/uinput or by writing to the
/dev/input/event* node of a keyboard.
Input for a tty goes through the flip buffer of its port. A driver
inserts the data with tty_insert_flip_*() and then calls
tty_flip_buffer_push() to pass it on to the line discipline. The insert
functions take no lock: they check that the current struct tty_buffer
has room, copy the data to offset ->used, and then advance ->used. So a
flip buffer supports only one producer at a time, and a driver that has
several must serialise them.
Four functions feed the flip buffer of a virtual console:
- put_queue(), puts_queue() and fn_send_intr() insert typed characters
and breaks for the keyboard handler. They run under kbd_event_lock.
- respond_string() inserts the reply when a program writes an escape
sequence that requests one, such as a cursor position report. It runs
under the console lock.
The keyboard handler gets its events from the input layer and feeds the
foreground console. Key events that a program writes to /dev/uinput or
to an event node reach it in the same way as typed keys.
The keyboard handler and respond_string() share no lock, so they can
interleave:
keyboard handler respond_string()
================ ================
room check passes
room check passes
memcpy() to offset used
used += len
memcpy() to offset used
used += len
/* used > size of the buffer */
The room check subtracts ->used from the size, and both are unsigned.
Once ->used exceeds the size, the result wraps, so the check always
passes, and each later insert lands further past the buffer.
Reproduced as root, with keys from a uinput keyboard and cursor position
reports on the same console: KFENCE reported an out-of-bounds write
1,024 bytes past the buffer in under 10 s.
Fix this by taking port->lock, with interrupts disabled, around the
insert and the push in these four functions. kbd_keycode() already takes
port->lock under kbd_event_lock, so this lock ordering is not new.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Nicolas Pitre <npitre@baylibre.com>
Cc: Kees Cook <kees+treewide@kernel.org>
Cc: Joshua Rogers <linux@joshua.hu>
Cc: Chris Mason <mason@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Mingyu Wang <25181214217@stu.xidian.edu.cn>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Ronan Pigott <ronan@rjp.ie>
Cc: Liav Mordouch <liavmordouch@gmail.com>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-1-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/vt/keyboard.c | 6 ++++++
drivers/tty/vt/vt.c | 2 ++
2 files changed, 8 insertions(+)
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -321,15 +321,20 @@ int kbd_rate(struct kbd_repeat *rpt)
/*
* Helper Functions.
+ *
+ * A flip buffer allows one producer at a time, and respond_string() in vt.c
+ * feeds the same one under the console lock. So take the lock of the port.
*/
static void put_queue(struct vc_data *vc, int ch)
{
+ guard(spinlock_irqsave)(&vc->port.lock);
tty_insert_flip_char(&vc->port, ch, 0);
tty_flip_buffer_push(&vc->port);
}
static void puts_queue(struct vc_data *vc, const char *cp)
{
+ guard(spinlock_irqsave)(&vc->port.lock);
tty_insert_flip_string(&vc->port, cp, strlen(cp));
tty_flip_buffer_push(&vc->port);
}
@@ -590,6 +595,7 @@ static void fn_inc_console(struct vc_dat
static void fn_send_intr(struct vc_data *vc)
{
+ guard(spinlock_irqsave)(&vc->port.lock);
tty_insert_flip_char(&vc->port, 0, TTY_BREAK);
tty_flip_buffer_push(&vc->port);
}
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1788,6 +1788,8 @@ static void csi_m(struct vc_data *vc)
static void respond_string(const char *p, size_t len, struct tty_port *port)
{
+ /* The keyboard handler feeds the same flip buffer. */
+ guard(spinlock_irqsave)(&port->lock);
tty_insert_flip_string(port, p, len);
tty_flip_buffer_push(port);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0625/1167] comedi: addi_apci_1500: fix clearing of the gate enable
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (618 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0624/1167] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0626/1167] comedi: ni_660x: dont poll without a DMA channel Greg Kroah-Hartman
` (37 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit ade85ceef46892425a08f3ee52ca06729ee4922e upstream.
INSN_CONFIG_SET_GATE_SRC reads the mode register of the counter/timer,
is meant to clear the External Gate Enable bit, sets it again if the
external gate was asked for, and writes the register back. The mask lacks
its '~': all the bits but EGE are cleared instead. So
- the external gate can be enabled but never be disabled again, and
- the instruction wipes the mode (continuous or single cycle, external
output, count and trigger enables, retrigger, duty cycle) which
INSN_CONFIG_SET_COUNTER_MODE has programmed: the timer silently falls
back to a single cycle pulse.
With the right mask, the instruction only changes the gate bit. An
application which sets the gate source after the counter mode now keeps
the mode it has asked for.
Fixes: a8c66b684efa ("staging: comedi: addi_apci_1500: rewrite the subdevice support functions")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-2-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/drivers/addi_apci_1500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/comedi/drivers/addi_apci_1500.c
+++ b/drivers/comedi/drivers/addi_apci_1500.c
@@ -696,7 +696,7 @@ static int apci1500_timer_insn_config(st
return -EINVAL;
val = z8536_read(dev, Z8536_CT_MODE_REG(chan));
- val &= Z8536_CT_MODE_EGE;
+ val &= ~Z8536_CT_MODE_EGE;
if (data[1] == 1)
val |= Z8536_CT_MODE_EGE;
else if (data[1] > 1)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0626/1167] comedi: ni_660x: dont poll without a DMA channel
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (619 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0625/1167] comedi: addi_apci_1500: fix clearing of the gate enable Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0627/1167] comedi: ni_tio: Fix overflow of the clock period Greg Kroah-Hartman
` (36 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 5a0c88567a5ebbe24ecb7828e200f63ed972718f upstream.
A counter command owns a MITE DMA channel from ni_660x_cmd() to
ni_660x_cancel(). A command does not only end by COMEDI_CANCEL: when the
reader is too slow mite_sync_input_dma() sets COMEDI_CB_OVERFLOW, and
counter errors set COMEDI_CB_ERROR, and comedi_handle_events() then calls
->cancel() from the interrupt handler. That releases the channel and
clears counter->mite_chan, but s->busy stays set until the owner has read
the rest of the data and seen the end of the acquisition.
do_poll_ioctl() only looks at s->busy, so a COMEDI_POLL in that state
ends in mite_sync_dma(NULL, s), which dereferences the channel.
Test the channel like ni_pcidio_poll() and ni_sync_ai_dma() do. The
pointer only changes under dev->mutex, which the ioctl holds, or in the
interrupt handler under interrupt_lock, which is taken here.
Fixes: 894db1197347 ("Staging: Comedi: ni_600x: Added support for comedi_poll.")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-3-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/drivers/ni_660x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/comedi/drivers/ni_660x.c
+++ b/drivers/comedi/drivers/ni_660x.c
@@ -459,7 +459,8 @@ static int ni_660x_input_poll(struct com
/* lock to avoid race with comedi_poll */
spin_lock_irqsave(&devpriv->interrupt_lock, flags);
- mite_sync_dma(counter->mite_chan, s);
+ if (counter->mite_chan)
+ mite_sync_dma(counter->mite_chan, s);
spin_unlock_irqrestore(&devpriv->interrupt_lock, flags);
return comedi_buf_read_n_available(s);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0627/1167] comedi: ni_tio: Fix overflow of the clock period
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (620 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0626/1167] comedi: ni_660x: dont poll without a DMA channel Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0628/1167] comedi: vmk80xx: report failed transfers of the K8061 Greg Kroah-Hartman
` (35 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik, Ian Abbott
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit ec214735bb113be747454812035b83010892e0d2 upstream.
ni_tio_set_clock_src() stores the period of the clock source, which the
user passes in nanoseconds, in picoseconds:
counter->clock_period_ps = period_ns * 1000;
period_ns is an unsigned int, so that the product is computed in 32
bits, although clock_period_ps is a u64. It wraps for periods above
4294967 ns, that is for external clocks slower than 233 Hz.
INSN_CONFIG_GET_CLOCK_SRC then reports a wrong period, and
ni_tio_set_sync_mode() decides on a wrong one: 4294968 ns become 704 ps,
which is below the limit of 25 ns under which the alternate
synchronization mode for fast clocks is switched on.
The multiplication was done in 64 bits until the constant
pico_per_nano, a uint64_t, was replaced by a literal. Widen again.
Fixes: 3e90b1c7ebe9 ("staging: comedi: ni_tio: tidy up ni_tio_set_clock_src() and helpers")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-4-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/drivers/ni_tio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/comedi/drivers/ni_tio.c
+++ b/drivers/comedi/drivers/ni_tio.c
@@ -800,7 +800,7 @@ static int ni_tio_set_clock_src(struct n
GI_PRESCALE_X2(counter_dev->variant) |
GI_PRESCALE_X8(counter_dev->variant), bits);
}
- counter->clock_period_ps = period_ns * 1000;
+ counter->clock_period_ps = (u64)period_ns * 1000;
ni_tio_set_sync_mode(counter);
return 0;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0628/1167] comedi: vmk80xx: report failed transfers of the K8061
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (621 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0627/1167] comedi: ni_tio: Fix overflow of the clock period Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0629/1167] iio: addac: ad74413r: fix the values of set_multiple Greg Kroah-Hartman
` (34 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 92fa93505576188acc22c5de1999db9a1c70c09b upstream.
For the K8061 board vmk80xx_read_packet() and vmk80xx_write_packet() call
vmk80xx_do_bulk_msg(), which ignores the result of its two bulk transfers,
and return 0. After a timeout, a stall or an unplug the instruction
handlers therefore go on and hand the old content of usb_rx_buf to user
space as a fresh sample (analog and digital inputs, counters, PWM and
output read-back), and writes to the outputs are reported as done.
All callers check the result already, because the K8055 branch of the two
functions returns that of usb_interrupt_msg(). Return the error of the
bulk transfers as well, and don't wait for an answer to a command that
could not be sent.
Fixes: 985cafccbf9b ("Staging: Comedi: vmk80xx: Add k8061 support")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-5-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/drivers/vmk80xx.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
--- a/drivers/comedi/drivers/vmk80xx.c
+++ b/drivers/comedi/drivers/vmk80xx.c
@@ -151,7 +151,7 @@ struct vmk80xx_private {
enum vmk80xx_model model;
};
-static void vmk80xx_do_bulk_msg(struct comedi_device *dev)
+static int vmk80xx_do_bulk_msg(struct comedi_device *dev)
{
struct vmk80xx_private *devpriv = dev->private;
struct usb_device *usb = comedi_to_usb_dev(dev);
@@ -161,6 +161,7 @@ static void vmk80xx_do_bulk_msg(struct c
unsigned int rx_pipe;
size_t tx_size;
size_t rx_size;
+ int ret;
tx_addr = devpriv->ep_tx->bEndpointAddress;
rx_addr = devpriv->ep_rx->bEndpointAddress;
@@ -169,11 +170,13 @@ static void vmk80xx_do_bulk_msg(struct c
tx_size = usb_endpoint_maxp(devpriv->ep_tx);
rx_size = usb_endpoint_maxp(devpriv->ep_rx);
- usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf, tx_size, NULL,
- PACKET_TIMEOUT);
+ ret = usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf, tx_size, NULL,
+ PACKET_TIMEOUT);
+ if (ret)
+ return ret;
- usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, rx_size, NULL,
- PACKET_TIMEOUT);
+ return usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, rx_size, NULL,
+ PACKET_TIMEOUT);
}
static int vmk80xx_read_packet(struct comedi_device *dev)
@@ -183,10 +186,8 @@ static int vmk80xx_read_packet(struct co
struct usb_endpoint_descriptor *ep;
unsigned int pipe;
- if (devpriv->model == VMK8061_MODEL) {
- vmk80xx_do_bulk_msg(dev);
- return 0;
- }
+ if (devpriv->model == VMK8061_MODEL)
+ return vmk80xx_do_bulk_msg(dev);
ep = devpriv->ep_rx;
pipe = usb_rcvintpipe(usb, ep->bEndpointAddress);
@@ -204,10 +205,8 @@ static int vmk80xx_write_packet(struct c
devpriv->usb_tx_buf[0] = cmd;
- if (devpriv->model == VMK8061_MODEL) {
- vmk80xx_do_bulk_msg(dev);
- return 0;
- }
+ if (devpriv->model == VMK8061_MODEL)
+ return vmk80xx_do_bulk_msg(dev);
ep = devpriv->ep_tx;
pipe = usb_sndintpipe(usb, ep->bEndpointAddress);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0629/1167] iio: addac: ad74413r: fix the values of set_multiple
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (622 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0628/1167] comedi: vmk80xx: report failed transfers of the K8061 Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0631/1167] misc: bcm-vk: fix DMA allocation memory leak Greg Kroah-Hartman
` (33 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik, Nuno Sá,
Jonathan Cameron
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit e6dfbd84b833ed595a5236b027357e917de28260 upstream.
ad74413r_gpio_set_multiple() walks over the lines in the mask and looks up
the new value of each with
if (*bits & offset)
offset is the number of the line, not a bit mask. Line 0 is always driven
low, line 1 gets the value meant for line 0, line 2 the one meant for line
1, and line 3 is driven high if either of these two is.
Test the bit which belongs to the line.
Fixes: fea251b6a5db ("iio: addac: add AD74413R driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/addac/ad74413r.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/addac/ad74413r.c
+++ b/drivers/iio/addac/ad74413r.c
@@ -312,7 +312,7 @@ static void ad74413r_gpio_set_multiple(s
return;
real_mask |= BIT(real_offset);
- if (*bits & offset)
+ if (test_bit(offset, bits))
real_bits |= BIT(real_offset);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0631/1167] misc: bcm-vk: fix DMA allocation memory leak
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (623 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0629/1167] iio: addac: ad74413r: fix the values of set_multiple Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0632/1167] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
` (32 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guangshuo Li
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
commit a36b3db60466d44eefcc5c252ce927c043429922 upstream.
bcm_vk_dma_alloc() leaks dma->pages and pinned user-page references
when page pinning or coherent SG allocation fails. DMA mapping
failures can also leave the SG list and earlier mappings unreleased,
as bcm_vk_sg_alloc() skips the partially initialized slot.
This issue was found by our static analysis tool under development.
Fixes: 111d746bb476 ("misc: bcm-vk: add VK messaging support")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20261027150921.137189-1-lgs201920130244@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/bcm-vk/bcm_vk_sg.c | 43 +++++++++++++++++++++++++++++++++-------
1 file changed, 36 insertions(+), 7 deletions(-)
--- a/drivers/misc/bcm-vk/bcm_vk_sg.c
+++ b/drivers/misc/bcm-vk/bcm_vk_sg.c
@@ -80,7 +80,8 @@ static int bcm_vk_dma_alloc(struct devic
dma->nr_pages = (err >= 0) ? err : 0;
dev_err(dev, "get_user_pages_fast, err=%d [%d]\n",
err, dma->nr_pages);
- return err < 0 ? err : -EINVAL;
+ err = err < 0 ? err : -EINVAL;
+ goto err_pages;
}
/* Max size of sg list is 1 per mapped page + fields at start */
@@ -92,8 +93,10 @@ static int bcm_vk_dma_alloc(struct devic
dma->sglen,
&dma->handle,
GFP_KERNEL);
- if (!dma->sglist)
- return -ENOMEM;
+ if (!dma->sglist) {
+ err = -ENOMEM;
+ goto err_pages;
+ }
dma->sglist[SGLIST_NUM_SG] = 0;
dma->sglist[SGLIST_TOTALSIZE] = vkdata->size;
@@ -110,8 +113,8 @@ static int bcm_vk_dma_alloc(struct devic
dma->direction);
transfer_size = size;
if (unlikely(dma_mapping_error(dev, sg_addr))) {
- __free_page(dma->pages[0]);
- return -EIO;
+ err = -EIO;
+ goto err_sglist;
}
for (i = 1; i < dma->nr_pages; i++) {
@@ -123,8 +126,8 @@ static int bcm_vk_dma_alloc(struct devic
size,
dma->direction);
if (unlikely(dma_mapping_error(dev, addr))) {
- __free_page(dma->pages[i]);
- return -EIO;
+ err = -EIO;
+ goto err_unmap;
}
/*
@@ -169,6 +172,32 @@ static int bcm_vk_dma_alloc(struct devic
#endif
return 0;
+
+err_unmap:
+ /*
+ * Unmap completed SG entries and the in-progress DMA range,
+ * which has not been written to the SG list yet.
+ */
+ sgdata = (struct _vk_data *)&dma->sglist[SGLIST_VKDATA_START];
+ for (i = 0; i < dma->sglist[SGLIST_NUM_SG]; i++) {
+ size = sgdata[i].size;
+ addr = get_unaligned(&sgdata[i].address);
+ dma_unmap_page(dev, addr, size, dma->direction);
+ }
+ dma_unmap_page(dev, sg_addr, transfer_size, dma->direction);
+
+err_sglist:
+ dma_free_coherent(dev, dma->sglen, dma->sglist, dma->handle);
+
+err_pages:
+ for (i = 0; i < dma->nr_pages; i++)
+ put_page(dma->pages[i]);
+ kfree(dma->pages);
+ dma->pages = NULL;
+ dma->sglist = NULL;
+ dma->sglen = 0;
+ dma->nr_pages = 0;
+ return err;
}
int bcm_vk_sg_alloc(struct device *dev,
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0632/1167] misc: ibmvmc: initialize HMC state before device registration
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (624 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0631/1167] misc: bcm-vk: fix DMA allocation memory leak Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0633/1167] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
` (31 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Jiale Yao
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
commit 2022f170e5655c40b93ed98629f7d0adb98cea49 upstream.
misc_register() exposes the IBM VMC device before the HMC state and
spinlocks are initialized. A userspace operation racing module
initialization can therefore access an HMC through an uninitialized
spinlock.
Initialize all HMC state before registering the misc device.
Fixes: 0eca353e7ae7 ("misc: IBM Virtual Management Channel Driver (VMC)")
Cc: stable <stable@kernel.org>
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20261028044828.96177-5-yaojiale02@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/ibmvmc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--- a/drivers/misc/ibmvmc.c
+++ b/drivers/misc/ibmvmc.c
@@ -2367,14 +2367,6 @@ static int __init ibmvmc_module_init(voi
ibmvmc.state = ibmvmc_state_initial;
pr_info("ibmvmc: version %s\n", IBMVMC_DRIVER_VERSION);
- rc = misc_register(&ibmvmc_miscdev);
- if (rc) {
- pr_err("ibmvmc: misc registration failed\n");
- goto misc_register_failed;
- }
- pr_info("ibmvmc: node %d:%d\n", MISC_MAJOR,
- ibmvmc_miscdev.minor);
-
/* Initialize data structures */
memset(hmcs, 0, sizeof(struct ibmvmc_hmc) * MAX_HMCS);
for (i = 0; i < MAX_HMCS; i++) {
@@ -2384,6 +2376,14 @@ static int __init ibmvmc_module_init(voi
hmcs[i].queue_outbound_msgs[j] = VMC_INVALID_BUFFER_ID;
}
+ rc = misc_register(&ibmvmc_miscdev);
+ if (rc) {
+ pr_err("ibmvmc: misc registration failed\n");
+ goto misc_register_failed;
+ }
+ pr_info("ibmvmc: node %d:%d\n", MISC_MAJOR,
+ ibmvmc_miscdev.minor);
+
/* Sanity check module parms */
ibmvmc_scrub_module_parms();
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0633/1167] misc: vmw_vmci: wait for callbacks in event unsubscribe
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (625 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.6 0632/1167] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0634/1167] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
` (30 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Bryan Tan, Vishnu Dasa,
Broadcom internal kernel review list, Arnd Bergmann, Josef Bacik
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 824a27d391cf934d3232e8e2dabee221fc4e18ae upstream.
event_deliver() calls the callbacks of the subscribers inside an RCU read
side critical section. vmci_event_unsubscribe() used to call
synchronize_rcu() before it freed the subscription. This did more than
to protect the struct vmci_subscription: when the function returned, no
callback was running any more, and its callers rely on that.
vmci_transport_free_resources() unsubscribes from
VMCI_EVENT_QP_PEER_DETACH and frees the struct vmci_transport, which is
the callback data, a few lines later:
CPU0 CPU1
event_deliver()
rcu_read_lock()
vmci_transport_peer_detach_cb()
vmci_event_unsubscribe()
list_del_rcu(&s->node)
kvfree_rcu_mightsleep(s)
kfree(transport)
spin_lock_bh(&trans->lock)
The event is sent when the peer of the queue pair detaches, so the other
end of a vsock connection chooses the time. vmci_transport_exit() and
vmci_guest_remove_device() unsubscribe callbacks which are gone with
their module.
kvfree_rcu_mightsleep() only waits for a grace period if it cannot
allocate memory. Bring the synchronize_rcu() back. The cleanup work of
the vmci transport now waits for one grace period per socket again.
Fixes: 6da3f33770e0 ("misc: vmw_vmci: Switch to kvfree_rcu() API")
Cc: stable <stable@kernel.org>
Cc: Bryan Tan <bryan-bt.tan@broadcom.com>
Cc: Vishnu Dasa <vishnu.dasa@broadcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/2026102715-escapable-quaintly-8530@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/vmw_vmci/vmci_event.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/misc/vmw_vmci/vmci_event.c
+++ b/drivers/misc/vmw_vmci/vmci_event.c
@@ -213,7 +213,12 @@ int vmci_event_unsubscribe(u32 sub_id)
if (!s)
return VMCI_ERROR_NOT_FOUND;
- kvfree_rcu_mightsleep(s);
+ /*
+ * Wait for event_deliver(): the caller is going to free what the
+ * callback works on.
+ */
+ synchronize_rcu();
+ kfree(s);
return VMCI_SUCCESS;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0634/1167] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (626 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0633/1167] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0640/1167] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
` (29 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Ilpo Järvinen,
Andy Shevchenko, Jiri Slaby, Heikki Krogerus, Peter Hurley,
Josef Bacik
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 08daebfd63e9054e097eb2653eff9381de43a422 upstream.
byt_set_termios() derives the clock of the UART from the baud rate in
the termios, which nobody has looked at yet:
fuart = baud * 16;
...
fuart *= rounddown_pow_of_two(fref / fuart);
...
p->uartclk = fuart;
fref is 100 MHz. For a baud rate above 6250000, which BOTHER allows,
fref / fuart is 0, and rounddown_pow_of_two(0) shifts 1UL by -1. On x86
that is 1UL << 63, the product with a multiple of 16 is 0, and so is
uartclk. serial8250_get_baud_rate() then passes 0 for both limits,
uart_get_baud_rate() finds no rate which fits, WARNs and returns 0, and
uart_get_divisor() or dw8250_get_divisor() divide by 16 * 0.
Everybody who may open the tty can oops the kernel with one TCSETS2.
Don't ask for more than fref. The limits are those of a 100 MHz clock
then, and uart_get_baud_rate() falls back to the old rate as for any
other rate that the port cannot do. 8250_mid, which has the same
formula, treats this case separately.
Fixes: 21947ba654a6 ("serial: 8250_pci: replace switch-case by formula")
Cc: stable <stable@kernel.org>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-16-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_lpss.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/tty/serial/8250/8250_lpss.c
+++ b/drivers/tty/serial/8250/8250_lpss.c
@@ -82,6 +82,9 @@ static void byt_set_termios(struct uart_
/* Gracefully handle the B0 case: fall back to B9600 */
fuart = fuart ? fuart : 9600 * 16;
+ /* Fuart <= Fref: leave it to the core to refuse a higher baud rate */
+ fuart = min(fuart, fref);
+
/* Get Fuart closer to Fref */
fuart *= rounddown_pow_of_two(fref / fuart);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0640/1167] USB: serial: garmin_gps: fix deadlock on reset request
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (627 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0634/1167] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0641/1167] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
` (28 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Bacik, Johan Hovold
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit ab89a9dab02d9553eb0cc27fd3e4a4998acbc8e9 upstream.
The garmin_gps driver has a reset feature that is supposed to reset the
device when writing a private reset request packet. The reset is however
done synchronously from the write() callback (and without holding the
required device lock) which leads to a deadlock in the line discipline
when hanging up the port as part of disconnect.
Switch to using the asynchronous reset interface while dropping the
redundant and synchronous stopping of the interrupt urb (write()
callbacks are supposed to be atomic and USB core, USB serial core and
the driver itself will unlink and kill all URBs during disconnect).
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/2026102733-prayer-drainer-56f3@gregkh
Cc: stable@vger.kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/garmin_gps.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -822,10 +822,9 @@ static void priv_status_resp(struct usb_
* Garmin specific driver functions
******************************************************************************/
-static int process_resetdev_request(struct usb_serial_port *port)
+static void process_resetdev_request(struct usb_serial_port *port)
{
unsigned long flags;
- int status;
struct garmin_data *garmin_data_p = usb_get_serial_port_data(port);
spin_lock_irqsave(&garmin_data_p->lock, flags);
@@ -834,13 +833,8 @@ static int process_resetdev_request(stru
garmin_data_p->serial_num = 0;
spin_unlock_irqrestore(&garmin_data_p->lock, flags);
- usb_kill_urb(port->interrupt_in_urb);
- dev_dbg(&port->dev, "%s - usb_reset_device\n", __func__);
- status = usb_reset_device(port->serial->dev);
- if (status)
- dev_dbg(&port->dev, "%s - usb_reset_device failed: %d\n",
- __func__, status);
- return status;
+ dev_dbg(&port->dev, "%s - usb_queue_reset_device\n", __func__);
+ usb_queue_reset_device(port->serial->interface);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0641/1167] USB: serial: oti6858: fix the teardown order in close
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (628 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0640/1167] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0642/1167] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
` (27 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Johan Hovold, Josef Bacik
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit f184ae84a5d19554d980a918a9c8baaef87ac301 upstream.
The driver passes a baton around: the completion handler of the
interrupt urb either resubmits the urb, submits the read urb or
schedules one of the two delayed works, and the works and the bulk
completion handlers submit the interrupt urb again.
oti6858_close() cancels the works first and kills the urbs afterwards.
An interrupt urb that completes in between schedules a work again:
oti6858_close()
cancel_delayed_work_sync(setup)
cancel_delayed_work_sync(write)
oti6858_read_int_callback()
schedule_delayed_work(setup)
usb_kill_urb(interrupt_in_urb) /* not in flight */
setup_line()
usb_submit_urb(interrupt_in_urb)
The port is now closed with the baton still going round. The next open
fails because the interrupt urb is already submitted, and if the device
is unplugged, oti6858_port_remove() frees the private data while a work
may be pending or running.
Poison the interrupt urb first: that waits for the handler and makes all
further submissions fail, so nothing schedules the works any more. Then
cancel the works, after which only the bulk urbs are left, kill those,
and make the interrupt urb usable again for the next open. Don't print
an error for the submissions that fail with -EPERM in this window, as
oti6858_read_bulk_callback() already does.
Fixes: 49cdee0ed0fc ("USB: oti6858 usb-serial driver (in Nokia CA-42 cable)")
Cc: stable <stable@kernel.org>
Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/oti6858.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -252,7 +252,7 @@ static void setup_line(struct work_struc
dev_dbg(&port->dev, "%s(): submitting interrupt urb\n", __func__);
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
- if (result != 0) {
+ if (result != 0 && result != -EPERM) {
dev_err(&port->dev, "%s(): usb_submit_urb() failed with error %d\n",
__func__, result);
}
@@ -304,7 +304,7 @@ static void send_data(struct work_struct
dev_dbg(&port->dev, "%s(): submitting interrupt urb\n", __func__);
result = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
- if (result != 0) {
+ if (result != 0 && result != -EPERM) {
dev_err(&port->dev, "%s(): usb_submit_urb() failed with error %d\n",
__func__, result);
}
@@ -566,6 +566,13 @@ static void oti6858_close(struct usb_ser
dev_dbg(&port->dev, "%s(): after buf_clear()\n", __func__);
+ /*
+ * The interrupt urb schedules the works, and the works and the bulk
+ * urbs resubmit the interrupt urb: keep it from being submitted until
+ * all of them are gone.
+ */
+ usb_poison_urb(port->interrupt_in_urb);
+
/* cancel scheduled setup */
cancel_delayed_work_sync(&priv->delayed_setup_work);
cancel_delayed_work_sync(&priv->delayed_write_work);
@@ -574,7 +581,8 @@ static void oti6858_close(struct usb_ser
dev_dbg(&port->dev, "%s(): shutting down urbs\n", __func__);
usb_kill_urb(port->write_urb);
usb_kill_urb(port->read_urb);
- usb_kill_urb(port->interrupt_in_urb);
+
+ usb_unpoison_urb(port->interrupt_in_urb);
}
static int oti6858_tiocmset(struct tty_struct *tty,
@@ -831,7 +839,7 @@ static void oti6858_write_bulk_callback(
/* schedule the interrupt urb if we are still open */
dev_dbg(&port->dev, "%s(): submitting interrupt urb\n", __func__);
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
- if (result != 0) {
+ if (result != 0 && result != -EPERM) {
dev_err(&port->dev, "%s(): failed submitting int urb,"
" error %d\n", __func__, result);
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0642/1167] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (629 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0641/1167] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0643/1167] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
` (26 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Joonhoe Kim, Konrad Dybcio,
Heikki Krogerus
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonhoe Kim <26rote@gmail.com>
commit 89aaaa26f6985d55676fc5c90440f279733fa132 upstream.
DisplayPort pin assignments C and E give all four SuperSpeed lanes to
DisplayPort, but the USB 2.0 D+/D- pair is not part of the pin
assignment and stays available. The FSA4480 sits on that pair, and in
these modes the driver turns its USB switch off, so a USB 2.0 hub or
device behind a DisplayPort sink is disconnected as soon as the
DisplayPort mode is set.
Configure the USB switch the same way in all DisplayPort modes.
Fixes: c7054c31c1c9 ("usb: typec: fsa4480: rework mux & switch setup to handle more states")
Cc: stable <stable@kernel.org>
Signed-off-by: Joonhoe Kim <26rote@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20261022165143.1327-1-26rote@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/mux/fsa4480.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
--- a/drivers/usb/typec/mux/fsa4480.c
+++ b/drivers/usb/typec/mux/fsa4480.c
@@ -84,16 +84,9 @@ static int fsa4480_set(struct fsa4480 *f
sel = FSA4480_SEL_USB;
} else if (fsa->svid) {
switch (fsa->mode) {
- /* DP Only */
case TYPEC_DP_STATE_C:
- case TYPEC_DP_STATE_E:
- enable |= FSA4480_ENABLE_SBU;
- if (reverse)
- sel = FSA4480_SEL_SBU_REVERSE;
- break;
-
- /* DP + USB */
case TYPEC_DP_STATE_D:
+ case TYPEC_DP_STATE_E:
case TYPEC_DP_STATE_F:
enable |= FSA4480_ENABLE_USB | FSA4480_ENABLE_SBU;
sel = FSA4480_SEL_USB;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0643/1167] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (630 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0642/1167] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0644/1167] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
` (25 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Chaz Bailey,
Krishna Kurapati, Heikki Krogerus
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chaz Bailey <charles.s.bailey@gmail.com>
commit 2022b10726be78849626ea3fa33038ee96a54e46 upstream.
nb7vpq904m_probe() allocates struct nb7vpq904m, but client data is not
set during probe.
In nb7vpq904m_remove(), i2c_get_clientdata(client) returns NULL, leading
to a NULL pointer dereference when accessing nb7->retimer or nb7->sw.
Set client data upon successful allocation in probe.
Fixes: 88d8f3ac9c67 ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver")
Cc: stable <stable@kernel.org>
Signed-off-by: Chaz Bailey <charles.s.bailey@gmail.com>
Reviewed-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20261016122045.187862-1-charles.s.bailey@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/mux/nb7vpq904m.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/typec/mux/nb7vpq904m.c
+++ b/drivers/usb/typec/mux/nb7vpq904m.c
@@ -425,6 +425,7 @@ static int nb7vpq904m_probe(struct i2c_c
return -ENOMEM;
nb7->client = client;
+ i2c_set_clientdata(client, nb7);
nb7->regmap = devm_regmap_init_i2c(client, &nb7_regmap);
if (IS_ERR(nb7->regmap)) {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0644/1167] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa)
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (631 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0643/1167] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0645/1167] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
` (24 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Olivier Kaloudoff, stable,
Alan Stern
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Kaloudoff <olivier.kaloudoff@gmail.com>
commit fafd23d61494461256d374f67c121f2712e1af2f upstream.
The ASMedia chip detection in uas_use_uas_driver() assumes that every
device with idVendor/idProduct 174c:5106 or 174c:55aa reporting a
config.MaxPower of 0 is an ASM1153 with working UAS.
ASMT135x bridges (iProduct "ASMT135x") share the same 174c:55aa id and
also report MaxPower == 0, so they take the "ASM1153, do nothing"
path — but their UAS implementation is broken:
- The first READ(16) issued by sd probing times out after 30 s;
enumeration only completes after a uas_eh_abort_handler plus a full
uas_eh_host_reset_handler cycle:
scsi 3:0:0:0: Direct-Access ASMT ASMT135x 0 PQ: 0 ANSI: 6
sd 3:0:0:0: [sdb] tag#26 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN
sd 3:0:0:0: [sdb] tag#26 CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
scsi host3: uas_eh_host_reset_handler start
usb 6-2: reset SuperSpeed USB device number 2 using xhci_hcd
scsi host3: uas_eh_host_reset_handler success
- Under concurrent load the bridge stalls: all inflight commands (20+
UAS tags in the captured incident, mixed READ(16)/WRITE(16)) hit the
30 s UAS timeout in the same event, forcing repeated abort/reset
cycles and eventually a USB disconnect. Writes dropped mid-flight
during these resets returned zeros to the filesystem (observed as
XFS metadata corruption on the mounted volume).
- Sequential-write throughput is ~45 MiB/s under UAS versus ~136 MiB/s
after disabling UAS (usb-storage BOT mode), which is fully stable:
several tens of GiB written without a single error.
- Bulk reads of healthy LBA ranges do work under UAS (~190 MiB/s, no
errors); the failure pattern is command-timeout at enumeration and
under queue depth / write load, not a broken transfer path.
Since 174c:55aa is shared across several ASMedia bridges and enclosure
rebrandings, distinguish the ASMT135x by its product string — the same
approach used for the HIKSEMI MD202 check a few lines below. The
product strings of working bridges using the same id ("ASM1053E",
"ASM1153", "ASM1153E", "ASM1351", vendor rebrands such as "YZWY_TECH")
do not contain "ASMT135", so the match is safe.
Verified on an ORICO enclosure (iManufacturer "ASMT", iProduct
"ASMT135x", bcdDevice 1.00) attached through an Alpine Ridge TB3 dock:
with the equivalent usb-storage quirks parameter (174c:55aa:u) the
device is completely stable.
Signed-off-by: Olivier Kaloudoff <olivier.kaloudoff@gmail.com>
Cc: stable <stable@kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20261014165741.35758-1-olivier.kaloudoff@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/storage/uas-detect.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -78,6 +78,8 @@ static int uas_use_uas_driver(struct usb
* ASM1051 - with broken (*) uas support
* ASM1053 - with working uas support, but problems with large xfers
* ASM1153 - with working uas support
+ * ASMT135x - broken uas support, shares the ASM1153 MaxPower == 0
+ * signature, identify it by its product string
*
* Devices with these chips re-use a number of device-ids over the
* entire line, so the device-id is useless to determine if we're
@@ -99,7 +101,11 @@ static int uas_use_uas_driver(struct usb
(le16_to_cpu(udev->descriptor.idProduct) == 0x5106 ||
le16_to_cpu(udev->descriptor.idProduct) == 0x55aa)) {
if (udev->actconfig->desc.bMaxPower == 0) {
- /* ASM1153, do nothing */
+ if (udev->product && strstr(udev->product, "ASMT135")) {
+ /* ASMT135x, broken uas */
+ flags |= US_FL_IGNORE_UAS;
+ }
+ /* else ASM1153, do nothing */
} else if (udev->speed < USB_SPEED_SUPER) {
/* No streams info, assume ASM1051 */
flags |= US_FL_IGNORE_UAS;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0645/1167] usb: usbtest: prevent divide by zero in simple_io() with zero length
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (632 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0644/1167] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0646/1167] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
` (23 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Bin Yu, Cheng Wen,
YuanZhe Liu, Alan Stern
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
commit fdaca138694111153f96c7d76877734b9dbf0e01 upstream.
A divide error oops was observed in simple_io():
usbtest 1-1:1.0: TEST 3: write/1 0..0 bytes 16307 times
Oops: divide error: 0000 [#1] SMP KASAN
RIP: 0010:simple_io+0x2c4/0x540 drivers/usb/misc/usbtest.c:497
The variable-length tests (test 3 and test 4) compute the next URB
size with "len %= max", where max is the original
urb->transfer_buffer_length. However, when a zero-length transfer is
requested (param->length == 0), simple_alloc_urb() still returns a valid
URB with transfer_buffer_length set to 0. On the first vary update,
"len %= max" divides by zero and the kernel oopses.
Commit 564e69893c63 ("USB: usbtest: prevent a divide by zero bug") added
the equivalent zero check to alloc_sglist(), which covers the
scatterlist tests (test 7/8), but the single-URB variable-length path in
simple_io() was left unprotected.
Fix this by returning -EINVAL early from simple_io() when vary is
requested but max is zero, so the divide by zero never occurs.
Zero-length transfers without vary remain valid for the other callers of
simple_io().
Cc: stable <stable@kernel.org>
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20261016072750.34256-1-25031212351@stu.xidian.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/misc/usbtest.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -466,6 +466,9 @@ static int simple_io(
int retval = 0;
unsigned long expire;
+ if (vary && !max)
+ return -EINVAL;
+
urb->context = &completion;
while (retval == 0 && iterations-- > 0) {
init_completion(&completion);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0646/1167] usb: typec: ucsi: Set ucsi->connector before enabling notifications
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (633 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0645/1167] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0647/1167] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
` (22 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Uttkarsh Aggarwal,
Peter Chen, Heikki Krogerus
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uttkarsh Aggarwal <uttkarsh.aggarwal@oss.qualcomm.com>
commit 5b4b83c2ffe8740f6f3e54ea4d4962a62c063ef1 upstream.
In ucsi_init(), ucsi->connector is assigned only after the
UCSI_SET_NOTIFICATION_ENABLE command completes. But once that command
is sent, the PPM is free to raise a connector change notification at
any time, which is handled through:
ucsi_notify_common() -> ucsi_connector_change()
ucsi_connector_change() indexes into ucsi->connector to get the
connector and schedule its work item. If this notification arrives
before ucsi_init() reaches the "ucsi->connector = connector;" line,
ucsi->connector is still NULL and the driver crashes dereferencing it.
Fix this by setting ucsi->connector right after the connectors are
registered, before notifications are enabled, so it is always valid
by the time a connector change event can be delivered. Also clear
ucsi->connector in the err_unregister path so it isn't left pointing
at freed memory if a later step in ucsi_init() fails.
Fixes: 0482c34ec6f8 ("usb: ucsi: Fix ucsi->connector race")
Cc: stable <stable@kernel.org>
Signed-off-by: Uttkarsh Aggarwal <uttkarsh.aggarwal@oss.qualcomm.com>
Reviewed-by: Peter Chen <peter.chen@oss.qualcomm.com>
Reviewed-by: Heikki Krogerus <heikki.krogeurs@linuc.intel.com>
Link: https://patch.msgid.link/20260929092939.1806907-1-uttkarsh.aggarwal@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/ucsi/ucsi.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1528,6 +1528,14 @@ static int ucsi_init(struct ucsi *ucsi)
goto err_unregister;
}
+ /*
+ * Set ucsi->connector before enabling notifications. A connector
+ * change event can be handled as soon as the notifications are
+ * enabled below, and ucsi_connector_change() indexes into
+ * ucsi->connector, so it must not be NULL at that point.
+ */
+ ucsi->connector = connector;
+
/* Enable all supported notifications */
ntfy = ucsi_get_supported_notifications(ucsi);
command = UCSI_SET_NOTIFICATION_ENABLE | ntfy;
@@ -1535,7 +1543,6 @@ static int ucsi_init(struct ucsi *ucsi)
if (ret < 0)
goto err_unregister;
- ucsi->connector = connector;
ucsi->ntfy = ntfy;
mutex_lock(&ucsi->ppm_lock);
@@ -1549,6 +1556,7 @@ static int ucsi_init(struct ucsi *ucsi)
return 0;
err_unregister:
+ ucsi->connector = NULL;
for (con = connector; con->port; con++)
ucsi_unregister_port(con);
for (i = 0; i < ucsi->cap.num_connectors; i++)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0647/1167] usb: xhci: disable the correct slot on alloc_dev failure
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (634 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0646/1167] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0648/1167] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
` (21 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xu Rao, Niklas Neronin,
Mathias Nyman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xu Rao <raoxu@uniontech.com>
commit 2f2fe3201029ffc215b46ac40a0a9587715bc43a upstream.
xhci_alloc_dev() stores the Slot ID returned by the Enable Slot command
in the local slot_id variable. udev->slot_id is updated only after
xhci_alloc_virt_device() succeeds.
If endpoint resource reservation or virtual device allocation fails
before that update, the error path passes udev->slot_id to
xhci_disable_and_free_slot(). During initial enumeration this is slot 0.
When reallocating a device whose virtual device is missing or belongs to
another usb_device, udev->slot_id may contain a stale Slot ID.
The newly enabled slot can therefore remain active, or the wrong slot can
be disabled.
Pass slot_id, which identifies the slot enabled by this invocation.
xhci_disable_and_free_slot() already handles a missing xhci->devs entry.
Fixes: 3ffbba9511b4 ("USB: xhci: Allocate and address USB devices")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Reviewed-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20261105175106.241182-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4103,7 +4103,7 @@ int xhci_alloc_dev(struct usb_hcd *hcd,
return 1;
disable_slot:
- xhci_disable_and_free_slot(xhci, udev->slot_id);
+ xhci_disable_and_free_slot(xhci, slot_id);
return 0;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0648/1167] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (635 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0647/1167] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0649/1167] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
` (20 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Yu Zhang, Alan Stern
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Zhang <yuz08559@gmail.com>
commit 450fa94d7ae9fc91c3df525f5d1322bf8fecf7b2 upstream.
fsg_store_nofua() syncs the LUN's backing file when switching from async
to sync mode:
if (!nofua && curlun->nofua)
fsg_lun_fsync_sub(curlun);
fsg_lun_fsync_sub() dereferences curlun->filp (vfs_fsync(filp)). Unlike
every other store that touches the backing file -- fsg_store_ro() and
fsg_store_cdrom() (down_read), fsg_store_file() (down_write) --
fsg_store_nofua() holds no filesem while doing so.
A concurrent close of the backing file runs under down_write(filesem) and
does fput(curlun->filp) in fsg_lun_close() (fsg_store_file() with an empty
path, the SCSI START_STOP eject in do_start_stop(), or forced_eject), so
it can free the file while fsg_store_nofua() is dereferencing it:
BUG: KASAN: slab-use-after-free in vfs_fsync+0x20/0xe0
vfs_fsync+0x20/0xe0
fsg_lun_fsync_sub+0xa0/0xd0
fsg_store_nofua+0x138/0x160
configfs_write_iter+0x1a7/0x250
vfs_write+0x5df/0x940
Allocated by task 3459:
fsg_store_file+0x150/0x1f0
configfs_write_iter+0x1a7/0x250
Freed by task 3459:
__fput+0x456/0x6c0
__fput_deferred+0x10d/0x330
fsg_store_file+0x9e/0x1f0
configfs_write_iter+0x1a7/0x250
Hold filesem for read around the fsync in fsg_store_nofua() so the backing
file cannot be closed underneath it. The lock is only needed when the
fsync actually runs, so it is taken only in that branch.
Reproduced on a mass_storage gadget over dummy_hcd by writing lun.N/nofua
(1 then 0) from one task while another task rewrites and clears lun.N/file.
Cc: stable <stable@kernel.org>
Signed-off-by: Yu Zhang <yuz08559@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20261020023050.87701-1-yuz08559@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/f_mass_storage.c | 8 ++++++--
drivers/usb/gadget/function/storage_common.c | 7 +++++--
drivers/usb/gadget/function/storage_common.h | 3 ++-
3 files changed, 13 insertions(+), 5 deletions(-)
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -2668,8 +2668,9 @@ static ssize_t nofua_store(struct device
const char *buf, size_t count)
{
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
+ struct rw_semaphore *filesem = dev_get_drvdata(dev);
- return fsg_store_nofua(curlun, buf, count);
+ return fsg_store_nofua(curlun, filesem, buf, count);
}
static ssize_t file_store(struct device *dev, struct device_attribute *attr,
@@ -3248,7 +3249,10 @@ static ssize_t fsg_lun_opts_nofua_show(s
static ssize_t fsg_lun_opts_nofua_store(struct config_item *item,
const char *page, size_t len)
{
- return fsg_store_nofua(to_fsg_lun_opts(item)->lun, page, len);
+ struct fsg_lun_opts *opts = to_fsg_lun_opts(item);
+ struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent);
+
+ return fsg_store_nofua(opts->lun, &fsg_opts->common->filesem, page, len);
}
CONFIGFS_ATTR(fsg_lun_opts_, nofua);
--- a/drivers/usb/gadget/function/storage_common.c
+++ b/drivers/usb/gadget/function/storage_common.c
@@ -415,7 +415,8 @@ ssize_t fsg_store_ro(struct fsg_lun *cur
}
EXPORT_SYMBOL_GPL(fsg_store_ro);
-ssize_t fsg_store_nofua(struct fsg_lun *curlun, const char *buf, size_t count)
+ssize_t fsg_store_nofua(struct fsg_lun *curlun, struct rw_semaphore *filesem,
+ const char *buf, size_t count)
{
bool nofua;
int ret;
@@ -425,8 +426,10 @@ ssize_t fsg_store_nofua(struct fsg_lun *
return ret;
/* Sync data when switching from async mode to sync */
- if (!nofua && curlun->nofua)
+ if (!nofua && curlun->nofua) {
+ guard(rwsem_read)(filesem);
fsg_lun_fsync_sub(curlun);
+ }
curlun->nofua = nofua;
--- a/drivers/usb/gadget/function/storage_common.h
+++ b/drivers/usb/gadget/function/storage_common.h
@@ -210,7 +210,8 @@ ssize_t fsg_show_cdrom(struct fsg_lun *c
ssize_t fsg_show_removable(struct fsg_lun *curlun, char *buf);
ssize_t fsg_store_ro(struct fsg_lun *curlun, struct rw_semaphore *filesem,
const char *buf, size_t count);
-ssize_t fsg_store_nofua(struct fsg_lun *curlun, const char *buf, size_t count);
+ssize_t fsg_store_nofua(struct fsg_lun *curlun, struct rw_semaphore *filesem,
+ const char *buf, size_t count);
ssize_t fsg_store_file(struct fsg_lun *curlun, struct rw_semaphore *filesem,
const char *buf, size_t count);
ssize_t fsg_store_cdrom(struct fsg_lun *curlun, struct rw_semaphore *filesem,
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0649/1167] usb: gadget: f_midi: fix UAF race during IN request handling
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (636 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0648/1167] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0650/1167] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
` (19 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Sonali Pradhan
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sonali Pradhan <sonalipradhan@google.com>
commit 78a8d6537f1de34770e460edee360b556ef40427 upstream.
f_midi_disable() drains and frees pre-allocated IN requests from
in_req_fifo without holding midi->transmit_lock. If f_midi_transmit()
runs concurrently on the workqueue, f_midi_do_transmit() can peek a
request from in_req_fifo and write into its buffer while
f_midi_disable() frees it, leading to a use-after-free.
Additionally, when usb_ep_queue() fails in f_midi_do_transmit() (such
as with -ESHUTDOWN when the endpoint is disabled concurrently), it
resets req->length = 0 and returns active instead of the error code,
causing the do-while loop in f_midi_transmit() to keep spinning under
midi->transmit_lock until the substream is drained.
Fix this by acquiring midi->transmit_lock in f_midi_disable() while
releasing IN requests from in_req_fifo, and returning the error code
from f_midi_do_transmit() when usb_ep_queue() fails so f_midi_transmit()
aborts immediately and drops active substreams.
Fixes: e1e3d7ec5da3 ("usb: gadget: f_midi: pre-allocate IN requests")
Cc: stable <stable@kernel.org>
Signed-off-by: Sonali Pradhan <sonalipradhan@google.com>
Link: https://patch.msgid.link/20261028074821.579450-1-sonalipradhan@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/f_midi.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -419,6 +419,7 @@ static void f_midi_disable(struct usb_fu
struct f_midi *midi = func_to_midi(f);
struct usb_composite_dev *cdev = f->config->cdev;
struct usb_request *req = NULL;
+ unsigned long flags;
DBG(cdev, "disable\n");
@@ -430,8 +431,10 @@ static void f_midi_disable(struct usb_fu
usb_ep_disable(midi->out_ep);
/* release IN requests */
+ spin_lock_irqsave(&midi->transmit_lock, flags);
while (kfifo_get(&midi->in_req_fifo, &req))
free_ep_req(midi->in_ep, req);
+ spin_unlock_irqrestore(&midi->transmit_lock, flags);
f_midi_drop_out_substreams(midi);
}
@@ -660,6 +663,7 @@ static int f_midi_do_transmit(struct f_m
ERROR(midi, "%s failed to queue req: %d\n",
midi->in_ep->name, err);
req->length = 0; /* Re-use request next time. */
+ return err;
} else {
/* Upon success, put request at the back of the queue. */
kfifo_skip(&midi->in_req_fifo);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0650/1167] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (637 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0649/1167] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0651/1167] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
` (18 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Cosmin Tanislav,
Vladyslav Tymoshchuk, Leonardo Costa, Hiago De Franco
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 78585f90feb3bbaf3b1c642294c8c47e451dc3cf upstream.
ncm_wrap_ntb() aggregates datagrams into a pending NTB, which is sent
either when it becomes full, or after 300us since the NTB was started,
using ndo_start_xmit() (eth_start_xmit()).
ndo_start_xmit() returns NETDEV_TX_BUSY when the TX freelist is empty.
For regular packets this is fine since the networking core will requeue
them, but for timer-flushed packets there is no logic to handle this
situation, and HRTIMER_NORESTART is returned from ncm_tx_timeout()
without checking eth_start_xmit()'s return value.
Under sustained TX saturation the request freelist is empty most of the
time. Since the timer is never restarted, small packets keep getting
accumulated into the NTB, until either TX_MAX_NUM_DPE packets are stored
or NTB_DEFAULT_IN_SIZE is reached, which is an unknown amount of time.
Check the return value of ndo_start_xmit() and restart the timer after
another 300us.
Cc: stable <stable@kernel.org>
Fixes: 6d3865f9d41f ("usb: gadget: NCM: Add transmit multi-frame.")
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Tested-by: Vladyslav Tymoshchuk <tvlad744@gmail.com>
Tested-by: Leonardo Costa <leonardo.costa@toradex.com>
Reported-by: Hiago De Franco <hiago.franco@toradex.com>
Closes: https://lore.kernel.org/all/20231204183751.64202-1-hiagofranco@gmail.com/
Link: https://patch.msgid.link/20260817192638.437798-1-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/f_ncm.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -1138,6 +1138,7 @@ static enum hrtimer_restart ncm_tx_timeo
{
struct f_ncm *ncm = container_of(data, struct f_ncm, task_timer);
struct net_device *netdev = READ_ONCE(ncm->netdev);
+ netdev_tx_t ret;
if (netdev) {
/* XXX This allowance of a NULL skb argument to ndo_start_xmit
@@ -1148,7 +1149,11 @@ static enum hrtimer_restart ncm_tx_timeo
*
* This will call directly into u_ether's eth_start_xmit()
*/
- netdev->netdev_ops->ndo_start_xmit(NULL, netdev);
+ ret = netdev->netdev_ops->ndo_start_xmit(NULL, netdev);
+ if (ret == NETDEV_TX_BUSY) {
+ hrtimer_forward_now(data, TX_TIMEOUT_NSECS);
+ return HRTIMER_RESTART;
+ }
}
return HRTIMER_NORESTART;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0651/1167] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (638 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0650/1167] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0652/1167] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
` (17 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+782b2f1063e38ba8fa6e, stable,
Brian Ellis
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Ellis <brianellis@gotenna.com>
commit ea6cf69ad03c8d85138830c0d2c3b946b5ae231d upstream.
gs_close() opens with
struct gs_port *port = tty->driver_data;
...
spin_lock_irq(&port->port_lock);
and never checks port. gs_open() assigns tty->driver_data only on the
port.count 0 -> 1 edge, so any failure earlier in gs_open() leaves it NULL,
and tty_open() calls tty_release(), and hence ->close(), when ->open()
fails.
syzbot hit exactly this on arm64. Fault injection failed the kfifo_alloc()
of the write buffer in gs_open():
__kfifo_alloc_node+0x10c/0x208 lib/kfifo.c:44
gs_open+0x144/0x514 drivers/usb/gadget/function/u_serial.c:636
tty_open+0x404/0x89c drivers/tty/tty_io.c:2137
and the tty core's close of the failed open then took port_lock through
the NULL port:
BUG: unable to handle kernel paging request in gs_close
KASAN: null-ptr-deref in range [0x00000000000003a0-0x00000000000003a7]
Call trace:
spin_lock_irq include/linux/spinlock.h:372 [inline]
gs_close+0xac/0x65c drivers/usb/gadget/function/u_serial.c:698
tty_release+0x2c4/0xffc drivers/tty/tty_io.c:1745
tty_open+0x46c/0x89c drivers/tty/tty_io.c:2146
Return early instead. There is nothing to release when the open never got
far enough to claim the port.
Unlike the check reverted by commit f6c7bc4a6823 ("Revert "usb: gadget:
u_serial: Add null pointer check in gs_start_io""), this is not hiding a
race: the tty core calls ->close() for an ->open() that failed by design,
so driver_data is legitimately unset on that path.
Fixes: c1dca562be8a ("usb gadget: split out serial core")
Reported-by: syzbot+782b2f1063e38ba8fa6e@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=782b2f1063e38ba8fa6e
Cc: stable <stable@kernel.org>
Assisted-by: LLM
Signed-off-by: Brian Ellis <brianellis@gotenna.com>
Link: https://patch.msgid.link/20261013-u_serial-gs-close-null-v4-1-9ea038501994@gotenna.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/u_serial.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/usb/gadget/function/u_serial.c
+++ b/drivers/usb/gadget/function/u_serial.c
@@ -679,6 +679,9 @@ static void gs_close(struct tty_struct *
struct gs_port *port = tty->driver_data;
struct gserial *gser;
+ if (!port)
+ return;
+
spin_lock_irq(&port->port_lock);
if (port->port.count != 1) {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0652/1167] usb: dwc3: gadget: Clear delayed stop on End Transfer completion
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (639 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0651/1167] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0653/1167] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
` (16 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit f2bd20f92a7dc68980a6098397503067192ce63a upstream.
When an End Transfer command times out outside of the SETUP phase, the
driver sets DWC3_EP_DELAY_STOP to retry it on the next SETUP phase. If
the command completes in the meantime, the flag is left set. Requests
queued to the endpoint are then deferred, and the retry may end a
transfer that is started later.
Clear DWC3_EP_DELAY_STOP when the End Transfer command completes.
Fixes: 4db0fbb60136 ("usb: dwc3: gadget: Don't delay End Transfer on delayed_status")
Cc: stable <stable@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/c28a9660f7b6bfa626077ddcfbadd50e6b503f86.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -3862,6 +3862,7 @@ static void dwc3_gadget_endpoint_command
if (dep->stream_capable)
dep->flags |= DWC3_EP_IGNORE_NEXT_NOSTREAM;
+ dep->flags &= ~DWC3_EP_DELAY_STOP;
dep->flags &= ~DWC3_EP_END_TRANSFER_PENDING;
dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
dwc3_gadget_ep_cleanup_cancelled_requests(dep);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0653/1167] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (640 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0652/1167] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0654/1167] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
` (15 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit e616d91e02881983e5dadf6980c4aa08123800b3 upstream.
The function driver may re-enable an endpoint before the End Transfer
command issued on ep disable completes. The no-op Start Transfer issued
on ep enable then fails with "No Resource".
Only stream endpoints need the no-op Start Transfer to initiate a
stream. Other bulk and interrupt endpoints start their transfer when a
request is queued. Skip it for those endpoints, and move it to a helper
to be reused.
Fixes: a97ea994605e ("usb: dwc3: gadget: offset Start Transfer latency for bulk EPs")
Cc: stable <stable@kernel.org>
Reported-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Closes: https://lore.kernel.org/linux-usb/20260227121236.963-1-selvarasu.g@samsung.com/
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/227e97e30d26a017c92d7008a8633c01f955d088.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 97 +++++++++++++++++++++++-----------------------
1 file changed, 50 insertions(+), 47 deletions(-)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -893,6 +893,54 @@ static int dwc3_gadget_resize_tx_fifos(s
return 0;
}
+static int dwc3_gadget_ep_start_noop_transfer(struct dwc3_ep *dep)
+{
+ struct dwc3_gadget_ep_cmd_params params;
+ struct dwc3 *dwc = dep->dwc;
+ struct dwc3_trb *trb;
+ dma_addr_t trb_dma;
+ u32 cmd;
+ int ret;
+
+ memset(¶ms, 0, sizeof(params));
+ trb = &dep->trb_pool[0];
+ trb_dma = dwc3_trb_dma_offset(dep, trb);
+
+ params.param0 = upper_32_bits(trb_dma);
+ params.param1 = lower_32_bits(trb_dma);
+
+ cmd = DWC3_DEPCMD_STARTTRANSFER;
+
+ ret = dwc3_send_gadget_ep_cmd(dep, cmd, ¶ms);
+ if (ret < 0)
+ return ret;
+
+ /*
+ * For streams, at start, there maybe a race where the host primes the
+ * endpoint before the function driver queues a request to initiate a
+ * stream. In that case, the controller will not see the prime to
+ * generate the ERDY and start stream. To workaround this, issue a
+ * no-op TRB as normal, but end it immediately. As a result, when the
+ * function driver queues the request, the next START_TRANSFER command
+ * will cause the controller to generate an ERDY to initiate the
+ * stream.
+ */
+ dwc3_stop_active_transfer(dep, false, true);
+
+ /*
+ * All stream eps will reinitiate stream on NoStream rejection.
+ *
+ * However, if the controller is capable of TXF_FLUSH_BYPASS, then IN
+ * direction endpoints will automatically restart the stream without
+ * the driver initiation.
+ */
+ if (!dep->direction ||
+ !(dwc->hwparams.hwparams9 & DWC3_GHWPARAMS9_DEV_TXF_FLUSH_BYPASS))
+ dep->flags |= DWC3_EP_FORCE_RESTART_STREAM;
+
+ return 0;
+}
+
/**
* __dwc3_gadget_ep_enable - initializes a hw endpoint
* @dep: endpoint to be initialized
@@ -960,55 +1008,10 @@ static int __dwc3_gadget_ep_enable(struc
* Issue StartTransfer here with no-op TRB so we can always rely on No
* Response Update Transfer command.
*/
- if (usb_endpoint_xfer_bulk(desc) ||
- usb_endpoint_xfer_int(desc)) {
- struct dwc3_gadget_ep_cmd_params params;
- struct dwc3_trb *trb;
- dma_addr_t trb_dma;
- u32 cmd;
-
- memset(¶ms, 0, sizeof(params));
- trb = &dep->trb_pool[0];
- trb_dma = dwc3_trb_dma_offset(dep, trb);
-
- params.param0 = upper_32_bits(trb_dma);
- params.param1 = lower_32_bits(trb_dma);
-
- cmd = DWC3_DEPCMD_STARTTRANSFER;
-
- ret = dwc3_send_gadget_ep_cmd(dep, cmd, ¶ms);
+ if (dep->stream_capable) {
+ ret = dwc3_gadget_ep_start_noop_transfer(dep);
if (ret < 0)
return ret;
-
- if (dep->stream_capable) {
- /*
- * For streams, at start, there maybe a race where the
- * host primes the endpoint before the function driver
- * queues a request to initiate a stream. In that case,
- * the controller will not see the prime to generate the
- * ERDY and start stream. To workaround this, issue a
- * no-op TRB as normal, but end it immediately. As a
- * result, when the function driver queues the request,
- * the next START_TRANSFER command will cause the
- * controller to generate an ERDY to initiate the
- * stream.
- */
- dwc3_stop_active_transfer(dep, false, true);
-
- /*
- * All stream eps will reinitiate stream on NoStream
- * rejection.
- *
- * However, if the controller is capable of
- * TXF_FLUSH_BYPASS, then IN direction endpoints will
- * automatically restart the stream without the driver
- * initiation.
- */
- if (!dep->direction ||
- !(dwc->hwparams.hwparams9 &
- DWC3_GHWPARAMS9_DEV_TXF_FLUSH_BYPASS))
- dep->flags |= DWC3_EP_FORCE_RESTART_STREAM;
- }
}
out:
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0654/1167] usb: dwc3: gadget: Recover from End Transfer timeout
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (641 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0653/1167] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0655/1167] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
` (14 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Thinh Nguyen, stable
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit 61575534fb05d52d36979f38976ece74649f091a upstream.
If the End Transfer command times out, the endpoint resource is never
released and every subsequent Start Transfer to the endpoint fails with
"No Resource". Schedule an error recovery to reset the controller.
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: stable <stable@kernel.org>
Link: https://patch.msgid.link/7523e9a11303a33acd0b92a092fb0e8218d509d2.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1745,6 +1745,8 @@ static int __dwc3_gadget_get_frame(struc
return DWC3_DSTS_SOFFN(reg);
}
+static void dwc3_schedule_err_recovery(struct dwc3 *dwc);
+
/**
* __dwc3_stop_active_transfer - stop the current active transfer
* @dep: isoc endpoint
@@ -1788,6 +1790,9 @@ static int __dwc3_stop_active_transfer(s
dev_err_ratelimited(dep->dwc->dev,
"end transfer failed: %d\n", ret);
+ if (ret == -ETIMEDOUT && dep->dwc->err_state == DWC3_ERR_NONE)
+ dwc3_schedule_err_recovery(dep->dwc);
+
dep->resource_index = 0;
if (!interrupt)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0655/1167] usb: dwc3: gadget: Reject requests to a disabled endpoint
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (642 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0654/1167] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0656/1167] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
` (13 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit 5eb11b1647b0534b3a61a21473d77ebf4ffbed7c upstream.
__dwc3_gadget_ep_disable() releases the lock while giving back requests,
and DWC3_EP_ENABLED is only cleared afterward. A function driver can
queue a new request in this window, and the driver would start a
transfer on an endpoint that is already disabled in hardware.
Clear DWC3_EP_ENABLED before giving back the requests, and reject
requests queued to an endpoint that is not enabled.
Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/4ceab6aa5d6af0e4780f9d3a964fd5d8168a0a02.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1076,6 +1076,8 @@ static int __dwc3_gadget_ep_disable(stru
reg &= ~DWC3_DALEPENA_EP(dep->number);
dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);
+ dep->flags &= ~DWC3_EP_ENABLED;
+
dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
dep->stream_capable = false;
@@ -1989,7 +1991,8 @@ static int __dwc3_gadget_ep_queue(struct
{
struct dwc3 *dwc = dep->dwc;
- if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) {
+ if (!(dep->flags & DWC3_EP_ENABLED) || !dep->endpoint.desc ||
+ !dwc->pullups_connected || !dwc->connected) {
dev_dbg(dwc->dev, "%s: can't queue to disabled endpoint\n",
dep->name);
return -ESHUTDOWN;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0656/1167] usb: dwc3: gadget: Reset endpoint flags on controller start
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (643 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0655/1167] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0657/1167] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
` (12 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit 7c9bc134e5b3315e0456cda9e8e59c752309ea78 upstream.
The flags of a disabled endpoint may be preserved while its End
Transfer command is pending. If the command never completes, the stale
flags persist across a soft disconnect or an error recovery, and the
endpoint can't be used again.
Reset the flags of all non-control endpoints when starting the
controller.
Fixes: 76bff31c7fba ("usb: dwc3: gadget: Do not clear ep delayed stop flag during ep disable")
Cc: stable <stable@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/21cd189962b9d32a4f9df381df4947d35341d5a9.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2972,6 +2972,7 @@ static int __dwc3_gadget_start(struct dw
{
struct dwc3_ep *dep;
int ret = 0;
+ u32 epnum;
u32 reg;
/*
@@ -3029,6 +3030,15 @@ static int __dwc3_gadget_start(struct dw
return ret;
}
+ for (epnum = 2; epnum < dwc->num_eps; epnum++) {
+ dep = dwc->eps[epnum];
+ if (!dep)
+ continue;
+
+ dep->flags &= (DWC3_EP_TXFIFO_RESIZED |
+ DWC3_EP_RESOURCE_ALLOCATED);
+ }
+
dep = dwc->eps[0];
dep->flags = 0;
ret = __dwc3_gadget_ep_enable(dep, DWC3_DEPCFG_ACTION_INIT);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0657/1167] usb: dwc3: gadget: Track a timed out End Transfer
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (644 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0656/1167] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0658/1167] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
` (11 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit af91c6322e633504aa45de278f5d520f39d127be upstream.
If an End Transfer command with CMDIOC times out, the driver clears the
resource index but keeps DWC3_EP_TRANSFER_STARTED without setting
DWC3_EP_END_TRANSFER_PENDING. The command is still outstanding, but a
later stop issues another End Transfer with resource index 0, and the
next Start Transfer fails with "No Resource".
Mark the timed out End Transfer as pending so that no other command is
issued to the endpoint until it completes. For any other failure, there
is no outstanding command, so clear DWC3_EP_TRANSFER_STARTED.
Fixes: e192cc7b5239 ("usb: dwc3: gadget: move cmd_endtransfer to extra function")
Cc: stable <stable@kernel.org>
Reported-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Closes: https://lore.kernel.org/linux-usb/3fdda532-8181-48e9-b58d-cad7289408e7@samsung.com/
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/5815c41a7e7923edb114741f29697cf0161f523c.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1797,9 +1797,9 @@ static int __dwc3_stop_active_transfer(s
dep->resource_index = 0;
- if (!interrupt)
+ if (!interrupt || (ret && ret != -ETIMEDOUT))
dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
- else if (!ret)
+ else
dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
dep->flags &= ~DWC3_EP_DELAY_STOP;
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0658/1167] usb: dwc3: gadget: Wait for End Transfer completion on ep disable
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (645 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0657/1167] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0659/1167] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
` (10 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit 1338410c21a5710b7ba88057034d35367ba0f054 upstream.
The End Transfer command on ep disable is issued without interrupt, and
the endpoint flags are cleared right after a fixed delay. The command
may not have completed by then. If the function driver re-enables the
endpoint and queues a request, the next Start Transfer fails with "No
Resource".
Issue the End Transfer command with interrupt on ep disable, and keep
DWC3_EP_END_TRANSFER_PENDING and DWC3_EP_TRANSFER_STARTED until the
command completes. Defer the no-op Start Transfer of a stream endpoint
re-enabled in the meantime to the command completion.
Fixes: c5353b225df9 ("usb: dwc3: gadget: don't enable interrupt when disabling endpoint")
Cc: stable <stable@kernel.org>
Reported-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Closes: https://lore.kernel.org/linux-usb/20260227121236.963-1-selvarasu.g@samsung.com/
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/24fa8adeb0222dab415c8c2799405188440bad4b.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/core.h | 4 +++-
drivers/usb/dwc3/ep0.c | 2 +-
drivers/usb/dwc3/gadget.c | 42 +++++++++++++++++++++++++++++++++++-------
3 files changed, 39 insertions(+), 9 deletions(-)
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -755,6 +755,7 @@ struct dwc3_ep {
#define DWC3_EP_TXFIFO_RESIZED BIT(12)
#define DWC3_EP_DELAY_STOP BIT(13)
#define DWC3_EP_RESOURCE_ALLOCATED BIT(14)
+#define DWC3_EP_PENDING_NOOP_START BIT(15)
/* This last one is specific to EP0 */
#define DWC3_EP0_DIR_IN BIT(31)
@@ -1627,7 +1628,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_
int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned int cmd,
u32 param);
void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc);
-void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status);
+void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status,
+ bool interrupt);
#else
static inline int dwc3_gadget_init(struct dwc3 *dwc)
{ return 0; }
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -315,7 +315,7 @@ void dwc3_ep0_out_start(struct dwc3 *dwc
if (dwc->connected)
dwc3_stop_active_transfer(dwc3_ep, false, true);
else
- dwc3_remove_requests(dwc, dwc3_ep, -ESHUTDOWN);
+ dwc3_remove_requests(dwc, dwc3_ep, -ESHUTDOWN, false);
}
}
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1009,9 +1009,14 @@ static int __dwc3_gadget_ep_enable(struc
* Response Update Transfer command.
*/
if (dep->stream_capable) {
- ret = dwc3_gadget_ep_start_noop_transfer(dep);
- if (ret < 0)
- return ret;
+ if (dep->flags & (DWC3_EP_END_TRANSFER_PENDING |
+ DWC3_EP_DELAY_STOP)) {
+ dep->flags |= DWC3_EP_PENDING_NOOP_START;
+ } else {
+ ret = dwc3_gadget_ep_start_noop_transfer(dep);
+ if (ret < 0)
+ return ret;
+ }
}
out:
@@ -1020,16 +1025,21 @@ out:
return 0;
}
-void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status)
+void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status,
+ bool interrupt)
{
struct dwc3_request *req;
- dwc3_stop_active_transfer(dep, false, false);
+ dwc3_stop_active_transfer(dep, false, interrupt);
/* If endxfer is delayed, avoid unmapping requests */
if (dep->flags & DWC3_EP_DELAY_STOP)
return;
+ /* Give the controller time to stop accessing the request buffers */
+ if (dep->flags & DWC3_EP_END_TRANSFER_PENDING)
+ mdelay(1);
+
/* - giveback all requests to gadget driver */
while (!list_empty(&dep->started_list)) {
req = next_request(&dep->started_list);
@@ -1078,7 +1088,7 @@ static int __dwc3_gadget_ep_disable(stru
dep->flags &= ~DWC3_EP_ENABLED;
- dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
+ dwc3_remove_requests(dwc, dep, -ESHUTDOWN, true);
dep->stream_capable = false;
dep->type = 0;
@@ -1090,6 +1100,15 @@ static int __dwc3_gadget_ep_disable(stru
*/
if (dep->flags & DWC3_EP_DELAY_STOP)
mask |= (DWC3_EP_DELAY_STOP | DWC3_EP_TRANSFER_STARTED);
+
+ /*
+ * The End Transfer command is still in progress. Do not clear the
+ * flags, so that the ep is only rearmed once the command completes.
+ */
+ if (dep->flags & DWC3_EP_END_TRANSFER_PENDING)
+ mask |= (DWC3_EP_END_TRANSFER_PENDING |
+ DWC3_EP_TRANSFER_STARTED);
+
dep->flags &= mask;
/* Clear out the ep descriptors for non-ep0 */
@@ -2575,7 +2594,7 @@ static void dwc3_stop_active_transfers(s
if (!dep)
continue;
- dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
+ dwc3_remove_requests(dwc, dep, -ESHUTDOWN, false);
}
}
@@ -3906,7 +3925,16 @@ static void dwc3_gadget_endpoint_command
dwc3_ep0_send_delayed_status(dwc);
}
+ if (dep->flags & DWC3_EP_PENDING_NOOP_START) {
+ dep->flags &= ~DWC3_EP_PENDING_NOOP_START;
+
+ if (!(dep->flags & DWC3_EP_DELAY_START) &&
+ (dep->flags & DWC3_EP_ENABLED))
+ dwc3_gadget_ep_start_noop_transfer(dep);
+ }
+
if ((dep->flags & DWC3_EP_DELAY_START) &&
+ (dep->flags & DWC3_EP_ENABLED) &&
!usb_endpoint_xfer_isoc(dep->endpoint.desc))
__dwc3_gadget_kick_transfer(dep);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0659/1167] usb: dwc3: xilinx: fix system suspend and resume PHY handling
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (646 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0658/1167] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0660/1167] w1: dont hold list_mutex while a slave is torn down Greg Kroah-Hartman
` (9 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Radhey Shyam Pandey,
Thinh Nguyen
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
commit 2fad8d241a6833d0c7aeafa0ab596e83c7b4ec9c upstream.
System suspend and resume error paths do not handle PHY and clock
resources correctly. Suspend calls phy_exit() without first powering
off the PHY and ignores failures, while resume can leave clocks
enabled if PHY reinitialization fails.
Propagate errors to the PM core and unwind resources to ensure a
consistent state on suspend and resume failures.
Fixes: d6edcdc1ef06 ("usb: dwc3: xilinx: fix usb3 non-wakeup source resume failure")
Cc: stable <stable@kernel.org>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260928120015.3152461-2-radhey.shyam.pandey@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/dwc3-xilinx.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -350,13 +350,26 @@ static int __maybe_unused dwc3_xlnx_runt
static int __maybe_unused dwc3_xlnx_suspend(struct device *dev)
{
struct dwc3_xlnx *priv_data = dev_get_drvdata(dev);
+ int ret;
+
+ ret = phy_power_off(priv_data->usb3_phy);
+ if (ret < 0)
+ return ret;
- phy_exit(priv_data->usb3_phy);
+ ret = phy_exit(priv_data->usb3_phy);
+ if (ret < 0)
+ goto err_phy_power_on;
/* Disable the clocks */
clk_bulk_disable(priv_data->num_clocks, priv_data->clks);
return 0;
+
+err_phy_power_on:
+ if (phy_power_on(priv_data->usb3_phy))
+ dev_err(dev, "failed to restore PHY power after suspend error\n");
+
+ return ret;
}
static int __maybe_unused dwc3_xlnx_resume(struct device *dev)
@@ -370,15 +383,20 @@ static int __maybe_unused dwc3_xlnx_resu
ret = phy_init(priv_data->usb3_phy);
if (ret < 0)
- return ret;
+ goto err_clk_disable;
ret = phy_power_on(priv_data->usb3_phy);
if (ret < 0) {
phy_exit(priv_data->usb3_phy);
- return ret;
+ goto err_clk_disable;
}
return 0;
+
+err_clk_disable:
+ clk_bulk_disable(priv_data->num_clocks, priv_data->clks);
+
+ return ret;
}
static const struct dev_pm_ops dwc3_xlnx_dev_pm_ops = {
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0660/1167] w1: dont hold list_mutex while a slave is torn down
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (647 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0659/1167] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0661/1167] w1: ds2482: set the strong pull-up with its byte Greg Kroah-Hartman
` (8 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 7ef382cb0ae0b2d6df4fbc5c822cd80394308839 upstream.
When the last reference to a slave is dropped, w1_unref_slave() holds
list_mutex of the master until the slave has been freed. In between it
calls the ->remove_slave() callback of the family driver and
device_unregister(). Both wait for others: for the sysfs callbacks
which are running, and in the case of w1_therm also for the file
therm_bulk_read of the master and for everybody who is talking to the
sensor. None of those can therefore take list_mutex, although the
callbacks of therm_bulk_read walk the list which it protects.
The mutex is only needed to make the decrement of the reference count and
the removal from the list one step for w1_search_slave() and
w1_slave_search_device(), which look the slave up in the list and, in the
first case, take a reference. Once the slave is off the list, nobody can
find it any more. Drop the mutex at that point.
The callers which hold the mutex of the master, which serialises
attaching and detaching, are not affected. The one which does not is
w1_process_cb(), when it drops the last reference to a slave which has
been detached while a netlink command for it was queued. Somebody who
attaches a slave with the same ID through sysfs or netlink at that very
moment used to wait until the old device was gone. Now the registration
of the new device may fail because the name is still in use.
This is a preparation for "w1: w1_therm: lock the list of slaves for the
bulk read".
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-7-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/w1.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -776,16 +776,24 @@ int w1_unref_slave(struct w1_slave *sl)
{
struct w1_master *dev = sl->master;
int refcnt;
+
+ /*
+ * Once it is off the list nobody can find the slave and take a new
+ * reference. The lock must not be held any longer than that: the rest
+ * waits for sysfs callbacks and for users of the family data.
+ */
mutex_lock(&dev->list_mutex);
refcnt = atomic_sub_return(1, &sl->refcnt);
+ if (refcnt == 0)
+ list_del(&sl->w1_slave_entry);
+ mutex_unlock(&dev->list_mutex);
+
if (refcnt == 0) {
struct w1_netlink_msg msg;
dev_dbg(&sl->dev, "%s: detaching %s [%p].\n", __func__,
sl->name, sl);
- list_del(&sl->w1_slave_entry);
-
memset(&msg, 0, sizeof(msg));
memcpy(msg.id.id, &sl->reg_num, sizeof(msg.id));
msg.type = W1_SLAVE_REMOVE;
@@ -799,7 +807,6 @@ int w1_unref_slave(struct w1_slave *sl)
kfree(sl);
}
atomic_dec(&dev->refcnt);
- mutex_unlock(&dev->list_mutex);
return refcnt;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0661/1167] w1: ds2482: set the strong pull-up with its byte
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (648 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0660/1167] w1: dont hold list_mutex while a slave is torn down Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0662/1167] w1: ds2805: use the bus mutex to talk on the bus Greg Kroah-Hartman
` (7 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit e4f673632fa8292a2922bcfbb39519b08016b382 upstream.
The eight channels of a DS2482-800 are eight independent 1-wire masters
for the w1 core, but share one I2C device. Each bus operation consists of
several I2C transfers: select the channel, send the command, poll the
status, set the read pointer, read the result. access_lock keeps the
operations of the channels apart.
ds2482_w1_set_pullup() polls the status, writes the configuration and
polls again without the lock. Polling sets the read pointer of the device
to the status register. In the middle of a read on another channel, after
that one has set the pointer to the data register, this makes the read
return the status instead of the data. The cached copy of the pointer in
pdev->read_prt can go wrong as well.
The lock alone is not enough. The strong pull-up is a setting of the
whole chip which is used up by the next byte. If an operation of another
channel gets in before the byte it was meant for, that channel gets the
pull-up, and the sensor converts without power.
So only note the request in ds2482_w1_set_pullup(), and write the
configuration in ds2482_w1_write_byte(), under the lock and after the
channel has been selected. The w1 core calls the former right before the
latter, under the bus mutex of the channel.
Fixes: 9c95bb6f25ff ("w1: ds2482: Added 1-Wire pull-up support to the driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-3-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/masters/ds2482.c | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -102,6 +102,7 @@ struct ds2482_data;
struct ds2482_w1_chan {
struct ds2482_data *pdev;
u8 channel;
+ bool spu; /* strong pullup after the next byte */
struct w1_bus_master w1_bm;
};
@@ -335,6 +336,19 @@ static void ds2482_w1_write_byte(void *d
if (pdev->w1_count > 1)
ds2482_set_channel(pdev, pchan->channel);
+ if (pchan->spu) {
+ pchan->spu = false;
+ /* the wait above and this one are crucial, otherwise devices
+ * might not be powered long enough, causing e.g. a w1_therm
+ * sensor to provide wrong conversion results
+ */
+ /* note: it seems like both SPU and APU have to be set! */
+ ds2482_send_cmd_data(pdev, DS2482_CMD_WRITE_CONFIG,
+ ds2482_calculate_config(DS2482_REG_CFG_SPU |
+ DS2482_REG_CFG_APU));
+ ds2482_wait_1wire_idle(pdev);
+ }
+
/* Send the write byte command */
ds2482_send_cmd_data(pdev, DS2482_CMD_1WIRE_WRITE_BYTE, byte);
@@ -419,27 +433,19 @@ static u8 ds2482_w1_reset_bus(void *data
static u8 ds2482_w1_set_pullup(void *data, int delay)
{
struct ds2482_w1_chan *pchan = data;
- struct ds2482_data *pdev = pchan->pdev;
- u8 retval = 1;
/* if delay is non-zero activate the pullup,
* the strong pullup will be automatically deactivated
* by the master, so do not explicitly deactive it
+ *
+ * The setting is used up by the next byte on any channel of the chip:
+ * ds2482_w1_write_byte() makes it, in one go with the byte.
*/
- if (delay) {
- /* both waits are crucial, otherwise devices might not be
- * powered long enough, causing e.g. a w1_therm sensor to
- * provide wrong conversion results
- */
- ds2482_wait_1wire_idle(pdev);
- /* note: it seems like both SPU and APU have to be set! */
- retval = ds2482_send_cmd_data(pdev, DS2482_CMD_WRITE_CONFIG,
- ds2482_calculate_config(DS2482_REG_CFG_SPU |
- DS2482_REG_CFG_APU));
- ds2482_wait_1wire_idle(pdev);
- }
+ if (!delay)
+ return 1;
- return retval;
+ pchan->spu = true;
+ return 0;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0662/1167] w1: ds2805: use the bus mutex to talk on the bus
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (649 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0661/1167] w1: ds2482: set the strong pull-up with its byte Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0663/1167] w1: ds28e04: " Greg Kroah-Hartman
` (6 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit a2e52ccce044e13d2695bb1bbdc07942727f28dd upstream.
Since commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.")
the slave drivers serialise their accesses to the bus with bus_mutex.
This driver takes the mutex of the master in the callbacks of its eeprom
file instead.
That mutex is held while a slave which has disappeared from the bus is
removed, which waits for the sysfs callbacks of the slave to return. A
callback which is waiting for the mutex at that moment never does: both
tasks are stuck, and with them the thread of the bus master.
Besides, it does not keep the other slave drivers off the bus, so that two
transactions can get mixed up on the wire.
Fixes: f6887531c0c6 ("drivers: w1: Add 1w slave driver for DS28E05 EEPROM")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-5-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/slaves/w1_ds2805.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/w1/slaves/w1_ds2805.c
+++ b/drivers/w1/slaves/w1_ds2805.c
@@ -102,7 +102,7 @@ static ssize_t w1_f0d_read_bin(struct fi
if (count == 0)
return 0;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
/* read directly from the EEPROM in chunks of W1_F0D_READ_MAXLEN */
while (todo > 0) {
@@ -123,7 +123,7 @@ static ssize_t w1_f0d_read_bin(struct fi
off += W1_F0D_READ_MAXLEN;
}
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
@@ -211,7 +211,7 @@ static ssize_t w1_f0d_write_bin(struct f
if (count == 0)
return 0;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
/* Can only write data in blocks of the size of the scratchpad */
addr = off;
@@ -256,7 +256,7 @@ static ssize_t w1_f0d_write_bin(struct f
}
out_up:
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0663/1167] w1: ds28e04: use the bus mutex to talk on the bus
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (650 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0662/1167] w1: ds2805: use the bus mutex to talk on the bus Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0664/1167] w1: netlink: drop the slave after the bus is unlocked Greg Kroah-Hartman
` (5 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 5bc51235d0ad4a4991e38f4e9dc3440738296850 upstream.
Since commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.")
the slave drivers serialise their accesses to the bus with bus_mutex.
This driver, which was merged shortly afterwards, takes the mutex of the
master in the callbacks of its eeprom and pio files instead.
That mutex is held while a slave which has disappeared from the bus is
removed, which waits for the sysfs callbacks of the slave to return. A
callback which is waiting for the mutex at that moment never does: both
tasks are stuck, and with them the thread of the bus master.
Besides, it does not keep the other slave drivers off the bus, so that two
transactions can get mixed up on the wire.
Fixes: fbf7f7b4e2ae ("w1: Add 1-wire slave device driver for DS28E04-100")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-4-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/slaves/w1_ds28e04.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
--- a/drivers/w1/slaves/w1_ds28e04.c
+++ b/drivers/w1/slaves/w1_ds28e04.c
@@ -123,7 +123,7 @@ static ssize_t eeprom_read(struct file *
if (count == 0)
return 0;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
if (w1_enable_crccheck) {
min_page = (off >> W1_PAGE_BITS);
@@ -140,7 +140,7 @@ static ssize_t eeprom_read(struct file *
}
out_up:
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
@@ -253,7 +253,7 @@ static ssize_t eeprom_write(struct file
}
}
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
/* Can only write data to one page at a time */
idx = 0;
@@ -271,7 +271,7 @@ static ssize_t eeprom_write(struct file
}
out_up:
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
@@ -290,9 +290,9 @@ static ssize_t pio_read(struct file *fil
if (off != 0 || count != 1 || buf == NULL)
return -EINVAL;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
ret = w1_f1C_read(sl, W1_1C_REG_LOGIC_STATE, count, buf);
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return ret;
}
@@ -310,11 +310,11 @@ static ssize_t pio_write(struct file *fi
if (off != 0 || count != 1 || buf == NULL)
return -EINVAL;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
/* Write the PIO data */
if (w1_reset_select_slave(sl)) {
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return -1;
}
@@ -328,7 +328,7 @@ static ssize_t pio_write(struct file *fi
w1_read_block(sl->master, &ack, sizeof(ack));
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
/* check for acknowledgement */
if (ack != 0xAA)
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0664/1167] w1: netlink: drop the slave after the bus is unlocked
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (651 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0663/1167] w1: ds28e04: " Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0665/1167] w1: remove the masters files before taking its locks Greg Kroah-Hartman
` (4 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 847fa880a3e1b2fdbbf72d89e830566108457637 upstream.
w1_process_cb() executes the commands of a netlink message with bus_mutex
held, and drops the reference to the slave which the message was
addressed to before it unlocks the mutex. If the slave has been detached
in the meantime, this is the last reference, and w1_unref_slave() tears
the slave down on the spot. That waits
- in device_unregister(), for the sysfs callbacks of the slave which are
running, and
- in w1_therm_remove_slave(), for the readers which have taken a
reference to the family data,
and both kinds take bus_mutex to talk to the slave. Whoever is waiting
for the mutex at that moment is never going to finish, and neither is the
thread of the bus master.
Unlock the bus first. The reference keeps the slave, and with it the
master, alive until then.
Fixes: d3a8a9dbb903 ("w1: hold bus_mutex in netlink and search")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-6-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/w1_netlink.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -480,15 +480,17 @@ static void w1_process_cb(struct w1_mast
if (!cmd || err)
w1_netlink_queue_status(node->block, node->msg, cmd, err);
+ dev->priv = NULL;
+ mutex_unlock(&dev->bus_mutex);
+
/* ref taken in w1_search_slave or w1_search_master_id when building
- * the block
+ * the block. If it is the last one, the slave is removed, which waits
+ * for users of the bus.
*/
if (sl)
w1_unref_slave(sl);
else
atomic_dec(&dev->refcnt);
- dev->priv = NULL;
- mutex_unlock(&dev->bus_mutex);
mutex_lock(&dev->list_mutex);
list_del(&async_cmd->async_entry);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0665/1167] w1: remove the masters files before taking its locks
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (652 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0664/1167] w1: netlink: drop the slave after the bus is unlocked Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0666/1167] w1: use the bus mutex for the "rw" file Greg Kroah-Hartman
` (3 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit dfc57752ec53c3cc6105656d3037fb2f5e80e9cc upstream.
__w1_remove_master_device() calls w1_destroy_master_attributes() with
both the mutex of the master and list_mutex held. Removing the files
waits for the callbacks which are running, and nearly all of them take
one of these two locks:
__w1_remove_master_device() read() of .../w1_master_slaves
mutex_lock(&dev->mutex) kernfs active reference
mutex_lock(&dev->list_mutex) w1_master_attribute_show_slaves()
w1_destroy_master_attributes() mutex_lock(&md->list_mutex)
sysfs_remove_group() waits
waits for the reference
The files are readable for everybody, and a bus master goes away when, for
instance, a DS2490 USB adapter is unplugged.
Remove the files first, before the locks are taken. That has to be done
before the slaves are detached and not afterwards: as long as the files
exist, a write to w1_master_add could attach a new slave behind the back
of this function, which would then wait for the reference count of the
master for ever. And it is done before the thread is stopped, because a
write to w1_master_search wakes the thread up.
Fixes: c30c9b15187e ("W1: fix deadlocks and remove w1_control_thread")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-2-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/w1_int.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -180,6 +180,13 @@ void __w1_remove_master_device(struct w1
mutex_unlock(&w1_mlock);
set_bit(W1_ABORT_SEARCH, &dev->flags);
+
+ /*
+ * This waits for the callbacks, which take the locks below. One of
+ * them wakes the thread up.
+ */
+ w1_destroy_master_attributes(dev);
+
kthread_stop(dev->thread);
mutex_lock(&dev->mutex);
@@ -189,7 +196,6 @@ void __w1_remove_master_device(struct w1
w1_slave_detach(sl);
mutex_lock(&dev->list_mutex);
}
- w1_destroy_master_attributes(dev);
mutex_unlock(&dev->list_mutex);
mutex_unlock(&dev->mutex);
atomic_dec(&dev->refcnt);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0666/1167] w1: use the bus mutex for the "rw" file
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (653 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0665/1167] w1: remove the masters files before taking its locks Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0667/1167] w1: w1_therm: leave the slaves of other families alone Greg Kroah-Hartman
` (2 subsequent siblings)
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 8599e08648c0b4913ea7b202511f1294d176e793 upstream.
Commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.") gave
the bus a mutex of its own, because the lock which protects the list of
slaves is held while a slave is removed, which waits for the sysfs
callbacks of the slave, so these must not take it. It converted all the
slave drivers, but not the "rw" file of the default family in w1.c,
which still takes the mutex of the master to talk on the bus. That has
two consequences:
- A deadlock. w1_process() holds the mutex of the master while it
searches the bus and detaches the slaves which have gone:
w1_process() read() of .../rw
mutex_lock(&dev->mutex) kernfs active reference
w1_search_process() rw_read()
w1_slave_detach() mutex_lock(&master->mutex)
w1_unref_slave() waits
device_unregister()
waits for the reference
The file is readable for everybody.
- The accesses through this file are not serialised with those of the
slave drivers, which take bus_mutex, so that two transactions can get
mixed up on the wire.
Take bus_mutex here as well. It also excludes the search, which takes it
for every pass.
Fixes: b02f8bede217 ("W1: split master mutex to avoid deadlocks.")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-1-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/w1.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -116,7 +116,7 @@ static ssize_t rw_write(struct file *fil
{
struct w1_slave *sl = kobj_to_w1_slave(kobj);
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
if (w1_reset_select_slave(sl)) {
count = 0;
goto out_up;
@@ -125,7 +125,7 @@ static ssize_t rw_write(struct file *fil
w1_write_block(sl->master, buf, count);
out_up:
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
@@ -135,9 +135,9 @@ static ssize_t rw_read(struct file *filp
{
struct w1_slave *sl = kobj_to_w1_slave(kobj);
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
w1_read_block(sl->master, buf, count);
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0667/1167] w1: w1_therm: leave the slaves of other families alone
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (654 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0666/1167] w1: use the bus mutex for the "rw" file Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0668/1167] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0669/1167] USB: serial: garmin_gps: validate packet data length in nat_receive() Greg Kroah-Hartman
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit c0eadd2e06e52563cae2b80491e56eb9712eb727 upstream.
The file therm_bulk_read belongs to the bus master. Its callbacks walk
all the slaves of the bus and look at sl->family_data as if every slave
were a temperature sensor. A 1-wire bus can carry other devices too:
- The family data of a slave which is driven by another driver, such as
w1_ds2433, w1_ds250x, w1_ds28e04 or w1_ds28e17, is a structure of that
driver. bulk_read_support() takes whatever is at the offset of
specific_functions for a pointer and dereferences it, and if the
result happens not to be 0, the callbacks write the state of the
conversion into that foreign structure.
- For a slave without family data, which is the case for most of the
other drivers and for the default family, trigger_bulk_read() gives up
with -ENODEV. A single serial number chip on the bus is enough to
make the bulk read unusable for all the sensors.
Only look at the slaves whose family is one of ours. A bulk conversion
now works on a bus with other devices.
Fixes: 57c76221d5af ("w1_therm: adding bulk read support to trigger multiple conversion on bus")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-9-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/slaves/w1_therm.c | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -917,6 +917,19 @@ static inline bool bulk_read_support(str
}
/**
+ * bulk_read_slave() - check if a slave of the bus takes part in a bulk read
+ * @sl: any slave on the list of the master
+ *
+ * The family data of the slaves of other families is none of our business.
+ *
+ * Return: true if it is one of our devices and supports bulk read
+ */
+static bool bulk_read_slave(struct w1_slave *sl)
+{
+ return device_family(sl) && sl->family_data && bulk_read_support(sl);
+}
+
+/**
* conversion_time() - get the Tconv for the slave
* @sl: device to get the conversion time
*
@@ -1507,9 +1520,7 @@ static int trigger_bulk_read(struct w1_m
* so we can apply a strong pullup if required
*/
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
- if (!sl->family_data)
- goto error;
- if (bulk_read_support(sl)) {
+ if (bulk_read_slave(sl)) {
int t_cur = conversion_time(sl);
t_conv = max(t_cur, t_conv);
@@ -1547,7 +1558,7 @@ static int trigger_bulk_read(struct w1_m
/* set a flag to instruct that converT pending */
list_for_each_entry(sl,
&dev_master->slist, w1_slave_entry) {
- if (bulk_read_support(sl))
+ if (bulk_read_slave(sl))
SLAVE_CONVERT_TRIGGERED(sl) = -1;
}
@@ -1576,7 +1587,7 @@ mt_unlock:
set_flag:
/* set a flag to register convsersion is done */
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
- if (bulk_read_support(sl))
+ if (bulk_read_slave(sl))
SLAVE_CONVERT_TRIGGERED(sl) = 1;
}
error:
@@ -1944,16 +1955,14 @@ static ssize_t therm_bulk_read_show(stru
int ret = 0;
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
- if (sl->family_data) {
- if (bulk_read_support(sl)) {
- if (SLAVE_CONVERT_TRIGGERED(sl) == -1) {
- ret = -1;
- goto show_result;
- }
- if (SLAVE_CONVERT_TRIGGERED(sl) == 1)
- /* continue to check other slaves */
- ret = 1;
+ if (bulk_read_slave(sl)) {
+ if (SLAVE_CONVERT_TRIGGERED(sl) == -1) {
+ ret = -1;
+ goto show_result;
}
+ if (SLAVE_CONVERT_TRIGGERED(sl) == 1)
+ /* continue to check other slaves */
+ ret = 1;
}
}
show_result:
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0668/1167] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (655 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0667/1167] w1: w1_therm: leave the slaves of other families alone Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0669/1167] USB: serial: garmin_gps: validate packet data length in nat_receive() Greg Kroah-Hartman
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian König, Jesse Zhang,
Alex Deucher
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
commit de0f2a6eabd019a3129025862bffca934a5d7180 upstream.
When initializing the immediate entity fails, amdgpu_vm_init_entities()
destroys that entity which was never set up, and when initializing the
delayed entity fails, it returns without destroying the immediate one.
On navi48, with the allocation of the immediate entity's scheduler list
failing through failslab while opening the render node:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
RIP: 0010:do_raw_spin_lock+0x7b/0x280
_raw_spin_lock+0x3c/0x50
drm_sched_rq_remove_entity+0x90/0x2a0 [gpu_sched]
drm_sched_entity_kill+0x86/0x5a0 [gpu_sched]
drm_sched_entity_fini+0x23/0x270 [gpu_sched]
drm_sched_entity_destroy+0x24/0x30 [gpu_sched]
amdgpu_vm_init_entities+0xc7/0x100 [amdgpu]
amdgpu_vm_init+0x5d1/0x1480 [amdgpu]
amdgpu_driver_open_kms+0x2b1/0xd10 [amdgpu]
Only destroy the immediate entity once it exists and the delayed one
failed.
Fixes: 55bf196f60df ("drm/amdgpu: reset VM when an error is detected")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2f538f57501a71baeb7116ff7485f9a7025e4fb9)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -384,11 +384,15 @@ static int amdgpu_vm_init_entities(struc
adev->vm_manager.vm_pte_scheds,
adev->vm_manager.vm_pte_num_scheds, NULL);
if (r)
+ return r;
+
+ r = drm_sched_entity_init(&vm->delayed, DRM_SCHED_PRIORITY_NORMAL,
+ adev->vm_manager.vm_pte_scheds,
+ adev->vm_manager.vm_pte_num_scheds, NULL);
+ if (r)
goto error;
- return drm_sched_entity_init(&vm->delayed, DRM_SCHED_PRIORITY_NORMAL,
- adev->vm_manager.vm_pte_scheds,
- adev->vm_manager.vm_pte_num_scheds, NULL);
+ return 0;
error:
drm_sched_entity_destroy(&vm->immediate);
^ permalink raw reply [flat|nested] 659+ messages in thread
* [PATCH 6.6 0669/1167] USB: serial: garmin_gps: validate packet data length in nat_receive()
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
` (656 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.6 0668/1167] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
657 siblings, 0 replies; 659+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hui Peng, Johan Hovold
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Peng <benquike@gmail.com>
commit ca783a2d55b3361493917ad4a3573715ba902503 upstream.
In nat_receive() (called from garmin_write() when userspace writes to
/dev/ttyUSBn in MODE_NATIVE mode), while garmin_data_p->insize is less
than GARMIN_PKTHDR_LENGTH (12), the loop copies up to 12 bytes into
garmin_data_p->inbuffer. Once garmin_data_p->insize reaches
GARMIN_PKTHDR_LENGTH, nat_receive() computes the total packet size as:
len = GARMIN_PKTHDR_LENGTH + getDataLength(garmin_data_p->inbuffer);
Because getDataLength() returns a signed int from __le32_to_cpup(), a
12-byte header with a negative 32-bit length field (such as 0xfffffff5,
i.e., -11) causes len to underflow to a small positive value (12 + (-11)
= 1) without any bounds check at that point. Then garmin_data_p->insize
>= len (12 >= 1) evaluates to true and nat_receive() calls
garmin_write_bulk(port, inbuffer, 1, 0), which allocates a 1-byte slab
buffer via kmemdup() and immediately reads 4 bytes from it in
getLayerId(buffer) (and again in garmin_write_bulk_callback() when the
URB completes):
BUG: KASAN: slab-out-of-bounds in garmin_write_bulk.constprop.0+0x3eb/0x500
Read of size 4 at addr ffff888002cc0ba0 by task init/1
Call Trace:
<TASK>
dump_stack_lvl+0x70/0xa0
print_report+0x153/0x4c6
kasan_report+0xf1/0x120
garmin_write_bulk.constprop.0+0x3eb/0x500
garmin_write+0x60f/0x1450
serial_write+0x123/0x200
n_tty_write+0x8ea/0xeb0
file_tty_write.isra.0+0x44f/0x7a0
vfs_write+0x671/0xd20
Validate the unsigned 32-bit data length (dlen >= GPS_IN_BUFSIZ -
GARMIN_PKTHDR_LENGTH, matching the existing len >= GPS_IN_BUFSIZ bound)
in nat_receive() as soon as the 12-byte header is present, resetting
insize and returning -EINVPKT on invalid lengths so garmin_write_bulk()
is only ever called with a full valid packet header (12 <= len <
GPS_IN_BUFSIZ).
Tested in QEMU against Linux 7.3.0-rc3 by emulating a Garmin USB GPS
device (091e:0003) via dummy_hcd + raw-gadget, switching /dev/ttyUSB0
to MODE_NATIVE via PRIV_PKTID_SET_MODE, and writing a 12-byte native
packet with data length 0xfffffff5: on the unfixed kernel this triggers
KASAN slab-out-of-bounds reads in garmin_write_bulk() and
garmin_write_bulk_callback(), whereas on the fixed kernel nat_receive()
rejects the packet with -EINVPKT and 0 KASAN faults.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Hui Peng <benquike@gmail.com>
[ johan: move comment and dev_dbg(); add comment about redundant check ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/garmin_gps.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -750,11 +750,7 @@ static int nat_receive(struct garmin_dat
len = GARMIN_PKTHDR_LENGTH;
if (len >= GPS_IN_BUFSIZ) {
- /* seems to be an invalid packet, ignore rest
- of input */
- dev_dbg(&garmin_data_p->port->dev,
- "%s - packet size too large: %d\n",
- __func__, len);
+ /* should never end up here given the dlen check below */
garmin_data_p->insize = 0;
count = 0;
result = -EINVPKT;
@@ -773,8 +769,17 @@ static int nat_receive(struct garmin_dat
/* do we have a complete packet ? */
if (garmin_data_p->insize >= GARMIN_PKTHDR_LENGTH) {
- len = GARMIN_PKTHDR_LENGTH+
- getDataLength(garmin_data_p->inbuffer);
+ u32 dlen = getDataLength(garmin_data_p->inbuffer);
+
+ if (dlen >= GPS_IN_BUFSIZ - GARMIN_PKTHDR_LENGTH) {
+ /* invalid packet, ignore rest of input */
+ dev_dbg(&garmin_data_p->port->dev, "%s - invalid length: %u\n",
+ __func__, dlen);
+ garmin_data_p->insize = 0;
+ result = -EINVPKT;
+ break;
+ }
+ len = GARMIN_PKTHDR_LENGTH + dlen;
if (garmin_data_p->insize >= len) {
garmin_write_bulk(garmin_data_p->port,
garmin_data_p->inbuffer,
^ permalink raw reply [flat|nested] 659+ messages in thread
end of thread, other threads:[~2026-12-04 12:02 UTC | newest]
Thread overview: 659+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0001/1167] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0002/1167] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0003/1167] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0004/1167] drm/amdgpu: Check cs flags Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0005/1167] bpf: Fix memory access flags in helper prototypes Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0006/1167] bpf: Drop inet_conn_established from lsm sleepable hooks Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0007/1167] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0008/1167] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0009/1167] bpf: Fix verifier assumptions of bpf_d_paths output buffer Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0010/1167] bpf: Specify access type of bpf_sysctl_get_name args Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0011/1167] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0012/1167] virtio_net: check RX buffer length before DMA sync Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0013/1167] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0014/1167] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0015/1167] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0016/1167] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0017/1167] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0018/1167] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0019/1167] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0020/1167] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0021/1167] io_uring: cleanup handle_tw_list() calling convention Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0022/1167] io_uring: pass in counter to handle_tw_list() rather than return it Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0023/1167] io_uring/sqpoll: manage task_work privately Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0024/1167] io_uring: wake SQPOLL task when task_work is added to an empty queue Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0025/1167] io_uring/sqpoll: use the correct check for pending task_work Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0026/1167] io_uring/sqpoll: early exit thread if task_context wasnt allocated Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0027/1167] io_uring/sqpoll: ensure that normal task_work is also run timely Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0028/1167] io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0029/1167] io_uring/sqpoll: ensure task state is TASK_RUNNING when running task_work Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0030/1167] io_uring: dont touch sqd->thread off tw add Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0031/1167] io_uring/sqpoll: zero sqd->thread on tctx errors Greg Kroah-Hartman
2026-12-04 9:50 ` [PATCH 6.6 0032/1167] io_uring/sqpoll: Increase task_work submission batch size Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0033/1167] io_uring: fix task_work add use-after-free with SQPOLL Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0034/1167] io_uring/sqpoll: do the return-to-userspace work in the SQPOLL thread Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0035/1167] net: sfp: add quirk for Lantech 8330-265D Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0036/1167] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0037/1167] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0038/1167] fs/9p: switch vfsmount to use v9fs_get_new_inode Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0039/1167] fs/9p: rework qid2ino logic Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0040/1167] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0041/1167] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0042/1167] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0043/1167] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0044/1167] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0045/1167] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0046/1167] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0047/1167] 9p: do not store the create fid on special files Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0048/1167] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0049/1167] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0050/1167] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0051/1167] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0052/1167] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0053/1167] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0054/1167] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0055/1167] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0056/1167] net: ethernet: mtk_wed: introduce versioning utility routines Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0057/1167] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0058/1167] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0059/1167] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0060/1167] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0061/1167] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0062/1167] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0063/1167] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0064/1167] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0065/1167] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0066/1167] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0067/1167] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0068/1167] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0069/1167] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0070/1167] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0071/1167] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0072/1167] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0073/1167] ipv4: Unmask upper DSCP bits in input route lookup Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0074/1167] ipv4: Convert ip_route_input_noref() to dscp_t Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0075/1167] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0076/1167] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0077/1167] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0078/1167] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0079/1167] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0080/1167] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0081/1167] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0082/1167] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0083/1167] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0084/1167] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0085/1167] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0086/1167] net: stmmac: Set dma_sync_size to zero for discarded frames Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0087/1167] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0088/1167] net: stmmac: copy XDP metadata in " Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0089/1167] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0090/1167] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0091/1167] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
2026-12-04 9:51 ` [PATCH 6.6 0092/1167] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0093/1167] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0094/1167] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0095/1167] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0096/1167] vhost-scsi: preserve event ordering Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0097/1167] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0098/1167] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0099/1167] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0100/1167] irqbypass: Take ownership of producer/consumer token tracking Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0101/1167] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0102/1167] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0103/1167] regulator: qcom_spmi: Drop unnecessary of_find_property() call Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0104/1167] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0105/1167] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0106/1167] gpio: mpc8xxx: Convert to platform remove callback returning void Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0107/1167] gpio: mpc8xxx: Add wake on GPIO support Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0108/1167] gpio: mpc8xxx: use a helper variable to store the address of pdev->dev Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0109/1167] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0110/1167] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0111/1167] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0112/1167] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0113/1167] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0114/1167] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0115/1167] Bluetooth: btintel: Add support for BlazarI Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0116/1167] Bluetooth: Add vendor-specific packet classification for ISO data Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0117/1167] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0118/1167] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0119/1167] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0120/1167] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0121/1167] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0122/1167] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0123/1167] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0124/1167] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0125/1167] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0126/1167] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0127/1167] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0128/1167] ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0129/1167] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0130/1167] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0131/1167] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0132/1167] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0133/1167] vhost: reject backend enable without a kick file Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0134/1167] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0135/1167] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0136/1167] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0137/1167] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0138/1167] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0139/1167] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0140/1167] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0141/1167] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0142/1167] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0143/1167] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0144/1167] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0145/1167] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0146/1167] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0147/1167] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0148/1167] nvme: fix various comment typos Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0149/1167] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0150/1167] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0151/1167] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
2026-12-04 9:52 ` [PATCH 6.6 0152/1167] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0153/1167] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0154/1167] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0155/1167] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0156/1167] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0157/1167] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0158/1167] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0159/1167] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0160/1167] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0161/1167] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0162/1167] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0163/1167] net: dsa: b53: Force flow control for BCM5301X CPU port(s) Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0164/1167] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0165/1167] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0166/1167] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0167/1167] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0168/1167] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0169/1167] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0170/1167] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0171/1167] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0172/1167] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0173/1167] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0174/1167] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0175/1167] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0176/1167] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0177/1167] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0178/1167] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0179/1167] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0180/1167] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0181/1167] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0182/1167] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0183/1167] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0184/1167] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0185/1167] init: flush async file closing Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0186/1167] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0187/1167] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0188/1167] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0189/1167] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0190/1167] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0191/1167] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0192/1167] locking/osq_lock: Clarify osq_wait_next() calling convention Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0193/1167] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0194/1167] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0195/1167] perf/x86/amd/uncore: Move discovery and registration Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0196/1167] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0197/1167] cpufreq: make cpufreq_boost_enabled() return bool Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0198/1167] cpufreq: staticize cpufreq_boost_trigger_state() Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0199/1167] cpufreq: Force sync policy boost with global boost on sysfs update Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0200/1167] cpufreq: Serialize global boost updates Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0201/1167] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0202/1167] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0203/1167] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0204/1167] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0205/1167] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0206/1167] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0207/1167] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0208/1167] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0209/1167] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0210/1167] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0211/1167] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
2026-12-04 9:53 ` [PATCH 6.6 0212/1167] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0213/1167] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0214/1167] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0215/1167] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0216/1167] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0217/1167] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0218/1167] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0219/1167] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0220/1167] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0221/1167] SUNRPC: preserve transport security " Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0222/1167] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0223/1167] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0224/1167] ublk: Limit dev_id/ub_number values Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0225/1167] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0226/1167] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0227/1167] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0228/1167] ipv6: ignore link state in gateway check Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0229/1167] team: Add matching error label for failed action Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0230/1167] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0231/1167] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0232/1167] net: protect negative destination advice with RCU Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0233/1167] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0234/1167] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0235/1167] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0236/1167] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0237/1167] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0238/1167] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0239/1167] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0240/1167] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0241/1167] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0242/1167] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0243/1167] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0244/1167] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0245/1167] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0246/1167] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0247/1167] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0248/1167] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0249/1167] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0250/1167] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0251/1167] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0252/1167] amt: tear down every amt device on an unregistering lower Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0253/1167] net: ena: Keep the RX buffer mapped if skb allocation fails Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0254/1167] net: ena: avoid RX copybreak for multi-descriptor packets Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0255/1167] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0256/1167] tls: fix async encryption race on weakly ordered architectures Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0257/1167] igmp: use the joined device when leaving a multicast group Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0258/1167] net/mlx5: Lag, Return error when enabling MPESW without LAG support Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0259/1167] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0260/1167] amt: use ipv6_hdr() in amt_mldv1_leave_handler() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0261/1167] net: usb: cdc_ncm: dont underflow the NDP room check Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0262/1167] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0263/1167] net: phy: c45: select BASE-T1 type for the forced speed Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0264/1167] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0265/1167] tracing: skip boot kprobe setup when no events were requested Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0266/1167] docs, kprobes: Fix bracket Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0267/1167] KEYS: do not let an unmatched key decide the search result Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0268/1167] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0269/1167] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0270/1167] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0271/1167] ksmbd: deny access for an empty DACL instead of granting the request Greg Kroah-Hartman
2026-12-04 9:54 ` [PATCH 6.6 0272/1167] media: marvell: mcam: stop DMA and cancel s_bh_work before freeing DMA buffers Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0273/1167] mm: khugepaged: fix folio is used after pte_unmap_unlock() Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0274/1167] smb: client: reclaim credits for decrypted reads with no matching mid Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0275/1167] smb: client: reject short SESSION_SETUP responses Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0276/1167] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data() Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0277/1167] x86/cpuid: Mark CPUID function 0x23 as being indexed Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0278/1167] KVM: VMX: Formally define KVMs "0xdead" exit reason used for failed VM-Enter Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0279/1167] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0280/1167] fs: make sure to call fsnotify_inoderemove() only once when inode is dead Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0281/1167] crypto: omap-des - fix crypto engine cleanup Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0282/1167] mm/page_counter: move calculating protection values to page_counter Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0283/1167] mm/page_counter: avoid integer overflow in effective_protection() Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0284/1167] panic: flatten nmi_panic control flow Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0285/1167] power: supply: Correct multiple typos in comments Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0286/1167] power: supply: qcom_smbx: set the charge enable after software control Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0287/1167] hwmon: (coretemp) Return -ENODATA for invalid temperature readings Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0288/1167] mm/hugetlb: dont clear the resv_map of a VMA whose lock is held Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0289/1167] ALSA: ua101: Bound packet copies by the PCM buffer size Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0290/1167] apparmor: fix profile leak when a policy load fails Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0291/1167] fs: dont fail __d_obtain_alias() for unlinked inodes Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0292/1167] ksmbd: let the owner read and change the DACL when no ACE names it Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0293/1167] xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0294/1167] can: skb: make echo skb freeing safe in any IRQ context Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0295/1167] mm/userfaultfd: wake all waiters on unregister Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0296/1167] khugepaged: fix readahead lock inversion in collapse_file() Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0297/1167] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0298/1167] perf evsel: Restrict incremental open error unwind Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0299/1167] libbpf: Avoid overflow in BTF.ext bounds check Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0300/1167] gpio: pcf857x: implement get_direction() Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0301/1167] perf jitdump: Free event in jit_repipe_code_move() Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0302/1167] cxl/test: Map mock device nodes to an online node Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0303/1167] fuse: dont bump attr_version for async direct read completion Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0304/1167] RDMA/hns: Fix missing CQE when UD QP use different SL Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0305/1167] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0306/1167] wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0307/1167] ACPI: APEI: GHES: Validate memory error section length before payload access Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0308/1167] ASoC: sta32x: make power restoration transactional Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0309/1167] dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0310/1167] dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v " Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0311/1167] wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0312/1167] arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0313/1167] sit: charge ip_tunnel_prl_entry allocations to memcg Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0314/1167] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0315/1167] crypto: mxs-dcp - handle zero-length skcipher requests Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0316/1167] ACPI: glue: Reduce debug noise from acpi_device_notify() Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0317/1167] ACPI: glue: Rework the success message in acpi_device_notify() Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0318/1167] ACPI: glue: Carry out companion lookup under bus_type_sem Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0319/1167] ACPI: glue: Rearrange acpi_bind_one() to avoid breakage Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0320/1167] PM: runtime: Only queue an idle check for RPM-linked suppliers Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0321/1167] libbpf: fix log level propagation for light skeleton loaders Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0322/1167] mtd: spi-nor: spansion: Remove s25fs256s0 Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0323/1167] cxl/hdm: Make switch decoder target parsing endian-safe Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0324/1167] cxl/hdm: Restore commit_end when decoder enumeration fails Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0325/1167] cxl/port: Bound switch decoder target array access by nr_targets Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0326/1167] ASoC: rt1015: make control calibration failures observable Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0328/1167] kernfs: dont repeat or skip an entry when readdir resumes Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0329/1167] cxl/region: Unregister the pmem region when the bridge is unbound Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0330/1167] bpftool: Compute map size of light skeletons at runtime Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0331/1167] i3c: mipi-i3c-hci: Process multiple IBIs per interrupt Greg Kroah-Hartman
2026-12-04 9:55 ` [PATCH 6.6 0332/1167] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked() Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0333/1167] wifi: rtl8xxxu: unwind incomplete receive startup Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0334/1167] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0335/1167] crypto: qat - hold cfg->lock when accessing config sections Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0336/1167] serial: txx9: Drop noop probe function and dangerous remove callback Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0337/1167] serial: sh-sci: Unregister UART on sysfs setup failure Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0338/1167] bpf: Keep target extended until its last freplace link detaches Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0339/1167] bpf: Look at frame 0 when telling async callback entries apart Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0340/1167] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0341/1167] bpf: Dont converge a loop on an iterator that was created anew Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0342/1167] bpf: Fix uninit read for non-fetch atomics on partially spilled slots Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0343/1167] bpf: Fix uninit read for helper mem args " Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0344/1167] sysctl: unregister tables before freeing bitmap Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0345/1167] ACPI: PCC: Free channel on OpRegion deactivation Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0346/1167] x86/fpu: Fix potential underflow in xstate_calculate_size() Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0347/1167] tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0348/1167] netfilter: nfnetlink: Fix for interrupted hook dumps Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0349/1167] RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0350/1167] RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0351/1167] RDMA/mlx5: Set QP event handler before firmware QPC insertion Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0352/1167] perf test code-reading: Fix duplicate kernel maps and machine leak Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0353/1167] perf build: Clean libperf-gtk.so in make clean Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0354/1167] cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0355/1167] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0356/1167] ALSA: usb-audio: Fix UAC2 mixer unit request handling Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0357/1167] s390/ism: Zerorize dmb at allocation Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0358/1167] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0359/1167] mm/memory_hotplug: fix missing rollback in __add_pages() Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0364/1167] scsi: scsi_debug: Report the residual of a write Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0365/1167] scsi: scsi_debug: Do not write a partial physical block to a zoned device Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0366/1167] scsi: scsi_debug: Advance the write pointer over the data written Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0367/1167] iommu/arm-smmu-v3: Dont rb_erase() a never-inserted stream node Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0368/1167] soc: qcom: pmic_glink: Avoid losing early rpmsg probe Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0369/1167] drm/msm/a5xx: dont read the GPMU registers on GPUs without a GPMU Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0370/1167] dlm: validate node weights before building member array Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0371/1167] drm/msm/a6xx: check pm_runtime_resume_and_get during resume Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0372/1167] dmaengine: ste_dma40: Fix cyclic transfer residue Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0373/1167] dmaengine: ste_dma40: Recover coalesced cyclic callbacks Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0374/1167] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0375/1167] proc: report SIGEV_NONE in /proc/pid/timers if target task has died Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0376/1167] wifi: mt76: mt7921: honour FIF_FCSFAIL instead of hardcoding drop_err Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0377/1167] wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown() Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0378/1167] wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0379/1167] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0380/1167] drm/amd/display: copy function name into dcn_fpu trace event Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0381/1167] drm/amd/display: copy function name into dcn_optc_lock_unlock_state " Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0382/1167] fs/ntfs3: check return values in indx_delete_entry() Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0383/1167] net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0384/1167] ALSA: pcmtest: Fix leak at probe error Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0385/1167] ALSA: hda: Use linked list for jack table Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0386/1167] ALSA: hda: Dont free card at probe error in vga_switcheroo handler Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0387/1167] ASoC: mediatek: mt8188: Constrain UL8 FE to its back ends capabilities Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0388/1167] wifi: nl80211: reject zero RNR/MBSSID elements Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0389/1167] wifi: mac80211: limit injected HT/VHT MCSes Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0390/1167] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0391/1167] fs/resctrl: Ensure default group reports tasks on monitor-only systems Greg Kroah-Hartman
2026-12-04 9:56 ` [PATCH 6.6 0392/1167] RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0393/1167] RDMA/core: Clear driver_udata before destroying objects in rdma_core Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0394/1167] dmaengine: ste_dma40: Preserve the LCPA I/O address space Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0395/1167] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0396/1167] mailbox: arm_mhu_db: " Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0397/1167] seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk() Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0398/1167] ALSA: control_led: Fix deadlock between sysfs writes and card disconnect Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0399/1167] drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0400/1167] btrfs: roll back sprout setup after device add failure Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0401/1167] btrfs: fix off-by-one end offset check in report_setget_bounds() Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0402/1167] wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0403/1167] ALSA: hda: intel: Dont free card in the probe work Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0404/1167] platform/x86/amd/pmc: clear devm-managed pointers on remove to prevent stale reuse Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0405/1167] ALSA: pcm: Protect delay DMA sync against concurrent HW_FREE Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0406/1167] fs/ntfs3: do not mark frame pages uptodate on read error Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0407/1167] perf symbol: Fix symbol loading from libbfd Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0408/1167] perf symbol: Add missing symsrc__destroy() for libbfd Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0409/1167] ALSA: pcm: Protect delay DMA sync in forward and rewind, too Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0410/1167] Bluetooth: btmtk: Validate the firmware layout before parsing it Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0411/1167] Bluetooth: hci_sync: fix mesh adv timeout units Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0412/1167] Bluetooth: hci_event: Fix LE link drop on remote features command status Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0413/1167] iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0414/1167] veth: clear rx queue hint in veth_xmit Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0415/1167] rxrpc: Fix aborting in rxperf test server Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0416/1167] rxrpc: Fix sendmsg length Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0417/1167] irqchip/mst-intc: Validate the DT interrupt range Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0418/1167] ASoC: rt5645: Shut down the button timer on removal Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0419/1167] ASoC: rockchip: fix device node reference leak in rk3288_hdmi_analog Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0420/1167] ublk: use global index for reported zones Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0421/1167] tcp: use the echoed source route in cookie_v4_check() Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0422/1167] pinctrl: stm32: Fix the unit of the hwspinlock timeout Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0423/1167] ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912) Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0424/1167] btrfs: drop the extent maps of the written part of a failed ordered extent Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0425/1167] btrfs: update the inode item when removing a free space inode Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0426/1167] bpf: Claim the per-CPU send_signal irq_work before filling it Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0427/1167] bpf: Use the frame mem type in devmap egress XDP Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0428/1167] bpf: Reject sleepable programs for task_vma iterator Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0429/1167] bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0430/1167] bpf: Assume no bounds for buffers behind a tail call Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0431/1167] bpf: Assume no bounds for a writable tp with tail calls Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0432/1167] bpf: Dont let an extension reach further into the context than its target Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0433/1167] bpf: Keep the symbols of a program until it has ended Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0434/1167] bpf, cpumap: Hold the device of frames in the queue Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0435/1167] bpf: Let bpf_dynptr_write() mark a global function Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0436/1167] bpf: Follow the head if an skb is written from a slice Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0437/1167] bpf: Zero-extend the index in inlined bpf_get_func_arg() Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0438/1167] gpiolib: clear the event clock flags when a line is released Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0439/1167] netfilter: flowtable: reset transport header after nf_flow_encap_pop() Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0440/1167] ALSA: jack: Pin the module while debugfs files are open Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0441/1167] ALSA: aloop: Keep shared timer callbacks alive through close Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0442/1167] RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0443/1167] net: phy: qca83xx: read resolved QCA8337 link status Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0444/1167] xsk: freeze deferred pool teardown without blocking unregister Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0445/1167] net: bcmasp: fix network filter lookup and wake filter pair allocation Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0446/1167] net: phy: marvell: keep WOL_EIE across interrupt reconfiguration Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0447/1167] ip6mr: clear skb->cb[] in reg_vif_xmit() Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0448/1167] net: stmmac: Track the TX DMA threshold per queue Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0449/1167] exfat: fix used_clusters accounting during cluster allocation Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0450/1167] ksmbd: fix iface_list use-after-free during server reset Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0451/1167] ksmbd: disconnect on invalid encryption transform flags Greg Kroah-Hartman
2026-12-04 9:57 ` [PATCH 6.6 0452/1167] ksmbd: cache the resolved share path for durable reconnects Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0453/1167] ksmbd: fix durable reconnects for root shares Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0454/1167] ksmbd: fix fd_limit accounting across durable reconnects Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0455/1167] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86 Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0456/1167] perf lock contention: Filter events before creating lock_stat Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0457/1167] sctp: reject forged cookie peer_addr with unknown address family Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0458/1167] net/mlx5e: IPsec, Fix out-of-bounds comparison of neighbour keys Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0459/1167] zram: fix short reads from block_state Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0460/1167] maple_tree: fix maple_range_64 crashes in RCU mode Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0461/1167] ALSA: ump: Drain sequencer callbacks before freeing their client Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0462/1167] ceph: wait for pending fscache write in write_folio_nounlock() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0463/1167] ceph: fix writeback_count leak when a bounce page allocation fails Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0464/1167] net: lan966x: dont disable hardirqs in fdma tx clear path Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0465/1167] tls: keep TX and RX hardware offload on the same device Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0466/1167] ksmbd: return complete and aligned stream information Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0467/1167] nfp: flower: fix use-after-free in neighbour update work Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0468/1167] blk-throttle: pass the I/O counts of a dead group on Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0469/1167] blk-throttle: make blkio.reset_stats reset I/O counts Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0470/1167] block: dont enter reclaim under rq_qos_mutex Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0471/1167] tls: Honor O_NONBLOCK in tls_sw_splice_read() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0472/1167] ice: E822: keep Tx timestamps disabled during offset calibration Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0473/1167] blk-mq: dont trust the cookie in blk_mq_poll() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0474/1167] blk-iocost: publish hweights as one atomic value Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0475/1167] apparmor: fix table_size() integer overflow on 32 bit Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0476/1167] apparmor: check connect permission for SCTP Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0477/1167] netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0478/1167] eth: bnxt: dont leak buffers when XDP agg buffer allocation fails Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0479/1167] apparmor: fix check SCTP bind, and connect permission checks Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0480/1167] apparmor: advertise that sctp is being mediated Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0481/1167] PM: runtime: Only queue an idle check for RPM-linked suppliers (part 2) Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0482/1167] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0483/1167] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0484/1167] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0485/1167] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0486/1167] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0487/1167] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0488/1167] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0489/1167] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0490/1167] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0491/1167] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0492/1167] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0493/1167] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0494/1167] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0495/1167] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0496/1167] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0497/1167] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0498/1167] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0499/1167] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0500/1167] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0501/1167] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0502/1167] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0503/1167] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0504/1167] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0505/1167] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0506/1167] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0507/1167] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0508/1167] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0509/1167] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0510/1167] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0511/1167] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.6 0512/1167] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0513/1167] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0514/1167] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0515/1167] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0516/1167] seg6: validate state in netfilter continuations Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0517/1167] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0518/1167] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0519/1167] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0520/1167] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0521/1167] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0522/1167] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0523/1167] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0524/1167] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0525/1167] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0526/1167] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0527/1167] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0528/1167] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0529/1167] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0530/1167] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0531/1167] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0532/1167] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0533/1167] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0534/1167] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0535/1167] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0536/1167] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0537/1167] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0538/1167] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0539/1167] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0540/1167] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0541/1167] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0542/1167] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0543/1167] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0544/1167] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0545/1167] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0546/1167] software node: only let the owner release a managed node Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0547/1167] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0548/1167] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0549/1167] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0550/1167] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0551/1167] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0552/1167] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0553/1167] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0554/1167] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0555/1167] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0556/1167] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0557/1167] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0558/1167] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0559/1167] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0560/1167] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0561/1167] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0562/1167] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0563/1167] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0564/1167] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0565/1167] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0566/1167] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0567/1167] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0568/1167] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0569/1167] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0570/1167] sctp: reset stored flag for each association Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0571/1167] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.6 0572/1167] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0573/1167] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0574/1167] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0575/1167] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0576/1167] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0577/1167] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0578/1167] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0579/1167] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0580/1167] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0581/1167] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0582/1167] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0583/1167] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0584/1167] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0585/1167] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0586/1167] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0587/1167] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0588/1167] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0589/1167] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0590/1167] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0591/1167] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0592/1167] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0593/1167] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0594/1167] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0595/1167] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0596/1167] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0597/1167] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0598/1167] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0599/1167] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0600/1167] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0601/1167] dm log userspace: drop the device reference on error Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0602/1167] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0603/1167] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0604/1167] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0605/1167] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0606/1167] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0607/1167] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0608/1167] dm persistent data: test return value of node_copy Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0609/1167] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0610/1167] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0611/1167] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0612/1167] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0613/1167] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0614/1167] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0615/1167] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0616/1167] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0617/1167] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0618/1167] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0619/1167] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0620/1167] dm-raid: bound array_position before indexing failed_devices Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0621/1167] dm-thin: fix data corruption if discard races with regular I/O Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0622/1167] dm-thin: fix leak if __set_snapshot_details fails Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0623/1167] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0624/1167] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0625/1167] comedi: addi_apci_1500: fix clearing of the gate enable Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0626/1167] comedi: ni_660x: dont poll without a DMA channel Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0627/1167] comedi: ni_tio: Fix overflow of the clock period Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0628/1167] comedi: vmk80xx: report failed transfers of the K8061 Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0629/1167] iio: addac: ad74413r: fix the values of set_multiple Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0631/1167] misc: bcm-vk: fix DMA allocation memory leak Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.6 0632/1167] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0633/1167] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0634/1167] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0640/1167] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0641/1167] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0642/1167] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0643/1167] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0644/1167] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0645/1167] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0646/1167] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0647/1167] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0648/1167] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0649/1167] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0650/1167] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0651/1167] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0652/1167] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0653/1167] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0654/1167] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0655/1167] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0656/1167] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0657/1167] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0658/1167] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0659/1167] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0660/1167] w1: dont hold list_mutex while a slave is torn down Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0661/1167] w1: ds2482: set the strong pull-up with its byte Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0662/1167] w1: ds2805: use the bus mutex to talk on the bus Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0663/1167] w1: ds28e04: " Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0664/1167] w1: netlink: drop the slave after the bus is unlocked Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0665/1167] w1: remove the masters files before taking its locks Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0666/1167] w1: use the bus mutex for the "rw" file Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0667/1167] w1: w1_therm: leave the slaves of other families alone Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0668/1167] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.6 0669/1167] USB: serial: garmin_gps: validate packet data length in nat_receive() Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox