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 0C3A712BF3D for ; Wed, 1 May 2024 13:06:39 +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=1714568800; cv=none; b=uVm1B3MgEcs8BoXhJKMR4d6juqkx+fOhkwPuWLQmdfJNi06pJoD3SxZDScLnPW8XwqYz5hNw/WdRr5yM0uGzbaENOdGN3Do1lMD9+2SEf/+mIxi9LKmphQjPg3SLBjYYo9C4MnOprXkqrUnitB8WDlV/H2gYx2fQDZuGTWx+OJo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714568800; c=relaxed/simple; bh=ly/nx8SI53ZvmCxxlGz47gsUD6QMO2AslL1PLEayOjM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aKYk8iwUJsa3tcps+xVfcDBr3DPMVYyXUHfVqSXL98rZ2wp7T1HhhhHNs8k666epN7ZnpvV6f+4ZlnxnURWDTBC2n/z7pvA9xaQDG/txvEivG2ZWNB+dbziiAGLGJu2kE3qUvdIY0xcKQLBc41mkY+xEY81v9Y6OMmzfraxorB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nWnzR5aT; 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="nWnzR5aT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C254C113CC; Wed, 1 May 2024 13:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714568799; bh=ly/nx8SI53ZvmCxxlGz47gsUD6QMO2AslL1PLEayOjM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=nWnzR5aTRWG/Y8OtRBSOI9aox/K+VNKFABu47tyjNOApktYHxKX/voI2RqEBTLYzE 6f03mlU9Qj9wjMJtNy2qgzEG499a0oxfSQIUeNwXaNJDpecsQ/0nJl0swrrZLVXtcV vxE/AsYiHyD/eRe00evdCX/IU0IqFzRV9IM1ACrA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52652: NTB: fix possible name leak in ntb_register_device() Date: Wed, 1 May 2024 15:06:33 +0200 Message-ID: <2024050131-CVE-2023-52652-9e84@gregkh> X-Mailer: git-send-email 2.44.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=2877; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ly/nx8SI53ZvmCxxlGz47gsUD6QMO2AslL1PLEayOjM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlGduG61zPWnfR709OWmBLoGPA4pvrcs9hmVXZ7Wc35G pqL5p3qiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgImYVTPM4fW/7Lph2eN7nm1x tT+qLRMcDBK2MMxmc9+ybOu1HRxTlG6ZTrnvvDbo074pAA== 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: NTB: fix possible name leak in ntb_register_device() If device_register() fails in ntb_register_device(), the device name allocated by dev_set_name() should be freed. As per the comment in device_register(), callers should use put_device() to give up the reference in the error path. So fix this by calling put_device() in the error path so that the name can be freed in kobject_cleanup(). As a result of this, put_device() in the error path of ntb_register_device() is removed and the actual error is returned. [mani: reworded commit message] The Linux kernel CVE team has assigned CVE-2023-52652 to this issue. Affected and fixed versions =========================== Issue introduced in 4.2 with commit a1bd3baeb2f1 and fixed in 5.15.153 with commit a62b9f3d7bbf Issue introduced in 4.2 with commit a1bd3baeb2f1 and fixed in 6.1.83 with commit 6632a54ac805 Issue introduced in 4.2 with commit a1bd3baeb2f1 and fixed in 6.6.23 with commit a039690d3232 Issue introduced in 4.2 with commit a1bd3baeb2f1 and fixed in 6.7.11 with commit e8025439ef8e Issue introduced in 4.2 with commit a1bd3baeb2f1 and fixed in 6.8.2 with commit 913421f9f7fd Issue introduced in 4.2 with commit a1bd3baeb2f1 and fixed in 6.9-rc1 with commit aebfdfe39b93 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-2023-52652 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: drivers/ntb/core.c drivers/pci/endpoint/functions/pci-epf-vntb.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/a62b9f3d7bbfac874cc0c638bc1776dcf1f8ec06 https://git.kernel.org/stable/c/6632a54ac8057cc0b0d789c6f73883e871bcd25c https://git.kernel.org/stable/c/a039690d323221eb5865f1f31db3ec264e7a14b6 https://git.kernel.org/stable/c/e8025439ef8e16029dc313d78a351ef192469b7b https://git.kernel.org/stable/c/913421f9f7fd8324dcc41753d0f28b52e177ef04 https://git.kernel.org/stable/c/aebfdfe39b9327a3077d0df8db3beb3160c9bdd0