svn commit: r352589 - in stable: 11/usr.sbin/ntp/libntp 12/usr.sbin/ntp/libntp

2019-09-21 Thread Cy Schubert
Author: cy
Date: Sun Sep 22 05:16:10 2019
New Revision: 352589
URL: https://svnweb.freebsd.org/changeset/base/352589

Log:
  MFC r352518:
  
  Reduce calls to close(2) at startup through the use of closefrom(2).
  
  Submitted by: pawel.bierna...@gmail.com
  Reviewed by:  mjg, cy
  Differential Revision:https://reviews.freebsd.org/D21715

Modified:
  stable/12/usr.sbin/ntp/libntp/Makefile
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/usr.sbin/ntp/libntp/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/usr.sbin/ntp/libntp/Makefile
==
--- stable/12/usr.sbin/ntp/libntp/Makefile  Sun Sep 22 00:12:43 2019
(r352588)
+++ stable/12/usr.sbin/ntp/libntp/Makefile  Sun Sep 22 05:16:10 2019
(r352589)
@@ -83,7 +83,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \
-I${.CURDIR:H} \
-I${.CURDIR}/
 
-CFLAGS+= -DHAVE_BSD_NICE -DHAVE_STDINT_H
+CFLAGS+= -DHAVE_BSD_NICE -DHAVE_STDINT_H -DHAVE_CLOSEFROM
 
 CLEANFILES+= .version version.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: r352589 - in stable: 11/usr.sbin/ntp/libntp 12/usr.sbin/ntp/libntp

2019-09-21 Thread Cy Schubert
Author: cy
Date: Sun Sep 22 05:16:10 2019
New Revision: 352589
URL: https://svnweb.freebsd.org/changeset/base/352589

Log:
  MFC r352518:
  
  Reduce calls to close(2) at startup through the use of closefrom(2).
  
  Submitted by: pawel.bierna...@gmail.com
  Reviewed by:  mjg, cy
  Differential Revision:https://reviews.freebsd.org/D21715

Modified:
  stable/11/usr.sbin/ntp/libntp/Makefile
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/usr.sbin/ntp/libntp/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/usr.sbin/ntp/libntp/Makefile
==
--- stable/11/usr.sbin/ntp/libntp/Makefile  Sun Sep 22 00:12:43 2019
(r352588)
+++ stable/11/usr.sbin/ntp/libntp/Makefile  Sun Sep 22 05:16:10 2019
(r352589)
@@ -83,7 +83,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \
-I${.CURDIR:H} \
-I${.CURDIR}/
 
-CFLAGS+= -DHAVE_BSD_NICE -DHAVE_STDINT_H
+CFLAGS+= -DHAVE_BSD_NICE -DHAVE_STDINT_H -DHAVE_CLOSEFROM
 
 CLEANFILES+= .version version.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: r352588 - releng/12.1/usr.sbin/periodic

2019-09-21 Thread Alan Somers
Author: asomers
Date: Sun Sep 22 00:12:43 2019
New Revision: 352588
URL: https://svnweb.freebsd.org/changeset/base/352588

Log:
  MF stable/12 r352489
  
  Approved by:  re (kib)
  
  r351192:
  periodic: fix anticongestion for scripts run after security
  
  Revision 316342, which introduced the anticongestion feature, failed to
  consider that the periodic scripts are executed by a recursive invocation of
  periodic.  The recursive invocation wrongly cleaned up a temporary file that
  should've been cleaned up only by the original invocation.  The result is
  that if the first script that requests an anticongestion sleep runs after
  the security scripts, the sleep won't happen.
  
  Fix this bug by delaying cleanup until the end of the original invocation.
  
  PR: 236564
  Submitted by:   Yasuhiro KIMURA 
  Reviewed by:imp
  
  r351203:
  periodic: replace "tty" with "test -t 0"
  
  Apparently using tty for this purpose has been deprecated since 4.4 Lite.
  
  Reviewed by:cy
  Differential Revision:  https://reviews.freebsd.org/D21318

Modified:
  releng/12.1/usr.sbin/periodic/periodic.sh
Directory Properties:
  releng/12.1/   (props changed)

