svn commit: r352203 - stable/11/sys/vm

2019-09-10 Thread Konstantin Belousov
Author: kib
Date: Wed Sep 11 04:59:27 2019
New Revision: 352203
URL: https://svnweb.freebsd.org/changeset/base/352203

Log:
  MFC r351830:
  madvise(MADV_FREE): Quick fix to time rewind.
  
  PR:   240061

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

Modified: stable/11/sys/vm/vm_map.c
==
--- stable/11/sys/vm/vm_map.c   Wed Sep 11 04:55:10 2019(r352202)
+++ stable/11/sys/vm/vm_map.c   Wed Sep 11 04:59:27 2019(r352203)
@@ -2279,6 +2279,18 @@ vm_map_madvise(
if (current->eflags & MAP_ENTRY_IS_SUB_MAP)
continue;
 
+   /*
+* MADV_FREE would otherwise rewind time to
+* the creation of the shadow object.  Because
+* we hold the VM map read-locked, neither the
+* entry's object nor the presence of a
+* backing object can change.
+*/
+   if (behav == MADV_FREE &&
+   current->object.vm_object != NULL &&
+   current->object.vm_object->backing_object != NULL)
+   continue;
+
pstart = OFF_TO_IDX(current->offset);
pend = pstart + atop(current->end - current->start);
useStart = current->start;
___
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: r352202 - stable/12/sys/vm

2019-09-10 Thread Konstantin Belousov
Author: kib
Date: Wed Sep 11 04:55:10 2019
New Revision: 352202
URL: https://svnweb.freebsd.org/changeset/base/352202

Log:
  MFC r351830:
  madvise(MADV_FREE): Quick fix to time rewind.
  
  PR:   240061

Modified:
  stable/12/sys/vm/vm_map.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_map.c
==
--- stable/12/sys/vm/vm_map.c   Wed Sep 11 03:25:30 2019(r352201)
+++ stable/12/sys/vm/vm_map.c   Wed Sep 11 04:55:10 2019(r352202)
@@ -2735,6 +2735,18 @@ vm_map_madvise(
if (current->eflags & MAP_ENTRY_IS_SUB_MAP)
continue;
 
+   /*
+* MADV_FREE would otherwise rewind time to
+* the creation of the shadow object.  Because
+* we hold the VM map read-locked, neither the
+* entry's object nor the presence of a
+* backing object can change.
+*/
+   if (behav == MADV_FREE &&
+   current->object.vm_object != NULL &&
+   current->object.vm_object->backing_object != NULL)
+   continue;
+
pstart = OFF_TO_IDX(current->offset);
pend = pstart + atop(current->end - current->start);
useStart = current->start;
___
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: r352201 - in head/sys/cam: . scsi

2019-09-10 Thread Alexander Motin
Author: mav
Date: Wed Sep 11 03:25:30 2019
New Revision: 352201
URL: https://svnweb.freebsd.org/changeset/base/352201

Log:
  Fix assumptions of only one device per SES slot.
  
  It is typical to have one, but no longer true for multi-actuator HDDs
  with separate LUN for each actuator.
  
  MFC after:4 days
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/cam/cam_periph.c
  head/sys/cam/scsi/scsi_enc_ses.c

Modified: head/sys/cam/cam_periph.c
==
--- head/sys/cam/cam_periph.c   Tue Sep 10 23:51:46 2019(r352200)
+++ head/sys/cam/cam_periph.c   Wed Sep 11 03:25:30 2019(r352201)
@@ -402,7 +402,9 @@ retry:
}
xpt_unlock_buses();
sbuf_finish(_sb);
-   sbuf_cpy(sb, sbuf_data(_sb));
+   if (sbuf_len(sb) != 0)
+   sbuf_cat(sb, ",");
+   sbuf_cat(sb, sbuf_data(_sb));
sbuf_delete(_sb);
return (count);
 }

Modified: head/sys/cam/scsi/scsi_enc_ses.c
==
--- head/sys/cam/scsi/scsi_enc_ses.cTue Sep 10 23:51:46 2019
(r352200)
+++ head/sys/cam/scsi/scsi_enc_ses.cWed Sep 11 03:25:30 2019
(r352201)
@@ -883,6 +883,7 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_ele
struct device_match_result  *device_match;
struct device_match_pattern *device_pattern;
ses_path_iter_args_t*args;
+   struct cam_path *path;
 
args = (ses_path_iter_args_t *)arg;
match_pattern.type = DEV_MATCH_DEVICE;
@@ -908,23 +909,26 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_ele
cdm.match_buf_len   = sizeof(match_result);
cdm.matches = _result;
 
-   xpt_action((union ccb *));
-   xpt_free_path(cdm.ccb_h.path);
+   do {
+   xpt_action((union ccb *));
 
-   if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP
-|| (cdm.status != CAM_DEV_MATCH_LAST
- && cdm.status != CAM_DEV_MATCH_MORE)
-|| cdm.num_matches == 0)
-   return;
+   if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP ||
+   (cdm.status != CAM_DEV_MATCH_LAST &&
+cdm.status != CAM_DEV_MATCH_MORE) ||
+   cdm.num_matches == 0)
+   break;
 
-   device_match = _result.result.device_result;
-   if (xpt_create_path(_h.path, /*periph*/NULL,
-device_match->path_id,
-device_match->target_id,
-device_match->target_lun) != CAM_REQ_CMP)
-   return;
+   device_match = _result.result.device_result;
+   if (xpt_create_path(, /*periph*/NULL,
+   device_match->path_id,
+   device_match->target_id,
+   device_match->target_lun) == CAM_REQ_CMP) {
 
-   args->callback(enc, elem, cdm.ccb_h.path, args->callback_arg);
+   args->callback(enc, elem, path, args->callback_arg);
+
+   xpt_free_path(path);
+   }
+   } while (cdm.status == CAM_DEV_MATCH_MORE);
 
xpt_free_path(cdm.ccb_h.path);
 }
___
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: r352200 - head/sbin/camcontrol

2019-09-10 Thread Alexander Motin
Author: mav
Date: Tue Sep 10 23:51:46 2019
New Revision: 352200
URL: https://svnweb.freebsd.org/changeset/base/352200

Log:
  Remove struct ata_res_pass16, unneeded after r352082.
  
  MFC after:4 days

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Tue Sep 10 22:44:09 2019
(r352199)
+++ head/sbin/camcontrol/camcontrol.c   Tue Sep 10 23:51:46 2019
(r352200)
@@ -153,22 +153,6 @@ struct camcontrol_opts {
const char  *subopt;
 };
 
