{"resultsPerPage":1,"startIndex":0,"totalResults":1,"format":"NVD_CVE","version":"2.0","timestamp":"2026-04-29T22:19:16.933","vulnerabilities":[{"cve":{"id":"CVE-2023-54271","sourceIdentifier":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","published":"2025-12-30T13:16:16.000","lastModified":"2026-04-15T00:35:42.020","vulnStatus":"Deferred","cveTags":[],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nblk-cgroup: Fix NULL deref caused by blkg_policy_data being installed before init\n\nblk-iocost sometimes causes the following crash:\n\n  BUG: kernel NULL pointer dereference, address: 00000000000000e0\n  ...\n  RIP: 0010:_raw_spin_lock+0x17/0x30\n  Code: be 01 02 00 00 e8 79 38 39 ff 31 d2 89 d0 5d c3 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 65 ff 05 48 d0 34 7e b9 01 00 00 00 31 c0 <f0> 0f b1 0f 75 02 5d c3 89 c6 e8 ea 04 00 00 5d c3 0f 1f 84 00 00\n  RSP: 0018:ffffc900023b3d40 EFLAGS: 00010046\n  RAX: 0000000000000000 RBX: 00000000000000e0 RCX: 0000000000000001\n  RDX: ffffc900023b3d20 RSI: ffffc900023b3cf0 RDI: 00000000000000e0\n  RBP: ffffc900023b3d40 R08: ffffc900023b3c10 R09: 0000000000000003\n  R10: 0000000000000064 R11: 000000000000000a R12: ffff888102337000\n  R13: fffffffffffffff2 R14: ffff88810af408c8 R15: ffff8881070c3600\n  FS:  00007faaaf364fc0(0000) GS:ffff88842fdc0000(0000) knlGS:0000000000000000\n  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n  CR2: 00000000000000e0 CR3: 00000001097b1000 CR4: 0000000000350ea0\n  Call Trace:\n   <TASK>\n   ioc_weight_write+0x13d/0x410\n   cgroup_file_write+0x7a/0x130\n   kernfs_fop_write_iter+0xf5/0x170\n   vfs_write+0x298/0x370\n   ksys_write+0x5f/0xb0\n   __x64_sys_write+0x1b/0x20\n   do_syscall_64+0x3d/0x80\n   entry_SYSCALL_64_after_hwframe+0x46/0xb0\n\nThis happens because iocg->ioc is NULL. The field is initialized by\nioc_pd_init() and never cleared. The NULL deref is caused by\nblkcg_activate_policy() installing blkg_policy_data before initializing it.\n\nblkcg_activate_policy() was doing the following:\n\n1. Allocate pd's for all existing blkg's and install them in blkg->pd[].\n2. Initialize all pd's.\n3. Online all pd's.\n\nblkcg_activate_policy() only grabs the queue_lock and may release and\nre-acquire the lock as allocation may need to sleep. ioc_weight_write()\ngrabs blkcg->lock and iterates all its blkg's. The two can race and if\nioc_weight_write() runs during #1 or between #1 and #2, it can encounter a\npd which is not initialized yet, leading to crash.\n\nThe crash can be reproduced with the following script:\n\n  #!/bin/bash\n\n  echo +io > /sys/fs/cgroup/cgroup.subtree_control\n  systemd-run --unit touch-sda --scope dd if=/dev/sda of=/dev/null bs=1M count=1 iflag=direct\n  echo 100 > /sys/fs/cgroup/system.slice/io.weight\n  bash -c \"echo '8:0 enable=1' > /sys/fs/cgroup/io.cost.qos\" &\n  sleep .2\n  echo 100 > /sys/fs/cgroup/system.slice/io.weight\n\nwith the following patch applied:\n\n> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c\n> index fc49be622e05..38d671d5e10c 100644\n> --- a/block/blk-cgroup.c\n> +++ b/block/blk-cgroup.c\n> @@ -1553,6 +1553,12 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)\n> \t\tpd->online = false;\n> \t}\n>\n> +       if (system_state == SYSTEM_RUNNING) {\n> +               spin_unlock_irq(&q->queue_lock);\n> +               ssleep(1);\n> +               spin_lock_irq(&q->queue_lock);\n> +       }\n> +\n> \t/* all allocated, init in the same order */\n> \tif (pol->pd_init_fn)\n> \t\tlist_for_each_entry_reverse(blkg, &q->blkg_list, q_node)\n\nI don't see a reason why all pd's should be allocated, initialized and\nonlined together. The only ordering requirement is that parent blkgs to be\ninitialized and onlined before children, which is guaranteed from the\nwalking order. Let's fix the bug by allocating, initializing and onlining pd\nfor each blkg and holding blkcg->lock over initialization and onlining. This\nensures that an installed blkg is always fully initialized and onlined\nremoving the the race window."},{"lang":"es","value":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nblk-cgroup: Corrección de desreferencia NULL causada por la instalación de blkg_policy_data antes de la inicialización\n\nblk-iocost a veces causa el siguiente fallo:\n\n  BUG: desreferencia de puntero NULL del kernel, dirección: 00000000000000e0\n  ...\n  RIP: 0010:_raw_spin_lock+0x17/0x30\n  Code: be 01 02 00 00 e8 79 38 39 ff 31 d2 89 d0 5d c3 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 65 ff 05 48 d0 34 7e b9 01 00 00 00 31 c0  0f b1 0f 75 02 5d c3 89 c6 e8 ea 04 00 00 5d c3 0f 1f 84 00 00\n  RSP: 0018:ffffc900023b3d40 EFLAGS: 00010046\n  RAX: 0000000000000000 RBX: 00000000000000e0 RCX: 0000000000000001\n  RDX: ffffc900023b3d20 RSI: ffffc900023b3cf0 RDI: 00000000000000e0\n  RBP: ffffc900023b3d40 R08: ffffc900023b3c10 R09: 0000000000000003\n  R10: 0000000000000064 R11: 000000000000000a R12: ffff888102337000\n  R13: fffffffffffffff2 R14: ffff88810af408c8 R15: ffff8881070c3600\n  FS:  00007faaaf364fc0(0000) GS:ffff88842fdc0000(0000) knlGS:0000000000000000\n  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n  CR2: 00000000000000e0 CR3: 00000001097b1000 CR4: 0000000000350ea0\n  Call Trace:\n   \n   ioc_weight_write+0x13d/0x410\n   cgroup_file_write+0x7a/0x130\n   kernfs_fop_write_iter+0xf5/0x170\n   vfs_write+0x298/0x370\n   ksys_write+0x5f/0xb0\n   __x64_sys_write+0x1b/0x20\n   do_syscall_64+0x3d/0x80\n   entry_SYSCALL_64_after_hwframe+0x46/0xb0\n\nEsto ocurre porque iocg-&gt;ioc es NULL. El campo es inicializado por ioc_pd_init() y nunca se borra. La desreferencia NULL es causada por blkcg_activate_policy() al instalar blkg_policy_data antes de inicializarlo.\n\nblkcg_activate_policy() estaba haciendo lo siguiente:\n\n1. Asignar pd's para todos los blkg's existentes e instalarlos en blkg-&gt;pd[].\n2. Inicializar todos los pd's.\n3. Poner en línea todos los pd's.\n\nblkcg_activate_policy() solo toma el queue_lock y puede liberar y volver a adquirir el bloqueo ya que la asignación puede necesitar dormir. ioc_weight_write() toma blkcg-&gt;lock e itera sobre todos sus blkg's. Los dos pueden competir y si ioc_weight_write() se ejecuta durante el #1 o entre el #1 y el #2, puede encontrar un pd que aún no está inicializado, lo que lleva a un fallo.\n\nEl fallo puede ser reproducido con el siguiente script:\n\n  #!/bin/bash\n\n  echo +io &gt; /sys/fs/cgroup/cgroup.subtree_control\n  systemd-run --unit touch-sda --scope dd if=/dev/sda of=/dev/null bs=1M count=1 iflag=direct\n  echo 100 &gt; /sys/fs/cgroup/system.slice/io.weight\n  bash -c \"echo '8:0 enable=1' &gt; /sys/fs/cgroup/io.cost.qos\" &amp;\n  sleep .2\n  echo 100 &gt; /sys/fs/cgroup/system.slice/io.weight\n\ncon el siguiente parche aplicado:\n\n&gt; diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c\n&gt; index fc49be622e05..38d671d5e10c 100644\n&gt; --- a/block/blk-cgroup.c\n&gt; +++ b/block/blk-cgroup.c\n&gt; @@ -1553,6 +1553,12 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)\n&gt; \t\tpd-&gt;online = false;\n&gt; \t}\n&gt;\n&gt; +       if (system_state == SYSTEM_RUNNING) {\n&gt; +               spin_unlock_irq(&amp;q-&gt;queue_lock);\n&gt; +               ssleep(1);\n&gt; +               spin_lock_irq(&amp;q-&gt;queue_lock);\n&gt; +       }\n&gt; +\n&gt; \t/* all allocated, init in the same order */\n&gt; \tif (pol-&gt;pd_init_fn)\n&gt; \t\tlist_for_each_entry_reverse(blkg, &amp;q-&gt;blkg_list, q_node)\n\nNo veo una razón por la cual todos los pd's deban ser asignados, inicializados y puestos en línea juntos. El único requisito de orden es que los blkg's padre sean inicializados y puestos en línea antes que los hijos, lo cual está garantizado por el orden de recorrido. Corrijamos el error al asignar, inicializar y poner en línea el pd para cada blkg y manteniendo blkcg-&gt;lock durante la inicialización y la puesta en línea. Esto asegura que un blkg instalado esté siempre completamente inicializado y puesto en línea, eliminando la ventana de carrera."}],"metrics":{},"references":[{"url":"https://git.kernel.org/stable/c/7d63c6f9765339dcfc34b7365ced7c518012e4fe","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/e39ef7880d1057b2ebcdb013405f4d84a257db23","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/ec14a87ee1999b19d8b7ed0fa95fea80644624ae","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"}]}}]}