]> git.ipfire.org Git - thirdparty/kernel/stable.git/log
thirdparty/kernel/stable.git
4 days agofuse: change ring->fc to ring->chan
Miklos Szeredi [Tue, 31 Mar 2026 14:57:50 +0000 (16:57 +0200)] 
fuse: change ring->fc to ring->chan

Store pointer to struct fuse_chan instead of struct fuse_conn in fuse_ring.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: remove fuse_mutex protection from fuse_dev_ioctl_sync_init()
Miklos Szeredi [Tue, 31 Mar 2026 14:32:21 +0000 (16:32 +0200)] 
fuse: remove fuse_mutex protection from fuse_dev_ioctl_sync_init()

In normal use ioctl(FUSE_DEV_IOC_SYNC_INIT) comes before the mount() or
fsconfig() syscalls, they are executed strictly serially.

If ioctl and mount are performed in parallel, the behavior is
nondeterministic.  Removing the mutex does not change this.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: set params in fuse_chan_set_initialized()
Miklos Szeredi [Tue, 31 Mar 2026 13:50:29 +0000 (15:50 +0200)] 
fuse: set params in fuse_chan_set_initialized()

Set minor, max_write and max_pages in the fuse_chan.  These match the same
fields in fuse_conn but are needed in both layers.

[Dongyang Jin: Pointers should use NULL instead of explicit '0']

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: create notify.c
Miklos Szeredi [Tue, 31 Mar 2026 12:50:24 +0000 (14:50 +0200)] 
fuse: create notify.c

Move FUSE_NOTIFY_* handling into a separate source file.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: create poll.c
Miklos Szeredi [Tue, 31 Mar 2026 11:49:22 +0000 (13:49 +0200)] 
fuse: create poll.c

Move f_op->poll related functions to the new source file.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: change fud->fc to fud->chan
Miklos Szeredi [Mon, 30 Mar 2026 12:27:23 +0000 (14:27 +0200)] 
fuse: change fud->fc to fud->chan

Store pointer to struct fuse_chan instead of struct fuse_conn in fuse_dev.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: split out filesystem part of request sending
Miklos Szeredi [Mon, 30 Mar 2026 10:58:19 +0000 (12:58 +0200)] 
fuse: split out filesystem part of request sending

Create a new source file: req.c and add the request sending entry
functions:

  __fuse_simple_request()
  fuse_simple_background()
  fuse_simple_notify_reply()

Introduce transport layer sending functions that are called by the
respective fs layer function:

  fuse_chan_send()
  fuse_chan_send_bg()
  fuse_chan_send_notify_reply()

Move calculation of request header fields uid, gid and pid from
fuse_get_req() and fuse_force_creads() to a new helper: fuse_fill_creds().

These fileds are now passed to the transport layer via struct fuse_args.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: change req->fm to req->chan
Miklos Szeredi [Mon, 30 Mar 2026 10:36:59 +0000 (12:36 +0200)] 
fuse: change req->fm to req->chan

Store a struct fuse_chan pointer in fuse_req instead of a struct fuse_mount
pointer.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: remove fm arg of args->end callback
Miklos Szeredi [Thu, 26 Mar 2026 15:11:52 +0000 (16:11 +0100)] 
fuse: remove fm arg of args->end callback

Only used by FUSE_INIT and CUSE_INIT, these can store the relevant pointer
in their structs derived from fuse_args.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: split off fuse_args and related definitions into a separate header
Miklos Szeredi [Thu, 26 Mar 2026 13:47:20 +0000 (14:47 +0100)] 
fuse: split off fuse_args and related definitions into a separate header

This is going to be used by both layers (transport and filesystem)

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: abort related layering cleanup
Miklos Szeredi [Tue, 24 Mar 2026 15:12:28 +0000 (16:12 +0100)] 
fuse: abort related layering cleanup

 - rename fuse_abort_conn() to fuse_chan_abort(), pass fuse_chan pointer
   instead of fuse_conn

 - pass an abort_with_err argument that tells fuse_dev_(read|write) to
   return with ECONNABORTED instead of ENODEV

 - move fc->aborted to fch->abort_with_err

 - rename fuse_wait_aborted() to fuse_chan_wait_aborted()

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: remove #include "fuse_i.h" from "req_timeout.c"
Miklos Szeredi [Tue, 24 Mar 2026 12:16:34 +0000 (13:16 +0100)] 
fuse: remove #include "fuse_i.h" from "req_timeout.c"

Just need to move fuse_abort_conn().

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: remove #include "fuse_i.h" from "dev_uring_i.h"
Miklos Szeredi [Tue, 24 Mar 2026 12:07:07 +0000 (13:07 +0100)] 
fuse: remove #include "fuse_i.h" from "dev_uring_i.h"

Start getting rid of fs layer stuff from transport layer files.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move fuse_dev_waitq to dev.c
Miklos Szeredi [Thu, 19 Mar 2026 14:49:56 +0000 (15:49 +0100)] 
fuse: move fuse_dev_waitq to dev.c

Move wake_up_all(&fuse_dev_waitq) into fuse_dev_install() where it
logically belongs.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move forget related struct and helpers
Miklos Szeredi [Tue, 31 Mar 2026 11:18:27 +0000 (13:18 +0200)] 
fuse: move forget related struct and helpers

Move:
 - struct fuse_forget_link to fuse_dev_i.h
 - fuse_alloc_forget() to dev.c/dev.h

Rename:
 - fuse_queue_forget -> fuse_chan_queue_forget

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: don't access transport layer structs directly from the fs layer
Miklos Szeredi [Thu, 19 Mar 2026 14:40:10 +0000 (15:40 +0100)] 
fuse: don't access transport layer structs directly from the fs layer

Add helpers (get and set functions mainly) that cleanly separate the
layers.

Remove #include "fuse_dev_i.h" from:

 - inode.c
 - file.c
 - control.c

Remove #include "dev_uring_i.h" from inode.c.

[Li Wang: drop redundant initializer in process_init_limits()]

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move struct fuse_req and related to fuse_dev_i.h
Miklos Szeredi [Thu, 19 Mar 2026 10:57:10 +0000 (11:57 +0100)] 
fuse: move struct fuse_req and related to fuse_dev_i.h

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move request timeout to fuse_chan
Miklos Szeredi [Wed, 18 Mar 2026 17:01:27 +0000 (18:01 +0100)] 
fuse: move request timeout to fuse_chan

Move:

 - timeout

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: add back pointer from fuse_chan to fuse_conn
Miklos Szeredi [Wed, 18 Mar 2026 16:49:01 +0000 (17:49 +0100)] 
fuse: add back pointer from fuse_chan to fuse_conn

Will be needed by callbacks from the transport layer to the fs layer.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: split off fch->lock from fc->lock
Miklos Szeredi [Tue, 17 Mar 2026 15:32:37 +0000 (16:32 +0100)] 
fuse: split off fch->lock from fc->lock

And document which members they protect.

end_polls() is called with both, outer fch->lock is probably unnecessary,
but doesn't hurt for now.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move interrupt related members to fuse_chan
Miklos Szeredi [Tue, 31 Mar 2026 13:05:51 +0000 (15:05 +0200)] 
fuse: move interrupt related members to fuse_chan

Move:

 - no_interrupt

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move io_uring related members to fuse_chan
Miklos Szeredi [Tue, 17 Mar 2026 14:29:04 +0000 (15:29 +0100)] 
fuse: move io_uring related members to fuse_chan

Move:

 - io_uring
 - ring

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move request blocking related members to fuse_chan
Miklos Szeredi [Tue, 17 Mar 2026 13:48:33 +0000 (14:48 +0100)] 
fuse: move request blocking related members to fuse_chan

Move:

 - initialized
 - blocked
 - blocked_waitq
 - connected
 - num_waiting

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move background queuing related members to fuse_chan
Miklos Szeredi [Tue, 17 Mar 2026 13:34:20 +0000 (14:34 +0100)] 
fuse: move background queuing related members to fuse_chan

Move:

 - max_background
 - num_background
 - active_background
 - bg_queue
 - bg_lock

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move 'devices' member from fuse_conn to fuse_chan
Miklos Szeredi [Tue, 17 Mar 2026 12:09:20 +0000 (13:09 +0100)] 
fuse: move 'devices' member from fuse_conn to fuse_chan

This belongs in the transport layer.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move fuse_dev and fuse_pqueue to dev.c
Miklos Szeredi [Tue, 17 Mar 2026 11:44:31 +0000 (12:44 +0100)] 
fuse: move fuse_dev and fuse_pqueue to dev.c

Move function definitions to dev.c, struct definitions to fuse_dev_i.h.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move fuse_iqueue to fuse_chan
Miklos Szeredi [Tue, 17 Mar 2026 11:08:00 +0000 (12:08 +0100)] 
fuse: move fuse_iqueue to fuse_chan

Move the 'fiq' member from fuse_conn to fuse_chan.

Move iqueue related structure definitions and function declarations from
"fuse_i.h" to "fuse_dev_i.h".

Add a fuse_dev_chan_new() helper, that returns a fuse_chan initialized with
the fuse_dev_fiq_ops.

Add a fuse_chan_release() function, that calls fiq->ops->release().

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: add struct fuse_chan
Miklos Szeredi [Tue, 17 Mar 2026 11:00:29 +0000 (12:00 +0100)] 
fuse: add struct fuse_chan

The goal is to separate transport layer stuff out from struct fuse_conn,
leaving just the filesystem related members.

Add a new object referenced from fuse_conn.  This patch just implements the
allocation and freeing of this object.

Following patches will move transport related members from fuse_conn to
fuse_chan.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: move request timeout code to a new source file
Miklos Szeredi [Tue, 10 Mar 2026 15:45:20 +0000 (16:45 +0100)] 
fuse: move request timeout code to a new source file

This marks the first step in cleanly separating the transport layer from
the filesystem layer.

Add "dev.h", which will contain the interface definition for the transport
layer.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: fix io-uring background queue dispatch on request completion
Joanne Koong [Wed, 8 Apr 2026 17:25:10 +0000 (10:25 -0700)] 
fuse: fix io-uring background queue dispatch on request completion

When a background request completes via the io_uring path, the
background queue gets flushed to dispatch pending background requests,
but this is done before the connection-level background counters
(fc->num_background, fc->active_background) are properly accounted,
which may reduce effective queue depth to one.

The connection-level counters are decremented in fuse_request_end(), but
flush_bg_queue() flushes the /dev/fuse path queue (fc->bg_queue), not
the io_uring per-queue bg one, which means pending uring background
requests on the queue are never dispatched in this path.

Fix this by accounting the connection-level background counters first
before flushing the queue's background queue. Since
fuse_request_bg_finish() clears FR_BACKGROUND, fuse_request_end() will
skip the background cleanup branch entirely, which avoids any
double-decrements; it will call the wake_up(&req->waitq) branch but this
is effectively a no-op as background requests have no waiters on
req->waitq.

Reviewed-by: Bernd Schubert <bernd@bsbernd.com>
Fixes: 857b0263f30e ("fuse: Allow to queue bg requests through io-uring")
Cc: stable@vger.kernel.org
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: fix device node leak in cuse_process_init_reply()
Alberto Ruiz [Wed, 8 Apr 2026 15:23:40 +0000 (17:23 +0200)] 
fuse: fix device node leak in cuse_process_init_reply()

If device_add() succeeds during CUSE initialization but a subsequent
step (cdev_alloc() or cdev_add()) fails, the error path calls
put_device() without first calling device_del().  This leaks the
devtmpfs entry created by device_add(), leaving a stale /dev/<name>
node that persists until reboot.

Since the cuse_conn is never linked into cuse_conntbl on the failure
path, cuse_channel_release() sees cc->dev == NULL and skips
device_unregister(), so no other code path cleans up the node.

This has several consequences:

 - The device name is permanently poisoned: any subsequent attempt to
   create a CUSE device with the same name hits the stale sysfs entry,
   device_add() fails, and the new device is aborted.

 - The collision manifests as ENODEV returned to userspace with no
   dmesg diagnostic, making it very difficult to debug.

 - The failure is self-perpetuating: once a name is leaked, all future
   attempts with that name fail identically.

Fix this by introducing an err_dev label that calls device_del() to
undo device_add() before falling through to err_unlock.  The existing
err_unlock path from a device_add() failure correctly skips device_del()
since the device was never added.

Testing instructions can be found at the lore link below.

Link: https://lore.kernel.org/all/20260408-wip-cuse-leak-fix-v1-0-1c028d575e97@redhat.com/
Signed-off-by: Alberto Ruiz <aruiz@redhat.com>
Fixes: 151060ac1314 ("CUSE: implement CUSE - Character device in Userspace")
Cc: stable@vger.kernel.org
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: do not use start_removing_noperm()
Miklos Szeredi [Wed, 10 Jun 2026 11:02:53 +0000 (13:02 +0200)] 
fuse: do not use start_removing_noperm()

