OS-8674

lx_mount() seems to leak

Status:
Need More Info
Created:
2025-06-28T13:52:18.635-0400
Updated:
2025-08-04T14:38:43.301-0400

Description

While testing for leaks in an unrelated part of the kernel, my ::findleaks only discovered leaks in the LX brand code in the kernel:

> ::findleaks -d
CACHE             LEAKED           BUFCTL CALLER
fffffeb187cd1008      17 fffffebb99bd8558 lx_mount+0x10e
fffffeb187cd1008      18 fffffeb45fb3c390 lx_mount+0x121
fffffeb187cd1008      17 fffffebb9b8e3e90 lx_mount+0x130
fffffeb187cd1008       2 fffffebc262e63c8 pn_get+0x35
------------------------------------------------------------------------
           Total      54 buffers, 62208 bytes

kmem_alloc_1152 leak: 17 buffers, 1152 bytes each, 19584 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
fffffebb99bd8558 fffffebb9b6ae180    12599210e2a1b fffffebad3633be0
                 fffffeb187cd1008 fffffeb1cb9c3f00 fffffeb2800e8788
                 kmem_cache_alloc_debug+0x37c
                 kmem_cache_alloc+0x138
                 kmem_alloc+0x4a
                 lx_mount+0x10e
                 lx_syscall_enter+0x1b2

kmem_alloc_1152 leak: 18 buffers, 1152 bytes each, 20736 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
fffffeb45fb3c390 fffffebba45f0000    12599210e2b77 fffffebad3633be0
                 fffffeb187cd1008 fffffeb1cb9c3fc0 fffffeb2800e8688
                 kmem_cache_alloc_debug+0x37c
                 kmem_cache_alloc+0x138
                 kmem_alloc+0x4a
                 lx_mount+0x121
                 lx_syscall_enter+0x1b2

kmem_alloc_1152 leak: 17 buffers, 1152 bytes each, 19584 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
fffffebb9b8e3e90 fffffebb9dfaf540    12599210e2ccd fffffebad3633be0
                 fffffeb187cd1008 fffffeb1cb9c4080 fffffeb2800e8588
                 kmem_cache_alloc_debug+0x37c
                 kmem_cache_alloc+0x138
                 kmem_alloc+0x4a
                 lx_mount+0x130
                 lx_syscall_enter+0x1b2

kmem_alloc_1152 leak: 2 buffers, 1152 bytes each, 2304 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
fffffebc262e63c8 fffffebc14f48000    1259d3ae6c208 fffffeb43cc1d100
                 fffffeb187cd1008 fffffeb1c18fd580 fffffeb272d18348
                 kmem_cache_alloc_debug+0x37c
                 kmem_cache_alloc+0x138
                 kmem_alloc+0x4a
                 pn_get+0x35
                 tmp_mount+0x1d2
                 fsop_mount+0x24
                 domount+0x47e
                 lx_mount+0x4f4
                 lx_syscall_enter+0x1b2

> 

An inspection of lx_mount(), the function all of these leaks have in common, did not show an OBVIOUS leak, as the out label kmem_frees what it allocated.. It is possible this is system-shutdown-time leaks (found in a reboot -d dump), but this should be investigated in a controlled environment, or we need to free things if the domount() call fails..