-struct ata_res_pass16 {
-   u_int16_t reserved[5];
-   u_int8_t flags;
-   u_int8_t error;
-   u_int8_t sector_count_exp;
-   u_int8_t sector_count;
-   u_int8_t lba_low_exp;
-   u_int8_t lba_low;
-   u_int8_t lba_mid_exp;
-   u_int8_t lba_mid;
-   u_int8_t lba_high_exp;
-   u_int8_t lba_high;
-   u_int8_t device;
-   u_int8_t status;
-};
-
 struct ata_set_max_pwd
 {
u_int16_t reserved1;
___
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: r352199 - head/share/man/man7

2019-09-10 Thread Jason Helfman
Author: jgh (doc,ports committer)
Date: Tue Sep 10 22:44:09 2019
New Revision: 352199
URL: https://svnweb.freebsd.org/changeset/base/352199

Log:
  - fix a minor typo
  
  PR:   240447
  Submitted by: brigadi...@gmail.com
  MFC after:1 week

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

Modified: head/share/man/man7/security.7
==
--- head/share/man/man7/security.7  Tue Sep 10 22:26:31 2019
(r352198)
+++ head/share/man/man7/security.7  Tue Sep 10 22:44:09 2019
(r352199)
@@ -1016,7 +1016,7 @@ hardware information leak.
 amd64.
 Controls the mitigation of L1 Terminal Fault in bhyve hypervisor.
 .It Dv kern.elf32.aslr.enable
-Controls system-global Address Space Layour Randomization (ASLR) for
+Controls system-global Address Space Layout Randomization (ASLR) for
 normal non-PIE (Position Independent Executable) 32bit binaries.
 See also
 .Xr proccontrol 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352198 - stable/12

2019-09-10 Thread Jung-uk Kim
Author: jkim
Date: Tue Sep 10 22:26:31 2019
New Revision: 352198
URL: https://svnweb.freebsd.org/changeset/base/352198

Log:
  MFC:  r352197
  
  Remove unnecessary entries from the previous commit.

Modified:
  stable/12/ObsoleteFiles.inc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/ObsoleteFiles.inc
==
--- stable/12/ObsoleteFiles.inc Tue Sep 10 22:24:42 2019(r352197)
+++ stable/12/ObsoleteFiles.inc Tue Sep 10 22:26:31 2019(r352198)
@@ -38,9 +38,6 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
-# 20190910: OpenSSL 1.1.1d
-OLD_FILES+=usr/share/openssl/man/man3/d2i_ECDSA_SIG.3.gz
-OLD_FILES+=usr/share/openssl/man/man3/i2d_ECDSA_SIG.3.gz
 # 20190811: sys/pwm.h renamed to dev/pwmc.h and pwm(9) removed
 OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9
 # 20190723: new clang import which bumps version from 8.0.0 to 8.0.1.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352197 - head

2019-09-10 Thread Jung-uk Kim
Author: jkim
Date: Tue Sep 10 22:24:42 2019
New Revision: 352197
URL: https://svnweb.freebsd.org/changeset/base/352197

Log:
  Remove unnecessary entries from the previous commit.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Sep 10 22:08:34 2019(r352196)
+++ head/ObsoleteFiles.inc  Tue Sep 10 22:24:42 2019(r352197)
@@ -38,9 +38,6 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
-# 20190910: OpenSSL 1.1.1d
-OLD_FILES+=usr/share/openssl/man/man3/d2i_ECDSA_SIG.3.gz
-OLD_FILES+=usr/share/openssl/man/man3/i2d_ECDSA_SIG.3.gz
 # 20190910: mklocale(1) and colldef(1) removed
 OLD_FILES+=usr/bin/mklocale
 OLD_FILES+=usr/share/man/man1/mklocale.1.gz
___
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: r352196 - head/sys/arm/ti/am335x

2019-09-10 Thread Ian Lepore
Author: ian
Date: Tue Sep 10 22:08:34 2019
New Revision: 352196
URL: https://svnweb.freebsd.org/changeset/base/352196

Log:
  In am335x_dmtpps, use a spin mutex to interlock between PPS capture and PPS
  ioctl(2) handling.  This allows doing the pps_event() work in the polling
  routine, instead of using a taskqueue task to do that work.
  
  Also, add PNPINFO, and switch to using make_dev_s() to create the cdev.
  
  Using a spin mutex and calling pps_event() from the polling function works
  around the situation which requires more than 2 sets of timecounter
  timehands in a single-core system to get reliable PPS capture.  That problem
  would happen when a single-core system is idle in cpu_idle() then gets woken
  up with an event timer event which was scheduled to handle a hardclock tick.
  That processing path would end up calling tc_windup 3 or 4 times between
  when the tc polling function was called and when the taskqueue task would
  eventually run, and with only two sets of timehands, the th_generation count
  would always be too old to allow the captured PPS data to be used.

Modified:
  head/sys/arm/ti/am335x/am335x_dmtpps.c

Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c
==
--- head/sys/arm/ti/am335x/am335x_dmtpps.c  Tue Sep 10 21:53:42 2019
(r352195)
+++ head/sys/arm/ti/am335x/am335x_dmtpps.c  Tue Sep 10 22:08:34 2019
(r352196)
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -79,7 +78,6 @@ struct dmtpps_softc {
uint32_ttclr;   /* Cached TCLR register. */
struct timecounter  tc;
int pps_curmode;/* Edge mode now set in hw. */
-   struct task pps_task;   /* For pps_event handling. */
struct cdev *   pps_cdev;
struct pps_statepps_state;
struct mtx  pps_mtx;
@@ -93,6 +91,7 @@ static struct ofw_compat_data compat_data[] = {
{"ti,am335x-timer-1ms", 1},
{NULL,  0},
 };
+SIMPLEBUS_PNP_INFO(compat_data);
 
 /*
  * A table relating pad names to the hardware timer number they can be mux'd 
to.
@@ -285,48 +284,29 @@ dmtpps_poll(struct timecounter *tc)
 * populates it from the current DMT_TCRR register) with the latched
 * value from the TCAR1 register.
 *
-* There is no locking here, by design.  pps_capture() writes into an
-* area of struct pps_state which is read only by pps_event().  The
-* synchronization of access to that area is temporal rather than
-* interlock based... we write in this routine and trigger the task that
-* will read the data, so no simultaneous access can occur.
-*
 * Note that we don't have the TCAR interrupt enabled, but the hardware
 * still provides the status bits in the "RAW" status register even when
 * they're masked from generating an irq.  However, when clearing the
 * TCAR status to re-arm the capture for the next second, we have to
 * write to the IRQ status register, not the RAW register.  Quirky.
+*
+* We do not need to hold a lock while capturing the pps data, because
+* it is captured into an area of the pps_state struct which is read
+* only by pps_event().  We do need to hold a lock while calling
+* pps_event(), because it manipulates data which is also accessed from
+* the ioctl(2) context by userland processes.
 */
if (DMTIMER_READ4(sc, DMT_IRQSTATUS_RAW) & DMT_IRQ_TCAR) {
pps_capture(>pps_state);
sc->pps_state.capcount = DMTIMER_READ4(sc, DMT_TCAR1);
DMTIMER_WRITE4(sc, DMT_IRQSTATUS, DMT_IRQ_TCAR);
-   taskqueue_enqueue(taskqueue_fast, >pps_task);
+
+   mtx_lock_spin(>pps_mtx);
+   pps_event(>pps_state, PPS_CAPTUREASSERT);
+   mtx_unlock_spin(>pps_mtx);
}
 }
 
-static void
-dmtpps_event(void *arg, int pending)
-{
-   struct dmtpps_softc *sc;
-
-   sc = arg;
-
-   /* This is the task function that gets enqueued by poll_pps.  Once the
-* time has been captured by the timecounter polling code which runs in
-* primary interrupt context, the remaining (more expensive) work to
-* process the event is done later in a threaded context.
-*
-* Here there is an interlock that protects the event data in struct
-* pps_state.  That data can be accessed at any time from userland via
-* ioctl() calls so we must ensure that there is no read access to
-* partially updated data while pps_event() does its work.
-*/
-   mtx_lock(>pps_mtx);
-   pps_event(>pps_state, PPS_CAPTUREASSERT);
-   mtx_unlock(>pps_mtx);
-}
-
 static int
 dmtpps_open(struct cdev *dev, int 

svn commit: r352195 - in head/stand/i386: libi386 loader

2019-09-10 Thread Toomas Soome
Author: tsoome
Date: Tue Sep 10 21:53:42 2019
New Revision: 352195
URL: https://svnweb.freebsd.org/changeset/base/352195

Log:
  loader: vidconsole should set LINES and COLUMNS
  
  Set LINES and COLUMNS based on terminal dimensions.

Modified:
  head/stand/i386/libi386/vidconsole.c
  head/stand/i386/loader/main.c

Modified: head/stand/i386/libi386/vidconsole.c
==
--- head/stand/i386/libi386/vidconsole.cTue Sep 10 21:30:38 2019
(r352194)
+++ head/stand/i386/libi386/vidconsole.cTue Sep 10 21:53:42 2019
(r352195)
@@ -574,6 +574,7 @@ vidc_init(int arg)
 {
const teken_attr_t *a;
int val;
+   char env[8];
 
if (vidc_started && arg == 0)
return (0);
@@ -605,6 +606,11 @@ vidc_init(int arg)
teken_init(, , NULL);
teken_set_winsize(, );
a = teken_get_defattr();
+
+   snprintf(env, sizeof (env), "%u", tp.tp_row);
+   setenv("LINES", env, 1);
+   snprintf(env, sizeof (env), "%u", tp.tp_col);
+   setenv("COLUMNS", env, 1);
 
for (int row = 0; row < tp.tp_row; row++)
for (int col = 0; col < tp.tp_col; col++) {

Modified: head/stand/i386/loader/main.c
==
--- head/stand/i386/loader/main.c   Tue Sep 10 21:30:38 2019
(r352194)
+++ head/stand/i386/loader/main.c   Tue Sep 10 21:53:42 2019
(r352195)
@@ -238,7 +238,6 @@ main(void)
 printf("\n%s", bootprog_info);
 
 extract_currdev(); /* set $currdev and $loaddev */
-setenv("LINES", "24", 1);  /* optional */
 
 bios_getsmap();
 
___
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: r352194 - head/stand/lua

2019-09-10 Thread Kyle Evans
Author: kevans
Date: Tue Sep 10 21:30:38 2019
New Revision: 352194
URL: https://svnweb.freebsd.org/changeset/base/352194

Log:
  lualoader: Revert to ASCII menu frame for serial console
  
  The box drawing characters we use aren't necessarily safe with a serial
  console; for instance, in the report by npn@, these were causing his xterm
  to send back a sequence that lua picked up as input and halted the boot.
  This is less than ideal.
  
  Fallback to ASCII frames for console with 'comconsole' in it.  This is a
  partial revert r338108 by imp@ -- instead of removing the menu entirely and
  disabling color/cursor sequences, just reverting the default frame to ASCII
  is enough to not break in this setup.
  
  Reported by:  npn
  Triaged and recommended by:   tsoome

Modified:
  head/stand/lua/core.lua
  head/stand/lua/drawer.lua

Modified: head/stand/lua/core.lua
==
--- head/stand/lua/core.lua Tue Sep 10 21:14:56 2019(r352193)
+++ head/stand/lua/core.lua Tue Sep 10 21:30:38 2019(r352194)
@@ -325,6 +325,16 @@ function core.isZFSBoot()
return false
 end
 
+function core.isSerialConsole()
+   local c = loader.getenv("console")
+   if c ~= nil then
+   if c:find("comconsole") ~= nil then
+   return true
+   end
+   end
+   return false
+end
+
 function core.isSerialBoot()
local s = loader.getenv("boot_serial")
if s ~= nil then

Modified: head/stand/lua/drawer.lua
==
--- head/stand/lua/drawer.lua   Tue Sep 10 21:14:56 2019(r352193)
+++ head/stand/lua/drawer.lua   Tue Sep 10 21:30:38 2019(r352194)
@@ -144,13 +144,20 @@ local function drawmenu(menudef)
return alias_table
 end
 
+local function defaultframe()
+   if core.isSerialConsole() then
+   return "ascii"
+   end
+   return "double"
+end
+
 local function drawbox()
local x = menu_position.x - 3
local y = menu_position.y - 1
local w = frame_size.w
local h = frame_size.h
 
-   local framestyle = loader.getenv("loader_menu_frame") or "double"
+   local framestyle = loader.getenv("loader_menu_frame") or defaultframe()
local framespec = drawer.frame_styles[framestyle]
-- If we don't have a framespec for the current frame style, just don't
-- draw a box.
___
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: r352193 - in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/bn crypto/openssl/crypto/cms crypto/openssl/crypto/ec crypto/openssl/crypto/pem cr...

2019-09-10 Thread Jung-uk Kim
Author: jkim
Date: Tue Sep 10 21:14:56 2019
New Revision: 352193
URL: https://svnweb.freebsd.org/changeset/base/352193

Log:
  Merge OpenSSL 1.0.2t.

Modified:
  stable/11/crypto/openssl/CHANGES
  stable/11/crypto/openssl/Configure
  stable/11/crypto/openssl/Makefile
  stable/11/crypto/openssl/NEWS
  stable/11/crypto/openssl/README
  stable/11/crypto/openssl/apps/CA.pl
  stable/11/crypto/openssl/crypto/arm_arch.h
  stable/11/crypto/openssl/crypto/armcap.c
  stable/11/crypto/openssl/crypto/bn/Makefile
  stable/11/crypto/openssl/crypto/bn/bn_lib.c
  stable/11/crypto/openssl/crypto/bn_int.h
  stable/11/crypto/openssl/crypto/cms/cms_env.c
  stable/11/crypto/openssl/crypto/cms/cms_lcl.h
  stable/11/crypto/openssl/crypto/cms/cms_smime.c
  stable/11/crypto/openssl/crypto/constant_time_locl.h
  stable/11/crypto/openssl/crypto/cryptlib.h
  stable/11/crypto/openssl/crypto/ec/Makefile
  stable/11/crypto/openssl/crypto/ec/ec.h
  stable/11/crypto/openssl/crypto/ec/ec_asn1.c
  stable/11/crypto/openssl/crypto/ec/ec_curve.c
  stable/11/crypto/openssl/crypto/ec/ec_err.c
  stable/11/crypto/openssl/crypto/ec/ec_lcl.h
  stable/11/crypto/openssl/crypto/ec/ec_lib.c
  stable/11/crypto/openssl/crypto/ec/ecp_nistp224.c
  stable/11/crypto/openssl/crypto/ec/ecp_nistp256.c
  stable/11/crypto/openssl/crypto/ec/ecp_nistp521.c
  stable/11/crypto/openssl/crypto/opensslv.h
  stable/11/crypto/openssl/crypto/pem/pvkfmt.c
  stable/11/crypto/openssl/crypto/pkcs7/pk7_doit.c
  stable/11/crypto/openssl/crypto/rsa/rsa_chk.c
  stable/11/crypto/openssl/crypto/x509/x509_cmp.c
  stable/11/crypto/openssl/crypto/x509v3/v3_alt.c
  stable/11/crypto/openssl/util/libeay.num
  stable/11/secure/lib/libcrypto/Makefile.inc
  stable/11/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
  stable/11/secure/lib/libcrypto/man/ASN1_STRING_length.3
  stable/11/secure/lib/libcrypto/man/ASN1_STRING_new.3
  stable/11/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
  stable/11/secure/lib/libcrypto/man/ASN1_TIME_set.3
  stable/11/secure/lib/libcrypto/man/ASN1_generate_nconf.3
  stable/11/secure/lib/libcrypto/man/BIO_ctrl.3
  stable/11/secure/lib/libcrypto/man/BIO_f_base64.3
  stable/11/secure/lib/libcrypto/man/BIO_f_buffer.3
  stable/11/secure/lib/libcrypto/man/BIO_f_cipher.3
  stable/11/secure/lib/libcrypto/man/BIO_f_md.3
  stable/11/secure/lib/libcrypto/man/BIO_f_null.3
  stable/11/secure/lib/libcrypto/man/BIO_f_ssl.3
  stable/11/secure/lib/libcrypto/man/BIO_find_type.3
  stable/11/secure/lib/libcrypto/man/BIO_new.3
  stable/11/secure/lib/libcrypto/man/BIO_new_CMS.3
  stable/11/secure/lib/libcrypto/man/BIO_push.3
  stable/11/secure/lib/libcrypto/man/BIO_read.3
  stable/11/secure/lib/libcrypto/man/BIO_s_accept.3
  stable/11/secure/lib/libcrypto/man/BIO_s_bio.3
  stable/11/secure/lib/libcrypto/man/BIO_s_connect.3
  stable/11/secure/lib/libcrypto/man/BIO_s_fd.3
  stable/11/secure/lib/libcrypto/man/BIO_s_file.3
  stable/11/secure/lib/libcrypto/man/BIO_s_mem.3
  stable/11/secure/lib/libcrypto/man/BIO_s_null.3
  stable/11/secure/lib/libcrypto/man/BIO_s_socket.3
  stable/11/secure/lib/libcrypto/man/BIO_set_callback.3
  stable/11/secure/lib/libcrypto/man/BIO_should_retry.3
  stable/11/secure/lib/libcrypto/man/BN_BLINDING_new.3
  stable/11/secure/lib/libcrypto/man/BN_CTX_new.3
  stable/11/secure/lib/libcrypto/man/BN_CTX_start.3
  stable/11/secure/lib/libcrypto/man/BN_add.3
  stable/11/secure/lib/libcrypto/man/BN_add_word.3
  stable/11/secure/lib/libcrypto/man/BN_bn2bin.3
  stable/11/secure/lib/libcrypto/man/BN_cmp.3
  stable/11/secure/lib/libcrypto/man/BN_copy.3
  stable/11/secure/lib/libcrypto/man/BN_generate_prime.3
  stable/11/secure/lib/libcrypto/man/BN_mod_inverse.3
  stable/11/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
  stable/11/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
  stable/11/secure/lib/libcrypto/man/BN_new.3
  stable/11/secure/lib/libcrypto/man/BN_num_bytes.3
  stable/11/secure/lib/libcrypto/man/BN_rand.3
  stable/11/secure/lib/libcrypto/man/BN_set_bit.3
  stable/11/secure/lib/libcrypto/man/BN_swap.3
  stable/11/secure/lib/libcrypto/man/BN_zero.3
  stable/11/secure/lib/libcrypto/man/CMS_add0_cert.3
  stable/11/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
  stable/11/secure/lib/libcrypto/man/CMS_add1_signer.3
  stable/11/secure/lib/libcrypto/man/CMS_compress.3
  stable/11/secure/lib/libcrypto/man/CMS_decrypt.3
  stable/11/secure/lib/libcrypto/man/CMS_encrypt.3
  stable/11/secure/lib/libcrypto/man/CMS_final.3
  stable/11/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
  stable/11/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
  stable/11/secure/lib/libcrypto/man/CMS_get0_type.3
  stable/11/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
  stable/11/secure/lib/libcrypto/man/CMS_sign.3
  stable/11/secure/lib/libcrypto/man/CMS_sign_receipt.3
  stable/11/secure/lib/libcrypto/man/CMS_uncompress.3
  stable/11/secure/lib/libcrypto/man/CMS_verify.3
  stable/11/secure/lib/libcrypto/man/CMS_verify_receipt.3
  

svn commit: r352192 - in stable/12: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/cryp...

2019-09-10 Thread Jung-uk Kim
/secure/lib/libcrypto/man/X509_get0_signature.3
  stable/12/secure/lib/libcrypto/man/X509_get0_uids.3
  stable/12/secure/lib/libcrypto/man/X509_get_extension_flags.3
  stable/12/secure/lib/libcrypto/man/X509_get_pubkey.3
  stable/12/secure/lib/libcrypto/man/X509_get_serialNumber.3
  stable/12/secure/lib/libcrypto/man/X509_get_subject_name.3
  stable/12/secure/lib/libcrypto/man/X509_get_version.3
  stable/12/secure/lib/libcrypto/man/X509_new.3
  stable/12/secure/lib/libcrypto/man/X509_sign.3
  stable/12/secure/lib/libcrypto/man/X509_verify_cert.3
  stable/12/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3
  stable/12/secure/lib/libcrypto/man/d2i_DHparams.3
  stable/12/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3
  stable/12/secure/lib/libcrypto/man/d2i_PrivateKey.3
  stable/12/secure/lib/libcrypto/man/d2i_SSL_SESSION.3
  stable/12/secure/lib/libcrypto/man/d2i_X509.3
  stable/12/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
  stable/12/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
  stable/12/secure/lib/libcrypto/man/i2d_re_X509_tbs.3
  stable/12/secure/lib/libcrypto/man/o2i_SCT_LIST.3
  stable/12/secure/usr.bin/openssl/man/CA.pl.1
  stable/12/secure/usr.bin/openssl/man/asn1parse.1
  stable/12/secure/usr.bin/openssl/man/ca.1
  stable/12/secure/usr.bin/openssl/man/ciphers.1
  stable/12/secure/usr.bin/openssl/man/cms.1
  stable/12/secure/usr.bin/openssl/man/crl.1
  stable/12/secure/usr.bin/openssl/man/crl2pkcs7.1
  stable/12/secure/usr.bin/openssl/man/dgst.1
  stable/12/secure/usr.bin/openssl/man/dhparam.1
  stable/12/secure/usr.bin/openssl/man/dsa.1
  stable/12/secure/usr.bin/openssl/man/dsaparam.1
  stable/12/secure/usr.bin/openssl/man/ec.1
  stable/12/secure/usr.bin/openssl/man/ecparam.1
  stable/12/secure/usr.bin/openssl/man/enc.1
  stable/12/secure/usr.bin/openssl/man/engine.1
  stable/12/secure/usr.bin/openssl/man/errstr.1
  stable/12/secure/usr.bin/openssl/man/gendsa.1
  stable/12/secure/usr.bin/openssl/man/genpkey.1
  stable/12/secure/usr.bin/openssl/man/genrsa.1
  stable/12/secure/usr.bin/openssl/man/list.1
  stable/12/secure/usr.bin/openssl/man/nseq.1
  stable/12/secure/usr.bin/openssl/man/ocsp.1
  stable/12/secure/usr.bin/openssl/man/openssl.1
  stable/12/secure/usr.bin/openssl/man/passwd.1
  stable/12/secure/usr.bin/openssl/man/pkcs12.1
  stable/12/secure/usr.bin/openssl/man/pkcs7.1
  stable/12/secure/usr.bin/openssl/man/pkcs8.1
  stable/12/secure/usr.bin/openssl/man/pkey.1
  stable/12/secure/usr.bin/openssl/man/pkeyparam.1
  stable/12/secure/usr.bin/openssl/man/pkeyutl.1
  stable/12/secure/usr.bin/openssl/man/prime.1
  stable/12/secure/usr.bin/openssl/man/rand.1
  stable/12/secure/usr.bin/openssl/man/req.1
  stable/12/secure/usr.bin/openssl/man/rsa.1
  stable/12/secure/usr.bin/openssl/man/rsautl.1
  stable/12/secure/usr.bin/openssl/man/s_client.1
  stable/12/secure/usr.bin/openssl/man/s_server.1
  stable/12/secure/usr.bin/openssl/man/s_time.1
  stable/12/secure/usr.bin/openssl/man/sess_id.1
  stable/12/secure/usr.bin/openssl/man/smime.1
  stable/12/secure/usr.bin/openssl/man/speed.1
  stable/12/secure/usr.bin/openssl/man/spkac.1
  stable/12/secure/usr.bin/openssl/man/srp.1
  stable/12/secure/usr.bin/openssl/man/storeutl.1
  stable/12/secure/usr.bin/openssl/man/ts.1
  stable/12/secure/usr.bin/openssl/man/tsget.1
  stable/12/secure/usr.bin/openssl/man/verify.1
  stable/12/secure/usr.bin/openssl/man/version.1
  stable/12/secure/usr.bin/openssl/man/x509.1
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/ObsoleteFiles.inc
==
--- stable/12/ObsoleteFiles.inc Tue Sep 10 21:08:17 2019(r352191)
+++ stable/12/ObsoleteFiles.inc Tue Sep 10 21:13:37 2019(r352192)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20190910: OpenSSL 1.1.1d
+OLD_FILES+=usr/share/openssl/man/man3/d2i_ECDSA_SIG.3.gz
+OLD_FILES+=usr/share/openssl/man/man3/i2d_ECDSA_SIG.3.gz
 # 20190811: sys/pwm.h renamed to dev/pwmc.h and pwm(9) removed
 OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9
 # 20190723: new clang import which bumps version from 8.0.0 to 8.0.1.

Modified: stable/12/crypto/openssl/CHANGES
==
--- stable/12/crypto/openssl/CHANGESTue Sep 10 21:08:17 2019
(r352191)
+++ stable/12/crypto/openssl/CHANGESTue Sep 10 21:13:37 2019
(r352192)
@@ -7,6 +7,101 @@
  https://github.com/openssl/openssl/commits/ and pick the appropriate
  release branch.
 
+ Changes between 1.1.1c and 1.1.1d [10 Sep 2019]
+
+  *) Fixed a fork protection issue. OpenSSL 1.1.1 introduced a rewritten random
+ number generator (RNG). This was intended to include protection in the
+ event of a fork() system call in order to ensure that the parent and child
+ processes did not share the same RNG state. However this protection was 
not
+ being used in the default case.
+
+ A partial mitigation for this issue

svn commit: r352191 - in head: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn...

2019-09-10 Thread Jung-uk Kim
/X509_LOOKUP_meth_new.3
  head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
  head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
  head/secure/lib/libcrypto/man/X509_NAME_get0_der.3
  head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
  head/secure/lib/libcrypto/man/X509_NAME_print_ex.3
  head/secure/lib/libcrypto/man/X509_PUBKEY_new.3
  head/secure/lib/libcrypto/man/X509_SIG_get0.3
  head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
  head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
  head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
  head/secure/lib/libcrypto/man/X509_STORE_add_cert.3
  head/secure/lib/libcrypto/man/X509_STORE_get0_param.3
  head/secure/lib/libcrypto/man/X509_STORE_new.3
  head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
  head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
  head/secure/lib/libcrypto/man/X509_check_ca.3
  head/secure/lib/libcrypto/man/X509_check_host.3
  head/secure/lib/libcrypto/man/X509_check_issued.3
  head/secure/lib/libcrypto/man/X509_check_private_key.3
  head/secure/lib/libcrypto/man/X509_cmp_time.3
  head/secure/lib/libcrypto/man/X509_digest.3
  head/secure/lib/libcrypto/man/X509_dup.3
  head/secure/lib/libcrypto/man/X509_get0_notBefore.3
  head/secure/lib/libcrypto/man/X509_get0_signature.3
  head/secure/lib/libcrypto/man/X509_get0_uids.3
  head/secure/lib/libcrypto/man/X509_get_extension_flags.3
  head/secure/lib/libcrypto/man/X509_get_pubkey.3
  head/secure/lib/libcrypto/man/X509_get_serialNumber.3
  head/secure/lib/libcrypto/man/X509_get_subject_name.3
  head/secure/lib/libcrypto/man/X509_get_version.3
  head/secure/lib/libcrypto/man/X509_new.3
  head/secure/lib/libcrypto/man/X509_sign.3
  head/secure/lib/libcrypto/man/X509_verify_cert.3
  head/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3
  head/secure/lib/libcrypto/man/d2i_DHparams.3
  head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3
  head/secure/lib/libcrypto/man/d2i_PrivateKey.3
  head/secure/lib/libcrypto/man/d2i_SSL_SESSION.3
  head/secure/lib/libcrypto/man/d2i_X509.3
  head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
  head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
  head/secure/lib/libcrypto/man/i2d_re_X509_tbs.3
  head/secure/lib/libcrypto/man/o2i_SCT_LIST.3
  head/secure/usr.bin/openssl/man/CA.pl.1
  head/secure/usr.bin/openssl/man/asn1parse.1
  head/secure/usr.bin/openssl/man/ca.1
  head/secure/usr.bin/openssl/man/ciphers.1
  head/secure/usr.bin/openssl/man/cms.1
  head/secure/usr.bin/openssl/man/crl.1
  head/secure/usr.bin/openssl/man/crl2pkcs7.1
  head/secure/usr.bin/openssl/man/dgst.1
  head/secure/usr.bin/openssl/man/dhparam.1
  head/secure/usr.bin/openssl/man/dsa.1
  head/secure/usr.bin/openssl/man/dsaparam.1
  head/secure/usr.bin/openssl/man/ec.1
  head/secure/usr.bin/openssl/man/ecparam.1
  head/secure/usr.bin/openssl/man/enc.1
  head/secure/usr.bin/openssl/man/engine.1
  head/secure/usr.bin/openssl/man/errstr.1
  head/secure/usr.bin/openssl/man/gendsa.1
  head/secure/usr.bin/openssl/man/genpkey.1
  head/secure/usr.bin/openssl/man/genrsa.1
  head/secure/usr.bin/openssl/man/list.1
  head/secure/usr.bin/openssl/man/nseq.1
  head/secure/usr.bin/openssl/man/ocsp.1
  head/secure/usr.bin/openssl/man/openssl.1
  head/secure/usr.bin/openssl/man/passwd.1
  head/secure/usr.bin/openssl/man/pkcs12.1
  head/secure/usr.bin/openssl/man/pkcs7.1
  head/secure/usr.bin/openssl/man/pkcs8.1
  head/secure/usr.bin/openssl/man/pkey.1
  head/secure/usr.bin/openssl/man/pkeyparam.1
  head/secure/usr.bin/openssl/man/pkeyutl.1
  head/secure/usr.bin/openssl/man/prime.1
  head/secure/usr.bin/openssl/man/rand.1
  head/secure/usr.bin/openssl/man/req.1
  head/secure/usr.bin/openssl/man/rsa.1
  head/secure/usr.bin/openssl/man/rsautl.1
  head/secure/usr.bin/openssl/man/s_client.1
  head/secure/usr.bin/openssl/man/s_server.1
  head/secure/usr.bin/openssl/man/s_time.1
  head/secure/usr.bin/openssl/man/sess_id.1
  head/secure/usr.bin/openssl/man/smime.1
  head/secure/usr.bin/openssl/man/speed.1
  head/secure/usr.bin/openssl/man/spkac.1
  head/secure/usr.bin/openssl/man/srp.1
  head/secure/usr.bin/openssl/man/storeutl.1
  head/secure/usr.bin/openssl/man/ts.1
  head/secure/usr.bin/openssl/man/tsget.1
  head/secure/usr.bin/openssl/man/verify.1
  head/secure/usr.bin/openssl/man/version.1
  head/secure/usr.bin/openssl/man/x509.1
Directory Properties:
  head/crypto/openssl/   (props changed)

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Sep 10 20:55:47 2019(r352190)
+++ head/ObsoleteFiles.inc  Tue Sep 10 21:08:17 2019(r352191)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20190910: OpenSSL 1.1.1d
+OLD_FILES+=usr/share/openssl/man/man3/d2i_ECDSA_SIG.3.gz
+OLD_FILES+=usr/share/openssl/man/man3/i2d_ECDSA_SIG.3.gz
 # 20190910: mklocale(1) and colldef(1) removed
 OLD_FILES+=usr/bin/mklocale
 OLD_FILES+=usr/share/man/man1/mklocale.1

svn commit: r352190 - in stable/12/sys: kern sys

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:55:47 2019
New Revision: 352190
URL: https://svnweb.freebsd.org/changeset/base/352190

Log:
  MFCr350429:
proc: make clear_orphan an public API
  
This will be useful for other patches with process descriptors.
Change its name as well.
  
Reviewed by:  markj, kib

Modified:
  stable/12/sys/kern/kern_exit.c
  stable/12/sys/sys/proc.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_exit.c
==
--- stable/12/sys/kern/kern_exit.c  Tue Sep 10 20:49:47 2019
(r352189)
+++ stable/12/sys/kern/kern_exit.c  Tue Sep 10 20:55:47 2019
(r352190)
@@ -147,8 +147,8 @@ reaper_abandon_children(struct proc *p, bool exiting)
p->p_treeflag &= ~P_TREE_REAPER;
 }
 
-static void
-clear_orphan(struct proc *p)
+void
+proc_clear_orphan(struct proc *p)
 {
struct proc *p1;
 
@@ -505,7 +505,7 @@ exit1(struct thread *td, int rval, int signo)
 * list due to present P_TRACED flag. Clear
 * orphan link for q now while q is locked.
 */
-   clear_orphan(q);
+   proc_clear_orphan(q);
q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE);
q->p_flag2 &= ~P2_PTRACE_FSTP;
q->p_ptevents = 0;
@@ -539,7 +539,7 @@ exit1(struct thread *td, int rval, int signo)
kern_psignal(q, q->p_pdeathsig);
CTR2(KTR_PTRACE, "exit: pid %d, clearing orphan %d", p->p_pid,
q->p_pid);
-   clear_orphan(q);
+   proc_clear_orphan(q);
PROC_UNLOCK(q);
}
 
@@ -889,7 +889,7 @@ proc_reap(struct thread *td, struct proc *p, int *stat
reaper_abandon_children(p, true);
LIST_REMOVE(p, p_reapsibling);
PROC_LOCK(p);
-   clear_orphan(p);
+   proc_clear_orphan(p);
PROC_UNLOCK(p);
leavepgrp(p);
if (p->p_procdesc != NULL)
@@ -1367,7 +1367,7 @@ proc_reparent(struct proc *child, struct proc *parent,
LIST_REMOVE(child, p_sibling);
LIST_INSERT_HEAD(>p_children, child, p_sibling);
 
-   clear_orphan(child);
+   proc_clear_orphan(child);
if ((child->p_flag & P_TRACED) != 0) {
proc_add_orphan(child, child->p_pptr);
}

Modified: stable/12/sys/sys/proc.h
==
--- stable/12/sys/sys/proc.hTue Sep 10 20:49:47 2019(r352189)
+++ stable/12/sys/sys/proc.hTue Sep 10 20:55:47 2019(r352190)
@@ -1069,6 +1069,7 @@ void  proc_wkilled(struct proc *p);
 struct pstats *pstats_alloc(void);
 void   pstats_fork(struct pstats *src, struct pstats *dst);
 void   pstats_free(struct pstats *ps);
+void   proc_clear_orphan(struct proc *p);
 void   reaper_abandon_children(struct proc *p, bool exiting);
 intsecurelevel_ge(struct ucred *cr, int level);
 intsecurelevel_gt(struct ucred *cr, int level);
___
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: r352189 - stable/12/lib/libcasper/services/cap_dns

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:49:47 2019
New Revision: 352189
URL: https://svnweb.freebsd.org/changeset/base/352189

Log:
  MFCr340638:
   libcasper: provide compatibility with the old version of service
  
Some external tools like tcpdump(1) have upstream the changes with old 
limits
name. Because of that provide compatibility with the old names.
  
Reported by:  emaste

Modified:
  stable/12/lib/libcasper/services/cap_dns/cap_dns.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.c
==
--- stable/12/lib/libcasper/services/cap_dns/cap_dns.c  Tue Sep 10 20:45:51 
2019(r352188)
+++ stable/12/lib/libcasper/services/cap_dns/cap_dns.c  Tue Sep 10 20:49:47 
2019(r352189)
@@ -474,7 +474,8 @@ dns_gethostbyname(const nvlist_t *limits, const nvlist
struct hostent *hp;
int family;
 
-   if (!dns_allowed_type(limits, "NAME2ADDR"))
+   if (!dns_allowed_type(limits, "NAME2ADDR") &&
+   !dns_allowed_type(limits, "NAME"))
return (NO_RECOVERY);
 
family = (int)nvlist_get_number(nvlin, "family");
@@ -498,7 +499,8 @@ dns_gethostbyaddr(const nvlist_t *limits, const nvlist
size_t addrsize;
int family;
 
-   if (!dns_allowed_type(limits, "ADDR2NAME"))
+   if (!dns_allowed_type(limits, "ADDR2NAME") &&
+   !dns_allowed_type(limits, "ADDR"))
return (NO_RECOVERY);
 
family = (int)nvlist_get_number(nvlin, "family");
@@ -524,7 +526,8 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t
socklen_t salen;
int error, flags;
 
-   if (!dns_allowed_type(limits, "ADDR2NAME"))
+   if (!dns_allowed_type(limits, "ADDR2NAME") &&
+   !dns_allowed_type(limits, "ADDR"))
return (NO_RECOVERY);
 
error = 0;
@@ -617,7 +620,8 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t
unsigned int ii;
int error, family, n;
 
-   if (!dns_allowed_type(limits, "NAME2ADDR"))
+   if (!dns_allowed_type(limits, "NAME2ADDR") &&
+   !dns_allowed_type(limits, "NAME"))
return (NO_RECOVERY);
 
hostname = dnvlist_get_string(nvlin, "hostname", NULL);
@@ -703,7 +707,9 @@ dns_limit(const nvlist_t *oldlimits, const nvlist_t *n
return (EINVAL);
type = nvlist_get_string(newlimits, name);
if (strcmp(type, "ADDR2NAME") != 0 &&
-   strcmp(type, "NAME2ADDR") != 0) {
+   strcmp(type, "NAME2ADDR") != 0 &&
+   strcmp(type, "ADDR") != 0 &&
+   strcmp(type, "NAME") != 0) {
return (EINVAL);
}
if (!dns_allowed_type(oldlimits, type))
___
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: r352188 - in stable/12: . contrib/tcpdump contrib/traceroute lib/libcasper/services/cap_dns lib/libcasper/services/cap_dns/tests sbin/ping

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:45:51 2019
New Revision: 352188
URL: https://svnweb.freebsd.org/changeset/base/352188

Log:
  MFCr340363:
libcasper: Change the name of limits in cap_dns so the intentions are 
obvious.
  
Reported by:  pjd

Modified:
  stable/12/ObsoleteFiles.inc
  stable/12/contrib/tcpdump/tcpdump.c
  stable/12/contrib/traceroute/traceroute.c
  stable/12/lib/libcasper/services/cap_dns/Makefile
  stable/12/lib/libcasper/services/cap_dns/cap_dns.3
  stable/12/lib/libcasper/services/cap_dns/cap_dns.c
  stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c
  stable/12/sbin/ping/ping.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/ObsoleteFiles.inc
==
--- stable/12/ObsoleteFiles.inc Tue Sep 10 20:41:42 2019(r352187)
+++ stable/12/ObsoleteFiles.inc Tue Sep 10 20:45:51 2019(r352188)
@@ -483,6 +483,9 @@ OLD_DIRS+=usr/lib/clang/6.0.1/lib
 OLD_DIRS+=usr/lib/clang/6.0.1
 # 20181116: Rename test file.
 OLD_FILES+=usr/tests/sys/netinet/reuseport_lb
+# 20181112: Cleanup old libcap_dns.
+OLD_LIBS+=lib/casper/libcap_dns.so.1
+OLD_LIBS+=usr/lib32/libcap_dns.so.1
 # 20181030: malloc_domain(9) KPI change
 OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz
 # 20181025: OpenSSL libraries version bump to avoid conflict with ports

Modified: stable/12/contrib/tcpdump/tcpdump.c
==
--- stable/12/contrib/tcpdump/tcpdump.c Tue Sep 10 20:41:42 2019
(r352187)
+++ stable/12/contrib/tcpdump/tcpdump.c Tue Sep 10 20:45:51 2019
(r352188)
@@ -741,7 +741,7 @@ capdns_setup(void)
if (capdnsloc == NULL)
error("unable to open system.dns service");
/* Limit system.dns to reverse DNS lookups. */
-   types[0] = "ADDR";
+   types[0] = "ADDR2NAME";
if (cap_dns_type_limit(capdnsloc, types, 1) < 0)
error("unable to limit access to system.dns service");
families[0] = AF_INET;

Modified: stable/12/contrib/traceroute/traceroute.c
==
--- stable/12/contrib/traceroute/traceroute.c   Tue Sep 10 20:41:42 2019
(r352187)
+++ stable/12/contrib/traceroute/traceroute.c   Tue Sep 10 20:45:51 2019
(r352188)
@@ -523,7 +523,7 @@ main(int argc, char **argv)
int sump = 0;
int sockerrno;
 #ifdef WITH_CASPER
-   const char *types[] = { "NAME", "ADDR" };
+   const char *types[] = { "NAME2ADDR", "ADDR2NAME" };
int families[1];
cap_channel_t *casper;
 #endif

Modified: stable/12/lib/libcasper/services/cap_dns/Makefile
==
--- stable/12/lib/libcasper/services/cap_dns/Makefile   Tue Sep 10 20:41:42 
2019(r352187)
+++ stable/12/lib/libcasper/services/cap_dns/Makefile   Tue Sep 10 20:45:51 
2019(r352188)
@@ -6,7 +6,7 @@ SHLIBDIR?=  /lib/casper
 
 PACKAGE=libcasper
 
-SHLIB_MAJOR=   1
+SHLIB_MAJOR=   2
 INCSDIR?=  ${INCLUDEDIR}/casper
 
 .if ${MK_CASPER} != "no"

Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.3
==
--- stable/12/lib/libcasper/services/cap_dns/cap_dns.3  Tue Sep 10 20:41:42 
2019(r352187)
+++ stable/12/lib/libcasper/services/cap_dns/cap_dns.3  Tue Sep 10 20:45:51 
2019(r352188)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 18, 2018
+.Dd November 12, 2018
 .Dt CAP_DNS 3
 .Os
 .Sh NAME
@@ -76,9 +76,9 @@ function limits the functions allowed in the service.
 The
 .Fa types
 variable can be set to
-.Dv ADDR
+.Dv ADDR2NAME
 or
-.Dv NAME .
+.Dv NAME2ADDR .
 See the
 .Sx LIMITS
 section for more details.
@@ -113,9 +113,9 @@ for that function can contain the following values and
 The
 .Va type
 can have two values:
-.Dv ADDR
+.Dv ADDR2NAME
 or
-.Dv NAME .
+.Dv NAME2ADDR .
 The
 .Dv ADDR
 means that reverse DNS lookups are allowed with

Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.c
==
--- stable/12/lib/libcasper/services/cap_dns/cap_dns.c  Tue Sep 10 20:41:42 
2019(r352187)
+++ stable/12/lib/libcasper/services/cap_dns/cap_dns.c  Tue Sep 10 20:45:51 
2019(r352188)
@@ -474,7 +474,7 @@ dns_gethostbyname(const nvlist_t *limits, const nvlist
struct hostent *hp;
int family;
 
-   if (!dns_allowed_type(limits, "NAME"))
+   if (!dns_allowed_type(limits, "NAME2ADDR"))
return (NO_RECOVERY);
 
family = (int)nvlist_get_number(nvlin, "family");
@@ -498,7 +498,7 @@ dns_gethostbyaddr(const nvlist_t *limits, const nvlist
size_t addrsize;
int family;
 
-   if (!dns_allowed_type(limits, "ADDR"))
+   if (!dns_allowed_type(limits, "ADDR2NAME"))
return 

svn commit: r352187 - in stable/12/lib/libcasper/services/cap_dns: . tests

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:41:42 2019
New Revision: 352187
URL: https://svnweb.freebsd.org/changeset/base/352187

Log:
  MFCr340141:
libcasper: fix limitations in dns service
  
The getaddrinfo(3) and gethostbyname(3) are used to return the address for a
given hostname. The getnameinfo(3) and gethostbyaddr(3) are used to return
hostname for a given address. Right now in casper, we have two limitations:
- NAME which allows resolving DNS names.
- ADDR which allows to do revert DNS lookups.
  
Before this change the rights was mixed up:
NAME - getnameinfo(3) and gethostbyname(3)
ADDR - gethostbyaddr(3) and getaddrinfo(3)
  
Which no matters on limitation allowed us to resolve DNS names and do DNS
lookups basically by using a different set of functions.
  
Now the NAME type allows getaddrinfo(3) and gethostbyname (3)functions,
and the ADDR names allow to use gethostbyaddr(3) and getnameinfo(3) 
functions.
  
Reviewed by:  pjd, bcr
Discussed with:   hrs
Differential Revision:https://reviews.freebsd.org/D16930

Modified:
  stable/12/lib/libcasper/services/cap_dns/cap_dns.3
  stable/12/lib/libcasper/services/cap_dns/cap_dns.c
  stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.3
==
--- stable/12/lib/libcasper/services/cap_dns/cap_dns.3  Tue Sep 10 20:27:44 
2019(r352186)
+++ stable/12/lib/libcasper/services/cap_dns/cap_dns.3  Tue Sep 10 20:41:42 
2019(r352187)
@@ -118,19 +118,21 @@ or
 .Dv NAME .
 The
 .Dv ADDR
-means that functions
-.Fn cap_gethostbyname ,
-.Fn cap_gethostbyname2
+means that reverse DNS lookups are allowed with
+.Fn cap_getnameinfo
 and
 .Fn cap_gethostbyaddr
-are allowed.
+functions.
 In case when
 .Va type
 is set to
 .Dv NAME
-the
-.Fn cap_getnameinfo
-function is allowed.
+the name resolution is allowed with
+.Fn cap_getaddrinfo ,
+.Fn cap_gethostbyname ,
+and
+.Fn cap_gethostbyname2
+functions.
 .It family ( NV_TYPE_NUMBER )
 The
 .Va family

Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.c
==
--- stable/12/lib/libcasper/services/cap_dns/cap_dns.c  Tue Sep 10 20:27:44 
2019(r352186)
+++ stable/12/lib/libcasper/services/cap_dns/cap_dns.c  Tue Sep 10 20:41:42 
2019(r352187)
@@ -524,7 +524,7 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t
socklen_t salen;
int error, flags;
 
-   if (!dns_allowed_type(limits, "NAME"))
+   if (!dns_allowed_type(limits, "ADDR"))
return (NO_RECOVERY);
 
error = 0;
@@ -617,7 +617,7 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t
unsigned int ii;
int error, family, n;
 
-   if (!dns_allowed_type(limits, "ADDR"))
+   if (!dns_allowed_type(limits, "NAME"))
return (NO_RECOVERY);
 
hostname = dnvlist_get_string(nvlin, "hostname", NULL);

Modified: stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c
==
--- stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c   Tue Sep 10 
20:27:44 2019(r352186)
+++ stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c   Tue Sep 10 
20:41:42 2019(r352187)
@@ -393,7 +393,8 @@ main(void)
CHECK(cap_dns_family_limit(capdns, families, 2) == 0);
 
CHECK(runtest(capdns) ==
-   (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET | GETHOSTBYNAME2_AF_INET6));
+   (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET | GETHOSTBYNAME2_AF_INET6 |
+   GETADDRINFO_AF_INET | GETADDRINFO_AF_INET6));
 
cap_close(capdns);
 
@@ -419,9 +420,7 @@ main(void)
CHECK(cap_dns_family_limit(capdns, families, 2) == 0);
 
CHECK(runtest(capdns) ==
-   (GETHOSTBYADDR_AF_INET | GETHOSTBYADDR_AF_INET6 |
-   GETADDRINFO_AF_INET | GETADDRINFO_AF_INET6));
-
+   (GETHOSTBYADDR_AF_INET | GETHOSTBYADDR_AF_INET6));
cap_close(capdns);
 
/*
@@ -512,7 +511,8 @@ main(void)
CHECK(cap_dns_family_limit(capdns, families, 1) == -1 &&
errno == ENOTCAPABLE);
 
-   CHECK(runtest(capdns) == (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET));
+   CHECK(runtest(capdns) ==
+   (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET | GETADDRINFO_AF_INET));
 
cap_close(capdns);
 
@@ -548,7 +548,8 @@ main(void)
CHECK(cap_dns_family_limit(capdns, families, 1) == -1 &&
errno == ENOTCAPABLE);
 
-   CHECK(runtest(capdns) == GETHOSTBYNAME2_AF_INET6);
+   CHECK(runtest(capdns) ==
+   (GETHOSTBYNAME2_AF_INET6 | GETADDRINFO_AF_INET6));
 
cap_close(capdns);
 
@@ -584,7 +585,7 @@ main(void)
CHECK(cap_dns_family_limit(capdns, families, 1) == -1 &&
 

svn commit: r352186 - head/lib/geom/nop

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:27:44 2019
New Revision: 352186
URL: https://svnweb.freebsd.org/changeset/base/352186

Log:
  gnop: Fix initial value for the wdelayprob
  
  Reported by:  Chuck Silvers 

Modified:
  head/lib/geom/nop/geom_nop.c

Modified: head/lib/geom/nop/geom_nop.c
==
--- head/lib/geom/nop/geom_nop.cTue Sep 10 20:21:47 2019
(r352185)
+++ head/lib/geom/nop/geom_nop.cTue Sep 10 20:27:44 2019
(r352186)
@@ -53,7 +53,7 @@ struct g_command class_commands[] = {
{ 's', "size", "0", G_TYPE_NUMBER },
{ 'S', "secsize", "0", G_TYPE_NUMBER },
{ 'w', "wfailprob", "-1", G_TYPE_NUMBER },
-   { 'x', "wdelayprob", "1", G_TYPE_NUMBER },
+   { 'x', "wdelayprob", "-1", G_TYPE_NUMBER },
{ 'z', "physpath", G_NOP_PHYSPATH_PASSTHROUGH, G_TYPE_STRING },
G_OPT_SENTINEL
},
@@ -68,7 +68,7 @@ struct g_command class_commands[] = {
{ 'q', "rdelayprob", "-1", G_TYPE_NUMBER },
{ 'r', "rfailprob", "-1", G_TYPE_NUMBER },
{ 'w', "wfailprob", "-1", G_TYPE_NUMBER },
-   { 'x', "wdelayprob", "1", G_TYPE_NUMBER },
+   { 'x', "wdelayprob", "-1", G_TYPE_NUMBER },
G_OPT_SENTINEL
},
"[-v] [-d delaymsec] [-e error] [-q rdelayprob] [-r rfailprob] "
___
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: r352185 - stable/12/sys/kern

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:21:47 2019
New Revision: 352185
URL: https://svnweb.freebsd.org/changeset/base/352185

Log:
  MFCr350617:
procdesc: fix the function name
  
I changed name of the function r350429 and forgot to update
the r350612 patch.
  
Reported by:  jenkins

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

Modified: stable/12/sys/kern/sys_procdesc.c
==
--- stable/12/sys/kern/sys_procdesc.c   Tue Sep 10 20:20:45 2019
(r352184)
+++ stable/12/sys/kern/sys_procdesc.c   Tue Sep 10 20:21:47 2019
(r352185)
@@ -419,7 +419,7 @@ procdesc_close(struct file *fp, struct thread *td)
if ((p->p_flag & P_TRACED) == 0) {
proc_reparent(p, p->p_reaper, true);
} else {
-   clear_orphan(p);
+   proc_clear_orphan(p);
p->p_oppid = p->p_reaper->p_pid;
proc_add_orphan(p, p->p_reaper);
}
___
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: r352184 - stable/12/sys/kern

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:20:45 2019
New Revision: 352184
URL: https://svnweb.freebsd.org/changeset/base/352184

Log:
  MFCr350616:
process: style
  
We don't need to check if the parent is already set.
This is done already in the proc_reparent.
  
No functional behaviour changes intended.
  
MFC after:1 month

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

Modified: stable/12/sys/kern/sys_process.c
==
--- stable/12/sys/kern/sys_process.cTue Sep 10 20:19:29 2019
(r352183)
+++ stable/12/sys/kern/sys_process.cTue Sep 10 20:20:45 2019
(r352184)
@@ -929,9 +929,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
 * on a "detach".
 */
proc_set_traced(p, true);
-   if (p->p_pptr != td->td_proc) {
-   proc_reparent(p, td->td_proc, false);
-   }
+   proc_reparent(p, td->td_proc, false);
CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid,
p->p_oppid);
 
@@ -1048,7 +1046,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
bcopy(td2->td_sa.args, addr, td2->td_sa.narg *
sizeof(register_t));
break;
-   
+
case PT_STEP:
case PT_CONTINUE:
case PT_TO_SCE:
@@ -1158,8 +1156,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
 
sendsig:
MPASS(proctree_locked == 0);
-   
-   /* 
+
+   /*
 * Clear the pending event for the thread that just
 * reported its event (p_xthread).  This may not be
 * the thread passed to PT_CONTINUE, PT_STEP, etc. if
___
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: r352183 - head/sys/kern

2019-09-10 Thread Mateusz Guzik
Author: mjg
Date: Tue Sep 10 20:19:29 2019
New Revision: 352183
URL: https://svnweb.freebsd.org/changeset/base/352183

Log:
  cache: avoid excessive relocking on entry removal during lookup
  
  Due to lock ordering issues (bucket lock held, vnode locks wanted) the code
  starts with trylocking which in face of contention often fails. Prior to
  the change it would loop back with a possible yield.
  
  Instead note we know what locks are needed and can take them in the right
  order, avoiding retries. Then we can safely re-lookup and see if the entry
  we are looking for is still there.
  
  On a 104-way box poudriere would result in constant retries during an 11h
  run as seen in the vfs.cache.zap_and_exit_bucket_fail counter.
  
  before: 408866592
  after : 0
  
  However, a new stat reports:
  vfs.cache.zap_and_exit_bucket_relock_success: 32638
  
  Note this is only a bandaid over current design issues.
  
  Tested by:pho
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Tue Sep 10 20:19:02 2019(r352182)
+++ head/sys/kern/vfs_cache.c   Tue Sep 10 20:19:29 2019(r352183)
@@ -378,6 +378,8 @@ STATNODE_COUNTER(numfullpathfail2,
 "Number of fullpath search errors (VOP_VPTOCNP failures)");
 STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors 
(ENOMEM)");
 STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls");
+STATNODE_COUNTER(zap_and_exit_bucket_relock_success,
+"Number of successful removals after relocking");
 static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail,
 "Number of times zap_and_exit failed to lock");
 static long zap_and_exit_bucket_fail2; 
STATNODE_ULONG(zap_and_exit_bucket_fail2,
@@ -526,6 +528,19 @@ cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp
 }
 
 static void
+cache_lock_vnodes(struct mtx *vlp1, struct mtx *vlp2)
+{
+
+   MPASS(vlp1 != NULL || vlp2 != NULL);
+   MPASS(vlp1 <= vlp2);
+
+   if (vlp1 != NULL)
+   mtx_lock(vlp1);
+   if (vlp2 != NULL)
+   mtx_lock(vlp2);
+}
+
+static void
 cache_unlock_vnodes(struct mtx *vlp1, struct mtx *vlp2)
 {
 
@@ -992,10 +1007,47 @@ out:
return (error);
 }
 
+/*
+ * If trylocking failed we can get here. We know enough to take all needed 
locks
+ * in the right order and re-lookup the entry.
+ */
 static int
-cache_zap_wlocked_bucket(struct namecache *ncp, struct rwlock *blp)
+cache_zap_unlocked_bucket(struct namecache *ncp, struct componentname *cnp,
+struct vnode *dvp, struct mtx *dvlp, struct mtx *vlp, uint32_t hash,
+struct rwlock *blp)
 {
+   struct namecache *rncp;
+
+   cache_assert_bucket_locked(ncp, RA_UNLOCKED);
+
+   cache_sort_vnodes(, );
+   cache_lock_vnodes(dvlp, vlp);
+   rw_wlock(blp);
+   LIST_FOREACH(rncp, (NCHHASH(hash)), nc_hash) {
+   if (rncp == ncp && rncp->nc_dvp == dvp &&
+   rncp->nc_nlen == cnp->cn_namelen &&
+   !bcmp(rncp->nc_name, cnp->cn_nameptr, rncp->nc_nlen))
+   break;
+   }
+   if (rncp != NULL) {
+   cache_zap_locked(rncp, false);
+   rw_wunlock(blp);
+   cache_unlock_vnodes(dvlp, vlp);
+   counter_u64_add(zap_and_exit_bucket_relock_success, 1);
+   return (0);
+   }
+
+   rw_wunlock(blp);
+   cache_unlock_vnodes(dvlp, vlp);
+   return (EAGAIN);
+}
+
+static int __noinline
+cache_zap_wlocked_bucket(struct namecache *ncp, struct componentname *cnp,
+uint32_t hash, struct rwlock *blp)
+{
struct mtx *dvlp, *vlp;
+   struct vnode *dvp;
 
cache_assert_bucket_locked(ncp, RA_WLOCKED);
 
@@ -1010,14 +1062,17 @@ cache_zap_wlocked_bucket(struct namecache *ncp, struct
return (0);
}
 
+   dvp = ncp->nc_dvp;
rw_wunlock(blp);
-   return (EAGAIN);
+   return (cache_zap_unlocked_bucket(ncp, cnp, dvp, dvlp, vlp, hash, blp));
 }
 
-static int
-cache_zap_rlocked_bucket(struct namecache *ncp, struct rwlock *blp)
+static int __noinline
+cache_zap_rlocked_bucket(struct namecache *ncp, struct componentname *cnp,
+uint32_t hash, struct rwlock *blp)
 {
struct mtx *dvlp, *vlp;
+   struct vnode *dvp;
 
cache_assert_bucket_locked(ncp, RA_RLOCKED);
 
@@ -1034,8 +1089,9 @@ cache_zap_rlocked_bucket(struct namecache *ncp, struct
return (0);
}
 
+   dvp = ncp->nc_dvp;
rw_runlock(blp);
-   return (EAGAIN);
+   return (cache_zap_unlocked_bucket(ncp, cnp, dvp, dvlp, vlp, hash, blp));
 }
 
 static int
@@ -1197,7 +1253,7 @@ retry:
goto out_no_entry;
}
 
-   error = cache_zap_wlocked_bucket(ncp, blp);
+   error = cache_zap_wlocked_bucket(ncp, cnp, hash, blp);
if 

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

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:19:02 2019
New Revision: 352182
URL: https://svnweb.freebsd.org/changeset/base/352182

Log:
  MFCr350614:
exit1: fix style nits

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

Modified: stable/12/sys/kern/kern_exit.c
==
--- stable/12/sys/kern/kern_exit.c  Tue Sep 10 20:18:06 2019
(r352181)
+++ stable/12/sys/kern/kern_exit.c  Tue Sep 10 20:19:02 2019
(r352182)
@@ -456,7 +456,7 @@ exit1(struct thread *td, int rval, int signo)
PROC_LOCK(q);
q->p_sigparent = SIGCHLD;
 
-   if (!(q->p_flag & P_TRACED)) {
+   if ((q->p_flag & P_TRACED) == 0) {
proc_reparent(q, q->p_reaper, true);
if (q->p_state == PRS_ZOMBIE) {
/*
___
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: r352181 - in stable/12: sys/kern tests/sys/kern

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:18:06 2019
New Revision: 352181
URL: https://svnweb.freebsd.org/changeset/base/352181

Log:
  MFCr350612
procdesc: fix reparenting when the debugger is attached
  
The process is reparented to the debugger while it is attached.
  B  B
 /   >   |
A  A D
  
Every time when the process is reparented, it is added to the orphan list
of the previous parent:
  
A->orphan = B
D->orphan = NULL
  
When the A process will close the process descriptor to the B process,
the B process will be reparented to the init process.
  BB - init
  |   >
A D  A   D
  
A->orphan = B
D->orphan = B
  
In this scenario, the B process is in the orphan list of A and D.
  
When the last process descriptor is closed instead of reparenting
it to the reaper let it stay with the debugger process and set
our previews parent to the reaper.
  
Add test case for this situation.
Notice that without this patch the kernel will crash with this test case:
panic: orphan 0xf8000e990530 of 0xf8000e99 has unexpected oppid 
1
  
Reviewed by:  markj, kib
Differential Revision:https://reviews.freebsd.org/D20361

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

Modified: stable/12/sys/kern/sys_procdesc.c
==
--- stable/12/sys/kern/sys_procdesc.c   Tue Sep 10 20:15:52 2019
(r352180)
+++ stable/12/sys/kern/sys_procdesc.c   Tue Sep 10 20:18:06 2019
(r352181)
@@ -416,7 +416,13 @@ procdesc_close(struct file *fp, struct thread *td)
 * terminate with prejudice.
 */
p->p_sigparent = SIGCHLD;
-   proc_reparent(p, p->p_reaper, true);
+   if ((p->p_flag & P_TRACED) == 0) {
+   proc_reparent(p, p->p_reaper, true);
+   } else {
+   clear_orphan(p);
+   p->p_oppid = p->p_reaper->p_pid;
+   proc_add_orphan(p, p->p_reaper);
+   }
if ((pd->pd_flags & PDF_DAEMON) == 0)
kern_psignal(p, SIGKILL);
PROC_UNLOCK(p);

Modified: stable/12/tests/sys/kern/ptrace_test.c
==
--- stable/12/tests/sys/kern/ptrace_test.c  Tue Sep 10 20:15:52 2019
(r352180)
+++ stable/12/tests/sys/kern/ptrace_test.c  Tue Sep 10 20:18:06 2019
(r352181)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #define_WANT_MIPS_REGNUM
+#include 
 #include 
 #include 
 #include 
@@ -3906,6 +3907,60 @@ ATF_TC_BODY(ptrace__PT_LWPINFO_stale_siginfo, tc)
ATF_REQUIRE(errno == ECHILD);
 }
 
+/*
+ * Verify that when the process is traced that it isn't reparent
+ * to the init process when we close all process descriptors.
+ */
+ATF_TC(ptrace__proc_reparent);
+ATF_TC_HEAD(ptrace__proc_reparent, tc)
+{
+
+   atf_tc_set_md_var(tc, "timeout", "2");
+}
+ATF_TC_BODY(ptrace__proc_reparent, tc)
+{
+   pid_t traced, debuger, wpid;
+   int pd, status;
+
+   traced = pdfork(, 0);
+   ATF_REQUIRE(traced >= 0);
+   if (traced == 0) {
+   raise(SIGSTOP);
+   exit(0);
+   }
+   ATF_REQUIRE(pd >= 0);
+
+   debuger = fork();
+   ATF_REQUIRE(debuger >= 0);
+   if (debuger == 0) {
+   /* The traced process is reparented to debuger. */
+   ATF_REQUIRE(ptrace(PT_ATTACH, traced, 0, 0) == 0);
+   wpid = waitpid(traced, , 0);
+   ATF_REQUIRE(wpid == traced);
+   ATF_REQUIRE(WIFSTOPPED(status));
+   ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+   ATF_REQUIRE(close(pd) == 0);
+   ATF_REQUIRE(ptrace(PT_DETACH, traced, (caddr_t)1, 0) == 0);
+
+   /* We closed pd so we should not have any child. */
+   wpid = wait();
+   ATF_REQUIRE(wpid == -1);
+   ATF_REQUIRE(errno == ECHILD);
+
+   exit(0);
+   }
+
+   ATF_REQUIRE(close(pd) == 0);
+   wpid = waitpid(debuger, , 0);
+   ATF_REQUIRE(wpid == debuger);
+   ATF_REQUIRE(WEXITSTATUS(status) == 0);
+
+   /* Check if we still have any child. */
+   wpid = wait();
+   ATF_REQUIRE(wpid == -1);
+   ATF_REQUIRE(errno == ECHILD);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
@@ -3967,6 +4022,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread);
 #endif
ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo);
+   ATF_TP_ADD_TC(tp, ptrace__proc_reparent);
 
return (atf_no_error());
 }

svn commit: r352180 - in stable/12/sys: kern sys

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:15:52 2019
New Revision: 352180
URL: https://svnweb.freebsd.org/changeset/base/352180

Log:
  MFCr350611:
proc: introduce the proc_add_orphan function
  
This API allows adding the process to its parent orphan list.
  
Reviewed by:  kib, markj

Modified:
  stable/12/sys/kern/kern_exit.c
  stable/12/sys/sys/proc.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_exit.c
==
--- stable/12/sys/kern/kern_exit.c  Tue Sep 10 20:14:52 2019
(r352179)
+++ stable/12/sys/kern/kern_exit.c  Tue Sep 10 20:15:52 2019
(r352180)
@@ -1330,6 +1330,24 @@ loop_locked:
goto loop;
 }
 
+void
+proc_add_orphan(struct proc *child, struct proc *parent)
+{
+
+   sx_assert(_lock, SX_XLOCKED);
+   KASSERT((child->p_flag & P_TRACED) != 0,
+   ("proc_add_orphan: not traced"));
+
+   if (LIST_EMPTY(>p_orphans)) {
+   child->p_treeflag |= P_TREE_FIRST_ORPHAN;
+   LIST_INSERT_HEAD(>p_orphans, child, p_orphan);
+   } else {
+   LIST_INSERT_AFTER(LIST_FIRST(>p_orphans),
+   child, p_orphan);
+   }
+   child->p_treeflag |= P_TREE_ORPHANED;
+}
+
 /*
  * Make process 'parent' the new parent of process 'child'.
  * Must be called with an exclusive hold of proctree lock.
@@ -1350,16 +1368,8 @@ proc_reparent(struct proc *child, struct proc *parent,
LIST_INSERT_HEAD(>p_children, child, p_sibling);
 
clear_orphan(child);
-   if (child->p_flag & P_TRACED) {
-   if (LIST_EMPTY(>p_pptr->p_orphans)) {
-   child->p_treeflag |= P_TREE_FIRST_ORPHAN;
-   LIST_INSERT_HEAD(>p_pptr->p_orphans, child,
-   p_orphan);
-   } else {
-   LIST_INSERT_AFTER(LIST_FIRST(>p_pptr->p_orphans),
-   child, p_orphan);
-   }
-   child->p_treeflag |= P_TREE_ORPHANED;
+   if ((child->p_flag & P_TRACED) != 0) {
+   proc_add_orphan(child, child->p_pptr);
}
 
child->p_pptr = parent;

Modified: stable/12/sys/sys/proc.h
==
--- stable/12/sys/sys/proc.hTue Sep 10 20:14:52 2019(r352179)
+++ stable/12/sys/sys/proc.hTue Sep 10 20:15:52 2019(r352180)
@@ -1063,6 +1063,7 @@ void  proc_linkup(struct proc *p, struct thread *td);
 struct proc *proc_realparent(struct proc *child);
 void   proc_reap(struct thread *td, struct proc *p, int *status, int options);
 void   proc_reparent(struct proc *child, struct proc *newparent, bool 
set_oppid);
+void   proc_add_orphan(struct proc *child, struct proc *parent);
 void   proc_set_traced(struct proc *p, bool stop);
 void   proc_wkilled(struct proc *p);
 struct pstats *pstats_alloc(void);
___
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: r352179 - stable/12/sys/kern

2019-09-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Sep 10 20:14:52 2019
New Revision: 352179
URL: https://svnweb.freebsd.org/changeset/base/352179

Log:
  MFCr350610:
exit1: postpone clearing P_TRACED flag until the proctree lock is acquired
  
In case of the process being debugged. The P_TRACED is cleared very early,
which would make procdesc_close() not calling proc_clear_orphan().
That would result in the debugged process can not be able to collect
status of the process with process descriptor.
  
Reviewed by:  markj, kib
Tested by:pho

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

Modified: stable/12/sys/kern/kern_exit.c
==
--- stable/12/sys/kern/kern_exit.c  Tue Sep 10 20:11:00 2019
(r352178)
+++ stable/12/sys/kern/kern_exit.c  Tue Sep 10 20:14:52 2019
(r352179)
@@ -335,7 +335,6 @@ exit1(struct thread *td, int rval, int signo)
 */
PROC_LOCK(p);
stopprofclock(p);
-   p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE);
p->p_ptevents = 0;
 
/*
@@ -437,6 +436,11 @@ exit1(struct thread *td, int rval, int signo)
LIST_INSERT_HEAD(, p, p_list);
LIST_REMOVE(p, p_hash);
sx_xunlock(_lock);
+
+   sx_xlock(_lock);
+   PROC_LOCK(p);
+   p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE);
+   PROC_UNLOCK(p);
 
/*
 * Reparent all children processes:
___
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: r352178 - head/sys/kern

2019-09-10 Thread Mateusz Guzik
Author: mjg
Date: Tue Sep 10 20:11:00 2019
New Revision: 352178
URL: https://svnweb.freebsd.org/changeset/base/352178

Log:
  cache: change the formula for calculating lock array sizes
  
  It used to be mp_ncpus * 64, but this gives unnecessarily big values for small
  machines and at the same time constraints bigger ones. In particular this 
helps
  on a 104-way box for which the count is now doubled.
  
  While here make cache_purgevfs less likely. Currently it is not efficient in
  face of contention due to lock ordering issues. These are fixable but not 
worth
  it at the moment.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Tue Sep 10 20:08:24 2019(r352177)
+++ head/sys/kern/vfs_cache.c   Tue Sep 10 20:11:00 2019(r352178)
@@ -1879,19 +1879,21 @@ nchinit(void *dummy __unused)
UMA_ZONE_ZINIT);
 
nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, );
-   ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 1;
+   ncbuckethash = cache_roundup_2(mp_ncpus * mp_ncpus) - 1;
+   if (ncbuckethash < 7) /* arbitrarily chosen to avoid having one lock */
+   ncbuckethash = 7;
if (ncbuckethash > nchash)
ncbuckethash = nchash;
bucketlocks = malloc(sizeof(*bucketlocks) * numbucketlocks, M_VFSCACHE,
M_WAITOK | M_ZERO);
for (i = 0; i < numbucketlocks; i++)
rw_init_flags([i], "ncbuc", RW_DUPOK | RW_RECURSE);
-   ncvnodehash = cache_roundup_2(mp_ncpus * 64) - 1;
+   ncvnodehash = ncbuckethash;
vnodelocks = malloc(sizeof(*vnodelocks) * numvnodelocks, M_VFSCACHE,
M_WAITOK | M_ZERO);
for (i = 0; i < numvnodelocks; i++)
mtx_init([i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE);
-   ncpurgeminvnodes = numbucketlocks;
+   ncpurgeminvnodes = numbucketlocks * 2;
 
ncneghash = 3;
neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE,
___
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: r352177 - head/sys/kern

2019-09-10 Thread Mateusz Guzik
Author: mjg
Date: Tue Sep 10 20:08:24 2019
New Revision: 352177
URL: https://svnweb.freebsd.org/changeset/base/352177

Log:
  cache: assorted cleanups
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Tue Sep 10 19:08:01 2019(r352176)
+++ head/sys/kern/vfs_cache.c   Tue Sep 10 20:08:24 2019(r352177)
@@ -380,6 +380,8 @@ STATNODE_COUNTER(numfullpathfail4, "Number of fullpath
 STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls");
 static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail,
 "Number of times zap_and_exit failed to lock");
+static long zap_and_exit_bucket_fail2; 
STATNODE_ULONG(zap_and_exit_bucket_fail2,
+"Number of times zap_and_exit failed to lock");
 static long cache_lock_vnodes_cel_3_failures;
 STATNODE_ULONG(cache_lock_vnodes_cel_3_failures,
 "Number of times 3-way vnode locking failed");
@@ -394,7 +396,7 @@ static int cache_yield;
 SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, _yield, 0,
 "Number of times cache called yield");
 
-static void
+static void __noinline
 cache_maybe_yield(void)
 {
 
@@ -453,12 +455,14 @@ cache_assert_bucket_locked(struct namecache *ncp, int 
 #define cache_assert_bucket_locked(x, y) do { } while (0)
 #endif
 
-#define cache_sort(x, y)   _cache_sort((void **)(x), (void **)(y))
+#define cache_sort_vnodes(x, y)_cache_sort_vnodes((void **)(x), (void 
**)(y))
 static void
-_cache_sort(void **p1, void **p2)
+_cache_sort_vnodes(void **p1, void **p2)
 {
void *tmp;
 
+   MPASS(*p1 != NULL || *p2 != NULL);
+
if (*p1 > *p2) {
tmp = *p2;
*p2 = *p1;
@@ -506,8 +510,7 @@ static int
 cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp2)
 {
 
-   cache_sort(, );
-   MPASS(vlp2 != NULL);
+   cache_sort_vnodes(, );
 
if (vlp1 != NULL) {
if (!mtx_trylock(vlp1))
@@ -924,7 +927,7 @@ cache_zap_locked_vnode_kl2(struct namecache *ncp, stru
mtx_unlock(*vlpp);
*vlpp = NULL;
}
-   cache_sort(, );
+   cache_sort_vnodes(, );
if (vlp1 == pvlp) {
mtx_lock(vlp2);
to_unlock = vlp2;
@@ -950,7 +953,7 @@ out_relock:
return (false);
 }
 
-static int
+static int __noinline
 cache_zap_locked_vnode(struct namecache *ncp, struct vnode *vp)
 {
struct mtx *pvlp, *vlp1, *vlp2, *to_unlock;
@@ -969,7 +972,7 @@ cache_zap_locked_vnode(struct namecache *ncp, struct v
blp = NCP2BUCKETLOCK(ncp);
vlp1 = VP2VNODELOCK(ncp->nc_dvp);
vlp2 = VP2VNODELOCK(ncp->nc_vp);
-   cache_sort(, );
+   cache_sort_vnodes(, );
if (vlp1 == pvlp) {
mtx_lock(vlp2);
to_unlock = vlp2;
@@ -1047,7 +1050,7 @@ cache_zap_wlocked_bucket_kl(struct namecache *ncp, str
vlp = NULL;
if (!(ncp->nc_flag & NCF_NEGATIVE))
vlp = VP2VNODELOCK(ncp->nc_vp);
-   cache_sort(, );
+   cache_sort_vnodes(, );
 
if (*vlpp1 == dvlp && *vlpp2 == vlp) {
cache_zap_locked(ncp, false);
@@ -1194,14 +1197,13 @@ retry:
goto out_no_entry;
}
 
-   counter_u64_add(numposzaps, 1);
-
error = cache_zap_wlocked_bucket(ncp, blp);
-   if (error != 0) {
+   if (__predict_false(error != 0)) {
zap_and_exit_bucket_fail++;
cache_maybe_yield();
goto retry;
}
+   counter_u64_add(numposzaps, 1);
cache_free(ncp);
return (0);
 out_no_entry:
@@ -1397,8 +1399,8 @@ zap_and_exit:
error = cache_zap_rlocked_bucket(ncp, blp);
else
error = cache_zap_locked_vnode(ncp, dvp);
-   if (error != 0) {
-   zap_and_exit_bucket_fail++;
+   if (__predict_false(error != 0)) {
+   zap_and_exit_bucket_fail2++;
cache_maybe_yield();
goto retry;
}
@@ -1434,7 +1436,7 @@ cache_lock_vnodes_cel(struct celockstate *cel, struct 
 
vlp1 = VP2VNODELOCK(vp);
vlp2 = VP2VNODELOCK(dvp);
-   cache_sort(, );
+   cache_sort_vnodes(, );
 
if (vlp1 != NULL) {
mtx_lock(vlp1);
@@ -1504,7 +1506,7 @@ cache_lock_buckets_cel(struct celockstate *cel, struct
MPASS(cel->blp[0] == NULL);
MPASS(cel->blp[1] == NULL);
 
-   cache_sort(, );
+   cache_sort_vnodes(, );
 
if (blp1 != NULL) {
rw_wlock(blp1);
___
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: r352176 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs compat/linuxkpi/common/src dev/drm2/ttm dev/xen/gntdev dev/xen/privcmd kern vm

2019-09-10 Thread Jeff Roberson
Author: jeff
Date: Tue Sep 10 19:08:01 2019
New Revision: 352176
URL: https://svnweb.freebsd.org/changeset/base/352176

Log:
  Replace redundant code with a few new vm_page_grab facilities:
   - VM_ALLOC_NOCREAT will grab without creating a page.
   - vm_page_grab_valid() will grab and page in if necessary.
   - vm_page_busy_acquire() automates some busy acquire loops.
  
  Discussed with:   alc, kib, markj
  Tested by:pho (part of larger branch)
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D21546

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/compat/linuxkpi/common/src/linux_page.c
  head/sys/dev/drm2/ttm/ttm_bo_vm.c
  head/sys/dev/drm2/ttm/ttm_tt.c
  head/sys/dev/xen/gntdev/gntdev.c
  head/sys/dev/xen/privcmd/privcmd.c
  head/sys/kern/uipc_shm.c
  head/sys/vm/vm_glue.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 
10 18:46:32 2019(r352175)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 
10 19:08:01 2019(r352176)
@@ -412,33 +412,14 @@ page_busy(vnode_t *vp, int64_t start, int64_t off, int
obj = vp->v_object;
zfs_vmobject_assert_wlocked(obj);
 
-   for (;;) {
-   if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL &&
-   pp->valid) {
-   if (vm_page_xbusied(pp)) {
-   /*
-* Reference the page before unlocking and
-* sleeping so that the page daemon is less
-* likely to reclaim it.
-*/
-   vm_page_reference(pp);
-   vm_page_sleep_if_xbusy(pp, "zfsmwb");
-   continue;
-   }
-   vm_page_sbusy(pp);
-   } else if (pp != NULL) {
-   ASSERT(!pp->valid);
-   pp = NULL;
-   }
-
-   if (pp != NULL) {
-   ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL);
-   vm_object_pip_add(obj, 1);
-   pmap_remove_write(pp);
-   if (nbytes != 0)
-   vm_page_clear_dirty(pp, off, nbytes);
-   }
-   break;
+   vm_page_grab_valid(, obj, OFF_TO_IDX(start), VM_ALLOC_NOCREAT |
+   VM_ALLOC_SBUSY | VM_ALLOC_NORMAL | VM_ALLOC_IGN_SBUSY);
+   if (pp != NULL) {
+   ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL);
+   vm_object_pip_add(obj, 1);
+   pmap_remove_write(pp);
+   if (nbytes != 0)
+   vm_page_clear_dirty(pp, off, nbytes);
}
return (pp);
 }
@@ -455,32 +436,14 @@ static vm_page_t
 page_wire(vnode_t *vp, int64_t start)
 {
vm_object_t obj;
-   vm_page_t pp;
+   vm_page_t m;
 
obj = vp->v_object;
zfs_vmobject_assert_wlocked(obj);
 
-   for (;;) {
-   if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL &&
-   pp->valid) {
-   if (vm_page_xbusied(pp)) {
-   /*
-* Reference the page before unlocking and
-* sleeping so that the page daemon is less
-* likely to reclaim it.
-*/
-   vm_page_reference(pp);
-   vm_page_sleep_if_xbusy(pp, "zfsmwb");
-   continue;
-   }
-
-   ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL);
-   vm_page_wire(pp);
-   } else
-   pp = NULL;
-   break;
-   }
-   return (pp);
+   vm_page_grab_valid(, obj, OFF_TO_IDX(start), VM_ALLOC_NOCREAT |
+   VM_ALLOC_WIRED | VM_ALLOC_IGN_SBUSY | VM_ALLOC_NOBUSY);
+   return (m);
 }
 
 static void

Modified: head/sys/compat/linuxkpi/common/src/linux_page.c
==
--- head/sys/compat/linuxkpi/common/src/linux_page.cTue Sep 10 18:46:32 
2019(r352175)
+++ head/sys/compat/linuxkpi/common/src/linux_page.cTue Sep 10 19:08:01 
2019(r352176)
@@ -286,27 +286,11 @@ linux_shmem_read_mapping_page_gfp(vm_object_t obj, int
panic("GFP_NOWAIT is unimplemented");
 
VM_OBJECT_WLOCK(obj);
-   page = vm_page_grab(obj, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY |
-   VM_ALLOC_WIRED);
-   if 

svn commit: r352175 - head/lib/libkvm

2019-09-10 Thread Leandro Lupori
Author: luporl
Date: Tue Sep 10 18:46:32 2019
New Revision: 352175
URL: https://svnweb.freebsd.org/changeset/base/352175

Log:
  Add powerpc support to libkvm probe function
  
  PowerPC kernels are of DYN type, instead of EXEC.
  
  Reviewed by:  jhibbits
  Differential Revision:https://reviews.freebsd.org/D21583

Modified:
  head/lib/libkvm/kvm_private.c

Modified: head/lib/libkvm/kvm_private.c
==
--- head/lib/libkvm/kvm_private.c   Tue Sep 10 18:27:45 2019
(r352174)
+++ head/lib/libkvm/kvm_private.c   Tue Sep 10 18:46:32 2019
(r352175)
@@ -131,7 +131,8 @@ _kvm_probe_elf_kernel(kvm_t *kd, int class, int machin
 {
 
return (kd->nlehdr.e_ident[EI_CLASS] == class &&
-   kd->nlehdr.e_type == ET_EXEC &&
+   ((machine == EM_PPC || machine == EM_PPC64) ?
+kd->nlehdr.e_type == ET_DYN : kd->nlehdr.e_type == ET_EXEC) &&
kd->nlehdr.e_machine == machine);
 }
 
___
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: r352174 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/drm2/ttm kern vm

2019-09-10 Thread Jeff Roberson
Author: jeff
Date: Tue Sep 10 18:27:45 2019
New Revision: 352174
URL: https://svnweb.freebsd.org/changeset/base/352174

Log:
  Use the sleepq lock rather than the page lock to protect against wakeup
  races with page busy state.  The object lock is still used as an interlock
  to ensure that the identity stays valid.  Most callers should use
  vm_page_sleep_if_busy() to handle the locking particulars.
  
  Reviewed by:  alc, kib, markj
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D21255

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/dev/drm2/ttm/ttm_bo_vm.c
  head/sys/kern/vfs_bio.c
  head/sys/vm/phys_pager.c
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 
10 17:55:07 2019(r352173)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 
10 18:27:45 2019(r352174)
@@ -422,10 +422,7 @@ page_busy(vnode_t *vp, int64_t start, int64_t off, int
 * likely to reclaim it.
 */
vm_page_reference(pp);
-   vm_page_lock(pp);
-   zfs_vmobject_wunlock(obj);
-   vm_page_busy_sleep(pp, "zfsmwb", true);
-   zfs_vmobject_wlock(obj);
+   vm_page_sleep_if_xbusy(pp, "zfsmwb");
continue;
}
vm_page_sbusy(pp);
@@ -473,10 +470,7 @@ page_wire(vnode_t *vp, int64_t start)
 * likely to reclaim it.
 */
vm_page_reference(pp);
-   vm_page_lock(pp);
-   zfs_vmobject_wunlock(obj);
-   vm_page_busy_sleep(pp, "zfsmwb", true);
-   zfs_vmobject_wlock(obj);
+   vm_page_sleep_if_xbusy(pp, "zfsmwb");
continue;
}
 

Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
==
--- head/sys/dev/drm2/ttm/ttm_bo_vm.c   Tue Sep 10 17:55:07 2019
(r352173)
+++ head/sys/dev/drm2/ttm/ttm_bo_vm.c   Tue Sep 10 18:27:45 2019
(r352174)
@@ -232,10 +232,7 @@ reserve:
 
VM_OBJECT_WLOCK(vm_obj);
if (vm_page_busied(m)) {
-   vm_page_lock(m);
-   VM_OBJECT_WUNLOCK(vm_obj);
-   vm_page_busy_sleep(m, "ttmpbs", false);
-   VM_OBJECT_WLOCK(vm_obj);
+   vm_page_sleep_if_busy(m, "ttmpbs");
ttm_mem_io_unlock(man);
ttm_bo_unreserve(bo);
goto retry;

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Tue Sep 10 17:55:07 2019(r352173)
+++ head/sys/kern/vfs_bio.c Tue Sep 10 18:27:45 2019(r352174)
@@ -2931,12 +2931,8 @@ vfs_vmio_invalidate(struct buf *bp)
presid = resid > (PAGE_SIZE - poffset) ?
(PAGE_SIZE - poffset) : resid;
KASSERT(presid >= 0, ("brelse: extra page"));
-   while (vm_page_xbusied(m)) {
-   vm_page_lock(m);
-   VM_OBJECT_WUNLOCK(obj);
-   vm_page_busy_sleep(m, "mbncsh", true);
-   VM_OBJECT_WLOCK(obj);
-   }
+   while (vm_page_xbusied(m))
+   vm_page_sleep_if_xbusy(m, "mbncsh");
if (pmap_page_wired_mappings(m) == 0)
vm_page_set_invalid(m, poffset, presid);
vm_page_release_locked(m, flags);
@@ -4565,10 +4561,7 @@ vfs_drain_busy_pages(struct buf *bp)
for (; last_busied < i; last_busied++)
vm_page_sbusy(bp->b_pages[last_busied]);
while (vm_page_xbusied(m)) {
-   vm_page_lock(m);
-   VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object);
-   vm_page_busy_sleep(m, "vbpage", true);
-   VM_OBJECT_WLOCK(bp->b_bufobj->bo_object);
+   vm_page_sleep_if_xbusy(m, "vbpage");
}
}
}

Modified: head/sys/vm/phys_pager.c
==
--- head/sys/vm/phys_pager.cTue Sep 10 17:55:07 2019(r352173)
+++ 

svn commit: r352173 - in head/sys/arm64: arm64 conf

2019-09-10 Thread Kyle Evans
Author: kevans
Date: Tue Sep 10 17:55:07 2019
New Revision: 352173
URL: https://svnweb.freebsd.org/changeset/base/352173

Log:
  ... it was so easy, and I goofed it up. Correct dir

Modified:
Directory Properties:
  head/sys/arm64/arm64/   (props changed)
  head/sys/arm64/conf/   (props changed)
___
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: r352172 - head/sys/arm64/arm64

2019-09-10 Thread Kyle Evans
Author: kevans
Date: Tue Sep 10 17:53:54 2019
New Revision: 352172
URL: https://svnweb.freebsd.org/changeset/base/352172

Log:
  Ignore LINT kernconf on arm64

Modified:
Directory Properties:
  head/sys/arm64/arm64/   (props changed)
___
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: r352171 - in head/contrib/llvm: include/llvm/TextAPI/MachO lib/Target/Nios2 lib/TextAPI/MachO tools/lldb/source/Plugins/ExpressionParser/Go tools/lldb/source/Plugins/Language/Go tools/l...

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:51:22 2019
New Revision: 352171
URL: https://svnweb.freebsd.org/changeset/base/352171

Log:
  Remove dirs (and their now-empty parents) empty since r344779

Deleted:
  head/contrib/llvm/include/llvm/TextAPI/MachO/
  head/contrib/llvm/lib/Target/Nios2/
  head/contrib/llvm/lib/TextAPI/MachO/
  head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Go/
  head/contrib/llvm/tools/lldb/source/Plugins/Language/Go/
  head/contrib/llvm/tools/lldb/source/Plugins/Language/Java/
  head/contrib/llvm/tools/lldb/source/Plugins/Language/OCaml/
  head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/Go/
  head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/Java/
  head/contrib/llvm/tools/lldb/source/Plugins/OperatingSystem/Go/
  head/contrib/llvm/tools/llvm-mca/include/
  head/contrib/llvm/tools/llvm-mca/lib/
___
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: r352170 - head/contrib/llvm/include/llvm/BinaryFormat/WasmRelocs

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:50:00 2019
New Revision: 352170
URL: https://svnweb.freebsd.org/changeset/base/352170

Log:
  Remove dir empty since r327952

Deleted:
  head/contrib/llvm/include/llvm/BinaryFormat/WasmRelocs/
___
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: r352169 - head/contrib/compiler-rt/lib/sancov

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:49:18 2019
New Revision: 352169
URL: https://svnweb.freebsd.org/changeset/base/352169

Log:
  Remove dir empty since r314564

Deleted:
  head/contrib/compiler-rt/lib/sancov/
___
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: r352168 - in head/contrib/llvm: include/llvm/MC/MCAnalysis lib/ExecutionEngine/JIT lib/MC/MCAnalysis

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:47:38 2019
New Revision: 352168
URL: https://svnweb.freebsd.org/changeset/base/352168

Log:
  Remove dirs empty since r280031

Deleted:
  head/contrib/llvm/include/llvm/MC/MCAnalysis/
  head/contrib/llvm/lib/ExecutionEngine/JIT/
  head/contrib/llvm/lib/MC/MCAnalysis/
___
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: r352167 - head/contrib/compiler-rt/lib/builtins/armv6m

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:46:30 2019
New Revision: 352167
URL: https://svnweb.freebsd.org/changeset/base/352167

Log:
  Remove dir empty since r276851

Deleted:
  head/contrib/compiler-rt/lib/builtins/armv6m/
___
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: r352166 - vendor-crypto/openssl/1.0.2t

2019-09-10 Thread Jung-uk Kim
Author: jkim
Date: Tue Sep 10 17:43:01 2019
New Revision: 352166
URL: https://svnweb.freebsd.org/changeset/base/352166

Log:
  Tag OpenSSL 1.0.2t.

Added:
  vendor-crypto/openssl/1.0.2t/
 - copied from r352165, vendor-crypto/openssl/dist-1.0.2/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352165 - in vendor-crypto/openssl/dist-1.0.2: . apps crypto crypto/bn crypto/cms crypto/ec crypto/pem crypto/pkcs7 crypto/rsa crypto/x509 crypto/x509v3 util

2019-09-10 Thread Jung-uk Kim
Author: jkim
Date: Tue Sep 10 17:42:17 2019
New Revision: 352165
URL: https://svnweb.freebsd.org/changeset/base/352165

Log:
  Import OpenSSL 1.0.2t.

Modified:
  vendor-crypto/openssl/dist-1.0.2/CHANGES
  vendor-crypto/openssl/dist-1.0.2/Configure
  vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade
  vendor-crypto/openssl/dist-1.0.2/Makefile
  vendor-crypto/openssl/dist-1.0.2/NEWS
  vendor-crypto/openssl/dist-1.0.2/README
  vendor-crypto/openssl/dist-1.0.2/apps/CA.pl
  vendor-crypto/openssl/dist-1.0.2/crypto/arm_arch.h
  vendor-crypto/openssl/dist-1.0.2/crypto/armcap.c
  vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile
  vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c
  vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h
  vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_env.c
  vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_lcl.h
  vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_smime.c
  vendor-crypto/openssl/dist-1.0.2/crypto/constant_time_locl.h
  vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/Makefile
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec.h
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_asn1.c
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_curve.c
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_err.c
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ecp_nistp224.c
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ecp_nistp256.c
  vendor-crypto/openssl/dist-1.0.2/crypto/ec/ecp_nistp521.c
  vendor-crypto/openssl/dist-1.0.2/crypto/opensslv.h
  vendor-crypto/openssl/dist-1.0.2/crypto/pem/pvkfmt.c
  vendor-crypto/openssl/dist-1.0.2/crypto/pkcs7/pk7_doit.c
  vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_chk.c
  vendor-crypto/openssl/dist-1.0.2/crypto/x509/x509_cmp.c
  vendor-crypto/openssl/dist-1.0.2/crypto/x509v3/v3_alt.c
  vendor-crypto/openssl/dist-1.0.2/util/libeay.num

Modified: vendor-crypto/openssl/dist-1.0.2/CHANGES
==
--- vendor-crypto/openssl/dist-1.0.2/CHANGESTue Sep 10 17:41:39 2019
(r352164)
+++ vendor-crypto/openssl/dist-1.0.2/CHANGESTue Sep 10 17:42:17 2019
(r352165)
@@ -7,6 +7,48 @@
  https://github.com/openssl/openssl/commits/ and pick the appropriate
  release branch.
 
+ Changes between 1.0.2s and 1.0.2t [10 Sep 2019]
+
+   *) For built-in EC curves, ensure an EC_GROUP built from the curve name is
+  used even when parsing explicit parameters, when loading a serialized key
+  or calling `EC_GROUP_new_from_ecpkparameters()`/
+  `EC_GROUP_new_from_ecparameters()`.
+  This prevents bypass of security hardening and performance gains,
+  especially for curves with specialized EC_METHODs.
+  By default, if a key encoded with explicit parameters is loaded and later
+  serialized, the output is still encoded with explicit parameters, even if
+  internally a "named" EC_GROUP is used for computation.
+  [Nicola Tuveri]
+
+  *) Compute ECC cofactors if not provided during EC_GROUP construction. Before
+ this change, EC_GROUP_set_generator would accept order and/or cofactor as
+ NULL. After this change, only the cofactor parameter can be NULL. It also
+ does some minimal sanity checks on the passed order.
+ (CVE-2019-1547)
+ [Billy Bob Brumley]
+
+  *) Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey.
+ An attack is simple, if the first CMS_recipientInfo is valid but the
+ second CMS_recipientInfo is chosen ciphertext. If the second
+ recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct
+ encryption key will be replaced by garbage, and the message cannot be
+ decoded, but if the RSA decryption fails, the correct encryption key is
+ used and the recipient will not notice the attack.
+ As a work around for this potential attack the length of the decrypted
+ key must be equal to the cipher default key length, in case the
+ certifiate is not given and all recipientInfo are tried out.
+ The old behaviour can be re-enabled in the CMS code by setting the
+ CMS_DEBUG_DECRYPT flag.
+ (CVE-2019-1563)
+ [Bernd Edlinger]
+
+  *) Document issue with installation paths in diverse Windows builds
+
+ '/usr/local/ssl' is an unsafe prefix for location to install OpenSSL
+ binaries and run-time config file.
+ (CVE-2019-1552)
+ [Richard Levitte]
+
  Changes between 1.0.2r and 1.0.2s [28 May 2019]
 
   *) Change the default RSA, DSA and DH size to 2048 bit instead of 1024.

Modified: vendor-crypto/openssl/dist-1.0.2/Configure
==
--- vendor-crypto/openssl/dist-1.0.2/Configure  Tue Sep 10 17:41:39 2019
(r352164)
+++ vendor-crypto/openssl/dist-1.0.2/Configure  Tue Sep 10 17:42:17 2019
(r352165)
@@ -118,7 +118,7 @@ my 

svn commit: r352164 - vendor-crypto/openssl/1.1.1d

2019-09-10 Thread Jung-uk Kim
Author: jkim
Date: Tue Sep 10 17:41:39 2019
New Revision: 352164
URL: https://svnweb.freebsd.org/changeset/base/352164

Log:
  Tag OpenSSL 1.1.1d.

Added:
  vendor-crypto/openssl/1.1.1d/
 - copied from r352163, vendor-crypto/openssl/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352163 - in vendor-crypto/openssl/dist: . apps crypto crypto/aes/asm crypto/asn1 crypto/bio crypto/bn crypto/bn/asm crypto/cms crypto/conf crypto/dh crypto/dsa crypto/dso crypto/ec cry...

2019-09-10 Thread Jung-uk Kim
Author: jkim
Date: Tue Sep 10 17:40:53 2019
New Revision: 352163
URL: https://svnweb.freebsd.org/changeset/base/352163

Log:
  Import OpenSSL 1.1.1d.

Added:
  vendor-crypto/openssl/dist/doc/man3/CRYPTO_memcmp.pod
  vendor-crypto/openssl/dist/doc/man3/X509_cmp.pod
Deleted:
  vendor-crypto/openssl/dist/crypto/aes/asm/aes-586.pl
  vendor-crypto/openssl/dist/crypto/aes/asm/aes-x86_64.pl
  vendor-crypto/openssl/dist/crypto/aes/asm/bsaes-x86_64.pl
Modified:
  vendor-crypto/openssl/dist/CHANGES
  vendor-crypto/openssl/dist/Configure
  vendor-crypto/openssl/dist/FREEBSD-upgrade
  vendor-crypto/openssl/dist/INSTALL
  vendor-crypto/openssl/dist/NEWS
  vendor-crypto/openssl/dist/README
  vendor-crypto/openssl/dist/apps/apps.c
  vendor-crypto/openssl/dist/apps/apps.h
  vendor-crypto/openssl/dist/apps/ca.c
  vendor-crypto/openssl/dist/apps/dgst.c
  vendor-crypto/openssl/dist/apps/enc.c
  vendor-crypto/openssl/dist/apps/ocsp.c
  vendor-crypto/openssl/dist/apps/openssl.c
  vendor-crypto/openssl/dist/apps/pkcs12.c
  vendor-crypto/openssl/dist/apps/req.c
  vendor-crypto/openssl/dist/apps/s_apps.h
  vendor-crypto/openssl/dist/apps/s_cb.c
  vendor-crypto/openssl/dist/apps/s_client.c
  vendor-crypto/openssl/dist/apps/speed.c
  vendor-crypto/openssl/dist/apps/storeutl.c
  vendor-crypto/openssl/dist/config
  vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl
  vendor-crypto/openssl/dist/crypto/asn1/a_time.c
  vendor-crypto/openssl/dist/crypto/asn1/a_type.c
  vendor-crypto/openssl/dist/crypto/asn1/x_bignum.c
  vendor-crypto/openssl/dist/crypto/bio/b_addr.c
  vendor-crypto/openssl/dist/crypto/bio/bss_dgram.c
  vendor-crypto/openssl/dist/crypto/bio/bss_file.c
  vendor-crypto/openssl/dist/crypto/bio/bss_mem.c
  vendor-crypto/openssl/dist/crypto/bn/asm/mips.pl
  vendor-crypto/openssl/dist/crypto/bn/bn_div.c
  vendor-crypto/openssl/dist/crypto/bn/bn_lcl.h
  vendor-crypto/openssl/dist/crypto/bn/bn_lib.c
  vendor-crypto/openssl/dist/crypto/bn/bn_prime.c
  vendor-crypto/openssl/dist/crypto/bn/bn_rand.c
  vendor-crypto/openssl/dist/crypto/bn/bn_sqrt.c
  vendor-crypto/openssl/dist/crypto/cms/cms_att.c
  vendor-crypto/openssl/dist/crypto/cms/cms_env.c
  vendor-crypto/openssl/dist/crypto/cms/cms_err.c
  vendor-crypto/openssl/dist/crypto/cms/cms_lcl.h
  vendor-crypto/openssl/dist/crypto/cms/cms_sd.c
  vendor-crypto/openssl/dist/crypto/cms/cms_smime.c
  vendor-crypto/openssl/dist/crypto/conf/conf_sap.c
  vendor-crypto/openssl/dist/crypto/ctype.c
  vendor-crypto/openssl/dist/crypto/dh/dh_check.c
  vendor-crypto/openssl/dist/crypto/dh/dh_gen.c
  vendor-crypto/openssl/dist/crypto/dh/dh_key.c
  vendor-crypto/openssl/dist/crypto/dh/dh_lib.c
  vendor-crypto/openssl/dist/crypto/dsa/dsa_ameth.c
  vendor-crypto/openssl/dist/crypto/dsa/dsa_err.c
  vendor-crypto/openssl/dist/crypto/dsa/dsa_ossl.c
  vendor-crypto/openssl/dist/crypto/dso/dso_dlfcn.c
  vendor-crypto/openssl/dist/crypto/ec/asm/ecp_nistz256-sparcv9.pl
  vendor-crypto/openssl/dist/crypto/ec/asm/ecp_nistz256-x86_64.pl
  vendor-crypto/openssl/dist/crypto/ec/asm/x25519-ppc64.pl
  vendor-crypto/openssl/dist/crypto/ec/ec_asn1.c
  vendor-crypto/openssl/dist/crypto/ec/ec_curve.c
  vendor-crypto/openssl/dist/crypto/ec/ec_lcl.h
  vendor-crypto/openssl/dist/crypto/ec/ec_lib.c
  vendor-crypto/openssl/dist/crypto/ec/ecdh_ossl.c
  vendor-crypto/openssl/dist/crypto/ec/ecdsa_ossl.c
  vendor-crypto/openssl/dist/crypto/ec/ecp_nistp224.c
  vendor-crypto/openssl/dist/crypto/ec/ecp_nistp256.c
  vendor-crypto/openssl/dist/crypto/ec/ecp_nistp521.c
  vendor-crypto/openssl/dist/crypto/ec/ecp_nistputil.c
  vendor-crypto/openssl/dist/crypto/ec/ecx_meth.c
  vendor-crypto/openssl/dist/crypto/engine/eng_devcrypto.c
  vendor-crypto/openssl/dist/crypto/engine/eng_openssl.c
  vendor-crypto/openssl/dist/crypto/err/err.c
  vendor-crypto/openssl/dist/crypto/err/openssl.txt
  vendor-crypto/openssl/dist/crypto/evp/bio_ok.c
  vendor-crypto/openssl/dist/crypto/evp/e_aes.c
  vendor-crypto/openssl/dist/crypto/evp/e_aria.c
  vendor-crypto/openssl/dist/crypto/evp/e_chacha20_poly1305.c
  vendor-crypto/openssl/dist/crypto/evp/e_rc5.c
  vendor-crypto/openssl/dist/crypto/evp/evp_err.c
  vendor-crypto/openssl/dist/crypto/evp/evp_lib.c
  vendor-crypto/openssl/dist/crypto/evp/m_sha3.c
  vendor-crypto/openssl/dist/crypto/include/internal/ctype.h
  vendor-crypto/openssl/dist/crypto/include/internal/rand_int.h
  vendor-crypto/openssl/dist/crypto/include/internal/sm2err.h
  vendor-crypto/openssl/dist/crypto/init.c
  vendor-crypto/openssl/dist/crypto/lhash/lhash.c
  vendor-crypto/openssl/dist/crypto/o_str.c
  vendor-crypto/openssl/dist/crypto/pem/pvkfmt.c
  vendor-crypto/openssl/dist/crypto/pkcs7/pk7_doit.c
  vendor-crypto/openssl/dist/crypto/rand/drbg_lib.c
  vendor-crypto/openssl/dist/crypto/rand/rand_err.c
  vendor-crypto/openssl/dist/crypto/rand/rand_lcl.h
  vendor-crypto/openssl/dist/crypto/rand/rand_lib.c
  vendor-crypto/openssl/dist/crypto/rand/rand_unix.c
  vendor-crypto/openssl/dist/crypto/rsa/rsa_ameth.c
  

svn commit: r352162 - head/contrib/libxo/m4

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:31:06 2019
New Revision: 352162
URL: https://svnweb.freebsd.org/changeset/base/352162

Log:
  Remove empty directory after r297894

Deleted:
  head/contrib/libxo/m4/
___
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: r352161 - head/contrib/ipfilter/ipsd

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:30:05 2019
New Revision: 352161
URL: https://svnweb.freebsd.org/changeset/base/352161

Log:
  Remove empty dir after r342815 (pt 2, oops)

Deleted:
  head/contrib/ipfilter/ipsd/
___
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: r352160 - head/contrib/ipfilter/net

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:26:46 2019
New Revision: 352160
URL: https://svnweb.freebsd.org/changeset/base/352160

Log:
  Remove empty dir after r288683

Deleted:
  head/contrib/ipfilter/net/
___
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: r352159 - head/contrib/ipfilter/ipsd/Celler

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:26:20 2019
New Revision: 352159
URL: https://svnweb.freebsd.org/changeset/base/352159

Log:
  Remove empty dir after r342815

Deleted:
  head/contrib/ipfilter/ipsd/Celler/
___
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: r352158 - head/contrib/wpa/src/hlr_auc_gw

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:20:24 2019
New Revision: 352158
URL: https://svnweb.freebsd.org/changeset/base/352158

Log:
  Remove dir empty since r214734

Deleted:
  head/contrib/wpa/src/hlr_auc_gw/
___
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: r352157 - in head/contrib/wpa: patches wpa_supplicant/tests

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 17:19:43 2019
New Revision: 352157
URL: https://svnweb.freebsd.org/changeset/base/352157

Log:
  Remove dirs empty since r336203

Deleted:
  head/contrib/wpa/patches/
  head/contrib/wpa/wpa_supplicant/tests/
___
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: r352156 - head/contrib/apr/include/private

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:58:19 2019
New Revision: 352156
URL: https://svnweb.freebsd.org/changeset/base/352156

Log:
  Remove directory empty after r266735

Deleted:
  head/contrib/apr/include/private/
___
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: r352155 - head/contrib/traceroute/lbl

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:57:35 2019
New Revision: 352155
URL: https://svnweb.freebsd.org/changeset/base/352155

Log:
  Remove empty directory after r215937

Deleted:
  head/contrib/traceroute/lbl/
___
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: r352154 - head/crypto/heimdal/lib/sqlite

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:56:43 2019
New Revision: 352154
URL: https://svnweb.freebsd.org/changeset/base/352154

Log:
  Remove empty directory after r342871

Deleted:
  head/crypto/heimdal/lib/sqlite/
___
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: r352153 - head/sys/gnu/dts/include/dt-bindings/genpd

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:53:16 2019
New Revision: 352153
URL: https://svnweb.freebsd.org/changeset/base/352153

Log:
  Remove empty directory imported with r342935

Deleted:
  head/sys/gnu/dts/include/dt-bindings/genpd/
___
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: r352152 - head/usr.sbin/bsdconfig/fdisk

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:51:52 2019
New Revision: 352152
URL: https://svnweb.freebsd.org/changeset/base/352152

Log:
  Remove empty directory imported with r238438

Deleted:
  head/usr.sbin/bsdconfig/fdisk/
___
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: r352151 - head/cddl/contrib/opensolaris/common/avl

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:50:38 2019
New Revision: 352151
URL: https://svnweb.freebsd.org/changeset/base/352151

Log:
  Remove now-empty directory after r288337

Deleted:
  head/cddl/contrib/opensolaris/common/avl/
___
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: r352150 - in head/contrib/netbsd-tests: crypto/libcrypto/bf crypto/libcrypto/bn crypto/libcrypto/cast crypto/libcrypto/des crypto/libcrypto/dh crypto/libcrypto/dsa crypto/libcrypto/ec c...

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:48:49 2019
New Revision: 352150
URL: https://svnweb.freebsd.org/changeset/base/352150

Log:
  Remove now-empty directories after r272458

Deleted:
  head/contrib/netbsd-tests/crypto/libcrypto/bf/
  head/contrib/netbsd-tests/crypto/libcrypto/bn/
  head/contrib/netbsd-tests/crypto/libcrypto/cast/
  head/contrib/netbsd-tests/crypto/libcrypto/des/
  head/contrib/netbsd-tests/crypto/libcrypto/dh/
  head/contrib/netbsd-tests/crypto/libcrypto/dsa/
  head/contrib/netbsd-tests/crypto/libcrypto/ec/
  head/contrib/netbsd-tests/crypto/libcrypto/ecdh/
  head/contrib/netbsd-tests/crypto/libcrypto/ecdsa/
  head/contrib/netbsd-tests/crypto/libcrypto/engine/
  head/contrib/netbsd-tests/crypto/libcrypto/evp/
  head/contrib/netbsd-tests/crypto/libcrypto/hmac/
  head/contrib/netbsd-tests/crypto/libcrypto/idea/
  head/contrib/netbsd-tests/crypto/libcrypto/lhash/
  head/contrib/netbsd-tests/crypto/libcrypto/md2/
  head/contrib/netbsd-tests/crypto/libcrypto/md4/
  head/contrib/netbsd-tests/crypto/libcrypto/md5/
  head/contrib/netbsd-tests/crypto/libcrypto/mdc2/
  head/contrib/netbsd-tests/crypto/libcrypto/rand/
  head/contrib/netbsd-tests/crypto/libcrypto/rc2/
  head/contrib/netbsd-tests/crypto/libcrypto/rc4/
  head/contrib/netbsd-tests/crypto/libcrypto/rc5/
  head/contrib/netbsd-tests/crypto/libcrypto/ripemd/
  head/contrib/netbsd-tests/crypto/libcrypto/rsa/
  head/contrib/netbsd-tests/crypto/libcrypto/sha/
  head/contrib/netbsd-tests/crypto/libcrypto/sha1/
  head/contrib/netbsd-tests/crypto/libcrypto/srp/
  head/contrib/netbsd-tests/crypto/libcrypto/threads/
  head/contrib/netbsd-tests/crypto/libcrypto/x509v3/
  head/contrib/netbsd-tests/dev/usb/libhid/
  head/contrib/netbsd-tests/dev/usb/t_hid/
  head/contrib/netbsd-tests/lib/libposix/bsd/
  head/contrib/netbsd-tests/lib/libposix/posix1/
  head/contrib/netbsd-tests/lib/libposix/posix2/
  head/contrib/netbsd-tests/lib/libtre/
___
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: r352149 - in head/tools/tools/nanobsd: gateworks rescue/Pkg

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:43:05 2019
New Revision: 352149
URL: https://svnweb.freebsd.org/changeset/base/352149

Log:
  Remove gateworks directories left over from r336136

Deleted:
  head/tools/tools/nanobsd/gateworks/
  head/tools/tools/nanobsd/rescue/Pkg/
___
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: r352148 - in head/sys/modules: if_tap if_tun

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:41:00 2019
New Revision: 352148
URL: https://svnweb.freebsd.org/changeset/base/352148

Log:
  Remove empty tap/tun modules directories after r347241

Deleted:
  head/sys/modules/if_tap/
  head/sys/modules/if_tun/
___
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: r352147 - head/usr.bin/send-pr

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:40:00 2019
New Revision: 352147
URL: https://svnweb.freebsd.org/changeset/base/352147

Log:
  Remove leftover usr.bin/send-pr after r338042

Deleted:
  head/usr.bin/send-pr/
___
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: r352146 - head/sys/mips/gxemul

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:38:52 2019
New Revision: 352146
URL: https://svnweb.freebsd.org/changeset/base/352146

Log:
  Remove empty directory after r342256

Deleted:
  head/sys/mips/gxemul/
___
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: r352145 - head/stand/sparc64/zfsloader

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:37:32 2019
New Revision: 352145
URL: https://svnweb.freebsd.org/changeset/base/352145

Log:
  Remove empty directory aftre r336532

Deleted:
  head/stand/sparc64/zfsloader/
___
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: r352143 - in head/sys/modules: drm drm2

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:35:31 2019
New Revision: 352143
URL: https://svnweb.freebsd.org/changeset/base/352143

Log:
  Remove empty directories after drm removal

Deleted:
  head/sys/modules/drm/
  head/sys/modules/drm2/
___
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: r352144 - in head: lib/libnandfs sbin/nandfs sbin/newfs_nandfs sys/dev/nand sys/fs/nandfs usr.sbin/nandsim usr.sbin/nandtool

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:36:09 2019
New Revision: 352144
URL: https://svnweb.freebsd.org/changeset/base/352144

Log:
  Remove more directories left over from nand removal

Deleted:
  head/lib/libnandfs/
  head/sbin/nandfs/
  head/sbin/newfs_nandfs/
  head/sys/dev/nand/
  head/sys/fs/nandfs/
  head/usr.sbin/nandsim/
  head/usr.sbin/nandtool/
___
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: r352141 - in head/sys/modules: nand nandfs nandsim

2019-09-10 Thread Warner Losh
Author: imp
Date: Tue Sep 10 16:30:06 2019
New Revision: 352141
URL: https://svnweb.freebsd.org/changeset/base/352141

Log:
  Remove empty directories left over from nand removal

Deleted:
  head/sys/modules/nand/
  head/sys/modules/nandfs/
  head/sys/modules/nandsim/
___
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: r352140 - head/sys/sys

2019-09-10 Thread Leandro Lupori
Author: luporl
Date: Tue Sep 10 16:16:05 2019
New Revision: 352140
URL: https://svnweb.freebsd.org/changeset/base/352140

Log:
  Add R_PPC_IRELATIVE relocation
  
  Pre-requisite for most ifunc related changes.
  
  Reviewed by:  jhibbits
  Differential Revision:https://reviews.freebsd.org/D21587

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Tue Sep 10 15:42:34 2019(r352139)
+++ head/sys/sys/elf_common.h   Tue Sep 10 16:16:05 2019(r352140)
@@ -1199,6 +1199,7 @@ typedef struct {
 #defineR_PPC_SECTOFF_LO34
 #defineR_PPC_SECTOFF_HI35
 #defineR_PPC_SECTOFF_HA36
+#defineR_PPC_IRELATIVE 248
 
 /*
  * 64-bit relocations
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349352 - in head: etc/mtree include lib lib/libnandfs sbin sbin/camcontrol sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk stand stand/arm/uboot stand/common stan

2019-09-10 Thread Hans Petter Selasky

On 2019-06-25 06:50, Warner Losh wrote:

Author: imp
Date: Tue Jun 25 04:50:09 2019
New Revision: 349352
URL: https://svnweb.freebsd.org/changeset/base/349352

Log:
   Remove NAND and NANDFS support
   
   NANDFS has been broken for years. Remove it. The NAND drivers that

   remain are for ancient parts that are no longer relevant. They are
   polled, have terrible performance and just for ancient arm
   hardware. NAND parts have evolved significantly from this early work
   and little to none of it would be relevant should someone need to
   update to support raw nand. This code has been off by default for
   years and has violated the vnode protocol leading to panics since it
   was committed.
   
   Numerous posts to arch@ and other locations have found no actual users

   for this software.
   
   Relnotes:	Yes

   No Objection From: arch@
   Differential Revision: https://reviews.freebsd.org/D20745



This change leaves behind a bunch of empty directories in SVN? Cleanup?

--HPS

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352138 - in head: etc/mtree usr.bin/locale usr.bin/locale/tests

2019-09-10 Thread Yuri Pankov
Author: yuripv
Date: Tue Sep 10 15:09:46 2019
New Revision: 352138
URL: https://svnweb.freebsd.org/changeset/base/352138

Log:
  locale: handle day, abday, mon, abmon, am_pm keywords
  
  All of these are defined as mandatory by POSIX.
  
  While here, mark all non-standard ones as FreeBSD-only as
  other systems (at least, GNU/Linux and illumos) do not handle
  them, so we should not encourage their use.
  
  PR:   237752
  Reviewed by:  bapt
  Differential Revision:https://reviews.freebsd.org/D21490

Added:
  head/usr.bin/locale/tests/
  head/usr.bin/locale/tests/Makefile   (contents, props changed)
  head/usr.bin/locale/tests/k_flag_posix_messages.out   (contents, props 
changed)
  head/usr.bin/locale/tests/k_flag_posix_monetary.out   (contents, props 
changed)
  head/usr.bin/locale/tests/k_flag_posix_numeric.out   (contents, props changed)
  head/usr.bin/locale/tests/k_flag_posix_time.out   (contents, props changed)
  head/usr.bin/locale/tests/locale_test.sh   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.bin/locale/Makefile
  head/usr.bin/locale/locale.c

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Tue Sep 10 14:33:07 2019
(r352137)
+++ head/etc/mtree/BSD.tests.dist   Tue Sep 10 15:09:46 2019
(r352138)
@@ -1010,6 +1010,8 @@
 ..
 limits
 ..
+locale
+..
 m4
 ..
 mkimg

Modified: head/usr.bin/locale/Makefile
==
--- head/usr.bin/locale/MakefileTue Sep 10 14:33:07 2019
(r352137)
+++ head/usr.bin/locale/MakefileTue Sep 10 15:09:46 2019
(r352138)
@@ -1,6 +1,12 @@
 # $FreeBSD$
 
+.include 
+
 PROG=  locale
 CFLAGS+= -I${SRCTOP}/lib/libc/locale
+LIBADD+= sbuf
+
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
 
 .include 

Modified: head/usr.bin/locale/locale.c
==
--- head/usr.bin/locale/locale.cTue Sep 10 14:33:07 2019
(r352137)
+++ head/usr.bin/locale/locale.cTue Sep 10 15:09:46 2019
(r352138)
@@ -39,6 +39,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -59,7 +60,7 @@ void  list_charmaps(void);
 void   list_locales(void);
 const char *lookup_localecat(int);
 char   *kwval_lconv(int);
-intkwval_lookup(const char *, char **, int *, int *);
+intkwval_lookup(const char *, char **, int *, int *, int *);
 void   showdetails(const char *);
 void   showkeywordslist(char *substring);
 void   showlocale(void);
@@ -87,141 +88,258 @@ static const struct _lcinfo {
 #defineNLCINFO nitems(lcinfo)
 
 /* ids for values not referenced by nl_langinfo() */
-#defineKW_ZERO 1
-#defineKW_GROUPING (KW_ZERO+1)
-#defineKW_INT_CURR_SYMBOL  (KW_ZERO+2)
-#defineKW_CURRENCY_SYMBOL  (KW_ZERO+3)
-#defineKW_MON_DECIMAL_POINT(KW_ZERO+4)
-#defineKW_MON_THOUSANDS_SEP(KW_ZERO+5)
-#defineKW_MON_GROUPING (KW_ZERO+6)
-#defineKW_POSITIVE_SIGN(KW_ZERO+7)
-#defineKW_NEGATIVE_SIGN(KW_ZERO+8)
-#defineKW_INT_FRAC_DIGITS  (KW_ZERO+9)
-#defineKW_FRAC_DIGITS  (KW_ZERO+10)
-#defineKW_P_CS_PRECEDES(KW_ZERO+11)
-#defineKW_P_SEP_BY_SPACE   (KW_ZERO+12)
-#defineKW_N_CS_PRECEDES(KW_ZERO+13)
-#defineKW_N_SEP_BY_SPACE   (KW_ZERO+14)
-#defineKW_P_SIGN_POSN  (KW_ZERO+15)
-#defineKW_N_SIGN_POSN  (KW_ZERO+16)
-#defineKW_INT_P_CS_PRECEDES(KW_ZERO+17)
-#defineKW_INT_P_SEP_BY_SPACE   (KW_ZERO+18)
-#defineKW_INT_N_CS_PRECEDES(KW_ZERO+19)
-#defineKW_INT_N_SEP_BY_SPACE   (KW_ZERO+20)
-#defineKW_INT_P_SIGN_POSN  (KW_ZERO+21)
-#defineKW_INT_N_SIGN_POSN  (KW_ZERO+22)
+enum {
+   KW_GROUPING,
+   KW_INT_CURR_SYMBOL,
+   KW_CURRENCY_SYMBOL,
+   KW_MON_DECIMAL_POINT,
+   KW_MON_THOUSANDS_SEP,
+   KW_MON_GROUPING,
+   KW_POSITIVE_SIGN,
+   KW_NEGATIVE_SIGN,
+   KW_INT_FRAC_DIGITS,
+   KW_FRAC_DIGITS,
+   KW_P_CS_PRECEDES,
+   KW_P_SEP_BY_SPACE,
+   KW_N_CS_PRECEDES,
+   KW_N_SEP_BY_SPACE,
+   KW_P_SIGN_POSN,
+   KW_N_SIGN_POSN,
+   KW_INT_P_CS_PRECEDES,
+   KW_INT_P_SEP_BY_SPACE,
+   KW_INT_N_CS_PRECEDES,
+   KW_INT_N_SEP_BY_SPACE,
+   KW_INT_P_SIGN_POSN,
+   KW_INT_N_SIGN_POSN,
+   KW_TIME_DAY,
+   KW_TIME_ABDAY,
+   KW_TIME_MON,
+   KW_TIME_ABMON,
+   KW_TIME_AM_PM
+};
 
+enum {
+   SRC_LINFO,
+   SRC_LCONV,
+   SRC_LTIME
+};
+
 static const struct _kwinfo {
const char  *name;
int isstr;  /* true - string, false - number 

svn commit: r352137 - head/sys/net

2019-09-10 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Sep 10 14:33:07 2019
New Revision: 352137
URL: https://svnweb.freebsd.org/changeset/base/352137

Log:
  Callout drain does not have to be followed by a callout stop call.
  Fix bogus code.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/net/if_spppsubr.c

Modified: head/sys/net/if_spppsubr.c
==
--- head/sys/net/if_spppsubr.c  Tue Sep 10 14:30:10 2019(r352136)
+++ head/sys/net/if_spppsubr.c  Tue Sep 10 14:33:07 2019(r352137)
@@ -1060,15 +1060,13 @@ sppp_detach(struct ifnet *ifp)
KASSERT(mtx_initialized(>mtx), ("sppp mutex is not initialized"));
 
/* Stop keepalive handler. */
-   if (!callout_drain(>keepalive_callout))
-   callout_stop(>keepalive_callout);
+   callout_drain(>keepalive_callout);
 
for (i = 0; i < IDX_COUNT; i++) {
-   if (!callout_drain(>ch[i]))
-   callout_stop(>ch[i]);
+   callout_drain(>ch[i]);
}
-   if (!callout_drain(>pap_my_to_ch))
-   callout_stop(>pap_my_to_ch);
+   callout_drain(>pap_my_to_ch);
+
mtx_destroy(>pp_cpq.ifq_mtx);
mtx_destroy(>pp_fastq.ifq_mtx);
mtx_destroy(>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: r352136 - head/contrib/libedit

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 14:30:10 2019
New Revision: 352136
URL: https://svnweb.freebsd.org/changeset/base/352136

Log:
  Import libedit 2019-09-10
  
  Compared to current version in base:
  - great improvements on the Unicode support
  - full support for filename completion including quoting
which means we do not need anymore our custom addition)
  - Improved readline compatiblity
  
  Upgrading libedit has been a pain in the past, because somehow we never
  managed to properly cleanup the tree in lib/libedit and each merge has always
  been very painful. After years of fighting give up and refresh a merge from
  scrarch properly in contrib.
  
  Note that the switch to this version will be done in another commit.

Added:
  head/contrib/libedit/
 - copied from r352135, vendor/NetBSD/libedit/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r352113 - head/sys/net

2019-09-10 Thread Ian Lepore
On Tue, 2019-09-10 at 01:56 +, Conrad Meyer wrote:
> Author: cem
> Date: Tue Sep 10 01:56:47 2019
> New Revision: 352113
> URL: https://svnweb.freebsd.org/changeset/base/352113
> 
> Log:
>   Appease Clang false-positive Werrors in r352112
>   
>   Reported by:bcran
> 
> Modified:
>   head/sys/net/rtsock.c
> 
> Modified: head/sys/net/rtsock.c
> =
> =
> --- head/sys/net/rtsock.c Mon Sep  9 22:54:27 2019(r352112)
> +++ head/sys/net/rtsock.c Tue Sep 10 01:56:47 2019(r352113)
> @@ -2105,7 +2105,7 @@ rt_dumpentry_ddb(struct radix_node *rn, void
> *arg __un
>  
>   if (flags != rt->rt_flags)
>   db_printf(",");
> - db_printf(rt_flag_name(idx));
> + db_printf("%s", rt_flag_name(idx));
>  
>   flags &= ~(1ul << idx);
>   }
> @@ -2374,8 +2374,12 @@ _DB_FUNC(_show, route, db_show_route_cmd,
> db_show_tabl
>   u.dest_sin6.sin6_addr.s6_addr16[i] =
> htons(hextets[i]);
>   dstp = (void *)_sin6;
>   dst_addrp = _sin6.sin6_addr;
> - } else
> + } else {
>   MPASS(false);
> + /* UNREACHABLE */
> + /* Appease Clang false positive: */
> + dstp = NULL;
> + }
>  
>   bp = inet_ntop(af, dst_addrp, buf, sizeof(buf));
>   if (bp != NULL)
> 

I don't think this was a false positive.  MPASS resolves to KASSERT
which resolves to nothing when built without INVARIANTS defined.  So
that comment is misleading, the code isn't unreachable, and after
falling through, dstp is going to be dereferenced a few lines later.

Instead of just squelching the coverity error, I think it should lead
to the question: Does it make any sense to assert in a ddb command
handler?  Would it make more sense to make that else block do something
like db_printf("Unexpected address family %d\n", af); goto exit; ?

-- Ian

___
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: r352135 - in vendor/NetBSD/libedit/2019-09-10: . TEST readline

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 13:56:36 2019
New Revision: 352135
URL: https://svnweb.freebsd.org/changeset/base/352135

Log:
  Tag import of libedit snapshot 2019-09-10

Added:
  vendor/NetBSD/libedit/2019-09-10/
 - copied from r338453, vendor/NetBSD/libedit/dist/
  vendor/NetBSD/libedit/2019-09-10/TEST/test_filecompletion.c
 - copied unchanged from r352134, 
vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c
Replaced:
  vendor/NetBSD/libedit/2019-09-10/TEST/Makefile
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/TEST/Makefile
  vendor/NetBSD/libedit/2019-09-10/chared.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/chared.c
  vendor/NetBSD/libedit/2019-09-10/chartype.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/chartype.c
  vendor/NetBSD/libedit/2019-09-10/common.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/common.c
  vendor/NetBSD/libedit/2019-09-10/editline.3
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/editline.3
  vendor/NetBSD/libedit/2019-09-10/el.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/el.c
  vendor/NetBSD/libedit/2019-09-10/el.h
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/el.h
  vendor/NetBSD/libedit/2019-09-10/eln.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/eln.c
  vendor/NetBSD/libedit/2019-09-10/filecomplete.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/filecomplete.c
  vendor/NetBSD/libedit/2019-09-10/hist.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/hist.c
  vendor/NetBSD/libedit/2019-09-10/history.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/history.c
  vendor/NetBSD/libedit/2019-09-10/keymacro.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/keymacro.c
  vendor/NetBSD/libedit/2019-09-10/literal.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/literal.c
  vendor/NetBSD/libedit/2019-09-10/map.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/map.c
  vendor/NetBSD/libedit/2019-09-10/parse.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/parse.c
  vendor/NetBSD/libedit/2019-09-10/read.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/read.c
  vendor/NetBSD/libedit/2019-09-10/readline.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/readline.c
  vendor/NetBSD/libedit/2019-09-10/readline/readline.h
 - copied unchanged from r352134, 
vendor/NetBSD/libedit/dist/readline/readline.h
  vendor/NetBSD/libedit/2019-09-10/refresh.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/refresh.c
  vendor/NetBSD/libedit/2019-09-10/search.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/search.c
  vendor/NetBSD/libedit/2019-09-10/shlib_version
 - copied unchanged from r286801, vendor/NetBSD/libedit/dist/shlib_version
  vendor/NetBSD/libedit/2019-09-10/terminal.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/terminal.c
  vendor/NetBSD/libedit/2019-09-10/tty.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/tty.c
  vendor/NetBSD/libedit/2019-09-10/tty.h
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/tty.h
  vendor/NetBSD/libedit/2019-09-10/vi.c
 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/vi.c

Copied: vendor/NetBSD/libedit/2019-09-10/TEST/Makefile (from r352134, 
vendor/NetBSD/libedit/dist/TEST/Makefile)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/NetBSD/libedit/2019-09-10/TEST/Makefile  Tue Sep 10 13:56:36 
2019(r352135, copy of r352134, vendor/NetBSD/libedit/dist/TEST/Makefile)
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.8 2017/10/15 18:59:00 abhinav Exp $
+
+NOMAN=1
+PROG=wtc1 test_filecompletion
+CPPFLAGS=-I${.CURDIR}/..
+LDADD+=-ledit -ltermlib
+DPADD+=${LIBEDIT} ${LIBTERMLIB}
+
+.ifdef DEBUG
+CPPFLAGS+=-DDEBUG
+.endif
+
+.include 

Copied: vendor/NetBSD/libedit/2019-09-10/TEST/test_filecompletion.c (from 
r352134, vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/NetBSD/libedit/2019-09-10/TEST/test_filecompletion.c Tue Sep 10 
13:56:36 2019(r352135, copy of r352134, 
vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c)
@@ -0,0 +1,553 @@
+/* $NetBSD: test_filecompletion.c,v 1.5 2019/09/08 05:50:58 abhinav Exp $  
*/
+
+/*-
+ * Copyright (c) 2017 Abhinav Upadhyay 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of 

svn commit: r352134 - in vendor/NetBSD/libedit/dist: . TEST readline

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 13:55:44 2019
New Revision: 352134
URL: https://svnweb.freebsd.org/changeset/base/352134

Log:
  Update libedit to snapshot 2019-09-10

Added:
  vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c   (contents, props 
changed)
Modified:
  vendor/NetBSD/libedit/dist/TEST/Makefile
  vendor/NetBSD/libedit/dist/chared.c
  vendor/NetBSD/libedit/dist/chartype.c
  vendor/NetBSD/libedit/dist/common.c
  vendor/NetBSD/libedit/dist/editline.3
  vendor/NetBSD/libedit/dist/el.c
  vendor/NetBSD/libedit/dist/el.h
  vendor/NetBSD/libedit/dist/eln.c
  vendor/NetBSD/libedit/dist/filecomplete.c
  vendor/NetBSD/libedit/dist/hist.c
  vendor/NetBSD/libedit/dist/history.c
  vendor/NetBSD/libedit/dist/keymacro.c
  vendor/NetBSD/libedit/dist/literal.c
  vendor/NetBSD/libedit/dist/map.c
  vendor/NetBSD/libedit/dist/parse.c
  vendor/NetBSD/libedit/dist/read.c
  vendor/NetBSD/libedit/dist/readline.c
  vendor/NetBSD/libedit/dist/readline/readline.h
  vendor/NetBSD/libedit/dist/refresh.c
  vendor/NetBSD/libedit/dist/search.c
  vendor/NetBSD/libedit/dist/terminal.c
  vendor/NetBSD/libedit/dist/tty.c
  vendor/NetBSD/libedit/dist/tty.h
  vendor/NetBSD/libedit/dist/vi.c

Modified: vendor/NetBSD/libedit/dist/TEST/Makefile
==
--- vendor/NetBSD/libedit/dist/TEST/MakefileTue Sep 10 09:57:24 2019
(r352133)
+++ vendor/NetBSD/libedit/dist/TEST/MakefileTue Sep 10 13:55:44 2019
(r352134)
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.7 2016/03/23 22:27:48 christos Exp $
+# $NetBSD: Makefile,v 1.8 2017/10/15 18:59:00 abhinav Exp $
 
 NOMAN=1
-PROG=wtc1
+PROG=wtc1 test_filecompletion
 CPPFLAGS=-I${.CURDIR}/..
 LDADD+=-ledit -ltermlib
 DPADD+=${LIBEDIT} ${LIBTERMLIB}

Added: vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c   Tue Sep 10 
13:55:44 2019(r352134)
@@ -0,0 +1,553 @@
+/* $NetBSD: test_filecompletion.c,v 1.5 2019/09/08 05:50:58 abhinav Exp $  
*/
+
+/*-
+ * Copyright (c) 2017 Abhinav Upadhyay 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "filecomplete.h"
+#include "el.h"
+
+typedef struct {
+   const wchar_t *user_typed_text; /* The actual text typed by the user on 
the terminal */
+   const char *completion_function_input ; /*the text received by 
fn_filename_completion_function */
+   const char *expanded_text[2]; /* the value to which 
completion_function_input should be expanded */
+   const wchar_t *escaped_output; /* expected escaped value of 
expanded_text */
+} test_input;
+
+static test_input inputs[] = {
+   {
+   /* simple test for escaping angular brackets */
+   L"ls ang",
+   "ang",
+   {"angtest", NULL},
+   L"ls ang\\test "
+   },
+   {
+   /* test angular bracket inside double quotes: ls "dq_ang */
+   L"ls \"dq_ang",
+   "dq_ang",
+   {"dq_angtest", NULL},
+   L"ls \"dq_angtest\""
+   },
+   {
+   /* test angular bracket inside singlq quotes: ls "sq_ang */
+   L"ls 'sq_ang",
+   "sq_ang",
+   {"sq_angtest", NULL},
+   L"ls 'sq_angtest'"
+   },
+   {
+   /* simple test for backslash */
+   L"ls back",
+   

svn commit: r352133 - stable/11/usr.bin/proccontrol

2019-09-10 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 10 09:57:24 2019
New Revision: 352133
URL: https://svnweb.freebsd.org/changeset/base/352133

Log:
  MFC r351774:
  Add stackgap control mode to proccontrol(1).
  
  PR:   239894

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

Modified: stable/11/usr.bin/proccontrol/proccontrol.c
==
--- stable/11/usr.bin/proccontrol/proccontrol.c Tue Sep 10 08:51:11 2019
(r352132)
+++ stable/11/usr.bin/proccontrol/proccontrol.c Tue Sep 10 09:57:24 2019
(r352133)
@@ -42,6 +42,7 @@ enum {
MODE_INVALID,
MODE_TRACE,
MODE_TRAPCAP,
+   MODE_STACKGAP,
 };
 
 static pid_t
@@ -62,7 +63,7 @@ static void __dead2
 usage(void)
 {
 
-   fprintf(stderr, "Usage: proccontrol -m (trace|trapcap) [-q] "
+   fprintf(stderr, "Usage: proccontrol -m (trace|trapcap|stackgap) [-q] "
"[-s (enable|disable)] [-p pid | command]\n");
exit(1);
 }
@@ -85,6 +86,8 @@ main(int argc, char *argv[])
mode = MODE_TRACE;
else if (strcmp(optarg, "trapcap") == 0)
mode = MODE_TRAPCAP;
+   else if (strcmp(optarg, "stackgap") == 0)
+   mode = MODE_STACKGAP;
else
usage();
break;
@@ -127,6 +130,9 @@ main(int argc, char *argv[])
case MODE_TRAPCAP:
error = procctl(P_PID, pid, PROC_TRAPCAP_STATUS, );
break;
+   case MODE_STACKGAP:
+   error = procctl(P_PID, pid, PROC_STACKGAP_STATUS, );
+   break;
default:
usage();
break;
@@ -152,6 +158,26 @@ main(int argc, char *argv[])
break;
}
break;
+   case MODE_STACKGAP:
+   switch (arg & (PROC_STACKGAP_ENABLE |
+   PROC_STACKGAP_DISABLE)) {
+   case PROC_STACKGAP_ENABLE:
+   printf("enabled\n");
+   break;
+   case PROC_STACKGAP_DISABLE:
+   printf("disabled\n");
+   break;
+   }
+   switch (arg & (PROC_STACKGAP_ENABLE_EXEC |
+   PROC_STACKGAP_DISABLE_EXEC)) {
+   case PROC_STACKGAP_ENABLE_EXEC:
+   printf("enabled after exec\n");
+   break;
+   case PROC_STACKGAP_DISABLE_EXEC:
+   printf("disabled after exec\n");
+   break;
+   }
+   break;
}
} else {
switch (mode) {
@@ -164,6 +190,12 @@ main(int argc, char *argv[])
arg = enable ? PROC_TRAPCAP_CTL_ENABLE :
PROC_TRAPCAP_CTL_DISABLE;
error = procctl(P_PID, pid, PROC_TRAPCAP_CTL, );
+   break;
+   case MODE_STACKGAP:
+   arg = enable ? PROC_STACKGAP_ENABLE_EXEC :
+   (PROC_STACKGAP_DISABLE |
+   PROC_STACKGAP_DISABLE_EXEC);
+   error = procctl(P_PID, pid, PROC_STACKGAP_CTL, );
break;
default:
usage();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352132 - head/sys/net

2019-09-10 Thread Li-Wen Hsu
Author: lwhsu
Date: Tue Sep 10 08:51:11 2019
New Revision: 352132
URL: https://svnweb.freebsd.org/changeset/base/352132

Log:
  Fix build for the platforms where db_expr_t is not long
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/rtsock.c

Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Tue Sep 10 08:28:44 2019(r352131)
+++ head/sys/net/rtsock.c   Tue Sep 10 08:51:11 2019(r352132)
@@ -2226,7 +2226,7 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl
 
if (af == AF_INET && db_tok_number > UINT8_MAX) {
db_printf("Not a valid v4 octet: %ld\n",
-   db_tok_number);
+   (long)db_tok_number);
goto exit;
}
hextets[i] = db_tok_number;
___
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: r352131 - head

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 08:28:44 2019
New Revision: 352131
URL: https://svnweb.freebsd.org/changeset/base/352131

Log:
  Fix bad path
  
  Reported by:  zeising

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Sep 10 08:19:46 2019(r352130)
+++ head/ObsoleteFiles.inc  Tue Sep 10 08:28:44 2019(r352131)
@@ -39,9 +39,9 @@
 # done
 
 # 20190910: mklocale(1) and colldef(1) removed
-OLD_FILES+=usr.bin/mklocale
+OLD_FILES+=usr/bin/mklocale
 OLD_FILES+=usr/share/man/man1/mklocale.1.gz
-OLD_FILES+=usr.bin/colldef
+OLD_FILES+=usr/bin/colldef
 OLD_FILES+=usr/share/man/man1/colldef.1.gz
 # 20190904: Remove boot1.efifat
 OLD_FILES+=boot/boot1.efifat
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r352128 - in head: . usr.bin usr.bin/colldef usr.bin/mklocale

2019-09-10 Thread Niclas Zeising

On 2019-09-10 09:54, Baptiste Daroussin wrote:

Author: bapt
Date: Tue Sep 10 07:54:49 2019
New Revision: 352128
URL: https://svnweb.freebsd.org/changeset/base/352128

Log:
   Remove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11
   
   In FreeBSD 11 along with the rework on the collation, mklocale(1) and colldef(1)

   has been replaced by localedef(1) (a note has been added to the manpage to 
state
   it).
   mklocale(1) and colldef(1) has been kept around to be able to build older
   versions of FreeBSD. None of the version requiring those tools are supported
   anymore so it is time to remove them from base

Deleted:
   head/usr.bin/colldef/
   head/usr.bin/mklocale/
Modified:
   head/ObsoleteFiles.inc
   head/usr.bin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Sep 10 07:47:52 2019(r352127)
+++ head/ObsoleteFiles.inc  Tue Sep 10 07:54:49 2019(r352128)
@@ -38,6 +38,11 @@
  #   xargs -n1 | sort | uniq -d;
  # done
  
+# 20190910: mklocale(1) and colldef(1) removed

+OLD_FILES+=usr.bin/mklocale

^^
should be usr/bin/mklocale

+OLD_FILES+=usr/share/man/man1/mklocale.1.gz
+OLD_FILES+=usr.bin/colldef

^^
should be usr/bin/colldef

+OLD_FILES+=usr/share/man/man1/colldef.1.gz
  # 20190904: Remove boot1.efifat
  OLD_FILES+=boot/boot1.efifat
  # 20190903: pc-sysinstall(8) removed




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


De unieke domeinnaam publie.nl wordt verkocht

2019-09-10 Thread Stella Simons
Geachte dames en heren,

Graag maken wij u erop attent dat de domein: publie.nl wordt verkocht.
Heeft U interesse?

Met vriendelijke groet,

Stella Simons
___
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: r352130 - head/sbin/devd

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 08:19:46 2019
New Revision: 352130
URL: https://svnweb.freebsd.org/changeset/base/352130

Log:
  Stop linking to libl by specifying we do not need yywrap
  
  MFC after: 3 days

Modified:
  head/sbin/devd/Makefile
  head/sbin/devd/token.l

Modified: head/sbin/devd/Makefile
==
--- head/sbin/devd/Makefile Tue Sep 10 07:56:57 2019(r352129)
+++ head/sbin/devd/Makefile Tue Sep 10 08:19:46 2019(r352130)
@@ -34,7 +34,7 @@ MAN=  devd.8 devd.conf.5
 
 NO_SHARED?=YES
 
-LIBADD=l util
+LIBADD=util
 
 YFLAGS+=-v
 CFLAGS+=-I. -I${.CURDIR}

Modified: head/sbin/devd/token.l
==
--- head/sbin/devd/token.l  Tue Sep 10 07:56:57 2019(r352129)
+++ head/sbin/devd/token.l  Tue Sep 10 08:19:46 2019(r352130)
@@ -50,6 +50,7 @@ update_lineno(const char *cp)
 
 %}
 
+%option noyywrap
 %option nounput
 %option noinput
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2019-09-10 Thread Brooks Davis
On Mon, Sep 09, 2019 at 01:49:50PM -0600, Warner Losh wrote:
> On Mon, Sep 9, 2019, 5:56 AM Brooks Davis  wrote:
> 
> > On Sat, Sep 07, 2019 at 12:23:03PM +0800, Philip Paeps wrote:
> > > On 2019-09-07 12:06:32 (+0800), Warner Losh wrote:
> > > > On Fri, Sep 6, 2019 at 9:54 PM Philip Paeps 
> > > > wrote:
> > > >> On 2019-09-06 22:18:36 (+0800), Ian Lepore wrote:
> > > >>> On Fri, 2019-09-06 at 12:15 +0800, Philip Paeps wrote:
> > >  On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote:
> > > > On Fri, 2019-09-06 at 01:19 +, Philip Paeps wrote:
> > > >> Log:
> > > >>   riscv: default to HZ=100
> > > >
> > > > This seems like a bad idea.  I've run a 90mhz armv4 chip with
> > > > HZ=1000 and didn't notice any performance hit from doing so.
> > > > Almost all arm kernel config files set HZ as an option, so that
> > > > define doesn't do much for arm these days.  It probably does still
> > > > set HZ for various mips platforms.
> > > >
> > > > I would think 1000 is appropriate for anything modern running at
> > > > 200mhz or more.
> > > >
> > > > Setting it to 100 has the bad side effect of making things like
> > > > msleep(), tsleep(), and pause() (which show up in plenty of
> > > > drivers) all have a minimum timeout of 10ms, which is a long long
> > > > time on modern hardware.
> > > >
> > > > What benefit do you think you'll get from the lower number?
> > > 
> > >  On systems running at 10s of MHz (or slower, ick), with HZ=1000 you
> > >  spend an awful lot of time servicing the timer interrupt and not
> > >  very much time doing anything else.
> > > 
> > >  My rationale was that most RISC-V systems (including emulation and
> > >  FPGA prototypes) I've encountered are running slower than the
> > >  tipping point where HZ=1000 makes sense.  With the default of
> > >  HZ=100, faster exceptions can still set HZ=1000 in their individual
> > >  configs.
> > > 
> > >  When the RISC-V world evolves to having more actual silicon and
> > >  fewer slow prototypes, I definitely agree this default should be
> > >  flipped again for HZ=1000 by default and HZ=100 in the config files
> > >  for the exceptions.
> > > >>>
> > > >>> Wait a second... are you saying that the riscv implementation
> > > >>> doesn't support event timers and uses an old-style periodic tick
> > > >>> based on HZ?
> > > >>
> > > >> Depending on the hardware, there may not be an event timer (yet)...
> > > >>
> > > >> As I wrote: I would be more than happy to revert this change when
> > > >> more silicon becomes available.  Presently, there is exactly one
> > > >> silicon RISC-V implementation commercially available (HiFive FU540)
> > > >> and even that one is kind of difficult to source.  Most people
> > > >> running RISC-V are doing so in emulation or on FPGAs.
> > > >>
> > > >> Given how long these things take to boot to userland (where you
> > > >> really notice how slow things are), HZ=100 feels like a more sensible
> > > >> default than HZ=1000.
> > > >
> > > > I think it show more that the defaults are bad for MIPS and ARM. All
> > > > the MIPS files, except BERI/CHERI are 1000Hz. Well, Octeon is also
> > > > 100Hz, due to the defaults, but it will be fine at 1000Hz, so maybe we
> > > > need to attend to this as well. Arm !=v5 is also 1000Hz, so it should
> > > > be changed...
> > > >
> > > >> I don't feel terribly strongly about this though.  I've just been
> > > >> bitten several times in the last week on a <15MHz FPGA forgetting to
> > > >> set HZ=100 in config and figured I'd save others the trouble. ;-)
> > > >
> > > > 15MHz FPGA? FreeBSD 1.0 barely ran on 25MHz i386 machines of the
> > > > time  How common are these beasts and how well does FreeBSD do on
> > > > them. I assume these are early prototypes?
> > >
> > > These are early prototypes indeed.
> > >
> > > FreeBSD runs remarkably well on them.  Slowly of course.  Booting takes
> > > several minutes and running anything non-trivial can be frustrating.
> >
> > [More context for Warner and others following along.]
> >
> > I don't know what platform Philip is using here, but with architectures
> > supporting CHERI (including MIPS and RISC-V), we typically run on
> > sub-100Mhz FPGA implementations.
> >
> > We also run on simulations or models that range from 100s of MIPS to a
> > few KIPS.  Being able to do this is important to help validate that the
> > models we're proving security properties on actually relate to the
> > "more real" implementations we develop on.
> >
> > In all these cases, "run" is a relative thing.  We certainly don't
> > expect to self-host until we've got performant hardware (and to the
> > extent that we care about 32-bit, we consider self-hosting an active
> > non-goal.)  We often expect to be able to run real software including
> > things like nginx and webkit, but we mostly care about relative
> > performance not 

svn commit: r352129 - head

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:56:57 2019
New Revision: 352129
URL: https://svnweb.freebsd.org/changeset/base/352129

Log:
  Remove a blankline wrongly added in r351781

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Sep 10 07:54:49 2019(r352128)
+++ head/ObsoleteFiles.inc  Tue Sep 10 07:56:57 2019(r352129)
@@ -125,7 +125,6 @@ OLD_DIRS+=usr/share/pc-sysinstall/conf/license
 OLD_DIRS+=usr/share/pc-sysinstall/conf
 OLD_DIRS+=usr/share/pc-sysinstall/doc
 OLD_DIRS+=usr/share/pc-sysinstall
-
 # 20190825: zlib 1.0.4 removed from kernel
 OLD_FILES+=usr/include/sys/zlib.h
 OLD_FILES+=usr/include/sys/zutil.h
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352128 - in head: . usr.bin usr.bin/colldef usr.bin/mklocale

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:54:49 2019
New Revision: 352128
URL: https://svnweb.freebsd.org/changeset/base/352128

Log:
  Remove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11
  
  In FreeBSD 11 along with the rework on the collation, mklocale(1) and 
colldef(1)
  has been replaced by localedef(1) (a note has been added to the manpage to 
state
  it).
  mklocale(1) and colldef(1) has been kept around to be able to build older
  versions of FreeBSD. None of the version requiring those tools are supported
  anymore so it is time to remove them from base

Deleted:
  head/usr.bin/colldef/
  head/usr.bin/mklocale/
Modified:
  head/ObsoleteFiles.inc
  head/usr.bin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Sep 10 07:47:52 2019(r352127)
+++ head/ObsoleteFiles.inc  Tue Sep 10 07:54:49 2019(r352128)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20190910: mklocale(1) and colldef(1) removed
+OLD_FILES+=usr.bin/mklocale
+OLD_FILES+=usr/share/man/man1/mklocale.1.gz
+OLD_FILES+=usr.bin/colldef
+OLD_FILES+=usr/share/man/man1/colldef.1.gz
 # 20190904: Remove boot1.efifat
 OLD_FILES+=boot/boot1.efifat
 # 20190903: pc-sysinstall(8) removed

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Tue Sep 10 07:47:52 2019(r352127)
+++ head/usr.bin/Makefile   Tue Sep 10 07:54:49 2019(r352128)
@@ -20,7 +20,6 @@ SUBDIR=   alias \
cksum \
cmp \
col \
-   colldef \
colrm \
column \
comm \
@@ -94,7 +93,6 @@ SUBDIR=   alias \
mkdep \
mkfifo \
mkimg \
-   mklocale \
mktemp \
mkuzip \
mt \
___
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: r352127 - head/lib/libc/locale

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:47:52 2019
New Revision: 352127
URL: https://svnweb.freebsd.org/changeset/base/352127

Log:
  In FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1)
  tools to generate the locales data. state it in the libc manpages.
  
  MFC after:3 days

Modified:
  head/lib/libc/locale/euc.5
  head/lib/libc/locale/multibyte.3
  head/lib/libc/locale/setlocale.3

Modified: head/lib/libc/locale/euc.5
==
--- head/lib/libc/locale/euc.5  Tue Sep 10 07:40:45 2019(r352126)
+++ head/lib/libc/locale/euc.5  Tue Sep 10 07:47:52 2019(r352127)
@@ -31,7 +31,7 @@
 .\"@(#)euc.4   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd November 8, 2003
+.Dd September 9, 2019
 .Dt EUC 5
 .Os
 .Sh NAME
@@ -58,7 +58,7 @@
 .\".Ux
 .\"based systems.
 .\"See
-.\".Xr mklocale 1
+.\".Xr localedef 1
 .\"for a complete description of the
 .\".Ev LC_CTYPE
 .\"source file format.
@@ -130,5 +130,5 @@ Notice that the global
 is set to 0x8080, this implies that from those 2 bits the codeset can
 be determined.
 .Sh SEE ALSO
-.Xr mklocale 1 ,
+.Xr localedef 1 ,
 .Xr setlocale 3

Modified: head/lib/libc/locale/multibyte.3
==
--- head/lib/libc/locale/multibyte.3Tue Sep 10 07:40:45 2019
(r352126)
+++ head/lib/libc/locale/multibyte.3Tue Sep 10 07:47:52 2019
(r352127)
@@ -32,7 +32,7 @@
 .\"@(#)multibyte.3 8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd April 8, 2004
+.Dd September 9, 2019
 .Dt MULTIBYTE 3
 .Os
 .Sh NAME
@@ -127,7 +127,7 @@ multibyte characters:
 .It Xr wctomb 3 Ta "convert a wide-character code to a character"
 .El
 .Sh SEE ALSO
-.Xr mklocale 1 ,
+.Xr localedef 1 ,
 .Xr setlocale 3 ,
 .Xr stdio 3 ,
 .Xr big5 5 ,

Modified: head/lib/libc/locale/setlocale.3
==
--- head/lib/libc/locale/setlocale.3Tue Sep 10 07:40:45 2019
(r352126)
+++ head/lib/libc/locale/setlocale.3Tue Sep 10 07:47:52 2019
(r352127)
@@ -31,7 +31,7 @@
 .\"@(#)setlocale.3 8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd November 21, 2003
+.Dd September 9, 2019
 .Dt SETLOCALE 3
 .Os
 .Sh NAME
@@ -150,8 +150,7 @@ and the category
 .Sh ERRORS
 No errors are defined.
 .Sh SEE ALSO
-.Xr colldef 1 ,
-.Xr mklocale 1 ,
+.Xr localedef 1 ,
 .Xr catopen 3 ,
 .Xr ctype 3 ,
 .Xr localeconv 3 ,
___
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: r352126 - head/share/man/man7

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:40:45 2019
New Revision: 352126
URL: https://svnweb.freebsd.org/changeset/base/352126

Log:
  Remove reference to mklocale regarding the nls directory
  
  mklocale never had anything to do with the content of this directory
  
  MFC after:3 days

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

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Tue Sep 10 07:29:21 2019(r352125)
+++ head/share/man/man7/hier.7  Tue Sep 10 07:40:45 2019(r352126)
@@ -28,7 +28,7 @@
 .\"@(#)hier.7  8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd December 6, 2018
+.Dd September 10, 2019
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -533,9 +533,7 @@ templates for make;
 see
 .Xr make 1
 .It Pa nls/
-national language support files;
-see
-.Xr mklocale 1
+national language support files
 .It Pa security/
 data files for security policies such as
 .Xr mac_lomac 4
___
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: r352125 - in stable/11: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys sys/vm

2019-09-10 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 10 07:29:21 2019
New Revision: 352125
URL: https://svnweb.freebsd.org/changeset/base/352125

Log:
  MFC r351773:
  Add procctl(PROC_STACKGAP_CTL).
  
  PR:   239894

Modified:
  stable/11/lib/libc/sys/procctl.2
  stable/11/sys/compat/freebsd32/freebsd32_misc.c
  stable/11/sys/kern/kern_exec.c
  stable/11/sys/kern/kern_fork.c
  stable/11/sys/kern/kern_procctl.c
  stable/11/sys/sys/proc.h
  stable/11/sys/sys/procctl.h
  stable/11/sys/vm/vm_map.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/sys/procctl.2
==
--- stable/11/lib/libc/sys/procctl.2Tue Sep 10 07:28:27 2019
(r352124)
+++ stable/11/lib/libc/sys/procctl.2Tue Sep 10 07:29:21 2019
(r352125)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 23, 2019
+.Dd August 31, 2019
 .Dt PROCCTL 2
 .Os
 .Sh NAME
@@ -422,6 +422,67 @@ must point to a memory location that can hold a value 
 .Vt int .
 If signal delivery has not been requested, it will contain zero
 on return.
+.It Dv PROC_STACKGAP_CTL
+Controls the stack gaps in the specified process.
+A stack gap is the part of the growth area for a
+.Dv MAP_STACK
+mapped region that is reserved and never filled by memory.
+Instead, the process is guaranteed to receive a
+.Dv SIGSEGV
+signal on accessing pages in the gap.
+Gaps protect against stack overflow corrupting memory adjacent
+to the stack.
+.Pp
+The
+.Fa data
+argument must point to an integer variable containing flags.
+The following flags are allowed:
+.Bl -tag -width PROC_STACKGAP_DISABLE_EXEC
+.It Dv PROC_STACKGAP_ENABLE
+This flag is only accepted for consistency with
+.Dv PROC_STACKGAP_STATUS .
+If stack gaps are enabled, the flag is ignored.
+If disabled, the flag causes an
+.Ev EINVAL
+error to be returned.
+After gaps are disabled in a process, they can only be re-enabled when an
+.Xr execve 2
+is performed.
+.It Dv PROC_STACKGAP_DISABLE
+Disable stack gaps for the process.
+For existing stacks, the gap is no longer a reserved part of the growth
+area and can be filled by memory on access.
+.It Dv PROC_STACKGAP_ENABLE_EXEC
+Enable stack gaps for programs started after an
+.Xr execve 2
+by the specified process.
+.It Dv PROC_STACKGAP_DISABLE_EXEC
+Inherit disabled stack gaps state after
+.Xr execve 2 .
+In other words, if the currently executing program has stack gaps disabled,
+they are kept disabled on exec.
+If gaps were enabled, they are kept enabled after exec.
+.El
+.Pp
+The stack gap state is inherited from the parent on
+.Xr fork 2 .
+.It Dv PROC_STACKGAP_STATUS
+Returns the current stack gap state for the specified process.
+.Fa data
+must point to an integer variable, which is used to return a bitmask
+consisting of the following flags:
+.Bl -tag -width PROC_STACKGAP_DISABLE_EXEC
+.It Dv PROC_STACKGAP_ENABLE
+Stack gaps are enabled.
+.It Dv PROC_STACKGAP_DISABLE
+Stack gaps are disabled.
+.It Dv PROC_STACKGAP_ENABLE_EXEC
+Stack gaps are enabled in the process after
+.Xr execve 2 .
+.It Dv PROC_STACKGAP_DISABLE_EXEC
+Stack gaps are disabled in the process after
+.Xr execve 2 .
+.El
 .El
 .Sh NOTES
 Disabling tracing on a process should not be considered a security

Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c
==
--- stable/11/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 10 07:28:27 
2019(r352124)
+++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 10 07:29:21 
2019(r352125)
@@ -3107,6 +3107,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_
 
switch (uap->com) {
case PROC_SPROTECT:
+   case PROC_STACKGAP_CTL:
case PROC_TRACE_CTL:
case PROC_TRAPCAP_CTL:
error = copyin(PTRIN(uap->data), , sizeof(flags));
@@ -3137,6 +3138,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_
return (error);
data = 
break;
+   case PROC_STACKGAP_STATUS:
case PROC_TRACE_STATUS:
case PROC_TRAPCAP_STATUS:
data = 
@@ -3165,6 +3167,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_
if (error == 0)
error = error1;
break;
+   case PROC_STACKGAP_STATUS:
case PROC_TRACE_STATUS:
case PROC_TRAPCAP_STATUS:
if (error == 0)

Modified: stable/11/sys/kern/kern_exec.c
==
--- stable/11/sys/kern/kern_exec.c  Tue Sep 10 07:28:27 2019
(r352124)
+++ stable/11/sys/kern/kern_exec.c  Tue Sep 10 07:29:21 2019
(r352125)
@@ -762,6 +762,8 @@ interpret:
p->p_flag |= P_EXEC;
if ((p->p_flag2 & P2_NOTRACE_EXEC) == 0)
p->p_flag2 &= ~P2_NOTRACE;
+   if ((p->p_flag2 & P2_STKGAP_DISABLE_EXEC) == 0)
+   

svn commit: r352124 - in head/usr.sbin: ctld ndiscvt

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:28:27 2019
New Revision: 352124
URL: https://svnweb.freebsd.org/changeset/base/352124

Log:
  Stop linking to libl by specifying we do not need yywrap
  
  MFC after: 3 days

Modified:
  head/usr.sbin/ctld/Makefile
  head/usr.sbin/ctld/token.l
  head/usr.sbin/ndiscvt/Makefile
  head/usr.sbin/ndiscvt/inf-token.l

Modified: head/usr.sbin/ctld/Makefile
==
--- head/usr.sbin/ctld/Makefile Tue Sep 10 07:26:38 2019(r352123)
+++ head/usr.sbin/ctld/Makefile Tue Sep 10 07:28:27 2019(r352124)
@@ -15,7 +15,7 @@ CFLAGS+=  -I${SRCTOP}/sys/dev/iscsi
 #CFLAGS+=  -DICL_KERNEL_PROXY
 MAN=   ctld.8 ctl.conf.5
 
-LIBADD=bsdxml l md sbuf util ucl m nv
+LIBADD=bsdxml md sbuf util ucl m nv
 
 YFLAGS+=   -v
 CLEANFILES=y.tab.c y.tab.h y.output

Modified: head/usr.sbin/ctld/token.l
==
--- head/usr.sbin/ctld/token.l  Tue Sep 10 07:26:38 2019(r352123)
+++ head/usr.sbin/ctld/token.l  Tue Sep 10 07:28:27 2019(r352124)
@@ -45,6 +45,7 @@ extern intyylex(void);
 
 %}
 
+%option noyywrap
 %option noinput
 %option nounput
 

Modified: head/usr.sbin/ndiscvt/Makefile
==
--- head/usr.sbin/ndiscvt/Makefile  Tue Sep 10 07:26:38 2019
(r352123)
+++ head/usr.sbin/ndiscvt/Makefile  Tue Sep 10 07:28:27 2019
(r352124)
@@ -13,8 +13,6 @@ MAN+= ndisgen.8
 WARNS?=4
 NO_WCAST_ALIGN=
 
-LIBADD=l
-
 YFLAGS+=-v
 
 CFLAGS+=-I. -I${.CURDIR} -I${SRCTOP}/sys

Modified: head/usr.sbin/ndiscvt/inf-token.l
==
--- head/usr.sbin/ndiscvt/inf-token.l   Tue Sep 10 07:26:38 2019
(r352123)
+++ head/usr.sbin/ndiscvt/inf-token.l   Tue Sep 10 07:28:27 2019
(r352124)
@@ -59,6 +59,7 @@ update_lineno(const char *cp)
 
 %}
 
+%option noyywrap
 %option nounput
 %option noinput
 
___
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: r352123 - head/usr.sbin/kbdcontrol

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:26:38 2019
New Revision: 352123
URL: https://svnweb.freebsd.org/changeset/base/352123

Log:
  Stop linking to libl by specifying we do not need yywrap
  
  MFC after: 3 days

Modified:
  head/usr.sbin/kbdcontrol/Makefile
  head/usr.sbin/kbdcontrol/lex.l

Modified: head/usr.sbin/kbdcontrol/Makefile
==
--- head/usr.sbin/kbdcontrol/Makefile   Tue Sep 10 07:25:37 2019
(r352122)
+++ head/usr.sbin/kbdcontrol/Makefile   Tue Sep 10 07:26:38 2019
(r352123)
@@ -8,6 +8,4 @@ SRCS=   kbdcontrol.c lex.l
 WARNS?=4
 CFLAGS+= -I${.CURDIR}
 
-LIBADD=l
-
 .include 

Modified: head/usr.sbin/kbdcontrol/lex.l
==
--- head/usr.sbin/kbdcontrol/lex.l  Tue Sep 10 07:25:37 2019
(r352122)
+++ head/usr.sbin/kbdcontrol/lex.l  Tue Sep 10 07:26:38 2019
(r352123)
@@ -36,6 +36,7 @@
 
 %}
 
+%option noyywrap
 %option nounput
 %option noinput
 
___
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: r352122 - head/usr.sbin/jail

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:25:37 2019
New Revision: 352122
URL: https://svnweb.freebsd.org/changeset/base/352122

Log:
  Stop linking to libl by specifying we do not need yywrap
  
  MFC after: 3 days

Modified:
  head/usr.sbin/jail/Makefile
  head/usr.sbin/jail/jaillex.l

Modified: head/usr.sbin/jail/Makefile
==
--- head/usr.sbin/jail/Makefile Tue Sep 10 07:23:01 2019(r352121)
+++ head/usr.sbin/jail/Makefile Tue Sep 10 07:25:37 2019(r352122)
@@ -6,7 +6,7 @@ PROG=   jail
 MAN=   jail.8 jail.conf.5
 SRCS=  jail.c command.c config.c state.c jailp.h jaillex.l jailparse.y y.tab.h
 
-LIBADD=jail kvm util l
+LIBADD=jail kvm util
 
 PACKAGE=jail
 

Modified: head/usr.sbin/jail/jaillex.l
==
--- head/usr.sbin/jail/jaillex.lTue Sep 10 07:23:01 2019
(r352121)
+++ head/usr.sbin/jail/jaillex.lTue Sep 10 07:25:37 2019
(r352122)
@@ -48,6 +48,7 @@ static int lineno = 1;
 #define YY_DECL int yylex(void)
 %}
 
+%option noyywrap
 %option noinput
 %option nounput
 
___
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: r352121 - head/usr.sbin/apmd

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:23:01 2019
New Revision: 352121
URL: https://svnweb.freebsd.org/changeset/base/352121

Log:
  Stop linking to libl by specifying we do not need yywrap
  
  MFC after:3 days

Modified:
  head/usr.sbin/apmd/Makefile
  head/usr.sbin/apmd/apmdlex.l

Modified: head/usr.sbin/apmd/Makefile
==
--- head/usr.sbin/apmd/Makefile Tue Sep 10 07:20:32 2019(r352120)
+++ head/usr.sbin/apmd/Makefile Tue Sep 10 07:23:01 2019(r352121)
@@ -10,8 +10,6 @@ PACKAGE=apm
 
 WARNS?=3
 
-LIBADD=l
-
 CFLAGS+= -I${.CURDIR}
 
 test:

Modified: head/usr.sbin/apmd/apmdlex.l
==
--- head/usr.sbin/apmd/apmdlex.lTue Sep 10 07:20:32 2019
(r352120)
+++ head/usr.sbin/apmd/apmdlex.lTue Sep 10 07:23:01 2019
(r352121)
@@ -44,6 +44,7 @@ int first_time;
 %}
 
 /* We don't need it, avoid the warning. */
