svn commit: r326682 - stable/11/sys/netipsec

2017-12-08 Thread Andrey V. Elsukov
Author: ae
Date: Fri Dec  8 08:16:36 2017
New Revision: 326682
URL: https://svnweb.freebsd.org/changeset/base/326682

Log:
  MFC r326422:
Do better cleaning in key_destroy() for VIMAGE case.
  
SPDB was cleaned using TAILQ_CONCAT() instead of calling key_unlink()
for each SP, thus we need to properly clean lists in each bucket of
V_sphashtbl to avoid panic in hashdestroy() when INVARIANTS is enabled.
  
Do the same for V_acqaddrhashtbl and V_acqseqhashtbl.
  
When we are called in DEFAULT_VNET, destroy also all global locks and
drain key_timer callout.
  
Reported by:kp
Tested by:  kp

Modified:
  stable/11/sys/netipsec/key.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netipsec/key.c
==
--- stable/11/sys/netipsec/key.cFri Dec  8 05:57:18 2017
(r326681)
+++ stable/11/sys/netipsec/key.cFri Dec  8 08:16:36 2017
(r326682)
@@ -8145,7 +8145,10 @@ key_destroy(void)
TAILQ_CONCAT(&drainq, &V_sptree[i], chain);
TAILQ_CONCAT(&drainq, &V_sptree_ifnet[i], chain);
}
+   for (i = 0; i < V_sphash_mask + 1; i++)
+   LIST_INIT(&V_sphashtbl[i]);
SPTREE_WUNLOCK();
+
sp = TAILQ_FIRST(&drainq);
while (sp != NULL) {
nextsp = TAILQ_NEXT(sp, chain);
@@ -8196,6 +8199,10 @@ key_destroy(void)
free(acq, M_IPSEC_SAQ);
acq = nextacq;
}
+   for (i = 0; i < V_acqaddrhash_mask + 1; i++)
+   LIST_INIT(&V_acqaddrhashtbl[i]);
+   for (i = 0; i < V_acqseqhash_mask + 1; i++)
+   LIST_INIT(&V_acqseqhashtbl[i]);
ACQ_UNLOCK();
 
SPACQ_LOCK();
@@ -8211,6 +8218,18 @@ key_destroy(void)
hashdestroy(V_acqaddrhashtbl, M_IPSEC_SAQ, V_acqaddrhash_mask);
hashdestroy(V_acqseqhashtbl, M_IPSEC_SAQ, V_acqseqhash_mask);
uma_zdestroy(V_key_lft_zone);
+
+   if (!IS_DEFAULT_VNET(curvnet))
+   return;
+#ifndef IPSEC_DEBUG2
+   callout_drain(&key_timer);
+#endif
+   XFORMS_LOCK_DESTROY();
+   SPTREE_LOCK_DESTROY();
+   REGTREE_LOCK_DESTROY();
+   SAHTREE_LOCK_DESTROY();
+   ACQ_LOCK_DESTROY();
+   SPACQ_LOCK_DESTROY();
 }
 #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: r326683 - head/sys/dev/uart

2017-12-08 Thread Andrew Turner
Author: andrew
Date: Fri Dec  8 10:05:23 2017
New Revision: 326683
URL: https://svnweb.freebsd.org/changeset/base/326683

Log:
  Set the io width when using an ACPI uart. Previously it would only ever be
  set when finding the uart from the device tree.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/dev/uart/uart_cpu_arm64.c

