Re: svn commit: r325825 - head/sys/kern

2017-11-15 Thread Bruce Evans

On Tue, 14 Nov 2017, Ed Maste wrote:


Log:
 disallow clock_settime too far in the future to avoid panic

 clock_ts_to_ct has a KASSERT that the converted year fits into four
 digits.  By default (sysctl debug.allow_insane_settime is 0) the kernel
 disallows a time too far in the future, using a value of  366-day
 years.  However, clock_settime is epoch-relative and the assertion will
 fail with a tv_sec corresponding to some 8030 years.

 Avoid trying to be too clever, and just use a limit of 8000 365-day
 years past the epoch.

 Submitted by:  Heqing Yan 
 Reported by:   Syzkaller (https://github.com/google/syzkaller)
 MFC after: 1 week
 Sponsored by:  The FreeBSD Foundation


I reported this panic and several others in reply to previous attempted fixes.


Modified: head/sys/kern/kern_time.c
==
--- head/sys/kern/kern_time.c   Tue Nov 14 18:17:23 2017(r325824)
+++ head/sys/kern/kern_time.c   Tue Nov 14 18:18:18 2017(r325825)
@@ -408,7 +408,7 @@ kern_clock_settime(struct thread *td, clockid_t clock_
if (ats->tv_nsec < 0 || ats->tv_nsec >= 10 ||
ats->tv_sec < 0)
return (EINVAL);
-   if (!allow_insane_settime && ats->tv_sec > ULL * 366 * 24 * 60 * 60)
+   if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60)
return (EINVAL);
/* XXX Don't convert nsec->usec and back */
TIMESPEC_TO_TIMEVAL(&atv, ats);


Panics still occur when year 10K is reached via:

tv_sec = 8000ULL * 365 * 24 * 60 * 60 - 1 (approx. 7994.5 years)
POSIX Epoch offset = 1970 years
utc_offset() <= (approx. 7994.5 + 1970) - 10 = approx. -36.5 years
(utc_offset() in seconds is the combined timezone offset
  60 * tz.tz_minuteswest + (wall_cmos_clock ? adjkerntz : 0).)

A utc_offset() of -36.5 years is preposterous but easy to reach without
overflow (utc_offset() has blind overflow at approx. +-69 years).

For 32-bit time_t, both of the above abominable ULL checks are vacuously
false, but panics still occurs for all widths of time_t with non-
preposterous values near the Epoch:

tv_sec = 0  (Epoch in UTC)
utc_offset() = 10 * 60  (garbage or panic in RTC; should be 1969)

Wthout INVARIANTS, this writes the RTC with the garbage time 70/01/01
00:5c:05, where at least the 5c is from a buffer overrun.  With
INVARIANTS, garbage produced by clock_tv_to_ct() is detected there.

   tv_sec = INT_MAX (2038 in UTC)
   utc_offset() = -1(garbage or panic in RTC; should be EINVAL)

This takes 32-bit time_t.  Then tv_sec - utc_offset() blindly overflows
to INT_MIN on supported arches.  The resulting garbage or panic in the
RTC is not much worse than for any other negative value of
tv_sec - utc_offset().

The settime() level doesn't know about utc_offset() (except for the
historical mistake of setting the timezone using settimeofday()), and
this is correct.  Only the RTC level uses utc_offset() (or the timezone).
The correct error handling is to not KASSERT() anything, but avoid overflow
and just don't continue after overflow or set the RTC to a preposterous
or unportable value.

Bruce
___
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: r325841 - in head/sys: conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib modules/mlx4

2017-11-15 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Nov 15 11:14:39 2017
New Revision: 325841
URL: https://svnweb.freebsd.org/changeset/base/325841

Log:
  Update the mlx4 core and mlx4en(4) modules towards Linux v4.9.
  
  Background:
  The coming ibcore update forces an update of mlx4ib(4) which in turn requires
  an updated mlx4 core module. This also affects the mlx4en(4) module because
  commonly used APIs are updated. This commit is a middle step updating the
  mlx4 modules towards the new ibcore.
  
  This change contains no major new features.
  
  Changes in mlx4:
a) Improved error handling when mlx4 PCI devices are
detached inside VMs.
b) Major update of codebase towards Linux 4.9.
  
  Changes in mlx4ib(4):
a) Minimal changes needed in order to compile using the
updated mlx4 core APIs.
  
  Changes in mlx4en(4):
a) Update flow steering code in mlx4en to use new APIs for
registering MAC addresses and IP addresses.
b) Update all statistics counters to be 64-bit.
c) Minimal changes needed in order to compile using the
updated mlx4 core APIs.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Added:
  head/sys/dev/mlx4/mlx4_core/fw_qos.h   (contents, props changed)
  head/sys/dev/mlx4/mlx4_core/mlx4_fw_qos.c   (contents, props changed)
Deleted:
  head/sys/dev/mlx4/mlx4_core/mlx4_sys_tune.c
Modified:
  head/sys/conf/files
  head/sys/dev/mlx4/cmd.h
  head/sys/dev/mlx4/cq.h
  head/sys/dev/mlx4/device.h
  head/sys/dev/mlx4/driver.h
  head/sys/dev/mlx4/mlx4_core/fw.h
  head/sys/dev/mlx4/mlx4_core/icm.h
  head/sys/dev/mlx4/mlx4_core/mlx4.h
  head/sys/dev/mlx4/mlx4_core/mlx4_alloc.c
  head/sys/dev/mlx4/mlx4_core/mlx4_catas.c
  head/sys/dev/mlx4/mlx4_core/mlx4_cmd.c
  head/sys/dev/mlx4/mlx4_core/mlx4_cq.c
  head/sys/dev/mlx4/mlx4_core/mlx4_eq.c
  head/sys/dev/mlx4/mlx4_core/mlx4_fw.c
  head/sys/dev/mlx4/mlx4_core/mlx4_icm.c
  head/sys/dev/mlx4/mlx4_core/mlx4_intf.c
  head/sys/dev/mlx4/mlx4_core/mlx4_main.c
  head/sys/dev/mlx4/mlx4_core/mlx4_mcg.c
  head/sys/dev/mlx4/mlx4_core/mlx4_mr.c
  head/sys/dev/mlx4/mlx4_core/mlx4_pd.c
  head/sys/dev/mlx4/mlx4_core/mlx4_port.c
  head/sys/dev/mlx4/mlx4_core/mlx4_profile.c
  head/sys/dev/mlx4/mlx4_core/mlx4_qp.c
  head/sys/dev/mlx4/mlx4_core/mlx4_reset.c
  head/sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c
  head/sys/dev/mlx4/mlx4_core/mlx4_sense.c
  head/sys/dev/mlx4/mlx4_core/mlx4_srq.c
  head/sys/dev/mlx4/mlx4_en/en.h
  head/sys/dev/mlx4/mlx4_en/en_port.h
  head/sys/dev/mlx4/mlx4_en/mlx4_en_cq.c
  head/sys/dev/mlx4/mlx4_en/mlx4_en_main.c
  head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
  head/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
  head/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c
  head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
  head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cq.c
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mr.c
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_srq.c
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_sysfs.c
  head/sys/dev/mlx4/qp.h
  head/sys/dev/mlx4/stats.h
  head/sys/modules/mlx4/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Nov 15 06:45:33 2017(r325840)
+++ head/sys/conf/files Wed Nov 15 11:14:39 2017(r325841)
@@ -4569,6 +4569,8 @@ dev/mlx4/mlx4_core/mlx4_eq.c  
optional mlx4 pci \
compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_fw.c   optional mlx4 pci \
compile-with "${OFED_C}"
+dev/mlx4/mlx4_core/mlx4_fw_qos.c   optional mlx4 pci \
+   compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_icm.c  optional mlx4 pci \
compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_intf.c optional mlx4 pci \
@@ -4594,8 +4596,6 @@ dev/mlx4/mlx4_core/mlx4_sense.c   
optional mlx4 pci \
 dev/mlx4/mlx4_core/mlx4_srq.c  optional mlx4 pci \
compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_resource_tracker.c optional mlx4 pci \
-   compile-with "${OFED_C}"
-dev/mlx4/mlx4_core/mlx4_sys_tune.c optional mlx4 pci \
compile-with "${OFED_C}"
 
 dev/mlx4/mlx4_en/mlx4_en_cq.c  optional mlx4en pci inet inet6  
\

Modified: head/sys/dev/mlx4/cmd.h
==
--- head/sys/dev/mlx4/cmd.h Wed Nov 15 06:45:33 2017(r325840)
+++ head/sys/dev/mlx4/cmd.h Wed Nov 15 11:14:39 2017(r325841)
@@ -36,6 +36,8 @@
 #include 
 #include 
 
+struct mlx4_counter;
+
 enum {
/* initialization and general commands */
MLX4_CMD_SYS_EN  = 0x1,
@@ -67,8 +69,13 @@ enum {
MLX4_CMD_MAP_ICM_AUX = 0xffc,
MLX4_CMD_UNMAP_ICM_AUX   = 0xffb,
MLX4_CMD_SET_ICM_SIZE= 0xffd,
+   MLX4_

svn commit: r325844 - stable/11/lib/libutil

2017-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 15 12:17:51 2017
New Revision: 325844
URL: https://svnweb.freebsd.org/changeset/base/325844

Log:
  MFC r325716:
  
  Fix some nroff style issue

Modified:
  stable/11/lib/libutil/hexdump.3
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libutil/hexdump.3
==
--- stable/11/lib/libutil/hexdump.3 Wed Nov 15 11:35:02 2017
(r325843)
+++ stable/11/lib/libutil/hexdump.3 Wed Nov 15 12:17:51 2017
(r325844)
@@ -42,14 +42,9 @@
 The
 .Fn hexdump
 function prints an array of bytes to standard out in hexadecimal form,
-along with the
-.Tn ASCII
-representation of the bytes, if possible.
-By default, each line of
-output will start with an offset count, followed by 16 hexadecimal values,
-followed by 16
-.Tn ASCII
-characters.
+along with the ASCII representation of the bytes, if possible.
+By default, each line of output will start with an offset count, followed by 16
+hexadecimal values, followed by 16 ASCII characters.
 .Bl -tag -width indent
 .It Fa ptr
 Pointer to the array of bytes to print.
@@ -73,12 +68,10 @@ Flags for controlling the formatting of the output.
 Integer value of the number of bytes to display on each line.
 A value of 0 implies that the default value of 16 will be used.
 .It Bits 8-15
-Character
-.Tn ASCII
-value to use as the separator for the hexadecimal output.
+Character ASCII value to use as the separator for the hexadecimal output.
 A value of 0 implies that the default value of 32
-.Tn ( ASCII
-space) will be used.
+.Pq ASCII space
+will be used.
 .It Dv HD_OMIT_COUNT
 Do not print the offset column at the beginning of each line.
 .It Dv HD_OMIT_HEX
___
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: r325845 - stable/10/lib/libutil

2017-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 15 12:19:11 2017
New Revision: 325845
URL: https://svnweb.freebsd.org/changeset/base/325845

Log:
  MFC r325716:
  
  Fix some nroff style issue

Modified:
  stable/10/lib/libutil/hexdump.3
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libutil/hexdump.3
==
--- stable/10/lib/libutil/hexdump.3 Wed Nov 15 12:17:51 2017
(r325844)
+++ stable/10/lib/libutil/hexdump.3 Wed Nov 15 12:19:11 2017
(r325845)
@@ -42,14 +42,9 @@
 The
 .Fn hexdump
 function prints an array of bytes to standard out in hexadecimal form,
-along with the
-.Tn ASCII
-representation of the bytes, if possible.
-By default, each line of
-output will start with an offset count, followed by 16 hexadecimal values,
-followed by 16
-.Tn ASCII
-characters.
+along with the ASCII representation of the bytes, if possible.
+By default, each line of output will start with an offset count, followed by 16
+hexadecimal values, followed by 16 ASCII characters.
 .Bl -tag -width indent
 .It Fa ptr
 Pointer to the array of bytes to print.
@@ -73,12 +68,10 @@ Flags for controlling the formatting of the output.
 Integer value of the number of bytes to display on each line.
 A value of 0 implies that the default value of 16 will be used.
 .It Bits 8-15
-Character
-.Tn ASCII
-value to use as the separator for the hexadecimal output.
+Character ASCII value to use as the separator for the hexadecimal output.
 A value of 0 implies that the default value of 32
-.Tn ( ASCII
-space) will be used.
+.Pq ASCII space
+will be used.
 .It Dv HD_OMIT_COUNT
 Do not print the offset column at the beginning of each line.
 .It Dv HD_OMIT_HEX
___
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: r325846 - stable/11/usr.bin/rctl

2017-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 15 12:20:53 2017
New Revision: 325846
URL: https://svnweb.freebsd.org/changeset/base/325846

Log:
  MFC r325717:
  
  Remove __unused attributed on arguments that are actually used

Modified:
  stable/11/usr.bin/rctl/rctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/rctl/rctl.c
==
--- stable/11/usr.bin/rctl/rctl.c   Wed Nov 15 12:19:11 2017
(r325845)
+++ stable/11/usr.bin/rctl/rctl.c   Wed Nov 15 12:20:53 2017
(r325846)
@@ -586,7 +586,7 @@ usage(void)
 }
 
 int
-main(int argc __unused, char **argv __unused)
+main(int argc, char **argv)
 {
int ch, aflag = 0, hflag = 0, nflag = 0, lflag = 0, rflag = 0,
uflag = 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: r325847 - stable/10/usr.bin/rctl

2017-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 15 12:21:06 2017
New Revision: 325847
URL: https://svnweb.freebsd.org/changeset/base/325847

Log:
  MFC r325717:
  
  Remove __unused attributed on arguments that are actually used

Modified:
  stable/10/usr.bin/rctl/rctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/rctl/rctl.c
==
--- stable/10/usr.bin/rctl/rctl.c   Wed Nov 15 12:20:53 2017
(r325846)
+++ stable/10/usr.bin/rctl/rctl.c   Wed Nov 15 12:21:06 2017
(r325847)
@@ -494,7 +494,7 @@ usage(void)
 }
 
 int
-main(int argc __unused, char **argv __unused)
+main(int argc, char **argv)
 {
int ch, aflag = 0, hflag = 0, nflag = 0, lflag = 0, rflag = 0,
uflag = 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: r325848 - stable/11/share/misc

2017-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 15 12:22:56 2017
New Revision: 325848
URL: https://svnweb.freebsd.org/changeset/base/325848

Log:
  MFC r325737:
  
  Update to 2017.10.21

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_vendorsWed Nov 15 12:21:06 2017
(r325847)
+++ stable/11/share/misc/pci_vendorsWed Nov 15 12:22:56 2017
(r325848)
@@ -3,8 +3,8 @@
 #
 #  List of PCI ID's
 #
-#  Version: 2017.09.01
-#  Date:2017-09-01 03:15:02
+#  Version: 2017.10.21
+#  Date:2017-10-21 03:15:01
 #
 #  Maintained by Albert Pool, Martin Mares, and other volunteers from
 #  the PCI ID Project at http://pci-ids.ucw.cz/.
@@ -79,18 +79,18 @@
 0b0b  Rhino Equipment Corp.
0105  R1T1
0205  R4FXO
-   0206  RCB4FXO 4-channel FXO analog telphony card
+   0206  RCB4FXO 4-channel FXO analog telephony card
0305  R4T1
0405  R8FXX
-   0406  RCB8FXX 8-channel modular analog telphony card
+   0406  RCB8FXX 8-channel modular analog telephony card
0505  R24FXX
-   0506  RCB24FXS 24-Channel FXS analog telphony card
+   0506  RCB24FXS 24-Channel FXS analog telephony card
0605  R2T1
0705  R24FXS
-   0706  RCB24FXO 24-Channel FXO analog telphony card
+   0706  RCB24FXO 24-Channel FXO analog telephony card
0905  R1T3 Single T3 Digital Telephony Card
-   0906  RCB24FXX 24-channel modular analog telphony card
-   0a06  RCB672FXX 672-channel modular analog telphony card
+   0906  RCB24FXX 24-channel modular analog telephony card
+   0a06  RCB672FXX 672-channel modular analog telephony card
 0e11  Compaq Computer Corporation
0001  PCI to EISA Bridge
0002  PCI to ISA Bridge
@@ -251,6 +251,9 @@
1028 1fd4  PERC H745P MX
1d49 0602  ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter
1d49 0604  ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter
+   8086 352d  Integrated RAID Module RMSP3AD160F
+   8086 9460  RAID Controller RSP3TD160F
+   8086 9480  RAID Controller RSP3MD088F
0015  MegaRAID Tri-Mode SAS3416
0016  MegaRAID Tri-Mode SAS3508
1028 1fc9  PERC H840 Adapter
@@ -260,9 +263,15 @@
1d49 0601  ThinkSystem RAID 930-8i 2GB Flash PCIe 12Gb Adapter
1d49 0603  ThinkSystem RAID 930-24i 4GB Flash PCIe 12Gb Adapter
1d49 0604  ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter
+   8086 352e  Integrated RAID Module RMSP3CD080F
+   8086 352f  Integrated RAID Module RMSP3HD080E
+   8086 9461  RAID Controller RSP3DD080F
0017  MegaRAID Tri-Mode SAS3408
1d49 0500  ThinkSystem RAID 530-8i PCIe 12Gb Adapter
1d49 0502  ThinkSystem RAID 530-8i Dense Adapter
+   8086 3528  Integrated RAID RMSP3LD060
+   8086 3529  Integrated RAID RMSP3LD060
+   8086 9441  RAID Controller RSP3WD080E
001b  MegaRAID Tri-Mode SAS3504
1d49 0605  ThinkSystem RAID 930-4i 2GB Flash Flex Adapter
001c  MegaRAID Tri-Mode SAS3404
@@ -586,9 +595,12 @@
1028 1fd3  HBA330 MMZ
1bd4 0011  Inspur 12Gb 8i-3008 IT SAS HBA
00ab  SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC)
+   8086 3530  Integrated RAID Module RMSP3JD160J
00ac  SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
1d49 0201  ThinkSystem 430-16i SAS/SATA 12Gb HBA
1d49 0203  ThinkSystem 430-16e SAS/SATA 12Gb HBA
+   8086 3000  RAID Controller RSP3QD160J
+   8086 3020  RAID Controller RSP3GD016J
00ae  SAS3508 Fusion-MPT Tri-Mode RAID On Chip (ROC)
00af  SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
1d49 0200  ThinkSystem 430-8i SAS/SATA 12Gb HBA
@@ -614,6 +626,9 @@
00d0  SAS3716 Fusion-MPT Tri-Mode RAID Controller Chip (ROC)
00d1  SAS3616 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
00d3  MegaRAID Tri-Mode SAS3716W
+   02b0  Virtual Endpoint on PCIe Switch
+   1d49 0001  ThinkSystem 1610-4P NVMe Switch Adapter
+   1d49 0002  ThinkSystem 810-4P NVMe Switch Adapter
0407  MegaRAID
1000 0530  MegaRAID 530 SCSI 320-0X RAID Controller
1000 0531  MegaRAID 531 SCSI 320-4X RAID Controller
@@ -904,6 +919,7 @@
1043 836c  M4A785TD Motherboard
1043 8410  M4A89GTD PRO/USB3 Motherboard
1043 841b  M5A88-V EVO
+   105b 0e13  N15235/A74MX mainboard / AMD SB700
1179 ff50  Satellite P305D-S8995E
1458 a022  GA-MA770-DS3rev2.0 Motherboard
   

svn commit: r325849 - stable/10/share/misc

2017-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 15 12:23:01 2017
New Revision: 325849
URL: https://svnweb.freebsd.org/changeset/base/325849

Log:
  MFC r325737:
  
  Update to 2017.10.21

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_vendorsWed Nov 15 12:22:56 2017
(r325848)
+++ stable/10/share/misc/pci_vendorsWed Nov 15 12:23:01 2017
(r325849)
@@ -3,8 +3,8 @@
 #
 #  List of PCI ID's
 #
-#  Version: 2017.09.01
-#  Date:2017-09-01 03:15:02
+#  Version: 2017.10.21
+#  Date:2017-10-21 03:15:01
 #
 #  Maintained by Albert Pool, Martin Mares, and other volunteers from
 #  the PCI ID Project at http://pci-ids.ucw.cz/.
@@ -79,18 +79,18 @@
 0b0b  Rhino Equipment Corp.
0105  R1T1
0205  R4FXO
-   0206  RCB4FXO 4-channel FXO analog telphony card
+   0206  RCB4FXO 4-channel FXO analog telephony card
0305  R4T1
0405  R8FXX
-   0406  RCB8FXX 8-channel modular analog telphony card
+   0406  RCB8FXX 8-channel modular analog telephony card
0505  R24FXX
-   0506  RCB24FXS 24-Channel FXS analog telphony card
+   0506  RCB24FXS 24-Channel FXS analog telephony card
0605  R2T1
0705  R24FXS
-   0706  RCB24FXO 24-Channel FXO analog telphony card
+   0706  RCB24FXO 24-Channel FXO analog telephony card
0905  R1T3 Single T3 Digital Telephony Card
-   0906  RCB24FXX 24-channel modular analog telphony card
-   0a06  RCB672FXX 672-channel modular analog telphony card
+   0906  RCB24FXX 24-channel modular analog telephony card
+   0a06  RCB672FXX 672-channel modular analog telephony card
 0e11  Compaq Computer Corporation
0001  PCI to EISA Bridge
0002  PCI to ISA Bridge
@@ -251,6 +251,9 @@
1028 1fd4  PERC H745P MX
1d49 0602  ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter
1d49 0604  ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter
+   8086 352d  Integrated RAID Module RMSP3AD160F
+   8086 9460  RAID Controller RSP3TD160F
+   8086 9480  RAID Controller RSP3MD088F
0015  MegaRAID Tri-Mode SAS3416
0016  MegaRAID Tri-Mode SAS3508
1028 1fc9  PERC H840 Adapter
@@ -260,9 +263,15 @@
1d49 0601  ThinkSystem RAID 930-8i 2GB Flash PCIe 12Gb Adapter
1d49 0603  ThinkSystem RAID 930-24i 4GB Flash PCIe 12Gb Adapter
1d49 0604  ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter
+   8086 352e  Integrated RAID Module RMSP3CD080F
+   8086 352f  Integrated RAID Module RMSP3HD080E
+   8086 9461  RAID Controller RSP3DD080F
0017  MegaRAID Tri-Mode SAS3408
1d49 0500  ThinkSystem RAID 530-8i PCIe 12Gb Adapter
1d49 0502  ThinkSystem RAID 530-8i Dense Adapter
+   8086 3528  Integrated RAID RMSP3LD060
+   8086 3529  Integrated RAID RMSP3LD060
+   8086 9441  RAID Controller RSP3WD080E
001b  MegaRAID Tri-Mode SAS3504
1d49 0605  ThinkSystem RAID 930-4i 2GB Flash Flex Adapter
001c  MegaRAID Tri-Mode SAS3404
@@ -586,9 +595,12 @@
1028 1fd3  HBA330 MMZ
1bd4 0011  Inspur 12Gb 8i-3008 IT SAS HBA
00ab  SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC)
+   8086 3530  Integrated RAID Module RMSP3JD160J
00ac  SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
1d49 0201  ThinkSystem 430-16i SAS/SATA 12Gb HBA
1d49 0203  ThinkSystem 430-16e SAS/SATA 12Gb HBA
+   8086 3000  RAID Controller RSP3QD160J
+   8086 3020  RAID Controller RSP3GD016J
00ae  SAS3508 Fusion-MPT Tri-Mode RAID On Chip (ROC)
00af  SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
1d49 0200  ThinkSystem 430-8i SAS/SATA 12Gb HBA
@@ -614,6 +626,9 @@
00d0  SAS3716 Fusion-MPT Tri-Mode RAID Controller Chip (ROC)
00d1  SAS3616 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
00d3  MegaRAID Tri-Mode SAS3716W
+   02b0  Virtual Endpoint on PCIe Switch
+   1d49 0001  ThinkSystem 1610-4P NVMe Switch Adapter
+   1d49 0002  ThinkSystem 810-4P NVMe Switch Adapter
0407  MegaRAID
1000 0530  MegaRAID 530 SCSI 320-0X RAID Controller
1000 0531  MegaRAID 531 SCSI 320-4X RAID Controller
@@ -904,6 +919,7 @@
1043 836c  M4A785TD Motherboard
1043 8410  M4A89GTD PRO/USB3 Motherboard
1043 841b  M5A88-V EVO
+   105b 0e13  N15235/A74MX mainboard / AMD SB700
1179 ff50  Satellite P305D-S8995E
1458 a022  GA-MA770-DS3rev2.0 Motherboard
   

