From nobody Sun Apr 17 16:02:03 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0818411D75B5 for ; Sun, 17 Apr 2022 16:02:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KhFF84yWjz3vhh for ; Sun, 17 Apr 2022 16:02:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AB832141C for ; Sun, 17 Apr 2022 16:02:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 23HG24ij057036 for ; Sun, 17 Apr 2022 16:02:04 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 23HG24jH057035 for bugs@FreeBSD.org; Sun, 17 Apr 2022 16:02:04 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 263371] Possible memleak bugs caused by g_raid_destroy_volume() Date: Sun, 17 Apr 2022 16:02:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: zhou1615@umn.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650211324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VrC0WtJZoQn3X6nP1ZkX2h36YneUpzzsBSBQAUxSM4c=; b=mGI1lfpaDlpKo8ufiWIQVsoa2iHS+gEwKsFiqaJ53bq13aVzOFOiejAjto1WU+MiSu2U0T 1hEpERjtPi9AQb7vK1m+A9/UlMs9YeasvOZwekum/bzKkWp/TaEr4QOYSeLtKpHD/2Jk1M vYo8rTEmlPBCVbbjNVvx+ZEgyssWhnXxqqZqTLkuZTd7C0tHWdhNniEW0Sab809++lgone dXnYJ8gxUoDqG7LHT33IsPMu5ktnJaPDfoE1KP7JkZA1Tcw25ie6MH1mCTsvb/HYzK5Wvl FePYOjZK0QLe9d1sUVKzxQrUKyREtHYscw1acMsMVQFWQLuYooIGpny11tjAGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650211324; a=rsa-sha256; cv=none; b=dXnh0+hFiHg0lpmke863sJ7Yi3uzdKDBJmZYZA0bcrQZHEwi4Myait3UewFud8/vDYGsTg HQLB5/h3ahPYyOfAgsmC7wdUdoWq4YshFTaRZO0X10Yd2vdLJez/C9ThrDbASzLWg1s2o0 WAqk1UzCZV/AiAKHFcw6ao22NRIItplhI/gmYFNVOWmxMjGSTbrXzc0pmgtPilFR54XZHg j6lVhwFup12tdGEsdAgF5MqePYSJEALnWxQ1tmC0tBFTb7ITSlOyMu8lKInEakt/yxF3u4 ohTCijdkYnF+f9ipz5gTweXUlHRYSo/dzJM7SEGNudyTbYNNhspo8X2uH//KNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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.=