Skip to content

[rocky10_2] History Rebuild through kernel-6.12.0-211.61.1.el10_2 - #1669

Open
PlaidCat wants to merge 15 commits into
rocky10_2from
rocky10_2_rebuild
Open

PlaidCat wants to merge 15 commits into
rocky10_2from
rocky10_2_rebuild

Conversation

@PlaidCat

@PlaidCat PlaidCat commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

This is an automated kernel history rebuild using cron and internal tooling. It follows the same process used for previous history rebuilds:

  • Download all unprocessed src.rpm packages
  • For each src.rpm:
    • Identify all commits in the changelog up to the last known tag (6.12.0-211)
    • Replay commits in chronological order (oldest to newest in the changelog) using git cherry-pick
    • Replace the code in the branch with the output of rpmbuild -bp for the corresponding src.rpm
    • Tag the rebuild branch

JIRA Tickets

Rebuild Splat Inspection

kernel-6.12.0-211.61.1.el10_2

$ cat ciq/ciq_backports/kernel-6.12.0-211.61.1.el10_2/rebuild.details.txt
Rebuild_History BUILDABLE
Rebuilding Kernel from rpm changelog with Fuzz Limit: 87.50%
Number of commits in upstream range v6.12~1..kernel-mainline: 158564
Number of commits in rpm: 17
Number of commits matched with upstream: 14 (82.35%)
Number of commits in upstream but not in rpm: 158550
Number of commits NOT found in upstream: 3 (17.65%)

Rebuilding Kernel on Branch rocky10_2_rebuild_kernel-6.12.0-211.61.1.el10_2 for kernel-6.12.0-211.61.1.el10_2
Clean Cherry Picks: 13 (92.86%)
Empty Cherry Picks: 1 (7.14%)
_______________________________

__EMPTY COMMITS__________________________
40ab6644b99685755f740b872c00ef40d9aa870e fhandle: fix UAF due to unlocked ->mnt_ns read in may_decode_fh()

__CHANGES NOT IN UPSTREAM________________
Add partial riscv64 support for build root'
Provide basic VisionFive 2 support'
crypto: testmgr - block Crypto API xxhash64 in FIPS mode

BUILD

$ grep -E -B 5 -A 5 "\[TIMER\]|^Starting Build" $(ls -t kbuild* | head -n1)
/mnt/code/kernel-src-tree-build
Running make mrproper...
  CLEAN   scripts/basic
  CLEAN   scripts/kconfig
  CLEAN   include/config include/generated
[TIMER]{MRPROPER}: 13s
x86_64 architecture detected, copying config
'configs/kernel-x86_64-rhel.config' -> '.config'
Setting Local Version for build
CONFIG_LOCALVERSION="-rocky10_2_rebuild-fab9392bfdd7"
Making olddefconfig
--
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
Starting Build
  GEN     arch/x86/include/generated/asm/orc_hash.h
  WRAP    arch/x86/include/generated/uapi/asm/bpf_perf_event.h
  UPD     include/generated/uapi/linux/version.h
  WRAP    arch/x86/include/generated/uapi/asm/errno.h
  WRAP    arch/x86/include/generated/uapi/asm/fcntl.h
--
  LD [M]  net/qrtr/qrtr-mhi.ko
  LD [M]  virt/lib/irqbypass.ko
  BTF [M] net/qrtr/qrtr-mhi.ko
  BTF [M] net/qrtr/qrtr.ko
  BTF [M] virt/lib/irqbypass.ko
[TIMER]{BUILD}: 3796s
Making Modules
  SYMLINK /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+/build
  INSTALL /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+/modules.builtin
  INSTALL /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+/modules.order
  INSTALL /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+/modules.builtin.modinfo
--
  SIGN    /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+/kernel/net/qrtr/qrtr-mhi.ko
  STRIP   /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+/kernel/virt/lib/irqbypass.ko
  SIGN    /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+/kernel/net/qrtr/qrtr.ko
  SIGN    /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+/kernel/virt/lib/irqbypass.ko
  DEPMOD  /lib/modules/6.12.0-rocky10_2_rebuild-fab9392bfdd7+
[TIMER]{MODULES}: 21s
Making Install
  INSTALL /boot
