summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorpgoyette <pgoyette@NetBSD.org>2019-02-20 09:59:39 +0000
committerpgoyette <pgoyette@NetBSD.org>2019-02-20 09:59:39 +0000
commit30d0dc6fad41e8564362770b7bef220ac4c1acb6 (patch)
tree83471d26064711d748a5eaf6c8d66652354f4a7d /sys
parentfd251db7269ee8cf1aaa605f3efcbb23084cf779 (diff)
compat70_ocreds_valid is not a pointer to a boolean, it is the boolean
itself which controls whether or not we recognize the OCRED options. Should fix the panic identified in PR kern/53991 (awaiting confirmation from submitter).
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_usrreq.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 43603dd5c9c..bb9248aa794 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_usrreq.c,v 1.190 2019/02/04 10:11:34 mrg Exp $ */
+/* $NetBSD: uipc_usrreq.c,v 1.191 2019/02/20 09:59:39 pgoyette Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.190 2019/02/04 10:11:34 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.191 2019/02/20 09:59:39 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -126,6 +126,7 @@ __KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.190 2019/02/04 10:11:34 mrg Exp $"
#include <sys/compat_stub.h>
#include <compat/sys/socket.h>
+#include <compat/net/route_70.h>
/*
* Unix communications domain.
@@ -208,7 +209,7 @@ struct mbuf * stub_compat_70_unp_addsockcred(struct lwp *lwp,
return control;
}
-bool *compat70_ocreds_valid = false;
+bool compat70_ocreds_valid = false;
/*
* Initialize Unix protocols.
@@ -610,7 +611,7 @@ uipc_ctloutput(int op, struct socket *so, struct sockopt *sopt)
case PRCO_SETOPT:
switch (sopt->sopt_name) {
case LOCAL_OCREDS:
- if (!*compat70_ocreds_valid) {
+ if (!compat70_ocreds_valid) {
error = ENOPROTOOPT;
break;
}
@@ -664,7 +665,7 @@ uipc_ctloutput(int op, struct socket *so, struct sockopt *sopt)
error = sockopt_setint(sopt, optval);
break;
case LOCAL_OCREDS:
- if (*compat70_ocreds_valid) {
+ if (compat70_ocreds_valid) {
optval = OPTBIT(UNP_OWANTCRED);
error = sockopt_setint(sopt, optval);
break;