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 3959A293C62 for ; Wed, 18 Jun 2025 11:14:52 +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=1750245292; cv=none; b=Nk9jlYE8nE/H78MzlQKP3nWbIpfQaiPxPHKcX5x/yTVVSKJqpHFYjFofGRs94R4rpfinwJiORVNCIcj8MerHxBKKnwM7OfLNNTdfLZAtDCm1iSutAsd7PsHAyKkA3WdotqlfOhg4bNalWc3jBbLzidi/nPRaPf7xZsznmQDGIvY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245292; c=relaxed/simple; bh=rrJCdNZUrMPcJ/pltGAXtqfwlzHXC0WS+vIEXRKSFJQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FK2tFyXL+cpWKjHz6F9NfrSDFNNgCKoPQl4kfC0bTCF6snacwcfZoxYkWXbjJWlKrU/AAbZ5VN+g3EMH0oevaqInOsFowAebISHhMclHTeLw0owU4jBtfNFVQfbJRJkX/e2FMk19ElMhooIL/yDSPeqN8dbb6vJTUkP++UYjt/E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Nz/zLCTe; 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="Nz/zLCTe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D413C4CEE7; Wed, 18 Jun 2025 11:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245292; bh=rrJCdNZUrMPcJ/pltGAXtqfwlzHXC0WS+vIEXRKSFJQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Nz/zLCTe93R3Tj2nf10t9bGNgERBAisETcaaDSvhjBp5cYyAJXSwAl+cwwBEhtJaP 9znQP6dWdh4EForfYe4t1bwaUkVB9qEw0G0sTJSapjLHbeASmV/t+6Wbi2uEWYZexP MFQOkD7n51WXUp0uWhd1P0DcGoNGV5rLuEXxvX58= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50170: kunit: executor: Fix a memory leak on failure in kunit_filter_tests Date: Wed, 18 Jun 2025 13:03:55 +0200 Message-ID: <2025061829-CVE-2022-50170-6904@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=2771; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ibgSL1rwctWkD5I9kq8YEr6v+Fsl/bbpBu5Jcuy+iTU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBczqD5SUCzu+7d/Ldm/CdKtez7ncssSqoTtuf5TwjS eHjIZ//HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARvhaG+Y4HWmyM9CZrHP3/ KVWu5Fi5+fs15QwLrjsu3apUV1J2boONTJHmhoMFVd2RAA== 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: kunit: executor: Fix a memory leak on failure in kunit_filter_tests It's possible that memory allocation for 'filtered' will fail, but for the copy of the suite to succeed. In this case, the copy could be leaked. Properly free 'copy' in the error case for the allocation of 'filtered' failing. Note that there may also have been a similar issue in kunit_filter_subsuites, before it was removed in "kunit: flatten kunit_suite*** to kunit_suite** in .kunit_test_suites". This was reported by clang-analyzer via the kernel test robot, here: https://lore.kernel.org/all/c8073b8e-7b9e-0830-4177-87c12f16349c@intel.com/ And by smatch via Dan Carpenter and the kernel test robot: https://lore.kernel.org/all/202207101328.ASjx88yj-lkp@intel.com/ The Linux kernel CVE team has assigned CVE-2022-50170 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18.3 with commit bd8b222a0002872bb229f6c755672a093ef93ea4 and fixed in 5.18.18 with commit a8a7e3ced362b88b659ab54239990196ff975982 Issue introduced in 5.19 with commit a02353f491622e49c7ddedc6a6dc4f1d6ed2150a and fixed in 5.19.2 with commit 7d69764fa3442c7615a75c6b5c02eaa1f274bccf Issue introduced in 5.19 with commit a02353f491622e49c7ddedc6a6dc4f1d6ed2150a and fixed in 6.0 with commit 94681e289bf5d10c9db9db143d1a22d8717205c5 Issue introduced in 5.17.14 with commit 80cf4932c2545bc231e933d869511008c36af1e0 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-50170 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: lib/kunit/executor.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/a8a7e3ced362b88b659ab54239990196ff975982 https://git.kernel.org/stable/c/7d69764fa3442c7615a75c6b5c02eaa1f274bccf https://git.kernel.org/stable/c/94681e289bf5d10c9db9db143d1a22d8717205c5