]> git.baikalelectronics.ru Git - kernel.git/commit
net: fix races in page->_count manipulation
authorEric Dumazet <edumazet@google.com>
Fri, 10 Oct 2014 11:48:18 +0000 (04:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Oct 2014 19:37:29 +0000 (15:37 -0400)
commit4d511592dbcc53ea8289813a6f79fb5ae1c2797d
tree85ca97083049de5acf67f1a1b467b1db209e7cdc
parentbe5ead84044549e3bbfc8900328a38bc3c0ed4c6
net: fix races in page->_count manipulation

This is illegal to use atomic_set(&page->_count, ...) even if we 'own'
the page. Other entities in the kernel need to use get_page_unless_zero()
to get a reference to the page before testing page properties, so we could
loose a refcount increment.

The only case it is valid is when page->_count is 0

Fixes: d81c967540f63 ("net: Update alloc frag to reduce get/put page usage and recycle pages")
Signed-off-by: Eric Dumaze <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c