Project

General

Profile

Bug #12246

pci_get_irq_routing_table() leaks under UEFI

Added by Andy Fiddaman 12 months ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Under a UEFI environment, pci_bios_get_irq_routing() returns 0 and also sets *nneededp to 0; this causes a small leak in pci_get_irq_routing_table().

kmem_alloc_512 leak: 1 buffer, 512 bytes
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
ffffff0708721018 ffffff0708706b80                0 fffffffffbc53040
                 ffffff06e1038648 ffffff06e6017a00                0
                 kmem_cache_alloc_debug+0x2fc
                 kmem_cache_alloc+0x25b
                 kmem_zalloc+0x47
                 pci_get_irq_routing_table+0x27
                 startup_pci_bios+9
                 startup+0x4a
                 main+0x96
                 _locore_start+0x90
#1

Updated by Andy Fiddaman 12 months ago

  • Description updated (diff)
#2

Updated by Andy Fiddaman 12 months ago

Review at: https://illumos.org/rb/r/2496/

Testing

UEFI

bloody% tr '\0' '\n' < /system/boot/environment | grep efi
efi-version=2.70
bloody% pfexec mdb -ke pci_irq_nroutes/X
pci_irq_nroutes:
pci_irq_nroutes:0
bloody% pfexec reboot -d
...
bloody# mdb -ke ::findleaks {unix,vmcore}.7
findleaks: no memory leaks detected

BIOS

bloody% tr '\0' '\n' < /system/boot/environment | grep efi
bloody% pfexec mdb -ke pci_irq_nroutes/X
pci_irq_nroutes:
pci_irq_nroutes:20
bloody% pfexec reboot -d
...
bloody# mdb -ke ::findleaks {unix,vmcore}.8
findleaks: no memory leaks detected
#3

Updated by Electric Monk 12 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit d851c23803d14c57f342f6cca648ec3bfb5ea9d1

commit  d851c23803d14c57f342f6cca648ec3bfb5ea9d1
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2020-01-24T23:49:13.000Z

    12246 pci_get_irq_routing_table() leaks under UEFI
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Matthias Scheler <mscheler@tintri.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Also available in: Atom PDF