svn commit: r362145 - in head/contrib/sqlite3: . tea

2020-06-12 Thread Cy Schubert
Author: cy
Date: Sat Jun 13 04:47:59 2020
New Revision: 362145
URL: https://svnweb.freebsd.org/changeset/base/362145

Log:
  MFV r362143:
  
  Update sqlite3 to 3.32.2 (3320200).
  
  CVE-2020-11655: SQLite through 3.31.1 allows attackers to cause a denial of
  service (segmentation fault) via a malformed window-function query because
  the AggInfo object's initialization is mishandled.
  
  CVE-2020-13434: SQLite through 3.32.0 has an integer overflow in
  sqlite3_str_vappendf in printf.c.
  
  CVE-2020-13435: SQLite through 3.32.0 has a segmentation fault in
  sqlite3ExprCodeTarget in expr.c.
  
  CVE-2020-13630: ext/fts3/fts3.c in SQLite before 3.32.0 has a
  use-after-free in fts3EvalNextRow, related to the snippet feature
  
  CVE-2020-13631: SQLite before 3.32.0 allows a virtual table to be renamed
  to the name of one of its shadow tables, related to alter.c and build.c.
  
  CVE-2020-13632: ext/fts3/fts3_snippet.c in SQLite before 3.32.0 ha s a
  NULL pointer dereference via a crafted matchinfo() query.
  
  PR:   247149
  Reported by:  spam...@bitbert.com
  MFC after:3 days
  Security: vuxml: c4ac9c79-ab37-11ea-8b5e-b42e99a1b9c3
https://nvd.nist.gov/vuln/detail/CVE-2020-11655
https://nvd.nist.gov/vuln/detail/CVE-2020-13434
https://nvd.nist.gov/vuln/detail/CVE-2020-13435
https://nvd.nist.gov/vuln/detail/CVE-2020-13630
https://nvd.nist.gov/vuln/detail/CVE-2020-13631
https://nvd.nist.gov/vuln/detail/CVE-2020-13632

Modified:
  head/contrib/sqlite3/configure
  head/contrib/sqlite3/configure.ac
  head/contrib/sqlite3/shell.c
  head/contrib/sqlite3/sqlite3.c
  head/contrib/sqlite3/sqlite3.h
  head/contrib/sqlite3/tea/configure
  head/contrib/sqlite3/tea/configure.ac
Directory Properties:
  head/contrib/sqlite3/   (props changed)

Modified: head/contrib/sqlite3/configure
==
--- head/contrib/sqlite3/configure  Sat Jun 13 03:52:15 2020
(r362144)
+++ head/contrib/sqlite3/configure  Sat Jun 13 04:47:59 2020
(r362145)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.32.0.
+# Generated by GNU Autoconf 2.69 for sqlite 3.32.2.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.32.0'
-PACKAGE_STRING='sqlite 3.32.0'
+PACKAGE_VERSION='3.32.2'
+PACKAGE_STRING='sqlite 3.32.2'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.32.0 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.32.0:";;
+ short | recursive ) echo "Configuration of sqlite 3.32.2:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.32.0
+sqlite configure 3.32.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.32.0, which was
+It was created by sqlite $as_me 3.32.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.32.0'
+ VERSION='3.32.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.32.0, which was
+This file was extended by sqlite $as_me 3.32.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.32.0
+sqlite config.status 3.32.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: head/contrib/sqlite3/configure.ac
==
--- 

svn commit: r362144 - vendor/sqlite3/sqlite-3320200

2020-06-12 Thread Cy Schubert
Author: cy
Date: Sat Jun 13 03:52:15 2020
New Revision: 362144
URL: https://svnweb.freebsd.org/changeset/base/362144

Log:
  Tag import of sqlite3-3.32.2 (3320200)

Added:
  vendor/sqlite3/sqlite-3320200/
 - copied from r362143, vendor/sqlite3/dist/
___
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"


svn commit: r362143 - in vendor/sqlite3/dist: . tea

2020-06-12 Thread Cy Schubert
Author: cy
Date: Sat Jun 13 03:50:35 2020
New Revision: 362143
URL: https://svnweb.freebsd.org/changeset/base/362143

Log:
  Import sqlite3-3.32.2 (3320200)

Modified:
  vendor/sqlite3/dist/configure
  vendor/sqlite3/dist/configure.ac
  vendor/sqlite3/dist/shell.c
  vendor/sqlite3/dist/sqlite3.c
  vendor/sqlite3/dist/sqlite3.h
  vendor/sqlite3/dist/tea/configure
  vendor/sqlite3/dist/tea/configure.ac

Modified: vendor/sqlite3/dist/configure
==
--- vendor/sqlite3/dist/configure   Sat Jun 13 03:16:09 2020
(r362142)
+++ vendor/sqlite3/dist/configure   Sat Jun 13 03:50:35 2020
(r362143)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.32.0.
+# Generated by GNU Autoconf 2.69 for sqlite 3.32.2.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.32.0'
-PACKAGE_STRING='sqlite 3.32.0'
+PACKAGE_VERSION='3.32.2'
+PACKAGE_STRING='sqlite 3.32.2'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.32.0 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.32.0:";;
+ short | recursive ) echo "Configuration of sqlite 3.32.2:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.32.0
+sqlite configure 3.32.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.32.0, which was
+It was created by sqlite $as_me 3.32.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.32.0'
+ VERSION='3.32.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.32.0, which was
+This file was extended by sqlite $as_me 3.32.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.32.0
+sqlite config.status 3.32.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: vendor/sqlite3/dist/configure.ac
==
--- vendor/sqlite3/dist/configure.acSat Jun 13 03:16:09 2020
(r362142)
+++ vendor/sqlite3/dist/configure.acSat Jun 13 03:50:35 2020
(r362143)
@@ -10,7 +10,7 @@
 #
 
 AC_PREREQ(2.61)
-AC_INIT(sqlite, 3.32.0, http://www.sqlite.org)
+AC_INIT(sqlite, 3.32.2, http://www.sqlite.org)
 AC_CONFIG_SRCDIR([sqlite3.c])
 AC_CONFIG_AUX_DIR([.])
 

Modified: vendor/sqlite3/dist/shell.c
==
--- vendor/sqlite3/dist/shell.c Sat Jun 13 03:16:09 2020(r362142)
+++ vendor/sqlite3/dist/shell.c Sat Jun 13 03:50:35 2020(r362143)
@@ -6591,6 +6591,7 @@ int sqlite3_zipfile_init(
 /* #include "sqlite3ext.h" */
 SQLITE_EXTENSION_INIT1
 #include 
+#include 
 
 /*
 ** Implementation of the "sqlar_compress(X)" SQL function.

Modified: vendor/sqlite3/dist/sqlite3.c
==
--- vendor/sqlite3/dist/sqlite3.c   Sat Jun 13 03:16:09 2020
(r362142)
+++ vendor/sqlite3/dist/sqlite3.c   Sat Jun 13 03:50:35 2020
(r362143)
@@ -1,6 +1,6 @@
 /**
 ** This file is an amalgamation of many separate C source files from SQLite
-** version 3.32.0.  By combining all the individual C code files into this
+** version 3.32.2.  By combining all the individual C code files into this
 ** single large file, the entire code can be compiled as a single 

svn commit: r362142 - head/sys/net80211

2020-06-12 Thread Conrad Meyer
Author: cem
Date: Sat Jun 13 03:16:09 2020
New Revision: 362142
URL: https://svnweb.freebsd.org/changeset/base/362142

Log:
  Fix !DEBUGNET build after r362138
  
  X-MFC-With:   r362138

Modified:
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_freebsd.h

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Sat Jun 13 03:04:40 2020
(r362141)
+++ head/sys/net80211/ieee80211_freebsd.c   Sat Jun 13 03:16:09 2020
(r362142)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Sat Jun 13 03:04:40 2020
(r362141)
+++ head/sys/net80211/ieee80211_freebsd.h   Sat Jun 13 03:16:09 2020
(r362142)
@@ -40,9 +40,7 @@
 #include 
 #include 
 
-#ifdef DEBUGNET
 #include 
-#endif
 
 /*
  * Common state locking definitions.
___
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"


svn commit: r362141 - head/sys/kern

2020-06-12 Thread Conrad Meyer
Author: cem
Date: Sat Jun 13 03:04:40 2020
New Revision: 362141
URL: https://svnweb.freebsd.org/changeset/base/362141

Log:
  Flip kern.tty_info_kstacks on by default
  
  It's a useful debug aid for anyone using Ctrl-T today, and doesn't seem to be
  widely known.  So, enable it out of the box to help people find it.
  
  It's a tunable and sysctl, so if you don't like it, it's easy to disable
  locally.
  
  If people really hate it, we can always flip it back.
  
  Reported by:  Daniel O'Connor

Modified:
  head/sys/kern/tty_info.c

Modified: head/sys/kern/tty_info.c
==
--- head/sys/kern/tty_info.cSat Jun 13 02:24:35 2020(r362140)
+++ head/sys/kern/tty_info.cSat Jun 13 03:04:40 2020(r362141)
@@ -239,7 +239,7 @@ sbuf_tty_drain(void *a, const char *d, int len)
 }
 
 #ifdef STACK
-static bool tty_info_kstacks = false;
+static bool tty_info_kstacks = true;
 SYSCTL_BOOL(_kern, OID_AUTO, tty_info_kstacks, CTLFLAG_RWTUN,
 _info_kstacks, 0,
 "Enable printing kernel stack(9) traces on ^T (tty info)");
___
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"


svn commit: r362139 - in head/sys: compat/linuxkpi/common/include/linux sys

2020-06-12 Thread Doug Moore
Author: dougm
Date: Sat Jun 13 01:54:09 2020
New Revision: 362139
URL: https://svnweb.freebsd.org/changeset/base/362139

Log:
  Linuxkpi uses the rb-tree structures without using their interfaces,
  making them break when the representation changes. Revert changes that
  eliminated the color field from rb-trees, leaving everything as it was
  before.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D25250

Modified:
  head/sys/compat/linuxkpi/common/include/linux/rbtree.h
  head/sys/sys/tree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Sat Jun 13 
00:59:36 2020(r362138)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Sat Jun 13 
01:54:09 2020(r362139)
@@ -57,7 +57,11 @@ RB_HEAD(linux_root, rb_node);
 RB_PROTOTYPE(linux_root, rb_node, __entry, panic_cmp);
 
 #definerb_parent(r)RB_PARENT(r, __entry)
+#definerb_color(r) RB_COLOR(r, __entry)
+#definerb_is_red(r)(rb_color(r) == RB_RED)
+#definerb_is_black(r)  (rb_color(r) == RB_BLACK)
 #definerb_set_parent(r, p) rb_parent((r)) = (p)
+#definerb_set_color(r, c)  rb_color((r)) = (c)
 #definerb_entry(ptr, type, member) container_of(ptr, type, member)
 
 #define RB_EMPTY_ROOT(root) RB_EMPTY((struct linux_root *)root)
@@ -78,6 +82,7 @@ rb_link_node(struct rb_node *node, struct rb_node *par
 struct rb_node **rb_link)
 {
rb_set_parent(node, parent);
+   rb_set_color(node, RB_RED);
node->__entry.rbe_left = node->__entry.rbe_right = NULL;
*rb_link = node;
 }

Modified: head/sys/sys/tree.h
==
--- head/sys/sys/tree.h Sat Jun 13 00:59:36 2020(r362138)
+++ head/sys/sys/tree.h Sat Jun 13 01:54:09 2020(r362139)
@@ -307,38 +307,35 @@ struct name { 
\
(root)->rbh_root = NULL;\
 } while (/*CONSTCOND*/ 0)
 
+#define RB_BLACK   0
+#define RB_RED 1
 #define RB_ENTRY(type) \
 struct {   \
struct type *rbe_left;  /* left element */  \
struct type *rbe_right; /* right element */ \
struct type *rbe_parent;/* parent element */\
+   int rbe_color;  /* node color */\
 }
 
-#define RB_LF(elm, field)  (elm)->field.rbe_left
-#define RB_RT(elm, field)  (elm)->field.rbe_right
-#define RB_FLIP(elm)   (*(__uintptr_t *)&(elm) ^= 1)
-#define RB_FLIP_LF(elm, field) RB_FLIP(RB_LF(elm, field))
-#define RB_FLIP_RT(elm, field) RB_FLIP(RB_RT(elm, field))
-#define RB_ISRED(elm)  ((*(__uintptr_t *)&(elm) & 1) != 0)
-#define RB_RED_LF(elm, field)  RB_ISRED(RB_LF(elm, field))
-#define RB_RED_RT(elm, field)  RB_ISRED(RB_RT(elm, field))
-#define RB_PTR(elm, field) ((__typeof(elm->field.rbe_parent)) \
-((__uintptr_t)(elm) & ~(__uintptr_t)1))
-#define RB_LEFT(elm, field)RB_PTR(RB_LF(elm, field), field)
-#define RB_RIGHT(elm, field)   RB_PTR(RB_RT(elm, field), field)
+#define RB_LEFT(elm, field)(elm)->field.rbe_left
+#define RB_RIGHT(elm, field)   (elm)->field.rbe_right
 #define RB_PARENT(elm, field)  (elm)->field.rbe_parent
+#define RB_COLOR(elm, field)   (elm)->field.rbe_color
+#define RB_ISRED(elm, field)   ((elm) != NULL && RB_COLOR(elm, field) 
== RB_RED)
 #define RB_ROOT(head)  (head)->rbh_root
 #define RB_EMPTY(head) (RB_ROOT(head) == NULL)
-#define RB_BOOLint
-#define RB_TRUE1
-#define RB_FALSE   0
 
-/* For debugging support */
-#define RB_COLOR(elm, field)   (RB_PARENT(elm, field) == NULL ? 
RB_FALSE : \
-   RB_LEFT(RB_PARENT(elm, field), 
field) == elm ? \
-   RB_RED_LF(RB_PARENT(elm, field), 
field) : \
-   RB_RED_RT(RB_PARENT(elm, field), 
field))
+#define RB_SET(elm, parent, field) do {
\
+   RB_PARENT(elm, field) = parent; \
+   RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL;  \
+   RB_COLOR(elm, field) = RB_RED;  \
+} while (/*CONSTCOND*/ 0)
 
+#define RB_SET_BLACKRED(black, red, field) do {
\
+   RB_COLOR(black, 

svn commit: r362138 - head/sys/net80211

2020-06-12 Thread Conrad Meyer
Author: cem
Date: Sat Jun 13 00:59:36 2020
New Revision: 362138
URL: https://svnweb.freebsd.org/changeset/base/362138

Log:
  net80211: Add framework for debugnet(4) support
  
  Allow net80211 drivers to register a small vtable of debugnet-related
  methods.
  
  This is not a functional change.  Driver support is needed, similar to
  debugnet(4) for wired NICs.
  
  Reviewed by:  adrian, markj (earlier version both)
  Differential Revision:https://reviews.freebsd.org/D17308

Modified:
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_freebsd.h
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Fri Jun 12 23:43:44 2020
(r362137)
+++ head/sys/net80211/ieee80211_freebsd.c   Sat Jun 13 00:59:36 2020
(r362138)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+DEBUGNET_DEFINE(ieee80211);
 SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
 "IEEE 80211 parameters");
 
@@ -111,7 +112,14 @@ wlan_clone_create(struct if_clone *ifc, int unit, cadd
cp.icp_flags & IEEE80211_CLONE_MACADDR ?
cp.icp_macaddr : ic->ic_macaddr);
 
-   return (vap == NULL ? EIO : 0);
+   if (vap == NULL)
+   return (EIO);
+
+#ifdef DEBUGNET
+   if (ic->ic_debugnet_meth != NULL)
+   DEBUGNET_SET(vap->iv_ifp, ieee80211);
+#endif
+   return (0);
 }
 
 static void
@@ -1046,6 +1054,54 @@ ieee80211_get_vap_ifname(struct ieee80211vap *vap)
return "(none)";
return vap->iv_ifp->if_xname;
 }
+
+#ifdef DEBUGNET
+static void
+ieee80211_debugnet_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize)
+{
+   struct ieee80211vap *vap;
+   struct ieee80211com *ic;
+
+   vap = if_getsoftc(ifp);
+   ic = vap->iv_ic;
+
+   IEEE80211_LOCK(ic);
+   ic->ic_debugnet_meth->dn8_init(ic, nrxr, ncl, clsize);
+   IEEE80211_UNLOCK(ic);
+}
+
+static void
+ieee80211_debugnet_event(struct ifnet *ifp, enum debugnet_ev ev)
+{
+   struct ieee80211vap *vap;
+   struct ieee80211com *ic;
+
+   vap = if_getsoftc(ifp);
+   ic = vap->iv_ic;
+
+   IEEE80211_LOCK(ic);
+   ic->ic_debugnet_meth->dn8_event(ic, ev);
+   IEEE80211_UNLOCK(ic);
+}
+
+static int
+ieee80211_debugnet_transmit(struct ifnet *ifp, struct mbuf *m)
+{
+   return (ieee80211_vap_transmit(ifp, m));
+}
+
+static int
+ieee80211_debugnet_poll(struct ifnet *ifp, int count)
+{
+   struct ieee80211vap *vap;
+   struct ieee80211com *ic;
+
+   vap = if_getsoftc(ifp);
+   ic = vap->iv_ic;
+
+   return (ic->ic_debugnet_meth->dn8_poll(ic, count));
+}
+#endif
 
 /*
  * Module glue.

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Fri Jun 12 23:43:44 2020
(r362137)
+++ head/sys/net80211/ieee80211_freebsd.h   Sat Jun 13 00:59:36 2020
(r362138)
@@ -40,6 +40,10 @@
 #include 
 #include 
 
+#ifdef DEBUGNET
+#include 
+#endif
+
 /*
  * Common state locking definitions.
  */
@@ -492,6 +496,36 @@ typedef int ieee80211_ioctl_setfunc(struct ieee80211va
 struct ieee80211req *);
 SET_DECLARE(ieee80211_ioctl_setset, ieee80211_ioctl_setfunc);
 #defineIEEE80211_IOCTL_SET(_name, _set) 
TEXT_SET(ieee80211_ioctl_setset, _set)
+
+#ifdef DEBUGNET
+typedef void debugnet80211_init_t(struct ieee80211com *, int *nrxr, int *ncl,
+int *clsize);
+typedef void debugnet80211_event_t(struct ieee80211com *, enum debugnet_ev);
+typedef int debugnet80211_poll_t(struct ieee80211com *, int);
+
+struct debugnet80211_methods {
+   debugnet80211_init_t*dn8_init;
+   debugnet80211_event_t   *dn8_event;
+   debugnet80211_poll_t*dn8_poll;
+};
+
+#defineDEBUGNET80211_DEFINE(driver)
\
+   static debugnet80211_init_t driver##_debugnet80211_init;
\
+   static debugnet80211_event_t driver##_debugnet80211_event;  \
+   static debugnet80211_poll_t driver##_debugnet80211_poll;
\
+   \
+   static struct debugnet80211_methods driver##_debugnet80211_methods = { \
+   .dn8_init = driver##_debugnet80211_init,
\
+   .dn8_event = driver##_debugnet80211_event,  \
+   .dn8_poll = driver##_debugnet80211_poll,
\
+   }
+#define DEBUGNET80211_SET(ic, driver)  \
+   (ic)->ic_debugnet_meth = ##_debugnet80211_methods
+#else
+#define DEBUGNET80211_DEFINE(driver)
+#define DEBUGNET80211_SET(ic, driver)
+#endif /* DEBUGNET */
+
 #endif /* _KERNEL */
 
 /* XXX this 

svn commit: r362137 - head/sys/sys

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 23:43:44 2020
New Revision: 362137
URL: https://svnweb.freebsd.org/changeset/base/362137

Log:
  Allow  to be used in assembly.
  
  Hide C-only declarations under #ifndef LOCORE.  This will be used by
  future changes to define ELF notes in assembly.
  
  Reviewed by:  kib
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25211

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Fri Jun 12 23:42:36 2020(r362136)
+++ head/sys/sys/elf_common.h   Fri Jun 12 23:43:44 2020(r362137)
@@ -46,12 +46,14 @@
  * not include the padding.
  */
 