Revert the fuse part of commit c9ba789dad15 ("VFS: introduce
start_creating_noperm() and start_removing_noperm()").

Commit c9ba789dad15 ("VFS: introduce start_creating_noperm() and
start_removing_noperm()") caused a regression in FUSE_NOTIFY_INVAL_ENTRY,
which failed to invalidate negative dentries.

This manifests in the filesystem returning -ENOENT for operations on an
existing file.

Fixing it properly while still keeping the start_removing* infrastructure
would add much additional complexity.

Instead revert to the original simple implementation.

The start_removing* infrastructure is needed in VFS to abstract the
filesystem locking.  However filesystem code can still safely use the raw
locking primitives without affacting other filesystems.

This is part two of the revert.

Reported-by: Артем Лабазов <123321artyom@gmail.com>
Closes: https://lore.kernel.org/all/CAFbF8N7++zopZuEcsKRxBV_sgOGCbzCY0hOyMw1SiGAtuzGhyQ@mail.gmail.com/
Fixes: c9ba789dad15 ("VFS: introduce start_creating_noperm() and start_removing_noperm()")
Cc: stable@vger.kernel.org # 6.19
Cc: NeilBrown <neilb@ownmail.net>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agoRevert "fuse: fix conversion of fuse_reverse_inval_entry() to start_removing()"
Miklos Szeredi [Wed, 10 Jun 2026 10:57:21 +0000 (12:57 +0200)] 
Revert "fuse: fix conversion of fuse_reverse_inval_entry() to start_removing()"

This reverts commit cab012375122304a6343c1ed09404e5143b9dc01.

Commit c9ba789dad15 ("VFS: introduce start_creating_noperm() and
start_removing_noperm()") caused a regression in FUSE_NOTIFY_INVAL_ENTRY,
which failed to invalidate negative dentries.

This manifests in the filesystem returning -ENOENT for operations on an
existing file.

Fixing it properly while still keeping the start_removing* infrastructure
would add much additional complexity.

Instead revert to the original simple implementation.

The start_removing* infrastructure is needed in VFS to abstract the
filesystem locking.  However filesystem code can still safely use the raw
locking primitives without affacting other filesystems.

This is part one of the revert.

Reported-by: Артем Лабазов <123321artyom@gmail.com>
Closes: https://lore.kernel.org/all/CAFbF8N7++zopZuEcsKRxBV_sgOGCbzCY0hOyMw1SiGAtuzGhyQ@mail.gmail.com/
Fixes: c9ba789dad15 ("VFS: introduce start_creating_noperm() and start_removing_noperm()")
Cc: stable@vger.kernel.org # 6.19
Cc: NeilBrown <neilb@ownmail.net>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: avoid 32-bit prune notification count wrap
Samuel Moelius [Wed, 10 Jun 2026 00:37:18 +0000 (00:37 +0000)] 
fuse: avoid 32-bit prune notification count wrap

FUSE_NOTIFY_PRUNE validates the nodeid payload length with:

    size - sizeof(outarg) != outarg.count * sizeof(u64)

On 32-bit kernels, size_t is also 32 bits, so the daemon-controlled
count multiplication can wrap.  A prune notification with count
0x20000000 and no nodeid payload passes the check, enters the copy
loop, and asks the device copy path to read nodeids that are not
present in the userspace write buffer.  In QEMU this reaches the
fuse_copy_fill() BUG_ON(!err) path.

Validate the payload length with array_size() instead.  That accepts
exactly the same valid messages, but avoids wrapping arithmetic before
the copy loop consumes the count.

Assisted-by: Codex:gpt-5.5-cyber-preview
Fixes: 3f29d59e92a9 ("fuse: add prune notification")
Cc: stable@vger.kernel.org
Signed-off-by: Samuel Moelius <sam.moelius@trailofbits.com>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: remove request-less entries from ent_w_req_queue to fix NULL deref
Joanne Koong [Tue, 9 Jun 2026 21:36:58 +0000 (14:36 -0700)] 
fuse-uring: remove request-less entries from ent_w_req_queue to fix NULL deref

If a copy into the userspace ring buffer fails, a request will be
terminated and fuse_uring_req_end() will set ent->fuse_req to NULL but
it will leave the entry on ent_w_req_queue in FRRS_FUSE_REQ state. This
can lead to a NULL deref if the request expiration logic scans
ent_w_req_queue in the window before the entry is moved off it.

Fix this by taking the entry off ent_w_req_queue and changing its state
from FRRS_FUSE_REQ to FRRS_INVALID before terminating the request.

Fixes: 4fea593e625c ("fuse: optimize over-io-uring request expiration check")
Cc: stable@kernel.org
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: clear intr_entry in fuse_resend and fuse_remove_pending_req
Ji'an Zhou [Tue, 9 Jun 2026 09:58:51 +0000 (09:58 +0000)] 
fuse: clear intr_entry in fuse_resend and fuse_remove_pending_req

When fuse_resend() moves a request from fpq->processing back to
fiq->pending, it sets FR_PENDING and clears FR_SENT but does not
remove the requests intr_entry from fiq->interrupts.  If the
request had FR_INTERRUPTED set from a prior signal, intr_entry
remains dangling on fiq->interrupts.  When the requesting task
then receives a fatal signal, fuse_remove_pending_req() sees
FR_PENDING=1, removes the request from fiq->pending and frees it
via the refcount path, also without cleaning intr_entry.  The
stale intr_entry causes use-after-free when fuse_read_interrupt()
iterates fiq->interrupts:
  - list_del_init(&req->intr_entry) -> UAF write on freed slab
  - req->in.h.unique -> UAF read, data leaked to userspace

Remove intr_entry from fiq->interrupts in fuse_resend() for
interrupted requests before they are placed back on fiq->pending.

Add a WARN_ON if the intr_entry is not empty on request destruction.

Fixes: 760eac73f9f6 ("fuse: Introduce a new notification type for resend pending requests")
Cc: stable@vger.kernel.org # 6.9
Signed-off-by: Ji'an Zhou <eilaimemedsnaimel@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: make a fuse_req on SQE commit only findable after memcpy
Bernd Schubert [Mon, 8 Jun 2026 21:03:45 +0000 (23:03 +0200)] 
fuse-uring: make a fuse_req on SQE commit only findable after memcpy

Bad userspace might try to trick us and send commit SQEs request
unique / commit-id of requests that are not even send to
fuse-server (io_uring_cmd_done() not called) yet.

fuse_uring_commit_fetch() ends the fuse request when the ring entry
has a wrong state, but that could have caused a use-after-free
with the memcpy operations in fuse_uring_send_in_task().
In order to avoid such races the call of fuse_uring_add_to_pq()
is moved after the copy operations and just before completing
the io-uring request - malicious userspace cannot find the request
anymore until all prepration work in fuse-client/kernel is completed.

This also moves fuse_uring_add_to_pq() a bit up in the code to
avoid a forward declaration. Also not with a preparation commit,
to make it easier to back port to older kernels.

Reported-by: xlabai <xlabai@tencent.com>
Reported-by: Berkant Koc <me@berkoc.com>
Fixes: c090c8abae4b6b ("fuse: Add io-uring sqe commit and fetch support")
Cc: stable@kernel.org # 6.14
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: Avoid queue->stopped races and set/read that value under lock
Bernd Schubert [Mon, 8 Jun 2026 21:03:44 +0000 (23:03 +0200)] 
fuse-uring: Avoid queue->stopped races and set/read that value under lock

There are several readers of queue->stopped that check the value
under lock, but fuse_uring_commit_fetch() did not and actually
the value was not set under the lock in fuse_uring_abort_end_requests()
either. Especially in fuse_uring_commit_fetch it is important
to check under a lock, because due to races 'struct fuse_req'
might be freed with fuse_request_end, but another thread/cpu
might already do teardown work.

Cc: stable@kernel.org # 6.14
Fixes: 4a9bfb9b6850fec ("fuse: {io-uring} Handle teardown of ring entries")
Reported-by: Berkant Koc <me@berkoc.com>
Reported-by: xlabai <xlabai@tencent.com>
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: Avoid use-after-free in fuse_uring_async_stop_queues
Bernd Schubert [Mon, 8 Jun 2026 21:03:43 +0000 (23:03 +0200)] 
fuse-uring: Avoid use-after-free in fuse_uring_async_stop_queues

fuse_uring_async_stop_queues() might run when the last reference
on ring->queue_refs was already dropped.

In order to avoid an early destruction a reference on struct fuse_conn
is now taken before starting fuse_uring_async_stop_queues() and that
reference is only released when that delayed work queue terminates.

Fixes: 4a9bfb9b6850 ("fuse: {io-uring} Handle teardown of ring entries")
Cc: stable@kernel.org # 6.14
Reported-by: Berkant Koc <me@berkoc.com>
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: end fuse_req on io-uring cancel task work
Chris Mason [Tue, 9 Jun 2026 00:28:55 +0000 (17:28 -0700)] 
fuse-uring: end fuse_req on io-uring cancel task work

When io_uring delivers task work with tw.cancel set (PF_EXITING,
PF_KTHREAD fallback, or percpu_ref_is_dying on the ring context),
fuse_uring_send_in_task() takes the cancel branch, assigns
-ECANCELED, and falls through to fuse_uring_send(). That path only
flips the entry to FRRS_USERSPACE and completes the io_uring cmd;
it never discharges the ring entry's owning reference to the
fuse_req that fuse_uring_add_req_to_ring_ent() handed it at
dispatch time.

    fuse_uring_send_in_task()
      tw.cancel == true
        err = -ECANCELED
      fuse_uring_send(ent, cmd, err, issue_flags)
        ent->state = FRRS_USERSPACE
        list_move(&ent->list, &queue->ent_in_userspace)
        ent->cmd = NULL
        io_uring_cmd_done(-ECANCELED)
        /* ent->fuse_req still set, req still hashed */

The fuse_req stays linked on fpq->processing[hash] and
fuse_request_end() is never invoked. The originating syscall
thread blocks in D-state in request_wait_answer() until
fuse_abort_conn() runs, which can be the entire connection
lifetime. For FR_BACKGROUND requests fc->num_background is never
decremented either, so repeated cancels inflate the counter until
max_background is hit and all later background ops stall. tw.cancel does
not imply a connection abort (e.g. a single io_uring worker thread exits
while the fuse connection stays up), so this cannot be left for
fuse_abort_conn() to clean up.

Ending the req but still routing the entry through fuse_uring_send()
is not enough: that leaves a req-less entry on ent_in_userspace, and
ent_list_request_expired() dereferences ent->fuse_req unconditionally
on the head of that list, which would then NULL-deref.

Fix the cancel branch to release the entry directly. Remove it from the
queue, complete the io_uring cmd, end the fuse_req, free the entry, and
drop its queue_refs (waking the teardown waiter if it was the last).

Fixes: c2c9af9a0b13 ("fuse: Allow to queue fg requests through io-uring")
Cc: stable@vger.kernel.org
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Assisted-by: kres (claude-opus-4-7)
Signed-off-by: Chris Mason <clm@meta.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: fix moving cancelled entry to ent_in_userspace list
Joanne Koong [Mon, 8 Jun 2026 19:21:49 +0000 (12:21 -0700)] 
fuse-uring: fix moving cancelled entry to ent_in_userspace list

fuse_uring_cancel() moves entries that are available (these have no reqs
attached) to the ent_in_userspace list. ent_list_request_expired()
checks the first entry on ent_in_userspace and dereferences
ent->fuse_req unconditionally, which will crash on a cancelled entry
that was moved to this list.

Fix this by freeing the entry and dropping queue_refs directly in
fuse_uring_cancel(). This is safe because cancel is the cancel handler
itself - after io_uring_cmd_done(), no more cancels will be dispatched
for this command, and teardown serializes with cancel via queue->lock.

Since cancel now decrements queue_refs, fuse_uring_abort() must no
longer gate fuse_uring_abort_end_requests() on queue_refs > 0, as
cancelled entries may have already dropped queue_refs while requests are
still queued. Remove the gate so abort always flushes requests and stops
queues.

Reported-by: Heechan Kang <gganji11@naver.com>
Tested-by: Heechan Kang <gganji11@naver.com>
Reviewed-by: Bernd Schubert <bernd@bsbernd.com>
Fixes: 4fea593e625c ("fuse: optimize over-io-uring request expiration check")
Cc: stable@vger.kernel.org
Suggested-by: Jian Huang Li <ali@ddn.com>
Suggested-by: Horst Birthelmer <horst@birthelmer.de>
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: check connection abort during ring creation
Joanne Koong [Mon, 8 Jun 2026 19:21:48 +0000 (12:21 -0700)] 
fuse-uring: check connection abort during ring creation

Check fch->connected under fch->lock in fuse_uring_create() before
attaching a new ring. Without this, a race between fuse_uring_create()
and fuse_chan_abort() can result in the ring, queue, and fpq.processing
table being created after fuse_uring_abort() has already run, leading
to unnecessary allocation and teardown. These are eventually cleaned up
by fuse_uring_destruct() but will linger until the process exits, even
with the connection aborted.

Reviewed-by: Bernd Schubert <bernd@bsbernd.com>
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: fix race between registration and connection abortion
Joanne Koong [Mon, 8 Jun 2026 19:21:47 +0000 (12:21 -0700)] 
fuse-uring: fix race between registration and connection abortion

This fixes this race:
- thread a: io_uring_enter -> register sqe ->
  fuse_uring_create_ring_ent -> allocate ent but doesn't grab queue_ref
  yet
- thread b: fuse_conn_destroy() -> fuse_chan_abort() ->
  fuse_uring_abort() is a no-op due to queue ref being 0
- thread a: grabs the queue_ref, queue_ref is now 1, rest of
  fuse_uring_do_register() logic executes
- thread b: fuse_chan_abort() returns, fuse_chan_wait_aborted() now runs
  and calls
  "wait_event(ring->stop_waitq, atomic_read(&ring->queue_refs) == 0);"
The abort/unmount thread will hang indefinitely in unkillable state as
nothing will decrement queue_refs or wake stop_waitq, and the ring,
queue, and ent are leaked.

Fix this by checking fch->connected under fch->lock after the created
ent has grabbed a ref count on the queue. This ensures that in the
scenario above, it is guaranteed that we either release the queue ref
and wake up stop_waitq (in case fuse_chan_wait_aborted() is already
waiting) in fuse_uring_do_register() when we detect !fch->connected, or
if the connection is aborted after the check, it is guaranteed that the
async teardown worker will be running in the background cleaning up ents
and decrementing the ent's ref on the queue, which will unblock the
eventual queue and ring teardown.

Fixes: 24fe962c86f5 ("fuse: {io-uring} Handle SQEs - register commands")
Cc: stable@vger.kernel.org
Reviewed-by: Bernd Schubert <bernd@bsbernd.com>
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: fix data races on ring->ready
Chris Mason [Fri, 5 Jun 2026 19:27:07 +0000 (12:27 -0700)] 
fuse-uring: fix data races on ring->ready

On weakly-ordered architectures, the store to fiq->ops can be
reordered past the store to ring->ready, allowing a CPU that sees
ring->ready == true via fuse_uring_ready() to dispatch requests
through a stale fiq->ops pointer. Upgrade the store to
smp_store_release() and the load in fuse_uring_ready() to
smp_load_acquire() so that the preceding WRITE_ONCE(fiq->ops, ...)
is visible to any CPU that observes ring->ready == true.

Additionally, fuse_uring_do_register() publishes ring->ready with
WRITE_ONCE() but the fast-path check reads it with a plain load.
This is a marked-vs-unmarked access that KCSAN will flag. Wrap it in
READ_ONCE() to mark it without adding unnecessary ordering.

Also wrap the fc->ring load in fuse_uring_ready() in READ_ONCE() to
prevent the compiler from reloading it between the NULL check and the
dereference.

Fixes: c2c9af9a0b13 ("fuse: Allow to queue fg requests through io-uring")
Cc: stable@vger.kernel.org
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Assisted-by: kres (claude-opus-4-7)
Signed-off-by: Chris Mason <clm@meta.com>
Reviewed-by: Bernd Schubert <bernd@bsbernd.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse-uring: fix EFAULT clobber in fuse_uring_commit
Chris Mason [Fri, 5 Jun 2026 19:27:06 +0000 (12:27 -0700)] 
fuse-uring: fix EFAULT clobber in fuse_uring_commit

copy_from_user() returns the number of bytes not copied as an unsigned
residual on failure (1..sizeof(struct fuse_out_header)). fuse_uring_commit
stores that residual in ssize_t err, sets req->out.h.error to -EFAULT,
then jumps to out: with err still holding the positive residual.

    err = copy_from_user(&req->out.h, &ent->headers->in_out,
                         sizeof(req->out.h));
    if (err) {
        req->out.h.error = -EFAULT;
        goto out;          /* err is the positive residual */
    }
    ...
    out:
        fuse_uring_req_end(ent, req, err);

fuse_uring_req_end() then runs

    if (error)
        req->out.h.error = error;

which overwrites the just-assigned -EFAULT with the positive residual.
FUSE callers such as fuse_simple_request() test err < 0 to detect
failure, so the positive value is interpreted as success and the
caller proceeds with an uninitialised or partial req->out.args.

Fix by assigning err = -EFAULT in the failure branch before jumping
to out, so fuse_uring_req_end() receives a negative errno and sets
req->out.h.error to -EFAULT.

Fixes: c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")
Cc: stable@vger.kernel.org
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Assisted-by: kres (claude-opus-4-7)
Signed-off-by: Chris Mason <clm@meta.com>
Reviewed-by: Bernd Schubert <bernd@bsbernd.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agofuse: back uncached readdir buffers with pages
Matthew R. Ochs [Tue, 26 May 2026 15:20:21 +0000 (08:20 -0700)] 
fuse: back uncached readdir buffers with pages

Commit dabb90391028 ("fuse: increase readdir buffer size") changed
fuse_readdir_uncached() to size its temporary buffer from ctx->count.
This is useful for overlayfs and other in-kernel callers that use
INT_MAX to indicate an unlimited directory read.

The larger buffer is currently supplied as a kvec output argument. For
virtiofs, kvec arguments are copied through req->argbuf, which is
allocated with kmalloc(..., GFP_ATOMIC). A large uncached readdir buffer
can therefore require a multi-megabyte contiguous atomic allocation
before the request is queued.

Avoid the large bounce-buffer allocation by backing uncached readdir
output with pages and setting out_pages. Transports such as virtiofs can
then pass the pages as scatter-gather entries instead of copying the
output through argbuf.

Map the pages with vm_map_ram() only while parsing the returned dirents.
The existing parser can then continue to use a linear kernel mapping.

[SzM: separate allocation of pages into a helper function]

Fixes: dabb90391028 ("fuse: increase readdir buffer size")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agovirtiofs: fix UAF on submount umount
Miklos Szeredi [Thu, 28 May 2026 08:58:24 +0000 (10:58 +0200)] 
virtiofs: fix UAF on submount umount

iput() called from fuse_release_end() can Oops if the super block has
already been destroyed.  Normally this is prevented by waiting for
num_waiting to go down to zero before commencing with super block shutdown.

This only works, however, for the last submount instance, as the wait
counter is per connection, not per superblock.

Revert to using synchronous release requests for the auto_submounts case,
which is virtiofs only at this time.

Reported-by: Aurélien Bombo <abombo@microsoft.com>
Reported-by: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: Greg Kurz <gkurz@redhat.com>
Closes: https://github.com/kata-containers/kata-containers/issues/12589
Fixes: 26e5c67deb2e ("fuse: fix livelock in synchronous file put from fuseblk workers")
Cc: stable@vger.kernel.org
Reviewed-by: Greg Kurz <gkurz@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
4 days agoMerge tag 'memory-controller-drv-7.2-2' of https://git.kernel.org/pub/scm/linux/kerne...
Arnd Bergmann [Mon, 15 Jun 2026 11:46:01 +0000 (13:46 +0200)] 
Merge tag 'memory-controller-drv-7.2-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers

Memory controller drivers for v7.2, part two

A few improvements for Tegra Memory Controller drivers, including one
fix for UBSAN report for an older commit.

* tag 'memory-controller-drv-7.2-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: tegra234: drop dead NULL check in tegra234_mc_icc_aggregate()
  memory: tegra264: drop redundant tegra264_mc_icc_aggregate()
  memory: tegra186-emc: stop borrowing MC aggregate hook for EMC

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
4 days agoRevert "firmware: zynqmp: Add dynamic CSU register discovery and sysfs interface"
Arnd Bergmann [Mon, 15 Jun 2026 11:41:05 +0000 (13:41 +0200)] 
Revert "firmware: zynqmp: Add dynamic CSU register discovery and sysfs interface"

This reverts commit 47d7bca76dd4f36ba0525d761f247c76ec9e4b17, which was
merged by accident.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
4 days agoRevert "Documentation: ABI: add sysfs interface for ZynqMP CSU registers"
Arnd Bergmann [Mon, 15 Jun 2026 11:41:02 +0000 (13:41 +0200)] 
Revert "Documentation: ABI: add sysfs interface for ZynqMP CSU registers"

This reverts commit 8ebebccf1579f6ce92bde3ddbb13df12c080f647, which was
merged by accident.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
4 days agoALSA: hda/realtek: Add quirk for Lenovo Xiaoxin 14 GT
Viktor Menshin [Mon, 15 Jun 2026 09:25:15 +0000 (18:25 +0900)] 
ALSA: hda/realtek: Add quirk for Lenovo Xiaoxin 14 GT

The Lenovo Xiaoxin 14 GT (Chinese market model, AMD Ryzen AI 9 365)
produces constant electrical hissing and crackling noise from both
internal speakers and 3.5mm headphone jack during audio playback.
Audio works correctly on Windows.

The PCI SSID 17aa:3912 is not present in the quirk list. The device
shares the same AMD platform and ALC287 codec as neighboring Lenovo
14" AMD models (17aa:3911, 17aa:390d), so apply the same fixup.

Note: the fixup selection is based on similarity with neighboring
models and has not been verified by testing a compiled kernel.
Guidance from maintainers on the correct fixup is welcome.

Signed-off-by: Viktor Menshin <ripeeerr@gmail.com>
Link: https://patch.msgid.link/20260615092515.1082-1-ripeeerr@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 days agoMerge tag 'pull-fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Mon, 15 Jun 2026 10:23:57 +0000 (15:53 +0530)] 
Merge tag 'pull-fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/viro/vfs

Pull udf fix from Al Viro:
 "I just noticed that a udf fix had been sitting in #fixes since
  February; still applicable, Jan's Acked-by applied. Very belated pull
  request"

* tag 'pull-fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/viro/vfs:
  udf: fix nls leak on udf_fill_super() failure

4 days agoMerge tag 'x86-cpu-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip
Linus Torvalds [Mon, 15 Jun 2026 09:55:17 +0000 (15:25 +0530)] 
Merge tag 'x86-cpu-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull x86 cpuid updates from Ingo Molnar:

 - CPUID API updates (Ahmed S. Darwish):
    - Introduce a centralized CPUID parser
    - Introduce a centralized CPUID data model
    - Introduce <asm/cpuid/leaf_types.h>
    - Rename cpuid_leaf()/cpuid_subleaf() APIs
    - treewide: Explicitly include the x86 CPUID headers

 - Update to x86-cpuid-db v3.1 (Maciej Wieczor-Retman)

 - Continued removal of pre-i586 support and related simplifications
   (Ingo Molnar)

 - Add Intel CPU model number for rugged Panther Lake (Tony Luck)

 - Misc fixes, updates and cleanups by Arnd Bergmann, Chao Gao, Lukas
   Bulwahn, Sohil Mehta, Maciej Wieczor-Retman.

* tag 'x86-cpu-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (25 commits)
  x86/cpu: Make CONFIG_X86_CX8 unconditional
  x86/cpu: Remove unused !CONFIG_X86_TSC code
  x86/cpuid: Update bitfields to x86-cpuid-db v3.1
  tools/x86/kcpuid: Update bitfields to x86-cpuid-db v3.1
  x86/cpu: Make CONFIG_X86_TSC unconditional
  MAINTAINERS: Drop obsolete FPU EMULATOR section
  x86/cpu: Fix a F00F bug warning and clean up surrounding code
  x86/cpu: Add Intel CPU model number for rugged Panther Lake
  x86/cpuid: Introduce a centralized CPUID parser
  x86/cpu: Introduce a centralized CPUID data model
  x86/cpuid: Introduce <asm/cpuid/leaf_types.h>
  x86/cpuid: Rename cpuid_leaf()/cpuid_subleaf() APIs
  x86/cpu: Do not include the CPUID API header in asm/processor.h
  Documentation: core-api/cpu_hotplug: Remove stale cpu0_hotplug docs
  x86/cpu, cpufreq: Remove AMD ELAN support
  x86/fpu: Remove the math-emu/ FPU emulation library
  x86/fpu: Remove the 'no387' boot option
  x86/fpu: Remove MATH_EMULATION and related glue code
  treewide: Explicitly include the x86 CPUID headers
  x86/cpu: Remove the CONFIG_X86_INVD_BUG quirk
  ...

4 days agoMerge tag 'x86-msr-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip
Linus Torvalds [Mon, 15 Jun 2026 09:38:14 +0000 (15:08 +0530)] 
Merge tag 'x86-msr-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull x86/msr updates from Ingo Molnar:

 - Large series to reorganize the rdmsr/wrmsr APIs to remove
   32-bit variants and convert to 64-bit variants (Juergen Gross)

 - Fix W=1 warning (HyeongJun An)

* tag 'x86-msr-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  x86/msr: Remove wrmsrl()
  x86/msr: Switch wrmsrl() users to wrmsrq()
  x86/msr: Remove rdmsrl()
  x86/msr: Switch rdmsrl() users to rdmsrq()
  x86/msr: Remove wrmsr_safe_on_cpu()
  x86/msr: Switch wrmsr_safe_on_cpu() users to wrmsrq_safe_on_cpu()
  x86/msr: Remove rdmsr_safe_on_cpu()
  x86/msr: Switch rdmsr_safe_on_cpu() users to rdmsrq_safe_on_cpu()
  x86/msr: Don't use rdmsr_safe_on_cpu() in rdmsrq_safe_on_cpu()
  x86/msr: Remove wrmsr_on_cpu()
  x86/msr: Switch wrmsr_on_cpu() users to wrmsrq_on_cpu()
  x86/msr: Remove rdmsr_on_cpu()
  x86/msr: Switch rdmsr_on_cpu() users to rdmsrq_on_cpu()
  x86/msr: Remove rdmsrl_on_cpu()
  x86/msr: Switch rdmsrl_on_cpu() user to rdmsrq_on_cpu()
  x86/process: Convert rdmsr() to rdmsrq() in arch_post_acpi_subsys_init() to address W=1 warning

4 days agoMerge tag 'sched-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 09:20:18 +0000 (14:50 +0530)] 
Merge tag 'sched-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull scheduler updates from Ingo Molnar:
 "SMP load-balancing updates:

   - A large series to introduce infrastructure for cache-aware load
     balancing, with the goal of co-locating tasks that share data
     within the same Last Level Cache (LLC) domain. By improving cache
     locality, the scheduler can reduce cache bouncing and cache misses,
     ultimately improving data access efficiency.

     Implemented by Chen Yu and Tim Chen, based on early prototype work
     by Peter Zijlstra, with fixes by Jianyong Wu, Peter Zijlstra and
     Shrikanth Hegde.

   - A series to simplify CONFIG_SCHED_SMT ifdef usage (Shrikanth Hegde)

  Fair scheduler updates:

   - A series to improve SD_ASYM_CPUCAPACITY scheduling by introducing
     SMT awareness (Andrea Righi, K Prateek Nayak)

   - A series to optimize cfs_rq and sched_entity allocation for better
     data locality (Zecheng Li)

   - A preparatory series to change fair/cgroup scheduling to a single
     runqueue, without the final change (Peter Zijlstra)

   - Auto-manage ext/fair dl_server bandwidth (Andrea Righi)

   - Fix cpu_util runnable_avg arithmetic (Hongyan Xia)

   - Optimize update_tg_load_avg()'s rate-limiting code (Rik van Riel)

   - Allow account_cfs_rq_runtime() to throttle current hierarchy
     (K Prateek Nayak)

   - Update util_est after updating util_avg during dequeue, to fix the
     util signal update logic, which reduces signal noise (Vincent
     Guittot)

  Scheduler topology updates:

   - Allow multiple domains to claim sched_domain_shared (K Prateek
     Nayak)

   - Add parameter to split LLC (Peter Zijlstra)

  Core scheduler updates:

   - Use trace_call__<tp>() to save a static branch (Gabriele Monaco)

  Scheduler statistics updates:

   - Drop now-stale mul_u64_u64_div_u64() cputime over-approximation
     guard (Nicolas Pitre)

  Deadline scheduler updates:

   - Reject debugfs dl_server writes for offline CPUs (Andrea Righi)

   - Fix replenishment logic for non-deferred servers (Yuri Andriaccio)

  RT scheduling updates:

   - Turn RT_PUSH_IPI default off for non PREEMPT_RT (Steven Rostedt)

   - Update default bandwidth for real-time tasks to 1.0 (Yuri
     Andriaccio)

  Proxy scheduling updates:

   - A series to implement Optimized Donor Migration for Proxy Execution
     (John Stultz, Peter Zijlstra)

   - Various proxy scheduling cleanups and fixes (Peter Zijlstra,
     K Prateek Nayak)

  Misc fixes, improvements and cleanups by Aaron Lu, Andrea Righi,
  Zenghui Yu, Chen Yu, Guanyou.Chen, John Stultz, Shrikanth Hegde,
  Peter Zijlstra, Liang Luo and Yiyang Chen"

* tag 'sched-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (91 commits)
  sched/fair: Fix newidle vs core-sched
  sched/deadline: Use task_on_rq_migrating() helper
  sched/core: Combine separate 'else' and 'if' statements
  sched/fair: Fix cpu_util runnable_avg arithmetic
  sched/fair: Unify cfs_rq throttling via account_cfs_rq_runtime()
  sched/fair: Move the throttled tasks to a local list in tg_unthrottle_up()
  sched/fair: Call update_curr() before unthrottling the hierarchy
  sched/fair: Use throttled_csd_list for local unthrottle
  sched/fair: Convert cfs bandwidth throttling to use guards
  sched/fair: Allocate cfs_tg_state with percpu allocator
  sched/fair: Remove task_group->se pointer array
  sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state
  sched: restore timer_slack_ns when resetting RT policy on fork
  MAINTAINERS: Fix spelling mistake in Peter's name
  sched: Simplify ttwu_runnable()
  sched/proxy: Remove superfluous clear_task_blocked_in()
  sched/proxy: Remove PROXY_WAKING
  sched/proxy: Switch proxy to use p->is_blocked
  sched/proxy: Only return migrate when needed
  sched: Be more strict about p->is_blocked
  ...

4 days agoMerge tag 'perf-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 09:15:41 +0000 (14:45 +0530)] 
Merge tag 'perf-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull performance events updates from Ingo Molnar:
 "Core perf code updates:

   - Reveal PMU type in fdinfo (Chun-Tse Shao)

  Intel CPU PMU driver updates:

   - Fix various inaccurate hard-coded event configurations (Dapeng Mi)

  Intel uncore PMU driver updates (Zide Chen):

   - Fix discovery unit lookup bug for multi-die systems

   - Guard against invalid box control address

   - Fix PCI device refcount leak in UPI discovery

   - Defer ADL global PMON enable to enable_box() to save power

   - Fix uncore_die_to_cpu() for offline dies

   - Implement global init callback for GNR uncore

  AMD CPU PMU driver updates:

   - Always use the NMI latency mitigation (Sandipan Das)

  AMD uncore PMU driver updates:

   - Use Node ID to identify DF and UMC domains (Sandipan Das)"

* tag 'perf-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (22 commits)
  perf/x86/amd/uncore: Use Node ID to identify DF and UMC domains
  perf: Reveal PMU type in fdinfo
  perf/x86/intel/uncore: Implement global init callback for GNR uncore
  perf/x86/intel/uncore: Fix uncore_die_to_cpu() for offline dies
  perf/x86/intel/uncore: Move die_to_cpu() to uncore.c
  perf/x86/intel/uncore: Defer ADL global PMON enable to enable_box()
  perf/x86/intel/uncore: Fix PCI device refcount leak in UPI discovery
  perf/x86/intel/uncore: Guard against invalid box control address
  perf/x86/intel/uncore: Fix discovery unit lookup for multi-die systems
  perf/x86/amd/core: Always use the NMI latency mitigation
  perf/x86/intel: Update event constraints and cache_extra_regsfor CWF
  perf/x86/intel: Update event constraints and cache_extra_regsfor SRF
  perf/x86/intel: Update event constraints and cache_extra_regsfor NVL
  perf/x86/intel: Update event constraints for PTL
  perf/x86/intel: Update event constraints and cache_extra_regsfor ARL
  perf/x86/intel: Update event constraints and cache_extra_regsfor LNL
  perf/x86/intel: Update event constraints and cache_extra_regsfor MTL
  perf/x86/intel: Update event constraints and cache_extra_regsfor ADL
  perf/x86/intel: Update event constraints for DMR
  perf/x86/intel: Update event constraints and cache_extra_regsfor SPR
  ...

4 days agoMerge tag 'objtool-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 09:01:58 +0000 (14:31 +0530)] 
Merge tag 'objtool-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull objtool updates from Ingo Molnar:

 - A large series of KLP fixes and improvements, in preparation of the
   arm64 port (Josh Poimboeuf)

 - Fix a number of bugs and issues on specific distro, LTO, FineIBT and
   kCFI configs (Josh Poimboeuf)

 - Misc other fixes by Josh Poimboeuf and Joe Lawrence

* tag 'objtool-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (53 commits)
  objtool/klp: Cache dont_correlate() result
  objtool: Improve and simplify prefix symbol detection
  objtool/klp: Fix kCFI prefix finding/cloning
  objtool: Grow __cfi_* prefix symbols for all CFI+CALL_PADDING
  objtool/klp: Fix position-dependent checksums for non-relocated jumps/calls
  objtool: Add insn_sym() helper
  objtool/klp: Add correlation debugging output
  objtool/klp: Rewrite symbol correlation algorithm
  objtool/klp: Calculate object checksums
  klp-build: Validate short-circuit prerequisites
  objtool/klp: Remove "objtool --checksum"
  klp-build: Use "objtool klp checksum" subcommand
  objtool/klp: Add "objtool klp checksum" subcommand
  objtool: Consolidate file decoding into decode_file()
  objtool/klp: Extricate checksum calculation from validate_branch()
  objtool: Add is_cold_func() helper
  objtool: Add is_alias_sym() helper
  objtool/klp: Handle Clang .data..Lanon anonymous data sections
  objtool/klp: Create empty checksum sections for function-less object files
  objtool: Include libsubcmd headers directly from source tree
  ...

4 days agoMerge tag 'locking-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 08:51:14 +0000 (14:21 +0530)] 
Merge tag 'locking-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull locking updates from Ingo Molnar:
 "Futex updates:

   - Optimize futex hash bucket access patterns (Peter Zijlstra)

   - Large series to address the robust futex unlock race for real, by
     Thomas Gleixner:

      "The robust futex unlock mechanism is racy in respect to the
       clearing of the robust_list_head::list_op_pending pointer because
       unlock and clearing the pointer are not atomic.

       The race window is between the unlock and clearing the pending op
       pointer. If the task is forced to exit in this window, exit will
       access a potentially invalid pending op pointer when cleaning up
       the robust list.

       That happens if another task manages to unmap the object
       containing the lock before the cleanup, which results in an UAF.

       In the worst case this UAF can lead to memory corruption when
       unrelated content has been mapped to the same address by the time
       the access happens.

       User space can't solve this problem without help from the kernel.
       This series provides the kernel side infrastructure to help it
       along:

        1) Combined unlock, pointer clearing, wake-up for the
           contended case

        2) VDSO based unlock and pointer clearing helpers with a
           fix-up function in the kernel when user space was interrupted
           within the critical section.

      ... with help by André Almeida:

        - Add a note about robust list race condition (André Almeida)
        - Add self-tests for robust release operations (André Almeida)

  Context analysis updates:

   - Implement context analysis for 'struct rt_mutex'. (Bart Van Assche)
   - Bump required Clang version to 23 (Marco Elver)

  Guard infrastructure updates:

   - Series to remove NULL check from unconditional guards (Dmitry
     Ilvokhin)

  Lockdep updates:

   - Restore self-test migrate_disable() and sched_rt_mutex state on
     PREEMPT_RT (Karl Mehltretter)

  Membarriers updates:

   - Use per-CPU mutexes for targeted commands (Aniket Gattani)
   - Modernize membarrier_global_expedited with cleanup guards (Aniket
     Gattani)
   - Add rseq stress test for CFS throttle interactions (Aniket Gattani)

  percpu-rwsems updates:

   - Extract __percpu_up_read() to optimize inlining overhead (Dmitry
     Ilvokhin)

  Seqlocks updates:

   - Allow UBSAN_ALIGNMENT to fail optimizing (Heiko Carstens)

  Lock tracing:

   - Add contended_release tracepoint to sleepable locks such as
     mutexes, percpu-rwsems, rtmutexes, rwsems and semaphores (Dmitry
     Ilvokhin)

  MAINTAINERS updates:

   - MAINTAINERS: Add RUST [SYNC] entry (Boqun Feng)

  Misc updates and fixes by Randy Dunlap, YE WEI-HONG, Fabricio Parra,
  Dmitry Ilvokhin and Peter Zijlstra"

* tag 'locking-core-2026-06-14' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (36 commits)
  locking: Add contended_release tracepoint to sleepable locks
  locking/percpu-rwsem: Extract __percpu_up_read()
  tracing/lock: Remove unnecessary linux/sched.h include
  futex: Optimize futex hash bucket access patterns
  rust: sync: completion: Mark inline complete_all and wait_for_completion
  MAINTAINERS: Add RUST [SYNC] entry
  cleanup: Specify nonnull argument index
  selftests: futex: Add tests for robust release operations
  Documentation: futex: Add a note about robust list race condition
  x86/vdso: Implement __vdso_futex_robust_try_unlock()
  x86/vdso: Prepare for robust futex unlock support
  futex: Provide infrastructure to plug the non contended robust futex unlock race
  futex: Add robust futex unlock IP range
  futex: Add support for unlocking robust futexes
  futex: Cleanup UAPI defines
  x86: Select ARCH_MEMORY_ORDER_TSO
  uaccess: Provide unsafe_atomic_store_release_user()
  futex: Provide UABI defines for robust list entry modifiers
  futex: Move futex related mm_struct data into a struct
  futex: Make futex_mm_init() void
  ...

4 days agoMerge tag 'timers-vdso-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 08:27:13 +0000 (13:57 +0530)] 
Merge tag 'timers-vdso-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull vdso updates from Thomas Gleixner:

 - Remove the redundant CONFIG_GENERIC_TIME_VSYSCALL after converting
   the remaining users over.

 - Rework and sanitize the MIPS VDSO handling, so it does not handle the
   time related VDSO if there is no VDSO capable clocksource available.
   Also stop mapping VDSO data pages unconditionally even if there is no
   usage possible.

* tag 'timers-vdso-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  MIPS: VDSO: Fold MIPS_CLOCK_VSYSCALL into MIPS_GENERIC_GETTIMEOFDAY
  MIPS: VDSO: Gate microMIPS restriction on GCC version
  MIPS: VDSO: Fold MIPS_DISABLE_VDSO into MIPS_GENERIC_GETTIMEOFDAY
  clocksource/drivers/mips-gic-timer: Only use VDSO_CLOCKMODE_GIC when it is a available
  MIPS: csrc-r4k: Only use VDSO_CLOCKMODE_R4K when it is a available
  MIPS: VDSO: Only map the data pages when the vDSO is used
  MIPS: Introduce Kconfig MIPS_GENERIC_GETTIMEOFDAY
  vdso/datastore: Always provide symbol declarations
  MAINTAINERS: Add include/linux/vdso_datastore.h to vDSO block
  vdso/gettimeofday: Rename __arch_get_vdso_u_timens_data()
  vdso/treewide: Drop GENERIC_TIME_VSYSCALL
  vdso/vsyscall: Gate update_vsyscall() behind CONFIG_GENERIC_GETTIMEOFDAY
  riscv: vdso: Drop CONFIG_GENERIC_TIME_VSYSCALL guard around syscall fallbacks

4 days agoMerge tag 'timers-ptp-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 08:21:27 +0000 (13:51 +0530)] 
Merge tag 'timers-ptp-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull timekeeping updates from Thomas Gleixner:
 "Updates for NTP/timekeeping and PTP:

   - Expand timekeeping snapshot mechanisms

     The various snapshot functions are mostly used for PTP to collect
     "atomic" snapshots of various involved clocks.

     They lack support for the recently introduced AUX clocks and do not
     provide the underlying counter value (e.g. TSC) to user space.
     Exposing the counter value snapshot allows for better control and
     steering.

     Convert the hard wired ktime_get_snapshot() to take a clock ID,
     which allows the caller to select the clock ID to be captured along
     with CLOCK_MONONOTONIC_RAW. Additionally capture the underlying
     hardware counter value and the clock source ID of the counter.

     Expand the hardware based snapshot capture where devices provide a
     mechanism to snapshot the hardware PTP clock and the system counter
     (usually via PCI/PTM) to support AUX clocks and also provide the
     captured counter value back to the caller and not only the clock
     timestamps derived from it.

   - Add a new optional read_snapshot() callback to clocksources

     That is required to capture atomic snapshots from clocksources
     which are derived from TSC with a scaling mechanism (e.g. Hyper-V,
     KVMclock).

     The value pair is handed back in the snapshot structure to the
     callers, so they can do the necessary correlations in a more
     precise way.

  This touches usage sites of the affected functions and data structure
  all over the tree, but stays fully backwards compatible for the
  existing user space exposed interfaces. New PTP IOCTLs will provide
  access to the extended functionality in later kernel versions"

* tag 'timers-ptp-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (28 commits)
  ptp: vmclock: Use hw_cycles from snapshot for precise TSC pairing
  x86/kvmclock: Implement read_snapshot() for kvmclock clocksource
  clocksource/hyperv: Implement read_snapshot() for TSC page clocksource
  timekeeping: Add clocksource read_snapshot() method and hw_cycles to snapshot
  ptp: Switch to ktime_get_snapshot_id() for pre/post timestamps
  timekeeping: Add support for AUX clock cross timestamping
  timekeeping: Remove system_device_crosststamp::sys_realtime
  ALSA: hda/common: Use system_device_crosststamp::sys_systime
  wifi: iwlwifi: Use system_device_crosststamp::sys_systime
  ptp: Use system_device_crosststamp::sys_systime
  timekeeping: Prepare for cross timestamps on arbitrary clock IDs
  timekeeping: Remove ktime_get_snapshot()
  virtio_rtc: Use provided clock ID for history snapshot
  net/mlx5: Use provided clock ID for history snapshot
  igc: Use provided clock ID for history snapshot
  ice/ptp: Use provided clock ID for history snapshot
  wifi: iwlwifi: Adopt PTP cross timestamps to core changes
  timekeeping: Add CLOCK ID to system_device_crosststamp
  timekeeping: Add system_counterval_t to struct system_device_crosststamp
  timekeeping: Add CLOCK_AUX support for ktime_get_snapshot_id()
  ...

4 days agoMerge tag 'timers-nohz-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 08:18:52 +0000 (13:48 +0530)] 
Merge tag 'timers-nohz-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull NOHZ updates from Thomas Gleixner:

 - Fix a long standing TOCTOU in get_cpu_sleep_time_us()

 - Make the CPU offline NOHZ handling more robust by disabling NOHZ on
   the outgoing CPU early instead of creating unneeded state which needs
   to be undone.

 - Unify idle CPU time accounting instead of having two different
   accounting mechanisms. These two different mechanisms are not really
   independent, but the different properties can in the worst case cause
   that gloabl idle time can be observed going backwards.

 - Consolidate the idle/iowait time retrieval interfaces instead of
   converting back and forth between them.

 - Make idle interrupt time accounting more robust. The original code
   assumes that interrupt time accouting is enabled and therefore stops
   elapsing idle time while an interrupt is handled in NOHZ dyntick
   state. That assumption is not correct as interrupt time accounting
   can be disabled at compile and runtime.

 - Fix an accounting error between dyntick idle time and dyntick idle
   steal time. The stolen time is not accounted and therefore idle time
   becomes inaccurate. The stolen time is now accounted after the fact
   as there is no way to predict the steal time upfront.

* tag 'timers-nohz-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  sched/cputime: Handle dyntick-idle steal time correctly
  sched/cputime: Handle idle irqtime gracefully
  sched/cputime: Provide get_cpu_[idle|iowait]_time_us() off-case
  tick/sched: Consolidate idle time fetching APIs
  tick/sched: Account tickless idle cputime only when tick is stopped
  tick/sched: Remove unused fields
  tick/sched: Move dyntick-idle cputime accounting to cputime code
  tick/sched: Remove nohz disabled special case in cputime fetch
  tick/sched: Unify idle cputime accounting
  s390/time: Prepare to stop elapsing in dynticks-idle
  powerpc/time: Prepare to stop elapsing in dynticks-idle
  sched/cputime: Correctly support generic vtime idle time
  sched/cputime: Remove superfluous and error prone kcpustat_field() parameter
  sched/idle: Handle offlining first in idle loop
  tick/sched: Fix TOCTOU in nohz idle time fetch

4 days agoMerge tag 'timers-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 08:09:12 +0000 (13:39 +0530)] 
Merge tag 'timers-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull timer core updates from Thomas Gleixner:
 "Updates for the time/timer core subsystem:

   - Harden the user space controllable hrtimer interfaces further to
     protect against unpriviledged DoS attempts by arming timers in the
     past.

   - Add per-capacity hierarchies to the timer migration code to prevent
     timer migration accross different capacity domains. This code has
     been disabled last minute as there is a pathological problem with
     SoCs which advertise a larger number of capacity domains. The
     problem is under investigation and the code won't be active before
     v7.3, but that turned out to be less intrusive than a full revert
     as it preserves the preparatory steps and allows people to work on
     the final resolution

   - Export time namespace functionality as a recent user can be built
     as a module.

   - Initialize the jiffies clocksource before using it. The recent
     hardening against time moving backward requires that the related
     members of struct clocksource have been initialized, otherwise it
     clamps the readout to 0, which makes time stand sill and causes
     boot delays.

   - Fix a more than twenty year old PID reference count leak in an
     error path of the POSIX CPU timer code.

   - The usual small fixes, improvements and cleanups all over the
     place"

* tag 'timers-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (31 commits)
  posix-cpu-timers: Fix pid refcount leak in do_cpu_nanosleep() error path
  time/jiffies: Register jiffies clocksource before usage
  timers/migration: Temporarily disable per capacity hierarchies
  timers/migration: Turn tmigr_hierarchy level_list into a flexible array
  timers/migration: Deactivate per-capacity hierarchies under nohz_full
  timers/migration: Fix hotplug migrator selection target on asymetric capacity machines
  ntsync: Honour caller's time namespace for absolute MONOTONIC timeouts
  time/namespace: Export init_time_ns and do_timens_ktime_to_host()
  timers/migration: Update stale @online doc to @available
  timers: Fix flseep() typo in kernel-doc comment
  hrtimer: Fix the bogus return type of __hrtimer_start_range_ns()
  hrtimer: Return ktime_t from hrtimer_get_next_event()/hrtimer_next_event_without()
  clocksource: Clean up clocksource_update_freq() functions
  alarmtimer: Remove stale return description from alarm_handle_timer()
  selftests/posix_timers: Use CLOCK_THREAD_CPUTIME_ID for ITIMER_PROF measurements
  scripts/timers: Add timer_migration_tree.py
  timers/migration: Handle capacity in connect tracepoints
  timers/migration: Split per-capacity hierarchies
  timers/migration: Track CPUs in a hierarchy
  timers/migration: Abstract out hierarchy to prepare for CPU capacity awareness
  ...

4 days agoMerge tag 'timers-clocksource-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel...
Linus Torvalds [Mon, 15 Jun 2026 08:04:03 +0000 (13:34 +0530)] 
Merge tag 'timers-clocksource-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull clocksource updates from Thomas Gleixner:
 "Updates for clocksource/clockevent drivers:

   - Add devm helpers for clocksources, which allows to simplify driver
     teardown and probe failure handling.

   - More module conversion work

   - Update the support for the ARM EL2 virtual timer including the
     required ACPI changes.

   - Add clockevent and clocksource support for the TI Dual Mode Timer

   - Fix the support for multiple watchdog instances in the TEGRA186
     driver

   - Add D1 timer support to the SUN5I driver

   - The usual devicetree updates, cleanups and small fixes all over the
     place"

* tag 'timers-clocksource-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (24 commits)
  clocksource: move NXP timer selection to drivers/clocksource
  clocksource/drivers/timer-tegra186: Reserve and service a kernel watchdog
  clocksource/drivers/timer-tegra186: Register all accessible watchdog timers
  clocksource/drivers/timer-tegra186: Correct num_wdts for Tegra186 and Tegra234
  clocksource/drivers/timer-tegra186: Fix support for multiple watchdog instances
  clocksource/drivers/timer-ti-dm: Add clockevent support
  clocksource/drivers/timer-ti-dm: Add clocksource support
  clocksource/drivers/timer-ti-dm: Fix property name in comment
  dt-bindings: timer: arm,arch_timer: Fix requirements for interrupt description
  clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when running VHE
  ACPI: GTDT: Parse information related to the EL2 virtual timer
  ACPI: GTDT: Account for GTDTv3 size when walking the platform timer descriptors
  clocksource: Add devm_clocksource_register_*() helpers
  clocksource/drivers/sun5i: Add D1 hstimer support
  dt-bindings: timer: allwinner,sun5i-a13-hstimer: add H616 and D1
  dt-bindings: timer: Add StarFive JHB100 clint
  dt-bindings: timer: renesas,rz-mtu3: document RZ/{T2H,N2H}
  dt-bindings: timer: renesas,rz-mtu3: Remove TCIU8 interrupt
  dt-bindings: timer: Remove sifive,fine-ctr-bits property
  clocksource/drivers/timer-of: Make the code compatible with modules
  ...

4 days agoMerge tag 'smp-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip
Linus Torvalds [Mon, 15 Jun 2026 08:00:04 +0000 (13:30 +0530)] 
Merge tag 'smp-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull smp core updates from Thomas Gleixner:
 "Two small updates to the SMP/hotplug subsystem:

   - Add cpuhplock.h to the maintained files

   - Provide the missing stubs for lockdep_is_cpus_held() and
     lockdep_is_cpus_write_held() so the usage sites can be simplified"

* tag 'smp-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  cpu: Add lockdep_is_cpus_held()/lockdep_is_cpus_write_held() stubs for !CONFIG_HOTPLUG_CPU
  MAINTAINERS: Add include/linux/cpuhplock.h to CPU HOTPLUG area

4 days agoMerge tag 'irq-msi-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip
Linus Torvalds [Mon, 15 Jun 2026 07:58:24 +0000 (13:28 +0530)] 
Merge tag 'irq-msi-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull MSI irq update from Thomas Gleixner:
 "A trivial update to the MSI interrupt subsystem, which fixes a couple
  of typos"

* tag 'irq-msi-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  genirq/msi: Fix typos in msi_domain_ops comment

4 days agoMerge tag 'irq-drivers-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 07:55:32 +0000 (13:25 +0530)] 
Merge tag 'irq-drivers-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull interrupt chip driver updates from Thomas Gleixner:

 - Replace the support for the AST2700-A0 early silicon with a proper
   driver for the final A2 production silicon

 - Rename and rework the StarFive JH8100 interrupt controller for the
   new JHB100 SoC as JH8100 was discontinued before production.

 - Add support for Amlogic A9 SoCs to the meson-gpio interrupt
   controller

 - Expand the Econet interrupt controller driver to support MIPS 34Kc
   Vectored External Interrupt Controller mode.

 - Prevent a NULL pointer dereference in the GICv4 code as the vLPI code
   blindly assumes that the ITS was populated. Add the missing sanity
   check.

 - Add support for software triggered and for error interrupts to the
   Renesas RZ/T2H driver.

 - Add interrupt redirection support for the loongarch architecture.

 - Add multicore support to the Realtek RTL interrupt driver

 - The usual updates, enhancements and fixes all over the place

* tag 'irq-drivers-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (32 commits)
  irqchip/irq-realtek-rtl: Add multicore support
  irqchip/irq-realtek-rtl: Add/simplify register helpers
  irqchip/loongarch-ir: Add IR (interrupt redirection) irqchip support
  irqchip/loongarch-avec: Return IRQ_SET_MASK_OK_DONE when keep affinity
  irqchip/loongarch-avec: Prepare for interrupt redirection support
  Docs/LoongArch: Add advanced extended IRQ model
  irqchip/qcom-pdc: Use FIELD_GET() to extract bank index and bit position
  irqchip/qcom-pdc: Add PDC_VERSION() macro to describe version register fields
  irqchip/qcom-pdc: Tighten ioremap clamp to single DRV region size
  irqchip/qcom-pdc: Split __pdc_enable_intr() into per-version helpers
  irqchip/exynos-combiner: Remove useless spinlock
  irqchip/renesas-rzt2h: Add error interrupts support
  irqchip/renesas-rzt2h: Add software-triggered interrupts support
  irqchip/gic-v4: Don't advertise VLPIs if no ITS is probed
  irqchip/gic-v3-its: Use FIELD_MODIFY()
  irqchip/econet-en751221: Support MIPS 34Kc VEIC mode
  dt-bindings: interrupt-controller: econet: Add CPU interrupt mapping
  irqchip/meson-gpio: Add support for Amlogic A9 SoCs
  dt-bindings: interrupt-controller: Add support for Amlogic A9 SoCs
  irqchip/meson-gpio: Use the correct register in meson_s4_gpio_irq_set_type()
  ...

4 days agoMerge tag 'irq-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip
Linus Torvalds [Mon, 15 Jun 2026 07:49:41 +0000 (13:19 +0530)] 
Merge tag 'irq-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull interrupt core updates from Thomas Gleixner:

  - Rework of /proc/interrupt handling:

    /proc/interrupts was subject to micro optimizations for a long time,
    but most of the low hanging fruit was left on the table. This rework
    addresses the major time consuming issues:

      - Printing a long series of zeros one by one via a format string
        instead of counting subsequent zeros and emitting a string
        constant.

      - Simplify and cache the conditions whether interrupts should be
        printed

      - Use a proper iteration over the interrupt descriptor xarray
        instead of walking and testing one by one.

      - Provide helper functions for the architecture code to emit the
        architecture specific counters

      - Convert the counter structure in x86 to an array, which
        simplifies the output and add mechanisms to suppress unused
        architecture interrupts, which just occupy space for nothing.
        Adopt the new core mechanisms.

    This adjusts the gdb scripts related to interrupt counter statistics
    to work with the new mechanisms.

  - Prevent a string overflow in the /proc/irq/$N/ directory name
    creation code.

* tag 'irq-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  x86/irq: Add missing 's' back to thermal event printout
  genirq/proc: Speed up /proc/interrupts iteration
  genirq/proc: Runtime size the chip name
  genirq: Expose irq_find_desc_at_or_after() in core code
  genirq: Add rcuref count to struct irq_desc
  genirq/proc: Increase default interrupt number precision to four
  genirq: Calculate precision only when required
  genirq: Cache the condition for /proc/interrupts exposure
  genirq/manage: Make NMI cleanup RT safe
  genirq: Expose nr_irqs in core code
  scripts/gdb: Update x86 interrupts to the array based storage
  x86/irq: Move IOAPIC misrouted and PIC/APIC error counts into irq_stats
  x86/irq: Suppress unlikely interrupt stats by default
  x86/irq: Make irqstats array based
  genirq/proc: Utilize irq_desc::tot_count to avoid evaluation
  genirq/proc: Avoid formatting zero counts in /proc/interrupts
  x86/irq: Optimize interrupts decimals printing
  genirq/proc: Size interrupt directory names for 10-digit interrupt numbers

4 days agoMerge tag 'core-rseq-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 15 Jun 2026 07:44:36 +0000 (13:14 +0530)] 
Merge tag 'core-rseq-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip

Pull rseq update from Thomas Gleixner:
 "A trivial update for RSEQ selftests to provide the config fragments
  which contain the config options required to actually run the tests"

* tag 'core-rseq-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  selftests/rseq: Add config fragment

4 days agoALSA: hda/realtek: Add CS35L41 I2C quirk for ASUS UM3405GA
Colton Jones [Mon, 15 Jun 2026 03:36:20 +0000 (03:36 +0000)] 
ALSA: hda/realtek: Add CS35L41 I2C quirk for ASUS UM3405GA

The ASUS Zenbook 14 UM3405GA uses a Realtek ALC294 codec with two
Cirrus Logic CS35L41 speaker amplifiers exposed through the CSC3551 ACPI
device. The machine reports the Realtek subsystem ID 1043:19f4.

Without a PCI quirk, the codec falls back to generic pin matching and the
internal speakers remain silent even though PCM playback completes.

Add the UM3405GA subsystem ID and reuse the same ASUS I2C headset-mic
fixup used by the closely related UM3406HA. That fixup configures the
headset microphone pin and chains to CS35L41 I2C speaker-amp binding.

Signed-off-by: Colton Jones <cjones1308@pm.me>
Link: https://patch.msgid.link/20260615033619.7-1-cjones1308@pm.me
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 days agoMerge branch 'for-linus' into for-next
Takashi Iwai [Mon, 15 Jun 2026 07:28:24 +0000 (09:28 +0200)] 
Merge branch 'for-linus' into for-next

Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 days agoselftests/bpf: Work around llvm stack overflow in crypto progs
Alexei Starovoitov [Mon, 15 Jun 2026 07:17:58 +0000 (00:17 -0700)] 
selftests/bpf: Work around llvm stack overflow in crypto progs

clang 23 fails to build crypto_bench.c and crypto_sanity.c with
"BPF stack limit exceeded". The progs fill a 408-byte
bpf_crypto_params on the stack and pass it to bpf_crypto_ctx_create().
clang 23 copies the byte-aligned cipher/key globals into it one byte at
a time through the stack, and keeps more than one copy of the struct
around. Together that blows the 512-byte limit.

Align the source arrays to 8 bytes so the copy is word-wise, and move
params off the stack into a static .bss var. static keeps it out of the
skeleton, where bpf_crypto_params is an incomplete type. Either change
alone is not enough.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoMerge tag 'driver-core-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/drive...
Linus Torvalds [Mon, 15 Jun 2026 07:11:17 +0000 (12:41 +0530)] 
Merge tag 'driver-core-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core updates from Danilo Krummrich:
 "Deferred probe:
   - Fix race where deferred probe timeout work could be permanently
     canceled by using mod_delayed_work()
   - Fix missing jiffies conversion in deferred_probe_extend_timeout()
   - Guard timeout extension with delayed_work_pending() to prevent
     premature firing
   - Use system_percpu_wq instead of the deprecated system_wq
   - Update deferred_probe_timeout documentation

  device:
   - Replace direct struct device bitfield access (can_match, dma_iommu,
     dma_skip_sync, dma_ops_bypass, state_synced, dma_coherent,
     of_node_reused, offline, offline_disabled) with flag-based
     accessors using bit operations
   - Reject devices with unregistered buses
   - Delete unused DEVICE_ATTR_PREALLOC()
   - Add low-level device attribute macros with const show/store
     callbacks, allowing device attributes to reside in read-only memory
   - Move core device attributes to read-only memory
   - Constify group array pointers in driver_add_groups() /
     driver_remove_groups(), struct bus_type, and struct device_driver

  device property:
   - Fix fwnode reference leak in fwnode_graph_get_endpoint_by_id()
   - Initialize all fields of fwnode_handle in fwnode_init()
   - Provide swnode_get()/swnode_put() wrappers around kobject_get/put()
   - Allow passing struct software_node_ref_args pointers directly to
     PROPERTY_ENTRY_REF()

  driver_override:
   - Migrate amba, cdx, vmbus, and rpmsg to the generic driver_override
     infrastructure, fixing a UAF from unsynchronized access to
     driver_override in bus match() callbacks
   - Remove the now-unused driver_set_override()

  firmware loader:
   - Fix recursive lock deadlock in device_cache_fw_images() when async
     work falls back to synchronous execution
   - Fix device reference leak in firmware_upload_register()

  platform:
   - Pass KBUILD_MODNAME through the platform driver registration macro
     to create module symlinks in sysfs for built-in drivers; move
     module_kset initialization to a pure_initcall and tegra cbb
     registration to core_initcall to ensure correct ordering
   - Pass THIS_MODULE implicitly through a coresight_init_driver() macro

  sysfs:
   - Upgrade OOB write detection in sysfs_kf_seq_show() from printk to
     WARN
   - Add return value clamping to sysfs_kf_read()

  Rust:
   - ACPI:

     Fix missing match data for PRP0001 by exporting
     acpi_of_match_device()

   - Auxiliary:

     Replace drvdata() with dedicated registration data on
     auxiliary_device. drvdata() exposed the driver's bus device private
     data beyond the driver's own scope, creating ordering constraints
     and forcing the data to outlive all registrations that access it.
     Registration data is instead scoped structurally to the
     Registration object, making lifecycle ordering enforced by
     construction rather than convention.

   - Rust-native device driver lifetimes (HRT):

     Allow Rust device drivers to carry a lifetime parameter on their
     bus device private data, tied to the device binding scope -- the
     interval during which a bus device is bound to a driver. Device
     resources like pci::Bar<'a> and IoMem<'a> can be stored directly in
     the driver's bus device private data with a lifetime bounded by the
     binding scope, so the compiler enforces at build time that they do
     not outlive the binding. This removes Devres indirection from every
     access site and eliminates try_access() failure paths in
     destructors.

     Bus driver traits use a Generic Associated Type (GAT) Data<'bound>
     to introduce the lifetime on the private data, rather than
     parameterizing the Driver trait itself. Auxiliary registration
     data, where the lifetime is not introduced by a trait callback but
     must be threaded through Registration, uses the ForLt trait (a
     type-level abstraction for types generic over a lifetime).

  Misc:
   - Fix DT overlayed devices not probing by reverting the broken
     treewide overlay fix and re-running fw_devlink consumer pickup when
     an overlay is applied to a bound device
   - Use root_device_register() for faux bus root device; add sanity
     check for failed bus init
   - Fix dev_has_sync_state() data race with READ_ONCE() and move it to
     base.h
   - Avoid spurious device_links warning when removing a device while
     its supplier is unbinding
   - Switch ISA bus to dynamic root device
   - Fix suspicious RCU usage in kernfs_put()
   - Remove devcoredump exit callback
   - Constify devfreq_event_class"

* tag 'driver-core-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/driver-core/driver-core: (81 commits)
  software node: allow passing reference args to PROPERTY_ENTRY_REF()
  driver core: platform: set mod_name in driver registration
  coresight: pass THIS_MODULE implicitly through a macro
  kernel: param: initialize module_kset in a pure_initcall
  soc/tegra: cbb: Move driver registration from pure_initcall to core_initcall
  firmware_loader: Fix recursive lock in device_cache_fw_images()
  driver core: Use system_percpu_wq instead of system_wq
  driver core: remove driver_set_override()
  rpmsg: use generic driver_override infrastructure
  Drivers: hv: vmbus: use generic driver_override infrastructure
  cdx: use generic driver_override infrastructure
  amba: use generic driver_override infrastructure
  rust: devres: add 'static bound to Devres<T>
  samples: rust: rust_driver_auxiliary: showcase lifetime-bound registration data
  rust: auxiliary: generalize Registration over ForLt
  rust: types: add `ForLt` trait for higher-ranked lifetime support
  gpu: nova-core: separate driver type from driver data
  samples: rust: rust_driver_pci: use HRT lifetime for Bar
  rust: io: make IoMem and ExclusiveIoMem lifetime-parameterized
  rust: pci: make Bar lifetime-parameterized
  ...

4 days agoMerge tag 'pm-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm
Linus Torvalds [Mon, 15 Jun 2026 06:07:18 +0000 (11:37 +0530)] 
Merge tag 'pm-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "Over a half of the changes here are cpufreq updates that include core
  modifications, fixes of the old-style governors, new hardware support
  in drivers, assorded driver fixes and cleanups, and the removal of one
  driver (AMD Elan SC4*).

  Apart from that, the intel_idle driver will now be able to avoid
  exposing redundant C-states if PC6 is disabled and there are new
  sysctl knobs for device suspend/resume watchdog timeouts, hibernation
  gets built-in LZ4 support for image compression and there is the usual
  collection of assorted fixes and cleanups.

  Specifics:

   - Fix a race between cpufreq suspend and CPU hotplug during system
     shutdown (Tianxiang Chen)

   - Avoid redundant target() calls for unchanged limits and fix a typo
     in a comment in the cpufreq core (Viresh Kumar)

   - Fix concurrency issues related to sysfs attributes access that
     affect cpufreq governors using the common governor code (Zhongqiu
     Han)

   - Simplify frequency limit handling in the conservative cpufreq
     governor (Lifeng Zheng)

   - Fix descriptions of the conservative governor freq_step tunable and
     the ondemand governor sampling_down_factor tunable in the cpufreq
     documentation (Pengjie Zhang)

   - Fix use-after-free and double free during _OSC evaluation in the
     PCC cpufreq driver (Yuho Choi)

   - Rework the handling of policy min and max frequency values in the
     cpufreq core to allow drivers to specify special initial values for
     the scaling_min_freq and scaling_max_freq sysfs attributes (Pierre
     Gondois)

   - Add cpufreq scaling support for Qualcomm Shikra SoC (Taniya Das,
     Imran Shaik).

   - Improve the warning message on HWP-disabled hybrid processors
     printed by the intel_pstate driver and sync policy->cur during CPU
     offline in it (Yohei Kojima, Fushuai Wang)

   - Drop cpufreq support for AMD Elan SC4* (Sean Young)

   - Minor fixes for cpufreq drivers (Krzysztof Kozlowski, Akashdeep
     Kaur, Hans Zhang, Guangshuo Li, Xueqin Luo)

   - Clean up dead dependencies on X86 in the cpufreq Kconfig (Julian
     Braha)

   - Allow the intel_idle driver to avoid exposing C-states that are
     redundant when PC6 is disabled (Artem Bityutskiy)

   - Fix memory leak and a potential race in the OPP core (Abdun Nihaal,
     Di Shen)

   - Mark Rust OPP methods as inline (Nicolás Antinori)

   - Fix misc device registration failure path in the PM QoS core (Yuho
     Choi)

   - Add sysctl interface for DPM watchdog timeouts (Tzung-Bi Shih)

   - Use complete() instead of complete_all() in device_pm_sleep_init()
     to avoid a false-positive warning from lockdep_assert_RT_in_threaded_ctx()
     when CONFIG_PROVE_RAW_LOCK_NESTING is enabled (Jiakai Xu)

   - Use a flexible array for CRC uncompressed buffers during
     hibernation image saving (Rosen Penev)

   - Make the LZ4 algorithm available for hibernation compression
     (l1rox3)

   - Move the preallocate_image() call during hibernation after the
     "prepare" phase of the "freeze" transition (Matthew Leach)

   - Fix a memory leak in rapl_add_package_cpuslocked() in the
     intel_rapl power capping driver and use sysfs_emit() in
     cpumask_show() in that driver (Sumeet Pawnikar, Yury Norov)

   - Fix ValueError when parsing incomplete device properties in the
     pm-graph utility (Gongwei Li)"

* tag 'pm-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm: (40 commits)
  PM: dpm_watchdog: Add sysctl interface for DPM watchdog timeouts
  PM: QoS: Fix misc device registration unwind
  cpufreq: Use policy->min/max init as QoS request
  cpufreq: Remove driver default policy->min/max init
  cpufreq: Set default policy->min/max values for all drivers
  cpufreq: Extract cpufreq_policy_init_qos() function
  cpufreq: Documentation: fix conservative governor freq_step description
  cpufreq: ti: Add EPROBE_DEFER for K3 SoCs
  cpufreq: qcom: Add cpufreq scaling support for Qualcomm Shikra SoC
  dt-bindings: cpufreq: Document Qualcomm Shikra SoC EPSS
  powercap: intel_rapl: Use sysfs_emit() in cpumask_show()
  cpufreq: governor: Fix stale prev_cpu_nice spike when enabling ignore_nice_load
  cpufreq: governor: Fix data races on per-CPU idle/nice baselines
  PM: hibernate: Use flexible array for CRC uncompressed buffers
  powercap: intel_rapl: Fix memory leak in rapl_add_package_cpuslocked()
  PM: hibernate: make LZ4 available for hibernation compression
  PM: sleep: Use complete() in device_pm_sleep_init()
  opp: rust: mark OPP methods as inline
  cpufreq: intel_pstate: Improve warning message on HWP-disabled hybrid CPUs
  cpufreq: elanfreq: Drop support for AMD Elan SC4*
  ...

4 days agoMerge tag 'thermal-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Mon, 15 Jun 2026 06:05:11 +0000 (11:35 +0530)] 
Merge tag 'thermal-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm

Pull thermal control updates from Rafael Wysocki:
 "These add new hardware support (i.MX93 TMU, Amlogic T7, Intel Arrow
  Lake, QCom Nord, Shikra and Hawi), fix issues in a number of places in
  the thermal control core and drivers, clean up code and refactor it in
  preparation for future changes:

   - Rework the initialization and cleanup of thermal class cooling
     devices to separate DT-based cooling device registration and
     cooling device registration without DT (Daniel Lezcano, Ovidiu
     Panait)

   - Update the cooling device DT bindings to support 3-cell cooling
     device representation, where the additional cell holds an ID to
     select a cooling mechanism for devices that offer multiple cooling
     mechanisms, and adjust the cooling device registration code
     accordingly (Gaurav Kohli, Daniel Lezcano)

   - Remove dead code from two functions in the thermal core and
     simplify the unregistration of thermal governors (Rafael Wysocki)

   - Fix critical temperature attribute removal handling in the generic
     thermal zone hwmon support code and rework that code to register a
     separate hwmon class device for each thermal zone (instead of using
     one hwmon class device for all thermal zones of the same type) to
     address thermal zone removal deadlocks (Rafael Wysocki)

   - Use attribute groups for adding temperature attributes to hwmon
     class devices associated with thermal zones (Rafael Wysocki)

   - Pass WQ_UNBOUND when allocating the thermal workqueue (Marco
     Crivellari)

   - Fix potential shift overflow in ptc_mmio_write() and improve error
     handling in proc_thermal_ptc_add() in the int340x thermal control
     driver (Aravind Anilraj)

   - Use sysfs_emit() for cpumask printing in the Intel powerclamp
     thermal driver (Yury Norov)

   - Add Arrow Lake CPU models to the intel_tcc_cooling driver (Srinivas
     Pandruvada)

   - Add QCom Nord, Shikra and Hawi temperature sensor DT bindings
     (Deepti Jaggi, Gaurav Kohli, Dipa Ramesh Mantre)

   - Use devm_add_action_or_reset() for clock disable on the NVidia
     soctherm and switch it to devm cooling device registration version
     (Daniel Lezcano)

   - Add the Amlogic T7 thermal sensor along with thermal calibration
     data read from SMC calls (Ronald Claveau)

   - Fix atomic temperature read in the QCom tsens driver to comply with
     hardware documentation (Priyansh Jain)

   - Add SpacemiT K1 thermal sensor support (Shuwei Wu)

   - Add i.MX93 temperature sensor support and filter out the invalid
     temperature (Jacky Bai)

   - Enable by default the TMU (Thermal Monitoring Unit) on Exynos
     platform (Krzysztof Kozlowski)

   - Rework interrupt initialization in the Tsens driver and add the
     optional wakeup source (Priyansh Jain)

   - Fix typo in a comment in the TSens QCom driver (Jinseok Kim)

   - Fix trailing whitespace and repeated word in the OF code, remove
     quoted string splitting across lines from the iMX7 driver, and
     remove a stray space from the thermal_trip_of_attr() macro
     definition (Mayur Kumar)

   - Update the thermal testing facility code to avoid NULL pointer
     dereferences by rejecting missing command arguments and replace
     sscanf() with kstrtoint() or kstrtoul() in that code (Ovidiu
     Panait, Samuel Moelius)"

