aboutsummaryrefslogtreecommitdiff
path: root/tools/LibraryReport
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2026-05-07 08:06:35 +0000
committerMark Johnston <markj@FreeBSD.org>2026-05-20 19:37:14 +0000
commit8eb0bbbd2e4681dd6dc4b8d0e894438d6d4deedb (patch)
tree73252a937b840893ea305e6aee14e97e63f09eda /tools/LibraryReport
parent5cf14032ddf35ec8a3da4b858e2376e56484cd54 (diff)
setcred: Fix buffer overflow
Since groups is a pointer to a pointer to an array of gid_t, we should use sizeof(**groups) or sizeof(gid_t) when calculating how much to allocate and copy in. We were using sizeof(*groups) instead, which meant that on 64-bit platforms, we would allocate and copy in twice as much as we should. Unfortunately, in the smallgroups case, we copy into a preallocated buffer which has the correct size, which means that if sc_supp_groups_nb >= CRED_SMALLGROUPS_NB / 2, we overflow smallgroups. This is a direct commit to stable/14. Approved by: so Security: FreeBSD-SA-26:18.setcred Reported by: Ryan of Calif.io Fixes: ddb3eb4efe55 ("New setcred() system call and associated MAC hooks")
Diffstat (limited to 'tools/LibraryReport')
0 files changed, 0 insertions, 0 deletions