From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.70.43.100 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796289462; b=eW17aDAo+vzlJQNOmN9YRHjDhv0cr0vOR/eui4f1YR/gybAeXGd7dzcD6KK0k9fL2tM1 q0dMd7CQ84UedGbd2LfHa3c4crT7P2dAxrkIx4c1y+b4c3U4uv4ZRIzyNqvBUsq/1gcY+ /VAW0HMkhB+VEhgKqQGL6xpbnMqCt2WnHxTNepV/LT/QefgDPLzQ9TVfKDJVj2lKNQUir N7PJmn+8oxqcgXKZsrU1QveW7ppPXWfTzjrljTCyA8G2NN8I3L9cARGriCJDYO0CdEqdz ZasysjEj0u9HhcPI/OgEoWCI5hjRM1SrmBOtqfSThFK2ke4AX+i2nwnu2F9kL1l5VBA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796289462; h=DMARC-Filter:DKIM-Signature:Date:To:From:Cc:Subject:Message-ID: In-Reply-To:References:Feedback-ID:X-Pm-Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=yZDyFeYsKtJJ4rgbkAxCNwEqcKNkKdHbdp1xgoprQG8=; b=ALLku3ClpyOov9FARG9/9/IbOTz/FHVTFYADENig3KmXODccA/M4O+QMGsvU8kkeF6lr nuVdHC8GmCgjBcVbFRLzZFIAKTXMSY9nDxWFVrnUkItRPWLkwJaRN6vU2y4hd1qkkcaXm XwUlhzYqaMpH1UJzB5OMF1d23+c+25fkUiS9klEToqNtlGxJ4Jv8ypDJi0vj3/FluSvQO Uek5TZ9RpMKK3tABRjzKIjMBZvcHuqvf4lgXbTdfCr0/iQTWA0RvQ4UzY5qg+FKRKK0g2 s/7B+kVXhhwaVqhmj5D15bmLtpjCAqI9rdy11Wv+JknkqRiDXNx2LvX/gNJnkhOdQXQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass header.d=proton.me header.i=@proton.me header.a=rsa-sha256 header.s=protonmail2 header.b=HbHO22F2; arc=none smtp.remote-ip=185.70.43.100 Received: from mail-43100.protonmail.ch (mail-43100.protonmail.ch [185.70.43.100]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 382F0606A692 for ; Thu, 3 Dec 2026 09:17:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 382F0606A692 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=proton.me header.i=@proton.me header.a=rsa-sha256 header.s=protonmail2 header.b=HbHO22F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1796289455; x=1796548655; bh=yZDyFeYsKtJJ4rgbkAxCNwEqcKNkKdHbdp1xgoprQG8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=HbHO22F22XCpgP2IzWfBRB0zIVJa2a6bwTNiJRpvHlBqqRFmd7KMURuKSzgCUWn/8 /eOpaKoOCXrPrdwp5Lu2UFm3P1kS1DlFt1bXdK12XNQDGxs2mZnCC2fNqH9Mzmhwgl glnxOHIKlAzLr8hOR0LGO/ex6Oua1D12R4Lsae/LOPP2FakaV7dGKw4Zzay3rMdN3Q d9zg8hf3RLQFg1S0WANwIjMSkLv2qzhBZ/0MPITo/68c7kUxopg4KxGbYkzgP5YV1A DKxk+6sleH9hOxHyeY1p641vSvaqlM2tYDVJGejsfKl/Ptw2pq6fmM6j9Tq4vp0YmD FoAycc77JuZqA== Date: Thu, 03 Dec 2026 09:17:28 +0000 To: Sidraya Jayagond From: Bryam Vargas Cc: Mahanta Jambigi , "D . Wythe" , Eric Dumazet , "David S . Miller" , Paolo Abeni , Jakub Kicinski , Dust Li , Stefan Raspl , Simon Horman , Guangguan Wang , Wen Gu , linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Lu , Ursula Braun , Hidayath Khan , Wenjia Zhang Subject: Re: [PATCH net v2 5/6] net/smc: order the urgent mark across the cursor wrap rollover Message-ID: <20261203091718.486262-1-hexlabsecurity@proton.me> In-Reply-To: <9de0921d-d01c-4cae-8ec2-7d86a3c3f438@linux.ibm.com> References: <20261128-b4-disp-360e65c5-v2-0-d9c05004d430@proton.me> <20261128-b4-disp-360e65c5-v2-5-d9c05004d430@proton.me> <9de0921d-d01c-4cae-8ec2-7d86a3c3f438@linux.ibm.com> Feedback-ID: 199661219:user:proton X-Pm-Message-ID: 9a1a2518fa10eabebed0442b1edfe0c9a1a17465 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/12/26 1:48 pm, Sidraya Jayagond wrote: > With a 16 KiB RMB, urg =3D {0, 0} and cons =3D {1, 16383}, this returns 1 > although the reader is 32767 bytes past the mark. It also ignores > urg_state, so a connection that never got urgent data (urg_curs is > zeroed) or has a stale mark can report at-mark. [...] > Could you fold this into v3? Folded into 5/7 as you wrote it: https://lore.kernel.org/all/20261203-b4-disp-ba1ad55e-v3-5-6834ff90c5d0@pro= ton.me/ I ran your case, no urgent data and 32767 bytes read: net and v2 return 1, v3 returns 0. A valid mark 32767 bytes behind the reader gives the same. Both halves of the check are needed. Without the state check, the 1 is back once the reader is on wrap 65535, and with smc_curs_diff() kept, it is back for the mark behind the reader. The urg_rx_skip_pend operand changes the result in one case I could find: recv(MSG_OOB) with data in front of the urgent byte, then SO_OOBINLINE switched on, then a read up to the byte. The state is SMC_URG_READ, the skip is pending and the reader is one byte before the mark. v3 returns 1 there, as net and TCP do; without that operand it returns 0. One answer changes, and I want you to see it. After recv(MSG_OOB) of an urgent byte with nothing in front of it, SIOCATMARK now returns 0. net returns 1 there, and so does TCP. Without 7/7 the state is SMC_URG_READ and no skip is pending, so the check is false. With 7/7 the reader has skipped the byte and the distance is 0. If a reader calls recv(MSG_OOB) first and then reads until SIOCATMARK returns 1, it keeps reading. On net that reader stops, and the sender's next send() stalls, which is the case 7/7 fixes. SMC already returns 0 after a read that reaches the mark: it skips the urgent byte at that read, TCP at the next one. Returning 1 after recv(MSG_OOB) needs one more state. After that call the state is SMC_URG_READ and the reader is at the mark, and a new connection, SMC_URG_READ with both cursors zero, looks the same. I left that out of v3; it is under "Not fixed here". Is 0 fine with you there, or do you want it handled in this series? > Cc: stable@vger.kernel.org # depends on 2/6 and 4/6 Added, as 2/7 and 4/7. Thanks, Bryam pw-bot: cr