In the Linux kernel, the following vulnerability has been resolved:
ext4: make sure the first directory block is not a hole
The syzbot constructs a directory that has no dirblock but is non-inline, i.e. the first directory block is a hole. And no errors are reported when creating files in this directory in the following flow.
ext4_mknod
...
ext4_add_entry
// Read block 0
ext4_read_dirblock(dir, block, DIRENT)
bh = ext4_bread(NULL, inode, block, 0)
if (!bh && (type == INDEX || type == DIRENT_HTREE))
// The first directory block is a hole
// But type == DIRENT, so no error is reported.
After that, we get a directory block without '.' and '..' but with a valid dentry. This may cause some code that relies on dot or dotdot (such as makeindexeddir()) to crash.
Therefore when ext4readdirblock() finds that the first directory block is a hole report that the filesystem is corrupted and return an error to avoid loading corrupted data from disk causing something bad.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42304.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-42304.json"
[
{
"id": "CVE-2024-42304-046e9bb9",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
]
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3893d9de8ee153baac56d127d844103488133b5",
"target": {
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-06531451",
"signature_type": "Function",
"digest": {
"function_hash": "337601929133363230298088705060941761171",
"length": 1750.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6",
"target": {
"function": "ext4_empty_dir",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-0cb74c33",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"258513700494849575219545358349051465302",
"204449465920953364843904247924620720881",
"309373469897414713421015287618391028458",
"270201683384327676872433020562437677854",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
]
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d81d7e347d1f1f48a5634607d39eb90c161c8afe",
"target": {
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-17b01983",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"258513700494849575219545358349051465302",
"204449465920953364843904247924620720881",
"309373469897414713421015287618391028458",
"270201683384327676872433020562437677854",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
]
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e02f9941e8c011aa3eafa799def6a134ce06bcfa",
"target": {
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-21ff0138",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
]
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@299bc6ffa57e04e74c6cce866d6c0741fb4897a1",
"target": {
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-279fd3bc",
"signature_type": "Function",
"digest": {
"function_hash": "172941389722341911573863161181035779394",
"length": 2094.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@299bc6ffa57e04e74c6cce866d6c0741fb4897a1",
"target": {
"function": "__ext4_read_dirblock",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-32ce53c7",
"signature_type": "Function",
"digest": {
"function_hash": "80643326921993999107620513533109200368",
"length": 1090.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e02f9941e8c011aa3eafa799def6a134ce06bcfa",
"target": {
"function": "ext4_get_first_dir_block",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-34535ae1",
"signature_type": "Function",
"digest": {
"function_hash": "250432748759346544556552022401130450938",
"length": 1731.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e02f9941e8c011aa3eafa799def6a134ce06bcfa",
"target": {
"function": "ext4_empty_dir",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-3e747cb9",
"signature_type": "Function",
"digest": {
"function_hash": "172941389722341911573863161181035779394",
"length": 2094.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9771e3d8365ae1dd5e8846a204cb9af14e3e656a",
"target": {
"function": "__ext4_read_dirblock",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-460f5cd7",
"signature_type": "Function",
"digest": {
"function_hash": "172941389722341911573863161181035779394",
"length": 2094.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de2a011a13a46468a6e8259db58b1b62071fe136",
"target": {
"function": "__ext4_read_dirblock",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-5201a075",
"signature_type": "Function",
"digest": {
"function_hash": "80643326921993999107620513533109200368",
"length": 1090.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6",
"target": {
"function": "ext4_get_first_dir_block",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-5852e333",
"signature_type": "Function",
"digest": {
"function_hash": "172941389722341911573863161181035779394",
"length": 2094.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3893d9de8ee153baac56d127d844103488133b5",
"target": {
"function": "__ext4_read_dirblock",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-5cf9df3e",
"signature_type": "Function",
"digest": {
"function_hash": "80643326921993999107620513533109200368",
"length": 1090.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de2a011a13a46468a6e8259db58b1b62071fe136",
"target": {
"function": "ext4_get_first_dir_block",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-5f6fd8f1",
"signature_type": "Function",
"digest": {
"function_hash": "337601929133363230298088705060941761171",
"length": 1750.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@299bc6ffa57e04e74c6cce866d6c0741fb4897a1",
"target": {
"function": "ext4_empty_dir",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-689c2eae",
"signature_type": "Function",
"digest": {
"function_hash": "337601929133363230298088705060941761171",
"length": 1750.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3893d9de8ee153baac56d127d844103488133b5",
"target": {
"function": "ext4_empty_dir",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-69b440de",
"signature_type": "Function",
"digest": {
"function_hash": "80643326921993999107620513533109200368",
"length": 1090.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b609753cbbd38f8c0affd4956c0af178348523ac",
"target": {
"function": "ext4_get_first_dir_block",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-75ae2bed",
"signature_type": "Function",
"digest": {
"function_hash": "243564504159328629566460644572613592817",
"length": 1736.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de2a011a13a46468a6e8259db58b1b62071fe136",
"target": {
"function": "ext4_empty_dir",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-7a1b5226",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
]
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9771e3d8365ae1dd5e8846a204cb9af14e3e656a",
"target": {
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-7b1aa09e",
"signature_type": "Function",
"digest": {
"function_hash": "172941389722341911573863161181035779394",
"length": 2094.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b609753cbbd38f8c0affd4956c0af178348523ac",
"target": {
"function": "__ext4_read_dirblock",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-7b624f77",
"signature_type": "Function",
"digest": {
"function_hash": "80643326921993999107620513533109200368",
"length": 1090.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@299bc6ffa57e04e74c6cce866d6c0741fb4897a1",
"target": {
"function": "ext4_get_first_dir_block",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-7ba12e2a",
"signature_type": "Function",
"digest": {
"function_hash": "80643326921993999107620513533109200368",
"length": 1090.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3893d9de8ee153baac56d127d844103488133b5",
"target": {
"function": "ext4_get_first_dir_block",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-86549a88",
"signature_type": "Function",
"digest": {
"function_hash": "337601929133363230298088705060941761171",
"length": 1750.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b609753cbbd38f8c0affd4956c0af178348523ac",
"target": {
"function": "ext4_empty_dir",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-867e3858",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
]
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b609753cbbd38f8c0affd4956c0af178348523ac",
"target": {
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-9a75d275",
"signature_type": "Function",
"digest": {
"function_hash": "172941389722341911573863161181035779394",
"length": 2094.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6",
"target": {
"function": "__ext4_read_dirblock",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-b584a314",
"signature_type": "Function",
"digest": {
"function_hash": "203425469627959404406136961159845493137",
"length": 1631.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d81d7e347d1f1f48a5634607d39eb90c161c8afe",
"target": {
"function": "__ext4_read_dirblock",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-bd14488d",
"signature_type": "Function",
"digest": {
"function_hash": "203425469627959404406136961159845493137",
"length": 1631.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e02f9941e8c011aa3eafa799def6a134ce06bcfa",
"target": {
"function": "__ext4_read_dirblock",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-c5fd064a",
"signature_type": "Function",
"digest": {
"function_hash": "250432748759346544556552022401130450938",
"length": 1731.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d81d7e347d1f1f48a5634607d39eb90c161c8afe",
"target": {
"function": "ext4_empty_dir",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-d084ddff",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
]
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de2a011a13a46468a6e8259db58b1b62071fe136",
"target": {
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-d0bc0f7a",
"signature_type": "Function",
"digest": {
"function_hash": "80643326921993999107620513533109200368",
"length": 1090.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d81d7e347d1f1f48a5634607d39eb90c161c8afe",
"target": {
"function": "ext4_get_first_dir_block",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-dbe7f66f",
"signature_type": "Function",
"digest": {
"function_hash": "337601929133363230298088705060941761171",
"length": 1750.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9771e3d8365ae1dd5e8846a204cb9af14e3e656a",
"target": {
"function": "ext4_empty_dir",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-e4ebd1ef",
"signature_type": "Function",
"digest": {
"function_hash": "80643326921993999107620513533109200368",
"length": 1090.0
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9771e3d8365ae1dd5e8846a204cb9af14e3e656a",
"target": {
"function": "ext4_get_first_dir_block",
"file": "fs/ext4/namei.c"
},
"deprecated": false
},
{
"id": "CVE-2024-42304-e877111e",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
]
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6",
"target": {
"file": "fs/ext4/namei.c"
},
"deprecated": false
}
]