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 3B6D228A72F for ; Wed, 18 Jun 2025 11:10:19 +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=1750245019; cv=none; b=DJ3ielB3x9e42/wqLUsW/vb+qpHUOeEE6pm3Wb2Bp976HsqYVH7s45nepoQkilusY3QXcufMBdRAjOrWH3123h6dKVO4Vav5IRNOSXdcYQGAz49fSOu526uTFVRRmMuj0NBmv2Hz0DjtyGYhs20KoDVJyPyi2XCx6YjhiFqrk3Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245019; c=relaxed/simple; bh=aJBdp3HT76RqqJW09UC09+xlh7N/lQuptfTyoQo4gDo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Q8iCrobqD3kp2U1Vr65Gukuik6wrMqno4Pa4f71x/5Xcujofxv9oJE9V4Igb6MxzQ9TX7vVS//DErDraVdlm2qxiE+TTfYJObpV6SLm1uzeMmqCo37ZVVmL3x8esk7Wl6LSa26Wylp4o8NQaU9kor/pDgaVUprBwj/fKbDOnUSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=isFhIl7Q; 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="isFhIl7Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C601C4CEE7; Wed, 18 Jun 2025 11:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245019; bh=aJBdp3HT76RqqJW09UC09+xlh7N/lQuptfTyoQo4gDo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=isFhIl7QOrrjhhll5mhePv9irkCVDmFWntKvtJ4NbUFA14+9U72o3fjqi3zWAntGP GNNkWlqQ6R6RA5Dt+4FXq/gwfDQRyyqwtaEcXZultwXv+N0OyPoNe3D8u2C1DEPEpH 3eMHPzPmecoFpcWYqAJXQSw6DSjYP2oR3LyIOIt0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50074: apparmor: Fix memleak in aa_simple_write_to_buffer() Date: Wed, 18 Jun 2025 13:02:19 +0200 Message-ID: <2025061854-CVE-2022-50074-c768@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=2911; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2T38rnuJ8H52DkKdugGyozaa+d3DFUGESK31meW5EAA=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc9ImB+3Yx3ViywnlP8dXKq6/tzfmIM/Tg4Uux7yFJ B9tPNKZ2xHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATkapiWND7OuyZ1IWPDeUu EguYml6p/Gg3EmWYZ9zZETS5fEO6QmUac/dalU4JbQkfAA== 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: apparmor: Fix memleak in aa_simple_write_to_buffer() When copy_from_user failed, the memory is freed by kvfree. however the management struct and data blob are allocated independently, so only kvfree(data) cause a memleak issue here. Use aa_put_loaddata(data) to fix this issue. The Linux kernel CVE team has assigned CVE-2022-50074 to this issue. Affected and fixed versions =========================== Issue introduced in 4.17 with commit a6a52579e52b55448326db88bd9a5740e7c1a037 and fixed in 4.19.256 with commit 6500eb3a48ac221051b1791818a1ac74744ef617 Issue introduced in 4.17 with commit a6a52579e52b55448326db88bd9a5740e7c1a037 and fixed in 5.4.211 with commit 7db182a2ebeefded86fea542fcc5d6a68bb77f58 Issue introduced in 4.17 with commit a6a52579e52b55448326db88bd9a5740e7c1a037 and fixed in 5.10.138 with commit 8aab4295582eb397a125d2788b829fa62b88dbf7 Issue introduced in 4.17 with commit a6a52579e52b55448326db88bd9a5740e7c1a037 and fixed in 5.15.63 with commit bf7ebebce2c25071c719fd8a2f1307e0c243c2d7 Issue introduced in 4.17 with commit a6a52579e52b55448326db88bd9a5740e7c1a037 and fixed in 5.19.4 with commit 6583edbf459de2e06b9759f264c0ae27e452b97a Issue introduced in 4.17 with commit a6a52579e52b55448326db88bd9a5740e7c1a037 and fixed in 6.0 with commit 417ea9fe972d2654a268ad66e89c8fcae67017c3 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-50074 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: security/apparmor/apparmorfs.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/6500eb3a48ac221051b1791818a1ac74744ef617 https://git.kernel.org/stable/c/7db182a2ebeefded86fea542fcc5d6a68bb77f58 https://git.kernel.org/stable/c/8aab4295582eb397a125d2788b829fa62b88dbf7 https://git.kernel.org/stable/c/bf7ebebce2c25071c719fd8a2f1307e0c243c2d7 https://git.kernel.org/stable/c/6583edbf459de2e06b9759f264c0ae27e452b97a https://git.kernel.org/stable/c/417ea9fe972d2654a268ad66e89c8fcae67017c3