svn commit: r325850 - head/sbin/pfctl

2017-11-15 Thread Kristof Provost
Author: kp
Date: Wed Nov 15 12:27:02 2017
New Revision: 325850
URL: https://svnweb.freebsd.org/changeset/base/325850

Log:
  pfctl: teach route-to to deal with interfaces with multiple addresses
  
  The route_host parsing code set the interface name, but only for the first
  node_host in the list. If that one happened to be the inet6 address and the
  rule wanted an inet address it'd get removed by remove_invalid_hosts() later
  on, and we'd have no interface name.
  
  We must set the interface name for all node_host entries in the list, not just
  the first one.
  
  PR:   223208
  MFC after:2 weeks

Modified:
  head/sbin/pfctl/parse.y

Modified: head/sbin/pfctl/parse.y
==
--- head/sbin/pfctl/parse.y Wed Nov 15 12:23:01 2017(r325849)
+++ head/sbin/pfctl/parse.y Wed Nov 15 12:27:02 2017(r325850)
@@ -4390,8 +4390,11 @@ route_host   : STRING{
$$->tail = $$;
}
| '(' STRING host ')'   {
+   struct node_host *n;
+
$$ = $3;
-   $$->ifname = $2;
+   for (n = $3; n != NULL; n = n->next)
+   n->ifname = $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: r325851 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 15 12:48:36 2017
New Revision: 325851
URL: https://svnweb.freebsd.org/changeset/base/325851

Log:
  remove the poor emulation of the IllumOS needfree global variable to prevent
  the ARC reclaim thread running longer than needed.
  
  Update the arc::needfree dtrace probe triggered in arc_lowmem() to also report
  the value we may want to free.
  
  Submitted by: Nikita Kozlov 
  Reviewed by:  avg
  Approved by:  avg
  MFC after:3 weeks
  Sponsored by: blade
  Differential Revision:https://reviews.freebsd.org/D12163

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Wed Nov 15 
12:27:02 2017(r325850)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Wed Nov 15 
12:48:36 2017(r325851)
@@ -4199,8 +4199,6 @@ arc_shrink(int64_t to_free)
}
 }
 
-static long needfree = 0;
-
 typedef enum free_memory_reason_t {
FMR_UNKNOWN,
FMR_NEEDFREE,
@@ -4238,14 +4236,6 @@ arc_available_memory(void)
free_memory_reason_t r = FMR_UNKNOWN;
 
 #ifdef _KERNEL
-   if (needfree > 0) {
-   n = PAGESIZE * (-needfree);
-   if (n < lowest) {
-   lowest = n;
-   r = FMR_NEEDFREE;
-   }
-   }
-
/*
 * Cooperate with pagedaemon when it's time for it to scan
 * and reclaim some pages.
@@ -4510,9 +4500,6 @@ arc_reclaim_thread(void *dummy __unused)
int64_t to_free =
(arc_c >> arc_shrink_shift) - free_memory;
if (to_free > 0) {
-#ifdef _KERNEL
-   to_free = MAX(to_free, ptob(needfree));
-#endif
arc_shrink(to_free);
}
} else if (free_memory < arc_c >> arc_no_grow_shift) {
@@ -4533,9 +4520,6 @@ arc_reclaim_thread(void *dummy __unused)
 * infinite loop.
 */
if (arc_size <= arc_c || evicted == 0) {
-#ifdef _KERNEL
-   needfree = 0;
-#endif
/*
 * We're either no longer overflowing, or we
 * can't evict anything more, so we should wake
@@ -6310,9 +6294,7 @@ arc_lowmem(void *arg __unused, int howto __unused)
 {
 
mutex_enter(&arc_reclaim_lock);
-   /* XXX: Memory deficit should be passed as argument. */
-   needfree = btoc(arc_c >> arc_shrink_shift);
-   DTRACE_PROBE(arc__needfree);
+   DTRACE_PROBE1(arc__needfree, int64_t, ((int64_t)freemem - 
zfs_arc_free_target) * PAGESIZE);
cv_signal(&arc_reclaim_thread_cv);
 
/*
___
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: r325852 - in head/sys: sys vm

2017-11-15 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 15 13:41:03 2017
New Revision: 325852
URL: https://svnweb.freebsd.org/changeset/base/325852

Log:
  vmtotal: extend memory counters to accomodate for current and future
  hardware sizes.
  
  32bit counters already overflow on approachable virtual memory page
  counts, and soon would overflow on the physical pages counts as well.
  Bump sizes to 64bit types.  Bump __FreeBSD_version.
  
  It is impossible to provide perfect backward ABI compat for this
  change.  If a program requests an old structure, it can be detected by
  size.  But if it queries the size first by passing NULL old req
  pointer, there is almost nothing we can do to detect the desired ABI.
  As a partial solution, check p_osrel of the quering process when
  selecting the size to report.
  
  Submitted by: Pawel Biernacki 
  Differential revision:https://reviews.freebsd.org/D13018

Modified:
  head/sys/sys/param.h
  head/sys/sys/vmmeter.h
  head/sys/vm/vm_meter.c

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Nov 15 12:48:36 2017(r325851)
+++ head/sys/sys/param.hWed Nov 15 13:41:03 2017(r325852)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200053  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200054  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
@@ -84,6 +84,7 @@
 #defineP_OSREL_SHUTDOWN_ENOTCONN   1100077
 #defineP_OSREL_MAP_GUARD   1200035
 #defineP_OSREL_WRFSBASE1200041
+#defineP_OSREL_VMTOTAL64   1200054
 
 #defineP_OSREL_MAJOR(x)((x) / 10)
 #endif

Modified: head/sys/sys/vmmeter.h
==
--- head/sys/sys/vmmeter.h  Wed Nov 15 12:48:36 2017(r325851)
+++ head/sys/sys/vmmeter.h  Wed Nov 15 13:41:03 2017(r325852)
@@ -41,20 +41,23 @@
 
 /* Systemwide totals computed every five seconds. */
 struct vmtotal {
-   int16_t t_rq;   /* length of the run queue */
-   int16_t t_dw;   /* jobs in ``disk wait'' (neg priority) */
-   int16_t t_pw;   /* jobs in page wait */
-   int16_t t_sl;   /* jobs sleeping in core */
-   int16_t t_sw;   /* swapped out runnable/short block jobs */
-   int32_t t_vm;   /* total virtual memory */
-   int32_t t_avm;  /* active virtual memory */
-   int32_t t_rm;   /* total real memory in use */
-   int32_t t_arm;  /* active real memory */
-   int32_t t_vmshr;/* shared virtual memory */
-   int32_t t_avmshr;   /* active shared virtual memory */
-   int32_t t_rmshr;/* shared real memory */
-   int32_t t_armshr;   /* active shared real memory */
-   int32_t t_free; /* free memory pages */
+   uint64_tt_vm;   /* total virtual memory */
+   uint64_tt_avm;  /* active virtual memory */
+   uint64_tt_rm;   /* total real memory in use */
+   uint64_tt_arm;  /* active real memory */
+   uint64_tt_vmshr;/* shared virtual memory */
+   uint64_tt_avmshr;   /* active shared virtual memory */
+   uint64_tt_rmshr;/* shared real memory */
+   uint64_tt_armshr;   /* active shared real memory */
+   uint64_tt_free; /* free memory pages */
+   int16_t t_rq;   /* length of the run queue */
+   int16_t t_dw;   /* jobs in ``disk wait'' (neg
+  priority) */
+   int16_t t_pw;   /* jobs in page wait */
+   int16_t t_sl;   /* jobs sleeping in core */
+   int16_t t_sw;   /* swapped out runnable/short
+  block jobs */
+   uint16_tt_pad[3];
 };
 
 #if defined(_KERNEL) || defined(_WANT_VMMETER)

Modified: head/sys/vm/vm_meter.c
==
--- head/sys/vm/vm_meter.c  Wed Nov 15 12:48:36 2017(r325851)
+++ head/sys/vm/vm_meter.c  Wed Nov 15 13:41:03 2017(r325852)
@@ -152,14 +152,43 @@ is_object_active(vm_object_t obj)
return (obj->ref_count > obj->shadow_count);
 }
 
+#if defined(COMPAT_FREEBSD11)
+struct vmtotal11 {
+   int16_t t_rq;
+   int16_t t_dw;
+   int16_t t_pw;
+   int16_t t_sl;
+   int16_t t_sw;
+   int32_t t_vm;
+   int32_t t_avm;
+   int32_t t_rm;
+   int32_t t_arm;
+   int32_t t_vmshr;
+   int32_t t_avmshr;
+   int32_t t_rmshr;
+   int32_t t_armshr;
+   int

svn commit: r325853 - stable/11/sys/i386/i386

2017-11-15 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 15 14:35:42 2017
New Revision: 325853
URL: https://svnweb.freebsd.org/changeset/base/325853

Log:
  MFC r325553:
  Remove useless DEBUG printfs in i386 sendsig() implementations.

Modified:
  stable/11/sys/i386/i386/machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/i386/i386/machdep.c
==
--- stable/11/sys/i386/i386/machdep.c   Wed Nov 15 13:41:03 2017
(r325852)
+++ stable/11/sys/i386/i386/machdep.c   Wed Nov 15 14:35:42 2017
(r325853)
@@ -444,9 +444,6 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mas
 * Copy the sigframe out to the user's stack.
 */
if (copyout(&sf, fp, sizeof(*fp)) != 0) {
-#ifdef DEBUG
-   printf("process %ld has trashed its stack\n", (long)p->p_pid);
-#endif
PROC_LOCK(p);
sigexit(td, SIGILL);
}
@@ -573,9 +570,6 @@ freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 * Copy the sigframe out to the user's stack.
 */
if (copyout(&sf, sfp, sizeof(*sfp)) != 0) {
-#ifdef DEBUG
-   printf("process %ld has trashed its stack\n", (long)p->p_pid);
-#endif
PROC_LOCK(p);
sigexit(td, SIGILL);
}
@@ -739,9 +733,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
(xfpusave != NULL && copyout(xfpusave,
(void *)sf.sf_uc.uc_mcontext.mc_xfpustate, xfpusave_len)
!= 0)) {
-#ifdef DEBUG
-   printf("process %ld has trashed its stack\n", (long)p->p_pid);
-#endif
PROC_LOCK(p);
sigexit(td, SIGILL);
}
___
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: r325828 - head/usr.bin/fortune/datfiles

2017-11-15 Thread Jeremie Le Hen
Hi Benno,

On Tue, Nov 14, 2017 at 10:18 PM, Benno Rice  wrote:
> Author: benno
> Date: Tue Nov 14 21:18:30 2017
> New Revision: 325828
> URL: https://svnweb.freebsd.org/changeset/base/325828
>
> Log:
>   Remove all fortune datfiles except freebsd-tips.
>
>   Humour is a funny thing. What is funny to one person is not funny to all
>   people. What is insightful to one person is similarly not universal. The
>   fortune datfiles have been around a long time and have undoubtedly amused
>   people but it's time to acknowledge their subjective, and in some cases
>   at least potentially offensive, nature and stop distributing them with the
>   imprimatur of the FreeBSD project.

Sorry to ask, I'm only loosely following the project, but was this
discussed somewhere?


>   If anyone wishes to distribute these via other mechanisms they are welcome 
> to
>   check them out of history and do so.

I don't think there's any rule saying that, but I know people are
usually happy to have a replacing port.  As you removed them, can I
please ask you do this?

Thanks.
-- Jeremie


>   MFC after:2 days
>
> Deleted:
>   head/usr.bin/fortune/datfiles/fortunes
>   head/usr.bin/fortune/datfiles/fortunes.sp.ok
>   head/usr.bin/fortune/datfiles/gerrold.limerick
>   head/usr.bin/fortune/datfiles/limerick
>   head/usr.bin/fortune/datfiles/limerick.sp.ok
>   head/usr.bin/fortune/datfiles/murphy
>   head/usr.bin/fortune/datfiles/murphy-o
>   head/usr.bin/fortune/datfiles/murphy.sp.ok
>   head/usr.bin/fortune/datfiles/startrek
>   head/usr.bin/fortune/datfiles/startrek.sp.ok
>   head/usr.bin/fortune/datfiles/zippy
>   head/usr.bin/fortune/datfiles/zippy.sp.ok
> Modified:
>   head/usr.bin/fortune/datfiles/Makefile
>
> Modified: head/usr.bin/fortune/datfiles/Makefile
> ==
> --- head/usr.bin/fortune/datfiles/Makefile  Tue Nov 14 21:11:55 2017  
>   (r325827)
> +++ head/usr.bin/fortune/datfiles/Makefile  Tue Nov 14 21:18:30 2017  
>   (r325828)
> @@ -1,11 +1,7 @@
>  #  @(#)Makefile8.2 (Berkeley) 4/19/94
>  # $FreeBSD$
>
> -DB=fortunes freebsd-tips murphy startrek zippy
> -
> -# TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, COMMENT OUT THE
> -# NEXT LINE.
> -DB+=   limerick murphy-o gerrold.limerick
> +DB=freebsd-tips
>
>  BLDS=  ${DB:S/$/.dat/}
>  FILES= ${DB} ${BLDS}
> ___
> 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"



-- 
Jeremie Le Hen
j...@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: r325854 - head/share/man/man7

2017-11-15 Thread Warner Losh
Author: imp
Date: Wed Nov 15 15:00:02 2017
New Revision: 325854
URL: https://svnweb.freebsd.org/changeset/base/325854

Log:
  Reword a bit for clarity.
  
  Sponsored by: Netflix

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Nov 15 14:35:42 2017(r325853)
+++ head/share/man/man7/arch.7  Wed Nov 15 15:00:02 2017(r325854)
@@ -418,9 +418,12 @@ For example,
 .Dv MACHINE_CPUARCH
 is defined to be mips for all the flavors of mips that we support
 since we support them all with a shared set of sources.
-One might thing that it should be x86 for both amd64 and i386.
-However, since we don't support these two architectures with the same
-source base, that's not done despite it's logical appeal.
+While amd64 and i386 are closely related, MACHINE_CPUARCH is not x86
+for them.
+The FreeBSD source base supports amd64 and i386 with two
+distinct source bases living in subdirectories named amd64 and i386
+(though behind the scenes there's some sharing that fits into this
+framework).
 .It Dv CPUTYPE Sets the flavor of
 .Dv MACHINE_ARCH
 to build.
@@ -433,7 +436,8 @@ Unused outside of that scope.
 It is not passed down to the rest of the build.
 Makefiles outside of the top level shouldn't use it at all (though
 some have their own private copy for hysterical raisons).
-.It Dv TARGET_ARCH Used to set Dv MACHINE_ARCH by Fx's top level Makefile 
for cross building.
+.It Dv TARGET_ARCH Used to set
+.Dv MACHINE_ARCH by Fx's top level Makefile for cross building.
 Like
 .Dv TARGET , it is unused outside of that scope.
 .El
___
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: r325855 - head/share/man/man7

2017-11-15 Thread Warner Losh
Author: imp
Date: Wed Nov 15 15:02:45 2017
New Revision: 325855
URL: https://svnweb.freebsd.org/changeset/base/325855

Log:
  Replace Fx's with 'the' since expanding FreeBSD here didn't seem quite
  right.
  
  Sponsored by: Netflix

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Nov 15 15:00:02 2017(r325854)
+++ head/share/man/man7/arch.7  Wed Nov 15 15:02:45 2017(r325855)
@@ -437,7 +437,7 @@ It is not passed down to the rest of the build.
 Makefiles outside of the top level shouldn't use it at all (though
 some have their own private copy for hysterical raisons).
 .It Dv TARGET_ARCH Used to set
-.Dv MACHINE_ARCH by Fx's top level Makefile for cross building.
+.Dv MACHINE_ARCH by the top level Makefile for cross building.
 Like
 .Dv TARGET , it is unused outside of that scope.
 .El
___
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: r325856 - stable/11/contrib/elftoolchain/readelf

2017-11-15 Thread John Baldwin
Author: jhb
Date: Wed Nov 15 15:24:28 2017
New Revision: 325856
URL: https://svnweb.freebsd.org/changeset/base/325856

Log:
  MFC 323588: Recognize NT_PTLWPINFO and NT_ARM_VFP in FreeBSD ELF cores.

Modified:
  stable/11/contrib/elftoolchain/readelf/readelf.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/elftoolchain/readelf/readelf.c
==
--- stable/11/contrib/elftoolchain/readelf/readelf.cWed Nov 15 15:02:45 
2017(r325855)
+++ stable/11/contrib/elftoolchain/readelf/readelf.cWed Nov 15 15:24:28 
2017(r325856)
@@ -1141,7 +1141,9 @@ note_type_freebsd_core(unsigned int nt)
case 14: return "NT_PROCSTAT_OSREL";
case 15: return "NT_PROCSTAT_PSSTRINGS";
case 16: return "NT_PROCSTAT_AUXV";
+   case 17: return "NT_PTLWPINFO";
case 0x202: return "NT_X86_XSTATE (x86 XSAVE extended state)";
+   case 0x400: return "NT_ARM_VFP (arm VFP registers)";
default: return (note_type_unknown(nt));
}
 }
___
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: r325857 - head/sys/cam

2017-11-15 Thread Alan Somers
Author: asomers
Date: Wed Nov 15 15:52:06 2017
New Revision: 325857
URL: https://svnweb.freebsd.org/changeset/base/325857

