CVS commit: src/lib/libwrap

2019-01-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 14 03:30:25 UTC 2019

Modified Files:
src/lib/libwrap: expandm.c

Log Message:
Whitespace (indent with tabs, rather than spaces), and rearrange one
line that needed wrapping so it no longer does, and is (IMO) clearer.
WHile here, note that this was created in 2019, not 2018, for the
copyright notice...

NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libwrap/expandm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libwrap/expandm.c
diff -u src/lib/libwrap/expandm.c:1.7 src/lib/libwrap/expandm.c:1.8
--- src/lib/libwrap/expandm.c:1.7	Sun Jan 13 06:10:34 2019
+++ src/lib/libwrap/expandm.c	Mon Jan 14 03:30:25 2019
@@ -1,7 +1,7 @@
-/*	$NetBSD: expandm.c,v 1.7 2019/01/13 06:10:34 kre Exp $	*/
+/*	$NetBSD: expandm.c,v 1.8 2019/01/14 03:30:25 kre Exp $	*/
 
 /*-
- * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: expandm.c,v 1.7 2019/01/13 06:10:34 kre Exp $");
+__RCSID("$NetBSD: expandm.c,v 1.8 2019/01/14 03:30:25 kre Exp $");
 
 #include 
 #include 
@@ -53,27 +53,26 @@ expandm(const char *fmt, const char *sf,
 	char *buf, *m, *nbuf;
 	const char *ptr;
 
-	for (ptr = fmt, buf = NULL; (m = strstr(ptr, "%m")) != NULL;
-	ptr = m + 2)
-	{
+	buf = NULL;
+	for (ptr = fmt; (m = strstr(ptr, "%m")) != NULL; ptr = m + 2) {
 		size_t cnt = 0;
 
 		for (char *p = m; p >= ptr && *p == '%'; p--)
 			cnt++;
 
-   if (__predict_false((m - ptr) >= INT_MAX)) {
-size_t blen = buf ? strlen(buf) : 0;
-size_t nlen = (size_t)(m - ptr);
-
-nbuf = realloc(buf, blen + nlen + 1);
-if (nbuf == NULL)
-goto out;
-
-memcpy(nbuf + blen, ptr, nlen);
-nbuf[blen + nlen] = '\0';
-ptr += nlen;
-buf = nbuf;
-}
+		if (__predict_false((m - ptr) >= INT_MAX)) {
+			size_t blen = buf ? strlen(buf) : 0;
+			size_t nlen = (size_t)(m - ptr);
+
+			nbuf = realloc(buf, blen + nlen + 1);
+			if (nbuf == NULL)
+goto out;
+
+			memcpy(nbuf + blen, ptr, nlen);
+			nbuf[blen + nlen] = '\0';
+			ptr += nlen;
+			buf = nbuf;
+		}
 
 		if (__predict_true(e == NULL && (cnt & 1) != 0))
 			e = strerror(err);



CVS commit: src/lib/libwrap

2019-01-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 14 03:30:25 UTC 2019

Modified Files:
src/lib/libwrap: expandm.c

Log Message:
Whitespace (indent with tabs, rather than spaces), and rearrange one
line that needed wrapping so it no longer does, and is (IMO) clearer.
WHile here, note that this was created in 2019, not 2018, for the
copyright notice...

NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libwrap/expandm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/etc

2019-01-13 Thread Robert Elz
Date:Mon, 14 Jan 2019 11:59:51 +1100
From:matthew green 
Message-ID:  <10889.1547427...@splode.eterna.com.au>

  | i don't agree with this.
  |
  | if we were going to make things easy for naive users

I didn't say "easy" for naive users, I said "most useful".   That might
mean "suitably secure" rather than "simply works" and is a different
discussion.

One possibility here, might be to make configuration classes,
like "laptop" "workstation" "server" (whatever we want) and
have different default configurations for different system types,
so while I certainly wouldn't let non-root be configuring my servers
in any way at all, I don't really want to be root in order to
configure my laptop (at least to decide which wireless SSID
it should connect to, or when wireless should be disabled
when I am on a plane).

We could also have different security levels, "locked down",
"adequate", "better than nothing", and "absent" and have
different default configurations for those as well.

And then it would be easy for sysint to ask the user which
type of system this is (it would often be able to intuit a
reasonable default from the config) and what level of
security they want, and set those at the the same time it
is setting rc_configured=YES.

Aside from working out exactly what the values for the
various configs should be for whatever different modes
we create, all of this is trivial.

kre



Re: CVS commit: src/etc

2019-01-13 Thread Greg Troxel
matthew green  writes:

> (i wouldn't pick 'wheel' as this group -- i would invent a
> new group either called 'net' or 'wpa', with no underscore
> since they're designed to be assigned, unlike the groups
> for specific programs security models.)

Are you saying that you are ok with the following:

   add a new group "net"

   by default, nobody is in it

   it's ok for things that modify networking config to allow this to be
   done by users in group net, in addition to root

   (so therefore, absent configuration by root, there are no additional
   privileges compared to now)

?

If so, that seems like a reasonable compromise compared to letting wheel
modify networking, and calling it "net" lets this be a logical privilege
in general, even if wpa config is the only thing right now.


Re: CVS commit: src/etc

2019-01-13 Thread Jason Thorpe



> On Jan 13, 2019, at 5:08 PM, David Holland 
>  wrote:
> 
> Is there a way we could, for example, leverage the current hacks for
> chowning console devices to grant access to wpa_supplicant?

Some of this could be achieved with ttyaction(5), certainly.

-- thorpej



Re: CVS commit: src/etc

2019-01-13 Thread David Holland
On Mon, Jan 14, 2019 at 09:42:54AM +1100, matthew green wrote:
 > it would be OK if this was _read-only_ access to network
 > configuration, but one should never be allowed to change the
 > it unless root.

In the long run, it's quite helpful for laptops to be able to adjust
the network configuration from a GUI on the console without having to
run GUI bits as root. We aren't in a position to do this correctly
(nor does importing the likes of polkit as a hack to allow reasoning
about being "on the console" constitute correctly) but let's not lose
track of it as a goal.

Is there a way we could, for example, leverage the current hacks for
chowning console devices to grant access to wpa_supplicant?

-- 
David A. Holland
dholl...@netbsd.org


re: CVS commit: src/etc

2019-01-13 Thread matthew green
>   | i don't want to allow [...]
> 
> People, once again, a big meaningless discussion on what the
> default configuration should be.We should work out what will
> be most useful to most naive users, and make that be the default,
> regardless of what any of us want.

i don't agree with this.

if we were going to make things easy for naive users we'd give
up almost any pretense of security at all.  i'm not talking about
general configuration, but security configuration.

AFAICT, we care a lot about security.  allowing network configuration
to be done by some new class of users is not what i consider a
secure default.  at the very least, this point must be considered
and chosen, rather than some contested commit enabling it.

infact, i was trying to say it would be great if this worked better
out of the box -- but i don't see why non-root should be allowed to
change network configuration by default.  wheel is a stepping stone
in the security layering, please don't skip over it.


.mrg.


Re: CVS commit: src/etc

2019-01-13 Thread Robert Elz
In my previous message, I forgot to also note that if
modifying (if required) wpa_supplicant to create the
socket with the ownership & permissions set in the
rc.conf file is too hard (would create issues with importing
new versions easily) then the same can be accomplished
by putting the socket in a sub-dir (it is already I believe)
and applying the permissions to the gating directory,
then the socket just needs to be made 666 mode and
we're all happy.

And incidentally, why is (even before the recent
changes, I haven't updated to those in systems I
use yet) the socket created 770 mode ?   What does
'x' mean to a socket?   Does that have some magic
meaning I'm unaware of, or is this just sloppy?

kre



re: CVS commit: src/tests/kernel

2019-01-13 Thread matthew green
> Modified Files:
>   src/tests/kernel: t_timeleft.c
> 
> Log Message:
> add call error checks, requested by mrg@

thanks!


Re: CVS commit: src/etc

2019-01-13 Thread Robert Elz
Date:Mon, 14 Jan 2019 09:42:54 +1100
From:matthew green 
Message-ID:  <11338.1547419...@splode.eterna.com.au>

  | > I suppose the real question is do we want to allow group access to 
  | > [...]

  | i don't want to allow [...]

People, once again, a big meaningless discussion on what the
default configuration should be.We should work out what will
be most useful to most naive users, and make that be the default,
regardless of what any of us want.

For the rest of us, what we need is the ability to configure to suit
our own desires.

So perhaps an rc.conf setting like

WPA_MODES=077:user:group

or something, to select the umask to use when creating the
socket (or the inverse to set the perms) and the user and
group that should own it.   Then just decide what is best
to set that to for the default config, and everyone here can
adjust as needed in our own systems.

For my personal preference (not to be considered when deciding
what is the default setup) I'd prefer wheel group to be able to config
the (wireless) network (which is all that is in question here, right?
nothing is allowing non-root to edit rc.conf or /etc/ifconfig.xx0)

On my phone I don't need to be root to decide which wireless net
to connect to, I can't imagine why I would need to be on my laptop.
But to each their own (ie: there is no need for anyone to explain why
they prefer what they prefer for their systems ... just stop demanding
that the default config be what you want on your system.)

I prefer wheel as the group, over creating a new one, not because a
new one is much harder to deal with, but if we keep creating new
specific groups (that people actually join, unlike the _ groups) then
eventually we'll reach the point where some users need to be in more
than NGROUPS groups, and things stop working (and as I recall,
NGROUPS being exceeded does not result in any obvious feedback).

kre



CVS commit: src/tests/kernel

2019-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 14 00:23:43 UTC 2019

Modified Files:
src/tests/kernel: t_timeleft.c

Log Message:
add call error checks, requested by mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/kernel/t_timeleft.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/kernel/t_timeleft.c
diff -u src/tests/kernel/t_timeleft.c:1.3 src/tests/kernel/t_timeleft.c:1.4
--- src/tests/kernel/t_timeleft.c:1.3	Sun Jan 13 10:36:57 2019
+++ src/tests/kernel/t_timeleft.c	Sun Jan 13 19:23:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: t_timeleft.c,v 1.3 2019/01/13 15:36:57 christos Exp $ */
+/* $NetBSD: t_timeleft.c,v 1.4 2019/01/14 00:23:43 christos Exp $ */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_timeleft.c,v 1.3 2019/01/13 15:36:57 christos Exp $");
+__RCSID("$NetBSD: t_timeleft.c,v 1.4 2019/01/14 00:23:43 christos Exp $");
 
 #include 
 #include 
