Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve freelist walking #12

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ksen-lin
Copy link

@ksen-lin ksen-lin commented Mar 2, 2025

Hi!
I came across the following situations that libslub couldn´t handle:

  1. a loop in a freelist led to libslub hanging with ^C being the only help
  2. an address in a freelist that couldn't be dereferenced (eg unmapped) resulted in an exception

For the first one i've added a limit that depends on a maximum capacity of a particular slub. For the second i've added a try-except, and also an explicit check to point non-kernel addresses.

With my fixes it looks like this:

  1. circular (2 elements) freelist
    dups
  2. invalid next
    next

Looking forward to comments/suggestions if you have any. Thanks!

ksen-lin added 3 commits March 1, 2025 12:19
libslub got stuck on freelists that contained cycles. Fix by walking no more than `max_objs_per_slab` steps.
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.

1 participant