In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to truncate preallocated blocks in f2fsfileopen()
chenyuwen reports a f2fs bug as below:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000011 fscryptsetbiocryptctx+0x78/0x1e8 f2fsgrabreadbio+0x78/0x208 f2fssubmitpageread+0x44/0x154 f2fsgetreaddatapage+0x288/0x5f4 f2fsgetlockdatapage+0x60/0x190 truncatepartialdatapage+0x108/0x4fc f2fsdotruncateblocks+0x344/0x5f0 f2fstruncateblocks+0x6c/0x134 f2fstruncate+0xd8/0x200 f2fsiget+0x20c/0x5ac dogarbagecollect+0x5d0/0xf6c f2fsgc+0x22c/0x6a4 f2fsdisablecheckpoint+0xc8/0x310 f2fsfillsuper+0x14bc/0x1764 mountbdev+0x1b4/0x21c f2fsmount+0x20/0x30 legacygettree+0x50/0xbc vfsgettree+0x5c/0x1b0 donewmount+0x298/0x4cc pathmount+0x33c/0x5fc _arm64sysmount+0xcc/0x15c invokesyscall+0x60/0x150 el0svccommon+0xb8/0xf8 doel0svc+0x28/0xa0 el0svc+0x24/0x84 el0t64synchandler+0x88/0xec
It is because inode.icryptinfo is not initialized during below path: - mount - f2fsfillsuper - f2fsdisablecheckpoint - f2fsgc - f2fsiget - f2fs_truncate
So, let's relocate truncation of preallocated blocks to f2fsfileopen(), after fscryptfileopen().
[
{
"deprecated": false,
"target": {
"file": "fs/f2fs/file.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"23170238215032593420932647739303426607",
"104286493744130460461770866215635433238",
"14768538786961837083284470283384053177",
"155626095316623729854277984127191963893",
"188505554921482938473763640667635610864",
"87210539437075414844905275182788599648",
"328808411799508043658919044418356054485"
]
},
"id": "CVE-2024-43859-0fe1e4ea",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5f04969136db674f133781626e0b692c5f2bf2f0",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/f2fs.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"136581241695456742550313104056005508685",
"63839072167231304952524581561044572382",
"11655426181376017755294908718726726505",
"211813643609798201442580818467447778455"
]
},
"id": "CVE-2024-43859-4822c120",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3ba0ae885215b325605ff7ebf6de12ac2adf204d",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/inode.c",
"function": "f2fs_iget"
},
"digest": {
"length": 2390.0,
"function_hash": "306728121416371728280643230837779841984"
},
"id": "CVE-2024-43859-4ad64988",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5f04969136db674f133781626e0b692c5f2bf2f0",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/file.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"23170238215032593420932647739303426607",
"104286493744130460461770866215635433238",
"14768538786961837083284470283384053177",
"128538115323452052502858871493986128019",
"291096040478833485428315762602037055181",
"176469166589536786219974708617595778043",
"328808411799508043658919044418356054485"
]
},
"id": "CVE-2024-43859-5f432957",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3ba0ae885215b325605ff7ebf6de12ac2adf204d",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/f2fs.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"136581241695456742550313104056005508685",
"63839072167231304952524581561044572382",
"11655426181376017755294908718726726505",
"211813643609798201442580818467447778455"
]
},
"id": "CVE-2024-43859-86717490",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@298b1e4182d657c3e388adcc29477904e9600ed5",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/file.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"23170238215032593420932647739303426607",
"104286493744130460461770866215635433238",
"14768538786961837083284470283384053177",
"128538115323452052502858871493986128019",
"291096040478833485428315762602037055181",
"176469166589536786219974708617595778043",
"328808411799508043658919044418356054485"
]
},
"id": "CVE-2024-43859-a29c91a9",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@298b1e4182d657c3e388adcc29477904e9600ed5",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/file.c",
"function": "f2fs_file_open"
},
"digest": {
"length": 342.0,
"function_hash": "157848880921844672924250492066587561753"
},
"id": "CVE-2024-43859-a7e90277",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3ba0ae885215b325605ff7ebf6de12ac2adf204d",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/file.c",
"function": "f2fs_file_open"
},
"digest": {
"length": 342.0,
"function_hash": "157848880921844672924250492066587561753"
},
"id": "CVE-2024-43859-a7f3374c",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@298b1e4182d657c3e388adcc29477904e9600ed5",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/inode.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"147926421930721771642743070123175221986",
"218584981728401939070785982489689722781",
"113171579419786327068422522648018983565",
"138297247562822657261859396136695702543",
"10466808574377943911982949875081138948",
"190643170371412240875424303942474433535",
"46022791077735883892289583902440472630",
"189127343746762559495272931730544620480",
"229785097017256945775018683694964771452",
"84277638972812259697503588322641987386"
]
},
"id": "CVE-2024-43859-b2e78e0f",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3ba0ae885215b325605ff7ebf6de12ac2adf204d",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/f2fs.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"293686211725540094652741855454042530536",
"130165711133501496962704372535218179724",
"151963881085949898884297084843173595441",
"35132022805531075780290421355632240805"
]
},
"id": "CVE-2024-43859-c35dae7f",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5f04969136db674f133781626e0b692c5f2bf2f0",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/file.c",
"function": "f2fs_file_open"
},
"digest": {
"length": 303.0,
"function_hash": "32556319203125130624269410623423947212"
},
"id": "CVE-2024-43859-c9336153",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5f04969136db674f133781626e0b692c5f2bf2f0",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/inode.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"147926421930721771642743070123175221986",
"218584981728401939070785982489689722781",
"113171579419786327068422522648018983565",
"138297247562822657261859396136695702543",
"10466808574377943911982949875081138948",
"190643170371412240875424303942474433535",
"46022791077735883892289583902440472630",
"189127343746762559495272931730544620480",
"229785097017256945775018683694964771452",
"84277638972812259697503588322641987386"
]
},
"id": "CVE-2024-43859-d83fc392",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@298b1e4182d657c3e388adcc29477904e9600ed5",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/inode.c",
"function": "f2fs_iget"
},
"digest": {
"length": 2390.0,
"function_hash": "306728121416371728280643230837779841984"
},
"id": "CVE-2024-43859-e6110d64",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3ba0ae885215b325605ff7ebf6de12ac2adf204d",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/inode.c",
"function": "f2fs_iget"
},
"digest": {
"length": 2390.0,
"function_hash": "306728121416371728280643230837779841984"
},
"id": "CVE-2024-43859-f1a28dc8",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@298b1e4182d657c3e388adcc29477904e9600ed5",
"signature_version": "v1"
},
{
"deprecated": false,
"target": {
"file": "fs/f2fs/inode.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"147926421930721771642743070123175221986",
"218584981728401939070785982489689722781",
"113171579419786327068422522648018983565",
"138297247562822657261859396136695702543",
"10466808574377943911982949875081138948",
"190643170371412240875424303942474433535",
"46022791077735883892289583902440472630",
"189127343746762559495272931730544620480",
"229785097017256945775018683694964771452",
"84277638972812259697503588322641987386"
]
},
"id": "CVE-2024-43859-fc2801ec",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5f04969136db674f133781626e0b692c5f2bf2f0",
"signature_version": "v1"
}
]