In the Linux kernel, the following vulnerability has been resolved:
xen/privcmd: fix error exit of privcmdioctldm_op()
The error exit of privcmdioctldmop() is calling unlockpages() potentially with pages being NULL, leading to a NULL dereference.
Additionally lockpages() doesn't check for pinuserpagesfast() having been completely successful, resulting in potentially not locking all pages into memory. This could result in sporadic failures when using the related memory in user mode.
Fix all of that by calling unlockpages() always with the real number of pinned pages, which will be zero in case pages being NULL, and by checking the number of pages pinned by pinuserpagesfast() matching the expected number of pages.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49989.json",
"cna_assigner": "Linux"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49989.json"
[
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"124219184320335868492106193705654907423",
"86616328718695294127088720710729372894",
"199050597770417579759708369589948317358",
"96872663514159912348215163345122068685",
"250346915229462893576958587217757966809",
"314212311941420585756417241677357629917",
"199403900277689934564137307149091289790",
"171243905703065650726999866855984684396",
"260405677480665844182164431516418382321",
"96666866104810898402133514766491063385",
"719415964058468685495457166654857802",
"34258615317066712667326045493734124334",
"163486661998124460142619910003518650083",
"329350155617017647151245273663631221277",
"171892238747168945976901795706195474120",
"95264490522630323701490135540341162692",
"211066010371913142658920843627462214451",
"203952150055158970665949071608480755924",
"135841122483002875454004636581879125882",
"300528135921078914758122367612436149860",
"54015797707770309232124284627597881682",
"246264742847067374550129078517540061489",
"227557444173665257934829783103767187313",
"152025252046966090500911879199925136948",
"227883933218782987799618905788543430318",
"5516099520989598772374287891853114499",
"261893688980240917149425194841610880518",
"278942471768289666254685364929267027870",
"132739726551785449939777886419083141836",
"283784150221422450274881406881879366716",
"122883377883925762132148122859311322304"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@45d47bd9b96e7874b98dbcc7602fe2826c5d62a6",
"signature_type": "Line",
"id": "CVE-2022-49989-08126029",
"target": {
"file": "drivers/xen/privcmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "203889345218828933799892624151816353419",
"length": 534.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c5deb27895e017a0267de0a20d140ad5fcc55a54",
"signature_type": "Function",
"id": "CVE-2022-49989-19ffb2a0",
"target": {
"file": "drivers/xen/privcmd.c",
"function": "lock_pages"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "203889345218828933799892624151816353419",
"length": 534.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2b7bae7c90051fd6a679d5dee00400d67ebbf4a",
"signature_type": "Function",
"id": "CVE-2022-49989-2ca175df",
"target": {
"file": "drivers/xen/privcmd.c",
"function": "lock_pages"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "232100834365879614774256656636503822180",
"length": 1632.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@45d47bd9b96e7874b98dbcc7602fe2826c5d62a6",
"signature_type": "Function",
"id": "CVE-2022-49989-3ffbd47f",
"target": {
"file": "drivers/xen/privcmd.c",
"function": "privcmd_ioctl_dm_op"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "232100834365879614774256656636503822180",
"length": 1632.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2b7bae7c90051fd6a679d5dee00400d67ebbf4a",
"signature_type": "Function",
"id": "CVE-2022-49989-44cfd373",
"target": {
"file": "drivers/xen/privcmd.c",
"function": "privcmd_ioctl_dm_op"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"124219184320335868492106193705654907423",
"86616328718695294127088720710729372894",
"199050597770417579759708369589948317358",
"96872663514159912348215163345122068685",
"250346915229462893576958587217757966809",
"314212311941420585756417241677357629917",
"199403900277689934564137307149091289790",
"171243905703065650726999866855984684396",
"260405677480665844182164431516418382321",
"96666866104810898402133514766491063385",
"719415964058468685495457166654857802",
"34258615317066712667326045493734124334",
"163486661998124460142619910003518650083",
"329350155617017647151245273663631221277",
"171892238747168945976901795706195474120",
"95264490522630323701490135540341162692",
"211066010371913142658920843627462214451",
"203952150055158970665949071608480755924",
"135841122483002875454004636581879125882",
"300528135921078914758122367612436149860",
"54015797707770309232124284627597881682",
"246264742847067374550129078517540061489",
"227557444173665257934829783103767187313",
"152025252046966090500911879199925136948",
"227883933218782987799618905788543430318",
"5516099520989598772374287891853114499",
"261893688980240917149425194841610880518",
"278942471768289666254685364929267027870",
"132739726551785449939777886419083141836",
"283784150221422450274881406881879366716",
"122883377883925762132148122859311322304"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6de50db104af0dc921f593fd95c55db86a52ceef",
"signature_type": "Line",
"id": "CVE-2022-49989-537b8066",
"target": {
"file": "drivers/xen/privcmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"124219184320335868492106193705654907423",
"86616328718695294127088720710729372894",
"199050597770417579759708369589948317358",
"96872663514159912348215163345122068685",
"250346915229462893576958587217757966809",
"314212311941420585756417241677357629917",
"199403900277689934564137307149091289790",
"171243905703065650726999866855984684396",
"260405677480665844182164431516418382321",
"96666866104810898402133514766491063385",
"719415964058468685495457166654857802",
"34258615317066712667326045493734124334",
"163486661998124460142619910003518650083",
"329350155617017647151245273663631221277",
"171892238747168945976901795706195474120",
"95264490522630323701490135540341162692",
"211066010371913142658920843627462214451",
"203952150055158970665949071608480755924",
"135841122483002875454004636581879125882",
"300528135921078914758122367612436149860",
"54015797707770309232124284627597881682",
"246264742847067374550129078517540061489",
"227557444173665257934829783103767187313",
"152025252046966090500911879199925136948",
"227883933218782987799618905788543430318",
"5516099520989598772374287891853114499",
"261893688980240917149425194841610880518",
"278942471768289666254685364929267027870",
"132739726551785449939777886419083141836",
"283784150221422450274881406881879366716",
"122883377883925762132148122859311322304"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2b7bae7c90051fd6a679d5dee00400d67ebbf4a",
"signature_type": "Line",
"id": "CVE-2022-49989-59be2362",
"target": {
"file": "drivers/xen/privcmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "232100834365879614774256656636503822180",
"length": 1632.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c5deb27895e017a0267de0a20d140ad5fcc55a54",
"signature_type": "Function",
"id": "CVE-2022-49989-5b267f2f",
"target": {
"file": "drivers/xen/privcmd.c",
"function": "privcmd_ioctl_dm_op"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "232100834365879614774256656636503822180",
"length": 1632.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6de50db104af0dc921f593fd95c55db86a52ceef",
"signature_type": "Function",
"id": "CVE-2022-49989-a08e9a38",
"target": {
"file": "drivers/xen/privcmd.c",
"function": "privcmd_ioctl_dm_op"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "203889345218828933799892624151816353419",
"length": 534.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6de50db104af0dc921f593fd95c55db86a52ceef",
"signature_type": "Function",
"id": "CVE-2022-49989-bf0316ee",
"target": {
"file": "drivers/xen/privcmd.c",
"function": "lock_pages"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "203889345218828933799892624151816353419",
"length": 534.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@45d47bd9b96e7874b98dbcc7602fe2826c5d62a6",
"signature_type": "Function",
"id": "CVE-2022-49989-e0ff1547",
"target": {
"file": "drivers/xen/privcmd.c",
"function": "lock_pages"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"124219184320335868492106193705654907423",
"86616328718695294127088720710729372894",
"199050597770417579759708369589948317358",
"96872663514159912348215163345122068685",
"250346915229462893576958587217757966809",
"314212311941420585756417241677357629917",
"199403900277689934564137307149091289790",
"171243905703065650726999866855984684396",
"260405677480665844182164431516418382321",
"96666866104810898402133514766491063385",
"719415964058468685495457166654857802",
"34258615317066712667326045493734124334",
"163486661998124460142619910003518650083",
"329350155617017647151245273663631221277",
"171892238747168945976901795706195474120",
"95264490522630323701490135540341162692",
"211066010371913142658920843627462214451",
"203952150055158970665949071608480755924",
"135841122483002875454004636581879125882",
"300528135921078914758122367612436149860",
"54015797707770309232124284627597881682",
"246264742847067374550129078517540061489",
"227557444173665257934829783103767187313",
"152025252046966090500911879199925136948",
"227883933218782987799618905788543430318",
"5516099520989598772374287891853114499",
"261893688980240917149425194841610880518",
"278942471768289666254685364929267027870",
"132739726551785449939777886419083141836",
"283784150221422450274881406881879366716",
"122883377883925762132148122859311322304"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c5deb27895e017a0267de0a20d140ad5fcc55a54",
"signature_type": "Line",
"id": "CVE-2022-49989-f4e30e84",
"target": {
"file": "drivers/xen/privcmd.c"
}
}
]