In the Linux kernel, the following vulnerability has been resolved:
ext4: fix memory leak in parseapplysbmountoptions()
If processing the on-disk mount options fails after any memory was allocated in the ext4fscontext, e.g. sqfnames, then this memory is leaked. Fix this by calling ext4fcfree() instead of kfree() directly.
Reproducer:
mkfs.ext4 -F /dev/vdc
tune2fs /dev/vdc -E mount_opts=usrjquota=file
echo clear > /sys/kernel/debug/kmemleak
mount /dev/vdc /vdc
echo scan > /sys/kernel/debug/kmemleak
sleep 5
echo scan > /sys/kernel/debug/kmemleak
cat /sys/kernel/debug/kmemleak
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea3e6168948189cec31d0678d2b55b395f88491",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/ext4/super.c"
},
"id": "CVE-2022-49408-24731b9c",
"digest": {
"threshold": 0.9,
"line_hashes": [
"57102572846769867866512135050919045542",
"106504174886776424777342409524642565114",
"81777403497798589507710733287610620303",
"317915913232306288146733849513047254394",
"17370861955863222839220004577492702"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c069db76ed7b681c69159f44be96d2137e9ca989",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "parse_apply_sb_mount_options",
"file": "fs/ext4/super.c"
},
"id": "CVE-2022-49408-3dbc5443",
"digest": {
"length": 1097.0,
"function_hash": "43177506460864136440593897145850863018"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c069db76ed7b681c69159f44be96d2137e9ca989",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/ext4/super.c"
},
"id": "CVE-2022-49408-43803408",
"digest": {
"threshold": 0.9,
"line_hashes": [
"57102572846769867866512135050919045542",
"106504174886776424777342409524642565114",
"81777403497798589507710733287610620303",
"317915913232306288146733849513047254394",
"17370861955863222839220004577492702"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f92ded66e9d0aa20b883a2a5183973abc8f41815",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "parse_apply_sb_mount_options",
"file": "fs/ext4/super.c"
},
"id": "CVE-2022-49408-7363d20f",
"digest": {
"length": 1097.0,
"function_hash": "43177506460864136440593897145850863018"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea3e6168948189cec31d0678d2b55b395f88491",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "parse_apply_sb_mount_options",
"file": "fs/ext4/super.c"
},
"id": "CVE-2022-49408-df2d5efc",
"digest": {
"length": 1097.0,
"function_hash": "43177506460864136440593897145850863018"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f92ded66e9d0aa20b883a2a5183973abc8f41815",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/ext4/super.c"
},
"id": "CVE-2022-49408-e1f6aec2",
"digest": {
"threshold": 0.9,
"line_hashes": [
"57102572846769867866512135050919045542",
"106504174886776424777342409524642565114",
"81777403497798589507710733287610620303",
"317915913232306288146733849513047254394",
"17370861955863222839220004577492702"
]
},
"signature_type": "Line"
}
]