Skip to content

[rlc-10/6.12.0-264.20.1.el10_3] Multiple patches tested (4 commits) - #1869

Open
ciq-kernel-automation[bot] wants to merge 4 commits into
rlc-10/6.12.0-264.20.1.el10_3from
{bmastbergen}_rlc-10/6.12.0-264.20.1.el10_3
Open

ciq-kernel-automation[bot] wants to merge 4 commits into
rlc-10/6.12.0-264.20.1.el10_3from
{bmastbergen}_rlc-10/6.12.0-264.20.1.el10_3

Conversation

@ciq-kernel-automation

Copy link
Copy Markdown

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

assoc_array: don't lose objects when a shortcut is split on a word boundary

cve-pre CVE-2026-99567
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 2a62c32760a8fbf464a7388853d19bc62c5cc423
assoc_array: don't lose objects when a root shortcut is split at level 4

cve-pre CVE-2026-99567
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 20b436c1ae8d37032f888c725915729830dc52f2
assoc_array: don't chain a new shortcut onto an existing one

cve CVE-2026-99567
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 48691075b0adc590a6831390723e3603dfca76fc
upstream-diff | Ported inline into the cluster path: this tree does not
    carry upstream's assoc_array_insert_shortcut() or
    assoc_array_parent_link().  The override block is verbatim, and
    set[0].ptr is computed from the overridden back pointer at each
    install point rather than once in a shared tail.
assoc_array: keep gc's cleanup out of the live tree on allocation failure

cve CVE-2026-99566
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 8afff2e4b90978b8203f9e3898995dcf86821b49
upstream-diff | Only the allocation calls differ: kept this tree's
    kzalloc()/kmalloc(struct_size()) idiom in place of
    kzalloc_obj()/kmalloc_flex().

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 33m 43s 34m 32s
aarch64 25m 31s 26m 12s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 425 62 rlc-10/6.12.0-264.20.1.el10_3 ⚠️ No baseline available
aarch64 369 56 rlc-10/6.12.0-264.20.1.el10_3 ⚠️ No baseline available

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 1540 5 rlc-10/6.12.0-264.20.1.el10_3 ⚠️ No baseline available
aarch64 1511 6 rlc-10/6.12.0-264.20.1.el10_3 ⚠️ No baseline available

🤖 This PR was automatically generated by GitHub Actions
Run ID: 46704649149

…undary

cve-pre CVE-2026-99567
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 2a62c32

When assoc_array_insert_mid_shortcut() splits a shortcut at level diff,
the new shortcut in front of the split, new_s0, gets the first
round_up(diff, ASSOC_ARRAY_KEY_CHUNK_SIZE) bits of the old shortcut's
index key, and the bits from diff onwards are then cleared from its
last word:

	blank = ULONG_MAX << (diff & ASSOC_ARRAY_KEY_CHUNK_MASK);
	new_s0->index_key[keylen - 1] &= ~blank;

When diff is a multiple of ASSOC_ARRAY_KEY_CHUNK_SIZE, the shift is 0,
blank is all ones, and the whole last word is cleared, although all of
it lies below diff.  A walk then compares the key it is looking for
against that zeroed word, takes the shortcut to point elsewhere, and
every object below it can no longer be found.

assoc_array_insert_into_terminal_node() trims a new shortcut's key the
same way, and only when the level is not a multiple of the chunk size.
Do the same here.

Found by a userspace build of the array with a test that inserts, in
order, string keys whose first word is their length and the rest their
bytes.  The 102nd key split a shortcut at bit 256, and 76 of the keys
already in the array could no longer be found; AddressSanitizer also
reported assoc_array_walk() reading a word past the end of a shortcut's
index key.  With this change the test passes, and AddressSanitizer and
UndefinedBehaviorSanitizer report nothing.

Fixes: 3cb9895 ("Add a generic associative array implementation.")
Assisted-by: LLM
	Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
	Tested-by: David Howells <dhowells@redhat.com>
	Reviewed-by: David Howells <dhowells@redhat.com>
(cherry picked from commit 2a62c32)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
cve-pre CVE-2026-99567
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 20b436c

assoc_array_insert_mid_shortcut() takes level, the level of the node
holding the shortcut as assoc_array_walk() reports it, and adds
ASSOC_ARRAY_LEVEL_STEP to get the level of a node in that shortcut's
place.  If the new key first differs from the shortcut no further in
than that, no shortcut is made in front of the split, and new_n0 takes
the old shortcut's place directly.

A shortcut at the root is held by no node.  assoc_array_walk() reports
level 0 for it, and whatever takes its place is the root, which is read
at level 0.  So when the new key first differs from a root shortcut in
bits 4-7, diff is 4, no shortcut is made in front, and new_n0, whose
slots are indexed by bits 4-7, becomes the root and is indexed by bits
0-3.  Objects already in the array can no longer be found, and the new
one lands in a slot its key does not select.