+#ifndef LOCORE
 typedef struct {
u_int32_t   n_namesz;   /* Length of name. */
u_int32_t   n_descsz;   /* Length of descriptor. */
u_int32_t   n_type; /* Type of this note. */
 } Elf_Note;
 typedef Elf_Note Elf_Nhdr;
+#endif
 
 /*
  * Option kinds.
@@ -112,12 +114,14 @@ typedef Elf_Note Elf_Nhdr;
  * The header for GNU-style hash sections.
  */
 
+#ifndef LOCORE
 typedef struct {
u_int32_t   gh_nbuckets;/* Number of hash buckets. */
u_int32_t   gh_symndx;  /* First visible symbol in .dynsym. */
u_int32_t   gh_maskwords;   /* #maskwords used in bloom filter. */
u_int32_t   gh_shift2;  /* Bloom filter shift count. */
 } Elf_GNU_Hash_Header;
+#endif
 
 /* Indexes into the e_ident array.  Keep synced with
http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
___
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"


svn commit: r362136 - head/sys/sys

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 23:42:36 2020
New Revision: 362136
URL: https://svnweb.freebsd.org/changeset/base/362136

Log:
  Allow  to be included from userland assembly files.
  
  This will be used by future changes to define ELF notes in assembly.
  
  Reviewed by:  kib
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25211

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hFri Jun 12 23:10:30 2020(r362135)
+++ head/sys/sys/param.hFri Jun 12 23:42:36 2020(r362136)
@@ -136,8 +136,10 @@
 #endif
 
 #ifndef _KERNEL
+#ifndef LOCORE
 /* Signals. */
 #include 
+#endif
 #endif
 
 /* Machine type dependent parameters. */
___
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"


svn commit: r362135 - head/sys/opencrypto

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 23:10:30 2020
New Revision: 362135
URL: https://svnweb.freebsd.org/changeset/base/362135

Log:
  Various optimizations to software AES-CCM and AES-GCM.
  
  - Make use of cursors to avoid data copies for AES-CCM and AES-GCM.
  
Pass pointers into the request's input and/or output buffers
directly to the Update, encrypt, and decrypt hooks rather than
always copying all data into a temporary block buffer on the stack.
  
  - Move handling for partial final blocks out of the main loop.
  
This removes branches from the main loop and permits using
encrypt/decrypt_last which avoids a memset to clear the rest of the
block on the stack.
  
  - Shrink the on-stack buffers to assume AES block sizes and CCM/GCM
tag lengths.
  
  - For AAD data, pass larger chunks to axf->Update.  CCM can take each
AAD segment in a single call.  GMAC can take multiple blocks at a
time.
  
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D25058

Modified:
  head/sys/opencrypto/cryptosoft.c

Modified: head/sys/opencrypto/cryptosoft.c
==
--- head/sys/opencrypto/cryptosoft.cFri Jun 12 23:02:34 2020
(r362134)
+++ head/sys/opencrypto/cryptosoft.cFri Jun 12 23:10:30 2020
(r362135)
@@ -107,8 +107,8 @@ swcr_encdec(struct swcr_session *ses, struct cryptop *
struct enc_xform *exf;
int i, blks, inlen, ivlen, outlen, resid;
struct crypto_buffer_cursor cc_in, cc_out;
-   const char *inblk;
-   char *outblk;
+   const unsigned char *inblk;
+   unsigned char *outblk;
int error;
bool encrypting;
 
@@ -404,11 +404,12 @@ CTASSERT(INT_MAX <= (uint64_t)-1);/* GCM: 
associated 
 static int
 swcr_gmac(struct swcr_session *ses, struct cryptop *crp)
 {
-   uint32_t blkbuf[howmany(EALG_MAX_BLOCK_LEN, sizeof(uint32_t))];
+   uint32_t blkbuf[howmany(AES_BLOCK_LEN, sizeof(uint32_t))];
u_char *blk = (u_char *)blkbuf;
-   u_char aalg[AALG_MAX_RESULT_LEN];
-   u_char iv[EALG_MAX_BLOCK_LEN];
+   u_char tag[GMAC_DIGEST_LEN];
+   u_char iv[AES_BLOCK_LEN];
struct crypto_buffer_cursor cc;
+   const u_char *inblk;
union authctx ctx;
struct swcr_auth *swa;
struct auth_hash *axf;
@@ -419,7 +420,9 @@ swcr_gmac(struct swcr_session *ses, struct cryptop *cr
axf = swa->sw_axf;
 
bcopy(swa->sw_ictx, , axf->ctxsize);
-   blksz = axf->blocksize;
+   blksz = GMAC_BLOCK_LEN;
+   KASSERT(axf->blocksize == blksz, ("%s: axf block size mismatch",
+   __func__));
 
/* Initialize the IV */
ivlen = AES_GCM_IV_LEN;
@@ -428,37 +431,49 @@ swcr_gmac(struct swcr_session *ses, struct cryptop *cr
axf->Reinit(, iv, ivlen);
crypto_cursor_init(, >crp_buf);
crypto_cursor_advance(, crp->crp_payload_start);
-   for (resid = crp->crp_payload_length; resid > 0; resid -= len) {
-   len = MIN(resid, blksz);
-   crypto_cursor_copydata(, len, blk);
-   bzero(blk + len, blksz - len);
+   for (resid = crp->crp_payload_length; resid >= blksz; resid -= len) {
+   len = crypto_cursor_seglen();
+   if (len >= blksz) {
+   inblk = crypto_cursor_segbase();
+   len = rounddown(MIN(len, resid), blksz);
+   crypto_cursor_advance(, len);
+   } else {
+   len = blksz;
+   crypto_cursor_copydata(, len, blk);
+   inblk = blk;
+   }
+   axf->Update(, inblk, len);
+   }
+   if (resid > 0) {
+   memset(blk, 0, blksz);
+   crypto_cursor_copydata(, resid, blk);
axf->Update(, blk, blksz);
}
 
/* length block */
-   bzero(blk, blksz);
+   memset(blk, 0, blksz);
blkp = (uint32_t *)blk + 1;
*blkp = htobe32(crp->crp_payload_length * 8);
axf->Update(, blk, blksz);
 
/* Finalize MAC */
-   axf->Final(aalg, );
+   axf->Final(tag, );
 
error = 0;
if (crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) {
-   u_char uaalg[AALG_MAX_RESULT_LEN];
+   u_char tag2[GMAC_DIGEST_LEN];
 
crypto_copydata(crp, crp->crp_digest_start, swa->sw_mlen,
-   uaalg);
-   if (timingsafe_bcmp(aalg, uaalg, swa->sw_mlen) != 0)
+   tag2);
+   if (timingsafe_bcmp(tag, tag2, swa->sw_mlen) != 0)
error = EBADMSG;
-   explicit_bzero(uaalg, sizeof(uaalg));
+   explicit_bzero(tag2, sizeof(tag2));
} else {
/* Inject the authentication data */
-   crypto_copyback(crp, crp->crp_digest_start, swa->sw_mlen, aalg);
+   crypto_copyback(crp, 

svn commit: r362134 - in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.b...

2020-06-12 Thread Martin Matuska
Author: mm
Date: Fri Jun 12 23:02:34 2020
New Revision: 362134
URL: https://svnweb.freebsd.org/changeset/base/362134

Log:
  MFC r361294:
  Update libarchive to 3.4.3
  
  Relevant vendor changes:
PR #1352: support negative zstd compression levels
PR #1359: improve zstd version checking
PR #1348: support RHT.security.selinux from GNU tar
PR #1357: support for archives compressed with pzstd
PR #1367: fix issues in acl tests
PR #1372: child handling cleanup
PR #1378: fix memory leak from passphrase callback

Added:
  stable/10/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu
  
stable/10/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c
  
stable/10/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu
  stable/10/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c
  stable/10/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu
Deleted:
  stable/10/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c
  stable/10/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu
Modified:
  stable/10/contrib/libarchive/NEWS
  stable/10/contrib/libarchive/README.md
  stable/10/contrib/libarchive/libarchive/archive.h
  stable/10/contrib/libarchive/libarchive/archive_digest.c
  stable/10/contrib/libarchive/libarchive/archive_entry.c
  stable/10/contrib/libarchive/libarchive/archive_entry.h
  stable/10/contrib/libarchive/libarchive/archive_entry_stat.3
  stable/10/contrib/libarchive/libarchive/archive_read_add_passphrase.c
  stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c
  stable/10/contrib/libarchive/libarchive/archive_read_support_filter_program.c
  stable/10/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c
  stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
  stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c
  stable/10/contrib/libarchive/libarchive/archive_write_add_filter_program.c
  stable/10/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c
  stable/10/contrib/libarchive/libarchive/archive_write_set_options.3
  stable/10/contrib/libarchive/libarchive/filter_fork.h
  stable/10/contrib/libarchive/libarchive/filter_fork_posix.c
  stable/10/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c
  stable/10/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c
  stable/10/contrib/libarchive/libarchive/test/test_compat_zstd.c
  stable/10/contrib/libarchive/libarchive/test/test_write_filter_zstd.c
  stable/10/contrib/libarchive/tar/bsdtar.1
  stable/10/lib/libarchive/tests/Makefile
  stable/10/usr.bin/bsdcat/Makefile
  stable/10/usr.bin/cpio/Makefile
  stable/10/usr.bin/tar/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/libarchive/NEWS
==
--- stable/10/contrib/libarchive/NEWS   Fri Jun 12 23:01:29 2020
(r362133)
+++ stable/10/contrib/libarchive/NEWS   Fri Jun 12 23:02:34 2020
(r362134)
@@ -1,3 +1,9 @@
+May 20, 2020: libarchive 3.4.3 released
+
+Apr 30, 2020: Support for pzstd compressed files
+
+Apr 16, 2020: Support for RHT.security.selinux tar extended attribute
+
 Feb 11, 2020: libarchive 3.4.2 released
 
 Jan 23, 2020: Important fixes for writing XAR archives

Modified: stable/10/contrib/libarchive/README.md
==
--- stable/10/contrib/libarchive/README.md  Fri Jun 12 23:01:29 2020
(r362133)
+++ stable/10/contrib/libarchive/README.md  Fri Jun 12 23:02:34 2020
(r362134)
@@ -70,7 +70,7 @@ know about any errors or omissions you find.
 
 ## Supported Formats
 
-Currently, the library automatically detects and reads the following fomats:
+Currently, the library automatically detects and reads the following formats:
   * Old V7 tar archives
   * POSIX ustar
   * GNU tar format (including GNU long filenames, long link names, and sparse 
files)

Modified: stable/10/contrib/libarchive/libarchive/archive.h
==
--- stable/10/contrib/libarchive/libarchive/archive.h   Fri Jun 12 23:01:29 
2020(r362133)
+++ stable/10/contrib/libarchive/libarchive/archive.h   Fri Jun 12 23:02:34 
2020

svn commit: r362133 - in stable/11: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.b...

2020-06-12 Thread Martin Matuska
Author: mm
Date: Fri Jun 12 23:01:29 2020
New Revision: 362133
URL: https://svnweb.freebsd.org/changeset/base/362133

Log:
  MFC r361294:
  Update libarchive to 3.4.3
  
  Relevant vendor changes:
PR #1352: support negative zstd compression levels
PR #1359: improve zstd version checking
PR #1348: support RHT.security.selinux from GNU tar
PR #1357: support for archives compressed with pzstd
PR #1367: fix issues in acl tests
PR #1372: child handling cleanup
PR #1378: fix memory leak from passphrase callback
  
  Relnotes: yes

Added:
  stable/11/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu
  
stable/11/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c
  
stable/11/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu
  stable/11/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c
  stable/11/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu
Deleted:
  stable/11/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c
  stable/11/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu
Modified:
  stable/11/contrib/libarchive/NEWS
  stable/11/contrib/libarchive/README.md
  stable/11/contrib/libarchive/libarchive/archive.h
  stable/11/contrib/libarchive/libarchive/archive_digest.c
  stable/11/contrib/libarchive/libarchive/archive_entry.c
  stable/11/contrib/libarchive/libarchive/archive_entry.h
  stable/11/contrib/libarchive/libarchive/archive_entry_stat.3
  stable/11/contrib/libarchive/libarchive/archive_read_add_passphrase.c
  stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_filter_program.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_program.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_options.3
  stable/11/contrib/libarchive/libarchive/filter_fork.h
  stable/11/contrib/libarchive/libarchive/filter_fork_posix.c
  stable/11/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c
  stable/11/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c
  stable/11/contrib/libarchive/libarchive/test/test_compat_zstd.c
  stable/11/contrib/libarchive/libarchive/test/test_write_filter_zstd.c
  stable/11/contrib/libarchive/tar/bsdtar.1
  stable/11/lib/libarchive/tests/Makefile
  stable/11/usr.bin/bsdcat/Makefile
  stable/11/usr.bin/cpio/Makefile
  stable/11/usr.bin/tar/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/libarchive/NEWS
==
--- stable/11/contrib/libarchive/NEWS   Fri Jun 12 22:59:59 2020
(r362132)
+++ stable/11/contrib/libarchive/NEWS   Fri Jun 12 23:01:29 2020
(r362133)
@@ -1,3 +1,9 @@
+May 20, 2020: libarchive 3.4.3 released
+
+Apr 30, 2020: Support for pzstd compressed files
+
+Apr 16, 2020: Support for RHT.security.selinux tar extended attribute
+
 Feb 11, 2020: libarchive 3.4.2 released
 
 Jan 23, 2020: Important fixes for writing XAR archives

Modified: stable/11/contrib/libarchive/README.md
==
--- stable/11/contrib/libarchive/README.md  Fri Jun 12 22:59:59 2020
(r362132)
+++ stable/11/contrib/libarchive/README.md  Fri Jun 12 23:01:29 2020
(r362133)
@@ -70,7 +70,7 @@ know about any errors or omissions you find.
 
 ## Supported Formats
 
-Currently, the library automatically detects and reads the following fomats:
+Currently, the library automatically detects and reads the following formats:
   * Old V7 tar archives
   * POSIX ustar
   * GNU tar format (including GNU long filenames, long link names, and sparse 
files)

Modified: stable/11/contrib/libarchive/libarchive/archive.h
==
--- stable/11/contrib/libarchive/libarchive/archive.h   Fri Jun 12 22:59:59 
2020(r362132)
+++ stable/11/contrib/libarchive/libarchive/archive.h   Fri Jun 12 

svn commit: r362132 - in stable/12: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.b...

2020-06-12 Thread Martin Matuska
Author: mm
Date: Fri Jun 12 22:59:59 2020
New Revision: 362132
URL: https://svnweb.freebsd.org/changeset/base/362132

Log:
  MFC r361294:
  Update libarchive to 3.4.3
  
  Relevant vendor changes:
PR #1352: support negative zstd compression levels
PR #1359: improve zstd version checking
PR #1348: support RHT.security.selinux from GNU tar
PR #1357: support for archives compressed with pzstd
PR #1367: fix issues in acl tests
PR #1372: child handling cleanup
PR #1378: fix memory leak from passphrase callback
  
  Relnotes: yes

Added:
  stable/12/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu
  
stable/12/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c
  
stable/12/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu
  stable/12/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c
  stable/12/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu
 - copied unchanged from r361294, 
head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu
Deleted:
  stable/12/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c
  stable/12/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu
Modified:
  stable/12/contrib/libarchive/NEWS
  stable/12/contrib/libarchive/README.md
  stable/12/contrib/libarchive/libarchive/archive.h
  stable/12/contrib/libarchive/libarchive/archive_digest.c
  stable/12/contrib/libarchive/libarchive/archive_entry.c
  stable/12/contrib/libarchive/libarchive/archive_entry.h
  stable/12/contrib/libarchive/libarchive/archive_entry_stat.3
  stable/12/contrib/libarchive/libarchive/archive_read_add_passphrase.c
  stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c
  stable/12/contrib/libarchive/libarchive/archive_read_support_filter_program.c
  stable/12/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c
  stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
  stable/12/contrib/libarchive/libarchive/archive_read_support_format_tar.c
  stable/12/contrib/libarchive/libarchive/archive_write_add_filter_program.c
  stable/12/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c
  stable/12/contrib/libarchive/libarchive/archive_write_set_options.3
  stable/12/contrib/libarchive/libarchive/filter_fork.h
  stable/12/contrib/libarchive/libarchive/filter_fork_posix.c
  stable/12/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c
  stable/12/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c
  stable/12/contrib/libarchive/libarchive/test/test_compat_zstd.c
  stable/12/contrib/libarchive/libarchive/test/test_write_filter_zstd.c
  stable/12/contrib/libarchive/tar/bsdtar.1
  stable/12/lib/libarchive/tests/Makefile
  stable/12/usr.bin/bsdcat/Makefile
  stable/12/usr.bin/cpio/Makefile
  stable/12/usr.bin/tar/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/libarchive/NEWS
==
--- stable/12/contrib/libarchive/NEWS   Fri Jun 12 22:27:26 2020
(r362131)
+++ stable/12/contrib/libarchive/NEWS   Fri Jun 12 22:59:59 2020
(r362132)
@@ -1,3 +1,9 @@
+May 20, 2020: libarchive 3.4.3 released
+
+Apr 30, 2020: Support for pzstd compressed files
+
+Apr 16, 2020: Support for RHT.security.selinux tar extended attribute
+
 Feb 11, 2020: libarchive 3.4.2 released
 
 Jan 23, 2020: Important fixes for writing XAR archives

Modified: stable/12/contrib/libarchive/README.md
==
--- stable/12/contrib/libarchive/README.md  Fri Jun 12 22:27:26 2020
(r362131)
+++ stable/12/contrib/libarchive/README.md  Fri Jun 12 22:59:59 2020
(r362132)
@@ -70,7 +70,7 @@ know about any errors or omissions you find.
 
 ## Supported Formats
 
-Currently, the library automatically detects and reads the following fomats:
+Currently, the library automatically detects and reads the following formats:
   * Old V7 tar archives
   * POSIX ustar
   * GNU tar format (including GNU long filenames, long link names, and sparse 
files)

Modified: stable/12/contrib/libarchive/libarchive/archive.h
==
--- stable/12/contrib/libarchive/libarchive/archive.h   Fri Jun 12 22:27:26 
2020(r362131)
+++ stable/12/contrib/libarchive/libarchive/archive.h   Fri Jun 12 

Re: svn commit: r362126 - head/sys/vm

2020-06-12 Thread Conrad Meyer
On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen  wrote:
>   Honor db_pager_quit in some vm_object ddb commands
>
>   These can be rather verbose.

We also have this (?)hack in OneFS, which eliminates the need for
every debug function to check the db_pager globals:

https://people.freebsd.org/~cem/db_pager.patch

I'm not sure how objectionable it is.
___
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"


svn commit: r362131 - head/sys/opencrypto

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 22:27:26 2020
New Revision: 362131
URL: https://svnweb.freebsd.org/changeset/base/362131

Log:
  Fix a regression in r361804 for TLS 1.3.
  
  I was not including the record type stored in the first byte of the
  trailer as part of the payload to be encrypted and hashed.
  
  Sponsored by: Netflix

Modified:
  head/sys/opencrypto/ktls_ocf.c

Modified: head/sys/opencrypto/ktls_ocf.c
==
--- head/sys/opencrypto/ktls_ocf.c  Fri Jun 12 22:14:45 2020
(r362130)
+++ head/sys/opencrypto/ktls_ocf.c  Fri Jun 12 22:27:26 2020
(r362131)
@@ -293,6 +293,7 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls,
 * record_type even if only the first byte is used.
 */
trailer[0] = record_type;
+   crp->crp_payload_length++;
iov[iovcnt + 1].iov_base = trailer;
iov[iovcnt + 1].iov_len = AES_GMAC_HASH_LEN + 1;
uio.uio_iovcnt++;
___
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"


svn commit: r362130 - in head: share/man/man7 sys/amd64/amd64 sys/dev/cpuctl sys/x86/include sys/x86/x86

2020-06-12 Thread Konstantin Belousov
Author: kib
Date: Fri Jun 12 22:14:45 2020
New Revision: 362130
URL: https://svnweb.freebsd.org/changeset/base/362130

Log:
  Control for Special Register Buffer Data Sampling mitigation.
  
  New microcode update for Intel enables mitigation for SRBDS, which
  slows down RDSEED and related instructions.  The update also provides
  a control to limit the mitigation to SGX enclaves, which should
  restore the speed of random generator by the cost of potential
  cross-core bufer sampling.
  
  See 
https://software.intel.com/security-software-guidance/insights/deep-dive-special-register-buffer-data-sampling
  
  GIve the user control over it.
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25221

Modified:
  head/share/man/man7/security.7
  head/sys/amd64/amd64/initcpu.c
  head/sys/amd64/amd64/machdep.c
  head/sys/dev/cpuctl/cpuctl.c
  head/sys/x86/include/x86_var.h
  head/sys/x86/x86/cpu_machdep.c

Modified: head/share/man/man7/security.7
==
--- head/share/man/man7/security.7  Fri Jun 12 22:12:57 2020
(r362129)
+++ head/share/man/man7/security.7  Fri Jun 12 22:14:45 2020
(r362130)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 16, 2020
+.Dd June 11, 2020
 .Dt SECURITY 7
 .Os
 .Sh NAME
@@ -1040,6 +1040,13 @@ page table format used by hypervisors on Intel CPUs to
 physical address space to machine physical memory.
 May be disabled to work around a CPU Erratum called
 Machine Check Error Avoidance on Page Size Change.
+.It Dv machdep.mitigations.rngds.enable
+amd64 and i386.
+Controls mitigation of Special Register Buffer Data Sampling versus
+optimization of the MCU access.
+When set to zero, the mitigation is disabled, and the RDSEED and RDRAND
+instructions do not incur serialization overhead for shared buffer accesses,
+and do not serialize off-core memory accessses.
 .It Dv kern.elf32.aslr.enable
 Controls system-global Address Space Layout Randomization (ASLR) for
 normal non-PIE (Position Independent Executable) 32bit binaries.

Modified: head/sys/amd64/amd64/initcpu.c
==
--- head/sys/amd64/amd64/initcpu.c  Fri Jun 12 22:12:57 2020
(r362129)
+++ head/sys/amd64/amd64/initcpu.c  Fri Jun 12 22:14:45 2020
(r362130)
@@ -270,6 +270,7 @@ initializecpu(void)
hw_ibrs_recalculate(false);
hw_ssb_recalculate(false);
amd64_syscall_ret_flush_l1d_recalc();
+   x86_rngds_mitg_recalculate(false);
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
case CPU_VENDOR_HYGON:

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Fri Jun 12 22:12:57 2020
(r362129)
+++ head/sys/amd64/amd64/machdep.c  Fri Jun 12 22:14:45 2020
(r362130)
@@ -1791,6 +1791,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
TUNABLE_INT_FETCH("machdep.mitigations.taa.enable", _taa_enable);
 
+   TUNABLE_INT_FETCH("machdep.mitigations.rndgs.enable",
+   _rngds_mitg_enable);
+
finishidentcpu();   /* Final stage of CPU initialization */
initializecpu();/* Initialize CPU registers */
 

Modified: head/sys/dev/cpuctl/cpuctl.c
==
--- head/sys/dev/cpuctl/cpuctl.cFri Jun 12 22:12:57 2020
(r362129)
+++ head/sys/dev/cpuctl/cpuctl.cFri Jun 12 22:14:45 2020
(r362130)
@@ -547,6 +547,7 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td
 #endif
hw_mds_recalculate();
x86_taa_recalculate();
+   x86_rngds_mitg_recalculate(true);
printcpuinfo();
return (0);
 }

Modified: head/sys/x86/include/x86_var.h
==
--- head/sys/x86/include/x86_var.h  Fri Jun 12 22:12:57 2020
(r362129)
+++ head/sys/x86/include/x86_var.h  Fri Jun 12 22:14:45 2020
(r362130)
@@ -95,6 +95,7 @@ externint hw_mds_disable;
 extern int hw_ssb_active;
 extern int x86_taa_enable;
 extern int cpu_flush_rsb_ctxsw;
+extern int x86_rngds_mitg_enable;
 
 struct pcb;
 struct thread;
@@ -139,6 +140,7 @@ voidhw_ibrs_recalculate(bool all_cpus);
 void   hw_mds_recalculate(void);
 void   hw_ssb_recalculate(bool all_cpus);
 void   x86_taa_recalculate(void);
+void   x86_rngds_mitg_recalculate(bool all_cpus);
 void   nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame);
 void   nmi_call_kdb_smp(u_int type, struct trapframe *frame);
 void   nmi_handle_intr(u_int type, struct trapframe *frame);

Modified: head/sys/x86/x86/cpu_machdep.c

svn commit: r362129 - in head/sys/x86: include x86

2020-06-12 Thread Konstantin Belousov
Author: kib
Date: Fri Jun 12 22:12:57 2020
New Revision: 362129
URL: https://svnweb.freebsd.org/changeset/base/362129

Log:
  x86: add bits definitions for SRBDS mitigation control.
  
  See 
https://software.intel.com/security-software-guidance/insights/deep-dive-special-register-buffer-data-sampling
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25221

Modified:
  head/sys/x86/include/specialreg.h
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/include/specialreg.h
==
--- head/sys/x86/include/specialreg.h   Fri Jun 12 22:10:03 2020
(r362128)
+++ head/sys/x86/include/specialreg.h   Fri Jun 12 22:12:57 2020
(r362129)
@@ -477,6 +477,7 @@
 #defineCPUID_STDEXT3_AVX5124FMAPS  0x0008
 #defineCPUID_STDEXT3_FSRM  0x0010
 #defineCPUID_STDEXT3_AVX512VP2INTERSECT0x0100
+#defineCPUID_STDEXT3_MCUOPT0x0200
 #defineCPUID_STDEXT3_MD_CLEAR  0x0400
 #defineCPUID_STDEXT3_TSXFA 0x2000
 #defineCPUID_STDEXT3_PCONFIG   0x0004
@@ -555,6 +556,7 @@
 #defineMSR_BBL_CR_BUSY 0x11b
 #defineMSR_BBL_CR_CTL3 0x11e
 #defineMSR_IA32_TSX_CTRL   0x122
+#defineMSR_IA32_MCU_OPT_CTRL   0x123
 #defineMSR_SYSENTER_CS_MSR 0x174
 #defineMSR_SYSENTER_ESP_MSR0x175
 #defineMSR_SYSENTER_EIP_MSR0x176
@@ -796,6 +798,9 @@
 
 /* MSR IA32_FLUSH_CMD */
 #defineIA32_FLUSH_CMD_L1D  0x0001
+
+/* MSR IA32_MCU_OPT_CTRL */
+#defineIA32_RNGDS_MITG_DIS 0x0001
 
 /* MSR IA32_HWP_CAPABILITIES */
 #defineIA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(x)(((x) >> 0) & 
0xff)

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Fri Jun 12 22:10:03 2020(r362128)
+++ head/sys/x86/x86/identcpu.c Fri Jun 12 22:12:57 2020(r362129)
@@ -1028,6 +1028,7 @@ printcpuinfo(void)
   "\004AVX512_4FMAPS"
   "\005FSRM"
   "\011AVX512VP2INTERSECT"
+  "\012MCUOPT"
   "\013MD_CLEAR"
   "\016TSXFA"
   "\023PCONFIG"
___
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"


svn commit: r362128 - in head/libexec/rtld-elf: . rtld-libc

2020-06-12 Thread Konstantin Belousov
Author: kib
Date: Fri Jun 12 22:10:03 2020
New Revision: 362128
URL: https://svnweb.freebsd.org/changeset/base/362128

Log:
  rtld: set osrel when in the direct exec mode.
  
  Rtld itself is a shared object which does not have vendor note, so
  after the direct exec of ld-elf.so.1 process has p_osrel set to zero.
  This affects the ABI of syscalls.
  
  Set osrel to the __FreeBSD_version value at compile time right after
  rtld identified direct exec mode.  Then, switch to the osrel read from
  the binary note or zero if no note, right before starting calling
  ifunc resolvers, which is the first byte of the user code.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld-libc/Makefile.inc
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc
==
--- head/libexec/rtld-elf/rtld-libc/Makefile.incFri Jun 12 21:55:30 
2020(r362127)
+++ head/libexec/rtld-elf/rtld-libc/Makefile.incFri Jun 12 22:10:03 
2020(r362128)
@@ -46,7 +46,7 @@ _libc_string_objects= bcmp bcopy bzero memset memchr m
 # Also use all the syscall .o files from libc_nossp_pic:
 _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \
 cerror geteuid getegid sigfastblock munmap mprotect \
-sysarch __sysctl issetugid __getcwd utrace \
+sysarch __sysctl issetugid __getcwd utrace getpid \
 thr_self thr_kill pread mmap lseek _exit _fstat _fstatat _fstatfs \
 getdirentries _getdirentries _close _fcntl _open _openat _read \
 _sigprocmask _write readlink __realpathat _setjmp setjmp setjmperr

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cFri Jun 12 21:55:30 2020
(r362127)
+++ head/libexec/rtld-elf/rtld.cFri Jun 12 22:10:03 2020
(r362128)
@@ -384,11 +384,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
 const char *argv0, *binpath;
 caddr_t imgentry;
 char buf[MAXPATHLEN];
-int argc, fd, i, phnum, rtld_argc;
+int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc;
+size_t sz;
 #ifdef __powerpc__
 int old_auxv_format = 1;
 #endif
-bool dir_enable, explicit_fd, search_in_path;
+bool dir_enable, direct_exec, explicit_fd, search_in_path;
 
 /*
  * On entry, the dynamic linker itself has not been relocated yet.
@@ -451,6 +452,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
ld_fast_sigblock = true;
 
 trust = !issetugid();
+direct_exec = false;
 
 md_abi_variant_hook(aux_info);
 
@@ -466,6 +468,21 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
argv0);
rtld_die();
}
+   direct_exec = true;
+
+   /*
+* Set osrel for us, it is later reset to the binary'
+* value before first instruction of code from the binary
+* is executed.
+*/
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[2] = KERN_PROC_OSREL;
+   mib[3] = getpid();
+   osrel = __FreeBSD_version;
+   sz = sizeof(old_osrel);
+   (void)sysctl(mib, 4, _osrel, , , sizeof(osrel));
+
dbg("opening main program in direct exec mode");
if (argc >= 2) {
rtld_argc = parse_args(argv, argc, _in_path, , 
);
@@ -803,6 +820,18 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
  * init functions.
  */
 pre_init();
+
+if (direct_exec) {
+   /* Set osrel for direct-execed binary */
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[2] = KERN_PROC_OSREL;
+   mib[3] = getpid();
+   osrel = obj_main->osrel;
+   sz = sizeof(old_osrel);
+   dbg("setting osrel to %d", osrel);
+   (void)sysctl(mib, 4, _osrel, , , sizeof(osrel));
+}
 
 wlock_acquire(rtld_bind_lock, );
 
___
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"


svn commit: r362127 - head/lib/libsecureboot

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:55:30 2020
New Revision: 362127
URL: https://svnweb.freebsd.org/changeset/base/362127

Log:
  verify_pcr_export: bump kenv_mvallen if needed
  
  The loader.ve.hashed list can easily exceed KENV_MVALLEN.
  If so, bump kenv_mvallen to a multiple of KENV_MVALLEN to
  accommodate the value.
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/lib/libsecureboot/verify_file.c

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cFri Jun 12 21:53:08 2020
(r362126)
+++ head/lib/libsecureboot/verify_file.cFri Jun 12 21:55:30 2020
(r362127)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "libsecureboot.h"
 #include 
@@ -532,6 +533,19 @@ verify_pcr_export(void)
DEBUG_PRINTF(1,
("%s: setenv(loader.ve.hashed, %s\n",
__func__, hinfo));
+   if ((hlen = strlen(hinfo)) > KENV_MVALLEN) {
+   /*
+* bump kenv_mvallen
+* roundup to multiple of KENV_MVALLEN
+*/
+   char mvallen[16];
+
+   hlen += KENV_MVALLEN -
+   (hlen % KENV_MVALLEN);
+   if (snprintf(mvallen, sizeof(mvallen),
+   "%d", (int) hlen) < 
sizeof(mvallen))
+   setenv("kenv_mvallen", mvallen, 
1);
+   }
free(hinfo);
}
}
___
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"


