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

mm, slab: Fix infinite loop at _slub_get_freelist() #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leitao
Copy link

@leitao leitao commented Oct 10, 2024

In some cases, _slub_get_freelist() loops forever when ptr dereferences to itself.

This causes instructions like the following to loop forever. (I got this with a vmcore)

identify_address(prog, 18446613188003018408)

If I break if the pointer is already in the freelist-set, then, I can get drgn unstuck:

identify_address(prog, 18446613188003018408)
'slab object: sock_inode_cache+0x2a8'

Co-developed-with: Leandro Silva [email protected]

In some cases, _slub_get_freelist() loops forever when ptr dereferences
to itself.

This causes instructions like the following to loop forever.  (I got
this with a vmcore)

	identify_address(prog, 18446613188003018408)

If I break if the pointer is already in the freelist-set, then, I can
get drgn unstuck:

>>> identify_address(prog, 18446613188003018408)
'slab object: sock_inode_cache+0x2a8'

Signed-off-by: Breno Leitao <[email protected]>
@osandov
Copy link
Owner

osandov commented Oct 10, 2024

I discussed this with Breno offline. We're going to use this fix internally as a quick mitigation for our automated crash dump analysis system, but I'm going to look into reporting this as a corrupted free list in some way as the proper fix.

@brenns10
Copy link
Contributor

We definitely encountered this on some core dumps as well, and did our own sort of workaround at oracle-samples/drgn-tools#110. I've had it on my agenda to work on a proper fix that allows us to report corrupted freelist pointers, and circular freelists, and continue operating, so that we can format that information for later display.

@osandov
Copy link
Owner

osandov commented Oct 10, 2024

Thanks, @brenns10, that looks pretty similar to what I had in mind. I'll take a stab at it today or tomorrow.

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.

3 participants