Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/bouyer-socketcan]: src/sys/kern Allow any user to bind to CAN sockets.



details:   https://anonhg.NetBSD.org/src/rev/37bfefaf316b
branches:  bouyer-socketcan
changeset: 820912:37bfefaf316b
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu May 25 18:52:24 2017 +0000

description:
Allow any user to bind to CAN sockets.
Maybe a better security model is needed.

diffstat:

 sys/kern/uipc_socket.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 16bd546c5012 -r 37bfefaf316b sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Thu May 25 18:26:36 2017 +0000
+++ b/sys/kern/uipc_socket.c    Thu May 25 18:52:24 2017 +0000
@@ -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 @@
                }
 
        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. */



Home | Main Index | Thread Index | Old Index