Author: emaste
Date: Thu Nov 22 16:55:09 2018
New Revision: 340771
URL: https://svnweb.freebsd.org/changeset/base/340771

Log:
  proto: change device permissions to 0600
  
  C Turt reports that the driver is not thread safe and may have
  exploitable races.
  
  Note that the proto device is intended for prototyping and development,
  and is not for use on production systems.  From the man page:
  
  SECURITY CONSIDERATIONS
       Because programs have direct access to the hardware, the proto
       driver is inherently insecure.  It is not advisable to use this
       driver on a production machine.
  
  The proto device is not included in any of FreeBSD's kernel config files
  (although the module is built).
  
  The issues in the proto device still need to be fixed, and the device is
  inherently (and intentionally) insecure, but it might as well be limited
  to root only.
  
  admbugs:      782
  Reported by:  C Turt <ect...@gmail.com>
  MFC after:    3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/proto/proto_core.c

Modified: head/sys/dev/proto/proto_core.c
==============================================================================
--- head/sys/dev/proto/proto_core.c     Thu Nov 22 16:53:30 2018        
(r340770)
+++ head/sys/dev/proto/proto_core.c     Thu Nov 22 16:55:09 2018        
(r340771)
@@ -196,7 +196,7 @@ proto_attach(device_t dev)
                case SYS_RES_MEMORY:
                case SYS_RES_IOPORT:
                        r->r_size = rman_get_size(r->r_d.res);
-                       r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666,
+                       r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600,
                            "proto/%s/%02x.%s", device_get_desc(dev), r->r_rid,
                            (r->r_type == SYS_RES_IOPORT) ? "io" : "mem");
                        r->r_u.cdev->si_drv1 = sc;
@@ -204,7 +204,7 @@ proto_attach(device_t dev)
                        break;
                case PROTO_RES_PCICFG:
                        r->r_size = 4096;
-                       r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666,
+                       r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600,
                            "proto/%s/pcicfg", device_get_desc(dev));
                        r->r_u.cdev->si_drv1 = sc;
                        r->r_u.cdev->si_drv2 = r;
@@ -212,7 +212,7 @@ proto_attach(device_t dev)
                case PROTO_RES_BUSDMA:
                        r->r_d.busdma = proto_busdma_attach(sc);
                        r->r_size = 0;  /* no read(2) nor write(2) */
-                       r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666,
+                       r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600,
                            "proto/%s/busdma", device_get_desc(dev));
                        r->r_u.cdev->si_drv1 = sc;
                        r->r_u.cdev->si_drv2 = r;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to