{"id":"CVE-2022-48988","aliases":["CVE-2022-48988"],"related":[],"kind":"vulnerability","state":"published","title":"memcg: fix possible use-after-free in memcg_write_event_control()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmemcg: fix possible use-after-free in memcg_write_event_control()\n\nmemcg_write_event_control() accesses the dentry->d_name of the specified\ncontrol fd to route the write call.  As a cgroup interface file can't be\nrenamed, it's safe to access d_name as long as the specified file is a\nregular cgroup file.  Also, as these cgroup interface files can't be\nremoved before the directory, it's safe to access the parent too.\n\nPrior to 347c4a874710 (\"memcg: remove cgroup_event->cft\"), there was a\ncall to __file_cft() which verified that the specified file is a regular\ncgroupfs file before further accesses.  The cftype pointer returned from\n__file_cft() was no longer necessary and the commit inadvertently dropped\nthe file type check with it allowing any file to slip through.  With the\ninvarients broken, the d_name and parent accesses can now race against\nrenames and removals of arbitrary files and cause use-after-free's.\n\nFix the bug by resurrecting the file type check in __file_cft().  Now that\ncgroupfs is implemented through kernfs, checking the file operations needs\nto go through a layer of indirection.  Instead, let's check the superblock\nand dentry type.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmemcg: fix possible use-after-free in memcg_write_event_control()\n\nmemcg_write_event_control() accesses the dentry->d_name of the specified\ncontrol fd to route the write call.  As a cgroup interface file can't be\nrenamed, it's safe to access d_name as long as the specified file is a\nregular cgroup file.  Also, as these cgroup interface files can't be\nremoved before the directory, it's safe to access the parent too.\n\nPrior to 347c4a874710 (\"memcg: remove cgroup_event->cft\"), there was a\ncall to __file_cft() which verified that the specified file is a regular\ncgroupfs file before further accesses.  The cftype pointer returned from\n__file_cft() was no longer necessary and the commit inadvertently dropped\nthe file type check with it allowing any file to slip through.  With the\ninvarients broken, the d_name and parent accesses can now race against\nrenames and removals of arbitrary files and cause use-after-free's.\n\nFix the bug by resurrecting the file type check in __file_cft().  Now that\ncgroupfs is implemented through kernfs, checking the file operations needs\nto go through a layer of indirection.  Instead, let's check the superblock\nand dentry type.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: memcg: corregir posible use after free en memcg_write_event_control() memcg_write_event_control() accede a dentry-&gt;d_name del fd de control especificado para enrutar la llamada de escritura. Como no se puede cambiar el nombre de un archivo de interfaz de cgroup, es seguro acceder a d_name siempre que el archivo especificado sea un archivo cgroup normal. Además, como estos archivos de interfaz de cgroup no se pueden eliminar antes del directorio, también es seguro acceder al padre. Antes de 347c4a874710 (\"memcg: eliminar cgroup_event-&gt;cft\"), había una llamada a __file_cft() que verificaba que el archivo especificado es un archivo cgroupfs normal antes de futuros accesos. El puntero cftype devuelto desde __file_cft() ya no era necesario y el commit eliminó inadvertidamente la verificación del tipo de archivo, lo que permitió que cualquier archivo se deslizara. Con las invariantes rotas, los accesos a d_name y a los padres ahora pueden competir contra los cambios de nombre y las eliminaciones de archivos arbitrarios y causar use-after-free. Corrija el error resucitando la comprobación del tipo de archivo en __file_cft(). Ahora que cgroupfs está implementado a través de kernfs, la comprobación de las operaciones de archivo debe pasar por una capa de indirección. En su lugar, verifiquemos el tipo de superbloque y dentry.","source":"nvd"}],"published":"2024-10-21T20:06:04.601Z","modified":"2026-08-05T08:53:17.372Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"347c4a8747104a945ecced358944e42879176ca5","fixed":"b77600e26fd48727a95ffd50ba1e937efb548125","status":"affected"},{"type":"git","introduced":"347c4a8747104a945ecced358944e42879176ca5","fixed":"e1ae97624ecf400ea56c238bff23e5cd139df0b8","status":"affected"},{"type":"git","introduced":"347c4a8747104a945ecced358944e42879176ca5","fixed":"35963b31821920908e397146502066f6b032c917","status":"affected"},{"type":"git","introduced":"347c4a8747104a945ecced358944e42879176ca5","fixed":"f1f7f36cf682fa59db15e2089039a2eeb58ff2ad","status":"affected"},{"type":"git","introduced":"347c4a8747104a945ecced358944e42879176ca5","fixed":"aad8bbd17a1d586005feb9226c2e9cfce1432e13","status":"affected"},{"type":"git","introduced":"347c4a8747104a945ecced358944e42879176ca5","fixed":"0ed074317b835caa6c03bcfa8f133365324673dc","status":"affected"},{"type":"git","introduced":"347c4a8747104a945ecced358944e42879176ca5","fixed":"4a7ba45b1a435e7097ca0f79a847d0949d0eb088","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.14","status":"unaffected"},{"type":"semver","introduced":"4.14.302","lastAffected":"4.14.*","status":"unaffected"},{"type":"semver","introduced":"4.19.269","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.227","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.159","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.83","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.0.13","lastAffected":"6.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"3.14","fixed":"4.14.302"},{"status":"affected","introduced":"4.15","fixed":"4.19.269"},{"status":"affected","introduced":"4.20","fixed":"5.4.227"},{"status":"affected","introduced":"5.5","fixed":"5.10.159"},{"status":"affected","introduced":"5.11","fixed":"5.15.83"},{"status":"affected","introduced":"5.16","fixed":"6.0.13"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/b77600e26fd48727a95ffd50ba1e937efb548125","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e1ae97624ecf400ea56c238bff23e5cd139df0b8","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/35963b31821920908e397146502066f6b032c917","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f1f7f36cf682fa59db15e2089039a2eeb58ff2ad","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/aad8bbd17a1d586005feb9226c2e9cfce1432e13","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0ed074317b835caa6c03bcfa8f133365324673dc","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4a7ba45b1a435e7097ca0f79a847d0949d0eb088","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-10-22T13:16:57.577Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-48988","url":"https://www.cve.org/CVERecord?id=CVE-2022-48988","licence":"CVE Terms of Use","modified":"2026-08-05T08:53:17.372Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-48988","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-48988","licence":"Public domain","modified":"2026-08-04T10:17:29.650Z"}],"updatedAt":"2026-11-25T22:58:20.019Z","epss":{"score":0.00245,"percentile":0.16787,"date":"2026-12-02T12:00:21.000Z"}}