]> git.baikalelectronics.ru Git - kernel.git/commit
xen-netback: unref frags when handling a from-guest skb with a frag list
authorDavid Vrabel <david.vrabel@citrix.com>
Wed, 4 Mar 2015 11:14:47 +0000 (11:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Mar 2015 19:58:17 +0000 (14:58 -0500)
commite8d8a327f4353e5379baeb8fb69d1c0567fc28c6
treef642411098ecbf508d8303abdaacaa7e39642482
parent2a0396307ab39fab98a8d8c8db5937b694bb2a30
xen-netback: unref frags when handling a from-guest skb with a frag list

Every time a VIF is destroyed up to 256 pages may be leaked if packets
with more than MAX_SKB_FRAGS frags were transmitted from the guest.
Even worse, if another user of ballooned pages allocated one of these
ballooned pages it would not handle the unexpectedly >1 page count
(e.g., gntdev would deadlock when unmapping a grant because the page
count would never reach 1).

When handling a from-guest skb with a frag list, unref the frags
before releasing them so they are freed correctly when the VIF is
destroyed.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/xen-netback/netback.c