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/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243106

            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=210458&action=edit
proposed patch

reallocarray() is used in jailparam_all() to shrink the jail parameter list. 
It appears that the final call to shrink the list is unsafe if the reallocation
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.

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

help

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