]> 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)
commitcf5bf81d3b977b6a08cbb70eec28d8d1d9f137b4
tree85ca97083049de5acf67f1a1b467b1db209e7cdc
parent62effaf94bee2986f998752e47eaf41c80a2b1ff
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: 3f5febdd121c9 ("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