Skip to content

Commit

Permalink
MFC r340771: proto: change device permissions to 0600
Browse files Browse the repository at this point in the history
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 <ecturt@gmail.com>
Sponsored by:	The FreeBSD Foundation
  • Loading branch information
emaste committed Nov 25, 2018
1 parent 996bc6e commit 91dc347
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sys/dev/proto/proto_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,23 +196,23 @@ 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;
r->r_u.cdev->si_drv2 = r;
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;
break;
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;
Expand Down

0 comments on commit 91dc347

Please sign in to comment.