git: 6af3cf27ed00 - main - freebsd32_rusage_out(): bzero the compat32 structure
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 25 Jan 2026 15:56:44 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=6af3cf27ed0072f2dcb17380ab63228f9aa28708
commit 6af3cf27ed0072f2dcb17380ab63228f9aa28708
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-01-21 14:14:10 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-01-25 15:52:30 +0000
freebsd32_rusage_out(): bzero the compat32 structure
There is some padding on non-x86. Unconditionally bzero the memory to
avoid a leak.
Noted by: markj
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54592
---
sys/compat/freebsd32/freebsd32_misc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 7913940338c2..8a2c179926d8 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -203,6 +203,7 @@ void
freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32)
{
+ bzero(s32, sizeof(*s32));
TV_CP(*s, *s32, ru_utime);
TV_CP(*s, *s32, ru_stime);
CP(*s, *s32, ru_maxrss);