Merge tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Pull bpf fixes from Alexei Starovoitov:
"Mostly sockmap fixes as promised, plus uprobe ctx rewrite via bpf and
cgroup-bpf fixes.
- Reject writable map iterators on read-only maps (Adethya
Srinivasan)
- Various sockmap fixes (Alexei Starovoitov):
- Clear the redirect target before the sk_msg prog runs
- Check that the redirected message is the cork
- Leave sk_stream_wait_memory() once the socket is dead
- Keep the rest of the cork after a redirect
- Don't let an SK_PASS verdict cover the next message
- Subtract all dropped bytes from the return value of sendmsg()
- Clear the end mark of elements added by bpf_msg_push_data() and
bpf_msg_pop_data()
[72 lines not shown]
Merge tag 'zonefs-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs
Pull zonefs fixes from Damien Le Moal:
- Avoid potentially opening the wrong file in the case of an overflow
when converting a file names to an inode number (Guangshuo)
- Handle potential overflow of RLIMIT_FSIZE (Ding)
* tag 'zonefs-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
zonefs: ignore RLIMIT_FSIZE above LLONG_MAX in zonefs_write_check_limits()
zonefs: check multiplication overflow in zonefs_fname_to_fno()
Merge tag 'fuse-fixes-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse
Pull fuse fixes from Miklos Szeredi:
- Fix bugs reported by Sashiko
- Fix a couple of issues introduced in this cycle
- Misc bug fixes
* tag 'fuse-fixes-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
fuse: limit name size in listxattr
fuse: clear the old EOF tail before writeback-cache writes
fuse: fix UBSAN warning in fuse_iomap_writeback_range()
fuse: skip dcache instantiation for readdirplus names with embedded NUL
fuse: preserve ENOTCONN after failed initialization and disconnect
fuse: set dentry epoch before making the dentry visible
fuse: advertise support for DAX mappings
fuse: don't mark inode DAX without CONFIG_FS_DAX
[9 lines not shown]
Merge tag 'libnvdimm-fixes-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm fix from Alison Schofield:
"Nest namespace mapping locks under the bus lock"
* tag 'libnvdimm-fixes-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
nvdimm/namespace: Nest mapping locks under the bus lock
Merge tag 'cxl-fixes-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl
Pull cxl fixes from Dave Jiang:
"A small collection of CXL fixes"
* tag 'cxl-fixes-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
cxl/port: Fix endpoint RAS error unmasking
cxl/test: Free the decoder registry when cxl_test_init() fails
cxl/region: Reject a repeat write of an endpoint decoder to targetN
cxl/region: Restore a target's position from its slot after sorting
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe:
"Usual set of bug fixes, many found by tools:
- Bound checks and counter widths in srpt for initiator controlled
descriptor tables, out of bounds read and resource leaks are remote
triggerable
- Use after free races in siw MR lookup and in the rtrs event handler
error unwind
- Don't leak kernel heap memory to userspace through query_qp
- Several rereg_mr bugs in irdma and mlx4 leaving stale or revived MR
state after a failure
- irdma FRWR and PBLE/AEQ setup was broken on PAGE_SIZE > 4K
[36 lines not shown]
Merge tag 'block-7.4-20261119' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux
Pull block fixes from Jens Axboe:
- NVMe fixes via Keith:
- nvme-tcp fixes for TLS record handling and waiting for an
in-flight TLS handshake callback
- Fix a deadlock on nvme_subsystems_lock in nvme_init_subsystem()
- Fix a gendisk leak in nvme_alloc_ns()
- Stop AEN work before ANA teardown
- Remove namespaces in parallel
- Various nvmet fixes for auth, the file backend, fc, tcp, loop,
and connection failure rollback
- sysfs input validation and kfree_sensitive() for DH-HMAC-CHAP
secrets
- Dead code removal
- Fix a 32-bit overflow in the blk-iocost donation weight calculation
[37 lines not shown]
Merge tag 'io_uring-7.4-20261119' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux
Pull io_uring fixes from Jens Axboe:
- Don't run canceled local work from a task that doesn't share the mm
of the submitter on ring release
- Fail soft links on negative IOU_COMPLETE results, on cancelled futex
waits, and on short or failed IOPOLL IO
- Show the stuck io-wq workers rather than WARN on a slow exit, as the
WARN can be triggered at will and the exiting task's stack trace is
never the interesting one
- Don't rearm a multishot timeout on cancel, as that could delay ring
teardown for a long time
- Keep the old registered file when a file update fails
[16 lines not shown]
Merge tag 'sound-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"A collection of various small fixes. Nothing really stands out.
While we still get more fixes than before, things look still well
manageable (fingers crossed). Here are the highlights:
ALSA core:
- Fix page leaks at buffer allocation retries
- Fix in compress-offload API for setting metadata_set flag
- Parameter flag handling fixes on setup and error in PCM OSS layer
HD-audio:
- Fix AE-5 LED strip color corruption during animation in ca0132
- Correct boost values for CS35L41 on several HP laptops
- Realtek quirk regression fixes for Lenovo Legion and V14 G2 ITL
- Fix quiet speakers on HP 250 G6
- Various Realtek quirks and mute LED fixups (HP, Lenovo, THUNDEROBOT)
[37 lines not shown]
Merge tag 'gpio-fixes-for-v7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fixes from Bartosz Golaszewski:
"GPIO core fixes:
- delay freeing the line state workqueue to device release and
fix a UAF bug
- fix races in access to the flags field of GPIO descriptors
- clear the debounce period field of struct gpio_desc before
clearing the "requested" flag
- propagate -ENOTSUPP from .set_config() in gpio-shared-proxy
GPIO driver fixes:
- check the return value of clk_prepare in gpio-omap
- reject bulk-in endpoints smaller than 3 bytes in gpio-mpsse
- validate the pin index of interrupt events in gpio-ljca
- disable interrupts around the chip lock in direction callbacks
in gpio-mlxbf2
- fix line name handling in gpio-virtio
[19 lines not shown]
Merge tag 'ata-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Pull ata fixes from Niklas Cassel:
- Fix an off-by-one in the REMOVE ELEMENT AND TRUNCATE translation,
which asked the device for one block more than requested (Nick)
- Fix the INC_512 bit test in the SECURITY PROTOCOL IN/OUT
translation, which treated lengths in 512-byte units as bytes (me)
- Limit max_sectors to 8191 on the INTEL SSDSCKKB240G8 SSD to avoid
NCQ command timeouts (Justinien)
* tag 'ata-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
ata: libata-core: Add max sector quirk to INTEL SSDSCKKB240G8
ata: libata-scsi: fix the INC_512 bit test for SECURITY PROTOCOL IN/OUT
ata: libata-scsi: fix REQUESTED MAX LBA field for REMOVE ELEMENT AND TRUNCATE
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas:
"BBML3 allow-list corrections for Cortex-X4 and Neoverse-V3/V3AE
following updated errata, a kCFI oops during kexec relocation and NEON
intrinsics type mismatches causing CRC64 and XOR build failures with
tip-of-tree Clang:
- Remove Cortex-X4 and Neoverse-V3/V3AE from the BBML3 allow list
Updated errata documents show that revisions previously reported as
fixed remain affected by load/store livelocks when changing mapping
sizes without break-before-make
- Fix a kCFI oops during kexec image relocation. Give the relocation
routine a type hash and enter the copied code at the correct offset
- Fix the build with recent Clang versions by removing the stdint.h
type overrides for NEON intrinsics. The CRC64 and XOR intrinsics
[9 lines not shown]
Merge tag 's390-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Alexander Gordeev:
- Fix error handling for monitor start and stop operations
Return failures to userspace, prevent inconsistent state
and potential use-after-free scenarios
- Ensure skipped syscalls return -ENOSYS as expected
Preserve existing ptrace behavior while separating syscall
number handling from the return value stored in gpr2
- Fix a race during module initialization where sysfs handlers
could access an uninitialized device list semaphore
* tag 's390-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/dcssblk: Initialize device semaphore before sysfs registration
[2 lines not shown]
zonefs: ignore RLIMIT_FSIZE above LLONG_MAX in zonefs_write_check_limits()
zonefs_write_check_limits() follows generic_write_check_limits() and
has the same problem: it stores rlimit(RLIMIT_FSIZE), an unsigned long,
in a loff_t, so a soft limit between 2^63 and RLIM_INFINITY is negative
and every write fails with -EFBIG and raises SIGXFSZ.
Keep the limit unsigned and apply it only when it is at most LLONG_MAX,
as the generic helper now does.
Fixes: ebfd68cd0c1e ("zonefs: Fix O_APPEND async write handling")
Cc: stable at vger.kernel.org
Assisted-by: Claude:claude-opus-5-5 Frama-C
Signed-off-by: Ding Feng <dingf3ng at gmail.com>
Signed-off-by: Damien Le Moal <dlemoal at kernel.org>
fuse: limit name size in listxattr
Limit the size of names to XATTR_NAME_MAX. Return -EIO to the listxattr()
caller if the server exceeds this limit.
Fixes: 92a8780e1136 ("[PATCH] FUSE - extended attribute operations")
Cc: stable at vger.kernel.org
Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
fuse: clear the old EOF tail before writeback-cache writes
Buffered writeback-cache writes go through iomap_file_buffered_write(),
but do not clear cached data between the old EOF and the write position.
If a shared mapping dirtied the tail of the old EOF page, an extending
write can expose those bytes as file contents instead of zeros. A later
writeback can also send them to the server.
Clear the gap under the existing inode lock before the buffered write.
Use the same page-cache cleanup as fuse_perform_write() does for
write-through writes, leaving the write range itself untouched.
Fixes: 4d99ff8f12eb ("fuse: Turn writeback cache on")
Cc: stable at vger.kernel.org
Signed-off-by: Hungyu Lin <dennylin0707 at gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
fuse: fix UBSAN warning in fuse_iomap_writeback_range()
In fuse_iomap_writeback_range() 'ap' is initialized to '&wpa->ia.ap'
unconditionally, but 'wpa' (== data->wpa) is NULL when the writeback
of the first folio of a batch starts: 'data' is zero-initialized in
fuse_writepages() and fuse_launder_folio(), and fuse_writepages_send()
resets data->wpa to NULL after every batch.
Taking the address of a member of a NULL pointer is undefined
behavior. The bogus initial value of 'ap' is never actually
dereferenced: all uses are either guarded by 'if (wpa)' or run after
'ap' has been reassigned in the 'data->wpa == NULL' branch, where a
new 'wpa' is allocated first. Still, the expression lets the
compiler assume that 'wpa' is non-NULL for the whole function, which
could break the 'if (wpa)' check below and turn the latent UB into a
real NULL pointer dereference.
This can be observed with a kernel built with -fsanitize=null (not
part of the default CONFIG_UBSAN flag set) when writeback of an mmap
[17 lines not shown]
gpio: shared-proxy: propagate -ENOTSUPP from .set_config()
The gpio-shared-proxy driver does not propagate -ENOTSUPP returned from
the set_config() callback by real GPIO drivers controlling the shared
GPIOs. This can lead to a situation where for an open-drain, shared GPIO,
we take the emulation path on request - ending up setting the direction
to input for the initial user - and then fail to allow simulated output
direction for the second user if the driver in question does not
support using "real" open-drain.
Propagate all errors from the underlying .set_config() call in
gpio_shared_proxy_set_config().
Reported-by: Igor Velkov <iav at iav.lv>
Closes: https://lore.kernel.org/all/20261115-hc4-gpio-shared-od-1@iav.lv/
Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver")
Tested-by: Igor Velkov <iav at iav.lv>
Link: https://patch.msgid.link/20261118-gpio-shared-proxy-enotsupp-v1-1-39d3fe4d3aa7@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski at oss.qualcomm.com>
Merge tag 'asoc-fix-v7.4-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v7.4
Quite a lot of fixes here together with a few quriks for new devices,
mostly not particularly remarkable. The Cirrus changes are relatively
large but reasonably so, there's a bunch of data table updates and a
couple of new functions needed and they come with clear reasonining.
Merge branch 'bpf-limit-writable-registers-in-uprobe-context'
Jiri Olsa says:
====================
bpf: Limit writable registers in uprobe context
Hi,
a uprobe BPF program can currently write fields in struct pt_regs that
are loaded directly by the architecture’s return-to-user path. Some of
these fields are restricted by ptrace, but the BPF verifier does not
apply the same restrictions.
This series limits uprobe context writes to registers that ptrace can
set to arbitrary values. It adds architecture-specific writable-register
checks for arm64, riscv, and x86-64; other architectures default to
allowing no writes. Reads are unchanged.
The second patch adds verifier tests for writable and read-only registers
[11 lines not shown]
bpf: Restrict uprobe ctx writes to the registers ptrace can set
Since commit 7384893d970e ("bpf: Allow uprobe program to change context
registers") a uprobe program can write any field of struct pt_regs.
Some of those fields are not plain user registers. The exit to user
space loads them into the CPU:
arch field exit path ptrace
------ ------ ------------------------------- ------------------
riscv status csrw CSR_STATUS, a0 not in the regset
arm64 pstate msr spsr_el1, x22 valid_user_regs()
x86-64 cs, ss (cs & 3) == 0: iretq to ring 0 set_segment_reg()
x86-64 flags iretq loads IF and IOPL set_flags()
On riscv a program that sets sstatus.SPP in pt_regs.status makes
ret_from_exception return to user code in supervisor mode. On x86-64 a
program that writes a kernel selector to cs makes iretq return to
ring 0.
ptrace guards these fields, but the bpf verifier does not.
[27 lines not shown]
selftests/bpf: Test which ctx registers a uprobe prog can write
A uprobe program can write only the pt_regs fields that ptrace can set
to any value. Add verifier tests for x86-64, arm64 and riscv:
- writes to the general registers, the stack pointer and the
instruction pointer load
- writes to cs, ss, flags and orig_ax on x86-64, to pstate and
orig_x0 on arm64, and to status, badaddr and cause on riscv fail
with "invalid bpf_context access"
- a 4-byte write to the low half of a read-only field fails too
- reading a read-only field still works
- on x86-64, a kprobe program that writes ctx->flags fails to load
Other arches get one test that just loads.
Signed-off-by: Jiri Olsa <jolsa at kernel.org>
Signed-off-by: Alexei Starovoitov <ast at kernel.org>
Link: https://patch.msgid.link/20261118084451.12590-3-jolsa@kernel.org
Merge tag 'selinux-pr-20261119' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux fix from Paul Moore:
"A single SELinux fix for a problem where we were not properly handling
MAP_SHARED_VALIDATE"
* tag 'selinux-pr-20261119' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
selinux: check MAP_SHARED_VALIDATE mappings as shared
Merge tag 'thermal-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fix from Rafael Wysocki:
"Fix the Nova Lake-S PCI device ID in the int340x thermal driver
(Sankara Tankala)"
* tag 'thermal-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
thermal: int340x: processor_thermal: Fix Nova Lake-S PCI device ID
Merge tag 'pm-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management and ACPI fixes from Rafael Wysocki:
"These fix two recent regressions related to power management, one in
the ACPI CPPC library (affects the CPPC interface in sysfs and the
intel_pstate driver), and one in the ACPI device PM core code (affects
platforms with shared ACPI power resources assigned to devices
reported as "not present" by firmware), another ACPI CPPC library
issue and two cpufreq issues, one in the core and one in the CPPC
cpufreq driver:
- Avoid initializing power management for absent devices in the core
ACPI PM code to unbreak power management on platforms where an ACPI
shared power resource is assigned to a device reported by the
platform firmware as absent (Rafael Wysocki)
- Drop compliance checks involving nominal performance from the ACPI
CPPC library to unbreak the CPPC sysfs interface and the
intel_pstate driver on some Intel platforms after a recent change
[19 lines not shown]
Merge branches 'acpi-cppc-fixes' and 'pm-cpufreq-fixes'
Merge ACPI CPPC library fixes and cpufreq fixes for 7.4-rc1:
- Drop compliance checks involving nominal performance from the ACPI
CPPC library to unbreak the CPPC sysfs interface and the intel_pstate
driver on some Intel platforms after a recent change that added those
checks (Rafael Wysocki)
- Make the ACPI CPPC library reject EPP registers that are too small to
store all of the possible EPP values (Christian Loehle)
- Make cpufreq_driver_target() skip inactive policies to avoid a NULL
pointer dereference on a frequency table access attempt (Zhongqiu Han)
- Set the CPPC Enable register in cpu_init() in the CPPC cpufreq driver
to enable CPPC on platforms that wait for the OS to enable it (Sumit
Gupta)
[7 lines not shown]
ASoC: tas2781: Avoid possible zero-division
The calibration preprocessing code in TAS2781 codec driver has a
division with the value calculated from the firmware data, and when a
malformed firmware is given, this could lead to a zero-division error.
We already hit and addressed such a case (commit 8dbab764f1e0 "ALSA:
hda/tas2781: Only accept CRC-less V1 data if all entries are valid")
which was fixed in the caller side (HD-audio TAS2781 driver).
For avoiding such a breakage in future, let's add a safety check for
zero division in the callee side, too.
Fixes: 05ac3846ffe5 ("ALSA: hda/tas2781: A workaround solution to lower-vol issue among lower calibrated-impedance micro-speaker on TAS2781")
Signed-off-by: Takashi Iwai <tiwai at suse.de>
Link: https://patch.msgid.link/20261119131045.2152868-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie at kernel.org>
fuse: skip dcache instantiation for readdirplus names with embedded NUL
FUSE READDIRPLUS can pass a length-bearing qstr with an embedded NUL to
d_splice_alias(). Unlike verify_dirent_name() in fs/readdir.c, this
path can create a dentry whose d_name.len extends past the NUL.
For such a name, strscpy() in inotify_handle_inode_event() and the
fanotify name-copy helpers stop early. The kmalloc() and kvmalloc()
event-name buffers retain uninitialized bytes within the recorded name
length, which copy_event_to_user() and copy_fid_info_to_user() can expose.
Some FUSE servers include a terminating NUL in namelen. Follow
nfs_prime_dcache() in commit 78d04af4995a1 ("NFS: nfs_prime_dcache must
validate the filename") by skipping dcache instantiation without
failing getdents(). Return -EIO from fuse_direntplus_link() so
parse_dirplusfile() sends FUSE_FORGET for the unused lookup reference
and continues readdir.
Fixes: 0b05b18381ee ("fuse: implement NFS-like readdirplus support")
[6 lines not shown]
fuse: preserve ENOTCONN after failed initialization and disconnect
Commit 794e811d1443 ("fuse: split out filesystem part of request
sending") moved the INIT failure check into fuse_req_prep(), before
the channel checks whether it is still connected.
If a daemon closes /dev/fuse before replying to INIT, aborting the
channel completes INIT with an error. stat() and open() on the mount
then return ECONNREFUSED instead of the previous ENOTCONN. The same
change occurs when INIT is rejected before the daemon closes the fd.
Record INIT failure in the channel before publishing initialized, and
check it in fuse_get_req() after waiting for initialization and checking
for disconnection. This preserves ECONNREFUSED for failed INIT while
the device remains open, and restores ENOTCONN after disconnection.
Set the failure flag only while the channel is connected, since abort
also marks it initialized to wake waiters after a successful INIT.
[4 lines not shown]