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 19396264A62 for ; Tue, 8 Apr 2025 08:18:43 +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=1744100324; cv=none; b=gGMe+Ur6UpjWprZ2geAw82ONaU76g6O0aAqxInBf95G1d5CSCT8vOSpcW7xKIXPN5Jt+0/Q9LhtOmHh7P2eMjEywm6ileZLtMxv3YCaxg0Fb/oIdHWKMp389czJ8hk52ridhsIXmP5ewCFFYoS1zzU5+8/0nJGHHHZSVEx9h6uc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744100324; c=relaxed/simple; bh=JyYEFEDd/hYkjII7ArfZTjHiz77JeLmbYGZqWh9tw6A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sQJkV4UBPelY3v7CbyY8m3KaFVMfGonC4eO9uqoKzxcI5qqOJzY64HvQXHxutI1+1IzKV1wQEpQzWPx1nnAgWz/JblUpJp3aajqLPbAyCM1wapEuqxS19ClfHA847TkCJKAhmAcM5QVO7Aoz41zggbfqCFKUuVqF2ejp2BWj/EQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2WHWrDcp; 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="2WHWrDcp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EC07C4CEE9; Tue, 8 Apr 2025 08:18:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744100323; bh=JyYEFEDd/hYkjII7ArfZTjHiz77JeLmbYGZqWh9tw6A=; h=From:To:Cc:Subject:Date:Reply-to:From; b=2WHWrDcpo7Fm/vMYeb6/cCKFhrPvw0DgwU/hv4HzTjqSgC5BN35uCpmd3PDyIgEse TZIdHR/AyXaVVqmvSxwXWpJPVuvD+pVRsgbDIoeQ7XCLSl0IXonUk0YdbEANPpLEqk zL6o92dVZsamdc5uEmTS7wOyEg6+iK83sarPE46g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-22017: devlink: fix xa_alloc_cyclic() error handling Date: Tue, 8 Apr 2025 10:16:51 +0200 Message-ID: <2025040844-CVE-2025-22017-a66e@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=2277; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JyYEFEDd/hYkjII7ArfZTjHiz77JeLmbYGZqWh9tw6A=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlfbufcXq36+v6VmiUaOl7nDv0omRO63uTk49L4et6ra 18Hftqg2BHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATsTvHMD9ZaN7Bw+YbDQ5e 7ZY8+ITryV2VmMsMC9aeMAhhfcTZuLN486dbPp+PRh00awMA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: devlink: fix xa_alloc_cyclic() error handling In case of returning 1 from xa_alloc_cyclic() (wrapping) ERR_PTR(1) will be returned, which will cause IS_ERR() to be false. Which can lead to dereference not allocated pointer (rel). Fix it by checking if err is lower than zero. This wasn't found in real usecase, only noticed. Credit to Pierre. The Linux kernel CVE team has assigned CVE-2025-22017 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit c137743bce02b18c1537d4681aa515f7b80bf0a8 and fixed in 6.12.21 with commit f8aaa38cfaf6f20afa4db36b6529032fb69165dc Issue introduced in 6.7 with commit c137743bce02b18c1537d4681aa515f7b80bf0a8 and fixed in 6.13.9 with commit 466132f6d28a7e47a82501fe1c46b8f90487412e Issue introduced in 6.7 with commit c137743bce02b18c1537d4681aa515f7b80bf0a8 and fixed in 6.14 with commit f3b97b7d4bf316c3991e5634c9f4847c2df35478 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-2025-22017 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: net/devlink/core.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/f8aaa38cfaf6f20afa4db36b6529032fb69165dc https://git.kernel.org/stable/c/466132f6d28a7e47a82501fe1c46b8f90487412e https://git.kernel.org/stable/c/f3b97b7d4bf316c3991e5634c9f4847c2df35478