@@ -91,9 +91,9 @@ tester(void (*fun)(struct timespec *))
 	ATF_REQUIRE(signal(SIGINT, sighandler) == 0);
 	ATF_REQUIRE(pthread_create(, NULL, runner, ) == 0);
 
-	nanosleep(, NULL);
-	pthread_kill(thr, SIGINT);
-	pthread_join(thr, NULL);
+	ATF_REQUIRE(nanosleep(, NULL) == 0);
+	ATF_REQUIRE(pthread_kill(thr, SIGINT) == 0);
+	ATF_REQUIRE(pthread_join(thr, NULL) == 0);
 	printf("Orig time %ju.%lu\n", (intmax_t)ts.tv_sec, ts.tv_nsec);
 	printf("Time left %ju.%lu\n", (intmax_t)i.ts.tv_sec, i.ts.tv_nsec);
 	ATF_REQUIRE(timespeccmp(, , <));



CVS commit: src/tests/kernel

2019-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 14 00:23:43 UTC 2019

Modified Files:
src/tests/kernel: t_timeleft.c

Log Message:
add call error checks, requested by mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/kernel/t_timeleft.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [pgoyette-compat] src/doc

2019-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Jan 14 00:16:32 UTC 2019

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Note the desire to return some callback functions to having a void
type, rather than int (changing them was necessary to use a common
return type for all callbacks).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.19 -r1.1.2.20 src/doc/TODO.compat-module

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/TODO.compat-module
diff -u src/doc/TODO.compat-module:1.1.2.19 src/doc/TODO.compat-module:1.1.2.20
--- src/doc/TODO.compat-module:1.1.2.19	Sun Jan 13 23:33:07 2019
+++ src/doc/TODO.compat-module	Mon Jan 14 00:16:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.compat-module,v 1.1.2.19 2019/01/13 23:33:07 pgoyette Exp $ */
+/* $NetBSD: TODO.compat-module,v 1.1.2.20 2019/01/14 00:16:32 pgoyette Exp $ */
 
 DONE
 
@@ -103,3 +103,7 @@ TODO - Not required for branch merge
 deal with them appropriately.  For now, we simply ensure that they
 are included in every kernel via 'options COMPAT_UTILS' in file
 sys/conf/std
+
+22. Several hook callback routines have had their return type changed
+from "void" to "int" in order to provide a common type in the
+hook structure.  Ideally, I'd like to revert these back to "void".



CVS commit: [pgoyette-compat] src/doc

2019-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Jan 14 00:16:32 UTC 2019

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Note the desire to return some callback functions to having a void
type, rather than int (changing them was necessary to use a common
return type for all callbacks).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.19 -r1.1.2.20 src/doc/TODO.compat-module

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/sparc/conf

2019-01-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jan 14 00:13:18 UTC 2019

Modified Files:
src/sys/arch/sparc/conf: GENERIC KRUPS

Log Message:
normalise comment for fileassoc(8).  from PR#44873.


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/sys/arch/sparc/conf/GENERIC
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/sparc/conf/KRUPS

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/conf/GENERIC
diff -u src/sys/arch/sparc/conf/GENERIC:1.262 src/sys/arch/sparc/conf/GENERIC:1.263
--- src/sys/arch/sparc/conf/GENERIC:1.262	Wed Dec 19 13:57:49 2018
+++ src/sys/arch/sparc/conf/GENERIC	Mon Jan 14 00:13:18 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.262 2018/12/19 13:57:49 maxv Exp $
+# $NetBSD: GENERIC,v 1.263 2019/01/14 00:13:18 mrg Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/sparc/conf/std.sparc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.262 $"
+#ident 		"GENERIC-$Revision: 1.263 $"
 
 maxusers	32
 
@@ -712,7 +712,7 @@ pseudo-device	wsmux			# mouse and keyboa
 pseudo-device	wsfont
 pseudo-device	putter			# for puffs and pud
 
-#options 	FILEASSOC		# fileassoc(9)
+#options 	FILEASSOC		# fileassoc(9) - required for Veriexec
 	# and PAX_SEGVGUARD
 
 # Veriexec

Index: src/sys/arch/sparc/conf/KRUPS
diff -u src/sys/arch/sparc/conf/KRUPS:1.78 src/sys/arch/sparc/conf/KRUPS:1.79
--- src/sys/arch/sparc/conf/KRUPS:1.78	Wed Dec 19 13:57:49 2018
+++ src/sys/arch/sparc/conf/KRUPS	Mon Jan 14 00:13:18 2019
@@ -1,4 +1,4 @@
-# $NetBSD: KRUPS,v 1.78 2018/12/19 13:57:49 maxv Exp $
+# $NetBSD: KRUPS,v 1.79 2019/01/14 00:13:18 mrg Exp $
 # From: NetBSD: GENERIC,v 1.197 2006/12/04 23:43:35 elad Exp
 #
 # Krups (JavaStation-NC) machine description file
@@ -8,7 +8,7 @@ include 	"arch/sparc/conf/std.sparc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"KRUPS-$Revision: 1.78 $"
+#ident 		"KRUPS-$Revision: 1.79 $"
 
 maxusers	32
 
@@ -339,7 +339,7 @@ pseudo-device	putter			# for puffs and p
 
 #pseudo-device	fss			# file system snapshot device
 
-#options 	FILEASSOC		# fileassoc(9)
+#options 	FILEASSOC		# fileassoc(9) - required for Veriexec
 	# and PAX_SEGVGUARD
 
 # Veriexec



CVS commit: src/sys/arch/sparc/conf

2019-01-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jan 14 00:13:18 UTC 2019

Modified Files:
src/sys/arch/sparc/conf: GENERIC KRUPS

Log Message:
normalise comment for fileassoc(8).  from PR#44873.


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/sys/arch/sparc/conf/GENERIC
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/sparc/conf/KRUPS

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



re: CVS commit: src/tests/kernel

2019-01-13 Thread Christos Zoulas
On Jan 14,  9:29am, m...@eterna.com.au (matthew green) wrote:
-- Subject: re: CVS commit: src/tests/kernel

| "Christos Zoulas" writes:
| > Module Name:src
| > Committed By:   christos
| > Date:   Sun Jan 13 15:36:57 UTC 2019
| > 
| > Modified Files:
| > src/tests/kernel: t_timeleft.c
| > 
| > Log Message:
| > Increase the timeout a bit, and make sure we join so that there is no
| > race.
| 
| i notice both pthread_kill() and pthread_join() calls here do 
| not have their return value checked.
| 
| any particular reason?  shouldn't their failiure also be a
| test failure?

Nope, I will add them.

christos


CVS commit: [pgoyette-compat] src/doc

2019-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 13 23:33:07 UTC 2019

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Note that rtsock_50 is now functional, even though the implementation
remains sub-optimal.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/doc/TODO.compat-module

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [pgoyette-compat] src/doc

2019-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 13 23:33:07 UTC 2019

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Note that rtsock_50 is now functional, even though the implementation
remains sub-optimal.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/doc/TODO.compat-module

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/TODO.compat-module
diff -u src/doc/TODO.compat-module:1.1.2.18 src/doc/TODO.compat-module:1.1.2.19
--- src/doc/TODO.compat-module:1.1.2.18	Fri Oct 12 04:12:06 2018
+++ src/doc/TODO.compat-module	Sun Jan 13 23:33:07 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.compat-module,v 1.1.2.18 2018/10/12 04:12:06 pgoyette Exp $ */
+/* $NetBSD: TODO.compat-module,v 1.1.2.19 2019/01/13 23:33:07 pgoyette Exp $ */
 
 DONE
 
@@ -55,22 +55,19 @@ DONE
 framework, and split version-specific code from baseline code as
 needed.
 
+16. While the rtsock_50 situation is still a disaster (rtsock_50.c
+#include-s the main rtsock.c code with various COMPAT_50-dependant
+macro definitions and redefinitions), the basic functionality
+works, and the compat_14 references to rtsock_50 routines seems to
+be correct.  The rtsock_50.c stuff should still be rewritten at
+some future time, but it's not urgent.
+
 TODO - Not required for branch merge
 
-16. Audit the entire code base for any remaining embedded #ifdef's for
+17. Audit the entire code base for any remaining embedded #ifdef's for
 COMPAT_xx.  When found, move the actual compat code into the compat
 hierarchy and replace originals with indirect (vectored) calls.
 
-17. The rtsock compat code is a disaster, with rtsock_50.c #include-ing
-the main rtsock.c code with various manipulations of the COMPAT_50
-macro.  Once rtsock is separated, compat_14 references to rtsock_50
-routines needs to be verified.
-
-Currently, this entire code is built for the monolithic COMPAT
-module, but there's no way to reach the entry points, so none of
-the compat code can be executed, neither on the branch nor on
-HEAD.
-
 18. The compat_60 module still needs some work for XEN systems.  We
 probably need some build infrastructure changes to ensure that
 XEN (and, for i386, XEN-PAE) modules are build with the correct



CVS commit: [pgoyette-compat] src/sys

2019-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 13 23:32:22 UTC 2019

Modified Files:
src/sys/compat/common [pgoyette-compat]: rtsock_50.c
src/sys/compat/net [pgoyette-compat]: if.h route.h
src/sys/kern [pgoyette-compat]: compat_stub.c
src/sys/net [pgoyette-compat]: route.h rtsock.c
src/sys/sys [pgoyette-compat]: compat_stub.h