svn commit: r362126 - head/sys/vm

2020-06-12 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 12 21:53:08 2020
New Revision: 362126
URL: https://svnweb.freebsd.org/changeset/base/362126

Log:
  Honor db_pager_quit in some vm_object ddb commands
  
  These can be rather verbose.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==
--- head/sys/vm/vm_object.c Fri Jun 12 21:51:20 2020(r362125)
+++ head/sys/vm/vm_object.c Fri Jun 12 21:53:08 2020(r362126)
@@ -2694,6 +2694,8 @@ DB_SHOW_COMMAND(vmochk, vm_object_check)
(void *)object->backing_object);
}
}
+   if (db_pager_quit)
+   return;
}
 }
 
@@ -2744,6 +2746,9 @@ DB_SHOW_COMMAND(object, vm_object_print_static)
 
db_printf("(off=0x%jx,page=0x%jx)",
(uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p));
+
+   if (db_pager_quit)
+   break;
}
if (count != 0)
db_printf("\n");
___
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"


svn commit: r362125 - head/sys/security/mac_veriexec

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:51:20 2020
New Revision: 362125
URL: https://svnweb.freebsd.org/changeset/base/362125

Log:
  mac_veriexec_fingerprint_check_vnode: v_writecount > 0 means active writers
  
  v_writecount can actually be < 0 for text,
  so check for v_writecount > 0
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/sys/security/mac_veriexec/veriexec_fingerprint.c

