Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144522864
D30617.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30617.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
@@ -288,7 +288,7 @@
#ifndef _SYS_SYSPROTO_H_
struct getgroups_args {
- u_int gidsetsize;
+ int gidsetsize;
gid_t *gidset;
};
#endif
@@ -296,8 +296,7 @@
sys_getgroups(struct thread *td, struct getgroups_args *uap)
{
struct ucred *cred;
- u_int ngrp;
- int error;
+ int ngrp, error;
cred = td->td_ucred;
ngrp = cred->cr_ngroups;
@@ -791,7 +790,7 @@
#ifndef _SYS_SYSPROTO_H_
struct setgroups_args {
- u_int gidsetsize;
+ int gidsetsize;
gid_t *gidset;
};
#endif
@@ -801,11 +800,10 @@
{
gid_t smallgroups[XU_NGROUPS];
gid_t *groups;
- u_int gidsetsize;
- int error;
+ int gidsetsize, error;
gidsetsize = uap->gidsetsize;
- if (gidsetsize > ngroups_max + 1)
+ if (gidsetsize > ngroups_max + 1 || gidsetsize < 0)
return (EINVAL);
if (gidsetsize > XU_NGROUPS)
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -523,13 +523,13 @@
}
79 AUE_GETGROUPS STD {
int getgroups(
- u_int gidsetsize,
+ int gidsetsize,
_Out_writes_opt_(gidsetsize) gid_t *gidset
);
}
80 AUE_SETGROUPS STD {
int setgroups(
- u_int gidsetsize,
+ int gidsetsize,
_In_reads_(gidsetsize) gid_t *gidset
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 10, 4:04 AM (18 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28612777
Default Alt Text
D30617.diff (1 KB)
Attached To
Mode
D30617: kern: fail getgroup and setgroup with negative int
Attached
Detach File
Event Timeline
Log In to Comment