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 280C91E1A2F for ; Thu, 7 Nov 2024 09:36:17 +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=1730972177; cv=none; b=WHpKtYS4qWMt1MKh3LZLSY4Zh6eKgwQ7/fOahCYsffI5R4pptHwOXuDsFUxGBOinz3fkNh4u/yfzgC0YXYa9b3ElsRwnemxc21ugWv09r+U0tNw+tao9k7MDS/W+OgslhBxU/d9W4s0v8cWwzxeT81KXD6m/4qnBJKXsFAfSIiA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730972177; c=relaxed/simple; bh=mKfVBsSAgG/B2nJOg8zCNmxYcpLLEQ+GeQq0OUrrbRk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=V2U1WjoGGpImflViYbObF0gYKoTO/SfiR7XqdidCNHg46dKiR7KLyAvfmBDjOlujLWnPY3gESnLoy3SE0pkcB/DU0uySOKOky5QMtV1cBif3CZmNxbFdo87C5YoWixPLLLxD2WYpXToJIhOnU1TMGrCV+519fT2qXn3RC5VgOZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f7ZAfQrc; 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="f7ZAfQrc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62C35C4CECC; Thu, 7 Nov 2024 09:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730972177; bh=mKfVBsSAgG/B2nJOg8zCNmxYcpLLEQ+GeQq0OUrrbRk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=f7ZAfQrcjLOEEJB+AOkx3enVt+dlQ9TQPmwLyU8HvHk7msj24t4h7NaOeQaG2rSBx GWETz/XEwSSTPzSu06G94GOGd+imlezSfaBsq9yi3Pf0YMal4sKEGxpPFxbvA4vwuy JLOUFNw51ZMczIvrOfQO/jfujY5h8cwvh+UGIiCo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50165: bpf: Preserve param->string when parsing mount options Date: Thu, 7 Nov 2024 10:35:05 +0100 Message-ID: <2024110748-CVE-2024-50165-5e80@gregkh> X-Mailer: git-send-email 2.47.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=2489; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=mKfVBsSAgG/B2nJOg8zCNmxYcpLLEQ+GeQq0OUrrbRk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOk6nTvmiYVdXWhwOyHsW+XUkyHvWEUVlD5uffhrUddRH VFN2z08HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR3IsM8x2Xhh5vjO62q/QO m1q0bFFT/8WqHQwLGtaYp9VNtdGwilt0QUdAoeGs11odAA== 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: bpf: Preserve param->string when parsing mount options In bpf_parse_param(), keep the value of param->string intact so it can be freed later. Otherwise, the kmalloc area pointed to by param->string will be leaked as shown below: unreferenced object 0xffff888118c46d20 (size 8): comm "new_name", pid 12109, jiffies 4295580214 hex dump (first 8 bytes): 61 6e 79 00 38 c9 5c 7e any.8.\~ backtrace (crc e1b7f876): [<00000000c6848ac7>] kmemleak_alloc+0x4b/0x80 [<00000000de9f7d00>] __kmalloc_node_track_caller_noprof+0x36e/0x4a0 [<000000003e29b886>] memdup_user+0x32/0xa0 [<0000000007248326>] strndup_user+0x46/0x60 [<0000000035b3dd29>] __x64_sys_fsconfig+0x368/0x3d0 [<0000000018657927>] x64_sys_call+0xff/0x9f0 [<00000000c0cabc95>] do_syscall_64+0x3b/0xc0 [<000000002f331597>] entry_SYSCALL_64_after_hwframe+0x4b/0x53 The Linux kernel CVE team has assigned CVE-2024-50165 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit 6c1752e0b6ca and fixed in 6.11.6 with commit 5d7a0a426540 Issue introduced in 6.9 with commit 6c1752e0b6ca and fixed in 6.12-rc5 with commit 1f97c03f43fa 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-2024-50165 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: kernel/bpf/inode.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/5d7a0a426540319327309035509cb768a2f5c2c4 https://git.kernel.org/stable/c/1f97c03f43fadc407de5b5cb01c07755053e1c22