Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-14 Thread Dmitry Chagin
вт, 14 мая 2019 г. в 20:02, Konstantin Belousov :

> Author: kib
> Date: Tue May 14 17:02:20 2019
> New Revision: 347566
> URL: https://svnweb.freebsd.org/changeset/base/347566
>
> Log:
>   Mitigations for Microarchitectural Data Sampling.
>
>   Microarchitectural buffers on some Intel processors utilizing
>   speculative execution may allow a local process to obtain a memory
>   disclosure.  An attacker may be able to read secret data from the
>   kernel or from a process when executing untrusted code (for example,
>   in a web browser).
>
>   Reference:
> https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
>   Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
> CVE-2019-11091
>   Security: FreeBSD-SA-19:07.mds
>   Reviewed by:  jhb
>   Tested by:emaste, lwhsu
>   Approved by:  so (gtetlow)
>
> Modified:
>   head/sys/amd64/amd64/exception.S
>   head/sys/amd64/amd64/genassym.c
>   head/sys/amd64/amd64/initcpu.c
>   head/sys/amd64/amd64/machdep.c
>   head/sys/amd64/amd64/support.S
>



Hi, Kostik!

cc -target x86_64-unknown-freebsd13.0
--sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp
-B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x
assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc
-I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include
-I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL
-DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
-MF.depend.support.o -MTsupport.o
-fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include
-fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include -mcmodel=kernel
-mno-red-zone -mno-mmx -mno-sse -msoft-float
-fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
-gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign
-D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
-fdiagnostics-show-option -Wno-unknown-pragmas
-Wno-error-tautological-compare -Wno-error-empty-body
-Wno-error-parentheses-equality -Wno-error-unused-function
-Wno-error-pointer-sign -Wno-error-shift-negative-value
-Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999
-Werror /home/dchagin/head/sys/amd64/amd64/support.S
/home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction
requires: AVX-512 ISA
 vmovdqa64 %zmm0, %gs:0x340
 ^
/home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction
requires: AVX-512 ISA
 vpxor %zmm0, %zmm0, %zmm0
 ^
/home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction
requires: AVX-512 DQ ISA
 vorpd (%rdx), %zmm0, %zmm0
 ^
/home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction
requires: AVX-512 DQ ISA
 vorpd (%rdx), %zmm0, %zmm0
 ^
/home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction
requires: AVX-512 ISA
 vmovdqa64 %gs:0x340, %zmm0
 ^
*** Error code 1


I/m missied something?
___
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: r347606 - head/usr.sbin/ntp/ntpd

2019-05-14 Thread Xin LI
Author: delphij
Date: Wed May 15 03:39:27 2019
New Revision: 347606
URL: https://svnweb.freebsd.org/changeset/base/347606

Log:
  Replace the leap-seconds file in r347488 from USNO with a
  leap-seconds file from NIST at ftp://ftp.nist.gov/pub/time.
  
  Future updates should use the NIST version of file, available
  at ftp://ftp.nist.gov/pub/time/leap-seconds.list .
  
  Requested by:   ian@
  Obtained from:  ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800
  MFC after:  3 days

Modified:
  head/usr.sbin/ntp/ntpd/leap-seconds

Modified: head/usr.sbin/ntp/ntpd/leap-seconds
==
--- head/usr.sbin/ntp/ntpd/leap-seconds Wed May 15 01:40:40 2019
(r347605)
+++ head/usr.sbin/ntp/ntpd/leap-seconds Wed May 15 03:39:27 2019
(r347606)
@@ -1,10 +1,10 @@
 #
 #  In the following text, the symbol '#' introduces
-#  a comment, which continues from that symbol until 
+#  a comment, which continues from that symbol until
 #  the end of the line. A plain comment line has a
 #  whitespace character following the comment indicator.
-#  There are also special comment lines defined below. 
-#  A special comment will always have a non-whitespace 
+#  There are also special comment lines defined below.
+#  A special comment will always have a non-whitespace
 #  character in column 2.
 #
 #  A blank line should be ignored.
@@ -15,17 +15,22 @@
 #  are transmitted by almost all time services.
 #
 #  The first column shows an epoch as a number of seconds
-#  since 1900.0 and the second column shows the number of
-#  seconds that must be added to UTC to compute TAI for
-#  any timestamp at or after that epoch. The value on 
-#  each line is valid from the indicated initial instant
-#  until the epoch given on the next one or indefinitely 
-#  into the future if there is no next line.
+#  since 1 January 1900, 00:00:00 (1900.0 is also used to
+#  indicate the same epoch.) Both of these time stamp formats
+#  ignore the complexities of the time scales that were
+#  used before the current definition of UTC at the start
+#  of 1972. (See note 3 below.)
+#  The second column shows the number of seconds that
+#  must be added to UTC to compute TAI for any timestamp
+#  at or after that epoch. The value on each line is
+#  valid from the indicated initial instant until the
+#  epoch given on the next one or indefinitely into the
+#  future if there is no next line.
 #  (The comment on each line shows the representation of
-#  the corresponding initial epoch in the usual 
+#  the corresponding initial epoch in the usual
 #  day-month-year format. The epoch always begins at
 #  00:00:00 UTC on the indicated day. See Note 5 below.)
-#  
+#
 #  Important notes:
 #
 #  1. Coordinated Universal Time (UTC) is often referred to
@@ -33,7 +38,7 @@
 #  longer used, and the use of GMT to designate UTC is
 #  discouraged.
 #
-#  2. The UTC time scale is realized by many national 
+#  2. The UTC time scale is realized by many national
 #  laboratories and timing centers. Each laboratory
 #  identifies its realization with its name: Thus
 #  UTC(NIST), UTC(USNO), etc. The differences among
@@ -42,12 +47,12 @@
 #  and can be ignored for many purposes. These differences
 #  are tabulated in Circular T, which is published monthly
 #  by the International Bureau of Weights and Measures
-#  (BIPM). See www.bipm.fr for more information.
+#  (BIPM). See www.bipm.org for more information.
 #
-#  3. The current defintion of the relationship between UTC 
-#  and TAI dates from 1 January 1972. A number of different 
-#  time scales were in use before than epoch, and it can be 
-#  quite difficult to compute precise timestamps and time 
+#  3. The current definition of the relationship between UTC
+#  and TAI dates from 1 January 1972. A number of different
+#  time scales were in use before that epoch, and it can be
+#  quite difficult to compute precise timestamps and time
 #  intervals in those "prehistoric" days. For more information,
 #  consult:
 #
@@ -56,38 +61,41 @@
 #  or
 #  Terry Quinn, "The BIPM and the Accurate Measurement
 #  of Time," Proc. of the IEEE, Vol. 79, pp. 894-905,
-#  July, 1991.
+#  July, 1991. 
+#  reprinted in: 
+# Christine Hackman and Donald B Sullivan (eds.)
+# Time and Frequency Measurement
+# American Association of Physics Teachers (1996)
+# , pp. 75-86
 #
-#  4.  The insertion of leap seconds into UTC is currently the
-#  responsibility of the International Earth Rotation Service,
-#  whic

svn commit: r347605 - stable/11/cddl/contrib/opensolaris/cmd/zfs

2019-05-14 Thread Alexander Motin
Author: mav
Date: Wed May 15 01:40:40 2019
New Revision: 347605
URL: https://svnweb.freebsd.org/changeset/base/347605

Log:
  MFC r347240: Fix dataset name comparison in zfs_compare().
  
  The code never returned match comparing two datasets (not snapshots).
  As result, uu_avl_find(), called from zfs_callback(), never succeeded,
  allowing to add same dataset into the list multiple times, for example:
  
  # zfs get name pers pers pers@z pers@z
  NAMEPROPERTY  VALUE   SOURCE
  persname  pers-
  persname  pers-
  pers@z  name  pers@z  -
  
  With the patch:
  
  # zfs get name pers pers pers@z pers@z
  NAMEPROPERTY  VALUE   SOURCE
  persname  pers-
  pers@z  name  pers@z  -

Modified:
  stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
==
--- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c   Wed May 15 
01:38:34 2019(r347604)
+++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c   Wed May 15 
01:40:40 2019(r347605)
@@ -225,7 +225,7 @@ zfs_compare(const void *larg, const void *rarg, void *
*rat = '\0';
 
ret = strcmp(lname, rname);
-   if (ret == 0) {
+   if (ret == 0 && (lat != NULL || rat != NULL)) {
/*
 * If we're comparing a dataset to one of its snapshots, we
 * always make the full dataset first.
___
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: r347604 - stable/12/cddl/contrib/opensolaris/cmd/zfs

2019-05-14 Thread Alexander Motin
Author: mav
Date: Wed May 15 01:38:34 2019
New Revision: 347604
URL: https://svnweb.freebsd.org/changeset/base/347604

Log:
  MFC r347240: Fix dataset name comparison in zfs_compare().
  
  The code never returned match comparing two datasets (not snapshots).
  As result, uu_avl_find(), called from zfs_callback(), never succeeded,
  allowing to add same dataset into the list multiple times, for example:
  
  # zfs get name pers pers pers@z pers@z
  NAMEPROPERTY  VALUE   SOURCE
  persname  pers-
  persname  pers-
  pers@z  name  pers@z  -
  
  With the patch:
  
  # zfs get name pers pers pers@z pers@z
  NAMEPROPERTY  VALUE   SOURCE
  persname  pers-
  pers@z  name  pers@z  -

Modified:
  stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
==
--- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c   Wed May 15 
00:38:52 2019(r347603)
+++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c   Wed May 15 
01:38:34 2019(r347604)
@@ -225,7 +225,7 @@ zfs_compare(const void *larg, const void *rarg, void *
*rat = '\0';
 
ret = strcmp(lname, rname);
-   if (ret == 0) {
+   if (ret == 0 && (lat != NULL || rat != NULL)) {
/*
 * If we're comparing a dataset to one of its snapshots, we
 * always make the full dataset first.
___
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: r347601 - in head/sys: compat/linuxkpi/common/include/linux sys

2019-05-14 Thread Johannes Lundberg
Author: johalun
Date: Tue May 14 23:50:46 2019
New Revision: 347601
URL: https://svnweb.freebsd.org/changeset/base/347601

Log:
  LinuxKPI: Add prepare to pm_ops and bump FreeBSD version.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

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

Modified: head/sys/compat/linuxkpi/common/include/linux/device.h
==
--- head/sys/compat/linuxkpi/common/include/linux/device.h  Tue May 14 
23:32:02 2019(r347600)
+++ head/sys/compat/linuxkpi/common/include/linux/device.h  Tue May 14 
23:50:46 2019(r347601)
@@ -61,6 +61,7 @@ struct class {
 };
 
 struct dev_pm_ops {
+   int (*prepare)(struct device *dev);
int (*suspend)(struct device *dev);
int (*suspend_late)(struct device *dev);
int (*resume)(struct device *dev);

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue May 14 23:32:02 2019(r347600)
+++ head/sys/sys/param.hTue May 14 23:50:46 2019(r347601)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300026  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300027  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r347600 - head/sys/compat/linuxkpi/common/include/linux

2019-05-14 Thread Johannes Lundberg
Author: johalun
Date: Tue May 14 23:32:02 2019
New Revision: 347600
URL: https://svnweb.freebsd.org/changeset/base/347600

Log:
  LinuxKPI: Add vm_fault_t type.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

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

Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h
==
--- head/sys/compat/linuxkpi/common/include/linux/mm_types.hTue May 14 
23:28:45 2019(r347599)
+++ head/sys/compat/linuxkpi/common/include/linux/mm_types.hTue May 14 
23:32:02 2019(r347600)
@@ -35,6 +35,8 @@
 
 #include 
 
+typedef int vm_fault_t;
+
 struct vm_area_struct;
 struct task_struct;
 
___
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: r347597 - in releng: 11.2 11.2/sys/conf 12.0 12.0/sys/conf

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 23:22:30 2019
New Revision: 347597
URL: https://svnweb.freebsd.org/changeset/base/347597

Log:
  Bump newvers.sh and add UPDATING block.
  
  Approved by:  so

Modified:
  releng/11.2/UPDATING
  releng/11.2/sys/conf/newvers.sh
  releng/12.0/UPDATING
  releng/12.0/sys/conf/newvers.sh

Modified: releng/11.2/UPDATING
==
--- releng/11.2/UPDATINGTue May 14 23:21:20 2019(r347596)
+++ releng/11.2/UPDATINGTue May 14 23:22:30 2019(r347597)
@@ -16,6 +16,29 @@ 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.
 
+20190514   p10 FreeBSD-EN-19:08.tzdata
+   FreeBSD-EN-19:09.xinstall
+   FreeBSD-SA-19:03.wpa
+   FreeBSD-SA-19:04.ntp
+   FreeBSD-SA-19:05.pf
+   FreeBSD-SA-19:06.pf
+   FreeBSD-SA-19:07.mds
+
+   Import tzdata 2019a. [EN-19:08.tzdata]
+
+   Fix install with partially matching relative paths. [EN-19:09.xinstall]
+
+   Fix multiple vulnerabilities in hostapd/wpa_supplicant. [SA-19:03.wpa]
+
+   Fix authenticated denial of service in ntpd. [SA-19:04.ntp]
+
+   Fix IPv6 fragment reassembly in pf. [SA-19:05.pf]
+
+   Fix ICMP/ICMP6 packet filter bypass in pf. [SA-19:06.pf]
+
+   Add mitigations for Microarchitectural Data Sampling. [SA-19:07.mds]
+
+
 20190205   p9  FreeBSD-SA-19:01.syscall
 
amd64: clear callee-preserved registers on syscall exit

Modified: releng/11.2/sys/conf/newvers.sh
==
--- releng/11.2/sys/conf/newvers.sh Tue May 14 23:21:20 2019
(r347596)
+++ releng/11.2/sys/conf/newvers.sh Tue May 14 23:22:30 2019
(r347597)
@@ -44,7 +44,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.2"
-BRANCH="RELEASE-p9"
+BRANCH="RELEASE-p10"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/12.0/UPDATING
==
--- releng/12.0/UPDATINGTue May 14 23:21:20 2019(r347596)
+++ releng/12.0/UPDATINGTue May 14 23:22:30 2019(r347597)
@@ -16,6 +16,32 @@ 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.
 
+20190514   p4  FreeBSD-EN-19:08.tzdata
+   FreeBSD-EN-19:09.xinstall
+   FreeBSD-EN-19:10.scp
+   FreeBSD-SA-19:03.wpa
+   FreeBSD-SA-19:04.ntp
+   FreeBSD-SA-19:05.pf
+   FreeBSD-SA-19:06.pf
+   FreeBSD-SA-19:07.mds
+
+   Import tzdata 2019a. [EN-19:08.tzdata]
+
+   Fix install with partially matching relative paths. [EN-19:09.xinstall]
+
+   Fix filename validation in scp. [EN-19:10.scp]
+
+   Fix multiple vulnerabilities in hostapd/wpa_supplicant. [SA-19:03.wpa]
+
+   Fix authenticated denial of service in ntpd. [SA-19:04.ntp]
+
+   Fix IPv6 fragment reassembly in pf. [SA-19:05.pf]
+
+   Fix ICMP/ICMP6 packet filter bypass in pf. [SA-19:06.pf]
+
+   Add mitigations for Microarchitectural Data Sampling. [SA-19:07.mds]
+
+
 20190205:  p3  FreeBSD-SA-19:01.syscall
FreeBSD-SA-19:02.fd
FreeBSD-EN-19:06.dtrace

Modified: releng/12.0/sys/conf/newvers.sh
==
--- releng/12.0/sys/conf/newvers.sh Tue May 14 23:21:20 2019
(r347596)
+++ releng/12.0/sys/conf/newvers.sh Tue May 14 23:22:30 2019
(r347597)
@@ -46,7 +46,7 @@
 
 TYPE="FreeBSD"
 REVISION="12.0"
-BRANCH="RELEASE-p3"
+BRANCH="RELEASE-p4"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2019-05-14 Thread Johannes Lundberg
Author: johalun
Date: Tue May 14 23:21:20 2019
New Revision: 347596
URL: https://svnweb.freebsd.org/changeset/base/347596

Log:
  LinuxKPI: Add context member to ww_mutex and bump FreeBSD version.
  
  This patch is part of https://reviews.freebsd.org/D19565.
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps

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

Modified: head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h
==
--- head/sys/compat/linuxkpi/common/include/linux/ww_mutex.hTue May 14 
23:20:16 2019(r347595)
+++ head/sys/compat/linuxkpi/common/include/linux/ww_mutex.hTue May 14 
23:21:20 2019(r347596)
@@ -45,6 +45,7 @@ struct ww_acquire_ctx {
 struct ww_mutex {
struct mutex base;
struct cv condvar;
+   struct ww_acquire_ctx *ctx;
 };
 
 #defineDEFINE_WW_CLASS(name)   \

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue May 14 23:20:16 2019(r347595)
+++ head/sys/sys/param.hTue May 14 23:21:20 2019(r347596)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300025  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300026  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r347595 - in releng/11.2/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 23:20:16 2019
New Revision: 347595
URL: https://svnweb.freebsd.org/changeset/base/347595

Log:
  Mitigations for Microarchitectural Data Sampling.
  
  Approved by:  so
  Security: FreeBSD-SA-19:07.mds
  Security: CVE-2018-12126
  Security: CVE-2018-12127
  Security: CVE-2018-12130
  Security: CVE-2019-11091

Modified:
  releng/11.2/sys/amd64/amd64/exception.S
  releng/11.2/sys/amd64/amd64/genassym.c
  releng/11.2/sys/amd64/amd64/initcpu.c
  releng/11.2/sys/amd64/amd64/machdep.c
  releng/11.2/sys/amd64/amd64/support.S
  releng/11.2/sys/amd64/include/pcpu.h
  releng/11.2/sys/dev/cpuctl/cpuctl.c
  releng/11.2/sys/i386/i386/exception.s
  releng/11.2/sys/i386/i386/genassym.c
  releng/11.2/sys/i386/i386/initcpu.c
  releng/11.2/sys/i386/i386/support.s
  releng/11.2/sys/i386/include/pcpu.h
  releng/11.2/sys/x86/include/specialreg.h
  releng/11.2/sys/x86/include/x86_var.h
  releng/11.2/sys/x86/x86/cpu_machdep.c

Modified: releng/11.2/sys/amd64/amd64/exception.S
==
--- releng/11.2/sys/amd64/amd64/exception.S Tue May 14 23:19:08 2019
(r347594)
+++ releng/11.2/sys/amd64/amd64/exception.S Tue May 14 23:20:16 2019
(r347595)
@@ -487,6 +487,7 @@ fast_syscall_common:
testl   $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax)
jne 3f
callhandle_ibrs_exit
+   callq   *mds_handler
/* Restore preserved registers. */
MEXITCOUNT
movqTF_RDI(%rsp),%rdi   /* bonus; preserve arg 1 */
@@ -1121,6 +1122,7 @@ ld_regs:
jz  2f  /* keep running with kernel GS.base */
cli
callhandle_ibrs_exit_rs
+   callq   *mds_handler
cmpb$0,pti
je  1f
pushq   %rdx

Modified: releng/11.2/sys/amd64/amd64/genassym.c
==
--- releng/11.2/sys/amd64/amd64/genassym.c  Tue May 14 23:19:08 2019
(r347594)
+++ releng/11.2/sys/amd64/amd64/genassym.c  Tue May 14 23:20:16 2019
(r347595)
@@ -230,6 +230,9 @@ ASSYM(PC_SAVED_UCR3, offsetof(struct pcpu, pc_saved_uc
 ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack));
 ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ);
 ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set));