Log:
  Remove a double free(9) in xpt_bus_register
  
  In xpt_bus_register(), remove superfluous call to free().  This was mostly
  benign since free(9) checks for NULL before doing anything, and
  xpt_create_path() is nice enough to NULL out the pointer on failure.
  However, it could've segfaulted if malloc(9) failed during
  xpt_create_path().
  
  Submitted by: gibbs
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Wed Nov 15 15:24:28 2017(r325856)
+++ head/sys/cam/cam_xpt.c  Wed Nov 15 15:52:06 2017(r325857)
@@ -4049,7 +4049,6 @@ xpt_bus_register(struct cam_sim *sim, device_t parent,
  CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
if (status != CAM_REQ_CMP) {
xpt_release_bus(new_bus);
-   free(path, M_CAMXPT);
return (CAM_RESRC_UNAVAIL);
}
 
___
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: r325858 - in stable/11: sys/compat/cloudabi sys/compat/cloudabi32 sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss

2017-11-15 Thread Ed Schouten
Author: ed
Date: Wed Nov 15 15:56:08 2017
New Revision: 325858
URL: https://svnweb.freebsd.org/changeset/base/325858

Log:
  MFC r324727 and r32:
  
Import the latest CloudABI definitions, version 0.16.
  
The most important change in this release is the removal of the
poll_fd() system call; CloudABI's equivalent of kevent(). Though I think
that kqueue is a lot saner than many of its alternatives, our
experience is that emulating this system call on other systems
accurately isn't easy. It has become a complex API, even though I'm not
convinced this complexity is needed. This is why we've decided to take a
different approach, by looking one layer up.
  
We're currently adding an event loop to CloudABI's C library that is API
compatible with libuv (except when incompatible with Capsicum).
Initially, this event loop will be built on top of plain inefficient
poll() calls. Only after this is finished, we'll work our way backwards
and design a new set of system calls to optimize it.
  
Interesting challenges will include integrating asynchronous I/O into
such a system call API. libuv currently doesn't aio(4) on Linux/BSD, due
to it being unreliable and having undesired semantics.
  
Upgrade to CloudABI v0.17.
  
Compared to the previous version, v0.16, there are a couple of minor
changes:
  
- CLOUDABI_AT_PID: Process identifiers for CloudABI processes.
  
  Initially, BSD process identifiers weren't exposed inside the runtime,
  due to them being pretty much useless inside of a cluster computing
  environment. When jobs are scheduled across systems, the BSD process
  number doesn't act as an identifier. Even on individual systems they
  may recycle relatively quickly.
  
  With this change, the kernel will now generate a UUIDv4 when executing
  a process. These UUIDs can be obtained within the process using
  program_getpid(). Right now, FreeBSD will not attempt to store this
  value. This should of course happen at some point in time, so that it
  may be printed by administration tools.
  
- Removal of some unused structure members for polling.
  
  With the polling framework being simplified/redesigned, it turns out
  some of the structure fields were not used by the C library. We can
  remove these to keep things nice and tidy.

Modified:
  stable/11/sys/compat/cloudabi/cloudabi_fd.c
  stable/11/sys/compat/cloudabi32/cloudabi32_module.c
  stable/11/sys/compat/cloudabi32/cloudabi32_poll.c
  stable/11/sys/compat/cloudabi32/cloudabi32_proto.h
  stable/11/sys/compat/cloudabi32/cloudabi32_syscall.h
  stable/11/sys/compat/cloudabi32/cloudabi32_syscalls.c
  stable/11/sys/compat/cloudabi32/cloudabi32_sysent.c
  stable/11/sys/compat/cloudabi32/cloudabi32_systrace_args.c
  stable/11/sys/compat/cloudabi64/cloudabi64_module.c
  stable/11/sys/compat/cloudabi64/cloudabi64_poll.c
  stable/11/sys/compat/cloudabi64/cloudabi64_proto.h
  stable/11/sys/compat/cloudabi64/cloudabi64_syscall.h
  stable/11/sys/compat/cloudabi64/cloudabi64_syscalls.c
  stable/11/sys/compat/cloudabi64/cloudabi64_sysent.c
  stable/11/sys/compat/cloudabi64/cloudabi64_systrace_args.c
  stable/11/sys/contrib/cloudabi/cloudabi32_types.h
  stable/11/sys/contrib/cloudabi/cloudabi64_types.h
  stable/11/sys/contrib/cloudabi/cloudabi_types_common.h
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_i686.S
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S
  stable/11/sys/contrib/cloudabi/syscalls32.master
  stable/11/sys/contrib/cloudabi/syscalls64.master
  stable/11/usr.bin/truss/syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/cloudabi/cloudabi_fd.c
==
--- stable/11/sys/compat/cloudabi/cloudabi_fd.c Wed Nov 15 15:52:06 2017
(r325857)
+++ stable/11/sys/compat/cloudabi/cloudabi_fd.c Wed Nov 15 15:56:08 2017
(r325858)
@@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$");
MAPPING(CLOUDABI_RIGHT_MEM_MAP, CAP_MMAP)   \
MAPPING(CLOUDABI_RIGHT_MEM_MAP_EXEC, CAP_MMAP_X)\
MAPPING(CLOUDABI_RIGHT_POLL_FD_READWRITE, CAP_EVENT)\
-   MAPPING(CLOUDABI_RIGHT_POLL_MODIFY, CAP_KQUEUE_CHANGE)  \
MAPPING(CLOUDABI_RIGHT_POLL_PROC_TERMINATE, CAP_EVENT)  \
-   MAPPING(CLOUDABI_RIGHT_POLL_WAIT, CAP_KQUEUE_EVENT) \
MAPPING(CLOUDABI_RIGHT_PROC_EXEC, CAP_FEXECVE)  \
MAPPING(CLOUDABI_RIGHT_SOCK_SHUTDOWN, CAP_SHUTDOWN) \
 
@@ -93,9 +91,6 @@ cloudabi_sys_fd_create1(struct thread *td,
struct filecaps fcaps = {};
 
switch (uap->type) {
-   case CLOUDABI_FILETYPE_POLL:
-   

Re: svn commit: r325828 - head/usr.bin/fortune/datfiles

2017-11-15 Thread Benno Rice


> On Nov 15, 2017, at 06:54, Jeremie Le Hen  wrote:
> 
> Hi Benno,
> 
> On Tue, Nov 14, 2017 at 10:18 PM, Benno Rice  > wrote:
>> Author: benno
>> Date: Tue Nov 14 21:18:30 2017
>> New Revision: 325828
>> URL: https://svnweb.freebsd.org/changeset/base/325828
>> 
>> Log:
>>  Remove all fortune datfiles except freebsd-tips.
>> 
>>  Humour is a funny thing. What is funny to one person is not funny to all
>>  people. What is insightful to one person is similarly not universal. The
>>  fortune datfiles have been around a long time and have undoubtedly amused
>>  people but it's time to acknowledge their subjective, and in some cases
>>  at least potentially offensive, nature and stop distributing them with the
>>  imprimatur of the FreeBSD project.
> 
> Sorry to ask, I'm only loosely following the project, but was this
> discussed somewhere?

It was raised to core but I decided to take unilateral action. That’s not an 
indication of any disagreement in core per se, I just made the call that in the 
light of finding Hitler quotes in the file, and the fact that there were still 
files clearly marked as offensive in the Makefile, that trying to be the 
editors of humour is not something we’re really cut out for and that we should 
get out of the game. I put the MFC timer on it so that if anyone wants to mount 
an argument as to why they should stay they can.

>>  If anyone wishes to distribute these via other mechanisms they are welcome 
>> to
>>  check them out of history and do so.
> 
> I don't think there's any rule saying that, but I know people are
> usually happy to have a replacing port.  As you removed them, can I
> please ask you do this?

Personally I feel that this is the kind of thing that doesn’t need to live on. 
I won’t be making a port of it. If someone else wants to distribute these then 
they can.

Thanks,
Benno.

___
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: r325844 - stable/11/lib/libutil

2017-11-15 Thread Rodney W. Grimes
> Author: bapt
> Date: Wed Nov 15 12:17:51 2017
> New Revision: 325844
> URL: https://svnweb.freebsd.org/changeset/base/325844
> 
> Log:
>   MFC r325716:
>   
>   Fix some nroff style issue
> 
> Modified:
>   stable/11/lib/libutil/hexdump.3
> Directory Properties:
>   stable/11/   (props changed)
> 
> Modified: stable/11/lib/libutil/hexdump.3
> ==
> --- stable/11/lib/libutil/hexdump.3   Wed Nov 15 11:35:02 2017
> (r325843)
> +++ stable/11/lib/libutil/hexdump.3   Wed Nov 15 12:17:51 2017
> (r325844)
> @@ -42,14 +42,9 @@
>  The
>  .Fn hexdump
>  function prints an array of bytes to standard out in hexadecimal form,
> -along with the
> -.Tn ASCII
> -representation of the bytes, if possible.
> -By default, each line of
> -output will start with an offset count, followed by 16 hexadecimal values,
> -followed by 16
> -.Tn ASCII
> -characters.
> +along with the ASCII representation of the bytes, if possible.
> +By default, each line of output will start with an offset count, followed by 
> 16
> +hexadecimal values, followed by 16 ASCII characters.

Just for the future, the old school way of dong this would be:
By default,
each line of output will start with an offset count,
followed by 16 hexadecimal values,
followed by 16 ASCII characters.

IE, you put each fragment of a sentance on its own line.   It is
bad form in .troff to try and pack lines full.

I am not sure why we are removing the troff .Tn macro, mandoc
may do nothing with it, but if someone formats the man page
for a typesetter this does make the ASCII look special.

>  .Bl -tag -width indent
>  .It Fa ptr
>  Pointer to the array of bytes to print.
> @@ -73,12 +68,10 @@ Flags for controlling the formatting of the output.
>  Integer value of the number of bytes to display on each line.
>  A value of 0 implies that the default value of 16 will be used.
>  .It Bits 8-15
> -Character
> -.Tn ASCII
> -value to use as the separator for the hexadecimal output.
> +Character ASCII value to use as the separator for the hexadecimal output.
>  A value of 0 implies that the default value of 32
> -.Tn ( ASCII
> -space) will be used.
> +.Pq ASCII space
> +will be used.
>  .It Dv HD_OMIT_COUNT
>  Do not print the offset column at the beginning of each line.
>  .It Dv HD_OMIT_HEX
> 
> 

-- 
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: r325859 - head

2017-11-15 Thread Ed Maste
Author: emaste
Date: Wed Nov 15 18:03:31 2017
New Revision: 325859
URL: https://svnweb.freebsd.org/changeset/base/325859

Log:
  Sort pkgbase mtree metadata, for reproducible builds
  
  Packaged base packages are created by running the stageworld and
  stagekernel targets with -DNO_ROOT, and converting the resulting mtree
  file into a set of pkg plists.  If stage* is run with multiple processes
  the order of entries in the mtree file may be nondeterministic, and the
  resulting package tbz also had nondeterministic file ordering.
  
  The mtree file generated by -DNO_ROOT builds consists of one line per
  file, with the filename starting in the first column, so is easily
  sorted.  There's one exception: the first line of the mtree file is a
  comment, but the # character sorts before the filenames anyhow and needs
  no special treatment.
  
  PR:   223673
  Reviewed by:  bapt, gjb
  Sponsored by: The Linux Foundation, Core Infrastructure Initiative
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D13103

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Nov 15 15:56:08 2017(r325858)
+++ head/Makefile.inc1  Wed Nov 15 18:03:31 2017(r325859)
@@ -1613,8 +1613,8 @@ create-packages: .PHONY create-packages-world create-p
 create-world-packages: _pkgbootstrap .PHONY
@rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || :
@cd ${WSTAGEDIR} ; \
-   awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
-   ${WSTAGEDIR}/METALOG
+   env -i LC_COLLATE=C sort ${WSTAGEDIR}/METALOG | \
+   awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk
@for plist in ${WSTAGEDIR}/*.plist; do \
  plist=$${plist##*/} ; \
  pkgname=$${plist%.plist} ; \
@@ -1658,9 +1658,9 @@ _debug=-debug
 create-kernel-packages: 
create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: 
_pkgbootstrap .PHONY
@cd ${KSTAGEDIR}/${DISTDIR} ; \
+   env -i LC_COLLATE=C sort ${KSTAGEDIR}/kernel.meta | \
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
-   -v kernel=yes -v _kernconf=${INSTALLKERNEL} \
-   ${KSTAGEDIR}/kernel.meta ; \
+   -v kernel=yes -v _kernconf=${INSTALLKERNEL} ; \
cap_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VCAP_MKDB_ENDIAN` ; \
pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \
sed -e "s/%VERSION%/${PKG_VERSION}/" \
@@ -1693,9 +1693,9 @@ _debug=-debug
 create-kernel-packages: 
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}
 
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}:
 _pkgbootstrap .PHONY
@cd ${KSTAGEDIR}/kernel.${_kernel} ; \
+   env -i LC_COLLATE=C sort ${KSTAGEDIR}/kernel.${_kernel}.meta | \
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
-   -v kernel=yes -v _kernconf=${_kernel} \
-   ${KSTAGEDIR}/kernel.${_kernel}.meta ; \
+   -v kernel=yes -v _kernconf=${_kernel} ; \
cap_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VCAP_MKDB_ENDIAN` ; \
pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \
sed -e "s/%VERSION%/${PKG_VERSION}/" \
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread Ed Maste
Author: emaste
Date: Wed Nov 15 18:40:40 2017
New Revision: 325860
URL: https://svnweb.freebsd.org/changeset/base/325860

Log:
  newfs: warn if newer than kernel
  
  Creating a UFS filesystem with a newfs newer than the running kernel,
  and then mounting that filesystem, can lead to interesting failures.
  
  Add a safety belt to explicitly warn when newfs is newer than the
  running kernel.
  
  Reviewed by:  gjb, jhb, mckusick
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D12765

Modified:
  head/sbin/newfs/newfs.c

Modified: head/sbin/newfs/newfs.c
==
--- head/sbin/newfs/newfs.c Wed Nov 15 18:03:31 2017(r325859)
+++ head/sbin/newfs/newfs.c Wed Nov 15 18:40:40 2017(r325860)
@@ -398,6 +398,10 @@ main(int argc, char *argv[])
if (pp != NULL)
pp->p_size *= secperblk;
}
+   if (getosreldate() < __FreeBSD_version) {
+   warnx("%s is newer than the running kernel and may not be 
compatible",
+   getprogname());
+   }
mkfs(pp, special);
ufs_disk_close(&disk);
if (!jflag)
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread Rodney W. Grimes
> Author: emaste
> Date: Wed Nov 15 18:40:40 2017
> New Revision: 325860
> URL: https://svnweb.freebsd.org/changeset/base/325860
> 
> Log:
>   newfs: warn if newer than kernel
>   
>   Creating a UFS filesystem with a newfs newer than the running kernel,
>   and then mounting that filesystem, can lead to interesting failures.
>   
>   Add a safety belt to explicitly warn when newfs is newer than the
>   running kernel.

You should probably make the warning if (newer || older) as
either is likely to have interesting side effects, as are
mounting ufs file systems on different versions.

*Sigh*  why did not UFS grow a version number of its own
when things started to change other than UFS1 vs UFS2.


>   Reviewed by:gjb, jhb, mckusick
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D12765
> 
> Modified:
>   head/sbin/newfs/newfs.c
> 
> Modified: head/sbin/newfs/newfs.c
> ==
> --- head/sbin/newfs/newfs.c   Wed Nov 15 18:03:31 2017(r325859)
> +++ head/sbin/newfs/newfs.c   Wed Nov 15 18:40:40 2017(r325860)
> @@ -398,6 +398,10 @@ main(int argc, char *argv[])
>   if (pp != NULL)
>   pp->p_size *= secperblk;
>   }
> + if (getosreldate() < __FreeBSD_version) {
> + warnx("%s is newer than the running kernel and may not be 
> compatible",
> + getprogname());
> + }
>   mkfs(pp, special);
>   ufs_disk_close(&disk);
>   if (!jflag)
> 
> 

-- 
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: r325861 - head/release/arm

2017-11-15 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov 15 19:03:06 2017
New Revision: 325861
URL: https://svnweb.freebsd.org/changeset/base/325861

Log:
  release: Update u-boot and firmware file for RPI-B target
  
  THe u-boot port for RPI-B was updated to use u-boot-master, this cause
  an update in u-boot version to v2017.09 and changing the filename.
  The various firmware files for the RPI* are now in a common ports
  sysutils/rpi-firmware as they are shared on all the RPI version.
  
  Update the release files to copy the right files from the right location.
  
  Reviewed by:  gjb
  MFC after:3 days

Modified:
  head/release/arm/RPI-B.conf

Modified: head/release/arm/RPI-B.conf
==
--- head/release/arm/RPI-B.conf Wed Nov 15 18:40:40 2017(r325860)
+++ head/release/arm/RPI-B.conf Wed Nov 15 19:03:06 2017(r325861)
@@ -6,7 +6,7 @@
 EMBEDDEDBUILD=1
 EMBEDDED_TARGET="arm"
 EMBEDDED_TARGET_ARCH="armv6"
-EMBEDDEDPORTS="sysutils/u-boot-rpi"
+EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware"
 KERNEL="RPI-B"
 IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
@@ -17,8 +17,11 @@ NODOC=1
 
 arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi"
