Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Jan 2020 05:39:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 243106] jail(3): memory leak when resizing jail parameter list.
Message-ID:  <bug-243106-227@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 243106
           Summary: jail(3): memory leak when resizing jail parameter
                    list.
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: chwoithe@yahoo.com

Created attachment 210458
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D210458&action=
=3Dedit
proposed patch

reallocarray() is used in jailparam_all() to shrink the jail parameter list=
.=20
It appears that the final call to shrink the list is unsafe if the realloca=
tion
fails.  There is a possibility, for example, that NULL is assigned to *jpp =
and
njp keeps its previous (likely non-zero) value.  jls, which uses
jailparam_all(), will attempt to use this invalid list.

I have attached a proposed fix.

--=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-243106-227>