Modified: releng/12.1/usr.sbin/periodic/periodic.sh
==
--- releng/12.1/usr.sbin/periodic/periodic.sh   Sat Sep 21 21:02:57 2019
(r352587)
+++ releng/12.1/usr.sbin/periodic/periodic.sh   Sun Sep 22 00:12:43 2019
(r352588)
@@ -78,8 +78,13 @@ arg=$1
 
 if [ -z "$PERIODIC_ANTICONGESTION_FILE" ] ; then
export PERIODIC_ANTICONGESTION_FILE=`mktemp 
${TMPDIR:-/tmp}/periodic.anticongestion.XX`
+   remove_periodic_anticongestion_file=yes
+else
+   # We might be in a recursive invocation; let the top-level invocation
+   # remove the file.
+   remove_periodic_anticongestion_file=no
 fi
-if tty > /dev/null 2>&1; then
+if [ -t 0 ]; then
export PERIODIC_IS_INTERACTIVE=1
 fi
 tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XX`
@@ -147,4 +152,6 @@ esac
 } | output_pipe $arg "$context"
 
 rm -f $tmp_output
-rm -f $PERIODIC_ANTICONGESTION_FILE
+if [ $remove_periodic_anticongestion_file = "yes" ] ; then
+   rm -f $PERIODIC_ANTICONGESTION_FILE
+fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352585 - head/sys/kern

2019-09-21 Thread Konstantin Belousov
Author: kib
Date: Sat Sep 21 20:03:17 2019
New Revision: 352585
URL: https://svnweb.freebsd.org/changeset/base/352585

Log:
  kern.elf{32,64}.pie_base sysctl: enforce page alignment.
  
  Requested by: rstone
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Sat Sep 21 19:51:57 2019(r352584)
+++ head/sys/kern/imgact_elf.c  Sat Sep 21 20:03:17 2019(r352585)
@@ -136,8 +136,24 @@ SYSCTL_INT(_kern_elf32, OID_AUTO, read_exec, CTLFLAG_R
 #endif
 
 static u_long __elfN(pie_base) = ET_DYN_LOAD_ADDR;
-SYSCTL_ULONG(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base,
-CTLFLAG_RWTUN, &__elfN(pie_base), 0,
+static int
+sysctl_pie_base(SYSCTL_HANDLER_ARGS)
+{
+   u_long val;
+   int error;
+
+   val = __elfN(pie_base);
+   error = sysctl_handle_long(oidp, &val, 0, req);
+   if (error != 0 || req->newptr == NULL)
+   return (error);
+   if ((val & PAGE_MASK) != 0)
+   return (EINVAL);
+   __elfN(pie_base) = val;
+   return (0);
+}
+SYSCTL_PROC(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base,
+CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0,
+sysctl_pie_base, "LU",
 "PIE load base without randomization");
 
 SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, CTLFLAG_RW, 
0,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352584 - head/sys/arm64/arm64

2019-09-21 Thread Alan Cox
Author: alc
Date: Sat Sep 21 19:51:57 2019
New Revision: 352584
URL: https://svnweb.freebsd.org/changeset/base/352584

Log:
  In case a translation fault on the kernel address space occurs from
  within a critical section, we must perform a lock-free check on the
  faulting address.
  
  Reported by:  andrew
  Reviewed by:  andrew, markj
  X-MFC with:   r350579
  Differential Revision:https://reviews.freebsd.org/D21685

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Sat Sep 21 19:05:38 2019(r352583)
+++ head/sys/arm64/arm64/pmap.c Sat Sep 21 19:51:57 2019(r352584)
@@ -5810,23 +5810,33 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far)
case ISS_DATA_DFSC_TF_L1:
case ISS_DATA_DFSC_TF_L2:
case ISS_DATA_DFSC_TF_L3:
-   PMAP_LOCK(pmap);
-   /* Ask the MMU to check the address */
-   intr = intr_disable();
-   if (pmap == kernel_pmap)
-   par = arm64_address_translate_s1e1r(far);
-   else
-   par = arm64_address_translate_s1e0r(far);
-   intr_restore(intr);
-   PMAP_UNLOCK(pmap);
-
/*
-* If the translation was successful the address was invalid
-* due to a break-before-make sequence. We can unlock and
-* return success to the trap handler.
+* Retry the translation.  A break-before-make sequence can
+* produce a transient fault.
 */
-   if (PAR_SUCCESS(par))
-   rv = KERN_SUCCESS;
+   if (pmap == kernel_pmap) {
+   /*
+* The translation fault may have occurred within a
+* critical section.  Therefore, we must check the
+* address without acquiring the kernel pmap's lock.
+*/
+   if (pmap_kextract(far) != 0)
+   rv = KERN_SUCCESS;
+   } else {
+   PMAP_LOCK(pmap);
+   /* Ask the MMU to check the address. */
+   intr = intr_disable();
+   par = arm64_address_translate_s1e0r(far);
+   intr_restore(intr);
+   PMAP_UNLOCK(pmap);
+
+   /*
+* If the translation was successful, then we can
+* return success to the trap handler.
+*/
+   if (PAR_SUCCESS(par))
+   rv = KERN_SUCCESS;
+   }
break;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352583 - head/sys/kern

2019-09-21 Thread Mateusz Guzik
Author: mjg
Date: Sat Sep 21 19:05:38 2019
New Revision: 352583
URL: https://svnweb.freebsd.org/changeset/base/352583

Log:
  lockprof: use CPUFOREACH and drop always false lp_cpu NULL checks
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/subr_lock.c

Modified: head/sys/kern/subr_lock.c
==
--- head/sys/kern/subr_lock.c   Sat Sep 21 18:00:23 2019(r352582)
+++ head/sys/kern/subr_lock.c   Sat Sep 21 19:05:38 2019(r352583)
@@ -287,7 +287,7 @@ lock_prof_init(void *arg)
 {
int cpu;
 
-   for (cpu = 0; cpu <= mp_maxid; cpu++) {
+   CPU_FOREACH(cpu) {
lp_cpu[cpu] = malloc(sizeof(*lp_cpu[cpu]), M_DEVBUF,
M_WAITOK | M_ZERO);
lock_prof_init_type(&lp_cpu[cpu]->lpc_types[0]);
@@ -330,14 +330,14 @@ lock_prof_reset(void)
 * before we zero the structures.  Some items may still be linked
 * into per-thread lists as well.
 */
-   for (cpu = 0; cpu <= mp_maxid; cpu++) {
+   CPU_FOREACH(cpu) {
lpc = lp_cpu[cpu];
for (i = 0; i < LPROF_CACHE_SIZE; i++) {
LIST_REMOVE(&lpc->lpc_types[0].lpt_objs[i], lpo_link);
LIST_REMOVE(&lpc->lpc_types[1].lpt_objs[i], lpo_link);
}
}
-   for (cpu = 0; cpu <= mp_maxid; cpu++) {
+   CPU_FOREACH(cpu) {
lpc = lp_cpu[cpu];
bzero(lpc, sizeof(*lpc));
lock_prof_init_type(&lpc->lpc_types[0]);
@@ -378,9 +378,7 @@ lock_prof_sum(struct lock_prof *match, struct lock_pro
dst->class = match->class;
dst->name = match->name;
 
-   for (cpu = 0; cpu <= mp_maxid; cpu++) {
-   if (lp_cpu[cpu] == NULL)
-   continue;
+   CPU_FOREACH(cpu) {
type = &lp_cpu[cpu]->lpc_types[spin];
SLIST_FOREACH(l, &type->lpt_hash[hash], link) {
if (l->ticks == t)
@@ -399,7 +397,6 @@ lock_prof_sum(struct lock_prof *match, struct lock_pro
dst->cnt_contest_locking += l->cnt_contest_locking;
}
}
-   
 }
 
 static void
@@ -438,9 +435,7 @@ dump_lock_prof_stats(SYSCTL_HANDLER_ARGS)
lock_prof_enable = 0;
quiesce_all_cpus("profstat", 0);
t = ticks;
-   for (cpu = 0; cpu <= mp_maxid; cpu++) {
-   if (lp_cpu[cpu] == NULL)
-   continue;
+   CPU_FOREACH(cpu) {
lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[0], sb, 0, t);
lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[1], sb, 1, t);
}
___
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: r352582 - head/sys/kern

2019-09-21 Thread Konstantin Belousov
Author: kib
Date: Sat Sep 21 18:00:23 2019
New Revision: 352582
URL: https://svnweb.freebsd.org/changeset/base/352582

Log:
  Make non-ASLR pie base tunable.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Sat Sep 21 17:59:15 2019(r352581)
+++ head/sys/kern/imgact_elf.c  Sat Sep 21 18:00:23 2019(r352582)
@@ -135,6 +135,11 @@ SYSCTL_INT(_kern_elf32, OID_AUTO, read_exec, CTLFLAG_R
 "enable execution from readable segments");
 #endif
 
+static u_long __elfN(pie_base) = ET_DYN_LOAD_ADDR;
+SYSCTL_ULONG(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base,
+CTLFLAG_RWTUN, &__elfN(pie_base), 0,
+"PIE load base without randomization");
+
 SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, CTLFLAG_RW, 
0,
 "");
 #defineASLR_NODE_OID   __CONCAT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), 
_aslr)
@@ -1146,13 +1151,13 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
if (baddr == 0) {
if ((sv->sv_flags & SV_ASLR) == 0 ||
(fctl0 & NT_FREEBSD_FCTL_ASLR_DISABLE) != 0)
-   et_dyn_addr = ET_DYN_LOAD_ADDR;
+   et_dyn_addr = __elfN(pie_base);
else if ((__elfN(pie_aslr_enabled) &&
(imgp->proc->p_flag2 & P2_ASLR_DISABLE) == 0) ||
(imgp->proc->p_flag2 & P2_ASLR_ENABLE) != 0)
et_dyn_addr = ET_DYN_ADDR_RAND;
else
-   et_dyn_addr = ET_DYN_LOAD_ADDR;
+   et_dyn_addr = __elfN(pie_base);
}
}
 
___
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: r352581 - head/sys/amd64/amd64

2019-09-21 Thread Konstantin Belousov
Author: kib
Date: Sat Sep 21 17:59:15 2019
New Revision: 352581
URL: https://svnweb.freebsd.org/changeset/base/352581

Log:
  amd64 pmap: Fix formats for 64bit addresses in ddb and sysctl output.
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D21737

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sat Sep 21 17:54:42 2019(r352580)
+++ head/sys/amd64/amd64/pmap.c Sat Sep 21 17:59:15 2019(r352581)
@@ -10030,13 +10030,13 @@ sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_
mode = "WC";
break;
default:
-   printf("%s: unknown PAT mode %#x for range %#016lx-%#016lx\n",
+   printf("%s: unknown PAT mode %#x for range 0x%016lx-0x%016lx\n",
__func__, i, range->sva, eva);
mode = "??";
break;
}
 
-   sbuf_printf(sb, "%#016lx-%#016lx r%c%c%c%c %s %d %d %d\n",
+   sbuf_printf(sb, "0x%016lx-0x%016lx r%c%c%c%c %s %d %d %d\n",
range->sva, eva,
(range->attrs & X86_PG_RW) != 0 ? 'w' : '-',
(range->attrs & pg_nx) != 0 ? '-' : 'x',
@@ -10271,25 +10271,25 @@ DB_SHOW_COMMAND(pte, pmap_print_pte)
 
PG_V = pmap_valid_bit(pmap);
pml4 = pmap_pml4e(pmap, va);
-   db_printf("VA %#016lx pml4e %#016lx", va, *pml4);
+   db_printf("VA 0x%016lx pml4e 0x%016lx", va, *pml4);
if ((*pml4 & PG_V) == 0) {
db_printf("\n");
return;
}
pdp = pmap_pml4e_to_pdpe(pml4, va);
-   db_printf(" pdpe %#016lx", *pdp);
+   db_printf(" pdpe 0x%016lx", *pdp);
if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) {
db_printf("\n");
return;
}
pde = pmap_pdpe_to_pde(pdp, va);
-   db_printf(" pde %#016lx", *pde);
+   db_printf(" pde 0x%016lx", *pde);
if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) {
db_printf("\n");
return;
}
pte = pmap_pde_to_pte(pde, va);
-   db_printf(" pte %#016lx\n", *pte);
+   db_printf(" pte 0x%016lx\n", *pte);
 }
 
 DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap)
___
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: r352580 - head/cddl/contrib/opensolaris/lib/libzfs/common

2019-09-21 Thread Sean Eric Fagan
Author: sef
Date: Sat Sep 21 17:54:42 2019
New Revision: 352580
URL: https://svnweb.freebsd.org/changeset/base/352580

Log:
  Fix a regression introduced in r344601, and work properly with the
  -v and -n options.
  
  PR:   240640
  Reported by:  Andriy Gapon 
  Reviewed by:  avg
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D21709

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
==
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c   Sat Sep 
21 15:38:08 2019(r352579)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c   Sat Sep 
21 17:54:42 2019(r352580)
@@ -1289,13 +1289,11 @@ dump_snapshot(zfs_handle_t *zhp, void *arg)
fromorigin = sdd->prevsnap[0] == '\0' &&
(sdd->fromorigin || sdd->replicate);
 
-   if (sdd->progress && sdd->dryrun) {
+   if (sdd->verbose || sdd->progress) {
(void) estimate_ioctl(zhp, sdd->prevsnap_obj,
fromorigin, flags, &size);
sdd->size += size;
-   }
 
-   if (sdd->verbose) {
send_print_verbose(fout, zhp->zfs_name,
sdd->prevsnap[0] ? sdd->prevsnap : NULL,
size, sdd->parsable);
@@ -1663,7 +1661,7 @@ zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *fla
fromname = name;
}
 
-   if (flags->progress) {
+   if (flags->progress || flags->verbose) {
error = lzc_send_space(zhp->zfs_name, fromname,
lzc_flags, &size);
if (error == 0)
@@ -1933,7 +1931,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, cons
sdd.cleanup_fd = -1;
sdd.snapholds = NULL;
}
-   if (flags->progress || sdd.snapholds != NULL) {
+   if (flags->progress || flags->verbose || sdd.snapholds != NULL) {
/*
 * Do a verbose no-op dry run to get all the verbose output
 * or to gather snapshot hold's before generating any data,
___
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: r352579 - head/sys/kern

2019-09-21 Thread Alexander Motin
Author: mav
Date: Sat Sep 21 15:38:08 2019
New Revision: 352579
URL: https://svnweb.freebsd.org/changeset/base/352579

Log:
  Allocate callout wheel from the respective memory domain.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cSat Sep 21 15:01:11 2019
(r352578)
+++ head/sys/kern/kern_timeout.cSat Sep 21 15:38:08 2019
(r352579)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -325,8 +326,9 @@ callout_cpu_init(struct callout_cpu *cc, int cpu)
mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE);
SLIST_INIT(&cc->cc_callfree);
cc->cc_inited = 1;
-   cc->cc_callwheel = malloc(sizeof(struct callout_list) * callwheelsize,
-   M_CALLOUT, M_WAITOK);
+   cc->cc_callwheel = malloc_domainset(sizeof(struct callout_list) *
+   callwheelsize, M_CALLOUT,
+   DOMAINSET_PREF(pcpu_find(cpu)->pc_domain), M_WAITOK);
for (i = 0; i < callwheelsize; i++)
LIST_INIT(&cc->cc_callwheel[i]);
TAILQ_INIT(&cc->cc_expireq);
___
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: r352578 - head/usr.bin/jot

2019-09-21 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Sat Sep 21 15:01:11 2019
New Revision: 352578
URL: https://svnweb.freebsd.org/changeset/base/352578

Log:
  jot.1: Explain default argument values more precisely
  
  The way jot(1) defaults missing arguments doesn't match the behaviour
  described in the manpage, which states that with fewer than 3 arguments
  missing values are supplied from left to right.
  
  In fact, with one or two arguments, the last (s which is step size or seed)
  defaults to 1 (or -1 if begin and end specify a descending range), and then
  omitted arguments are set to default starting with the leftmost until three
  arguments are available.
  
  This is why `jot 2 1000` prints 1000 and 1001 instead of 1000 and 100.
  
  PR:   135475
  Submitted by: Jonathan McKeown 
  Approved by:  doc (bcr)
  Differential Revision:https://reviews.freebsd.org/D21736
  Event:EuroBSDcon 2019

Modified:
  head/usr.bin/jot/jot.1

Modified: head/usr.bin/jot/jot.1
==
--- head/usr.bin/jot/jot.1  Sat Sep 21 14:16:37 2019(r352577)
+++ head/usr.bin/jot/jot.1  Sat Sep 21 15:01:11 2019(r352578)
@@ -28,7 +28,7 @@
 .\"@(#)jot.1   8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd April 7, 2015
+.Dd September 21, 2019
 .Dt JOT 1
 .Os
 .Sh NAME
@@ -108,14 +108,16 @@ Any three of these arguments determines the fourth.
 If four are specified and the given and computed values of
 .Ar reps
 conflict, the lower value is used.
-If fewer than three are specified, defaults are assigned
-left to right, except for
+If one or two are specified, defaults are assigned
+starting with
 .Ar s ,
-which assumes a default of 1 or -1 if both
+which assumes a default of 1 (or -1 if
 .Ar begin
 and
 .Ar end
-are given.
+specify a descending range).
+Then the default values are assigned to the leftmost omitted arguments until
+three arguments are set.
 .Pp
 Defaults for the four arguments are, respectively,
 100, 1, 100, and 1, except that when random data are requested,
___
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: r352577 - head/share/man/man7

2019-09-21 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Sat Sep 21 14:16:37 2019
New Revision: 352577
URL: https://svnweb.freebsd.org/changeset/base/352577

Log:
  ascii(7): Add STANDARDS section and update HISTORY section
  
  PR:   240727
  Submitted by: Gordon Bergling 
  Approved by:  src (imp)
  Event:EuroBSDcon 2019

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

Modified: head/share/man/man7/ascii.7
==
--- head/share/man/man7/ascii.7 Sat Sep 21 14:06:16 2019(r352576)
+++ head/share/man/man7/ascii.7 Sat Sep 21 14:16:37 2019(r352577)
@@ -28,7 +28,7 @@
 .\"@(#)ascii.7 8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd October 30, 2017
+.Dd September 21, 2019
 .Dt ASCII 7
 .Os
 .Sh NAME
@@ -146,8 +146,15 @@ ESC  ;  [  { 11011
 .Bl -tag -width /usr/share/misc/ascii -compact
 .It Pa /usr/share/misc/ascii
 .El
+.Sh STANDARDS
+.Rs
+.%T Information Systems - Coded Character Sets - 7-Bit American National\
+ Standard Code for Information Interchange (7-Bit ASCII)
+.%R INCITS 4-1986[R2017]
+.%Q InterNational Committee for Information Technology Standards
+.Re
 .Sh HISTORY
 An
 .Nm
 manual page appeared in
-.At v7 .
+.At v2 .
___
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: r352576 - stable/11/usr.bin/quota

2019-09-21 Thread Hiroki Sato
Author: hrs
Date: Sat Sep 21 14:06:16 2019
New Revision: 352576
URL: https://svnweb.freebsd.org/changeset/base/352576

Log:
  MFC r352567:
  
  Add a workaround for servers which respond RPC_PROGNOTREGISTERED
  to a clnt_create() call even when it is actually a program
  version mismatch.
  
  Normally the server is supposed to return RPC_PROGVERSMISMATCH
  when it supports the specified program but not support
  the specified version.  Some filers return RPC_PROGNOTREGISTERED
  to RQUOTA v2 calls and FreeBSD does not retry with the old
  v1 calls.  This change fixes this failure scenario.
  
  Submitted by: Jian-Bo Liao
  PR:   236179

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

Modified: stable/11/usr.bin/quota/quota.c
==
--- stable/11/usr.bin/quota/quota.c Sat Sep 21 14:03:41 2019
(r352575)
+++ stable/11/usr.bin/quota/quota.c Sat Sep 21 14:06:16 2019
(r352576)
@@ -604,7 +604,7 @@ getnfsquota(struct statfs *fst, struct quotause *qup, 
call_stat = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS,
  RQUOTAPROC_GETQUOTA, 
(xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args,
  (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt);
-   if (call_stat == RPC_PROGVERSMISMATCH) {
+   if (call_stat == RPC_PROGVERSMISMATCH || call_stat == 
RPC_PROGNOTREGISTERED) {
if (quotatype == USRQUOTA) {
old_gq_args.gqa_pathp = cp + 1;
old_gq_args.gqa_uid = id;
___
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: r352575 - stable/12/usr.bin/quota

2019-09-21 Thread Hiroki Sato
Author: hrs
Date: Sat Sep 21 14:03:41 2019
New Revision: 352575
URL: https://svnweb.freebsd.org/changeset/base/352575

Log:
  MFC r352567:
  
  Add a workaround for servers which respond RPC_PROGNOTREGISTERED
  to a clnt_create() call even when it is actually a program
  version mismatch.
  
  Normally the server is supposed to return RPC_PROGVERSMISMATCH
  when it supports the specified program but not support
  the specified version.  Some filers return RPC_PROGNOTREGISTERED
  to RQUOTA v2 calls and FreeBSD does not retry with the old
  v1 calls.  This change fixes this failure scenario.
  
  Submitted by: Jian-Bo Liao
  PR:   236179

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

Modified: stable/12/usr.bin/quota/quota.c
==
--- stable/12/usr.bin/quota/quota.c Sat Sep 21 13:34:06 2019
(r352574)
+++ stable/12/usr.bin/quota/quota.c Sat Sep 21 14:03:41 2019
(r352575)
@@ -606,7 +606,7 @@ getnfsquota(struct statfs *fst, struct quotause *qup, 
call_stat = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS,
  RQUOTAPROC_GETQUOTA, 
(xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args,
  (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt);
-   if (call_stat == RPC_PROGVERSMISMATCH) {
+   if (call_stat == RPC_PROGVERSMISMATCH || call_stat == 
RPC_PROGNOTREGISTERED) {
if (quotatype == USRQUOTA) {
old_gq_args.gqa_pathp = cp + 1;
old_gq_args.gqa_uid = id;
___
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: r352574 - head/usr.sbin/rpc.statd

2019-09-21 Thread Hiroki Sato
Author: hrs
Date: Sat Sep 21 13:34:06 2019
New Revision: 352574
URL: https://svnweb.freebsd.org/changeset/base/352574

Log:
  - Revert WARNS to 2 because of mismatch between (xdrproc_t) and xdr_void().
  - Add prototype of from_addr().

Modified:
  head/usr.sbin/rpc.statd/Makefile
  head/usr.sbin/rpc.statd/procs.c

Modified: head/usr.sbin/rpc.statd/Makefile
==
--- head/usr.sbin/rpc.statd/MakefileSat Sep 21 13:00:38 2019
(r352573)
+++ head/usr.sbin/rpc.statd/MakefileSat Sep 21 13:34:06 2019
(r352574)
@@ -7,6 +7,9 @@ SRCS=   file.c sm_inter_svc.c sm_inter.h statd.c procs.c
 CFLAGS+= -I${.OBJDIR}
 LIBADD=rpcsvc
 
+# XXX: mismatch between (xdrproc_t) and xdr_void().
+WARNS?=2
+
 CLEANFILES= sm_inter_svc.c sm_inter.h
 
 RPCSRC= ${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc/sm_inter.x

Modified: head/usr.sbin/rpc.statd/procs.c
==
--- head/usr.sbin/rpc.statd/procs.c Sat Sep 21 13:00:38 2019
(r352573)
+++ head/usr.sbin/rpc.statd/procs.c Sat Sep 21 13:34:06 2019
(r352574)
@@ -52,9 +52,10 @@ __FBSDID("$FreeBSD$");
 
 #include "statd.h"
 
+static const char *from_addr(struct sockaddr *);
+
 static const char *
-from_addr(saddr)
-   struct sockaddr *saddr;
+from_addr(struct sockaddr *saddr)
 {
static char inet_buf[INET6_ADDRSTRLEN];
 
___
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: r352573 - releng/12.1/sys/fs/fuse

2019-09-21 Thread Alan Somers
Author: asomers
Date: Sat Sep 21 13:00:38 2019
New Revision: 352573
URL: https://svnweb.freebsd.org/changeset/base/352573

Log:
  MF stable/12 r352534:
  
  Fix an off-by-one error from r351961
  
  That revision addressed a Coverity CID that could lead to a buffer overflow,
  but it had an off-by-one error in the buffer size check.
  
  Approved by: re (kib)
  Reported by: Coverity
  Coverity CID: 1405530
  MFC-With: 351961
  Sponsored by: The FreeBSD Foundation

Modified:
  releng/12.1/sys/fs/fuse/fuse_internal.c
Directory Properties:
  releng/12.1/   (props changed)

Modified: releng/12.1/sys/fs/fuse/fuse_internal.c
==
--- releng/12.1/sys/fs/fuse/fuse_internal.c Sat Sep 21 12:33:41 2019
(r352572)
+++ releng/12.1/sys/fs/fuse/fuse_internal.c Sat Sep 21 13:00:38 2019
(r352573)
@@ -390,7 +390,7 @@ fuse_internal_invalidate_entry(struct mount *mp, struc
if ((err = uiomove(&fnieo, sizeof(fnieo), uio)) != 0)
return (err);
 
-   if (fnieo.namelen > sizeof(name))
+   if (fnieo.namelen >= sizeof(name))
return (EINVAL);
 
if ((err = uiomove(name, fnieo.namelen, uio)) != 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352572 - head/usr.sbin/rpc.statd

2019-09-21 Thread Hiroki Sato
Author: hrs
Date: Sat Sep 21 12:33:41 2019
New Revision: 352572
URL: https://svnweb.freebsd.org/changeset/base/352572

Log:
  Fix warnings and set WARNS=6.

Modified:
  head/usr.sbin/rpc.statd/Makefile
  head/usr.sbin/rpc.statd/file.c
  head/usr.sbin/rpc.statd/statd.c

Modified: head/usr.sbin/rpc.statd/Makefile
==
--- head/usr.sbin/rpc.statd/MakefileSat Sep 21 01:39:49 2019
(r352571)
+++ head/usr.sbin/rpc.statd/MakefileSat Sep 21 12:33:41 2019
(r352572)
@@ -4,9 +4,7 @@ PROG=   rpc.statd
 MAN=   rpc.statd.8
 SRCS=  file.c sm_inter_svc.c sm_inter.h statd.c procs.c
 
-CFLAGS+= -I.
-WARNS?= 2
-
+CFLAGS+= -I${.OBJDIR}
 LIBADD=rpcsvc
 
 CLEANFILES= sm_inter_svc.c sm_inter.h

Modified: head/usr.sbin/rpc.statd/file.c
==
--- head/usr.sbin/rpc.statd/file.c  Sat Sep 21 01:39:49 2019
(r352571)
+++ head/usr.sbin/rpc.statd/file.c  Sat Sep 21 12:33:41 2019
(r352572)
@@ -201,8 +201,8 @@ void init_file(const char *filename)
   /* defective, re-create from scratch.
*/
   if (!new_file)
   {
-if ((status_file_len < HEADER_LEN) || (status_file_len
-  < (HEADER_LEN + sizeof(HostInfo) * status_info->noOfHosts)) )
+if ((status_file_len < (off_t)HEADER_LEN) || (status_file_len
+  < (off_t)(HEADER_LEN + sizeof(HostInfo) * status_info->noOfHosts)) )
 {
   warnx("status file is corrupt");
   new_file = TRUE;

Modified: head/usr.sbin/rpc.statd/statd.c
==
--- head/usr.sbin/rpc.statd/statd.c Sat Sep 21 01:39:49 2019
(r352571)
+++ head/usr.sbin/rpc.statd/statd.c Sat Sep 21 12:33:41 2019
(r352572)
@@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$");
 
 int debug = 0; /* Controls syslog() calls for debug messages   */
 
-char **hosts, *svcport_str = NULL;
-int nhosts = 0;
-int xcreated = 0;
+static char **hosts, *svcport_str = NULL;
+static int nhosts = 0;
+static int xcreated = 0;
 static int mallocd_svcport = 0;
 static int *sock_fd;
 static int sock_fdcnt;
@@ -86,7 +86,8 @@ main(int argc, char **argv)
   void *nc_handle;
   in_port_t svcport;
   int ch, i, s;
-  char *endptr, **hosts_bak;
+  char *endptr;
+  char **hosts_bak;
   int have_v6 = 1;
   int maxrec = RPC_MAXDATASIZE;
   int attempt_cnt, port_len, port_pos, ret;
@@ -156,7 +157,7 @@ main(int argc, char **argv)
  if (hosts == NULL)
  out_of_mem();
 
- hosts[0] = "*";
+ hosts[0] = strdup("*");
  nhosts = 1;
   } else {
  hosts_bak = hosts;
@@ -172,7 +173,7 @@ main(int argc, char **argv)
  hosts = hosts_bak;
 
  nhosts += 2;
- hosts[nhosts - 2] = "::1";
+ hosts[nhosts - 2] = strdup("::1");
  } else {
  hosts_bak = realloc(hosts, (nhosts + 1) * sizeof(char *));
  if (hosts_bak == NULL) {
@@ -186,7 +187,7 @@ main(int argc, char **argv)
  hosts = hosts_bak;
  }
  }
- hosts[nhosts - 1] = "127.0.0.1";
+ hosts[nhosts - 1] = strdup("127.0.0.1");
   }
 
   attempt_cnt = 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"