+ASSYM(PC_MDS_TMP, offsetof(struct pcpu, pc_mds_tmp));
+ASSYM(PC_MDS_BUF, offsetof(struct pcpu, pc_mds_buf));
+ASSYM(PC_MDS_BUF64, offsetof(struct pcpu, pc_mds_buf64));
  
 ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL);
 ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL);

Modified: releng/11.2/sys/amd64/amd64/initcpu.c
==
--- releng/11.2/sys/amd64/amd64/initcpu.c   Tue May 14 23:19:08 2019
(r347594)
+++ releng/11.2/sys/amd64/amd64/initcpu.c   Tue May 14 23:20:16 2019
(r347595)
@@ -223,6 +223,7 @@ initializecpu(void)
}
hw_ibrs_recalculate();
hw_ssb_recalculate(false);
+   hw_mds_recalculate();
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
init_amd();

Modified: releng/11.2/sys/amd64/amd64/machdep.c
==
--- releng/11.2/sys/amd64/amd64/machdep.c   Tue May 14 23:19:08 2019
(r347594)
+++ releng/11.2/sys/amd64/amd64/machdep.c   Tue May 14 23:20:16 2019
(r347595)
@@ -1851,6 +1851,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable);
TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable);
+   TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable);
 
/* Location of kernel stack for locore */
return ((u_int64_t)thread0.td_pcb);

Modified: releng/11.2/sys/amd64/amd64/support.S
==
--- releng/11.2/sys/amd64/amd64/support.S   Tue May 14 23:19:08 2019
(r347594)
+++ releng/11.2/sys/amd64/amd64/support.S   Tue May 14 23:20:16 2019
(r347595)
@@ -1,8 +1,13 @@
 /*-
+ * Copyright (c) 2018-2019 The FreeBSD Foundation
  * Copyright (c) 2003 Peter Wemm.
  * Copyright (c) 1993 The Regents of the University of California.
  * All rights reserved.
  *
+ * Portions of this software were developed by
+ * Konstantin Belousov  under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -892,3 +897,246 @@ ENTRY(handle_ibrs_exit_rs)
 END(handle_ibrs_exit_rs)
 
.noaltmacro
+
+ENTRY(mds_handler_void)
+   retq
+END(mds_handler_void)
+
+ENTRY(mds_handler_verw)
+   subq$8, %rsp
+   movw%ds, (%rsp)
+   verw(%rsp)
+   addq$8, %rsp
+   retq
+END(mds_handler_ver

svn commit: r347594 - in releng/12.0/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 23:19:08 2019
New Revision: 347594
URL: https://svnweb.freebsd.org/changeset/base/347594

Log:
  Mitigations for Microarchitectural Data Sampling.
  
  Approved by:  so
  Security: FreeBSD-SA-19:07.mds
  Security: CVE-2018-12126
  Security: CVE-2018-12127
  Security: CVE-2018-12130
  Security: CVE-2019-11091

Modified:
  releng/12.0/sys/amd64/amd64/exception.S
  releng/12.0/sys/amd64/amd64/genassym.c
  releng/12.0/sys/amd64/amd64/initcpu.c
  releng/12.0/sys/amd64/amd64/machdep.c
  releng/12.0/sys/amd64/amd64/support.S
  releng/12.0/sys/amd64/include/pcpu.h
  releng/12.0/sys/dev/cpuctl/cpuctl.c
  releng/12.0/sys/i386/i386/exception.s
  releng/12.0/sys/i386/i386/genassym.c
  releng/12.0/sys/i386/i386/initcpu.c
  releng/12.0/sys/i386/i386/support.s
  releng/12.0/sys/i386/include/pcpu.h
  releng/12.0/sys/x86/include/specialreg.h
  releng/12.0/sys/x86/include/x86_var.h
  releng/12.0/sys/x86/x86/cpu_machdep.c

Modified: releng/12.0/sys/amd64/amd64/exception.S
==
--- releng/12.0/sys/amd64/amd64/exception.S Tue May 14 23:12:22 2019
(r347593)
+++ releng/12.0/sys/amd64/amd64/exception.S Tue May 14 23:19:08 2019
(r347594)
@@ -512,6 +512,7 @@ fast_syscall_common:
testl   $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax)
jne 3f
callhandle_ibrs_exit
+   callq   *mds_handler
/* Restore preserved registers. */
MEXITCOUNT
movqTF_RDI(%rsp),%rdi   /* bonus; preserve arg 1 */
@@ -1157,6 +1158,7 @@ ld_regs:
jz  2f  /* keep running with kernel GS.base */
cli
callhandle_ibrs_exit_rs
+   callq   *mds_handler
cmpq$~0,PCPU(UCR3)
je  1f
pushq   %rdx

Modified: releng/12.0/sys/amd64/amd64/genassym.c
==
--- releng/12.0/sys/amd64/amd64/genassym.c  Tue May 14 23:12:22 2019
(r347593)
+++ releng/12.0/sys/amd64/amd64/genassym.c  Tue May 14 23:19:08 2019
(r347594)
@@ -233,6 +233,9 @@ ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack
 ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ);
 ASSYM(PC_PTI_RSP0, offsetof(struct pcpu, pc_pti_rsp0));
 ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set));
+ASSYM(PC_MDS_TMP, offsetof(struct pcpu, pc_mds_tmp));
+ASSYM(PC_MDS_BUF, offsetof(struct pcpu, pc_mds_buf));
+ASSYM(PC_MDS_BUF64, offsetof(struct pcpu, pc_mds_buf64));
  
 ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL);
 ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL);

Modified: releng/12.0/sys/amd64/amd64/initcpu.c
==
--- releng/12.0/sys/amd64/amd64/initcpu.c   Tue May 14 23:12:22 2019
(r347593)
+++ releng/12.0/sys/amd64/amd64/initcpu.c   Tue May 14 23:19:08 2019
(r347594)
@@ -253,6 +253,7 @@ initializecpu(void)
}
hw_ibrs_recalculate();
hw_ssb_recalculate(false);
+   hw_mds_recalculate();
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
init_amd();

Modified: releng/12.0/sys/amd64/amd64/machdep.c
==
--- releng/12.0/sys/amd64/amd64/machdep.c   Tue May 14 23:12:22 2019
(r347593)
+++ releng/12.0/sys/amd64/amd64/machdep.c   Tue May 14 23:19:08 2019
(r347594)
@@ -1878,6 +1878,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable);
TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable);
+   TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable);
 
TSEXIT();
 

Modified: releng/12.0/sys/amd64/amd64/support.S
==
--- releng/12.0/sys/amd64/amd64/support.S   Tue May 14 23:12:22 2019
(r347593)
+++ releng/12.0/sys/amd64/amd64/support.S   Tue May 14 23:19:08 2019
(r347594)
@@ -1,8 +1,13 @@
 /*-
+ * Copyright (c) 2018-2019 The FreeBSD Foundation
  * Copyright (c) 2003 Peter Wemm.
  * Copyright (c) 1993 The Regents of the University of California.
  * All rights reserved.
  *
+ * Portions of this software were developed by
+ * Konstantin Belousov  under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -1586,3 +1591,246 @@ ENTRY(flush_l1d_sw)
ret
 #undef L1D_FLUSH_SIZE
 END(flush_l1d_sw)
+
+ENTRY(mds_handler_void)
+   retq
+END(mds_handler_void)
+
+ENTRY(mds_handler_verw)
+   subq$8, %rsp
+   movw%ds, (%rsp)
+   verw(%rsp)
+   addq$8, %rsp
+   retq
+END(mds_handler_verw)
+
+ENTRY(mds_handler_ivb)
+   pushq   %rax
+   pushq   %

svn commit: r347593 - in releng: 11.2/sys/netpfil/pf 12.0/sys/netpfil/pf

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 23:12:22 2019
New Revision: 347593
URL: https://svnweb.freebsd.org/changeset/base/347593

Log:
  Fix ICMP/ICMP6 packet filter bypass in pf.
  
  Approved by:  so
  Security: FreeBSD-SA-19:06.pf
  Security: CVE-2019-5598

Modified:
  releng/11.2/sys/netpfil/pf/pf.c
  releng/12.0/sys/netpfil/pf/pf.c

Modified: releng/11.2/sys/netpfil/pf/pf.c
==
--- releng/11.2/sys/netpfil/pf/pf.c Tue May 14 23:12:14 2019
(r347592)
+++ releng/11.2/sys/netpfil/pf/pf.c Tue May 14 23:12:22 2019
(r347593)
@@ -4550,7 +4550,7 @@ pf_test_state_icmp(struct pf_state **state, int direct
 {
struct pf_addr  *saddr = pd->src, *daddr = pd->dst;
u_int16_ticmpid = 0, *icmpsum;
-   u_int8_t icmptype;
+   u_int8_t icmptype, icmpcode;
int  state_icmp = 0;
struct pf_state_key_cmp key;
 
@@ -4559,6 +4559,7 @@ pf_test_state_icmp(struct pf_state **state, int direct
 #ifdef INET
case IPPROTO_ICMP:
icmptype = pd->hdr.icmp->icmp_type;
+   icmpcode = pd->hdr.icmp->icmp_code;
icmpid = pd->hdr.icmp->icmp_id;
icmpsum = &pd->hdr.icmp->icmp_cksum;
 
@@ -4573,6 +4574,7 @@ pf_test_state_icmp(struct pf_state **state, int direct
 #ifdef INET6
case IPPROTO_ICMPV6:
icmptype = pd->hdr.icmp6->icmp6_type;
+   icmpcode = pd->hdr.icmp6->icmp6_code;
icmpid = pd->hdr.icmp6->icmp6_id;
icmpsum = &pd->hdr.icmp6->icmp6_cksum;
 
@@ -4771,6 +4773,23 @@ pf_test_state_icmp(struct pf_state **state, int direct
 #endif /* INET6 */
}
 
