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
Merge tag 'cifs-fixes-7.4-rc5' of https://git.manguebit.org/linux
Pull smb client fixes from Paulo Alcantara:
- Fix cifs_sb->prepath being overwritten with UTF-8 bytes when a DFS
link is reconnected on a mount with a non-utf8 iocharset, which made
lookups fail with -ENOENT
- Fix the DFS target node name being copied into the UNC and prepath
in the cache charset on mount, which made the mount fail with
-ENOENT on non-utf8 iocharset mounts
- Fix a use-after-free of the server in smb2_reconnect_server(), which
unlocked reconnect_mutex after dropping the session reference on the
terminate path
- Fix file name conversion on big-endian systems, where the temporary
UTF-16 buffers were not in CPU byte order
[9 lines not shown]
Merge tag 'efi-fixes-for-v7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi
Pull EFI fixes from Ard Biesheuvel:
- Mark some EFI config table types as unusable after kexec on x86
- Revert a module parameter hack in efi-pstore
- Use the right memory attributes for MMIO runtime regions on RISC-V
- Fix a memory corruption issue when calling the Apple properties
protocol from the x86 EFI stub
- Other non-critical build and runtime fixes
* tag 'efi-fixes-for-v7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
efi: pstore: Make pstore_disable parameter read-only again
efi/libstub: loongarch: Provide 64-bit integer shift helpers for 32-bit
efi: Statically initialize efivar_ops_nh
[10 lines not shown]
Merge tag 'watchdog-for-v7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull watchdog fixes from Guenter Roeck:
- core: return 0 from watchdog_get_timeleft() when neither WDOG_ACTIVE
nor WDOG_HW_RUNNING is set instead of calling ->get_timeleft(),
avoiding hardware accesses on stopped watchdogs (such as external
aborts in omap_wdt via sysfs timeleft or WDIOC_GETTIMELEFT)
- intel_oc_wdt: add noirq suspend/resume callbacks to stop a running,
unlocked watchdog during system sleep (including firmware-started
watchdogs) so it does not reset the machine in suspend-to-idle, and
restore the configured timeout and restart it on resume
- sp805: keep the clock prepared from probe and call clk_enable() in
the atomic restart handler so reboot still works after the watchdog
has been stopped and its clock disabled
- dt-bindings: reference /schemas/arm/primecell.yaml# in arm,sp805.yaml
[7 lines not shown]
Merge tag 'dmaengine-fix-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine fixes from Vinod Koul:
- A bunch of error handling leak fixes in stm, rcar drivers
- Minor number handling fix in idxd driver
- ABI version fix in documentation for idxd
* tag 'dmaengine-fix-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
dmaengine: rcar-dmac: Remove redundant dev_err()/dev_err_probe()
dmaengine: rcar-dmac: Add missing dma_descriptor_unmap()
dmaengine: rcar-dmac: Fix PM usage counter imbalance
Documentation: ABI: sysfs-driver-dma-idxd: Fix the kernel version 6.20.0
dmaengine: idxd: Free the minor number when cdev setup fails
dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend
Merge tag 'phy-fixes-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
Pull phy fixes from Vinod Koul:
- A bunch of error handling fixes for ingenic, ti, rockchip etc drivers
- Revert of skipping phy reset in Qualcomm pcie driver and revert of
freescale hdmi default rate due to reported regressions
* tag 'phy-fixes-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
phy: rockchip: inno-hdmi: Fix potential stale clock provider
phy: rockchip: snps-pcie3: Raise the SRAM init timeout
phy: Revert "phy: freescale: fsl-samsung-hdmi: initialize default rate"
phy: freescale: phy-fsl-imx8-mipi-dphy: Fix hs_zero underflow
phy: phy-bcm-ns2-usbdrd: cancel extcon work on unbind to avoid use-after-free
phy: PHY_GOOGLE_USB should depend on ARCH_GOOGLE
phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent OOB access
phy: rockchip: naneng-combphy: Fix overwritten PLL SSC control bit
Revert "phy: qcom: qmp-pcie: Skip PHY reset if already up"
[6 lines not shown]
Merge tag 'soundwire-7.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire
Pull soundwire fix from Vinod Koul:
"A single qualcomm driver fix to disable the interrupt before
clock gating"
* tag 'soundwire-7.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
soundwire: qcom: disable the interrupt before gating the clock
dt-bindings: watchdog: arm,sp805: reference the PrimeCell binding
Unlike the other PrimeCell bindings, the binding ends in
unevaluatedProperties: false without referencing
/schemas/arm/primecell.yaml#, so arm,primecell-periphid is not an
evaluated property on an arm,sp805 node. Two nodes in the tree carry
that property regardless -- watchdog at a2c000 in hisi-x5hd2.dtsi and
watchdog at 8000 in mps2.dtsi.
`make CHECK_DTBS=y`:
watchdog at a2c000 (arm,sp805): Unevaluated properties are not allowed
('arm,primecell-periphid' was unexpected)
Add the reference so the property becomes evaluable; both nodes then
validate.
Fixes: 73d3e43f9813 ("dt-bindings: watchdog: sp-805: Convert to Json-schema")
Cc: stable at vger.kernel.org
[5 lines not shown]
block: bounce user PI when writes may remap reference tags
On an io_uring O_DIRECT write, bio_integrity_map_user() can attach the
caller's protection information (PI) buffer directly to the bio. The
block layer pins the pages for reading, but reference-tag remapping can
write to those same pages.
A caller with write access to a block device whose integrity profile
enables reference-tag remapping can therefore modify a page it can
only map for reading. In testing, remapping changed a tag in the page
cache of a read-only file. With a PI buffer backed by the shared zero
page, the kernel faulted during remapping.
Use the existing bounce-buffer path for REQ_OP_WRITE when the queue's
integrity profile has BLK_INTEGRITY_REF_TAG set. This copies the PI
buffer into kernel memory before remapping, so the caller's buffer
retains its original reference tags.
I found this issue during a source review assisted by an LLM.
[10 lines not shown]
Merge tag 'io_uring-7.4-20261127' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux
Pull io_uring fixes from Jens Axboe:
"io_uring fixes for this week - bigger than I'd like at this point, but
that's mostly looking at the commit count. The fixes are all pretty
small and isolated. This contains:
- Don't charge the whole folio offset to the skb truesize for managed
frags, as a registered buffer backed by huge pages otherwise looked
like a full socket long before any real memory was used.
- recvmsg retry fixes: don't copy msg_name again on a retry, and
restore the cmsg buffer before a retry.
- Clear REQ_F_BL_NO_RECYCLE when the buffers it was set for are put,
fixing a NULL pointer dereference in bundle receive with
MSG_WAITALL.
- Free the ring from an RCU work, fixing a use-after-free of the ctx
[33 lines not shown]
Merge tag 'hwmon-for-v7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck:
- Fix a v7.4-rc2 regression in aquacomputer_d5next that rejected
single-collection Aquaero sensor interfaces during probe by only
checking collection[1].type when maxcollection > 1.
- Fix peak value tracking for IEEE-754 half-precision chips
(LT7170/LT7171) in pmbus/ltc2978: compare binary16 values as
sign-magnitude integers instead of decoding them as LINEAR11, and use
-infinity/+infinity for peak initialization and reset values.
- Fix ACPI fan paths for the Lenovo Yoga Pro 7 14IAH10 in yogafan by
using the dual-fan FA1S/FA2S configuration instead of the nonexistent
FANS path, and update the driver documentation table to match.
- Add the missing platform:cgbc-hwmon module alias to cgbc-hwmon so the
driver autoloads when built as a module.
[6 lines not shown]