Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Apr 2022 16:02:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 263371] Possible memleak bugs caused by g_raid_destroy_volume()
Message-ID:  <bug-263371-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263371

            Bug ID: 263371
           Summary: Possible memleak bugs caused by
                    g_raid_destroy_volume()
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: zhou1615@umn.edu

In sys/geom/raid/g_raid.c file, the function g_raid_destroy_volume(vol) will
not=20
free "vol" on some paths and return EBUSY instead of 0.

However, not all caller of g_raid_destroy_volume() will check the return va=
lue
and=20
those callers assume that there is no error when running=20
g_raid_destroy_volume(vol).

In detail, functions below does not check the return value:

In sys/geom/raid/md_promise.c file,
function: g_raid_md_promise_purge_volumes() and g_raid_md_ctl_promise()

In sys/geom/raid/md_ddf.c file,
fucntion: g_raid_md_ddf_purge_volumes() and g_raid_md_ctl_ddf()

In sys/geom/raid/md_intel.c file,
function: g_raid_md_ctl_intel()

In sys/geom/raid/g_raid.c file,
function: g_raid_update_volume() and g_raid_access().

There only one function g_raid_destroy_node() checks the return value of=20
g_raid_destroy_volume() and return EBUSY.
Maybe we should handle other functions like this one.

I am not sure whether missing checks of g_raid_destroy_volume() is on purpo=
se=20
or ignored,
and those bugs are found by a static analyzer, please advise.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-263371-227>