]> git.ipfire.org Git - thirdparty/linux.git/commit
ppp: disconnect channel before nullifying pch->chan
authorQingfang Deng <dqfext@gmail.com>
Thu, 12 Mar 2026 09:37:30 +0000 (17:37 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 Mar 2026 09:58:04 +0000 (10:58 +0100)
commit6a196e83a1a7e50be93482d1cd4305641f1a9fb1
treeebdfafeda2540dccfecad51463c013c12d0c141d
parenta2efb1b80f36320c67622245e661fd980aa0c344
ppp: disconnect channel before nullifying pch->chan

In ppp_unregister_channel(), pch->chan is set to NULL before calling
ppp_disconnect_channel(), which removes the channel from ppp->channels
list using list_del_rcu() + synchronize_net(). This creates an
intermediate state where the channel is still connected (on the list)
but already unregistered (pch->chan == NULL).

Call ppp_disconnect_channel() before setting pch->chan to NULL. After
the synchronize_net(), no new reader on the transmit path will hold a
reference to the channel from the list.

This eliminates the problematic state, and prepares for removing the
pch->chan NULL checks from the transmit path in a subsequent patch.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://patch.msgid.link/20260312093732.277254-1-dqfext@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ppp/ppp_generic.c