Re: [PATCH net v2 0/2] net/x25: don't call lock_sock() from softirq in x25_kill_by_neigh()
From: Krystian Kaniewski
Date: Fri Nov 27 2026 - 08:30:27 EST
Hi Martin,
I tested v2 on net c5de2ce2fccd in QEMU with the syzbot config of
300375dfd44665f063a6. The syz reproducer of that report and both
reproducers of 9faa82ae2e94c5c7d2ef hit the splats without the series
and run clean with it. Link loss, restart and NETDEV_DOWN with idle and
owned calls are clean too, and your tests 2 and 3 pass. The same holds
with the PREEMPT_RT config of 9faa82ae2e94c5c7d2ef.
On the question of the netdev bot: patch 2 fixes a bug that can be hit
at runtime, the x25_recvmsg() case included. The window is narrow, but
a test can hold it open. A second thread owns the socket, stalled in a
userfaultfd copy, while sendmsg() or recvmsg() waits with the lock
dropped, and a CLEAR REQUEST from the peer goes to the backlog. For
x25_sendmsg() and x25_output() an RR in the backlog first frees the
send buffer, and the sender runs at SCHED_FIFO on the owner's CPU, so
it gets its skb before the CLEAR REQUEST is processed. For
x25_recvmsg() the CLEAR REQUEST follows a short DATA packet and the
first fragment of a longer message, and the receive buffer is small,
so the fragment sets X25_COND_OWN_RX_BUSY and x25_disconnect() purges
it again. Without patch 2 all three end in a NULL pointer dereference
(trimmed):
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
RIP: 0010:x25_sendmsg+0x8b2/0x1580
Call Trace:
__sys_sendto+0x48a/0x4e0
__x64_sys_sendto+0xe0/0x1c0
do_syscall_64+0x125/0x7a0
The other two stop in x25_output+0x51f, called from x25_sendmsg(), and
in x25_write_internal+0x26f, called from x25_check_rbuf() in
x25_recvmsg(). With the series send() returns ENOTCONN and recv()
returns the data. I can send the test program if it helps.
Tested-by: Krystian Kaniewski <krystianmkaniewski@xxxxxxxxx>
--
Krystian Kaniewski