svn commit: r362190 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic

2020-06-14 Thread Cy Schubert
Author: cy
Date: Mon Jun 15 03:10:53 2020
New Revision: 362190
URL: https://svnweb.freebsd.org/changeset/base/362190

Log:
  MFC r362095, r362145
  
  r362095:
  MFV r362082:
  
  Update sqlite3 3.31.1 --> 3.32.0.
  
  PR:   247149
  Reported by:  spam...@bitbert.com
  Reminded by:  emaste
  Security: CVE-2020-11655, CVE-2020-13434, CVE-2020-13435,
CVE-2020-13630, CVE-2020-13631, CVE-2020-13632
  
  r362145:
  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
  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:
  stable/12/contrib/sqlite3/Makefile.msc
  stable/12/contrib/sqlite3/configure
  stable/12/contrib/sqlite3/configure.ac
  stable/12/contrib/sqlite3/shell.c
  stable/12/contrib/sqlite3/sqlite3.c
  stable/12/contrib/sqlite3/sqlite3.h
  stable/12/contrib/sqlite3/sqlite3ext.h
  stable/12/contrib/sqlite3/tea/configure
  stable/12/contrib/sqlite3/tea/configure.ac
  stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/contrib/sqlite3/Makefile.msc
  stable/11/contrib/sqlite3/configure
  stable/11/contrib/sqlite3/configure.ac
  stable/11/contrib/sqlite3/shell.c
  stable/11/contrib/sqlite3/sqlite3.c
  stable/11/contrib/sqlite3/sqlite3.h
  stable/11/contrib/sqlite3/sqlite3ext.h
  stable/11/contrib/sqlite3/tea/configure
  stable/11/contrib/sqlite3/tea/configure.ac
  stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/contrib/sqlite3/Makefile.msc
==
--- stable/12/contrib/sqlite3/Makefile.msc  Mon Jun 15 03:02:59 2020
(r362189)
+++ stable/12/contrib/sqlite3/Makefile.msc  Mon Jun 15 03:10:53 2020
(r362190)
@@ -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: stable/12/contrib/sqlite3/configure
==
--- stable/12/contrib/sqlite3/configure Mon Jun 15 03:02:59 2020
(r362189)
+++ stable/12/contrib/sqlite3/configure Mon Jun 15 03:10:53 2020
(r362190)
@@ -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.2.
 #
 # 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.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 

svn commit: r362190 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic

2020-06-14 Thread Cy Schubert
Author: cy
Date: Mon Jun 15 03:10:53 2020
New Revision: 362190
URL: https://svnweb.freebsd.org/changeset/base/362190

Log:
  MFC r362095, r362145
  
  r362095:
  MFV r362082:
  
  Update sqlite3 3.31.1 --> 3.32.0.
  
  PR:   247149
  Reported by:  spam...@bitbert.com
  Reminded by:  emaste
  Security: CVE-2020-11655, CVE-2020-13434, CVE-2020-13435,
CVE-2020-13630, CVE-2020-13631, CVE-2020-13632
  
  r362145:
  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
  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:
  stable/11/contrib/sqlite3/Makefile.msc
  stable/11/contrib/sqlite3/configure
  stable/11/contrib/sqlite3/configure.ac
  stable/11/contrib/sqlite3/shell.c
  stable/11/contrib/sqlite3/sqlite3.c
  stable/11/contrib/sqlite3/sqlite3.h
  stable/11/contrib/sqlite3/sqlite3ext.h
  stable/11/contrib/sqlite3/tea/configure
  stable/11/contrib/sqlite3/tea/configure.ac
  stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/contrib/sqlite3/Makefile.msc
  stable/12/contrib/sqlite3/configure
  stable/12/contrib/sqlite3/configure.ac
  stable/12/contrib/sqlite3/shell.c
  stable/12/contrib/sqlite3/sqlite3.c
  stable/12/contrib/sqlite3/sqlite3.h
  stable/12/contrib/sqlite3/sqlite3ext.h
  stable/12/contrib/sqlite3/tea/configure
  stable/12/contrib/sqlite3/tea/configure.ac
  stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/contrib/sqlite3/Makefile.msc
==
--- stable/11/contrib/sqlite3/Makefile.msc  Mon Jun 15 03:02:59 2020
(r362189)
+++ stable/11/contrib/sqlite3/Makefile.msc  Mon Jun 15 03:10:53 2020
(r362190)
@@ -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: stable/11/contrib/sqlite3/configure
==
--- stable/11/contrib/sqlite3/configure Mon Jun 15 03:02:59 2020
(r362189)
+++ stable/11/contrib/sqlite3/configure Mon Jun 15 03:10:53 2020
(r362190)
@@ -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.2.
 #
 # 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.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 

svn commit: r362188 - in stable/12/sys: compat/linux vm

2020-06-14 Thread Mark Johnston
Author: markj
Date: Mon Jun 15 03:02:19 2020
New Revision: 362188
URL: https://svnweb.freebsd.org/changeset/base/362188

Log:
  Revert r362187, it contained some unintended changes.
  
  This is a direct commit to stable/12.

Modified:
  stable/12/sys/compat/linux/linux_misc.c
  stable/12/sys/vm/vm_map.c
  stable/12/sys/vm/vm_map.h
  stable/12/sys/vm/vm_mmap.c
  stable/12/sys/vm/vm_unix.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_misc.c
