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.
[
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
],
"threshold": 0.9
},
"target": {
"file": "fs/ext4/namei.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3893d9de8ee153baac56d127d844103488133b5",
"signature_version": "v1",
"id": "CVE-2024-42304-046e9bb9"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1750.0,
"function_hash": "337601929133363230298088705060941761171"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_empty_dir"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6",
"signature_version": "v1",
"id": "CVE-2024-42304-06531451"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"258513700494849575219545358349051465302",
"204449465920953364843904247924620720881",
"309373469897414713421015287618391028458",
"270201683384327676872433020562437677854",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
],
"threshold": 0.9
},
"target": {
"file": "fs/ext4/namei.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e02f9941e8c011aa3eafa799def6a134ce06bcfa",
"signature_version": "v1",
"id": "CVE-2024-42304-17b01983"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
],
"threshold": 0.9
},
"target": {
"file": "fs/ext4/namei.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@299bc6ffa57e04e74c6cce866d6c0741fb4897a1",
"signature_version": "v1",
"id": "CVE-2024-42304-21ff0138"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2094.0,
"function_hash": "172941389722341911573863161181035779394"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "__ext4_read_dirblock"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@299bc6ffa57e04e74c6cce866d6c0741fb4897a1",
"signature_version": "v1",
"id": "CVE-2024-42304-279fd3bc"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1090.0,
"function_hash": "80643326921993999107620513533109200368"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_get_first_dir_block"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e02f9941e8c011aa3eafa799def6a134ce06bcfa",
"signature_version": "v1",
"id": "CVE-2024-42304-32ce53c7"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1731.0,
"function_hash": "250432748759346544556552022401130450938"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_empty_dir"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e02f9941e8c011aa3eafa799def6a134ce06bcfa",
"signature_version": "v1",
"id": "CVE-2024-42304-34535ae1"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2094.0,
"function_hash": "172941389722341911573863161181035779394"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "__ext4_read_dirblock"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9771e3d8365ae1dd5e8846a204cb9af14e3e656a",
"signature_version": "v1",
"id": "CVE-2024-42304-3e747cb9"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2094.0,
"function_hash": "172941389722341911573863161181035779394"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "__ext4_read_dirblock"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de2a011a13a46468a6e8259db58b1b62071fe136",
"signature_version": "v1",
"id": "CVE-2024-42304-460f5cd7"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1090.0,
"function_hash": "80643326921993999107620513533109200368"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_get_first_dir_block"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6",
"signature_version": "v1",
"id": "CVE-2024-42304-5201a075"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2094.0,
"function_hash": "172941389722341911573863161181035779394"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "__ext4_read_dirblock"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3893d9de8ee153baac56d127d844103488133b5",
"signature_version": "v1",
"id": "CVE-2024-42304-5852e333"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1090.0,
"function_hash": "80643326921993999107620513533109200368"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_get_first_dir_block"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de2a011a13a46468a6e8259db58b1b62071fe136",
"signature_version": "v1",
"id": "CVE-2024-42304-5cf9df3e"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1750.0,
"function_hash": "337601929133363230298088705060941761171"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_empty_dir"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@299bc6ffa57e04e74c6cce866d6c0741fb4897a1",
"signature_version": "v1",
"id": "CVE-2024-42304-5f6fd8f1"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1750.0,
"function_hash": "337601929133363230298088705060941761171"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_empty_dir"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3893d9de8ee153baac56d127d844103488133b5",
"signature_version": "v1",
"id": "CVE-2024-42304-689c2eae"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1090.0,
"function_hash": "80643326921993999107620513533109200368"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_get_first_dir_block"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b609753cbbd38f8c0affd4956c0af178348523ac",
"signature_version": "v1",
"id": "CVE-2024-42304-69b440de"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1736.0,
"function_hash": "243564504159328629566460644572613592817"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_empty_dir"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de2a011a13a46468a6e8259db58b1b62071fe136",
"signature_version": "v1",
"id": "CVE-2024-42304-75ae2bed"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
],
"threshold": 0.9
},
"target": {
"file": "fs/ext4/namei.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9771e3d8365ae1dd5e8846a204cb9af14e3e656a",
"signature_version": "v1",
"id": "CVE-2024-42304-7a1b5226"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2094.0,
"function_hash": "172941389722341911573863161181035779394"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "__ext4_read_dirblock"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b609753cbbd38f8c0affd4956c0af178348523ac",
"signature_version": "v1",
"id": "CVE-2024-42304-7b1aa09e"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1090.0,
"function_hash": "80643326921993999107620513533109200368"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_get_first_dir_block"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@299bc6ffa57e04e74c6cce866d6c0741fb4897a1",
"signature_version": "v1",
"id": "CVE-2024-42304-7b624f77"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1090.0,
"function_hash": "80643326921993999107620513533109200368"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_get_first_dir_block"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3893d9de8ee153baac56d127d844103488133b5",
"signature_version": "v1",
"id": "CVE-2024-42304-7ba12e2a"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1750.0,
"function_hash": "337601929133363230298088705060941761171"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_empty_dir"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b609753cbbd38f8c0affd4956c0af178348523ac",
"signature_version": "v1",
"id": "CVE-2024-42304-86549a88"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
],
"threshold": 0.9
},
"target": {
"file": "fs/ext4/namei.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b609753cbbd38f8c0affd4956c0af178348523ac",
"signature_version": "v1",
"id": "CVE-2024-42304-867e3858"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2094.0,
"function_hash": "172941389722341911573863161181035779394"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "__ext4_read_dirblock"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6",
"signature_version": "v1",
"id": "CVE-2024-42304-9a75d275"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1631.0,
"function_hash": "203425469627959404406136961159845493137"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "__ext4_read_dirblock"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e02f9941e8c011aa3eafa799def6a134ce06bcfa",
"signature_version": "v1",
"id": "CVE-2024-42304-bd14488d"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
],
"threshold": 0.9
},
"target": {
"file": "fs/ext4/namei.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de2a011a13a46468a6e8259db58b1b62071fe136",
"signature_version": "v1",
"id": "CVE-2024-42304-d084ddff"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1750.0,
"function_hash": "337601929133363230298088705060941761171"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_empty_dir"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9771e3d8365ae1dd5e8846a204cb9af14e3e656a",
"signature_version": "v1",
"id": "CVE-2024-42304-dbe7f66f"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1090.0,
"function_hash": "80643326921993999107620513533109200368"
},
"target": {
"file": "fs/ext4/namei.c",
"function": "ext4_get_first_dir_block"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9771e3d8365ae1dd5e8846a204cb9af14e3e656a",
"signature_version": "v1",
"id": "CVE-2024-42304-e4ebd1ef"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"85605693276652023722823431200369836454",
"322543400432993203806823156112781068505",
"297136749633081540618358103528312495702",
"95549527241950214271222933539761821818",
"277114711086539926736955122995256141192",
"145485618788492964967032273638513735797",
"228621035386416691129677375970451835120",
"290812199492758933001774364217842879415",
"191120686816515502287022050269431874133",
"332653171744896150061892494541826807870",
"308392291451931225407047341250003739466",
"315284136377050942811777384022281234463",
"972702329971327336428392021262634770",
"322139313063198612736355599870303123672",
"97659960619592316508050657947487741718"
],
"threshold": 0.9
},
"target": {
"file": "fs/ext4/namei.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6",
"signature_version": "v1",
"id": "CVE-2024-42304-e877111e"
}
]