[TIMER]{INSTALL}: 29s
Checking kABI
kABI check passed
Setting Default Kernel to /boot/vmlinuz-6.12.0-rocky10_2_rebuild-fab9392bfdd7+ and Index to 2
Hopefully Grub2.0 took everything ... rebooting after time metrices
[TIMER]{MRPROPER}: 13s
[TIMER]{BUILD}: 3796s
[TIMER]{MODULES}: 21s
[TIMER]{INSTALL}: 29s
[TIMER]{TOTAL} 3868s
Rebooting in 10 seconds

KSelfTests

$ get_kselftest_diff.sh
kselftest.6.12.0-rocky10_2_rebuild-e68abaf29ed0+.log
492
kselftest.6.12.0-rocky10_2_rebuild-0647fbe9328b+.log
492
kselftest.6.12.0-rocky10_2_rebuild-58c29b94a3fd+.log
490
kselftest.6.12.0-rocky10_2_rebuild-fab9392bfdd7+.log
491
Before: kselftest.6.12.0-rocky10_2_rebuild-58c29b94a3fd+.log
After: kselftest.6.12.0-rocky10_2_rebuild-fab9392bfdd7+.log
Diff:
+ok 1 selftests: timers: posix_timers
-ok 2 selftests: seccomp: seccomp_benchmark
-ok 7 selftests: timers: raw_skew
+ok 7 selftests: timers: raw_skew # SKIP
+ok 85 selftests: kvm: rseq_test

jira KERNEL-1695
cve CVE-2026-45942
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Yongjian Sun <sunyongjian1@huawei.com>
commit bdc56a9

A bitmap inconsistency issue was observed during stress tests under
mixed huge-page workloads. Ext4 reported multiple e4b bitmap check
failures like:

ext4_mb_complex_scan_group:2508: group 350, 8179 free clusters as
per group info. But got 8192 blocks

Analysis and experimentation confirmed that the issue is caused by a
race condition between page migration and bitmap modification. Although
this timing window is extremely narrow, it is still hit in practice:

folio_lock                        ext4_mb_load_buddy
__migrate_folio
  check ref count
  folio_mc_copy                     __filemap_get_folio
                                      folio_try_get(folio)
                                  ......
                                  mb_mark_used
                                  ext4_mb_unload_buddy
  __folio_migrate_mapping
    folio_ref_freeze
folio_unlock

The root cause of this issue is that the fast path of load_buddy only
increments the folio's reference count, which is insufficient to prevent
concurrent folio migration. We observed that the folio migration process
acquires the folio lock. Therefore, we can determine whether to take the
fast path in load_buddy by checking the lock status. If the folio is
locked, we opt for the slow path (which acquires the lock) to close this
concurrency window.

Additionally, this change addresses the following issues:

When the DOUBLE_CHECK macro is enabled to inspect bitmap-related
issues, the following error may be triggered:

corruption in group 324 at byte 784(6272): f in copy != ff on
disk/prealloc

Analysis reveals that this is a false positive. There is a specific race
window where the bitmap and the group descriptor become momentarily
inconsistent, leading to this error report:

ext4_mb_load_buddy                   ext4_mb_load_buddy
  __filemap_get_folio(create|lock)
    folio_lock
  ext4_mb_init_cache
    folio_mark_uptodate
                                     __filemap_get_folio(no lock)
                                     ......
                                     mb_mark_used
                                       mb_mark_used_double
  mb_cmp_bitmaps
                                       mb_set_bits(e4b->bd_bitmap)
  folio_unlock

The original logic assumed that since mb_cmp_bitmaps is called when the
bitmap is newly loaded from disk, the folio lock would be sufficient to
prevent concurrent access. However, this overlooks a specific race
condition: if another process attempts to load buddy and finds the folio
is already in an uptodate state, it will immediately begin using it without
holding folio lock.

	Signed-off-by: Yongjian Sun <sunyongjian1@huawei.com>
	Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
	Reviewed-by: Baokun Li <libaokun1@huawei.com>
	Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260106090820.836242-1-sunyongjian@huaweicloud.com
	Signed-off-by: Theodore Ts'o <tytso@mit.edu>
	Cc: stable@kernel.org
(cherry picked from commit bdc56a9)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-46076
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Kevin Cheng <chengkev@google.com>
commit c36991c

Explicitly synthesize a #UD for VMMCALL if L2 is active, L1 does NOT want
to intercept VMMCALL, nested_svm_l2_tlb_flush_enabled() is true, and the
hypercall is something other than one of the supported Hyper-V hypercalls.
When all of the above conditions are met, KVM will intercept VMMCALL but
never forward it to L1, i.e. will let L2 make hypercalls as if it were L1.