Modified: head/sys/security/mac_veriexec/veriexec_fingerprint.c
==
--- head/sys/security/mac_veriexec/veriexec_fingerprint.c   Fri Jun 12 
21:48:46 2020(r362124)
+++ head/sys/security/mac_veriexec/veriexec_fingerprint.c   Fri Jun 12 
21:51:20 2020(r362125)
@@ -215,7 +215,7 @@ mac_veriexec_fingerprint_check_vnode(struct vnode *vp,
int error;
 
/* reject fingerprint if writers are active */
-   if (vp->v_writecount)
+   if (vp->v_writecount > 0)
return (ETXTBSY);
 
if ((vp->v_mount->mnt_flag & MNT_VERIFIED) != 0) {
___
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"


svn commit: r362124 - head/stand/common

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:48:46 2020
New Revision: 362124
URL: https://svnweb.freebsd.org/changeset/base/362124

Log:
  Minor cleanup of initialized variables
  
  Sort the list and cleanup trailing white-space
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/stand/common/install.c

Modified: head/stand/common/install.c
==
--- head/stand/common/install.c Fri Jun 12 21:33:02 2020(r362123)
+++ head/stand/common/install.c Fri Jun 12 21:48:46 2020(r362124)
@@ -207,15 +207,15 @@ install(char *pkgname)
if (*s == '\0')
goto invalid_url;
 
-   proto = NULL;
devname = NULL;
devnamelen = 0;
-   
+   proto = NULL;
+   local = 0;
+
if (i == 4 && !strncasecmp(pkgname, "tftp", i)) {
devname = "net0";
devnamelen = 4;
proto = _fsops;
-   local = 0;
} else if (i == 4 && !strncasecmp(pkgname, "file", i)) {
currdev = getenv("currdev");
local = 1;
___
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"


svn commit: r362123 - head/sys/crypto/aesni

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 21:33:02 2020
New Revision: 362123
URL: https://svnweb.freebsd.org/changeset/base/362123

Log:
  Fix AES-CCM requests with an AAD size smaller than a single block.
  
  The amount to copy for the first block is the minimum of the size of
  the AAD region or the remaining space in the first block.
  
  Reported by:  cryptocheck -z
  MFC after:2 weeks
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D25140

Modified:
  head/sys/crypto/aesni/aesni_ccm.c

Modified: head/sys/crypto/aesni/aesni_ccm.c
==
--- head/sys/crypto/aesni/aesni_ccm.c   Fri Jun 12 21:21:18 2020
(r362122)
+++ head/sys/crypto/aesni/aesni_ccm.c   Fri Jun 12 21:33:02 2020
(r362123)
@@ -155,7 +155,7 @@ cbc_mac_start(const unsigned char *auth_data, size_t a
 * already partially filled, by auth_amt, so we need
 * to handle that.  The last block needs to be zero padded.
 */
-   copy_amt = MIN(auth_len - auth_amt,
+   copy_amt = MIN(auth_len,
sizeof(staging_block) - auth_amt);
byte_ptr = (uint8_t*)_block;
bcopy(auth_ptr, _ptr[auth_amt], copy_amt);
___
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"


svn commit: r362122 - in head/sys/mips: include mips

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 21:21:18 2020
New Revision: 362122
URL: https://svnweb.freebsd.org/changeset/base/362122

Log:
  Various fixes to TLS for MIPS.
  
  - Clear the current thread's TLS pointer on exec. Previously the TLS
pointer (and register) remain unchanged.
  
  - Explicitly clear the TLS pointer when new threads are created.
  
  - Make md_tls_tcb_offset per-process instead of per-thread.
  
The layout of the TLS and TCB are identical for all threads in a
process, it is only the TLS pointer values themselves that vary by
thread.  This also makes setting md_tls_tcb_offset in
cpu_set_user_tls() redundant with the setting in exec_setregs(), so
only set it in exec_setregs().
  
  Submitted by: Alfredo Mazzinghi (1)
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D24957

Modified:
  head/sys/mips/include/proc.h
  head/sys/mips/mips/genassym.c
  head/sys/mips/mips/pm_machdep.c
  head/sys/mips/mips/swtch.S
  head/sys/mips/mips/sys_machdep.c
  head/sys/mips/mips/trap.c
  head/sys/mips/mips/vm_machdep.c

Modified: head/sys/mips/include/proc.h
==
--- head/sys/mips/include/proc.hFri Jun 12 21:17:56 2020
(r362121)
+++ head/sys/mips/include/proc.hFri Jun 12 21:21:18 2020
(r362122)
@@ -64,7 +64,6 @@ struct mdthread {
int md_pc_count;/* performance counter */
int md_pc_spill;/* performance counter spill */
void*md_tls;
-   size_t  md_tls_tcb_offset;  /* TCB offset */
 #ifdef CPU_CNMIPS
struct octeon_cop2_state*md_cop2; /* kernel context */
struct octeon_cop2_state*md_ucop2; /* userland context */
@@ -79,8 +78,7 @@ struct mdthread {
 #defineMDTD_COP2USED   0x0002  /* Process used the COP2 */
 
 struct mdproc {
-   /* Avoid empty structs because they are undefined behavior. */
-   longmd_spare;
+   size_t  md_tls_tcb_offset;  /* TCB offset */
 };
 
 struct syscall_args {

Modified: head/sys/mips/mips/genassym.c
==
--- head/sys/mips/mips/genassym.c   Fri Jun 12 21:17:56 2020
(r362121)
+++ head/sys/mips/mips/genassym.c   Fri Jun 12 21:21:18 2020
(r362122)
@@ -70,13 +70,15 @@ __FBSDID("$FreeBSD$");
 #endif
 
 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
+ASSYM(TD_PROC, offsetof(struct thread, td_proc));
 ASSYM(TD_UPTE, offsetof(struct thread, td_md.md_upte));
 ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
 ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
 ASSYM(TD_MDFLAGS, offsetof(struct thread, td_md.md_flags));
 ASSYM(TD_MDTLS, offsetof(struct thread, td_md.md_tls));
-ASSYM(TD_MDTLS_TCB_OFFSET, offsetof(struct thread, td_md.md_tls_tcb_offset));
+
+ASSYM(P_MDTLS_TCB_OFFSET, offsetof(struct proc, p_md.md_tls_tcb_offset));
 
 ASSYM(U_PCB_REGS, offsetof(struct pcb, pcb_regs.zero));
 ASSYM(U_PCB_CONTEXT, offsetof(struct pcb, pcb_context));

Modified: head/sys/mips/mips/pm_machdep.c
==
--- head/sys/mips/mips/pm_machdep.c Fri Jun 12 21:17:56 2020
(r362121)
+++ head/sys/mips/mips/pm_machdep.c Fri Jun 12 21:21:18 2020
(r362122)
@@ -473,12 +473,15 @@ exec_setregs(struct thread *td, struct image_params *i
PCPU_SET(fpcurthread, (struct thread *)0);
td->td_md.md_ss_addr = 0;
 
+   td->td_md.md_tls = NULL;
 #ifdef COMPAT_FREEBSD32
if (!SV_PROC_FLAG(td->td_proc, SV_LP64))
-   td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32;
+   td->td_proc->p_md.md_tls_tcb_offset = TLS_TP_OFFSET +
+   TLS_TCB_SIZE32;
else
 #endif
-   td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE;
+   td->td_proc->p_md.md_tls_tcb_offset = TLS_TP_OFFSET +
+   TLS_TCB_SIZE;
 }
 
 int

Modified: head/sys/mips/mips/swtch.S
==
--- head/sys/mips/mips/swtch.S  Fri Jun 12 21:17:56 2020(r362121)
+++ head/sys/mips/mips/swtch.S  Fri Jun 12 21:21:18 2020(r362122)
@@ -386,7 +386,8 @@ sw2:
.globl  cpu_switch_set_userlocal
 cpu_switch_set_userlocal:
PTR_L   t0, TD_MDTLS(a1)# Get TLS pointer
-   PTR_L   t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset
+   PTR_L   t1, TD_PROC(a1)
+   PTR_L   t1, P_MDTLS_TCB_OFFSET(t1)  # Get TLS/TCB offset
PTR_ADDU v0, t0, t1
MTC0v0, MIPS_COP_0_USERLOCAL, 2 # write it to ULR for rdhwr
 

Modified: head/sys/mips/mips/sys_machdep.c
==
--- head/sys/mips/mips/sys_machdep.cFri 

svn commit: r362121 - in head/sys: amd64/amd64 i386/i386

2020-06-12 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 12 21:17:56 2020
New Revision: 362121
URL: https://svnweb.freebsd.org/changeset/base/362121

Log:
  FPU init: allocate initial state from UMA to ensure alignment
  
  The Intel Instruction Set Reference says this about the XSAVE instruction:
  
  Use of a destination operand not aligned to 64-byte boundary
  (in either 64-bit or 32-bit modes) results in a general-protection
  (#GP) exception.
  
  This alignment happens naturally when all malloc buckets are powers
  of two.  However, this change is necessary on some systems when
  certain non-power-of-two (and non-multiple of 64) malloc buckets
  are defined.
  
  Reviewed by:  cem; kib; earlier version by jhb
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25098

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/i386/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:12:26 2020(r362120)
+++ head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:17:56 2020(r362121)
@@ -372,8 +372,7 @@ fpuinitstate(void *arg __unused)
fpu_save_area_zone = uma_zcreate("FPU_save_area",
cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
XSAVE_AREA_ALIGN - 1, 0);
-   fpu_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF,
-   M_WAITOK | M_ZERO);
+   fpu_initialstate = uma_zalloc(fpu_save_area_zone, M_WAITOK | M_ZERO);
if (use_xsave) {
max_ext_n = flsl(xsave_mask);
xsave_area_desc = malloc(max_ext_n * sizeof(struct

Modified: head/sys/i386/i386/npx.c
==
--- head/sys/i386/i386/npx.cFri Jun 12 21:12:26 2020(r362120)
+++ head/sys/i386/i386/npx.cFri Jun 12 21:17:56 2020(r362121)
@@ -483,8 +483,7 @@ npxinitstate(void *arg __unused)
fpu_save_area_zone = uma_zcreate("FPU_save_area",
cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
XSAVE_AREA_ALIGN - 1, 0);
-   npx_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF,
-   M_WAITOK | M_ZERO);
+   npx_initialstate = uma_zalloc(fpu_save_area_zone, M_WAITOK | M_ZERO);
if (use_xsave) {
if (xsave_mask >> 32 != 0)
max_ext_n = fls(xsave_mask >> 32) + 32;
___
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"


svn commit: r362120 - in head/sys: amd64/amd64 i386/i386

2020-06-12 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 12 21:12:26 2020
New Revision: 362120
URL: https://svnweb.freebsd.org/changeset/base/362120

Log:
  FPU: make xsave_area_desc static
  
  ...because it can be.
  
  Reviewed by:  cem kib
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25098

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/i386/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:10:45 2020(r362119)
+++ head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:12:26 2020(r362120)
@@ -159,7 +159,7 @@ uint64_t xsave_mask;/* the same */
 static uma_zone_t fpu_save_area_zone;
 static struct savefpu *fpu_initialstate;
 
-struct xsave_area_elm_descr {
+static struct xsave_area_elm_descr {
u_int   offset;
u_int   size;
 } *xsave_area_desc;

Modified: head/sys/i386/i386/npx.c
==
--- head/sys/i386/i386/npx.cFri Jun 12 21:10:45 2020(r362119)
+++ head/sys/i386/i386/npx.cFri Jun 12 21:12:26 2020(r362120)
@@ -201,7 +201,7 @@ uint64_t xsave_mask;
 static uma_zone_t fpu_save_area_zone;
 static union savefpu *npx_initialstate;
 
-struct xsave_area_elm_descr {
+static struct xsave_area_elm_descr {
u_int   offset;
u_int   size;
 } *xsave_area_desc;
___
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"


svn commit: r362119 - in head/sys: amd64/amd64 i386/i386

2020-06-12 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 12 21:10:45 2020
New Revision: 362119
URL: https://svnweb.freebsd.org/changeset/base/362119

Log:
  FPU init: Do potentially blocking operations before disabling interrupts
  
  In particular, uma_zcreate creates sysctl oids, which locks an sx lock,
  which uses IPIs under contention.  IPIs tend not to work very well
  when interrupts are disabled.  Who knew, right?
  
  Reviewed by:  cem kib
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25098

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/i386/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Fri Jun 12 20:39:42 2020(r362118)
+++ head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:10:45 2020(r362119)
@@ -368,8 +368,18 @@ fpuinitstate(void *arg __unused)
register_t saveintr;
int cp[4], i, max_ext_n;
 
+   /* Do potentially blocking operations before disabling interrupts. */
+   fpu_save_area_zone = uma_zcreate("FPU_save_area",
+   cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
+   XSAVE_AREA_ALIGN - 1, 0);
fpu_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF,
M_WAITOK | M_ZERO);
+   if (use_xsave) {
+   max_ext_n = flsl(xsave_mask);
+   xsave_area_desc = malloc(max_ext_n * sizeof(struct
+   xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
+   }
+
saveintr = intr_disable();
stop_emulating();
 
@@ -399,9 +409,6 @@ fpuinitstate(void *arg __unused)
offsetof(struct xstate_hdr, xstate_bv));
*xstate_bv = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE;
 
-   max_ext_n = flsl(xsave_mask);
-   xsave_area_desc = malloc(max_ext_n * sizeof(struct
-   xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
/* x87 state */
xsave_area_desc[0].offset = 0;
xsave_area_desc[0].size = 160;
@@ -415,10 +422,6 @@ fpuinitstate(void *arg __unused)
xsave_area_desc[i].size = cp[0];
}
}
-
-   fpu_save_area_zone = uma_zcreate("FPU_save_area",
-   cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
-   XSAVE_AREA_ALIGN - 1, 0);
 
start_emulating();
intr_restore(saveintr);

Modified: head/sys/i386/i386/npx.c
==
--- head/sys/i386/i386/npx.cFri Jun 12 20:39:42 2020(r362118)
+++ head/sys/i386/i386/npx.cFri Jun 12 21:10:45 2020(r362119)
@@ -479,8 +479,21 @@ npxinitstate(void *arg __unused)
if (!hw_float)
return;
 
+   /* Do potentially blocking operations before disabling interrupts. */
+   fpu_save_area_zone = uma_zcreate("FPU_save_area",
+   cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
+   XSAVE_AREA_ALIGN - 1, 0);
npx_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF,
M_WAITOK | M_ZERO);
+   if (use_xsave) {
+   if (xsave_mask >> 32 != 0)
+   max_ext_n = fls(xsave_mask >> 32) + 32;
+   else
+   max_ext_n = fls(xsave_mask);
+   xsave_area_desc = malloc(max_ext_n * sizeof(struct
+   xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
+   }
+
saveintr = intr_disable();
stop_emulating();
 
@@ -522,12 +535,6 @@ npxinitstate(void *arg __unused)
offsetof(struct xstate_hdr, xstate_bv));
*xstate_bv = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE;
 
-   if (xsave_mask >> 32 != 0)
-   max_ext_n = fls(xsave_mask >> 32) + 32;
-   else
-   max_ext_n = fls(xsave_mask);
-   xsave_area_desc = malloc(max_ext_n * sizeof(struct
-   xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
/* x87 state */
xsave_area_desc[0].offset = 0;
xsave_area_desc[0].size = 160;
@@ -541,10 +548,6 @@ npxinitstate(void *arg __unused)
xsave_area_desc[i].size = cp[0];
}
}
-
-   fpu_save_area_zone = uma_zcreate("FPU_save_area",
-   cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
-   XSAVE_AREA_ALIGN - 1, 0);
 
start_emulating();
intr_restore(saveintr);
___
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"


svn commit: r362118 - stable/12/sys/geom/eli

2020-06-12 Thread Alan Somers
Author: asomers
Date: Fri Jun 12 20:39:42 2020
New Revision: 362118
URL: https://svnweb.freebsd.org/changeset/base/362118

Log:
  MFC r361562:
  
  geli: fix a livelock during panic
  
  During any kind of shutdown, kern_reboot calls geli's pre_sync event hook,
  which tries to destroy all unused geli devices. But during a panic, geli
  can't destroy any devices, because the scheduler is stopped, so it can't
  switch threads. A livelock results, and the system never dumps core.
  
  This commit fixes the problem by refusing to destroy any devices during
  panic, used or otherwise.
  
  PR:   246207
  Reviewed by:  jhb
  Sponsored by: Axcient
  Differential Revision:https://reviews.freebsd.org/D24697

Modified:
  stable/12/sys/geom/eli/g_eli.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/geom/eli/g_eli.c
==
--- stable/12/sys/geom/eli/g_eli.c  Fri Jun 12 20:33:00 2020
(r362117)
+++ stable/12/sys/geom/eli/g_eli.c  Fri Jun 12 20:39:42 2020
(r362118)
@@ -1320,11 +1320,13 @@ g_eli_shutdown_pre_sync(void *arg, int howto)
continue;
pp = LIST_FIRST(>provider);
KASSERT(pp != NULL, ("No provider? gp=%p (%s)", gp, gp->name));
-   if (pp->acr + pp->acw + pp->ace == 0)
-   error = g_eli_destroy(sc, TRUE);
-   else {
+   if (pp->acr != 0 || pp->acw != 0 || pp->ace != 0 ||
+   SCHEDULER_STOPPED())
+   {
sc->sc_flags |= G_ELI_FLAG_RW_DETACH;
gp->access = g_eli_access;
+   } else {
+   error = g_eli_destroy(sc, TRUE);
}
}
g_topology_unlock();
___
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"


svn commit: r362117 - stable/12/share/man/man4

2020-06-12 Thread Alan Somers
Author: asomers
Date: Fri Jun 12 20:33:00 2020
New Revision: 362117
URL: https://svnweb.freebsd.org/changeset/base/362117

Log:
  MFC r361439:
  
  [skip ci] ip.4: fix typos

Modified:
  stable/12/share/man/man4/ip.4
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/ip.4
==
--- stable/12/share/man/man4/ip.4   Fri Jun 12 20:32:26 2020
(r362116)
+++ stable/12/share/man/man4/ip.4   Fri Jun 12 20:33:00 2020
(r362117)
@@ -28,7 +28,7 @@
 .\" @(#)ip.4   8.2 (Berkeley) 11/30/93
 .\" $FreeBSD$
 .\"
-.Dd February 22, 2019
+.Dd May 24, 2020
 .Dt IP 4
 .Os
 .Sh NAME
@@ -144,7 +144,7 @@ the
 .Xr recvmsg 2
 call will return the destination
 .Tn IP
-address and destination port or a
+address and destination port for a
 .Tn UDP
 datagram.
 The
@@ -155,13 +155,13 @@ structure points to a buffer
 that contains a
 .Vt cmsghdr
 structure followed by the
-.Tn in_sockkaddr
-structre.
+.Tn sockaddr_in
+structure.
 The
 .Vt cmsghdr
 fields have the following values:
 .Bd -literal
-cmsg_len = CMSG_LEN(sizeof(struct in_sockaddr))
+cmsg_len = CMSG_LEN(sizeof(struct sockaddr_in))
 cmsg_level = IPPROTO_IP
 cmsg_type = IP_ORIGDSTADDR
 .Ed
___
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"


svn commit: r362116 - in stable/12: sys/fs/fuse tests/sys/fs/fusefs

2020-06-12 Thread Alan Somers
Author: asomers
Date: Fri Jun 12 20:32:26 2020
New Revision: 362116
URL: https://svnweb.freebsd.org/changeset/base/362116

Log:
  MFC r361401:
  
  Fix issues with FUSE_ACCESS when default_permissions is disabled
  
  This patch fixes two issues relating to FUSE_ACCESS when the
  default_permissions mount option is disabled:
  
  * VOP_ACCESS() calls with VADMIN set should never be sent to a fuse server
in the form of FUSE_ACCESS operations. The FUSE protocol has no equivalent
of VADMIN, so we must evaluate such things kernel-side, regardless of the
default_permissions setting.
  
  * The FUSE protocol only requires FUSE_ACCESS to be sent for two purposes:
for the access(2) syscall and to check directory permissions for
searchability during lookup. FreeBSD sends it much more frequently, due to
differences between our VFS and Linux's, for which FUSE was designed. But
this patch does eliminate several cases not required by the FUSE protocol:
  
* for any FUSE_*XATTR operation
* when creating a new file
* when deleting a file
* when setting timestamps, such as by utimensat(2).
  
  * Additionally, when default_permissions is disabled, this patch removes one
FUSE_GETATTR operation when deleting a file.
  
  PR:   245689
  Reported by:  MooseFS FreeBSD Team 
  Reviewed by:  cem
  Differential Revision:https://reviews.freebsd.org/D24777

Modified:
  stable/12/sys/fs/fuse/fuse_internal.c
  stable/12/sys/fs/fuse/fuse_vnops.c
  stable/12/tests/sys/fs/fusefs/access.cc
  stable/12/tests/sys/fs/fusefs/rename.cc
  stable/12/tests/sys/fs/fusefs/rmdir.cc
  stable/12/tests/sys/fs/fusefs/unlink.cc
  stable/12/tests/sys/fs/fusefs/utils.cc
  stable/12/tests/sys/fs/fusefs/utils.hh
  stable/12/tests/sys/fs/fusefs/xattr.cc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/fuse/fuse_internal.c
==
--- stable/12/sys/fs/fuse/fuse_internal.c   Fri Jun 12 20:27:37 2020
(r362115)
+++ stable/12/sys/fs/fuse/fuse_internal.c   Fri Jun 12 20:32:26 2020
(r362116)
@@ -158,6 +158,7 @@ fuse_internal_get_cached_vnode(struct mount* mp, ino_t
return 0;
 }
 
+SDT_PROBE_DEFINE0(fusefs, , internal, access_vadmin);
 /* Synchronously send a FUSE_ACCESS operation */
 int
 fuse_internal_access(struct vnode *vp,
@@ -210,10 +211,18 @@ fuse_internal_access(struct vnode *vp,
va.va_gid, mode, cred, NULL);
}
 
+   if (mode & VADMIN) {
+   /*
+* The FUSE protocol doesn't have an equivalent of VADMIN, so
+* it's a bug if we ever reach this point with that bit set.
+*/
+   SDT_PROBE0(fusefs, , internal, access_vadmin);
+   }
+
if (!fsess_isimpl(mp, FUSE_ACCESS))
return 0;
 
-   if ((mode & (VWRITE | VAPPEND | VADMIN)) != 0)
+   if ((mode & (VWRITE | VAPPEND)) != 0)
mask |= W_OK;
if ((mode & VREAD) != 0)
mask |= R_OK;

Modified: stable/12/sys/fs/fuse/fuse_vnops.c
==
--- stable/12/sys/fs/fuse/fuse_vnops.c  Fri Jun 12 20:27:37 2020
(r362115)
+++ stable/12/sys/fs/fuse/fuse_vnops.c  Fri Jun 12 20:32:26 2020
(r362116)
@@ -233,6 +233,7 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, stru
 {
struct mount *mp = vnode_mount(vp);
struct fuse_data *data = fuse_get_mpdata(mp);
+   int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS;
 
/*
 * Kernel-invoked always succeeds.
@@ -246,13 +247,16 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, stru
 */
switch (ns) {
case EXTATTR_NAMESPACE_SYSTEM:
-   if (data->dataflags & FSESS_DEFAULT_PERMISSIONS) {
+   if (default_permissions) {
return (priv_check_cred(cred, PRIV_VFS_EXTATTR_SYSTEM,
0));
}
-   /* FALLTHROUGH */
+   return (0);
case EXTATTR_NAMESPACE_USER:
-   return (fuse_internal_access(vp, accmode, td, cred));
+   if (default_permissions) {
+   return (fuse_internal_access(vp, accmode, td, cred));
+   }
+   return (0);
default:
return (EPERM);
}
@@ -984,6 +988,8 @@ fuse_vnop_lookup(struct vop_lookup_args *ap)
int wantparent = flags & (LOCKPARENT | WANTPARENT);
int islastcn = flags & ISLASTCN;
struct mount *mp = vnode_mount(dvp);
+   struct fuse_data *data = fuse_get_mpdata(mp);
+   int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS;
 
int err = 0;
int lookup_err = 0;
@@ -1107,7 +1113,11 @@ fuse_vnop_lookup(struct vop_lookup_args *ap)
if (lookup_err) {
/* Entry not 

svn commit: r362115 - stable/12/sys/fs/fuse

2020-06-12 Thread Alan Somers
Author: asomers
Date: Fri Jun 12 20:27:37 2020
New Revision: 362115
URL: https://svnweb.freebsd.org/changeset/base/362115

Log:
  MFC r361399:
  
  Disable nullfs cacheing on top of fusefs
  
  Nullfs cacheing can keep a large number of vnodes active.  That results in
  more active FUSE file handles, causing some FUSE servers to use extra
  resources.  Disable nullfs cacheing for fusefs, just like we already do for
  NFSv4.
  
  PR:   245688
  Reported by:  MooseFS FreeBSD Team 

Modified:
  stable/12/sys/fs/fuse/fuse_vfsops.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/fuse/fuse_vfsops.c
==
--- stable/12/sys/fs/fuse/fuse_vfsops.c Fri Jun 12 20:11:25 2020
(r362114)
+++ stable/12/sys/fs/fuse/fuse_vfsops.c Fri Jun 12 20:27:37 2020
(r362115)
@@ -425,6 +425,11 @@ fuse_vfsop_mount(struct mount *mp)
 */
mp->mnt_flag &= ~MNT_LOCAL;
mp->mnt_kern_flag |= MNTK_USES_BCACHE;
+   /* 
+* Disable nullfs cacheing because it can consume too many resources in
+* the FUSE server.
+*/
+   mp->mnt_kern_flag |= MNTK_NULL_NOCACHE;
MNT_IUNLOCK(mp);
/* We need this here as this slot is used by getnewvnode() */
mp->mnt_stat.f_iosize = maxbcachebuf;
___
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"


svn commit: r362114 - stable/12/tests/sys/fs/fusefs

2020-06-12 Thread Alan Somers
Author: asomers
Date: Fri Jun 12 20:11:25 2020
New Revision: 362114
URL: https://svnweb.freebsd.org/changeset/base/362114

Log:
  MFC r361223:
  
  fusefs: fix intermittency in some ENOENT tests
  
  When a FUSE operation other than LOOKUP returns ENOENT, the kernel will
  reclaim that vnode, resuling in a FUSE_FORGET being sent a short while
  later.  Many of the ENOENT tests weren't expecting those FUSE_FORGET
  operations.  They usually passed by luck since FUSE_FORGET is often delayed.
  This commit adds appropriate expectations.

Modified:
  stable/12/tests/sys/fs/fusefs/getattr.cc
  stable/12/tests/sys/fs/fusefs/open.cc
  stable/12/tests/sys/fs/fusefs/opendir.cc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/fs/fusefs/getattr.cc
==
--- stable/12/tests/sys/fs/fusefs/getattr.ccFri Jun 12 19:56:19 2020
(r362113)
+++ stable/12/tests/sys/fs/fusefs/getattr.ccFri Jun 12 20:11:25 2020
(r362114)
@@ -32,6 +32,8 @@
 
 extern "C" {
 #include 
+
+#include 
 }
 
 #include "mockfs.hh"
@@ -172,7 +174,10 @@ TEST_F(Getattr, enoent)
const char RELPATH[] = "some_file.txt";
struct stat sb;
const uint64_t ino = 42;
+   sem_t sem;
 
+   ASSERT_EQ(0, sem_init(, 0, 0)) << strerror(errno);
+
expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1, 0, 0);
EXPECT_CALL(*m_mock, process(
ResultOf([](auto in) {
@@ -181,8 +186,15 @@ TEST_F(Getattr, enoent)
}, Eq(true)),
_)
).WillOnce(Invoke(ReturnErrno(ENOENT)));
+   // Since FUSE_GETATTR returns ENOENT, the kernel will reclaim the vnode
+   // and send a FUSE_FORGET
+   expect_forget(ino, 1, );
+
EXPECT_NE(0, stat(FULLPATH, ));
EXPECT_EQ(ENOENT, errno);
+
+   sem_wait();
+   sem_destroy();
 }
 
 TEST_F(Getattr, ok)

Modified: stable/12/tests/sys/fs/fusefs/open.cc
==
--- stable/12/tests/sys/fs/fusefs/open.cc   Fri Jun 12 19:56:19 2020
(r362113)
+++ stable/12/tests/sys/fs/fusefs/open.cc   Fri Jun 12 20:11:25 2020
(r362114)
@@ -32,7 +32,9 @@
 
 extern "C" {
 #include 
+
 #include 
+#include 
 }
 
 #include "mockfs.hh"
@@ -105,7 +107,10 @@ TEST_F(Open, enoent)
const char FULLPATH[] = "mountpoint/some_file.txt";
const char RELPATH[] = "some_file.txt";
uint64_t ino = 42;
+   sem_t sem;
 
+   ASSERT_EQ(0, sem_init(, 0, 0)) << strerror(errno);
+
expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1);
EXPECT_CALL(*m_mock, process(
ResultOf([=](auto in) {
@@ -114,8 +119,15 @@ TEST_F(Open, enoent)
}, Eq(true)),
_)
).WillOnce(Invoke(ReturnErrno(ENOENT)));
+   // Since FUSE_OPEN returns ENOENT, the kernel will reclaim the vnode
+   // and send a FUSE_FORGET
+   expect_forget(ino, 1, );
+
ASSERT_EQ(-1, open(FULLPATH, O_RDONLY));
EXPECT_EQ(ENOENT, errno);
+
+   sem_wait();
+   sem_destroy();
 }
 
 /* 

Modified: stable/12/tests/sys/fs/fusefs/opendir.cc
==
--- stable/12/tests/sys/fs/fusefs/opendir.ccFri Jun 12 19:56:19 2020
(r362113)
+++ stable/12/tests/sys/fs/fusefs/opendir.ccFri Jun 12 20:11:25 2020
(r362114)
@@ -32,7 +32,9 @@
 
 extern "C" {
 #include 
+
 #include 
+#include 
 }
 
 #include "mockfs.hh"
@@ -82,12 +84,21 @@ TEST_F(Opendir, enoent)
const char FULLPATH[] = "mountpoint/some_dir";
const char RELPATH[] = "some_dir";
uint64_t ino = 42;
+   sem_t sem;
 
+   ASSERT_EQ(0, sem_init(, 0, 0)) << strerror(errno);
+
expect_lookup(RELPATH, ino);
expect_opendir(ino, O_RDONLY, ReturnErrno(ENOENT));
+   // Since FUSE_OPENDIR returns ENOENT, the kernel will reclaim the vnode
+   // and send a FUSE_FORGET
+   expect_forget(ino, 1, );
 
ASSERT_EQ(-1, open(FULLPATH, O_DIRECTORY));
EXPECT_EQ(ENOENT, errno);
+
+   sem_wait();
+   sem_destroy();
 }
 
 /* 
___
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"


svn commit: r362113 - in head/sys/netinet: . tcp_stacks

2020-06-12 Thread Randall Stewart
Author: rrs
Date: Fri Jun 12 19:56:19 2020
New Revision: 362113
URL: https://svnweb.freebsd.org/changeset/base/362113

Log:
  So it turns out with the right window scaling you can get the code in all 
stacks to
  always want to do a window update, even when no data can be sent. Now in
  cases where you are not pacing thats probably ok, you just send an extra
  window update or two. However with bbr (and rack if its paced) every time
  the pacer goes off its going to send a "window update".
  
  Also in testing bbr I have found that if we are not responding to
  data right away we end up staying in startup but incorrectly holding
  a pacing gain of 192 (a loss). This is because the idle window code
  does not restict itself to only work with PROBE_BW. In all other
  states you dont want it doing a PROBE_BW state change.
  
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D25247

Modified:
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_stacks/bbr.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Fri Jun 12 18:41:12 2020
(r362112)
+++ head/sys/netinet/tcp_output.c   Fri Jun 12 19:56:19 2020
(r362113)
@@ -655,7 +655,10 @@ after_sack_rexmit:
adv = recwin;
if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) {
oldwin = (tp->rcv_adv - tp->rcv_nxt);
-   adv -= oldwin;
+   if (adv > oldwin)
+   adv -= oldwin;
+   else
+   adv = 0;
} else
oldwin = 0;
 

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Fri Jun 12 18:41:12 2020
(r362112)
+++ head/sys/netinet/tcp_stacks/bbr.c   Fri Jun 12 19:56:19 2020
(r362113)
@@ -8078,7 +8078,7 @@ bbr_restart_after_idle(struct tcp_bbr *bbr, uint32_t c
bbr->r_ctl.rc_bbr_hptsi_gain = bbr->r_ctl.rc_startup_pg;
bbr->r_ctl.rc_bbr_cwnd_gain = bbr->r_ctl.rc_startup_pg;
bbr_log_type_statechange(bbr, cts, __LINE__);
-   } else {
+   } else if (bbr->rc_bbr_state == BBR_STATE_PROBE_BW) {
bbr_substate_change(bbr, cts, __LINE__, 1);
}
}
@@ -12000,21 +12000,27 @@ bbr_window_update_needed(struct tcpcb *tp, struct sock
 * "adv" is the amount we could increase the window, taking into
 * account that we are limited by TCP_MAXWIN << tp->rcv_scale.
 */
-   uint32_t adv;
+   int32_t adv;
int32_t oldwin;
 
-   adv = min(recwin, TCP_MAXWIN << tp->rcv_scale);
+   adv = recwin;
if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) {
oldwin = (tp->rcv_adv - tp->rcv_nxt);
-   adv -= oldwin;
+   if (adv > oldwin)
+   adv -= oldwin;
+   else {
+   /* We can't increase the window */
+   adv = 0;
+   }
} else
oldwin = 0;
 
/*
-* If the new window size ends up being the same as the old size
-* when it is scaled, then don't force a window update.
+* If the new window size ends up being the same as or less
+* than the old size when it is scaled, then don't force
+* a window update.
 */
-   if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale)
+   if (oldwin >> tp->rcv_scale >= (adv + oldwin) >> tp->rcv_scale)
return (0);
 
if (adv >= (2 * maxseg) &&

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Fri Jun 12 18:41:12 2020
(r362112)
+++ head/sys/netinet/tcp_stacks/rack.c  Fri Jun 12 19:56:19 2020
(r362113)
@@ -12845,18 +12845,24 @@ again:
int32_t adv;
int oldwin;
 
-   adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale);
+   adv = recwin;
if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) {
oldwin = (tp->rcv_adv - tp->rcv_nxt);
-   adv -= oldwin;
+   if (adv > oldwin)
+   adv -= oldwin;
+   else {
+   /* We can't increase the window */
+   adv = 0;
+   }
} else
oldwin = 0;
 
/*
-* If the new window size ends up being the same as the old
-* size when it is scaled, then don't force a window update.
+ 

svn commit: r362112 - head/sys/x86/x86

2020-06-12 Thread Andrew Gallatin
Author: gallatin
Date: Fri Jun 12 18:41:12 2020
New Revision: 362112
URL: https://svnweb.freebsd.org/changeset/base/362112

Log:
  x86: Bump default msi/msix vector limit to 2048
  
  Given that 64c/128t CPUs are currently available, and that many
  devices (nvme, many NICs) desire to map 1 MSI-X vector per core,
  or even 1 per-thread, it is becoming far easier to see MSI-X interrupt
  setup fail due to msi vector exhaustion, and devices fail to attach at
  boot on large system.
  
  This bump costs 12KB on amd64 (and 6KB on i386), which seems
  worth the trade off for a better out of the box experience on
  high end hardware.
  
  Reviewed by:  jhb
  MFC after:21 days
  Sponsored by: Netflix

Modified:
  head/sys/x86/x86/msi.c

Modified: head/sys/x86/x86/msi.c
==
--- head/sys/x86/x86/msi.c  Fri Jun 12 18:13:32 2020(r362111)
+++ head/sys/x86/x86/msi.c  Fri Jun 12 18:41:12 2020(r362112)
@@ -156,7 +156,7 @@ u_int first_msi_irq;
 SYSCTL_UINT(_machdep, OID_AUTO, first_msi_irq, CTLFLAG_RD, _msi_irq, 0,
 "Number of first IRQ reserved for MSI and MSI-X interrupts");
 
-u_int num_msi_irqs = 512;
+u_int num_msi_irqs = 2048;
 SYSCTL_UINT(_machdep, OID_AUTO, num_msi_irqs, CTLFLAG_RDTUN, _msi_irqs, 0,
 "Number of IRQs reserved for MSI and MSI-X interrupts");
 
___
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"


svn commit: r362111 - head/lib/libc/gen

2020-06-12 Thread Kyle Evans
Author: kevans
Date: Fri Jun 12 18:13:32 2020
New Revision: 362111
URL: https://svnweb.freebsd.org/changeset/base/362111

Log:
  posix_spawn: fix for some custom allocator setups
  
  libc cannot assume that aligned_alloc and free come from jemalloc, or that
  any application providing its own malloc and free is actually providing
  aligned_alloc.
  
  Switch back to malloc and just make sure we're passing a properly aligned
  stack into rfork_thread, as an application perhaps can't reasonably replace
  just malloc or just free without headaches.
  
  This unbreaks ksh93 after r361996, which provides malloc/free but no
  aligned_alloc.
  
  Reported by:  freqlabs
  Diagnosed by: Andrew Gierth 
  X-MFC-With:   r361996

Modified:
  head/lib/libc/gen/posix_spawn.c

Modified: head/lib/libc/gen/posix_spawn.c
==
--- head/lib/libc/gen/posix_spawn.c Fri Jun 12 17:48:12 2020
(r362110)
+++ head/lib/libc/gen/posix_spawn.c Fri Jun 12 18:13:32 2020
(r362111)
@@ -276,9 +276,19 @@ do_posix_spawn(pid_t *pid, const char *path,
stacksz += MAX(3, cnt + 2) * sizeof(char *);
stacksz = PSPAWN_STACK_ALIGN(stacksz);
}
-   stack = aligned_alloc(PSPAWN_STACK_ALIGNMENT, stacksz);
+
+   /*
+* aligned_alloc is not safe to use here, because we can't guarantee
+* that aligned_alloc and free will be provided by the same
+* implementation.  We've actively hit at least one application that
+* will provide its own malloc/free but not aligned_alloc leading to
+* a free by the wrong allocator.
+*/
+   stack = malloc(stacksz);
if (stack == NULL)
return (ENOMEM);
+   stacksz = (((uintptr_t)stack + stacksz) & ~PSPAWN_STACK_ALIGNBYTES) -
+   (uintptr_t)stack;
 #endif
psa.path = path;
psa.fa = fa;
___
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"


Re: svn commit: r362110 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Doug Moore
As far as I know, by undoing the change that introduced the compilation
error, I have fixed the compilation error.  If you mean to ask whether I
intend to fix the underlying linuxkpi error, which motivated the earlier
unfortunate change, then yes, I do.  I intend to make things better as
soon as I can.  Thanks for your inquiry.

Doug Moore

On 2020-06-12 12:53, Hans Petter Selasky wrote:
> On 2020-06-12 19:51, Hans Petter Selasky wrote:
>> On 2020-06-12 19:48, Doug Moore wrote:
>>> Author: dougm
>>> Date: Fri Jun 12 17:48:12 2020
>>> New Revision: 362110
>>> URL: https://svnweb.freebsd.org/changeset/base/362110
>>>
>>> Log:
>>>    Revert r362108, as it breaks compilation.
>>>
>>> Modified:
>>>    head/sys/compat/linuxkpi/common/include/linux/rbtree.h
>>>
>>> Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
>>> ==
>>>
>>> --- head/sys/compat/linuxkpi/common/include/linux/rbtree.h    Fri
>>> Jun 12 17:31:38 2020    (r362109)
>>> +++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h    Fri
>>> Jun 12 17:48:12 2020    (r362110)
>>> @@ -37,8 +37,8 @@
>>>   struct rb_node {
>>>   RB_ENTRY(rb_node)    __entry;
>>>   };
>>> -#define    rb_left    RB_PTR(__entry.rbe_left)
>>> -#define    rb_right    RB_PTR(__entry.rbe_right)
>>> +#define    rb_left    __entry.rbe_left
>>> +#define    rb_right    __entry.rbe_right
>>>   /*
>>>    * We provide a false structure that has the same bit pattern as
>>> tree.h
>>>
>>
>> Are you planning to fix those compilation errors?
>>
>
> Or is the current code fine?
>
> --HPS
>
___
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"


Re: svn commit: r362110 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Hans Petter Selasky

On 2020-06-12 19:51, Hans Petter Selasky wrote:

On 2020-06-12 19:48, Doug Moore wrote:

Author: dougm
Date: Fri Jun 12 17:48:12 2020
New Revision: 362110
URL: https://svnweb.freebsd.org/changeset/base/362110

Log:
   Revert r362108, as it breaks compilation.

Modified:
   head/sys/compat/linuxkpi/common/include/linux/rbtree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
== 

--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h    Fri Jun 
12 17:31:38 2020    (r362109)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h    Fri Jun 
12 17:48:12 2020    (r362110)

@@ -37,8 +37,8 @@
  struct rb_node {
  RB_ENTRY(rb_node)    __entry;
  };
-#define    rb_left    RB_PTR(__entry.rbe_left)
-#define    rb_right    RB_PTR(__entry.rbe_right)
+#define    rb_left    __entry.rbe_left
+#define    rb_right    __entry.rbe_right
  /*
   * We provide a false structure that has the same bit pattern as tree.h



Are you planning to fix those compilation errors?



Or is the current code fine?

--HPS

___
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"


Re: svn commit: r362110 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Hans Petter Selasky

On 2020-06-12 19:48, Doug Moore wrote:

Author: dougm
Date: Fri Jun 12 17:48:12 2020
New Revision: 362110
URL: https://svnweb.freebsd.org/changeset/base/362110

Log:
   Revert r362108, as it breaks compilation.

Modified:
   head/sys/compat/linuxkpi/common/include/linux/rbtree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
17:31:38 2020(r362109)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
17:48:12 2020(r362110)
@@ -37,8 +37,8 @@
  struct rb_node {
RB_ENTRY(rb_node)   __entry;
  };
-#definerb_left RB_PTR(__entry.rbe_left)
-#definerb_rightRB_PTR(__entry.rbe_right)
+#definerb_left __entry.rbe_left
+#definerb_right__entry.rbe_right
  
  /*

   * We provide a false structure that has the same bit pattern as tree.h



Are you planning to fix those compilation errors?

--HPS
___
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"


svn commit: r362110 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Doug Moore
Author: dougm
Date: Fri Jun 12 17:48:12 2020
New Revision: 362110
URL: https://svnweb.freebsd.org/changeset/base/362110

Log:
  Revert r362108, as it breaks compilation.

Modified:
  head/sys/compat/linuxkpi/common/include/linux/rbtree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
17:31:38 2020(r362109)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
17:48:12 2020(r362110)
@@ -37,8 +37,8 @@
 struct rb_node {
RB_ENTRY(rb_node)   __entry;
 };
-#definerb_left RB_PTR(__entry.rbe_left)
-#definerb_rightRB_PTR(__entry.rbe_right)
+#definerb_left __entry.rbe_left
+#definerb_right__entry.rbe_right
 
 /*
  * We provide a false structure that has the same bit pattern as tree.h
___
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"


svn commit: r362109 - in head/sys: arm64/coresight conf

2020-06-12 Thread Ruslan Bukin
Author: br
Date: Fri Jun 12 17:31:38 2020
New Revision: 362109
URL: https://svnweb.freebsd.org/changeset/base/362109

Log:
  Coresight replicator:
  o Add a header file;
  o Split-out FDT attachment to a separate file;
  o Add ACPI attachment.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/arm64/coresight/coresight_replicator.h   (contents, props changed)
  head/sys/arm64/coresight/coresight_replicator_acpi.c   (contents, props 
changed)
  head/sys/arm64/coresight/coresight_replicator_fdt.c   (contents, props 
changed)
Modified:
  head/sys/arm64/coresight/coresight_replicator.c
  head/sys/conf/files.arm64

Modified: head/sys/arm64/coresight/coresight_replicator.c
==
--- head/sys/arm64/coresight/coresight_replicator.c Fri Jun 12 16:51:55 
2020(r362108)
+++ head/sys/arm64/coresight/coresight_replicator.c Fri Jun 12 17:31:38 
2020(r362109)
@@ -41,25 +41,10 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
-#include 
-#include 
-
 #include "coresight_if.h"
 
-#defineREPLICATOR_IDFILTER00x00
-#defineREPLICATOR_IDFILTER10x04
-
-static struct ofw_compat_data compat_data[] = {
-   { "arm,coresight-dynamic-replicator",   1 },
-   { NULL, 0 }
-};
-
-struct replicator_softc {
-   struct resource *res;
-   struct coresight_platform_data  *pdata;
-};
-
 static struct resource_spec replicator_spec[] = {
{ SYS_RES_MEMORY,   0,  RF_ACTIVE },
{ -1, 0 }
@@ -111,21 +96,6 @@ replicator_disable(device_t dev, struct endpoint *endp
 }
 
 static int
-replicator_probe(device_t dev)
-{
-
-   if (!ofw_bus_status_okay(dev))
-   return (ENXIO);
-
-   if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
-   return (ENXIO);
-
-   device_set_desc(dev, "Coresight Dynamic Replicator");
-
-   return (BUS_PROBE_DEFAULT);
-}
-
-static int
 replicator_attach(device_t dev)
 {
struct replicator_softc *sc;
@@ -149,7 +119,6 @@ replicator_attach(device_t dev)
 
 static device_method_t replicator_methods[] = {
/* Device interface */
-   DEVMETHOD(device_probe, replicator_probe),
DEVMETHOD(device_attach,replicator_attach),
 
/* Coresight interface */
@@ -159,14 +128,5 @@ static device_method_t replicator_methods[] = {
DEVMETHOD_END
 };
 
-static driver_t replicator_driver = {
-   "replicator",
-   replicator_methods,
-   sizeof(struct replicator_softc),
-};
-
-static devclass_t replicator_devclass;
-
-DRIVER_MODULE(replicator, simplebus, replicator_driver, replicator_devclass,
-0, 0);
-MODULE_VERSION(replicator, 1);
+DEFINE_CLASS_0(replicator, replicator_driver, replicator_methods,
+sizeof(struct replicator_softc));

Added: head/sys/arm64/coresight/coresight_replicator.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/coresight/coresight_replicator.h Fri Jun 12 17:31:38 
2020(r362109)
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2020 Ruslan Bukin 
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
+ * ("CTSRD"), as part of the DARPA CRASH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef_ARM64_CORESIGHT_CORESIGHT_REPLICATOR_H_
+#define_ARM64_CORESIGHT_CORESIGHT_REPLICATOR_H_
+
+#defineREPLICATOR_IDFILTER00x00
+#define

svn commit: r362108 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Doug Moore
Author: dougm
Date: Fri Jun 12 16:51:55 2020
New Revision: 362108
URL: https://svnweb.freebsd.org/changeset/base/362108

Log:
  The linuxkpi code accesses left/right rb tree pointers without using
  RB_LEFT or RB_RIGHT, so they aren't stripping off the color bit
  encoded there. Strip off that bit for linuxkpi.
  
  Reported by:  dch
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D25245

Modified:
  head/sys/compat/linuxkpi/common/include/linux/rbtree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
16:40:10 2020(r362107)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
16:51:55 2020(r362108)
@@ -37,8 +37,8 @@
 struct rb_node {
RB_ENTRY(rb_node)   __entry;
 };
-#definerb_left __entry.rbe_left
-#definerb_right__entry.rbe_right
+#definerb_left RB_PTR(__entry.rbe_left)
+#definerb_rightRB_PTR(__entry.rbe_right)
 
 /*
  * We provide a false structure that has the same bit pattern as tree.h
___
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"


svn commit: r362107 - head/sys/netinet

2020-06-12 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 12 16:40:10 2020
New Revision: 362107
URL: https://svnweb.freebsd.org/changeset/base/362107

Log:
  Whitespace change due to upstream cleanup.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_constants.h

Modified: head/sys/netinet/sctp_constants.h
==
--- head/sys/netinet/sctp_constants.h   Fri Jun 12 16:31:13 2020
(r362106)
+++ head/sys/netinet/sctp_constants.h   Fri Jun 12 16:40:10 2020
(r362107)
@@ -992,7 +992,7 @@ do { \
 #define sctp_sowwakeup_locked(inp, so) \
 do { \
if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) { \
-SOCKBUF_UNLOCK(&((so)->so_snd)); \
+   SOCKBUF_UNLOCK(&((so)->so_snd)); \
inp->sctp_flags |= SCTP_PCB_FLAGS_WAKEOUTPUT; \
} else { \
sowwakeup_locked(so); \
___
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"


svn commit: r362106 - head/sys/netinet

2020-06-12 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 12 16:31:13 2020
New Revision: 362106
URL: https://svnweb.freebsd.org/changeset/base/362106

Log:
  More cleanups due to ifdef cleanup done upstream
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_constants.h
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_pcb.h
  head/sys/netinet/sctp_structs.h
  head/sys/netinet/sctp_uio.h

Modified: head/sys/netinet/sctp_constants.h
==
--- head/sys/netinet/sctp_constants.h   Fri Jun 12 15:37:55 2020
(r362105)
+++ head/sys/netinet/sctp_constants.h   Fri Jun 12 16:31:13 2020
(r362106)
@@ -1012,7 +1012,7 @@ do { \
 do { \
if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) { \
inp->sctp_flags |= SCTP_PCB_FLAGS_WAKEINPUT; \
-SOCKBUF_UNLOCK(&((so)->so_rcv)); \
+   SOCKBUF_UNLOCK(&((so)->so_rcv)); \
} else { \
sorwakeup_locked(so); \
} \

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Fri Jun 12 15:37:55 2020
(r362105)
+++ head/sys/netinet/sctp_input.c   Fri Jun 12 16:31:13 2020
(r362106)
@@ -5723,7 +5723,7 @@ out:
return;
 }
 
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(SCTP_MCORE_INPUT) && defined(SMP)
 extern int *sctp_cpuarry;
 #endif
 
@@ -5735,7 +5735,7 @@ sctp_input(struct mbuf **mp, int *offp, int proto SCTP
 
m = *mp;
off = *offp;
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(SCTP_MCORE_INPUT) && defined(SMP)
if (mp_ncpus > 1) {
struct ip *ip;
struct sctphdr *sh;

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Fri Jun 12 15:37:55 2020(r362105)
+++ head/sys/netinet/sctp_pcb.c Fri Jun 12 16:31:13 2020(r362106)
@@ -5535,18 +5535,14 @@ sctp_del_local_addr_restricted(struct sctp_tcb *stcb, 
return;
 }
 
-/*
- * Temporarily remove for __APPLE__ until we use the Tiger equivalents
- */
 /* sysctl */
 static int sctp_max_number_of_assoc = SCTP_MAX_NUM_OF_ASOC;
 static int sctp_scale_up_for_address = SCTP_SCALE_FOR_ADDR;
 
-
-
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(SCTP_MCORE_INPUT) && defined(SMP)
 struct sctp_mcore_ctrl *sctp_mcore_workers = NULL;
 int *sctp_cpuarry = NULL;
+
 void
 sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use)
 {
@@ -5716,13 +5712,13 @@ sctp_pcb_init(void)
 #if defined(SCTP_LOCAL_TRACE_BUF)
memset(_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log));
 #endif
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *,
((mp_maxid + 1) * sizeof(struct sctpstat)),
SCTP_M_MCORE);
 #endif
(void)SCTP_GETTIME_TIMEVAL();
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
memset(SCTP_BASE_STATS, 0, sizeof(struct sctpstat) * (mp_maxid + 1));
SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = 
(uint32_t)tv.tv_sec;
SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = 
(uint32_t)tv.tv_usec;
@@ -5833,7 +5829,7 @@ sctp_pcb_init(void)
}
sctp_startup_iterator();
 
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(SCTP_MCORE_INPUT) && defined(SMP)
sctp_startup_mcore_threads();
 #endif
 
@@ -5988,7 +5984,7 @@ retry:
SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_strmoq));
SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asconf));
SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asconf_ack));
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
SCTP_FREE(SCTP_BASE_STATS, SCTP_M_MCORE);
 #endif
 }

