Skip to content

lib: Drop the unused page fragment allocator - #3968

Merged
etsal merged 1 commit into
sched-ext:mainfrom
mohitmishra786:lib-drop-pagefrag-alloc
Nov 21, 2026
Merged

etsal merged 1 commit into
sched-ext:mainfrom
mohitmishra786:lib-drop-pagefrag-alloc

Conversation

@mohitmishra786

Copy link
Copy Markdown
Contributor

lib/pagefrag_alloc.h has a use-after-free (#3510): pagefrag_free() unmaps a page once its last object is freed, but the allocating CPU still caches it in page_frag_cur_page[] and keeps carving from it. Nothing in the tree uses the allocator, and lib/sdt_alloc.bpf.c and lib/alloc/buddy.bpf.c cover the same need, so this removes it as discussed in the issue.

  • lib: Drop the unused page fragment allocator

Closes #3510

@mohitmishra786

Copy link
Copy Markdown
Contributor Author

Can you @etsal please review this PR?

@mohitmishra786
mohitmishra786 force-pushed the lib-drop-pagefrag-alloc branch from db04872 to 7817757 Compare November 6, 2026 16:45
@mohitmishra786

Copy link
Copy Markdown
Contributor Author

Can you @sirlucjan please review this PR too?

@etsal etsal assigned etsal and unassigned etsal Nov 6, 2026
@etsal
etsal self-requested a review November 6, 2026 16:51
pagefrag_alloc.h has a use-after-free. pagefrag_free() unmaps a page
once its last object is freed, but the allocating CPU still caches that
page in page_frag_cur_page[] and keeps carving from it on its next
allocation.

Nothing in the tree uses the allocator. lib/sdt_alloc.bpf.c and
lib/alloc/buddy.bpf.c cover the same need, so remove it instead of
fixing it.

Link: sched-ext#3510
Signed-off-by: Mohit Mishra <immadmohit@gmail.com>
@mohitmishra786
mohitmishra786 force-pushed the lib-drop-pagefrag-alloc branch from 7817757 to d2bf02e Compare November 14, 2026 03:06
@mohitmishra786

Copy link
Copy Markdown
Contributor Author

Rebased on current main now that the scx_pandemonium verifier fix is in, so CI should come up green. Can you @sirlucjan @arighi please review and merge this?

@mohitmishra786

Copy link
Copy Markdown
Contributor Author

All checks are green now and @etsal has approved. Can you @htejun @sirlucjan please take a look and merge it if it looks fine?

@etsal
etsal added this pull request to the merge queue Nov 21, 2026
Merged via the queue into sched-ext:main with commit 0d149b2 Nov 21, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use-after-free in pagefrag_alloc

2 participants