In the Linux kernel, the following vulnerability has been resolved:
nouveau/firmware: use dma non-coherent allocator
Currently, enabling SG_DEBUG in the kernel will cause nouveau to hit a BUG() on startup, when the iommu is enabled:
kernel BUG at include/linux/scatterlist.h:187! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 7 PID: 930 Comm: (udev-worker) Not tainted 6.9.0-rc3Lyude-Test+ #30 Hardware name: MSI MS-7A39/A320M GAMING PRO (MS-7A39), BIOS 1.I0 01/22/2019 RIP: 0010:sginitone+0x85/0xa0 Code: 69 88 32 01 83 e1 03 f6 c3 03 75 20 a8 01 75 1e 48 09 cb 41 89 54 24 08 49 89 1c 24 41 89 6c 24 0c 5b 5d 41 5c e9 7b b9 88 00 <0f> 0b 0f 0b 0f 0b 48 8b 05 5e 46 9a 01 eb b2 66 66 2e 0f 1f 84 00 RSP: 0018:ffffa776017bf6a0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffffa77600d87000 RCX: 000000000000002b RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffffa77680d87000 RBP: 000000000000e000 R08: 0000000000000000 R09: 0000000000000000 R10: ffff98f4c46aa508 R11: 0000000000000000 R12: ffff98f4c46aa508 R13: ffff98f4c46aa008 R14: ffffa77600d4a000 R15: ffffa77600d4a018 FS: 00007feeb5aae980(0000) GS:ffff98f5c4dc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f22cb9a4520 CR3: 00000001043ba000 CR4: 00000000003506f0 Call Trace: <TASK> ? die+0x36/0x90 ? dotrap+0xdd/0x100 ? sginitone+0x85/0xa0 ? doerrortrap+0x65/0x80 ? sginitone+0x85/0xa0 ? excinvalidop+0x50/0x70 ? sginitone+0x85/0xa0 ? asmexcinvalidop+0x1a/0x20 ? sginitone+0x85/0xa0 nvkmfirmwarector+0x14a/0x250 [nouveau] nvkmfalconfwctor+0x42/0x70 [nouveau] ga102gspbooterctor+0xb4/0x1a0 [nouveau] r535gsponeinit+0xb3/0x15f0 [nouveau] ? srsoreturnthunk+0x5/0x5f ? srsoreturnthunk+0x5/0x5f ? nvkmudevicenew+0x95/0x140 [nouveau] ? srsoreturnthunk+0x5/0x5f ? srsoreturnthunk+0x5/0x5f ? ktime_get+0x47/0xb0
Fix this by using the non-coherent allocator instead, I think there might be a better answer to this, but it involve ripping up some of APIs using sg lists.
[
{
"digest": {
"length": 1768.0,
"function_hash": "42680021021839725363779199676825607412"
},
"target": {
"function": "nvkm_firmware_ctor",
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-2e334cba",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57ca481fca97ca4553e8c85d6a94baf4cb40c40e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"length": 851.0,
"function_hash": "207954267914084054880398874149658506254"
},
"target": {
"function": "nvkm_falcon_fw_boot",
"file": "drivers/gpu/drm/nouveau/nvkm/falcon/fw.c"
},
"id": "CVE-2024-45012-39960925",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b340aeb26d50e9a9ec99599e2a39b035fac978e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"43868304045890288449320786508962944802",
"20462754226127165947904496281698356416",
"235663909122944389758872434436223976629"
]
},
"target": {
"file": "drivers/gpu/drm/nouveau/nvkm/falcon/fw.c"
},
"id": "CVE-2024-45012-39ac9cef",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b340aeb26d50e9a9ec99599e2a39b035fac978e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"43868304045890288449320786508962944802",
"20462754226127165947904496281698356416",
"235663909122944389758872434436223976629"
]
},
"target": {
"file": "drivers/gpu/drm/nouveau/nvkm/falcon/fw.c"
},
"id": "CVE-2024-45012-49567c7c",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57ca481fca97ca4553e8c85d6a94baf4cb40c40e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"43868304045890288449320786508962944802",
"20462754226127165947904496281698356416",
"235663909122944389758872434436223976629"
]
},
"target": {
"file": "drivers/gpu/drm/nouveau/nvkm/falcon/fw.c"
},
"id": "CVE-2024-45012-7e767692",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc29c5546c6a373648363ac49781f1d74b530707",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"279120755559698041287859748272864576717",
"105555578454543110152432086155060819860",
"35429277037175641448236591182644392346",
"290710652904189966354230783743609480227",
"36288342450808693874753054693097866692",
"169476601954537307228194340245738135489",
"339299110033741579342527701865120384281",
"237193559556848274061770764292775952600",
"23317442614438997651576803362550156295"
]
},
"target": {
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-8c03181f",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc29c5546c6a373648363ac49781f1d74b530707",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"279120755559698041287859748272864576717",
"105555578454543110152432086155060819860",
"194868304064374406537274196022945717397",
"185185025535365583151255805510623369836",
"36288342450808693874753054693097866692",
"169476601954537307228194340245738135489",
"339299110033741579342527701865120384281",
"237193559556848274061770764292775952600",
"23317442614438997651576803362550156295"
]
},
"target": {
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-96e065f0",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57ca481fca97ca4553e8c85d6a94baf4cb40c40e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"279120755559698041287859748272864576717",
"105555578454543110152432086155060819860",
"194868304064374406537274196022945717397",
"185185025535365583151255805510623369836",
"36288342450808693874753054693097866692",
"169476601954537307228194340245738135489",
"339299110033741579342527701865120384281",
"237193559556848274061770764292775952600",
"23317442614438997651576803362550156295"
]
},
"target": {
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-9992fb0e",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b340aeb26d50e9a9ec99599e2a39b035fac978e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"length": 629.0,
"function_hash": "339903186044917403444676763379835161334"
},
"target": {
"function": "nvkm_firmware_dtor",
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-a9143065",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57ca481fca97ca4553e8c85d6a94baf4cb40c40e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"length": 851.0,
"function_hash": "207954267914084054880398874149658506254"
},
"target": {
"function": "nvkm_falcon_fw_boot",
"file": "drivers/gpu/drm/nouveau/nvkm/falcon/fw.c"
},
"id": "CVE-2024-45012-c37c0c23",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc29c5546c6a373648363ac49781f1d74b530707",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"length": 1768.0,
"function_hash": "42680021021839725363779199676825607412"
},
"target": {
"function": "nvkm_firmware_ctor",
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-cf4a1717",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b340aeb26d50e9a9ec99599e2a39b035fac978e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"length": 968.0,
"function_hash": "64193349383181251736555526624413239673"
},
"target": {
"function": "nvkm_firmware_ctor",
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-d39b0f9a",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc29c5546c6a373648363ac49781f1d74b530707",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"length": 851.0,
"function_hash": "207954267914084054880398874149658506254"
},
"target": {
"function": "nvkm_falcon_fw_boot",
"file": "drivers/gpu/drm/nouveau/nvkm/falcon/fw.c"
},
"id": "CVE-2024-45012-d3ae3538",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57ca481fca97ca4553e8c85d6a94baf4cb40c40e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"length": 629.0,
"function_hash": "339903186044917403444676763379835161334"
},
"target": {
"function": "nvkm_firmware_dtor",
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-f0a7408d",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b340aeb26d50e9a9ec99599e2a39b035fac978e",
"signature_version": "v1",
"deprecated": false
},
{
"digest": {
"length": 426.0,
"function_hash": "111802329183325038298750490222920072168"
},
"target": {
"function": "nvkm_firmware_dtor",
"file": "drivers/gpu/drm/nouveau/nvkm/core/firmware.c"
},
"id": "CVE-2024-45012-f3212c87",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc29c5546c6a373648363ac49781f1d74b530707",
"signature_version": "v1",
"deprecated": false
}
]