Project

General

Profile

Bug #4533

mountd(1m) leaks nd_hostservlist in do_logging_queue()

Added by Marcel Telka about 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
nfs - NFS server and client
Start date:
2014-01-26
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

In a case the getclientsnames_lazy() is successfully called in do_logging_queue(), the clnames will leak:

295    struct nd_hostservlist    *clnames;
296
297    while (lq) {
298        if (lq->ld_host == NULL) {
299            DTRACE_PROBE(mountd, name_by_lazy);
300            if (getclientsnames_lazy(lq->ld_netid,
301                &lq->ld_nb, &clnames) != 0)
302                host = NULL;
303            else
304                host = clnames->h_hostservs[0].h_host;
305        } else
306            host = lq->ld_host;
307
308        audit_mountd_mount(host, lq->ld_path, lq->ld_status); /* BSM */
309
310        /* add entry to mount list */
311        if (lq->ld_rpath)
312            mntlist_new(host, lq->ld_rpath);
313
314        lq->ld_next = lq_clean;
315        lq_clean = lq;
316
317        (void) mutex_lock(&logging_queue_lock);
318        lq = remove_head_of_queue();
319        (void) mutex_unlock(&logging_queue_lock);
320    }
#1

Updated by Marcel Telka about 7 years ago

> ::findleaks -d
CACHE     LEAKED   BUFCTL CALLER
08067a10       1 080efb30 anon_client+0x13
08067a10       1 080efba8 anon_client+0x26
------------------------------------------------------------------------
   Total       2 buffers, 32 bytes

umem_alloc_16 leak: 1 buffer, 16 bytes
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         80efb30          80ee3c0    321b60c44d5c8                4
                          8067a10                0                0
                 libumem.so.1`umem_cache_alloc_debug+0x1fe
                 libumem.so.1`umem_cache_alloc+0x18f
                 libumem.so.1`umem_alloc+0x50
                 libumem.so.1`malloc+0x36
                 anon_client+0x13
                 getclientsnames_common+0xe4
                 getclientsnames_lazy+0x56
                 do_logging_queue+0x37
                 logging_svc+0x5a
                 libc.so.1`_thrp_setup+0x88
                 libc.so.1`_lwp_start

umem_alloc_16 leak: 1 buffer, 16 bytes
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         80efba8          80ee3a0    321b60c44d7e3                4
                          8067a10                0                0
                 libumem.so.1`umem_cache_alloc_debug+0x1fe
                 libumem.so.1`umem_cache_alloc+0x18f
                 libumem.so.1`umem_alloc+0x50
                 libumem.so.1`malloc+0x36
                 anon_client+0x26
                 getclientsnames_common+0xe4
                 getclientsnames_lazy+0x56
                 do_logging_queue+0x37
                 logging_svc+0x5a
                 libc.so.1`_thrp_setup+0x88
                 libc.so.1`_lwp_start

>
#2

Updated by Marcel Telka about 7 years ago

Reproducible using this command:

# mount -o vers=3 SERVER:/tmp /mnt

Where /tmp is a shared directory at SERVER.

#3

Updated by Marcel Telka about 7 years ago

  • Status changed from In Progress to Pending RTI
#4

Updated by Robert Mustacchi about 7 years ago

  • Status changed from Pending RTI to Resolved
  • % Done changed from 0 to 100
  • Tags deleted (needs-triage)

Resolved in d383eb7abfbfe9663f0ee57d8e3ad74ed725a7ad.

Also available in: Atom PDF