Log Message:
Add the required hooks for rtsock_50 and modify the COMPATCALL() macro
to use the hooks.  While the rtsock_50 situation is still sub-optimal
(it includes the main rtsock.c with a whole bunch of function and
variable redefinitions via macros), this at least makes it possible to
load the rtsock_50 code separately from more recent code, rather than
the previous requirement that rtsock_50 be built-in.


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/compat/common/rtsock_50.c
cvs rdiff -u -r1.4.14.1 -r1.4.14.2 src/sys/compat/net/if.h
cvs rdiff -u -r1.2.14.1 -r1.2.14.2 src/sys/compat/net/route.h
cvs rdiff -u -r1.1.2.34 -r1.1.2.35 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.117.2.3 -r1.117.2.4 src/sys/net/route.h
cvs rdiff -u -r1.238.2.17 -r1.238.2.18 src/sys/net/rtsock.c
cvs rdiff -u -r1.1.2.46 -r1.1.2.47 src/sys/sys/compat_stub.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/rtsock_50.c
diff -u src/sys/compat/common/rtsock_50.c:1.6.2.2 src/sys/compat/common/rtsock_50.c:1.6.2.3
--- src/sys/compat/common/rtsock_50.c:1.6.2.2	Fri Jan 11 06:27:45 2019
+++ src/sys/compat/common/rtsock_50.c	Sun Jan 13 23:32:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_50.c,v 1.6.2.2 2019/01/11 06:27:45 pgoyette Exp $	*/
+/*	$NetBSD: rtsock_50.c,v 1.6.2.3 2019/01/13 23:32:21 pgoyette Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.6.2.2 2019/01/11 06:27:45 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.6.2.3 2019/01/13 23:32:21 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -80,7 +80,7 @@ __KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,
 #include 
 #include 
 
-void
+int
 compat_50_rt_oifmsg(struct ifnet *ifp)
 {
 	struct if_msghdr50 oifm;
@@ -88,7 +88,7 @@ compat_50_rt_oifmsg(struct ifnet *ifp)
 	struct rt_addrinfo info;
 
 	if (COMPATNAME(route_info).ri_cb.any_count == 0)
-		return;
+		return 0;
 	(void)memset(, 0, sizeof(info));
 	(void)memset(, 0, sizeof(oifm));
 	oifm.ifm_index = ifp->if_index;
@@ -116,8 +116,10 @@ compat_50_rt_oifmsg(struct ifnet *ifp)
 	oifm.ifm_addrs = 0;
 	m = COMPATNAME(rt_msg1)(RTM_OIFINFO, , (void *), sizeof(oifm));
 	if (m == NULL)
-		return;
+		return 0;
 	COMPATNAME(route_enqueue)(m, 0);
+
+	return 0;
 }
 
 int
@@ -158,19 +160,52 @@ compat_50_iflist(struct ifnet *ifp, stru
 	return 0;
 }
 
-MODULE_SET_HOOK(rtsock_50_hook, "rts_50", compat_50_iflist);
-MODULE_UNSET_HOOK(rtsock_50_hook); 
- 
+MODULE_SET_HOOK(rtsock_50_iflist_hook, "rts_50", compat_50_iflist);
+MODULE_UNSET_HOOK(rtsock_50_iflist_hook); 
+
+MODULE_SET_HOOK(rtsock_50_oifmsg_hook, "rts_50", compat_50_rt_oifmsg);
+MODULE_UNSET_HOOK(rtsock_50_oifmsg_hook); 
+
+MODULE_SET_HOOK(rtsock_50_rt_missmsg_hook, "rts_50", compat_50_rt_missmsg);
+MODULE_UNSET_HOOK(rtsock_50_rt_missmsg_hook); 
+
+MODULE_SET_HOOK(rtsock_50_rt_ifmsg_hook, "rts_50", compat_50_rt_ifmsg);
+MODULE_UNSET_HOOK(rtsock_50_rt_ifmsg_hook); 
+
+MODULE_SET_HOOK(rtsock_50_rt_newaddrmsg_hook, "rts_50",
+compat_50_rt_newaddrmsg);
+MODULE_UNSET_HOOK(rtsock_50_rt_newaddrmsg_hook); 
+
+MODULE_SET_HOOK(rtsock_50_rt_ifannouncemsg_hook, "rts_50",
+compat_50_rt_ifannouncemsg);
+MODULE_UNSET_HOOK(rtsock_50_rt_ifannouncemsg_hook); 
+
+MODULE_SET_HOOK(rtsock_50_rt_ieee80211msg_hook, "rts_50",
+compat_50_rt_ieee80211msg);
+MODULE_UNSET_HOOK(rtsock_50_rt_ieee80211msg_hook); 
+
 void
 rtsock_50_init(void)
 {
  
-	rtsock_50_hook_set();
+	rtsock_50_iflist_hook_set();
+	rtsock_50_oifmsg_hook_set();
+	rtsock_50_rt_missmsg_hook_set();
+	rtsock_50_rt_ifmsg_hook_set();
+	rtsock_50_rt_newaddrmsg_hook_set();
+	rtsock_50_rt_ifannouncemsg_hook_set();
+	rtsock_50_rt_ieee80211msg_hook_set();
 }
  
 void
 rtsock_50_fini(void)
 {  
 
-	rtsock_50_hook_unset();
+	rtsock_50_iflist_hook_unset();
+	rtsock_50_oifmsg_hook_unset();
+	rtsock_50_rt_missmsg_hook_unset();
+	rtsock_50_rt_ifmsg_hook_unset();
+	rtsock_50_rt_newaddrmsg_hook_unset();
+	rtsock_50_rt_ifannouncemsg_hook_unset();
+	rtsock_50_rt_ieee80211msg_hook_unset();
 }

Index: src/sys/compat/net/if.h
diff -u src/sys/compat/net/if.h:1.4.14.1 src/sys/compat/net/if.h:1.4.14.2
--- src/sys/compat/net/if.h:1.4.14.1	Mon Sep 17 11:04:30 2018
+++ src/sys/compat/net/if.h	Sun Jan 13 23:32:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.4.14.1 2018/09/17 11:04:30 pgoyette Exp $	*/
+/*	$NetBSD: if.h,v 1.4.14.2 2019/01/13 23:32:21 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The 

CVS commit: [pgoyette-compat] src/sys

2019-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 13 23:32:22 UTC 2019

Modified Files:
src/sys/compat/common [pgoyette-compat]: rtsock_50.c
src/sys/compat/net [pgoyette-compat]: if.h route.h
src/sys/kern [pgoyette-compat]: compat_stub.c
src/sys/net [pgoyette-compat]: route.h rtsock.c
src/sys/sys [pgoyette-compat]: compat_stub.h

Log Message:
Add the required hooks for rtsock_50 and modify the COMPATCALL() macro
to use the hooks.  While the rtsock_50 situation is still sub-optimal
(it includes the main rtsock.c with a whole bunch of function and
variable redefinitions via macros), this at least makes it possible to
load the rtsock_50 code separately from more recent code, rather than
the previous requirement that rtsock_50 be built-in.


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/compat/common/rtsock_50.c
cvs rdiff -u -r1.4.14.1 -r1.4.14.2 src/sys/compat/net/if.h
cvs rdiff -u -r1.2.14.1 -r1.2.14.2 src/sys/compat/net/route.h
cvs rdiff -u -r1.1.2.34 -r1.1.2.35 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.117.2.3 -r1.117.2.4 src/sys/net/route.h
cvs rdiff -u -r1.238.2.17 -r1.238.2.18 src/sys/net/rtsock.c
cvs rdiff -u -r1.1.2.46 -r1.1.2.47 src/sys/sys/compat_stub.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



re: CVS commit: src/etc

2019-01-13 Thread matthew green
Roy Marples writes:
> On 13/01/2019 10:20, matthew green wrote:
> > shouldn't one need to be root to modify network configuration?
> > i shouldn't be able to tell wpa_supplicant to do something as
> > non-root, in a default install.
> 
> In a default install the only member of wheel is root and wpa_supplicant 
> is not started.
> 
> I suppose the real question is do we want to allow group access to 
> wpa_supplicant and if so which group if not wheel?
> 
> If we don't want to allow group access I may as well revert my changes 
> and setup is then as before - the user is expected to configure 
> everything themselves and wpa_cli won't work by default. This would be a 
> shame as I've had a lot of positive feedback on this change already.

i don't want to allow configuration changes by non root.
that should be fairly obvious and not something anyone would
question.

group 'wheel' means access to root, not that it gives you
additional privs immediately.  if it did there would be no
point in having group 'wheel' -- may as well just make all
the wheel users uid 0, since that is the security provided.

it would be OK if this was _read-only_ access to network
configuration, but one should never be allowed to change the
it unless root.  ie, i'm not objecting to having a better
default wpa_supplicant configuration, but don't remove
security layers in the process.

(i wouldn't pick 'wheel' as this group -- i would invent a
new group either called 'net' or 'wpa', with no underscore
since they're designed to be assigned, unlike the groups
for specific programs security models.)


.mrg.


re: CVS commit: src/tests/kernel

2019-01-13 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Sun Jan 13 15:36:57 UTC 2019
> 
> Modified Files:
>   src/tests/kernel: t_timeleft.c
> 
> Log Message:
> Increase the timeout a bit, and make sure we join so that there is no
> race.

i notice both pthread_kill() and pthread_join() calls here do 
not have their return value checked.

any particular reason?  shouldn't their failiure also be a
test failure?


.mrg.


CVS commit: src/sys/arch/sparc/sparc

2019-01-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 13 22:11:11 UTC 2019

Modified Files:
src/sys/arch/sparc/sparc: pmap.c

Log Message:
switch sparc pmap lock to the scheme sparc64 uses:

- local IPL_NONE mutex for general pmap locking operations, not
  kernel lock.
- for pmap_activate()/pmap_deactivate(), switch to using the
  existing ctx_lock, and push handling of it into ctx_alloc() the
  ctx_free() callers.

fixes easy to trigger deadlocks on systems with >2 cpus.  without
this patch i usually hang during boot.  with it, i was able to
push the machine hard for over 12 hours.

XXX: pullup-8, and maybe -7.


To generate a diff of this commit:
cvs rdiff -u -r1.365 -r1.366 src/sys/arch/sparc/sparc/pmap.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/arch/sparc/sparc/pmap.c
diff -u src/sys/arch/sparc/sparc/pmap.c:1.365 src/sys/arch/sparc/sparc/pmap.c:1.366
--- src/sys/arch/sparc/sparc/pmap.c:1.365	Mon Sep  3 16:29:27 2018
+++ src/sys/arch/sparc/sparc/pmap.c	Sun Jan 13 22:11:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.365 2018/09/03 16:29:27 riastradh Exp $ */
+/*	$NetBSD: pmap.c,v 1.366 2019/01/13 22:11:11 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.365 2018/09/03 16:29:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.366 2019/01/13 22:11:11 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -176,8 +176,8 @@ paddr_t	vm_first_phys = (paddr_t)-1;
 paddr_t	vm_last_phys = 0;
 psize_t vm_num_phys;
 
-#define	PMAP_LOCK()	KERNEL_LOCK(1, NULL)
-#define	PMAP_UNLOCK()	KERNEL_UNLOCK_ONE(NULL)
+#define	PMAP_LOCK()	mutex_enter(_lock)
+#define	PMAP_UNLOCK()	mutex_exit(_lock)
 
 /*
  * Flags in pvlist.pv_flags.  Note that PV_MOD must be 1 and PV_REF must be 2
@@ -347,6 +347,7 @@ mmuq_insert_tail(struct mmuentry *head, 
 int	seginval;		/* [4/4c] the invalid segment number */
 int	reginval;		/* [4/3mmu] the invalid region number */
 
