Module Name: src Committed By: bouyer Date: Thu May 25 18:52:24 UTC 2017
Modified Files: src/sys/kern [bouyer-socketcan]: uipc_socket.c Log Message: Allow any user to bind to CAN sockets. Maybe a better security model is needed. To generate a diff of this commit: cvs rdiff -u -r1.252 -r1.252.2.1 src/sys/kern/uipc_socket.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.252 src/sys/kern/uipc_socket.c:1.252.2.1 --- src/sys/kern/uipc_socket.c:1.252 Thu Oct 13 19:10:23 2016 +++ src/sys/kern/uipc_socket.c Thu May 25 18:52:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.252 2016/10/13 19:10:23 uwe Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.252.2.1 2017/05/25 18:52:24 bouyer Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.252 2016/10/13 19:10:23 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.252.2.1 2017/05/25 18:52:24 bouyer Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -433,9 +433,9 @@ socket_listener_cb(kauth_cred_t cred, ka } case KAUTH_REQ_NETWORK_SOCKET_OPEN: - /* We allow "raw" routing/bluetooth sockets to anyone. */ + /* We allow "raw" routing/bluetooth/CAN sockets to anyone. */ if ((u_long)arg1 == PF_ROUTE || (u_long)arg1 == PF_OROUTE - || (u_long)arg1 == PF_BLUETOOTH) { + || (u_long)arg1 == PF_BLUETOOTH || (u_long)arg1 == PF_CAN) { result = KAUTH_RESULT_ALLOW; } else { /* Privileged, let secmodel handle this. */