Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2016 21:59:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 208985] DoS / heap overflow in bpf_stats_sysctl
Message-ID:  <bug-208985-8-oA3fTDki6A@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-208985-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-208985-8@https.bugs.freebsd.org/bugzilla/>

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

--- Comment #1 from CTurt <cturt@hardenedbsd.org> ---
To fix this bug, there should be a bound check on `req->oldlen` before call=
ing
`malloc`, such as the following:

        if (req->oldptr =3D=3D NULL)
                return (SYSCTL_OUT(req, 0, bpf_bpfd_cnt * sizeof(*xbd)));
        if (bpf_bpfd_cnt =3D=3D 0)
                return (SYSCTL_OUT(req, 0, 0));
+       if (req->oldlen > 0x1000)
+               return EINVAL;
        xbdbuf =3D malloc(req->oldlen, M_BPF, M_WAITOK);

--=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-208985-8-oA3fTDki6A>