From nobody Wed Aug 30 22:34:59 2023 X-Original-To: bugs@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 4RbfHl4Rwgz4rLbC for ; Wed, 30 Aug 2023 22:34:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RbfHl3GvHz4dgV for ; Wed, 30 Aug 2023 22:34:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693434899; a=rsa-sha256; cv=none; b=QVLRGBH5cRRbeSq9Mg9NhN9m1GYVm8KohI3d1097pSLNgnvtQQ1vtrF5tDxmv8y0a7jZda co4hnyAsHInHyFz9uz6XMduzv5tPjmSavnIwCzRwYkM2fEDgAH+vh1LwBaSNFwVoFv/t49 IM89tS1QtwIzS5VgFvAgMOp44Y49iQpE8i1W1VYl9IiQ6edzBIBLfs4iwO1DTdTK4kF3cs lG/DL/uoD6A4pzVqfIYr989Anyt00ULyaCjNSwBi8oIGTy4Lf4jeqea6SSwcQ0fQULa1Ql tVhwHHtAD0RwL57ocxLzQm89yql9hpr4/NGwINe8KCsEdWdkj4PXURKtQh6jug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693434899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iCYy/Wo/Cx0JZ1lc5FVvO7j7uA7y28kksEfV9/kIz8I=; b=UxHImdPDBqPXpcf7z8/xqRZJP4/eBLh/tFT7vMSTrLWwpY40bVJ1c0EdGIlpi8Tn4BB7zc bU+bKl1orGwM32ArnBpkpfYs9+s2jQdJXSthkdMBoxzCpKFiDCx4OFWzeJl10wWT3z23Y+ NjxYZPfxqmtox8WOBkilSlYO1TjhxEs5NRvQlg4rFyouMqHQV+4LpcdYzkNRLoiEkU5qYT 1CajRcUplLXiBSyfi+rp6K14Oi+ZXAubS6KT5CzLfhA49WDcVnmD6IDdB+ZZeFr0ZlpiBH GwE6ldkqkNK6PleYTNHURLdFBKDUjvvwdz5TPk8bMA7cnJgAHZP7clbYO/z9Cg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RbfHl2D90zrwN for ; Wed, 30 Aug 2023 22:34:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 37UMYxk3025296 for ; Wed, 30 Aug 2023 22:34:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 37UMYxPj025295 for bugs@FreeBSD.org; Wed, 30 Aug 2023 22:34:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 212716] recv() with MSG_WAITALL doesn't always unblock on EOF Date: Wed, 30 Aug 2023 22:34:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: greg@codeconcepts.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212716 --- Comment #6 from Greg Becker --- I am also able to repro with 15.0-CURRENT. The problem seems to be that we are not rechecking the socket receive buffer for errors or to see if the peer closed after calling pr_rcvd() (around line 2430 in file uipc_socket.c), having dropped the socket receive buffer lock before the call and then reacquiring it after the call. Which is to say, t= he socket state can change once the receive buffer lock is dropped, and hence previous assertions made while the lock was held cannot be relied upon... I've attached an initial patch, but I need to spend more time reviewing the code, as it's not clear to me yet whether we should be exiting the MSG_WAIT= ALL loop at line 2522 if the receive buffer contains valid data. Perhaps someo= ne more familiar with this code and chime in... --=20 You are receiving this mail because: You are the assignee for the bug.=