The TLFS says a whole lot of nothing about this scenario, so go with the
architectural behavior, which says that VMMCALL #UDs if it's not
intercepted.

Opportunistically do a 2-for-1 stub trade by stub-ifying the new API
instead of the helpers it uses.  The last remaining "single" stub will
soon be dropped as well.

	Suggested-by: Sean Christopherson <seanjc@google.com>
Fixes: 3f4a812 ("KVM: nSVM: hyper-v: Enable L2 TLB flush")
	Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
	Cc: stable@vger.kernel.org
	Signed-off-by: Kevin Cheng <chengkev@google.com>
Link: https://patch.msgid.link/20260228033328.2285047-5-chengkev@google.com
[sean: rewrite changelog and comment, tag for stable, remove defunct stubs]
	Reviewed-by: Yosry Ahmed <yosry@kernel.org>
	Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://patch.msgid.link/20260304002223.1105129-2-seanjc@google.com
	Signed-off-by: Sean Christopherson <seanjc@google.com>
(cherry picked from commit c36991c)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Janosch Frank <frankja@linux.ibm.com>
commit dcf96f7

While we check the address for errors, we don't seem to check the bit
offsets and since they are 32 and 64 bits a lot of memory can be
reached indirectly via those offsets.

Fixes: 8422359 ("KVM: s390: irq routing for adapter interrupts.")
	Suggested-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
	Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
	Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
	Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
	Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
	Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
(cherry picked from commit dcf96f7)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Janosch Frank <frankja@linux.ibm.com>
commit 0c6294d

This test tries to setup routes which have address + offset
combinations which cross a page.

	Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
	Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
	Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
	Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
(cherry picked from commit 0c6294d)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-68299
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Harshaka Narayana <harshaka.narayana@broadcom.com>
commit 34a71f5

vmxnet3_get_hdr_len() assumes gdesc->rcd.v4/v6/tcp always describe the
outer header, but for a Geneve-encapsulated packet the device can set
them based on the inner header instead, signalled by the
VMXNET3_RCD_HDR_INNER_SHIFT bit in the completion descriptor. Since the
function never skips the outer encapsulation, this mismatch triggers:

- BUG_ON(hdr.ipv4->protocol != IPPROTO_TCP), because the outer
  protocol is UDP (Geneve), not TCP.
- BUG_ON(hdr.eth->h_proto != ...), when the tunnel's outer and inner
  IP versions differ (e.g. outer IPv6/inner IPv4 or vice versa).

Check VMXNET3_RCD_HDR_INNER_SHIFT up front and bail out, since the
function cannot locate the inner header it would need to parse. Also
convert the remaining BUG_ON()s in this function to return 0
defensively.

Fixes: 45dac1d ("vmxnet3: Changes for vmxnet3 adapter version 2 (fwd)")
	Signed-off-by: Harshaka Narayana <harshaka.narayana@broadcom.com>
	Reviewed-by: Ronak Doshi <ronak.doshi@broadcom.com>
	Reviewed-by: Sankararaman Jayaraman <sankararaman.jayaraman@broadcom.com>
	Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260713140915.3381715-1-harshaka.narayana@broadcom.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 34a71f5)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-80522
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Vladislav Dronov <vdronov@redhat.com>
commit 360f297

Perform rctx->cryptlen calculation in tegra_gcm_do_one_req() the same way
it is done in tegra_ccm_crypt_init(). The current formulae may lead to a
crash if a caller does not call tegra_gcm_setauthsize() and so ctx->authsize
remains zero. Then a decrypt operation with incorrect rctx->cryptlen will
lead to a write beyound rctx->dst_sg buffer.

As a follow-up cleanup delete struct tegra_aead_ctx->authsize field since
it appears to be completely unused. Also simplify tegra_ccm_setauthsize()
and tegra_gcm_setauthsize() functions respectively.

Fixes: 0880bb3 ("crypto: tegra - Add Tegra Security Engine driver")
	Signed-off-by: Vladislav Dronov <vdronov@redhat.com>
	Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 360f297)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-53341
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Jann Horn <jannh@google.com>
commit 40ab664
Empty-Commit: Cherry-Pick Conflicts during history rebuild.
Will be included in final tarball splat. Ref for failed cherry-pick at:
ciq/ciq_backports/kernel-6.12.0-211.61.1.el10_2/40ab6644.failed