+static kmutex_t pmap_lock;
 static kmutex_t demap_lock;
 static bool	lock_available = false;	/* demap_lock has been initialized */
 
@@ -372,15 +373,15 @@ union ctxinfo {
 	struct	pmap *c_pmap;		/* pmap (if busy) */
 };
 
-static kmutex_t	ctx_lock;		/* lock for below */
+static kmutex_t	ctx_lock;		/* lock for below, and {,de}activate */
 union	ctxinfo *ctxinfo;		/* allocated at in pmap_bootstrap */
 union	ctxinfo *ctx_freelist;		/* context free list */
 int	ctx_kick;			/* allocation rover when none free */
 int	ctx_kickdir;			/* ctx_kick roves both directions */
 int	ncontext;			/* sizeof ctx_freelist */
 
-void	ctx_alloc(struct pmap *);
-void	ctx_free(struct pmap *);
+static void	ctx_alloc(struct pmap *);
+static void	ctx_free(struct pmap *);
 
 /*void *	vdumppages;	-* 32KB worth of reserved dump pages */
 
@@ -2121,7 +2122,7 @@ mmu_pagein(struct pmap *pm, vaddr_t va, 
  * This routine is only ever called from locore.s just after it has
  * saved away the previous process, so there are no active user windows.
  */
-void
+static void
 ctx_alloc(struct pmap *pm)
 {
 	union ctxinfo *c;
@@ -2133,6 +2134,8 @@ ctx_alloc(struct pmap *pm)
 	struct cpu_info *cpi;
 #endif
 
+	KASSERT(mutex_owned(_lock));
+
 /*XXX-GCC!*/gap_start=gap_end=0;
 #ifdef DEBUG
 	if (pm->pm_ctx)
@@ -2145,7 +2148,6 @@ ctx_alloc(struct pmap *pm)
 		gap_end = pm->pm_gap_end;
 	}
 
-	mutex_spin_enter(_lock);
 	if ((c = ctx_freelist) != NULL) {
 		ctx_freelist = c->c_nextfree;
 		cnum = c - ctxinfo;
@@ -2288,13 +2290,12 @@ ctx_alloc(struct pmap *pm)
 		setcontext4m(cnum);
 #endif /* SUN4M || SUN4D */
 	}
-	mutex_spin_exit(_lock);
 }
 
 /*
  * Give away a context.
  */
-void
+static void
 ctx_free(struct pmap *pm)
 {
 	union ctxinfo *c;
@@ -2303,6 +2304,8 @@ ctx_free(struct pmap *pm)
 	struct cpu_info *cpi;
 #endif
 
+	KASSERT(mutex_owned(_lock));
+
 	c = pm->pm_ctx;
 	ctx = pm->pm_ctxnum;
 	pm->pm_ctx = NULL;
@@ -2316,8 +2319,6 @@ ctx_free(struct pmap *pm)
 	}
 #endif /* SUN4 || SUN4C */
 
-	mutex_spin_enter(_lock);
-
 #if defined(SUN4M) || defined(SUN4D)
 	if (CPU_HAS_SRMMU) {
 		CPU_INFO_ITERATOR i;
@@ -2334,7 +2335,6 @@ ctx_free(struct pmap *pm)
 
 	c->c_nextfree = ctx_freelist;
 	ctx_freelist = c;
-	mutex_spin_exit(_lock);
 }
 
 
@@ -3070,6 +3070,7 @@ pmap_bootstrap(int nctx, int nregion, in
 	}
 
 	pmap_page_upload();
+	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_VM);
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_SCHED);
 	lock_available = true;
