Re: [PATCH net v3 1/2] net/x25: don't call lock_sock() from softirq in x25_kill_by_neigh()
From: Martin Schiller
Date: Wed Dec 02 2026 - 07:19:16 EST
On Wed, 02 Dec 2026 13:02:09 +0100, sashiko-bot@xxxxxxxxxx wrote:
> Should x25_process_rx_frame() also bail out when X25_KILL_FLAG is set?
No. Frames on the backlog arrived before the link event and belong to
the call, so they are still handled: data is delivered to the user, and
a CLEAR REQUEST from the peer clears the call. Anything they would make
the socket send is suppressed by X25_KILL_FLAG.
> For example, a backlogged
> X25_CLEAR_REQUEST or X25_CLEAR_CONFIRMATION frame calls
> x25_disconnect(sk, 0, ...), clearing x25->neighbour and setting
> sk->sk_err = 0, so x25_release_cb() then skips
> x25_disconnect(sk, ENETUNREACH, 0, 0) and clears X25_KILL_FLAG, losing
> ENETUNREACH
That matches the current behaviour: x25_kill_by_neigh() takes
lock_sock(), so release_sock() runs the backlog first, and it then
only disconnects the socket if x25->neighbour is still the neighbour.
If the peer cleared the call before the link went away, the socket
reports that clear, with its cause and diagnostic, in both cases. The
NULL pointer dereference in x25_recvmsg() is what patch 2 fixes.