+   if (PF_ANEQ(pd->dst, pd2.src, pd->af)) {
+   if (V_pf_status.debug >= PF_DEBUG_MISC) {
+   printf("pf: BAD ICMP %d:%d outer dst: ",
+   icmptype, icmpcode);
+   pf_print_host(pd->src, 0, pd->af);
+   printf(" -> ");
+   pf_print_host(pd->dst, 0, pd->af);
+   printf(" inner src: ");
+   pf_print_host(pd2.src, 0, pd2.af);
+   printf(" -> ");
+   pf_print_host(pd2.dst, 0, pd2.af);
+   printf("\n");
+   }
+   REASON_SET(reason, PFRES_BADSTATE);
+   return (PF_DROP);
+   }
+
switch (pd2.proto) {
case IPPROTO_TCP: {
struct tcphdrth;
@@ -4827,7 +4846,7 @@ pf_test_state_icmp(struct pf_state **state, int direct
!SEQ_GEQ(seq, src->seqlo - (dst->max_win << dws 
{
if (V_pf_status.debug >= PF_DEBUG_MISC) {
printf("pf: BAD ICMP %d:%d ",
-   icmptype, pd->hdr.icmp->icmp_code);
+   icmptype, icmpcode);
pf_print_host(pd->src, 0, pd->af);
printf(" -> ");
pf_print_host(pd->dst, 0, pd->af);
@@ -4840,7 +4859,7 @@ pf_test_state_icmp(struct pf_state **state, int direct
} else {
if (V_pf_status.debug >= PF_DEBUG_MISC) {
printf("pf: OK ICMP %d:%d ",
-   icmptype, pd->hdr.icmp->icmp_code);
+   icmptype, icmpcode);
pf_print_host(pd->src, 0, pd->af);
printf(" -> ");
pf_print_host(pd->dst, 0, pd->af);

Modified: releng/12.0/sys/netpfil/pf/pf.c
==
--- releng/12.0/sys/netpfil/pf/pf.c Tue May 14 23:12:14 2019
(r347592)
+++ releng/12.0/sys/netpfil/pf/pf.c Tue May 14 23:12:22 2019
(r347593)
@@ -4588,7 +4588,7 @@ pf_test_state_icmp(struct pf_state **state, int direct
 {
struct pf_addr  *saddr = pd->src, *daddr = pd->dst;
u_int16_ticmpid = 0, *icmpsum;
-   u_int8_t icmptype;
+   u_int8_t icmptype, icmpcode;
int  state_icmp = 0;
struct pf_state_key_cmp key;
 
@@ -4597,6 +4597,7 @@ pf_test_state_icmp(struct pf_state **state, int direct
 #ifdef INET
case IPPROTO_ICMP:
icmptype = pd->hdr.icmp->icmp_type;
+   icmpcode = pd->hdr.icmp->icmp_code;
icmpid = pd->hdr.icmp->icmp_id;
icmpsum = &pd->hdr.icmp->icmp_cksum;
 
@@ -4611,6 +4612,7 @@ pf_test_state_i

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

2019-05-14 Thread Johannes Lundberg
Author: johalun
Date: Tue May 14 23:12:14 2019
New Revision: 347592
URL: https://svnweb.freebsd.org/changeset/base/347592

Log:
  LinuxKPI: Let del_timer return a value to match Linux.
  
  This patch is part of https://reviews.freebsd.org/D19565.
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/timer.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h
==
--- head/sys/compat/linuxkpi/common/include/linux/timer.h   Tue May 14 
23:10:21 2019(r347591)
+++ head/sys/compat/linuxkpi/common/include/linux/timer.h   Tue May 14 
23:12:14 2019(r347592)
@@ -81,8 +81,8 @@ extern unsigned long linux_timer_hz_mask;
 extern void mod_timer(struct timer_list *, int);
 extern void add_timer(struct timer_list *);
 extern void add_timer_on(struct timer_list *, int cpu);
+extern int del_timer(struct timer_list *);
 
-#definedel_timer(timer)(void)callout_stop(&(timer)->callout)
 #definedel_timer_sync(timer)   (void)callout_drain(&(timer)->callout)
 #definetimer_pending(timer)callout_pending(&(timer)->callout)
 #defineround_jiffies(j)\

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Tue May 14 23:10:21 
2019(r347591)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Tue May 14 23:12:14 
2019(r347592)
@@ -1906,6 +1906,15 @@ add_timer_on(struct timer_list *timer, int cpu)
&linux_timer_callback_wrapper, timer, cpu);
 }
 
+int
+del_timer(struct timer_list *timer)
+{
+
+   if (callout_stop(&(timer)->callout) == -1)
+   return (0);
+   return (1);
+}
+
 static void
 linux_timer_init(void *arg)
 {
___
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: r347591 - in releng: 11.2/sys/netpfil/pf 12.0/sys/netpfil/pf

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 23:10:21 2019
New Revision: 347591
URL: https://svnweb.freebsd.org/changeset/base/347591

Log:
  Fix IPv6 fragment reassembly panic in pf
  
  Approved by:  so
  Security: FreeBSD-SA-19:05.pf
  Security: CVE-2019-5597

Modified:
  releng/11.2/sys/netpfil/pf/pf_norm.c
  releng/12.0/sys/netpfil/pf/pf_norm.c

Modified: releng/11.2/sys/netpfil/pf/pf_norm.c
==
--- releng/11.2/sys/netpfil/pf/pf_norm.cTue May 14 23:06:26 2019
(r347590)
+++ releng/11.2/sys/netpfil/pf/pf_norm.cTue May 14 23:10:21 2019
(r347591)
@@ -652,11 +652,11 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, 
}
 
/* We have all the data. */
+   frent = TAILQ_FIRST(&frag->fr_queue);
+   KASSERT(frent != NULL, ("frent != NULL"));
extoff = frent->fe_extoff;
maxlen = frag->fr_maxlen;
frag_id = frag->fr_id;
-   frent = TAILQ_FIRST(&frag->fr_queue);
-   KASSERT(frent != NULL, ("frent != NULL"));
total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off +
TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len;
hdrlen = frent->fe_hdrlen - sizeof(struct ip6_frag);

Modified: releng/12.0/sys/netpfil/pf/pf_norm.c
==
--- releng/12.0/sys/netpfil/pf/pf_norm.cTue May 14 23:06:26 2019
(r347590)
+++ releng/12.0/sys/netpfil/pf/pf_norm.cTue May 14 23:10:21 2019
(r347591)
@@ -668,11 +668,11 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, 
}
 
/* We have all the data. */
+   frent = TAILQ_FIRST(&frag->fr_queue);
+   KASSERT(frent != NULL, ("frent != NULL"));
extoff = frent->fe_extoff;
maxlen = frag->fr_maxlen;
frag_id = frag->fr_id;
-   frent = TAILQ_FIRST(&frag->fr_queue);
-   KASSERT(frent != NULL, ("frent != NULL"));
total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off +
TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len;
hdrlen = frent->fe_hdrlen - sizeof(struct ip6_frag);
___
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: r347590 - in releng/11.2: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys ...

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 23:06:26 2019
New Revision: 347590
URL: https://svnweb.freebsd.org/changeset/base/347590

Log:
  Update ntpd to 4.2.8p13 to fix authenticated denial of service.
  
  Approved by:  so
  Security: FreeBSD-SA-19:04.ntp
  Security: CVE-2019-8936

Added:
  releng/11.2/contrib/ntp/libntp/xsbprintf.c
Modified:
  releng/11.2/contrib/ntp/COPYRIGHT
  releng/11.2/contrib/ntp/ChangeLog
  releng/11.2/contrib/ntp/CommitLog
  releng/11.2/contrib/ntp/Makefile.in
  releng/11.2/contrib/ntp/NEWS
  releng/11.2/contrib/ntp/aclocal.m4
  releng/11.2/contrib/ntp/adjtimed/Makefile.in
  releng/11.2/contrib/ntp/build
  releng/11.2/contrib/ntp/clockstuff/Makefile.in
  releng/11.2/contrib/ntp/config.h.in
  releng/11.2/contrib/ntp/configure
  releng/11.2/contrib/ntp/configure.ac
  releng/11.2/contrib/ntp/html/authentic.html
  releng/11.2/contrib/ntp/html/authopt.html
  releng/11.2/contrib/ntp/html/confopt.html
  releng/11.2/contrib/ntp/html/keygen.html
  releng/11.2/contrib/ntp/html/ntpdate.html
  releng/11.2/contrib/ntp/include/Makefile.in
  releng/11.2/contrib/ntp/include/isc/Makefile.in
  releng/11.2/contrib/ntp/include/ntp.h
  releng/11.2/contrib/ntp/include/ntp_calendar.h
  releng/11.2/contrib/ntp/include/ntp_md5.h
  releng/11.2/contrib/ntp/include/ntp_stdlib.h
  releng/11.2/contrib/ntp/include/ntpd.h
  releng/11.2/contrib/ntp/include/parse.h
  releng/11.2/contrib/ntp/kernel/Makefile.in
  releng/11.2/contrib/ntp/kernel/sys/Makefile.in
  releng/11.2/contrib/ntp/libntp/Makefile.am
  releng/11.2/contrib/ntp/libntp/Makefile.in
  releng/11.2/contrib/ntp/libntp/a_md5encrypt.c
  releng/11.2/contrib/ntp/libntp/authreadkeys.c
  releng/11.2/contrib/ntp/libntp/calyearstart.c
  releng/11.2/contrib/ntp/libntp/ntp_calendar.c
  releng/11.2/contrib/ntp/libntp/prettydate.c
  releng/11.2/contrib/ntp/libntp/ssl_init.c
  releng/11.2/contrib/ntp/libntp/syssignal.c
  releng/11.2/contrib/ntp/libntp/work_fork.c
  releng/11.2/contrib/ntp/libntp/work_thread.c
  releng/11.2/contrib/ntp/libparse/Makefile.in
  releng/11.2/contrib/ntp/libparse/clk_trimtsip.c
  releng/11.2/contrib/ntp/libparse/gpstolfp.c
  releng/11.2/contrib/ntp/ntpd/Makefile.in
  releng/11.2/contrib/ntp/ntpd/complete.conf.in
  releng/11.2/contrib/ntp/ntpd/invoke-ntp.conf.texi
  releng/11.2/contrib/ntp/ntpd/invoke-ntp.keys.texi
  releng/11.2/contrib/ntp/ntpd/invoke-ntpd.texi
  releng/11.2/contrib/ntp/ntpd/ntp.conf.5man
  releng/11.2/contrib/ntp/ntpd/ntp.conf.5mdoc
  releng/11.2/contrib/ntp/ntpd/ntp.conf.def
  releng/11.2/contrib/ntp/ntpd/ntp.conf.html
  releng/11.2/contrib/ntp/ntpd/ntp.conf.man.in
  releng/11.2/contrib/ntp/ntpd/ntp.conf.mdoc.in
  releng/11.2/contrib/ntp/ntpd/ntp.keys.5man
  releng/11.2/contrib/ntp/ntpd/ntp.keys.5mdoc
  releng/11.2/contrib/ntp/ntpd/ntp.keys.def
  releng/11.2/contrib/ntp/ntpd/ntp.keys.html
  releng/11.2/contrib/ntp/ntpd/ntp.keys.man.in
  releng/11.2/contrib/ntp/ntpd/ntp.keys.mdoc.in
  releng/11.2/contrib/ntp/ntpd/ntp_config.c
  releng/11.2/contrib/ntp/ntpd/ntp_control.c
  releng/11.2/contrib/ntp/ntpd/ntp_crypto.c
  releng/11.2/contrib/ntp/ntpd/ntp_io.c
  releng/11.2/contrib/ntp/ntpd/ntp_loopfilter.c
  releng/11.2/contrib/ntp/ntpd/ntp_parser.c
  releng/11.2/contrib/ntp/ntpd/ntp_parser.h
  releng/11.2/contrib/ntp/ntpd/ntp_proto.c
  releng/11.2/contrib/ntp/ntpd/ntp_refclock.c
  releng/11.2/contrib/ntp/ntpd/ntp_request.c
  releng/11.2/contrib/ntp/ntpd/ntp_timer.c
  releng/11.2/contrib/ntp/ntpd/ntpd-opts.c
  releng/11.2/contrib/ntp/ntpd/ntpd-opts.h
  releng/11.2/contrib/ntp/ntpd/ntpd.1ntpdman
  releng/11.2/contrib/ntp/ntpd/ntpd.1ntpdmdoc
  releng/11.2/contrib/ntp/ntpd/ntpd.c
  releng/11.2/contrib/ntp/ntpd/ntpd.html
  releng/11.2/contrib/ntp/ntpd/ntpd.man.in
  releng/11.2/contrib/ntp/ntpd/ntpd.mdoc.in
  releng/11.2/contrib/ntp/ntpd/rc_cmdlength.c
  releng/11.2/contrib/ntp/ntpd/refclock_bancomm.c
  releng/11.2/contrib/ntp/ntpd/refclock_datum.c
  releng/11.2/contrib/ntp/ntpd/refclock_gpsdjson.c
  releng/11.2/contrib/ntp/ntpd/refclock_jupiter.c
  releng/11.2/contrib/ntp/ntpd/refclock_parse.c
  releng/11.2/contrib/ntp/ntpd/refclock_shm.c
  releng/11.2/contrib/ntp/ntpd/refclock_true.c
  releng/11.2/contrib/ntp/ntpdate/Makefile.in
  releng/11.2/contrib/ntp/ntpdate/ntpdate.c
  releng/11.2/contrib/ntp/ntpdc/Makefile.in
  releng/11.2/contrib/ntp/ntpdc/invoke-ntpdc.texi
  releng/11.2/contrib/ntp/ntpdc/nl.pl
  releng/11.2/contrib/ntp/ntpdc/ntpdc-opts.c
  releng/11.2/contrib/ntp/ntpdc/ntpdc-opts.h
  releng/11.2/contrib/ntp/ntpdc/ntpdc.1ntpdcman
  releng/11.2/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
  releng/11.2/contrib/ntp/ntpdc/ntpdc.c
  releng/11.2/contrib/ntp/ntpdc/ntpdc.html
  releng/11.2/contrib/ntp/ntpdc/ntpdc.man.in
  releng/11.2/contrib/ntp/ntpdc/ntpdc.mdoc.in
  releng/11.2/contrib/ntp/ntpdc/ntpdc_ops.c
  releng/11.2/contrib/ntp/ntpq/Makefile.in
  releng/11.2/contrib/ntp/ntpq/invoke-ntpq.texi
  releng/11.2/contrib/ntp/ntpq/ntpq-opts.c
  releng/11.2/contrib/ntp/ntpq/ntpq-opts.h
  releng/11.2/contrib/ntp/ntpq/ntpq-subs.c
  releng/11.2/cont

svn commit: r347589 - in releng/12.0: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys contrib/ntp/libnt...

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 23:02:56 2019
New Revision: 347589
URL: https://svnweb.freebsd.org/changeset/base/347589

Log:
  Update ntpd to 4.2.8p13 to fix authenticated denial of service.
  
  Approved by:  so
  Security: FreeBSD-SA-19:04.ntp
  Security: CVE-2019-8936

Added:
  releng/12.0/contrib/ntp/libntp/xsbprintf.c
Modified:
  releng/12.0/contrib/ntp/COPYRIGHT
  releng/12.0/contrib/ntp/ChangeLog
  releng/12.0/contrib/ntp/CommitLog
  releng/12.0/contrib/ntp/Makefile.in
  releng/12.0/contrib/ntp/NEWS
  releng/12.0/contrib/ntp/aclocal.m4
  releng/12.0/contrib/ntp/adjtimed/Makefile.in
  releng/12.0/contrib/ntp/build
  releng/12.0/contrib/ntp/clockstuff/Makefile.in
  releng/12.0/contrib/ntp/config.h.in
  releng/12.0/contrib/ntp/configure
  releng/12.0/contrib/ntp/configure.ac
  releng/12.0/contrib/ntp/include/Makefile.in
  releng/12.0/contrib/ntp/include/isc/Makefile.in
  releng/12.0/contrib/ntp/include/ntp_calendar.h
  releng/12.0/contrib/ntp/include/ntp_stdlib.h
  releng/12.0/contrib/ntp/include/ntpd.h
  releng/12.0/contrib/ntp/include/parse.h
  releng/12.0/contrib/ntp/kernel/Makefile.in
  releng/12.0/contrib/ntp/kernel/sys/Makefile.in
  releng/12.0/contrib/ntp/libntp/Makefile.am
  releng/12.0/contrib/ntp/libntp/Makefile.in
  releng/12.0/contrib/ntp/libntp/authreadkeys.c
  releng/12.0/contrib/ntp/libntp/calyearstart.c
  releng/12.0/contrib/ntp/libntp/ntp_calendar.c
  releng/12.0/contrib/ntp/libntp/work_fork.c
  releng/12.0/contrib/ntp/libparse/Makefile.in
  releng/12.0/contrib/ntp/libparse/clk_trimtsip.c
  releng/12.0/contrib/ntp/libparse/gpstolfp.c
  releng/12.0/contrib/ntp/ntpd/Makefile.in
  releng/12.0/contrib/ntp/ntpd/invoke-ntp.conf.texi
  releng/12.0/contrib/ntp/ntpd/invoke-ntp.keys.texi
  releng/12.0/contrib/ntp/ntpd/invoke-ntpd.texi
  releng/12.0/contrib/ntp/ntpd/ntp.conf.5man
  releng/12.0/contrib/ntp/ntpd/ntp.conf.5mdoc
  releng/12.0/contrib/ntp/ntpd/ntp.conf.html
  releng/12.0/contrib/ntp/ntpd/ntp.conf.man.in
  releng/12.0/contrib/ntp/ntpd/ntp.conf.mdoc.in
  releng/12.0/contrib/ntp/ntpd/ntp.keys.5man
  releng/12.0/contrib/ntp/ntpd/ntp.keys.5mdoc
  releng/12.0/contrib/ntp/ntpd/ntp.keys.html
  releng/12.0/contrib/ntp/ntpd/ntp.keys.man.in
  releng/12.0/contrib/ntp/ntpd/ntp.keys.mdoc.in
  releng/12.0/contrib/ntp/ntpd/ntp_config.c
  releng/12.0/contrib/ntp/ntpd/ntp_control.c
  releng/12.0/contrib/ntp/ntpd/ntp_crypto.c
  releng/12.0/contrib/ntp/ntpd/ntp_loopfilter.c
  releng/12.0/contrib/ntp/ntpd/ntp_proto.c
  releng/12.0/contrib/ntp/ntpd/ntp_request.c
  releng/12.0/contrib/ntp/ntpd/ntp_timer.c
  releng/12.0/contrib/ntp/ntpd/ntpd-opts.c
  releng/12.0/contrib/ntp/ntpd/ntpd-opts.h
  releng/12.0/contrib/ntp/ntpd/ntpd.1ntpdman
  releng/12.0/contrib/ntp/ntpd/ntpd.1ntpdmdoc
  releng/12.0/contrib/ntp/ntpd/ntpd.c
  releng/12.0/contrib/ntp/ntpd/ntpd.html
  releng/12.0/contrib/ntp/ntpd/ntpd.man.in
  releng/12.0/contrib/ntp/ntpd/ntpd.mdoc.in
  releng/12.0/contrib/ntp/ntpd/refclock_bancomm.c
  releng/12.0/contrib/ntp/ntpd/refclock_jupiter.c
  releng/12.0/contrib/ntp/ntpd/refclock_parse.c
  releng/12.0/contrib/ntp/ntpdate/Makefile.in
  releng/12.0/contrib/ntp/ntpdate/ntpdate.c
  releng/12.0/contrib/ntp/ntpdc/Makefile.in
  releng/12.0/contrib/ntp/ntpdc/invoke-ntpdc.texi
  releng/12.0/contrib/ntp/ntpdc/nl.pl
  releng/12.0/contrib/ntp/ntpdc/ntpdc-opts.c
  releng/12.0/contrib/ntp/ntpdc/ntpdc-opts.h
  releng/12.0/contrib/ntp/ntpdc/ntpdc.1ntpdcman
  releng/12.0/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
  releng/12.0/contrib/ntp/ntpdc/ntpdc.html
  releng/12.0/contrib/ntp/ntpdc/ntpdc.man.in
  releng/12.0/contrib/ntp/ntpdc/ntpdc.mdoc.in
  releng/12.0/contrib/ntp/ntpdc/ntpdc_ops.c
  releng/12.0/contrib/ntp/ntpq/Makefile.in
  releng/12.0/contrib/ntp/ntpq/invoke-ntpq.texi
  releng/12.0/contrib/ntp/ntpq/ntpq-opts.c
  releng/12.0/contrib/ntp/ntpq/ntpq-opts.h
  releng/12.0/contrib/ntp/ntpq/ntpq.1ntpqman
  releng/12.0/contrib/ntp/ntpq/ntpq.1ntpqmdoc
  releng/12.0/contrib/ntp/ntpq/ntpq.html
  releng/12.0/contrib/ntp/ntpq/ntpq.man.in
  releng/12.0/contrib/ntp/ntpq/ntpq.mdoc.in
  releng/12.0/contrib/ntp/ntpsnmpd/Makefile.in
  releng/12.0/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
  releng/12.0/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
  releng/12.0/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
  releng/12.0/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
  releng/12.0/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
  releng/12.0/contrib/ntp/ntpsnmpd/ntpsnmpd.html
  releng/12.0/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
  releng/12.0/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
  releng/12.0/contrib/ntp/packageinfo.sh
  releng/12.0/contrib/ntp/parseutil/Makefile.in
  releng/12.0/contrib/ntp/scripts/Makefile.in
  releng/12.0/contrib/ntp/scripts/build/Makefile.in
  releng/12.0/contrib/ntp/scripts/build/check--help
  releng/12.0/contrib/ntp/scripts/calc_tickadj/Makefile.in
  releng/12.0/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
  releng/12.0/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
  releng/12.0/contrib/ntp/scripts/calc_t

svn commit: r347588 - in releng/11.2: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/patches contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/dr...

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 22:59:32 2019
New Revision: 347588
URL: https://svnweb.freebsd.org/changeset/base/347588

Log:
  Update hostapd/wpa_supplicant to 2.8 to fix multiple vulnerabilities.
  
  Approved by:  so
  Security: FreeBSD-SA-19:03.wpa
  Security: CVE-2019-9494
  Security: CVE-2019-9495
  Security: CVE-2019-9496
  Security: CVE-2019-9497
  Security: CVE-2019-9498
  Security: CVE-2019-9499
  Security: CVE-2019-11555

Added:
  releng/11.2/contrib/wpa/hostapd/README-MULTI-AP
  releng/11.2/contrib/wpa/src/ap/dpp_hostapd.c
  releng/11.2/contrib/wpa/src/ap/dpp_hostapd.h
  releng/11.2/contrib/wpa/src/ap/eth_p_oui.c
  releng/11.2/contrib/wpa/src/ap/eth_p_oui.h
  releng/11.2/contrib/wpa/src/ap/fils_hlp.c
  releng/11.2/contrib/wpa/src/ap/fils_hlp.h
  releng/11.2/contrib/wpa/src/ap/gas_query_ap.c
  releng/11.2/contrib/wpa/src/ap/gas_query_ap.h
  releng/11.2/contrib/wpa/src/ap/ieee802_11_he.c
  releng/11.2/contrib/wpa/src/ap/mbo_ap.c
  releng/11.2/contrib/wpa/src/ap/mbo_ap.h
  releng/11.2/contrib/wpa/src/ap/neighbor_db.c
  releng/11.2/contrib/wpa/src/ap/neighbor_db.h
  releng/11.2/contrib/wpa/src/ap/rrm.c
  releng/11.2/contrib/wpa/src/ap/rrm.h
  releng/11.2/contrib/wpa/src/ap/taxonomy.c
  releng/11.2/contrib/wpa/src/ap/taxonomy.h
  releng/11.2/contrib/wpa/src/ap/vlan.c
  releng/11.2/contrib/wpa/src/ap/vlan.h
  releng/11.2/contrib/wpa/src/ap/vlan_full.c
  releng/11.2/contrib/wpa/src/ap/vlan_ifconfig.c
  releng/11.2/contrib/wpa/src/ap/vlan_ioctl.c
  releng/11.2/contrib/wpa/src/common/cli.c
  releng/11.2/contrib/wpa/src/common/cli.h
  releng/11.2/contrib/wpa/src/common/ctrl_iface_common.c
  releng/11.2/contrib/wpa/src/common/ctrl_iface_common.h
  releng/11.2/contrib/wpa/src/common/dhcp.h
  releng/11.2/contrib/wpa/src/common/dpp.c
  releng/11.2/contrib/wpa/src/common/dpp.h
  releng/11.2/contrib/wpa/src/common/gas_server.c
  releng/11.2/contrib/wpa/src/common/gas_server.h
  releng/11.2/contrib/wpa/src/common/ocv.c
  releng/11.2/contrib/wpa/src/common/ocv.h
  releng/11.2/contrib/wpa/src/crypto/crypto_linux.c
  releng/11.2/contrib/wpa/src/crypto/crypto_nettle.c
  releng/11.2/contrib/wpa/src/crypto/crypto_wolfssl.c
  releng/11.2/contrib/wpa/src/crypto/fips_prf_wolfssl.c
  releng/11.2/contrib/wpa/src/crypto/sha384-internal.c
  releng/11.2/contrib/wpa/src/crypto/sha384-kdf.c
  releng/11.2/contrib/wpa/src/crypto/sha384.c
  releng/11.2/contrib/wpa/src/crypto/sha384_i.h
  releng/11.2/contrib/wpa/src/crypto/sha512-internal.c
  releng/11.2/contrib/wpa/src/crypto/sha512-kdf.c
  releng/11.2/contrib/wpa/src/crypto/sha512-prf.c
  releng/11.2/contrib/wpa/src/crypto/sha512.c
  releng/11.2/contrib/wpa/src/crypto/sha512.h
  releng/11.2/contrib/wpa/src/crypto/sha512_i.h
  releng/11.2/contrib/wpa/src/crypto/tls_openssl.h
  releng/11.2/contrib/wpa/src/crypto/tls_openssl_ocsp.c
  releng/11.2/contrib/wpa/src/crypto/tls_wolfssl.c
  releng/11.2/contrib/wpa/src/drivers/driver_macsec_linux.c
  releng/11.2/contrib/wpa/src/drivers/driver_wired_common.c
  releng/11.2/contrib/wpa/src/drivers/driver_wired_common.h
  releng/11.2/contrib/wpa/src/tls/tlsv1_client_ocsp.c
  releng/11.2/contrib/wpa/src/utils/const_time.h
  releng/11.2/contrib/wpa/src/utils/crc32.c
  releng/11.2/contrib/wpa/src/utils/crc32.h
  releng/11.2/contrib/wpa/src/utils/json.c
  releng/11.2/contrib/wpa/src/utils/json.h
  releng/11.2/contrib/wpa/src/utils/module_tests.h
  releng/11.2/contrib/wpa/wpa_supplicant/Android.mk
  releng/11.2/contrib/wpa/wpa_supplicant/README-DPP
  releng/11.2/contrib/wpa/wpa_supplicant/README-Windows.txt
  releng/11.2/contrib/wpa/wpa_supplicant/android.config
  releng/11.2/contrib/wpa/wpa_supplicant/binder/
  releng/11.2/contrib/wpa/wpa_supplicant/binder/.clang-format
  releng/11.2/contrib/wpa/wpa_supplicant/binder/binder.cpp
  releng/11.2/contrib/wpa/wpa_supplicant/binder/binder.h
  releng/11.2/contrib/wpa/wpa_supplicant/binder/binder_constants.cpp
  releng/11.2/contrib/wpa/wpa_supplicant/binder/binder_constants.h
  releng/11.2/contrib/wpa/wpa_supplicant/binder/binder_i.h
  releng/11.2/contrib/wpa/wpa_supplicant/binder/binder_manager.cpp
  releng/11.2/contrib/wpa/wpa_supplicant/binder/binder_manager.h
  releng/11.2/contrib/wpa/wpa_supplicant/binder/fi/
  releng/11.2/contrib/wpa/wpa_supplicant/binder/fi/w1/
  releng/11.2/contrib/wpa/wpa_supplicant/binder/fi/w1/wpa_supplicant/
  releng/11.2/contrib/wpa/wpa_supplicant/binder/fi/w1/wpa_supplicant/IIface.aidl
  
releng/11.2/contrib/wpa/wpa_supplicant/binder/fi/w1/wpa_supplicant/ISupplicant.aidl
  
releng/11.2/contrib/wpa/wpa_supplicant/binder/fi/w1/wpa_supplicant/ISupplicantCallbacks.aidl
  releng/11.2/contrib/wpa/wpa_supplicant/binder/iface.cpp
  releng/11.2/contrib/wpa/wpa_supplicant/binder/iface.h
  releng/11.2/contrib/wpa/wpa_supplicant/binder/supplicant.cpp
  releng/11.2/contrib/wpa/wpa_supplicant/binder/supplicant.h
  releng/11.2/contrib/wpa/wpa_supplicant/dpp_supplicant.c
  releng/11.2/contrib/wpa/wpa_supplicant/dpp_supplicant.h
  releng/11.2/contrib/wpa/wpa_s

svn commit: r347587 - in releng/12.0: . contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/...

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 22:57:29 2019
New Revision: 347587
URL: https://svnweb.freebsd.org/changeset/base/347587

Log:
  Update hostapd/wpa_supplicant to 2.8 to fix multiple vulnerabilities.
  
  Approved by:  so
  Security: FreeBSD-SA-19:03.wpa
  Security: CVE-2019-9494
  Security: CVE-2019-9495
  Security: CVE-2019-9496
  Security: CVE-2019-9497
  Security: CVE-2019-9498
  Security: CVE-2019-9499
  Security: CVE-2019-11555

Added:
  releng/12.0/contrib/wpa/hostapd/README-MULTI-AP
  releng/12.0/contrib/wpa/src/ap/dpp_hostapd.c
  releng/12.0/contrib/wpa/src/ap/dpp_hostapd.h
  releng/12.0/contrib/wpa/src/ap/eth_p_oui.c
  releng/12.0/contrib/wpa/src/ap/eth_p_oui.h
  releng/12.0/contrib/wpa/src/ap/fils_hlp.c
  releng/12.0/contrib/wpa/src/ap/fils_hlp.h
  releng/12.0/contrib/wpa/src/ap/gas_query_ap.c
  releng/12.0/contrib/wpa/src/ap/gas_query_ap.h
  releng/12.0/contrib/wpa/src/ap/ieee802_11_he.c
  releng/12.0/contrib/wpa/src/common/dhcp.h
  releng/12.0/contrib/wpa/src/common/dpp.c
  releng/12.0/contrib/wpa/src/common/dpp.h
  releng/12.0/contrib/wpa/src/common/gas_server.c
  releng/12.0/contrib/wpa/src/common/gas_server.h
  releng/12.0/contrib/wpa/src/common/ocv.c
  releng/12.0/contrib/wpa/src/common/ocv.h
  releng/12.0/contrib/wpa/src/crypto/crypto_linux.c
  releng/12.0/contrib/wpa/src/crypto/crypto_nettle.c
  releng/12.0/contrib/wpa/src/crypto/crypto_wolfssl.c
  releng/12.0/contrib/wpa/src/crypto/fips_prf_wolfssl.c
  releng/12.0/contrib/wpa/src/crypto/sha384-kdf.c
  releng/12.0/contrib/wpa/src/crypto/sha384.c
  releng/12.0/contrib/wpa/src/crypto/sha512-kdf.c
  releng/12.0/contrib/wpa/src/crypto/sha512-prf.c
  releng/12.0/contrib/wpa/src/crypto/sha512.c
  releng/12.0/contrib/wpa/src/crypto/sha512.h
  releng/12.0/contrib/wpa/src/crypto/tls_wolfssl.c
  releng/12.0/contrib/wpa/src/drivers/driver_macsec_linux.c
  releng/12.0/contrib/wpa/src/drivers/driver_wired_common.c
  releng/12.0/contrib/wpa/src/drivers/driver_wired_common.h
  releng/12.0/contrib/wpa/src/utils/const_time.h
  releng/12.0/contrib/wpa/src/utils/crc32.c
  releng/12.0/contrib/wpa/src/utils/crc32.h
  releng/12.0/contrib/wpa/src/utils/json.c
  releng/12.0/contrib/wpa/src/utils/json.h
  releng/12.0/contrib/wpa/wpa_supplicant/README-DPP
  releng/12.0/contrib/wpa/wpa_supplicant/dpp_supplicant.c
  releng/12.0/contrib/wpa/wpa_supplicant/dpp_supplicant.h
  releng/12.0/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py
  releng/12.0/contrib/wpa/wpa_supplicant/op_classes.c
  releng/12.0/contrib/wpa/wpa_supplicant/rrm.c
Deleted:
  releng/12.0/contrib/wpa/src/ap/peerkey_auth.c
  releng/12.0/contrib/wpa/src/rsn_supp/peerkey.c
  releng/12.0/contrib/wpa/src/rsn_supp/peerkey.h
  releng/12.0/contrib/wpa/wpa_supplicant/dbus/dbus_old.c
  releng/12.0/contrib/wpa/wpa_supplicant/dbus/dbus_old.h
  releng/12.0/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.c
  releng/12.0/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.h
  releng/12.0/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers_wps.c
  
releng/12.0/contrib/wpa/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
  releng/12.0/contrib/wpa/wpa_supplicant/examples/wpas-test.py
Modified:
  releng/12.0/Makefile.inc1
  releng/12.0/contrib/wpa/CONTRIBUTIONS
  releng/12.0/contrib/wpa/COPYING
  releng/12.0/contrib/wpa/README
  releng/12.0/contrib/wpa/hostapd/ChangeLog
  releng/12.0/contrib/wpa/hostapd/README
  releng/12.0/contrib/wpa/hostapd/config_file.c
  releng/12.0/contrib/wpa/hostapd/config_file.h
  releng/12.0/contrib/wpa/hostapd/ctrl_iface.c
  releng/12.0/contrib/wpa/hostapd/defconfig
  releng/12.0/contrib/wpa/hostapd/hlr_auc_gw.c
  releng/12.0/contrib/wpa/hostapd/hostapd.conf
  releng/12.0/contrib/wpa/hostapd/hostapd.eap_user_sqlite
  releng/12.0/contrib/wpa/hostapd/hostapd.wpa_psk
  releng/12.0/contrib/wpa/hostapd/hostapd_cli.c
  releng/12.0/contrib/wpa/hostapd/main.c
  releng/12.0/contrib/wpa/hostapd/wps-ap-nfc.py
  releng/12.0/contrib/wpa/hs20/client/Makefile
  releng/12.0/contrib/wpa/hs20/client/est.c
  releng/12.0/contrib/wpa/hs20/client/oma_dm_client.c
  releng/12.0/contrib/wpa/hs20/client/osu_client.c
  releng/12.0/contrib/wpa/hs20/client/osu_client.h
  releng/12.0/contrib/wpa/src/ap/acs.c
  releng/12.0/contrib/wpa/src/ap/acs.h
  releng/12.0/contrib/wpa/src/ap/ap_config.c
  releng/12.0/contrib/wpa/src/ap/ap_config.h
  releng/12.0/contrib/wpa/src/ap/ap_drv_ops.c
  releng/12.0/contrib/wpa/src/ap/ap_drv_ops.h
  releng/12.0/contrib/wpa/src/ap/ap_mlme.c
  releng/12.0/contrib/wpa/src/ap/authsrv.c
  releng/12.0/contrib/wpa/src/ap/beacon.c
  releng/12.0/contrib/wpa/src/ap/beacon.h
  releng/12.0/contrib/wpa/src/ap/bss_load.c
  releng/12.0/contrib/wpa/src/ap/ctrl_iface_ap.c
  releng/12.0/contrib/wpa/src/ap/ctrl_iface_ap.h
  releng/12.0/contrib/wpa/src/ap/dfs.c
  releng/12.0/contrib/wpa/src/ap/dfs.h
  releng/12.0/contrib/wpa/src/ap/dhcp_snoop.c
  releng/12.0/contrib/wpa/src/ap/drv_callbacks.c
  releng/12.0/contrib/wpa/src/ap/eap_user_db.c
  releng/12.0/contrib/wpa/src/

svn commit: r347586 - releng/12.0/crypto/openssh

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 22:54:17 2019
New Revision: 347586
URL: https://svnweb.freebsd.org/changeset/base/347586

Log:
  Fix insufficient filename validation in scp client
  
  Approved by:  so
  Security: FreeBSD-EN-19:10.scp

Modified:
  releng/12.0/crypto/openssh/scp.1
  releng/12.0/crypto/openssh/scp.c

Modified: releng/12.0/crypto/openssh/scp.1
==
--- releng/12.0/crypto/openssh/scp.1Tue May 14 22:51:49 2019
(r347585)
+++ releng/12.0/crypto/openssh/scp.1Tue May 14 22:54:17 2019
(r347586)
@@ -18,7 +18,7 @@
 .Nd secure copy (remote file copy program)
 .Sh SYNOPSIS
 .Nm scp
-.Op Fl 346BCpqrv
+.Op Fl 346BCpqrTv
 .Op Fl c Ar cipher
 .Op Fl F Ar ssh_config
 .Op Fl i Ar identity_file
@@ -207,6 +207,16 @@ to use for the encrypted connection.
 The program must understand
 .Xr ssh 1
 options.
+.It Fl T
+Disable strict filename checking.
+By default when copying files from a remote host to a local directory
+.Nm
+checks that the received filenames match those requested on the command-line
+to prevent the remote end from sending unexpected or unwanted files.
+Because of differences in how various operating systems and shells interpret
+filename wildcards, these checks may cause wanted files to be rejected.
+This option disables these checks at the expense of fully trusting that
+the server will not send unexpected filenames.
 .It Fl v
 Verbose mode.
 Causes

Modified: releng/12.0/crypto/openssh/scp.c
==
--- releng/12.0/crypto/openssh/scp.cTue May 14 22:51:49 2019
(r347585)
+++ releng/12.0/crypto/openssh/scp.cTue May 14 22:54:17 2019
(r347586)
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.197 2018/06/01 04:31:48 dtucker Exp $ */
+/* $OpenBSD: scp.c,v 1.204 2019/02/10 11:15:52 djm Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -94,6 +94,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -375,14 +376,14 @@ void verifydir(char *);
 struct passwd *pwd;
 uid_t userid;
 int errs, remin, remout;
-int pflag, iamremote, iamrecursive, targetshouldbedirectory;
+int Tflag, pflag, iamremote, iamrecursive, targetshouldbedirectory;
 
 #defineCMDNEEDS64
 char cmd[CMDNEEDS];/* must hold "rcp -r -p -d\0" */
 
 int response(void);
 void rsource(char *, struct stat *);
-void sink(int, char *[]);
+void sink(int, char *[], const char *);
 void source(int, char *[]);
 void tolocal(int, char *[]);
 void toremote(int, char *[]);
@@ -421,8 +422,9 @@ main(int argc, char **argv)
addargs(&args, "-oRemoteCommand=none");
addargs(&args, "-oRequestTTY=no");
 
-   fflag = tflag = 0;
-   while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q12346S:o:F:")) != -1)
+   fflag = Tflag = tflag = 0;
+   while ((ch = getopt(argc, argv,
+   "dfl:prtTvBCc:i:P:q12346S:o:F:")) != -1) {
switch (ch) {
/* User-visible flags. */
case '1':
@@ -501,9 +503,13 @@ main(int argc, char **argv)
setmode(0, O_BINARY);
 #endif
break;
+   case 'T':
+   Tflag = 1;
+   break;
default:
usage();
}
+   }
argc -= optind;
argv += optind;
 
@@ -534,7 +540,7 @@ main(int argc, char **argv)
}
if (tflag) {
/* Receive data. */
-   sink(argc, argv);
+   sink(argc, argv, NULL);
exit(errs != 0);
}
if (argc < 2)
@@ -620,6 +626,253 @@ parse_scp_uri(const char *uri, char **userp, char **ho
return r;
 }
 
+/* Appends a string to an array; returns 0 on success, -1 on alloc failure */
+static int
+append(char *cp, char ***ap, size_t *np)
+{
+   char **tmp;
+
+   if ((tmp = reallocarray(*ap, *np + 1, sizeof(*tmp))) == NULL)
+   return -1;
+   tmp[(*np)] = cp;
+   (*np)++;
+   *ap = tmp;
+   return 0;
+}
+
+/*
+ * Finds the start and end of the first brace pair in the pattern.
+ * returns 0 on success or -1 for invalid patterns.
+ */
+static int
+find_brace(const char *pattern, int *startp, int *endp)
+{
+   int i;
+   int in_bracket, brace_level;
+
+   *startp = *endp = -1;
+   in_bracket = brace_level = 0;
+   for (i = 0; i < INT_MAX && *endp < 0 && pattern[i] != '\0'; i++) {
+   switch (pattern[i]) {
+   case '\\':
+   /* skip next character */
+   if (pattern[i + 1] != '\0')
+   i++;
+   break;
+   case '[':
+   in_bracket = 1;
+   break;
+   case ']':
+   

svn commit: r347585 - in releng: 11.2/usr.bin/xinstall 11.2/usr.bin/xinstall/tests 12.0/usr.bin/xinstall 12.0/usr.bin/xinstall/tests

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 22:51:49 2019
New Revision: 347585
URL: https://svnweb.freebsd.org/changeset/base/347585

Log:
  Fix partially matching relative paths in xinstall.
  
  Approved by:  so
  Security: FreeBSD-EN-19:09.xinstall

Modified:
  releng/11.2/usr.bin/xinstall/tests/install_test.sh
  releng/11.2/usr.bin/xinstall/xinstall.c
  releng/12.0/usr.bin/xinstall/tests/install_test.sh
  releng/12.0/usr.bin/xinstall/xinstall.c

Modified: releng/11.2/usr.bin/xinstall/tests/install_test.sh
==
--- releng/11.2/usr.bin/xinstall/tests/install_test.sh  Tue May 14 22:48:36 
2019(r347584)
+++ releng/11.2/usr.bin/xinstall/tests/install_test.sh  Tue May 14 22:51:49 
2019(r347585)
@@ -377,6 +377,29 @@ mkdir_simple_body() {
atf_check install -d dir1/dir2/dir3
 }
 
+atf_test_case symbolic_link_relative_absolute_common
+symbolic_link_relative_absolute_common_head() {
+   atf_set "descr" "Verify -l rs with absolute paths having common 
components"
+}
+symbolic_link_relative_absolute_common_body() {
+   filename=foo.so
+   src_path=lib
+   src_path_prefixed=$PWD/$src_path
+   dest_path=$PWD/libexec/
+   src_file=$src_path_prefixed/$filename
+   dest_file=$dest_path/$filename
+
+   atf_check mkdir $src_path_prefixed $dest_path
+   atf_check touch $src_file
+   atf_check install -l sr $src_file $dest_path
+
+   dest_path_relative=$(readlink $dest_file)
+   src_path_relative="../lib/$filename"
+   if [ "$src_path_relative" != "$dest_path_relative" ]; then
+   atf_fail "unexpected symlink contents ('$src_path_relative' != 
'$dest_path_relative')"
+   fi
+}
+
 atf_init_test_cases() {
atf_add_test_case copy_to_nonexistent
atf_add_test_case copy_to_nonexistent_safe
@@ -415,5 +438,6 @@ atf_init_test_cases() {
atf_add_test_case symbolic_link_relative_absolute_source_and_dest1
atf_add_test_case 
symbolic_link_relative_absolute_source_and_dest1_double_slash
atf_add_test_case symbolic_link_relative_absolute_source_and_dest2
+   atf_add_test_case symbolic_link_relative_absolute_common
atf_add_test_case mkdir_simple
 }

Modified: releng/11.2/usr.bin/xinstall/xinstall.c
==
--- releng/11.2/usr.bin/xinstall/xinstall.c Tue May 14 22:48:36 2019
(r347584)
+++ releng/11.2/usr.bin/xinstall/xinstall.c Tue May 14 22:51:49 2019
(r347585)
@@ -667,7 +667,7 @@ makelink(const char *from_name, const char *to_name,
}
 
if (dolink & LN_RELATIVE) {
-   char *to_name_copy, *cp, *d, *s;
+   char *to_name_copy, *cp, *d, *ld, *ls, *s;
 
if (*from_name != '/') {
/* this is already a relative link */
@@ -703,8 +703,19 @@ makelink(const char *from_name, const char *to_name,
free(to_name_copy);
 
/* Trim common path components. */
-   for (s = src, d = dst; *s == *d; s++, d++)
+   ls = ld = NULL;
+   for (s = src, d = dst; *s == *d; ls = s, ld = d, s++, d++)
continue;
+   /*
+* If we didn't end after a directory separator, then we've
+* falsely matched the last component.  For example, if one
+* invoked install -lrs /lib/foo.so /libexec/ then the source
+* would terminate just after the separator while the
+* destination would terminate in the middle of 'libexec',
+* leading to a full directory getting falsely eaten.
+*/
+   if ((ls != NULL && *ls != '/') || (ld != NULL && *ld != '/'))
+   s--, d--;
while (*s != '/')
s--, d--;
 

Modified: releng/12.0/usr.bin/xinstall/tests/install_test.sh
==
--- releng/12.0/usr.bin/xinstall/tests/install_test.sh  Tue May 14 22:48:36 
2019(r347584)
+++ releng/12.0/usr.bin/xinstall/tests/install_test.sh  Tue May 14 22:51:49 
2019(r347585)
@@ -377,6 +377,29 @@ mkdir_simple_body() {
atf_check install -d dir1/dir2/dir3
 }
 
+atf_test_case symbolic_link_relative_absolute_common
+symbolic_link_relative_absolute_common_head() {
+   atf_set "descr" "Verify -l rs with absolute paths having common 
components"
+}
+symbolic_link_relative_absolute_common_body() {
+   filename=foo.so
+   src_path=lib
+   src_path_prefixed=$PWD/$src_path
+   dest_path=$PWD/libexec/
+   src_file=$src_path_prefixed/$filename
+   dest_file=$dest_path/$filename
+
+   atf_check mkdir $src_path_prefixed $dest_path
+   atf_check touch $src_file
+   atf_check install -l sr $src_file $dest_path
+
+   dest_path_relative=$(readlink $dest_fil

svn commit: r347584 - in releng: 11.2/contrib/tzdata 12.0/contrib/tzdata

2019-05-14 Thread Gordon Tetlow
Author: gordon
Date: Tue May 14 22:48:36 2019
New Revision: 347584
URL: https://svnweb.freebsd.org/changeset/base/347584

Log:
  Import tzdata 2019a.
  
  Approved by:  so
  Security: FreeBSD-EN-19:08.tzdata

Modified:
  releng/11.2/contrib/tzdata/Makefile
  releng/11.2/contrib/tzdata/NEWS
  releng/11.2/contrib/tzdata/README
  releng/11.2/contrib/tzdata/africa
  releng/11.2/contrib/tzdata/asia
  releng/11.2/contrib/tzdata/backward
  releng/11.2/contrib/tzdata/backzone
  releng/11.2/contrib/tzdata/etcetera
  releng/11.2/contrib/tzdata/europe
  releng/11.2/contrib/tzdata/leap-seconds.list
  releng/11.2/contrib/tzdata/leapseconds
  releng/11.2/contrib/tzdata/northamerica
  releng/11.2/contrib/tzdata/theory.html
  releng/11.2/contrib/tzdata/version
  releng/12.0/contrib/tzdata/Makefile
  releng/12.0/contrib/tzdata/NEWS
  releng/12.0/contrib/tzdata/README
  releng/12.0/contrib/tzdata/africa
  releng/12.0/contrib/tzdata/asia
  releng/12.0/contrib/tzdata/backward
  releng/12.0/contrib/tzdata/backzone
  releng/12.0/contrib/tzdata/etcetera
  releng/12.0/contrib/tzdata/europe
  releng/12.0/contrib/tzdata/leap-seconds.list
  releng/12.0/contrib/tzdata/leapseconds
  releng/12.0/contrib/tzdata/northamerica
  releng/12.0/contrib/tzdata/theory.html
  releng/12.0/contrib/tzdata/version

Modified: releng/11.2/contrib/tzdata/Makefile
==
--- releng/11.2/contrib/tzdata/Makefile Tue May 14 22:00:47 2019
(r347583)
+++ releng/11.2/contrib/tzdata/Makefile Tue May 14 22:48:36 2019
(r347584)
@@ -12,7 +12,10 @@ VERSION= unknown
 # Email address for bug reports.
 BUGEMAIL=  t...@iana.org
 
-# Choose source data features.  To get new features right away, use:
+# DATAFORM selects the data format.
+# Available formats represent essentially the same data, albeit
+# possibly with minor discrepancies that users are not likely to notice.
+# To get new features and the best data right away, use:
 #  DATAFORM=   vanguard
 # To wait a while before using new features, to give downstream users
 # time to upgrade zic (the default), use:
@@ -33,11 +36,11 @@ DATAFORM=   main
 LOCALTIME= GMT
 
 # If you want something other than Eastern United States time as a template
-# for handling POSIX-style timezone environment variables,
+# for handling ruleless POSIX-style timezone environment variables,
 # change the line below (after finding the timezone you want in the
 # one of the $(TDATA) source files, or adding it to a source file).
-# When a POSIX-style environment variable is handled, the rules in the
-# template file are used to determine "spring forward" and "fall back" days and
+# A ruleless environment setting like TZ='CST6CDT' uses the rules in the
+# template file to determine "spring forward" and "fall back" days and
 # times; the environment variable itself specifies UT offsets of standard and
 # daylight saving time.
 # Alternatively, if you discover you've got the wrong timezone, you can just
@@ -46,7 +49,6 @@ LOCALTIME=GMT
 # Use the command
 #  make zonenames
 # to get a list of the values you can use for POSIXRULES.
-# If you want POSIX compatibility, use "America/New_York".
 
 POSIXRULES=America/New_York
 
@@ -113,8 +115,8 @@ TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TI
 TIME_T_ALTERNATIVES_HEAD = int64_t
 TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
 
-# What kind of TZif data files to generate.
-# (TZif is the binary time zone data format that zic generates.)
+# What kind of TZif data files to generate.  (TZif is the binary time
+# zone data format that zic generates; see Internet RFC 8536.)
 # If you want only POSIX time, with time values interpreted as
 # seconds since the epoch (not counting leap seconds), use
 #  REDO=   posix_only
@@ -360,6 +362,9 @@ LEAPSECONDS=
 zic=   ./zic
 ZIC=   $(zic) $(ZFLAGS)
 
+# To shrink the size of installed TZif files,
+# append "-r @N" to omit data before N-seconds-after-the-Epoch.
+# See the zic man page for more about -r.
 ZFLAGS=
 
 # How to use zic to install TZif files.
@@ -491,7 +496,8 @@ MANTXTS=newctime.3.txt newstrftime.3.txt newtzset.3.t
 COMMON=calendars CONTRIBUTING LICENSE Makefile \
NEWS README theory.html version
 WEB_PAGES= tz-art.html tz-how-to.html tz-link.html
-CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html
+CHECK_WEB_PAGES=check_theory.html check_tz-art.html \
+   check_tz-how-to.html check_tz-link.html
 DOCS=  $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
 PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
@@ -804,9 +810,10 @@ check_tzs: $(TZS) $(TZS_NEW)
touch $@
 
 check_web: $(CHECK_WEB_PAGES)
+check_theory.html: theory.html
 check_tz-art.html: tz-art.html
 check_tz-link.html: tz-link.html
-check_tz-art.html check_tz-link.html:
+che

svn commit: r347583 - head/usr.sbin/mountd

2019-05-14 Thread Rick Macklem
Author: rmacklem
Date: Tue May 14 22:00:47 2019
New Revision: 347583
URL: https://svnweb.freebsd.org/changeset/base/347583

Log:
  Replace global list for grouplist with list(s) for each exportlist element.
  
  In mountd.c, the grouplist structures are linked into a single global
  linked list headed by "grphead". The only use of this linked list is
  to free all list elements when the exportlist elements are also all being
  free'd at the time the exports are being reloaded.
  This patch replaces this one global linked list head with a list head in
  each exportlist structure, where the grouplist elements for that exported
  file system are linked.
  The only change is that now the grouplist elements are free'd with the
  associated exportlist element as they are free'd instead of all grouplist
  elements being free'd after the exportlist elements are free'd. This
  change should have no effect in practice.
  This is being done, since a future patch that will add a "-I" option for
  incrementally updating the exports in the kernel needs to know which
  grouplist elements are associated with each exported file system and
  having them linked into a list headed by the exportlist element does that.
  
  MFC after:1 month

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

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Tue May 14 21:30:55 2019
(r347582)
+++ head/usr.sbin/mountd/mountd.c   Tue May 14 22:00:47 2019
(r347583)
@@ -114,6 +114,7 @@ struct dirlist {
 struct exportlist {
struct dirlist  *ex_dirl;
struct dirlist  *ex_defdir;
+   struct grouplist *ex_grphead;
int ex_flag;
fsid_t  ex_fs;
char*ex_fsdir;
@@ -235,7 +236,6 @@ static void terminate(int);
 
 static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead);
 static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead);
-static struct grouplist *grphead;
 static char *exnames_default[2] = { _PATH_EXPORTS, NULL };
 static char **exnames;
 static char **hosts = NULL;
@@ -455,7 +455,6 @@ main(int argc, char **argv)
 
argc -= optind;
argv += optind;
-   grphead = (struct grouplist *)NULL;
if (argc > 0)
exnames = argv;
else
@@ -1692,8 +1691,8 @@ get_exportlist_one(void)
 */
if (has_host) {
hang_dirp(dirhead, tgrp, ep, opt_flags);
-   grp->gr_next = grphead;
-   grphead = tgrp;
+   grp->gr_next = ep->ex_grphead;
+   ep->ex_grphead = tgrp;
} else {
hang_dirp(dirhead, (struct grouplist *)NULL, ep,
opt_flags);
@@ -1720,7 +1719,6 @@ nextline:
 static void
 get_exportlist(void)
 {
-   struct grouplist *grp, *tgrp;
struct export_args export;
struct iovec *iov;
struct statfs *mntbufp;
@@ -1743,14 +1741,6 @@ get_exportlist(void)
 */
free_exports(&exphead);
 
-   grp = grphead;
-   while (grp) {
-   tgrp = grp;
-   grp = grp->gr_next;
-   free_grp(tgrp);
-   }
-   grphead = (struct grouplist *)NULL;
-
/*
 * and the old V4 root dir.
 */
@@ -2448,6 +2438,7 @@ get_host(char *cp, struct grouplist *grp, struct group
 static void
 free_exp(struct exportlist *ep)
 {
+   struct grouplist *grp, *tgrp;
 
if (ep->ex_defdir) {
free_host(ep->ex_defdir->dp_hosts);
@@ -2458,6 +2449,12 @@ free_exp(struct exportlist *ep)
if (ep->ex_indexfile)
free(ep->ex_indexfile);
free_dir(ep->ex_dirl);
+   grp = ep->ex_grphead;
+   while (grp) {
+   tgrp = grp;
+   grp = grp->gr_next;
+   free_grp(tgrp);
+   }
free((caddr_t)ep);
 }
 
___
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: r347582 - in head/sys: netinet netinet6

2019-05-14 Thread Mark Johnston
Author: markj
Date: Tue May 14 21:30:55 2019
New Revision: 347582
URL: https://svnweb.freebsd.org/changeset/base/347582

Log:
  Close some races in multicast socket option handling.
  
  r333175 converted the global multicast lock to a sleepable sx lock,
  so the lock order with respect to the (non-sleepable) inp lock changed.
  To handle this, r333175 and r333505 added code to drop the inp lock,
  but this opened races that could leave multicast group description
  structures in an inconsistent state.  This change fixes the problem by
  simply acquiring the global lock sooner.  Along the way, this fixes
  some LORs and bogus error handling introduced in r333175, and commits
  some related cleanup.
  
  Reported by:  syzbot+ba7c4943547e0604f...@syzkaller.appspotmail.com
  Reported by:  syzbot+1b803796ab94d11a4...@syzkaller.appspotmail.com
  Reviewed by:  ae
  MFC after:3 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20070

Modified:
  head/sys/netinet/in_mcast.c
  head/sys/netinet6/in6_mcast.c

Modified: head/sys/netinet/in_mcast.c
==
--- head/sys/netinet/in_mcast.c Tue May 14 21:11:15 2019(r347581)
+++ head/sys/netinet/in_mcast.c Tue May 14 21:30:55 2019(r347582)
@@ -1534,6 +1534,7 @@ inp_block_unblock_source(struct inpcb *inp, struct soc
/*
 * Check if we are actually a member of this group.
 */
+   IN_MULTI_LOCK();
imo = inp_findmoptions(inp);
idx = imo_match_group(imo, ifp, &gsa->sa);
if (idx == -1 || imo->imo_mfilters == NULL) {
@@ -1593,14 +1594,13 @@ inp_block_unblock_source(struct inpcb *inp, struct soc
/*
 * Begin state merge transaction at IGMP layer.
 */
-   IN_MULTI_LOCK();
CTR1(KTR_IGMPV3, "%s: merge inm state", __func__);
IN_MULTI_LIST_LOCK();
error = inm_merge(inm, imf);
if (error) {
CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__);
IN_MULTI_LIST_UNLOCK();
-   goto out_in_multi_locked;
+   goto out_imf_rollback;
}
 
CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__);
@@ -1609,9 +1609,6 @@ inp_block_unblock_source(struct inpcb *inp, struct soc
if (error)
CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__);
 
-out_in_multi_locked:
-
-   IN_MULTI_UNLOCK();
 out_imf_rollback:
if (error)
imf_rollback(imf);
@@ -1622,6 +1619,7 @@ out_imf_rollback:
 
 out_inp_locked:
INP_WUNLOCK(inp);
+   IN_MULTI_UNLOCK();
return (error);
 }
 
@@ -1680,10 +1678,10 @@ inp_findmoptions(struct inpcb *inp)
 static void
 inp_gcmoptions(struct ip_moptions *imo)
 {
-   struct in_mfilter   *imf;
+   struct in_mfilter *imf;
struct in_multi *inm;
struct ifnet *ifp;
-   size_t   idx, nmships;
+   size_t idx, nmships;
 
nmships = imo->imo_num_memberships;
for (idx = 0; idx < nmships; ++idx) {
@@ -2142,12 +2140,12 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt
CTR2(KTR_IGMPV3, "%s: unknown sopt_name %d",
__func__, sopt->sopt_name);
return (EOPNOTSUPP);
-   break;
}
 
if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0)
return (EADDRNOTAVAIL);
 
+   IN_MULTI_LOCK();
imo = inp_findmoptions(inp);
idx = imo_match_group(imo, ifp, &gsa->sa);
if (idx == -1) {
@@ -2272,10 +2270,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt
/*
 * Begin state merge transaction at IGMP layer.
 */
-   in_pcbref(inp);
-   INP_WUNLOCK(inp);
-   IN_MULTI_LOCK();
-
if (is_new) {
error = in_joingroup_locked(ifp, &gsa->sin.sin_addr, imf,
&inm);
@@ -2286,6 +2280,8 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt
goto out_imo_free;
}
inm_acquire(inm);
+   KASSERT(imo->imo_membership[idx] == NULL,
+   ("%s: imo_membership already allocated", __func__));
imo->imo_membership[idx] = inm;
} else {
CTR1(KTR_IGMPV3, "%s: merge inm state", __func__);
@@ -2295,7 +2291,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt
CTR1(KTR_IGMPV3, "%s: failed to merge inm state",
 __func__);
IN_MULTI_LIST_UNLOCK();
-   goto out_in_multi_locked;
+   goto out_imf_rollback;
}
CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__);
error = igmp_change_state(inm);
@@ -2303,16 +2299,11 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt
if (error) {
 

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

2019-05-14 Thread Konstantin Belousov
Author: kib
Date: Tue May 14 21:11:15 2019
New Revision: 347581
URL: https://svnweb.freebsd.org/changeset/base/347581

Log:
  MFC r347148:
  imgact_elf: do not relock the text vnode if possible.

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Tue May 14 20:59:44 2019
(r347580)
+++ stable/12/sys/kern/imgact_elf.c Tue May 14 21:11:15 2019
(r347581)
@@ -958,9 +958,12 @@ __elfN(get_interp)(struct image_params *imgp, const El
interp_name_len = phdr->p_filesz;
if (phdr->p_offset > PAGE_SIZE ||
interp_name_len > PAGE_SIZE - phdr->p_offset) {
-   VOP_UNLOCK(imgp->vp, 0);
-   interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK);
-   vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+   interp = malloc(interp_name_len + 1, M_TEMP, M_NOWAIT);
+   if (interp == NULL) {
+   VOP_UNLOCK(imgp->vp, 0);
+   interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK);
+   vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+   }
error = vn_rdwr(UIO_READ, imgp->vp, interp,
interp_name_len, phdr->p_offset,
UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred,
@@ -1279,7 +1282,12 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
/*
 * Construct auxargs table (used by the fixup routine)
 */
-   elf_auxargs = malloc(sizeof(Elf_Auxargs), M_TEMP, M_WAITOK);
+   elf_auxargs = malloc(sizeof(Elf_Auxargs), M_TEMP, M_NOWAIT);
+   if (elf_auxargs == NULL) {
+   VOP_UNLOCK(imgp->vp, 0);
+   elf_auxargs = malloc(sizeof(Elf_Auxargs), M_TEMP, M_WAITOK);
+   vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+   }
elf_auxargs->execfd = -1;
elf_auxargs->phdr = proghdr + et_dyn_addr;
elf_auxargs->phent = hdr->e_phentsize;
@@ -2559,9 +2567,12 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Not
ASSERT_VOP_LOCKED(imgp->vp, "parse_notes");
if (pnote->p_offset > PAGE_SIZE ||
pnote->p_filesz > PAGE_SIZE - pnote->p_offset) {
-   VOP_UNLOCK(imgp->vp, 0);
-   buf = malloc(pnote->p_filesz, M_TEMP, M_WAITOK);
-   vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+   buf = malloc(pnote->p_filesz, M_TEMP, M_NOWAIT);
+   if (buf == NULL) {
+   VOP_UNLOCK(imgp->vp, 0);
+   buf = malloc(pnote->p_filesz, M_TEMP, M_WAITOK);
+   vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+   }
error = vn_rdwr(UIO_READ, imgp->vp, buf, pnote->p_filesz,
pnote->p_offset, UIO_SYSSPACE, IO_NODELOCKED,
curthread->td_ucred, NOCRED, NULL, curthread);
___
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: r347580 - head/sys/amd64/linux

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 20:59:44 2019
New Revision: 347580
URL: https://svnweb.freebsd.org/changeset/base/347580

Log:
  Fix handling of r10 in Linux ptrace(2).  This fixes decoding
  of the 'flags' argument to mmap(2) with Linux strace(1).
  
  Reviewed by:  dchagin
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20223

Modified:
  head/sys/amd64/linux/linux_ptrace.c

Modified: head/sys/amd64/linux/linux_ptrace.c
==
--- head/sys/amd64/linux/linux_ptrace.c Tue May 14 20:41:24 2019
(r347579)
+++ head/sys/amd64/linux/linux_ptrace.c Tue May 14 20:59:44 2019
(r347580)
@@ -338,18 +338,27 @@ linux_ptrace_getregs(struct thread *td, pid_t pid, voi
 
map_regs_to_linux(&b_reg, &l_reg);
 
-   /*
-* The strace(1) utility depends on RAX being set to -ENOSYS
-* on syscall entry.
-*/
error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo));
if (error != 0) {
printf("%s: PT_LWPINFO failed with error %d\n", __func__, 
error);
return (error);
}
-   if (lwpinfo.pl_flags & PL_FLAG_SCE)
-   l_reg.rax = -38; // XXX: Don't hardcode?
+   if (lwpinfo.pl_flags & PL_FLAG_SCE) {
+   /*
+* The strace(1) utility depends on RAX being set to -ENOSYS
+* on syscall entry; otherwise it loops printing those:
+*
+* [ Process PID=928 runs in 64 bit mode. ]
+* [ Process PID=928 runs in x32 mode. ]
+*/
+   l_reg.rax = -38; /* -ENOSYS */
 
+   /*
+* Undo the mangling done in exception.S:fast_syscall_common().
+*/
+   l_reg.r10 = l_reg.rcx;
+   }
+
error = copyout(&l_reg, (void *)data, sizeof(l_reg));
return (error);
 }
@@ -399,21 +408,27 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid
 
map_regs_to_linux_regset(&b_reg, fsbase, gsbase, &l_regset);
 
-   /*
-* The strace(1) utility depends on RAX being set to -ENOSYS
-* on syscall entry; otherwise it loops printing those:
-*
-* [ Process PID=928 runs in 64 bit mode. ]
-* [ Process PID=928 runs in x32 mode. ]
-*/
error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo));
if (error != 0) {
printf("%s: PT_LWPINFO failed with error %d\n",
__func__, error);
return (error);
}
-   if (lwpinfo.pl_flags & PL_FLAG_SCE)
-   l_regset.rax = -38; // XXX: Don't hardcode?
+   if (lwpinfo.pl_flags & PL_FLAG_SCE) {
+   /*
+* The strace(1) utility depends on RAX being set to -ENOSYS
+* on syscall entry; otherwise it loops printing those:
+*
+* [ Process PID=928 runs in 64 bit mode. ]
+* [ Process PID=928 runs in x32 mode. ]
+*/
+   l_regset.rax = -38; /* -ENOSYS */
+
+   /*
+* Undo the mangling done in exception.S:fast_syscall_common().
+*/
+   l_regset.r10 = l_regset.rcx;
+   }
 
len = MIN(iov.iov_len, sizeof(l_regset));
error = copyout(&l_regset, (void *)iov.iov_base, len);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 20:41:24 2019
New Revision: 347579
URL: https://svnweb.freebsd.org/changeset/base/347579

Log:
  MFC r346120:
  
  Use shared vnode locks for the ELF interpreter.
  
  Sponsored by: DARPA, AFRL

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Tue May 14 20:32:29 2019
(r347578)
+++ stable/12/sys/kern/imgact_elf.c Tue May 14 20:41:24 2019
(r347579)
@@ -717,7 +717,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_
struct nameidata *nd;
struct vattr *attr;
struct image_params *imgp;
-   u_long rbase;
+   u_long flags, rbase;
u_long base_addr = 0;
int error;
 
@@ -745,7 +745,10 @@ __elfN(load_file)(struct proc *p, const char *file, u_
imgp->object = NULL;
imgp->execlabel = NULL;
 
-   NDINIT(nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_SYSSPACE, file, curthread);
+   flags = FOLLOW | LOCKSHARED | LOCKLEAF;
+
+again:
+   NDINIT(nd, LOOKUP, flags, UIO_SYSSPACE, file, curthread);
if ((error = namei(nd)) != 0) {
nd->ni_vp = NULL;
goto fail;
@@ -760,15 +763,30 @@ __elfN(load_file)(struct proc *p, const char *file, u_
if (error)
goto fail;
 
+   /*
+* Also make certain that the interpreter stays the same,
+* so set its VV_TEXT flag, too.  Since this function is only
+* used to load the interpreter, the VV_TEXT is almost always
+* already set.
+*/
+   if (VOP_IS_TEXT(nd->ni_vp) == 0) {
+   if (VOP_ISLOCKED(nd->ni_vp) != LK_EXCLUSIVE) {
+   /*
+* LK_UPGRADE could have resulted in dropping
+* the lock.  Just try again from the start,
+* this time with exclusive vnode lock.
+*/
+   vput(nd->ni_vp);
+   flags &= ~LOCKSHARED;
+   goto again;
+   }
+
+   VOP_SET_TEXT(nd->ni_vp);
+   }
+
error = exec_map_first_page(imgp);
if (error)
goto fail;
-
-   /*
-* Also make certain that the interpreter stays the same, so set
-* its VV_TEXT flag, too.
-*/
-   VOP_SET_TEXT(nd->ni_vp);
 
imgp->object = nd->ni_vp->v_object;
 
___
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: r347578 - head/sys/net

2019-05-14 Thread Kyle Evans
Author: kevans
Date: Tue May 14 20:32:29 2019
New Revision: 347578
URL: https://svnweb.freebsd.org/changeset/base/347578

Log:
  tuntap: Defer clearing if_softc until after if_detach
  
  r346670 added an sx to close a race between the ifioctl handler and
  interface destruction. Unfortunately, it clears if_softc immediately after
  the interface is closed, but before if_detach has been invoked.
  
  Any time before detachment, an interface that's part of a bridge may still
  receive traffic that's pushed through tunstart/tunstart_l2 and promptly
  lead to a panic because if_softc is now NULL.
  
  Fix it by deferring the clearing of if_softc until after the interface has
  detached and thus been removed from the bridge. if_softc still gets cleared
  in case another thread has already entered the ioctl handler before it's
  replaced with ifdead_ioctl.
  
  Reported by:  markj
  MFC after:3 days

Modified:
  head/sys/net/if_tuntap.c

Modified: head/sys/net/if_tuntap.c
==
--- head/sys/net/if_tuntap.cTue May 14 20:31:06 2019(r347577)
+++ head/sys/net/if_tuntap.cTue May 14 20:32:29 2019(r347578)
@@ -537,9 +537,6 @@ tun_destroy(struct tuntap_softc *tp)
TUN_UNLOCK(tp);
 
CURVNET_SET(TUN2IFP(tp)->if_vnet);
-   sx_xlock(&tun_ioctl_sx);
-   TUN2IFP(tp)->if_softc = NULL;
-   sx_xunlock(&tun_ioctl_sx);
 
destroy_dev(tp->tun_dev);
seldrain(&tp->tun_rsel);
@@ -551,6 +548,9 @@ tun_destroy(struct tuntap_softc *tp)
bpfdetach(TUN2IFP(tp));
if_detach(TUN2IFP(tp));
}
+   sx_xlock(&tun_ioctl_sx);
+   TUN2IFP(tp)->if_softc = NULL;
+   sx_xunlock(&tun_ioctl_sx);
free_unr(tp->tun_drv->unrhdr, TUN2IFP(tp)->if_dunit);
if_free(TUN2IFP(tp));
mtx_destroy(&tp->tun_mtx);
___
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: r347576 - stable/12/sys/kern

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 20:29:12 2019
New Revision: 347576
URL: https://svnweb.freebsd.org/changeset/base/347576

Log:
  MFC r346053:
  
  Factor out section loading into a separate function.
  
  Sponsored by: DARPA, AFRL

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Tue May 14 20:27:45 2019
(r347575)
+++ stable/12/sys/kern/imgact_elf.c Tue May 14 20:29:12 2019
(r347576)
@@ -650,6 +650,45 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
return (0);
 }
 
+static int
+__elfN(load_sections)(struct image_params *imgp, const Elf_Ehdr *hdr,
+const Elf_Phdr *phdr, u_long rbase, u_long *base_addrp)
+{
+   vm_prot_t prot;
+   u_long base_addr;
+   bool first;
+   int error, i;
+
+   base_addr = 0;
+   first = true;
+
+   for (i = 0; i < hdr->e_phnum; i++) {
+   if (phdr[i].p_type != PT_LOAD || phdr[i].p_memsz == 0)
+   continue;
+
+   /* Loadable segment */
+   prot = __elfN(trans_prot)(phdr[i].p_flags);
+   error = __elfN(load_section)(imgp, phdr[i].p_offset,
+   (caddr_t)(uintptr_t)phdr[i].p_vaddr + rbase,
+   phdr[i].p_memsz, phdr[i].p_filesz, prot);
+   if (error != 0)
+   return (error);
+
+   /*
+* Establish the base address if this is the first segment.
+*/
+   if (first) {
+   base_addr = trunc_page(phdr[i].p_vaddr + rbase);
+   first = false;
+   }
+   }
+
+   if (base_addrp != NULL)
+   *base_addrp = base_addr;
+
+   return (0);
+}
+
 /*
  * Load the file "file" into memory.  It may be either a shared object
  * or an executable.
@@ -676,10 +715,9 @@ __elfN(load_file)(struct proc *p, const char *file, u_
struct nameidata *nd;
struct vattr *attr;
struct image_params *imgp;
-   vm_prot_t prot;
u_long rbase;
u_long base_addr = 0;
-   int error, i, numsegs;
+   int error;
 
 #ifdef CAPABILITY_MODE
/*
@@ -757,25 +795,10 @@ __elfN(load_file)(struct proc *p, const char *file, u_
goto fail;
}
 
-   for (i = 0, numsegs = 0; i < hdr->e_phnum; i++) {
-   if (phdr[i].p_type == PT_LOAD && phdr[i].p_memsz != 0) {
-   /* Loadable segment */
-   prot = __elfN(trans_prot)(phdr[i].p_flags);
-   error = __elfN(load_section)(imgp, phdr[i].p_offset,
-   (caddr_t)(uintptr_t)phdr[i].p_vaddr + rbase,
-   phdr[i].p_memsz, phdr[i].p_filesz, prot);
-   if (error != 0)
-   goto fail;
-   /*
-* Establish the base address if this is the
-* first segment.
-*/
-   if (numsegs == 0)
-   base_addr = trunc_page(phdr[i].p_vaddr +
-   rbase);
-   numsegs++;
-   }
-   }
+   error = __elfN(load_sections)(imgp, hdr, phdr, rbase, &base_addr);
+   if (error != 0)
+   goto fail;
+
*addr = base_addr;
*entry = (unsigned long)hdr->e_entry + rbase;
 
@@ -999,7 +1022,6 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
char *interp;
Elf_Brandinfo *brand_info;
struct sysentvec *sv;
-   vm_prot_t prot;
u_long addr, baddr, et_dyn_addr, entry, proghdr;
u_long maxalign, mapsz, maxv, maxv1;
uint32_t fctl0;
@@ -1056,6 +1078,17 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
maxalign = phdr[i].p_align;
mapsz += phdr[i].p_memsz;
n++;
+
+   /*
+* If this segment contains the program headers,
+* remember their virtual address for the AT_PHDR
+* aux entry. Static binaries don't usually include
+* a PT_PHDR entry.
+*/
+   if (phdr[i].p_offset == 0 &&
+   hdr->e_phoff + hdr->e_phnum * hdr->e_phentsize
+   <= phdr[i].p_filesz)
+   proghdr = phdr[i].p_vaddr + hdr->e_phoff;
break;
case PT_INTERP:
/* Path to interpreter */
@@ -1075,6 +1108,9 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
__elfN(trans_prot)(phdr[i].p_flags);
 

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

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 20:31:06 2019
New Revision: 347577
URL: https://svnweb.freebsd.org/changeset/base/347577

Log:
  MFC r346076:
  
  Improve vnode lock assertions.
  
  Sponsored by: DARPA, AFRL

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Tue May 14 20:29:12 2019
(r347576)
+++ stable/12/sys/kern/imgact_elf.c Tue May 14 20:31:06 2019
(r347577)
@@ -659,6 +659,8 @@ __elfN(load_sections)(struct image_params *imgp, const
bool first;
int error, i;
 
+   ASSERT_VOP_LOCKED(imgp->vp, __func__);
+
base_addr = 0;
first = true;
 
@@ -925,8 +927,7 @@ __elfN(get_interp)(struct image_params *imgp, const El
 
KASSERT(phdr->p_type == PT_INTERP,
("%s: p_type %u != PT_INTERP", __func__, phdr->p_type));
-   KASSERT(VOP_ISLOCKED(imgp->vp),
-   ("%s: vp %p is not locked", __func__, imgp->vp));
+   ASSERT_VOP_LOCKED(imgp->vp, __func__);
 
td = curthread;
 
___
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: r347575 - stable/12/sys/kern

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 20:27:45 2019
New Revision: 347575
URL: https://svnweb.freebsd.org/changeset/base/347575

Log:
  MFC r346030:
  
  Refactor ELF interpreter loading into a separate function.
  
  Sponsored by: DARPA, AFRL

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Tue May 14 20:26:05 2019
(r347574)
+++ stable/12/sys/kern/imgact_elf.c Tue May 14 20:27:45 2019
(r347575)
@@ -946,6 +946,41 @@ __elfN(get_interp)(struct image_params *imgp, const El
return (0);
 }
 
+static int
+__elfN(load_interp)(struct image_params *imgp, const Elf_Brandinfo *brand_info,
+const char *interp, u_long *addr, u_long *entry)
+{
+   char *path;
+   int error;
+
+   if (brand_info->emul_path != NULL &&
+   brand_info->emul_path[0] != '\0') {
+   path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
+   snprintf(path, MAXPATHLEN, "%s%s",
+   brand_info->emul_path, interp);
+   error = __elfN(load_file)(imgp->proc, path, addr, entry);
+   free(path, M_TEMP);
+   if (error == 0)
+   return (0);
+   }
+
+   if (brand_info->interp_newpath != NULL &&
+   (brand_info->interp_path == NULL ||
+   strcmp(interp, brand_info->interp_path) == 0)) {
+   error = __elfN(load_file)(imgp->proc,
+   brand_info->interp_newpath, addr, entry);
+   if (error == 0)
+   return (0);
+   }
+
+   error = __elfN(load_file)(imgp->proc, interp, addr, entry);
+   if (error == 0)
+   return (0);
+
+   uprintf("ELF interpreter %s not found, error %d\n", interp, error);
+   return (error);
+}
+
 /*
  * Impossible et_dyn_addr initial value indicating that the real base
  * must be calculated later with some randomization applied.
@@ -961,8 +996,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
Elf_Auxargs *elf_auxargs;
struct vmspace *vmspace;
vm_map_t map;
-   const char *newinterp;
-   char *interp, *path;
+   char *interp;
Elf_Brandinfo *brand_info;
struct sysentvec *sv;
vm_prot_t prot;
@@ -971,7 +1005,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
uint32_t fctl0;
int32_t osrel;
bool free_interp;
-   int error, i, n, have_interp;
+   int error, i, n;
 
hdr = (const Elf_Ehdr *)imgp->image_header;
 
@@ -1007,7 +1041,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
osrel = 0;
fctl0 = 0;
entry = proghdr = 0;
-   newinterp = interp = NULL;
+   interp = NULL;
free_interp = false;
td = curthread;
maxalign = PAGE_SIZE;
@@ -1075,8 +1109,6 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
et_dyn_addr = ET_DYN_LOAD_ADDR;
}
}
-   if (interp != NULL && brand_info->interp_newpath != NULL)
-   newinterp = brand_info->interp_newpath;
 
/*
 * Avoid a possible deadlock if the current address space is destroyed
@@ -1201,7 +1233,6 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
imgp->entry_addr = entry;
 
if (interp != NULL) {
-   have_interp = FALSE;
VOP_UNLOCK(imgp->vp, 0);
if ((map->flags & MAP_ASLR) != 0) {
/* Assume that interpeter fits into 1/4 of AS */
@@ -1210,35 +1241,11 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
addr = __CONCAT(rnd_, __elfN(base))(map, addr,
maxv1, PAGE_SIZE);
}
-   if (brand_info->emul_path != NULL &&
-   brand_info->emul_path[0] != '\0') {
-   path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
-   snprintf(path, MAXPATHLEN, "%s%s",
-   brand_info->emul_path, interp);
-   error = __elfN(load_file)(imgp->proc, path, &addr,
-   &imgp->entry_addr);
-   free(path, M_TEMP);
-   if (error == 0)
-   have_interp = TRUE;
-   }
-   if (!have_interp && newinterp != NULL &&
-   (brand_info->interp_path == NULL ||
-   strcmp(interp, brand_info->interp_path) == 0)) {
-   error = __elfN(load_file)(imgp->proc, newinterp, &addr,
-   &imgp->entry_addr);
-   if (error == 0)
-   have_interp = TRUE;
-   }
-   if (!have_interp) {
-   error = __elfN(load_file)(imgp->p

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

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 20:26:05 2019
New Revision: 347574
URL: https://svnweb.freebsd.org/changeset/base/347574

Log:
  MFC r345661:
  
  Factor out retrieving the interpreter path from the main ELF
  loader routine.
  
  MFC r345734 by kib:
  
  Fix branding after r345661.
  
  In particular, elf32 FreeBSD binaries were not executed on LP64 hosts.
  The interp_name_len value should account for the nul terminator.  This
  is needed for strncmp()s in brand checking code to work.
  
  Sponsored by: DARPA, AFRL

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Tue May 14 20:19:29 2019
(r347573)
+++ stable/12/sys/kern/imgact_elf.c Tue May 14 20:26:05 2019
(r347574)
@@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$");
 
 static int __elfN(check_header)(const Elf_Ehdr *hdr);
 static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp,
-const char *interp, int interp_name_len, int32_t *osrel, uint32_t *fctl0);
+const char *interp, int32_t *osrel, uint32_t *fctl0);
 static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr,
 u_long *entry);
 static int __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset,
@@ -273,13 +273,15 @@ __elfN(brand_inuse)(Elf_Brandinfo *entry)
 
 static Elf_Brandinfo *
 __elfN(get_brandinfo)(struct image_params *imgp, const char *interp,
-int interp_name_len, int32_t *osrel, uint32_t *fctl0)
+int32_t *osrel, uint32_t *fctl0)
 {
const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header;
Elf_Brandinfo *bi, *bi_m;
boolean_t ret;
-   int i;
+   int i, interp_name_len;
 
+   interp_name_len = interp != NULL ? strlen(interp) + 1 : 0;
+
/*
 * We support four types of branding -- (1) the ELF EI_OSABI field
 * that SCO added to the ELF spec, (2) FreeBSD 3.x's traditional string
@@ -890,6 +892,60 @@ __elfN(enforce_limits)(struct image_params *imgp, cons
return (0);
 }
 
+static int
+__elfN(get_interp)(struct image_params *imgp, const Elf_Phdr *phdr,
+char **interpp, bool *free_interpp)
+{
+   struct thread *td;
+   char *interp;
+   int error, interp_name_len;
+
+   KASSERT(phdr->p_type == PT_INTERP,
+   ("%s: p_type %u != PT_INTERP", __func__, phdr->p_type));
+   KASSERT(VOP_ISLOCKED(imgp->vp),
+   ("%s: vp %p is not locked", __func__, imgp->vp));
+
+   td = curthread;
+
+   /* Path to interpreter */
+   if (phdr->p_filesz < 2 || phdr->p_filesz > MAXPATHLEN) {
+   uprintf("Invalid PT_INTERP\n");
+   return (ENOEXEC);
+   }
+
+   interp_name_len = phdr->p_filesz;
+   if (phdr->p_offset > PAGE_SIZE ||
+   interp_name_len > PAGE_SIZE - phdr->p_offset) {
+   VOP_UNLOCK(imgp->vp, 0);
+   interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK);
+   vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+   error = vn_rdwr(UIO_READ, imgp->vp, interp,
+   interp_name_len, phdr->p_offset,
+   UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred,
+   NOCRED, NULL, td);
+   if (error != 0) {
+   free(interp, M_TEMP);
+   uprintf("i/o error PT_INTERP %d\n", error);
+   return (error);
+   }
+   interp[interp_name_len] = '\0';
+
+   *interpp = interp;
+   *free_interpp = true;
+   return (0);
+   }
+
+   interp = __DECONST(char *, imgp->image_header) + phdr->p_offset;
+   if (interp[interp_name_len - 1] != '\0') {
+   uprintf("Invalid PT_INTERP\n");
+   return (ENOEXEC);
+   }
+
+   *interpp = interp;
+   *free_interpp = false;
+   return (0);
+}
+
 /*
  * Impossible et_dyn_addr initial value indicating that the real base
  * must be calculated later with some randomization applied.
@@ -906,7 +962,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
struct vmspace *vmspace;
vm_map_t map;
const char *newinterp;
-   char *interp, *interp_buf, *path;
+   char *interp, *path;
Elf_Brandinfo *brand_info;
struct sysentvec *sv;
vm_prot_t prot;
@@ -914,7 +970,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
u_long maxalign, mapsz, maxv, maxv1;
uint32_t fctl0;
int32_t osrel;
-   int error, i, n, interp_name_len, have_interp;
+   bool free_interp;
+   int error, i, n, have_interp;
 
hdr = (const Elf_Ehdr *)imgp->image_header;
 
@@ -950,9 +1007,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
osrel = 0;
fctl0 = 0;
entry = proghdr = 0;
-   interp_name_len = 0;
-   new

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

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 20:19:29 2019
New Revision: 347573
URL: https://svnweb.freebsd.org/changeset/base/347573

Log:
  MFC r345547:
  
  Factor out resource limit enforcement code in the ELF loader.
  It makes the code slightly easier to follow, and might make
  it easier to fix the resouce accounting to also account for
  the interpreter.
  
  The PROC_UNLOCK() is moved earlier - I don't see anything
  it should protect; the lim_max() is a wrapper around lim_rlimit(),
  and that, differently from lim_rlimit_proc(), doesn't require
  the proc lock to be held.
  
  Sponsored by: DARPA, AFRL

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Tue May 14 20:03:19 2019
(r347572)
+++ stable/12/sys/kern/imgact_elf.c Tue May 14 20:19:29 2019
(r347573)
@@ -813,6 +813,83 @@ __CONCAT(rnd_, __elfN(base))(vm_map_t map __unused, u_
return (res);
 }
 
+static int
+__elfN(enforce_limits)(struct image_params *imgp, const Elf_Ehdr *hdr,
+const Elf_Phdr *phdr, u_long et_dyn_addr)
+{
+   struct vmspace *vmspace;
+   const char *err_str;
+   u_long text_size, data_size, total_size, text_addr, data_addr;
+   u_long seg_size, seg_addr;
+   int i;
+
+   err_str = NULL;
+   text_size = data_size = total_size = text_addr = data_addr = 0;
+
+   for (i = 0; i < hdr->e_phnum; i++) {
+   if (phdr[i].p_type != PT_LOAD || phdr[i].p_memsz == 0)
+   continue;
+
+   seg_addr = trunc_page(phdr[i].p_vaddr + et_dyn_addr);
+   seg_size = round_page(phdr[i].p_memsz +
+   phdr[i].p_vaddr + et_dyn_addr - seg_addr);
+
+   /*
+* Make the largest executable segment the official
+* text segment and all others data.
+*
+* Note that obreak() assumes that data_addr + data_size == end
+* of data load area, and the ELF file format expects segments
+* to be sorted by address.  If multiple data segments exist,
+* the last one will be used.
+*/
+
+   if ((phdr[i].p_flags & PF_X) != 0 && text_size < seg_size) {
+   text_size = seg_size;
+   text_addr = seg_addr;
+   } else {
+   data_size = seg_size;
+   data_addr = seg_addr;
+   }
+   total_size += seg_size;
+   }
+   
+   if (data_addr == 0 && data_size == 0) {
+   data_addr = text_addr;
+   data_size = text_size;
+   }
+
+   /*
+* Check limits.  It should be safe to check the
+* limits after loading the segments since we do
+* not actually fault in all the segments pages.
+*/
+   PROC_LOCK(imgp->proc);
+   if (data_size > lim_cur_proc(imgp->proc, RLIMIT_DATA))
+   err_str = "Data segment size exceeds process limit";
+   else if (text_size > maxtsiz)
+   err_str = "Text segment size exceeds system limit";
+   else if (total_size > lim_cur_proc(imgp->proc, RLIMIT_VMEM))
+   err_str = "Total segment size exceeds process limit";
+   else if (racct_set(imgp->proc, RACCT_DATA, data_size) != 0)
+   err_str = "Data segment size exceeds resource limit";
+   else if (racct_set(imgp->proc, RACCT_VMEM, total_size) != 0)
+   err_str = "Total segment size exceeds resource limit";
+   PROC_UNLOCK(imgp->proc);
+   if (err_str != NULL) {
+   uprintf("%s\n", err_str);
+   return (ENOMEM);
+   }
+
+   vmspace = imgp->proc->p_vmspace;
+   vmspace->vm_tsize = text_size >> PAGE_SHIFT;
+   vmspace->vm_taddr = (caddr_t)(uintptr_t)text_addr;
+   vmspace->vm_dsize = data_size >> PAGE_SHIFT;
+   vmspace->vm_daddr = (caddr_t)(uintptr_t)data_addr;
+
+   return (0);
+}
+
 /*
  * Impossible et_dyn_addr initial value indicating that the real base
  * must be calculated later with some randomization applied.
@@ -828,13 +905,12 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
Elf_Auxargs *elf_auxargs;
struct vmspace *vmspace;
vm_map_t map;
-   const char *err_str, *newinterp;
+   const char *newinterp;
char *interp, *interp_buf, *path;
Elf_Brandinfo *brand_info;
struct sysentvec *sv;
vm_prot_t prot;
-   u_long text_size, data_size, total_size, text_addr, data_addr;
-   u_long seg_size, seg_addr, addr, baddr, et_dyn_addr, entry, proghdr;
+   u_long addr, baddr, et_dyn_addr, entry, proghdr;
u_long maxalign, mapsz, maxv, maxv1;
uint32_t fctl0;
int32_t osrel;
@@ -873,10 +949,9 @@ __CONCAT(exec_, __elfN(imgact))(

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

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 20:03:19 2019
New Revision: 347572
URL: https://svnweb.freebsd.org/changeset/base/347572

Log:
  MFC r345448:
  
  Remove trunc_page_ps() and round_page_ps() macros.  This completes
  the undoing of r100384.
  
  Sponsored by: DARPA, AFRL

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Tue May 14 19:52:18 2019
(r347571)
+++ stable/12/sys/kern/imgact_elf.c Tue May 14 20:03:19 2019
(r347572)
@@ -159,9 +159,7 @@ SYSCTL_INT(ASLR_NODE_OID, OID_AUTO, honor_sbrk, CTLFLA
 
 static Elf_Brandinfo *elf_brand_list[MAX_BRANDS];
 
-#definetrunc_page_ps(va, ps)   rounddown2(va, ps)
-#defineround_page_ps(va, ps)   roundup2(va, ps)
-#definealigned(a, t)   (trunc_page_ps((u_long)(a), sizeof(t)) == 
(u_long)(a))
+#definealigned(a, t)   (rounddown2((u_long)(a), sizeof(t)) == 
(u_long)(a))
 
 static const char FREEBSD_ABI_VENDOR[] = "FreeBSD";
 
@@ -569,8 +567,8 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
 
object = imgp->object;
map = &imgp->proc->p_vmspace->vm_map;
-   map_addr = trunc_page_ps((vm_offset_t)vmaddr, PAGE_SIZE);
-   file_addr = trunc_page_ps(offset, PAGE_SIZE);
+   map_addr = trunc_page((vm_offset_t)vmaddr);
+   file_addr = trunc_page(offset);
 
/*
 * We have two choices.  We can either clear the data in the last page
@@ -581,9 +579,9 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
if (filsz == 0)
map_len = 0;
else if (memsz > filsz)
-   map_len = trunc_page_ps(offset + filsz, PAGE_SIZE) - file_addr;
+   map_len = trunc_page(offset + filsz) - file_addr;
else
-   map_len = round_page_ps(offset + filsz, PAGE_SIZE) - file_addr;
+   map_len = round_page(offset + filsz) - file_addr;
 
if (map_len != 0) {
/* cow flags: don't dump readonly sections in core */
@@ -612,11 +610,10 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
 * segment in the file is extended to provide bss.  It's a neat idea
 * to try and save a page, but it's a pain in the behind to implement.
 */
-   copy_len = filsz == 0 ? 0 : (offset + filsz) - trunc_page_ps(offset +
-   filsz, PAGE_SIZE);
-   map_addr = trunc_page_ps((vm_offset_t)vmaddr + filsz, PAGE_SIZE);
-   map_len = round_page_ps((vm_offset_t)vmaddr + memsz, PAGE_SIZE) -
-   map_addr;
+   copy_len = filsz == 0 ? 0 : (offset + filsz) - trunc_page(offset +
+   filsz);
+   map_addr = trunc_page((vm_offset_t)vmaddr + filsz);
+   map_len = round_page((vm_offset_t)vmaddr + memsz) - map_addr;
 
/* This had damn well better be true! */
if (map_len != 0) {
@@ -632,8 +629,7 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
return (EIO);
 
/* send the page fragment to user space */
-   off = trunc_page_ps(offset + filsz, PAGE_SIZE) -
-   trunc_page(offset + filsz);
+   off = trunc_page(offset + filsz) - trunc_page(offset + filsz);
error = copyout((caddr_t)sf_buf_kva(sf) + off,
(caddr_t)map_addr, copy_len);
vm_imgact_unmap_page(sf);
___
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: r347571 - in stable/12/sys: amd64/amd64 amd64/cloudabi32 amd64/cloudabi64 amd64/linux amd64/linux32 arm/arm arm/cloudabi32 arm64/arm64 arm64/cloudabi32 arm64/cloudabi64 arm64/linux comp...

2019-05-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 14 19:52:18 2019
New Revision: 347571
URL: https://svnweb.freebsd.org/changeset/base/347571

Log:
  MFC r344705:
  
  Remove sv_pagesize, originally introduced with r100384.
  
  In all of the architectures we have today, we always use PAGE_SIZE.
  While in theory one could define different things, none of the
  current architectures do, even the ones that have transitioned from
  32-bit to 64-bit like i386 and arm. Some ancient mips binaries on
  other systems used 8k instead of 4k, but we don't support running
  those and likely never will due to their age and obscurity.
  
  Differently from the original commit, the merge leaves the struct
  member in place to preserve the ABI.
  
  Sponsored by: DARPA, AFRL

Modified:
  stable/12/sys/amd64/amd64/elf_machdep.c
  stable/12/sys/amd64/cloudabi32/cloudabi32_sysvec.c
  stable/12/sys/amd64/cloudabi64/cloudabi64_sysvec.c
  stable/12/sys/amd64/linux/linux_sysvec.c
  stable/12/sys/amd64/linux32/linux32_sysvec.c
  stable/12/sys/arm/arm/elf_machdep.c
  stable/12/sys/arm/cloudabi32/cloudabi32_sysvec.c
  stable/12/sys/arm64/arm64/elf_machdep.c
  stable/12/sys/arm64/cloudabi32/cloudabi32_sysvec.c
  stable/12/sys/arm64/cloudabi64/cloudabi64_sysvec.c
  stable/12/sys/arm64/linux/linux_sysvec.c
  stable/12/sys/compat/ia32/ia32_sysvec.c
  stable/12/sys/i386/cloudabi32/cloudabi32_sysvec.c
  stable/12/sys/i386/i386/elf_machdep.c
  stable/12/sys/i386/linux/linux_sysvec.c
  stable/12/sys/kern/imgact_aout.c
  stable/12/sys/kern/imgact_elf.c
  stable/12/sys/kern/init_main.c
  stable/12/sys/mips/mips/elf_machdep.c
  stable/12/sys/mips/mips/freebsd32_machdep.c
  stable/12/sys/powerpc/powerpc/elf32_machdep.c
  stable/12/sys/powerpc/powerpc/elf64_machdep.c
  stable/12/sys/riscv/riscv/elf_machdep.c
  stable/12/sys/sparc64/sparc64/elf_machdep.c
  stable/12/sys/sys/sysent.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/elf_machdep.c
==
--- stable/12/sys/amd64/amd64/elf_machdep.c Tue May 14 18:26:39 2019
(r347570)
+++ stable/12/sys/amd64/amd64/elf_machdep.c Tue May 14 19:52:18 2019
(r347571)
@@ -64,7 +64,6 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_coredump= __elfN(coredump),
.sv_imgact_try  = NULL,
.sv_minsigstksz = MINSIGSTKSZ,
-   .sv_pagesize= PAGE_SIZE,
.sv_minuser = VM_MIN_ADDRESS,
.sv_maxuser = VM_MAXUSER_ADDRESS,
.sv_usrstack= USRSTACK,

Modified: stable/12/sys/amd64/cloudabi32/cloudabi32_sysvec.c
==
--- stable/12/sys/amd64/cloudabi32/cloudabi32_sysvec.c  Tue May 14 18:26:39 
2019(r347570)
+++ stable/12/sys/amd64/cloudabi32/cloudabi32_sysvec.c  Tue May 14 19:52:18 
2019(r347571)
@@ -210,7 +210,6 @@ static struct sysentvec cloudabi32_elf_sysvec = {
.sv_fixup   = cloudabi32_fixup_tcb,
.sv_name= "CloudABI ELF32",
.sv_coredump= elf32_coredump,
-   .sv_pagesize= IA32_PAGE_SIZE,
.sv_minuser = FREEBSD32_MINUSER,
.sv_maxuser = FREEBSD32_MAXUSER,
.sv_stackprot   = VM_PROT_READ | VM_PROT_WRITE,

Modified: stable/12/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==
--- stable/12/sys/amd64/cloudabi64/cloudabi64_sysvec.c  Tue May 14 18:26:39 
2019(r347570)
+++ stable/12/sys/amd64/cloudabi64/cloudabi64_sysvec.c  Tue May 14 19:52:18 
2019(r347571)
@@ -197,7 +197,6 @@ static struct sysentvec cloudabi64_elf_sysvec = {
.sv_fixup   = cloudabi64_fixup_tcb,
.sv_name= "CloudABI ELF64",
.sv_coredump= elf64_coredump,
-   .sv_pagesize= PAGE_SIZE,
.sv_minuser = VM_MIN_ADDRESS,
/* Keep top page reserved to work around AMD Ryzen stability issues. */
.sv_maxuser = VM_MAXUSER_ADDRESS - PAGE_SIZE,

Modified: stable/12/sys/amd64/linux/linux_sysvec.c
==
--- stable/12/sys/amd64/linux/linux_sysvec.cTue May 14 18:26:39 2019
(r347570)
+++ stable/12/sys/amd64/linux/linux_sysvec.cTue May 14 19:52:18 2019
(r347571)
@@ -723,7 +723,6 @@ struct sysentvec elf_linux_sysvec = {
.sv_coredump= elf64_coredump,
.sv_imgact_try  = linux_exec_imgact_try,
.sv_minsigstksz = LINUX_MINSIGSTKSZ,
-   .sv_pagesize= PAGE_SIZE,
.sv_minuser = VM_MIN_ADDRESS,
.sv_maxuser = VM_MAXUSER_ADDRESS,
.sv_usrstack= USRSTACK,

Modified: stable/12/sys/amd64/linux32/linux32_sysvec.c
==
--- stable/12/sys/amd64/linux32/linux32_sysve

svn commit: r347570 - head/sys/conf

2019-05-14 Thread Mark Johnston
Author: markj
Date: Tue May 14 18:26:39 2019
New Revision: 347570
URL: https://svnweb.freebsd.org/changeset/base/347570

Log:
  Specify -z notext when building with -z ifunc-noplt.
  
  The upstream implementation of -z ifunc-noplt disallows its combination
  with -z text.  The option does not have much significance for kernel
  builds, though.
  
  Reviewed by:  kib (previous version)
  Discussed with:   emaste
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20260

Modified:
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Tue May 14 18:10:32 2019(r347569)
+++ head/sys/conf/kern.pre.mk   Tue May 14 18:26:39 2019(r347570)
@@ -157,7 +157,7 @@ LDFLAGS+=   -z max-page-size=2097152
 .if ${LINKER_TYPE} != "lld"
 LDFLAGS+=  -z common-page-size=4096
 .else
-LDFLAGS+=  -z ifunc-noplt
+LDFLAGS+=  -z notext -z ifunc-noplt
 .endif
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r347569 - head/sys/conf

2019-05-14 Thread Mark Johnston
Author: markj
Date: Tue May 14 18:10:32 2019
New Revision: 347569
URL: https://svnweb.freebsd.org/changeset/base/347569

Log:
  Remove redundant -Wl uses from the kernel's LDFLAGS.
  
  No functional change intended.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Tue May 14 17:05:02 2019(r347568)
+++ head/sys/conf/kern.pre.mk   Tue May 14 18:10:32 2019(r347569)
@@ -144,7 +144,7 @@ CFLAGS+=${GCOV_CFLAGS}
 CFLAGS+=   ${CONF_CFLAGS}
 
 .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id}
-LDFLAGS+=  -Wl,--build-id=sha1
+LDFLAGS+=  --build-id=sha1
 .endif
 
 .if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
@@ -153,11 +153,11 @@ LDFLAGS+= -Wl,--build-id=sha1
 .error amd64/arm64/i386 kernel requires linker ifunc support
 .endif
 .if ${MACHINE_CPUARCH} == "amd64"
-LDFLAGS+=  -Wl,-z max-page-size=2097152
+LDFLAGS+=  -z max-page-size=2097152
 .if ${LINKER_TYPE} != "lld"
-LDFLAGS+=  -Wl,-z common-page-size=4096
+LDFLAGS+=  -z common-page-size=4096
 .else
-LDFLAGS+=  -Wl,-z -Wl,ifunc-noplt
+LDFLAGS+=  -z ifunc-noplt
 .endif
 .endif
 

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue May 14 17:05:02 2019(r347568)
+++ head/sys/conf/kmod.mk   Tue May 14 18:10:32 2019(r347569)
@@ -138,7 +138,7 @@ CFLAGS+=-fno-common
 LDFLAGS+=  -d -warn-common
 
 .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id}
-LDFLAGS+=  -Wl,--build-id=sha1
+LDFLAGS+=  --build-id=sha1
 .endif
 
 CFLAGS+=   ${DEBUG_FLAGS}
___
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: r347568 - in stable/11/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-14 Thread Konstantin Belousov
Author: kib
Date: Tue May 14 17:05:02 2019
New Revision: 347568
URL: https://svnweb.freebsd.org/changeset/base/347568

Log:
  MFC r347566:
  Mitigations for Microarchitectural Data Sampling.
  
  Reference: 
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
  Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
  Security: FreeBSD-SA-19:07.mds
  Reviewed by:  jhb
  Tested by:emaste, lwhsu
  Approved by:  so (gtetlow)

Modified:
  stable/11/sys/amd64/amd64/exception.S
  stable/11/sys/amd64/amd64/genassym.c
  stable/11/sys/amd64/amd64/initcpu.c
  stable/11/sys/amd64/amd64/machdep.c
  stable/11/sys/amd64/amd64/support.S
  stable/11/sys/amd64/include/pcpu.h
  stable/11/sys/dev/cpuctl/cpuctl.c
  stable/11/sys/i386/i386/exception.s
  stable/11/sys/i386/i386/genassym.c
  stable/11/sys/i386/i386/initcpu.c
  stable/11/sys/i386/i386/support.s
  stable/11/sys/i386/include/pcpu.h
  stable/11/sys/x86/include/specialreg.h
  stable/11/sys/x86/include/x86_var.h
  stable/11/sys/x86/x86/cpu_machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/exception.S
==
--- stable/11/sys/amd64/amd64/exception.S   Tue May 14 17:04:00 2019
(r347567)
+++ stable/11/sys/amd64/amd64/exception.S   Tue May 14 17:05:02 2019
(r347568)
@@ -502,6 +502,7 @@ fast_syscall_common:
testl   $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax)
jne 3f
callhandle_ibrs_exit
+   callq   *mds_handler
/* Restore preserved registers. */
MEXITCOUNT
movqTF_RDI(%rsp),%rdi   /* bonus; preserve arg 1 */
@@ -1139,6 +1140,7 @@ ld_regs:
jz  2f  /* keep running with kernel GS.base */
cli
callhandle_ibrs_exit_rs
+   callq   *mds_handler
cmpq$~0,PCPU(UCR3)
je  1f
pushq   %rdx

Modified: stable/11/sys/amd64/amd64/genassym.c
==
--- stable/11/sys/amd64/amd64/genassym.cTue May 14 17:04:00 2019
(r347567)
+++ stable/11/sys/amd64/amd64/genassym.cTue May 14 17:05:02 2019
(r347568)
@@ -231,6 +231,9 @@ ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack
 ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ);
 ASSYM(PC_PTI_RSP0, offsetof(struct pcpu, pc_pti_rsp0));
 ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set));
+ASSYM(PC_MDS_TMP, offsetof(struct pcpu, pc_mds_tmp));
+ASSYM(PC_MDS_BUF, offsetof(struct pcpu, pc_mds_buf));
+ASSYM(PC_MDS_BUF64, offsetof(struct pcpu, pc_mds_buf64));
  
 ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL);
 ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL);

Modified: stable/11/sys/amd64/amd64/initcpu.c
==
--- stable/11/sys/amd64/amd64/initcpu.c Tue May 14 17:04:00 2019
(r347567)
+++ stable/11/sys/amd64/amd64/initcpu.c Tue May 14 17:05:02 2019
(r347568)
@@ -247,6 +247,7 @@ initializecpu(void)
}
hw_ibrs_recalculate();
hw_ssb_recalculate(false);
+   hw_mds_recalculate();
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
init_amd();

Modified: stable/11/sys/amd64/amd64/machdep.c
==
--- stable/11/sys/amd64/amd64/machdep.c Tue May 14 17:04:00 2019
(r347567)
+++ stable/11/sys/amd64/amd64/machdep.c Tue May 14 17:05:02 2019
(r347568)
@@ -1864,6 +1864,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable);
TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable);
+   TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable);
 
/* Location of kernel stack for locore */
return ((u_int64_t)thread0.td_pcb);

Modified: stable/11/sys/amd64/amd64/support.S
==
--- stable/11/sys/amd64/amd64/support.S Tue May 14 17:04:00 2019
(r347567)
+++ stable/11/sys/amd64/amd64/support.S Tue May 14 17:05:02 2019
(r347568)
@@ -1,8 +1,13 @@
 /*-
+ * Copyright (c) 2018-2019 The FreeBSD Foundation
  * Copyright (c) 2003 Peter Wemm.
  * Copyright (c) 1993 The Regents of the University of California.
  * All rights reserved.
  *
+ * Portions of this software were developed by
+ * Konstantin Belousov  under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -925,3 +930,239 @@ ENTRY(flush_l1d_sw)
ret
 #undef L1D_FLUSH_SIZE
 END(flush_l1d_sw)
+
+ENTRY(mds_handler_void)
+   retq
+END(mds_handler_void)
+
+ENTRY(mds_handler_verw)
+   subq$8, %rsp
+   movw 

svn commit: r347567 - in stable/12/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-14 Thread Konstantin Belousov
Author: kib
Date: Tue May 14 17:04:00 2019
New Revision: 347567
URL: https://svnweb.freebsd.org/changeset/base/347567

Log:
  MFC r347566:
  Mitigations for Microarchitectural Data Sampling.
  
  Reference: 
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
  Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
  Security: FreeBSD-SA-19:07.mds
  Reviewed by:  jhb
  Tested by:emaste, lwhsu
  Approved by:  so (gtetlow)

Modified:
  stable/12/sys/amd64/amd64/exception.S
  stable/12/sys/amd64/amd64/genassym.c
  stable/12/sys/amd64/amd64/initcpu.c
  stable/12/sys/amd64/amd64/machdep.c
  stable/12/sys/amd64/amd64/support.S
  stable/12/sys/amd64/include/pcpu.h
  stable/12/sys/dev/cpuctl/cpuctl.c
  stable/12/sys/i386/i386/exception.s
  stable/12/sys/i386/i386/genassym.c
  stable/12/sys/i386/i386/initcpu.c
  stable/12/sys/i386/i386/support.s
  stable/12/sys/i386/include/pcpu.h
  stable/12/sys/x86/include/specialreg.h
  stable/12/sys/x86/include/x86_var.h
  stable/12/sys/x86/x86/cpu_machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/exception.S
==
--- stable/12/sys/amd64/amd64/exception.S   Tue May 14 17:02:20 2019
(r347566)
+++ stable/12/sys/amd64/amd64/exception.S   Tue May 14 17:04:00 2019
(r347567)
@@ -512,6 +512,7 @@ fast_syscall_common:
testl   $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax)
jne 3f
callhandle_ibrs_exit
+   callq   *mds_handler
/* Restore preserved registers. */
MEXITCOUNT
movqTF_RDI(%rsp),%rdi   /* bonus; preserve arg 1 */
@@ -1157,6 +1158,7 @@ ld_regs:
jz  2f  /* keep running with kernel GS.base */
cli
callhandle_ibrs_exit_rs
+   callq   *mds_handler
cmpq$~0,PCPU(UCR3)
je  1f
pushq   %rdx

Modified: stable/12/sys/amd64/amd64/genassym.c
==
--- stable/12/sys/amd64/amd64/genassym.cTue May 14 17:02:20 2019
(r347566)
+++ stable/12/sys/amd64/amd64/genassym.cTue May 14 17:04:00 2019
(r347567)
@@ -233,6 +233,9 @@ ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack
 ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ);
 ASSYM(PC_PTI_RSP0, offsetof(struct pcpu, pc_pti_rsp0));
 ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set));
