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 6446B1FBF60 for ; Mon, 21 Oct 2024 19:41:00 +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=1729539660; cv=none; b=o+SFeLvFkyNnYTp/bPUUFS02+8DXXwcMWsHX0vQhBc9MP2aIjvybQib9rEolK0Eu/JURRcuCq46ki6RpWnaI25ciTaAMsq+0AMYN5TkoE4Kr+6ARKKdD2yv0pk7kqq/x8+A/EfThefz5U+ztu1De1vemcYda+rQT8K7vyccgW0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729539660; c=relaxed/simple; bh=dulrv5D0GOqsvX6Ily0JClouxTOtrFpqDRILbHlvHj4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Tpsb+6SmsaiyhH2z4ZTamPNhcHnh8UpDdBQRulY75VcxoI78s+NENRfvA5q3p9G0EPbC1HTR9QjwcZ/l2gAedTJKKKlYBvpwvep/+zTIfyoM7bsp4DZzswxD75b/sI0wz3x/GAVLZAXNSu2wL1bqqksHQpGbC5r5lUv83hjFHXU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rRVOgqkE; 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="rRVOgqkE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D508FC4CEC3; Mon, 21 Oct 2024 19:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729539660; bh=dulrv5D0GOqsvX6Ily0JClouxTOtrFpqDRILbHlvHj4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=rRVOgqkEwT0kFq1V9pk60/f+hDEJ7XjZ3nmmH26/caYeijn1us3ah3G900oiNuslE ePXjQJnLrJJysJp0Rc2EnEtK+9ZMXM7gGVwYZUX1+RoJG7oBa30wUbEDBr23p9JSnP Mn5VzrcgIY5Rc4JE1ctYfSUqW/1NOnlqLm5i/dwA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50048: fbcon: Fix a NULL pointer dereference issue in fbcon_putcs Date: Mon, 21 Oct 2024 21:39:54 +0200 Message-ID: <2024102134-CVE-2024-50048-f299@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=3065; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=dulrv5D0GOqsvX6Ily0JClouxTOtrFpqDRILbHlvHj4=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlia79xtS7Q8njVUfL+199eJ48djb9k5ke2SNee+Bl77 Jul8izHjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIaQGGBbsij2vebYhl9ZnG wSG4YUKHdFFrGMOCyUqHtp+1vGl779hftaeF72YXyE82BwA= 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: fbcon: Fix a NULL pointer dereference issue in fbcon_putcs syzbot has found a NULL pointer dereference bug in fbcon. Here is the simplified C reproducer: struct param { uint8_t type; struct tiocl_selection ts; }; int main() { struct fb_con2fbmap con2fb; struct param param; int fd = open("/dev/fb1", 0, 0); con2fb.console = 0x19; con2fb.framebuffer = 0; ioctl(fd, FBIOPUT_CON2FBMAP, &con2fb); param.type = 2; param.ts.xs = 0; param.ts.ys = 0; param.ts.xe = 0; param.ts.ye = 0; param.ts.sel_mode = 0; int fd1 = open("/dev/tty1", O_RDWR, 0); ioctl(fd1, TIOCLINUX, ¶m); con2fb.console = 1; con2fb.framebuffer = 0; ioctl(fd, FBIOPUT_CON2FBMAP, &con2fb); return 0; } After calling ioctl(fd1, TIOCLINUX, ¶m), the subsequent ioctl(fd, FBIOPUT_CON2FBMAP, &con2fb) causes the kernel to follow a different execution path: set_con2fb_map -> con2fb_init_display -> fbcon_set_disp -> redraw_screen -> hide_cursor -> clear_selection -> highlight -> invert_screen -> do_update_region -> fbcon_putcs -> ops->putcs Since ops->putcs is a NULL pointer, this leads to a kernel panic. To prevent this, we need to call set_blitting_type() within set_con2fb_map() to properly initialize ops->putcs. The Linux kernel CVE team has assigned CVE-2024-50048 to this issue. Affected and fixed versions =========================== Fixed in 6.1.113 with commit 8266ae6eafdc Fixed in 6.6.57 with commit f7fb5dda5553 Fixed in 6.11.4 with commit e5c2dba62996 Fixed in 6.12-rc1 with commit 5b97eebcce1b 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-50048 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/fbcon.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/8266ae6eafdcd5a3136592445ff4038bbc7ee80e https://git.kernel.org/stable/c/f7fb5dda555344529ce584ff7a28b109528d2f1b https://git.kernel.org/stable/c/e5c2dba62996a3a6eeb34bd248b90fc69c5a6a1b https://git.kernel.org/stable/c/5b97eebcce1b4f3f07a71f635d6aa3af96c236e7