+%option noyywrap
 %option nounput
 %option noinput
 
___
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: r352120 - head/usr.sbin/rrenumd

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:20:32 2019
New Revision: 352120
URL: https://svnweb.freebsd.org/changeset/base/352120

Log:
  by specifyng we do not use yywrap we can avoid linking to libl and liby
  
  MFC after:3 days

Modified:
  head/usr.sbin/rrenumd/Makefile
  head/usr.sbin/rrenumd/lexer.l

Modified: head/usr.sbin/rrenumd/Makefile
==
--- head/usr.sbin/rrenumd/Makefile  Tue Sep 10 07:14:39 2019
(r352119)
+++ head/usr.sbin/rrenumd/Makefile  Tue Sep 10 07:20:32 2019
(r352120)
@@ -23,7 +23,7 @@ YFLAGS=   -d
 
 WARNS?=2
 
-LIBADD=ipsec l y
+LIBADD=ipsec
 
 CLEANFILES=y.tab.h
 SRCS+= y.tab.h

Modified: head/usr.sbin/rrenumd/lexer.l
==
--- head/usr.sbin/rrenumd/lexer.l   Tue Sep 10 07:14:39 2019
(r352119)
+++ head/usr.sbin/rrenumd/lexer.l   Tue Sep 10 07:20:32 2019
(r352120)
@@ -60,6 +60,7 @@ void yyerror(const char *);
 int yylex(void);
 %}
 