Eighteen keys are enough: seventeen that agree on bits 0-7 make the root
a shortcut, and one that agrees with them on bits 0-3 only splits it.
Three of the eighteen objects can then not be found, and inserting one
of those keys again adds a second object instead of replacing it.

Only add the step for a shortcut that hangs from a node.  A root
shortcut split at level 4 then gets a shortcut in front of the split
that ends at level 4, as assoc_array_insert_into_terminal_node() already
makes when the leaves of a full root node first differ there.

Found by a userspace test that builds a shortcut ending at every level
and splits it at every level inside it, from the root and from a node:
every split of a root shortcut at level 4 failed, and nothing else did.

Fixes: 3cb9895 ("Add a generic associative array implementation.")
Assisted-by: LLM
	Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
	Tested-by: David Howells <dhowells@redhat.com>
	Reviewed-by: David Howells <dhowells@redhat.com>
(cherry picked from commit 20b436c)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
cve CVE-2026-99567
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 4869107
upstream-diff | Ported inline into the cluster path: this tree does not
    carry upstream's assoc_array_insert_shortcut() or
    assoc_array_parent_link().  The override block is verbatim, and
    set[0].ptr is computed from the overridden back pointer at each
    install point rather than once in a shared tail.

When a full node's leaves and the new key all share the node's segment,
assoc_array_insert_into_terminal_node() replaces the node with a
shortcut to a pair of new nodes.  If the node is itself the target of a
shortcut, the new shortcut is installed as that shortcut's next node,
and a shortcut leading to a shortcut is something nothing expects:
assoc_array_walk() indexes the second one as a node, and
assoc_array_apply_edit() hits the BUG_ON() in the loop that adjusts
nr_leaves_on_branch, on that same insertion.

Deletion gets a node there.  When the subtree below a shortcut shrinks
enough, assoc_array_delete() collapses it into one node below the
shortcut, and the leaves it collects can all share that node's segment.
The next key that shares it too takes this path.  Eighteen insertions
and a deletion are enough: sixteen keys that agree on bits 0-11, one
that leaves them at bit 8 and is deleted again, and one more that agrees
with the sixteen.

Have the new shortcut replace the one in front of the node as well.
assoc_array_insert_shortcut() gives it that shortcut's back pointer and
parent slot, so the caller installs it where that one was, and excises
the old shortcut along with the node, which takes a second entry in
excised_meta[].  The new shortcut's index key comes from the new key up
to the new skip level, so it covers what the old one did.

Found by a userspace test doing random insertions and deletions on keys
that share long prefixes; a targeted case builds a shortcut, deletes
down to the collapse and inserts one more key.

Fixes: 3cb9895 ("Add a generic associative array implementation.")
	Reported-by: Ollrogge <nils-ollrogge@outlook.de>
Assisted-by: LLM
	Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
	Tested-by: David Howells <dhowells@redhat.com>
	Reviewed-by: David Howells <dhowells@redhat.com>
(cherry picked from commit 4869107)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
…lure

cve CVE-2026-99566
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 8afff2e
upstream-diff | Only the allocation calls differ: kept this tree's
    kzalloc()/kmalloc(struct_size()) idiom in place of
    kzalloc_obj()/kmalloc_flex().

assoc_array_gc() builds a copy of the tree.  Where the copy reaches a
shortcut, it allocates the copy of the shortcut with kmalloc_flex(),
fills it with memcpy(), links it into the new tree, and only then
allocates the copy of the node after it.  The memcpy() leaves the new
shortcut's next_node pointing at the old tree's node, so if that second
allocation fails, the cleanup, assoc_array_destroy_subtree() on the new
tree, follows the new shortcut into the old tree, and the BUG_ON() on
the old node's back pointer fires.

Allocate the node first, and the shortcut once the node exists, freeing
the node again if the shortcut cannot be allocated.  A copied shortcut
is then only linked into the new tree when the copy of its node is there
to follow it.  Nothing else changes: with no allocation failing, the
trees gc builds are the same as before.

Found by a userspace test that makes each allocation of each operation
fail in turn.

Fixes: 3cb9895 ("Add a generic associative array implementation.")
Assisted-by: LLM
	Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
	Tested-by: David Howells <dhowells@redhat.com>
	Reviewed-by: David Howells <dhowells@redhat.com>
(cherry picked from commit 8afff2e)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
@ciq-kernel-automation ciq-kernel-automation Bot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/46755845110

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

🔍 Diffofdiffs: 2 of 4 backports differ from upstream

View the diffofdiffs report.

Open to anyone signed in to GitHub. Report expires 2027-03-01 21:58 UTC.

# Subject Backport Upstream
1 assoc_array: don't chain a new shortcut onto an existing one 23a20c34d63b 48691075b0ad
2 assoc_array: keep gc's cleanup out of the live tree on allocation failure 3a2fd8d145ec 8afff2e4b909

Checked PR revision 3a2fd8d145ec against base 4432999b8acb.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

✅ Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/46755845110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

1 participant