+ASSYM(PC_MDS_TMP, offsetof(struct pcpu, pc_mds_tmp));
+ASSYM(PC_MDS_BUF, offsetof(struct pcpu, pc_mds_buf));
+ASSYM(PC_MDS_BUF64, offsetof(struct pcpu, pc_mds_buf64));
  
 ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL);
 ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL);

Modified: stable/12/sys/amd64/amd64/initcpu.c
==
--- stable/12/sys/amd64/amd64/initcpu.c Tue May 14 17:02:20 2019
(r347566)
+++ stable/12/sys/amd64/amd64/initcpu.c Tue May 14 17:04:00 2019
(r347567)
@@ -257,6 +257,7 @@ initializecpu(void)
hw_ibrs_recalculate();
hw_ssb_recalculate(false);
amd64_syscall_ret_flush_l1d_recalc();
+   hw_mds_recalculate();
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
init_amd();

Modified: stable/12/sys/amd64/amd64/machdep.c
==
--- stable/12/sys/amd64/amd64/machdep.c Tue May 14 17:02:20 2019
(r347566)
+++ stable/12/sys/amd64/amd64/machdep.c Tue May 14 17:04:00 2019
(r347567)
@@ -1733,6 +1733,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable);
TUNABLE_INT_FETCH("machdep.syscall_ret_l1d_flush",
&syscall_ret_l1d_flush_mode);
+   TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable);
 
