{"id":"CVE-2024-26981","aliases":["CVE-2024-26981"],"related":[],"kind":"vulnerability","state":"published","title":"nilfs2: fix OOB in nilfs_set_de_type","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix OOB in nilfs_set_de_type\n\nThe size of the nilfs_type_by_mode array in the fs/nilfs2/dir.c file is\ndefined as \"S_IFMT >> S_SHIFT\", but the nilfs_set_de_type() function,\nwhich uses this array, specifies the index to read from the array in the\nsame way as \"(mode & S_IFMT) >> S_SHIFT\".\n\nstatic void nilfs_set_de_type(struct nilfs_dir_entry *de, struct inode\n *inode)\n{\n\tumode_t mode = inode->i_mode;\n\n\tde->file_type = nilfs_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; // oob\n}\n\nHowever, when the index is determined this way, an out-of-bounds (OOB)\nerror occurs by referring to an index that is 1 larger than the array size\nwhen the condition \"mode & S_IFMT == S_IFMT\" is satisfied.  Therefore, a\npatch to resize the nilfs_type_by_mode array should be applied to prevent\nOOB errors.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix OOB in nilfs_set_de_type\n\nThe size of the nilfs_type_by_mode array in the fs/nilfs2/dir.c file is\ndefined as \"S_IFMT >> S_SHIFT\", but the nilfs_set_de_type() function,\nwhich uses this array, specifies the index to read from the array in the\nsame way as \"(mode & S_IFMT) >> S_SHIFT\".\n\nstatic void nilfs_set_de_type(struct nilfs_dir_entry *de, struct inode\n *inode)\n{\n\tumode_t mode = inode->i_mode;\n\n\tde->file_type = nilfs_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; // oob\n}\n\nHowever, when the index is determined this way, an out-of-bounds (OOB)\nerror occurs by referring to an index that is 1 larger than the array size\nwhen the condition \"mode & S_IFMT == S_IFMT\" is satisfied.  Therefore, a\npatch to resize the nilfs_type_by_mode array should be applied to prevent\nOOB errors.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: nilfs2: corrige OOB en nilfs_set_de_type El tamaño de la matriz nilfs_type_by_mode en el archivo fs/nilfs2/dir.c se define como \"S_IFMT &gt;&gt; S_SHIFT\", pero la función nilfs_set_de_type() , que utiliza esta matriz, especifica el índice a leer de la matriz de la misma manera que \"(mode &amp; S_IFMT) &gt;&gt; S_SHIFT\". static void nilfs_set_de_type(struct nilfs_dir_entry *de, struct inode *inode) { umode_t modo = inodo-&gt;i_mode; de-&gt;tipo_archivo = nilfs_type_by_mode[(modo &amp; S_IFMT)&gt;&gt;S_SHIFT]; // oob } Sin embargo, cuando el índice se determina de esta manera, se produce un error fuera de los límites (OOB) al hacer referencia a un índice que es 1 mayor que el tamaño de la matriz cuando la condición \"modo &amp; S_IFMT == S_IFMT\" es satisfecho. Por lo tanto, se debe aplicar un parche para cambiar el tamaño de la matriz nilfs_type_by_mode para evitar errores OOB.","source":"nvd"}],"published":"2024-05-01T05:27:06.469Z","modified":"2026-06-17T07:18:51.153Z","severity":{"scorer":"NVD","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":"NVD","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"}],"cwes":["CWE-129"],"affected":[{"ranges":[{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"054f29e9ca05be3906544c5f2a2c7321c30a4243","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"90f43980ea6be4ad903e389be9a27a2a0018f1c8","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"7061c7efbb9e8f11ce92d6b4646405ea2b0b4de1","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"bdbe483da21f852c93b22557b146bc4d989260f0","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"897ac5306bbeb83e90c437326f7044c79a17c611","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"2382eae66b196c31893984a538908c3eb7506ff9","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"90823f8d9ecca3d5fa6b102c8e464c62f416975f","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"c4a7dc9523b59b3e73fd522c73e95e072f876b16","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.30","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.30","status":"unaffected"},{"type":"semver","introduced":"4.19.313","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.275","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.216","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.157","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.88","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.29","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.8.8","lastAffected":"6.8.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.9","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":"2.6.30","fixed":"4.19.313"},{"status":"affected","introduced":"4.20","fixed":"5.4.275"},{"status":"affected","introduced":"5.5","fixed":"5.10.216"},{"status":"affected","introduced":"5.11","fixed":"5.15.157"},{"status":"affected","introduced":"5.16","fixed":"6.1.88"},{"status":"affected","introduced":"6.2","fixed":"6.6.29"},{"status":"affected","introduced":"6.7","fixed":"6.8.8"},{"status":"affected","version":"6.9"},{"status":"affected","version":"6.9"},{"status":"affected","version":"6.9"},{"status":"affected","version":"6.9"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/054f29e9ca05be3906544c5f2a2c7321c30a4243","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/90f43980ea6be4ad903e389be9a27a2a0018f1c8","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7061c7efbb9e8f11ce92d6b4646405ea2b0b4de1","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bdbe483da21f852c93b22557b146bc4d989260f0","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/897ac5306bbeb83e90c437326f7044c79a17c611","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2382eae66b196c31893984a538908c3eb7506ff9","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/90823f8d9ecca3d5fa6b102c8e464c62f416975f","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c4a7dc9523b59b3e73fd522c73e95e072f876b16","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html","tags":["mailing-list","third-party-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html","tags":["mailing-list","third-party-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DAMSOZXJEPUOXW33WZYWCVAY7Z5S7OOY/","tags":[],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4EZ6PJW7VOZ224TD7N4JZNU6KV32ZJ53/","tags":[],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GCBZZEC7L7KTWWAS2NLJK6SO3IZIL4WW/","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-07-17T14:33:30.572Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-26981","url":"https://www.cve.org/CVERecord?id=CVE-2024-26981","licence":"CVE Terms of Use","modified":"2026-05-11T20:08:06.091Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-26981","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-26981","licence":"Public domain","modified":"2026-06-17T07:18:51.153Z"}],"updatedAt":"2026-11-25T22:58:39.751Z","epss":{"score":0.00273,"percentile":0.21116,"date":"2026-12-01T12:00:22.000Z"}}