+%option noyywrap
 %option nounput
 
 /* common section */
___
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: r352119 - head/usr.sbin/config

2019-09-10 Thread Baptiste Daroussin
Author: bapt
Date: Tue Sep 10 07:14:39 2019
New Revision: 352119
URL: https://svnweb.freebsd.org/changeset/base/352119

Log:
  config: do not link against libl, it is not needed
  
  MFC after:3 days

Modified:
  head/usr.sbin/config/Makefile

Modified: head/usr.sbin/config/Makefile
==
--- head/usr.sbin/config/Makefile   Tue Sep 10 06:47:40 2019
(r352118)
+++ head/usr.sbin/config/Makefile   Tue Sep 10 07:14:39 2019
(r352119)
@@ -18,7 +18,7 @@ CFLAGS+= -I. -I${SRCDIR}
 
 NO_WMISSING_VARIABLE_DECLARATIONS=
 
-LIBADD=l nv sbuf
+LIBADD=nv sbuf
 
 CLEANFILES+=   kernconf.c
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352118 - stable/12/usr.bin/proccontrol

2019-09-10 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 10 06:47:40 2019
New Revision: 352118
URL: https://svnweb.freebsd.org/changeset/base/352118

Log:
  MFC r351774:
  Add stackgap control mode to proccontrol(1).
  
  PR:   239894