* tag 'thermal-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm: (54 commits)
  thermal: sysfs: Replace sscanf() with kstrtoul()
  thermal: testing: Replace sscanf() with kstrtoint()
  thermal: testing: reject missing command arguments
  thermal: intel: intel_tcc_cooling: Add Arrow Lake CPU models
  thermal/drivers/qcom/tsens: Disable wakeup interrupt setup on automotive targets
  thermal/drivers/qcom/tsens: Switch wake IRQ handling to PM callbacks
  thermal/core: Fix missing stub for devm_thermal_cooling_device_register
  dt-bindings: thermal: cooling-devices: Update support for 3 cells cooling device
  thermal/of: Support cooling device ID in cooling-spec
  thermal/of: Pass cdev_id and introduce devm registration helper
  thermal/of: Add cooling device ID support
  thermal/of: Rename the devm_thermal_of_cooling_device_register() function
  thermal/core: Make cooling device OF node conditional on CONFIG_THERMAL_OF
  thermal/of: Move cooling device OF helpers out of thermal core
  hwmon: Use non-OF thermal cooling device registration API
  thermal/core: Add devm_thermal_cooling_device_register()
  thermal/core: Introduce non-OF thermal_cooling_device_register()
  thermal/drivers/samsung: Enable TMU by default
  thermal/driver/qoriq: Workaround unexpected temperature readings from tmu
  thermal/drivers/qoriq: Add i.MX93 tmu support
  ...