finishidentcpu();   /* Final stage of CPU initialization */
initializecpu();/* Initialize CPU registers */

Modified: stable/12/sys/amd64/amd64/support.S
==
--- stable/12/sys/amd64/amd64/support.S Tue May 14 17:02:20 2019
(r347566)
+++ stable/12/sys/amd64/amd64/support.S Tue May 14 17:04:00 2019
(r347567)
@@ -1,8 +1,13 @@
 /*-
+ * Copyright (c) 2018-2019 The FreeBSD Foundation
  * Copyright (c) 2003 Peter Wemm.
  * Copyright (c) 1993 The Regents of the University of California.
  * All rights reserved.
  *
+ * Portions of this software were developed by
+ * Konstantin Belousov  under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -1626,3 +1631,239 @@ ENTRY(flush_l1d_sw_abi)
popq%rbx
ret
 END(flush_l1d_sw_abi)
+
+ENTRY

svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-14 Thread Konstantin Belousov
Author: kib
Date: Tue May 14 17:02:20 2019
New Revision: 347566
URL: https://svnweb.freebsd.org/changeset/base/347566

Log:
  Mitigations for Microarchitectural Data Sampling.
  
  Microarchitectural buffers on some Intel processors utilizing
  speculative execution may allow a local process to obtain a memory
  disclosure.  An attacker may be able to read secret data from the
  kernel or from a process when executing untrusted code (for example,
  in a web browser).
  
  Reference: 
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
  Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
  Security: FreeBSD-SA-19:07.mds
  Reviewed by:  jhb
  Tested by:emaste, lwhsu
  Approved by:  so (gtetlow)

Modified:
  head/sys/amd64/amd64/exception.S
  head/sys/amd64/amd64/genassym.c
  head/sys/amd64/amd64/initcpu.c
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/support.S
  head/sys/amd64/include/pcpu.h
  head/sys/dev/cpuctl/cpuctl.c
  head/sys/i386/i386/exception.s
  head/sys/i386/i386/genassym.c
  head/sys/i386/i386/initcpu.c
  head/sys/i386/i386/support.s
  head/sys/i386/include/pcpu.h
  head/sys/x86/include/specialreg.h
  head/sys/x86/include/x86_var.h
  head/sys/x86/x86/cpu_machdep.c

Modified: head/sys/amd64/amd64/exception.S
==
--- head/sys/amd64/amd64/exception.STue May 14 15:41:34 2019
(r347565)
+++ head/sys/amd64/amd64/exception.STue May 14 17:02:20 2019
(r347566)
@@ -512,6 +512,7 @@ fast_syscall_common:
testl   $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax)
jne 3f
callhandle_ibrs_exit
+   callq   *mds_handler
/* Restore preserved registers. */
MEXITCOUNT
movqTF_RDI(%rsp),%rdi   /* bonus; preserve arg 1 */
@@ -1157,6 +1158,7 @@ ld_regs:
jz  2f  /* keep running with kernel GS.base */
cli
callhandle_ibrs_exit_rs
+   callq   *mds_handler
cmpq$~0,PCPU(UCR3)
je  1f
pushq   %rdx

