]> git.kernelconcepts.de Git - karo-tx-linux.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)
commit4c450583d9d0a8241f0f62b80038ac47b43ff843
tree85ca97083049de5acf67f1a1b467b1db209e7cdc
parent98226208c8a1fe5834e92d827a2a1e8051a17943
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: 540eb7bf0bbed ("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