Re: [PATCH net-next] ppp: require callers of ppp_dev_name() to hold RCU

From: Breno Leitao

Date: Tue Mar 17 2026 - 16:05:47 EST


On Mon, Mar 16, 2026 at 05:28:23PM +0800, Qingfang Deng wrote:
> 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

nit: The only two references of the function *are*...

> which already hold RCU. So remove the internal RCU lock and document
> that callers must hold RCU.

This symbol is also exported, but, we don't care if external drivers
call it without holding the RCU read lock.

> Signed-off-by: Qingfang Deng <dqfext@xxxxxxxxx>

Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>