Modified: head/sys/amd64/amd64/genassym.c
==
--- head/sys/amd64/amd64/genassym.c Tue May 14 15:41:34 2019
(r347565)
+++ head/sys/amd64/amd64/genassym.c Tue May 14 17:02:20 2019
(r347566)
@@ -233,6 +233,9 @@ ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack
 ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ);
 ASSYM(PC_PTI_RSP0, offsetof(struct pcpu, pc_pti_rsp0));
 ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set));
+ASSYM(PC_MDS_TMP, offsetof(struct pcpu, pc_mds_tmp));
+ASSYM(PC_MDS_BUF, offsetof(struct pcpu, pc_mds_buf));
+ASSYM(PC_MDS_BUF64, offsetof(struct pcpu, pc_mds_buf64));
  
 ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL);
 ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL);

Modified: head/sys/amd64/amd64/initcpu.c
==
--- head/sys/amd64/amd64/initcpu.c  Tue May 14 15:41:34 2019
(r347565)
+++ head/sys/amd64/amd64/initcpu.c  Tue May 14 17:02:20 2019
(r347566)
@@ -257,6 +257,7 @@ initializecpu(void)
hw_ibrs_recalculate();
hw_ssb_recalculate(false);
amd64_syscall_ret_flush_l1d_recalc();
+   hw_mds_recalculate();
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
init_amd();

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Tue May 14 15:41:34 2019
(r347565)
+++ head/sys/amd64/amd64/machdep.c  Tue May 14 17:02:20 2019
(r347566)
@@ -1732,6 +1732,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable);
TUNABLE_INT_FETCH("machdep.syscall_ret_l1d_flush",
&syscall_ret_l1d_flush_mode);
+   TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable);
 
