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 45FD01FCF72 for ; Mon, 21 Oct 2024 18:08:58 +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=1729534138; cv=none; b=QDLxj9djmF2eEx3o2qkiYD8Lkdu+7P8yi6Kszpy6tBZoYfQjYcLRUyJcl5aKS9I3yjiOWhCZE179uIaqr5TyjsKpopWQ1iiSmlrUlWNQACtYkWRb9qRT6KK57M+XB+gNdHecFBwqQSfG4B+9A+lcNiWvkQGZXTVw4SG06P3hCBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729534138; c=relaxed/simple; bh=rhuNdmZE+i7QO52M62IiyvakesmrPoMeUfnPWFGtVaE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e7CIOlDOch/rh4ZoiNeTzksDlpZ6IJNp0uwsbWj3TW305f09xiqjPjZMRg/4tzmq+p+hOsQWbhxiSES+NRM8yJj1v00oIzWwWkm6nowHmzXCSWeTR8FomIAz7n/u6WbDw8WcDL+UC+gh9KS48HE4Q9mEe/lWcNV+WxCCCU2dPFE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1AD4BXBT; 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="1AD4BXBT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBBB7C4CEC3; Mon, 21 Oct 2024 18:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729534138; bh=rhuNdmZE+i7QO52M62IiyvakesmrPoMeUfnPWFGtVaE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=1AD4BXBTL8rk0FQwrZk6AOVE9dJcheEORDB/Dblyx8G9SUgEf6jHsS6DVMXCoUquF 6FWSBK060xFeRxSmJJjVweIgZrOJfAKxT4es5GBb6mxy4uGX6R4mQ/dLqrmhPHqWDe 1ZhM8ocn4h984LoKg+A4K63TScOOHVr7jUn/jzcI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49996: cifs: Fix buffer overflow when parsing NFS reparse points Date: Mon, 21 Oct 2024 20:03:24 +0200 Message-ID: <2024102138-CVE-2024-49996-0d29@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=2719; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=rhuNdmZE+i7QO52M62IiyvakesmrPoMeUfnPWFGtVaE=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli05lcqjy9HknNlMjb9jnoh5Tyy5POEh4+tfZvD7FNm FHx7mt5RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzk2yqGeepPDmnfZNGdEVgj q7ZtxbqMDyz33RgW9CxkTeD++siT+3rukclrVug8rHF0AwA= 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: cifs: Fix buffer overflow when parsing NFS reparse points ReparseDataLength is sum of the InodeType size and DataBuffer size. So to get DataBuffer size it is needed to subtract InodeType's size from ReparseDataLength. Function cifs_strndup_from_utf16() is currentlly accessing buf->DataBuffer at position after the end of the buffer because it does not subtract InodeType size from the length. Fix this problem and correctly subtract variable len. Member InodeType is present only when reparse buffer is large enough. Check for ReparseDataLength before accessing InodeType to prevent another invalid memory access. Major and minor rdev values are present also only when reparse buffer is large enough. Check for reparse buffer size before calling reparse_mkdev(). The Linux kernel CVE team has assigned CVE-2024-49996 to this issue. Affected and fixed versions =========================== Issue introduced in 5.3 with commit d5ecebc4900d and fixed in 6.6.55 with commit c6db81c550ce Issue introduced in 5.3 with commit d5ecebc4900d and fixed in 6.10.14 with commit 803b3a39cb09 Issue introduced in 5.3 with commit d5ecebc4900d and fixed in 6.11.3 with commit c173d47b69f0 Issue introduced in 5.3 with commit d5ecebc4900d and fixed in 6.12-rc2 with commit e2a8910af016 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-49996 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: fs/smb/client/reparse.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/c6db81c550cea0c73bd72ef55f579991e0e4ba07 https://git.kernel.org/stable/c/803b3a39cb096d8718c0aebc03fd19f11c7dc919 https://git.kernel.org/stable/c/c173d47b69f07cd7ca08efb4e458adbd4725d8e9 https://git.kernel.org/stable/c/e2a8910af01653c1c268984855629d71fb81f404