Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22AC8E567 for ; Thu, 1 May 2025 14:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108813; cv=none; b=f7i1UUd4p6VbMDvm2JYOZj4U28dWmSMQiIhgRdrHGarUbAxIVfEebpB2i9hsrMnLkzXqx30pyAgMZqk8GJ77skNPFb7r9rsqTaSbPVYLBBN+GAY08Uyj7ITk205TcwyiUisCIlSilFWtFDFqIJ+kD96afG9JqzJ4xEV6KR77izU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108813; c=relaxed/simple; bh=g3tRDMondANPwZh2BFbHxSiw85By6FcIoTz0/QaNTzQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kb8PkFJCgmnFXBT8VEjOz0LU8oShBk9EDnUy090H9bcVBp6HY3LDA3a1Ngh9ZDs+As7Ra9JEkHpFtvOnONft/72O4TcgDSlyygbHseA3tKcoobwz+5jkkiCdy19MXQ2iBF4sdtTmCVg9E02WadyW3QIq6wfMZh0I/EWB9ebzXbk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1INwG+qO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1INwG+qO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97873C4CEE3; Thu, 1 May 2025 14:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746108813; bh=g3tRDMondANPwZh2BFbHxSiw85By6FcIoTz0/QaNTzQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=1INwG+qOPRU/R3vWsl2gpD1qMh9UVSwhaMWQJjar6/TSnWJYno/4eL+hmGkYkDyye +Cd8Rj2AAdrKAemVYES3DNPo/1VnOMqUowG+cQzhF3Ob2IdqTE6Idv1QjiUQUzfpWF Wtc6LsAsqicraWkjqycxw9XVbeZ1jZLF8li7SUXU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49820: mctp i2c: don't count unused / invalid keys for flow release Date: Thu, 1 May 2025 16:10:10 +0200 Message-ID: <2025050133-CVE-2022-49820-6723@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2468; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=/77MmqQTmg1IoWEIML0ES+1rRY7TLqneLUmsVuq23Io=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDXMLf97WlCmzjPt79ceDZQvuL/IRElzysC9UtWLtX NY1+aZeHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARywKG+fkGqvtOiZzx+DzN bf4cDvZF3fo/sxjmO7Wt2l3pMbkgc7OteD+ruvBbphOyAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: mctp i2c: don't count unused / invalid keys for flow release We're currently hitting the WARN_ON in mctp_i2c_flow_release: if (midev->release_count > midev->i2c_lock_count) { WARN_ONCE(1, "release count overflow"); This may be hit if we expire a flow before sending the first packet it contains - as we will not be pairing the increment of release_count (performed on flow release) with the i2c lock operation (only performed on actual TX). To fix this, only release a flow if we've encountered it previously (ie, dev_flow_state does not indicate NEW), as we will mark the flow as ACTIVE at the same time as accounting for the i2c lock operation. We also need to add an INVALID flow state, to indicate when we've done the release. The Linux kernel CVE team has assigned CVE-2022-49820 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit f5b8abf9fc3dacd7529d363e26fe8230935d65f8 and fixed in 6.0.10 with commit a5915a9a3ab4067ef8996a57738d156eabeb3a12 Issue introduced in 5.18 with commit f5b8abf9fc3dacd7529d363e26fe8230935d65f8 and fixed in 6.1 with commit 9cbd48d5fa14e4c65f8580de16686077f7cea02b Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-49820 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/mctp/mctp-i2c.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/a5915a9a3ab4067ef8996a57738d156eabeb3a12 https://git.kernel.org/stable/c/9cbd48d5fa14e4c65f8580de16686077f7cea02b