==
--- stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:01:28 2020
(r362187)
+++ stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:02:19 2020
(r362188)
@@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #ifdef COMPAT_LINUX32
@@ -149,6 +150,7 @@ int
 linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
 {
struct l_sysinfo sysinfo;
+   vm_object_t object;
int i, j;
struct timespec ts;
 
@@ -166,13 +168,14 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_
sysinfo.totalram = physmem * PAGE_SIZE;
sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE;
 
-   /*
-* sharedram counts pages allocated to named, swap-backed objects such
-* as shared memory segments and tmpfs files.  There is no cheap way to
-* compute this, so just leave the field unpopulated.  Linux itself only
-* started setting this field in the 3.x timeframe.
-*/
sysinfo.sharedram = 0;
+   mtx_lock(_object_list_mtx);
+   TAILQ_FOREACH(object, _object_list, object_list)
+   if (object->shadow_count > 1)
+   sysinfo.sharedram += object->resident_page_count;
+   mtx_unlock(_object_list_mtx);
+
+   sysinfo.sharedram *= PAGE_SIZE;
sysinfo.bufferram = 0;
 
swap_pager_status(, );

Modified: stable/12/sys/vm/vm_map.c
==
--- stable/12/sys/vm/vm_map.c   Mon Jun 15 03:01:28 2020(r362187)
+++ stable/12/sys/vm/vm_map.c   Mon Jun 15 03:02:19 2020(r362188)
@@ -3097,7 +3097,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm
u_long npages;
u_int last_timestamp;
int rv;
-   boolean_t need_wakeup, result, user_wire, user_wire_limit;
+   boolean_t need_wakeup, result, user_wire;
vm_prot_t prot;
 
VM_MAP_ASSERT_LOCKED(map);
@@ -3108,7 +3108,6 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm
if (flags & VM_MAP_WIRE_WRITE)
prot |= VM_PROT_WRITE;
user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE;
-   user_wire_limit = (flags & VM_MAP_WIRE_USER_LIMIT) ? TRUE : FALSE;
VM_MAP_RANGE_CHECK(map, start, end);
if (!vm_map_lookup_entry(map, start, _entry)) {
if (flags & VM_MAP_WIRE_HOLESOK)
@@ -3189,8 +3188,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm
entry->wired_count++;
 
npages = atop(entry->end - entry->start);
-   if (user_wire_limit &&
-   !vm_map_wire_user_count_add(npages)) {
+   if (user_wire && !vm_map_wire_user_count_add(npages)) {
vm_map_wire_entry_failure(map, entry,
entry->start);
end = entry->end;
@@ -3252,7 +3250,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm
last_timestamp = map->timestamp;
if (rv != KERN_SUCCESS) {
vm_map_wire_entry_failure(map, entry, faddr);
-   if (user_wire_limit)
+   if (user_wire)
vm_map_wire_user_count_sub(npages);
end = entry->end;
goto done;
@@ -3321,7 +3319,7 @@ done:
 */
if (entry->wired_count == 1) {
vm_map_entry_unwire(map, entry);
-   if (user_wire_limit)
+   if (user_wire)
vm_map_wire_user_count_sub(
atop(entry->end - entry->start));
} else
@@ -4457,8 +4455,7 @@ retry:
if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) {
rv = vm_map_wire_locked(map, grow_start,
grow_start + grow_amount,
-   VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT |
-   VM_MAP_WIRE_NOHOLES);
+   VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES);
}
vm_map_lock_downgrade(map);
 

Modified: 

svn commit: r362189 - stable/12/sys/compat/linux

2020-06-14 Thread Mark Johnston
Author: markj
Date: Mon Jun 15 03:02:59 2020
New Revision: 362189
URL: https://svnweb.freebsd.org/changeset/base/362189

Log:
  MFC r361945, r362036:
  Stop computing a "sharedram" value when emulating Linux sysinfo(2).

Modified:
  stable/12/sys/compat/linux/linux_misc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_misc.c
==
--- stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:02:19 2020
(r362188)
+++ stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:02:59 2020
(r362189)
@@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #ifdef COMPAT_LINUX32
@@ -150,7 +149,6 @@ int
 linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
 {
struct l_sysinfo sysinfo;
-   vm_object_t object;
int i, j;
struct timespec ts;
 
@@ -168,14 +166,13 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_
sysinfo.totalram = physmem * PAGE_SIZE;
sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE;
 
+   /*
+* sharedram counts pages allocated to named, swap-backed objects such
+* as shared memory segments and tmpfs files.  There is no cheap way to
+* compute this, so just leave the field unpopulated.  Linux itself only
+* started setting this field in the 3.x timeframe.
+*/
sysinfo.sharedram = 0;
-   mtx_lock(_object_list_mtx);
-   TAILQ_FOREACH(object, _object_list, object_list)
-   if (object->shadow_count > 1)
-   sysinfo.sharedram += object->resident_page_count;
-   mtx_unlock(_object_list_mtx);
-
-   sysinfo.sharedram *= PAGE_SIZE;
sysinfo.bufferram = 0;
 
swap_pager_status(, );
___
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: r362187 - in stable/12/sys: compat/linux vm

2020-06-14 Thread Mark Johnston
Author: markj
Date: Mon Jun 15 03:01:28 2020
New Revision: 362187
URL: https://svnweb.freebsd.org/changeset/base/362187

Log:
  MFC r361945, r362036:
  Stop computing a "sharedram" value when emulating Linux sysinfo(2).

Modified:
  stable/12/sys/compat/linux/linux_misc.c
  stable/12/sys/vm/vm_map.c
  stable/12/sys/vm/vm_map.h
  stable/12/sys/vm/vm_mmap.c
  stable/12/sys/vm/vm_unix.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_misc.c
==
--- stable/12/sys/compat/linux/linux_misc.c Sun Jun 14 22:39:34 2020
(r362186)
+++ stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:01:28 2020
(r362187)
@@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #ifdef COMPAT_LINUX32
@@ -150,7 +149,6 @@ int
 linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
 {
struct l_sysinfo sysinfo;
-   vm_object_t object;
int i, j;
struct timespec ts;
 
@@ -168,14 +166,13 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_
sysinfo.totalram = physmem * PAGE_SIZE;
sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE;
 
+   /*
+* sharedram counts pages allocated to named, swap-backed objects such
+* as shared memory segments and tmpfs files.  There is no cheap way to
+* compute this, so just leave the field unpopulated.  Linux itself only
+* started setting this field in the 3.x timeframe.
+*/
sysinfo.sharedram = 0;
-   mtx_lock(_object_list_mtx);
-   TAILQ_FOREACH(object, _object_list, object_list)
-   if (object->shadow_count > 1)
-   sysinfo.sharedram += object->resident_page_count;
-   mtx_unlock(_object_list_mtx);
-
-   sysinfo.sharedram *= PAGE_SIZE;
sysinfo.bufferram = 0;
 
swap_pager_status(, );

Modified: stable/12/sys/vm/vm_map.c
==
--- stable/12/sys/vm/vm_map.c   Sun Jun 14 22:39:34 2020(r362186)
+++ stable/12/sys/vm/vm_map.c   Mon Jun 15 03:01:28 2020(r362187)
@@ -3097,7 +3097,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm
u_long npages;
u_int last_timestamp;
int rv;
-   boolean_t need_wakeup, result, user_wire;
+   boolean_t need_wakeup, result, user_wire, user_wire_limit;
vm_prot_t prot;
 
VM_MAP_ASSERT_LOCKED(map);
@@ -3108,6 +3108,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm
if (flags & VM_MAP_WIRE_WRITE)
prot |= VM_PROT_WRITE;
user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE;
+   user_wire_limit = (flags & VM_MAP_WIRE_USER_LIMIT) ? TRUE : FALSE;
VM_MAP_RANGE_CHECK(map, start, end);
if (!vm_map_lookup_entry(map, start, _entry)) {
if (flags & VM_MAP_WIRE_HOLESOK)
@@ -3188,7 +3189,8 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm
entry->wired_count++;
 
npages = atop(entry->end - entry->start);
-   if (user_wire && !vm_map_wire_user_count_add(npages)) {
+   if (user_wire_limit &&
+   !vm_map_wire_user_count_add(npages)) {
vm_map_wire_entry_failure(map, entry,
entry->start);
end = entry->end;
@@ -3250,7 +3252,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm
last_timestamp = map->timestamp;
if (rv != KERN_SUCCESS) {
vm_map_wire_entry_failure(map, entry, faddr);
-   if (user_wire)
+   if (user_wire_limit)
vm_map_wire_user_count_sub(npages);
end = entry->end;
goto done;
@@ -3319,7 +3321,7 @@ done:
 */
if (entry->wired_count == 1) {
vm_map_entry_unwire(map, entry);
-   if (user_wire)
+   if (user_wire_limit)
vm_map_wire_user_count_sub(
atop(entry->end - entry->start));
} else
@@ -4455,7 +4457,8 @@ retry:
if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) {
rv = vm_map_wire_locked(map, grow_start,
grow_start + grow_amount,
-   VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES);
+   VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT |
+   VM_MAP_WIRE_NOHOLES);
}
vm_map_lock_downgrade(map);
 

Modified: 

svn commit: r362186 - head/sys/dev/virtio/network

2020-06-14 Thread Jessica Clarke
Author: jrtc27
Date: Sun Jun 14 22:39:34 2020
New Revision: 362186
URL: https://svnweb.freebsd.org/changeset/base/362186

Log:
  vtnet: Fix regression introduced in r361944
  
  For legacy devices that don't support MrgRxBuf (such as bhyve pre-r358180),
  r361944 failed to update the receive handler to account for the additional
  padding introduced by the unused num_buffers field that is now always present
  in struct vtnet_rx_header. Thus, calculate the padding dynamically based on
  vtnet_hdr_size.
  
  PR:   247242
  Reported by:  thj
  Tested by:thj

Modified:
  head/sys/dev/virtio/network/if_vtnet.c

Modified: head/sys/dev/virtio/network/if_vtnet.c
==
--- head/sys/dev/virtio/network/if_vtnet.c  Sun Jun 14 21:07:12 2020
(r362185)
+++ head/sys/dev/virtio/network/if_vtnet.c  Sun Jun 14 22:39:34 2020
(r362186)
@@ -1819,9 +1819,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq)
adjsz = sizeof(struct vtnet_rx_header);
/*
 * Account for our pad inserted between the header
-* and the actual start of the frame.
+* and the actual start of the frame. This includes
+* the unused num_buffers when using a legacy device.
 */
-   len += VTNET_RX_HEADER_PAD;
+   len += adjsz - sc->vtnet_hdr_size;
} else {
mhdr = mtod(m, struct virtio_net_hdr_mrg_rxbuf *);
nbufs = mhdr->num_buffers;
___
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: r361944 - in head/sys/dev/virtio: . network

2020-06-14 Thread Jessica Clarke
On 14 Jun 2020, at 22:22, Tom Jones  wrote:
> On Sun, Jun 14, 2020 at 09:56:03PM +0100, Jessica Clarke wrote:
>> On 14 Jun 2020, at 20:51, Tom Jones  wrote:
>>> On Mon, Jun 08, 2020 at 09:51:36PM +, Jessica Clarke wrote:
 Author: jrtc27
 Date: Mon Jun  8 21:51:36 2020
 New Revision: 361944
 URL: https://svnweb.freebsd.org/changeset/base/361944
 
 Log:
 virtio: Support non-legacy network device and queue
 
 The non-legacy interface always defines num_buffers in the header,
 regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. We
 also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1
 during negotiation, as it supports non-legacy transports just fine. This
 fixes network packet transmission on TinyEMU.
 
 Reviewed by:   br, brooks (mentor), jhb (mentor)
 Approved by:   br, brooks (mentor), jhb (mentor)
 Differential Revision: https://reviews.freebsd.org/D25132
 
 Modified:
 head/sys/dev/virtio/network/if_vtnet.c
 head/sys/dev/virtio/network/if_vtnetvar.h
 head/sys/dev/virtio/virtio.c
 head/sys/dev/virtio/virtqueue.c
 
>>> 
>>> Hi Jessica,
>>> 
>>> After updating my current bhyve vm today (on a 12.1 host), networking no 
>>> longer
>>> works. Reverting this commit seems to resolve the issue. I think vtnet is 
>>> not
>>> passing enough data up to the ip layer.
>>> 
>>> If I capture on the tap interface for the vm I see arp requests and arp
>>> replies, however kern.msgbuf is full of: 
>>> 
>>> <5>arp: short packet received on vtnet0
>>> 
>>> and netstat does not see any replies to arp requests:
>>> 
>>> root@freebsd-current:~ # netstat -s -p arp
>>> arp:
>>>   11 ARP requests sent
>>>   0 ARP requests failed to sent
>>>   0 ARP replies sent
>>>   0 ARP requests received
>>>   0 ARP replies received
>>>   0 ARP packets received
>>>   24 total packets dropped due to no ARP entry
>>>   2 ARP entrys timed out
>>>   0 Duplicate IPs seen
>>> 
>>> If I set up an arp entry manually I can see ICMP echo requests and 
>>> responses on
>>> the tap interface, but the vm does not see the responses. 
>>> 
>>> root@freebsd-current:~ # netstat -s -p ip
>>> ip:
>>>   7 total packets received
>>>   0 bad header checksums
>>>   0 with size smaller than minimum
>>>   7 with data size < data length
>>>   0 with ip length > max ip packet size
>>>   0 with header length < data size
>>>   0 with data length < header length
>>> 
>>> The line
>>> 
>>>   7 with data size < data length
>>> 
>>> makes me think that vtnet is truncating packets. 
>>> 
>>> markj pointed me at this bug in irc which might also be related:
>>> 
>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242
>> 
>> Hi Tom,
>> Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf"
>> case. Could you please try the patch below?
>> 
>> Jess
>> 
> 
> This changed fixed the issue for me. Please feel free to add 
> 
> Tested By: thj 
> 
> when you commit.

Great, thanks for the report.

> In testing I this lor went by, I wonder if this is something you care about:
> 
> acquiring duplicate lock of same type: "vtnet0-rx0"
> 1st vtnet0-rx0 @ 
> /usr/home/tj/code/freebsd/projects/review-D25220/sys/dev/virtio/network/if_vtnet.c:1780
> 2nd vtnet0-rx0 @ 
> /usr/home/tj/code/freebsd/projects/review-D25220/sys/kern/subr_taskqueue.c:281
> stack backtrace:
> #0 0x80c32881 at witness_debugger+0x71
> #1 0x80ba3e54 at __mtx_lock_flags+0x94
> #2 0x80c24bd2 at taskqueue_enqueue+0x42
> #3 0x80a1af99 at vtnet_rxq_tq_intr+0xb9
> #4 0x80c2520a at taskqueue_run_locked+0xaa
> #5 0x80c26284 at taskqueue_thread_loop+0x94
> #6 0x80b830e0 at fork_exit+0x80
> #7 0x81040eae at fork_trampoline+0xe

Hm, I think that's just a false-positive, because if_vtnet constructs
the taskqueue using the same name as its own internal mutexes. Though
the locking around vtnet_rx_vq_intr and vtnet_rxq_tq_intr is a bit
fishy given they're rather similar yet inconsistent. I would imagine
rxq->vtnrx_stats.vrxs_rescheduled is supposed to be protected by that
mutex, but wouldn't like to say whether taskqueue_enqueue needs to be.
Vincenzo, you recently touched code around there, perhaps you could be
persuaded to have a quick look?..

Jess

___
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: r361944 - in head/sys/dev/virtio: . network

2020-06-14 Thread Tom Jones
On Sun, Jun 14, 2020 at 09:56:03PM +0100, Jessica Clarke wrote:
> On 14 Jun 2020, at 20:51, Tom Jones  wrote:
> > On Mon, Jun 08, 2020 at 09:51:36PM +, Jessica Clarke wrote:
> >> Author: jrtc27
> >> Date: Mon Jun  8 21:51:36 2020
> >> New Revision: 361944
> >> URL: https://svnweb.freebsd.org/changeset/base/361944
> >> 
> >> Log:
> >>  virtio: Support non-legacy network device and queue
> >> 
> >>  The non-legacy interface always defines num_buffers in the header,
> >>  regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. We
> >>  also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1
> >>  during negotiation, as it supports non-legacy transports just fine. This
> >>  fixes network packet transmission on TinyEMU.
> >> 
> >>  Reviewed by:  br, brooks (mentor), jhb (mentor)
> >>  Approved by:  br, brooks (mentor), jhb (mentor)
> >>  Differential Revision:https://reviews.freebsd.org/D25132
> >> 
> >> Modified:
> >>  head/sys/dev/virtio/network/if_vtnet.c
> >>  head/sys/dev/virtio/network/if_vtnetvar.h
> >>  head/sys/dev/virtio/virtio.c
> >>  head/sys/dev/virtio/virtqueue.c
> >> 
> > 
> > Hi Jessica,
> > 
> > After updating my current bhyve vm today (on a 12.1 host), networking no 
> > longer
> > works. Reverting this commit seems to resolve the issue. I think vtnet is 
> > not
> > passing enough data up to the ip layer.
> > 
> > If I capture on the tap interface for the vm I see arp requests and arp
> > replies, however kern.msgbuf is full of: 
> > 
> > <5>arp: short packet received on vtnet0
> > 
> > and netstat does not see any replies to arp requests:
> > 
> > root@freebsd-current:~ # netstat -s -p arp
> > arp:
> >11 ARP requests sent
> >0 ARP requests failed to sent
> >0 ARP replies sent
> >0 ARP requests received
> >0 ARP replies received
> >0 ARP packets received
> >24 total packets dropped due to no ARP entry
> >2 ARP entrys timed out
> >0 Duplicate IPs seen
> > 
> > If I set up an arp entry manually I can see ICMP echo requests and 
> > responses on
> > the tap interface, but the vm does not see the responses. 
> > 
> > root@freebsd-current:~ # netstat -s -p ip
> > ip:
> >7 total packets received
> >0 bad header checksums
> >0 with size smaller than minimum
> >7 with data size < data length
> >0 with ip length > max ip packet size
> >0 with header length < data size
> >0 with data length < header length
> > 
> > The line
> > 
> >7 with data size < data length
> > 
> > makes me think that vtnet is truncating packets. 
> > 
> > markj pointed me at this bug in irc which might also be related:
> > 
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242
> 
> Hi Tom,
> Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf"
> case. Could you please try the patch below?
> 
> Jess
> 

This changed fixed the issue for me. Please feel free to add 

Tested By: thj 

when you commit. 

In testing I this lor went by, I wonder if this is something you care about:

acquiring duplicate lock of same type: "vtnet0-rx0"
 1st vtnet0-rx0 @ 
/usr/home/tj/code/freebsd/projects/review-D25220/sys/dev/virtio/network/if_vtnet.c:1780
 2nd vtnet0-rx0 @ 
/usr/home/tj/code/freebsd/projects/review-D25220/sys/kern/subr_taskqueue.c:281
stack backtrace:
#0 0x80c32881 at witness_debugger+0x71
#1 0x80ba3e54 at __mtx_lock_flags+0x94
#2 0x80c24bd2 at taskqueue_enqueue+0x42
#3 0x80a1af99 at vtnet_rxq_tq_intr+0xb9
#4 0x80c2520a at taskqueue_run_locked+0xaa
#5 0x80c26284 at taskqueue_thread_loop+0x94
#6 0x80b830e0 at fork_exit+0x80
#7 0x81040eae at fork_trampoline+0xe

- Tom
___
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: r361944 - in head/sys/dev/virtio: . network

2020-06-14 Thread Vincenzo Maffione
You may already know that, but FreeBSD-CURRENT supports mergeable rx
buffers as of r358180.

Cheers,
  Vincenzo

Il giorno dom 14 giu 2020 alle ore 22:56 Jessica Clarke 
ha scritto:

> On 14 Jun 2020, at 20:51, Tom Jones  wrote:
> > On Mon, Jun 08, 2020 at 09:51:36PM +, Jessica Clarke wrote:
> >> Author: jrtc27
> >> Date: Mon Jun  8 21:51:36 2020
> >> New Revision: 361944
> >> URL: https://svnweb.freebsd.org/changeset/base/361944
> >>
> >> Log:
> >>  virtio: Support non-legacy network device and queue
> >>
> >>  The non-legacy interface always defines num_buffers in the header,
> >>  regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused.
> We
> >>  also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1
> >>  during negotiation, as it supports non-legacy transports just fine.
> This
> >>  fixes network packet transmission on TinyEMU.
> >>
> >>  Reviewed by:br, brooks (mentor), jhb (mentor)
> >>  Approved by:br, brooks (mentor), jhb (mentor)
> >>  Differential Revision:  https://reviews.freebsd.org/D25132
> >>
> >> Modified:
> >>  head/sys/dev/virtio/network/if_vtnet.c
> >>  head/sys/dev/virtio/network/if_vtnetvar.h
> >>  head/sys/dev/virtio/virtio.c
> >>  head/sys/dev/virtio/virtqueue.c
> >>
> >
> > Hi Jessica,
> >
> > After updating my current bhyve vm today (on a 12.1 host), networking no
> longer
> > works. Reverting this commit seems to resolve the issue. I think vtnet
> is not
> > passing enough data up to the ip layer.
> >
> > If I capture on the tap interface for the vm I see arp requests and arp
> > replies, however kern.msgbuf is full of:
> >
> > <5>arp: short packet received on vtnet0
> >
> > and netstat does not see any replies to arp requests:
> >
> > root@freebsd-current:~ # netstat -s -p arp
> > arp:
> >11 ARP requests sent
> >0 ARP requests failed to sent
> >0 ARP replies sent
> >0 ARP requests received
> >0 ARP replies received
> >0 ARP packets received
> >24 total packets dropped due to no ARP entry
> >2 ARP entrys timed out
> >0 Duplicate IPs seen
> >
> > If I set up an arp entry manually I can see ICMP echo requests and
> responses on
> > the tap interface, but the vm does not see the responses.
> >
> > root@freebsd-current:~ # netstat -s -p ip
> > ip:
> >7 total packets received
> >0 bad header checksums
> >0 with size smaller than minimum
> >7 with data size < data length
> >0 with ip length > max ip packet size
> >0 with header length < data size
> >0 with data length < header length
> >
> > The line
> >
> >7 with data size < data length
> >
> > makes me think that vtnet is truncating packets.
> >
> > markj pointed me at this bug in irc which might also be related:
> >
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242
>
> Hi Tom,
> Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf"
> case. Could you please try the patch below?
>
> Jess
>
> diff --git a/sys/dev/virtio/network/if_vtnet.c
> b/sys/dev/virtio/network/if_vtnet.c
> index 7a0859cc0eb1..7e10b75f7f66 100644
> --- a/sys/dev/virtio/network/if_vtnet.c
> +++ b/sys/dev/virtio/network/if_vtnet.c
> @@ -1819,9 +1819,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq)
>  adjsz = sizeof(struct vtnet_rx_header);
>  /*
>   * Account for our pad inserted between the header
> - * and the actual start of the frame.
> + * and the actual start of the frame. This includes
> + * the unused num_buffers when using a legacy device.
>   */
> -len += VTNET_RX_HEADER_PAD;
> +len += adjsz - sc->vtnet_hdr_size;
>  } else {
>  mhdr = mtod(m, struct virtio_net_hdr_mrg_rxbuf *);
>  nbufs = mhdr->num_buffers;
>
>
___
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: r362185 - head/sys/net

2020-06-14 Thread Vincenzo Maffione
Author: vmaffione
Date: Sun Jun 14 21:07:12 2020
New Revision: 362185
URL: https://svnweb.freebsd.org/changeset/base/362185

Log:
  iflib: netmap: enter/exit netmap mode after device stops
  
  Avoid possible race conditions by calling nm_set_native_flags()
  and nm_clear_native_flags() only after the device has been
  stopped.
  
  MFC after:1 week

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cSun Jun 14 20:57:24 2020(r362184)
+++ head/sys/net/iflib.cSun Jun 14 21:07:12 2020(r362185)
@@ -788,13 +788,19 @@ iflib_netmap_register(struct netmap_adapter *na, int o
if (!CTX_IS_VF(ctx))
IFDI_CRCSTRIP_SET(ctx, onoff, iflib_crcstrip);
 
-   /* enable or disable flags and callbacks in na and ifp */
+   iflib_stop(ctx);
+
+   /*
+* Enable (or disable) netmap flags, and intercept (or restore)
+* ifp->if_transmit. This is done once the device has been stopped
+* to prevent race conditions.
+*/
if (onoff) {
nm_set_native_flags(na);
} else {
nm_clear_native_flags(na);
}
-   iflib_stop(ctx);
+
iflib_init_locked(ctx);
IFDI_CRCSTRIP_SET(ctx, onoff, iflib_crcstrip); // XXX why twice ?
status = ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 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: r362184 - head/stand/i386/zfsboot

2020-06-14 Thread Toomas Soome
Author: tsoome
Date: Sun Jun 14 20:57:24 2020
New Revision: 362184
URL: https://svnweb.freebsd.org/changeset/base/362184

Log:
  zfsboot: cstyle cleanup
  
  No functional changes intended.
  
  Sponsored by: Netflix, Klara Inc.

Modified:
  head/stand/i386/zfsboot/zfsboot.c

Modified: head/stand/i386/zfsboot/zfsboot.c
==
--- head/stand/i386/zfsboot/zfsboot.c   Sun Jun 14 20:47:31 2020
(r362183)
+++ head/stand/i386/zfsboot/zfsboot.c   Sun Jun 14 20:57:24 2020
(r362184)
@@ -48,20 +48,20 @@ __FBSDID("$FreeBSD$");
 
 #include "libzfs.h"
 
-#define ARGS   0x900
-#define NOPT   14
-#define NDEV   3
+#defineARGS0x900
+#defineNOPT14
+#defineNDEV3
 
-#define BIOS_NUMDRIVES 0x475
-#define DRV_HARD   0x80
-#define DRV_MASK   0x7f
+#defineBIOS_NUMDRIVES  0x475
+#defineDRV_HARD0x80
+#defineDRV_MASK0x7f
 
-#define TYPE_AD0
-#define TYPE_DA1
-#define TYPE_MAXHARD   TYPE_DA
-#define TYPE_FD2
+#defineTYPE_AD 0
+#defineTYPE_DA 1
+#defineTYPE_MAXHARDTYPE_DA
+#defineTYPE_FD 2
 
-#define DEV_GELIBOOT_BSIZE 4096
+#defineDEV_GELIBOOT_BSIZE  4096
 
 extern uint32_t _end;
 
@@ -97,12 +97,12 @@ uint32_t opts;
  * If no loader is found, try to load a kernel directly instead.
  */
 static const struct string {
-const char *p;
-size_t len;
+   const char *p;
+   size_t len;
 } loadpath[] = {
-{ PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS) },
-{ PATH_LOADER, sizeof(PATH_LOADER) },
-{ PATH_KERNEL, sizeof(PATH_KERNEL) },
+   { PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS) },
+   { PATH_LOADER, sizeof(PATH_LOADER) },
+   { PATH_KERNEL, sizeof(PATH_KERNEL) },
 };
 
 static const unsigned char dev_maj[NDEV] = {30, 4, 2};
@@ -130,7 +130,7 @@ static char *heap_next;
 static char *heap_end;
 
 /* Buffers that must not span a 64k boundary. */
-#define READ_BUF_SIZE  8192
+#defineREAD_BUF_SIZE   8192
 struct dmadat {
char rdbuf[READ_BUF_SIZE];  /* for reading large things */
char secbuf[READ_BUF_SIZE]; /* for MBR/disklabel */
@@ -150,9 +150,9 @@ static char gelipw[GELI_PW_MAXLEN];
 #endif
 
 struct zfsdsk {
-   struct dsk   dsk;
+   struct dsk  dsk;
 #ifdef LOADER_GELI_SUPPORT
-   struct geli_dev *gdev;
+   struct geli_dev *gdev;
 #endif
 };
 
@@ -162,7 +162,8 @@ struct zfsdsk {
  * Read from a dnode (which must be from a ZPL filesystem).
  */
 static int
-zfs_read(spa_t *spa, const dnode_phys_t *dnode, off_t *offp, void *start, 
size_t size)
+zfs_read(spa_t *spa, const dnode_phys_t *dnode, off_t *offp, void *start,
+size_t size)
 {
const znode_phys_t *zp = (const znode_phys_t *) dnode->dn_bonus;
size_t n;
@@ -198,10 +199,10 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu
daddr_t lba, alignlba;
off_t diff;
unsigned int nb, alignnb;
-   struct zfsdsk *zdsk = (struct zfsdsk *) priv;
+   struct zfsdsk *zdsk = priv;
 
if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1)))
-   return -1;
+   return (-1);
 
p = buf;
lba = off / DEV_BSIZE;
@@ -242,12 +243,13 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu
}
 
if (drvread(>dsk, dmadat->rdbuf, alignlba, alignnb))
-   return -1;
+   return (-1);
 #ifdef LOADER_GELI_SUPPORT
/* decrypt */
if (zdsk->gdev != NULL) {
-   if (geli_read(zdsk->gdev, ((alignlba - zdsk->dsk.start) 
*
-   DEV_BSIZE), dmadat->rdbuf, alignnb * DEV_BSIZE))
+   if (geli_read(zdsk->gdev,
+   ((alignlba - zdsk->dsk.start) * DEV_BSIZE),
+   dmadat->rdbuf, alignnb * DEV_BSIZE))
return (-1);
}
 #endif
@@ -260,13 +262,13 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu
diff = 0;
}
 
-   return 0;
+   return (0);
 }
 /* Match the signature exactly due to signature madness */
 static int
 vdev_read2(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes)
 {
-   return vdev_read(vdev, priv, off, buf, bytes);
+   return (vdev_read(vdev, priv, off, buf, bytes));
 }
 
 
@@ -276,10 +278,10 @@ vdev_write(vdev_t *vdev, void *priv, off_t off, void *
char *p;
daddr_t lba;
unsigned int nb;
-   struct zfsdsk *zdsk = (struct zfsdsk *) priv;
+   struct zfsdsk *zdsk = priv;
 
if ((off 

Re: svn commit: r361944 - in head/sys/dev/virtio: . network

2020-06-14 Thread Jessica Clarke
On 14 Jun 2020, at 20:51, Tom Jones  wrote:
> On Mon, Jun 08, 2020 at 09:51:36PM +, Jessica Clarke wrote:
>> Author: jrtc27
>> Date: Mon Jun  8 21:51:36 2020
>> New Revision: 361944
>> URL: https://svnweb.freebsd.org/changeset/base/361944
>> 
>> Log:
>>  virtio: Support non-legacy network device and queue
>> 
>>  The non-legacy interface always defines num_buffers in the header,
>>  regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. We
>>  also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1
>>  during negotiation, as it supports non-legacy transports just fine. This
>>  fixes network packet transmission on TinyEMU.
>> 
>>  Reviewed by:br, brooks (mentor), jhb (mentor)
>>  Approved by:br, brooks (mentor), jhb (mentor)
>>  Differential Revision:  https://reviews.freebsd.org/D25132
>> 
>> Modified:
>>  head/sys/dev/virtio/network/if_vtnet.c
>>  head/sys/dev/virtio/network/if_vtnetvar.h
>>  head/sys/dev/virtio/virtio.c
>>  head/sys/dev/virtio/virtqueue.c
>> 
> 
> Hi Jessica,
> 
> After updating my current bhyve vm today (on a 12.1 host), networking no 
> longer
> works. Reverting this commit seems to resolve the issue. I think vtnet is not
> passing enough data up to the ip layer.
> 
> If I capture on the tap interface for the vm I see arp requests and arp
> replies, however kern.msgbuf is full of: 
> 
> <5>arp: short packet received on vtnet0
> 
> and netstat does not see any replies to arp requests:
> 
> root@freebsd-current:~ # netstat -s -p arp
> arp:
>11 ARP requests sent
>0 ARP requests failed to sent
>0 ARP replies sent
>0 ARP requests received
>0 ARP replies received
>0 ARP packets received
>24 total packets dropped due to no ARP entry
>2 ARP entrys timed out
>0 Duplicate IPs seen
> 
> If I set up an arp entry manually I can see ICMP echo requests and responses 
> on
> the tap interface, but the vm does not see the responses. 
> 
> root@freebsd-current:~ # netstat -s -p ip
> ip:
>7 total packets received
>0 bad header checksums
>0 with size smaller than minimum
>7 with data size < data length
>0 with ip length > max ip packet size
>0 with header length < data size
>0 with data length < header length
> 
> The line
> 
>7 with data size < data length
> 
> makes me think that vtnet is truncating packets. 
> 
> markj pointed me at this bug in irc which might also be related:
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242

Hi Tom,
Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf"
case. Could you please try the patch below?

Jess

diff --git a/sys/dev/virtio/network/if_vtnet.c 
b/sys/dev/virtio/network/if_vtnet.c
index 7a0859cc0eb1..7e10b75f7f66 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -1819,9 +1819,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq)
 adjsz = sizeof(struct vtnet_rx_header);
 /*
  * Account for our pad inserted between the header
- * and the actual start of the frame.
+ * and the actual start of the frame. This includes
+ * the unused num_buffers when using a legacy device.
  */
-len += VTNET_RX_HEADER_PAD;
+len += adjsz - sc->vtnet_hdr_size;
 } else {
 mhdr = mtod(m, struct virtio_net_hdr_mrg_rxbuf *);
 nbufs = mhdr->num_buffers;

___
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: r362183 - in head/sys/dev: netmap virtio/network

2020-06-14 Thread Vincenzo Maffione
Author: vmaffione
Date: Sun Jun 14 20:47:31 2020
New Revision: 362183
URL: https://svnweb.freebsd.org/changeset/base/362183

Log:
  netmap: vtnet: fix races in vtnet_netmap_reg()
  
  The nm_register callback needs to call nm_set_native_flags()
  or nm_clear_native_flags() once the device has been stopped.
  However, in the current implementation this is not true,
  as the device is stopped by vtnet_init_locked(). This causes
  race conditions where the driver crashes as soon as it
  dequeues netmap buffers assuming they are mbufs (or the other
  way around).
  To fix the issue, we extend vtnet_init_locked() with a second
  argument that, if not zero, will set/clear the netmap flags.
  This results in a huge simplification of the nm_register
  callback itself.
  Also, use netmap_reset() to check if a ring is going to be
  re-initialized in netmap mode.
  
  MFC after:1 week

Modified:
  head/sys/dev/netmap/if_vtnet_netmap.h
  head/sys/dev/virtio/network/if_vtnet.c
  head/sys/dev/virtio/network/if_vtnetvar.h

Modified: head/sys/dev/netmap/if_vtnet_netmap.h
==
--- head/sys/dev/netmap/if_vtnet_netmap.h   Sun Jun 14 19:41:24 2020
(r362182)
+++ head/sys/dev/netmap/if_vtnet_netmap.h   Sun Jun 14 20:47:31 2020
(r362183)
@@ -39,52 +39,18 @@ vtnet_netmap_reg(struct netmap_adapter *na, int state)
 {
struct ifnet *ifp = na->ifp;
struct vtnet_softc *sc = ifp->if_softc;
-   int success;
-   int i;
 
-   /* Drain the taskqueues to make sure that there are no worker threads
-* accessing the virtqueues. */
-   vtnet_drain_taskqueues(sc);
-
+   /*
+* Trigger a device reinit, asking vtnet_init_locked() to
+* also enter or exit netmap mode.
+*/
VTNET_CORE_LOCK(sc);
-
-   /* We need nm_netmap_on() to return true when called by
-* vtnet_init_locked() below. */
-   if (state)
-   nm_set_native_flags(na);
-
-   /* We need to trigger a device reset in order to unexpose guest buffers
-* published to the host. */
-   ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
-   /* Get pending used buffers. The way they are freed depends on whether
-* they are netmap buffer or they are mbufs. We can tell apart the two
-* cases by looking at kring->nr_mode, before this is possibly updated
-* in the loop below. */
-   for (i = 0; i < sc->vtnet_act_vq_pairs; i++) {
-   struct vtnet_txq *txq = >vtnet_txqs[i];
-   struct vtnet_rxq *rxq = >vtnet_rxqs[i];
-
-   VTNET_TXQ_LOCK(txq);
-   vtnet_txq_free_mbufs(txq);
-   VTNET_TXQ_UNLOCK(txq);
-
-   VTNET_RXQ_LOCK(rxq);
-   vtnet_rxq_free_mbufs(rxq);
-   VTNET_RXQ_UNLOCK(rxq);
-   }
-   vtnet_init_locked(sc);
-   success = (ifp->if_drv_flags & IFF_DRV_RUNNING) ? 0 : ENXIO;
-
-   if (state) {
-   netmap_krings_mode_commit(na, state);
-   } else {
-   nm_clear_native_flags(na);
-   netmap_krings_mode_commit(na, state);
-   }
-
+   ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+   vtnet_init_locked(sc, state ? VTNET_INIT_NETMAP_ENTER
+   : VTNET_INIT_NETMAP_EXIT);
VTNET_CORE_UNLOCK(sc);
 
-   return success;
+   return 0;
 }
 
 
@@ -245,15 +211,13 @@ vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq)
 {
struct netmap_adapter *na = NA(rxq->vtnrx_sc->vtnet_ifp);
struct netmap_kring *kring;
+   struct netmap_slot *slot;
int error;
 
-   if (!nm_native_on(na) || rxq->vtnrx_id >= na->num_rx_rings)
+   slot = netmap_reset(na, NR_RX, rxq->vtnrx_id, 0);
+   if (slot == NULL)
return -1;
-
kring = na->rx_rings[rxq->vtnrx_id];
-   if (!(nm_kring_pending_on(kring) ||
-   kring->nr_pending_mode == NKR_NETMAP_ON))
-   return -1;
 
/* Expose all the RX netmap buffers we can. In case of no indirect
 * buffers, the number of netmap slots in the RX ring matches the

Modified: head/sys/dev/virtio/network/if_vtnet.c
==
--- head/sys/dev/virtio/network/if_vtnet.c  Sun Jun 14 19:41:24 2020
(r362182)
+++ head/sys/dev/virtio/network/if_vtnet.c  Sun Jun 14 20:47:31 2020
(r362183)
@@ -181,7 +181,7 @@ static int  vtnet_init_tx_queues(struct vtnet_softc *);
 static int vtnet_init_rxtx_queues(struct vtnet_softc *);
 static voidvtnet_set_active_vq_pairs(struct vtnet_softc *);
 static int vtnet_reinit(struct vtnet_softc *);
-static voidvtnet_init_locked(struct vtnet_softc *);
+static voidvtnet_init_locked(struct vtnet_softc *, int);
 static voidvtnet_init(void *);
 
 static voidvtnet_free_ctrl_vq(struct vtnet_softc *);
@@ -523,7 +523,7 @@ vtnet_resume(device_t 

Re: svn commit: r361944 - in head/sys/dev/virtio: . network

2020-06-14 Thread Tom Jones
On Mon, Jun 08, 2020 at 09:51:36PM +, Jessica Clarke wrote:
> Author: jrtc27
> Date: Mon Jun  8 21:51:36 2020
> New Revision: 361944
> URL: https://svnweb.freebsd.org/changeset/base/361944
> 
> Log:
>   virtio: Support non-legacy network device and queue
>   
>   The non-legacy interface always defines num_buffers in the header,
>   regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. We
>   also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1
>   during negotiation, as it supports non-legacy transports just fine. This
>   fixes network packet transmission on TinyEMU.
>   
>   Reviewed by:br, brooks (mentor), jhb (mentor)
>   Approved by:br, brooks (mentor), jhb (mentor)
>   Differential Revision:  https://reviews.freebsd.org/D25132
> 
> Modified:
>   head/sys/dev/virtio/network/if_vtnet.c
>   head/sys/dev/virtio/network/if_vtnetvar.h
>   head/sys/dev/virtio/virtio.c
>   head/sys/dev/virtio/virtqueue.c
> 

Hi Jessica,

After updating my current bhyve vm today (on a 12.1 host), networking no longer
works. Reverting this commit seems to resolve the issue. I think vtnet is not
passing enough data up to the ip layer.

If I capture on the tap interface for the vm I see arp requests and arp
replies, however kern.msgbuf is full of: 

<5>arp: short packet received on vtnet0

and netstat does not see any replies to arp requests:

root@freebsd-current:~ # netstat -s -p arp
arp:
11 ARP requests sent
0 ARP requests failed to sent
0 ARP replies sent
0 ARP requests received
0 ARP replies received
0 ARP packets received
24 total packets dropped due to no ARP entry
2 ARP entrys timed out
0 Duplicate IPs seen

If I set up an arp entry manually I can see ICMP echo requests and responses on
the tap interface, but the vm does not see the responses. 

root@freebsd-current:~ # netstat -s -p ip
ip:
7 total packets received
0 bad header checksums
0 with size smaller than minimum
7 with data size < data length
0 with ip length > max ip packet size
0 with header length < data size
0 with data length < header length

The line

7 with data size < data length

makes me think that vtnet is truncating packets. 

markj pointed me at this bug in irc which might also be related:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242

- Tom
___
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: r362182 - head/bin/sh/tests/execution

2020-06-14 Thread Jilles Tjoelker
Author: jilles
Date: Sun Jun 14 19:41:24 2020
New Revision: 362182
URL: https://svnweb.freebsd.org/changeset/base/362182

Log:
  sh/tests: Add tests for SIGINT in non-jobc background commands
  
  If job control is not enabled, background commands shall ignore SIGINT and
  SIGQUIT, and it shall be possible to override that ignore in the same shell.
  
  MFC after:1 week

Added:
  head/bin/sh/tests/execution/bg11.0   (contents, props changed)
  head/bin/sh/tests/execution/bg12.0   (contents, props changed)
Modified:
  head/bin/sh/tests/execution/Makefile

Modified: head/bin/sh/tests/execution/Makefile
==
--- head/bin/sh/tests/execution/MakefileSun Jun 14 18:49:06 2020
(r362181)
+++ head/bin/sh/tests/execution/MakefileSun Jun 14 19:41:24 2020
(r362182)
@@ -17,6 +17,8 @@ ${PACKAGE}FILES+= bg7.0
 ${PACKAGE}FILES+=  bg8.0
 ${PACKAGE}FILES+=  bg9.0
 ${PACKAGE}FILES+=  bg10.0 bg10.0.stdout
+${PACKAGE}FILES+=  bg11.0
+${PACKAGE}FILES+=  bg12.0
 ${PACKAGE}FILES+=  env1.0
 ${PACKAGE}FILES+=  fork1.0
 ${PACKAGE}FILES+=  fork2.0

Added: head/bin/sh/tests/execution/bg11.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/execution/bg11.0  Sun Jun 14 19:41:24 2020
(r362182)
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.`
+trap 'rm -rf $T' 0
+cd $T || exit 3
+mkfifo fifo1
+# Use a trap, not the default action, since the shell may catch SIGINT and
+# therefore its processing may be delayed.
+{ trap 'exit 5' TERM; read dummy fifo1
+kill -INT "$!"
+kill -TERM "$!"
+exec 3>&-
+wait "$!"
+r=$?
+[ "$r" = 5 ]

Added: head/bin/sh/tests/execution/bg12.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/execution/bg12.0  Sun Jun 14 19:41:24 2020
(r362182)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.`
+trap 'rm -rf $T' 0
+cd $T || exit 3
+mkfifo fifo1
+{ trap - INT; : >fifo1; sleep 5; exit 4; } &
+: https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362181 - in stable/11: contrib/apr contrib/apr-util contrib/apr-util/buckets contrib/apr-util/crypto contrib/apr-util/dbd contrib/apr-util/dbd/unsupported contrib/apr-util/dbm/sdbm con...

2020-06-14 Thread Dimitry Andric
Author: dim
Date: Sun Jun 14 18:49:06 2020
New Revision: 362181
URL: https://svnweb.freebsd.org/changeset/base/362181

Log:
  Update Subversion and dependencies to 1.14.0 LTS.
  
  MFC r323365 (by jonathan):
  
  Remove redundant source and object files.
  
  Reviewed by:  bdrewery, ngie
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D12208
  
  MFC r327739 (by asomers):
  
  Add Pull Request to the Subversion commit template
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D13178
  
  MFC r54 (by peter):
  
  Update svn-1.9.7 to 1.10.0.
  
  MFC r55 (by peter):
  
  Update svn/svnlite from 1.9.7 to 1.10.0
  
  MFC r87 (by peter):
  
  Update svn_private_config.h - I misread an autoconf change.
  SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL -> SVN_LIBSVN_RA_LINKS_RA_LOCAL
  SVN_LIBSVN_CLIENT_LINKS_RA_SERF -> SVN_LIBSVN_RA_LINKS_RA_SERF
  SVN_LIBSVN_CLIENT_LINKS_RA_SVN -> SVN_LIBSVN_RA_LINKS_RA_SVN
  
  MFC r339256 (by jhb):
  
  Update Apache Serf to 1.3.9 to support OpenSSL 1.1.1.
  
  Approved by:  re (rgrimes)
  
  MFC r352156 (by imp):
  
  Remove directory empty after r266735
  
  MFC r357299 (by cem):
  
  contrib/apr: Remove scope leak UB
  
  In apr_vformatter, the variable buf was declared inside a limited scope
  region, but a pointer to it is leaked outside of that region and used
  later.  This is undefined behavior.  Fix by moving the buf variable to
  function scope.
  
  Reported by:  Coverity
  CID:  1192541
  
  MFC r357301 (by cem):
  
  contrib/apr: Rip out bogus [CS]PRNG implementation
  
  This construction used some relatively slow design involving SHA2; even if
  it were fed real entropy (unclear; external to the design), it did not
  handle fork in a safe way, and it was difficult to audit for correctness.
  So just rip it out and use the very simple and known-correct arc4random(3)
  interface in its place.
  
  MFC r361677:
  
  Change Makefiles under usr.bin/svn to make them easier to incrementally
  update. No functional change intended.
  
  MFC r361678:
  
  Update apr to 1.7.0. See contrib/apr/CHANGES for a summary of changes.
  
  MFC r361681:
  
  Change more Makefiles under usr.bin/svn to make them easier to
  incrementally update. No functional change intended.
  
  MFC r361684 (by kevans):
  
  apr: build some needed emulated 64-bit atomic bits after r361678
  
  This should fix the build on armv{6,7}, mips, and mips64, which all need
  emulated 64-bit atomics for apr.
  
  MFC r361691:
  
  Follow-up r361678 (update apr to 1.7.0) by also regenerating the apr
  internal headers through the upstream configure script, with some minor
  custom tweaks.
  
  MFC r361692:
  
  Update apr-util to 1.6.1. See contrib/apr-util/CHANGES for a summary of
  changes.
  
  MFC r361693:
  
  Update Subversion to 1.14.0 LTS. See contrib/subversion/CHANGES for a
  summary of changes, or for a more thorough overview:
  
  https://subversion.apache.org/docs/release-notes/1.14
  
  NOTE: there is no need to dump and reload repositories, and the working
  copy format is still the same as Subversion 1.8 through 1.13.
  
  Relnotes: yes

Added:
  stable/11/contrib/apr-util/CMakeLists.txt
 - copied unchanged from r361692, head/contrib/apr-util/CMakeLists.txt
  stable/11/contrib/apr-util/README.FREETDS
 - copied unchanged from r361692, head/contrib/apr-util/README.FREETDS
  stable/11/contrib/apr-util/README.cmake
 - copied unchanged from r361692, head/contrib/apr-util/README.cmake
  stable/11/contrib/apr-util/crypto/apr_crypto_commoncrypto.c
 - copied unchanged from r361692, 
head/contrib/apr-util/crypto/apr_crypto_commoncrypto.c
  stable/11/contrib/apr-util/crypto/apr_siphash.c
 - copied unchanged from r361692, head/contrib/apr-util/crypto/apr_siphash.c
  stable/11/contrib/apr-util/dbd/unsupported/
 - copied from r361692, head/contrib/apr-util/dbd/unsupported/
  stable/11/contrib/apr-util/include/apr_ldap.hwc
 - copied unchanged from r361692, head/contrib/apr-util/include/apr_ldap.hwc
  stable/11/contrib/apr-util/include/apr_redis.h
 - copied unchanged from r361692, head/contrib/apr-util/include/apr_redis.h
  stable/11/contrib/apr-util/include/apr_siphash.h
 - copied unchanged from r361692, 
head/contrib/apr-util/include/apr_siphash.h
  stable/11/contrib/apr-util/include/apu.hwc
 - copied unchanged from r361692, head/contrib/apr-util/include/apu.hwc
  stable/11/contrib/apr-util/redis/
 - copied from r361692, head/contrib/apr-util/redis/
  stable/11/contrib/apr-util/test/testredis.c
 - copied unchanged from r361692, head/contrib/apr-util/test/testredis.c
  stable/11/contrib/apr-util/test/testsiphash.c
 - copied unchanged from r361692, head/contrib/apr-util/test/testsiphash.c
  stable/11/contrib/apr/atomic/unix/builtins64.c
 - copied unchanged from r361678, head/contrib/apr/atomic/unix/builtins64.c
  stable/11/contrib/apr/atomic/unix/mutex64.c
 - 

Re: svn commit: r362170 - in head/cddl/contrib/opensolaris/cmd: dtrace lockstat zdb zfs zpool zstreamdump

2020-06-14 Thread Warner Losh
On Sun, Jun 14, 2020, 8:57 AM Rodney W. Grimes 
wrote:

> > Author: gbe (doc committer)
> > Date: Sun Jun 14 05:50:28 2020
> > New Revision: 362170
> > URL: https://svnweb.freebsd.org/changeset/base/362170
> >
> > Log:
> >   Add HISTORY sections to ZFS and dtrace manpage
> >
> >   Reviewed by:bcr (mentor)
> >   Approved by:bcr (mentor)
> >   MFC after:  7 days
> >   Differential Revision:  https://reviews.freebsd.org/D23833
> >
> > Modified:
> >   head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
> >   head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
> >   head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
> >   head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
> >   head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
> >   head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1
>
> Is this really the correct history?  Didnt all of these first
> appear in Solaris?
>
> The man page may of first appeared in FreeBSD, but the commands
> themselves originated some place else?
>


They did first appear in FreeBSD as indicated (as far as I could tell).
They originated in Solaris as well and could have that indicated as well.
Other places in the tree note both where appropriate, but sometimes fall
short noting only the first FreeBSD release they appeared in.

Warner

>
> > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
> >
> ==
> > --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14
> 05:35:02 2020(r362169)
> > +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14
> 05:50:28 2020(r362170)
> > @@ -20,7 +20,7 @@
> >  .\"
> >  .\" $FreeBSD$
> >  .\"
> > -.Dd October 30, 2018
> > +.Dd February 25, 2020
> >  .Dt DTRACE 1
> >  .Os
> >  .Sh NAME
> > @@ -776,6 +776,11 @@ failed or that the specified request could not be
> sati
> >  .It 2
> >  Invalid command line options or arguments were specified.
> >  .El
> > +.Sh HISTORY
> > +The
> > +.Nm
> > +utility first appeared in
> > +.Fx 7.1 .
> >  .Sh SEE ALSO
> >  .Xr cpp 1 ,
> >  .Xr elf 5 ,
> >
> > Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
> >
> ==
> > --- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14
> 05:35:02 2020(r362169)
> > +++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14
> 05:50:28 2020(r362170)
> > @@ -21,7 +21,7 @@
> >  .\"
> >  .\" $FreeBSD$
> >  .\"
> > -.Dd September 29, 2015
> > +.Dd February 25, 2020
> >  .Dt LOCKSTAT 1
> >  .Os
> >  .Sh NAME
> > @@ -366,6 +366,11 @@ Count indv cuml rcnt nsec Lock
>  C
> >  .Xr dtrace 1 ,
> >  .Xr ksyms 4 ,
> >  .Xr locking 9
> > +.Sh HISTORY
> > +The
> > +.Nm
> > +utility first appeared in
> > +.Fx 7.1 .
> >  .Sh NOTES
> >  Tail-call elimination can affect call sites.
> >  For example, if
> >
> > Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
> >
> ==
> > --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8   Sun Jun 14
> 05:35:02 2020(r362169)
> > +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8   Sun Jun 14
> 05:50:28 2020(r362170)
> > @@ -13,7 +13,7 @@
> >  .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
> >  .\" Copyright 2017 Nexenta Systems, Inc.
> >  .\"
> > -.Dd October 06, 2017
> > +.Dd February 25, 2020
> >  .Dt ZDB 8
> >  .Os
> >  .Sh NAME
> > @@ -407,3 +407,8 @@ dedup = 1.11, compress = 1.80, copies = 1.00, dedup
> *
> >  .Sh SEE ALSO
> >  .Xr zfs 8 ,
> >  .Xr zpool 8
> > +.Sh HISTORY
> > +The
> > +.Nm
> > +utility first appeared in
> > +.Fx 7.0 .
> >
> > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
> >
> ==
> > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8   Sun Jun 14
> 05:35:02 2020(r362169)
> > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8   Sun Jun 14
> 05:50:28 2020(r362170)
> > @@ -3949,6 +3949,11 @@ M   F   /tank/test/modified
> >  .Xr umount 8 ,
> >  .Xr zfs-program 8 ,
> >  .Xr zpool 8
> > +.Sh HISTORY
> > +The
> > +.Nm
> > +utility first appeared in
> > +.Fx 7.0 .
> >  .Sh AUTHORS
> >  This manual page is a
> >  .Xr mdoc 7
> >
> > Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
> >
> ==
> > --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8   Sun Jun 14
> 05:35:02 2020(r362169)
> > +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8   Sun Jun 14
> 05:50:28 2020(r362170)
> > @@ -29,7 +29,7 @@
> >  .\"
> >  .\" $FreeBSD$
> >  .\"
> > -.Dd November 7, 2019
> > +.Dd February 25, 2020
> >  .Dt ZPOOL 8
> >  .Os
> >  .Sh NAME
> > @@ -2462,6 +2462,11 @@ Discarded approximately 29 seconds of
> transactions.
> >  .Xr zpool-features 7 ,
> >  .Xr zfs 8 ,
> >  .Xr zfsd 8
> > 

svn commit: r362180 - in stable/12: contrib/apr contrib/apr-util contrib/apr-util/buckets contrib/apr-util/crypto contrib/apr-util/dbd contrib/apr-util/dbd/unsupported contrib/apr-util/dbm/sdbm con...

2020-06-14 Thread Dimitry Andric
Author: dim
Date: Sun Jun 14 17:36:43 2020
New Revision: 362180
URL: https://svnweb.freebsd.org/changeset/base/362180

Log:
  Update Subversion and dependencies to 1.14.0 LTS.
  
  MFC r344438 (by emaste):
  
  svn: support building with WITH_PIE
  
  Subversion builds and links against its own .a archives using local
  rules, so did not benefit from with the WITH_PIE library support added
  in r344179.  Apply the same _pie suffix locally.
  
  Reviewed by:  cem
  Differential Revision:https://reviews.freebsd.org/D19246
  
  MFC r352156 (by imp):
  
  Remove directory empty after r266735
  
  MFC r357299 (by cem):
  
  contrib/apr: Remove scope leak UB
  
  In apr_vformatter, the variable buf was declared inside a limited scope
  region, but a pointer to it is leaked outside of that region and used
  later.  This is undefined behavior.  Fix by moving the buf variable to
  function scope.
  
  Reported by:  Coverity
  CID:  1192541
  
  MFC r357301 (by cem):
  
  contrib/apr: Rip out bogus [CS]PRNG implementation
  
  This construction used some relatively slow design involving SHA2; even if
  it were fed real entropy (unclear; external to the design), it did not
  handle fork in a safe way, and it was difficult to audit for correctness.
  So just rip it out and use the very simple and known-correct arc4random(3)
  interface in its place.
  
  MFC r361677:
  
  Change Makefiles under usr.bin/svn to make them easier to incrementally
  update. No functional change intended.
  
  MFC r361678:
  
  Update apr to 1.7.0. See contrib/apr/CHANGES for a summary of changes.
  
  MFC r361681:
  
  Change more Makefiles under usr.bin/svn to make them easier to
  incrementally update. No functional change intended.
  
  MFC r361684 (by kevans):
  
  apr: build some needed emulated 64-bit atomic bits after r361678
  
  This should fix the build on armv{6,7}, mips, and mips64, which all need
  emulated 64-bit atomics for apr.
  
  MFC r361691:
  
  Follow-up r361678 (update apr to 1.7.0) by also regenerating the apr
  internal headers through the upstream configure script, with some minor
  custom tweaks.
  
  MFC r361692:
  
  Update apr-util to 1.6.1. See contrib/apr-util/CHANGES for a summary of
  changes.
  
  MFC r361693:
  
  Update Subversion to 1.14.0 LTS. See contrib/subversion/CHANGES for a
  summary of changes, or for a more thorough overview:
  
  https://subversion.apache.org/docs/release-notes/1.14
  
  NOTE: there is no need to dump and reload repositories, and the working
  copy format is still the same as Subversion 1.8 through 1.13.
  
  Relnotes: yes

Added:
  stable/12/contrib/apr-util/CMakeLists.txt
 - copied unchanged from r361692, head/contrib/apr-util/CMakeLists.txt
  stable/12/contrib/apr-util/README.FREETDS
 - copied unchanged from r361692, head/contrib/apr-util/README.FREETDS
  stable/12/contrib/apr-util/README.cmake
 - copied unchanged from r361692, head/contrib/apr-util/README.cmake
  stable/12/contrib/apr-util/crypto/apr_crypto_commoncrypto.c
 - copied unchanged from r361692, 
head/contrib/apr-util/crypto/apr_crypto_commoncrypto.c
  stable/12/contrib/apr-util/crypto/apr_siphash.c
 - copied unchanged from r361692, head/contrib/apr-util/crypto/apr_siphash.c
  stable/12/contrib/apr-util/dbd/unsupported/
 - copied from r361692, head/contrib/apr-util/dbd/unsupported/
  stable/12/contrib/apr-util/include/apr_ldap.hwc
 - copied unchanged from r361692, head/contrib/apr-util/include/apr_ldap.hwc
  stable/12/contrib/apr-util/include/apr_redis.h
 - copied unchanged from r361692, head/contrib/apr-util/include/apr_redis.h
  stable/12/contrib/apr-util/include/apr_siphash.h
 - copied unchanged from r361692, 
head/contrib/apr-util/include/apr_siphash.h
  stable/12/contrib/apr-util/include/apu.hwc
 - copied unchanged from r361692, head/contrib/apr-util/include/apu.hwc
  stable/12/contrib/apr-util/redis/
 - copied from r361692, head/contrib/apr-util/redis/
  stable/12/contrib/apr-util/test/testredis.c
 - copied unchanged from r361692, head/contrib/apr-util/test/testredis.c
  stable/12/contrib/apr-util/test/testsiphash.c
 - copied unchanged from r361692, head/contrib/apr-util/test/testsiphash.c
  stable/12/contrib/apr/atomic/unix/builtins64.c
 - copied unchanged from r361678, head/contrib/apr/atomic/unix/builtins64.c
  stable/12/contrib/apr/atomic/unix/mutex64.c
 - copied unchanged from r361678, head/contrib/apr/atomic/unix/mutex64.c
  stable/12/contrib/apr/encoding/apr_encode.c
 - copied unchanged from r361678, head/contrib/apr/encoding/apr_encode.c
  stable/12/contrib/apr/include/apr_cstr.h
 - copied unchanged from r361678, head/contrib/apr/include/apr_cstr.h
  stable/12/contrib/apr/include/apr_encode.h
 - copied unchanged from r361678, head/contrib/apr/include/apr_encode.h
  stable/12/contrib/apr/include/apr_perms_set.h
 - copied unchanged from r361678, head/contrib/apr/include/apr_perms_set.h
  

svn commit: r362179 - in head/sys/dev: ic scc

2020-06-14 Thread Brandon Bergren
Author: bdragon
Date: Sun Jun 14 16:47:16 2020
New Revision: 362179
URL: https://svnweb.freebsd.org/changeset/base/362179

Log:
  [PowerPC] Fix scc z8530 driver
  
  Parts of the z8530 driver were still using the SUN channel spacing.
  
  This was invalid on PowerMac and QEMU, where the attachment was to escc,
  not escc-legacy. This means the driver has apparently NEVER worked properly
  on Macintosh hardware.
  
  Add documentation for the channel spacing details, and change to using
  driver-specific initialization instead of hardcoded spacing so either
  spacing can be used.
  
  Fixes boot hang in QEMU when using the serial console, and fixes use on
  Xserve serial (and presumably PowerMacs that have a Stealth Serial port
  or similar)
  
  Reviewed by:  jhibbits
  Sponsored by: Tag1 Consulting, Inc.
  Differential Revision:https://reviews.freebsd.org/D24661

Modified:
  head/sys/dev/ic/z8530.h
  head/sys/dev/scc/scc_bfe.h
  head/sys/dev/scc/scc_bfe_macio.c
  head/sys/dev/scc/scc_dev_z8530.c

Modified: head/sys/dev/ic/z8530.h
==
--- head/sys/dev/ic/z8530.h Sun Jun 14 16:05:08 2020(r362178)
+++ head/sys/dev/ic/z8530.h Sun Jun 14 16:47:16 2020(r362179)
@@ -32,15 +32,14 @@
 #define_DEV_IC_Z8530_H_
 
 /*
- * Channel B control:  0
- * Channel B data: 1
- * Channel A control:  2
- * Channel A data: 3
+ * legacy: SUN compatible
+ * escc:   Macintosh
+ * legacy  escc
+ * Channel B control:  0   0
+ * Channel B data: 1   1
+ * Channel A control:  2   16
+ * Channel A data: 3   17
  */
-
-/* The following apply when using a device-scoped bus handle */
-#defineCHAN_A  2
-#defineCHAN_B  0
 
 #defineREG_CTRL0
 #defineREG_DATA1

Modified: head/sys/dev/scc/scc_bfe.h
==
--- head/sys/dev/scc/scc_bfe.h  Sun Jun 14 16:05:08 2020(r362178)
+++ head/sys/dev/scc/scc_bfe.h  Sun Jun 14 16:47:16 2020(r362179)
@@ -114,7 +114,8 @@ struct scc_class {
 
 extern struct scc_class scc_quicc_class;
 extern struct scc_class scc_sab82532_class;
-extern struct scc_class scc_z8530_class;
+extern struct scc_class scc_z8530_escc_class;
+extern struct scc_class scc_z8530_legacy_class;
 
 struct scc_softc {
KOBJ_FIELDS;

Modified: head/sys/dev/scc/scc_bfe_macio.c
==
--- head/sys/dev/scc/scc_bfe_macio.cSun Jun 14 16:05:08 2020
(r362178)
+++ head/sys/dev/scc/scc_bfe_macio.cSun Jun 14 16:47:16 2020
(r362179)
@@ -55,9 +55,10 @@ scc_macio_probe(device_t dev)
 
sc = device_get_softc(dev);
nm = ofw_bus_get_name(dev);
+   /* Attach to modern escc (channel shift 4 bits) */
if (!strcmp(nm, "escc")) {
device_set_desc(dev, "Zilog Z8530 dual channel SCC");
-   sc->sc_class = _z8530_class;
+   sc->sc_class = _z8530_escc_class;
return (scc_bfe_probe(dev, MACIO_REGSHFT, MACIO_RCLK, 0));
}
return (ENXIO);

Modified: head/sys/dev/scc/scc_dev_z8530.c
==
--- head/sys/dev/scc/scc_dev_z8530.cSun Jun 14 16:05:08 2020
(r362178)
+++ head/sys/dev/scc/scc_dev_z8530.cSun Jun 14 16:47:16 2020
(r362179)
@@ -51,6 +51,10 @@ static int z8530_bfe_iclear(struct scc_softc *, struct
 static int z8530_bfe_ipend(struct scc_softc *);
 static int z8530_bfe_probe(struct scc_softc *);
 
+/* Channel B is always at 0 offset. */
+#defineCHAN_A  (-(sc->sc_class->cl_range))
+#defineCHAN_B  0
+
 static kobj_method_t z8530_methods[] = {
KOBJMETHOD(scc_attach,  z8530_bfe_attach),
KOBJMETHOD(scc_iclear,  z8530_bfe_iclear),
@@ -59,14 +63,32 @@ static kobj_method_t z8530_methods[] = {
KOBJMETHOD_END
 };
 
-struct scc_class scc_z8530_class = {
-   "z8530 class",
+/*
+ * escc (macio) spacing.
+ */
+struct scc_class scc_z8530_escc_class = {
+   "z8530 escc class",
z8530_methods,
sizeof(struct scc_softc),
.cl_channels = 2,
.cl_class = SCC_CLASS_Z8530,
.cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
-   .cl_range = CHAN_B - CHAN_A,
+   /* Negative .cl_range signifies this is channel spacing. */
+   .cl_range = (CHAN_B - 16),
+};
+
+/*
+ * SUN compatible channel spacing.
+ */
+struct scc_class scc_z8530_legacy_class = {
+   "z8530 legacy class",
+   z8530_methods,
+   sizeof(struct scc_softc),
+   .cl_channels = 2,
+   .cl_class = SCC_CLASS_Z8530,
+   .cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
+   /* Negative .cl_range signifies this is channel spacing. */
+   .cl_range = 

svn commit: r362178 - head/sys/netinet

2020-06-14 Thread Michael Tuexen
Author: tuexen
Date: Sun Jun 14 16:05:08 2020
New Revision: 362178
URL: https://svnweb.freebsd.org/changeset/base/362178

Log:
  Allocate the mbuf for the signature in the COOKIE or the correct size.
  While there, do also do some cleanups.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Sun Jun 14 15:49:32 2020
(r362177)
+++ head/sys/netinet/sctp_output.c  Sun Jun 14 16:05:08 2020
(r362178)
@@ -3831,8 +3831,6 @@ sctp_add_cookie(struct mbuf *init, int init_offset,
struct mbuf *copy_init, *copy_initack, *m_at, *sig, *mret;
struct sctp_state_cookie *stc;
struct sctp_paramhdr *ph;
-   uint8_t *foo;
-   int sig_offset;
uint16_t cookie_sz;
 
mret = sctp_get_mbuf_for_msg((sizeof(struct sctp_state_cookie) +
@@ -3896,24 +3894,20 @@ sctp_add_cookie(struct mbuf *init, int init_offset,
break;
}
}
-   sig = sctp_get_mbuf_for_msg(SCTP_SECRET_SIZE, 0, M_NOWAIT, 1, MT_DATA);
+   sig = sctp_get_mbuf_for_msg(SCTP_SIGNATURE_SIZE, 0, M_NOWAIT, 1, 
MT_DATA);
if (sig == NULL) {
/* no space, so free the entire chain */
sctp_m_freem(mret);
return (NULL);
}
-   SCTP_BUF_LEN(sig) = 0;
SCTP_BUF_NEXT(m_at) = sig;
-   sig_offset = 0;
-   foo = (uint8_t *)(mtod(sig, caddr_t)+sig_offset);
-   memset(foo, 0, SCTP_SIGNATURE_SIZE);
-   *signature = foo;
-   SCTP_BUF_LEN(sig) += SCTP_SIGNATURE_SIZE;
+   SCTP_BUF_LEN(sig) = SCTP_SIGNATURE_SIZE;
cookie_sz += SCTP_SIGNATURE_SIZE;
ph->param_length = htons(cookie_sz);
+   *signature = (uint8_t *)mtod(sig, caddr_t);
+   memset(*signature, 0, SCTP_SIGNATURE_SIZE);
return (mret);
 }
-
 
 static uint8_t
 sctp_get_ect(struct sctp_tcb *stcb)
___
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: r362170 - in head/cddl/contrib/opensolaris/cmd: dtrace lockstat zdb zfs zpool zstreamdump

2020-06-14 Thread Rodney W. Grimes
> Author: gbe (doc committer)
> Date: Sun Jun 14 05:50:28 2020
> New Revision: 362170
> URL: https://svnweb.freebsd.org/changeset/base/362170
> 
> Log:
>   Add HISTORY sections to ZFS and dtrace manpage
>   
>   Reviewed by:bcr (mentor)
>   Approved by:bcr (mentor)
>   MFC after:  7 days
>   Differential Revision:  https://reviews.freebsd.org/D23833
> 
> Modified:
>   head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
>   head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
>   head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
>   head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
>   head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
>   head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1

Is this really the correct history?  Didnt all of these first
appear in Solaris?

The man page may of first appeared in FreeBSD, but the commands
themselves originated some place else?

> 
> Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
> ==
> --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14 05:35:02 
> 2020(r362169)
> +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14 05:50:28 
> 2020(r362170)
> @@ -20,7 +20,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd October 30, 2018
> +.Dd February 25, 2020
>  .Dt DTRACE 1
>  .Os
>  .Sh NAME
> @@ -776,6 +776,11 @@ failed or that the specified request could not be sati
>  .It 2
>  Invalid command line options or arguments were specified.
>  .El
> +.Sh HISTORY
> +The
> +.Nm 
> +utility first appeared in
> +.Fx 7.1 .
>  .Sh SEE ALSO
>  .Xr cpp 1 ,
>  .Xr elf 5 ,
> 
> Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
> ==
> --- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14 
> 05:35:02 2020(r362169)
> +++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14 
> 05:50:28 2020(r362170)
> @@ -21,7 +21,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd September 29, 2015
> +.Dd February 25, 2020
>  .Dt LOCKSTAT 1
>  .Os
>  .Sh NAME
> @@ -366,6 +366,11 @@ Count indv cuml rcnt nsec Lock   C
>  .Xr dtrace 1 ,
>  .Xr ksyms 4 ,
>  .Xr locking 9
> +.Sh HISTORY
> +The
> +.Nm
> +utility first appeared in
> +.Fx 7.1 .
>  .Sh NOTES
>  Tail-call elimination can affect call sites.
>  For example, if
> 
> Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
> ==
> --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8   Sun Jun 14 05:35:02 
> 2020(r362169)
> +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8   Sun Jun 14 05:50:28 
> 2020(r362170)
> @@ -13,7 +13,7 @@
>  .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
>  .\" Copyright 2017 Nexenta Systems, Inc.
>  .\"
> -.Dd October 06, 2017
> +.Dd February 25, 2020
>  .Dt ZDB 8
>  .Os
>  .Sh NAME
> @@ -407,3 +407,8 @@ dedup = 1.11, compress = 1.80, copies = 1.00, dedup * 
>  .Sh SEE ALSO
>  .Xr zfs 8 ,
>  .Xr zpool 8
> +.Sh HISTORY
> +The
> +.Nm
> +utility first appeared in
> +.Fx 7.0 .
> 
> Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
> ==
> --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8   Sun Jun 14 05:35:02 
> 2020(r362169)
> +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8   Sun Jun 14 05:50:28 
> 2020(r362170)
> @@ -3949,6 +3949,11 @@ M   F   /tank/test/modified
>  .Xr umount 8 ,
>  .Xr zfs-program 8 ,
>  .Xr zpool 8
> +.Sh HISTORY
> +The
> +.Nm
> +utility first appeared in
> +.Fx 7.0 .
>  .Sh AUTHORS
>  This manual page is a
>  .Xr mdoc 7
> 
> Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
> ==
> --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8   Sun Jun 14 05:35:02 
> 2020(r362169)
> +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8   Sun Jun 14 05:50:28 
> 2020(r362170)
> @@ -29,7 +29,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd November 7, 2019
> +.Dd February 25, 2020
>  .Dt ZPOOL 8
>  .Os
>  .Sh NAME
> @@ -2462,6 +2462,11 @@ Discarded approximately 29 seconds of transactions.
>  .Xr zpool-features 7 ,
>  .Xr zfs 8 ,
>  .Xr zfsd 8
> +.Sh HISTORY
> +The
> +.Nm
> +utility first appeared in
> +.Fx 7.0 .
>  .Sh AUTHORS
>  This manual page is a
>  .Xr mdoc 7
> 
> Modified: head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1
> ==
> --- head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1   Sun Jun 
> 14 05:35:02 2020(r362169)
> +++ head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1   Sun Jun 
> 14 05:50:28 2020(r362170)
> @@ -22,7 +22,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd December 31, 2013
> +.Dd 

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

2020-06-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Jun 14 14:38:40 2020
New Revision: 362176
URL: https://svnweb.freebsd.org/changeset/base/362176

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

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

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cSun Jun 14 11:41:57 2020
(r362175)
+++ head/sys/compat/linux/linux_socket.cSun Jun 14 14:38:40 2020
(r362176)
@@ -1042,8 +1042,12 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
cmsg->cmsg_level =
linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level);
if (cmsg->cmsg_type == -1
-   || cmsg->cmsg_level != SOL_SOCKET)
+   || cmsg->cmsg_level != SOL_SOCKET) {
+   linux_msg(curthread,
+   "unsupported sendmsg cmsg level %d type %d",
+   linux_cmsg.cmsg_level, 
linux_cmsg.cmsg_type);
goto bad;
+   }
 
/*
 * Some applications (e.g. pulseaudio) attempt to
@@ -1228,6 +1232,9 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
bsd_to_linux_sockopt_level(cm->cmsg_level);
if (linux_cmsg->cmsg_type == -1 ||
cm->cmsg_level != SOL_SOCKET) {
+   linux_msg(curthread,
+   "unsupported recvmsg cmsg level %d type %d",
+   cm->cmsg_level, cm->cmsg_type);
error = EINVAL;
goto 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"


svn commit: r362175 - head/sys/fs/nfs

2020-06-14 Thread Doug Rabson
Author: dfr
Date: Sun Jun 14 11:41:57 2020
New Revision: 362175
URL: https://svnweb.freebsd.org/changeset/base/362175

Log:
  Add support for the timecreate attribute
  
  This maps to the va_birthtime VFS attribute.

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cSun Jun 14 10:13:40 2020
(r362174)
+++ head/sys/fs/nfs/nfs_commonsubs.cSun Jun 14 11:41:57 2020
(r362175)
@@ -2922,6 +2922,11 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount
txdr_nfsv4time(>va_mtime, tl);
retnum += NFSX_V4TIME;
break;
+   case NFSATTRBIT_TIMECREATE:
+   NFSM_BUILD(tl, u_int32_t *, NFSX_V4TIME);
+   txdr_nfsv4time(>va_birthtime, tl);
+   retnum += NFSX_V4TIME;
+   break;
case NFSATTRBIT_TIMEMODIFYSET:
if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
___
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: r362174 - head/stand/efi/loader

2020-06-14 Thread Toomas Soome
Author: tsoome
Date: Sun Jun 14 10:13:40 2020
New Revision: 362174
URL: https://svnweb.freebsd.org/changeset/base/362174

Log:
  loader.efi: update console after gfx mode change
  
  The gfx mode change should be coordinated with console setup.

Modified:
  head/stand/efi/loader/framebuffer.c

Modified: head/stand/efi/loader/framebuffer.c
==
--- head/stand/efi/loader/framebuffer.c Sun Jun 14 09:50:00 2020
(r362173)
+++ head/stand/efi/loader/framebuffer.c Sun Jun 14 10:13:40 2020
(r362174)
@@ -586,6 +586,7 @@ gop_autoresize(EFI_GRAPHICS_OUTPUT *gop)
mode, EFI_ERROR_CODE(status));
return (CMD_ERROR);
}
+   (void) efi_cons_update_mode();
}
return (CMD_OK);
 }
@@ -610,6 +611,7 @@ text_autoresize()
}
if (max_dim > 0)
conout->SetMode(conout, best_mode);
+   (void) efi_cons_update_mode();
return (CMD_OK);
 }
 
@@ -697,6 +699,7 @@ command_gop(int argc, char *argv[])
argv[0], mode, EFI_ERROR_CODE(status));
return (CMD_ERROR);
}
+   (void) efi_cons_update_mode();
} else if (!strcmp(argv[1], "get")) {
if (argc != 2)
goto usage;
___
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: r362173 - head/sys/netinet

2020-06-14 Thread Michael Tuexen
Author: tuexen
Date: Sun Jun 14 09:50:00 2020
New Revision: 362173
URL: https://svnweb.freebsd.org/changeset/base/362173

Log:
  Cleanups, no functional change.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_ss_functions.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Sun Jun 14 06:58:58 2020
(r362172)
+++ head/sys/netinet/sctp_indata.c  Sun Jun 14 09:50:00 2020
(r362173)
@@ -66,7 +66,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co
 struct sctp_stream_in *strm,
 struct sctp_tcb *stcb,
 struct sctp_association *asoc,
-struct sctp_tmit_chunk *chk, int lock_held);
+struct sctp_tmit_chunk *chk, int hold_rlock);
 
 
 void

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Sun Jun 14 06:58:58 2020
(r362172)
+++ head/sys/netinet/sctp_output.c  Sun Jun 14 09:50:00 2020
(r362173)
@@ -5118,7 +5118,6 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_
}
}
return (op_err);
-   break;
}
default:
/*

Modified: head/sys/netinet/sctp_ss_functions.c
==
--- head/sys/netinet/sctp_ss_functions.cSun Jun 14 06:58:58 2020
(r362172)
+++ head/sys/netinet/sctp_ss_functions.cSun Jun 14 09:50:00 2020
(r362173)
@@ -767,8 +767,8 @@ sctp_ss_fb_scheduled(struct sctp_tcb *stcb, struct sct
  */
 static void
 sctp_ss_fcfs_add(struct sctp_tcb *stcb, struct sctp_association *asoc,
-struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp,
-int holds_lock);
+struct sctp_stream_out *strq SCTP_UNUSED,
+struct sctp_stream_queue_pending *sp, int holds_lock);
 
 static void
 sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_association *asoc,

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Sun Jun 14 06:58:58 2020(r362172)
+++ head/sys/netinet/sctputil.c Sun Jun 14 09:50:00 2020(r362173)
@@ -5230,10 +5230,6 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct soc
if (((struct sockaddr_in *)addr)->sin_addr.s_addr ==
laddr->ifa->address.sin.sin_addr.s_addr) {
/* found him. */
-   if (holds_lock == 0) {
-   SCTP_INP_RUNLOCK(inp);
-   }
-   return (laddr->ifa);
break;
}
}
@@ -5243,10 +5239,6 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct soc
if (SCTP6_ARE_ADDR_EQUAL((struct sockaddr_in6 *)addr,
>ifa->address.sin6)) {
/* found him. */
-   if (holds_lock == 0) {
-   SCTP_INP_RUNLOCK(inp);
-   }
-   return (laddr->ifa);
break;
}
}
@@ -5255,7 +5247,7 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct soc
if (holds_lock == 0) {
SCTP_INP_RUNLOCK(inp);
}
-   return (NULL);
+   return (laddr->ifa);
 }
 
 uint32_t
@@ -5332,9 +5324,6 @@ sctp_find_ifa_by_addr(struct sockaddr *addr, uint32_t 
if (((struct sockaddr_in *)addr)->sin_addr.s_addr ==
sctp_ifap->address.sin.sin_addr.s_addr) {
/* found him. */
-   if (holds_lock == 0)
-   SCTP_IPI_ADDR_RUNLOCK();
-   return (sctp_ifap);
break;
}
}
@@ -5344,9 +5333,6 @@ sctp_find_ifa_by_addr(struct sockaddr *addr, uint32_t 
if (SCTP6_ARE_ADDR_EQUAL((struct sockaddr_in6 *)addr,
_ifap->address.sin6)) {
/* found him. */
-   if (holds_lock == 0)
-   SCTP_IPI_ADDR_RUNLOCK();
-   return (sctp_ifap);
break;
}
}
@@ -5354,7 +5340,7 @@ sctp_find_ifa_by_addr(struct sockaddr *addr, uint32_t 
}

Website and Mobile App Development

2020-06-14 Thread HW Infotech
We have ✅ 500+ clone ScriptHi,
I am Waseem From HW Infotech.
 
Please share your phone number or Skype id, Whatsapp if you are
looking to develop a clone of any website.
Work in the following area :
✅ Clone Script for any Website and Mobile APP -Development and
Digital Marketing for App, Web, Software Clone Scripts
✅Readymade Script for useful product -Shop Website Templates, Clone
Scripts, & Marketplace Software | HW Infotech
✅Software Requirement Specification Documentation
✅A wireframe design for Website, ERP, Product  app
✅PHP Framework & MYSQL, HTML5, CSS3, JavaScript, jQuery, XML, JSON.
✅eCommerce, WordPress,Magento,Open Cart, Joomla, Magento 2,
Prestashop
✅Mobile APP- Android, IOS, Phone Gap and Flutter
✅SEO, SMO, and PPC
✅Install and config the project
✅Plugin: Customize and create a new plugin
✅Migrate & Upgrade: sustainable development and long-term
✅WHM Panel server configuration
✅Server Optimization
✅Website and Server Penetration testing
✅Load Balancing and Failover clustering Server
✅Mail Server configuration for bulk emailing
Contact us - Hire A Developer | Web and App Development Services | HW
Infotech
Regards
Waseem
www.hwinfotech.com  Gurugram | California |London|Vancouver|Abuja |
Melbourne
http://app.hwinfotech.net/index.php/lists/dd296hm0jzd67/unsubscribe/kg077r6gsc60e/ok072mq8cc88f
___
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: r362172 - in head: share/vt/fonts sys/dev/vt sys/dev/vt/font sys/sys tools/build tools/tools/vt/mkkfont usr.bin/vtfontcvt usr.sbin/vidcontrol

2020-06-14 Thread Toomas Soome
Author: tsoome
Date: Sun Jun 14 06:58:58 2020
New Revision: 362172
URL: https://svnweb.freebsd.org/changeset/base/362172

Log:
  Move font related data structured to sys/font.c and update vtfontcvt
  
  Prepare support to be able to handle font data in loader, consolidate
  data structures to sys/font.h and update vtfontcvt.
  
  vtfontcvt update is about to output set of glyphs in form of C source,
  the implementation does allow to output compressed or uncompressed font
  bitmaps.
  
  Reviewed by:  bcr
  Differential Revision:https://reviews.freebsd.org/D24189

Added:
  head/sys/sys/font.h   (contents, props changed)
Modified:
  head/share/vt/fonts/Makefile
  head/sys/dev/vt/font/vt_font_default.c
  head/sys/dev/vt/vt.h
  head/sys/dev/vt/vt_font.c
  head/sys/sys/consio.h
  head/tools/build/Makefile
  head/tools/tools/vt/mkkfont/mkkfont.c
  head/usr.bin/vtfontcvt/Makefile
  head/usr.bin/vtfontcvt/vtfontcvt.8
  head/usr.bin/vtfontcvt/vtfontcvt.c
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/share/vt/fonts/Makefile
==
--- head/share/vt/fonts/MakefileSun Jun 14 05:59:30 2020
(r362171)
+++ head/share/vt/fonts/MakefileSun Jun 14 06:58:58 2020
(r362172)
@@ -15,7 +15,7 @@ CLEANFILES+=  ${FONTS}
 
 .SUFFIXES: .bdf .fnt .fnt.uu .hex
 .bdf.fnt .hex.fnt:
-   vtfontcvt ${.IMPSRC} ${.TARGET}
+   vtfontcvt -o ${.TARGET} ${.IMPSRC}
 
 FILESDIR=  ${SHAREDIR}/vt/fonts
 

Modified: head/sys/dev/vt/font/vt_font_default.c
==
--- head/sys/dev/vt/font/vt_font_default.c  Sun Jun 14 05:59:30 2020
(r362171)
+++ head/sys/dev/vt/font/vt_font_default.c  Sun Jun 14 06:58:58 2020
(r362172)
@@ -3006,7 +3006,7 @@ static uint8_t font_bytes[2224 * 16] = {
0x0c, 0x06, 0x03, 0x01,
 };
 
-static struct vt_font_map font_mapping_normal[308] = {
+static vfnt_map_t font_mapping_normal[308] = {
{ 0x0020, 0x0001, 0x5e }, { 0x00a0, 0x0001, 0x00 },
{ 0x00a1, 0x0060, 0x6e }, { 0x0110, 0x008f, 0x00 },
{ 0x0111, 0x00cf, 0x08 }, { 0x011a, 0x00d2, 0x01 },
@@ -3163,7 +3163,7 @@ static struct vt_font_map font_mapping_normal[308] = {
{ 0xe0b0, 0x0478, 0x03 }, { 0xf6be, 0x0148, 0x00 },
 };
 
-static struct vt_font_map font_mapping_bold[319] = {
+static vfnt_map_t font_mapping_bold[319] = {
{ 0x0021, 0x047c, 0x0b }, { 0x002d, 0x0220, 0x00 },
{ 0x002e, 0x0488, 0x50 }, { 0x00a1, 0x04d9, 0x07 },
{ 0x00aa, 0x04e1, 0x03 }, { 0x00af, 0x04e5, 0x07 },

Modified: head/sys/dev/vt/vt.h
==
--- head/sys/dev/vt/vt.hSun Jun 14 05:59:30 2020(r362171)
+++ head/sys/dev/vt/vt.hSun Jun 14 06:58:58 2020(r362172)
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "opt_syscons.h"
 #include "opt_splash.h"
@@ -399,30 +400,6 @@ void vt_upgrade(struct vt_device *vd);
 
 /* name argument is not used yet. */
 #define VT_DRIVER_DECLARE(name, drv) DATA_SET(vt_drv_set, drv)
-
-/*
- * Fonts.
- *
- * Remapping tables are used to map Unicode points to glyphs.  They need
- * to be sorted, because vtfont_lookup() performs a binary search.  Each
- * font has two remapping tables, for normal and bold.  When a character
- * is not present in bold, it uses a normal glyph.  When no glyph is
- * available, it uses glyph 0, which is normally equal to U+FFFD.
- */
-
-struct vt_font_map {
-   uint32_t vfm_src;
-   uint16_t vfm_dst;
-   uint16_t vfm_len;
-};
-
-struct vt_font {
-   struct vt_font_map  *vf_map[VFNT_MAPS];
-   uint8_t *vf_bytes;
-   unsigned int vf_height, vf_width;
-   unsigned int vf_map_count[VFNT_MAPS];
-   unsigned int vf_refcount;
-};
 
 #ifndef SC_NO_CUTPASTE
 struct vt_mouse_cursor {

Modified: head/sys/dev/vt/vt_font.c
==
--- head/sys/dev/vt/vt_font.c   Sun Jun 14 05:59:30 2020(r362171)
+++ head/sys/dev/vt/vt_font.c   Sun Jun 14 06:58:58 2020(r362172)
@@ -49,7 +49,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font");
 #defineVTFONT_MAXDIMENSION 128
 
 static uint16_t
-vtfont_bisearch(const struct vt_font_map *map, unsigned int len, uint32_t src)
+vtfont_bisearch(const vfnt_map_t *map, unsigned int len, uint32_t src)
 {
int min, mid, max;
 
@@ -137,7 +137,7 @@ vtfont_unref(struct vt_font *vf)
 }
 
 static int
-vtfont_validate_map(struct vt_font_map *vfm, unsigned int length,
+vtfont_validate_map(vfnt_map_t *vfm, unsigned int length,
 unsigned int glyph_count)
 {
unsigned int i, last = 0;
@@ -198,7 +198,7 @@ vtfont_load(vfnt_t *f, struct vt_font **ret)
vf->vf_map_count[i] =