Modified: head/sys/dev/uart/uart_cpu_arm64.c
==
--- head/sys/dev/uart/uart_cpu_arm64.c  Fri Dec  8 08:16:36 2017
(r326682)
+++ head/sys/dev/uart/uart_cpu_arm64.c  Fri Dec  8 10:05:23 2017
(r326683)
@@ -100,7 +100,8 @@ uart_cpu_acpi_scan(uint8_t interface_type)
 
 static int
 uart_cpu_acpi_probe(struct uart_class **classp, bus_space_tag_t *bst,
-bus_space_handle_t *bsh, int *baud, u_int *rclk, u_int *shiftp)
+bus_space_handle_t *bsh, int *baud, u_int *rclk, u_int *shiftp,
+u_int *iowidthp)
 {
struct acpi_uart_compat_data *cd;
ACPI_TABLE_SPCR *spcr;
@@ -142,6 +143,7 @@ uart_cpu_acpi_probe(struct uart_class **classp, bus_sp
*classp = cd->clas;
*rclk = 0;
*shiftp = 2;
+   *iowidthp = spcr->SerialPort.BitWidth / 8;
 
 out:
acpi_unmap_table(spcr);
@@ -169,7 +171,8 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
 
err = ENXIO;
 #ifdef DEV_ACPI
-   err = uart_cpu_acpi_probe(&class, &bst, &bsh, &br, &rclk, &shift);
+   err = uart_cpu_acpi_probe(&class, &bst, &bsh, &br, &rclk, &shift,
+   &iowidth);
 #endif
 #ifdef FDT
if (err != 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: r326684 - stable/11/sys/kern

2017-12-08 Thread Konstantin Belousov
Author: kib
Date: Fri Dec  8 10:31:02 2017
New Revision: 326684
URL: https://svnweb.freebsd.org/changeset/base/326684

Log:
  MFC r326429:
  Destroy seltd st_mtx and st_wait in seltdfini().

Modified:
  stable/11/sys/kern/sys_generic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/sys_generic.c
==
--- stable/11/sys/kern/sys_generic.cFri Dec  8 10:05:23 2017
(r326683)
+++ stable/11/sys/kern/sys_generic.cFri Dec  8 10:31:02 2017
(r326684)
@@ -1902,6 +1902,8 @@ seltdfini(struct thread *td)
if (stp->st_free2)
uma_zfree(selfd_zone, stp->st_free2);
td->td_sel = NULL;
+   cv_destroy(&stp->st_wait);
+   mtx_destroy(&stp->st_mtx);
free(stp, M_SELECT);
 }
 
___
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: r326685 - stable/11/usr.bin/man

2017-12-08 Thread Baptiste Daroussin
Author: bapt
Date: Fri Dec  8 10:42:05 2017
New Revision: 326685
URL: https://svnweb.freebsd.org/changeset/base/326685

Log:
  MFC r326526:
  
  In case man(1) found a catpage to display skip looking ".so" which is manpage
  only.
  
  In case we are trying to read a catpage, the manpage variable is not defined.
  It results in the "cattool" having no arguments.
  
  In case the catpage is compressed, the cattool used is "zcat" which dies if 
the
  standard input is a terminal, meaning the function calling it is exiting as if
  there were no ".so"
  In case the catpage is uncompressed, the cattool used is "zcat -f" which waits
  reading standard input, making the man(1) command hang.
  
  PR:   223560
  Reported by:  wosch

Modified:
  stable/11/usr.bin/man/man.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/man/man.sh
==
--- stable/11/usr.bin/man/man.shFri Dec  8 10:31:02 2017
(r326684)
+++ stable/11/usr.bin/man/man.shFri Dec  8 10:42:05 2017
(r326685)
@@ -274,6 +274,9 @@ man_check_for_so() {
local IFS line tstr
 
unset IFS
+   if [ -n "$catpage" ]; then
+   return 0
+   fi
 
# We need to loop to accommodate multiple .so directives.
while true
___
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: r326686 - stable/10/usr.bin/man

2017-12-08 Thread Baptiste Daroussin
Author: bapt
Date: Fri Dec  8 10:44:44 2017
New Revision: 326686
URL: https://svnweb.freebsd.org/changeset/base/326686

Log:
  MFC r326526:
  
  In case man(1) found a catpage to display skip looking ".so" which is manpage
  only.
  
  In case we are trying to read a catpage, the manpage variable is not defined.
  It results in the "cattool" having no arguments.
  
  In case the catpage is compressed, the cattool used is "zcat" which dies if 
the
  standard input is a terminal, meaning the function calling it is exiting as if
  there were no ".so"
  In case the catpage is uncompressed, the cattool used is "zcat -f" which waits
  reading standard input, making the man(1) command hang.
  
  PR:   223560
  Reported by:  wosch

Modified:
  stable/10/usr.bin/man/man.sh
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/man/man.sh
==
--- stable/10/usr.bin/man/man.shFri Dec  8 10:42:05 2017
(r326685)
+++ stable/10/usr.bin/man/man.shFri Dec  8 10:44:44 2017
(r326686)
@@ -255,6 +255,9 @@ man_check_for_so() {
local IFS line tstr
 
unset IFS
+   if [ -n "$catpage" ]; then
+   return 0
+   fi
 
# We need to loop to accommodate multiple .so directives.
while true
___
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: r326688 - stable/10/usr.bin/man

2017-12-08 Thread Baptiste Daroussin
Author: bapt
Date: Fri Dec  8 10:47:29 2017
New Revision: 326688
URL: https://svnweb.freebsd.org/changeset/base/326688

Log:
  MFC r326527:
  
  Only skip looking for manpages if both man directory and cat directory
  are not existing.
  
  This allows man(1) to read catpages when no man directories are available at 
all
  
  PR:   223559
  Reported by:  wosch

Modified:
  stable/10/usr.bin/man/man.sh
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/man/man.sh
==
--- stable/10/usr.bin/man/man.shFri Dec  8 10:47:24 2017
(r326687)
+++ stable/10/usr.bin/man/man.shFri Dec  8 10:47:29 2017
(r326688)
@@ -176,7 +176,7 @@ find_file() {
catroot="$catroot/$3"
fi
 
-   if [ ! -d "$manroot" ]; then
+   if [ ! -d "$manroot" -a ! -d "$catroot" ]; then
return 1
fi
decho "  Searching directory $manroot" 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: r326687 - stable/11/usr.bin/man

2017-12-08 Thread Baptiste Daroussin
Author: bapt
Date: Fri Dec  8 10:47:24 2017
New Revision: 326687
URL: https://svnweb.freebsd.org/changeset/base/326687

Log:
  MFC r326527:
  
  Only skip looking for manpages if both man directory and cat directory
  are not existing.
  
  This allows man(1) to read catpages when no man directories are available at 
all
  
  PR:   223559
  Reported by:  wosch

Modified:
  stable/11/usr.bin/man/man.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/man/man.sh
==
--- stable/11/usr.bin/man/man.shFri Dec  8 10:44:44 2017
(r326686)
+++ stable/11/usr.bin/man/man.shFri Dec  8 10:47:24 2017
(r326687)
@@ -199,7 +199,7 @@ find_file() {
catroot="$catroot/$3"
fi
 
-   if [ ! -d "$manroot" ]; then
+   if [ ! -d "$manroot" -a ! -d "$catroot" ]; then
return 1
fi
decho "  Searching directory $manroot" 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: r326690 - stable/10/share/misc

2017-12-08 Thread Baptiste Daroussin
Author: bapt
Date: Fri Dec  8 10:50:13 2017
New Revision: 326690
URL: https://svnweb.freebsd.org/changeset/base/326690

Log:
  MFC r326633:
  
  Update to 2017-12-06

Modified:
  stable/10/share/misc/pci_vendors
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/misc/pci_vendors
==
--- stable/10/share/misc/pci_vendorsFri Dec  8 10:49:53 2017
(r326689)
+++ stable/10/share/misc/pci_vendorsFri Dec  8 10:50:13 2017
(r326690)
@@ -3,8 +3,8 @@
 #
 #  List of PCI ID's
 #
-#  Version: 2017.10.21
-#  Date:2017-10-21 03:15:01
+#  Version: 2017.12.06
+#  Date:2017-12-06 03:15:02
 #
 #  Maintained by Albert Pool, Martin Mares, and other volunteers from
 #  the PCI ID Project at http://pci-ids.ucw.cz/.
@@ -751,6 +751,7 @@
131b  Kaveri [Radeon R4 Graphics]
131c  Kaveri [Radeon R7 Graphics]
131d  Kaveri [Radeon R6 Graphics]
+   15dd  Radeon Vega 8 Mobile
1714  BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series]
103c 168b  ProBook 4535s
3150  RV380/M24 [Mobility Radeon X600]
@@ -1629,6 +1630,7 @@
6623  Mars
6631  Oland
6640  Saturn XT [FirePro M6100]
+   106b 014b  Tropo XT [Radeon R9 M380 Mac Edition]
6641  Saturn PRO [Radeon HD 8930M]
6646  Bonaire XT [Radeon R9 M280X]
6647  Bonaire PRO [Radeon R9 M270X]
@@ -2370,7 +2372,8 @@
6828  Cape Verde PRO [FirePro W600]
6829  Cape Verde
682a  Venus PRO
-   682b  Venus LE [Radeon HD 8830M]
+   682b  Venus LE / Tropo PRO-L [Radeon HD 8830M / R7 M465X]
+   0128 079c  Radeon R7 465X
682c  Cape Verde GL [FirePro W4100]
682d  Chelsea XT GL [FirePro M4000]
682f  Chelsea LP [Radeon HD 7730M]
@@ -2504,6 +2507,7 @@
144d c0c7  Radeon HD 7550M
6842  Thames LE [Radeon HD 7000M Series]
6843  Thames [Radeon HD 7670M]
+   6861  Vega 10 XT [Radeon PRO WX 9100]
6863  Vega 10 XTX [Radeon Vega Frontier Edition]
687f  Vega 10 XT [Radeon RX Vega 64]
6888  Cypress XT [FirePro V8800]
@@ -4037,6 +4041,7 @@
141f  Family 15h (Models 30h-3fh) Processor Function 5
1422  Family 15h (Models 30h-3fh) Processor Root Complex
1423  Family 15h (Models 30h-3fh) I/O Memory Management Unit
+   1424  Family 15h (Models 30h-3fh) Processor Root Port
1426  Family 15h (Models 30h-3fh) Processor Root Port
1436  Liverpool Processor Root Complex
1437  Liverpool I/O Memory Management Unit
@@ -4045,6 +4050,7 @@
1450  Family 17h (Models 00h-0fh) Root Complex
1451  Family 17h (Models 00h-0fh) I/O Memory Management Unit
1452  Family 17h (Models 00h-0fh) PCIe Dummy Host Bridge
+   1453  Family 17h (Models 00h-0fh) PCIe GPP Bridge
1454  Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B
1456  Family 17h (Models 00h-0fh) Platform Security Processor
1457  Family 17h (Models 00h-0fh) HD Audio Controller
@@ -5217,6 +5223,7 @@
3020  Samurai_IDE
 1043  ASUSTeK Computer Inc.
0464  Radeon R9 270x GPU
+   0521  RX580 [RX 580 Dual O8G]
0675  ISDNLink P-IN100-ST-D
0675 1704  ISDN Adapter (PCI Bus, D, C)
0675 1707  ISDN Adapter (PCI Bus, DV, W)
@@ -6176,6 +6183,7 @@
103c 12dd  4Gb Fibre Channel [AB429A]
2432  ISP2432-based 4Gb Fibre Channel to PCI Express HBA
103c 7040  FC1142SR 4Gb 1-port PCIe Fibre Channel Host Bus 
Adapter [HPAE311A]
+   1077 0137  QLE2460 4 GB PCI-X Host-Bus-Adapter
2532  ISP2532-based 8Gb Fibre Channel to PCI Express HBA
1014 041e  FC EN0Y/EN12 PCIe2 LP 8 Gb 4-port Fibre Channel 
Adapter for POWER
103c 3262  StorageWorks 81Q
@@ -6227,6 +6235,10 @@
1077 000b  25GE 2P QL41262HxCU-DE Adapter
1077 0011  FastLinQ QL41212H 25GbE Adapter
1077 0012  FastLinQ QL41112H 10GbE Adapter
+   1590 021d  10/25GbE 2P QL41222HLCU-HP Adapter
+   1590 021e  10/25GbE 2P QL41162HMRJ-HP Adapter
+   1590 021f  10/25GbE 2P QL41262HMCU-HP Adapter
+   1590 0220  10/25GbE 2P QL41122HLRJ-HP Adapter
8080  FastLinQ QL41000 Series 10/25/40/50GbE Controller (FCoE)
1077 0001  10GE 2P QL41162HxRJ-DE Adapter
1077 0002  10GE 2P QL41112HxCU-DE Adapter
@@ -6247,6 +6259,8 @@
1077 000e  FastLinQ QL41162H 10GbE iSCSI Adapter (SR-IOV VF)
1077 0011  FastLinQ QL41212H 25GbE Adapter (SR-IOV VF)
1077 0012  FastLinQ QL41112H 10GbE Adapter (SR-IOV VF)
+   1590 021e  10/25GbE 2P QL41162HMRJ-HP Adapter
+   1590 021f  10/25GbE 2P QL41262HMCU-HP Adapter
8430  ISP8324 1/10GbE Converge

svn commit: r326689 - stable/11/share/misc

2017-12-08 Thread Baptiste Daroussin
Author: bapt
Date: Fri Dec  8 10:49:53 2017
New Revision: 326689
URL: https://svnweb.freebsd.org/changeset/base/326689

Log:
  MFC r326633:
  
  Update to 2017-12-06

Modified:
  stable/11/share/misc/pci_vendors
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/pci_vendors
==
--- stable/11/share/misc/pci_vendorsFri Dec  8 10:47:29 2017
(r326688)
+++ stable/11/share/misc/pci_vendorsFri Dec  8 10:49:53 2017
(r326689)
@@ -3,8 +3,8 @@
 #
 #  List of PCI ID's
 #
-#  Version: 2017.10.21
-#  Date:2017-10-21 03:15:01
+#  Version: 2017.12.06
+#  Date:2017-12-06 03:15:02
 #
 #  Maintained by Albert Pool, Martin Mares, and other volunteers from
 #  the PCI ID Project at http://pci-ids.ucw.cz/.
@@ -751,6 +751,7 @@
131b  Kaveri [Radeon R4 Graphics]
131c  Kaveri [Radeon R7 Graphics]
131d  Kaveri [Radeon R6 Graphics]
+   15dd  Radeon Vega 8 Mobile
1714  BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series]
103c 168b  ProBook 4535s
3150  RV380/M24 [Mobility Radeon X600]
@@ -1629,6 +1630,7 @@
6623  Mars
6631  Oland
6640  Saturn XT [FirePro M6100]
+   106b 014b  Tropo XT [Radeon R9 M380 Mac Edition]
6641  Saturn PRO [Radeon HD 8930M]
6646  Bonaire XT [Radeon R9 M280X]
6647  Bonaire PRO [Radeon R9 M270X]
@@ -2370,7 +2372,8 @@
6828  Cape Verde PRO [FirePro W600]
6829  Cape Verde
682a  Venus PRO
-   682b  Venus LE [Radeon HD 8830M]
+   682b  Venus LE / Tropo PRO-L [Radeon HD 8830M / R7 M465X]
+   0128 079c  Radeon R7 465X
682c  Cape Verde GL [FirePro W4100]
682d  Chelsea XT GL [FirePro M4000]
682f  Chelsea LP [Radeon HD 7730M]
@@ -2504,6 +2507,7 @@
144d c0c7  Radeon HD 7550M
6842  Thames LE [Radeon HD 7000M Series]
6843  Thames [Radeon HD 7670M]
+   6861  Vega 10 XT [Radeon PRO WX 9100]
6863  Vega 10 XTX [Radeon Vega Frontier Edition]
687f  Vega 10 XT [Radeon RX Vega 64]
6888  Cypress XT [FirePro V8800]
@@ -4037,6 +4041,7 @@
141f  Family 15h (Models 30h-3fh) Processor Function 5
1422  Family 15h (Models 30h-3fh) Processor Root Complex
1423  Family 15h (Models 30h-3fh) I/O Memory Management Unit
+   1424  Family 15h (Models 30h-3fh) Processor Root Port
1426  Family 15h (Models 30h-3fh) Processor Root Port
1436  Liverpool Processor Root Complex
1437  Liverpool I/O Memory Management Unit
@@ -4045,6 +4050,7 @@
1450  Family 17h (Models 00h-0fh) Root Complex
1451  Family 17h (Models 00h-0fh) I/O Memory Management Unit
1452  Family 17h (Models 00h-0fh) PCIe Dummy Host Bridge
+   1453  Family 17h (Models 00h-0fh) PCIe GPP Bridge
1454  Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B
1456  Family 17h (Models 00h-0fh) Platform Security Processor
1457  Family 17h (Models 00h-0fh) HD Audio Controller
@@ -5217,6 +5223,7 @@
3020  Samurai_IDE
 1043  ASUSTeK Computer Inc.
0464  Radeon R9 270x GPU
+   0521  RX580 [RX 580 Dual O8G]
0675  ISDNLink P-IN100-ST-D
0675 1704  ISDN Adapter (PCI Bus, D, C)
0675 1707  ISDN Adapter (PCI Bus, DV, W)
@@ -6176,6 +6183,7 @@
103c 12dd  4Gb Fibre Channel [AB429A]
2432  ISP2432-based 4Gb Fibre Channel to PCI Express HBA
103c 7040  FC1142SR 4Gb 1-port PCIe Fibre Channel Host Bus 
Adapter [HPAE311A]
+   1077 0137  QLE2460 4 GB PCI-X Host-Bus-Adapter
2532  ISP2532-based 8Gb Fibre Channel to PCI Express HBA
1014 041e  FC EN0Y/EN12 PCIe2 LP 8 Gb 4-port Fibre Channel 
Adapter for POWER
103c 3262  StorageWorks 81Q
@@ -6227,6 +6235,10 @@
1077 000b  25GE 2P QL41262HxCU-DE Adapter
1077 0011  FastLinQ QL41212H 25GbE Adapter
1077 0012  FastLinQ QL41112H 10GbE Adapter
+   1590 021d  10/25GbE 2P QL41222HLCU-HP Adapter
+   1590 021e  10/25GbE 2P QL41162HMRJ-HP Adapter
+   1590 021f  10/25GbE 2P QL41262HMCU-HP Adapter
+   1590 0220  10/25GbE 2P QL41122HLRJ-HP Adapter
8080  FastLinQ QL41000 Series 10/25/40/50GbE Controller (FCoE)
1077 0001  10GE 2P QL41162HxRJ-DE Adapter
1077 0002  10GE 2P QL41112HxCU-DE Adapter
@@ -6247,6 +6259,8 @@
1077 000e  FastLinQ QL41162H 10GbE iSCSI Adapter (SR-IOV VF)
1077 0011  FastLinQ QL41212H 25GbE Adapter (SR-IOV VF)
1077 0012  FastLinQ QL41112H 10GbE Adapter (SR-IOV VF)
+   1590 021e  10/25GbE 2P QL41162HMRJ-HP Adapter
+   1590 021f  10/25GbE 2P QL41262HMCU-HP Adapter
8430  ISP8324 1/10GbE Converge

svn commit: r326691 - in stable/11: share/man/man4 sys/net

2017-12-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Dec  8 15:23:17 2017
New Revision: 326691
URL: https://svnweb.freebsd.org/changeset/base/326691

Log:
  MFC r326362:
  Disallow TUN and TAP character device IOCTLs to modify the network device
  type to any value. This can cause page faults and panics due to accessing
  uninitialized fields in the "struct ifnet" which are specific to the network
  device type.
  
  Found by: j...@iki.fi
  PR:   223767
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/share/man/man4/tap.4
  stable/11/share/man/man4/tun.4
  stable/11/sys/net/if_tap.c
  stable/11/sys/net/if_tun.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/tap.4
==
--- stable/11/share/man/man4/tap.4  Fri Dec  8 10:50:13 2017
(r326690)
+++ stable/11/share/man/man4/tap.4  Fri Dec  8 15:23:17 2017
(r326691)
@@ -1,7 +1,7 @@
 .\" $FreeBSD$
 .\" Based on PR#2411
 .\"
-.Dd April 10, 2015
+.Dd November 29, 2017
 .Dt TAP 4
 .Os
 .Sh NAME
@@ -171,7 +171,14 @@ calls are supported
 .In net/if_tap.h ) :
 .Bl -tag -width VMIO_SIOCSETMACADDR
 .It Dv TAPSIFINFO
-Set network interface information (line speed, MTU and type).
+Set network interface information (line speed and MTU).
+The type must be the same as returned by
+.Dv TAPGIFINFO
+or set to
+.Dv IFT_ETHER
+else the
+.Xr ioctl 2
+call will fail.
 The argument should be a pointer to a
 .Va struct tapinfo .
 .It Dv TAPGIFINFO

Modified: stable/11/share/man/man4/tun.4
==
--- stable/11/share/man/man4/tun.4  Fri Dec  8 10:50:13 2017
(r326690)
+++ stable/11/share/man/man4/tun.4  Fri Dec  8 15:23:17 2017
(r326691)
@@ -2,7 +2,7 @@
 .\" $FreeBSD$
 .\" Based on PR#2411
 .\"
-.Dd November 30, 2014
+.Dd November 29, 2017
 .Dt TUN 4
 .Os
 .Sh NAME
@@ -208,8 +208,15 @@ this stores the internal debugging variable's value in
 .It Dv TUNSIFINFO
 The argument should be a pointer to an
 .Vt struct tuninfo
-and allows setting the MTU, the type, and the baudrate of the tunnel
+and allows setting the MTU and the baudrate of the tunnel
 device.
+The type must be the same as returned by
+.Dv TUNGIFINFO
+or set to
+.Dv IFT_PPP
+else the
+.Xr ioctl 2
+call will fail.
 The
 .Vt struct tuninfo
 is declared in

Modified: stable/11/sys/net/if_tap.c
==
--- stable/11/sys/net/if_tap.c  Fri Dec  8 10:50:13 2017(r326690)
+++ stable/11/sys/net/if_tap.c  Fri Dec  8 15:23:17 2017(r326691)
@@ -735,9 +735,10 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, i
switch (cmd) {
case TAPSIFINFO:
tapp = (struct tapinfo *)data;
+   if (ifp->if_type != tapp->type)
+   return (EPROTOTYPE);
mtx_lock(&tp->tap_mtx);
ifp->if_mtu = tapp->mtu;
-   ifp->if_type = tapp->type;
ifp->if_baudrate = tapp->baudrate;
mtx_unlock(&tp->tap_mtx);
break;

Modified: stable/11/sys/net/if_tun.c
==
--- stable/11/sys/net/if_tun.c  Fri Dec  8 10:50:13 2017(r326690)
+++ stable/11/sys/net/if_tun.c  Fri Dec  8 15:23:17 2017(r326691)
@@ -676,9 +676,10 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i
if (error)
return (error);
}
+   if (TUN2IFP(tp)->if_type != tunp->type)
+   return (EPROTOTYPE);
mtx_lock(&tp->tun_mtx);
TUN2IFP(tp)->if_mtu = tunp->mtu;
-   TUN2IFP(tp)->if_type = tunp->type;
TUN2IFP(tp)->if_baudrate = tunp->baudrate;
mtx_unlock(&tp->tun_mtx);
break;
___
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: r326692 - in stable/10: share/man/man4 sys/net

2017-12-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Dec  8 15:26:57 2017
New Revision: 326692
URL: https://svnweb.freebsd.org/changeset/base/326692

Log:
  MFC r326362:
  Disallow TUN and TAP character device IOCTLs to modify the network device
  type to any value. This can cause page faults and panics due to accessing
  uninitialized fields in the "struct ifnet" which are specific to the network
  device type.
  
  Found by: j...@iki.fi
  PR:   223767
  Sponsored by: Mellanox Technologies

Modified:
  stable/10/share/man/man4/tap.4
  stable/10/share/man/man4/tun.4
  stable/10/sys/net/if_tap.c
  stable/10/sys/net/if_tun.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/tap.4
==
--- stable/10/share/man/man4/tap.4  Fri Dec  8 15:23:17 2017
(r326691)
+++ stable/10/share/man/man4/tap.4  Fri Dec  8 15:26:57 2017
(r326692)
@@ -1,7 +1,7 @@
 .\" $FreeBSD$
 .\" Based on PR#2411
 .\"
-.Dd November 30, 2014
+.Dd November 29, 2017
 .Dt TAP 4
 .Os
 .Sh NAME
@@ -171,7 +171,14 @@ calls are supported
 .In net/if_tap.h ) :
 .Bl -tag -width VMIO_SIOCSETMACADDR
 .It Dv TAPSIFINFO
-Set network interface information (line speed, MTU and type).
+Set network interface information (line speed and MTU).
+The type must be the same as returned by
+.Dv TAPGIFINFO
+or set to
+.Dv IFT_ETHER
+else the
+.Xr ioctl 2
+call will fail.
 The argument should be a pointer to a
 .Va struct tapinfo .
 .It Dv TAPGIFINFO

Modified: stable/10/share/man/man4/tun.4
==
--- stable/10/share/man/man4/tun.4  Fri Dec  8 15:23:17 2017
(r326691)
+++ stable/10/share/man/man4/tun.4  Fri Dec  8 15:26:57 2017
(r326692)
@@ -2,7 +2,7 @@
 .\" $FreeBSD$
 .\" Based on PR#2411
 .\"
-.Dd November 30, 2014
+.Dd November 29, 2017
 .Dt TUN 4
 .Os
 .Sh NAME
@@ -208,8 +208,15 @@ this stores the internal debugging variable's value in
 .It Dv TUNSIFINFO
 The argument should be a pointer to an
 .Vt struct tuninfo
-and allows setting the MTU, the type, and the baudrate of the tunnel
+and allows setting the MTU and the baudrate of the tunnel
 device.
+The type must be the same as returned by
+.Dv TUNGIFINFO
+or set to
+.Dv IFT_PPP
+else the
+.Xr ioctl 2
+call will fail.
 The
 .Vt struct tuninfo
 is declared in

Modified: stable/10/sys/net/if_tap.c
==
--- stable/10/sys/net/if_tap.c  Fri Dec  8 15:23:17 2017(r326691)
+++ stable/10/sys/net/if_tap.c  Fri Dec  8 15:26:57 2017(r326692)
@@ -736,9 +736,10 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, i
switch (cmd) {
case TAPSIFINFO:
tapp = (struct tapinfo *)data;
+   if (ifp->if_type != tapp->type)
+   return (EPROTOTYPE);
mtx_lock(&tp->tap_mtx);
ifp->if_mtu = tapp->mtu;
-   ifp->if_type = tapp->type;
ifp->if_baudrate = tapp->baudrate;
mtx_unlock(&tp->tap_mtx);
break;

Modified: stable/10/sys/net/if_tun.c
==
--- stable/10/sys/net/if_tun.c  Fri Dec  8 15:23:17 2017(r326691)
+++ stable/10/sys/net/if_tun.c  Fri Dec  8 15:26:57 2017(r326692)
@@ -677,9 +677,10 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i
if (error)
return (error);
}
+   if (TUN2IFP(tp)->if_type != tunp->type)
+   return (EPROTOTYPE);
mtx_lock(&tp->tun_mtx);
TUN2IFP(tp)->if_mtu = tunp->mtu;
-   TUN2IFP(tp)->if_type = tunp->type;
TUN2IFP(tp)->if_baudrate = tunp->baudrate;
mtx_unlock(&tp->tun_mtx);
break;
___
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: r326693 - in stable/9: share/man/man4 sys/net

2017-12-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Dec  8 15:30:59 2017
New Revision: 326693
URL: https://svnweb.freebsd.org/changeset/base/326693

Log:
  MFC r326362:
  Disallow TUN and TAP character device IOCTLs to modify the network device
  type to any value. This can cause page faults and panics due to accessing
  uninitialized fields in the "struct ifnet" which are specific to the network
  device type.
  
  Found by: j...@iki.fi
  PR:   223767
  Sponsored by: Mellanox Technologies

Modified:
  stable/9/share/man/man4/tap.4
  stable/9/share/man/man4/tun.4
  stable/9/sys/net/if_tap.c
  stable/9/sys/net/if_tun.c
Directory Properties:
  stable/9/share/   (props changed)
  stable/9/share/man/   (props changed)
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/net/   (props changed)

Modified: stable/9/share/man/man4/tap.4
==
--- stable/9/share/man/man4/tap.4   Fri Dec  8 15:26:57 2017
(r326692)
+++ stable/9/share/man/man4/tap.4   Fri Dec  8 15:30:59 2017
(r326693)
@@ -1,7 +1,7 @@
 .\" $FreeBSD$
 .\" Based on PR#2411
 .\"
-.Dd November 30, 2014
+.Dd November 29, 2017
 .Dt TAP 4
 .Os
 .Sh NAME
@@ -171,7 +171,14 @@ calls are supported
 .In net/if_tap.h ) :
 .Bl -tag -width VMIO_SIOCSETMACADDR
 .It Dv TAPSIFINFO
-Set network interface information (line speed, MTU and type).
+Set network interface information (line speed and MTU).
+The type must be the same as returned by
+.Dv TAPGIFINFO
+or set to
+.Dv IFT_ETHER
+else the
+.Xr ioctl 2
+call will fail.
 The argument should be a pointer to a
 .Va struct tapinfo .
 .It Dv TAPGIFINFO

Modified: stable/9/share/man/man4/tun.4
==
--- stable/9/share/man/man4/tun.4   Fri Dec  8 15:26:57 2017
(r326692)
+++ stable/9/share/man/man4/tun.4   Fri Dec  8 15:30:59 2017
(r326693)
@@ -2,7 +2,7 @@
 .\" $FreeBSD$
 .\" Based on PR#2411
 .\"
-.Dd November 30, 2014
+.Dd November 29, 2017
 .Dt TUN 4
 .Os
 .Sh NAME
@@ -208,8 +208,15 @@ this stores the internal debugging variable's value in
 .It Dv TUNSIFINFO
 The argument should be a pointer to an
 .Vt struct tuninfo
-and allows setting the MTU, the type, and the baudrate of the tunnel
+and allows setting the MTU and the baudrate of the tunnel
 device.
+The type must be the same as returned by
+.Dv TUNGIFINFO
+or set to
+.Dv IFT_PPP
+else the
+.Xr ioctl 2
+call will fail.
 The
 .Vt struct tuninfo
 is declared in

Modified: stable/9/sys/net/if_tap.c
==
--- stable/9/sys/net/if_tap.c   Fri Dec  8 15:26:57 2017(r326692)
+++ stable/9/sys/net/if_tap.c   Fri Dec  8 15:30:59 2017(r326693)
@@ -731,9 +731,10 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, i
switch (cmd) {
case TAPSIFINFO:
tapp = (struct tapinfo *)data;
+   if (ifp->if_type != tapp->type)
+   return (EPROTOTYPE);
mtx_lock(&tp->tap_mtx);
ifp->if_mtu = tapp->mtu;
-   ifp->if_type = tapp->type;
ifp->if_baudrate = tapp->baudrate;
mtx_unlock(&tp->tap_mtx);
break;

Modified: stable/9/sys/net/if_tun.c
==
--- stable/9/sys/net/if_tun.c   Fri Dec  8 15:26:57 2017(r326692)
+++ stable/9/sys/net/if_tun.c   Fri Dec  8 15:30:59 2017(r326693)
@@ -685,9 +685,10 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i
if (error)
return (error);
}
+   if (TUN2IFP(tp)->if_type != tunp->type)
+   return (EPROTOTYPE);
mtx_lock(&tp->tun_mtx);
TUN2IFP(tp)->if_mtu = tunp->mtu;
-   TUN2IFP(tp)->if_type = tunp->type;
TUN2IFP(tp)->if_baudrate = tunp->baudrate;
mtx_unlock(&tp->tun_mtx);
break;
___
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: r326694 - in stable/8: share/man/man4 sys/net

2017-12-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Dec  8 15:37:36 2017
New Revision: 326694
URL: https://svnweb.freebsd.org/changeset/base/326694

Log:
  MFC r326362:
  Disallow TUN and TAP character device IOCTLs to modify the network device
  type to any value. This can cause page faults and panics due to accessing
  uninitialized fields in the "struct ifnet" which are specific to the network
  device type.
  
  Found by: j...@iki.fi
  PR:   223767
  Sponsored by: Mellanox Technologies

Modified:
  stable/8/share/man/man4/tap.4
  stable/8/share/man/man4/tun.4
  stable/8/sys/net/if_tap.c
  stable/8/sys/net/if_tun.c
Directory Properties:
  stable/8/share/   (props changed)
  stable/8/share/man/   (props changed)
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/net/   (props changed)

Modified: stable/8/share/man/man4/tap.4
==
--- stable/8/share/man/man4/tap.4   Fri Dec  8 15:30:59 2017
(r326693)
+++ stable/8/share/man/man4/tap.4   Fri Dec  8 15:37:36 2017
(r326694)
@@ -1,7 +1,7 @@
 .\" $FreeBSD$
 .\" Based on PR#2411
 .\"
-.Dd September 8, 2008
+.Dd November 29, 2017
 .Dt TAP 4
 .Os
 .Sh NAME
@@ -164,7 +164,14 @@ calls are supported
 .In net/if_tap.h ) :
 .Bl -tag -width VMIO_SIOCSETMACADDR
 .It Dv TAPSIFINFO