may_decode_fh() accesses mount::mnt_ns without holding any locks; that
means the mount can concurrently be unmounted, and the mnt_namespace can
concurrently be freed after an RCU grace period.

This race can happens as follows, assuming that the mount point was
created by open_tree(..., OPEN_TREE_CLONE):

thread 1            thread 2            RCU
                    __do_sys_open_by_handle_at
                      do_handle_open
                        handle_to_path
                          may_decode_fh
                            is_mounted
                              [mount::mnt_ns access]
                            [mount::mnt_ns access]
__do_sys_close
  fput_close_sync
    __fput
      dissolve_on_fput
        umount_tree
        class_namespace_excl_destructor
          namespace_unlock
            free_mnt_ns
              mnt_ns_tree_remove
                call_rcu(mnt_ns_release_rcu)
                                        mnt_ns_release_rcu
                                          mnt_ns_release
                                            kfree
                            [mnt_namespace::user_ns access] **UAF**

Fix it by taking rcu_read_lock() around the mount::mnt_ns access, like
in __prepend_path().
Additionally, document the semantics of mount::mnt_ns, and use WRITE_ONCE()
for writers that can race with lockless readers.

This bug is unreachable unless one of the following is set:

 - CONFIG_PREEMPTION
 - CONFIG_RCU_STRICT_GRACE_PERIOD

because it requires an RCU grace period to happen during a syscall without
an explicit preemption.

This doesn't seem to have interesting security impact; worst-case, it could
leak the result of an integer comparison to userspace (from the level
check in cap_capable()), cause an endless loop, or crash the kernel by
dereferencing an invalid address.

Fixes: 620c266 ("fhandle: relax open_by_handle_at() permission checks")
	Cc: stable@vger.kernel.org
	Signed-off-by: Jann Horn <jannh@google.com>
Link: https://patch.msgid.link/20260603-vfs-fhandle-uaf-fix-v2-1-d05db76a5084@google.com
	Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
(cherry picked from commit 40ab664)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>

# Conflicts:
#	fs/namespace.c
jira KERNEL-1695
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
commit f666c92

The current calculation of the 'next' virtual address in the
page table initialization functions in arch/x86/mm/ident_map.c
doesn't protect against wrapping to zero.

This is a theoretical issue that cannot happen currently,
the problematic case is possible only if the user sets a
high enough x86_mapping_info::offset value - which no
current code in the upstream kernel does.

( The wrapping to zero only occurs if the top PGD entry is accessed.
  There are no such users upstream. Only hibernate_64.c uses
  x86_mapping_info::offset, and it operates on the direct mapping
  range, which is not the top PGD entry. )

Should such an overflow happen, it can result in page table
corruption and a hang.

To future-proof this code, replace the manual 'next' calculation
with p?d_addr_end() which handles wrapping correctly.

[ Backporter's note: there's no need to backport this patch. ]

	Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
	Signed-off-by: Ingo Molnar <mingo@kernel.org>
	Reviewed-by: Kai Huang <kai.huang@intel.com>
	Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
	Cc: Andy Lutomirski <luto@kernel.org>
	Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20241016111458.846228-2-kirill.shutemov@linux.intel.com
(cherry picked from commit f666c92)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-89480
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 7fa3f73

nvme_tcp_recv_data() completes a request once the current C2HData PDU
has been consumed. Nothing compares the total bytes received against
the length the command asked for: struct nvme_tcp_request has no
receive-side counter, queue->data_remaining is per queue, and
blk_mq_end_request() completes for blk_rq_bytes(rq) unconditionally
with no residual concept anywhere above.

A controller can therefore answer a 4096-byte read with 512 bytes and
have it reported as a complete read; user space then gets 4096 bytes of
which 3584 are whatever was already in the page. I reproduced that with
a test target.

Count the bytes received and refuse to complete a successful read whose
count does not match, at the two NVME_TCP_F_DATA_SUCCESS paths and in
nvme_tcp_process_nvme_cqe(). The success test shifts req->status right
by one, because the driver keeps the wire value there and shifts it on
completion, so the check must see what the completion path will see.
Only REQ_OP_READ is checked, because there the length comes from the
sectors the request covers; a passthrough command is built by its
submitter, which picks both command and buffer, so the kernel has
nothing to compare against.

