From mboxrd@z Thu Jan 1 00:00:00 1970 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 F0309218ADD for ; Wed, 26 Feb 2025 02:15:24 +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=1740536125; cv=none; b=rfhFQdLqibUICkmSnA5B4CWzuhhLYBzpk9retc9RXFnsWTLwe/wP9sKUQV9q1W059WTE7WQz6EVGbW0LC7KF+5qnY03wYi5jDDAWzPxwD76RHY6yJU7lcm/9kW5cDTBVaSmw/5vccKw9bG9uROcF7E1JzW7WVxHzNnCjell4Fg4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536125; c=relaxed/simple; bh=7yZNDTx4DslfsDdflkWk8qBeVPckVDuVWSIupJx6SUw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=asgSLXK+wX/cbG1TEFbRtz4o6vx2T61cGUDQZWyOkP5zxQbEaP+pSr8HelXacICfIgJiaob4aOYIekrlOICPj3Xv/dmrOOSzEEmUBsZoB0CAjld2f3bn5cFE2pl+0k2a2dSg/WmidYHFLA5+qw1h68nTm5Wk3j7UFQpw4V4DoVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OpkUwHTz; 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="OpkUwHTz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C62BAC4CEDD; Wed, 26 Feb 2025 02:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536124; bh=7yZNDTx4DslfsDdflkWk8qBeVPckVDuVWSIupJx6SUw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=OpkUwHTzKUgjKGuOsiJLZ/jLIzI0oH5CB47Kr7TlTs/se41Bi9/lMzlHwGKy2mrhk 94ehK5wsZI07opUlxQCxl5HGJY8cMYhkcsduwB/lHO5BqvGDIclUZ5eS6F5fh/pjLN 6XL+RVKiEyDqJIST6zMwaHvkpj63h0rP+0ioH12k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49511: fbdev: defio: fix the pagelist corruption Date: Wed, 26 Feb 2025 03:13:05 +0100 Message-ID: <2025022609-CVE-2022-49511-100a@gregkh> X-Mailer: git-send-email 2.48.1 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=2954; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=7yZNDTx4DslfsDdflkWk8qBeVPckVDuVWSIupJx6SUw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7KhiL4vO62h7VHOjrmyXbHLllh3tfVxNPZpBH5l/mZ /OWvFLsiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIl8VmVYsHXhxwc+pXnnEqwZ 5SMMrv3g4VA7wjA/qOSZ49WUs1tUsq5vOihbdyZL8Q4bAA== 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: fbdev: defio: fix the pagelist corruption Easily hit the below list corruption: == list_add corruption. prev->next should be next (ffffffffc0ceb090), but was ffffec604507edc8. (prev=ffffec604507edc8). WARNING: CPU: 65 PID: 3959 at lib/list_debug.c:26 __list_add_valid+0x53/0x80 CPU: 65 PID: 3959 Comm: fbdev Tainted: G U RIP: 0010:__list_add_valid+0x53/0x80 Call Trace: fb_deferred_io_mkwrite+0xea/0x150 do_page_mkwrite+0x57/0xc0 do_wp_page+0x278/0x2f0 __handle_mm_fault+0xdc2/0x1590 handle_mm_fault+0xdd/0x2c0 do_user_addr_fault+0x1d3/0x650 exc_page_fault+0x77/0x180 ? asm_exc_page_fault+0x8/0x30 asm_exc_page_fault+0x1e/0x30 RIP: 0033:0x7fd98fc8fad1 == Figure out the race happens when one process is adding &page->lru into the pagelist tail in fb_deferred_io_mkwrite(), another process is re-initializing the same &page->lru in fb_deferred_io_fault(), which is not protected by the lock. This fix is to init all the page lists one time during initialization, it not only fixes the list corruption, but also avoids INIT_LIST_HEAD() redundantly. V2: change "int i" to "unsigned int i" (Geert Uytterhoeven) The Linux kernel CVE team has assigned CVE-2022-49511 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 105a940416fc622406653b6fe54732897642dfbc and fixed in 5.18.3 with commit 6a9ae2fe887042f76fd3d334349e64e8ab3c55a2 Issue introduced in 5.18 with commit 105a940416fc622406653b6fe54732897642dfbc and fixed in 5.19 with commit 856082f021a28221db2c32bd0531614a8382be67 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-2022-49511 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/video/fbdev/core/fb_defio.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/e79b2b2aadeffe1db54a6b569b9b621575c3eb07 https://git.kernel.org/stable/c/6a9ae2fe887042f76fd3d334349e64e8ab3c55a2 https://git.kernel.org/stable/c/856082f021a28221db2c32bd0531614a8382be67