public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sun Jian <sun.jian.kdev@gmail.com>
To: Florian Westphal <fw@strlen.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sun Jian <sun.jian.kdev@gmail.com>
Subject: [PATCH v4 3/5] netfilter: irc: annotate nf_nat_irc_hook with __rcu
Date: Wed,  4 Feb 2026 23:38:10 +0800	[thread overview]
Message-ID: <20260204153812.739799-4-sun.jian.kdev@gmail.com> (raw)
In-Reply-To: <20260204153812.739799-1-sun.jian.kdev@gmail.com>

The nf_nat_irc_hook is an RCU-protected pointer but lacks the
proper __rcu annotation. Add the annotation to ensure the declaration
correctly reflects its usage via rcu_dereference().

Suggested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 include/linux/netfilter/nf_conntrack_irc.h | 2 +-
 net/netfilter/nf_conntrack_irc.c           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/netfilter/nf_conntrack_irc.h b/include/linux/netfilter/nf_conntrack_irc.h
index d02255f721e1..4f3ca5621998 100644
--- a/include/linux/netfilter/nf_conntrack_irc.h
+++ b/include/linux/netfilter/nf_conntrack_irc.h
@@ -8,7 +8,7 @@
 
 #define IRC_PORT	6667
 
-extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb,
+extern unsigned int (__rcu *nf_nat_irc_hook)(struct sk_buff *skb,
 				       enum ip_conntrack_info ctinfo,
 				       unsigned int protoff,
 				       unsigned int matchoff,
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c
index 5703846bea3b..76c007530b3c 100644
--- a/net/netfilter/nf_conntrack_irc.c
+++ b/net/netfilter/nf_conntrack_irc.c
@@ -30,7 +30,7 @@ static unsigned int dcc_timeout __read_mostly = 300;
 static char *irc_buffer;
 static DEFINE_SPINLOCK(irc_buffer_lock);
 
-unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb,
+unsigned int (__rcu *nf_nat_irc_hook)(struct sk_buff *skb,
 				enum ip_conntrack_info ctinfo,
 				unsigned int protoff,
 				unsigned int matchoff,
-- 
2.43.0


  parent reply	other threads:[~2026-02-04 15:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03  8:01 [PATCH] netfilter: amanda: fix RCU pointer typing for nf_nat_amanda_hook Sun Jian
2026-02-03 13:50 ` Florian Westphal
2026-02-03 14:36   ` sun jian
2026-02-03 14:55 ` [PATCH v2] " Sun Jian
2026-02-03 15:03   ` Florian Westphal
2026-02-03 16:19     ` sun jian
2026-02-03 16:59       ` Florian Westphal
2026-02-04  1:56         ` sun jian
2026-02-04  2:31           ` sun jian
2026-02-04 12:24             ` Florian Westphal
2026-02-04 14:49               ` sun jian
2026-02-04 15:38               ` [PATCH v4 0/5] netfilter: annotate NAT helper hook pointers with __rcu Sun Jian
2026-02-04 15:38                 ` [PATCH v4 1/5] netfilter: amanda: annotate nf_nat_amanda_hook " Sun Jian
2026-02-04 15:38                 ` [PATCH v4 2/5] netfilter: ftp: annotate nf_nat_ftp_hook " Sun Jian
2026-02-05 10:00                   ` Florian Westphal
2026-02-05 12:23                     ` sun jian
2026-02-05 12:30                     ` [PATCH v5] netfilter: annotate NAT helper hook pointers " Sun Jian
2026-02-04 15:38                 ` Sun Jian [this message]
2026-02-04 15:38                 ` [PATCH v4 4/5] netfilter: snmp: annotate nf_nat_snmp_hook " Sun Jian
2026-02-04 15:38                 ` [PATCH v4 5/5] netfilter: tftp: annotate nf_nat_tftp_hook " Sun Jian

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=20260204153812.739799-4-sun.jian.kdev@gmail.com \
    --to=sun.jian.kdev@gmail.com \
    --cc=fw@strlen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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