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 F37587489 for ; Fri, 8 Nov 2024 06:08:37 +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=1731046118; cv=none; b=ABqs2x4GBX/n4NqkDkuS9ed2XHobnjt0VG+COz6JFwQ/7DIooI1F1s7+Nk+YERfsl5bXfzp43bQ/y1VEZlr0Err/Xa2huM/M54F11XxdhootcpIIfy5/zO5qBxFumCJ/uWiq5cdML4QHukvPxCifU39aEAqRucgfTxkg+Z57Adw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731046118; c=relaxed/simple; bh=yT99+UROme7mNUItQt8+CO6NBzeE+Khfe/9A1hWZLKQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=o2rbdUZTeYE+fyqOvAZDtTQKuk0HFytgXyl7DokBfhLqzjji9262DVsa7PW5lBNzyWToI/Xb66ytJ33LM34HVkLz9sT1xe3VNpfHm6nPmmR70aYfhR/9DJtARxAA5VXTrROU+G3j+ZV9YEmIOqwuacGmUX6Hdl7kn1US4/Tu0vs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IS/5Plch; 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="IS/5Plch" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60BEDC4CECE; Fri, 8 Nov 2024 06:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1731046117; bh=yT99+UROme7mNUItQt8+CO6NBzeE+Khfe/9A1hWZLKQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=IS/5Plch6uaU+WO5ZO34//P22jcTv06E3xhqarpwwEkpjxC7x01oKKGyhkcXUkqjN ercf73o159hjPSwjsZUg4eIbGw4Eja57GFKetOL2wxvSXxZiZxTvSLfBUKhM5pFjiT yTyIqX308vbhqwPM5rmLSpTNVkeNbDOpPzFh3rxk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50210: posix-clock: posix-clock: Fix unbalanced locking in pc_clock_settime() Date: Fri, 8 Nov 2024 07:08:11 +0100 Message-ID: <2024110807-CVE-2024-50210-413b@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=2783; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=yT99+UROme7mNUItQt8+CO6NBzeE+Khfe/9A1hWZLKQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDOm6q44XWP6oC9RRdz+03X5qvXrKvrNtM+wWcAXzHT2Uf lnrdWFzRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEyko4NhwepmFvY133w7r0qH inx6JZdvem//Aob5EbN/iN9Mdj+44Y3z12vnXghpnrr6GwA= 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: posix-clock: posix-clock: Fix unbalanced locking in pc_clock_settime() If get_clock_desc() succeeds, it calls fget() for the clockid's fd, and get the clk->rwsem read lock, so the error path should release the lock to make the lock balance and fput the clockid's fd to make the refcount balance and release the fd related resource. However the below commit left the error path locked behind resulting in unbalanced locking. Check timespec64_valid_strict() before get_clock_desc() to fix it, because the "ts" is not changed after that. [pabeni@redhat.com: fixed commit message typo] The Linux kernel CVE team has assigned CVE-2024-50210 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15.169 with commit c8789fbe2bbf and fixed in 5.15.170 with commit e56e0ec1b79f Issue introduced in 6.1.114 with commit 27abbde44b6e and fixed in 6.1.115 with commit 5f063bbf1ee6 Issue introduced in 6.6.58 with commit a3f169e39821 and fixed in 6.6.59 with commit 1ba33b327c3f Issue introduced in 6.11.5 with commit 1ff7247101af and fixed in 6.11.6 with commit b27330128eca Issue introduced in 6.12-rc4 with commit d8794ac20a29 and fixed in 6.12-rc5 with commit 6e62807c7fbb Issue introduced in 5.10.228 with commit 673a1c5a2998 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-50210 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/time/posix-clock.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/e56e0ec1b79f5a6272c6e78b36e9d593aa0449af https://git.kernel.org/stable/c/5f063bbf1ee6b01611c016b54e050a41506eb794 https://git.kernel.org/stable/c/1ba33b327c3f88a7baee598979d73ab5b44d41cc https://git.kernel.org/stable/c/b27330128eca25179637c1816d5a72d6cc408c66 https://git.kernel.org/stable/c/6e62807c7fbb3c758d233018caf94dfea9c65dbd