summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorQingfang Deng <dqfext@gmail.com>2026-03-16 17:28:23 +0800
committerJakub Kicinski <kuba@kernel.org>2026-03-17 16:18:48 -0700
commitbb8539e0e60916ef3ed4a92eb2f3cfd8e34061ef (patch)
tree69c7271bc3fcb8d7991d241a99a0aee4cd156996 /include
parente3f741f587a9826a82304bb5da021e0fe783795d (diff)
ppp: require callers of ppp_dev_name() to hold RCU
ppp_dev_name() holds the RCU read lock internally to protect pch->ppp. However, as it returns netdev->name to the caller, the caller should also hold either RCU or RTNL lock to prevent the netdev from being freed. The only two references of the function is in the L2TP driver, both of which already hold RCU. So remove the internal RCU lock and document that callers must hold RCU. Signed-off-by: Qingfang Deng <dqfext@gmail.com> Reviewed-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20260316092824.479149-1-dqfext@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ppp_channel.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h
index ca8ad03eeef0..2f63e9a6cc88 100644
--- a/include/linux/ppp_channel.h
+++ b/include/linux/ppp_channel.h
@@ -72,7 +72,9 @@ extern int ppp_channel_index(struct ppp_channel *);
/* Get the unit number associated with a channel, or -1 if none */
extern int ppp_unit_number(struct ppp_channel *);
-/* Get the device name associated with a channel, or NULL if none */
+/* Get the device name associated with a channel, or NULL if none.
+ * Caller must hold RCU read lock.
+ */
extern char *ppp_dev_name(struct ppp_channel *);
/*