Merge tag 'clk-fixes-for-linus-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk fixes from Brian Masney:
"Qualcomm Glymur GCC:
- Use collapse voting for PCIe and PCIe PHY power domains shared with
other masters, including domains enabled by boot firmware
- Retain USB and USB PHY power domains to preserve configuration and
fix USB host controller resume from suspend
Samsung Exynos:
- Properly handle deferred probe of the AudioSubsystem clock
controller
- Fix integration of clock controller and power domains on Exynos5250
and Exynos5420: be sure device runtime resumed before proceeding
with probe and defer probe till the power domain is available"
[7 lines not shown]
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio fixes from Michael Tsirkin:
"Just a bunch of small fixes all over the place. Nothing stands out
much.
A new test in tools - given we had a bunch of issues around logging
discovered recently, seems prudent to just include it"
* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
virtio: Release the OF node when unregistering the device
vhost: synchronize worker freeing on vhost-net teardown
tools/virtio: add a vhost dirty log test
vhost: set dirty log bits without pinning pages on x86
tools/virtio: vringh_test: check that a split ring must be a power of two
virtio_ring: reject a split ring size that is not a power of two again
virtio-pci: Drop inclusion of <linux/mod_devicetable.h>
virtio_balloon: drain update works on probe error paths
virtio_console: defer HVC polling out of the virtqueue callback
[7 lines not shown]
Merge tag 'qcom-clk-fixes-for-7.4' into clk-fixes
Qualcomm clock fixes for v7.4
Fix Glymur GCC power domain handling for PCIe and USB.
- Use collapse voting for PCIe and PCIe PHY power domains shared with
other masters, including domains enabled by boot firmware.
- Retain USB and USB PHY power domains to preserve configuration and
fix USB host controller resume from suspend.
* tag 'qcom-clk-fixes-for-7.4':
clk: qcom: gcc-glymur: use collapse-voting for PCIe GDSCs
clk: qcom: gcc-glymur: Use PWRSTS_RET_ON flag for USB GDSCs
tools/virtio: add a vhost dirty log test
Add vhost_log_test, which exercises used-ring dirty logging through the
existing vhost_test module. It sets a log base with VHOST_SET_LOG_BASE,
enables VHOST_VRING_F_LOG on the ring, submits descriptors and checks
the resulting bitmap from userspace. No new kernel interface is needed.
The test covers:
- every bit in a byte, repeated sets, and neighbouring bytes being left
untouched, including the last byte of a page followed by a PROT_NONE
guard page
- a used ring write that spans two log pages, with both bits in the
same bitmap byte and in adjacent bytes
- a log page that has not been faulted in yet, read-only, PROT_NONE
and unmapped log pages, and logging after access is restored
- private (COW) and shared file mappings, checking that the bit reaches
the file after msync/fsync
- eight vrings setting different bits of the same byte concurrently,
[17 lines not shown]
virtio: Release the OF node when unregistering the device
virtio_device_of_init() acquires the OF node reference once during device
registration. virtio_dev_remove() currently puts it on each driver unbind,
although rebinding the driver does not acquire a new reference. Repeated
unbinds can therefore consume references not owned by the virtio device.
Conversely, unregistering a device that never bound to a driver leaves
the reference held.
Move the put to unregister_virtio_device() so it is paired with device
registration. Save the node pointer before device_unregister(), which
can free the virtio device, and put it after unregister has completed the
driver removal.
Fixes: 694a1116b405 ("virtio: Bind virtio device to device-tree node")
Reported-by: sashiko-bot <sashiko-bot at kernel.org>
Link: https://lore.kernel.org/all/sashiko-outbox-203883@kernel.org/
Cc: stable at vger.kernel.org
Signed-off-by: Yige Jiang <yigejiang86 at gmail.com>
[2 lines not shown]
vhost: synchronize worker freeing on vhost-net teardown
vhost_workers_free() only waits for RCU readers when sync is true. Both
vhost-net teardown paths pass false, relying on the assumption recorded
when the sync parameter was introduced (5efd97e6f0c7) that "net and scsi
stop their virtqueues before the workers are freed".
That assumption does not hold when a tap queue is detached while the
socket is still attached. __tun_detach() runs tun_queue_purge() on the
detaching thread, so skb_queue_purge() releases the zerocopy skbs and
vhost_zerocopy_complete() -> vhost_poll_queue() runs there rather than on
the vhost worker. The vhost_dev_flush() calls in vhost_net_flush() and
vhost_dev_stop() only wait for the vhost workers, so the queueing can
still be in flight when vhost_dev_cleanup() frees the worker, and
vhost_worker_queue() then dereferences freed memory.
Pass sync=true from vhost_net_release() and vhost_net_reset_owner() so a
grace period and a flush are observed before the workers are released,
matching the vsock RESET_OWNER path. Both are slow paths, and the extra
[17 lines not shown]
vhost: set dirty log bits without pinning pages on x86
vhost had a TODO to replace page pinning with a version
of set_bit that works on userspace memory, since forever.
It is really best to avoid GUP on fast path entirely.
Implement set_bit_user and use it in vhost, to do just that.
Should not be too hard for non-x86 too.
Reported-by: Khan Zhao <zhaoguohan at kylinos.cn>
Link: https://lore.kernel.org/all/20261112085631.128819-1-zhaoguohan@kylinos.cn/
Signed-off-by: Khan Zhao <zhaoguohan at kylinos.cn>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
Message-ID: <20261117083323.89502-2-zhaoguohan at kylinos.cn>
tools/virtio: vringh_test: check that a split ring must be a power of two
vring_new_virtqueue() used to accept a split ring of any size, although
the ring is indexed with num - 1 as a mask. Check that it now refuses
one size short of RINGSIZE.
Without the preceding fix, vringh_test fails with:
vringh_test: vring_new_virtqueue accepted size 255
With it, vring_new_virtqueue() prints:
Bad virtqueue length 255 (not a power of two)
and the rest of the test runs as before.
Signed-off-by: Stjepan Poljak <stjepan.poljak at gmail.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
Message-ID: <20261112154927.4004184-3-stjepan.poljak at gmail.com>
virtio_ring: reject a split ring size that is not a power of two again
The split ring indexes its avail and used rings with num - 1 as a mask,
so its size must be a power of two. Commit 2a2d1382fe9d ("virtio: Add
improved queue allocation API") moved that check from
vring_new_virtqueue() into the new allocation path, which
vring_new_virtqueue() does not use.
remoteproc calls vring_new_virtqueue() with a ring size from the
firmware, checked only to be non-zero. With 100 entries, for example,
the driver would put buffers 4 and 8 in avail slot 0. The device would
look for them at slots 4 and 8, possibly reading the wrong data.
Put the check back for the split ring; the packed ring has no such
restriction.
Fixes: 2a2d1382fe9d ("virtio: Add improved queue allocation API")
Signed-off-by: Stjepan Poljak <stjepan.poljak at gmail.com>
Reviewed-by: Francesco Valla <francesco at valla.it>
[4 lines not shown]
virtio-pci: Drop inclusion of <linux/mod_devicetable.h>
Among the different device id structures <linux/virtio_pci_legacy.h>
only uses struct virtio_device_id. Include <linux/device-id/virtio.h>
instead of <linux/mod_devicetable.h> to provide that which is more
lightweight and doesn't introduce that many dependencies.
The users of <linux/virtio_pci_legacy.h> also don't rely on this header
to provide the full plethora of definitions. (There are only
drivers/vdpa/alibaba/eni_vdpa.c and drivers/virtio/virtio_pci_common.c
using pci_device_id and these include <linux/pci.h> which is enough to
get it.)
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig at baylibre.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
Message-ID: <fc69191474ffd49d50d7e39b13dfe6586f4d3f75.1783354857.git.u.kleine-koenig at baylibre.com>
sched/wait: remove __add_wait_queue_entry_tail()
__add_wait_queue() and __add_wait_queue_entry_tail() are now the same.
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
sched/wait: always queue new waiters at the tail
Non-exclusive waiters have been added at the head and exclusive ones at
the tail, so that an exclusive wakeup stopping early still woke every
non-exclusive waiter.
That only matters for waiters that mix both kinds on one queue like
read() and poll() on a pipe - and even then it doesn't actually buy
anything but complexity and fragility of the code.
An exclusive reader consumes the event, the poller had nothing to see,
so there's no real point in keeping the two ordered.
The pointless ordering results in a special rule for everybody adding
themselves to the wait queue, and that rule has not been consistently
followed anyway (see for example do_wait_intr() and do_wait_intr_irq())
So just queue everyone in FIFO order. LIFO might be better for
throughput, but every time we've ever tried that optimization in real
[22 lines not shown]
sched/wait: remove the __add_wait_queue_*exclusive() helpers
Each has one or two special-case users. Open-code them there: set
WQ_FLAG_EXCLUSIVE and queue the entry directly, with a note on why the
caller doesn't use add_wait_queue_exclusive().
I think all cases (eventpoll, orangefs and ubifs) are unnecessary and
could just use the regular ordering, but I'll leave that to those
maintainers to sort out.
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Cc: Alexander Viro <viro at zeniv.linux.org.uk> # eventpoll
Cc: Christian Brauner <brauner at kernel.org> # eventpoll
Cc: Jan Kara <jack at suse.cz> # eventpoll
Cc: Mike Marshall <hubcap at omnibond.com> # orangefs
[2 lines not shown]
Merge tag 'edac_urgent_for_v7.4_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull EDAC fixes from Borislav Petkov:\
- Fix error handling paths and channel name truncation in versalnet_edac
* tag 'edac_urgent_for_v7.4_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
EDAC/versalnet: Fix use-after-free in remove_one_mc()
EDAC/versalnet: Use designated initializer for rpmsg_channel_info
EDAC/versalnet: Fix device_register() error handling in init_one_mc()
Merge tag 'x86-urgent-2026-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar:
- Make SafeRET robust also against NMIs (Atish Patra)
- Fix SMCA bank lookup in amd_mce_usable_address() (Yazen Ghannam)
- Fix the FPDSS erratum on Hygon (Shance Luo)
- Work around XSAVES Erratum 1386 on Hygon (Tina Zhang)
* tag 'x86-urgent-2026-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/cpu/hygon: Work around XSAVES Erratum 1386
x86/CPU: Fix FPDSS on Hygon
x86/mce/amd: Fix bank lookup in amd_mce_usable_address()
x86/entry: Make SafeRET robust also against NMIs
Merge tag 'sched-urgent-2026-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar:
- Clear stale rq->dl_server when core-sched replaces a pick
(Fernand Sieber)
- Don't charge core-sched forced idle to the DL servers
(Fernand Sieber)
- Add a core-sched forced-idle DL server self-test
(Fernand Sieber)
- Clear a stale rq->core_pick after dequeue (Ibrahim Elshahed)
- Don't take the idle fast path while the core is forced idle
(Ibrahim Elshahed)
- Fix a TOCTOU bug in sched_non_preferred_cpu_push_stop()
[20 lines not shown]
Merge tag 'locking-urgent-2026-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Ingo Molnar:
- Fix the __bitlock() macro definition (Bart Van Assche)
- Disable context analysis for __free() helpers (Bart Van Assche)
- Make the srcu_dereference_check() reader lock check conditional
(Bart Van Assche)
* tag 'locking-urgent-2026-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
srcu: Make the srcu_dereference_check() reader lock check conditional
cleanup: Disable context analysis for __free() helpers
bit_spinlock: Fix the __bitlock() macro definition
Merge tag 'docs-secbugs-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/docs/linux
Pull documentation update from Jonathan Corbet:
"A set of updates to security-bugs.rst from Willy Tarreau, who says:
Here comes the v2 of a new batch of updates for the security bugs doc,
essentially to make it more readable and to address some of its
apparent contradictions for those not reading it entirely. Some
additions were made to explain how to send a patch and a reproducer
separately, and to ask that first-time reporters send a single report
at once first.
The first patch looks big, it only reorders paragraphs to fix the
current mess resulting from minimal and incremental updates we've done
over the last 6 months in reactions to some repeated mistakes found in
reports. This accumulation has resulted in certain topics being
discussed in a somewhat inconsistent way at different places in the
document.
[25 lines not shown]
Merge tag 'fixes-2026-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux
Pull liveupdate fix from Mike Rapoport:
"debugfs/kho/in/sub_fdts exposes data that KHO users passed from the
previous kernel. KHO does not own that memory, its users may have
already freed it and reading these files can cause a use-after-free.
Drop support for debugfs/kho/in/sub_fdts"
* tag 'fixes-2026-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux:
kho: do not expose incoming sub-blob contents in debugfs
Merge tag 'ntfs-for-7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs
Pull ntfs fixes from Namjae Jeon:
- Convert the correct named $DATA stream when making room in a full MFT
record. Check for an exact name match, skip cached sibling streams,
and avoid waiting on folio locks under the MFT record lock to prevent
resize deadlocks
- Wait uninterruptibly for metadata reads to prevent fatal signals from
leaving metadata updates incomplete or causing spurious mount
failures and read-only remounts
- Flush sibling attribute mappings during stream fsync to make data
moved out of an MFT record during resize durable. Skip self-parent
FILE_NAME entries to avoid recursively locking the root directory's
MFT record
- Limit mount-time $MFTMirr comparisons to system records 0 through
[9 lines not shown]
Merge tag 'ksmbd-for-7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/smb
Pull smb server fixes from Namjae Jeon:
- Validate SMB2 LOCK requests before checking the unlock-only rule for
expired Kerberos sessions. This prevents an out-of-bounds read while
allowing clients to release existing byte-range locks
- Align and sign the final response when an SMB2 compound ends early so
clients can verify the compound response
- Process the SMB2 CREATE allocation-size context only on writable
shares, preventing disk space reservations through read-only shares
- Normalize timestamps before the Unix epoch during NT-to-Unix
conversion so the nanosecond field is valid when written to disk
- Recognize the -1 and -2 timestamp sentinels in FileBasicInformation
to prevent corruption of inode and DOS xattr timestamps
[11 lines not shown]
io_uring/poll: don't claim real exclusivity for EPOLLEXCLUSIVE
Same problem as epoll: an EPOLLEXCLUSIVE poll request returns 1 from
io_poll_wake() (even when it lost the ownership race and does nothing),
which stops the wakeup walk, but posting a CQE doesn't consume the
event.
Waiters queued behind it can sleep with the event pending.
Use WQ_FLAG_POLL_EXCLUSIVE, so only one io_uring entry is woken but real
waiters are not skipped.
Reported-by: Mani Tofigh <mt4022 at columbia.edu>
Cc: Jens Axboe <axboe at kernel.dk>
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
eventpoll: don't claim real exclusivity for EPOLLEXCLUSIVE
An EPOLLEXCLUSIVE entry that wakes an epoll_wait()er returns 1, and
because it was queued as an exclusive waiter that stops the wakeup walk.
But nothing makes the epoll user consume the event: it may be killed,
time out, pick another ready fd, or just not read. Anything queued
behind the entry - a blocked pipe reader, an accept()er, a recv()er -
then sleeps with the event pending.
Queue it with WQ_FLAG_POLL_EXCLUSIVE instead: still only one epoll
instance is woken per wakeup, but real waiters are not skipped.
Reported-by: Mani Tofigh <mt4022 at columbia.edu>
Reviewed-by: Oleg Nesterov <oleg at redhat.com>
Cc: Christian Brauner <brauner at kernel.org>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
[2 lines not shown]
sched/wait: add WQ_FLAG_POLL_EXCLUSIVE for user space waiters
An exclusive waiter whose wake function returns a positive return value
to indicate that it has successfully been woken up stops the wakeup
walk, on the understanding that it will handle the event.
However, user space consumers - like eventpoll or io_uring - want to be
woken up, and want to avoid the thundering herd issue. So they used an
exclusive wait - but without any actual guarantee that they will then
meaningfully handle the event.
So the wakeup could be lost, and real waiters would be left pending.
Add a separate flag for these kind of "exclusive poll" cases, which is
effectively what these user space waiters are. Only the first such
entry that accepts a wakeup is woken, as now, but they don't count
against nr_exclusive and it doesn't stop the walk.
Wake-all (nr_exclusive == 0, including POLLFREE) still calls every entry.
[9 lines not shown]
sched/core: Rank DL server picks as deadline in the core-wide pick
Commit 4b26cfdd3956 ("sched/core: Fix priority checking for DL server
picks") made the core-wide selection rank a task picked through a DL
server as deadline, so that a fair task competing with RT tasks under
core scheduling still gets its server's bandwidth. It keys on
p->dl_server, which pick_task() used to set.
Since commit bd9bbc96e835 ("sched: Rework dl_server"), pick_task()
records the server in rq->dl_server and p->dl_server is only set once
the task is switched in. The core-wide selection still ranks each
sibling's pick with prio_less(), so a task the sibling's server has
just picked ranks as a plain fair or ext task and loses to an RT task
on another sibling. The server's CPU then runs a task with the RT
task's cookie or is forced idle, and the fair task gets none of the
server's bandwidth for as long as the RT task runs.
Rank each sibling's pick by the server it came through, rq_i->dl_server.
prio_less() keeps using p->dl_server for the core tree, whose tasks are
[7 lines not shown]
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"Bug fixes, mostly in drivers. The only core change is to add service
action in to the SCSI ioctl to support ATA depopulation.
The largest driver fix is in ufs (decouple device lifecycle from
devres) and the next largest is in the target code (compare all six
ISID bytes identifying nexus) in the persistent reservation path"
* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: mpt3sas: Validate data_out size before SMP link-reset check
scsi: ufs-mediatek: Restore the M-PHY power state when va09 disable fails
scsi: ufs-mediatek: Use devm_regulator_get() for the va09 regulator
scsi: target: core: Compare all six ISID bytes when identifying a nexus
scsi: target: core: Disable protection processing for zero-block transfers
scsi: target: iscsi: Run the Time2Retain handler in process context
scsi: mpt3sas: Fix out-of-bounds cpu_msix_table read on CPU hotplug
scsi: pm8001: Offset hardware queue index for MSI-X pre-vector
[10 lines not shown]
Merge tag 'block-7.4-20261127' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux
Pull block fixes from Jens Axboe:
- Fix discard splitting for non-power-of-two granularities, as dm-thin
otherwise never saw a complete block and left the mapping allocated
- Reject a zero-length BLKSECDISCARD range, which otherwise invalidated
the entire page cache of the device
- Bounce user PI buffers for writes when the integrity profile remaps
reference tags, as the remap otherwise wrote to pages the caller only
mapped for reading
- ublk selftests build fix
* tag 'block-7.4-20261127' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux:
block: bounce user PI when writes may remap reference tags
block: fix BLKSECDISCARD zero-length range causing page cache invalidation
[2 lines not shown]
Merge tag 'spi-fix-v7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fix from Mark Brown:
"One Qualcomm specific driver fix that fixes issues reproduced on
actual hardware that could cause data corruption with some client
drivers that use an unusual bits per word configuration"
* tag 'spi-fix-v7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: geni-qcom: Fix sub-byte transfer packing and length calculation