Modified: head/sys/netinet/sctp_pcb.h
==
--- head/sys/netinet/sctp_pcb.h Fri Jun 12 15:37:55 2020(r362105)
+++ head/sys/netinet/sctp_pcb.h Fri Jun 12 16:31:13 2020(r362106)
@@ -246,7 +246,7 @@ struct sctp_base_info {
 * All static structures that anchor the system must be here.
 */
struct sctp_epinfo sctppcbinfo;
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
struct sctpstat *sctpstat;
 #else
struct sctpstat sctpstat;
@@ -478,7 +478,6 @@ struct sctp_tcb {
 #include 
 
 
-/* TODO where to put non-_KERNEL things for __Userspace__? */
 #if 

svn commit: r362105 - stable/12/sys/dev/acpica

2020-06-12 Thread Alexander Motin
Author: mav
Date: Fri Jun 12 15:37:55 2020
New Revision: 362105
URL: https://svnweb.freebsd.org/changeset/base/362105

Log:
  MFC r351516: Announce PCI Segment Groups supported to PCI host _OSC.
  
  According to ACPI 6.3 specification:
  The OS sets this bit to 1 if it supports PCI Segment Groups as defined
  by the _SEG object, and access to the configuration space of devices
  in PCI Segment Groups as described by this specification.  Otherwise,
  the OS sets this bit to 0.
  
  As far as I see we support both of those as PCI domains for quite a while.

Modified:
  stable/12/sys/dev/acpica/acpi_pcib_acpi.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/acpica/acpi_pcib_acpi.c
==
--- stable/12/sys/dev/acpica/acpi_pcib_acpi.c   Fri Jun 12 14:37:50 2020
(r362104)
+++ stable/12/sys/dev/acpica/acpi_pcib_acpi.c   Fri Jun 12 15:37:55 2020
(r362105)
@@ -323,9 +323,9 @@ acpi_pcib_osc(struct acpi_hpcib_softc *sc, uint32_t os
if (osc_ctl != 0 && (sc->ap_osc_ctl & osc_ctl) == osc_ctl)
return (0);
 
-   /* Support Field: Extended PCI Config Space, MSI */
+   /* Support Field: Extended PCI Config Space, PCI Segment Groups, MSI */
cap_set[PCI_OSC_SUPPORT] = PCIM_OSC_SUPPORT_EXT_PCI_CONF |
-   PCIM_OSC_SUPPORT_MSI;
+   PCIM_OSC_SUPPORT_SEG_GROUP | PCIM_OSC_SUPPORT_MSI;
 
/* Control Field */
cap_set[PCI_OSC_CTL] = sc->ap_osc_ctl | osc_ctl;
___
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"


svn commit: r362104 - in head: share/man/man4 sys/compat/linux

2020-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jun 12 14:37:50 2020
New Revision: 362104
URL: https://svnweb.freebsd.org/changeset/base/362104

Log:
  Add compat.linux.debug sysctl, to make it possible to silence down
  the debug messages. While here, clean up some variable naming.
  
  Reviewed by:  bcr (manpages), emaste
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25230

Modified:
  head/share/man/man4/linux.4
  head/sys/compat/linux/linux_mib.c
  head/sys/compat/linux/linux_mib.h
  head/sys/compat/linux/linux_util.c

Modified: head/share/man/man4/linux.4
==
--- head/share/man/man4/linux.4 Fri Jun 12 14:31:19 2020(r362103)
+++ head/share/man/man4/linux.4 Fri Jun 12 14:37:50 2020(r362104)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 10, 2020
+.Dd June 12, 2020
 .Dt LINUX 4
 .Os
 .Sh NAME
@@ -95,6 +95,10 @@ variables and
 .Xr loader 8
 tunables:
 .Bl -tag -width indent
+.It Va compat.linux.debug
+Enable debugging messages.
+Set to 0 to silence them.
+Defaults to 1.
 .It Va compat.linux.default_openfiles
 Default soft openfiles resource limit for Linux applications.
 Set to -1 to disable the limit.

Modified: head/sys/compat/linux/linux_mib.c
==
--- head/sys/compat/linux/linux_mib.c   Fri Jun 12 14:31:19 2020
(r362103)
+++ head/sys/compat/linux/linux_mib.c   Fri Jun 12 14:37:50 2020
(r362104)
@@ -63,6 +63,10 @@ static unsigned linux_osd_jail_slot;
 SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
 "Linux mode");
 
+int linux_debug = 1;
+SYSCTL_INT(_compat_linux, OID_AUTO, debug, CTLFLAG_RWTUN,
+_debug, 0, "Log warnings from linux(4); or 0 to disable");
+
 int linux_default_openfiles = 1024;
 SYSCTL_INT(_compat_linux, OID_AUTO, default_openfiles, CTLFLAG_RWTUN,
 _default_openfiles, 0,

Modified: head/sys/compat/linux/linux_mib.h
==
--- head/sys/compat/linux/linux_mib.h   Fri Jun 12 14:31:19 2020
(r362103)
+++ head/sys/compat/linux/linux_mib.h   Fri Jun 12 14:37:50 2020
(r362104)
@@ -62,6 +62,7 @@ int   linux_kernver(struct thread *td);
 
 #definelinux_use26(t)  (linux_kernver(t) >= 
LINUX_KERNVER_2006000)
 
+extern int linux_debug;
 extern int linux_default_openfiles;
 extern int linux_ignore_ip_recverr;
 extern int linux_preserve_vstatus;

Modified: head/sys/compat/linux/linux_util.c
==
--- head/sys/compat/linux/linux_util.c  Fri Jun 12 14:31:19 2020
(r362103)
+++ head/sys/compat/linux/linux_util.c  Fri Jun 12 14:37:50 2020
(r362104)
@@ -91,6 +91,9 @@ linux_msg(const struct thread *td, const char *fmt, ..
va_list ap;
struct proc *p;
 
+   if (linux_debug == 0)
+   return;
+
p = td->td_proc;
printf("linux: pid %d (%s): ", (int)p->p_pid, p->p_comm);
va_start(ap, fmt);
___
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"


svn commit: r362103 - head/sys/compat/linux

2020-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jun 12 14:31:19 2020
New Revision: 362103
URL: https://svnweb.freebsd.org/changeset/base/362103

Log:
  Fix naming clash.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cFri Jun 12 14:25:32 2020
(r362102)
+++ head/sys/compat/linux/linux_socket.cFri Jun 12 14:31:19 2020
(r362103)
@@ -943,7 +943,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
struct msghdr msg;
struct l_cmsghdr linux_cmsg;
struct l_cmsghdr *ptr_cmsg;
-   struct l_msghdr linux_msg;
+   struct l_msghdr linux_msghdr;
struct iovec *iov;
socklen_t datalen;
struct sockaddr *sa;
@@ -955,7 +955,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
l_size_t clen;
int error, fflag;
 
-   error = copyin(msghdr, _msg, sizeof(linux_msg));
+   error = copyin(msghdr, _msghdr, sizeof(linux_msghdr));
if (error != 0)
return (error);
 
@@ -966,10 +966,11 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
 * order to handle this case.  This should be checked, but allows the
 * Linux ping to work.
 */
-   if (PTRIN(linux_msg.msg_control) != NULL && linux_msg.msg_controllen == 
0)
-   linux_msg.msg_control = PTROUT(NULL);
+   if (PTRIN(linux_msghdr.msg_control) != NULL &&
+   linux_msghdr.msg_controllen == 0)
+   linux_msghdr.msg_control = PTROUT(NULL);
 
-   error = linux_to_bsd_msghdr(, _msg);
+   error = linux_to_bsd_msghdr(, _msghdr);
if (error != 0)
return (error);
 
@@ -1007,7 +1008,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
goto bad;
}
 
-   if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) {
+   if (linux_msghdr.msg_controllen >= sizeof(struct l_cmsghdr)) {
 
error = ENOBUFS;
control = m_get(M_WAITOK, MT_CONTROL);
@@ -1015,8 +1016,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
data = mtod(control, void *);
datalen = 0;
 
-   ptr_cmsg = PTRIN(linux_msg.msg_control);
-   clen = linux_msg.msg_controllen;
+   ptr_cmsg = PTRIN(linux_msghdr.msg_control);
+   clen = linux_msghdr.msg_controllen;
do {
error = copyin(ptr_cmsg, _cmsg,
sizeof(struct l_cmsghdr));
@@ -1151,7 +1152,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
struct l_cmsghdr *linux_cmsg = NULL;
struct l_ucred linux_ucred;
socklen_t datalen, maxlen, outlen;
-   struct l_msghdr linux_msg;
+   struct l_msghdr linux_msghdr;
struct iovec *iov, *uiov;
struct mbuf *control = NULL;
struct mbuf **controlp;
@@ -1163,11 +1164,11 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
void *data;
int error, i, fd, fds, *fdp;
 
-   error = copyin(msghdr, _msg, sizeof(linux_msg));
+   error = copyin(msghdr, _msghdr, sizeof(linux_msghdr));
if (error != 0)
return (error);
 
-   error = linux_to_bsd_msghdr(msg, _msg);
+   error = linux_to_bsd_msghdr(msg, _msghdr);
if (error != 0)
return (error);
 
@@ -1195,7 +1196,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
goto bad;
 
if (msg->msg_name) {
-   msg->msg_name = PTRIN(linux_msg.msg_name);
+   msg->msg_name = PTRIN(linux_msghdr.msg_name);
error = bsd_to_linux_sockaddr(sa, , msg->msg_namelen);
if (error == 0)
error = copyout(lsa, PTRIN(msg->msg_name),
@@ -1205,12 +1206,12 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
goto bad;
}
 
-   error = bsd_to_linux_msghdr(msg, _msg);
+   error = bsd_to_linux_msghdr(msg, _msghdr);
if (error != 0)
goto bad;
 
-   maxlen = linux_msg.msg_controllen;
-   linux_msg.msg_controllen = 0;
+   maxlen = linux_msghdr.msg_controllen;
+   linux_msghdr.msg_controllen = 0;
if (control) {
linux_cmsg = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO);
 
@@ -1218,7 +1219,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
msg->msg_controllen = control->m_len;
 
cm = CMSG_FIRSTHDR(msg);
-   outbuf = PTRIN(linux_msg.msg_control);
+   outbuf = PTRIN(linux_msghdr.msg_control);
outlen = 0;
while (cm != NULL) {
linux_cmsg->cmsg_type =
@@ -1284,7 +1285,7 @@ linux_recvmsg_common(struct thread *td, 

svn commit: r362102 - head/sys/compat/linux

2020-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jun 12 14:25:32 2020
New Revision: 362102
URL: https://svnweb.freebsd.org/changeset/base/362102

Log:
  Make linux(4) warn about unsupported fcntls.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25231

Modified:
  head/sys/compat/linux/linux_file.c

Modified: head/sys/compat/linux/linux_file.c
==
--- head/sys/compat/linux/linux_file.c  Fri Jun 12 14:23:10 2020
(r362101)
+++ head/sys/compat/linux/linux_file.c  Fri Jun 12 14:25:32 2020
(r362102)
@@ -1371,9 +1371,10 @@ fcntl_common(struct thread *td, struct linux_fcntl_arg
 
case LINUX_F_DUPFD_CLOEXEC:
return (kern_fcntl(td, args->fd, F_DUPFD_CLOEXEC, args->arg));
+   default:
+   linux_msg(td, "unsupported fcntl cmd %d\n", args->cmd);
+   return (EINVAL);
}
-
-   return (EINVAL);
 }
 
 int
___
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"


svn commit: r362101 - head/sys/compat/linux

2020-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jun 12 14:23:10 2020
New Revision: 362101
URL: https://svnweb.freebsd.org/changeset/base/362101

Log:
  Minor code cleanup; no functional changes.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25232

Modified:
  head/sys/compat/linux/linux_socket.c
  head/sys/compat/linux/linux_socket.h

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cFri Jun 12 14:14:01 2020
(r362100)
+++ head/sys/compat/linux/linux_socket.cFri Jun 12 14:23:10 2020
(r362101)
@@ -92,10 +92,9 @@ static int
 linux_to_bsd_sockopt_level(int level)
 {
 
-   switch (level) {
-   case LINUX_SOL_SOCKET:
+   if (level == LINUX_SOL_SOCKET)
return (SOL_SOCKET);
-   }
+   /* Remaining values are RFC-defined protocol numbers. */
return (level);
 }
 
@@ -103,10 +102,8 @@ static int
 bsd_to_linux_sockopt_level(int level)
 {
 
-   switch (level) {
-   case SOL_SOCKET:
+   if (level == SOL_SOCKET)
return (LINUX_SOL_SOCKET);
-   }
return (level);
 }
 

Modified: head/sys/compat/linux/linux_socket.h
==
--- head/sys/compat/linux/linux_socket.hFri Jun 12 14:14:01 2020
(r362100)
+++ head/sys/compat/linux/linux_socket.hFri Jun 12 14:23:10 2020
(r362101)
@@ -170,12 +170,6 @@ int linux_accept(struct thread *td, struct linux_accep
 
 /* Socket defines */
 #defineLINUX_SOL_SOCKET1
-#defineLINUX_SOL_IP0
-#defineLINUX_SOL_TCP   6
-#defineLINUX_SOL_UDP   17
-#defineLINUX_SOL_IPV6  41
-#defineLINUX_SOL_IPX   256
-#defineLINUX_SOL_AX25  257
 
 #defineLINUX_SO_DEBUG  1
 #defineLINUX_SO_REUSEADDR  2
___
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"


svn commit: r362100 - head/sys/dev/nvme

2020-06-12 Thread Alexander Motin
Author: mav
Date: Fri Jun 12 14:14:01 2020
New Revision: 362100
URL: https://svnweb.freebsd.org/changeset/base/362100

Log:
  Fix config_intrhook leak on initial reset failure.
  
  MFC after:1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Fri Jun 12 13:59:58 2020
(r362099)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Fri Jun 12 14:14:01 2020
(r362100)
@@ -1126,12 +1126,14 @@ nvme_ctrlr_start_config_hook(void *arg)
status = nvme_ctrlr_hw_reset(ctrlr);
if (status != 0) {
nvme_ctrlr_fail(ctrlr);
+   config_intrhook_disestablish(>config_hook);
return;
}
 
status = nvme_ctrlr_hw_reset(ctrlr);
if (status != 0) {
nvme_ctrlr_fail(ctrlr);
+   config_intrhook_disestablish(>config_hook);
return;
}
 
___
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"


svn commit: r362099 - in head/sys: arm64/coresight conf

2020-06-12 Thread Ruslan Bukin
Author: br
Date: Fri Jun 12 13:59:58 2020
New Revision: 362099
URL: https://svnweb.freebsd.org/changeset/base/362099

Log:
  ARM Coresight Trace Memory Controller (TMC):
  o Split-out FDT attachment to a separate file;
  o Add ACPI attachment.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/arm64/coresight/coresight_tmc_acpi.c   (contents, props changed)
  head/sys/arm64/coresight/coresight_tmc_fdt.c   (contents, props changed)
Modified:
  head/sys/arm64/coresight/coresight_tmc.c
  head/sys/arm64/coresight/coresight_tmc.h
  head/sys/conf/files.arm64

Modified: head/sys/arm64/coresight/coresight_tmc.c
==
--- head/sys/arm64/coresight/coresight_tmc.cFri Jun 12 13:54:41 2020
(r362098)
+++ head/sys/arm64/coresight/coresight_tmc.cFri Jun 12 13:59:58 2020
(r362099)
@@ -42,9 +42,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-#include 
-
 #include "coresight_if.h"
 
 #defineTMC_DEBUG
@@ -56,25 +53,6 @@ __FBSDID("$FreeBSD$");
 #definedprintf(fmt, ...)
 #endif
 
-static struct ofw_compat_data compat_data[] = {
-   { "arm,coresight-tmc",  1 },
-   { NULL, 0 }
-};
-
-struct tmc_softc {
-   struct resource *res;
-   device_tdev;
-   uint64_tcycle;
-   struct coresight_platform_data  *pdata;
-   uint32_tdev_type;
-#defineCORESIGHT_UNKNOWN   0
-#defineCORESIGHT_ETR   1
-#defineCORESIGHT_ETF   2
-   uint32_tnev;
-   struct coresight_event  *event;
-   boolean_t   etf_configured;
-};
-
 static struct resource_spec tmc_spec[] = {
{ SYS_RES_MEMORY,   0,  RF_ACTIVE },
{ -1, 0 }
@@ -335,21 +313,6 @@ tmc_read(device_t dev, struct endpoint *endp,
 }
 
 static int
-tmc_probe(device_t dev)
-{
-
-   if (!ofw_bus_status_okay(dev))
-   return (ENXIO);
-
-   if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
-   return (ENXIO);
-
-   device_set_desc(dev, "Coresight Trace Memory Controller (TMC)");
-
-   return (BUS_PROBE_DEFAULT);
-}
-
-static int
 tmc_attach(device_t dev)
 {
struct coresight_desc desc;
@@ -375,7 +338,6 @@ tmc_attach(device_t dev)
 
 static device_method_t tmc_methods[] = {
/* Device interface */
-   DEVMETHOD(device_probe, tmc_probe),
DEVMETHOD(device_attach,tmc_attach),
 
/* Coresight interface */
@@ -386,13 +348,4 @@ static device_method_t tmc_methods[] = {
DEVMETHOD_END
 };
 
-static driver_t tmc_driver = {
-   "tmc",
-   tmc_methods,
-   sizeof(struct tmc_softc),
-};
-
-static devclass_t tmc_devclass;
-
-DRIVER_MODULE(tmc, simplebus, tmc_driver, tmc_devclass, 0, 0);
-MODULE_VERSION(tmc, 1);
+DEFINE_CLASS_0(tmc, tmc_driver, tmc_methods, sizeof(struct tmc_softc));

Modified: head/sys/arm64/coresight/coresight_tmc.h
==
--- head/sys/arm64/coresight/coresight_tmc.hFri Jun 12 13:54:41 2020
(r362098)
+++ head/sys/arm64/coresight/coresight_tmc.hFri Jun 12 13:59:58 2020
(r362099)
@@ -116,4 +116,20 @@
 #defineTMC_COMPID2 0xFF8 /* Component ID2 Register */
 #defineTMC_COMPID3 0xFFC /* Component ID3 Register */
 
+DECLARE_CLASS(tmc_driver);
+
+struct tmc_softc {
+   struct resource *res;
+   device_tdev;
+   uint64_tcycle;
+   struct coresight_platform_data  *pdata;
+   uint32_tdev_type;
+#defineCORESIGHT_UNKNOWN   0
+#defineCORESIGHT_ETR   1
+#defineCORESIGHT_ETF   2
+   uint32_tnev;
+   struct coresight_event  *event;
+   boolean_t   etf_configured;
+};
+
 #endif /* !_ARM64_CORESIGHT_CORESIGHT_TMC_H_ */

Added: head/sys/arm64/coresight/coresight_tmc_acpi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/coresight/coresight_tmc_acpi.c   Fri Jun 12 13:59:58 
2020(r362099)
@@ -0,0 +1,79 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2020 Ruslan Bukin 
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory (Department of Computer Science and
+ * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
+ * DARPA SSITH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following 

svn commit: r362098 - stable/12/sys/fs/ext2fs

2020-06-12 Thread Fedor Uporov
Author: fsu
Date: Fri Jun 12 13:54:41 2020
New Revision: 362098
URL: https://svnweb.freebsd.org/changeset/base/362098

Log:
  MFC r361135:
  Restrict the max runp and runb return values in case of extents mapping.
  
  This restriction already present in case of indirect mapping, do the same
  in case of extents.
  
  PR:   246182
  Reported by:  Teran McKinney

Modified:
  stable/12/sys/fs/ext2fs/ext2_bmap.c

Modified: stable/12/sys/fs/ext2fs/ext2_bmap.c
==
--- stable/12/sys/fs/ext2fs/ext2_bmap.c Fri Jun 12 13:53:50 2020
(r362097)
+++ stable/12/sys/fs/ext2fs/ext2_bmap.c Fri Jun 12 13:54:41 2020
(r362098)
@@ -94,21 +94,28 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn
 {
struct inode *ip;
struct m_ext2fs *fs;
+   struct mount *mp;
+   struct ext2mount *ump;
struct ext4_extent_header *ehp;
struct ext4_extent *ep;
struct ext4_extent_path *path = NULL;
daddr_t lbn;
-   int error, depth;
+   int error, depth, maxrun = 0, bsize;
 
ip = VTOI(vp);
fs = ip->i_e2fs;
+   mp = vp->v_mount;
+   ump = VFSTOEXT2(mp);
lbn = bn;
ehp = (struct ext4_extent_header *)ip->i_data;
depth = ehp->eh_depth;
+   bsize = EXT2_BLOCK_SIZE(ump->um_e2fs);
 
*bnp = -1;
-   if (runp != NULL)
+   if (runp != NULL) {
+   maxrun = mp->mnt_iosize_max / bsize - 1;
*runp = 0;
+   }
if (runb != NULL)
*runb = 0;
 
@@ -119,18 +126,21 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn
ep = path[depth].ep_ext;
if(ep) {
if (lbn < ep->e_blk) {
-   if (runp != NULL)
-   *runp = ep->e_blk - lbn - 1;
+   if (runp != NULL) {
+   *runp = min(maxrun, ep->e_blk - lbn - 1);
+   }
} else if (ep->e_blk <= lbn && lbn < ep->e_blk + ep->e_len) {
*bnp = fsbtodb(fs, lbn - ep->e_blk +
(ep->e_start_lo | (daddr_t)ep->e_start_hi << 32));
-   if (runp != NULL)
-   *runp = ep->e_len - (lbn - ep->e_blk) - 1;
+   if (runp != NULL) {
+   *runp = min(maxrun,
+   ep->e_len - (lbn - ep->e_blk) - 1);
+   }
if (runb != NULL)
-   *runb = lbn - ep->e_blk;
+   *runb = min(maxrun, lbn - ep->e_blk);
} else {
if (runb != NULL)
-   *runb = ep->e_blk + lbn - ep->e_len;
+   *runb = min(maxrun, ep->e_blk + lbn - 
ep->e_len);
}
}
 
___
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"


svn commit: r362097 - stable/12/sys/fs/ext2fs

2020-06-12 Thread Fedor Uporov
Author: fsu
Date: Fri Jun 12 13:53:50 2020
New Revision: 362097
URL: https://svnweb.freebsd.org/changeset/base/362097

Log:
  MFC r361134:
  Fix incorrect inode link count check in case of rename.
  
  The check was incorrect because the directory inode link count have
  min value 2 after dir_nlink extfs feature introduction.

Modified:
  stable/12/sys/fs/ext2fs/ext2_vnops.c

Modified: stable/12/sys/fs/ext2fs/ext2_vnops.c
==
--- stable/12/sys/fs/ext2fs/ext2_vnops.cFri Jun 12 13:52:11 2020
(r362096)
+++ stable/12/sys/fs/ext2fs/ext2_vnops.cFri Jun 12 13:53:50 2020
(r362097)
@@ -1016,10 +1016,11 @@ abortit:
 */
ext2_dec_nlink(xp);
if (doingdirectory) {
-   if (--xp->i_nlink != 0)
+   if (xp->i_nlink > 2)
panic("ext2_rename: linked directory");
error = ext2_truncate(tvp, (off_t)0, IO_SYNC,
tcnp->cn_cred, tcnp->cn_thread);
+   xp->i_nlink = 0;
}
xp->i_flag |= IN_CHANGE;
vput(tvp);
___
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"


svn commit: r362096 - stable/12/sys/fs/ext2fs

2020-06-12 Thread Fedor Uporov
Author: fsu
Date: Fri Jun 12 13:52:11 2020
New Revision: 362096
URL: https://svnweb.freebsd.org/changeset/base/362096

Log:
  MFC r361133:
  Add inode bitmap tail initialization.
  
  Make ext2fs compatible with changes introduced in e2fsprogs v1.45.2.
  Now the tail of inode bitmap is filled with 0xff pattern explicitly during
  bitmap initialization phase to avoid e2fsck error like:
  "Padding at end of inode bitmap is not set."

Modified:
  stable/12/sys/fs/ext2fs/ext2_alloc.c

Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c
==
--- stable/12/sys/fs/ext2fs/ext2_alloc.cFri Jun 12 13:02:44 2020
(r362095)
+++ stable/12/sys/fs/ext2fs/ext2_alloc.cFri Jun 12 13:52:11 2020
(r362096)
@@ -1286,6 +1286,16 @@ ext2_zero_inode_table(struct inode *ip, int cg)
return (0);
 }
 
+static void
+ext2_fix_bitmap_tail(unsigned char *bitmap, int first, int last)
+{
+   int i;
+
+   for (i = first; i <= last; i++)
+   bitmap[i] = 0xff;
+}
+
+
 /*
  * Determine whether an inode can be allocated.
  *
@@ -1298,7 +1308,7 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr
struct m_ext2fs *fs;
struct buf *bp;
struct ext2mount *ump;
-   int error, start, len, ifree;
+   int error, start, len, ifree, ibytes;
char *ibp, *loc;
 
ipref--;/* to avoid a lot of (ipref -1) */
@@ -1320,7 +1330,10 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr
if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) ||
EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) {
if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_UNINIT) {
-   memset(bp->b_data, 0, fs->e2fs_bsize);
+   ibytes = fs->e2fs_ipg / 8;
+   memset(bp->b_data, 0, ibytes - 1);
+   ext2_fix_bitmap_tail(bp->b_data, ibytes,
+   fs->e2fs_bsize - 1);
fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_INODE_UNINIT;
}
ext2_gd_i_bitmap_csum_set(fs, cg, bp);
___
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"


Re: svn commit: r362009 - stable/12/sys/net

2020-06-12 Thread Marko Zec
On Wed, 10 Jun 2020 13:06:13 + (UTC)
"Andrey V. Elsukov"  wrote:

> Author: ae
> Date: Wed Jun 10 13:06:13 2020
> New Revision: 362009
> URL: https://svnweb.freebsd.org/changeset/base/362009
> 
> Log:
>   MFC r361749:
> Add if_reassign method to all tunneling interfaces.
>   
> After r339550 tunneling interfaces have started handle appearing
> and disappearing of ingress IP address on the host system.
> When such interfaces are moving into VNET jail, they lose ability
> to properly handle ifaddr_event_ext event. And this leads to need to
> reconfigure tunnel to make it working again.
>   
> Since moving an interface into VNET jail leads to removing of all
> IP addresses, it looks consistent, that tunnel configuration should
> also be cleared. This is what will do if_reassign method.

Sorry for not noticing this one before, but albeit jumping in late, I
have to state two objections:

1) what exactly is the use-case / purpose of moving clonable interfaces
from one vnet to another while removing their tunnel configs?
Apparently gif / gre already have virtualized cloners, so if a vnet
owner needs a new instance of gif / gre, it can create it there?  We
should either entirely prohibit moving such ifnets to child vnets, or
allow their tunnel endpoints to exist in the parent vnet space, while
permitting the traffic from child vnets to be encapsulated.

2) the behavior introduced by this change is inconsistent with how other
clonable interfaces have worked since 8.0, e.g if_vlan instances can be
moved (loaned) to a child vnet, and in such cases they remain tied to
their parent (physical) ethernet ifnets. Similarly, ng_eiface can be
loaned to a chiled vnet, but its netgraph part remains in the parent
vnet.

So now we got a confusion++, perhaps for a good reason, but I fail to
see the proper justification (execpt that someone wanted to see this
patch commited).

Cheers,

Marko


>   
> Reported by:  John W. O'Brien 
> 
> Modified:
>   stable/12/sys/net/if_gif.c
>   stable/12/sys/net/if_gre.c
>   stable/12/sys/net/if_ipsec.c
>   stable/12/sys/net/if_me.c
> Directory Properties:
>   stable/12/   (props changed)
> 
> Modified: stable/12/sys/net/if_gif.c
> ==
> --- stable/12/sys/net/if_gif.cWed Jun 10 09:31:37 2020
> (r362008) +++ stable/12/sys/net/if_gif.c  Wed Jun 10 13:06:13
> 2020  (r362009) @@ -104,6 +104,9 @@ void
> (*ng_gif_input_orphan_p)(struct ifnet *ifp, struc void
> (*ng_gif_attach_p)(struct ifnet *ifp); void
> (*ng_gif_detach_p)(struct ifnet *ifp); 
> +#ifdef VIMAGE
> +static void  gif_reassign(struct ifnet *, struct vnet *, char
> *); +#endif
>  static void  gif_delete_tunnel(struct gif_softc *);
>  static int   gif_ioctl(struct ifnet *, u_long, caddr_t);
>  static int   gif_transmit(struct ifnet *, struct mbuf *);
> @@ -150,6 +153,9 @@ gif_clone_create(struct if_clone *ifc, int unit,
> caddr GIF2IFP(sc)->if_transmit = gif_transmit;
>   GIF2IFP(sc)->if_qflush = gif_qflush;
>   GIF2IFP(sc)->if_output = gif_output;
> +#ifdef VIMAGE
> + GIF2IFP(sc)->if_reassign = gif_reassign;
> +#endif
>   GIF2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE;
>   GIF2IFP(sc)->if_capenable |= IFCAP_LINKSTATE;
>   if_attach(GIF2IFP(sc));
> @@ -159,6 +165,21 @@ gif_clone_create(struct if_clone *ifc, int unit,
> caddr 
>   return (0);
>  }
> +
> +#ifdef VIMAGE
> +static void
> +gif_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused,
> +char *unused __unused)
> +{
> + struct gif_softc *sc;
> +
> + sx_xlock(_ioctl_sx);
> + sc = ifp->if_softc;
> + if (sc != NULL)
> + gif_delete_tunnel(sc);
> + sx_xunlock(_ioctl_sx);
> +}
> +#endif /* VIMAGE */
>  
>  static void
>  gif_clone_destroy(struct ifnet *ifp)
> 
> Modified: stable/12/sys/net/if_gre.c
> ==
> --- stable/12/sys/net/if_gre.cWed Jun 10 09:31:37 2020
> (r362008) +++ stable/12/sys/net/if_gre.c  Wed Jun 10 13:06:13
> 2020  (r362009) @@ -107,6 +107,9 @@ static void
> gre_clone_destroy(struct ifnet *); VNET_DEFINE_STATIC(struct if_clone
> *, gre_cloner); #define   V_gre_clonerVNET(gre_cloner)
>  
> +#ifdef VIMAGE
> +static void  gre_reassign(struct ifnet *, struct vnet *, char
> *); +#endif
>  static void  gre_qflush(struct ifnet *);
>  static int   gre_transmit(struct ifnet *, struct mbuf *);
>  static int   gre_ioctl(struct ifnet *, u_long, caddr_t);
> @@ -183,12 +186,30 @@ gre_clone_create(struct if_clone *ifc, int
> unit, caddr GRE2IFP(sc)->if_ioctl = gre_ioctl;
>   GRE2IFP(sc)->if_transmit = gre_transmit;
>   GRE2IFP(sc)->if_qflush = gre_qflush;
> +#ifdef VIMAGE
> + GRE2IFP(sc)->if_reassign = gre_reassign;
> +#endif
>   GRE2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE;
>   GRE2IFP(sc)->if_capenable |= IFCAP_LINKSTATE;
>   if_attach(GRE2IFP(sc));
>   bpfattach(GRE2IFP(sc), 

svn commit: r362095 - in head/contrib/sqlite3: . tea tea/generic

2020-06-12 Thread Cy Schubert
Author: cy
Date: Fri Jun 12 13:02:44 2020
New Revision: 362095
URL: https://svnweb.freebsd.org/changeset/base/362095

Log:
  MFV r362082:
  
  Update sqlite3 3.31.1 --> 3.32.0.
  
  PR:   247149
  Reported by:  spam...@bitbert.com
  Reminded by:  emaste
  MFC after:3 days
  Security: CVE-2020-11655, CVE-2020-13434, CVE-2020-13435,
CVE-2020-13630, CVE-2020-13631, CVE-2020-13632

Modified:
  head/contrib/sqlite3/Makefile.msc
  head/contrib/sqlite3/configure
  head/contrib/sqlite3/configure.ac
  head/contrib/sqlite3/shell.c
  head/contrib/sqlite3/sqlite3.c
  head/contrib/sqlite3/sqlite3.h
  head/contrib/sqlite3/sqlite3ext.h
  head/contrib/sqlite3/tea/configure
  head/contrib/sqlite3/tea/configure.ac
  head/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  head/contrib/sqlite3/   (props changed)

Modified: head/contrib/sqlite3/Makefile.msc
==
--- head/contrib/sqlite3/Makefile.msc   Fri Jun 12 11:44:30 2020
(r362094)
+++ head/contrib/sqlite3/Makefile.msc   Fri Jun 12 13:02:44 2020
(r362095)
@@ -196,6 +196,7 @@ OSTRACE = 0
 DEBUG = 0
 !ENDIF
 
+
 # Enable use of available compiler optimizations?  Normally, this should be
 # non-zero.  Setting this to zero, thus disabling all compiler optimizations,
 # can be useful for testing.
@@ -288,6 +289,7 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
+OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
 !ENDIF
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1

Modified: head/contrib/sqlite3/configure
==
--- head/contrib/sqlite3/configure  Fri Jun 12 11:44:30 2020
(r362094)
+++ head/contrib/sqlite3/configure  Fri Jun 12 13:02:44 2020
(r362095)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.31.1.
+# Generated by GNU Autoconf 2.69 for sqlite 3.32.0.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.31.1'
-PACKAGE_STRING='sqlite 3.31.1'
+PACKAGE_VERSION='3.32.0'
+PACKAGE_STRING='sqlite 3.32.0'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.31.1 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.32.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.31.1:";;
+ short | recursive ) echo "Configuration of sqlite 3.32.0:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.31.1
+sqlite configure 3.32.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.31.1, which was
+It was created by sqlite $as_me 3.32.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.31.1'
+ VERSION='3.32.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.31.1, which was
+This file was extended by sqlite $as_me 3.32.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.31.1
+sqlite config.status 3.32.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: head/contrib/sqlite3/configure.ac
==

svn commit: r362094 - in releng/11.4: . lib/csu/common sys/conf

2020-06-12 Thread Glen Barber
Author: gjb
Date: Fri Jun 12 11:44:30 2020
New Revision: 362094
URL: https://svnweb.freebsd.org/changeset/base/362094

Log:
  Re-apply r362079, renaming releng/11.4 to -RELEASE, in preparation
  for restarting 11.4-RELEASE builds.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  releng/11.4/UPDATING
  releng/11.4/lib/csu/common/crtbrand.c
  releng/11.4/sys/conf/newvers.sh

Modified: releng/11.4/UPDATING
==
--- releng/11.4/UPDATINGFri Jun 12 11:42:48 2020(r362093)
+++ releng/11.4/UPDATINGFri Jun 12 11:44:30 2020(r362094)
@@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20200616:
+   11.4-RELEASE.
+
 20200609: 11.4-RC2-p1  FreeBSD-SA-20:17.usb
 
 Fix USB HID descriptor parsing error. [SA-20:17.usb]

Modified: releng/11.4/lib/csu/common/crtbrand.c
==
--- releng/11.4/lib/csu/common/crtbrand.c   Fri Jun 12 11:42:48 2020
(r362093)
+++ releng/11.4/lib/csu/common/crtbrand.c   Fri Jun 12 11:44:30 2020
(r362094)
@@ -63,5 +63,5 @@ static const struct {
.descsz = sizeof(int32_t),
.type = NT_FREEBSD_ABI_TAG,
.name = NOTE_FREEBSD_VENDOR,
-   .desc = __FreeBSD_version
+   .desc = 1104001
 };

Modified: releng/11.4/sys/conf/newvers.sh
==
--- releng/11.4/sys/conf/newvers.sh Fri Jun 12 11:42:48 2020
(r362093)
+++ releng/11.4/sys/conf/newvers.sh Fri Jun 12 11:44:30 2020
(r362094)
@@ -44,7 +44,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.4"
-BRANCH="RC2-p1"
+BRANCH="RELEASE"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
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"


svn commit: r362093 - releng/11.4/release/doc/en_US.ISO8859-1

2020-06-12 Thread Glen Barber
Author: gjb
Date: Fri Jun 12 11:42:48 2020
New Revision: 362093
URL: https://svnweb.freebsd.org/changeset/base/362093

Log:
  Revert r362074, reconnecting the errata page back to the build.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  releng/11.4/release/doc/en_US.ISO8859-1/Makefile

Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile
==
--- releng/11.4/release/doc/en_US.ISO8859-1/MakefileFri Jun 12 11:41:39 
2020(r362092)
+++ releng/11.4/release/doc/en_US.ISO8859-1/MakefileFri Jun 12 11:42:48 
2020(r362093)
@@ -6,7 +6,7 @@ SUBDIR = relnotes
 SUBDIR+= hardware
 SUBDIR+= installation
 SUBDIR+= readme
-#SUBDIR+= errata
+SUBDIR+= errata
 
 COMPAT_SYMLINK = en
 
___
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"


svn commit: r362092 - in releng/11.4: . lib/csu/common sys/conf

2020-06-12 Thread Glen Barber
Author: gjb
Date: Fri Jun 12 11:41:39 2020
New Revision: 362092
URL: https://svnweb.freebsd.org/changeset/base/362092

Log:
  Revert r362079 in order to correct an issue that triggered
  a build failure in 11.4-RELEASE builds.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  releng/11.4/UPDATING
  releng/11.4/lib/csu/common/crtbrand.c
  releng/11.4/sys/conf/newvers.sh

Modified: releng/11.4/UPDATING
==
--- releng/11.4/UPDATINGFri Jun 12 10:43:21 2020(r362091)
+++ releng/11.4/UPDATINGFri Jun 12 11:41:39 2020(r362092)
@@ -16,9 +16,6 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
-20200616:
-   11.4-RELEASE.
-
 20200609: 11.4-RC2-p1  FreeBSD-SA-20:17.usb
 
 Fix USB HID descriptor parsing error. [SA-20:17.usb]

Modified: releng/11.4/lib/csu/common/crtbrand.c
==
--- releng/11.4/lib/csu/common/crtbrand.c   Fri Jun 12 10:43:21 2020
(r362091)
+++ releng/11.4/lib/csu/common/crtbrand.c   Fri Jun 12 11:41:39 2020
(r362092)
@@ -63,5 +63,5 @@ static const struct {
.descsz = sizeof(int32_t),
.type = NT_FREEBSD_ABI_TAG,
.name = NOTE_FREEBSD_VENDOR,
-   .desc = 1104001
+   .desc = __FreeBSD_version
 };

Modified: releng/11.4/sys/conf/newvers.sh
==
--- releng/11.4/sys/conf/newvers.sh Fri Jun 12 10:43:21 2020
(r362091)
+++ releng/11.4/sys/conf/newvers.sh Fri Jun 12 11:41:39 2020
(r362092)
@@ -44,7 +44,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.4"
-BRANCH="RELEASE"
+BRANCH="RC2-p1"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
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"


svn commit: r362091 - head/sys/arm64/include

2020-06-12 Thread Andrew Turner
Author: andrew
Date: Fri Jun 12 10:43:21 2020
New Revision: 362091
URL: https://svnweb.freebsd.org/changeset/base/362091

Log:
  Teach the arm64 vfp.h about struct thread.
  
  Ensure struct thread is defined in vfp.h. In some cases it is not and stops
  the kernel from building.
  
  Sponsored by: Innovate UK

Modified:
  head/sys/arm64/include/vfp.h

Modified: head/sys/arm64/include/vfp.h
==
--- head/sys/arm64/include/vfp.hFri Jun 12 10:13:23 2020
(r362090)
+++ head/sys/arm64/include/vfp.hFri Jun 12 10:43:21 2020
(r362091)
@@ -42,6 +42,7 @@ struct vfpstate {
 
 #ifdef _KERNEL
 struct pcb;
+struct thread;
 
 void   vfp_init(void);
 void   vfp_discard(struct thread *);
___
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"


svn commit: r362090 - head/sys/netinet

2020-06-12 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 12 10:13:23 2020
New Revision: 362090
URL: https://svnweb.freebsd.org/changeset/base/362090

Log:
  Small cleanup due to upstream ifdef cleanups.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctputil.h

Modified: head/sys/netinet/sctputil.h
==
--- head/sys/netinet/sctputil.h Fri Jun 12 09:34:10 2020(r362089)
+++ head/sys/netinet/sctputil.h Fri Jun 12 10:13:23 2020(r362090)
@@ -55,7 +55,7 @@ void sctp_m_freem(struct mbuf *m);
 #define sctp_m_freem m_freem
 #endif
 
-#if defined(SCTP_LOCAL_TRACE_BUF) || defined(__APPLE__)
+#if defined(SCTP_LOCAL_TRACE_BUF)
 void
  sctp_log_trace(uint32_t fr, const char *str SCTP_UNUSED, uint32_t a, 
uint32_t b, uint32_t c, uint32_t d, uint32_t e, uint32_t f);
 #endif
___
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"


svn commit: r362089 - in head: share/misc usr.bin/calendar/calendars

2020-06-12 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Fri Jun 12 09:34:10 2020
New Revision: 362089
URL: https://svnweb.freebsd.org/changeset/base/362089

Log:
  Add myself (gbe) to committers-doc.dot and calendar.freebsd
  
  Reviewed by:  bcr (mentor)
  Approved by:  bcr (mentor)
  Differential Revision:https://reviews.freebsd.org/D25241

Modified:
  head/share/misc/committers-doc.dot
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/share/misc/committers-doc.dot
==
--- head/share/misc/committers-doc.dot  Fri Jun 12 07:36:32 2020
(r362088)
+++ head/share/misc/committers-doc.dot  Fri Jun 12 09:34:10 2020
(r362089)
@@ -70,6 +70,7 @@ ebrandi [label="Edson Brandi\nebra...@freebsd.org\n201
 gabor [label="Gabor Kovesdan\nga...@freebsd.org\n2007/02/02"]
 ganbold [label="Ganbold Tsagaankhuu\nganb...@freebsd.org\n2008/02/26"]
 gavin [label="Gavin Atkinson\nga...@freebsd.org\n2011/07/18"]
+gbe [label="Gordon Bergling\n...@freebsd.org\n2020/06/08"]
 gjb [label="Glen Barber\n...@freebsd.org\n2010/09/01"]
 hrs [label="Hiroki Sato\n...@freebsd.org\n2000/07/06"]
 issyl0 [label="Isabell Long\niss...@freebsd.org\n2012/04/25"]
@@ -115,6 +116,7 @@ bcr -> dexter
 bcr -> sg
 bcr -> carlavilla
 bcr -> "0mp"
+bcr -> gbe
 
 blackend -> ale
 

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdFri Jun 12 07:36:32 
2020(r362088)
+++ head/usr.bin/calendar/calendars/calendar.freebsdFri Jun 12 09:34:10 
2020(r362089)
@@ -357,6 +357,7 @@
 09/09  Yoshio Mita  born in Hiroshima, Japan, 1972
 09/09  Steven Hartland  born in Wordsley, United Kingdom, 
1973
 09/10  Wesley R. Peters  born in Hartford, Alabama, United 
States, 1961
+09/11  Gordon Bergling  born in Magdeburg, Germany, 1981
 09/12  Weongyo Jeong  born in Haman, Korea, 1980
 09/12  Benedict Christopher Reuschling  born in Darmstadt, 
Germany, 1981
 09/12  William C. Fumerola II  born in Detroit, Michigan, 
United States, 1981
___
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"


svn commit: r362088 - stable/12/sys/kern

2020-06-12 Thread Andriy Gapon
Author: avg
Date: Fri Jun 12 07:36:32 2020
New Revision: 362088
URL: https://svnweb.freebsd.org/changeset/base/362088

Log:
  fix up r362086, MFC of r361620, add missing VOP_UNLOCK argument
  
  The useless argument has been dropped in head, but not in this branch.
  
  Pointy hat to:avg

Modified:
  stable/12/sys/kern/kern_sig.c

Modified: stable/12/sys/kern/kern_sig.c
==
--- stable/12/sys/kern/kern_sig.c   Fri Jun 12 07:25:40 2020
(r362087)
+++ stable/12/sys/kern/kern_sig.c   Fri Jun 12 07:36:32 2020
(r362088)
@@ -3425,7 +3425,7 @@ corefile_open_last(struct thread *td, char *name, int 
if (oldvp != NULL)
vn_close(oldvp, FWRITE, td->td_ucred, td);
oldvp = vp;
-   VOP_UNLOCK(oldvp);
+   VOP_UNLOCK(oldvp, 0);
lasttime = vattr.va_mtime;
} else {
vnode_close_locked(td, vp);
___
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"


svn commit: r362087 - stable/12/sys/dev/pci

2020-06-12 Thread Andriy Gapon
Author: avg
Date: Fri Jun 12 07:25:40 2020
New Revision: 362087
URL: https://svnweb.freebsd.org/changeset/base/362087

Log:
  MFC r361621: do not enable pci bridge decoding on resume until I/O windows 
are restored
  
  PCI bus driver restores most but not all of a child PCI-PCI bridge
  configuration.  The bridge's I/O windows are restored by pcib driver and
  that happens later in time.  This can be problematic because the Command
  register is restored before the windows are restored.  If the firmware
  programs the windows incorrectly or even does not program them at all,
  then the bridge can start claiming I/O cycles that are not intended for
  it.  This will continue until the correct windows are restored.
  
  I have observed this problem with a buggy BIOS where after resuming from
  S3 an I/O port window of a PCI-PCI bridge was configured with zero base
  and limit causing the bridge to claim 0x0 - 0xFFF port range.  That
  interfered with ACPI port access including ACPI PM Timer at port 0x808,
  thus wreaking havoc in the time keeping.
  
  The solution is to restore the Command register of PCI-PCI bridges after
  the windows are restored in pcib driver.  While here, I decided that for
  other PCI device types (normal and cardbus) it's better to restore the
  Command register after their BARs are restored.

Modified:
  stable/12/sys/dev/pci/pci.c
  stable/12/sys/dev/pci/pci_pci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/pci/pci.c
==
--- stable/12/sys/dev/pci/pci.c Fri Jun 12 07:23:27 2020(r362086)
+++ stable/12/sys/dev/pci/pci.c Fri Jun 12 07:25:40 2020(r362087)
@@ -5933,7 +5933,6 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinf
 */
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0)
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
-   pci_write_config(dev, PCIR_COMMAND, dinfo->cfg.cmdreg, 2);
pci_write_config(dev, PCIR_INTLINE, dinfo->cfg.intline, 1);
pci_write_config(dev, PCIR_INTPIN, dinfo->cfg.intpin, 1);
pci_write_config(dev, PCIR_CACHELNSZ, dinfo->cfg.cachelnsz, 1);
@@ -5971,6 +5970,9 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinf
break;
}
pci_restore_bars(dev);
+
+   if ((dinfo->cfg.hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_BRIDGE)
+   pci_write_config(dev, PCIR_COMMAND, dinfo->cfg.cmdreg, 2);
 
/*
 * Restore extended capabilities for PCI-Express and PCI-X

Modified: stable/12/sys/dev/pci/pci_pci.c
==
--- stable/12/sys/dev/pci/pci_pci.c Fri Jun 12 07:23:27 2020
(r362086)
+++ stable/12/sys/dev/pci/pci_pci.c Fri Jun 12 07:25:40 2020
(r362087)
@@ -1786,6 +1786,12 @@ pcib_resume(device_t dev)
 {
 
pcib_cfg_restore(device_get_softc(dev));
+
+   /*
+* Restore the Command register only after restoring the windows.
+* The bridge should not be claiming random windows.
+*/
+   pci_write_config(dev, PCIR_COMMAND, pci_get_cmdreg(dev), 2);
return (bus_generic_resume(dev));
 }
 
___
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"


svn commit: r362086 - stable/12/sys/kern

2020-06-12 Thread Andriy Gapon
Author: avg
Date: Fri Jun 12 07:23:27 2020
New Revision: 362086
URL: https://svnweb.freebsd.org/changeset/base/362086

Log:
  MFC r361620: corefile_open_last: don't keep a locked vnode while locking 
other ones
  
  Consider this scenario:
  - kern.corefile=/var/coredumps/%N.%U.%I.core
  - multiple processes with the same name crash at the same time
  
  It's possible that one process selects existing file N as oldvp while it
  keeps looking for an unused file number.  Another process scans through
  files and stumbles upon N.  That process would be blocked on the vnode
  lock while holding the directory vnode exclusively locked.  The first
  process would, thus, get blocked on the directory's vnode lock.
  
  More generally, holding a file's vnode lock (oldvp) while trying to lock
  its directory (for the next lookup) is a violation of the vnode locking
  order.
  
  I have observed this deadlock in the wild.
  
  So, the change to keep oldvp "opened" but unlocked and to lock it again
  only if it's to be returned as the result.
  As kib noted, an alternative would be to keep the directory locked and
  to use VOP_LOOKUP directly for scanning through existing core files.

Modified:
  stable/12/sys/kern/kern_sig.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_sig.c
==
--- stable/12/sys/kern/kern_sig.c   Fri Jun 12 06:10:27 2020
(r362085)
+++ stable/12/sys/kern/kern_sig.c   Fri Jun 12 07:23:27 2020
(r362086)
@@ -3423,8 +3423,9 @@ corefile_open_last(struct thread *td, char *name, int 
(lasttime.tv_sec == vattr.va_mtime.tv_sec &&
lasttime.tv_nsec >= vattr.va_mtime.tv_nsec)) {
if (oldvp != NULL)
-   vnode_close_locked(td, oldvp);
+   vn_close(oldvp, FWRITE, td->td_ucred, td);
oldvp = vp;
+   VOP_UNLOCK(oldvp);
lasttime = vattr.va_mtime;
} else {
vnode_close_locked(td, vp);
@@ -3435,12 +3436,18 @@ corefile_open_last(struct thread *td, char *name, int 
if (nextvp == NULL) {
if ((td->td_proc->p_flag & P_SUGID) != 0) {
error = EFAULT;
-   vnode_close_locked(td, oldvp);
+   vn_close(oldvp, FWRITE, td->td_ucred, td);
} else {
nextvp = oldvp;
+   error = vn_lock(nextvp, LK_EXCLUSIVE);
+   if (error != 0) {
+   vn_close(nextvp, FWRITE, td->td_ucred,
+   td);
+   nextvp = NULL;
+   }
}
} else {
-   vnode_close_locked(td, oldvp);
+   vn_close(oldvp, FWRITE, td->td_ucred, td);
}
}
if (error != 0) {
___
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"


svn commit: r362085 - head/tools/tools/net80211/wlanstats

2020-06-12 Thread Adrian Chadd
Author: adrian
Date: Fri Jun 12 06:10:27 2020
New Revision: 362085
URL: https://svnweb.freebsd.org/changeset/base/362085

Log:
  [wlanstats] Add the per-node amsdu hardware decap'ed receive stats.
  
  This is useful for tracking hardware provided AMSDU frames to see
  when we're (a) seeing them, and (b) seeing the split between
  intermediary and final frames.
  
  Tested:
  
  * QCA9880 (athp) - AP mode

Modified:
  head/tools/tools/net80211/wlanstats/main.c
  head/tools/tools/net80211/wlanstats/wlanstats.c

Modified: head/tools/tools/net80211/wlanstats/main.c
==
--- head/tools/tools/net80211/wlanstats/main.c  Fri Jun 12 04:19:03 2020
(r362084)
+++ head/tools/tools/net80211/wlanstats/main.c  Fri Jun 12 06:10:27 2020
(r362085)
@@ -63,7 +63,7 @@ static struct {
   },
   {
 "amsdu",
-"input,output,amsdu_tooshort,amsdu_split,amsdu_decap,amsdu_encap,rssi,rate"
+
"input,output,amsdu_tooshort,amsdu_split,amsdu_decap,amsdu_encap,rx_amsdu_more,rx_amsdu_more_end,rssi,rate"
   },
 };
 

Modified: head/tools/tools/net80211/wlanstats/wlanstats.c
==
--- head/tools/tools/net80211/wlanstats/wlanstats.c Fri Jun 12 04:19:03 
2020(r362084)
+++ head/tools/tools/net80211/wlanstats/wlanstats.c Fri Jun 12 06:10:27 
2020(r362085)
@@ -276,7 +276,11 @@ static const struct fmt wlanstats[] = {
{ 8,  "amsdu_decap","decap","A-MSDU frames received" },
 #defineS_AMSDU_ENCAP   AFTER(S_AMSDU_DECAP)
{ 8,  "amsdu_encap","encap","A-MSDU frames transmitted" },
-#defineS_AMPDU_REORDER AFTER(S_AMSDU_ENCAP)
+#defineS_AMSDU_RX_MORE AFTER(S_AMSDU_ENCAP)
+   { 13,  "rx_amsdu_more", "rx_amsdu_more","A-MSDU HW intermediary 
decap'ed received" },
+#defineS_AMSDU_RX_MORE_END AFTER(S_AMSDU_RX_MORE)
+   { 17,  "rx_amsdu_more_end", "rx_amsdu_more_end","A-MSDU HW end 
decap'ed received" },
+#defineS_AMPDU_REORDER AFTER(S_AMSDU_RX_MORE_END)
{ 8,  "ampdu_reorder",  "reorder","A-MPDU frames held in reorder q" },
 #defineS_AMPDU_FLUSH   AFTER(S_AMPDU_REORDER)
{ 8,  "ampdu_flush","flush","A-MPDU frames sent up from 
reorder q" },
@@ -778,6 +782,8 @@ wlan_get_curstat(struct bsdstat *sf, int s, char b[], 
case S_AMSDU_SPLIT: STAT(amsdu_split);
case S_AMSDU_DECAP: STAT(amsdu_decap);
case S_AMSDU_ENCAP: STAT(amsdu_encap);
+   case S_AMSDU_RX_MORE:   NSTAT(rx_amsdu_more);
+   case S_AMSDU_RX_MORE_END:   NSTAT(rx_amsdu_more_end);
case S_AMPDU_REORDER:   STAT(ampdu_rx_reorder);
case S_AMPDU_FLUSH: STAT(ampdu_rx_flush);
case S_AMPDU_BARBAD:STAT(ampdu_bar_bad);
@@ -941,6 +947,8 @@ wlan_get_totstat(struct bsdstat *sf, int s, char b[], 
case S_AMSDU_SPLIT: STAT(amsdu_split);
case S_AMSDU_DECAP: STAT(amsdu_decap);
case S_AMSDU_ENCAP: STAT(amsdu_encap);
+   case S_AMSDU_RX_MORE:   NSTAT(rx_amsdu_more);
+   case S_AMSDU_RX_MORE_END:   NSTAT(rx_amsdu_more_end);
case S_AMPDU_REORDER:   STAT(ampdu_rx_reorder);
case S_AMPDU_FLUSH: STAT(ampdu_rx_flush);
case S_AMPDU_BARBAD:STAT(ampdu_bar_bad);
___
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"