4 days agoMerge tag 'acpi-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm
Linus Torvalds [Mon, 15 Jun 2026 06:02:38 +0000 (11:32 +0530)] 
Merge tag 'acpi-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI support updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to upstream version
  20260408, introduce support for devres-based management of ACPI notify
  handlers and update some core ACPI device drivers on top of that
  (which includes some fixes and cleanups), add _DEP support for PCI/CXL
  roots and Intel CVS devices, fix a couple of assorted issues and clean
  up code:

   - Fix multiple issues related to probe, removal and missing NVDIMM
     device notifications in the ACPI NFIT driver (Rafael Wysocki)

   - Add support for devres-based management of ACPI notify handlers to
     the ACPI core (Rafael Wysocki)

   - Switch multiple core ACPI device drivers (including the ACPI PAD,
     ACPI video bus, ACPI HED, ACPI thermal zone, ACPI AC, ACPI battery,
     and ACPI NFIT drivers) over to using devres-based resource
     management during probe (Rafael Wysocki)

   - Replace mutex_lock/unlock() with guard()/scoped_guard() in the ACPI
     PMIC driver (Maxwell Doose)

   - Fix message kref handling in the dead device path of the ACPI IPMI
     address space handler (Yuho Choi)

   - Use sysfs_emit() in idlecpus_show() in the ACPI processor
     aggregator device (PAD) driver (Yury Norov)

   - Clean up device_id_scheme initialization in the ACPI video bus
     driver (Jean-Ralph Aviles)

   - Clean up lid handling in the ACPI button driver and
     acpi_button_probe(), reorganize installing and removing event
     handlers in that driver and switch it over to using devres-based
     resource management during probe (Rafael Wysocki)

   - Add support for the Legacy Virtual Register (LVR) field in I2C
     serial bus resource descriptors to ACPICA (Akhil R)

   - Fix multiple issues related to bounds checks, input validation,
     use-after-free, and integer overflow checks in the AML interpreter
     in ACPICA (ikaros)

   - Update the copyright year to 2026 in ACPICA files and make minor
     changes related to ACPI 6.6 support (Pawel Chmielewski)

   - Remove spurious precision from format used to dump parse trees in
     ACPICA (David Laight)

   - Add modern standby DSM GUIDs to ACPICA header files (Daniel
     Schaefer)

   - Fix FADT 32/64X length mismatch warning in ACPICA (Abdelkader
     Boudih)

   - Update D3hot/cold device power states definitions in ACPICA header
     files (Aymeric Wibo)

   - Fix NULL pointer dereference in acpi_ns_custom_package() (Weiming
     Shi)

   - Update ACPICA version to 20260408 (Saket Dumbre)

   - Add cpuidle driver check in acpi_processor_register_idle_driver()
     to avoid evaluating _CST unnecessarily (Tony W Wang-oc)

   - Suppress UBSAN warning caused by field misuse during PCC-based
     register access in the ACPI CPPC library (Jeremy Linton)

   - Add support for CPPC v4 to the ACPI CPPC library (Sumit Gupta)

   - Update the ACPI device enumeration code to honor _DEP for ACPI0016
     PCI/CXL host bridges and make the ACPI PCI root driver clear _DEP
     dependencies for PCI roots that have become operational (Chen Pei)"

