From nobody Thu Sep 7 14:29:56 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 4RhM8P0Nw9z4sbtD for ; Thu, 7 Sep 2023 14:29:57 +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 4RhM8N4Fb1z4chB for ; Thu, 7 Sep 2023 14:29:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694096996; a=rsa-sha256; cv=none; b=Q+qaLhmzIpY928nT4BZ8vKHOIicBPqZjfuDRZvjm1ERVPyZAnN8SiOD6VtYivQlkhu6Qyq /q+AUmqbEL+RBTHGTJbHrfZBnwKJm1nCbfKFITwV+wG4MAginL3Gm9/2Pjw0mgrOnjr2yp 8rrD/dOAWyl+Hl6tIMhRSJt5np2x4SDEmQDkUCYwLEbqz7XTSOyYNqgawKyBKQOvAxZaF8 T/F5JJqNC7wcBE2iqzZg8y9a09KWboJbxPoiUpAay2nm2/aQ/d2AtadMztzNvM3S12CZmb r8fybh6DvTjAivD7l3hhT+kHXVDJbvhJ1OG0F8WdHPpDBewQ3D0Eo0LPf9NEKw== 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=1694096996; 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; bh=GWDFAzKpp7aUZCIVf7xNgFHj302JV89zhTiYS64oPQs=; b=oSGur4Fb5hD2uunvvbvjv3beWLOkRBfwesHnO7ddDimlypJBk3S6Ytk8/YzdEizVpIwv/P AqbO2FDgzGQxNlgWndeC+tacTMWf/p5I+7aqUqxuS23sPdCqL48xybZtYgfr9P82RymV7w wENiDE9vtjaoBtaionGak+y6uiukIDArmpSQ/VjzjjFU4PidrLpoASWtHASGK/vwsuUtNX poGSB9gOCH5sjt8gc9jbKQs05J+t3nx1nn510SzJJvTTvHzayIDGqij8pCTFefzCqCr1Nr JJJcLEXORrbwCvAM/KCT6vKJbmb0rtDfCfEtGDSkPBglBGckftBxQG/ZQe+wUw== 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 4RhM8N3D63z132w for ; Thu, 7 Sep 2023 14:29:56 +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 387ETupr048063 for ; Thu, 7 Sep 2023 14:29:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 387ETuBq048062 for bugs@FreeBSD.org; Thu, 7 Sep 2023 14:29:56 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 273615] infinite loop in sbflush_internal() Date: Thu, 07 Sep 2023 14:29:56 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some 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: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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=3D273615 Bug ID: 273615 Summary: infinite loop in sbflush_internal() Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: greg@codeconcepts.com Created attachment 244698 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D244698&action= =3Dedit patch to prevent infinite loop in sbflush_internal() If I run iperf3 in a loop over a 100gbe network (via cxgbe) eventually eith= er the client or server gets stuck in sbflush_internal(). This is because sb->sb_ccc is an unsigned int that contains a value greater than INT_MAX.=20 sb->sb_ccc is cast to an int and passed into sbcut_internal(), which then f= ails to consume the data and returns NULL. sbflush_internal() then keeps retryi= ng the operation having made no progress. There is a KASSERT in sbcut_internal() to catch this, but I'm not able to reproduce the problem with INVARIANTS enabled. See commit b5b023b91eee30bacb28684c7aa467bf547f7c0d for additional information about t= his problem. Note that I haven't yet been able to reproduce this on a 10gbe network. I've attached a patch which addresses the immediate problem, but it seems t= hat given the mixed usage of ssize_t, u_int, and int by callers of sbflush() and related interfaces that a larger scoped cleanup is desirable. Note that wh= en the bug arises, sb_ccc is always around 3.1-billion, which makes me wonder = if my patch is merely a bandaid for a symptom of a deeper problem... ??? Here's the iperf3 loop I use to catch the problem: while : ; do sudo iperf3 -c 172.16.10.200 --bidir || break; sleep 1; done --=20 You are receiving this mail because: You are the assignee for the bug.=