-Set network interface information (line speed, MTU and type).
+Set network interface information (line speed and MTU).
+The type must be the same as returned by
+.Dv TAPGIFINFO
+or set to
+.Dv IFT_ETHER
+else the
+.Xr ioctl 2
+call will fail.
 The argument should be a pointer to a
 .Va struct tapinfo .
 .It Dv TAPGIFINFO

Modified: stable/8/share/man/man4/tun.4
==
--- stable/8/share/man/man4/tun.4   Fri Dec  8 15:30:59 2017
(r326693)
+++ stable/8/share/man/man4/tun.4   Fri Dec  8 15:37:36 2017
(r326694)
@@ -2,7 +2,7 @@
 .\" $FreeBSD$
 .\" Based on PR#2411
 .\"
-.Dd February 4, 2007
+.Dd November 29, 2017
 .Dt TUN 4
 .Os
 .Sh NAME
@@ -197,8 +197,15 @@ this stores the internal debugging variable's value in
 .It Dv TUNSIFINFO
 The argument should be a pointer to an
 .Vt struct tuninfo
-and allows setting the MTU, the type, and the baudrate of the tunnel
+and allows setting the MTU and the baudrate of the tunnel
 device.
+The type must be the same as returned by
+.Dv TUNGIFINFO
+or set to
+.Dv IFT_PPP
+else the
+.Xr ioctl 2
+call will fail.
 The
 .Vt struct tuninfo
 is declared in

Modified: stable/8/sys/net/if_tap.c
==
--- stable/8/sys/net/if_tap.c   Fri Dec  8 15:30:59 2017(r326693)
+++ stable/8/sys/net/if_tap.c   Fri Dec  8 15:37:36 2017(r326694)
@@ -717,9 +717,10 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, i
switch (cmd) {
case TAPSIFINFO:
tapp = (struct tapinfo *)data;
+   if (ifp->if_type != tapp->type)
+   return (EPROTOTYPE);
mtx_lock(&tp->tap_mtx);
ifp->if_mtu = tapp->mtu;
-   ifp->if_type = tapp->type;
ifp->if_baudrate = tapp->baudrate;
mtx_unlock(&tp->tap_mtx);
break;

Modified: stable/8/sys/net/if_tun.c
==
--- stable/8/sys/net/if_tun.c   Fri Dec  8 15:30:59 2017(r326693)
+++ stable/8/sys/net/if_tun.c   Fri Dec  8 15:37:36 2017(r326694)
@@ -685,9 +685,10 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i
if (error)
return (error);
}
+   if (TUN2IFP(tp)->if_type != tunp->type)
+   return (EPROTOTYPE);
mtx_lock(&tp->tun_mtx);
TUN2IFP(tp)->if_mtu = tunp->mtu;
-   TUN2IFP(tp)->if_type = tunp->type;
TUN2IFP(tp)->if_baudrate = tunp->baudrate;
mtx_unlock(&tp->tun_mtx);
break;
___
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: r326383 - head/sys/x86/cpufreq

