Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153457025
D51660.id159517.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
617 B
Referenced Files
None
Subscribers
None
D51660.id159517.diff
View Options
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -2827,7 +2827,14 @@
free(cr->cr_groups, M_CRED);
cr->cr_groups = malloc(nbytes, M_CRED, M_WAITOK | M_ZERO);
- cr->cr_agroups = nbytes / sizeof(gid_t);
+
+ /*
+ * Note that this is technically incorrect, but ngroups_max cannot be
+ * configured at runtime today. We'll need to do crcopysafe()
+ * differently if we for some reason ever add a sysctl that can increase
+ * our limit to avoid unnecessary allocations.
+ */
+ cr->cr_agroups = MIN(ngroups_max, nbytes / sizeof(gid_t));
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 6:54 AM (4 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31960460
Default Alt Text
D51660.id159517.diff (617 B)
Attached To
Mode
D51660: kern: fix a panic in crcopysafe() found by syzkaller
Attached
Detach File
Event Timeline
Log In to Comment