From nobody Fri Nov 14 16:34:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4d7N6S6n8Rz6Gj01; Fri, 14 Nov 2025 16:35:28 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp052.goneo.de (smtp052.goneo.de [85.220.129.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4d7N6S41gJz3p09; Fri, 14 Nov 2025 16:35:28 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; none Received: from hub2.goneo.de (hub2.goneo.de [85.220.129.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp5.goneo.de (Postfix) with ESMTPS id 7B5BD2400FD; Fri, 14 Nov 2025 17:35:26 +0100 (CET) Received: from hub2.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPS id A6143240195; Fri, 14 Nov 2025 17:35:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1763138124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=y+QKqVfh18GNVd42M6sdK4il7eykG37JTKff3KaZ2fc=; b=oXt9Mk92A/p5bzfJPJeL0r9bE5XJnEpqgYhe0N38/1m1laRy8M4CK8jc23Wcirefvlksna w1rcw81ycwzgsl9x/q3Uz5RWxzddhqjIOwnij9DxIJKqGfnqxja6SmlG5EnYsKhAMCX7sK 5Dtq+weiSYtUHQPa2z9rvCrYOhNDrKya32XsIQUalF36Ausf6RWopNG/3zazllERRLkxkn 7RopS3ywwFEJ57MrNLQ+SnH+IQE7QEmUVYQ5jXcvCVo1UMWuf3TXVKTyYM0Gl8WJe6QwRd pfc3IzT7oE5awgbCZKWeouaZYTGtelMctw3drEydYD6teMOIEL+xy1u41Qx0uw== Received: from thor.sb211.local (dynamic-2a02-3100-22aa-6402-acb1-2f5e-bda3-e792.310.pool.telefonica.de [IPv6:2a02:3100:22aa:6402:acb1:2f5e:bda3:e792]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPSA id 3B8EF24016A; Fri, 14 Nov 2025 17:35:24 +0100 (CET) Date: Fri, 14 Nov 2025 17:34:49 +0100 From: A FreeBSD User To: Renato Botelho Cc: Gleb Smirnoff , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 69f61cee2efb - main - unix/stream: fix a race with MSG_PEEK on SOCK_SEQPACKET with MSG_EOR Message-ID: <20251114173516.7c693cf3@thor.sb211.local> In-Reply-To: References: <202511140240.5AE2eQmY011060__48884.4837805786$1763088041$gmane$org@gitrepo.freebsd.org> X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/NhkqQCfu./ehHXldCEFsfkZ"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Rspamd-UID: f96f00 X-Rspamd-UID: 8ce0a8 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4d7N6S41gJz3p09 --Sig_/NhkqQCfu./ehHXldCEFsfkZ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Tage des Herren Fri, 14 Nov 2025 13:18:34 -0300 Renato Botelho schrieb: > On 13/11/25 23:40, Gleb Smirnoff wrote: > > The branch main has been updated by glebius: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D69f61cee2efb1eec0640ca7d= e9b2d51599569a5d > >=20 > > commit 69f61cee2efb1eec0640ca7de9b2d51599569a5d > > Author: Gleb Smirnoff > > AuthorDate: 2025-11-14 02:39:48 +0000 > > Commit: Gleb Smirnoff > > CommitDate: 2025-11-14 02:39:48 +0000 > >=20 > > unix/stream: fix a race with MSG_PEEK on SOCK_SEQPACKET with MSG_E= OR > > =20 > > The pr_soreceive method first scans the buffer holding the both I/= O sx(9) > > and socket buffer mutex(9) and after figuring out how much needs t= o be > > copied out drops the mutex. Since the other side may only append = to the > > buffer, it is safe to continue the operation holding the sx(9) onl= y. > > However, the code had a bug that it used pointer in the very last = mbuf as > > marker of the place where to stop. This worked both in a case whe= n we > > drain a buffer completely (marker points at NULL) and in a case wh= en we > > wanted to stop at MSG_EOR (marker points at next mbuf after MSG_EO= R). > > However, this pointer is not consistent after we dropped the socke= t buffer > > mutex. > > =20 > > Rewrite the logic to use the data length as bounds for the copyout= cycle. > > =20 > > Provide a test case that reproduces the race. Note that the race = is very > > hard to hit, thus test will pass on unmodified kernel as well. In= a > > virtual machine I needed to add tsleep(9) for 10 nanoseconds into = the > > middle of function to be able to reproduce. > > =20 > > PR: 290658 > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D53632 > > Fixes: d15792780760ef94647af9b377b5f0a80e1826bc = =20 > Hi Gleb! >=20 > It looks like Thunderbird decided to encrypt my previous message, lets=20 > try again :) >=20 > I've updated my laptop this morning and it crashed at boot as you can=20 > see at [1]. I suspect it may be related to this commit. >=20 > [1] https://imgur.com/a/opfN6Ta >=20 Hello, I also have a serious issue with most recent CURRENT as it bails out with a= page fault, but I can reproduce the issue according to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D279653 and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D291003 (I have almost the same bridge setup and all boxes with bridges running CUR= RENT have this "infection" while others not). Just my thoughts. Sorry for the noise. oh --=20 A FreeBSD user --Sig_/NhkqQCfu./ehHXldCEFsfkZ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRQheDybVktG5eW/1Kxzvs8OqokrwUCaRdaRAAKCRCxzvs8Oqok r//UAQDfH3iisMMiUYCnSyXzH6O/GHwjxKUlxQDbBE2jzbkw1gEAx/6OAcBHDxG2 TSRECPIbBvKvHyJ+poJjJpULYyTmBAw= =KorS -----END PGP SIGNATURE----- --Sig_/NhkqQCfu./ehHXldCEFsfkZ--