Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/secmodel/extensions Make the callback deal with embryoni...
details: https://anonhg.NetBSD.org/src/rev/70231391c3bd
branches: trunk
changeset: 785168:70231391c3bd
user: martin <martin%NetBSD.org@localhost>
date: Thu Feb 28 15:23:24 2013 +0000
description:
Make the callback deal with embryonic connections which do not have
credentials yet. Fixes PR kern/47598.
diffstat:
sys/secmodel/extensions/secmodel_extensions.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 6c279381a698 -r 70231391c3bd sys/secmodel/extensions/secmodel_extensions.c
--- a/sys/secmodel/extensions/secmodel_extensions.c Thu Feb 28 13:28:36 2013 +0000
+++ b/sys/secmodel/extensions/secmodel_extensions.c Thu Feb 28 15:23:24 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_extensions.c,v 1.4 2013/01/28 00:51:29 jym Exp $ */
+/* $NetBSD: secmodel_extensions.c,v 1.5 2013/02/28 15:23:24 martin Exp $ */
/*-
* Copyright (c) 2011 Elad Efrat <elad%NetBSD.org@localhost>
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: secmodel_extensions.c,v 1.4 2013/01/28 00:51:29 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_extensions.c,v 1.5 2013/02/28 15:23:24 martin Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -481,6 +481,9 @@
if (curtain != 0) {
struct socket *so = (struct socket *)arg1;
+ if (__predict_false(so == NULL || so->so_cred == NULL))
+ return KAUTH_RESULT_DENY;
+
if (!kauth_cred_uidmatch(cred, so->so_cred)) {
int error;
bool isroot = false;
Home |
Main Index |
Thread Index |
Old Index