In the Linux kernel, the following vulnerability has been resolved:
iommufd: Fix protection fault in iommufdtestsyzconviova
Syzkaller reported the following bug:
general protection fault, probably for non-canonical address 0xdffffc0000000038: 0000 [#1] SMP KASAN KASAN: null-ptr-deref in range [0x00000000000001c0-0x00000000000001c7] Call Trace: lockacquire lockacquire+0x1ce/0x4f0 downread+0x93/0x4a0 iommufdtestsyzconviova+0x56/0x1f0 iommufdtestaccessrw.isra.0+0x2ec/0x390 iommufdtest+0x1058/0x1e30 iommufdfopsioctl+0x381/0x510 vfsioctl _dosysioctl _sesysioctl _x64sysioctl+0x170/0x1e0 dosyscallx64 dosyscall_64+0x71/0x140
This is because the new iommufdaccesschange_ioas() sets access->ioas to NULL during its process, so the lock might be gone in a concurrent racing context.
Fix this by doing the same access->ioas sanity as iommufdaccessrw() and iommufdaccesspin_pages() functions do.
[
{
"id": "CVE-2024-26785-19adca1d",
"target": {
"file": "drivers/iommu/iommufd/selftest.c",
"function": "iommufd_test_access_rw"
},
"digest": {
"length": 1083.0,
"function_hash": "248854644103100090693516714513536577103"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fc719ecbca45c9c046640d72baddba3d83e0bc0b",
"signature_version": "v1"
},
{
"id": "CVE-2024-26785-6359b458",
"target": {
"file": "drivers/iommu/iommufd/selftest.c",
"function": "iommufd_test_access_pages"
},
"digest": {
"length": 1794.0,
"function_hash": "126873958058199626155082142599009442715"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cf7c2789822db8b5efa34f5ebcf1621bc0008d48",
"signature_version": "v1"
},
{
"id": "CVE-2024-26785-9c178952",
"target": {
"file": "drivers/iommu/iommufd/selftest.c",
"function": "iommufd_test_access_rw"
},
"digest": {
"length": 1083.0,
"function_hash": "248854644103100090693516714513536577103"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cf7c2789822db8b5efa34f5ebcf1621bc0008d48",
"signature_version": "v1"
},
{
"id": "CVE-2024-26785-dc34bbf6",
"target": {
"file": "drivers/iommu/iommufd/selftest.c",
"function": "iommufd_test_access_pages"
},
"digest": {
"length": 1794.0,
"function_hash": "126873958058199626155082142599009442715"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fc719ecbca45c9c046640d72baddba3d83e0bc0b",
"signature_version": "v1"
},
{
"id": "CVE-2024-26785-e0e1400e",
"target": {
"file": "drivers/iommu/iommufd/selftest.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"217894223453245544759735507713874591989",
"191798386565841353515903703180200163753",
"35281551687931064226362216513748017585",
"292819067564478494808887867681717302554",
"176704053273436052764576504083936532067",
"155397216251588208193060338843964609698",
"313415571512576482711564220041936210353",
"215203581023419266107091083826769533074",
"251205288549217504186441528637931596094",
"304072395486281866954322381786526317850",
"317200680528728597378459079534482556552",
"330736731523893493013130435801216311154",
"290509034002583076749754874444192053233",
"51522439852416065220355967063869422166",
"135079778916983389724061008369954905950",
"287789835687853623979368679429222487037",
"148048508668845948136130750451806922296",
"329728131453576127751923359505190049201",
"62238947410445072885894092637613990039",
"174405657453722159692216417186015765990",
"239515543257102670514444092557677216487"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fc719ecbca45c9c046640d72baddba3d83e0bc0b",
"signature_version": "v1"
},
{
"id": "CVE-2024-26785-e6c7d099",
"target": {
"file": "drivers/iommu/iommufd/selftest.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"222251624975466905707577170343441565220",
"58396642170681062503897464319707667527",
"35281551687931064226362216513748017585",
"292819067564478494808887867681717302554",
"176704053273436052764576504083936532067",
"155397216251588208193060338843964609698",
"313415571512576482711564220041936210353",
"215203581023419266107091083826769533074",
"251205288549217504186441528637931596094",
"304072395486281866954322381786526317850",
"317200680528728597378459079534482556552",
"330736731523893493013130435801216311154",
"290509034002583076749754874444192053233",
"51522439852416065220355967063869422166",
"135079778916983389724061008369954905950",
"287789835687853623979368679429222487037",
"148048508668845948136130750451806922296",
"329728131453576127751923359505190049201",
"62238947410445072885894092637613990039",
"174405657453722159692216417186015765990",
"239515543257102670514444092557677216487"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cf7c2789822db8b5efa34f5ebcf1621bc0008d48",
"signature_version": "v1"
}
]