Fixes: 3f2304f ("nvme-tcp: add NVMe over TCP host driver")
	Cc: stable@vger.kernel.org
	Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
	Signed-off-by: Keith Busch <kbusch@kernel.org>
(cherry picked from commit 7fa3f73)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-46317
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Hyunwoo Kim <imv4bel@gmail.com>
commit 7054335

kvm->arch.nested_mmus[] is walked under kvm->mmu_lock, including from the
MMU notifier path (kvm_unmap_gfn_range() -> kvm_nested_s2_unmap()), which
can run at any time. kvm_vcpu_init_nested() reallocates the array and frees
the old buffer while holding only kvm->arch.config_lock, so such a walker
can reference the freed array.

Allocate the new array outside of mmu_lock, as the allocation can sleep.
Under the lock, copy the existing entries, fix up the back pointers and
reassign the array. Free the old buffer after dropping the lock, as
kvfree() can sleep as well.

Fixes: 4f128f8 ("KVM: arm64: nv: Support multiple nested Stage-2 mmu structures")
	Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
	Reviewed-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/aiKIVVeIr1aAB1yp@v4bel
	Signed-off-by: Marc Zyngier <maz@kernel.org>
	Cc: stable@vger,kernel.org
(cherry picked from commit 7054335)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-89775
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Marc Zyngier <maz@kernel.org>
commit 8053393

Computing the effects of a TLB invalidation involves looking at
the size of the mapping cached by the TLB. For S1 mappings such as
VNCR, this is deducted from the combination of the base granule size
and the mapping level.

However, this implies that the S1 MMU is *on*. When the MMU is off,
we indicate this with the level being set to a "creative" value of
-127 (S1_MMU_DISABLED).

This ends-up being misinterpreted by pgshift_level_to_ttl() as it
doesn't handle negative levels at all (the level is immediately cast
to a u8 and only the bottom two bits considered), leading to an
invalidation size of 0. Not helpful.

Tidy-up pgshift_level_to_ttl() to handle these negative levels, and
ttl_to_size() to always return SZ_1G when no valid TTL is present.
This allows the removal of open-coded checks for similar situations.

Note that the check for a negative value not explicitely checking for
S1_MMU_DISABLED is deliberate, so that actual negative levels introduced
with LVA2 and D128 can take the same path if we ever support them.

Fixes: 7270cc9 ("KVM: arm64: nv: Handle VNCR_EL2 invalidation from MMU notifiers")
	Reported-by: Hyunwoo Kim <imv4bel@gmail.com>
Link: https://lore.kernel.org/r/ameGoxbn2wzBq2kL@v4bel
	Signed-off-by: Marc Zyngier <maz@kernel.org>
	Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260806091026.620700-3-maz@kernel.org
	Signed-off-by: Oliver Upton <oupton@kernel.org>
(cherry picked from commit 8053393)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Thaumy Cheng <thaumy.love@gmail.com>
commit c418d8b

For events with inherit_stat enabled, a "read" event will be generated
to collect per task event counts on task exit.

The call chain is as follows:

do_exit
  -> perf_event_exit_task
    -> perf_event_exit_task_context
      -> perf_event_exit_event
        -> perf_remove_from_context
          -> perf_child_detach
            -> sync_child_event
              -> perf_event_read_event

However, the child event context detaches the task too early in
perf_event_exit_task_context, which causes sync_child_event to never
generate the read event in this case, since child_event->ctx->task is
always set to TASK_TOMBSTONE. Fix that by moving context lock section
backward to ensure ctx->task is not set to TASK_TOMBSTONE before
generating the read event.

Because perf_event_free_task calls perf_event_exit_task_context with
exit = false to tear down all child events from the context, and the
task never lived, accessing the task PID can lead to a use-after-free.

To fix that, let sync_child_event read task from argument and move the
call to the only place it should be triggered to avoid the effect of
setting ctx->task to TASK_TOMESTONE, and add a task parameter to
perf_event_exit_event to trigger the sync_child_event properly when
needed.

This bug can be reproduced by running "perf record -s" and attaching to
any program that generates perf events in its child tasks. If we check
the result with "perf report -T", the last line of the report will leave
an empty table like "# PID  TID", which is expected to contain the
per-task event counts by design.