* tag 'acpi-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm: (74 commits)
  ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver()
  ACPI: IPMI: Fix message kref handling on dead device
  ACPI: CPPC: Suppress UBSAN warning caused by field misuse
  ACPI: scan: Honor _DEP for Intel CVS devices
  ACPI: NFIT: core: Fix possible deadlock and missing notifications
  ACPI: NFIT: core: Eliminate redundant local variable
  ACPI: NFIT: core: Fix acpi_nfit_init() error cleanup
  ACPI: NFIT: core: Fix possible NULL pointer dereference
  ACPI: bus: Clean up devm_acpi_install_notify_handler()
  ACPI: button: Switch over to devres-based resource management
  ACPI: button: Reorganize installing and removing event handlers
  ACPI: button: Use string literals for generating netlink messages
  ACPI: button: Clean up adding and removing lid procfs interface
  ACPI: button: Merge two switch () statements in acpi_button_probe()
  ACPI: button: Drop redundant variable from acpi_button_probe()
  ACPI: button: Rework device verification during probe
  ACPI: CPPC: Add support for CPPC v4
  ACPI: PAD: Use sysfs_emit() in idlecpus_show()
  ACPI: scan: Honor _DEP for ACPI0016 PCI/CXL host bridge
  ACPI: PCI: Clear _DEP dependencies after PCI root bridge attach
  ...