Modified:
  stable/12/usr.bin/proccontrol/proccontrol.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/proccontrol/proccontrol.c
==
--- stable/12/usr.bin/proccontrol/proccontrol.c Tue Sep 10 06:45:44 2019
(r352117)
+++ stable/12/usr.bin/proccontrol/proccontrol.c Tue Sep 10 06:47:40 2019
(r352118)
@@ -43,6 +43,7 @@ enum {
MODE_INVALID,
MODE_TRACE,
MODE_TRAPCAP,
+   MODE_STACKGAP,
 #ifdef PROC_KPTI_CTL
MODE_KPTI,
 #endif
@@ -72,8 +73,8 @@ static void __dead2
 usage(void)
 {
 
-   fprintf(stderr, "Usage: proccontrol -m (aslr|trace|trapcap"
-   KPTI_USAGE") [-q] "
+   fprintf(stderr, "Usage: proccontrol -m (aslr|trace|trapcap|"
+   "stackgap"KPTI_USAGE") [-q] "
"[-s (enable|disable)] [-p pid | command]\n");
exit(1);
 }
@@ -98,6 +99,8 @@ main(int argc, char *argv[])
mode = MODE_TRACE;
else if (strcmp(optarg, "trapcap") == 0)
mode = MODE_TRAPCAP;
+   else if (strcmp(optarg, "stackgap") == 0)
+   mode = MODE_STACKGAP;
 #ifdef PROC_KPTI_CTL
else if (strcmp(optarg, "kpti") == 0)
mode = MODE_KPTI;
@@ -147,6 +150,9 @@ main(int argc, char *argv[])
case MODE_TRAPCAP:
error = procctl(P_PID, pid, PROC_TRAPCAP_STATUS, );
break;
+   case MODE_STACKGAP:
+   error = procctl(P_PID, pid, PROC_STACKGAP_STATUS, );
+   break;
 #ifdef PROC_KPTI_CTL
case MODE_KPTI:
error = procctl(P_PID, pid, PROC_KPTI_STATUS, );
@@ -194,6 +200,26 @@ main(int argc, char *argv[])
break;
}
break;
+   case MODE_STACKGAP:
+   switch (arg & (PROC_STACKGAP_ENABLE |
+   PROC_STACKGAP_DISABLE)) {
+   case PROC_STACKGAP_ENABLE:
+   printf("enabled\n");
+   break;
+   case PROC_STACKGAP_DISABLE:
+   printf("disabled\n");
+   break;
+   }
+   switch (arg & (PROC_STACKGAP_ENABLE_EXEC |
+   PROC_STACKGAP_DISABLE_EXEC)) {
+   case PROC_STACKGAP_ENABLE_EXEC:
+   printf("enabled after exec\n");
+   break;
+   case PROC_STACKGAP_DISABLE_EXEC:
+   printf("disabled after exec\n");
+   break;
+   }
+   break;
 #ifdef PROC_KPTI_CTL
case MODE_KPTI:
switch (arg & ~PROC_KPTI_STATUS_ACTIVE) {
@@ -227,6 +253,12 @@ main(int argc, char *argv[])
arg = enable ? PROC_TRAPCAP_CTL_ENABLE :
PROC_TRAPCAP_CTL_DISABLE;
error = procctl(P_PID, pid, PROC_TRAPCAP_CTL, );
+   break;
+   case MODE_STACKGAP:
+   arg = enable ? PROC_STACKGAP_ENABLE_EXEC :
+   (PROC_STACKGAP_DISABLE |
+   PROC_STACKGAP_DISABLE_EXEC);
+   error = procctl(P_PID, pid, PROC_STACKGAP_CTL, );
break;
 #ifdef PROC_KPTI_CTL
case MODE_KPTI:
___
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: r352117 - in stable/12: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys sys/vm

2019-09-10 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 10 06:45:44 2019
New Revision: 352117
URL: https://svnweb.freebsd.org/changeset/base/352117

Log:
  MFC r351773:
  Add procctl(PROC_STACKGAP_CTL).
  
  PR:   239894

Modified:
  stable/12/lib/libc/sys/procctl.2
  stable/12/sys/compat/freebsd32/freebsd32_misc.c
  stable/12/sys/kern/kern_exec.c
  stable/12/sys/kern/kern_fork.c
  stable/12/sys/kern/kern_procctl.c
  stable/12/sys/sys/proc.h
  stable/12/sys/sys/procctl.h
  stable/12/sys/vm/vm_map.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/sys/procctl.2
==
--- stable/12/lib/libc/sys/procctl.2Tue Sep 10 04:21:48 2019
(r352116)
+++ stable/12/lib/libc/sys/procctl.2Tue Sep 10 06:45:44 2019
(r352117)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 23, 2019
+.Dd August 31, 2019
 .Dt PROCCTL 2
 .Os
 .Sh NAME
@@ -462,6 +462,67 @@ must point to a memory location that can hold a value 
 .Vt int .
 If signal delivery has not been requested, it will contain zero
 on return.
+.It Dv PROC_STACKGAP_CTL
+Controls the stack gaps in the specified process.
+A stack gap is the part of the growth area for a
+.Dv MAP_STACK
+mapped region that is reserved and never filled by memory.
+Instead, the process is guaranteed to receive a
+.Dv SIGSEGV
+signal on accessing pages in the gap.
+Gaps protect against stack overflow corrupting memory adjacent
+to the stack.
+.Pp
+The
+.Fa data
+argument must point to an integer variable containing flags.
+The following flags are allowed:
+.Bl -tag -width PROC_STACKGAP_DISABLE_EXEC
+.It Dv PROC_STACKGAP_ENABLE
+This flag is only accepted for consistency with
+.Dv PROC_STACKGAP_STATUS .
+If stack gaps are enabled, the flag is ignored.
+If disabled, the flag causes an
+.Ev EINVAL
+error to be returned.
+After gaps are disabled in a process, they can only be re-enabled when an
+.Xr execve 2
+is performed.
+.It Dv PROC_STACKGAP_DISABLE
+Disable stack gaps for the process.
+For existing stacks, the gap is no longer a reserved part of the growth
+area and can be filled by memory on access.
+.It Dv PROC_STACKGAP_ENABLE_EXEC
+Enable stack gaps for programs started after an
+.Xr execve 2
+by the specified process.
+.It Dv PROC_STACKGAP_DISABLE_EXEC
+Inherit disabled stack gaps state after
+.Xr execve 2 .
+In other words, if the currently executing program has stack gaps disabled,
+they are kept disabled on exec.
+If gaps were enabled, they are kept enabled after exec.
+.El
+.Pp
+The stack gap state is inherited from the parent on
+.Xr fork 2 .
+.It Dv PROC_STACKGAP_STATUS
+Returns the current stack gap state for the specified process.
+.Fa data
+must point to an integer variable, which is used to return a bitmask
+consisting of the following flags:
+.Bl -tag -width PROC_STACKGAP_DISABLE_EXEC
+.It Dv PROC_STACKGAP_ENABLE
+Stack gaps are enabled.
+.It Dv PROC_STACKGAP_DISABLE
+Stack gaps are disabled.
+.It Dv PROC_STACKGAP_ENABLE_EXEC
+Stack gaps are enabled in the process after
+.Xr execve 2 .
+.It Dv PROC_STACKGAP_DISABLE_EXEC
+Stack gaps are disabled in the process after
+.Xr execve 2 .
+.El
 .El
 .Sh NOTES
 Disabling tracing on a process should not be considered a security

Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c
==
--- stable/12/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 10 04:21:48 
2019(r352116)
+++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 10 06:45:44 
2019(r352117)
@@ -3360,6 +3360,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_
switch (uap->com) {
case PROC_ASLR_CTL:
case PROC_SPROTECT:
+   case PROC_STACKGAP_CTL:
case PROC_TRACE_CTL:
case PROC_TRAPCAP_CTL:
error = copyin(PTRIN(uap->data), , sizeof(flags));
@@ -3391,6 +3392,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_
data = 
break;
case PROC_ASLR_STATUS:
+   case PROC_STACKGAP_STATUS:
case PROC_TRACE_STATUS:
case PROC_TRAPCAP_STATUS:
data = 
@@ -3420,6 +3422,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_
error = error1;
break;
case PROC_ASLR_STATUS:
+   case PROC_STACKGAP_STATUS:
case PROC_TRACE_STATUS:
case PROC_TRAPCAP_STATUS:
if (error == 0)

Modified: stable/12/sys/kern/kern_exec.c
==
--- stable/12/sys/kern/kern_exec.c  Tue Sep 10 04:21:48 2019
(r352116)
+++ stable/12/sys/kern/kern_exec.c  Tue Sep 10 06:45:44 2019
(r352117)
@@ -756,6 +756,8 @@ interpret:
p->p_flag |= P_EXEC;
if ((p->p_flag2 & P2_NOTRACE_EXEC) == 0)
p->p_flag2 &= ~P2_NOTRACE;
+   if ((p->p_flag2 & P2_STKGAP_DISABLE_EXEC) == 0)
+