2017-12-08 Thread Alexey Dokuchaev
On Thu, Dec 07, 2017 at 01:26:48PM -0500, Jung-uk Kim wrote:
> On 12/07/2017 05:03, Alexey Dokuchaev wrote:
> > On Thu, Nov 30, 2017 at 03:08:49PM -0500, Jung-uk Kim wrote:
> >> ...
> >> Probably.  However, I am just trying to fix my FX-8350 and A10-6800 and
> >> I don't have Zen processors to verify the MSRs are actually working on
> >> those CPUs.
> > 
> > Ah, that's so lovely, thanks Jung-uk; I feel that our support for AMD
> > fam. 15h CPUs is lacking.  E.g. only four P-states are reported for my
> > A8-5550M, while it supports boosted P-states per BKDG, and reading MSRs
> > directly via `sysutils/amdmsrtweaker' reports eight of them (P0 .. P7),
> > with three turbo P-states P0 P1 P2.
> 
> You don't trust your BIOS? ;-)

Well, I kind of do, with a grain of salt.  BIOSes (or shall I say, their
CPU support packages) are often poorly written or being too conservative,
in order to simplify vendors' job making sure they work across all CPUs.

I also like to undervolt them; I'm doing this now with my Pentium M 780
CPU via patched DSDT.  I hope that I could do the same for A8-5550M, and
with having more P-states than currently provided via stock DSDT for a
more fine-grained control.

> Unless SSDT is unavailable or broken, we should use ACPI tables first.

I know that's correct and recommended procedure; in fact, under Ubuntu,
available frequency steps are: 2.10 GHz, 1.90 GHz, 1.70 GHz, 1.40 GHz;
also just four (with driver: acpi-cpufreq).  I'd have to boot into Win7
to see if it's doing more than that.

./danfe
___
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: r326695 - in head: include include/arpa lib/libc/include/isc lib/libc/inet lib/libc/nameser lib/libc/resolv sys/dev/ath/ath_hal sys/dev/ath/ath_hal/ah_regdomain sys/dev/ath/ath_hal/ar52...

2017-12-08 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec  8 15:57:29 2017
New Revision: 326695
URL: https://svnweb.freebsd.org/changeset/base/326695

Log:
  SPDX: license IDs for some ISC-related files.

Modified:
  head/include/arpa/inet.h
  head/include/arpa/nameser.h
  head/include/ftw.h
  head/include/hesiod.h
  head/include/netdb.h
  head/include/readpassphrase.h
  head/include/res_update.h
  head/include/resolv.h
  head/include/unwind.h
  head/include/wchar.h
  head/lib/libc/include/isc/eventlib.h
  head/lib/libc/include/isc/list.h
  head/lib/libc/include/isc/platform.h
  head/lib/libc/inet/inet_addr.c
  head/lib/libc/inet/inet_cidr_ntop.c
  head/lib/libc/inet/inet_cidr_pton.c
  head/lib/libc/inet/inet_net_ntop.c
  head/lib/libc/inet/inet_net_pton.c
  head/lib/libc/inet/inet_neta.c
  head/lib/libc/inet/inet_ntop.c
  head/lib/libc/inet/inet_pton.c
  head/lib/libc/inet/nsap_addr.c
  head/lib/libc/nameser/ns_name.c
  head/lib/libc/nameser/ns_netint.c
  head/lib/libc/nameser/ns_parse.c
  head/lib/libc/nameser/ns_print.c
  head/lib/libc/nameser/ns_samedomain.c
  head/lib/libc/nameser/ns_ttl.c
  head/lib/libc/resolv/herror.c
  head/lib/libc/resolv/res_comp.c
  head/lib/libc/resolv/res_data.c
  head/lib/libc/resolv/res_debug.c
  head/lib/libc/resolv/res_debug.h
  head/lib/libc/resolv/res_findzonecut.c
  head/lib/libc/resolv/res_init.c
  head/lib/libc/resolv/res_mkquery.c
  head/lib/libc/resolv/res_mkupdate.c
  head/lib/libc/resolv/res_query.c
  head/lib/libc/resolv/res_send.c
  head/lib/libc/resolv/res_update.c
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ah_btcoex.h
  head/sys/dev/ath/ath_hal/ah_debug.h
  head/sys/dev/ath/ath_hal/ah_decode.h
  head/sys/dev/ath/ath_hal/ah_desc.h
  head/sys/dev/ath/ath_hal/ah_devid.h
  head/sys/dev/ath/ath_hal/ah_diagcodes.h
  head/sys/dev/ath/ath_hal/ah_eeprom.h
  head/sys/dev/ath/ath_hal/ah_eeprom_9287.c
  head/sys/dev/ath/ath_hal/ah_eeprom_9287.h
  head/sys/dev/ath/ath_hal/ah_eeprom_v1.c
  head/sys/dev/ath/ath_hal/ah_eeprom_v1.h
  head/sys/dev/ath/ath_hal/ah_eeprom_v14.c
  head/sys/dev/ath/ath_hal/ah_eeprom_v14.h
  head/sys/dev/ath/ath_hal/ah_eeprom_v3.c
  head/sys/dev/ath/ath_hal/ah_eeprom_v3.h
  head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
  head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/ath_hal/ah_regdomain.c
  head/sys/dev/ath/ath_hal/ah_regdomain.h
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_ctry.h
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_freqbands.h
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regmap.h
  head/sys/dev/ath/ath_hal/ah_soc.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_interrupts.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_phy.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210desc.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210phy.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210reg.h
  head/sys/dev/ath/ath_hal/ar5211/ar5211.h
  head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_interrupts.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211desc.h
  head/sys/dev/ath/ath_hal/ar5211/ar5211phy.h
  head/sys/dev/ath/ath_hal/ar5211/ar5211reg.h
  head/sys/dev/ath/ath_hal/ar5212/ar2316.c
  head/sys/dev/ath/ath_hal/ar5212/ar2317.c
  head/sys/dev/ath/ath_hal/ar5212/ar2413.c
  head/sys/dev/ath/ath_hal/ar5212/ar2425.c
  head/sys/dev/ath/ath_hal/ar5212/ar5111.c
  head/sys/dev/ath/ath_hal/ar5212/ar5112.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212.h
  head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_gpio.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_rfg

svn commit: r326696 - stable/11/sys/geom/mirror

2017-12-08 Thread Mark Johnston
Author: markj
Date: Fri Dec  8 16:12:45 2017
New Revision: 326696
URL: https://svnweb.freebsd.org/changeset/base/326696

Log:
  MFC r302794, r306744, r307691, r307692, r316174, r316681, r316859,
  r316866, r316867, r316869:
  Various gmirror fixes and cleanups.

Modified:
  stable/11/sys/geom/mirror/g_mirror.c
  stable/11/sys/geom/mirror/g_mirror.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/geom/mirror/g_mirror.c
==
--- stable/11/sys/geom/mirror/g_mirror.cFri Dec  8 15:57:29 2017
(r326695)
+++ stable/11/sys/geom/mirror/g_mirror.cFri Dec  8 16:12:45 2017
(r326696)
@@ -854,7 +854,7 @@ g_mirror_idle(struct g_mirror_softc *sc, int acw)
LIST_FOREACH(disk, &sc->sc_disks, d_next) {
if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE)
continue;
-   G_MIRROR_DEBUG(1, "Disk %s (device %s) marked as clean.",
+   G_MIRROR_DEBUG(2, "Disk %s (device %s) marked as clean.",
g_mirror_get_diskname(disk), sc->sc_name);
disk->d_flags &= ~G_MIRROR_DISK_FLAG_DIRTY;
g_mirror_update_metadata(disk);
@@ -877,7 +877,7 @@ g_mirror_unidle(struct g_mirror_softc *sc)
LIST_FOREACH(disk, &sc->sc_disks, d_next) {
if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE)
continue;
-   G_MIRROR_DEBUG(1, "Disk %s (device %s) marked as dirty.",
+   G_MIRROR_DEBUG(2, "Disk %s (device %s) marked as dirty.",
g_mirror_get_diskname(disk), sc->sc_name);
disk->d_flags |= G_MIRROR_DISK_FLAG_DIRTY;
g_mirror_update_metadata(disk);
@@ -1182,6 +1182,11 @@ g_mirror_start(struct bio *bp)
return;
}
mtx_lock(&sc->sc_queue_mtx);
+   if (bp->bio_to->error != 0) {
+   mtx_unlock(&sc->sc_queue_mtx);
+   g_io_deliver(bp, bp->bio_to->error);
+   return;
+   }
bioq_insert_tail(&sc->sc_queue, bp);
mtx_unlock(&sc->sc_queue_mtx);
G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc);
@@ -1281,13 +1286,6 @@ g_mirror_regular_release(struct g_mirror_softc *sc)
G_MIRROR_LOGREQ(2, bp, "Releasing delayed request (%p).", bp);
mtx_lock(&sc->sc_queue_mtx);
bioq_insert_head(&sc->sc_queue, bp);
-#if 0
-   /*
-* wakeup() is not needed, because this function is called from
-* the worker thread.
-*/
-   wakeup(&sc->sc_queue);
-#endif
mtx_unlock(&sc->sc_queue_mtx);
}
 }
@@ -1312,6 +1310,24 @@ g_mirror_sync_release(struct g_mirror_softc *sc)
 }
 
 /*
+ * Free a synchronization request and clear its slot in the array.
+ */
+static void
+g_mirror_sync_request_free(struct g_mirror_disk *disk, struct bio *bp)
+{
+   int idx;
+
+   if (disk != NULL && disk->d_sync.ds_bios != NULL) {
+   idx = (int)(uintptr_t)bp->bio_caller1;
+   KASSERT(disk->d_sync.ds_bios[idx] == bp,
+   ("unexpected sync BIO at %p:%d", disk, idx));
+   disk->d_sync.ds_bios[idx] = NULL;
+   }
+   free(bp->bio_data, M_MIRROR);
+   g_destroy_bio(bp);
+}
+
+/*
  * Handle synchronization requests.
  * Every synchronization request is two-steps process: first, READ request is
  * send to active provider and then WRITE request (with read data) to the 
provider
@@ -1323,6 +1339,7 @@ g_mirror_sync_request(struct bio *bp)
 {
struct g_mirror_softc *sc;
struct g_mirror_disk *disk;
+   struct g_mirror_disk_sync *sync;
 
bp->bio_from->index--;
sc = bp->bio_from->geom->softc;
@@ -1332,8 +1349,7 @@ g_mirror_sync_request(struct bio *bp)
g_topology_lock();
g_mirror_kill_consumer(sc, bp->bio_from);
g_topology_unlock();
-   free(bp->bio_data, M_MIRROR);
-   g_destroy_bio(bp);
+   g_mirror_sync_request_free(NULL, bp);
sx_xlock(&sc->sc_lock);
return;
}
@@ -1353,7 +1369,7 @@ g_mirror_sync_request(struct bio *bp)
G_MIRROR_LOGREQ(0, bp,
"Synchronization request failed (error=%d).",
bp->bio_error);
-   g_destroy_bio(bp);
+   g_mirror_sync_request_free(disk, bp);
return;
}
G_MIRROR_LOGREQ(3, bp,
@@ -1370,10 +1386,9 @@ g_mirror_sync_request(struct bio *bp)
}
case BIO_WRITE:
{
-   struct g_mirror_disk_sync *sync;
off_t offset;
void *data;
-   int i;
+   int i, idx;
 
KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_write

svn commit: r326697 - stable/11/sys/cddl/dev/dtrace

2017-12-08 Thread Mark Johnston
Author: markj
Date: Fri Dec  8 16:25:05 2017
New Revision: 326697
URL: https://svnweb.freebsd.org/changeset/base/326697

Log:
  MFC r326286:
  Don't use pcpu_find() to determine if a CPU ID is valid.

Modified:
  stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c
==
--- stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.cFri Dec  8 16:12:45 
2017(r326696)
+++ stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.cFri Dec  8 16:25:05 
2017(r326697)
@@ -236,10 +236,8 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t add
"DTRACEIOC_AGGSNAP":"DTRACEIOC_BUFSNAP",
curcpu, desc.dtbd_cpu);
 
-   if (desc.dtbd_cpu >= NCPU)
+   if (desc.dtbd_cpu >= MAXCPU || CPU_ABSENT(desc.dtbd_cpu))
return (ENOENT);
-   if (pcpu_find(desc.dtbd_cpu) == NULL)
-   return (ENOENT);
 
mutex_enter(&dtrace_lock);
 
@@ -801,11 +799,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t add
nerrs = state->dts_errors;
dstate = &state->dts_vstate.dtvs_dynvars;
 
-   for (i = 0; i < NCPU; i++) {
-#ifndef illumos
-   if (pcpu_find(i) == NULL)
-   continue;
-#endif
+   CPU_FOREACH(i) {
dtrace_dstate_percpu_t *dcpu = &dstate->dtds_percpu[i];
 
stat->dtst_dyndrops += dcpu->dtdsc_drops;
___
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: r326698 - head/usr.bin/at

2017-12-08 Thread Alan Somers
Author: asomers
Date: Fri Dec  8 17:15:20 2017
New Revision: 326698
URL: https://svnweb.freebsd.org/changeset/base/326698

Log:
  at(1): annotate some intended switch-case fallthroughs
  
  Reported by:  Coverity
  CID:  1008191
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp

Modified:
  head/usr.bin/at/parsetime.c

Modified: head/usr.bin/at/parsetime.c
==
--- head/usr.bin/at/parsetime.c Fri Dec  8 16:25:05 2017(r326697)
+++ head/usr.bin/at/parsetime.c Fri Dec  8 17:15:20 2017(r326698)
@@ -617,6 +617,7 @@ parsetime(int argc, char **argv)
}
/* now is optional prefix for PLUS tree */
expect(PLUS);
+   /* FALLTHROUGH */
 case PLUS:
plus(&runtime);
break;
@@ -641,8 +642,10 @@ parsetime(int argc, char **argv)
 */
 case TEATIME:
hr += 4;
+   /* FALLTHROUGH */
 case NOON:
hr += 12;
+   /* FALLTHROUGH */
 case MIDNIGHT:
if (runtime.tm_hour >= hr) {
runtime.tm_mday++;
___
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: r326699 - stable/11/sys/vm

2017-12-08 Thread Mark Johnston
Author: markj
Date: Fri Dec  8 17:16:35 2017
New Revision: 326699
URL: https://svnweb.freebsd.org/changeset/base/326699

Log:
  MFC r326371:
  Verify the object/vnode association after vget() in vm_pageout_clean().

Modified:
  stable/11/sys/vm/vm_pageout.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_pageout.c
==
--- stable/11/sys/vm/vm_pageout.c   Fri Dec  8 17:15:20 2017
(r326698)
+++ stable/11/sys/vm/vm_pageout.c   Fri Dec  8 17:16:35 2017
(r326699)
@@ -617,7 +617,17 @@ vm_pageout_clean(vm_page_t m, int *numpagedout)
goto unlock_mp;
}
VM_OBJECT_WLOCK(object);
+
+   /*
+* Ensure that the object and vnode were not disassociated
+* while locks were dropped.
+*/
+   if (vp->v_object != object) {
+   error = ENOENT;
+   goto unlock_all;
+   }
vm_page_lock(m);
+
/*
 * While the object and page were unlocked, the page
 * may have been:
___
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: r326700 - head/lib/libc/isc

2017-12-08 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec  8 17:52:53 2017
New Revision: 326700
URL: https://svnweb.freebsd.org/changeset/base/326700

Log:
  SPDX: more ISC-related files.

Modified:
  head/lib/libc/isc/ev_streams.c
  head/lib/libc/isc/ev_timers.c
  head/lib/libc/isc/eventlib_p.h

Modified: head/lib/libc/isc/ev_streams.c
==
--- head/lib/libc/isc/ev_streams.c  Fri Dec  8 17:16:35 2017
(r326699)
+++ head/lib/libc/isc/ev_streams.c  Fri Dec  8 17:52:53 2017
(r326700)
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1996-1999 by Internet Software Consortium
  *

Modified: head/lib/libc/isc/ev_timers.c
==
--- head/lib/libc/isc/ev_timers.c   Fri Dec  8 17:16:35 2017
(r326699)
+++ head/lib/libc/isc/ev_timers.c   Fri Dec  8 17:52:53 2017
(r326700)
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-1999 by Internet Software Consortium
  *

Modified: head/lib/libc/isc/eventlib_p.h
==
--- head/lib/libc/isc/eventlib_p.h  Fri Dec  8 17:16:35 2017
(r326699)
+++ head/lib/libc/isc/eventlib_p.h  Fri Dec  8 17:52:53 2017
(r326700)
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
  * Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-1999 by Internet Software Consortium
  *
___
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: r326701 - stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace

2017-12-08 Thread Mark Johnston
Author: markj
Date: Fri Dec  8 18:04:43 2017
New Revision: 326701
URL: https://svnweb.freebsd.org/changeset/base/326701

Log:
  MFC r326134:
  Duplicate helpers after disabling inherited tracepoints during a fork.

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri Dec 
 8 17:52:53 2017(r326700)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri Dec 
 8 18:04:43 2017(r326701)
@@ -600,8 +600,8 @@ fasttrap_fork(proc_t *p, proc_t *cp)
pid_t ppid = p->p_pid;
int i;
 
-#ifdef illumos
ASSERT(curproc == p);
+#ifdef illumos
ASSERT(p->p_proc_flag & P_PR_LOCK);
 #else
PROC_LOCK_ASSERT(p, MA_OWNED);
@@ -609,26 +609,15 @@ fasttrap_fork(proc_t *p, proc_t *cp)
 #ifdef illumos
ASSERT(p->p_dtrace_count > 0);
 #else
-   if (p->p_dtrace_helpers) {
-   /*
-* dtrace_helpers_duplicate() allocates memory.
-*/
-   _PHOLD(cp);
-   PROC_UNLOCK(p);
-   PROC_UNLOCK(cp);
-   dtrace_helpers_duplicate(p, cp);
-   PROC_LOCK(cp);
-   PROC_LOCK(p);
-   _PRELE(cp);
-   }
/*
 * This check is purposely here instead of in kern_fork.c because,
 * for legal resons, we cannot include the dtrace_cddl.h header
 * inside kern_fork.c and insert if-clause there.
 */
-   if (p->p_dtrace_count == 0)
+   if (p->p_dtrace_count == 0 && p->p_dtrace_helpers == NULL)
return;
 #endif
+
ASSERT(cp->p_dtrace_count == 0);
 
/*
@@ -657,6 +646,8 @@ fasttrap_fork(proc_t *p, proc_t *cp)
_PHOLD(cp);
PROC_UNLOCK(cp);
PROC_UNLOCK(p);
+   if (p->p_dtrace_count == 0)
+   goto dup_helpers;
 #endif
 
/*
@@ -710,6 +701,9 @@ fasttrap_fork(proc_t *p, proc_t *cp)
mutex_enter(&cp->p_lock);
sprunlock(cp);
 #else
+dup_helpers:
+   if (p->p_dtrace_helpers != NULL)
+   dtrace_helpers_duplicate(p, cp);
PROC_LOCK(p);
PROC_LOCK(cp);
_PRELE(cp);
___
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: r326702 - head/sys/net

2017-12-08 Thread Stephen Hurd
Author: shurd
Date: Fri Dec  8 18:43:31 2017
New Revision: 326702
URL: https://svnweb.freebsd.org/changeset/base/326702

Log:
  Handle read-only mbufs in iflib ether pad function
  
  If ethernet padding is enabled, and a read-only mbuf is passed,
  it would modify the mbuf using m_append(). Instead, call m_dup() and
  append to the new packet.
  
  Reported by:  Pyun YongHyeon
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D13414

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cFri Dec  8 18:04:43 2017(r326701)
+++ head/sys/net/iflib.cFri Dec  8 18:43:31 2017(r326702)
@@ -3112,7 +3112,7 @@ calc_next_txd(iflib_txq_t txq, int cidx, uint8_t qid)
  * min_frame_size is the frame size (less CRC) to pad the mbuf to
  */
 static __noinline int
-iflib_ether_pad(device_t dev, struct mbuf *m_head, uint16_t min_frame_size)
+iflib_ether_pad(device_t dev, struct mbuf **m_head, uint16_t min_frame_size)
 {
/*
 * 18 is enough bytes to pad an ARP packet to 46 bytes, and
@@ -3120,14 +3120,25 @@ iflib_ether_pad(device_t dev, struct mbuf *m_head, uin
 */
static char pad[18];/* just zeros */
int n;
+   struct mbuf *new_head;
 
-   for (n = min_frame_size - m_head->m_pkthdr.len;
+   if (!M_WRITABLE(*m_head)) {
+   new_head = m_dup(*m_head, M_NOWAIT);
+   if (new_head == NULL) {
+   device_printf(dev, "cannot pad short frame, m_dup() 
failed");
+   return ENOMEM;
+   }
+   m_freem(*m_head);
+   *m_head = new_head;
+   }
+
+   for (n = min_frame_size - (*m_head)->m_pkthdr.len;
 n > 0; n -= sizeof(pad))
-   if (!m_append(m_head, min(n, sizeof(pad)), pad))
+   if (!m_append(*m_head, min(n, sizeof(pad)), pad))
break;
 
if (n > 0) {
-   m_freem(m_head);
+   m_freem(*m_head);
device_printf(dev, "cannot pad short frame\n");
DBG_COUNTER_INC(encap_pad_mbuf_fail);
return (ENOBUFS);
@@ -3189,13 +3200,13 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp)
desc_tag = txq->ift_desc_tag;
max_segs = scctx->isc_tx_nsegments;
}
-   m_head = *m_headp;
if ((sctx->isc_flags & IFLIB_NEED_ETHER_PAD) &&
__predict_false(m_head->m_pkthdr.len < scctx->isc_min_frame_size)) {
-   err = iflib_ether_pad(ctx->ifc_dev, m_head, 
scctx->isc_min_frame_size);
+   err = iflib_ether_pad(ctx->ifc_dev, m_headp, 
scctx->isc_min_frame_size);
if (err)
return err;
}
+   m_head = *m_headp;
 
pkt_info_zero(&pi);
pi.ipi_mflags = (m_head->m_flags & (M_VLANTAG|M_BCAST|M_MCAST));
___
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: r326702 - head/sys/net

2017-12-08 Thread Ryan Stone
On Fri, Dec 8, 2017 at 1:43 PM, Stephen Hurd  wrote:
> Author: shurd
> Date: Fri Dec  8 18:43:31 2017
> New Revision: 326702
> URL: https://svnweb.freebsd.org/changeset/base/326702
> +   if (!M_WRITABLE(*m_head)) {
> +   new_head = m_dup(*m_head, M_NOWAIT);
> +   if (new_head == NULL) {
> +   device_printf(dev, "cannot pad short frame, m_dup() 
> failed");
> +   return ENOMEM;


Don't we leak *m_head here?  As far as I can tell the caller doesn't
deal with it.
___
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: r326703 - stable/11/sys/ofed/drivers/infiniband/core

2017-12-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Dec  8 19:19:47 2017
New Revision: 326703
URL: https://svnweb.freebsd.org/changeset/base/326703

Log:
  Add support for IPv6 based addresses as part of the TCP unify portspace 
feature
  in ibcore. This resolves an interopability issue when using both iWarp(T6) and
  RDMA(CX-4 and CX-5) devices at the same time.
  
  The problem is IPv4 based sockets cannot be bound to an IPv6 based address
  causing sobind() to fail preventing all use of IPv6 based addresses with RDMA
  when an iWarp device is present.
  
  This is a direct commit.
  
  Tested by:KrishnamRaju ErapaRaju 
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/ofed/drivers/infiniband/core/cma.c

Modified: stable/11/sys/ofed/drivers/infiniband/core/cma.c
==
--- stable/11/sys/ofed/drivers/infiniband/core/cma.cFri Dec  8 18:43:31 
2017(r326702)
+++ stable/11/sys/ofed/drivers/infiniband/core/cma.cFri Dec  8 19:19:47 
2017(r326703)
@@ -2569,32 +2569,37 @@ static int cma_get_tcp_port(struct rdma_id_private *id
int ret;
int size;
struct socket *sock;
+   struct sockaddr *src_addr = (struct sockaddr 
*)&id_priv->id.route.addr.src_addr;
 
-   ret = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
+   switch (src_addr->sa_family) {
+   case AF_INET:
+   case AF_INET6:
+   break;
+   default:
+   /* other address families are not handled by iWarp */
+   id_priv->unify_ps_tcp = 0;
+   return (0);
+   }
+
+   ret = sock_create_kern(src_addr->sa_family, SOCK_STREAM, IPPROTO_TCP, 
&sock);
if (ret)
return ret;
 #ifdef __linux__
-   ret = sock->ops->bind(sock,
-   (struct sockaddr *) &id_priv->id.route.addr.src_addr,
-   ip_addr_size((struct sockaddr *) 
&id_priv->id.route.addr.src_addr));
+   ret = sock->ops->bind(sock, src_addr, ip_addr_size(src_addr));
 #else
SOCK_LOCK(sock);
sock->so_options |= SO_REUSEADDR;
SOCK_UNLOCK(sock);
 
-   ret = -sobind(sock,
-   (struct sockaddr *)&id_priv->id.route.addr.src_addr,
-   curthread);
+   ret = -sobind(sock, src_addr, curthread);
 #endif
if (ret) {
sock_release(sock);
return ret;
}
 
-   size = ip_addr_size((struct sockaddr *) 
&id_priv->id.route.addr.src_addr);
-   ret = sock_getname(sock,
-   (struct sockaddr *) &id_priv->id.route.addr.src_addr,
-   &size, 0);
+   size = ip_addr_size(src_addr);
+   ret = sock_getname(sock, src_addr, &size, 0);
if (ret) {
sock_release(sock);
return ret;
___
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: r326704 - stable/10/sys/ofed/drivers/infiniband/core

2017-12-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Dec  8 19:21:46 2017
New Revision: 326704
URL: https://svnweb.freebsd.org/changeset/base/326704

Log:
  Add support for IPv6 based addresses as part of the TCP unify portspace 
feature
  in ibcore. This resolves an interopability issue when using both iWarp(T6) and
  RDMA(CX-4 and CX-5) devices at the same time.
  
  The problem is IPv4 based sockets cannot be bound to an IPv6 based address
  causing sobind() to fail preventing all use of IPv6 based addresses with RDMA
  when an iWarp device is present.
  
  This is a direct commit.
  
  Tested by:KrishnamRaju ErapaRaju 
  Sponsored by: Mellanox Technologies

Modified:
  stable/10/sys/ofed/drivers/infiniband/core/cma.c

Modified: stable/10/sys/ofed/drivers/infiniband/core/cma.c
==
--- stable/10/sys/ofed/drivers/infiniband/core/cma.cFri Dec  8 19:19:47 
2017(r326703)
+++ stable/10/sys/ofed/drivers/infiniband/core/cma.cFri Dec  8 19:21:46 
2017(r326704)
@@ -2373,32 +2373,37 @@ static int cma_get_tcp_port(struct rdma_id_private *id
int ret;
int size;
struct socket *sock;
+   struct sockaddr *src_addr = (struct sockaddr 
*)&id_priv->id.route.addr.src_addr;
 
-   ret = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
+   switch (src_addr->sa_family) {
+   case AF_INET:
+   case AF_INET6:
+   break;
+   default:
+   /* other address families are not handled by iWarp */
+   id_priv->unify_ps_tcp = 0;
+   return (0);
+   }
+
+   ret = sock_create_kern(src_addr->sa_family, SOCK_STREAM, IPPROTO_TCP, 
&sock);
if (ret)
return ret;
 #ifdef __linux__
-   ret = sock->ops->bind(sock,
-   (struct sockaddr *) &id_priv->id.route.addr.src_addr,
-   ip_addr_size((struct sockaddr *) 
&id_priv->id.route.addr.src_addr));
+   ret = sock->ops->bind(sock, src_addr, ip_addr_size(src_addr));
 #else
SOCK_LOCK(sock);
sock->so_options |= SO_REUSEADDR;
SOCK_UNLOCK(sock);
 
-   ret = -sobind(sock,
-   (struct sockaddr *)&id_priv->id.route.addr.src_addr,
-   curthread);
+   ret = -sobind(sock, src_addr, curthread);
 #endif
if (ret) {
sock_release(sock);
return ret;
}
 
-   size = ip_addr_size((struct sockaddr *) 
&id_priv->id.route.addr.src_addr);
-   ret = sock_getname(sock,
-   (struct sockaddr *) &id_priv->id.route.addr.src_addr,
-   &size, 0);
+   size = ip_addr_size(src_addr);
+   ret = sock_getname(sock, src_addr, &size, 0);
if (ret) {
sock_release(sock);
return ret;
___
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: r326705 - head/cddl/usr.sbin/dtrace/tests/common/env

2017-12-08 Thread Mark Johnston
Author: markj
Date: Fri Dec  8 19:26:25 2017
New Revision: 326705
URL: https://svnweb.freebsd.org/changeset/base/326705

Log:
  Actually add the -x setenv test Makefile, missed in r326499.
  
  X-MFC with:   r326499

Added:
  head/cddl/usr.sbin/dtrace/tests/common/env/
  head/cddl/usr.sbin/dtrace/tests/common/env/Makefile   (contents, props 
changed)

Added: head/cddl/usr.sbin/dtrace/tests/common/env/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/cddl/usr.sbin/dtrace/tests/common/env/Makefile Fri Dec  8 19:26:25 
2017(r326705)
@@ -0,0 +1,30 @@
+# $FreeBSD$
+
+#
+# This Makefile was generated by 
$srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh.
+#
+
+PACKAGE=   tests
+
+${PACKAGE}FILES= \
+ err.D_PRAGMA_OPTSET.setfromscript.d  \
+ err.D_PRAGMA_OPTSET.unsetfromscript.d  \
+ tst.ld_nolazyload.ksh  \
+ tst.ld_nolazyload.ksh.out  \
+ tst.setenv1.ksh  \
+ tst.setenv1.ksh.out  \
+ tst.setenv2.ksh  \
+ tst.setenv2.ksh.out  \
+ tst.unsetenv1.ksh  \
+ tst.unsetenv1.ksh.out  \
+ tst.unsetenv2.ksh  \
+ tst.unsetenv2.ksh.out  \
+
+TESTEXES= \
+
+
+CFILES= \
+
+
+
+.include "../../dtrace.test.mk"
___
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: r326706 - head/sys/net

2017-12-08 Thread Stephen Hurd
Author: shurd
Date: Fri Dec  8 19:50:06 2017
New Revision: 326706
URL: https://svnweb.freebsd.org/changeset/base/326706

Log:
  Free mbuf chain when m_dup fails
  
  Fix memory leak where mbuf chain wasn't free()d if iflib_ether_pad()
  has a failure in m_dup().
  
  Reported by:  "Ryan Stone" 
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cFri Dec  8 19:26:25 2017(r326705)
+++ head/sys/net/iflib.cFri Dec  8 19:50:06 2017(r326706)
@@ -3125,6 +3125,7 @@ iflib_ether_pad(device_t dev, struct mbuf **m_head, ui
if (!M_WRITABLE(*m_head)) {
new_head = m_dup(*m_head, M_NOWAIT);
if (new_head == NULL) {
+   m_freem(*m_head);
device_printf(dev, "cannot pad short frame, m_dup() 
failed");
return ENOMEM;
}
___
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: r326708 - head/stand/libsa

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 19:56:57 2017
New Revision: 326708
URL: https://svnweb.freebsd.org/changeset/base/326708

Log:
  Remove _KERNEL hack now that errno.h does the right thing when
  _STANDALONE is defined.
  
  Sponsored By: Netflix

Modified:
  head/stand/libsa/stand.h

Modified: head/stand/libsa/stand.h
==
--- head/stand/libsa/stand.hFri Dec  8 19:56:35 2017(r326707)
+++ head/stand/libsa/stand.hFri Dec  8 19:56:57 2017(r326708)
@@ -72,10 +72,7 @@
 #define CHK(fmt, args...)  printf("%s(%d): " fmt "\n", __func__, __LINE__ 
, ##args)
 #define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __func__, __LINE__ 
, ##args); getchar();}
 
-/* Avoid unwanted userlandish components */
-#define _KERNEL
 #include 
-#undef _KERNEL
 
 /* special stand error codes */
 #defineEADAPT  (ELAST+1)   /* bad adaptor */
___
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: r326707 - head/stand/libsa

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 19:56:35 2017
New Revision: 326707
URL: https://svnweb.freebsd.org/changeset/base/326707

Log:
  Add partial support signal.h functioanlity. Pull in machine/signal.h
  to define sig_atomic_t.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/Makefile
  head/stand/libsa/stand.h

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Fri Dec  8 19:50:06 2017(r326706)
+++ head/stand/libsa/Makefile   Fri Dec  8 19:56:35 2017(r326707)
@@ -111,7 +111,7 @@ beforedepend:
for i in _time.h _strings.h _string.h; do \
[ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
done; \
-   for i in ctype.h fcntl.h stdio.h stdlib.h; do \
+   for i in ctype.h fcntl.h signal.h stdio.h stdlib.h; do \
ln -sf ${SASRC}/stand.h $$i; \
done
 

Modified: head/stand/libsa/stand.h
==
--- head/stand/libsa/stand.hFri Dec  8 19:50:06 2017(r326706)
+++ head/stand/libsa/stand.hFri Dec  8 19:56:35 2017(r326707)
@@ -88,6 +88,9 @@
 #defineEOFFSET (ELAST+8)   /* relative seek not supported */
 #defineESALAST (ELAST+8)   /* */
 
+/* Partial signal emulation for sig_atomic_t */
+#include 
+
 struct open_file;
 
 /*
___
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: r326710 - head/stand/libsa

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 19:57:06 2017
New Revision: 326710
URL: https://svnweb.freebsd.org/changeset/base/326710

Log:
  Put the files we're copying over into a few variables and add them to
  CLEANDIRS and CLEANFILES so make clean removes any divots.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/Makefile

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Fri Dec  8 19:57:02 2017(r326709)
+++ head/stand/libsa/Makefile   Fri Dec  8 19:57:06 2017(r326710)
@@ -97,10 +97,15 @@ SRCS+=  infback.c inffast.c inflate.c inftrees.c zutil.
 
 # Create a subset of includes that are safe, as well as adjusting those that 
aren't
 # The lists may drive people nuts, but they are explicitly opt-in
+FAKE_DIRS=xlocale arpa
+SAFE_INCS=a.out.h assert.h elf.h limits.h nlist.h setjmp.h stddef.h stdbool.h 
string.h strings.h time.h unistd.h uuid.h
+STAND_H_INC=ctype.h fcntl.h signal.h stdio.h stdlib.h
+OTHER_INC=stdarg.h errno.h stdint.h
+
 beforedepend:
echo beforedepend; \
-   mkdir -p xlocale arpa; \
-   for i in a.out.h assert.h elf.h limits.h nlist.h setjmp.h stddef.h 
stdbool.h string.h strings.h time.h unistd.h uuid.h; do \
+   mkdir -p ${FAKE_DIRS}; \
+   for i in ${SAFE_INCS}; do \
ln -sf ${SRCTOP}/include/$$i $$i; \
done; \
ln -sf ${SYSDIR}/${MACHINE}/include/stdarg.h stdarg.h; \
@@ -111,9 +116,11 @@ beforedepend:
for i in _time.h _strings.h _string.h; do \
[ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
done; \
-   for i in ctype.h fcntl.h signal.h stdio.h stdlib.h; do \
+   for i in ${STAND_H_INC}; do \
ln -sf ${SASRC}/stand.h $$i; \
done
+CLEANDIRS+=${FAKE_DIRS}
+CLEANFILES+= ${SAFE_INCS} ${STAND_H_INC} ${OTHER_INC}
 
 # io routines
 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
___
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: r326709 - head/stand/libsa

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 19:57:02 2017
New Revision: 326709
URL: https://svnweb.freebsd.org/changeset/base/326709

Log:
  Provide implementations for iscntrl, ispunct and isgraph.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/stand.h

Modified: head/stand/libsa/stand.h
==
--- head/stand/libsa/stand.hFri Dec  8 19:56:57 2017(r326708)
+++ head/stand/libsa/stand.hFri Dec  8 19:57:02 2017(r326709)
@@ -235,6 +235,22 @@ static __inline int isalnum(int c)
 return isalpha(c) || isdigit(c);
 }
 
+static __inline int iscntrl(int c)
+{
+   return (c >= 0 && c < ' ') || c == 127;
+}
+
+static __inline int isgraph(int c)
+{
+   return c >= '!' && c <= '~';
+}
+
+static __inline int ispunct(int c)
+{
+   return (c >= '!' && c <= '/') || (c >= ':' && c <= '@') ||
+   (c >= '[' && c <= '`') || (c >= '{' && c <= '~');
+}
+
 static __inline int toupper(int c)
 {
 return islower(c) ? c - 'a' + 'A' : c;
___
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: r326713 - head/tools/boot

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 19:57:21 2017
New Revision: 326713
URL: https://svnweb.freebsd.org/changeset/base/326713

Log:
  Build WITHOUT_FORTH too, at least for amd64 and i386
  
  Sponsored by: Netflix

Modified:
  head/tools/boot/universe.sh

Modified: head/tools/boot/universe.sh
==
--- head/tools/boot/universe.sh Fri Dec  8 19:57:16 2017(r326712)
+++ head/tools/boot/universe.sh Fri Dec  8 19:57:21 2017(r326713)
@@ -44,6 +44,14 @@ dobuild()
 top=$(make -V SRCTOP)
 cd $top/stand
 
+# Build without forth
+for i in \
+   amd64/amd64 \
+   i386/i386 \
+   ; do
+ta=${i##*/}
+dobuild $ta _.boot.${ta}.no_forth.log "WITHOUT_FORTH=yes"
+done
 
 # Build without GELI
 for i in \
___
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: r326711 - head/stand/common

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 19:57:11 2017
New Revision: 326711
URL: https://svnweb.freebsd.org/changeset/base/326711

Log:
  Const poison a couple of interfaces.
  
  Obtained from: lua boot project
  Sponsored by: Netflix

Modified:
  head/stand/common/bootstrap.h
  head/stand/common/interp_backslash.c
  head/stand/common/interp_parse.c

Modified: head/stand/common/bootstrap.h
==
--- head/stand/common/bootstrap.h   Fri Dec  8 19:57:06 2017
(r326710)
+++ head/stand/common/bootstrap.h   Fri Dec  8 19:57:11 2017
(r326711)
@@ -49,10 +49,10 @@ voidinteract(const char *rc);
 intinclude(const char *filename);
 
 /* interp_backslash.c */
-char   *backslash(char *str);
+char   *backslash(const char *str);
 
 /* interp_parse.c */
-intparse(int *argc, char ***argv, char *str);
+intparse(int *argc, char ***argv, const char *str);
 
 /* interp_forth.c */
 void   bf_init(const char *rc);

Modified: head/stand/common/interp_backslash.c
==
--- head/stand/common/interp_backslash.cFri Dec  8 19:57:06 2017
(r326710)
+++ head/stand/common/interp_backslash.cFri Dec  8 19:57:11 2017
(r326711)
@@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$");
  * processing" done on it.  Original can be free'd if desired.
  */
 char *
-backslash(char *str)
+backslash(const char *str)
 {
 /*
  * Remove backslashes from the strings. Turn \040 etc. into a single

Modified: head/stand/common/interp_parse.c
==
--- head/stand/common/interp_parse.cFri Dec  8 19:57:06 2017
(r326710)
+++ head/stand/common/interp_parse.cFri Dec  8 19:57:11 2017
(r326711)
@@ -7,7 +7,7 @@
  * 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.
- * 
+ *
  * Jordan K. Hubbard
  * 29 August 1998
  *
@@ -82,7 +82,7 @@ isdquote(int ch)
 }
 
 int
-parse(int *argc, char ***argv, char *str)
+parse(int *argc, char ***argv, const char *str)
 {
 int ac;
 char *val, *p, *q, *copy = NULL;
___
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: r326712 - in head/stand: . common

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 19:57:16 2017
New Revision: 326712
URL: https://svnweb.freebsd.org/changeset/base/326712

Log:
  Create interp class.
  
  Create an interp class. Use it to separate out the different types of
  interpreters: forth and simple with function pointers rather than
  via #ifdefs.
  
  Obtained from: lua boot loader project
  (via https://bsd...@github.com/bsdimp/freebsd.git lua-bootloader)
  Sponsored by: Netflix

Added:
  head/stand/common/interp.h   (contents, props changed)
  head/stand/common/interp_simple.c   (contents, props changed)
Modified:
  head/stand/common/interp.c
  head/stand/common/interp_forth.c
  head/stand/loader.mk

Modified: head/stand/common/interp.c
==
--- head/stand/common/interp.c  Fri Dec  8 19:57:11 2017(r326711)
+++ head/stand/common/interp.c  Fri Dec  8 19:57:16 2017(r326712)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 1998 Michael Smith 
+ * Copyright (c) 2011 Wojciech A. Koszek 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,7 +24,6 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -36,112 +36,60 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include "bootstrap.h"
+#include "interp.h"
 
-#ifdef BOOT_FORTH
-#include "ficl.h"
-#defineRETURN(x)   stackPushINT(bf_vm->pStack,!x); return(x)
 
-extern FICL_VM *bf_vm;
+#defineMAXARGS 20  /* maximum number of arguments 
allowed */
+
+struct interp  *interp =
+#if defined(BOOT_FORTH)
+   &boot_interp_forth;
 #else
-#defineRETURN(x)   return(x)
+   &boot_interp_simple;
 #endif
 
-#defineMAXARGS 20  /* maximum number of arguments 
allowed */
-
-static voidprompt(void);
-
-#ifndef BOOT_FORTH
-static int perform(int argc, char *argv[]);
-
-/*
- * Perform the command
- */
 int
-perform(int argc, char *argv[])
+default_load_config(void *ctx)
 {
-intresult;
-struct bootblk_command **cmdp;
-bootblk_cmd_t  *cmd;
-
-if (argc < 1)
-   return(CMD_OK);
-
-/* set return defaults; a successful command will override these */
-command_errmsg = command_errbuf;
-strcpy(command_errbuf, "no error message");
-cmd = NULL;
-result = CMD_ERROR;
-
-/* search the command set for the command */
-SET_FOREACH(cmdp, Xcommand_set) {
-   if (((*cmdp)->c_name != NULL) && !strcmp(argv[0], (*cmdp)->c_name))
-   cmd = (*cmdp)->c_fn;
-}
-if (cmd != NULL) {
-   result = (cmd)(argc, argv);
-} else {
-   command_errmsg = "unknown command";
-}
-RETURN(result);
+   return INTERP_INCL(interp, "/boot/loader.rc");
 }
-#endif /* ! BOOT_FORTH */
 
 /*
  * Interactive mode
  */
 void
-interact(const char *rc)
+interact(const char * rc)
 {
-static charinput[256]; /* big enough? */
-#ifndef BOOT_FORTH
-intargc;
-char   **argv;
-#endif
+   static char input[256]; /* big enough? */
 
-#ifdef BOOT_FORTH
-bf_init((rc) ? "" : NULL);
-#endif
+   INTERP_INIT(interp);
 
-if (rc == NULL) {
-   /* Read our default configuration. */
-   include("/boot/loader.rc");
-} else if (*rc != '\0')
-   include(rc);
+   /*
+* Read our default configuration
+*/
+   INTERP_LOAD_DEF_CONFIG(interp);
+   printf("\n");
+   /*
+* Before interacting, we might want to autoboot.
+*/
+   autoboot_maybe();
 
-printf("\n");
+   /*
+* Not autobooting, go manual
+*/
+   printf("\nType '?' for a list of commands, 'help' for more detailed 
help.\n");
+   if (getenv("prompt") == NULL)
+   setenv("prompt", "${interpret}", 1);
+   if (getenv("interpret") == NULL)
+   setenv("interpret", "OK", 1);
 
-/*
- * Before interacting, we might want to autoboot.
- */
-autoboot_maybe();
-
-/*
- * Not autobooting, go manual
- */
-printf("\nType '?' for a list of commands, 'help' for more detailed 
help.\n");
-if (getenv("prompt") == NULL)
-   setenv("prompt", "${interpret}", 1);
-if (getenv("interpret") == NULL)
-setenv("interpret", "OK", 1);
-
 
-for (;;) {
-   input[0] = '\0';
-   prompt();
-   ngets(input, sizeof(input));
-#ifdef BOOT_FORTH
-   bf_vm->sourceID.i = 0;
-   bf_run(input);
-#else
-   if (!parse(&argc, &argv, input)) {
-   if (perform(argc, argv))
-   printf("%s: %s\n", argv[0], command_errmsg);
-   free(argv);
-   } else {
-   printf("parse error\n");
+   for (;;) {
+   input[0] = '\0';
+   prompt();
+   ngets(input, sizeof(input));
+

svn commit: r326714 - head/stand/efi/boot1

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 19:57:26 2017
New Revision: 326714
URL: https://svnweb.freebsd.org/changeset/base/326714

Log:
  boot1.c needs EFI_ZFS_BOOT too, so add it globally. Otherwise we'll
  not be able to actually read ZFS partitions.
  
  Submitted by: kevans@

Modified:
  head/stand/efi/boot1/Makefile

Modified: head/stand/efi/boot1/Makefile
==
--- head/stand/efi/boot1/Makefile   Fri Dec  8 19:57:21 2017
(r326713)
+++ head/stand/efi/boot1/Makefile   Fri Dec  8 19:57:26 2017
(r326714)
@@ -34,7 +34,7 @@ SRCS+=zfs_module.c
 CFLAGS.zfs_module.c+=  -I${ZFSSRC}
 CFLAGS.zfs_module.c+=  -I${SYSDIR}/cddl/boot/zfs
 CFLAGS.zfs_module.c+=  -I${SYSDIR}/crypto/skein
-CFLAGS.zfs_module.c+=  -DEFI_ZFS_BOOT
+CFLAGS+=   -DEFI_ZFS_BOOT
 LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
 .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: r326715 - stable/11/sys/geom/mirror

2017-12-08 Thread Mark Johnston
Author: markj
Date: Fri Dec  8 20:04:10 2017
New Revision: 326715
URL: https://svnweb.freebsd.org/changeset/base/326715

Log:
  MFC r325044:
  Fix a lock leak in g_mirror_destroy().

Modified:
  stable/11/sys/geom/mirror/g_mirror.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/geom/mirror/g_mirror.c
==
--- stable/11/sys/geom/mirror/g_mirror.cFri Dec  8 19:57:26 2017
(r326714)
+++ stable/11/sys/geom/mirror/g_mirror.cFri Dec  8 20:04:10 2017
(r326715)
@@ -3088,8 +3088,10 @@ g_mirror_destroy(struct g_mirror_softc *sc, int how)
}
}
 
-   if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0)
+   if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) {
+   sx_xunlock(&sc->sc_lock);
return (0);
+   }
sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY;
sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DRAIN;
G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc);
___
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: r326702 - head/sys/net

2017-12-08 Thread shurd



On Fri, 8 Dec 2017 13:57:13 -0500, Ryan Stone  wrote:

  On Fri, Dec 8, 2017 at 1:43 PM, Stephen Hurd  wrote:

Author: shurd
Date: Fri Dec 8 18:43:31 2017
New Revision: 326702
URL: https://svnweb.freebsd.org/changeset/base/326702
+ if (!M_WRITABLE(*m_head)) {
+ new_head = m_dup(*m_head, M_NOWAIT);
+ if (new_head == NULL) {
+ device_printf(dev, "cannot pad short frame, m_dup() failed");
+ return ENOMEM;


Don't we leak *m_head here? As far as I can tell the caller doesn't
deal with it. 

Thanks for catching that, fixed in r326706. 


___
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: r326614 - in head: etc/mtree usr.bin usr.bin/sponge usr.bin/tee

2017-12-08 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Tue, Dec 5, 2017 at 7:10 PM, Rodney W. Grimes
>  wrote:
> > [ Charset UTF-8 unsupported, converting... ]
> >> Author: eadler
> >> Date: Wed Dec  6 02:47:46 2017
> >> New Revision: 326614
> >> URL: https://svnweb.freebsd.org/changeset/base/326614
> >>
> >> Log:
> >>   sponge(1): revert
> >>
> >>   I did a complete buildworld and test... with the program disconnected
> >>   from the tree. Revert the change for now.
> >>
> >>   (this keeps the change to .arclint which is still correct)
> >
> > Commited with no log entry that makes any sense about why it was changed,
> > please revert .arclint and recommit with a proper log entry for .arclint
> > as to why all /tests/ dirs should be ignored.
> 
> I have to agree with Rod.  The commit message for the arclint change
> is currently "sponge(1): initial commit ?" and doesn't say anything
> about the arclint change.  Even if the change is correct, the commit
> message isn't.

Ping, I have not seen this reverted and recommitted with a reasonable
explination as to why this change is actually desired.

Thanks,

-- 
Rod Grimes rgri...@freebsd.org
___
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: r326716 - head/contrib/ofed/libibnetdisc

2017-12-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Dec  8 21:01:09 2017
New Revision: 326716
URL: https://svnweb.freebsd.org/changeset/base/326716

Log:
  Correctly define the unordered_map namespace in ofed/libibnetdisc .
  
  This should fix ofed/libibnetdisc compilation with C-compilers
  different from clang and GCC v4.2.1.
  
  Submitted by: kib
  Sponsored by: Mellanox Technologies

Modified:
  head/contrib/ofed/libibnetdisc/Makefile
  head/contrib/ofed/libibnetdisc/g_hash_table.cpp

Modified: head/contrib/ofed/libibnetdisc/Makefile
==
--- head/contrib/ofed/libibnetdisc/Makefile Fri Dec  8 20:04:10 2017
(r326715)
+++ head/contrib/ofed/libibnetdisc/Makefile Fri Dec  8 21:01:09 2017
(r326716)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 .PATH: ${.CURDIR} ${.CURDIR}/man
 
 SHLIBDIR?= /usr/lib
@@ -28,6 +30,9 @@ LIBADD=   osmcomp ibmad ibumad
 CFLAGS+=   -DHAVE_CONFIG_H=1
 CFLAGS+=   -I${.CURDIR}
 CFLAGS+=   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband
+.if ${COMPILER_FEATURES:Mc++11}
+CXXFLAGS+= -std=c++11
+.endif
 VERSION_MAP=   ${.CURDIR}/libibnetdisc.map
 
 .include 

Modified: head/contrib/ofed/libibnetdisc/g_hash_table.cpp
==
--- head/contrib/ofed/libibnetdisc/g_hash_table.cpp Fri Dec  8 20:04:10 
2017(r326715)
+++ head/contrib/ofed/libibnetdisc/g_hash_table.cpp Fri Dec  8 21:01:09 
2017(r326716)
@@ -31,17 +31,17 @@
  *
  */
 
-#if defined(__clang__)
+#if __cplusplus >= 201103L
 #include 
-#defineHASH_TABLE_UNORDERED_MAP std::unordered_map
+#defineUM_NAMESPACE std
 #else
 #include 
-#defineHASH_TABLE_UNORDERED_MAP std::tr1::unordered_map
+#defineUM_NAMESPACE std::tr1
 #endif
 
 class HashTable {
 public:
-   HASH_TABLE_UNORDERED_MAP map;
+   UM_NAMESPACE::unordered_map map;
HashTable() { };
~HashTable() { };
 };
___
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: r326717 - head/tools/tools/nanobsd/embedded

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 21:59:42 2017
New Revision: 326717
URL: https://svnweb.freebsd.org/changeset/base/326717

Log:
  Remove local here. It was a cut and paste error.
  
  Sponsored by: Netflix

Modified:
  head/tools/tools/nanobsd/embedded/common

Modified: head/tools/tools/nanobsd/embedded/common
==
--- head/tools/tools/nanobsd/embedded/commonFri Dec  8 21:01:09 2017
(r326716)
+++ head/tools/tools/nanobsd/embedded/commonFri Dec  8 21:59:42 2017
(r326717)
@@ -477,7 +477,7 @@ dos_boot_part ( ) (
 )
 
 if [ -n "$NANO_BOOT_PKG" ]; then
-   local d=/usr/local/share/u-boot/${NANO_BOOT_PKG}
+   d=/usr/local/share/u-boot/${NANO_BOOT_PKG}
if [ ! -d ${d} ]; then
echo ${NANO_BOOT_PKG} not installed. Sadly, it must be.
exit 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: r326718 - head/tools/tools/nanobsd/embedded

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 21:59:50 2017
New Revision: 326718
URL: https://svnweb.freebsd.org/changeset/base/326718

Log:
  Don't automatically create objdir here. We're just after the
  TMPPATH. We'll make the paths later.
  
  Sponsored by: Netflix

Modified:
  head/tools/tools/nanobsd/embedded/common

Modified: head/tools/tools/nanobsd/embedded/common
==
--- head/tools/tools/nanobsd/embedded/commonFri Dec  8 21:59:42 2017
(r326717)
+++ head/tools/tools/nanobsd/embedded/commonFri Dec  8 21:59:50 2017
(r326718)
@@ -669,5 +669,5 @@ create_diskimage ( ) (
 
 # Set the path to the same path we use for buldworld to use latest mkimg
 NANO_TARGET=$(cd ${NANO_SRC}; ${NANO_MAKE} TARGET_ARCH=${NANO_ARCH} -V _TARGET)
-NANO_TMPPATH=$(cd ${NANO_SRC}; ${NANO_MAKE} TARGET=${NANO_TARGET} 
TARGET_ARCH=${NANO_ARCH} -f Makefile.inc1 buildenv -V TMPPATH)
+NANO_TMPPATH=$(cd ${NANO_SRC}; ${NANO_MAKE} MK_AUTO_OBJ=no 
TARGET=${NANO_TARGET} TARGET_ARCH=${NANO_ARCH} -f Makefile.inc1 buildenv -V 
TMPPATH)
 export PATH="${NANO_TMPPATH}"
___
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: r326719 - in head: . include lib/libc/gen

2017-12-08 Thread Ed Schouten
Author: ed
Date: Fri Dec  8 22:06:18 2017
New Revision: 326719
URL: https://svnweb.freebsd.org/changeset/base/326719

Log:
  Remove basename_r(3).
  
  Now that the POSIX working group is going to require that basename(3)
  and dirname(3) are thread-safe in future revisions of the standard,
  there is even less of a need to provide basename_r(3). Remove this
  function to prevent people from writing code that only builds on
  FreeBSD and Bionic.
  
  Removing this function seems to break exactly one port: sbruno@'s
  qemu-user-static. I will send him a pull request on GitHub in a bit.
  __FreeBSD_version will not be bumped, as any value from 2017 can be used
  to test for the presence of a thread-safe basename(3)/dirname(3).
  
  PR:   https://bugs.freebsd.org/224016

Modified:
  head/ObsoleteFiles.inc
  head/include/libgen.h
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/Symbol.map
  head/lib/libc/gen/basename_compat.c

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Dec  8 21:59:50 2017(r326718)
+++ head/ObsoleteFiles.inc  Fri Dec  8 22:06:18 2017(r326719)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20171208: Remove basename_r(3)
+OLD_FILES+=usr/share/man/man3/basename_r.3.gz
 # 20171204: Move fdformat man page from volume 1 to volume 8.
 OLD_FILES+=usr/share/man/man1/fdformat.1.gz
 # 20171203: libproc version bump

Modified: head/include/libgen.h
==
--- head/include/libgen.h   Fri Dec  8 21:59:50 2017(r326718)
+++ head/include/libgen.h   Fri Dec  8 22:06:18 2017(r326719)
@@ -37,7 +37,6 @@
 
 __BEGIN_DECLS
 char   *basename(char *);
-char   *basename_r(const char *, char *);
 char   *dirname(char *);
 __END_DECLS
 

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Fri Dec  8 21:59:50 2017
(r326718)
+++ head/lib/libc/gen/Makefile.inc  Fri Dec  8 22:06:18 2017
(r326719)
@@ -312,7 +312,6 @@ MLINKS+=arc4random.3 arc4random_addrandom.3 \
arc4random.3 arc4random_stir.3 \
arc4random.3 arc4random_buf.3 \
arc4random.3 arc4random_uniform.3
-MLINKS+=basename.3 basename_r.3
 MLINKS+=ctermid.3 ctermid_r.3
 MLINKS+=devname.3 devname_r.3
 MLINKS+=devname.3 fdevname.3

Modified: head/lib/libc/gen/Symbol.map
==
--- head/lib/libc/gen/Symbol.mapFri Dec  8 21:59:50 2017
(r326718)
+++ head/lib/libc/gen/Symbol.mapFri Dec  8 22:06:18 2017
(r326719)
@@ -332,7 +332,6 @@ FBSD_1.1 {
 };
 
 FBSD_1.2 {
-   basename_r;
cfmakesane;
endutxent;
getpagesizes;

Modified: head/lib/libc/gen/basename_compat.c
==
--- head/lib/libc/gen/basename_compat.c Fri Dec  8 21:59:50 2017
(r326718)
+++ head/lib/libc/gen/basename_compat.c Fri Dec  8 22:06:18 2017
(r326719)
@@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 char *
-basename_r(const char *path, char *bname)
+__freebsd11_basename_r(const char *path, char *bname)
 {
const char *endp, *startp;
size_t len;
@@ -75,7 +75,8 @@ __freebsd11_basename(char *path)
if (bname == NULL)
return (NULL);
}
-   return (basename_r(path, bname));
+   return (__freebsd11_basename_r(path, bname));
 }
 
+__sym_compat(basename_r, __freebsd11_basename_r, FBSD_1.2);
 __sym_compat(basename, __freebsd11_basename, FBSD_1.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: r326720 - in head/stand: . ficl

2017-12-08 Thread Warner Losh
Author: imp
Date: Fri Dec  8 22:19:41 2017
New Revision: 326720
URL: https://svnweb.freebsd.org/changeset/base/326720

Log:
  This path belongs in ficl/Makefile, not the common defines for users
  of ficl.
  
  Sponsored by: Netflix

Modified:
  head/stand/ficl.mk
  head/stand/ficl/Makefile

Modified: head/stand/ficl.mk
==
--- head/stand/ficl.mk  Fri Dec  8 22:06:18 2017(r326719)
+++ head/stand/ficl.mk  Fri Dec  8 22:19:41 2017(r326720)
@@ -12,8 +12,6 @@ FICL_CPUARCH= mips64
 FICL_CPUARCH=  ${MACHINE_CPUARCH}
 .endif
 
-.PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH}
-
 .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0
 CFLAGS+=   -fPIC
 .endif

Modified: head/stand/ficl/Makefile
==
--- head/stand/ficl/MakefileFri Dec  8 22:06:18 2017(r326719)
+++ head/stand/ficl/MakefileFri Dec  8 22:19:41 2017(r326720)
@@ -4,6 +4,8 @@
 .include 
 .include "${BOOTSRC}/ficl.mk"
 
+.PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH}
+
 BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
prefix.c search.c stack.c tools.c vm.c words.c
 
___
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: r326614 - in head: etc/mtree usr.bin usr.bin/sponge usr.bin/tee

2017-12-08 Thread Eitan Adler
On 8 December 2017 at 12:11, Rodney W. Grimes
 wrote:

> Ping, I have not seen this reverted and recommitted with a reasonable
> explination as to why this change is actually desired.

Sorry, work has been busy and as the crux was reverted it didn't feel
as urgent[0]. The answer is that shell scripts in scripts don't need
to be chmod +x to work. In fact most are not.
Of the tests I found from a simple search:
65 are chmod +x
84 are chmod -x

The entirety of the changed config is:
"chmod": {
  "type": "chmod",
+  "exclude": "(/tests/)"
},

which simply disables this test during 'arc diff'.


[0] I still owe everyone a reply the original thread


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r326723 - in releng: 10.3 10.3/crypto/openssl/ssl 10.3/sys/conf 10.4 10.4/crypto/openssl/ssl 10.4/sys/conf

2017-12-08 Thread Gordon Tetlow
Author: gordon
Date: Sat Dec  9 03:45:23 2017
New Revision: 326723
URL: https://svnweb.freebsd.org/changeset/base/326723

Log:
  Fix error state handling
  
  Approved by:  so
  Security: CVE-2017-3737
  Security: FreeBSD-SA-17:12.openssl

Modified:
  releng/10.3/UPDATING
  releng/10.3/crypto/openssl/ssl/ssl.h
  releng/10.3/sys/conf/newvers.sh
  releng/10.4/UPDATING
  releng/10.4/crypto/openssl/ssl/ssl.h
  releng/10.4/sys/conf/newvers.sh

Modified: releng/10.3/UPDATING
==
--- releng/10.3/UPDATINGSat Dec  9 03:44:26 2017(r326722)
+++ releng/10.3/UPDATINGSat Dec  9 03:45:23 2017(r326723)
@@ -1,5 +1,5 @@
 Updating Information for FreeBSD current users
-
+2
 This file is maintained and copyrighted by M. Warner Losh .
 See end of file for further details.  For commonly done items, please see the
 COMMON ITEMS: section later in the file.  These instructions assume that you
@@ -15,6 +15,10 @@ NOTE: FreeBSD has switched from gcc to clang. If you h
 from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
+
+20171209   p26 FreeBSD-SA-17:12.openssl
+
+   Fix OpenSSL error state vulnerability.
 
 20171129   p25 FreeBSD-SA-17:11.openssl
 

Modified: releng/10.3/crypto/openssl/ssl/ssl.h
==
--- releng/10.3/crypto/openssl/ssl/ssl.hSat Dec  9 03:44:26 2017
(r326722)
+++ releng/10.3/crypto/openssl/ssl/ssl.hSat Dec  9 03:45:23 2017
(r326723)
@@ -1544,7 +1544,7 @@ extern "C" {
 # define SSL_ST_BEFORE   0x4000
 # define SSL_ST_OK   0x03
 # define SSL_ST_RENEGOTIATE  (0x04|SSL_ST_INIT)
-# define SSL_ST_ERR  0x05
+# define SSL_ST_ERR  (0x05|SSL_ST_INIT)
 
 # define SSL_CB_LOOP 0x01
 # define SSL_CB_EXIT 0x02

Modified: releng/10.3/sys/conf/newvers.sh
==
--- releng/10.3/sys/conf/newvers.sh Sat Dec  9 03:44:26 2017
(r326722)
+++ releng/10.3/sys/conf/newvers.sh Sat Dec  9 03:45:23 2017
(r326723)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.3"
-BRANCH="RELEASE-p25"
+BRANCH="RELEASE-p26"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.4/UPDATING
==
--- releng/10.4/UPDATINGSat Dec  9 03:44:26 2017(r326722)
+++ releng/10.4/UPDATINGSat Dec  9 03:45:23 2017(r326723)
@@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG to b
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20171209   p5  FreeBSD-SA-17:12.openssl
+
+   Fix OpenSSL error state vulnerability.
+
 20171129   p4  FreeBSD-SA-17:11.openssl
 
Fix OpenSSL out-of-bounds read vulnerability.

Modified: releng/10.4/crypto/openssl/ssl/ssl.h
==
--- releng/10.4/crypto/openssl/ssl/ssl.hSat Dec  9 03:44:26 2017
(r326722)
+++ releng/10.4/crypto/openssl/ssl/ssl.hSat Dec  9 03:45:23 2017
(r326723)
@@ -1544,7 +1544,7 @@ extern "C" {
 # define SSL_ST_BEFORE   0x4000
 # define SSL_ST_OK   0x03
 # define SSL_ST_RENEGOTIATE  (0x04|SSL_ST_INIT)
-# define SSL_ST_ERR  0x05
+# define SSL_ST_ERR  (0x05|SSL_ST_INIT)
 
 # define SSL_CB_LOOP 0x01
 # define SSL_CB_EXIT 0x02

Modified: releng/10.4/sys/conf/newvers.sh
==
--- releng/10.4/sys/conf/newvers.sh Sat Dec  9 03:44:26 2017
(r326722)
+++ releng/10.4/sys/conf/newvers.sh Sat Dec  9 03:45:23 2017
(r326723)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.4"
-BRANCH="RELEASE-p4"
+BRANCH="RELEASE-p5"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; 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: r326721 - stable/10/crypto/openssl/ssl

2017-12-08 Thread Gordon Tetlow
Author: gordon
Date: Sat Dec  9 03:41:31 2017
New Revision: 326721
URL: https://svnweb.freebsd.org/changeset/base/326721

Log:
  Fix error state handling.
  
  Security: CVE-2017-3737
  Security: FreeBSD-SA-17:12.openssl

Modified:
  stable/10/crypto/openssl/ssl/ssl.h

Modified: stable/10/crypto/openssl/ssl/ssl.h
==
--- stable/10/crypto/openssl/ssl/ssl.h  Fri Dec  8 22:19:41 2017
(r326720)
+++ stable/10/crypto/openssl/ssl/ssl.h  Sat Dec  9 03:41:31 2017
(r326721)
@@ -1544,7 +1544,7 @@ extern "C" {
 # define SSL_ST_BEFORE   0x4000
 # define SSL_ST_OK   0x03
 # define SSL_ST_RENEGOTIATE  (0x04|SSL_ST_INIT)
-# define SSL_ST_ERR  0x05
+# define SSL_ST_ERR  (0x05|SSL_ST_INIT)
 
 # define SSL_CB_LOOP 0x01
 # define SSL_CB_EXIT 0x02
___
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: r326722 - in releng/11.1: . crypto/openssl/crypto/bn/asm crypto/openssl/ssl secure/lib/libcrypto/amd64 sys/conf

2017-12-08 Thread Gordon Tetlow
Author: gordon
Date: Sat Dec  9 03:44:26 2017
New Revision: 326722
URL: https://svnweb.freebsd.org/changeset/base/326722

Log:
  Fix multiple OpenSSL vulnerabilities.
  
  Approved by:  so
  Security: CVE-2017-3737
  Security: CVE-2017-3738
  Security: FreeBSD-SA-17:12.openssl

Modified:
  releng/11.1/UPDATING
  releng/11.1/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl
  releng/11.1/crypto/openssl/ssl/ssl.h
  releng/11.1/secure/lib/libcrypto/amd64/rsaz-avx2.S
  releng/11.1/sys/conf/newvers.sh

Modified: releng/11.1/UPDATING
==
--- releng/11.1/UPDATINGSat Dec  9 03:41:31 2017(r326721)
+++ releng/11.1/UPDATINGSat Dec  9 03:44:26 2017(r326722)
@@ -16,6 +16,10 @@ 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.
 
+20171209   p6  FreeBSD-SA-17:12.openssl
+
+   Fix multiple vulnerabilities of OpenSSL.
+
 20171129   p5  FreeBSD-SA-17:11.openssl
 
Fix multiple vulnerabilities of OpenSSL.

Modified: releng/11.1/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl
==
--- releng/11.1/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl   Sat Dec  9 
03:41:31 2017(r326721)
+++ releng/11.1/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl   Sat Dec  9 
03:44:26 2017(r326722)
@@ -239,7 +239,7 @@ $code.=<<___;
vmovdqu 32*8-128($ap), $ACC8
 
lea 192(%rsp), $tp0 # 64+128=192
-   vpbroadcastq.Land_mask(%rip), $AND_MASK
+   vmovdqu .Land_mask(%rip), $AND_MASK
jmp .LOOP_GRANDE_SQR_1024
 
 .align 32
@@ -1070,10 +1070,10 @@ $code.=<<___;
vpmuludq32*6-128($np),$Yi,$TEMP1
vpaddq  $TEMP1,$ACC6,$ACC6
vpmuludq32*7-128($np),$Yi,$TEMP2
-vpblendd   \$3, $ZERO, $ACC9, $ACC9# correct $ACC3
+vpblendd   \$3, $ZERO, $ACC9, $TEMP1   # correct $ACC3
vpaddq  $TEMP2,$ACC7,$ACC7
vpmuludq32*8-128($np),$Yi,$TEMP0
-vpaddq $ACC9, $ACC3, $ACC3 # correct $ACC3
+vpaddq $TEMP1, $ACC3, $ACC3# correct $ACC3
vpaddq  $TEMP0,$ACC8,$ACC8
 
mov %rbx, %rax
@@ -1086,7 +1086,9 @@ $code.=<<___;
 vmovdqu-8+32*2-128($ap),$TEMP2
 
mov $r1, %rax
+vpblendd   \$0xfc, $ZERO, $ACC9, $ACC9 # correct $ACC3
imull   $n0, %eax
+vpaddq $ACC9,$ACC4,$ACC4   # correct $ACC3
and \$0x1fff, %eax
 
 imulq  16-128($ap),%rbx
@@ -1322,15 +1324,12 @@ ___
 #  But as we underutilize resources, it's possible to correct in
 #  each iteration with marginal performance loss. But then, as
 #  we do it in each iteration, we can correct less digits, and
-#  avoid performance penalties completely. Also note that we
-#  correct only three digits out of four. This works because
-#  most significant digit is subjected to less additions.
+#  avoid performance penalties completely.
 
 $TEMP0 = $ACC9;
 $TEMP3 = $Bi;
 $TEMP4 = $Yi;
 $code.=<<___;
-   vpermq  \$0, $AND_MASK, $AND_MASK
vpaddq  (%rsp), $TEMP1, $ACC0
 
vpsrlq  \$29, $ACC0, $TEMP1
@@ -1763,7 +1762,7 @@ $code.=<<___;
 
 .align 64
 .Land_mask:
-   .quad   0x1fff,0x1fff,0x1fff,-1
+   .quad   0x1fff,0x1fff,0x1fff,0x1fff
 .Lscatter_permd:
.long   0,2,4,6,7,7,7,7
 .Lgather_permd:

Modified: releng/11.1/crypto/openssl/ssl/ssl.h
==
--- releng/11.1/crypto/openssl/ssl/ssl.hSat Dec  9 03:41:31 2017
(r326721)
+++ releng/11.1/crypto/openssl/ssl/ssl.hSat Dec  9 03:44:26 2017
(r326722)
@@ -1727,7 +1727,7 @@ extern "C" {
 # define SSL_ST_BEFORE   0x4000
 # define SSL_ST_OK   0x03
 # define SSL_ST_RENEGOTIATE  (0x04|SSL_ST_INIT)
-# define SSL_ST_ERR  0x05
+# define SSL_ST_ERR  (0x05|SSL_ST_INIT)
 
 # define SSL_CB_LOOP 0x01
 # define SSL_CB_EXIT 0x02

Modified: releng/11.1/secure/lib/libcrypto/amd64/rsaz-avx2.S
==
--- releng/11.1/secure/lib/libcrypto/amd64/rsaz-avx2.S  Sat Dec  9 03:41:31 
2017(r326721)
+++ releng/11.1/secure/lib/libcrypto/amd64/rsaz-avx2.S  Sat Dec  9 03:44:26 
2017(r326722)
@@ -68,7 +68,7 @@ rsaz_1024_sqr_avx2:
vmovdqu 256-128(%rsi),%ymm8
 
leaq192(%rsp),%rbx
-   vpbroadcastq.Land_mask(%rip),%ymm15
+   vmovdqu .Land_mask(%rip),%ymm15
   

Re: svn commit: r326614 - in head: etc/mtree usr.bin usr.bin/sponge usr.bin/tee

2017-12-08 Thread Conrad Meyer
On Fri, Dec 8, 2017 at 6:07 PM, Eitan Adler  wrote:
> On 8 December 2017 at 12:11, Rodney W. Grimes
>  wrote:
>
>> Ping, I have not seen this reverted and recommitted with a reasonable
>> explination as to why this change is actually desired.
>
> Sorry, work has been busy and as the crux was reverted it didn't feel
> as urgent[0].

It's fine, it's not urgent.

> The answer is that shell scripts in scripts don't need
> to be chmod +x to work. In fact most are not.
> Of the tests I found from a simple search:
> 65 are chmod +x
> 84 are chmod -x

Great.  Please re-apply the change with something like that in the
commit message, when you get a chance.  It shouldn't take more than a
minute or two.

Conrad
___
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: r326614 - in head: etc/mtree usr.bin usr.bin/sponge usr.bin/tee

2017-12-08 Thread Kyle Evans
On Dec 8, 2017 8:07 PM, "Eitan Adler"  wrote:

On 8 December 2017 at 12:11, Rodney W. Grimes
 wrote:

> Ping, I have not seen this reverted and recommitted with a reasonable
> explination as to why this change is actually desired.

Sorry, work has been busy and as the crux was reverted it didn't feel
as urgent[0]. The answer is that shell scripts in scripts don't need
to be chmod +x to work. In fact most are not.
Of the tests I found from a simple search:
65 are chmod +x
84 are chmod -x

The entirety of the changed config is:
"chmod": {
  "type": "chmod",
+  "exclude": "(/tests/)"
},

which simply disables this test during 'arc diff'.


+1 to this change, but I think it would've been worthy of its own commit. I
don't recall off-hand if it's ATF-specific or not- in that case, at least,
the scripts are merely being processed into atf-sh script for when it ends
up in /usr/tests.

It's probably worth double checking the non-ATF case to make sure -x won't
break their expected execution, though.

- Kyle Evans
___
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: r326724 - head/share/misc

2017-12-08 Thread Warner Losh
Author: imp
Date: Sat Dec  9 05:05:25 2017
New Revision: 326724
URL: https://svnweb.freebsd.org/changeset/base/326724

Log:
  Add two dates derived from looking at archival source tarballs in the
  TUHS collection for 7th Edition and V32.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Sat Dec  9 03:45:23 2017
(r326723)
+++ head/share/misc/bsd-family-tree Sat Dec  9 05:05:25 2017
(r326724)
@@ -408,7 +408,7 @@ Fifth   Edition 1974-06-xx [QCU]
above 50 installations
 Sixth   Edition 1975-05-xx [QCU]
port to DEC Vax
-Seventh Edition 1979-01-xx [QCU]
+Seventh Edition 1979-01-xx [QCU] 1979-01-10 [TUHS]
first portable UNIX
 Eighth  Edition 1985-02-xx [QCU]
VAX 11/750, VAX 11/780 [dmr]
@@ -440,7 +440,7 @@ Tenth   Edition 1989-10-xx [QCU]
 2.11BSD1992-02-xx [SMS]
 2.11BSD rev #430   1999-12-13 [SMS]
 
-32V1978-1[01]-xx [QCU]
+32V1978-1[01]-xx [QCU] 1979-03-26 [TUHS]
 3BSDlate 1979 [QCU] March 1980 [TUHS]
virtual memory, page replacement,
demand paging
___
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: r326725 - in head/usr.sbin: . efibootmgr

2017-12-08 Thread Warner Losh
Author: imp
Date: Sat Dec  9 06:52:20 2017
New Revision: 326725
URL: https://svnweb.freebsd.org/changeset/base/326725

Log:
  Import Netflix's efibootmgr to help manage UEFI boot variables
  
  efibootmgr manages the UEFI Boot variables that implement the UEFI
  Boot Manager protocol defined in the UEFI standards. It is modeled
  after the Linux program of the same name with a mostly compatible set
  of command line options. Since there's a fair amount of OS specifioc
  code due to differeing names and methods of doing things, the
  compatibility isn't 100%.
  
  Basic functionality is implemented, though the more advanced next boot
  functionality that's been defined elsewhere is unimplemented.
  
  Submitted by: Matt Williams (with unix / efi path xlate by me)
  Sponsored by: Netflix

Added:
  head/usr.sbin/efibootmgr/
  head/usr.sbin/efibootmgr/Makefile   (contents, props changed)
  head/usr.sbin/efibootmgr/efibootmgr.8   (contents, props changed)
  head/usr.sbin/efibootmgr/efibootmgr.c   (contents, props changed)
Modified:
  head/usr.sbin/Makefile

Modified: head/usr.sbin/Makefile
==
--- head/usr.sbin/Makefile  Sat Dec  9 05:05:25 2017(r326724)
+++ head/usr.sbin/Makefile  Sat Dec  9 06:52:20 2017(r326725)
@@ -123,7 +123,7 @@ SUBDIR.${MK_BSNMP}+=bsnmpd
 SUBDIR.${MK_CTM}+= ctm
 SUBDIR.${MK_CXGBETOOL}+=   cxgbetool
 SUBDIR.${MK_DIALOG}+=  bsdconfig
-SUBDIR.${MK_EFI}+= efivar efidp
+SUBDIR.${MK_EFI}+= efivar efidp efibootmgr
 SUBDIR.${MK_FLOPPY}+=  fdcontrol
 SUBDIR.${MK_FLOPPY}+=  fdformat
 SUBDIR.${MK_FLOPPY}+=  fdread

Added: head/usr.sbin/efibootmgr/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/efibootmgr/Makefile   Sat Dec  9 06:52:20 2017
(r326725)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+EFIBOOT=${SRCTOP}/stand/efi
+EFIINCL=${SRCTOP}/stand/efi/include
+EFIVAR=${SRCTOP}/usr.sbin/efivar
+.PATH: ${EFIBOOT}/libefi ${EFIVAR}
+CFLAGS+= -I${EFIVAR} -I${EFIINCL}
+
+PROG=efibootmgr
+MAN=   efibootmgr.8
+SRCS= efichar.c efiutil.c efibootmgr.c
+
+LIBADD= efivar geom
+
+.include 

Added: head/usr.sbin/efibootmgr/efibootmgr.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/efibootmgr/efibootmgr.8   Sat Dec  9 06:52:20 2017
(r326725)
@@ -0,0 +1,150 @@
+.\" Copyright (c) 2017 Netflix, Inc
+.\" All rights reserved.
+.\"
+.\" 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$
+.\"
+.Dd December 8, 2017
+.Dt EFIBOOTMGR 8
+.Os
+.Sh NAME
+.Nm efibootmgr 
+.Nd manipulate the EFI Boot Manager
+.Sh SYNOPSIS
+.Op Fl aAnNB Ar Bootvar
+.Op Fl t Ar timeout
+.Op Fl T
+.Op Fl o Ar bootorder
+.Op Fl verbose
+.Op Fl c -k Ar kernel -l Ar loader [-L Ar label] [--dry-run] 
+.Sh "DESCRIPTION"
+.Nm
+manipulates how UEFI Boot Managers boot the system.
+Methods of booting can be created and destroyed.
+Boot methods can be activated or deactivated.
+The order of boot methods tried can be changed.
+Temporary boot methods can override the usual booting methods.
+.Pp
+The UEFI standard defines how hosts may control what is used to
+bootstrap the system.
+Each method is encapsulated within a persistent UEFI variable, stored
+by the UEFI BIOS of the form
+.Va Boot .
+These variables are numbered, describe where to load the bootstrap
+program from, and whether or not the method is active.
+The boot order of these methods is controlled by another variable
+.Va BootOrder .
+The currently booting metho

svn commit: r326726 - head/usr.sbin/efibootmgr

2017-12-08 Thread Warner Losh
Author: imp
Date: Sat Dec  9 06:57:19 2017
New Revision: 326726
URL: https://svnweb.freebsd.org/changeset/base/326726

Log:
  Forgotten in 326725
  
  Release Notes: Yes

Modified:
  head/usr.sbin/efibootmgr/efibootmgr.c

Modified: head/usr.sbin/efibootmgr/efibootmgr.c
==
--- head/usr.sbin/efibootmgr/efibootmgr.c   Sat Dec  9 06:52:20 2017
(r326725)
+++ head/usr.sbin/efibootmgr/efibootmgr.c   Sat Dec  9 06:57:19 2017
(r326726)
@@ -314,7 +314,7 @@ read_vars(void)
LIST_INIT(&efivars);
while ((ret = efi_get_next_variable_name(&guid, &next_name)) > 0) {
/*
-* Only pay attention to the EFI:Boot variables to get the 
list.
+* Only pay attention to EFI:Boot variables to get the list.
 */
if (efi_guid_cmp(guid, &EFI_GLOBAL_GUID) != 0 ||
strlen(next_name) != 8 ||
___
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: r326728 - head/usr.sbin/efibootmgr

2017-12-08 Thread Warner Losh
Author: imp
Date: Sat Dec  9 07:44:00 2017
New Revision: 326728
URL: https://svnweb.freebsd.org/changeset/base/326728

Log:
  Indent multiple device path entries correctly.
  
  Sponsored by: Netflix

Modified:
  head/usr.sbin/efibootmgr/efibootmgr.c

Modified: head/usr.sbin/efibootmgr/efibootmgr.c
==
--- head/usr.sbin/efibootmgr/efibootmgr.c   Sat Dec  9 07:43:55 2017
(r326727)
+++ head/usr.sbin/efibootmgr/efibootmgr.c   Sat Dec  9 07:44:00 2017
(r326728)
@@ -704,6 +704,7 @@ print_loadopt_str(uint8_t *data, size_t datalen)
int len;
int optlen;
int rv;
+   int indent;
 
if (datalen < sizeof(attr) + sizeof(fplen) + sizeof(efi_char))
return;
@@ -729,13 +730,15 @@ print_loadopt_str(uint8_t *data, size_t datalen)
opt = walker;
optlen = ep - walker;
 
+   indent = 1;
while (dp < edp) {
efidp_format_device_path(buf, sizeof(buf), dp,
(intptr_t)(void *)edp - (intptr_t)(void *)dp);
-   printf(" %s\n", buf);
+   printf("%*s%s\n", indent, "", buf);
+   indent = 10 + len + 1;
rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, 
&abspath);
if (rv == 0) {
-   printf("  %s:%s %s\n", dev, relpath, abspath);
+   printf("%*s%s:%s %s\n", indent + 4, "", dev, relpath, 
abspath);
free(dev);
free(relpath);
free(abspath);
___
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: r326727 - head/usr.sbin/efibootmgr

2017-12-08 Thread Warner Losh
Author: imp
Date: Sat Dec  9 07:43:55 2017
New Revision: 326727
URL: https://svnweb.freebsd.org/changeset/base/326727

Log:
  Remove vestiges of -d and -p commands.
  Fix two core dumps when optional data isn't specified.
  
  Sponsored by: Netflix

Modified:
  head/usr.sbin/efibootmgr/efibootmgr.c

Modified: head/usr.sbin/efibootmgr/efibootmgr.c
==
--- head/usr.sbin/efibootmgr/efibootmgr.c   Sat Dec  9 06:57:19 2017
(r326726)
+++ head/usr.sbin/efibootmgr/efibootmgr.c   Sat Dec  9 07:43:55 2017
(r326727)
@@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
 #define BAD_LENGTH ((size_t)-1)

 typedef struct _bmgr_opts {
-   char*dev;
char*env;
char*loader;
char*label;
@@ -84,7 +83,6 @@ typedef struct _bmgr_opts {
booldel_timeout;
booldry_run;
boolonce;
-   int part;
int cp_src;
boolset_active;
boolset_bootnext;
@@ -194,7 +192,7 @@ parse_args(int argc, char *argv[])
 {
int ch;
 
-   while ((ch = getopt_long(argc, argv, 
"A:a:B:C:cDd:e:hk:L:l:Nn:Oo:p:Tt:v",
+   while ((ch = getopt_long(argc, argv, "A:a:B:C:cDe:hk:L:l:Nn:Oo:Tt:v",
lopts, NULL)) != -1) {
switch (ch) {
case 'A':
@@ -218,9 +216,6 @@ parse_args(int argc, char *argv[])
case 'D': /* should be remove dups XXX */
opts.dry_run = true;
break;
-   case 'd':
-   opts.dev = optarg;
-   break;
case 'e':
opts.env = strdup(optarg);
break;
@@ -251,9 +246,6 @@ parse_args(int argc, char *argv[])
case 'o':
opts.order = strdup(optarg);
break;
-   case 'p':
-   opts.part = strtoul(optarg, NULL, 10);
-   break;
case 'T':
opts.del_timeout = true;
break;
@@ -267,7 +259,7 @@ parse_args(int argc, char *argv[])
}
}
if (opts.create) {
-   if (!(opts.loader && opts.dev && opts.part))
+   if (!opts.loader)
errx(1, "%s",CREATE_USAGE);
return;
}
@@ -598,7 +590,12 @@ create_loadopt(uint8_t *buf, size_t bufmax, uint32_t a
/*
 * Compute the length to make sure the passed in buffer is long enough.
 */
-   utf8_to_ucs2(description, &bbuf, &desc_len);
+   if (description)
+   utf8_to_ucs2(description, &bbuf, &desc_len);
+   else {
+   desc_len = 0;
+   bbuf = NULL;
+   }
len = sizeof(uint32_t) + sizeof(uint16_t) + desc_len + dp_size + 
optional_data_size;
if (len > bufmax) {
free(bbuf);
@@ -665,7 +662,7 @@ make_boot_var(const char *label, const char *loader, c
err(1, "malloc");
 
lopt_size = create_loadopt(load_opt_buf, MAX_LOADOPT_LEN, load_attrs,
-   dp, llen + klen, label, env, strlen(env) + 1);
+   dp, llen + klen, label, env, env ? strlen(env) + 1 : 0);
if (lopt_size == BAD_LENGTH)
errx(1, "Can't crate loadopt");
 
___
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"