linux_uid16.c (8fa0b743820f61c661ba5f3ea0e3be0dc137910e) linux_uid16.c (19e252baebe7a7466b33c27560420b7d95fe294d)
1/*-
2 * Copyright (c) 2001 The FreeBSD Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD$");
29
30#include "opt_compat.h"
1/*-
2 * Copyright (c) 2001 The FreeBSD Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD$");
29
30#include "opt_compat.h"
31#include "opt_kdtrace.h"
31
32#include <sys/fcntl.h>
33#include <sys/param.h>
32
33#include <sys/fcntl.h>
34#include <sys/param.h>
35#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/malloc.h>
36#include <sys/mutex.h>
37#include <sys/priv.h>
38#include <sys/proc.h>
36#include <sys/lock.h>
37#include <sys/malloc.h>
38#include <sys/mutex.h>
39#include <sys/priv.h>
40#include <sys/proc.h>
41#include <sys/sdt.h>
39#include <sys/syscallsubr.h>
40#include <sys/sysproto.h>
41#include <sys/systm.h>
42
43#ifdef COMPAT_LINUX32
44#include <machine/../linux32/linux.h>
45#include <machine/../linux32/linux32_proto.h>
46#else
47#include <machine/../linux/linux.h>
48#include <machine/../linux/linux_proto.h>
49#endif
50
42#include <sys/syscallsubr.h>
43#include <sys/sysproto.h>
44#include <sys/systm.h>
45
46#ifdef COMPAT_LINUX32
47#include <machine/../linux32/linux.h>
48#include <machine/../linux32/linux32_proto.h>
49#else
50#include <machine/../linux/linux.h>
51#include <machine/../linux/linux_proto.h>
52#endif
53
54#include <compat/linux/linux_dtrace.h>
51#include <compat/linux/linux_util.h>
52
55#include <compat/linux/linux_util.h>
56
57/* DTrace init */
58LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
59
60/**
61 * DTrace probes in this module.
62 */
63LIN_SDT_PROBE_DEFINE3(uid16, linux_chown16, entry, "char *", "l_uid16_t",
64 "l_gid16_t");
65LIN_SDT_PROBE_DEFINE1(uid16, linux_chown16, conv_path, "char *");
66LIN_SDT_PROBE_DEFINE1(uid16, linux_chown16, return, "int");
67LIN_SDT_PROBE_DEFINE3(uid16, linux_lchown16, entry, "char *", "l_uid16_t",
68 "l_gid16_t");
69LIN_SDT_PROBE_DEFINE1(uid16, linux_lchown16, conv_path, "char *");
70LIN_SDT_PROBE_DEFINE1(uid16, linux_lchown16, return, "int");
71LIN_SDT_PROBE_DEFINE2(uid16, linux_setgroups16, entry, "l_uint", "l_gid16_t *");
72LIN_SDT_PROBE_DEFINE1(uid16, linux_setgroups16, copyin_error, "int");
73LIN_SDT_PROBE_DEFINE1(uid16, linux_setgroups16, priv_check_cred_error, "int");
74LIN_SDT_PROBE_DEFINE1(uid16, linux_setgroups16, return, "int");
75LIN_SDT_PROBE_DEFINE2(uid16, linux_getgroups16, entry, "l_uint", "l_gid16_t *");
76LIN_SDT_PROBE_DEFINE1(uid16, linux_getgroups16, copyout_error, "int");
77LIN_SDT_PROBE_DEFINE1(uid16, linux_getgroups16, return, "int");
78LIN_SDT_PROBE_DEFINE0(uid16, linux_getgid16, entry);
79LIN_SDT_PROBE_DEFINE1(uid16, linux_getgid16, return, "int");
80LIN_SDT_PROBE_DEFINE0(uid16, linux_getuid16, entry);
81LIN_SDT_PROBE_DEFINE1(uid16, linux_getuid16, return, "int");
82LIN_SDT_PROBE_DEFINE0(uid16, linux_getegid16, entry);
83LIN_SDT_PROBE_DEFINE1(uid16, linux_getegid16, return, "int");
84LIN_SDT_PROBE_DEFINE0(uid16, linux_geteuid16, entry);
85LIN_SDT_PROBE_DEFINE1(uid16, linux_geteuid16, return, "int");
86LIN_SDT_PROBE_DEFINE1(uid16, linux_setgid16, entry, "l_gid16_t");
87LIN_SDT_PROBE_DEFINE1(uid16, linux_setgid16, return, "int");
88LIN_SDT_PROBE_DEFINE1(uid16, linux_setuid16, entry, "l_uid16_t");
89LIN_SDT_PROBE_DEFINE1(uid16, linux_setuid16, return, "int");
90LIN_SDT_PROBE_DEFINE2(uid16, linux_setregid16, entry, "l_git16_t", "l_git16_t");
91LIN_SDT_PROBE_DEFINE1(uid16, linux_setregid16, return, "int");
92LIN_SDT_PROBE_DEFINE2(uid16, linux_setreuid16, entry, "l_uid16_t", "l_uid16_t");
93LIN_SDT_PROBE_DEFINE1(uid16, linux_setreuid16, return, "int");
94LIN_SDT_PROBE_DEFINE3(uid16, linux_setresgid16, entry, "l_gid16_t", "l_gid16_t",
95 "l_gid16_t");
96LIN_SDT_PROBE_DEFINE1(uid16, linux_setresgid16, return, "int");
97LIN_SDT_PROBE_DEFINE3(uid16, linux_setresuid16, entry, "l_uid16_t", "l_uid16_t",
98 "l_uid16_t");
99LIN_SDT_PROBE_DEFINE1(uid16, linux_setresuid16, return, "int");
100
53DUMMY(setfsuid16);
54DUMMY(setfsgid16);
55DUMMY(getresuid16);
56DUMMY(getresgid16);
57
58#define CAST_NOCHG(x) ((x == 0xFFFF) ? -1 : x)
59
60int
61linux_chown16(struct thread *td, struct linux_chown16_args *args)
62{
63 char *path;
64 int error;
65
66 LCONVPATHEXIST(td, args->path, &path);
67
101DUMMY(setfsuid16);
102DUMMY(setfsgid16);
103DUMMY(getresuid16);
104DUMMY(getresgid16);
105
106#define CAST_NOCHG(x) ((x == 0xFFFF) ? -1 : x)
107
108int
109linux_chown16(struct thread *td, struct linux_chown16_args *args)
110{
111 char *path;
112 int error;
113
114 LCONVPATHEXIST(td, args->path, &path);
115
68#ifdef DEBUG
69 if (ldebug(chown16))
70 printf(ARGS(chown16, "%s, %d, %d"), path, args->uid, args->gid);
71#endif
116 /*
117 * The DTrace probes have to be after the LCONVPATHEXIST, as
118 * LCONVPATHEXIST may return on its own and we do not want to
119 * have a stray entry without the corresponding return.
120 */
121 LIN_SDT_PROBE3(uid16, linux_chown16, entry, args->path, args->uid,
122 args->gid);
123 LIN_SDT_PROBE1(uid16, linux_chown16, conv_path, path);
124
72 error = kern_chown(td, path, UIO_SYSSPACE, CAST_NOCHG(args->uid),
73 CAST_NOCHG(args->gid));
74 LFREEPATH(path);
125 error = kern_chown(td, path, UIO_SYSSPACE, CAST_NOCHG(args->uid),
126 CAST_NOCHG(args->gid));
127 LFREEPATH(path);
128
129 LIN_SDT_PROBE1(uid16, linux_chown16, return, error);
75 return (error);
76}
77
78int
79linux_lchown16(struct thread *td, struct linux_lchown16_args *args)
80{
81 char *path;
82 int error;
83
84 LCONVPATHEXIST(td, args->path, &path);
85
130 return (error);
131}
132
133int
134linux_lchown16(struct thread *td, struct linux_lchown16_args *args)
135{
136 char *path;
137 int error;
138
139 LCONVPATHEXIST(td, args->path, &path);
140
86#ifdef DEBUG
87 if (ldebug(lchown16))
88 printf(ARGS(lchown16, "%s, %d, %d"), path, args->uid,
89 args->gid);
90#endif
141 /*
142 * The DTrace probes have to be after the LCONVPATHEXIST, as
143 * LCONVPATHEXIST may return on its own and we do not want to
144 * have a stray entry without the corresponding return.
145 */
146 LIN_SDT_PROBE3(uid16, linux_lchown16, entry, args->path, args->uid,
147 args->gid);
148 LIN_SDT_PROBE1(uid16, linux_lchown16, conv_path, path);
149
91 error = kern_lchown(td, path, UIO_SYSSPACE, CAST_NOCHG(args->uid),
92 CAST_NOCHG(args->gid));
93 LFREEPATH(path);
150 error = kern_lchown(td, path, UIO_SYSSPACE, CAST_NOCHG(args->uid),
151 CAST_NOCHG(args->gid));
152 LFREEPATH(path);
153
154 LIN_SDT_PROBE1(uid16, linux_lchown16, return, error);
94 return (error);
95}
96
97int
98linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args)
99{
100 struct ucred *newcred, *oldcred;
101 l_gid16_t *linux_gidset;
102 gid_t *bsd_gidset;
103 int ngrp, error;
104 struct proc *p;
105
155 return (error);
156}
157
158int
159linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args)
160{
161 struct ucred *newcred, *oldcred;
162 l_gid16_t *linux_gidset;
163 gid_t *bsd_gidset;
164 int ngrp, error;
165 struct proc *p;
166
106#ifdef DEBUG
107 if (ldebug(setgroups16))
108 printf(ARGS(setgroups16, "%d, *"), args->gidsetsize);
109#endif
167 LIN_SDT_PROBE2(uid16, linux_setgroups16, entry, args->gidsetsize,
168 args->gidset);
110
111 ngrp = args->gidsetsize;
169
170 ngrp = args->gidsetsize;
112 if (ngrp < 0 || ngrp >= ngroups_max + 1)
171 if (ngrp < 0 || ngrp >= ngroups_max + 1) {
172 LIN_SDT_PROBE1(uid16, linux_setgroups16, return, EINVAL);
113 return (EINVAL);
173 return (EINVAL);
174 }
114 linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
115 error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t));
116 if (error) {
175 linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
176 error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t));
177 if (error) {
178 LIN_SDT_PROBE1(uid16, linux_setgroups16, copyin_error, error);
179 LIN_SDT_PROBE1(uid16, linux_setgroups16, return, error);
117 free(linux_gidset, M_TEMP);
118 return (error);
119 }
120 newcred = crget();
121 p = td->td_proc;
122 PROC_LOCK(p);
123 oldcred = crcopysafe(p, newcred);
124
125 /*
126 * cr_groups[0] holds egid. Setting the whole set from
127 * the supplied set will cause egid to be changed too.
128 * Keep cr_groups[0] unchanged to prevent that.
129 */
130
131 if ((error = priv_check_cred(oldcred, PRIV_CRED_SETGROUPS, 0)) != 0) {
132 PROC_UNLOCK(p);
133 crfree(newcred);
180 free(linux_gidset, M_TEMP);
181 return (error);
182 }
183 newcred = crget();
184 p = td->td_proc;
185 PROC_LOCK(p);
186 oldcred = crcopysafe(p, newcred);
187
188 /*
189 * cr_groups[0] holds egid. Setting the whole set from
190 * the supplied set will cause egid to be changed too.
191 * Keep cr_groups[0] unchanged to prevent that.
192 */
193
194 if ((error = priv_check_cred(oldcred, PRIV_CRED_SETGROUPS, 0)) != 0) {
195 PROC_UNLOCK(p);
196 crfree(newcred);
197
198 LIN_SDT_PROBE1(uid16, linux_setgroups16, priv_check_cred_error,
199 error);
134 goto out;
135 }
136
137 if (ngrp > 0) {
138 newcred->cr_ngroups = ngrp + 1;
139
140 bsd_gidset = newcred->cr_groups;
141 ngrp--;

--- 7 unchanged lines hidden (view full) ---

149
150 setsugid(td->td_proc);
151 p->p_ucred = newcred;
152 PROC_UNLOCK(p);
153 crfree(oldcred);
154 error = 0;
155out:
156 free(linux_gidset, M_TEMP);
200 goto out;
201 }
202
203 if (ngrp > 0) {
204 newcred->cr_ngroups = ngrp + 1;
205
206 bsd_gidset = newcred->cr_groups;
207 ngrp--;

--- 7 unchanged lines hidden (view full) ---

215
216 setsugid(td->td_proc);
217 p->p_ucred = newcred;
218 PROC_UNLOCK(p);
219 crfree(oldcred);
220 error = 0;
221out:
222 free(linux_gidset, M_TEMP);
223
224 LIN_SDT_PROBE1(uid16, linux_setgroups16, return, error);
157 return (error);
158}
159
160int
161linux_getgroups16(struct thread *td, struct linux_getgroups16_args *args)
162{
163 struct ucred *cred;
164 l_gid16_t *linux_gidset;
165 gid_t *bsd_gidset;
166 int bsd_gidsetsz, ngrp, error;
167
225 return (error);
226}
227
228int
229linux_getgroups16(struct thread *td, struct linux_getgroups16_args *args)
230{
231 struct ucred *cred;
232 l_gid16_t *linux_gidset;
233 gid_t *bsd_gidset;
234 int bsd_gidsetsz, ngrp, error;
235
168#ifdef DEBUG
169 if (ldebug(getgroups16))
170 printf(ARGS(getgroups16, "%d, *"), args->gidsetsize);
171#endif
236 LIN_SDT_PROBE2(uid16, linux_getgroups16, entry, args->gidsetsize,
237 args->gidset);
172
173 cred = td->td_ucred;
174 bsd_gidset = cred->cr_groups;
175 bsd_gidsetsz = cred->cr_ngroups - 1;
176
177 /*
178 * cr_groups[0] holds egid. Returning the whole set
179 * here will cause a duplicate. Exclude cr_groups[0]
180 * to prevent that.
181 */
182
183 if ((ngrp = args->gidsetsize) == 0) {
184 td->td_retval[0] = bsd_gidsetsz;
238
239 cred = td->td_ucred;
240 bsd_gidset = cred->cr_groups;
241 bsd_gidsetsz = cred->cr_ngroups - 1;
242
243 /*
244 * cr_groups[0] holds egid. Returning the whole set
245 * here will cause a duplicate. Exclude cr_groups[0]
246 * to prevent that.
247 */
248
249 if ((ngrp = args->gidsetsize) == 0) {
250 td->td_retval[0] = bsd_gidsetsz;
251
252 LIN_SDT_PROBE1(uid16, linux_getgroups16, return, 0);
185 return (0);
186 }
187
253 return (0);
254 }
255
188 if (ngrp < bsd_gidsetsz)
256 if (ngrp < bsd_gidsetsz) {
257 LIN_SDT_PROBE1(uid16, linux_getgroups16, return, EINVAL);
189 return (EINVAL);
258 return (EINVAL);
259 }
190
191 ngrp = 0;
192 linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset),
193 M_TEMP, M_WAITOK);
194 while (ngrp < bsd_gidsetsz) {
195 linux_gidset[ngrp] = bsd_gidset[ngrp + 1];
196 ngrp++;
197 }
198
199 error = copyout(linux_gidset, args->gidset, ngrp * sizeof(l_gid16_t));
200 free(linux_gidset, M_TEMP);
260
261 ngrp = 0;
262 linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset),
263 M_TEMP, M_WAITOK);
264 while (ngrp < bsd_gidsetsz) {
265 linux_gidset[ngrp] = bsd_gidset[ngrp + 1];
266 ngrp++;
267 }
268
269 error = copyout(linux_gidset, args->gidset, ngrp * sizeof(l_gid16_t));
270 free(linux_gidset, M_TEMP);
201 if (error)
271 if (error) {
272 LIN_SDT_PROBE1(uid16, linux_getgroups16, copyout_error, error);
273 LIN_SDT_PROBE1(uid16, linux_getgroups16, return, error);
202 return (error);
274 return (error);
275 }
203
204 td->td_retval[0] = ngrp;
276
277 td->td_retval[0] = ngrp;
278
279 LIN_SDT_PROBE1(uid16, linux_getgroups16, return, 0);
205 return (0);
206}
207
208/*
209 * The FreeBSD native getgid(2) and getuid(2) also modify td->td_retval[1]
210 * when COMPAT_43 is defined. This clobbers registers that are assumed to
211 * be preserved. The following lightweight syscalls fixes this. See also
212 * linux_getpid(2), linux_getgid(2) and linux_getuid(2) in linux_misc.c
213 *
214 * linux_getgid16() - MP SAFE
215 * linux_getuid16() - MP SAFE
216 */
217
218int
219linux_getgid16(struct thread *td, struct linux_getgid16_args *args)
220{
221
280 return (0);
281}
282
283/*
284 * The FreeBSD native getgid(2) and getuid(2) also modify td->td_retval[1]
285 * when COMPAT_43 is defined. This clobbers registers that are assumed to
286 * be preserved. The following lightweight syscalls fixes this. See also
287 * linux_getpid(2), linux_getgid(2) and linux_getuid(2) in linux_misc.c
288 *
289 * linux_getgid16() - MP SAFE
290 * linux_getuid16() - MP SAFE
291 */
292
293int
294linux_getgid16(struct thread *td, struct linux_getgid16_args *args)
295{
296
297 LIN_SDT_PROBE0(uid16, linux_getgid16, entry);
298
222 td->td_retval[0] = td->td_ucred->cr_rgid;
299 td->td_retval[0] = td->td_ucred->cr_rgid;
300
301 LIN_SDT_PROBE1(uid16, linux_getgid16, return, 0);
223 return (0);
224}
225
226int
227linux_getuid16(struct thread *td, struct linux_getuid16_args *args)
228{
229
302 return (0);
303}
304
305int
306linux_getuid16(struct thread *td, struct linux_getuid16_args *args)
307{
308
309 LIN_SDT_PROBE0(uid16, linux_getuid16, entry);
310
230 td->td_retval[0] = td->td_ucred->cr_ruid;
311 td->td_retval[0] = td->td_ucred->cr_ruid;
312
313 LIN_SDT_PROBE1(uid16, linux_getuid16, return, 0);
231 return (0);
232}
233
234int
235linux_getegid16(struct thread *td, struct linux_getegid16_args *args)
236{
237 struct getegid_args bsd;
314 return (0);
315}
316
317int
318linux_getegid16(struct thread *td, struct linux_getegid16_args *args)
319{
320 struct getegid_args bsd;
321 int error;
238
322
239 return (sys_getegid(td, &bsd));
323 LIN_SDT_PROBE0(uid16, linux_getegid16, entry);
324
325 error = sys_getegid(td, &bsd);
326
327 LIN_SDT_PROBE1(uid16, linux_getegid16, return, error);
328 return (error);
240}
241
242int
243linux_geteuid16(struct thread *td, struct linux_geteuid16_args *args)
244{
245 struct geteuid_args bsd;
329}
330
331int
332linux_geteuid16(struct thread *td, struct linux_geteuid16_args *args)
333{
334 struct geteuid_args bsd;
335 int error;
246
336
247 return (sys_geteuid(td, &bsd));
337 LIN_SDT_PROBE0(uid16, linux_geteuid16, entry);
338
339 error = sys_geteuid(td, &bsd);
340
341 LIN_SDT_PROBE1(uid16, linux_geteuid16, return, error);
342 return (error);
248}
249
250int
251linux_setgid16(struct thread *td, struct linux_setgid16_args *args)
252{
253 struct setgid_args bsd;
343}
344
345int
346linux_setgid16(struct thread *td, struct linux_setgid16_args *args)
347{
348 struct setgid_args bsd;
349 int error;
254
350
351 LIN_SDT_PROBE1(uid16, linux_setgid16, entry, args->gid);
352
255 bsd.gid = args->gid;
353 bsd.gid = args->gid;
256 return (sys_setgid(td, &bsd));
354 error = sys_setgid(td, &bsd);
355
356 LIN_SDT_PROBE1(uid16, linux_setgid16, return, error);
357 return (error);
257}
258
259int
260linux_setuid16(struct thread *td, struct linux_setuid16_args *args)
261{
262 struct setuid_args bsd;
358}
359
360int
361linux_setuid16(struct thread *td, struct linux_setuid16_args *args)
362{
363 struct setuid_args bsd;
364 int error;
263
365
366 LIN_SDT_PROBE1(uid16, linux_setuid16, entry, args->uid);
367
264 bsd.uid = args->uid;
368 bsd.uid = args->uid;
265 return (sys_setuid(td, &bsd));
369 error = sys_setuid(td, &bsd);
370
371 LIN_SDT_PROBE1(uid16, linux_setuid16, return, error);
372 return (error);
266}
267
268int
269linux_setregid16(struct thread *td, struct linux_setregid16_args *args)
270{
271 struct setregid_args bsd;
373}
374
375int
376linux_setregid16(struct thread *td, struct linux_setregid16_args *args)
377{
378 struct setregid_args bsd;
379 int error;
272
380
381 LIN_SDT_PROBE2(uid16, linux_setregid16, entry, args->rgid, args->egid);
382
273 bsd.rgid = CAST_NOCHG(args->rgid);
274 bsd.egid = CAST_NOCHG(args->egid);
383 bsd.rgid = CAST_NOCHG(args->rgid);
384 bsd.egid = CAST_NOCHG(args->egid);
275 return (sys_setregid(td, &bsd));
385 error = sys_setregid(td, &bsd);
386
387 LIN_SDT_PROBE1(uid16, linux_setregid16, return, error);
388 return (error);
276}
277
278int
279linux_setreuid16(struct thread *td, struct linux_setreuid16_args *args)
280{
281 struct setreuid_args bsd;
389}
390
391int
392linux_setreuid16(struct thread *td, struct linux_setreuid16_args *args)
393{
394 struct setreuid_args bsd;
395 int error;
282
396
397 LIN_SDT_PROBE2(uid16, linux_setreuid16, entry, args->ruid, args->euid);
398
283 bsd.ruid = CAST_NOCHG(args->ruid);
284 bsd.euid = CAST_NOCHG(args->euid);
399 bsd.ruid = CAST_NOCHG(args->ruid);
400 bsd.euid = CAST_NOCHG(args->euid);
285 return (sys_setreuid(td, &bsd));
401 error = sys_setreuid(td, &bsd);
402
403 LIN_SDT_PROBE1(uid16, linux_setreuid16, return, error);
404 return (error);
286}
287
288int
289linux_setresgid16(struct thread *td, struct linux_setresgid16_args *args)
290{
291 struct setresgid_args bsd;
405}
406
407int
408linux_setresgid16(struct thread *td, struct linux_setresgid16_args *args)
409{
410 struct setresgid_args bsd;
411 int error;
292
412
413 LIN_SDT_PROBE3(uid16, linux_setresgid16, entry, args->rgid, args->egid,
414 args->sgid);
415
293 bsd.rgid = CAST_NOCHG(args->rgid);
294 bsd.egid = CAST_NOCHG(args->egid);
295 bsd.sgid = CAST_NOCHG(args->sgid);
416 bsd.rgid = CAST_NOCHG(args->rgid);
417 bsd.egid = CAST_NOCHG(args->egid);
418 bsd.sgid = CAST_NOCHG(args->sgid);
296 return (sys_setresgid(td, &bsd));
419 error = sys_setresgid(td, &bsd);
420
421 LIN_SDT_PROBE1(uid16, linux_setresgid16, return, error);
422 return (error);
297}
298
299int
300linux_setresuid16(struct thread *td, struct linux_setresuid16_args *args)
301{
302 struct setresuid_args bsd;
423}
424
425int
426linux_setresuid16(struct thread *td, struct linux_setresuid16_args *args)
427{
428 struct setresuid_args bsd;
429 int error;
303
430
431 LIN_SDT_PROBE3(uid16, linux_setresuid16, entry, args->ruid, args->euid,
432 args->suid);
433
304 bsd.ruid = CAST_NOCHG(args->ruid);
305 bsd.euid = CAST_NOCHG(args->euid);
306 bsd.suid = CAST_NOCHG(args->suid);
434 bsd.ruid = CAST_NOCHG(args->ruid);
435 bsd.euid = CAST_NOCHG(args->euid);
436 bsd.suid = CAST_NOCHG(args->suid);
307 return (sys_setresuid(td, &bsd));
437 error = sys_setresuid(td, &bsd);
438
439 LIN_SDT_PROBE1(uid16, linux_setresuid16, return, error);
440 return (error);
308}
441}