Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Mar 2020 00:12:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 244563] vmstat -m show improbable values
Message-ID:  <bug-244563-227-ncCBXVrcLD@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-244563-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-244563-227@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=3D244563

--- Comment #3 from Mark Johnston <markj@FreeBSD.org> ---
-18446744073709551525 % (1 << 63) is ~24,000.  Looking at the other mallocs=
, I
see shmfd is pretty close to that.  sys_shm_unlink() calls free(path, M_TEM=
P),
which is wrong since shm_copyin_path() allocates the path buffer with M_SHM=
FD.=20
Looks like it was introduced in r354808.

diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index b97e75c0e417..886a0bad8746 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -961,7 +961,7 @@ sys_shm_unlink(struct thread *td, struct shm_unlink_args
*uap)
        sx_xlock(&shm_dict_lock);
        error =3D shm_remove(path, fnv, td->td_ucred);
        sx_xunlock(&shm_dict_lock);
-       free(path, M_TEMP);
+       free(path, M_SHMFD);

        return (error);
 }

--=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-244563-227-ncCBXVrcLD>