finishidentcpu();   /* Final stage of CPU initialization */
initializecpu();/* Initialize CPU registers */

Modified: head/sys/amd64/amd64/support.S
==
--- head/sys/amd64/amd64/support.S  Tue May 14 15:41:34 2019
(r347565)
+++ head/sys/amd64/amd64/support.S  Tue May 14 17:02:20 2019
(r347566)
@@ -1,8 +1,13 @@
 /*-
+ * Copyright (c) 2018-2019 The FreeBSD Foundation
  * Copyright (c) 2003 Peter Wemm.
  * Copyright (c) 1993 The Regents of the University of California.
  * All rights reserved.
  *
+ * Portions of this software were developed by
+ * Konstantin Belousov  under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -1622,3 +1627

svn commit: r347565 - head/share/man/man4

2019-05-14 Thread Guangyuan Yang
Author: ygy (doc committer)
Date: Tue May 14 15:41:34 2019
New Revision: 347565
URL: https://svnweb.freebsd.org/changeset/base/347565

Log:
  Fix some spelling errors in ng_eiface(4).
  
  MFC after:3 days
  PR:   237764
  Submitted by: Tom Marcoen 

Modified:
  head/share/man/man4/ng_eiface.4

Modified: head/share/man/man4/ng_eiface.4
==
--- head/share/man/man4/ng_eiface.4 Tue May 14 15:19:48 2019
(r347564)
+++ head/share/man/man4/ng_eiface.4 Tue May 14 15:41:34 2019
(r347565)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 3, 2005
+.Dd May 14, 2019
 .Dt NG_EIFACE 4
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 The
 .Vt eiface
 netgraph node implements the generic Ethernet interface.
-When
+When an
 .Vt eiface
 node is created, a new interface appears which is accessible via
 .Xr ifconfig 8 .
@@ -78,7 +78,7 @@ which requires as an argument an
 string consisting of 6 colon-separated hex digits.
 .It Dv NGM_EIFACE_GET_IFNAME Pq Ic getifname
 Return the name of the associated interface as a
-.Dv NUL Ns -terminated
+.Dv NULL Ns -terminated
 .Tn ASCII
 string.
 .It Dv NGM_EIFACE_GET_IFADDRS
@@ -97,7 +97,7 @@ Unlike most other node types, an
 .Vt eiface
 node does
 .Em not
-go away when all hooks have been disconnected; rather, and explicit
+go away when all hooks have been disconnected; rather, an explicit
 .Dv NGM_SHUTDOWN
 control message is required.
 .Sh SEE ALSO
___
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: r347564 - head/sys/amd64/amd64

2019-05-14 Thread Mark Johnston
Author: markj
Date: Tue May 14 15:19:48 2019
New Revision: 347564
URL: https://svnweb.freebsd.org/changeset/base/347564

Log:
  Fix formatting.
  
  MFC after:3 days

Modified:
  head/sys/amd64/amd64/trap.c

Modified: head/sys/amd64/amd64/trap.c
==
--- head/sys/amd64/amd64/trap.c Tue May 14 10:21:28 2019(r347563)
+++ head/sys/amd64/amd64/trap.c Tue May 14 15:19:48 2019(r347564)
@@ -904,8 +904,8 @@ trap_fatal(frame, eva)
code & PGEX_U ? "user" : "supervisor",
code & PGEX_W ? "write" : "read",
code & PGEX_I ? "instruction" : "data",
-   code & PGEX_PK ? " prot key" : " ",
-   code & PGEX_SGX ? " SGX" : " ",
+   code & PGEX_PK ? " prot key" : "",
+   code & PGEX_SGX ? " SGX" : "",
code & PGEX_RSV ? "reserved bits in PTE" :
code & PGEX_P ? "protection violation" : "page not 
present");
}
___
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: r347563 - head/sys/kern

2019-05-14 Thread Andrey V. Elsukov
Author: ae
Date: Tue May 14 10:21:28 2019
New Revision: 347563
URL: https://svnweb.freebsd.org/changeset/base/347563

Log:
  Remove bpf interface lock, it is no longer exist.

Modified:
  head/sys/kern/subr_witness.c

Modified: head/sys/kern/subr_witness.c
==
--- head/sys/kern/subr_witness.cTue May 14 04:34:58 2019
(r347562)
+++ head/sys/kern/subr_witness.cTue May 14 10:21:28 2019
(r347563)
@@ -576,7 +576,6 @@ static struct witness_order_list_entry order_lists[] =
 * BPF
 */
{ "bpf global lock", &lock_class_sx },
-   { "bpf interface lock", &lock_class_rw },
{ "bpf cdev lock", &lock_class_mtx_sleep },
{ NULL, NULL },
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"