4 days agoMerge tag 'nolibc-20260614-for-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 15 Jun 2026 05:59:31 +0000 (11:29 +0530)] 
Merge tag 'nolibc-20260614-for-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc

Pull nolibc updates from Thomas Weißschuh:

 - New architectures: OpenRISC and 32-bit parisc

 - New library functionality: alloca(), assert(), creat() and
   ftruncate()

 - Automatic large file support

 - Proper 64-bit system call argument passing on x32 and MIPS N32

 - Cleanups of the testmatrix

 - Various bugfixes and cleanups

* tag 'nolibc-20260614-for-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc: (37 commits)
  selftests/nolibc: test against -Wwrite-strings
  selftests/nolibc: use mutable buffer for execve() argv string
  tools/nolibc: cast default values of program_invocation_name
  tools/nolibc: add ftruncate()
  tools/nolibc: add a helper to split a 64-bit argument into 32-bit halves
  selftests/nolibc: enable CONFIG_TMPFS for sparc32
  tools/nolibc: stackprotector: Avoid stalling program startup if crng is not init yet
  tools/nolibc: getopt: Fix potential out of bounds access
  selftests/nolibc: test open mode handling
  tools/nolibc: always pass mode to open syscall
  tools/nolibc: split open mode handling into a macro
  tools/nolibc: split implicit open flags into a macro
  tools/nolibc: add support for 32-bit parisc
  selftests/nolibc: avoid function pointer comparisons
  tools/nolibc: add support for OpenRISC / or1k
  selftests/nolibc: use vmlinux for MIPS tests
  selftests/nolibc: trim IMAGE mappings
  selftests/nolibc: trim DEFCONFIG mappings
  selftests/nolibc: trim QEMU_ARCH mappings
  selftests/nolibc: use QEMU_ARCH for QEMU_ARCH_USER
  ...

4 days agoMerge branch 'bpf-skmsg-some-fixes-for-skmsg'
Alexei Starovoitov [Mon, 15 Jun 2026 04:30:21 +0000 (21:30 -0700)] 
Merge branch 'bpf-skmsg-some-fixes-for-skmsg'

Jiayuan Chen says:

====================
bpf, skmsg: some fixes for skmsg

All fixes are from previous patches sent by Weiming Shi, Zhang Cen,
Kuniyuki and Sechang Lim, which have already been reviewed by me and John and Jakub.

https://lore.kernel.org/bpf/20260610081218.506709-2-rhkrqnwk98@gmail.com/
https://lore.kernel.org/bpf/20260520102715.3033936-1-rollkingzzc@gmail.com/
https://lore.kernel.org/bpf/20260424191602.1522411-3-bestswngs@gmail.com/
https://lore.kernel.org/bpf/20260423155807.1245644-2-bestswngs@gmail.com/
https://lore.kernel.org/bpf/20260221233234.3814768-4-kuniyu@google.com/

The automated reviewer (sashiko) may still flag a few other potential
issues on top of this series. After looking into them, they are either
already covered by the patches here, are the BPF program's own
responsibility (e.g. initializing the payload it pushes) and intentionally
left out, or only reachable under very narrow conditions that require a
specially crafted BPF program and an unusual sk_msg ring state, so they are
not practical to trigger and are left out of this series. I'm collecting
these fixes together because the same
problems have been re-sent many times in slightly different forms, and I
hope this series can be prioritized for merging so the duplicates can
finally settle. With so many AI-generated patches floating around for
these spots, leaving them unmerged just keeps wasting maintainer review
cycles on the same issues.

v3->v4: Carry Kuniyuki Iwashima's reviewed-by tag.
        Drop the __GFP_ZERO patch; initializing the pushed payload is the
        BPF program's responsibility, not the kernel's (per maintainer
        feedback).
        https://lore.kernel.org/bpf/20260612130919.299124-1-jiayuan.chen@linux.dev/
v2->v3: Target to bpf-next and carry Emil's reviewed-by tag.
        Reverse xmas tree style is used suggested by Cong.
        (not all code match reverse xmas tree due to variable dependency)
v1->v2: fix problem when fix the conflict.
====================

Link: https://patch.msgid.link/20260615021959.140010-1-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoselftests/bpf: add test for bpf_msg_pop_data() overflow
Sechang Lim [Mon, 15 Jun 2026 02:19:59 +0000 (10:19 +0800)] 
selftests/bpf: add test for bpf_msg_pop_data() overflow

Add a test in sockmap_basic.c that calls bpf_msg_pop_data() with a length
close to U32_MAX, which overflows the start + len bounds check. The sk_msg
program records the return value over a sendmsg and the test checks that
the call is rejected with -EINVAL.

Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>
Signed-off-by: Sechang Lim <rhkrqnwk98@gmail.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20260615021959.140010-7-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agobpf, sockmap: fix integer overflow in bpf_msg_pop_data() bounds check
Sechang Lim [Mon, 15 Jun 2026 02:19:58 +0000 (10:19 +0800)] 
bpf, sockmap: fix integer overflow in bpf_msg_pop_data() bounds check

start and len are u32, so

u64 last = start + len;

evaluates start + len in 32-bit and wraps before storing it in last.
The bounds check

if (start >= offset + l || last > msg->sg.size)
return -EINVAL;