@@ -4392,7 +4393,9 @@ pmap_pmap_pool_dtor(void *arg, void *obj
 #endif
 
 	if ((c = pm->pm_ctx) != NULL) {
+		mutex_spin_enter(_lock);
 		ctx_free(pm);
+		mutex_spin_exit(_lock);
 	}
 
 #if defined(SUN4M) || defined(SUN4D)
@@ -4662,7 +4665,7 @@ pmap_remove(struct pmap *pm, vaddr_t va,
 	}
 
 	ctx = getcontext();
-	s = splvm();		/* XXX conservative */
+	s = splvm();
 	PMAP_LOCK();
 	for (; va < endva; va = nva) {
 		/* do one virtual 

CVS commit: src/sys/arch/sparc/sparc

2019-01-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 13 22:11:11 UTC 2019

Modified Files:
src/sys/arch/sparc/sparc: pmap.c

Log Message:
switch sparc pmap lock to the scheme sparc64 uses:

- local IPL_NONE mutex for general pmap locking operations, not
  kernel lock.
- for pmap_activate()/pmap_deactivate(), switch to using the
  existing ctx_lock, and push handling of it into ctx_alloc() the
  ctx_free() callers.

fixes easy to trigger deadlocks on systems with >2 cpus.  without
this patch i usually hang during boot.  with it, i was able to
push the machine hard for over 12 hours.

XXX: pullup-8, and maybe -7.


To generate a diff of this commit:
cvs rdiff -u -r1.365 -r1.366 src/sys/arch/sparc/sparc/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/xorg/lib/xkeyboard-config

2019-01-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jan 13 19:21:27 UTC 2019

Modified Files:
src/external/mit/xorg/lib/xkeyboard-config: xkeyboard-config.man

Log Message:
regen for 2.25


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man
diff -u src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man:1.4 src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man:1.5
--- src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man:1.4	Sun Mar 11 20:17:19 2018
+++ src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man	Sun Jan 13 19:21:27 2019
@@ -1,5 +1,5 @@
 .\" WARNING: this man page is autogenerated. Do not edit or you will lose all your changes.
-.TH XKEYBOARD-CONFIG 7 "xkeyboard-config 2.23.1" "X Version 11"
+.TH XKEYBOARD-CONFIG 7 "xkeyboard-config 2.25" "X Version 11"
 .SH NAME
 xkeyboard-config \- XKB data description files
 .SH DESCRIPTION
@@ -14,7 +14,7 @@ ___
 lB l.
 Model	Description
 pc101	Generic 101-key PC
-pc102	Generic 101-key PC (intl.)
+pc102	Generic 102-key PC (intl.)
 pc104	Generic 104-key PC
 pc105	Generic 105-key PC (intl.)
 dell101	Dell 101-key PC
@@ -313,11 +313,11 @@ in(mal_lalitha)	Malayalam (Lalitha)
 in(mal_enhanced)	Malayalam (enhanced Inscript, with rupee)
 in(ori)	Oriya
 in(olck)	Ol Chiki
-in(tam_unicode)	Tamil (Unicode)
-in(tam_keyboard_with_numerals)	Tamil (keyboard with numerals)
-in(tam_TAB)	Tamil (TAB typewriter)
-in(tam_TSCII)	Tamil (TSCII typewriter)
-in(tam)	Tamil
+in(tam_tamilnet)	Tamil (TamilNet '99)
+in(tam_tamilnet_with_tam_nums)	Tamil (TamilNet '99 with Tamil numerals)
+in(tam_tamilnet_TAB)	Tamil (TamilNet '99, TAB encoding)
+in(tam_tamilnet_TSCII)	Tamil (TamilNet '99, TSCII encoding)
+in(tam)	Tamil (Inscript)
 in(tel)	Telugu
 in(tel-kagapa)	Telugu (KaGaPa phonetic)
 in(tel-sarala)	Telugu (Sarala)
@@ -377,6 +377,7 @@ cm(mmuock)	Mmuock
 
 _
 mm	Burmese
+mm(zawgyi)	Burmese Zawgyi
 
 _
 ca	French (Canada)
@@ -396,6 +397,7 @@ cn	Chinese
 cn(tib)	Tibetan
 cn(tib_asciinum)	Tibetan (with ASCII numerals)
 cn(ug)	Uyghur
+cn(altgr-pinyin)	Hanyu Pinyin (altgr)
 
 _
 hr	Croatian
@@ -482,6 +484,7 @@ fr(azerty)	French (AZERTY)
 fr(bre)	French (Breton)
 fr(oci)	Occitan
 fr(geo)	Georgian (France, AZERTY Tskapo)
+fr(us)	French (US keyboard with French letters)
 
 _
 gh	English (Ghana)
@@ -598,6 +601,7 @@ kz	Kazakh
 kz(ruskaz)	Russian (Kazakhstan, with Kazakh)
 kz(kazrus)	Kazakh (with Russian)
 kz(ext)	Kazakh (extended)
+kz(latin)	Kazakh (Latin)
 
 _
 la	Lao
@@ -760,6 +764,7 @@ se(smi)	Northern Saami (Sweden)
 se(mac)	Swedish (Macintosh)
 se(svdvorak)	Swedish (Svdvorak)
 se(us_dvorak)	Swedish (based on US Intl. Dvorak)
+se(us)	Swedish (US, with Swedish letters)
 se(swl)	Swedish Sign Language
 
 _
@@ -787,8 +792,8 @@ tj(legacy)	Tajik (legacy)
 
 _
 lk	Sinhala (phonetic)
-lk(tam_unicode)	Tamil (Sri Lanka, Unicode)
-lk(tam_TAB)	Tamil (Sri Lanka, TAB Typewriter)
+lk(tam_unicode)	Tamil (Sri Lanka, TamilNet '99)
+lk(tam_TAB)	Tamil (Sri Lanka, TamilNet '99, TAB encoding)
 lk(us)	Sinhala (US, with Sinhala letters)
 
 _
@@ -840,6 +845,8 @@ uz(latin)	Uzbek (Latin)
 
 _
 vn	Vietnamese
+vn(us)	Vietnamese (US, with Vietnamese letters)
+vn(fr)	Vietnamese (French, with Vietnamese letters)
 
 _
 kr	Korean
@@ -1305,7 +1312,6 @@ lB lB
 ___
 lB l.
 Option	Description
-korean:hw_keys	Hardware Hangul/Hanja keys
 korean:ralt_rctrl	Right Alt as Hangul, right Ctrl as Hanja
 korean:rctrl_ralt	Right Ctrl as Hangul, right Alt as Hanja
 



CVS commit: src/external/mit/xorg/lib/xkeyboard-config

2019-01-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jan 13 19:21:27 UTC 2019

Modified Files:
src/external/mit/xorg/lib/xkeyboard-config: xkeyboard-config.man

Log Message:
regen for 2.25


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/games/fortune/datfiles

2019-01-13 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 13 17:55:03 UTC 2019

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
Incite the "Purple Cow" wrath of Gelett Burgess upon ourselves.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/games/fortune/datfiles/fortunes

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/fortune/datfiles/fortunes
diff -u src/games/fortune/datfiles/fortunes:1.76 src/games/fortune/datfiles/fortunes:1.77
--- src/games/fortune/datfiles/fortunes:1.76	Sat Dec 15 22:00:16 2018
+++ src/games/fortune/datfiles/fortunes	Sun Jan 13 17:55:03 2019
@@ -16244,3 +16244,12 @@ Rule 1 of cryptanalysis: check for plain
 Remember kids, the only difference between Science and screwing around is
 writing it down.
 		-- Adam Savage
+%
+	 THE PURPLE COW		Confession: and a Portrait, Too,
+Reflections on a Mythic Beast,		Upon a Background that I Rue!
+Who's Quite Remarkable, at Least.
+	Ah, yes! I wrote the "Purple Cow"--
+I never saw a Purple Cow;		I'm sorry, now, I wrote it!
+I never hope to see one;		But I can tell you, anyhow,
+But I can tell you, anyhow,		I'll kill you if you quote it!
+I'd rather see than be one.-- Gelett Burgess



CVS commit: src/games/fortune/datfiles

2019-01-13 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 13 17:55:03 UTC 2019

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
Incite the "Purple Cow" wrath of Gelett Burgess upon ourselves.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/games/fortune/datfiles/fortunes

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/xstr

2019-01-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 13 16:48:51 UTC 2019

Modified Files:
src/usr.bin/xstr: xstr.1

Log Message:
.Pp before .Bd is redundant.
>From Edgar Pettijohn.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xstr/xstr.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xstr/xstr.1
diff -u src/usr.bin/xstr/xstr.1:1.19 src/usr.bin/xstr/xstr.1:1.20
--- src/usr.bin/xstr/xstr.1:1.19	Mon Jul  3 21:34:22 2017
+++ src/usr.bin/xstr/xstr.1	Sun Jan 13 16:48:51 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: xstr.1,v 1.19 2017/07/03 21:34:22 wiz Exp $
+.\"	$NetBSD: xstr.1,v 1.20 2019/01/13 16:48:51 uwe Exp $
 .\"
 .\" Copyright (c) 1980, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -118,7 +118,6 @@ which may not, in fact, be needed.
 An appropriate command sequence for running
 .Nm
 after the C preprocessor is:
-.Pp
 .Bd -literal -offset indent
 $ cc \-E name.c | xstr \-c \-
 $ cc \-c x.c



CVS commit: src/usr.bin/xstr

2019-01-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 13 16:48:51 UTC 2019

Modified Files:
src/usr.bin/xstr: xstr.1

Log Message:
.Pp before .Bd is redundant.
>From Edgar Pettijohn.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xstr/xstr.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/etc

2019-01-13 Thread Greg Troxel
Jason Thorpe  writes:

>> On Jan 13, 2019, at 5:21 AM, Greg Troxel  wrote:
>> 
>> Even if you have to be root, these changes are still hugely useful.
>> "sudo wpa_cli" is not that hard, even if it seems like it should not be
>> necessary.
>
> ...but made slightly more annoying seeing as how sudo is not part of the base 
> OS.

s/sudo wpa_cli/su root -c wpa_cli/

But yes, it is harder.  I had to read the su man page (back when I was
young, we didn't have sudo and had to use su uphill both ways after
toggling in the boot loader).


Re: CVS commit: src/etc

2019-01-13 Thread Jason Thorpe



> On Jan 13, 2019, at 5:21 AM, Greg Troxel  wrote:
> 
> Even if you have to be root, these changes are still hugely useful.
> "sudo wpa_cli" is not that hard, even if it seems like it should not be
> necessary.

...but made slightly more annoying seeing as how sudo is not part of the base 
OS.

-- thorpej



CVS commit: src/tests/kernel

2019-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 15:36:57 UTC 2019

Modified Files:
src/tests/kernel: t_timeleft.c

Log Message:
Increase the timeout a bit, and make sure we join so that there is no
race.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/kernel/t_timeleft.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/kernel/t_timeleft.c
diff -u src/tests/kernel/t_timeleft.c:1.2 src/tests/kernel/t_timeleft.c:1.3
--- src/tests/kernel/t_timeleft.c:1.2	Sat Dec 30 12:06:27 2017
+++ src/tests/kernel/t_timeleft.c	Sun Jan 13 10:36:57 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: t_timeleft.c,v 1.2 2017/12/30 17:06:27 martin Exp $ */
+/* $NetBSD: t_timeleft.c,v 1.3 2019/01/13 15:36:57 christos Exp $ */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_timeleft.c,v 1.2 2017/12/30 17:06:27 martin Exp $");
+__RCSID("$NetBSD: t_timeleft.c,v 1.3 2019/01/13 15:36:57 christos Exp $");
 
 #include 
 #include 
@@ -84,7 +84,7 @@ static void
 tester(void (*fun)(struct timespec *))
 {
 	const struct timespec ts = { 5, 0 };
-	const struct timespec sts = { 0, 200 };
+	const struct timespec sts = { 1, 0 };
 	struct info i = { fun, ts };
 	pthread_t thr;
 
@@ -93,6 +93,7 @@ tester(void (*fun)(struct timespec *))
 
 	nanosleep(, NULL);
 	pthread_kill(thr, SIGINT);
+	pthread_join(thr, NULL);
 	printf("Orig time %ju.%lu\n", (intmax_t)ts.tv_sec, ts.tv_nsec);
 	printf("Time left %ju.%lu\n", (intmax_t)i.ts.tv_sec, i.ts.tv_nsec);
 	ATF_REQUIRE(timespeccmp(, , <));



CVS commit: src/tests/kernel

2019-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 15:36:57 UTC 2019

Modified Files:
src/tests/kernel: t_timeleft.c

Log Message:
Increase the timeout a bit, and make sure we join so that there is no
race.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/kernel/t_timeleft.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/vfs

2019-01-13 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jan 13 14:35:00 UTC 2019

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
Mark the fs/vfs/t_renamerace:udf_renamerace_dirs test case as an
expected failure referencing PR kern/53865, and force failure to avoid
reports of unexpected success as it does not realiably fail under
qemu.  This makes the treatment of udf_renamerace_dirs the same as
that of udf_renamerace, only with a different PR.  Also, make
whitespace consistent between the two.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tests/fs/vfs/t_renamerace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/vfs/t_renamerace.c
diff -u src/tests/fs/vfs/t_renamerace.c:1.34 src/tests/fs/vfs/t_renamerace.c:1.35
--- src/tests/fs/vfs/t_renamerace.c:1.34	Fri Jan 13 21:30:40 2017
+++ src/tests/fs/vfs/t_renamerace.c	Sun Jan 13 14:35:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.34 2017/01/13 21:30:40 christos Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.35 2019/01/13 14:35:00 gson Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -147,9 +147,10 @@ renamerace_dirs(const atf_tc_t *tc, cons
 
 	if (FSTYPE_SYSVBFS(tc))
 		atf_tc_skip("directories not supported by file system");
-
 	if (FSTYPE_RUMPFS(tc))
 		atf_tc_skip("rename not supported by file system");
+	if (FSTYPE_UDF(tc))
+		atf_tc_expect_fail("PR kern/53865");
 
 	/* XXX: msdosfs also sometimes hangs */
 	if (FSTYPE_MSDOS(tc))
@@ -169,6 +170,9 @@ renamerace_dirs(const atf_tc_t *tc, cons
 	pthread_join(pt2, NULL);
 	RL(rump_sys_chdir("/"));
 
+	if (FSTYPE_UDF(tc))
+		atf_tc_fail("race did not trigger this time");
+
 	/*
 	 * Doesn't always trigger when run on a slow backend
 	 * (i.e. not on tmpfs/mfs).  So do the usual kludge.



CVS commit: src/tests/fs/vfs

2019-01-13 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jan 13 14:35:00 UTC 2019

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
Mark the fs/vfs/t_renamerace:udf_renamerace_dirs test case as an
expected failure referencing PR kern/53865, and force failure to avoid
reports of unexpected success as it does not realiably fail under
qemu.  This makes the treatment of udf_renamerace_dirs the same as
that of udf_renamerace, only with a different PR.  Also, make
whitespace consistent between the two.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tests/fs/vfs/t_renamerace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/etc

2019-01-13 Thread Greg Troxel
Roy Marples  writes:

> On 13/01/2019 10:20, matthew green wrote:
>> shouldn't one need to be root to modify network configuration?
>> i shouldn't be able to tell wpa_supplicant to do something as
>> non-root, in a default install.
>
> In a default install the only member of wheel is root and
> wpa_supplicant is not started.
>
> I suppose the real question is do we want to allow group access to
> wpa_supplicant and if so which group if not wheel?

That is indeed the real question.  As I see it wheel has historically
been a group for users that are system administrators, given how "su"
only allows users in wheel to su.  So it seems reasonable to allow
various configuration changes by users in wheel.

It seems the only point in putting somebody in wheel now is if you tell
them the root pw, to let them su.  Are there other reasons?

Another approach is to create a wpa_supplicant group, and allow wpa
changes by those in that group.  I can't see any reasonable objection to
this, other than group bloat.

> If we don't want to allow group access I may as well revert my changes
> and setup is then as before - the user is expected to configure
> everything themselves and wpa_cli won't work by default. This would be
> a shame as I've had a lot of positive feedback on this change already.

Even if you have to be root, these changes are still hugely useful.
"sudo wpa_cli" is not that hard, even if it seems like it should not be
necessary.


CVS commit: src/sys/arch/x86/include

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 12:19:09 UTC 2019

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Forgot to commit file along with identcpu.c::rev1.86.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/x86/include/specialreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.136 src/sys/arch/x86/include/specialreg.h:1.137
--- src/sys/arch/x86/include/specialreg.h:1.136	Mon Nov 26 04:43:37 2018
+++ src/sys/arch/x86/include/specialreg.h	Sun Jan 13 12:19:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.136 2018/11/26 04:43:37 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.137 2019/01/13 12:19:09 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -971,6 +971,9 @@
 #define 	DE_CFG_ERRATA_721	0x0001
 #define 	DE_CFG_ERRATA_1021	__BIT(13)
 
+#define MSR_BU_CFG2	0xc001102a
+#define 	BU_CFG2_CWPLUS_DIS	__BIT(24)
+
 #define MSR_LS_CFG2	0xc001102d
 #define 	LS_CFG2_ERRATA_1091	__BIT(34)
 



CVS commit: src/sys/arch/x86/include

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 12:19:09 UTC 2019

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Forgot to commit file along with identcpu.c::rev1.86.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/x86/include/specialreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/x86/x86

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 12:16:58 UTC 2019

Modified Files:
src/sys/arch/x86/x86: identcpu.c

Log Message:
On certain AMD f10h CPUs (like mine), the BIOS does not enable WC+. It
means that the guest pages that are WC+ become CD, and this degrades
performance of the guests.

Explicitly enable WC+.

While here clarify the AMD identification code.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/x86/x86/identcpu.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/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.85 src/sys/arch/x86/x86/identcpu.c:1.86
--- src/sys/arch/x86/x86/identcpu.c:1.85	Sun Jan  6 16:13:51 2019
+++ src/sys/arch/x86/x86/identcpu.c	Sun Jan 13 12:16:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.85 2019/01/06 16:13:51 maxv Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.86 2019/01/13 12:16:58 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.85 2019/01/06 16:13:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.86 2019/01/13 12:16:58 maxv Exp $");
 
 #include "opt_xen.h"
 
@@ -354,41 +354,51 @@ cpu_probe_amd_cache(struct cpu_info *ci)
 }
 
 static void
-cpu_probe_k5(struct cpu_info *ci)
+cpu_probe_amd(struct cpu_info *ci)
 {
+	uint64_t val;
 	int flag;
 
-	if (cpu_vendor != CPUVENDOR_AMD ||
-	CPUID_TO_FAMILY(ci->ci_signature) != 5)
+	if (cpu_vendor != CPUVENDOR_AMD)
+		return;
+	if (CPUID_TO_FAMILY(ci->ci_signature) < 5)
 		return;
 
-	if (CPUID_TO_MODEL(ci->ci_signature) == 0) {
+	switch (CPUID_TO_FAMILY(ci->ci_signature)) {
+	case 0x05: /* K5 */
+		if (CPUID_TO_MODEL(ci->ci_signature) == 0) {
+			/*
+			 * According to the AMD Processor Recognition App Note,
+			 * the AMD-K5 Model 0 uses the wrong bit to indicate
+			 * support for global PTEs, instead using bit 9 (APIC)
+			 * rather than bit 13 (i.e. "0x200" vs. 0x2000").
+			 */
+			flag = ci->ci_feat_val[0];
+			if ((flag & CPUID_APIC) != 0)
+flag = (flag & ~CPUID_APIC) | CPUID_PGE;
+			ci->ci_feat_val[0] = flag;
+		}
+		break;
+
+	case 0x10: /* Family 10h */
 		/*
-		 * According to the AMD Processor Recognition App Note,
-		 * the AMD-K5 Model 0 uses the wrong bit to indicate
-		 * support for global PTEs, instead using bit 9 (APIC)
-		 * rather than bit 13 (i.e. "0x200" vs. 0x2000".  Oops!).
+		 * On Family 10h, certain BIOSes do not enable WC+ support.
+		 * This causes WC+ to become CD, and degrades guest
+		 * performance at the NPT level.
+		 *
+		 * Explicitly enable WC+ if we're not a guest.
 		 */
-		flag = ci->ci_feat_val[0];
-		if ((flag & CPUID_APIC) != 0)
-			flag = (flag & ~CPUID_APIC) | CPUID_PGE;
-		ci->ci_feat_val[0] = flag;
+		if (!ISSET(ci->ci_feat_val[1], CPUID2_RAZ)) {
+			val = rdmsr(MSR_BU_CFG2);
+			val &= ~BU_CFG2_CWPLUS_DIS;
+			wrmsr(MSR_BU_CFG2, val);
+		}
+		break;
 	}
 
 	cpu_probe_amd_cache(ci);
 }
 
-static void
-cpu_probe_k678(struct cpu_info *ci)
-{
-
-	if (cpu_vendor != CPUVENDOR_AMD ||
-	CPUID_TO_FAMILY(ci->ci_signature) < 6)
-		return;
-
-	cpu_probe_amd_cache(ci);
-}
-
 static inline uint8_t
 cyrix_read_reg(uint8_t reg)
 {
@@ -956,8 +966,7 @@ cpu_probe(struct cpu_info *ci)
 	}
 
 	cpu_probe_intel(ci);
-	cpu_probe_k5(ci);
-	cpu_probe_k678(ci);
+	cpu_probe_amd(ci);
 	cpu_probe_cyrix(ci);
 	cpu_probe_winchip(ci);
 	cpu_probe_c3(ci);



CVS commit: src/sys/arch/x86/x86

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 12:16:58 UTC 2019

Modified Files:
src/sys/arch/x86/x86: identcpu.c

Log Message:
On certain AMD f10h CPUs (like mine), the BIOS does not enable WC+. It
means that the guest pages that are WC+ become CD, and this degrades
performance of the guests.

Explicitly enable WC+.

While here clarify the AMD identification code.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/x86/x86/identcpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libc/sys

2019-01-13 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jan 13 11:03:20 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Don't mark the traceme_vfork_crash_bus test case as an expected failure
when it is executing as part of the lib/libc/sys/t_ptrace_waitid test,
because that particular combination is not failing, at least not on amd64.
It is failing as part of other tests, so PR lib/53343 still applies.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/tests/lib/libc/sys/t_ptrace_wait.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libc/sys

2019-01-13 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jan 13 11:03:20 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Don't mark the traceme_vfork_crash_bus test case as an expected failure
when it is executing as part of the lib/libc/sys/t_ptrace_waitid test,
because that particular combination is not failing, at least not on amd64.
It is failing as part of other tests, so PR lib/53343 still applies.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/tests/lib/libc/sys/t_ptrace_wait.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.67 src/tests/lib/libc/sys/t_ptrace_wait.c:1.68
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.67	Mon Aug 13 22:59:52 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sun Jan 13 11:03:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.67 2018/08/13 22:59:52 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.68 2019/01/13 11:03:20 gson Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.67 2018/08/13 22:59:52 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.68 2019/01/13 11:03:20 gson Exp $");
 
 #include 
 #include 
@@ -870,7 +870,9 @@ traceme_vfork_crash(int sig)
 #endif
 
 	if (sig == SIGBUS) {
+#ifndef TWAIT_WAITID
 		atf_tc_expect_fail("lib/53343");
+#endif
 	}
 
 	DPRINTF("Before forking process PID=%d\n", getpid());



CVS commit: [pgoyette-compat] src/sys

2019-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 13 10:49:51 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep.c
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c
src/sys/arch/sparc/fpu [pgoyette-compat]: fpu.c
src/sys/arch/sparc64/sparc64 [pgoyette-compat]: netbsd32_machdep.c
src/sys/compat/common [pgoyette-compat]: if_43.c rtsock_14.c
rtsock_70.c tty_60.c usb_subr_30.c
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_kern_proc.c
netbsd32_module.c
src/sys/dev [pgoyette-compat]: bio.c ccd.c clockctl.c vnd.c
src/sys/dev/raidframe [pgoyette-compat]: rf_netbsdkintf.c
src/sys/dev/sysmon [pgoyette-compat]: sysmon_power.c
src/sys/dev/usb [pgoyette-compat]: ugen.c uhid.c usb.c
src/sys/dev/wscons [pgoyette-compat]: wsevent.c
src/sys/fs/puffs [pgoyette-compat]: puffs_compat.c puffs_msgif.c
src/sys/kern [pgoyette-compat]: compat_stub.c kern_proc.c kern_rndq.c
sys_module.c sysv_ipc.c tty.c tty_ptm.c uipc_usrreq.c
vfs_syscalls.c
src/sys/net [pgoyette-compat]: if.c if_spppsubr.c rtsock.c
src/sys/net80211 [pgoyette-compat]: ieee80211_ioctl.c
src/sys/opencrypto [pgoyette-compat]: cryptodev.c
src/sys/sys [pgoyette-compat]: compat_stub.h module_hook.h

Log Message:
Remove the HOOK2 versions of the MODULE_HOOK macros.  There were
only a few uses, and using them led to some lack of clarity in the
code.  Instead, we now use two separate hooks, with names that
make it clear(er) what we're doing.

This also positions us to start unraveling some of the rtsock_50
mess, which will need (at least) five hooks.


To generate a diff of this commit:
cvs rdiff -u -r1.115.2.12 -r1.115.2.13 \
src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.15.2.8 -r1.15.2.9 src/sys/arch/mips/mips/netbsd32_machdep.c
cvs rdiff -u -r1.27.46.1 -r1.27.46.2 src/sys/arch/sparc/fpu/fpu.c
cvs rdiff -u -r1.110.14.1 -r1.110.14.2 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.14.2.10 -r1.14.2.11 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.5.14.4 -r1.5.14.5 src/sys/compat/common/rtsock_14.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/compat/common/rtsock_70.c
cvs rdiff -u -r1.4.16.5 -r1.4.16.6 src/sys/compat/common/tty_60.c
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/compat/common/usb_subr_30.c
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/compat/netbsd32/netbsd32_kern_proc.c
cvs rdiff -u -r1.6.2.9 -r1.6.2.10 src/sys/compat/netbsd32/netbsd32_module.c
cvs rdiff -u -r1.13.16.5 -r1.13.16.6 src/sys/dev/bio.c
cvs rdiff -u -r1.175.2.8 -r1.175.2.9 src/sys/dev/ccd.c
cvs rdiff -u -r1.35.14.8 -r1.35.14.9 src/sys/dev/clockctl.c
cvs rdiff -u -r1.263.2.10 -r1.263.2.11 src/sys/dev/vnd.c
cvs rdiff -u -r1.356.2.6 -r1.356.2.7 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.58.2.5 -r1.58.2.6 src/sys/dev/sysmon/sysmon_power.c
cvs rdiff -u -r1.139.2.6 -r1.139.2.7 src/sys/dev/usb/ugen.c
cvs rdiff -u -r1.101.2.5 -r1.101.2.6 src/sys/dev/usb/uhid.c
cvs rdiff -u -r1.168.2.7 -r1.168.2.8 src/sys/dev/usb/usb.c
cvs rdiff -u -r1.37.2.6 -r1.37.2.7 src/sys/dev/wscons/wsevent.c
cvs rdiff -u -r1.4.16.3 -r1.4.16.4 src/sys/fs/puffs/puffs_compat.c
cvs rdiff -u -r1.101.10.6 -r1.101.10.7 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.1.2.33 -r1.1.2.34 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.209.2.10 -r1.209.2.11 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.89.16.4 -r1.89.16.5 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.23.2.13 -r1.23.2.14 src/sys/kern/sys_module.c
cvs rdiff -u -r1.32.16.6 -r1.32.16.7 src/sys/kern/sysv_ipc.c
cvs rdiff -u -r1.275.2.5 -r1.275.2.6 src/sys/kern/tty.c
cvs rdiff -u -r1.37.16.2 -r1.37.16.3 src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.183.2.6 -r1.183.2.7 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.518.2.2 -r1.518.2.3 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.419.2.18 -r1.419.2.19 src/sys/net/if.c
cvs rdiff -u -r1.179.2.7 -r1.179.2.8 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.238.2.16 -r1.238.2.17 src/sys/net/rtsock.c
cvs rdiff -u -r1.60.16.4 -r1.60.16.5 src/sys/net80211/ieee80211_ioctl.c
cvs rdiff -u -r1.98.2.7 -r1.98.2.8 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.1.2.45 -r1.1.2.46 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/sys/sys/module_hook.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.12 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.13
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.12	Wed Dec 26 14:01:31 2018
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Sun Jan 13 10:49:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.115.2.12 2018/12/26 14:01:31 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.115.2.13 2019/01/13 10:49:49 pgoyette Exp $	

CVS commit: [pgoyette-compat] src/sys

2019-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 13 10:49:51 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep.c
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c
src/sys/arch/sparc/fpu [pgoyette-compat]: fpu.c
src/sys/arch/sparc64/sparc64 [pgoyette-compat]: netbsd32_machdep.c
src/sys/compat/common [pgoyette-compat]: if_43.c rtsock_14.c
rtsock_70.c tty_60.c usb_subr_30.c
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_kern_proc.c
netbsd32_module.c
src/sys/dev [pgoyette-compat]: bio.c ccd.c clockctl.c vnd.c
src/sys/dev/raidframe [pgoyette-compat]: rf_netbsdkintf.c
src/sys/dev/sysmon [pgoyette-compat]: sysmon_power.c
src/sys/dev/usb [pgoyette-compat]: ugen.c uhid.c usb.c
src/sys/dev/wscons [pgoyette-compat]: wsevent.c
src/sys/fs/puffs [pgoyette-compat]: puffs_compat.c puffs_msgif.c
src/sys/kern [pgoyette-compat]: compat_stub.c kern_proc.c kern_rndq.c
sys_module.c sysv_ipc.c tty.c tty_ptm.c uipc_usrreq.c
vfs_syscalls.c
src/sys/net [pgoyette-compat]: if.c if_spppsubr.c rtsock.c
src/sys/net80211 [pgoyette-compat]: ieee80211_ioctl.c
src/sys/opencrypto [pgoyette-compat]: cryptodev.c
src/sys/sys [pgoyette-compat]: compat_stub.h module_hook.h

Log Message:
Remove the HOOK2 versions of the MODULE_HOOK macros.  There were
only a few uses, and using them led to some lack of clarity in the
code.  Instead, we now use two separate hooks, with names that
make it clear(er) what we're doing.

This also positions us to start unraveling some of the rtsock_50
mess, which will need (at least) five hooks.


To generate a diff of this commit:
cvs rdiff -u -r1.115.2.12 -r1.115.2.13 \
src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.15.2.8 -r1.15.2.9 src/sys/arch/mips/mips/netbsd32_machdep.c
cvs rdiff -u -r1.27.46.1 -r1.27.46.2 src/sys/arch/sparc/fpu/fpu.c
cvs rdiff -u -r1.110.14.1 -r1.110.14.2 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.14.2.10 -r1.14.2.11 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.5.14.4 -r1.5.14.5 src/sys/compat/common/rtsock_14.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/compat/common/rtsock_70.c
cvs rdiff -u -r1.4.16.5 -r1.4.16.6 src/sys/compat/common/tty_60.c
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/compat/common/usb_subr_30.c
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/compat/netbsd32/netbsd32_kern_proc.c
cvs rdiff -u -r1.6.2.9 -r1.6.2.10 src/sys/compat/netbsd32/netbsd32_module.c
cvs rdiff -u -r1.13.16.5 -r1.13.16.6 src/sys/dev/bio.c
cvs rdiff -u -r1.175.2.8 -r1.175.2.9 src/sys/dev/ccd.c
cvs rdiff -u -r1.35.14.8 -r1.35.14.9 src/sys/dev/clockctl.c
cvs rdiff -u -r1.263.2.10 -r1.263.2.11 src/sys/dev/vnd.c
cvs rdiff -u -r1.356.2.6 -r1.356.2.7 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.58.2.5 -r1.58.2.6 src/sys/dev/sysmon/sysmon_power.c
cvs rdiff -u -r1.139.2.6 -r1.139.2.7 src/sys/dev/usb/ugen.c
cvs rdiff -u -r1.101.2.5 -r1.101.2.6 src/sys/dev/usb/uhid.c
cvs rdiff -u -r1.168.2.7 -r1.168.2.8 src/sys/dev/usb/usb.c
cvs rdiff -u -r1.37.2.6 -r1.37.2.7 src/sys/dev/wscons/wsevent.c
cvs rdiff -u -r1.4.16.3 -r1.4.16.4 src/sys/fs/puffs/puffs_compat.c
cvs rdiff -u -r1.101.10.6 -r1.101.10.7 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.1.2.33 -r1.1.2.34 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.209.2.10 -r1.209.2.11 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.89.16.4 -r1.89.16.5 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.23.2.13 -r1.23.2.14 src/sys/kern/sys_module.c
cvs rdiff -u -r1.32.16.6 -r1.32.16.7 src/sys/kern/sysv_ipc.c
cvs rdiff -u -r1.275.2.5 -r1.275.2.6 src/sys/kern/tty.c
cvs rdiff -u -r1.37.16.2 -r1.37.16.3 src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.183.2.6 -r1.183.2.7 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.518.2.2 -r1.518.2.3 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.419.2.18 -r1.419.2.19 src/sys/net/if.c
cvs rdiff -u -r1.179.2.7 -r1.179.2.8 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.238.2.16 -r1.238.2.17 src/sys/net/rtsock.c
cvs rdiff -u -r1.60.16.4 -r1.60.16.5 src/sys/net80211/ieee80211_ioctl.c
cvs rdiff -u -r1.98.2.7 -r1.98.2.8 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.1.2.45 -r1.1.2.46 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/sys/sys/module_hook.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libnvmm

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 10:43:23 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm_x86.c

Log Message:
Handle more corner cases, clean up a little, and add a set of instructions
in Group1.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libnvmm/libnvmm_x86.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libnvmm/libnvmm_x86.c
diff -u src/lib/libnvmm/libnvmm_x86.c:1.14 src/lib/libnvmm/libnvmm_x86.c:1.15
--- src/lib/libnvmm/libnvmm_x86.c:1.14	Tue Jan  8 07:34:22 2019
+++ src/lib/libnvmm/libnvmm_x86.c	Sun Jan 13 10:43:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm_x86.c,v 1.14 2019/01/08 07:34:22 maxv Exp $	*/
+/*	$NetBSD: libnvmm_x86.c,v 1.15 2019/01/13 10:43:22 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -77,13 +77,15 @@ nvmm_vcpu_dump(struct nvmm_machine *mach
 	printf("| -> RAX=%p\n", (void *)state.gprs[NVMM_X64_GPR_RAX]);
 	printf("| -> RBX=%p\n", (void *)state.gprs[NVMM_X64_GPR_RBX]);
 	printf("| -> RCX=%p\n", (void *)state.gprs[NVMM_X64_GPR_RCX]);
+	printf("| -> RFLAGS=%p\n", (void *)state.gprs[NVMM_X64_GPR_RFLAGS]);
 	for (i = 0; i < NVMM_X64_NSEG; i++) {
-		printf("| -> %s: sel=0x%lx base=%p, limit=%p, P=%d, D=%d\n",
+		printf("| -> %s: sel=0x%lx base=%p, limit=%p, P=%d, D=%d L=%d\n",
 		segnames[i],
 		state.segs[i].selector,
 		(void *)state.segs[i].base,
 		(void *)state.segs[i].limit,
-		state.segs[i].attrib.p, state.segs[i].attrib.def32);
+		state.segs[i].attrib.p, state.segs[i].attrib.def32,
+		state.segs[i].attrib.lng);
 	}
 	printf("| -> MSR_EFER=%p\n", (void *)state.msrs[NVMM_X64_MSR_EFER]);
 	printf("| -> CR0=%p\n", (void *)state.crs[NVMM_X64_CR_CR0]);
@@ -392,7 +394,7 @@ x86_gva_to_gpa(struct nvmm_machine *mach
 	gva &= ~PAGE_MASK;
 
 	is_pae = (state->crs[NVMM_X64_CR_CR4] & CR4_PAE) != 0;
-	is_lng = (state->msrs[NVMM_X64_MSR_EFER] & EFER_LME) != 0;
+	is_lng = (state->msrs[NVMM_X64_MSR_EFER] & EFER_LMA) != 0;
 	has_pse = (state->crs[NVMM_X64_CR_CR4] & CR4_PSE) != 0;
 	cr3 = state->crs[NVMM_X64_CR_CR3];
 
@@ -437,6 +439,12 @@ nvmm_gva_to_gpa(struct nvmm_machine *mac
 /* -- */
 
 static inline bool
+is_long_mode(struct nvmm_x64_state *state)
+{
+	return (state->msrs[NVMM_X64_MSR_EFER] & EFER_LMA) != 0;
+}
+
+static inline bool
 is_64bit(struct nvmm_x64_state *state)
 {
 	return (state->segs[NVMM_X64_SEG_CS].attrib.lng != 0);
@@ -456,14 +464,8 @@ is_16bit(struct nvmm_x64_state *state)
 	(state->segs[NVMM_X64_SEG_CS].attrib.def32 == 0);
 }
 
-static inline bool
-is_long_mode(struct nvmm_x64_state *state)
-{
-	return (state->msrs[NVMM_X64_MSR_EFER] & EFER_LME) != 0;
-}
-
 static int
-segment_apply(struct nvmm_x64_state_seg *seg, gvaddr_t *gva, size_t size)
+segment_check(struct nvmm_x64_state_seg *seg, gvaddr_t gva, size_t size)
 {
 	uint64_t limit;
 
@@ -480,11 +482,10 @@ segment_apply(struct nvmm_x64_state_seg 
 		limit *= PAGE_SIZE;
 	}
 
-	if (__predict_false(*gva + size > limit)) {
+	if (__predict_false(gva + size > limit)) {
 		goto error;
 	}
 
-	*gva += seg->base;
 	return 0;
 
 error:
@@ -492,17 +493,25 @@ error:
 	return -1;
 }
 
-static uint64_t
-mask_from_adsize(size_t adsize)
+static inline void
+segment_apply(struct nvmm_x64_state_seg *seg, gvaddr_t *gva)
 {
-	switch (adsize) {
-	case 8:
-		return 0x;
-	case 4:
-		return 0x;
+	*gva += seg->base;
+}
+
+static inline uint64_t
+size_to_mask(size_t size)
+{
+	switch (size) {
+	case 1:
+		return 0x00FF;
 	case 2:
-	default: /* impossible */
 		return 0x;
+	case 4:
+		return 0x;
+	case 8:
+	default:
+		return 0x;
 	}
 }
 
@@ -511,7 +520,7 @@ rep_get_cnt(struct nvmm_x64_state *state
 {
 	uint64_t mask, cnt;
 
-	mask = mask_from_adsize(adsize);
+	mask = size_to_mask(adsize);
 	cnt = state->gprs[NVMM_X64_GPR_RCX] & mask;
 
 	return cnt;
@@ -522,28 +531,12 @@ rep_set_cnt(struct nvmm_x64_state *state
 {
 	uint64_t mask;
 
-	mask = mask_from_adsize(adsize);
+	/* XXX: should we zero-extend? */
+	mask = size_to_mask(adsize);
 	state->gprs[NVMM_X64_GPR_RCX] &= ~mask;
 	state->gprs[NVMM_X64_GPR_RCX] |= cnt;
 }
 
-static uint64_t
-rep_dec_apply(struct nvmm_x64_state *state, size_t adsize)
-{
-	uint64_t mask, cnt;
-
-	mask = mask_from_adsize(adsize);
-
-	cnt = state->gprs[NVMM_X64_GPR_RCX] & mask;
-	cnt -= 1;
-	cnt &= mask;
-
-	state->gprs[NVMM_X64_GPR_RCX] &= ~mask;
-	state->gprs[NVMM_X64_GPR_RCX] |= cnt;
-
-	return cnt;
-}
-
 static int
 read_guest_memory(struct nvmm_machine *mach, struct nvmm_x64_state *state,
 gvaddr_t gva, uint8_t *data, size_t size)
@@ -693,7 +686,7 @@ nvmm_assist_io(struct nvmm_machine *mach
 	uint64_t cnt = 0; /* GCC */
 	uint8_t iobuf[8];
 	int iocnt = 1;
-	gvaddr_t gva;
+	gvaddr_t gva = 0; /* GCC */
 	int reg = 0; /* GCC */
 	

CVS commit: src/lib/libnvmm

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 10:43:23 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm_x86.c

Log Message:
Handle more corner cases, clean up a little, and add a set of instructions
in Group1.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libnvmm/libnvmm_x86.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



re: CVS commit: src/etc

2019-01-13 Thread matthew green
shouldn't one need to be root to modify network configuration?
i shouldn't be able to tell wpa_supplicant to do something as
non-root, in a default install.


.mrg.


CVS commit: src/sys/dev/nvmm/x86

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 10:07:50 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_svm.c

Log Message:
Reset DR7 before loading DR0-3, to prevent a fault if the host process
has dbregs enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/nvmm/x86/nvmm_x86_svm.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/dev/nvmm/x86/nvmm_x86_svm.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.14 src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.15
--- src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.14	Thu Jan 10 06:58:36 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_svm.c	Sun Jan 13 10:07:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_svm.c,v 1.14 2019/01/10 06:58:36 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_svm.c,v 1.15 2019/01/13 10:07:50 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.14 2019/01/10 06:58:36 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.15 2019/01/13 10:07:50 maxv Exp $");
 
 #include 
 #include 
@@ -1128,6 +1128,8 @@ svm_vcpu_guest_dbregs_enter(struct nvmm_
 
 	x86_dbregs_save(curlwp);
 
+	ldr7(0);
+
 	ldr0(cpudata->drs[NVMM_X64_DR_DR0]);
 	ldr1(cpudata->drs[NVMM_X64_DR_DR1]);
 	ldr2(cpudata->drs[NVMM_X64_DR_DR2]);



CVS commit: src/sys/dev/nvmm/x86

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 10:07:50 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_svm.c

Log Message:
Reset DR7 before loading DR0-3, to prevent a fault if the host process
has dbregs enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/nvmm/x86/nvmm_x86_svm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/x86

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 10:01:07 UTC 2019

Modified Files:
src/sys/arch/x86/include: dbregs.h
src/sys/arch/x86/x86: dbregs.c

Log Message:
Error out if the higher 32 bits of DR6 and DR7 are set. MOV DR would
fault otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/include/dbregs.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x86/x86/dbregs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/x86

2019-01-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 13 10:01:07 UTC 2019

Modified Files:
src/sys/arch/x86/include: dbregs.h
src/sys/arch/x86/x86: dbregs.c

Log Message:
Error out if the higher 32 bits of DR6 and DR7 are set. MOV DR would
fault otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/include/dbregs.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x86/x86/dbregs.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/arch/x86/include/dbregs.h
diff -u src/sys/arch/x86/include/dbregs.h:1.7 src/sys/arch/x86/include/dbregs.h:1.8
--- src/sys/arch/x86/include/dbregs.h:1.7	Thu Sep 27 13:04:22 2018
+++ src/sys/arch/x86/include/dbregs.h	Sun Jan 13 10:01:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbregs.h,v 1.7 2018/09/27 13:04:22 maxv Exp $	*/
+/*	$NetBSD: dbregs.h,v 1.8 2019/01/13 10:01:07 maxv Exp $	*/
 
 /*
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -45,6 +45,7 @@
 #define X86_DR6_DEBUG_REGISTER_ACCESS_DETECTED		__BIT(13)
 #define X86_DR6_SINGLE_STEP__BIT(14)
 #define X86_DR6_TASK_SWITCH__BIT(15)
+#define X86_DR6_MBZ	__BITS(32, 63)
 
 /*
  * CPU Debug Control Register (DR7)
@@ -67,7 +68,6 @@
 #define X86_DR7_GLOBAL_EXACT_BREAKPOINT		__BIT(9)
 #define X86_DR7_RESTRICTED_TRANSACTIONAL_MEMORY	__BIT(11)
 #define X86_DR7_GENERAL_DETECT_ENABLE		__BIT(13)
-
 #define X86_DR7_DR0_CONDITION_MASK		__BITS(16, 17)
 #define X86_DR7_DR0_LENGTH_MASK			__BITS(18, 19)
 #define X86_DR7_DR1_CONDITION_MASK		__BITS(20, 21)
@@ -76,6 +76,7 @@
 #define X86_DR7_DR2_LENGTH_MASK			__BITS(26, 27)
 #define X86_DR7_DR3_CONDITION_MASK		__BITS(28, 29)
 #define X86_DR7_DR3_LENGTH_MASK			__BITS(30, 31)
+#define X86_DR7_MBZ__BITS(32, 63)
 
 /*
  * X86_DR7_CONDITION_IO_READWRITE is currently unused. It requires DE

Index: src/sys/arch/x86/x86/dbregs.c
diff -u src/sys/arch/x86/x86/dbregs.c:1.12 src/sys/arch/x86/x86/dbregs.c:1.13
--- src/sys/arch/x86/x86/dbregs.c:1.12	Thu Sep 27 13:04:21 2018
+++ src/sys/arch/x86/x86/dbregs.c	Sun Jan 13 10:01:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbregs.c,v 1.12 2018/09/27 13:04:21 maxv Exp $	*/
+/*	$NetBSD: dbregs.c,v 1.13 2019/01/13 10:01:07 maxv Exp $	*/
 
 /*
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -256,6 +256,12 @@ x86_dbregs_validate(const struct dbreg *
 			return EINVAL;
 	}
 
+	if (regs->dr[6] & X86_DR6_MBZ) {
+		return EINVAL;
+	}
+	if (regs->dr[7] & X86_DR7_MBZ) {
+		return EINVAL;
+	}
 	if (regs->dr[7] & X86_DR7_GENERAL_DETECT_ENABLE) {
 		return EINVAL;
 	}



Re: CVS commit: src/etc

2019-01-13 Thread Roy Marples
Not really, it just sets the group explicitly rather than implicitly. Without 
it the socket group is derived from the directory it's created in, which is 
group wheel to start with.

Now it could be argued that creating the socket in the first place allows 
members of the wheel group to configure wpa_supplicant and thus connect to a 
network. I don't see this as a problem myself and I believe that wpa_cli should 
work by default if wpa is enabled.

Roy


On 12 January 2019 19:05:23 GMT, m...@netbsd.org wrote:
>This lets any user in wheel group choose to connect to the network.
>Isn't that more privileges than we normally give?
>
>On Sat, Jan 12, 2019 at 04:51:55PM +, Roy Marples wrote:
>> +ctrl_interface_group=wheel

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.