summaryrefslogtreecommitdiffstats
path: root/sys/rpc/svc_auth.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-06-07 20:51:31 +0000
committerrwatson <rwatson@FreeBSD.org>2009-06-07 20:51:31 +0000
commit23373fdcc8dda4da70583f20133c83c82e27e155 (patch)
tree2e20dad7ff994820d0bdf90ea5748e014b959f06 /sys/rpc/svc_auth.c
parent8fb24ef4a36b35611bdc3785d1352256ef87ea9a (diff)
downloadFreeBSD-src-23373fdcc8dda4da70583f20133c83c82e27e155.zip
FreeBSD-src-23373fdcc8dda4da70583f20133c83c82e27e155.tar.gz
Add a temporary workaround for panics being seen on NFS servers with ZFS,
where an improperly initialized prison field could lead to a panic. This is not the correct solution, since it fails to address similar problems for both AUDIT and MAC, which also rely on properly initialized credentials, but should reduce panic reports while we work that out. Reported by: ps, kan, others
Diffstat (limited to 'sys/rpc/svc_auth.c')
-rw-r--r--sys/rpc/svc_auth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c
index 6d5a79b..2d2b73d 100644
--- a/sys/rpc/svc_auth.c
+++ b/sys/rpc/svc_auth.c
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/systm.h>
+#include <sys/jail.h>
#include <sys/ucred.h>
#include <rpc/rpc.h>
@@ -181,6 +182,8 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp)
for (i = 0; i < xcr->cr_ngroups; i++)
cr->cr_groups[i] = xcr->cr_groups[i];
cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0];
+ cr->cr_prison = &prison0;
+ prison_hold(cr->cr_prison);
*crp = cr;
return (TRUE);
OpenPOWER on IntegriCloud