netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net 0/5] net: fix races accessing page->_count
@ 2014-10-10 11:48 Eric Dumazet
  2014-10-10 11:48 ` [PATCH v2 net 1/5] fm10k: fix race " Eric Dumazet
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Eric Dumazet @ 2014-10-10 11:48 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Alexander Duyck, Jeff Kirsher, Andres Lagar-Cavilla,
	Greg Thelen, Hugh Dickins, David Rientjes, Eric Dumazet

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, we can use this in
__netdev_alloc_frag()

Note that I never seen crashes caused by these races, the issue was reported
by Andres Lagar-Cavilla and Hugh Dickins.


Eric Dumazet (5):
  fm10k: fix race accessing page->_count
  igb: fix race accessing page->_count
  ixgbe: fix race accessing page->_count
  mlx4: fix race accessing page->_count
  net: fix races in page->_count manipulation

 drivers/net/ethernet/intel/fm10k/fm10k_main.c |  7 +++----
 drivers/net/ethernet/intel/igb/igb_main.c     |  7 +++----
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  8 +++-----
 drivers/net/ethernet/mellanox/mlx4/en_rx.c    |  6 +++---
 net/core/skbuff.c                             | 25 ++++++++++++++++++-------
 5 files changed, 30 insertions(+), 23 deletions(-)

-- 
2.1.0.rc2.206.gedb03e5

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-10 19:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-10 11:48 [PATCH v2 net 0/5] net: fix races accessing page->_count Eric Dumazet
2014-10-10 11:48 ` [PATCH v2 net 1/5] fm10k: fix race " Eric Dumazet
2014-10-10 11:48 ` [PATCH v2 net 2/5] igb: " Eric Dumazet
2014-10-10 11:48 ` [PATCH v2 net 3/5] ixgbe: " Eric Dumazet
2014-10-10 11:48 ` [PATCH v2 net 4/5] mlx4: " Eric Dumazet
2014-10-10 11:48 ` [PATCH v2 net 5/5] net: fix races in page->_count manipulation Eric Dumazet
2014-10-10 19:37 ` [PATCH v2 net 0/5] net: fix races accessing page->_count David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).