{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2023-53747",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2023-53747"
  ],
  "published": "2025-12-08T01:19:54Z",
  "summary": "vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nvc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF\n\nAfter a call to console_unlock() in vcs_write() the vc_data struct can be\nfreed by vc_port_destruct(). Because of that, the struct vc_data pointer\nmust be reloaded in the while loop in vcs_write() after console_lock() to\navoid a UAF when vcs_size() is called.\n\nSyzkaller reported a UAF in vcs_size().\n\nBUG: KASAN: slab-use-after-free in vcs_size (drivers/tty/vt/vc_screen.c:215)\nRead of size 4 at addr ffff8880beab89a8 by task repro_vcs_size/4119\n\nCall Trace:\n <TASK>\n__asan_report_load4_noabort (mm/kasan/report_generic.c:380)\nvcs_size (drivers/tty/vt/vc_screen.c:215)\nvcs_write (drivers/tty/vt/vc_screen.c:664)\nvfs_write (fs/read_write.c:582 fs/read_write.c:564)\n...\n <TASK>\n\nAllocated by task 1213:\nkmalloc_trace (mm/slab_common.c:1064)\nvc_allocate (./include/linux/slab.h:559 ./include/linux/slab.h:680\n    drivers/tty/vt/vt.c:1078 drivers/tty/vt/vt.c:1058)\ncon_install (drivers/tty/vt/vt.c:3334)\ntty_init_dev (drivers/tty/tty_io.c:1303 drivers/tty/tty_io.c:1415\n    drivers/tty/tty_io.c:1392)\ntty_open (drivers/tty/tty_io.c:2082 drivers/tty/tty_io.c:2128)\nchrdev_open (fs/char_dev.c:415)\ndo_dentry_open (fs/open.c:921)\nvfs_open (fs/open.c:1052)\n...\n\nFreed by task 4116:\nkfree (mm/slab_common.c:1016)\nvc_port_destruct (drivers/tty/vt/vt.c:1044)\ntty_port_destructor (drivers/tty/tty_port.c:296)\ntty_port_put (drivers/tty/tty_port.c:312)\nvt_disallocate_all (drivers/tty/vt/vt_ioctl.c:662 (discriminator 2))\nvt_ioctl (drivers/tty/vt/vt_ioctl.c:903)\ntty_ioctl (drivers/tty/tty_io.c:2778)\n...\n\nThe buggy address belongs to the object at ffff8880beab8800\n which belongs to the cache kmalloc-1k of size 1024\nThe buggy address is located 424 bytes inside of\n freed 1024-byte region [ffff8880beab8800, ffff8880beab8c00)\n\nThe buggy address belongs to the physical page:\npage:00000000afc77580 refcount:1 mapcount:0 mapping:0000000000000000\n    index:0x0 pfn:0xbeab8\nhead:00000000afc77580 order:3 entire_mapcount:0 nr_pages_mapped:0\n    pincount:0\nflags: 0xfffffc0010200(slab|head|node=0|zone=1|lastcpupid=0x1fffff)\npage_type: 0xffffffff()\nraw: 000fffffc0010200 ffff888100042dc0 ffffea000426de00 dead000000000002\nraw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000\npage dumped because: kasan: bad access detected\n\nMemory state around the buggy address:\n ffff8880beab8880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb\n ffff8880beab8900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb\n>ffff8880beab8980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb\n                                  ^\n ffff8880beab8a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb\n ffff8880beab8a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb\n==================================================================\nDisabling lock debugging due to kernel taint",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.21-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v6",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7l",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v8",
            "binary_version": "1:6.1.21-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.21-1+rpt1": {
            "linux_commit": "0afb5e98488aed7017b9bf321b575d0177feb7ed",
            "upstream_version": "6.1.21",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.30"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2023-53747"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/934de9a9b659785fed3e820bc0c813a460c71fea"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0deff678157333d775af190f84696336cdcccd6d"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a4e3c4c65ae8510e01352c9a4347e05c035b2ce2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/11dddfbb7a4e62489b01074d6c04d9d1b42e4047"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/e3d1adcad5b73c7ed0c7edb35ab68abcaa45cf67"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3338d0b9acde770ee588eead5cac32c25e7048fc"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/1de42e7653d6714a7507ba6696151a1fa028c69f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8fb9ea65c9d1338b0d2bb0a9122dc942cdd32357"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:24:39Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - Exploitation requires local access to character device nodes \u2014 write(2) on /dev/vcsN or /dev/vcsaN and an ioctl on a VT tty for VT_DISALLOCATE. There is no network or remote-peer reachability.\nAC:L - The attacker controls both sides of the race: one thread drives the write loop (which unconditionally drops console_lock every PAGE_SIZE chunk) while another calls VT_DISALLOCATE, and the window can be stretched indefinitely by backing the user buffer with userfaultfd or FUSE so copy_from_user stalls on demand. This makes the free-and-respray step reliable rather than opportunistic.\nPR:L - VT_DISALLOCATE carries no perm or capable() check whatsoever in vt_ioctl, so the only gate is DAC on /dev/vcs* and a VT fd \u2014 held by any tty-group member, any console-logged-in user via logind ACLs, or non-root console services on embedded systems. No capability or root privilege in the initial namespace is needed.\nUI:N - The attacker performs every step \u2014 allocating the VT, opening /dev/vcs*, issuing the write and the deallocation ioctl \u2014 from its own threads. No victim action is involved.\nS:U - The use-after-free corrupts kernel heap memory within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The stale vc_data is read after free (vcs_size, screenpos, vc_sw), and since the attacker can reclaim the kmalloc-1k slot with controlled data and set vc->vc_origin arbitrarily, the write path's read-modify-write sequences (vcs_scr_readw on the computed pointer) yield an arbitrary kernel-memory read primitive.\nI:H - vcs_write_buf derives its destination pointer from the freed object's vc_origin/vc_visible_origin and then writes attacker-supplied 16-bit values there, giving a controlled arbitrary kernel write; the viewed path additionally makes an indirect call through vc->vc_sw->con_screen_pos read out of freed memory, a direct control-flow hijack primitive leading to privilege escalation.\nA:H - Even unweaponized the bug is a slab use-after-free that reads and writes through a dangling pointer, producing KASAN splats, oopses, and kernel panics as syzkaller demonstrated, and it can be retriggered at will."
    }
  }
}