-   UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \
-   start.elf start_cd.elf u-boot.img"
+   RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware"
+   UBOOT_FILES="u-boot.bin"
+   RPI_FIRMWARE_FILES="bootcode.bin config.txt \
+   fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \
+   start.elf start_cd.elf start_db.elf start_x.elf"
FATMOUNT="${DESTDIR%${KERNEL}}/fat"
UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
@@ -26,6 +29,10 @@ arm_install_uboot() {
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
for _UF in ${UBOOT_FILES}; do
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \
+   ${FATMOUNT}/${_UF}
+   done
+   for _UF in ${RPI_FIRMWARE_FILES}; do
+   chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \
${FATMOUNT}/${_UF}
done
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \
___
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: r325862 - head/release/arm

2017-11-15 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov 15 19:04:23 2017
New Revision: 325862
URL: https://svnweb.freebsd.org/changeset/base/325862

Log:
  release: Update u-boot and firmware file for RPI2 target
  
  The u-boot port for RPI-2 was updated to use u-boot-master, this cause
  an update in u-boot version to v2017.09 and changing the filename.
  The various firmware files for the RPI* are now in a common ports
  sysutils/rpi-firmware as they are shared on all the RPI version.
  
  Update the release files to copy the right files from the right location.
  
  Reviewed by:  gjb
  MFC after:3 days

Modified:
  head/release/arm/RPI2.conf

Modified: head/release/arm/RPI2.conf
==
--- head/release/arm/RPI2.conf  Wed Nov 15 19:03:06 2017(r325861)
+++ head/release/arm/RPI2.conf  Wed Nov 15 19:04:23 2017(r325862)
@@ -6,7 +6,7 @@
 EMBEDDEDBUILD=1
 EMBEDDED_TARGET="arm"
 EMBEDDED_TARGET_ARCH="armv7"
-EMBEDDEDPORTS="sysutils/u-boot-rpi2"
+EMBEDDEDPORTS="sysutils/u-boot-rpi2 sysutils/rpi-firmware"
 KERNEL="GENERIC"
 IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
@@ -18,8 +18,11 @@ export BOARDNAME="RPI2"
 
 arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2"
-   UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \
-   fixup_x.dat start.elf start_cd.elf start_x.elf u-boot.bin"
+   RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware"
+   UBOOT_FILES="u-boot.bin"
+   RPI_FIRMWARE_FILES="bootcode.bin config.txt \
+   fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \
+   start.elf start_cd.elf start_db.elf start_x.elf"
FATMOUNT="${DESTDIR%${KERNEL}}/fat"
UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
@@ -27,6 +30,10 @@ arm_install_uboot() {
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
for _UF in ${UBOOT_FILES}; do
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \
+   ${FATMOUNT}/${_UF}
+   done
+   for _UF in ${RPI_FIRMWARE_FILES}; do
+   chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \
${FATMOUNT}/${_UF}
done
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \
___
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: r325863 - head/release

2017-11-15 Thread Glen Barber
Author: gjb
Date: Wed Nov 15 19:14:44 2017
New Revision: 325863
URL: https://svnweb.freebsd.org/changeset/base/325863

Log:
  Only copy /etc/resolv.conf to ${CHROOTDIR} if /etc/resolv.conf does
  not already exist within ${CHROOTDIR}.  This allows re-using a build
  chroot with CHROOTBUILD_SKIP set to a non-empty value and CHROOTDIR
  set to '/' in release.conf.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/release.sh

Modified: head/release/release.sh
==
--- head/release/release.sh Wed Nov 15 19:04:23 2017(r325862)
+++ head/release/release.sh Wed Nov 15 19:14:44 2017(r325863)
@@ -252,8 +252,8 @@ chroot_setup() {
 extra_chroot_setup() {
mkdir -p ${CHROOTDIR}/dev
mount -t devfs devfs ${CHROOTDIR}/dev
-   [ -e /etc/resolv.conf ] && cp /etc/resolv.conf \
-   ${CHROOTDIR}/etc/resolv.conf
+   [ -e /etc/resolv.conf -a ! -e ${CHROOTDIR}/etc/resolv.conf ] && \
+   cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf
# Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints
# is created.  This is needed by ports-mgmt/pkg.
eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart
___
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: r325828 - head/usr.bin/fortune/datfiles

2017-11-15 Thread Cy Schubert
Tips become stale and can be themselves contentious. Just consider our bike 
sheds. Besides, people should read the handbook anyway. Let's simply remove 
fortune altogether.

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.

Cy Schubert
 or 

---

-Original Message-
From: Benno Rice
Sent: 15/11/2017 08:58
To: Jeremie Le Hen
Cc: src-committers; svn-src-all@freebsd.org; svn-src-h...@freebsd.org
Subject: Re: svn commit: r325828 - head/usr.bin/fortune/datfiles






On Nov 15, 2017, at 06:54, Jeremie Le Hen  wrote:


Hi Benno,

On Tue, Nov 14, 2017 at 10:18 PM, Benno Rice  wrote:

Author: benno
Date: Tue Nov 14 21:18:30 2017
New Revision: 325828
URL: https://svnweb.freebsd.org/changeset/base/325828

Log:
 Remove all fortune datfiles except freebsd-tips.

 Humour is a funny thing. What is funny to one person is not funny to all
 people. What is insightful to one person is similarly not universal. The
 fortune datfiles have been around a long time and have undoubtedly amused
 people but it's time to acknowledge their subjective, and in some cases
 at least potentially offensive, nature and stop distributing them with the
 imprimatur of the FreeBSD project.


Sorry to ask, I'm only loosely following the project, but was this
discussed somewhere?



It was raised to core but I decided to take unilateral action. That’s not an 
indication of any disagreement in core per se, I just made the call that in the 
light of finding Hitler quotes in the file, and the fact that there were still 
files clearly marked as offensive in the Makefile, that trying to be the 
editors of humour is not something we’re really cut out for and that we should 
get out of the game. I put the MFC timer on it so that if anyone wants to mount 
an argument as to why they should stay they can.




 If anyone wishes to distribute these via other mechanisms they are welcome to
 check them out of history and do so.


I don't think there's any rule saying that, but I know people are
usually happy to have a replacing port.  As you removed them, can I
please ask you do this?


Personally I feel that this is the kind of thing that doesn’t need to live on. 
I won’t be making a port of it. If someone else wants to distribute these then 
they can.




Thanks,

 Benno.
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread Warner Losh
On Nov 15, 2017 11:47 AM, "Rodney W. Grimes" 
wrote:

> Author: emaste
> Date: Wed Nov 15 18:40:40 2017
> New Revision: 325860
> URL: https://svnweb.freebsd.org/changeset/base/325860
>
> Log:
>   newfs: warn if newer than kernel
>
>   Creating a UFS filesystem with a newfs newer than the running kernel,
>   and then mounting that filesystem, can lead to interesting failures.
>
>   Add a safety belt to explicitly warn when newfs is newer than the
>   running kernel.

You should probably make the warning if (newer || older) as
either is likely to have interesting side effects, as are
mounting ufs file systems on different versions.


Not really. The cg stuff is really only a hassle for the case ed is testing
for.

*Sigh*  why did not UFS grow a version number of its own
when things started to change other than UFS1 vs UFS2.


This isn't anything like those changes..

Warner

>   Reviewed by:gjb, jhb, mckusick
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D12765
>
> Modified:
>   head/sbin/newfs/newfs.c
>
> Modified: head/sbin/newfs/newfs.c
> 
==
> --- head/sbin/newfs/newfs.c   Wed Nov 15 18:03:31 2017(r325859)
> +++ head/sbin/newfs/newfs.c   Wed Nov 15 18:40:40 2017(r325860)
> @@ -398,6 +398,10 @@ main(int argc, char *argv[])
>   if (pp != NULL)
>   pp->p_size *= secperblk;
>   }
> + if (getosreldate() < __FreeBSD_version) {
> + warnx("%s is newer than the running kernel and may not be
compatible",
> + getprogname());
> + }
>   mkfs(pp, special);
>   ufs_disk_close(&disk);
>   if (!jflag)
>
>

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


Re: svn commit: r325860 - head/sbin/newfs

2017-11-15 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Nov 15, 2017 11:47 AM, "Rodney W. Grimes" 
> wrote:
> 
> > Author: emaste
> > Date: Wed Nov 15 18:40:40 2017
> > New Revision: 325860
> > URL: https://svnweb.freebsd.org/changeset/base/325860
> >
> > Log:
> >   newfs: warn if newer than kernel
> >
> >   Creating a UFS filesystem with a newfs newer than the running kernel,
> >   and then mounting that filesystem, can lead to interesting failures.
> >
> >   Add a safety belt to explicitly warn when newfs is newer than the
> >   running kernel.
> 
> You should probably make the warning if (newer || older) as
> either is likely to have interesting side effects, as are
> mounting ufs file systems on different versions.
> 
> 
> Not really. The cg stuff is really only a hassle for the case ed is testing
> for.

Its too late now, but if you take a newer ufs with the cg
stuff in them and mount it on an old system it politly well
corrupt the data that the newer kernel needs.  So your right,
doing this check in newfs wont do anything, but I can tell
you this tiny little chain has been a PITA for people that
move HD around

> *Sigh*  why did not UFS grow a version number of its own
> when things started to change other than UFS1 vs UFS2.
> 
> 
> This isn't anything like those changes..

UFS changed in a way that makes it difficult to move
UFS drives accross systems that are at differing versions.
That IS bad no mater how you slice it.  I now have to make
sure I fsck a drive when moving it from an old to new
system to get the cg checksum stuff fixed.


> Warner
> 
> >   Reviewed by:gjb, jhb, mckusick
> >   Sponsored by:   The FreeBSD Foundation
> >   Differential Revision:  https://reviews.freebsd.org/D12765
> >
> > Modified:
> >   head/sbin/newfs/newfs.c
> >
> > Modified: head/sbin/newfs/newfs.c
> > 
> ==
> > --- head/sbin/newfs/newfs.c   Wed Nov 15 18:03:31 2017(r325859)
> > +++ head/sbin/newfs/newfs.c   Wed Nov 15 18:40:40 2017(r325860)
> > @@ -398,6 +398,10 @@ main(int argc, char *argv[])
> >   if (pp != NULL)
> >   pp->p_size *= secperblk;
> >   }
> > + if (getosreldate() < __FreeBSD_version) {
> > + warnx("%s is newer than the running kernel and may not be
> compatible",
> > + getprogname());
> > + }
> >   mkfs(pp, special);
> >   ufs_disk_close(&disk);
> >   if (!jflag)
> >
> >
> 
> --
> Rod Grimes
> rgri...@freebsd.org

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


Re: svn commit: r325860 - head/sbin/newfs

2017-11-15 Thread Warner Losh
On Nov 15, 2017 1:51 PM, "Rodney W. Grimes" 
wrote:

[ Charset UTF-8 unsupported, converting... ]
> On Nov 15, 2017 11:47 AM, "Rodney W. Grimes" 
> wrote:
>
> > Author: emaste
> > Date: Wed Nov 15 18:40:40 2017
> > New Revision: 325860
> > URL: https://svnweb.freebsd.org/changeset/base/325860
> >
> > Log:
> >   newfs: warn if newer than kernel
> >
> >   Creating a UFS filesystem with a newfs newer than the running kernel,
> >   and then mounting that filesystem, can lead to interesting failures.
> >
> >   Add a safety belt to explicitly warn when newfs is newer than the
> >   running kernel.
>
> You should probably make the warning if (newer || older) as
> either is likely to have interesting side effects, as are
> mounting ufs file systems on different versions.
>
>
> Not really. The cg stuff is really only a hassle for the case ed is
testing
> for.

Its too late now, but if you take a newer ufs with the cg
stuff in them and mount it on an old system it politly well
corrupt the data that the newer kernel needs.  So your right,
doing this check in newfs wont do anything, but I can tell
you this tiny little chain has been a PITA for people that
move HD around


Fsck automatically fixes issues like that. It recomputes the checksums.

> *Sigh*  why did not UFS grow a version number of its own
> when things started to change other than UFS1 vs UFS2.
>
>
> This isn't anything like those changes..

UFS changed in a way that makes it difficult to move
UFS drives accross systems that are at differing versions.
That IS bad no mater how you slice it.  I now have to make
sure I fsck a drive when moving it from an old to new
system to get the cg checksum stuff fixed.


Except it isn't as bad as you say.

Warner


> Warner
>
> >   Reviewed by:gjb, jhb, mckusick
> >   Sponsored by:   The FreeBSD Foundation
> >   Differential Revision:  https://reviews.freebsd.org/D12765
> >
> > Modified:
> >   head/sbin/newfs/newfs.c
> >
> > Modified: head/sbin/newfs/newfs.c
> > 
> ==
> > --- head/sbin/newfs/newfs.c   Wed Nov 15 18:03:31 2017(r325859)
> > +++ head/sbin/newfs/newfs.c   Wed Nov 15 18:40:40 2017(r325860)
> > @@ -398,6 +398,10 @@ main(int argc, char *argv[])
> >   if (pp != NULL)
> >   pp->p_size *= secperblk;
> >   }
> > + if (getosreldate() < __FreeBSD_version) {
> > + warnx("%s is newer than the running kernel and may not be
> compatible",
> > + getprogname());
> > + }
> >   mkfs(pp, special);
> >   ufs_disk_close(&disk);
> >   if (!jflag)
> >
> >
>
> --
> Rod Grimes
> rgri...@freebsd.org

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


Re: svn commit: r325860 - head/sbin/newfs

2017-11-15 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Nov 15, 2017 1:51 PM, "Rodney W. Grimes" 
> wrote:
> 
> [ Charset UTF-8 unsupported, converting... ]
> > On Nov 15, 2017 11:47 AM, "Rodney W. Grimes"  net>
> > wrote:
> >
> > > Author: emaste
> > > Date: Wed Nov 15 18:40:40 2017
> > > New Revision: 325860
> > > URL: https://svnweb.freebsd.org/changeset/base/325860
> > >
> > > Log:
> > >   newfs: warn if newer than kernel
> > >
> > >   Creating a UFS filesystem with a newfs newer than the running kernel,
> > >   and then mounting that filesystem, can lead to interesting failures.
> > >
> > >   Add a safety belt to explicitly warn when newfs is newer than the
> > >   running kernel.
> >
> > You should probably make the warning if (newer || older) as
> > either is likely to have interesting side effects, as are
> > mounting ufs file systems on different versions.
> >
> >
> > Not really. The cg stuff is really only a hassle for the case ed is
> testing
> > for.
> 
> Its too late now, but if you take a newer ufs with the cg
> stuff in them and mount it on an old system it politly well
> corrupt the data that the newer kernel needs.  So your right,
> doing this check in newfs wont do anything, but I can tell
> you this tiny little chain has been a PITA for people that
> move HD around
> 
> 
> Fsck automatically fixes issues like that. It recomputes the checksums.

Yes, but you do not know that this is needed until AFTER
you have mounted the "Clean" file system and started using it,
and then you get some nasty messages (though they are a little
better now than the original ones).  So then you have to
manually fire off a fsck on the volume...

> 
> > *Sigh*  why did not UFS grow a version number of its own
> > when things started to change other than UFS1 vs UFS2.
> >
> >
> > This isn't anything like those changes..
> 
> UFS changed in a way that makes it difficult to move
> UFS drives accross systems that are at differing versions.
> That IS bad no mater how you slice it.  I now have to make
> sure I fsck a drive when moving it from an old to new
> system to get the cg checksum stuff fixed.
> 
> 
> Except it isn't as bad as you say.

It is a distracting PITA, you probably dont move a
UFS formatted flash drive around between as many
differing systems as I do.


Oh, and can you please get a mail client that does
proper quoting?

> Rod Grimes
> rgri...@freebsd.org

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


Re: svn commit: r325860 - head/sbin/newfs

2017-11-15 Thread Warner Losh
On Nov 15, 2017 2:13 PM, "Rodney W. Grimes" 
wrote:

[ Charset UTF-8 unsupported, converting... ]
> On Nov 15, 2017 1:51 PM, "Rodney W. Grimes" 
> wrote:
>
> [ Charset UTF-8 unsupported, converting... ]
> > On Nov 15, 2017 11:47 AM, "Rodney W. Grimes"
 net>
> > wrote:
> >
> > > Author: emaste
> > > Date: Wed Nov 15 18:40:40 2017
> > > New Revision: 325860
> > > URL: https://svnweb.freebsd.org/changeset/base/325860
> > >
> > > Log:
> > >   newfs: warn if newer than kernel
> > >
> > >   Creating a UFS filesystem with a newfs newer than the running
kernel,
> > >   and then mounting that filesystem, can lead to interesting failures.
> > >
> > >   Add a safety belt to explicitly warn when newfs is newer than the
> > >   running kernel.
> >
> > You should probably make the warning if (newer || older) as
> > either is likely to have interesting side effects, as are
> > mounting ufs file systems on different versions.
> >
> >
> > Not really. The cg stuff is really only a hassle for the case ed is
> testing
> > for.
>
> Its too late now, but if you take a newer ufs with the cg
> stuff in them and mount it on an old system it politly well
> corrupt the data that the newer kernel needs.  So your right,
> doing this check in newfs wont do anything, but I can tell
> you this tiny little chain has been a PITA for people that
> move HD around
>
>
> Fsck automatically fixes issues like that. It recomputes the checksums.

Yes, but you do not know that this is needed until AFTER
you have mounted the "Clean" file system and started using it,
and then you get some nasty messages (though they are a little
better now than the original ones).  So then you have to
manually fire off a fsck on the volume...



It's just a minor annoyance no data is lost.



>
> > *Sigh*  why did not UFS grow a version number of its own
> > when things started to change other than UFS1 vs UFS2.
> >
> >
> > This isn't anything like those changes..
>
> UFS changed in a way that makes it difficult to move
> UFS drives accross systems that are at differing versions.
> That IS bad no mater how you slice it.  I now have to make
> sure I fsck a drive when moving it from an old to new
> system to get the cg checksum stuff fixed.
>
>
> Except it isn't as bad as you say.

It is a distracting PITA, you probably dont move a
UFS formatted flash drive around between as many
differing systems as I do.


I've been dealing with false positives for these messages at work...


Oh, and can you please get a mail client that does
proper quoting?


It's just gmail. And there's really no alternative :(

Warner

> Rod Grimes
> rgri...@freebsd.org

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


Re: svn commit: r325860 - head/sbin/newfs

2017-11-15 Thread Conrad Meyer
On Wed, Nov 15, 2017 at 1:23 PM, Warner Losh  wrote:
> On Nov 15, 2017 2:13 PM, "Rodney W. Grimes" 
> wrote:
> Oh, and can you please get a mail client that does
> proper quoting?
>
>
> It's just gmail. And there's really no alternative :(
>
> Warner

Hi,

Gmail does quoting just fine.  I'm using it right now.  Not sure what
you're doing wrong, but there is a way to use gmail and quote replies.
I don't do anything special when I hit "reply" on an email.

Best,
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"


svn commit: r325864 - head/sys/netinet

2017-11-15 Thread Michael Tuexen
Author: tuexen
Date: Wed Nov 15 22:13:10 2017
New Revision: 325864
URL: https://svnweb.freebsd.org/changeset/base/325864

Log:
  Fix the handling of ERROR chunks which a lot of error causes.
  While there, clean up the code.
  Thanks to Felix Weinrank who found the bug by using fuzz-testing
  the SCTP userland stack.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Wed Nov 15 19:14:44 2017
(r325863)
+++ head/sys/netinet/sctp_input.c   Wed Nov 15 22:13:10 2017
(r325864)
@@ -1098,19 +1098,11 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chun
 #endif
 }
 
-/*
- * Skip past the param header and then we will find the chunk that caused the
- * problem. There are two possibilities ASCONF or FWD-TSN other than that and
- * our peer must be broken.
- */
 static void
-sctp_process_unrecog_chunk(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr,
+sctp_process_unrecog_chunk(struct sctp_tcb *stcb, uint8_t chunk_type,
 struct sctp_nets *net)
 {
-   struct sctp_chunkhdr *chk;
-
-   chk = (struct sctp_chunkhdr *)((caddr_t)phdr + sizeof(*phdr));
-   switch (chk->chunk_type) {
+   switch (chunk_type) {
case SCTP_ASCONF_ACK:
case SCTP_ASCONF:
sctp_asconf_cleanup(stcb, net);
@@ -1121,8 +1113,8 @@ sctp_process_unrecog_chunk(struct sctp_tcb *stcb, stru
break;
default:
SCTPDBG(SCTP_DEBUG_INPUT2,
-   "Peer does not support chunk type %d(%x)??\n",
-   chk->chunk_type, (uint32_t)chk->chunk_type);
+   "Peer does not support chunk type %d (0x%x).\n",
+   chunk_type, chunk_type);
break;
}
 }
@@ -1134,12 +1126,9 @@ sctp_process_unrecog_chunk(struct sctp_tcb *stcb, stru
  * XXX: Is this the right thing to do?
  */
 static void
-sctp_process_unrecog_param(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr)
+sctp_process_unrecog_param(struct sctp_tcb *stcb, uint16_t parameter_type)
 {
-   struct sctp_paramhdr *pbad;
-
-   pbad = phdr + 1;
-   switch (ntohs(pbad->param_type)) {
+   switch (parameter_type) {
/* pr-sctp draft */
case SCTP_PRSCTP_SUPPORTED:
stcb->asoc.prsctp_supported = 0;
@@ -1164,63 +1153,69 @@ sctp_process_unrecog_param(struct sctp_tcb *stcb, stru
break;
default:
SCTPDBG(SCTP_DEBUG_INPUT2,
-   "Peer does not support param type %d(%x)??\n",
-   pbad->param_type, (uint32_t)pbad->param_type);
+   "Peer does not support param type %d (0x%x)??\n",
+   parameter_type, parameter_type);
break;
}
 }
 
 static int
 sctp_handle_error(struct sctp_chunkhdr *ch,
-struct sctp_tcb *stcb, struct sctp_nets *net)
+struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t limit)
 {
-   int chklen;
-   struct sctp_paramhdr *phdr;
-   uint16_t error, error_type;
-   uint16_t error_len;
+   struct sctp_error_cause *cause;
struct sctp_association *asoc;
-   int adjust;
+   uint32_t remaining_length, adjust;
+   uint16_t code, cause_code, cause_length;
 #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
struct socket *so;
 #endif
 
/* parse through all of the errors and process */
asoc = &stcb->asoc;
-   phdr = (struct sctp_paramhdr *)((caddr_t)ch +
+   cause = (struct sctp_error_cause *)((caddr_t)ch +
sizeof(struct sctp_chunkhdr));
-   chklen = ntohs(ch->chunk_length) - sizeof(struct sctp_chunkhdr);
-   error = 0;
-   while ((size_t)chklen >= sizeof(struct sctp_paramhdr)) {
+   remaining_length = ntohs(ch->chunk_length);
+   if (remaining_length > limit) {
+   remaining_length = limit;
+   }
+   if (remaining_length >= sizeof(struct sctp_chunkhdr)) {
+   remaining_length -= sizeof(struct sctp_chunkhdr);
+   } else {
+   remaining_length = 0;
+   }
+   code = 0;
+   while (remaining_length >= sizeof(struct sctp_error_cause)) {
/* Process an Error Cause */
-   error_type = ntohs(phdr->param_type);
-   error_len = ntohs(phdr->param_length);
-   if ((error_len > chklen) || (error_len == 0)) {
-   /* invalid param length for this param */
-   SCTPDBG(SCTP_DEBUG_INPUT1, "Bogus length in error 
param- chunk left:%d errorlen:%d\n",
-   chklen, error_len);
+   cause_code = ntohs(cause->code);
+   cause_length = ntohs(cause->length);
+   if ((cause_length > remaining_length) || (cause_length == 0)) {
+   /* Invalid cause length, possibly due to truncation. *

svn commit: r325865 - in head/sys: compat/freebsd32 kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:30:21 2017
New Revision: 325865
URL: https://svnweb.freebsd.org/changeset/base/325865

Log:
  Properly bzero kldstat structure to prevent kernel information leak.
  
  Submitted by: kib
  Reported by:  TJ Corley
  Security: CVE-2017-1088

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_linker.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Wed Nov 15 22:13:10 2017
(r325864)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Wed Nov 15 22:30:21 2017
(r325865)
@@ -3331,8 +3331,8 @@ freebsd32_copyout_strings(struct image_params *imgp)
 int
 freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
 {
-   struct kld_file_stat stat;
-   struct kld32_file_stat stat32;
+   struct kld_file_stat *stat;
+   struct kld32_file_stat *stat32;
int error, version;
 
if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
@@ -3342,17 +3342,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_
version != sizeof(struct kld32_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-
-   bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
-   CP(stat, stat32, refs);
-   CP(stat, stat32, id);
-   PTROUT_CP(stat, stat32, address);
-   CP(stat, stat32, size);
-   bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
-   return (copyout(&stat32, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0) {
+   bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name));
+   CP(*stat, *stat32, refs);
+   CP(*stat, *stat32, id);
+   PTROUT_CP(*stat, *stat32, address);
+   CP(*stat, *stat32, size);
+   bcopy(&stat->pathname[0], &stat32->pathname[0],
+   sizeof(stat->pathname));
+   error = copyout(stat32, uap->stat, version);
+   }
+   free(stat, M_TEMP);
+   free(stat32, M_TEMP);
+   return (error);
 }
 
 int

Modified: head/sys/kern/kern_linker.c
==
--- head/sys/kern/kern_linker.c Wed Nov 15 22:13:10 2017(r325864)
+++ head/sys/kern/kern_linker.c Wed Nov 15 22:30:21 2017(r325865)
@@ -1229,7 +1229,7 @@ out:
 int
 sys_kldstat(struct thread *td, struct kldstat_args *uap)
 {
-   struct kld_file_stat stat;
+   struct kld_file_stat *stat;
int error, version;
 
/*
@@ -1242,10 +1242,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *ua
version != sizeof(struct kld_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-   return (copyout(&stat, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0)
+   error = copyout(stat, uap->stat, version);
+   free(stat, M_TEMP);
+   return (error);
 }
 
 int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r325866 - in stable/11/sys: compat/freebsd32 kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:34:15 2017
New Revision: 325866
URL: https://svnweb.freebsd.org/changeset/base/325866

Log:
  MFC r325865
  
  Properly bzero kldstat structure to prevent kernel information leak.
  
  Security: FreeBSD-SA-17:10.kldstat
  Security: CVE-2017-1088

Modified:
  stable/11/sys/compat/freebsd32/freebsd32_misc.c
  stable/11/sys/kern/kern_linker.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c
==
--- stable/11/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 15 22:30:21 
2017(r325865)
+++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 15 22:34:15 
2017(r325866)
@@ -2950,8 +2950,8 @@ freebsd32_copyout_strings(struct image_params *imgp)
 int
 freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
 {
-   struct kld_file_stat stat;
-   struct kld32_file_stat stat32;
+   struct kld_file_stat *stat;
+   struct kld32_file_stat *stat32;
int error, version;
 
if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
@@ -2961,17 +2961,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_
version != sizeof(struct kld32_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-
-   bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
-   CP(stat, stat32, refs);
-   CP(stat, stat32, id);
-   PTROUT_CP(stat, stat32, address);
-   CP(stat, stat32, size);
-   bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
-   return (copyout(&stat32, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0) {
+   bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name));
+   CP(*stat, *stat32, refs);
+   CP(*stat, *stat32, id);
+   PTROUT_CP(*stat, *stat32, address);
+   CP(*stat, *stat32, size);
+   bcopy(&stat->pathname[0], &stat32->pathname[0],
+   sizeof(stat->pathname));
+   error = copyout(stat32, uap->stat, version);
+   }
+   free(stat, M_TEMP);
+   free(stat32, M_TEMP);
+   return (error);
 }
 
 int

Modified: stable/11/sys/kern/kern_linker.c
==
--- stable/11/sys/kern/kern_linker.cWed Nov 15 22:30:21 2017
(r325865)
+++ stable/11/sys/kern/kern_linker.cWed Nov 15 22:34:15 2017
(r325866)
@@ -1228,7 +1228,7 @@ out:
 int
 sys_kldstat(struct thread *td, struct kldstat_args *uap)
 {
-   struct kld_file_stat stat;
+   struct kld_file_stat *stat;
int error, version;
 
/*
@@ -1241,10 +1241,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *ua
version != sizeof(struct kld_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-   return (copyout(&stat, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0)
+   error = copyout(stat, uap->stat, version);
+   free(stat, M_TEMP);
+   return (error);
 }
 
 int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r325867 - in stable/10/sys: compat/freebsd32 kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:35:16 2017
New Revision: 325867
URL: https://svnweb.freebsd.org/changeset/base/325867

Log:
  MFC r325865
  
  Properly bzero kldstat structure to prevent kernel information leak.
  
  Security: FreeBSD-SA-17:10.kldstat
  Security: CVE-2017-1088

Modified:
  stable/10/sys/compat/freebsd32/freebsd32_misc.c
  stable/10/sys/kern/kern_linker.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c
==
--- stable/10/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 15 22:34:15 
2017(r325866)
+++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 15 22:35:16 
2017(r325867)
@@ -3068,8 +3068,8 @@ freebsd32_copyout_strings(struct image_params *imgp)
 int
 freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
 {
-   struct kld_file_stat stat;
-   struct kld32_file_stat stat32;
+   struct kld_file_stat *stat;
+   struct kld32_file_stat *stat32;
int error, version;
 
if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
@@ -3079,17 +3079,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_
version != sizeof(struct kld32_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-
-   bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
-   CP(stat, stat32, refs);
-   CP(stat, stat32, id);
-   PTROUT_CP(stat, stat32, address);
-   CP(stat, stat32, size);
-   bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
-   return (copyout(&stat32, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0) {
+   bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name));
+   CP(*stat, *stat32, refs);
+   CP(*stat, *stat32, id);
+   PTROUT_CP(*stat, *stat32, address);
+   CP(*stat, *stat32, size);
+   bcopy(&stat->pathname[0], &stat32->pathname[0],
+   sizeof(stat->pathname));
+   error = copyout(stat32, uap->stat, version);
+   }
+   free(stat, M_TEMP);
+   free(stat32, M_TEMP);
+   return (error);
 }
 
 int

Modified: stable/10/sys/kern/kern_linker.c
==
--- stable/10/sys/kern/kern_linker.cWed Nov 15 22:34:15 2017
(r325866)
+++ stable/10/sys/kern/kern_linker.cWed Nov 15 22:35:16 2017
(r325867)
@@ -1223,7 +1223,7 @@ out:
 int
 sys_kldstat(struct thread *td, struct kldstat_args *uap)
 {
-   struct kld_file_stat stat;
+   struct kld_file_stat *stat;
int error, version;
 
/*
@@ -1236,10 +1236,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *ua
version != sizeof(struct kld_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-   return (copyout(&stat, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0)
+   error = copyout(stat, uap->stat, version);
+   free(stat, M_TEMP);
+   return (error);
 }
 
 int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r325869 - releng/11.0/sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:40:15 2017
New Revision: 325869
URL: https://svnweb.freebsd.org/changeset/base/325869

Log:
  Fix kernel data leak via ptrace(PT_LWPINFO). [SA-17:08]
  
  Approved by:so
  Security:   FreeBSD-SA-17:08.ptrace
  Security:   CVE-2017-1086

Modified:
  releng/11.0/sys/kern/sys_process.c

Modified: releng/11.0/sys/kern/sys_process.c
==
--- releng/11.0/sys/kern/sys_process.c  Wed Nov 15 22:39:41 2017
(r325868)
+++ releng/11.0/sys/kern/sys_process.c  Wed Nov 15 22:40:15 2017
(r325869)
@@ -518,6 +518,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl,
 struct ptrace_lwpinfo32 *pl32)
 {
 
+   bzero(pl32, sizeof(*pl32));
pl32->pl_lwpid = pl->pl_lwpid;
pl32->pl_event = pl->pl_event;
pl32->pl_flags = pl->pl_flags;
@@ -1229,6 +1230,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
} else
 #endif
pl = addr;
+   bzero(pl, sizeof(*pl));
pl->pl_lwpid = td2->td_tid;
pl->pl_event = PL_EVENT_NONE;
pl->pl_flags = 0;
@@ -1249,8 +1251,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
pl->pl_siginfo = td2->td_dbgksi.ksi_info;
}
}
-   if ((pl->pl_flags & PL_FLAG_SI) == 0)
-   bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo));
if (td2->td_dbgflags & TDB_SCE)
pl->pl_flags |= PL_FLAG_SCE;
else if (td2->td_dbgflags & TDB_SCX)
___
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: r325868 - releng/11.1/sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:39:41 2017
New Revision: 325868
URL: https://svnweb.freebsd.org/changeset/base/325868

Log:
  Fix kernel data leak via ptrace(PT_LWPINFO). [SA-17:08]
  
  Approved by:  so
  Security: FreeBSD-SA-17:08.ptrace
  Security: CVE-2017-1086

Modified:
  releng/11.1/sys/kern/sys_process.c

Modified: releng/11.1/sys/kern/sys_process.c
==
--- releng/11.1/sys/kern/sys_process.c  Wed Nov 15 22:35:16 2017
(r325867)
+++ releng/11.1/sys/kern/sys_process.c  Wed Nov 15 22:39:41 2017
(r325868)
@@ -518,6 +518,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl,
 struct ptrace_lwpinfo32 *pl32)
 {
 
+   bzero(pl32, sizeof(*pl32));
pl32->pl_lwpid = pl->pl_lwpid;
pl32->pl_event = pl->pl_event;
pl32->pl_flags = pl->pl_flags;
@@ -1301,6 +1302,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
} else
 #endif
pl = addr;
+   bzero(pl, sizeof(*pl));
pl->pl_lwpid = td2->td_tid;
pl->pl_event = PL_EVENT_NONE;
pl->pl_flags = 0;
@@ -1321,8 +1323,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
pl->pl_siginfo = td2->td_dbgksi.ksi_info;
}
}
-   if ((pl->pl_flags & PL_FLAG_SI) == 0)
-   bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo));
if (td2->td_dbgflags & TDB_SCE)
pl->pl_flags |= PL_FLAG_SCE;
else if (td2->td_dbgflags & TDB_SCX)
___
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: r325870 - releng/10.4/sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:40:32 2017
New Revision: 325870
URL: https://svnweb.freebsd.org/changeset/base/325870

Log:
  Fix kernel data leak via ptrace(PT_LWPINFO). [SA-17:08]
  
  Approved by:so
  Security:   FreeBSD-SA-17:08.ptrace
  Security:   CVE-2017-1086

Modified:
  releng/10.4/sys/kern/sys_process.c

Modified: releng/10.4/sys/kern/sys_process.c
==
--- releng/10.4/sys/kern/sys_process.c  Wed Nov 15 22:40:15 2017
(r325869)
+++ releng/10.4/sys/kern/sys_process.c  Wed Nov 15 22:40:32 2017
(r325870)
@@ -474,6 +474,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl,
 struct ptrace_lwpinfo32 *pl32)
 {
 
+   bzero(pl32, sizeof(*pl32));
pl32->pl_lwpid = pl->pl_lwpid;
pl32->pl_event = pl->pl_event;
pl32->pl_flags = pl->pl_flags;
@@ -1276,6 +1277,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
} else
 #endif
pl = addr;
+   bzero(pl, sizeof(*pl));
pl->pl_lwpid = td2->td_tid;
pl->pl_event = PL_EVENT_NONE;
pl->pl_flags = 0;
@@ -1296,8 +1298,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
pl->pl_siginfo = td2->td_dbgksi.ksi_info;
}
}
-   if ((pl->pl_flags & PL_FLAG_SI) == 0)
-   bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo));
if (td2->td_dbgflags & TDB_SCE)
pl->pl_flags |= PL_FLAG_SCE;
else if (td2->td_dbgflags & TDB_SCX)
___
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: r325871 - releng/10.3/sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:40:46 2017
New Revision: 325871
URL: https://svnweb.freebsd.org/changeset/base/325871

Log:
  Fix kernel data leak via ptrace(PT_LWPINFO). [SA-17:08]
  
  Approved by:so
  Security:   FreeBSD-SA-17:08.ptrace
  Security:   CVE-2017-1086

Modified:
  releng/10.3/sys/kern/sys_process.c

Modified: releng/10.3/sys/kern/sys_process.c
==
--- releng/10.3/sys/kern/sys_process.c  Wed Nov 15 22:40:32 2017
(r325870)
+++ releng/10.3/sys/kern/sys_process.c  Wed Nov 15 22:40:46 2017
(r325871)
@@ -474,6 +474,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl,
 struct ptrace_lwpinfo32 *pl32)
 {
 
+   bzero(pl32, sizeof(*pl32));
pl32->pl_lwpid = pl->pl_lwpid;
pl32->pl_event = pl->pl_event;
pl32->pl_flags = pl->pl_flags;
@@ -1193,6 +1194,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
} else
 #endif
pl = addr;
+   bzero(pl, sizeof(*pl));
pl->pl_lwpid = td2->td_tid;
pl->pl_event = PL_EVENT_NONE;
pl->pl_flags = 0;
@@ -1213,8 +1215,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
pl->pl_siginfo = td2->td_dbgksi.ksi_info;
}
}
-   if ((pl->pl_flags & PL_FLAG_SI) == 0)
-   bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo));
if (td2->td_dbgflags & TDB_SCE)
pl->pl_flags |= PL_FLAG_SCE;
else if (td2->td_dbgflags & TDB_SCX)
___
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: r325872 - head/sys/netipsec

2017-11-15 Thread Conrad Meyer
Author: cem
Date: Wed Nov 15 22:42:20 2017
New Revision: 325872
URL: https://svnweb.freebsd.org/changeset/base/325872

Log:
  ipsec: Use the same keysize values for HMAC as prior to r324017
  
  The HMAC construction natively permits any key size between 0 and the input
  block length. Before r324017, the auth_hash 'keysize' member was the hash
  output length, which was used by ipsec for key sizes. (Non-ipsec consumers
  need the ability to use other keysizes, hence, r324017.)
  
  The ipsec SADB code blindly uses the auth_hash 'keysize' member for both
  minimum and maximum key size, which is wrong (from an HMAC perspective).
  For now, just switch it to 'hashsize', which matches the existing
  expectations.
  
  Instead it should probably use the range [0, keysize]. But there may be
  other broken code in ipsec that rejects hashes with too small a minimum
  key size.
  
  Reported by:  olivier@
  Reviewed by:  olivier, no objection from ae
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D12770

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Wed Nov 15 22:40:46 2017(r325871)
+++ head/sys/netipsec/key.c Wed Nov 15 22:42:20 2017(r325872)
@@ -6263,7 +6263,7 @@ key_getsizes_ah(const struct auth_hash *ah, int alg, u
 u_int16_t* max)
 {
 
-   *min = *max = ah->keysize;
+   *min = *max = ah->hashsize;
if (ah->keysize == 0) {
/*
 * Transform takes arbitrary key size but algorithm
___
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: r325873 - in releng/10.3: share/man/man9 sys/kern sys/sys

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:45:13 2017
New Revision: 325873
URL: https://svnweb.freebsd.org/changeset/base/325873

Log:
  Fix namespace issue in POSIX shm implementation for jails. [SA-17:09]
  
  Approved by:  so
  Security: FreeBSD-SA-17:09.shm
  Security: CVE-2017-1087

Modified:
  releng/10.3/share/man/man9/osd.9
  releng/10.3/sys/kern/kern_osd.c
  releng/10.3/sys/kern/uipc_mqueue.c
  releng/10.3/sys/kern/uipc_sem.c
  releng/10.3/sys/kern/uipc_shm.c
  releng/10.3/sys/sys/osd.h

Modified: releng/10.3/share/man/man9/osd.9
==
--- releng/10.3/share/man/man9/osd.9Wed Nov 15 22:42:20 2017
(r325872)
+++ releng/10.3/share/man/man9/osd.9Wed Nov 15 22:45:13 2017
(r325873)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 5, 2011
+.Dd March 30, 2016
 .Dt OSD 9
 .Os
 .Sh NAME
@@ -33,6 +33,9 @@
 .Nm osd_register ,
 .Nm osd_deregister ,
 .Nm osd_set ,
+.Nm osd_reserve ,
+.Nm osd_set_reserved ,
+.Nm osd_free_reserved ,
 .Nm osd_get ,
 .Nm osd_del ,
 .Nm osd_call ,
@@ -63,6 +66,22 @@
 .Fa "void *value"
 .Fc
 .Ft void *
+.Fo osd_reserve
+.Fa "u_int slot"
+.Fc
+.Ft int
+.Fo osd_set_reserved
+.Fa "u_int type"
+.Fa "struct osd *osd"
+.Fa "u_int slot"
+.Fa "void *rsv"
+.Fa "void *value"
+.Fc
+.Ft void
+.Fo osd_free_reserved
+.Fa "void *rsv"
+.Fc
+.Ft void *
 .Fo osd_get
 .Fa "u_int type"
 .Fa "struct osd *osd"
@@ -198,6 +217,15 @@ argument points to a data object to associate with
 .Fa osd .
 .Pp
 The
+.Fn osd_set_reserved
+function does the same as
+.Fn osd_set ,
+but with an extra argument
+.Fa rsv
+that is internal-use memory previously allocated via
+.Fn osd_reserve .
+.Pp
+The
 .Fn osd_get
 function returns the data pointer associated with a kernel data structure's
 .Vt struct osd
@@ -324,6 +352,24 @@ will proceed without any
 .Xr realloc 9
 calls.
 .Pp
+It is possible for
+.Fn osd_set
+to fail to allocate this array.  To ensure that such allocation succeeds,
+.Fn osd_reserve
+may be called (in a non-blocking context), and it will pre-allocate the
+memory via
+.Xr malloc 9
+with M_WAITOK.
+Then this pre-allocated memory is passed to
+.Fn osd_set_reserved ,
+which will use it if necessary or otherwise discard it.
+The memory may also be explicitly discarded by calling
+.Fn osd_free_reserved .
+As this method always allocates memory whether or not it is ultimately needed,
+it should be used only rarely, such as in the unlikely event that
+.Fn osd_set
+fails.
+.Pp
 The
 .Nm
 API is geared towards slot identifiers storing pointers to the same underlying
@@ -359,14 +405,26 @@ the kernel including most fast paths.
 returns the slot identifier for the newly registered data type.
 .Pp
 .Fn osd_set
-returns zero on success or ENOMEM if the specified type/slot identifier pair
+and
+.Fn osd_set_reserved
+return zero on success or ENOMEM if the specified type/slot identifier pair
 triggered an internal
 .Xr realloc 9
-which failed.
+which failed
+.Fn ( osd_set_reserved
+will always succeed when
+.Fa rsv
+is non-NULL).
 .Pp
 .Fn osd_get
 returns the data pointer for the specified type/slot identifier pair, or NULL 
if
 the slot has not been initialised yet.
+.Pp
+.Fn osd_reserve
+returns a pointer suitable for passing to
+.Fn osd_set_reserved
+or
+.Fn osd_free_reserved .
 .Pp
 .Fn osd_call
 returns zero if no method is run or the method for each slot runs successfully.

Modified: releng/10.3/sys/kern/kern_osd.c
==
--- releng/10.3/sys/kern/kern_osd.c Wed Nov 15 22:42:20 2017
(r325872)
+++ releng/10.3/sys/kern/kern_osd.c Wed Nov 15 22:45:13 2017
(r325873)
@@ -44,6 +44,23 @@ __FBSDID("$FreeBSD$");
 
 /* OSD (Object Specific Data) */
 
+/*
+ * Lock key:
+ *  (m) osd_module_lock
+ *  (o) osd_object_lock
+ *  (l) osd_list_lock
+ */
+struct osd_master {
+   struct sxosd_module_lock;
+   struct rmlockosd_object_lock;
+   struct mtx   osd_list_lock;
+   LIST_HEAD(, osd) osd_list;  /* (l) */
+   osd_destructor_t*osd_destructors;   /* (o) */
+   osd_method_t*osd_methods;   /* (m) */
+   u_intosd_ntslots;   /* (m) */
+   const u_int  osd_nmethods;
+};
+
 static MALLOC_DEFINE(M_OSD, "osd", "Object Specific Data");
 
 static int osd_debug = 0;
@@ -62,25 +79,12 @@ static void do_osd_del(u_int type, struct osd *osd, u_
 int list_locked);
 
 /*
- * Lists of objects with OSD.
- *
- * Lock key:
- *  (m) osd_module_lock
- *  (o) osd_object_lock
- *  (l) osd_list_lock
+ * List of objects with OSD.
  */
-static LIST_HEAD(, osd)osd_list[OSD_LAST + 1]; /* (m) */
-static osd_method_t *osd_methods[OSD_LAST + 1];/* (m) */
-static u_int osd_nslots[OSD_LAST + 1]; /* (m) */
-static osd_destructor_t *osd_destructors[OSD_LAST + 1];  

svn commit: r325874 - releng/10.4/sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:45:50 2017
New Revision: 325874
URL: https://svnweb.freebsd.org/changeset/base/325874

Log:
  Fix namespace issue in POSIX shm implementation for jails. [SA-17:09]
  
  Approved by:so
  Security:   FreeBSD-SA-17:09.shm
  Security:   CVE-2017-1087

Modified:
  releng/10.4/sys/kern/uipc_mqueue.c
  releng/10.4/sys/kern/uipc_sem.c
  releng/10.4/sys/kern/uipc_shm.c

Modified: releng/10.4/sys/kern/uipc_mqueue.c
==
--- releng/10.4/sys/kern/uipc_mqueue.c  Wed Nov 15 22:45:13 2017
(r325873)
+++ releng/10.4/sys/kern/uipc_mqueue.c  Wed Nov 15 22:45:50 2017
(r325874)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -60,8 +61,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -131,6 +132,7 @@ struct mqfs_node {
LIST_HEAD(,mqfs_node)   mn_children;
LIST_ENTRY(mqfs_node)   mn_sibling;
LIST_HEAD(,mqfs_vdata)  mn_vnodes;
+   const void  *mn_pr_root;
int mn_refcount;
mqfs_type_t mn_type;
int mn_deleted;
@@ -218,6 +220,7 @@ static uma_zone_t   mvdata_zone;
 static uma_zone_t  mqnoti_zone;
 static struct vop_vector   mqfs_vnodeops;
 static struct fileops  mqueueops;
+static unsignedmqfs_osd_jail_slot;
 
 /*
  * Directory structure construction and manipulation
@@ -235,6 +238,7 @@ static int  mqfs_destroy(struct mqfs_node *mn);
 static voidmqfs_fileno_alloc(struct mqfs_info *mi, struct mqfs_node *mn);
 static voidmqfs_fileno_free(struct mqfs_info *mi, struct mqfs_node *mn);
 static int mqfs_allocv(struct mount *mp, struct vnode **vpp, struct 
mqfs_node *pn);
+static int mqfs_prison_remove(void *obj, void *data);
 
 /*
  * Message queue construction and maniplation
@@ -435,6 +439,7 @@ mqfs_create_node(const char *name, int namelen, struct
 
node = mqnode_alloc();
strncpy(node->mn_name, name, namelen);
+   node->mn_pr_root = cred->cr_prison->pr_root;
node->mn_type = nodetype;
node->mn_refcount = 1;
vfs_timestamp(&node->mn_birth);
@@ -643,6 +648,9 @@ mqfs_init(struct vfsconf *vfc)
 {
struct mqfs_node *root;
struct mqfs_info *mi;
+   osd_method_t methods[PR_MAXMETHOD] = {
+   [PR_METHOD_REMOVE] = mqfs_prison_remove,
+   };
 
mqnode_zone = uma_zcreate("mqnode", sizeof(struct mqfs_node),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
@@ -669,6 +677,7 @@ mqfs_init(struct vfsconf *vfc)
EVENTHANDLER_PRI_ANY);
mq_fdclose = mqueue_fdclose;
p31b_setcfg(CTL_P1003_1B_MESSAGE_PASSING, _POSIX_MESSAGE_PASSING);
+   mqfs_osd_jail_slot = osd_jail_register(NULL, methods);
return (0);
 }
 
@@ -682,6 +691,7 @@ mqfs_uninit(struct vfsconf *vfc)
 
if (!unloadable)
return (EOPNOTSUPP);
+   osd_jail_deregister(mqfs_osd_jail_slot);
EVENTHANDLER_DEREGISTER(process_exit, exit_tag);
mi = &mqfs_data;
mqfs_destroy(mi->mi_root);
@@ -801,13 +811,17 @@ found:
  * Search a directory entry
  */
 static struct mqfs_node *
-mqfs_search(struct mqfs_node *pd, const char *name, int len)
+mqfs_search(struct mqfs_node *pd, const char *name, int len, struct ucred 
*cred)
 {
struct mqfs_node *pn;
+   const void *pr_root;
 
sx_assert(&pd->mn_info->mi_lock, SX_LOCKED);
+   pr_root = cred->cr_prison->pr_root;
LIST_FOREACH(pn, &pd->mn_children, mn_sibling) {
-   if (strncmp(pn->mn_name, name, len) == 0 &&
+   /* Only match names within the same prison root directory */
+   if ((pn->mn_pr_root == NULL || pn->mn_pr_root == pr_root) &&
+   strncmp(pn->mn_name, name, len) == 0 &&
pn->mn_name[len] == '\0')
return (pn);
}
@@ -879,7 +893,7 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap)
 
/* named node */
sx_xlock(&mqfs->mi_lock);
-   pn = mqfs_search(pd, pname, namelen);
+   pn = mqfs_search(pd, pname, namelen, cnp->cn_cred);
if (pn != NULL)
mqnode_addref(pn);
sx_xunlock(&mqfs->mi_lock);
@@ -1364,6 +1378,7 @@ mqfs_readdir(struct vop_readdir_args *ap)
struct mqfs_node *pn;
struct dirent entry;
struct uio *uio;
+   const void *pr_root;
int *tmp_ncookies = NULL;
off_t offset;
int error, i;
@@ -1388,10 +1403,18 @@ mqfs_readdir(struct vop_readdir_args *ap)
error = 0;
offset = 0;
 
+   pr_root = ap->a_cred->cr_prison->pr_root;
sx_xlock(&mi->mi_lock);
 
LIST_FOREACH(pn, &pd->mn_children, mn_sibling) {
entry.d_reclen = sizeof(entry);
+
+

svn commit: r325875 - in releng/11.1: . sys/compat/freebsd32 sys/conf sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:49:47 2017
New Revision: 325875
URL: https://svnweb.freebsd.org/changeset/base/325875

Log:
  Properly bzero kldstat structure to prevent information leak. [SA-17:10]
  
  Approved by:  so
  Security: FreeBSD-SA-17:10.kldstat
  Security: CVE-2017-1088

Modified:
  releng/11.1/UPDATING
  releng/11.1/sys/compat/freebsd32/freebsd32_misc.c
  releng/11.1/sys/conf/newvers.sh
  releng/11.1/sys/kern/kern_linker.c

Modified: releng/11.1/UPDATING
==
--- releng/11.1/UPDATINGWed Nov 15 22:45:50 2017(r325874)
+++ releng/11.1/UPDATINGWed Nov 15 22:49:47 2017(r325875)
@@ -16,6 +16,13 @@ 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.
 
+20171115   p3  FreeBSD-SA-17:08.ptrace
+   FreeBSD-SA-17:10.kldstat
+
+   Fix ptrace(2) vulnerability. [SA-17:08.ptrace]
+
+   Fix kldstat(2) vulnerability. [SA-17:10.kldstat]
+
 20171102   p3  FreeBSD-EN-17:09.tzdata
 
Update timezone database information. [EN-17:09]

Modified: releng/11.1/sys/compat/freebsd32/freebsd32_misc.c
==
--- releng/11.1/sys/compat/freebsd32/freebsd32_misc.c   Wed Nov 15 22:45:50 
2017(r325874)
+++ releng/11.1/sys/compat/freebsd32/freebsd32_misc.c   Wed Nov 15 22:49:47 
2017(r325875)
@@ -2950,8 +2950,8 @@ freebsd32_copyout_strings(struct image_params *imgp)
 int
 freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
 {
-   struct kld_file_stat stat;
-   struct kld32_file_stat stat32;
+   struct kld_file_stat *stat;
+   struct kld32_file_stat *stat32;
int error, version;
 
if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
@@ -2961,17 +2961,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_
version != sizeof(struct kld32_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-
-   bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
-   CP(stat, stat32, refs);
-   CP(stat, stat32, id);
-   PTROUT_CP(stat, stat32, address);
-   CP(stat, stat32, size);
-   bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
-   return (copyout(&stat32, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0) {
+   bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name));
+   CP(*stat, *stat32, refs);
+   CP(*stat, *stat32, id);
+   PTROUT_CP(*stat, *stat32, address);
+   CP(*stat, *stat32, size);
+   bcopy(&stat->pathname[0], &stat32->pathname[0],
+   sizeof(stat->pathname));
+   error = copyout(stat32, uap->stat, version);
+   }
+   free(stat, M_TEMP);
+   free(stat32, M_TEMP);
+   return (error);
 }
 
 int

Modified: releng/11.1/sys/conf/newvers.sh
==
--- releng/11.1/sys/conf/newvers.sh Wed Nov 15 22:45:50 2017
(r325874)
+++ releng/11.1/sys/conf/newvers.sh Wed Nov 15 22:49:47 2017
(r325875)
@@ -44,7 +44,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.1"
-BRANCH="RELEASE-p3"
+BRANCH="RELEASE-p4"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/11.1/sys/kern/kern_linker.c
==
--- releng/11.1/sys/kern/kern_linker.c  Wed Nov 15 22:45:50 2017
(r325874)
+++ releng/11.1/sys/kern/kern_linker.c  Wed Nov 15 22:49:47 2017
(r325875)
@@ -1201,7 +1201,7 @@ out:
 int
 sys_kldstat(struct thread *td, struct kldstat_args *uap)
 {
-   struct kld_file_stat stat;
+   struct kld_file_stat *stat;
int error, version;
 
/*
@@ -1214,10 +1214,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *ua
version != sizeof(struct kld_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-   return (copyout(&stat, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0)
+   error = copyout(stat, uap->sta

svn commit: r325877 - in releng/10.4: . sys/compat/freebsd32 sys/conf sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:50:47 2017
New Revision: 325877
URL: https://svnweb.freebsd.org/changeset/base/325877

Log:
  Properly bzero kldstat structure to prevent information leak. [SA-17:10]
  
  Approved by:so
  Security:   FreeBSD-SA-17:10.kldstat
  Security:   CVE-2017-1088

Modified:
  releng/10.4/UPDATING
  releng/10.4/sys/compat/freebsd32/freebsd32_misc.c
  releng/10.4/sys/conf/newvers.sh
  releng/10.4/sys/kern/kern_linker.c

Modified: releng/10.4/UPDATING
==
--- releng/10.4/UPDATINGWed Nov 15 22:50:20 2017(r325876)
+++ releng/10.4/UPDATINGWed Nov 15 22:50:47 2017(r325877)
@@ -16,6 +16,16 @@ 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.
 
+20171115   p3  FreeBSD-SA-17:08.ptrace
+   FreeBSD-SA-17:09.shm
+   FreeBSD-SA-17:10.kldstat
+
+   Fix ptrace(2) vulnerability. [SA-17:08.ptrace]
+
+   Fix POSIX shm namespace vulnerability. [SA-17:09.shm]
+
+   Fix kldstat(2) vulnerability. [SA-17:10.kldstat]
+
 20171102:  p2  FreeBSD-EN-17:09.tzdata
 
Update timezone database information. [EN-17:09]

Modified: releng/10.4/sys/compat/freebsd32/freebsd32_misc.c
==
--- releng/10.4/sys/compat/freebsd32/freebsd32_misc.c   Wed Nov 15 22:50:20 
2017(r325876)
+++ releng/10.4/sys/compat/freebsd32/freebsd32_misc.c   Wed Nov 15 22:50:47 
2017(r325877)
@@ -3068,8 +3068,8 @@ freebsd32_copyout_strings(struct image_params *imgp)
 int
 freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
 {
-   struct kld_file_stat stat;
-   struct kld32_file_stat stat32;
+   struct kld_file_stat *stat;
+   struct kld32_file_stat *stat32;
int error, version;
 
if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
@@ -3079,17 +3079,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_
version != sizeof(struct kld32_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-
-   bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
-   CP(stat, stat32, refs);
-   CP(stat, stat32, id);
-   PTROUT_CP(stat, stat32, address);
-   CP(stat, stat32, size);
-   bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
-   return (copyout(&stat32, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0) {
+   bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name));
+   CP(*stat, *stat32, refs);
+   CP(*stat, *stat32, id);
+   PTROUT_CP(*stat, *stat32, address);
+   CP(*stat, *stat32, size);
+   bcopy(&stat->pathname[0], &stat32->pathname[0],
+   sizeof(stat->pathname));
+   error = copyout(stat32, uap->stat, version);
+   }
+   free(stat, M_TEMP);
+   free(stat32, M_TEMP);
+   return (error);
 }
 
 int

Modified: releng/10.4/sys/conf/newvers.sh
==
--- releng/10.4/sys/conf/newvers.sh Wed Nov 15 22:50:20 2017
(r325876)
+++ releng/10.4/sys/conf/newvers.sh Wed Nov 15 22:50:47 2017
(r325877)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.4"
-BRANCH="RELEASE-p2"
+BRANCH="RELEASE-p3"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.4/sys/kern/kern_linker.c
==
--- releng/10.4/sys/kern/kern_linker.c  Wed Nov 15 22:50:20 2017
(r325876)
+++ releng/10.4/sys/kern/kern_linker.c  Wed Nov 15 22:50:47 2017
(r325877)
@@ -1196,7 +1196,7 @@ out:
 int
 sys_kldstat(struct thread *td, struct kldstat_args *uap)
 {
-   struct kld_file_stat stat;
+   struct kld_file_stat *stat;
int error, version;
 
/*
@@ -1209,10 +1209,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *ua
version != sizeof(struct kld_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-   return (copyout(&stat, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldsta

svn commit: r325876 - in releng/11.0: . sys/compat/freebsd32 sys/conf sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:50:20 2017
New Revision: 325876
URL: https://svnweb.freebsd.org/changeset/base/325876

Log:
  Properly bzero kldstat structure to prevent information leak. [SA-17:10]
  
  Approved by:so
  Security:   FreeBSD-SA-17:10.kldstat
  Security:   CVE-2017-1088

Modified:
  releng/11.0/UPDATING
  releng/11.0/sys/compat/freebsd32/freebsd32_misc.c
  releng/11.0/sys/conf/newvers.sh
  releng/11.0/sys/kern/kern_linker.c

Modified: releng/11.0/UPDATING
==
--- releng/11.0/UPDATINGWed Nov 15 22:49:47 2017(r325875)
+++ releng/11.0/UPDATINGWed Nov 15 22:50:20 2017(r325876)
@@ -16,6 +16,13 @@ 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.
 
+20171115   p15 FreeBSD-SA-17:08.ptrace
+   FreeBSD-SA-17:10.kldstat
+
+   Fix ptrace(2) vulnerability. [SA-17:08.ptrace]
+
+   Fix kldstat(2) vulnerability. [SA-17:10.kldstat]
+
 20171102   p14 FreeBSD-EN-17:09.tzdata
 
Update timezone database information. [EN-17:09]

Modified: releng/11.0/sys/compat/freebsd32/freebsd32_misc.c
==
--- releng/11.0/sys/compat/freebsd32/freebsd32_misc.c   Wed Nov 15 22:49:47 
2017(r325875)
+++ releng/11.0/sys/compat/freebsd32/freebsd32_misc.c   Wed Nov 15 22:50:20 
2017(r325876)
@@ -2959,8 +2959,8 @@ freebsd32_copyout_strings(struct image_params *imgp)
 int
 freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
 {
-   struct kld_file_stat stat;
-   struct kld32_file_stat stat32;
+   struct kld_file_stat *stat;
+   struct kld32_file_stat *stat32;
int error, version;
 
if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
@@ -2970,17 +2970,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_
version != sizeof(struct kld32_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-
-   bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
-   CP(stat, stat32, refs);
-   CP(stat, stat32, id);
-   PTROUT_CP(stat, stat32, address);
-   CP(stat, stat32, size);
-   bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
-   return (copyout(&stat32, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0) {
+   bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name));
+   CP(*stat, *stat32, refs);
+   CP(*stat, *stat32, id);
+   PTROUT_CP(*stat, *stat32, address);
+   CP(*stat, *stat32, size);
+   bcopy(&stat->pathname[0], &stat32->pathname[0],
+   sizeof(stat->pathname));
+   error = copyout(stat32, uap->stat, version);
+   }
+   free(stat, M_TEMP);
+   free(stat32, M_TEMP);
+   return (error);
 }
 
 int

Modified: releng/11.0/sys/conf/newvers.sh
==
--- releng/11.0/sys/conf/newvers.sh Wed Nov 15 22:49:47 2017
(r325875)
+++ releng/11.0/sys/conf/newvers.sh Wed Nov 15 22:50:20 2017
(r325876)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.0"
-BRANCH="RELEASE-p14"
+BRANCH="RELEASE-p15"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/11.0/sys/kern/kern_linker.c
==
--- releng/11.0/sys/kern/kern_linker.c  Wed Nov 15 22:49:47 2017
(r325875)
+++ releng/11.0/sys/kern/kern_linker.c  Wed Nov 15 22:50:20 2017
(r325876)
@@ -1201,7 +1201,7 @@ out:
 int
 sys_kldstat(struct thread *td, struct kldstat_args *uap)
 {
-   struct kld_file_stat stat;
+   struct kld_file_stat *stat;
int error, version;
 
/*
@@ -1214,10 +1214,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *ua
version != sizeof(struct kld_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-   return (copyout(&stat, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0)
+   error = copyout(stat, uap

svn commit: r325878 - in releng/10.3: . sys/compat/freebsd32 sys/conf sys/kern

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 22:51:08 2017
New Revision: 325878
URL: https://svnweb.freebsd.org/changeset/base/325878

Log:
  Properly bzero kldstat structure to prevent information leak. [SA-17:10]
  
  Approved by:so
  Security:   FreeBSD-SA-17:10.kldstat
  Security:   CVE-2017-1088

Modified:
  releng/10.3/UPDATING
  releng/10.3/sys/compat/freebsd32/freebsd32_misc.c
  releng/10.3/sys/conf/newvers.sh
  releng/10.3/sys/kern/kern_linker.c

Modified: releng/10.3/UPDATING
==
--- releng/10.3/UPDATINGWed Nov 15 22:50:47 2017(r325877)
+++ releng/10.3/UPDATINGWed Nov 15 22:51:08 2017(r325878)
@@ -16,6 +16,16 @@ 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.
 
+20171115   p24 FreeBSD-SA-17:08.ptrace
+   FreeBSD-SA-17:09.shm
+   FreeBSD-SA-17:10.kldstat
+
+   Fix ptrace(2) vulnerability. [SA-17:08.ptrace]
+
+   Fix POSIX shm namespace vulnerability. [SA-17:09.shm]
+
+   Fix kldstat(2) vulnerability. [SA-17:10.kldstat]
+
 20171102   p23 FreeBSD-EN-17:09.tzdata
 
Update timezone database information. [EN-17:09]

Modified: releng/10.3/sys/compat/freebsd32/freebsd32_misc.c
==
--- releng/10.3/sys/compat/freebsd32/freebsd32_misc.c   Wed Nov 15 22:50:47 
2017(r325877)
+++ releng/10.3/sys/compat/freebsd32/freebsd32_misc.c   Wed Nov 15 22:51:08 
2017(r325878)
@@ -3040,8 +3040,8 @@ freebsd32_copyout_strings(struct image_params *imgp)
 int
 freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
 {
-   struct kld_file_stat stat;
-   struct kld32_file_stat stat32;
+   struct kld_file_stat *stat;
+   struct kld32_file_stat *stat32;
int error, version;
 
if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
@@ -3051,17 +3051,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_
version != sizeof(struct kld32_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-
-   bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
-   CP(stat, stat32, refs);
-   CP(stat, stat32, id);
-   PTROUT_CP(stat, stat32, address);
-   CP(stat, stat32, size);
-   bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
-   return (copyout(&stat32, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldstat(td, uap->fileid, stat);
+   if (error == 0) {
+   bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name));
+   CP(*stat, *stat32, refs);
+   CP(*stat, *stat32, id);
+   PTROUT_CP(*stat, *stat32, address);
+   CP(*stat, *stat32, size);
+   bcopy(&stat->pathname[0], &stat32->pathname[0],
+   sizeof(stat->pathname));
+   error = copyout(stat32, uap->stat, version);
+   }
+   free(stat, M_TEMP);
+   free(stat32, M_TEMP);
+   return (error);
 }
 
 int

Modified: releng/10.3/sys/conf/newvers.sh
==
--- releng/10.3/sys/conf/newvers.sh Wed Nov 15 22:50:47 2017
(r325877)
+++ releng/10.3/sys/conf/newvers.sh Wed Nov 15 22:51:08 2017
(r325878)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.3"
-BRANCH="RELEASE-p23"
+BRANCH="RELEASE-p24"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.3/sys/kern/kern_linker.c
==
--- releng/10.3/sys/kern/kern_linker.c  Wed Nov 15 22:50:47 2017
(r325877)
+++ releng/10.3/sys/kern/kern_linker.c  Wed Nov 15 22:51:08 2017
(r325878)
@@ -1196,7 +1196,7 @@ out:
 int
 sys_kldstat(struct thread *td, struct kldstat_args *uap)
 {
-   struct kld_file_stat stat;
+   struct kld_file_stat *stat;
int error, version;
 
/*
@@ -1209,10 +1209,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *ua
version != sizeof(struct kld_file_stat))
return (EINVAL);
 
-   error = kern_kldstat(td, uap->fileid, &stat);
-   if (error != 0)
-   return (error);
-   return (copyout(&stat, uap->stat, version));
+   stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
+   error = kern_kldsta

svn commit: r325879 - releng/11.1

2017-11-15 Thread Gordon Tetlow
Author: gordon
Date: Wed Nov 15 23:29:32 2017
New Revision: 325879
URL: https://svnweb.freebsd.org/changeset/base/325879

Log:
  Correct patch level.
  
  Approved by:  so
  X-Pointy-Hat: gordon@

Modified:
  releng/11.1/UPDATING

Modified: releng/11.1/UPDATING
==
--- releng/11.1/UPDATINGWed Nov 15 22:51:08 2017(r325878)
+++ releng/11.1/UPDATINGWed Nov 15 23:29:32 2017(r325879)
@@ -16,7 +16,7 @@ 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.
 
-20171115   p3  FreeBSD-SA-17:08.ptrace
+20171115   p4  FreeBSD-SA-17:08.ptrace
FreeBSD-SA-17:10.kldstat
 
Fix ptrace(2) vulnerability. [SA-17:08.ptrace]
___
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: r325880 - in head: share/man/man4 sys/dev/cxgbe

2017-11-15 Thread Navdeep Parhar
Author: np
Date: Wed Nov 15 23:48:02 2017
New Revision: 325880
URL: https://svnweb.freebsd.org/changeset/base/325880

Log:
  cxgbe(4):  Combine all _10g and _1g tunables and drop the suffix from
  their names.  The finer-grained knobs weren't practically useful.
  
  Sponsored by: Chelsio Communications

Modified:
  head/share/man/man4/cxgbe.4
  head/share/man/man4/cxgbev.4
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_vf.c

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Wed Nov 15 23:29:32 2017(r325879)
+++ head/share/man/man4/cxgbe.4 Wed Nov 15 23:48:02 2017(r325880)
@@ -172,37 +172,22 @@ types.
 A negative value for such a tunable instructs the driver to create
 up to that many queues if there are enough CPU cores available.
 .Bl -tag -width indent
-.It Va hw.cxgbe.ntxq10g
-Number of tx queues used for a 10Gb or higher-speed port.
+.It Va hw.cxgbe.ntxq
+Number of NIC tx queues used for a port.
 The default is 16 or the number
 of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.nrxq10g
-Number of rx queues used for a 10Gb or higher-speed port.
+.It Va hw.cxgbe.nrxq
+Number of NIC rx queues used for a port.
 The default is 8 or the number
 of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.ntxq1g
-Number of tx queues used for a 1Gb port.
-The default is 4 or the number
-of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.nrxq1g
-Number of rx queues used for a 1Gb port.
-The default is 2 or the number
-of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.nofldtxq10g
-Number of TOE tx queues used for a 10Gb or higher-speed port.
+.It Va hw.cxgbe.nofldtxq
+Number of TOE tx queues used for a port.
 The default is 8 or the
 number of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.nofldrxq10g
-Number of TOE rx queues used for a 10Gb or higher-speed port.
+.It Va hw.cxgbe.nofldrxq
+Number of TOE rx queues used for a port.
 The default is 2 or the
 number of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.nofldtxq1g
-Number of TOE tx queues used for a 1Gb port.
-The default is 2 or the
-number of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.nofldrxq1g
-Number of TOE rx queues used for a 1Gb port.
-The default is 1.
 .It Va hw.cxgbe.num_vis
 Number of virtual interfaces (VIs) created for each port.
 Each virtual interface creates a separate network interface.
@@ -213,8 +198,7 @@ name from the table above.
 Additional virtual interfaces use a single pair of queues
 for rx and tx as well an additional pair of queues for TOE rx and tx.
 The default is 1.
-.It Va hw.cxgbe.holdoff_timer_idx_10G
-.It Va hw.cxgbe.holdoff_timer_idx_1G
+.It Va hw.cxgbe.holdoff_timer_idx
 .It Va hw.cxgbe.holdoff_timer_idx_ofld
 Timer index value used to delay interrupts.
 The holdoff timer list has the values 1, 5, 10, 50, 100, and 200
@@ -224,8 +208,7 @@ holdoff_timer_idx_ofld applies to queues used for TOE 
 The default value is 1 which means the timer value is 5us.
 Different interfaces can be assigned different values at any time via the
 dev..X.holdoff_tmr_idx and dev..X.holdoff_tmr_idx_ofld sysctls.
-.It Va hw.cxgbe.holdoff_pktc_idx_10G
-.It Va hw.cxgbe.holdoff_pktc_idx_1G
+.It Va hw.cxgbe.holdoff_pktc_idx
 .It Va hw.cxgbe.holdoff_pktc_idx_ofld
 Packet-count index value used to delay interrupts.
 The packet-count list has the values 1, 8, 16, and 32 by default,

Modified: head/share/man/man4/cxgbev.4
==
--- head/share/man/man4/cxgbev.4Wed Nov 15 23:29:32 2017
(r325879)
+++ head/share/man/man4/cxgbev.4Wed Nov 15 23:48:02 2017
(r325880)
@@ -172,24 +172,15 @@ Tunables can be set at the
 prompt before booting the kernel or stored in
 .Xr loader.conf 5 .
 .Bl -tag -width indent
-.It Va hw.cxgbe.ntxq10g
-Number of tx queues used for a 10Gb or higher-speed port.
+.It Va hw.cxgbe.ntxq
+Number of tx queues used for a port.
 The default is 16 or the number
 of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.nrxq10g
-Number of rx queues used for a 10Gb or higher-speed port.
+.It Va hw.cxgbe.nrxq
+Number of rx queues used for a port.
 The default is 8 or the number
 of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.ntxq1g
-Number of tx queues used for a 1Gb port.
-The default is 4 or the number
-of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.nrxq1g
-Number of rx queues used for a 1Gb port.
-The default is 2 or the number
-of CPU cores in the system, whichever is less.
-.It Va hw.cxgbe.holdoff_timer_idx_10G
-.It Va hw.cxgbe.holdoff_timer_idx_1G
+.It Va hw.cxgbe.holdoff_timer_idx
 Timer index value used to delay interrupts.
 The holdoff timer list has the values 1, 5, 10, 50, 100, and 200
 by default (all values are in microseconds) and the index selects

svn commit: r325881 - head/share/man/man7

2017-11-15 Thread Warner Losh
Author: imp
Date: Wed Nov 15 23:51:17 2017
New Revision: 325881
URL: https://svnweb.freebsd.org/changeset/base/325881

Log:
  Fix some formatting issues, bump .Dd to today's date, don't use
  contractions, and make igor almost happy with this (two issues are
  false positives, and I'm not sure a synopsis makes sense).
  
  Sponsored by: Netflix

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Nov 15 23:48:02 2017(r325880)
+++ head/share/man/man7/arch.7  Wed Nov 15 23:51:17 2017(r325881)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 16, 2017
+.Dd November 15, 2017
 .Dt ARCH 7
 .Os
 .Sh NAME
@@ -68,7 +68,7 @@ and
 .Vt ptrdiff_t
 should be avoided.
 .Pp
-On some architectures, e.g.
+On some architectures, e.g.,
 .Dv sparc64 ,
 .Dv powerpc
 and AIM variants of
@@ -367,7 +367,7 @@ It is often the same as
 just as one CPU architecture can be implemented by many different
 hardware platforms, one hardware platform may support multiple CPU
 architecture family members, though with different binaries.
-For example, 
+For example,
 .Dv MACHINE
 of i386 supported the IBM-AT hardware platform while the
 .Dv MACHINE
@@ -393,12 +393,12 @@ integers (endian).
 It may also encode a variation in the size of the integer or pointer.
 It may also encode a ISA revision.
 It may also encode hard versus soft floating point ABI and usage.
-It may also encode a variant ABI when there other factors don't
+It may also encode a variant ABI when there other factors do not
 uniquely define the ABI (eg, MIPS' n32 ABI).
 It, along with
 .Dv MACHINE, define the ABI used by the system.
 For example, the MIPS CPU processor family supports 9 different
-combinations encoding pointer size, endian and hard vs soft float (for
+combinations encoding pointer size, endian and hard versus soft float (for
 8 combinations) as well as N32 (which only ever had one variation of
 all these).
 Generally, the plain CPU name specifies the most common (or at least
@@ -429,15 +429,18 @@ framework).
 to build.
 It is used to optimize the build for a specific CPU / core that the
 binaries run on.
-Generally, this doesn't change the ABI, though it can be a fine line
+Generally, this does not change the ABI, though it can be a fine line
 between optimization for specific cases.
-.It Dv TARGET  Used to set Dv MACHINE in the top level Makefile for cross 
building.
+.It Dv TARGET  Used to set
+.Dv MACHINE
+in the top level Makefile for cross building.
 Unused outside of that scope.
 It is not passed down to the rest of the build.
-Makefiles outside of the top level shouldn't use it at all (though
+Makefiles outside of the top level should not use it at all (though
 some have their own private copy for hysterical raisons).
 .It Dv TARGET_ARCH Used to set
-.Dv MACHINE_ARCH by the top level Makefile for cross building.
+.Dv MACHINE_ARCH
+by the top level Makefile for cross building.
 Like
 .Dv TARGET , it is unused outside of that scope.
 .El
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread Ed Maste
On 15 November 2017 at 13:47, Rodney W. Grimes
 wrote:
>> Author: emaste
>> Date: Wed Nov 15 18:40:40 2017
>> New Revision: 325860
>> URL: https://svnweb.freebsd.org/changeset/base/325860
>>
>> Log:
>>   newfs: warn if newer than kernel
>>
>>   Creating a UFS filesystem with a newfs newer than the running kernel,
>>   and then mounting that filesystem, can lead to interesting failures.
>>
>>   Add a safety belt to explicitly warn when newfs is newer than the
>>   running kernel.
>
> You should probably make the warning if (newer || older) as
> either is likely to have interesting side effects, as are
> mounting ufs file systems on different versions.

Why would an older newfs cause trouble? Forward compatibility should be fine.
___
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: r325882 - head/share/man/man7

2017-11-15 Thread Warner Losh
Author: imp
Date: Thu Nov 16 00:19:44 2017
New Revision: 325882
URL: https://svnweb.freebsd.org/changeset/base/325882

Log:
  Use better wording: change there to the and define to defines.
  Also fix a run-a-way macro invocation of Dv.
  
  Noticed by: matteo@

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Nov 15 23:51:17 2017(r325881)
+++ head/share/man/man7/arch.7  Thu Nov 16 00:19:44 2017(r325882)
@@ -393,10 +393,11 @@ integers (endian).
 It may also encode a variation in the size of the integer or pointer.
 It may also encode a ISA revision.
 It may also encode hard versus soft floating point ABI and usage.
-It may also encode a variant ABI when there other factors do not
-uniquely define the ABI (eg, MIPS' n32 ABI).
+It may also encode a variant ABI when the other factors do not
+uniquely define the ABI (e.g., MIPS' n32 ABI).
 It, along with
-.Dv MACHINE, define the ABI used by the system.
+.Dv MACHINE ,
+defines the ABI used by the system.
 For example, the MIPS CPU processor family supports 9 different
 combinations encoding pointer size, endian and hard versus soft float (for
 8 combinations) as well as N32 (which only ever had one variation of
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread Warner Losh
On Wed, Nov 15, 2017 at 5:05 PM, Ed Maste  wrote:

> On 15 November 2017 at 13:47, Rodney W. Grimes
>  wrote:
> >> Author: emaste
> >> Date: Wed Nov 15 18:40:40 2017
> >> New Revision: 325860
> >> URL: https://svnweb.freebsd.org/changeset/base/325860
> >>
> >> Log:
> >>   newfs: warn if newer than kernel
> >>
> >>   Creating a UFS filesystem with a newfs newer than the running kernel,
> >>   and then mounting that filesystem, can lead to interesting failures.
> >>
> >>   Add a safety belt to explicitly warn when newfs is newer than the
> >>   running kernel.
> >
> > You should probably make the warning if (newer || older) as
> > either is likely to have interesting side effects, as are
> > mounting ufs file systems on different versions.
>
> Why would an older newfs cause trouble? Forward compatibility should be
> fine
>

The only scenario that 'old' would cause problems is that if you did a
newfs with a new binary on a new kernel, mounted the file system, wrote
files to it, then rebooted with an old kernel, mounted the filesystem
there, writing new files to it, and then unmounting and running with a new
kernel. At that point, the new kernel will start printing cg mismatch
errors and will limit its allocation to CGs that weren't modified when it
was mounted under the old kernel (since those CGs will have changed their
checksum, but no new checksum will have been computed). The root cause here
is that the old kernel doesn't know that the CK_CYLGRP tags the cg as
having the proper hash metadata associated with them.

It sounds like this is exactly what Rod does on a regular basis as he's
taking a disk from one system to another and back again, maybe for file
transport on a USB stick. It's not a crazy scenario. At this point, there's
the annoyance of the messages, but that will be fixed with an fsck.

The scenario where I have a newer kernel and an old newfs will be a nop:
the old newfs won't set CK_CYLGRP, so the kernel won't checksum, so there
won't be any mismatch possible.

I'm not sure that the new safety belt is reasonable. Today it's fine, but
over time it will start producing false-positive warnings since the real
issue is just before/after the cg change, not old/new in general. I'd be
tempted to make a check against newfs being >= 1200046 while the kernel is
< 1200046. There wasn't a specific bump for this change to sys/param.h, but
this version was bumped within a few hours of Kirk's change.

Warner
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread Warner Losh
On Wed, Nov 15, 2017 at 2:28 PM, Conrad Meyer  wrote:

> On Wed, Nov 15, 2017 at 1:23 PM, Warner Losh  wrote:
> > On Nov 15, 2017 2:13 PM, "Rodney W. Grimes"  net>
> > wrote:
> > Oh, and can you please get a mail client that does
> > proper quoting?
> >
> >
> > It's just gmail. And there's really no alternative :(
> >
> > Warner
>
> Hi,
>
> Gmail does quoting just fine.  I'm using it right now.  Not sure what
> you're doing wrong, but there is a way to use gmail and quote replies.
> I don't do anything special when I hit "reply" on an email.
>

I usually don't either, but some of my messages today were from my phone.
Maybe that's the client I should avoid.

Warner
___
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: r325883 - head/sys/dev/cxgbe

2017-11-15 Thread Navdeep Parhar
Author: np
Date: Thu Nov 16 01:33:53 2017
New Revision: 325883
URL: https://svnweb.freebsd.org/changeset/base/325883

Log:
  cxgbe(4): Sanitize t4_num_vis during MOD_LOAD like all other t4_*
  tunables.  Add num_vis to the intrs_and_queues structure as it affects
  the number of interrupts requested and queues created.  In future
  cfg_itype_and_nqueues might lower it incrementally instead of going
  straight to 1 when enough interrupts aren't available.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Nov 16 00:19:44 2017
(r325882)
+++ head/sys/dev/cxgbe/t4_main.cThu Nov 16 01:33:53 2017
(r325883)
@@ -466,6 +466,7 @@ static int vi_mac_funcs[] = {
 
 struct intrs_and_queues {
uint16_t intr_type; /* INTx, MSI, or MSI-X */
+   uint16_t num_vis;   /* number of VIs for each port */
uint16_t nirq;  /* Total # of vectors */
uint16_t intr_flags;/* Interrupt flags for each port */
uint16_t ntxq;  /* # of NIC txq's for each port */
@@ -505,8 +506,7 @@ static int fwmtype_to_hwmtype(int);
 static int validate_mt_off_len(struct adapter *, int, uint32_t, int,
 uint32_t *);
 static int fixup_devlog_params(struct adapter *);
-static int cfg_itype_and_nqueues(struct adapter *, int, int,
-struct intrs_and_queues *);
+static int cfg_itype_and_nqueues(struct adapter *, struct intrs_and_queues *);
 static int prep_firmware(struct adapter *);
 static int partition_resources(struct adapter *, const struct firmware *,
 const char *);
@@ -965,24 +965,6 @@ t4_attach(device_t dev)
goto done; /* error message displayed already */
 
/*
-* Number of VIs to create per-port.  The first VI is the "main" regular
-* VI for the port.  The rest are additional virtual interfaces on the
-* same physical port.  Note that the main VI does not have native
-* netmap support but the extra VIs do.
-*
-* Limit the number of VIs per port to the number of available
-* MAC addresses per port.
-*/
-   if (t4_num_vis >= 1)
-   num_vis = t4_num_vis;
-   else
-   num_vis = 1;
-   if (num_vis > nitems(vi_mac_funcs)) {
-   num_vis = nitems(vi_mac_funcs);
-   device_printf(dev, "Number of VIs limited to %d\n", num_vis);
-   }
-
-   /*
 * First pass over all the ports - allocate VIs and initialize some
 * basic parameters like mac address, port type, etc.
 */
@@ -999,7 +981,7 @@ t4_attach(device_t dev)
 * XXX: vi[0] is special so we can't delay this allocation until
 * pi->nvi's final value is known.
 */
-   pi->vi = malloc(sizeof(struct vi_info) * num_vis, M_CXGBE,
+   pi->vi = malloc(sizeof(struct vi_info) * t4_num_vis, M_CXGBE,
M_ZERO | M_WAITOK);
 
/*
@@ -1040,12 +1022,11 @@ t4_attach(device_t dev)
 * Interrupt type, # of interrupts, # of rx/tx queues, etc.
 */
nports = sc->params.nports;
-   rc = cfg_itype_and_nqueues(sc, nports, num_vis, &iaq);
+   rc = cfg_itype_and_nqueues(sc, &iaq);
if (rc != 0)
goto done; /* error message displayed already */
-   if (iaq.nrxq_vi + iaq.nofldrxq_vi + iaq.nnmrxq_vi == 0)
-   num_vis = 1;
 
+   num_vis = iaq.num_vis;
sc->intr_type = iaq.intr_type;
sc->intr_count = iaq.nirq;
 
@@ -2662,15 +2643,16 @@ fixup_devlog_params(struct adapter *sc)
 }
 
 static int
-cfg_itype_and_nqueues(struct adapter *sc, int nports, int num_vis,
-struct intrs_and_queues *iaq)
+cfg_itype_and_nqueues(struct adapter *sc, struct intrs_and_queues *iaq)
 {
-   int rc, itype, navail, nrxq, n;
+   int rc, itype, navail, nrxq, nports, n;
int nofldrxq = 0;
 
+   nports = sc->params.nports;
MPASS(nports > 0);
 
bzero(iaq, sizeof(*iaq));
+   iaq->num_vis = t4_num_vis;
iaq->ntxq = t4_ntxq;
iaq->ntxq_vi = t4_ntxq_vi;
iaq->nrxq = nrxq = t4_nrxq;
@@ -2716,9 +2698,9 @@ restart:
 */
iaq->nirq = T4_EXTRA_INTR;
iaq->nirq += nports * (nrxq + nofldrxq);
-   iaq->nirq += nports * (num_vis - 1) *
+   iaq->nirq += nports * (iaq->num_vis - 1) *
max(iaq->nrxq_vi, iaq->nnmrxq_vi);  /* See comment above. */
-   iaq->nirq += nports * (num_vis - 1) * iaq->nofldrxq_vi;
+   iaq->nirq += nports * (iaq->num_vis - 1) * iaq->nofldrxq_vi;
if (iaq->nirq <= navail &&
(itype != INTR_MSI || powerof2(iaq->nirq))) {
iaq->intr_flags = INTR_ALL;
@@ -2726,15 +2708,15 @@ restart:

Re: svn commit: r325860 - head/sbin/newfs

2017-11-15 Thread Ed Maste
On 15 November 2017 at 19:36, Warner Losh  wrote:
>
> On Wed, Nov 15, 2017 at 5:05 PM, Ed Maste  wrote:
>>
>> On 15 November 2017 at 13:47, Rodney W. Grimes
>>  wrote:
>> >> Author: emaste
>> >> Date: Wed Nov 15 18:40:40 2017
>> >> New Revision: 325860
>> >> URL: https://svnweb.freebsd.org/changeset/base/325860
>> >>
>> >> Log:
>> >>   newfs: warn if newer than kernel
>> >>
>> >>   Creating a UFS filesystem with a newfs newer than the running kernel,
>> >>   and then mounting that filesystem, can lead to interesting failures.
>> >>
>> >>   Add a safety belt to explicitly warn when newfs is newer than the
>> >>   running kernel.
>> >
>> > You should probably make the warning if (newer || older) as
>> > either is likely to have interesting side effects, as are
>> > mounting ufs file systems on different versions.
>>
>> Why would an older newfs cause trouble? Forward compatibility should be
>> fine
>
> The only scenario that 'old' would cause problems is that if you did a newfs
> with a new binary on a new kernel, mounted the file system, wrote files to
> it, then rebooted with an old kernel, mounted the filesystem there, writing
> new files to it, and then unmounting and running with a new kernel.

Right, but that's not older newfs. AFAICT there's no reason at all for
a (newer || older) warning.

> I'm not sure that the new safety belt is reasonable. Today it's fine, but
> over time it will start producing false-positive warnings since the real
> issue is just before/after the cg change, not old/new in general. I'd be
> tempted to make a check against newfs being >= 1200046 while the kernel is <
> 1200046. There wasn't a specific bump for this change to sys/param.h, but
> this version was bumped within a few hours of Kirk's change.

Well, we don't in general support using a userland newer than the
running kernel, other than on a best-effort basis to facilitate
upgrades and development. This one is only a warning so I don't see
much harm in leaving it in place, and it would catch any new cases of
a similar nature. If such a warning was already in place we might have
avoided the issue where our snapshots produced checksum mismatch
messages. But I don't have a strong objection to a hardcoded version
check.
___
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: r325884 - head/sys/dev/cxgbe

2017-11-15 Thread Navdeep Parhar
Author: np
Date: Thu Nov 16 02:42:37 2017
New Revision: 325884
URL: https://svnweb.freebsd.org/changeset/base/325884

Log:
  cxgbe(4): Remove rsrv_noflowq from intrs_and_queues structure as it does
  not influence or get affected by the number of interrupts or queues.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Nov 16 01:33:53 2017
(r325883)
+++ head/sys/dev/cxgbe/t4_main.cThu Nov 16 02:42:37 2017
(r325884)
@@ -471,7 +471,6 @@ struct intrs_and_queues {
uint16_t intr_flags;/* Interrupt flags for each port */
uint16_t ntxq;  /* # of NIC txq's for each port */
uint16_t nrxq;  /* # of NIC rxq's for each port */
-   uint16_t rsrv_noflowq;  /* Flag whether to reserve queue 0 */
uint16_t nofldtxq;  /* # of TOE txq's for each port */
uint16_t nofldrxq;  /* # of TOE rxq's for each port */
 
@@ -1124,7 +1123,7 @@ t4_attach(device_t dev)
tqidx += vi->ntxq;
 
if (j == 0 && vi->ntxq > 1)
-   vi->rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0;
+   vi->rsrv_noflowq = t4_rsrv_noflowq ? 1 : 0;
else
vi->rsrv_noflowq = 0;
 
@@ -2657,7 +2656,6 @@ cfg_itype_and_nqueues(struct adapter *sc, struct intrs
iaq->ntxq_vi = t4_ntxq_vi;
iaq->nrxq = nrxq = t4_nrxq;
iaq->nrxq_vi = t4_nrxq_vi;
-   iaq->rsrv_noflowq = t4_rsrv_noflowq;
 #ifdef TCP_OFFLOAD
if (is_offload(sc)) {
iaq->nofldtxq = t4_nofldtxq;
___
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: r316980 - head/contrib/zstd/programs

2017-11-15 Thread Conrad Meyer
Please revert this change.

First, it introduces the POLA-violating behavior that zstdcat deletes
its source files.  This is not how zcat/bzcat behaves.

Second, it introduces a needless behavioral difference between FreeBSD
zstd and the rest of the world's zstd.  The zstd documentation we ship
continues to claim that zstd preserves source files by default, yet
this change makes that documentation exactly backwards.  While we can
change FreeBSD's documentation to accommodate the change, we can't
change Google results.

Thanks,
Conrad

On Sat, Apr 15, 2017 at 1:15 PM, Baptiste Daroussin  wrote:
> Author: bapt
> Date: Sat Apr 15 20:15:44 2017
> New Revision: 316980
> URL: https://svnweb.freebsd.org/changeset/base/316980
>
> Log:
>   Change some default to make zstd a dropin replacement for gzip,bzip etc
>   in most cases
>
>   Changes ares:
>   - quiet by default
>   - remove the source files one compression completion by default
>
> Modified:
>   head/contrib/zstd/programs/fileio.c
>   head/contrib/zstd/programs/zstdcli.c
>
> Modified: head/contrib/zstd/programs/fileio.c
> ==
> --- head/contrib/zstd/programs/fileio.c Sat Apr 15 20:06:24 2017
> (r316979)
> +++ head/contrib/zstd/programs/fileio.c Sat Apr 15 20:15:44 2017
> (r316980)
> @@ -138,7 +138,7 @@ static U32 g_dictIDFlag = 1;
>  void FIO_setDictIDFlag(unsigned dictIDFlag) { g_dictIDFlag = dictIDFlag; }
>  static U32 g_checksumFlag = 1;
>  void FIO_setChecksumFlag(unsigned checksumFlag) { g_checksumFlag = 
> checksumFlag; }
> -static U32 g_removeSrcFile = 0;
> +static U32 g_removeSrcFile = 1;
>  void FIO_setRemoveSrcFile(unsigned flag) { g_removeSrcFile = (flag>0); }
>  static U32 g_memLimit = 0;
>  void FIO_setMemLimit(unsigned memLimit) { g_memLimit = memLimit; }
>
> Modified: head/contrib/zstd/programs/zstdcli.c
> ==
> --- head/contrib/zstd/programs/zstdcli.cSat Apr 15 20:06:24 2017  
>   (r316979)
> +++ head/contrib/zstd/programs/zstdcli.cSat Apr 15 20:15:44 2017  
>   (r316980)
> @@ -61,7 +61,7 @@
>  #define MB *(1 <<20)
>  #define GB *(1U<<30)
>
> -#define DEFAULT_DISPLAY_LEVEL 2
> +#define DEFAULT_DISPLAY_LEVEL 1
>
>  static const char*g_defaultDictName = "dictionary";
>  static const unsigned g_defaultMaxDictSize = 110 KB;
>
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread Warner Losh
On Wed, Nov 15, 2017 at 6:46 PM, Ed Maste  wrote:

> On 15 November 2017 at 19:36, Warner Losh  wrote:
> >
> > On Wed, Nov 15, 2017 at 5:05 PM, Ed Maste  wrote:
> >>
> >> On 15 November 2017 at 13:47, Rodney W. Grimes
> >>  wrote:
> >> >> Author: emaste
> >> >> Date: Wed Nov 15 18:40:40 2017
> >> >> New Revision: 325860
> >> >> URL: https://svnweb.freebsd.org/changeset/base/325860
> >> >>
> >> >> Log:
> >> >>   newfs: warn if newer than kernel
> >> >>
> >> >>   Creating a UFS filesystem with a newfs newer than the running
> kernel,
> >> >>   and then mounting that filesystem, can lead to interesting
> failures.
> >> >>
> >> >>   Add a safety belt to explicitly warn when newfs is newer than the
> >> >>   running kernel.
> >> >
> >> > You should probably make the warning if (newer || older) as
> >> > either is likely to have interesting side effects, as are
> >> > mounting ufs file systems on different versions.
> >>
> >> Why would an older newfs cause trouble? Forward compatibility should be
> >> fine
> >
> > The only scenario that 'old' would cause problems is that if you did a
> newfs
> > with a new binary on a new kernel, mounted the file system, wrote files
> to
> > it, then rebooted with an old kernel, mounted the filesystem there,
> writing
> > new files to it, and then unmounting and running with a new kernel.
>
> Right, but that's not older newfs. AFAICT there's no reason at all for
> a (newer || older) warning.


I concur.

> I'm not sure that the new safety belt is reasonable. Today it's fine, but
> > over time it will start producing false-positive warnings since the real
> > issue is just before/after the cg change, not old/new in general. I'd be
> > tempted to make a check against newfs being >= 1200046 while the kernel
> is <
> > 1200046. There wasn't a specific bump for this change to sys/param.h, but
> > this version was bumped within a few hours of Kirk's change.
>
> Well, we don't in general support using a userland newer than the
> running kernel, other than on a best-effort basis to facilitate
> upgrades and development. This one is only a warning so I don't see
> much harm in leaving it in place, and it would catch any new cases of
> a similar nature. If such a warning was already in place we might have
> avoided the issue where our snapshots produced checksum mismatch
> messages. But I don't have a strong objection to a hardcoded version
> check.
>

What would have fixed the snapshot isn't a warning that nobody will notice.
But rather something like the following:

diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 16c46bece00..06e1838a7f1 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -73,6 +73,7 @@ pass5(void)
newcg->cg_niblk = fs->fs_ipg;
if (preen == 0 && yflag == 0 && fs->fs_magic == FS_UFS2_MAGIC &&
fswritefd != -1 && (fs->fs_metackhash & CK_CYLGRP) == 0 &&
+   getosreldate() >= 1200046 &&
reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) {
fs->fs_metackhash |= CK_CYLGRP;
rewritecg = 1;
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index f68c42ec6b3..0e7ee539265 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -495,7 +495,7 @@ restart:
/*
 * Set flags for metadata that is being check-hashed.
 */
-   if (Oflag > 1)
+   if (Oflag > 1 && getosreldate() >= 1200046)
sblock.fs_metackhash = CK_CYLGRP;

/*

which would avoid setting the flag on a problematical kernel. Here forward
compat is easy, and the consequences are scary messages, so I think we
should do something more like the above. I don't think we need some kind of
"do it anyway" override flag. since that doesn't fit well with the rest of
UFS "works by default where we can figure it out" philosophy.

I'll cleanup the above with a #define for 1200046. I've cc'd Kirk to see
what he thinks of the idea. It generally fits with what we've done in the
past for forward compat that's easy but protects the user from harshness.

Warner
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread Warner Losh
On Wed, Nov 15, 2017 at 10:17 PM, Warner Losh  wrote:

>
>
> On Wed, Nov 15, 2017 at 6:46 PM, Ed Maste  wrote:
>
>> On 15 November 2017 at 19:36, Warner Losh  wrote:
>> >
>> > On Wed, Nov 15, 2017 at 5:05 PM, Ed Maste  wrote:
>> >>
>> >> On 15 November 2017 at 13:47, Rodney W. Grimes
>> >>  wrote:
>> >> >> Author: emaste
>> >> >> Date: Wed Nov 15 18:40:40 2017
>> >> >> New Revision: 325860
>> >> >> URL: https://svnweb.freebsd.org/changeset/base/325860
>> >> >>
>> >> >> Log:
>> >> >>   newfs: warn if newer than kernel
>> >> >>
>> >> >>   Creating a UFS filesystem with a newfs newer than the running
>> kernel,
>> >> >>   and then mounting that filesystem, can lead to interesting
>> failures.
>> >> >>
>> >> >>   Add a safety belt to explicitly warn when newfs is newer than the
>> >> >>   running kernel.
>> >> >
>> >> > You should probably make the warning if (newer || older) as
>> >> > either is likely to have interesting side effects, as are
>> >> > mounting ufs file systems on different versions.
>> >>
>> >> Why would an older newfs cause trouble? Forward compatibility should be
>> >> fine
>> >
>> > The only scenario that 'old' would cause problems is that if you did a
>> newfs
>> > with a new binary on a new kernel, mounted the file system, wrote files
>> to
>> > it, then rebooted with an old kernel, mounted the filesystem there,
>> writing
>> > new files to it, and then unmounting and running with a new kernel.
>>
>> Right, but that's not older newfs. AFAICT there's no reason at all for
>> a (newer || older) warning.
>
>
> I concur.
>
> > I'm not sure that the new safety belt is reasonable. Today it's fine, but
>> > over time it will start producing false-positive warnings since the real
>> > issue is just before/after the cg change, not old/new in general. I'd be
>> > tempted to make a check against newfs being >= 1200046 while the kernel
>> is <
>> > 1200046. There wasn't a specific bump for this change to sys/param.h,
>> but
>> > this version was bumped within a few hours of Kirk's change.
>>
>> Well, we don't in general support using a userland newer than the
>> running kernel, other than on a best-effort basis to facilitate
>> upgrades and development. This one is only a warning so I don't see
>> much harm in leaving it in place, and it would catch any new cases of
>> a similar nature. If such a warning was already in place we might have
>> avoided the issue where our snapshots produced checksum mismatch
>> messages. But I don't have a strong objection to a hardcoded version
>> check.
>>
>
> What would have fixed the snapshot isn't a warning that nobody will
> notice. But rather something like the following:
>
> diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
> index 16c46bece00..06e1838a7f1 100644
> --- a/sbin/fsck_ffs/pass5.c
> +++ b/sbin/fsck_ffs/pass5.c
> @@ -73,6 +73,7 @@ pass5(void)
> newcg->cg_niblk = fs->fs_ipg;
> if (preen == 0 && yflag == 0 && fs->fs_magic == FS_UFS2_MAGIC &&
> fswritefd != -1 && (fs->fs_metackhash & CK_CYLGRP) == 0 &&
> +   getosreldate() >= 1200046 &&
> reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) {
> fs->fs_metackhash |= CK_CYLGRP;
> rewritecg = 1;
> diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
> index f68c42ec6b3..0e7ee539265 100644
> --- a/sbin/newfs/mkfs.c
> +++ b/sbin/newfs/mkfs.c
> @@ -495,7 +495,7 @@ restart:
> /*
>  * Set flags for metadata that is being check-hashed.
>  */
> -   if (Oflag > 1)
> +   if (Oflag > 1 && getosreldate() >= 1200046)
> sblock.fs_metackhash = CK_CYLGRP;
>
> /*
>
> which would avoid setting the flag on a problematical kernel. Here forward
> compat is easy, and the consequences are scary messages, so I think we
> should do something more like the above. I don't think we need some kind of
> "do it anyway" override flag. since that doesn't fit well with the rest of
> UFS "works by default where we can figure it out" philosophy.
>
> I'll cleanup the above with a #define for 1200046. I've cc'd Kirk to see
> what he thinks of the idea. It generally fits with what we've done in the
> past for forward compat that's easy but protects the user from harshness.
>

I've gone ahead and tidied it up in https://reviews.freebsd.org/D13114 for
anybody that's interested.

Warner
___
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: r325860 - head/sbin/newfs

2017-11-15 Thread John Baldwin
On Wednesday, November 15, 2017 10:17:27 PM Warner Losh wrote:
> On Wed, Nov 15, 2017 at 6:46 PM, Ed Maste  wrote:
> 
> > On 15 November 2017 at 19:36, Warner Losh  wrote:
> > >
> > > On Wed, Nov 15, 2017 at 5:05 PM, Ed Maste  wrote:
> > >>
> > >> On 15 November 2017 at 13:47, Rodney W. Grimes
> > >>  wrote:
> > >> >> Author: emaste
> > >> >> Date: Wed Nov 15 18:40:40 2017
> > >> >> New Revision: 325860
> > >> >> URL: https://svnweb.freebsd.org/changeset/base/325860
> > >> >>
> > >> >> Log:
> > >> >>   newfs: warn if newer than kernel
> > >> >>
> > >> >>   Creating a UFS filesystem with a newfs newer than the running
> > kernel,
> > >> >>   and then mounting that filesystem, can lead to interesting
> > failures.
> > >> >>
> > >> >>   Add a safety belt to explicitly warn when newfs is newer than the
> > >> >>   running kernel.
> > >> >
> > >> > You should probably make the warning if (newer || older) as
> > >> > either is likely to have interesting side effects, as are
> > >> > mounting ufs file systems on different versions.
> > >>
> > >> Why would an older newfs cause trouble? Forward compatibility should be
> > >> fine
> > >
> > > The only scenario that 'old' would cause problems is that if you did a
> > newfs
> > > with a new binary on a new kernel, mounted the file system, wrote files
> > to
> > > it, then rebooted with an old kernel, mounted the filesystem there,
> > writing
> > > new files to it, and then unmounting and running with a new kernel.
> >
> > Right, but that's not older newfs. AFAICT there's no reason at all for
> > a (newer || older) warning.
> 
> 
> I concur.
> 
> > I'm not sure that the new safety belt is reasonable. Today it's fine, but
> > > over time it will start producing false-positive warnings since the real
> > > issue is just before/after the cg change, not old/new in general. I'd be
> > > tempted to make a check against newfs being >= 1200046 while the kernel
> > is <
> > > 1200046. There wasn't a specific bump for this change to sys/param.h, but
> > > this version was bumped within a few hours of Kirk's change.
> >
> > Well, we don't in general support using a userland newer than the
> > running kernel, other than on a best-effort basis to facilitate
> > upgrades and development. This one is only a warning so I don't see
> > much harm in leaving it in place, and it would catch any new cases of
> > a similar nature. If such a warning was already in place we might have
> > avoided the issue where our snapshots produced checksum mismatch
> > messages. But I don't have a strong objection to a hardcoded version
> > check.
> >
> 
> What would have fixed the snapshot isn't a warning that nobody will notice.
> But rather something like the following:

No, what would really fix the snapshot is using makefs or the host newfs
instead of the target newfs during the build.  That part of the release
process is still fundamentally broken and fixing that wouldn't require various
one-off fixes for future changes that happen to introduce compatability but
would fix the entire class of issues.

-- 
John Baldwin
___
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: r325885 - stable/11/tests/sys/kern

2017-11-15 Thread John Baldwin
Author: jhb
Date: Thu Nov 16 06:55:57 2017
New Revision: 325885
URL: https://svnweb.freebsd.org/changeset/base/325885

Log:
  MFC 324993:
  Add a test for sending a signal while stepping a thread via PT_STEP.

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

Modified: stable/11/tests/sys/kern/ptrace_test.c
==
--- stable/11/tests/sys/kern/ptrace_test.c  Thu Nov 16 02:42:37 2017
(r325884)
+++ stable/11/tests/sys/kern/ptrace_test.c  Thu Nov 16 06:55:57 2017
(r325885)
@@ -3377,6 +3377,92 @@ ATF_TC_BODY(ptrace__PT_ATTACH_with_SBDRY_thread, tc)
ATF_REQUIRE(close(fd) == 0);
 }
 
+static void
+sigusr1_step_handler(int sig)
+{
+
+   CHILD_REQUIRE(sig == SIGUSR1);
+   raise(SIGABRT);
+}
+
+/*
+ * Verify that PT_STEP with a signal invokes the signal before
+ * stepping the next instruction (and that the next instruction is
+ * stepped correctly).
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__PT_STEP_with_signal);
+ATF_TC_BODY(ptrace__PT_STEP_with_signal, tc)
+{
+   struct ptrace_lwpinfo pl;
+   pid_t fpid, wpid;
+   int status;
+
+   ATF_REQUIRE((fpid = fork()) != -1);
+   if (fpid == 0) {
+   trace_me();
+   signal(SIGUSR1, sigusr1_step_handler);
+   raise(SIGABRT);
+   exit(1);
+   }
+
+   /* The first wait() should report the stop from SIGSTOP. */
+   wpid = waitpid(fpid, &status, 0);
+   ATF_REQUIRE(wpid == fpid);
+   ATF_REQUIRE(WIFSTOPPED(status));
+   ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+   ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+
+   /* The next stop should report the SIGABRT in the child body. */
+   wpid = waitpid(fpid, &status, 0);
+   ATF_REQUIRE(wpid == fpid);
+   ATF_REQUIRE(WIFSTOPPED(status));
+   ATF_REQUIRE(WSTOPSIG(status) == SIGABRT);
+
+   ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1);
+   ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI);
+   ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGABRT);
+
+   /* Step the child process inserting SIGUSR1. */
+   ATF_REQUIRE(ptrace(PT_STEP, fpid, (caddr_t)1, SIGUSR1) == 0);
+
+   /* The next stop should report the SIGABRT in the signal handler. */
+   wpid = waitpid(fpid, &status, 0);
+   ATF_REQUIRE(wpid == fpid);
+   ATF_REQUIRE(WIFSTOPPED(status));
+   ATF_REQUIRE(WSTOPSIG(status) == SIGABRT);
+
+   ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1);
+   ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI);
+   ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGABRT);
+
+   /* Continue the child process discarding the signal. */
+   ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+
+   /* The next stop should report a trace trap from PT_STEP. */
+   wpid = waitpid(fpid, &status, 0);
+   ATF_REQUIRE(wpid == fpid);
+   ATF_REQUIRE(WIFSTOPPED(status));
+   ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP);
+
+   ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1);
+   ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI);
+   ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGTRAP);
+   ATF_REQUIRE(pl.pl_siginfo.si_code == TRAP_TRACE);
+
+   /* Continue the child to let it exit. */
+   ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+
+   /* The last event should be for the child process's exit. */
+   wpid = waitpid(fpid, &status, 0);
+   ATF_REQUIRE(WIFEXITED(status));
+   ATF_REQUIRE(WEXITSTATUS(status) == 1);
+
+   wpid = wait(&status);
+   ATF_REQUIRE(wpid == -1);
+   ATF_REQUIRE(errno == ECHILD);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
@@ -3428,6 +3514,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, ptrace__parent_terminate_with_pending_sigstop2);
ATF_TP_ADD_TC(tp, ptrace__event_mask_sigkill_discard);
ATF_TP_ADD_TC(tp, ptrace__PT_ATTACH_with_SBDRY_thread);
+   ATF_TP_ADD_TC(tp, ptrace__PT_STEP_with_signal);
 
return (atf_no_error());
 }
___
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: r325886 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2017-11-15 Thread Mark Johnston
Author: markj
Date: Thu Nov 16 07:14:29 2017
New Revision: 325886
URL: https://svnweb.freebsd.org/changeset/base/325886

Log:
  Take r313504 into account when recomputing the string table length.
  
  When we encounter a USDT probe in a weak symbol, we emit an alias for
  the probe function symbol. Such aliases are named differently from the
  aliases we emit for probes in local functions, so make sure to take that
  difference into account when resizing the output object file's string
  table. Otherwise, we underrun the string table buffer.
  
  PR:   223680

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Nov 
16 06:55:57 2017(r325885)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Nov 
16 07:14:29 2017(r325886)
@@ -1416,8 +1416,15 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e
"expected %s to be of type function", s));
}
 
-   len = snprintf(NULL, 0, dt_symfmt, dt_symprefix,
-   objkey, s) + 1;
+   /*
+* Aliases of weak symbols don't get a uniquifier.
+*/
+   if (GELF_ST_BIND(fsym.st_info) == STB_WEAK)
+   len = snprintf(NULL, 0, dt_weaksymfmt,
+   dt_symprefix, s) + 1;
+   else
+   len = snprintf(NULL, 0, dt_symfmt, dt_symprefix,
+   objkey, s) + 1;
if ((p = dt_alloc(dtp, len)) == NULL) {
dt_strtab_destroy(strtab);
goto err;
___
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: r325887 - in head/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/intel/dtrace

2017-11-15 Thread Mark Johnston
Author: markj
Date: Thu Nov 16 07:25:12 2017
New Revision: 325887
URL: https://svnweb.freebsd.org/changeset/base/325887

Log:
  Avoid holding the process in uread() and uwrite().
  
  In general, higher-level code will atomically verify that the process
  is not exiting and hold the process. In one case, we were using uwrite()
  to copy a probed instruction to a per-thread scratch space block, but
  copyout() can be used for this purpose instead; this change effectively
  reverts r227291.
  
  MFC after:1 week

Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.cThu Nov 16 
07:14:29 2017(r325886)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.cThu Nov 16 
07:25:12 2017(r325887)
@@ -35,9 +35,7 @@ uread(proc_t *p, void *kaddr, size_t len, uintptr_t ua
 {
ssize_t n;
 
-   PHOLD(p);
n = proc_readmem(curthread, p, uaddr, kaddr, len);
-   PRELE(p);
if (n != len)
return (ENOMEM);
return (0);
@@ -48,9 +46,7 @@ uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t u
 {
ssize_t n;
 
-   PHOLD(p);
n = proc_writemem(curthread, p, uaddr, kaddr, len);
-   PRELE(p);
if (n != len)
return (ENOMEM);
return (0);

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Thu Nov 
16 07:14:29 2017(r325886)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Thu Nov 
16 07:25:12 2017(r325887)
@@ -1715,11 +1715,7 @@ fasttrap_pid_probe(struct reg *rp)
 
ASSERT(i <= sizeof (scratch));
 
-#ifdef illumos
if (fasttrap_copyout(scratch, (char *)addr, i)) {
-#else
-   if (uwrite(p, scratch, i, addr)) {
-#endif
fasttrap_sigtrap(p, curthread, pc);
new_pc = pc;
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"