-
Notifications
You must be signed in to change notification settings - Fork 106
fw/cache: Do not take an additional reference on paged sk_buff fragment while copying http/2 response body #1734
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
Conversation
Did I understand correctly that we are taking a reference in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems there is an issue with the fix. @const-t review is definitely required, since the skb refcounting is quite a subtle topic.
8b6b784
to
f194db6
Compare
Taking additional reference on paged sk_buff fragment is not needed when building For
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
while copying http/2 response body Taking additional reference on paged sk_buff fragment is not needed when building http/2 response body because each fragment is represented by newly allocated page with page->_refcount == 1. Extra page reference would result in memory leak during sk_buff freeing because of non-zero page->_refcount, so final __put_page() would not be called. For http/1 responses we still need an additional page reference due to the fact that the page in question has actually been allocated previously by TDB (see tdb_file_open()). Missing an additional reference here would lead to TDB owned pages freeing by kfree_skb(), which in turn would cause memory corruption. Signed-off-by: Petr Vyazovik <xen@f-m.fm>
f194db6
to
cb4e298
Compare
Signed-off-by: Petr Vyazovik xen@f-m.fm