6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bernard Pidoux rose_kick() transmits a skb_clone() of each data frame and keeps the original on ack_queue. The clone shares its data buffer with the original, so the sequence numbers that rose_send_iframe() ORs into byte 2 of the header are also left in the queued original. After a RESET, rose_requeue_frames() puts those originals back on the write queue and rose_kick() sends them again with vs/vr restarted at zero. rose_send_iframe() only ORs the new values into byte 2, so the retransmitted frame carries the bitwise OR of the old and new N(R) and N(S). The peer rejects the invalid N(R) with a new RESET REQUEST, the frames are requeued again, and the two nodes reset each other forever. This was observed on a live FPAC network: a White Pages circuit between two nodes looping on RESET REQUEST / RESET CONFIRMATION / DATA at about 2000 frames per second, with DATA frames resent as "R3 S7" right after a reset instead of "R0 S0", until the application was restarted. Clear everything but the M bit before setting the sequence numbers, as x25_send_iframe() does for modulo 8 circuits. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux (cherry picked from commit b16b091aeb78faac22cf2b850246826d23f4a335) Signed-off-by: Sasha Levin --- net/rose/rose_out.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rose/rose_out.c b/net/rose/rose_out.c index 9050e33c96042..6672fc65a7651 100644 --- a/net/rose/rose_out.c +++ b/net/rose/rose_out.c @@ -34,6 +34,7 @@ static void rose_send_iframe(struct sock *sk, struct sk_buff *skb) if (skb == NULL) return; + skb->data[2] &= ROSE_M_BIT; skb->data[2] |= (rose->vr << 5) & 0xE0; skb->data[2] |= (rose->vs << 1) & 0x0E; -- 2.53.0