mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Florian Westphal <fw@strlen.de>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@openvz.org, Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Subject: [PATCH 0/4] netlink: bridge: fix nf_bridge->physindev use after free
Date: Wed, 10 Jan 2024 19:00:10 +0800	[thread overview]
Message-ID: <20240110110451.5473-1-ptikhomirov@virtuozzo.com> (raw)

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/

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              | 13 +++----
 net/netfilter/xt_physdev.c                 |  2 +-
 11 files changed, 83 insertions(+), 43 deletions(-)

-- 
2.43.0


             reply	other threads:[~2024-01-10 11:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 11:00 Pavel Tikhomirov [this message]
2024-01-10 11:00 ` [PATCH 1/4] netfilter: nfnetlink_log: use proper helper for fetching physinif Pavel Tikhomirov
2024-01-10 13:33   ` Florian Westphal
2024-01-10 13:48     ` Pavel Tikhomirov
2024-01-10 14:01       ` Florian Westphal
2024-01-10 11:00 ` [PATCH 2/4] netfilter: nf_queue: remove excess nf_bridge variable Pavel Tikhomirov
2024-01-10 11:00 ` [PATCH 3/4] netfilter: propagate net to nf_bridge_get_physindev Pavel Tikhomirov
2024-01-10 13:34   ` Florian Westphal
2024-01-10 14:14   ` [PATCH v2 " Pavel Tikhomirov
2024-01-11 14:40     ` Paolo Abeni
2024-01-11 15:10       ` Pavel Tikhomirov
2024-01-10 11:00 ` [PATCH 4/4] netfilter: bridge: replace physindev with physinif in nf_bridge_info Pavel Tikhomirov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240110110451.5473-1-ptikhomirov@virtuozzo.com \
    --to=ptikhomirov@virtuozzo.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=kernel@openvz.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®