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 4F2A416DC09 for ; Fri, 12 Jul 2024 12:22:25 +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=1720786945; cv=none; b=pO0eLakbGo74xD9VNqIMrdfbdt/M2LGgvlegErkgcvRCRZu1WSmTzQfQPzy50navkFWxzapm2mT8I42x+4EooVsW7pNpWMP+GSqu0cTiyFb68C9QEdyS5grkb+rkZD86E4o5YlhSVcKnxrsaB5knMnCn8IzzkGpl+8bTEaVq+qg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720786945; c=relaxed/simple; bh=iSSNxF1sO/HtT7M0GfxrJgi4BMalScUqGIv+0BiHyMQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LvhHoNnVfUf4s0GlDFGCRI28gGEzrCZQP5tB2MNCgCGbyEGFHsqkSZV+LXRfZHfW8O6V/EXx6ZHvCvIo8a0o7KQHML5jmeaTmtjzZkxpvkg7mr3wTPJeTUBXc0bmKj492GkJ3JTdXcWCQd0ZmUT85x7/Fhe7/91WatwAGImLSFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=U+gZHaxA; 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="U+gZHaxA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0A48C32782; Fri, 12 Jul 2024 12:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720786945; bh=iSSNxF1sO/HtT7M0GfxrJgi4BMalScUqGIv+0BiHyMQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=U+gZHaxAquTIOznSaQw1D9IKm5OySN/MHb3Fgp/LHuflcpbrS9TP11TGb8KlcAbQ3 WDHT3H4/xhdG1IWd0tt1jG9ydVxPsFokqvRUS4nOZSnmetqI0yWNQBZRGfzH7fxMLk NDU2lfV6ROFc3H0C85IIR5yXercuGInik4KHftDk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-39497: drm/shmem-helper: Fix BUG_ON() on mmap(PROT_WRITE, MAP_PRIVATE) Date: Fri, 12 Jul 2024 14:21:03 +0200 Message-ID: <2024071202-CVE-2024-39497-834c@gregkh> X-Mailer: git-send-email 2.45.2 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=2355; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=iSSNxF1sO/HtT7M0GfxrJgi4BMalScUqGIv+0BiHyMQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkT5ddl2c5+9b/3pjq77PqQg0K9Gw7u51Kc1rrjtu2xv IOcszdVd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEvI4zzFM8pi3lYbNt+o6b Pc7ak2yiBbcYnGRYsOTGifIHdjcvfwr47LPCqbdGv9SCGQA= 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: drm/shmem-helper: Fix BUG_ON() on mmap(PROT_WRITE, MAP_PRIVATE) Lack of check for copy-on-write (COW) mapping in drm_gem_shmem_mmap allows users to call mmap with PROT_WRITE and MAP_PRIVATE flag causing a kernel panic due to BUG_ON in vmf_insert_pfn_prot: BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags)); Return -EINVAL early if COW mapping is detected. This bug affects all drm drivers using default shmem helpers. It can be reproduced by this simple example: void *ptr = mmap(0, size, PROT_WRITE, MAP_PRIVATE, fd, mmap_offset); ptr[0] = 0; The Linux kernel CVE team has assigned CVE-2024-39497 to this issue. Affected and fixed versions =========================== Issue introduced in 5.2 with commit 2194a63a818d and fixed in 6.6.35 with commit 1b4a8b89bf67 Issue introduced in 5.2 with commit 2194a63a818d and fixed in 6.9.6 with commit 03c71c42809e Issue introduced in 5.2 with commit 2194a63a818d and fixed in 6.10-rc2 with commit 39bc27bd6880 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-39497 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/gpu/drm/drm_gem_shmem_helper.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/1b4a8b89bf6787090b56424d269bf84ba00c3263 https://git.kernel.org/stable/c/03c71c42809ef4b17f5d874cdb2d3bf40e847b86 https://git.kernel.org/stable/c/39bc27bd688066a63e56f7f64ad34fae03fbe3b8