can then be passed with an out-of-range start/len, after which the pop
loop runs off the end of the scatterlist and sk_msg_shift_left() calls
put_page() on the empty msg->sg.end slot:

  Oops: general protection fault, probably for non-canonical address
  0xdffffc0000000001: 0000 [#1] SMP KASAN PTI
  KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
  RIP: 0010:sk_msg_shift_left net/core/filter.c:2957 [inline]
  RIP: 0010:____bpf_msg_pop_data net/core/filter.c:3103 [inline]
  RIP: 0010:bpf_msg_pop_data+0x753/0x1a10 net/core/filter.c:2984
  Call Trace:
   <TASK>
   bpf_prog_4cc92c278f4d5d56+0x1b1/0x1e8
   bpf_prog_run_pin_on_cpu+0x107/0x320 include/linux/filter.h:746
   sk_psock_msg_verdict+0x357/0x7f0 net/core/skmsg.c:934
   tcp_bpf_send_verdict net/ipv4/tcp_bpf.c:420 [inline]
   tcp_bpf_sendmsg+0x766/0x1ae0 net/ipv4/tcp_bpf.c:583
   __sock_sendmsg+0x153/0x1c0 net/socket.c:802
   __sys_sendto+0x326/0x430 net/socket.c:2265
   __x64_sys_sendto+0xe3/0x100 net/socket.c:2268
   do_syscall_64+0x14c/0x480
   entry_SYSCALL_64_after_hwframe+0x77/0x7f
   </TASK>

Widen the addition with a (u64) cast so the bound is evaluated in
64-bit and a len near U32_MAX no longer wraps below msg->sg.size.

While here, change pop from int to u32. It counts bytes against the
unsigned scatterlist lengths and can never be negative, so the signed
type only invites sign-confusion in the pop loop.

Fixes: 7246d8ed4dcc ("bpf: helper to pop data from messages")
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Sechang Lim <rhkrqnwk98@gmail.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20260615021959.140010-6-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agosockmap: Fix use-after-free in udp_bpf_recvmsg()
Kuniyuki Iwashima [Mon, 15 Jun 2026 02:19:57 +0000 (10:19 +0800)] 
sockmap: Fix use-after-free in udp_bpf_recvmsg()

syzbot reported use-after-free of struct sk_msg in sk_msg_recvmsg(). [0]

sk_msg_recvmsg() peeks sk_msg from psock->ingress_msg under a lock,
but its processing is lockless.

Thus, sk_msg_recvmsg() must be serialised by callers, otherwise
multiple threads could touch the same sk_msg.

For example, TCP uses lock_sock(), and AF_UNIX uses unix_sk(sk)->iolock.

Initially, udp_bpf_recvmsg() had used lock_sock(), but the cited
commit removed it.

Let's serialise sk_msg_recvmsg() with lock_sock() in udp_bpf_recvmsg().

Note that holding spin_lock_bh(&sk->sk_receive_queue.lock) is not
an option due to copy_page_to_iter() in sk_msg_recvmsg().

[0]:
BUG: KASAN: slab-use-after-free in sk_msg_recvmsg+0xb54/0xc30 net/core/skmsg.c:428
Read of size 4 at addr ffff88814cdcf000 by task syz.0.24/6020

CPU: 1 UID: 0 PID: 6020 Comm: syz.0.24 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 01/13/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xba/0x230 mm/kasan/report.c:482
 kasan_report+0x117/0x150 mm/kasan/report.c:595
 sk_msg_recvmsg+0xb54/0xc30 net/core/skmsg.c:428
 udp_bpf_recvmsg+0x4bd/0xe00 net/ipv4/udp_bpf.c:84
 inet_recvmsg+0x260/0x270 net/ipv4/af_inet.c:891
 sock_recvmsg_nosec net/socket.c:1078 [inline]
 sock_recvmsg+0x1a8/0x270 net/socket.c:1100
 ____sys_recvmsg+0x1e6/0x4a0 net/socket.c:2812
 ___sys_recvmsg+0x215/0x590 net/socket.c:2854
 do_recvmmsg+0x334/0x800 net/socket.c:2949
 __sys_recvmmsg net/socket.c:3023 [inline]
 __do_sys_recvmmsg net/socket.c:3046 [inline]
 __se_sys_recvmmsg net/socket.c:3039 [inline]
 __x64_sys_recvmmsg+0x198/0x250 net/socket.c:3039
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb319f9aeb9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb31ad97028 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007fb31a216090 RCX: 00007fb319f9aeb9
RDX: 0000000000000001 RSI: 0000200000000400 RDI: 0000000000000004
RBP: 00007fb31a008c1f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000040000021 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb31a216128 R14: 00007fb31a216090 R15: 00007ffe21dd0a98
 </TASK>

Allocated by task 6019:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
 __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415
 kasan_kmalloc include/linux/kasan.h:263 [inline]
 __kmalloc_cache_noprof+0x3d1/0x6e0 mm/slub.c:5780
 kmalloc_noprof include/linux/slab.h:957 [inline]
 kzalloc_noprof include/linux/slab.h:1094 [inline]
 alloc_sk_msg net/core/skmsg.c:510 [inline]
 sk_psock_skb_ingress_self+0x60/0x350 net/core/skmsg.c:612
 sk_psock_verdict_apply net/core/skmsg.c:1038 [inline]
 sk_psock_verdict_recv+0x7d9/0x8d0 net/core/skmsg.c:1236
 udp_read_skb+0x73e/0x7e0 net/ipv4/udp.c:2045
 sk_psock_verdict_data_ready+0x12d/0x550 net/core/skmsg.c:1257
 __udp_enqueue_schedule_skb+0xc54/0x10b0 net/ipv4/udp.c:1789
 __udp_queue_rcv_skb net/ipv4/udp.c:2346 [inline]
 udp_queue_rcv_one_skb+0xac5/0x19c0 net/ipv4/udp.c:2475
 __udp4_lib_mcast_deliver+0xc06/0xcf0 net/ipv4/udp.c:2585
 __udp4_lib_rcv+0x10f6/0x2620 net/ipv4/udp.c:2724
 ip_protocol_deliver_rcu+0x282/0x440 net/ipv4/ip_input.c:207
 ip_local_deliver_finish+0x3bb/0x6f0 net/ipv4/ip_input.c:241
 NF_HOOK+0x336/0x3c0 include/linux/netfilter.h:318
 dst_input include/net/dst.h:474 [inline]
 ip_sublist_rcv_finish+0x221/0x2a0 net/ipv4/ip_input.c:584
 ip_list_rcv_finish net/ipv4/ip_input.c:628 [inline]
 ip_sublist_rcv+0x5c6/0xa70 net/ipv4/ip_input.c:644
 ip_list_rcv+0x3f1/0x450 net/ipv4/ip_input.c:678
 __netif_receive_skb_list_ptype net/core/dev.c:6195 [inline]
 __netif_receive_skb_list_core+0x7e5/0x810 net/core/dev.c:6242
 __netif_receive_skb_list net/core/dev.c:6294 [inline]
 netif_receive_skb_list_internal+0x995/0xcf0 net/core/dev.c:6385
 netif_receive_skb_list+0x54/0x410 net/core/dev.c:6437
 xdp_recv_frames net/bpf/test_run.c:269 [inline]
 xdp_test_run_batch net/bpf/test_run.c:350 [inline]
 bpf_test_run_xdp_live+0x1946/0x1cf0 net/bpf/test_run.c:379
 bpf_prog_test_run_xdp+0x81c/0x1160 net/bpf/test_run.c:1396
 bpf_prog_test_run+0x2c7/0x340 kernel/bpf/syscall.c:4703
 __sys_bpf+0x5cb/0x920 kernel/bpf/syscall.c:6182
 __do_sys_bpf kernel/bpf/syscall.c:6274 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:6272 [inline]
 __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6272
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 6021:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
 poison_slab_object mm/kasan/common.c:253 [inline]
 __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
 kasan_slab_free include/linux/kasan.h:235 [inline]
 slab_free_hook mm/slub.c:2540 [inline]
 slab_free mm/slub.c:6674 [inline]
 kfree+0x1be/0x650 mm/slub.c:6882
 kfree_sk_msg include/linux/skmsg.h:385 [inline]
 sk_msg_recvmsg+0xaa8/0xc30 net/core/skmsg.c:483
 udp_bpf_recvmsg+0x4bd/0xe00 net/ipv4/udp_bpf.c:84
 inet_recvmsg+0x260/0x270 net/ipv4/af_inet.c:891
 sock_recvmsg_nosec net/socket.c:1078 [inline]
 sock_recvmsg+0x1a8/0x270 net/socket.c:1100
 ____sys_recvmsg+0x1e6/0x4a0 net/socket.c:2812
 ___sys_recvmsg+0x215/0x590 net/socket.c:2854
 do_recvmmsg+0x334/0x800 net/socket.c:2949
 __sys_recvmmsg net/socket.c:3023 [inline]
 __do_sys_recvmmsg net/socket.c:3046 [inline]
 __se_sys_recvmmsg net/socket.c:3039 [inline]
 __x64_sys_recvmmsg+0x198/0x250 net/socket.c:3039
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Fixes: 9f2470fbc4cb ("skmsg: Improve udp_bpf_recvmsg() accuracy")
Reported-by: syzbot+9307c991a6d07ce6e6d8@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/69922ac9.a70a0220.2c38d7.00e0.GAE@google.com/
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20260615021959.140010-5-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agobpf, sockmap: keep sk_msg copy state in sync
Zhang Cen [Mon, 15 Jun 2026 02:19:56 +0000 (10:19 +0800)] 
bpf, sockmap: keep sk_msg copy state in sync

SK_MSG uses msg->sg.copy as per-scatterlist-entry provenance. Entries
with this bit set are copied before data/data_end are exposed to SK_MSG
BPF programs for direct packet access.

bpf_msg_pull_data(), bpf_msg_push_data(), and bpf_msg_pop_data()
rewrite the sk_msg scatterlist ring by collapsing, splitting, and
shifting entries. These operations move msg->sg.data[] entries, but the
parallel copy bitmap can be left behind on the old slot. A copied entry
can then return to msg->sg.start with its copy bit clear and be exposed
as directly writable packet data.

This corruption path requires an attached SK_MSG BPF program that calls
the mutating helpers; ordinary sockmap/TLS traffic that never runs
push/pop/pull helper sequences is not affected.

Keep msg->sg.copy synchronized with scatterlist entry moves, preserve
the copy bit when an entry is split, clear it when a helper replaces an
entry with a private page, and clear slots vacated by pull-data
compaction.

Fixes: 015632bb30da ("bpf: sk_msg program helper bpf_sk_msg_pull_data")
Fixes: 6fff607e2f14 ("bpf: sk_msg program helper bpf_msg_push_data")
Fixes: 7246d8ed4dcc ("bpf: helper to pop data from messages")
Cc: stable@vger.kernel.org
Co-developed-by: Han Guidong <2045gemini@gmail.com>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Han Guidong <2045gemini@gmail.com>
Signed-off-by: Zhang Cen <rollkingzzc@gmail.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20260615021959.140010-4-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agobpf, sockmap: Fix wrong rsge offset in bpf_msg_push_data()
Weiming Shi [Mon, 15 Jun 2026 02:19:55 +0000 (10:19 +0800)] 
bpf, sockmap: Fix wrong rsge offset in bpf_msg_push_data()

When bpf_msg_push_data() splits a scatterlist element into head and
tail, the tail's page offset is advanced by `start` (absolute message
byte offset) instead of `start - offset` (byte position within the
element). This makes rsge.offset overshoot by `offset` bytes, pointing
to the wrong location within the page or beyond its boundary. Consumers
of the corrupted entry either silently read wrong data or trigger an
out-of-bounds access.

 BUG: KASAN: slab-use-after-free in bpf_msg_pull_data (net/core/filter.c:2728)
 Read of size 32752 at addr ffff8881042f0010 by task poc/130
 Call Trace:
  __asan_memcpy (mm/kasan/shadow.c:105)
  bpf_msg_pull_data (net/core/filter.c:2728)
  bpf_prog_run_pin_on_cpu (include/linux/bpf.h:1402)
  sk_psock_msg_verdict (net/core/skmsg.c:934)
  tcp_bpf_send_verdict (net/ipv4/tcp_bpf.c:421)
  sock_sendmsg_nosec (net/socket.c:727)

Fixes: 6fff607e2f14 ("bpf: sk_msg program helper bpf_msg_push_data")
Reported-by: Xiang Mei <xmei5@asu.edu>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20260615021959.140010-3-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agobpf, sockmap: reject overflowing copy + len in bpf_msg_push_data()
Weiming Shi [Mon, 15 Jun 2026 02:19:54 +0000 (10:19 +0800)] 
bpf, sockmap: reject overflowing copy + len in bpf_msg_push_data()

When the scatterlist ring is full or nearly full, bpf_msg_push_data()
enters a copy fallback path and computes copy + len for the page
allocation size. Since len comes from BPF with arg3_type = ARG_ANYTHING
and both are u32, a crafted len can wrap the sum to a small value,
causing an undersized allocation followed by an out-of-bounds memcpy.

 BUG: unable to handle page fault for address: ffffed104089a402
 Oops: Oops: 0000 [#1] SMP KASAN NOPTI
 Call Trace:
  __asan_memcpy (mm/kasan/shadow.c:105)
  bpf_msg_push_data (net/core/filter.c:2852 net/core/filter.c:2788)
  bpf_prog_9ed8b5711920a7d7+0x2e/0x36
  sk_psock_msg_verdict (net/core/skmsg.c:934)
  tcp_bpf_sendmsg (net/ipv4/tcp_bpf.c:421 net/ipv4/tcp_bpf.c:584)
  __sys_sendto (net/socket.c:2206)
  do_syscall_64 (arch/x86/entry/syscall_64.c:94)
  entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)

Add an overflow check before the allocation.

Link: https://lore.kernel.org/all/20260424155913.A19FDC19425@smtp.kernel.org
Fixes: 6fff607e2f14 ("bpf: sk_msg program helper bpf_msg_push_data")
Tested-by: Xiang Mei <xmei5@asu.edu>
Tested-by: Xinyu Ma <mmmxny@gmail.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20260615021959.140010-2-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoselftsets/bpf: Retry map update on helper_fill_hashmap()
Gabriele Monaco [Thu, 11 Jun 2026 15:07:03 +0000 (17:07 +0200)] 
selftsets/bpf: Retry map update on helper_fill_hashmap()

helper_fill_hashmap() is used also on parallel and stress map tests.
Those are consistently failing with ENOMEM on kernels built with
PREEMPT_RT if preallocation is disabled. The failure is transient and
only called by the memory cache refill running in a preemptible
irq_work, which can easily stall in case of contention.

Use a retriable update in those cases to handle transient ENOMEM and
make the test more stable also on PREEMPT_RT.
Also fix the sign of the value printed in case of error (strerror()
expects a positive errno while updates return it negative).

Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/r/20260611150704.95133-1-gmonaco@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoMerge tag 'rust-7.2' of gitolite.kernel.org:pub/scm/linux/kernel/git/ojeda/linux
Linus Torvalds [Mon, 15 Jun 2026 03:55:48 +0000 (09:25 +0530)] 
Merge tag 'rust-7.2' of gitolite.kernel.org:pub/scm/linux/kernel/git/ojeda/linux

Pull Rust updates from Miguel Ojeda:
 "This one is big due to the vendoring of the `zerocopy` library, which
  allows us to replace a bunch of `unsafe` code dealing with conversions
  between byte sequences and other types with safe alternatives. More
  details on that below (and in its merge commit).

  Toolchain and infrastructure:

   - Introduce support for the 'zerocopy' library [1][2]:

         Fast, safe, compile error. Pick two.

         Zerocopy makes zero-cost memory manipulation effortless. We write
         `unsafe` so you don't have to.

     It essentially provides derivable traits (e.g. 'FromBytes') and
     macros (e.g. 'transmute!') for safely converting between byte
     sequences and other types. Having such support allows us to remove
     some 'unsafe' code.

     It is among the most downloaded Rust crates and it is also used by
     the Rust compiler itself.

     It is licensed under "BSD-2-Clause OR Apache-2.0 OR MIT".

     The crates are imported essentially as-is (only +2/-3 lines needed
     to be adapted), plus SPDX identifiers. Upstream has since added the
     SPDX identifiers as well as one of the tweaks at my request, thus
     reducing our future diffs on updates -- I keep the details in one
     of our usual live lists [3].

     In total, it is about ~39k lines added, ~32k without counting
     'benches/' which are just for documentation purposes.

     The series includes a few Kbuild and rust-analyzer improvements and
     an example patch using it in Nova, removing one 'unsafe impl'.

     I checked that the codegen of an isolated example function (similar
     to the Nova patch on top) is essentially identical. It also turns
     out that (for that particular case) the 'zerocopy' version, even
     with 'debug-assertions' enabled, has no remaining panics, unlike a
     few in the current code (since the compiler can prove the remaining
     'ub_checks' statically).

     So their "fast, safe" does indeed check out -- at least in that
     case.

   - Support AutoFDO. This allows Rust code to be profiled and optimized
     based on the profile. Tested with Rust Binder: ~13% slower without
     AutoFDO in the binderAddInts benchmark (using an app-launch
     benchmark for the profile).

   - Support Software Tag-Based KASAN.

     In addition, fix KASAN Kconfig by requiring Clang.

   - Add Kconfig options for each existing Rust KUnit test suite, such
     as 'CONFIG_RUST_BITMAP_KUNIT_TEST'.

     They are placed within a new menu, 'CONFIG_RUST_KUNIT_TESTS', in
     the new 'rust/kernel/Kconfig.test' file.

   - Support the upcoming Rust 1.98.0 release (expected 2026-08-20):
     lint cleanups and an unstable flag rename.

   - Disable 'rustdoc' documentation inlining for all prelude items,
     which bloats the generated documentation.

   - Ignore (in Git) and clean (in Kbuild) the (rarely) 'rustc'-generated
     '*.long-type-*.txt' files.

  'kernel' crate:

   - Add new 'bitfield' module with the 'bitfield!' macro (extracted
     from the existing 'register!' one), which declares integer types
     that are split into distinct bit fields of arbitrary length.

     Each field is a 'Bounded' of the appropriate bit width (ensuring
     values are properly validated and avoiding implicit data loss) and
     gets several generated getters and setters (infallible, 'const' and
     fallible) as well as associated constants ('_MASK', '_SHIFT' and
     '_RANGE'). It also supports fields that can be converted from/to
     custom types, either fallibly ('?=>') or infallibly ('=>').

     For instance:

         bitfield! {
             struct Rgb(u16) {
                 15:11 blue;
                 10:5 green;
                 4:0 red;
             }
         }

         // Compile-time checks.
         let color = Rgb::zeroed().with_const_green::<0x1f>();

         assert_eq!(color.green(), 0x1f);
         assert_eq!(color.into_raw(), 0x1f << Rgb::GREEN_SHIFT);

     Add as well documentation and a test suite for it, as usual; and
     update the 'register!' macro to use it.

     It will be maintained by Alexandre Courbot (with Yury Norov as
     reviewer) under a new 'MAINTAINERS' entry: 'RUST [BITFIELD]'.

   - 'ptr' module: rework index projection syntax into keyworded syntax
     and introduce panicking variant.

     The keyword syntax ('build:', 'try:', 'panic:') is more explicit
     and paves the way of perhaps adding more flavors in the future,
     e.g. an 'unsafe' index projection.

     For instance, projections now look like this:

         fn f(p: *const [u8; 32]) -> Result {
             // Ok, within bounds, checked at build time.
             project!(p, [build: 1]);

             // Build error.
             project!(p, [build: 128]);

             // `OutOfBound` runtime error (convertible to `ERANGE`).
             project!(p, [try: 128]);

             // Runtime panic.
             project!(p, [panic: 128]);

             Ok(())
         }

     Update as well the users, which now look like e.g.

         // Pointer to the first entry of the GSP message queue.
         let data = project!(self.0.as_ptr(), .gspq.msgq.data[build: 0]);

   - 'build_assert' module: make the module the home of its macros
     instead of rendering them twice.

   - 'sync' module: add 'UniqueArc::as_ptr()' associated function.

   - 'alloc' module:

       - Fix the 'Vec::reserve()' doctest to properly account for the
         existing vector length in the capacity assertion.

       - Fix an incorrect operator in the 'Vec::extend_with()' 'SAFETY'
         comment; add a doc test demonstrating basic usage and the
         zero-length case.

   - Clean imports across several modules to follow the "kernel
     vertical" import style in order to minimize conflicts.

  'pin-init' crate:

   - User visible changes:

       - Do not generate 'non_snake_case' warnings for identifiers that
         are syntactically just users of a field name. This would allow
         all '#[allow(non_snake_case)]' in nova-core to be removed,
         which Gary will send to the nova tree next cycle.

       - Filter non-cfg attributes out properly in derived structs. This
         improves pin-init compatibility with other derive macros.

       - Insert projection types' where clause properly.

   - Other changes:

       - Bump MSRV to 1.82, plus associated cleanups.

       - Overhaul how init slots are projected. The new approach is
         easier to justify with safety comments.

       - Mark more functions as inline, which should help mitigate the
         super-long symbol name issue due to lack of inlining.

  rust-analyzer:

   - Support '--envs' for passing env vars for crates like 'zerocopy'.

  'MAINTAINERS':

   - Add the following reviewers to the 'RUST' entry:
       - Daniel Almeida
       - Tamir Duberstein
       - Alexandre Courbot
       - Onur Özkan

     They have been involved in the Rust for Linux project for about 7
     collective years and bring expertise across several domains, which
     will be very useful to have around in the future.

     Thanks everyone for stepping up!

  And some other fixes, cleanups and improvements"

