🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Simon Horman Sat, 28 Nov 2026 14:15
Re: [PATCH net] pfcp: drop packets until the device is initialised
#23892
Author: Simon Horman
Date: Sat, 28 Nov 2026 14:15
43 lines
9447 bytes
On Thu, Nov 19, 2026 at 01:29:46PM +0100, Andrey Misiurov wrote:
> pfcp_newlink() creates the PFCP UDP socket (port 8805) and publishes it
> (sk_user_data = pfcp, encap_rcv = pfcp_encap_recv) before
> register_netdevice() runs ndo_init, which is where pfcp->dev is set. A
> datagram that arrives in that window passes the "pfcp != NULL" check in
> pfcp_encap_recv() and then dereferences a NULL pfcp->dev:
> 
>   BUG: kernel NULL pointer dereference, address: 0000000000000108
>   #PF: supervisor read access in kernel mode
>   Oops: 0000 [#1] SMP PTI
>   CPU: 0 PID: 26516 Comm: pfcp_race
>   RIP: 0010:pfcp_encap_recv+0xeb/0x1d0 [pfcp]
>   Call Trace:
>    <IRQ>
>    udp_queue_rcv_one_skb+0x24a/0x560
>    udp_queue_rcv_skb+0x4f/0x80
>    udp_unicast_rcv_skb+0x78/0xa0
>    __udp4_lib_rcv+0x519/0x5f0
>    udp_rcv+0x25/0x40
>    ip_protocol_deliver_rcu+0xd4/0x210
>    ip_local_deliver_finish+0x86/0x110
>    ip_local_deliver+0x65/0x110
>    ip_rcv+0x17d/0x190
>    __netif_receive_skb_one_core+0x8d/0xa0
> 
> The window is wide when register_netdevice() fails before ndo_init (e.g. an
> invalid name): the socket stays live until pfcp_del_sock() on the error
> path. A narrower window also exists on the normal success path.
> 
> Drop the packet while pfcp->dev is not yet set or the device is not
> running.
> 
> Fixes: 76c8764ef36a ("pfcp: add PFCP module")
> Signed-off-by: Andrey Misiurov <amisiurov@cloudlinux.com>
> ---
> Found during a backport review.
> 
> Reproduced on ubuntu-resolute 7.0.0-42: flood UDP :8805 while creating a
> pfcp link with an invalid name (register_netdevice() fails before ndo_init)
> -> the NULL-deref above (kdump vmcore). With the fix the same run stays clean.

Reviewed-by: Simon Horman <horms@kernel.org>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads