[Bug 244563] vmstat -m show improbable values

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Mar 3 00:12:28 UTC 2020


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

--- Comment #3 from Mark Johnston <markj at 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_TEMP),
which is wrong since shm_copyin_path() allocates the path buffer with M_SHMFD. 
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 = shm_remove(path, fnv, td->td_ucred);
        sx_xunlock(&shm_dict_lock);
-       free(path, M_TEMP);
+       free(path, M_SHMFD);

        return (error);
 }

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


More information about the freebsd-bugs mailing list