Link: https://github.com/google/zerocopy
Link: https://docs.rs/zerocopy
Link: https://github.com/Rust-for-Linux/linux/issues/1239
* tag 'rust-7.2' of gitolite.kernel.org:pub/scm/linux/kernel/git/ojeda/linux: (86 commits)
  MAINTAINERS: add Onur Özkan as Rust reviewer
  MAINTAINERS: add Alexandre Courbot as Rust reviewer
  MAINTAINERS: add Tamir Duberstein as Rust reviewer
  MAINTAINERS: add Daniel Almeida as Rust reviewer
  kbuild: rust: clean `zerocopy-derive` in `mrproper`
  rust: make `build_assert` module the home of related macros
  rust: str: clean unused import for Rust >= 1.98
  rust: str: use the "kernel vertical" imports style
  rust: aref: use the "kernel vertical" imports style
  rust: page: use the "kernel vertical" imports style
  gpu: nova-core: firmware: parse `FalconUCodeDescV2` via `zerocopy`
  rust: prelude: add `zerocopy{,_derive}::FromBytes`
  rust: zerocopy-derive: enable support in kbuild
  rust: zerocopy-derive: add `README.md`
  rust: zerocopy-derive: avoid generating non-ASCII identifiers
  rust: zerocopy-derive: add SPDX License Identifiers
  rust: zerocopy-derive: import crate
  rust: zerocopy: enable support in kbuild
  rust: zerocopy: add `README.md`
  rust: zerocopy: remove float `Display` support
  ...

4 days agoMerge tag 'rcu.release.v7.2' of gitolite.kernel.org:pub/scm/linux/kernel/git/rcu...
Linus Torvalds [Mon, 15 Jun 2026 03:46:00 +0000 (09:16 +0530)] 
Merge tag 'rcu.release.v7.2' of gitolite.kernel.org:pub/scm/linux/kernel/git/rcu/linux

Pull RCU updates from Uladzislau Rezki:
 "Torture test updates:

   - Improve kvm-series.sh script by adding examples in its header
     comment

   - Lazy RCU is more fully tested now by replacing call_rcu_hurry()
     with call_rcu() and doing rcu_barrier() to motivate lazy callbacks
     during a stutter pause

   - Add more synonyms for the "--do-normal" group of torture.sh
     command-line arguments

  Misc changes:

   - Reduce stack usage of nocb_gp_wait() to address frame size warning
     when built with CONFIG_UBSAN_ALIGNMENT

   - The synchronize_rcu() call can detect the flood and latches a
     normal/default path temporary switching to wait_rcu_gp() path

   - Document using rcu_access_pointer() to fetch the old pointer for
     lockless cmpxchg() updates

   - Simplify some RCU code using clamp_val()

   - Fix a kerneldoc header comment typo in srcu_down_read_fast()"

* tag 'rcu.release.v7.2' of gitolite.kernel.org:pub/scm/linux/kernel/git/rcu/linux:
  rcu/nocb: reduce stack usage in nocb_gp_wait()
  rcu-tasks: Fix possible boot-time tests failed for the call_rcu_tasks()
  rcu: Latch normal synchronize_rcu() path on flood
  rcu: Document rcu_access_pointer() feeding into cmpxchg()
  rcu: Simplify param_set_next_fqs_jiffies() by applying clamp_val()
  rcu: Simplify rcu_do_batch() by applying clamp()
  checkpatch: Undeprecate rcu_read_lock_trace() and rcu_read_unlock_trace()
  srcu: Fix kerneldoc header comment typo in srcu_down_read_fast()
  torture: Allow "norm" abbreviation for "normal"
  torture: Improve kvm-series.sh header comment
  torture: Add torture_sched_set_normal() for user-specified nice values
  rcutorture: Fully test lazy RCU

4 days agoMerge tag 'kcsan-20260612-v7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 15 Jun 2026 03:26:31 +0000 (08:56 +0530)] 
Merge tag 'kcsan-20260612-v7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/melver/linux

Pull KCSAN update from Marco Elver:

 - Silence -Wmaybe-uninitialized when calling __kcsan_check_access()

* tag 'kcsan-20260612-v7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/melver/linux:
  kcsan: Silence -Wmaybe-uninitialized when calling __kcsan_check_access()

4 days agoselftests/bpf: Add test for sleepable lsm_cgroup rejection
David Windsor [Thu, 11 Jun 2026 14:35:49 +0000 (10:35 -0400)] 
selftests/bpf: Add test for sleepable lsm_cgroup rejection

Confirm the verifier rejects loading a sleepable BPF_LSM_CGROUP program,
as introduced in commit 5b038319be44 ("bpf: Reject sleepable
BPF_LSM_CGROUP programs at load time").

Signed-off-by: David Windsor <dwindsor@gmail.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/r/20260611143549.703914-1-dwindsor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoudf: fix nls leak on udf_fill_super() failure
Al Viro [Wed, 11 Feb 2026 20:11:28 +0000 (15:11 -0500)] 
udf: fix nls leak on udf_fill_super() failure

On all failure exits that go to error_out there we have already moved the
nls reference from uopt->nls_map to sbi->s_nls_map, leaving NULL behind.

Fixes: c4e89cc674ac ("udf: convert to new mount API")
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
4 days agoMerge remote-tracking branches 'ras/edac-drivers' and 'ras/edac-misc' into edac-updates
Borislav Petkov (AMD) [Mon, 15 Jun 2026 01:39:50 +0000 (18:39 -0700)] 
Merge remote-tracking branches 'ras/edac-drivers' and 'ras/edac-misc' into edac-updates

* ras/edac-drivers: (21 commits)
  EDAC: Consistently define pci_device_ids using named initializers
  EDAC/igen6: Add Intel Nova Lake-H SoC support
  EDAC/igen6: Make registers for detecting IBECC configurable
  EDAC/imh: Add RRL support for Intel Diamond Rapids server
  EDAC/{skx_common,i10nm}: Prepare RRL for sub-channel granularity
  EDAC/skx_common: Add SubChannel support to ADXL decode
  EDAC/{skx_common,i10nm}: Move RRL handling to common code
  EDAC/{skx_common,i10nm}: Introduce rrl_ctrl_mode
  EDAC/{skx_common,i10nm}: Rename rrl_mode to rrl_source_type
  EDAC/{skx_common,skx,i10nm}: Split skx_set_decode()
  EDAC/{skx_common,i10nm,imh}: Move MC register access helpers to skx_common
  EDAC/{skx_common,skx}: Fix UBSAN shift-out-of-bounds in skx_get_dimm_info
  EDAC/igen6: Add one Intel Panther Lake-H SoC support
  EDAC/igen6: Fix memory topology parsing for Panther Lake-H SoCs
  EDAC/igen6: Fix call trace due to missing release()
  EDAC/sb_edac: fix grammar in sb_decode_ddr3 warning
  EDAC/i5400: disable error reporting at teardown and refactor helper
  EDAC/i5100: disable error reporting at teardown and create helper
  EDAC/i5000: disable error reporting at teardown and refactor helper
  EDAC/i7300: disable error reporting if init fails and refactor helper
  ...

* ras/edac-misc:
  RAS/AMD/ATL: Drop malformed default N from Kconfig

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
4 days agoMerge branch 'bpf-fix-bpf_get-setsockopt-to-tos-for-ipv4-mapped-ipv6-socket'
Alexei Starovoitov [Mon, 15 Jun 2026 00:38:55 +0000 (17:38 -0700)] 
Merge branch 'bpf-fix-bpf_get-setsockopt-to-tos-for-ipv4-mapped-ipv6-socket'

Leon Hwang says:

====================
bpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socket

When TCP over IPv4 via INET6 API, sk->sk_family is AF_INET6, but it is a
v4 pkt. inet_csk(sk)->icsk_af_ops is ipv6_mapped and use ip_queue_xmit.
The tos sockopt does not work for bpf [get,set]sockopt() helpers.

Changelog:
v3 -> v4:
* Add 'sk->sk_type != SOCK_RAW && !ipv6_only_sock(sk)' check.
* Re-implement test with LLM assistance.
* v3: https://lore.kernel.org/all/20240914103226.71109-1-zhoufeng.zf@bytedance.com/

v2->v3:
* Use sk_is_inet() helper. (Eric Dumazet)
* https://lore.kernel.org/bpf/CANn89i+9GmBLCdgsfH=WWe-tyFYpiO27wONyxaxiU6aOBC6G8g@mail.gmail.com/T/

v1->v2:
* Fix compilation error. (kernel test robot)
* https://lore.kernel.org/bpf/202408152058.YXAnhLgZ-lkp@intel.com/T/
====================

Link: https://patch.msgid.link/20260613162443.60515-1-leon.hwang@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoselftests/bpf: Add test to verify the fix for bpf_setsockopt() helper
Leon Hwang [Sat, 13 Jun 2026 16:24:43 +0000 (00:24 +0800)] 
selftests/bpf: Add test to verify the fix for bpf_setsockopt() helper

Verify the fix by:

1. Attach cgroup sockops prog.
2. Build a tcp connection using ipv4 addr in ipv6 socket.
3. Verify the return value of bpf_setsockopt() helper.

Assisted-by: Codex:gpt-5.5-xhigh
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://lore.kernel.org/r/20260613162443.60515-3-leon.hwang@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agobpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socket
Leon Hwang [Sat, 13 Jun 2026 16:24:42 +0000 (00:24 +0800)] 
bpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socket

When TCP over IPv4 via INET6 API, bpf_get/setsockopt with ipv4 will
fail, because sk->sk_family is AF_INET6. With ipv6 will success, not
take effect, because inet_csk(sk)->icsk_af_ops is ipv6_mapped and
use ip_queue_xmit, inet_sk(sk)->tos.

To relax this restriction, allow getting/setting tos for those possible
ipv4-mapped ipv6 sockets.

Fixes: ee7f1e1302f5 ("bpf: Change bpf_setsockopt(SOL_IP) to reuse do_ip_setsockopt()")
Signed-off-by: Feng Zhou <zhoufeng.zf@bytedance.com>
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://lore.kernel.org/r/20260613162443.60515-2-leon.hwang@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoMerge branch 'tools-build-bpf-append-extra_cflags-and-host_extracflags'
Alexei Starovoitov [Mon, 15 Jun 2026 00:32:54 +0000 (17:32 -0700)] 
Merge branch 'tools-build-bpf-append-extra_cflags-and-host_extracflags'

Leo Yan says:

====================
tools build: bpf: Append EXTRA_CFLAGS and HOST_EXTRACFLAGS

Append EXTRA_CFLAGS and HOST_EXTRACFLAGS to the BPF build.

This mitigates an issue introduced in GCC 15, where a {0} initializer
does not guarantee zeroing the entire union [1].

The common changes under tools to support EXTRA_CFLAGS and
HOST_EXTRACFLAGS are sent separately [2].  As suggested, BPF patches
would be picked up via the bpf tree, so this series only includes BPF
related changes.

Verification on bpf-ci (with tools changes [2]:

  https://github.com/kernel-patches/bpf/actions/runs/26815163486

[1] https://gcc.gnu.org/gcc-15/changes.html
[2] https://lore.kernel.org/all/20260602-tools_build_fix_zero_init-v7-0-631baf679fe7@arm.com/

Signed-off-by: Leo Yan <leo.yan@arm.com>
---
Changes in v2:
- Used strscpy() instead in patch 06 (Ihor).
- Added prefix "bpf-next" in subject (Alexei).
- Added patch 01 to pass host cflags to bootstrap libbpf.
- Added patch 08 to avoid static LLVM linking for cross build.
- Link to v1: https://lore.kernel.org/r/20260323-tools_build_fix_zero_init_bpf_only-v1-0-d1cfad2f4cd1@arm.com
====================

Link: https://patch.msgid.link/20260602-tools_build_fix_zero_init_bpf_only-v2-0-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoselftests/bpf: Avoid static LLVM linking for cross builds
Leo Yan [Tue, 2 Jun 2026 14:47:17 +0000 (15:47 +0100)] 
selftests/bpf: Avoid static LLVM linking for cross builds

The BPF selftests prefer static LLVM linking, which works for native
builds but can break cross builds. Its --link-static output may include
host-only libraries that are unavailable for the cross compilation,
causing link failures.

Avoid static LLVM linking for cross builds and use shared LLVM libraries
instead. Native builds keep the existing behavior.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-8-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoselftests/bpf: Use common CFLAGS for urandom_read
Leo Yan [Tue, 2 Jun 2026 14:47:16 +0000 (15:47 +0100)] 
selftests/bpf: Use common CFLAGS for urandom_read

The urandom_read helper and its shared library are built with $(CLANG)
directly rather than through the normal selftest $(CC) rules.

The CFLAGS variable can contain specific flags only for $(CC) but might
be imcompatible for $(CLANG) and those flags are not necessarily valid
for the clang-only urandom_read build.

Split the BPF selftest local flags into COMMON_CFLAGS and append them to
CFLAGS for the normal build path. Use COMMON_CFLAGS directly for
urandom_read and liburandom_read.so, while still filtering out -static as
before.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-7-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agoselftests/bpf: Initialize operation name before use
Leo Yan [Tue, 2 Jun 2026 14:47:15 +0000 (15:47 +0100)] 
selftests/bpf: Initialize operation name before use

ASAN reports stack-buffer-overflow due to the uninitialized op_name.

Initialize it to fix the issue.

Fixes: 054b6c7866c7 ("selftests/bpf: Add verifier log tests for BPF_BTF_LOAD command")
Signed-off-by: Leo Yan <leo.yan@arm.com>
Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-6-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agotools/bpf: build: Append extra cflags
Leo Yan [Tue, 2 Jun 2026 14:47:14 +0000 (15:47 +0100)] 
tools/bpf: build: Append extra cflags

Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-5-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agolibbpf: Initialize CFLAGS before including Makefile.include
Leo Yan [Tue, 2 Jun 2026 14:47:13 +0000 (15:47 +0100)] 
libbpf: Initialize CFLAGS before including Makefile.include

tools/scripts/Makefile.include may expand EXTRA_CFLAGS in a future
change.  This could alter the initialization of CFLAGS, as the default
options "-g -O2" would never be set once EXTRA_CFLAGS is expanded.

Prepare for this by moving the CFLAGS initialization before including
tools/scripts/Makefile.include, so it is not affected by the extended
EXTRA_CFLAGS.

Append EXTRA_CFLAGS to CFLAGS only after including Makefile.include and
place it last so that the extra flags propagate properly and can
override the default options.

tools/scripts/Makefile.include already appends $(CLANG_CROSS_FLAGS) to
CFLAGS, the Makefile appends $(CLANG_CROSS_FLAGS) again, remove the
redundant append.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-4-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
4 days agobpftool: Append extra host flags
Leo Yan [Tue, 2 Jun 2026 14:47:12 +0000 (15:47 +0100)] 
bpftool: Append extra host flags

Append HOST_EXTRACFLAGS to HOST_CFLAGS so that additional flags can be
applied to the host compiler.

Acked-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-3-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>