The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Praneeth Balasubramanian <praneethb2002@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Praneeth Balasubramanian <praneethb2002@gmail.com>
Subject: [PATCH net 0/2] ipmr, ip6mr: Take mrt_lock when filling the output list of a new MFC entry
Date: Fri,  4 Dec 2026 10:48:39 -0800	[thread overview]
Message-ID: <20261204184841.1686426-1-praneethb2002@gmail.com> (raw)

ipmr_update_thresholds() and ip6mr_update_thresholds() read the VIF/MIF
table and are documented to run under mrt_lock. Both MFC add functions
take the lock for an existing entry but not for a new one. That was fine
while MFC and VIF/MIF updates were all serialized by RTNL. The MFC paths
now use dedicated mutexes: IPv4 rtnetlink since commit bddafc06ca5e
("ipmr: Don't hold RTNL for ipmr_rtm_route().") and IPv6 setsockopt
since commit a4c98421720a ("ip6mr: Replace RTNL with a dedicated mutex
for MFC."). So a new entry can be filled from a table that changes
during the scan.

Patch 1 fixes IPv4 and patch 2 IPv6. They are split because the Fixes
commits landed in different releases (v7.1 and v7.2).

Found by a static analysis tool (Clang context analysis on the locking
rule in the comment); the IPv6 twin was then found by inspection. Not
triggered; build-tested only.

Praneeth Balasubramanian (2):
  ipmr: Take mrt_lock when filling the output list of a new MFC entry
  ip6mr: Take mrt_lock when filling the output list of a new MFC entry

 net/ipv4/ipmr.c  | 2 ++
 net/ipv6/ip6mr.c | 2 ++
 2 files changed, 4 insertions(+)

-- 
2.25.1


             reply	other threads:[~2026-12-04 18:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 18:48 Praneeth Balasubramanian [this message]
2026-12-04 18:48 ` [PATCH net 1/2] ipmr: Take mrt_lock when filling the output list of a new MFC entry Praneeth Balasubramanian
2026-12-04 18:48 ` [PATCH net 2/2] ip6mr: " Praneeth Balasubramanian

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=20261204184841.1686426-1-praneethb2002@gmail.com \
    --to=praneethb2002@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --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