Fixes: ef54c1a ("perf: Rework perf_event_exit_event()")
	Signed-off-by: Thaumy Cheng <thaumy.love@gmail.com>
	Signed-off-by: Ingo Molnar <mingo@kernel.org>
	Acked-by: Peter Zijlstra <peterz@infradead.org>
	Cc: Adrian Hunter <adrian.hunter@intel.com>
	Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
	Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
	Cc: Ian Rogers <irogers@google.com>
	Cc: James Clark <james.clark@linaro.org>
	Cc: Jiri Olsa <jolsa@kernel.org>
	Cc: Mark Rutland <mark.rutland@arm.com>
	Cc: Namhyung Kim <namhyung@kernel.org>
	Cc: linux-perf-users@vger.kernel.org
Link: https://patch.msgid.link/20251209041600.963586-1-thaumy.love@gmail.com
(cherry picked from commit c418d8b)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-64556
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Taeyang Lee <0wn@theori.io>
commit 037a3c4

perf_event_remove_on_exec() removes events by calling
perf_event_exit_event(). For top-level events, this removes the event from
the context with DETACH_EXIT only.

This can leave inconsistent group state when a removed event is a group
leader and the group contains siblings without remove_on_exec. If the group
was active, the surviving siblings can remain active and attached to the
removed leader's sibling list, but are no longer represented by a valid
group leader on the PMU context active lists.

A later close of the removed leader uses DETACH_GROUP and can promote the
still-active siblings from this stale group state. The next schedule-in can
then add an already-linked active_list entry again, corrupting the PMU
context active list.

With DEBUG_LIST enabled, this is caught as a list_add double-add in
merge_sched_in().

Fix this by detaching group relationships when remove_on_exec removes an
event. This preserves the existing task-exit and revoke behavior, while
ensuring surviving siblings are ungrouped before the removed event leaves
the context.

Fixes: 2e498d0 ("perf: Add support for event removal on exec")
	Signed-off-by: Taeyang Lee <0wn@theori.io>
	Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/ai65GgZcC0LAlWLG@Taeyangs-MacBook-Pro.local
(cherry picked from commit 037a3c4)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira KERNEL-1695
cve CVE-2026-74753
Rebuild_History Non-Buildable kernel-6.12.0-211.61.1.el10_2
commit-author Kyle Zeng <kylebot@openai.com>
commit fa091f4

perf_event_remove_on_exec() sets remove-on-exec events to the EXIT state
and detaches their group relationships.  The event's file descriptor can
remain open, however, and perf_event_open() currently accepts that event
as a group leader because its early validation rejects only REVOKED and
DEAD events.

A new sibling can consequently be linked to the detached leader.  When
the leader is closed, perf_group_detach() observes that its
PERF_ATTACH_GROUP bit is already clear and skips the new sibling.  The
sibling then retains a group_leader pointer to the freed event.

Reject group leaders in the EXIT state.  Perform the check while holding
the shared context mutex so that an exec in the target task cannot detach
the leader between validation and group attachment.

[peterz: make the earlier test fully consistent]
Fixes: 037a3c4 ("perf/core: Detach event groups during remove_on_exec")
Assisted-by: Codex:gpt-5.6-sol
	Signed-off-by: Kyle Zeng <kylebot@openai.com>
	Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260806205655.75722-1-kylebot@openai.com
(cherry picked from commit fa091f4)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
Rebuild_History BUILDABLE
Rebuilding Kernel from rpm changelog with Fuzz Limit: 87.50%
Number of commits in upstream range v6.12~1..kernel-mainline: 158564
Number of commits in rpm: 17
Number of commits matched with upstream: 14 (82.35%)
Number of commits in upstream but not in rpm: 158550
Number of commits NOT found in upstream: 3 (17.65%)

Rebuilding Kernel on Branch rocky10_2_rebuild_kernel-6.12.0-211.61.1.el10_2 for kernel-6.12.0-211.61.1.el10_2
Clean Cherry Picks: 13 (92.86%)
Empty Cherry Picks: 1 (7.14%)
_______________________________

Full Details Located here:
ciq/ciq_backports/kernel-6.12.0-211.61.1.el10_2/rebuild.details.txt

Includes:
* git commit header above
* Empty Commits with upstream SHA
* RPM ChangeLog Entries that could not be matched

Individual Empty Commit failures contained in the same containing directory.
The git message for empty commits will have the path for the failed commit.
File names are the first 8 characters of the upstream SHA
@PlaidCat PlaidCat self-assigned this Oct 1, 2026
@PlaidCat
PlaidCat requested review from a team October 1, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants