netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] netlink: bridge: fix nf_bridge->physindev use after free
@ 2024-01-11 15:06 Pavel Tikhomirov
  2024-01-11 15:06 ` [PATCH v3 1/4] netfilter: nfnetlink_log: use proper helper for fetching physinif Pavel Tikhomirov
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Pavel Tikhomirov @ 2024-01-11 15:06 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Florian Westphal, David Ahern, Jozsef Kadlecsik, Kees Cook,
	Nikolay Aleksandrov, Pablo Neira Ayuso, Roopa Prabhu
  Cc: netdev, linux-kernel, netfilter-devel, coreteam, bridge, kernel,
	Pavel Tikhomirov

Code processing skb from neigh->arp_queue can access its
nf_bridge->physindev, which can already be freed, leading to crash.

So, as Florian suggests, we can put physinif on nf_bridge and peek into
the original device with dev_get_by_index_rcu(), so that we can be sure
that device is not freed under us.

This is a second attempt to fix this issue, first attempt:

"neighbour: purge nf_bridged skb from foreign device neigh"
https://lore.kernel.org/netdev/20240108085232.95437-1-ptikhomirov@virtuozzo.com/

v3: resend it to proper lists and recipients

Pavel Tikhomirov (4):
  netfilter: nfnetlink_log: use proper helper for fetching physinif
  netfilter: nf_queue: remove excess nf_bridge variable
  netfilter: propagate net to nf_bridge_get_physindev
  netfilter: bridge: replace physindev with physinif in nf_bridge_info

 include/linux/netfilter_bridge.h           |  6 ++--
 include/linux/skbuff.h                     |  2 +-
 net/bridge/br_netfilter_hooks.c            | 42 +++++++++++++++++-----
 net/bridge/br_netfilter_ipv6.c             | 14 +++++---
 net/ipv4/netfilter/nf_reject_ipv4.c        |  9 +++--
 net/ipv6/netfilter/nf_reject_ipv6.c        | 11 ++++--
 net/netfilter/ipset/ip_set_hash_netiface.c |  8 ++---
 net/netfilter/nf_log_syslog.c              | 13 +++----
 net/netfilter/nf_queue.c                   |  6 ++--
 net/netfilter/nfnetlink_log.c              |  8 ++---
 net/netfilter/xt_physdev.c                 |  2 +-
 11 files changed, 80 insertions(+), 41 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2024-01-17 14:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-11 15:06 [PATCH v3 0/4] netlink: bridge: fix nf_bridge->physindev use after free Pavel Tikhomirov
2024-01-11 15:06 ` [PATCH v3 1/4] netfilter: nfnetlink_log: use proper helper for fetching physinif Pavel Tikhomirov
2024-01-15 10:51   ` Simon Horman
2024-01-11 15:06 ` [PATCH v3 2/4] netfilter: nf_queue: remove excess nf_bridge variable Pavel Tikhomirov
2024-01-15 10:52   ` Simon Horman
2024-01-11 15:06 ` [PATCH v3 3/4] netfilter: propagate net to nf_bridge_get_physindev Pavel Tikhomirov
2024-01-15 10:52   ` Simon Horman
2024-01-11 15:06 ` [PATCH v3 4/4] netfilter: bridge: replace physindev with physinif in nf_bridge_info Pavel Tikhomirov
2024-01-17 12:43 ` [PATCH v3 0/4] netlink: bridge: fix nf_bridge->physindev use after free Pablo Neira Ayuso
2024-01-17 14:15   ` Florian Westphal

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).