Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2016 09:20:05 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304279 - head/sys/dev/acpica
Message-ID:  <201608170920.u7H9K5FS049768@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Aug 17 09:20:04 2016
New Revision: 304279
URL: https://svnweb.freebsd.org/changeset/base/304279

Log:
  By default, allow all to read the HPET registers pages.  At the same
  time, by, by default disallow writes to the mmaped HPET pages.
  
  Intent is to allow userspace to use HPET as fast (i.e. no-syscall)
  timecounter for gettimeofday(2).  Unfortunately, the permission model
  does not make it possible to safely unhide /dev/hpet in the jails even
  if default mode is set to 0444, because untrusted jailed root may
  change device permissions to writeable.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	3 weeks

Modified:
  head/sys/dev/acpica/acpi_hpet.c

Modified: head/sys/dev/acpica/acpi_hpet.c
==============================================================================
--- head/sys/dev/acpica/acpi_hpet.c	Wed Aug 17 09:12:02 2016	(r304278)
+++ head/sys/dev/acpica/acpi_hpet.c	Wed Aug 17 09:20:04 2016	(r304279)
@@ -762,14 +762,14 @@ hpet_attach(device_t dev)
 	mda.mda_devsw = &hpet_cdevsw;
 	mda.mda_uid = UID_ROOT;
 	mda.mda_gid = GID_WHEEL;
-	mda.mda_mode = 0600;
+	mda.mda_mode = 0644;
 	mda.mda_si_drv1 = sc;
 	error = make_dev_s(&mda, &sc->pdev, "hpet%d", device_get_unit(dev));
 	if (error == 0) {
 		sc->mmap_allow = 1;
 		TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow",
 		    &sc->mmap_allow);
-		sc->mmap_allow_write = 1;
+		sc->mmap_allow_write = 0;
 		TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow_write",
 		    &sc->mmap_allow_write);
 		SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608170920.u7H9K5FS049768>