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

cache: cache_include(): fix double put for cloned objects #416

Closed
wants to merge 1 commit into from

Conversation

KanjiMonster
Copy link
Contributor

When switching to auto obj, a nl_object_put() was left inplace in cache_include(). This leads to a double reference drop of the cloned object, leading to use after free later or triggering an assert that the reference count went negative.

Fixes: 831e986 ("cache: use the new _nl_auto_nl_object helper")

When switching to auto obj, a nl_object_put() was left inplace in
cache_include(). This leads to a double reference drop of the cloned
object, leading to use after free later or triggering an assert that
the reference count went negative.

Fixes: 831e986 ("cache: use the new _nl_auto_nl_object helper")
Signed-off-by: Jonas Gorski <[email protected]>
thom311 pushed a commit that referenced this pull request Dec 17, 2024
When switching to auto obj, a nl_object_put() was left inplace in
cache_include(). This leads to a double reference drop of the cloned
object, leading to use after free later or triggering an assert that
the reference count went negative.

Fixes: 831e986 ("cache: use the new _nl_auto_nl_object helper")
Signed-off-by: Jonas Gorski <[email protected]>

#416
@thom311
Copy link
Owner

thom311 commented Dec 17, 2024

thanks for the fix!!

hm, this is pretty bad. I think I should do a 3.12 release soon, just for this.

@thom311 thom311 closed this Dec 17, 2024
@KanjiMonster
Copy link
Contributor Author

This only does something if you are using the v2 callback where the object is actually cloned, not sure how many actually do that aside from us (who also added it).

@thom311
Copy link
Owner

thom311 commented Dec 17, 2024

I understood that it's only relevant with the v2 callback.

But I don't have a clear picture who uses that. It was unnoticed since:

  • introduces in August 2024 (arguably, few people test upstream before it gets released)
  • 3.11 release, ~47 days ago

ok, then maybe no immediate hurry... :)

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.

2 participants