In the Linux kernel, the following vulnerability has been resolved:
ext4: fix off-by-one errors in fast-commit block filling
Due to several different off-by-one errors, or perhaps due to a late change in design that wasn't fully reflected in the code that was actually merged, there are several very strange constraints on how fast-commit blocks are filled with tlv entries:
tlvs must start at least 10 bytes before the end of the block, even though the minimum tlv length is 8. Otherwise, the replay code will ignore them. (BUG: ext4fcreserve_space() could violate this requirement if called with a len of blocksize - 9 or blocksize - 8. Fortunately, this doesn't seem to happen currently.)
tlvs must end at least 1 byte before the end of the block. Otherwise the replay code will consider them to be invalid. This quirk contributed to a bug (fixed by an earlier commit) where uninitialized memory was being leaked to disk in the last byte of blocks.
Also, strangely these constraints don't apply to the replay code in e2fsprogs, which will accept any tlvs in the blocks (with no bounds checks at all, but that is a separate issue...).
Given that this all seems to be a bug, let's fix it by just filling blocks with tlv entries in the natural way.
Note that old kernels will be unable to replay fast-commit journals created by kernels that have this commit.
{ "vanir_signatures": [ { "digest": { "length": 1003.0, "function_hash": "117746750993442721646635292715813389808" }, "target": { "function": "ext4_fc_write_tail", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48a6a66db82b8043d298a630f22c62d43550cae5", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-05b24dcd" }, { "digest": { "length": 2289.0, "function_hash": "181255336090322548586293956105869756867" }, "target": { "function": "ext4_fc_replay", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@18f28f13301d1afb8cea9c4ddcecdbff14488ec6", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-17caeb05" }, { "digest": { "length": 2289.0, "function_hash": "181255336090322548586293956105869756867" }, "target": { "function": "ext4_fc_replay", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48a6a66db82b8043d298a630f22c62d43550cae5", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-195c165b" }, { "digest": { "length": 2986.0, "function_hash": "127713646302779651023270602149352257496" }, "target": { "function": "ext4_fc_replay_scan", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48a6a66db82b8043d298a630f22c62d43550cae5", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-45730616" }, { "digest": { "length": 1155.0, "function_hash": "138285880662812188582529250790512590726" }, "target": { "function": "ext4_fc_reserve_space", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48a6a66db82b8043d298a630f22c62d43550cae5", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-5c31ca84" }, { "digest": { "line_hashes": [ "57913064040189604851186997198417927384", "147684294991280272285392598299158097354", "121042513967871769560141572160272782142", "39405056680309875147580875059377426098", "75162131264610619452149901072448616904", "307090752463470063571130242886617278286", "256926679238319145099663216659239762450", "218664400899002516053933202851008641117", "306047037800249725789803418651348781068", "233546475773107816520993775374611089218", "232985667358124115141701616122772121446", "281891856641883825014206597722837461778", "241172119505118453088090490763953144309", "314634935089757905557736750352897414923", "174334288352519834351287998337167970712", "204931519631890393349517331071663367787", "136041469467367413608416466743237040539", "176115790316985769999544493560915308658", "317012272493597465519601811931416879941", "283322529689820310045844178543304958514", "176642928307280673346431044854983460664", "96799698886928391958074569447371518473", "140708658909891789018495758225340061824", "93619623626801665057505828913802607844", "118535346383551453171822752011258222760", "118955059529737364265994755228725600517", "184883574195372254069363351749483285512", "136905134009021091892315885160201770133", "170282348352342106010351766745771572193", "42619167619338636106313116388208601694", "88776062436640856801085716394102710810", "11646908885548619821038947537548477226", "253163982723473689557424852970167498316", "240209513113200639415338542163788707180", "76779867793988114362050665261147830307", "75805207840860755248794204665897159041", "323801993133507556158163631180017158639", "180520595739508462429146688203406495765", "139398848104803163983516629271217750313", "39793190184318725394441938541142200861", "264612698971061869166038040148966830657", "325818406574316873851193271338016402865", "212795020884094104908651955763067224109", "164591102605564968139349625148450364368", "182927885780020340211908947550923384842", "226834917371934420692571575643867014149", "54068870946149220870567606120222027506", "66526768389816011641965164817029284744", "164591102605564968139349625148450364368" ], "threshold": 0.9 }, "target": { "file": "fs/ext4/fast_commit.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5ca65dffdead16572ca046c43fb576b227f7f635", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-67d187ee" }, { "digest": { "length": 1155.0, "function_hash": "138285880662812188582529250790512590726" }, "target": { "function": "ext4_fc_reserve_space", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@18f28f13301d1afb8cea9c4ddcecdbff14488ec6", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-72be0c34" }, { "digest": { "length": 2986.0, "function_hash": "127713646302779651023270602149352257496" }, "target": { "function": "ext4_fc_replay_scan", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5ca65dffdead16572ca046c43fb576b227f7f635", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-836db3e9" }, { "digest": { "length": 2986.0, "function_hash": "127713646302779651023270602149352257496" }, "target": { "function": "ext4_fc_replay_scan", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@18f28f13301d1afb8cea9c4ddcecdbff14488ec6", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-98c92571" }, { "digest": { "length": 1003.0, "function_hash": "117746750993442721646635292715813389808" }, "target": { "function": "ext4_fc_write_tail", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@18f28f13301d1afb8cea9c4ddcecdbff14488ec6", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-9a783758" }, { "digest": { "length": 1003.0, "function_hash": "117746750993442721646635292715813389808" }, "target": { "function": "ext4_fc_write_tail", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5ca65dffdead16572ca046c43fb576b227f7f635", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-b0c59d2f" }, { "digest": { "length": 1155.0, "function_hash": "138285880662812188582529250790512590726" }, "target": { "function": "ext4_fc_reserve_space", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5ca65dffdead16572ca046c43fb576b227f7f635", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-b5cc32f8" }, { "digest": { "line_hashes": [ "57913064040189604851186997198417927384", "147684294991280272285392598299158097354", "121042513967871769560141572160272782142", "39405056680309875147580875059377426098", "75162131264610619452149901072448616904", "307090752463470063571130242886617278286", "256926679238319145099663216659239762450", "218664400899002516053933202851008641117", "306047037800249725789803418651348781068", "233546475773107816520993775374611089218", "232985667358124115141701616122772121446", "281891856641883825014206597722837461778", "241172119505118453088090490763953144309", "314634935089757905557736750352897414923", "174334288352519834351287998337167970712", "204931519631890393349517331071663367787", "136041469467367413608416466743237040539", "176115790316985769999544493560915308658", "317012272493597465519601811931416879941", "283322529689820310045844178543304958514", "176642928307280673346431044854983460664", "96799698886928391958074569447371518473", "140708658909891789018495758225340061824", "93619623626801665057505828913802607844", "118535346383551453171822752011258222760", "118955059529737364265994755228725600517", "184883574195372254069363351749483285512", "136905134009021091892315885160201770133", "170282348352342106010351766745771572193", "42619167619338636106313116388208601694", "88776062436640856801085716394102710810", "11646908885548619821038947537548477226", "253163982723473689557424852970167498316", "240209513113200639415338542163788707180", "76779867793988114362050665261147830307", "75805207840860755248794204665897159041", "323801993133507556158163631180017158639", "180520595739508462429146688203406495765", "139398848104803163983516629271217750313", "39793190184318725394441938541142200861", "264612698971061869166038040148966830657", "325818406574316873851193271338016402865", "212795020884094104908651955763067224109", "164591102605564968139349625148450364368", "182927885780020340211908947550923384842", "226834917371934420692571575643867014149", "54068870946149220870567606120222027506", "66526768389816011641965164817029284744", "164591102605564968139349625148450364368" ], "threshold": 0.9 }, "target": { "file": "fs/ext4/fast_commit.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48a6a66db82b8043d298a630f22c62d43550cae5", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-c91e7d4c" }, { "digest": { "line_hashes": [ "57913064040189604851186997198417927384", "147684294991280272285392598299158097354", "121042513967871769560141572160272782142", "39405056680309875147580875059377426098", "75162131264610619452149901072448616904", "307090752463470063571130242886617278286", "256926679238319145099663216659239762450", "218664400899002516053933202851008641117", "306047037800249725789803418651348781068", "233546475773107816520993775374611089218", "232985667358124115141701616122772121446", "281891856641883825014206597722837461778", "241172119505118453088090490763953144309", "314634935089757905557736750352897414923", "174334288352519834351287998337167970712", "204931519631890393349517331071663367787", "136041469467367413608416466743237040539", "176115790316985769999544493560915308658", "317012272493597465519601811931416879941", "283322529689820310045844178543304958514", "176642928307280673346431044854983460664", "96799698886928391958074569447371518473", "140708658909891789018495758225340061824", "93619623626801665057505828913802607844", "118535346383551453171822752011258222760", "118955059529737364265994755228725600517", "184883574195372254069363351749483285512", "136905134009021091892315885160201770133", "170282348352342106010351766745771572193", "42619167619338636106313116388208601694", "88776062436640856801085716394102710810", "11646908885548619821038947537548477226", "253163982723473689557424852970167498316", "240209513113200639415338542163788707180", "76779867793988114362050665261147830307", "75805207840860755248794204665897159041", "323801993133507556158163631180017158639", "180520595739508462429146688203406495765", "139398848104803163983516629271217750313", "39793190184318725394441938541142200861", "264612698971061869166038040148966830657", "325818406574316873851193271338016402865", "212795020884094104908651955763067224109", "164591102605564968139349625148450364368", "182927885780020340211908947550923384842", "226834917371934420692571575643867014149", "54068870946149220870567606120222027506", "66526768389816011641965164817029284744", "164591102605564968139349625148450364368" ], "threshold": 0.9 }, "target": { "file": "fs/ext4/fast_commit.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@18f28f13301d1afb8cea9c4ddcecdbff14488ec6", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-e2436bcd" }, { "digest": { "length": 2289.0, "function_hash": "181255336090322548586293956105869756867" }, "target": { "function": "ext4_fc_replay", "file": "fs/ext4/fast_commit.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5ca65dffdead16572ca046c43fb576b227f7f635", "deprecated": false, "signature_version": "v1", "id": "CVE-2022-50428-ef3751fa" } ] }