From nobody Tue Jan 14 11:06:12 2025 X-Original-To: net@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 4YXRBr5d9Xz5kX64 for ; Tue, 14 Jan 2025 11:06:12 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXRBr4xzTz3Lwn for ; Tue, 14 Jan 2025 11:06:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736852772; 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=ePekVm6bXU+qSoHqs3ZpowCHZKuoTLR22n+8fFyTNDw=; b=c7IjaaoQMu5SSMOJ5FoAgWm+qYoZexTYr2cPjewL7jl+pq6lHNrw8scKc8mh/1WgmlkfS+ zEoslUzx+GeyQ8stAyaqO5yDl33x6soI5Jmqqlu6Qz2CsjDuQ8fKSpYLO7r2y5D7tTit9Y BkxsgtmPlHcayjcgLnOvBpHHFmb4JNeW1BZ/TNfp7paOXcJGwSHJ5I4RGJ5lPmtAtKHJaM FLcaoYpPJRtD+Fg3KDLI6RPsE8GgsGedKKU1JVwt0CqnyG9j3lIY3aFKhLfR0VGL0hVRvT xCDf3rvAzyOSyBDcpkuXtpPd0+BzGWo5uUfZ7SRgN57IYwOFGbNVJ272AkN6MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736852772; 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=ePekVm6bXU+qSoHqs3ZpowCHZKuoTLR22n+8fFyTNDw=; b=KmNXMr6PIUJK8ZNEKn+6K7NXogmRR49TdH+BTa4d489REUj83qdRy19bYrvQ3RsypTbQSr uXRliWAE89MpO7l3uOjmFUAuhoFsfgRT/wYCc1u+94LT9rnGdbP54HTNnMas+pRScYwrRV QvPWW4d96x2jVmKtbkD/D1TvjpgmiQwwGYXkds5VfDfqbxo0/UdBGgRXiFtGtArVnk5GbM 50CSRG9SV9Q6ANHrWOn/we8hRCKWJdj6d/VLd6Fjc2XmAyn9TNiaUKdP/LWarO7jsIz/Q/ dTusKpjc7xcHqSFlERSwvAWdhBCNA+OXODn81wTzQn5r2NXvD51xQAqQVa92yA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736852772; a=rsa-sha256; cv=none; b=ZnjAP65jeNEmp7xi7WKLPpiq6TcvyYEdXwNrbAZab+dTlIymdR2sfguV/QLpvSO81abLTq dKZcUlFGUE63kR6YT7ftwALrlPWIh9SPyQCvEF6eG2T0/VbMZyk0eMHpqOT73h8AkTkCCp +dujrC9p74Lbia0pozkrdwZFN+MoW/NkoURZwVyvSg6asZt7SWiuolnFHjPHa+wE0AdvTP XuJwjguDpPyBJwcmSCAWUMFQ0OgUJJ/Q9YbEZdj3vSkIdpI6qYUbyanJnpvf3cqA7HJ5Fq CO0EMJC9VoXfJRzjx4zrexUWIS7cfj7pEUWnamaSpmyFWQ84tpSanWesD2ul3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YXRBr44Y4z1CWl for ; Tue, 14 Jan 2025 11:06:12 +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 50EB6CuI077208 for ; Tue, 14 Jan 2025 11:06:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 50EB6C48077207 for net@FreeBSD.org; Tue, 14 Jan 2025 11:06:12 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: net@FreeBSD.org Subject: [Bug 284057] vmxnet3/iflib: crash in vmxnet3_isc_txd_credits_update Date: Tue, 14 Jan 2025 11:06:12 +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.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: avg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D284057 --- Comment #7 from Andriy Gapon --- (In reply to Kristof Provost from comment #6) My thinking on purely defensive code is that maybe we can stash vxcr_next i= nto a local variable, check and increment it (with the wraparound) and then upd= ate back vxcr_next, maybe using atomic compare and set. This won't eliminate the race and won't improve correctness of vmxnet3_isc_txd_credits_update result, but it should make the code even saf= er comparing to your proposed patch where the initial array access indexed by vxcr_next may still be out of bounds. In the crash that I reported here, vxcr_next didn't run wild, it got wrapped around. But for a moment it was equal to vxcr_ndesc and that was enough to cause the crash. Which is very rare, admittedly. --=20 You are receiving this mail because: You are the assignee for the bug.=