svn commit: r364497 - in head/sys/dev/cxgbe: . common

2020-08-22 Thread Navdeep Parhar
Author: np
Date: Sun Aug 23 04:16:20 2020
New Revision: 364497
URL: https://svnweb.freebsd.org/changeset/base/364497

Log:
  cxgbe(4): Use large clusters for TOE rx queues when TOE+TLS is enabled.
  
  Rx is more efficient within the chip when the receive buffer size
  matches the TLS PDU size.
  
  MFC after:3 days
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D26127

Modified:
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/common/t4_hw.c
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/common/common.h
==
--- head/sys/dev/cxgbe/common/common.h  Sat Aug 22 22:56:50 2020
(r364496)
+++ head/sys/dev/cxgbe/common/common.h  Sun Aug 23 04:16:20 2020
(r364497)
@@ -246,6 +246,8 @@ struct tp_params {
 
uint32_t vlan_pri_map;
uint32_t ingress_config;
+   uint32_t max_rx_pdu;
+   uint32_t max_tx_pdu;
uint64_t hash_filter_mask;
__be16 err_vec_mask;
 

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Sat Aug 22 22:56:50 2020
(r364496)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Sun Aug 23 04:16:20 2020
(r364497)
@@ -9614,7 +9614,7 @@ static void read_filter_mode_and_ingress_config(struct
 int t4_init_tp_params(struct adapter *adap, bool sleep_ok)
 {
int chan;
-   u32 v;
+   u32 tx_len, rx_len, r, v;
struct tp_params *tpp = >params.tp;
 
v = t4_read_reg(adap, A_TP_TIMER_RESOLUTION);
@@ -9640,6 +9640,21 @@ int t4_init_tp_params(struct adapter *adap, bool sleep
htobe16(V_T6_COMPR_RXERR_VEC(M_T6_COMPR_RXERR_VEC));
}
}
+
+   rx_len = t4_read_reg(adap, A_TP_PMM_RX_PAGE_SIZE);
+   tx_len = t4_read_reg(adap, A_TP_PMM_TX_PAGE_SIZE);
+
+   r = t4_read_reg(adap, A_TP_PARA_REG2);
+   rx_len = min(rx_len, G_MAXRXDATA(r));
+   tx_len = min(tx_len, G_MAXRXDATA(r));
+
+   r = t4_read_reg(adap, A_TP_PARA_REG7);
+   v = min(G_PMMAXXFERLEN0(r), G_PMMAXXFERLEN1(r));
+   rx_len = min(rx_len, v);
+   tx_len = min(tx_len, v);
+
+   tpp->max_tx_pdu = tx_len;
+   tpp->max_rx_pdu = rx_len;
 
return 0;
 }

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cSat Aug 22 22:56:50 2020
(r364496)
+++ head/sys/dev/cxgbe/t4_main.cSun Aug 23 04:16:20 2020
(r364497)
@@ -736,6 +736,7 @@ static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS);
 static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS);
 static int sysctl_cpus(SYSCTL_HANDLER_ARGS);
 #ifdef TCP_OFFLOAD
+static int sysctl_tls(SYSCTL_HANDLER_ARGS);
 static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS);
 static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS);
 static int sysctl_tp_dack_timer(SYSCTL_HANDLER_ARGS);
@@ -6607,8 +6608,9 @@ t4_sysctls(struct adapter *sc)
CTLFLAG_RW, >tt.rx_coalesce, 0, "receive coalescing");
 
sc->tt.tls = 0;
-   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tls", CTLFLAG_RW,
-   >tt.tls, 0, "Inline TLS allowed");
+   SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls", CTLTYPE_INT |
+   CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_tls, "I",
+   "Inline TLS allowed");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls_rx_ports",
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0,
@@ -9699,6 +9701,37 @@ sysctl_cpus(SYSCTL_HANDLER_ARGS)
 }
 
 #ifdef TCP_OFFLOAD
+static int
+sysctl_tls(SYSCTL_HANDLER_ARGS)
+{
+   struct adapter *sc = arg1;
+   int i, j, v, rc;
+   struct vi_info *vi;
+
+   v = sc->tt.tls;
+   rc = sysctl_handle_int(oidp, , 0, req);
+   if (rc != 0 || req->newptr == NULL)
+   return (rc);
+
+   if (v != 0 && !(sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS))
+   return (ENOTSUP);
+
+   rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4stls");
+   if (rc)
+   return (rc);
+   sc->tt.tls = !!v;
+   for_each_port(sc, i) {
+   for_each_vi(sc->port[i], j, vi) {
+   if (vi->flags & VI_INIT_DONE)
+   t4_update_fl_bufsize(vi->ifp);
+   }
+   }
+   end_synchronized_op(sc, 0);
+
+   return (0);
+
+}
+
 static int
 sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS)
 {

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Sat Aug 22 22:56:50 2020(r364496)
+++ head/sys/dev/cxgbe/t4_sge.c Sun Aug 23 04:16:20 2020(r364497)
@@ -1032,14 +1032,19 @@ 

svn commit: r364495 - in head/sys: kern sys

2020-08-22 Thread Konstantin Belousov
Author: kib
Date: Sat Aug 22 21:32:11 2020
New Revision: 364495
URL: https://svnweb.freebsd.org/changeset/base/364495

Log:
  Fix several issues with process group orphanage.
  
  Attempt of adding assertions that pgrp->pg_jobc counters do not
  underflow in r361967, reverted in r362910, points out bugs in the
  handling of job control.  Peter Holm was able to narrow down the
  problem to very easy reproduction with timeout(1) which uses reaping.
  
  The following list of problems with calculation of pg_jobs which
  directs SIGHUP/SIGCONT delivery for orphaned process group was
  identified:
  - Re-calculation of the orphaned status for children of exiting parent
was wrong, but mostly unnoticed when all children were reparented to
init(8).  When child can be reparented to a different process which
could affect the child' job control state, it was not properly
accounted for in pg_jobc.
  - Lockless check for exiting process' parent process group is racy
because nothing prevents the parent from changing its group
membership.
  - Exited process is left in the process group, until waited. This
affects other calculations of pg_jobc.
  
  Split handling of job control status on process changing its process
  group, and process exiting.  Calculate increments and decrements for
  pg_jobs by exact checking the orphanage instead of assuming process
  group membership for children and parent.  Move the call to killjobc()
  later under the proctree_lock.  Mark exiting process in killjobc()
  with a new flag P_TREE_GRPEXITED and skip it for all pg_jobc
  calculations after the flag is set.
  
  Add checker that independently recalculates pg_jobc value and compares
  it with the memoized process group state. This is enabled under INVARIANTS.
  
  Reviewed by:  jilles
  Discussed with:   kevans
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Differential revision:https://reviews.freebsd.org/D26116

Modified:
  head/sys/kern/kern_exit.c
  head/sys/kern/kern_proc.c
  head/sys/sys/proc.h

Modified: head/sys/kern/kern_exit.c
==
--- head/sys/kern/kern_exit.c   Sat Aug 22 20:52:02 2020(r364494)
+++ head/sys/kern/kern_exit.c   Sat Aug 22 21:32:11 2020(r364495)
@@ -391,7 +391,6 @@ exit1(struct thread *td, int rval, int signo)
}
 
vmspace_exit(td);
-   killjobc();
(void)acct_process(td);
 
 #ifdef KTRACE
@@ -434,6 +433,12 @@ exit1(struct thread *td, int rval, int signo)
PROC_LOCK(p);
p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE);
PROC_UNLOCK(p);
+
+   /*
+* killjobc() might drop and re-acquire proctree_lock to
+* revoke control tty if exiting process was a session leader.
+*/
+   killjobc();
 
/*
 * Reparent all children processes:

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Sat Aug 22 20:52:02 2020(r364494)
+++ head/sys/kern/kern_proc.c   Sat Aug 22 21:32:11 2020(r364495)
@@ -102,13 +102,14 @@ MALLOC_DEFINE(M_SESSION, "session", "session header");
 static MALLOC_DEFINE(M_PROC, "proc", "Proc structures");
 MALLOC_DEFINE(M_SUBPROC, "subproc", "Proc sub-structures");
 
+static void fixjobc_enterpgrp(struct proc *p, struct pgrp *pgrp);
 static void doenterpgrp(struct proc *, struct pgrp *);
 static void orphanpg(struct pgrp *pg);
 static void fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp);
 static void fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp);
 static void fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp,
 int preferthread);
-static void pgadjustjobc(struct pgrp *pgrp, int entering);
+static void pgadjustjobc(struct pgrp *pgrp, bool entering);
 static void pgdelete(struct pgrp *);
 static int proc_ctor(void *mem, int size, void *arg, int flags);
 static void proc_dtor(void *mem, int size, void *arg);
@@ -633,6 +634,43 @@ enterthispgrp(struct proc *p, struct pgrp *pgrp)
 }
 
 /*
+ * If true, any child of q which belongs to group pgrp, qualifies the
+ * process group pgrp as not orphaned.
+ */
+static bool
+isjobproc(struct proc *q, struct pgrp *pgrp)
+{
+   sx_assert(_lock, SX_LOCKED);
+   return (q->p_pgrp != pgrp &&
+   q->p_pgrp->pg_session == pgrp->pg_session);
+}
+
+#ifdef INVARIANTS
+static void
+check_pgrp_jobc(struct pgrp *pgrp)
+{
+   struct proc *q;
+   int cnt;
+
+   sx_assert(_lock, SX_LOCKED);
+   PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED);
+
+   cnt = 0;
+   PGRP_LOCK(pgrp);
+   LIST_FOREACH(q, >pg_members, p_pglist) {
+   if ((q->p_treeflag & P_TREE_GRPEXITED) != 0 ||
+   q->p_pptr == NULL)
+   continue;
+   if (isjobproc(q->p_pptr, pgrp))
+   cnt++;
+   }
+   

svn commit: r364494 - head/contrib/mtree

2020-08-22 Thread Ed Maste
Author: emaste
Date: Sat Aug 22 20:52:02 2020
New Revision: 364494
URL: https://svnweb.freebsd.org/changeset/base/364494

Log:
  mtree(8): add xref to mtree(5)
  
  mtree(5) and mtree(8) come from different contrib sources. The former
  already had an xref to the latter, but not the other way around.
  
  MFC after:1 week

Modified:
  head/contrib/mtree/mtree.8

Modified: head/contrib/mtree/mtree.8
==
--- head/contrib/mtree/mtree.8  Sat Aug 22 20:02:40 2020(r364493)
+++ head/contrib/mtree/mtree.8  Sat Aug 22 20:52:02 2020(r364494)
@@ -748,6 +748,7 @@ seconds.nanoseconds without zero padding nanosecond va
 .Xr fnmatch 3 ,
 .Xr fts 3 ,
 .Xr strsvis 3 ,
+.Xr mtree 5 ,
 .Xr chown 8 ,
 .Xr mknod 8
 .Sh HISTORY
___
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: r364493 - head/sys/net

2020-08-22 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Aug 22 20:02:40 2020
New Revision: 364493
URL: https://svnweb.freebsd.org/changeset/base/364493

Log:
  Finish r364492 by renaming rt_flags to rte_flags for multipath code.

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSat Aug 22 19:30:56 2020(r364492)
+++ head/sys/net/route.cSat Aug 22 20:02:40 2020(r364493)
@@ -812,9 +812,9 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin
if (rn) {
rto = RNTORT(rn);
RT_LOCK(rto);
-   rto->rt_flags |= RTF_UP;
+   rto->rte_flags |= RTF_UP;
RT_UNLOCK(rto);
-   } else if (rt->rt_flags & RTF_GATEWAY) {
+   } else if (rt->rte_flags & RTF_GATEWAY) {
/*
 * For gateway routes, we need to 
 * make sure that we we are deleting
___
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: r364492 - in head/sys/net: . route

2020-08-22 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Aug 22 19:30:56 2020
New Revision: 364492
URL: https://svnweb.freebsd.org/changeset/base/364492

Log:
  Rename rt_flags to rte_flags && reduce number of rt_nhop accesses.
  
  No functional changes.
  
  Most of the routing flags are stored in the netxtop instead of rtentry.
  Rename rt->rt_flags to rt->rte_flags to simplify reading/modifying code
   checking routing flags.
  
  In the new multipath code, rt->rt_nhop may actually point to nexthop group
   instead of nhop. To ease transition, reduce the amount of rt->rt_nhop->...
   accesses.
  
  Differential Revision:https://reviews.freebsd.org/D26156

Modified:
  head/sys/net/route.c
  head/sys/net/route/route_ctl.c
  head/sys/net/route/route_ddb.c
  head/sys/net/route/route_var.h
  head/sys/net/rtsock.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSat Aug 22 19:18:31 2020(r364491)
+++ head/sys/net/route.cSat Aug 22 19:30:56 2020(r364492)
@@ -243,7 +243,7 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s
}
 
RT_LOCK(rc.rc_rt);
-   flags = rc.rc_rt->rt_flags;
+   flags = rc.rc_rt->rte_flags;
RT_UNLOCK(rc.rc_rt);
 
RTSTAT_INC(rts_dynamic);
@@ -354,6 +354,7 @@ rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *
struct nhop_object *nh;
int sa_len;
 
+   nh = rt->rt_nhop;
if (flags & NHR_COPY) {
/* Copy destination if dst is non-zero */
src = rt_key(rt);
@@ -383,9 +384,10 @@ rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *
}
 
/* Copy gateway is set && dst is non-zero */
-   src = >rt_nhop->gw_sa;
+   src = >gw_sa;
dst = info->rti_info[RTAX_GATEWAY];
-   if ((rt->rt_flags & RTF_GATEWAY) && src != NULL && dst != NULL){
+   if ((nhop_get_rtflags(nh) & RTF_GATEWAY) &&
+   src != NULL && dst != NULL) {
if (src->sa_len > dst->sa_len)
return (ENOMEM);
memcpy(dst, src, src->sa_len);
@@ -398,20 +400,19 @@ rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *
info->rti_info[RTAX_NETMASK] = rt_mask(rt);
info->rti_addrs |= RTA_NETMASK;
}
-   if (rt->rt_flags & RTF_GATEWAY) {
-   info->rti_info[RTAX_GATEWAY] = >rt_nhop->gw_sa;
+   if (nhop_get_rtflags(nh) & RTF_GATEWAY) {
+   info->rti_info[RTAX_GATEWAY] = >gw_sa;
info->rti_addrs |= RTA_GATEWAY;
}
}
 
-   nh = rt->rt_nhop;
rmx = info->rti_rmx;
if (rmx != NULL) {
info->rti_mflags |= RTV_MTU;
rmx->rmx_mtu = nh->nh_mtu;
}
 
-   info->rti_flags = rt->rt_flags | nhop_get_rtflags(nh);
+   info->rti_flags = rt->rte_flags | nhop_get_rtflags(nh);
info->rti_ifp = nh->nh_ifp;
info->rti_ifa = nh->nh_ifa;
if (flags & NHR_REF) {
@@ -579,7 +580,7 @@ rt_ifdelroute(const struct rtentry *rt, const struct n
 * Protect (sorta) against walktree recursion problems
 * with cloned routes
 */
-   if ((rt->rt_flags & RTF_UP) == 0)
+   if ((rt->rte_flags & RTF_UP) == 0)
return (0);
 
return (1);

Modified: head/sys/net/route/route_ctl.c
==
--- head/sys/net/route/route_ctl.c  Sat Aug 22 19:18:31 2020
(r364491)
+++ head/sys/net/route/route_ctl.c  Sat Aug 22 19:30:56 2020
(r364492)
@@ -251,7 +251,7 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in
return (ENOBUFS);
}
RT_LOCK_INIT(rt);
-   rt->rt_flags = RTF_UP | flags;
+   rt->rte_flags = RTF_UP | flags;
rt->rt_nhop = nh;
 
/* Fill in dst */
@@ -406,6 +406,7 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo 
 {
struct sockaddr *dst, *netmask;
struct rtentry *rt;
+   struct nhop_object *nh;
struct radix_node *rn;
 
dst = info->rti_info[RTAX_DST];
@@ -417,16 +418,18 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo 
return (NULL);
}
 
+   nh = rt->rt_nhop;
+
if ((info->rti_flags & RTF_PINNED) == 0) {
/* Check if target route can be deleted */
-   if (rt->rt_flags & RTF_PINNED) {
+   if (NH_IS_PINNED(nh)) {
*perror = EADDRINUSE;
return (NULL);
}
}
 
if (info->rti_filter != NULL) {
-   if (info->rti_filter(rt, rt->rt_nhop, info->rti_filterdata)==0){
+   if (info->rti_filter(rt, nh, info->rti_filterdata)==0){
/* Not 

svn commit: r364491 - head/sys/kern

2020-08-22 Thread Warner Losh
Author: imp
Date: Sat Aug 22 19:18:31 2020
New Revision: 364491
URL: https://svnweb.freebsd.org/changeset/base/364491

Log:
  Whitespace change to line up dev_sotfc definition.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cSat Aug 22 19:02:15 2020(r364490)
+++ head/sys/kern/subr_bus.cSat Aug 22 19:18:31 2020(r364491)
@@ -402,15 +402,15 @@ STAILQ_HEAD(devq, dev_event_info);
 
 static struct dev_softc
 {
-   int inuse;
-   int nonblock;
-   int queued;
-   int async;
-   struct mtx mtx;
-   struct cv cv;
-   struct selinfo sel;
-   struct devq devq;
-   struct sigio *sigio;
+   int inuse;
+   int nonblock;
+   int queued;
+   int async;
+   struct mtx  mtx;
+   struct cv   cv;
+   struct selinfo  sel;
+   struct devq devq;
+   struct sigio*sigio;
 } devsoftc;
 
 static voidfilt_devctl_detach(struct knote *kn);
___
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: r364490 - head/sys/kern

2020-08-22 Thread Warner Losh
Author: imp
Date: Sat Aug 22 19:02:15 2020
New Revision: 364490
URL: https://svnweb.freebsd.org/changeset/base/364490

Log:
  Retire obsolete sysctl hw.bus.devctl_disable
  
  hw.bus.devctl_disable has tagged been obsolete for a decade. Remove it. Also
  remove some long obsolete comments. This was done and backed out once in 2014,
  but we've had enough releases with the 'new' method of setting queue length 
that
  we can just remove this sysctl now (stable/11, stable/12 and current all don't
  reference it).

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cSat Aug 22 18:14:05 2020(r364489)
+++ head/sys/kern/subr_bus.cSat Aug 22 19:02:15 2020(r364490)
@@ -365,22 +365,9 @@ device_sysctl_fini(device_t dev)
  *
  * Also note: we specifically do not attach a device to the device_t tree
  * to avoid potential chicken and egg problems.  One could argue that all
- * of this belongs to the root node.  One could also further argue that the
- * sysctl interface that we have not might more properly be an ioctl
- * interface, but at this stage of the game, I'm not inclined to rock that
- * boat.
- *
- * I'm also not sure that the SIGIO support is done correctly or not, as
- * I copied it from a driver that had SIGIO support that likely hasn't been
- * tested since 3.4 or 2.2.8!
+ * of this belongs to the root node.
  */
 
-/* Deprecated way to adjust queue length */
-static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS);
-SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RWTUN |
-CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I",
-"devctl disable -- deprecated");
-
 #define DEVCTL_DEFAULT_QUEUE_LEN 1000
 static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS);
 static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN;
@@ -796,35 +783,6 @@ static void
 devnomatch(device_t dev)
 {
devaddq("?", "", dev);
-}
-
-static int
-sysctl_devctl_disable(SYSCTL_HANDLER_ARGS)
-{
-   struct dev_event_info *n1;
-   int dis, error;
-
-   dis = (devctl_queue_length == 0);
-   error = sysctl_handle_int(oidp, , 0, req);
-   if (error || !req->newptr)
-   return (error);
-   if (mtx_initialized())
-   mtx_lock();
-   if (dis) {
-   while (!STAILQ_EMPTY()) {
-   n1 = STAILQ_FIRST();
-   STAILQ_REMOVE_HEAD(, dei_link);
-   free(n1->dei_data, M_BUS);
-   free(n1, M_BUS);
-   }
-   devsoftc.queued = 0;
-   devctl_queue_length = 0;
-   } else {
-   devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN;
-   }
-   if (mtx_initialized())
-   mtx_unlock();
-   return (0);
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364489 - head/tests/sys/net/routing

2020-08-22 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Aug 22 18:14:05 2020
New Revision: 364489
URL: https://svnweb.freebsd.org/changeset/base/364489

Log:
  Add test for checking RTF_HOST and RTAX_NETMASK inconsistency.
  
  RTF_HOST indicates whether route is a host route
   (netmask is empty or /{32,128}).
  Check that if netmask is empty and host route is not specified, kernel
   returns an error.
  
  Differential Revision:https://reviews.freebsd.org/D26155

Modified:
  head/tests/sys/net/routing/test_rtsock_l3.c

Modified: head/tests/sys/net/routing/test_rtsock_l3.c
==
--- head/tests/sys/net/routing/test_rtsock_l3.c Sat Aug 22 16:58:59 2020
(r364488)
+++ head/tests/sys/net/routing/test_rtsock_l3.c Sat Aug 22 18:14:05 2020
(r364489)
@@ -365,7 +365,6 @@ ATF_TC_BODY(rtm_get_v4_empty_dst_failure, tc)
(struct sockaddr *)>mask4, NULL);
rtsock_update_rtm_len(rtm);
 
-   write(c->rtsock_fd, rtm, rtm->rtm_msglen);
ATF_CHECK_ERRNO(EINVAL, write(c->rtsock_fd, rtm, rtm->rtm_msglen));
 }
 
@@ -441,6 +440,30 @@ ATF_TC_CLEANUP(rtm_add_v4_gw_direct_success, tc)
CLEANUP_AFTER_TEST;
 }
 
+RTM_DECLARE_ROOT_TEST(rtm_add_v4_no_rtf_host_failure,
+"Tests failure with netmask sa and RTF_HOST inconsistency");
+
+ATF_TC_BODY(rtm_add_v4_no_rtf_host_failure, tc)
+{
+   DECLARE_TEST_VARS;
+
+   c = presetup_ipv4(tc);
+
+   /* Create IPv4 subnetwork with smaller prefix */
+   struct sockaddr_in mask4;
+   struct sockaddr_in net4;
+   struct sockaddr_in gw4;
+   prepare_v4_network(c, , , );
+
+   prepare_route_message(rtm, RTM_ADD, (struct sockaddr *),
+   NULL, (struct sockaddr *));
+   rtsock_update_rtm_len(rtm);
+
+   /* RTF_HOST is NOT specified, while netmask is empty */
+
+   ATF_CHECK_ERRNO(EINVAL, write(c->rtsock_fd, rtm, rtm->rtm_msglen));
+}
+
 ATF_TC_WITH_CLEANUP(rtm_del_v4_prefix_nogw_success);
 ATF_TC_HEAD(rtm_del_v4_prefix_nogw_success, tc)
 {
@@ -1269,6 +1292,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, rtm_get_v4_lpm_success);
ATF_TP_ADD_TC(tp, rtm_get_v4_hostbits_failure);
ATF_TP_ADD_TC(tp, rtm_get_v4_empty_dst_failure);
+   ATF_TP_ADD_TC(tp, rtm_add_v4_no_rtf_host_failure);
ATF_TP_ADD_TC(tp, rtm_add_v4_gw_direct_success);
ATF_TP_ADD_TC(tp, rtm_del_v4_prefix_nogw_success);
ATF_TP_ADD_TC(tp, rtm_add_v6_gu_gw_gu_direct_success);
___
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: r364488 - head/sys/kern

2020-08-22 Thread Mateusz Guzik
Author: mjg
Date: Sat Aug 22 16:58:59 2020
New Revision: 364488
URL: https://svnweb.freebsd.org/changeset/base/364488

Log:
  vfs: assert that HASBUF is only set with SAVENAME or SAVESTART
  
  as requested by the caller. The intent is to eradicate the mostly
  spurious NDFREE_PNBUF calls.

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Sat Aug 22 16:58:34 2020(r364487)
+++ head/sys/kern/vfs_lookup.c  Sat Aug 22 16:58:59 2020(r364488)
@@ -1384,6 +1384,7 @@ NDFREE_PNBUF(struct nameidata *ndp)
 {
 
if ((ndp->ni_cnd.cn_flags & HASBUF) != 0) {
+   MPASS((ndp->ni_cnd.cn_flags & (SAVENAME | SAVESTART)) != 0);
uma_zfree(namei_zone, ndp->ni_cnd.cn_pnbuf);
ndp->ni_cnd.cn_flags &= ~HASBUF;
}
___
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: r364487 - head/sys/kern

2020-08-22 Thread Mateusz Guzik
Author: mjg
Date: Sat Aug 22 16:58:34 2020
New Revision: 364487
URL: https://svnweb.freebsd.org/changeset/base/364487

Log:
  cache: stronger vnode asserts in cache_enter_time

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Sat Aug 22 16:57:45 2020(r364486)
+++ head/sys/kern/vfs_cache.c   Sat Aug 22 16:58:34 2020(r364487)
@@ -1892,10 +1892,12 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
u_long lnumcache;
 
CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr);
-   VNASSERT(vp == NULL || !VN_IS_DOOMED(vp), vp,
-   ("cache_enter: Adding a doomed vnode"));
-   VNASSERT(dvp == NULL || !VN_IS_DOOMED(dvp), dvp,
-   ("cache_enter: Doomed vnode used as src"));
+   VNPASS(!VN_IS_DOOMED(dvp), dvp);
+   VNPASS(dvp->v_type != VNON, dvp);
+   if (vp != NULL) {
+   VNPASS(!VN_IS_DOOMED(vp), vp);
+   VNPASS(vp->v_type != VNON, vp);
+   }
 
 #ifdef DEBUG_CACHE
if (__predict_false(!doingcache))
___
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: r364486 - head/sys/kern

2020-08-22 Thread Mateusz Guzik
Author: mjg
Date: Sat Aug 22 16:57:45 2020
New Revision: 364486
URL: https://svnweb.freebsd.org/changeset/base/364486

Log:
  fd: pwd_drop after releasing filedesc lock
  
  Fixes a potential LOR against vnode lock.

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cSat Aug 22 15:31:56 2020
(r364485)
+++ head/sys/kern/kern_descrip.cSat Aug 22 16:57:45 2020
(r364486)
@@ -3957,7 +3957,6 @@ kern_proc_filedesc_out(struct proc *p,  struct sbuf *s
vrefact(pwd->pwd_jdir);
export_vnode_to_sb(pwd->pwd_jdir, KF_FD_TYPE_JAIL, 
FREAD, efbuf);
}
-   pwd_drop(pwd);
}
lastfile = fdlastfile(fdp);
for (i = 0; fdp->fd_refcnt > 0 && i <= lastfile; i++) {
@@ -3979,6 +3978,8 @@ kern_proc_filedesc_out(struct proc *p,  struct sbuf *s
break;
}
FILEDESC_SUNLOCK(fdp);
+   if (pwd != NULL)
+   pwd_drop(pwd);
fddrop(fdp);
 fail:
free(efbuf, M_TEMP);
@@ -4100,7 +4101,6 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS)
if (pwd->pwd_jdir != NULL)
export_vnode_for_osysctl(pwd->pwd_jdir, 
KF_FD_TYPE_JAIL, kif,
okif, fdp, req);
-   pwd_drop(pwd);
}
lastfile = fdlastfile(fdp);
for (i = 0; fdp->fd_refcnt > 0 && i <= lastfile; i++) {
@@ -4116,6 +4116,8 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS)
break;
}
FILEDESC_SUNLOCK(fdp);
+   if (pwd != NULL)
+   pwd_drop(pwd);
fddrop(fdp);
free(kif, M_TEMP);
free(okif, M_TEMP);
___
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: r364485 - head/lib/clang/libllvm

2020-08-22 Thread Dimitry Andric
Author: dim
Date: Sat Aug 22 15:31:56 2020
New Revision: 364485
URL: https://svnweb.freebsd.org/changeset/base/364485

Log:
  Add a missed source file for LLVM's BPF target. This target is not
  enabled by default, so I forgot about it, apologies for the breakage.
  
  Reported by:  hrs
  MFC after:6 weeks
  X-MFC-With:   r364284

Modified:
  head/lib/clang/libllvm/Makefile

Modified: head/lib/clang/libllvm/Makefile
==
--- head/lib/clang/libllvm/Makefile Sat Aug 22 14:39:14 2020
(r364484)
+++ head/lib/clang/libllvm/Makefile Sat Aug 22 15:31:56 2020
(r364485)
@@ -1134,6 +1134,7 @@ SRCS_MIN+=Target/BPF/BPFMCInstLower.cpp
 SRCS_MIN+= Target/BPF/BPFMIChecking.cpp
 SRCS_MIN+= Target/BPF/BPFMIPeephole.cpp
 SRCS_MIN+= Target/BPF/BPFMISimplifyPatchable.cpp
+SRCS_MIN+= Target/BPF/BPFPreserveDIType.cpp
 SRCS_MIN+= Target/BPF/BPFRegisterInfo.cpp
 SRCS_MIN+= Target/BPF/BPFSelectionDAGInfo.cpp
 SRCS_MIN+= Target/BPF/BPFSubtarget.cpp
___
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: r364484 - head/sys/arm64/acpica

2020-08-22 Thread Ed Maste
Author: emaste
Date: Sat Aug 22 14:39:14 2020
New Revision: 364484
URL: https://svnweb.freebsd.org/changeset/base/364484

Log:
  acpi_iort: fix mapping end calculation
  
  According to the ARM Design Document "IO Remapping Table Platform"
  (DEN 0049D), the "Number of IDs" field of the ID mapping format means
  "The number of IDs in the range minus one".
  
  Submitted by: Greg V 
  Reviewed by:  andrew
  Differential Revision:https://reviews.freebsd.org/D25179

Modified:
  head/sys/arm64/acpica/acpi_iort.c

Modified: head/sys/arm64/acpica/acpi_iort.c
==
--- head/sys/arm64/acpica/acpi_iort.c   Sat Aug 22 14:24:17 2020
(r364483)
+++ head/sys/arm64/acpica/acpi_iort.c   Sat Aug 22 14:39:14 2020
(r364484)
@@ -234,7 +234,11 @@ iort_copy_data(struct iort_node *node, ACPI_IORT_NODE 
node->entries.mappings = mapping;
for (i = 0; i < node->nentries; i++, mapping++, map_entry++) {
mapping->base = map_entry->InputBase;
-   mapping->end = map_entry->InputBase + map_entry->IdCount - 1;
+   /*
+* IdCount means "The number of IDs in the range minus one" 
(ARM DEN 0049D).
+* We use <= for comparison against this field, so don't add 
one here.
+*/
+   mapping->end = map_entry->InputBase + map_entry->IdCount;
mapping->outbase = map_entry->OutputBase;
mapping->out_node_offset = map_entry->OutputReference;
mapping->flags = map_entry->Flags;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r364438 - in head/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools

2020-08-22 Thread Dimitry Andric
On 22 Aug 2020, at 16:27, Mark Johnston  wrote:
> 
> On Sat, Aug 22, 2020 at 12:40:49PM +0200, Antoine Brodin wrote:
>> On Thu, Aug 20, 2020 at 9:28 PM Mark Johnston  wrote:
>>> 
>>> Author: markj
>>> Date: Thu Aug 20 19:28:19 2020
>>> New Revision: 364438
>>> URL: https://svnweb.freebsd.org/changeset/base/364438
>>> 
>>> Log:
>>>  Enable creation of static userspace probes in incremental builds.
>>> 
>>>  To define USDT probes, dtrace -G makes use of relocations for undefined
>>>  symbols: the target address is overwritten with NOPs and the location is
>>>  recorded in the DOF section of the output object file.  To avoid link
>>>  errors, the original relocation is destroyed.  However, this means that
>>>  the same input object file cannot be processed multiple times, as
>>>  happens during incremental rebuilds.  Instead, only set the relocation
>>>  type to NONE, so that all information required to reconstruct USDT
>>>  probes is preserved.
>>> 
>>>  Reported by:  bdrewery
>>>  MFC after:3 weeks
>>>  Sponsored by: The FreeBSD Foundation
>>> 
>>> Modified:
>>>  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
>>>  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c
>>>  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h
>>>  head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
>> 
>> Hi,
>> 
>> This change seems broken on i386:
>> 
>> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-devel-5.33.0.262.log
>> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.28-5.28.3.log
>> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.30-5.30.3.log
>> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-5.32.0.log
> 
> The links are dead, but I think the problem should be fixed by r364483.

They work, but only over IPv6, unfortunately. :-)

-Dimitry



signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r364438 - in head/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools

2020-08-22 Thread Mark Johnston
On Sat, Aug 22, 2020 at 12:40:49PM +0200, Antoine Brodin wrote:
> On Thu, Aug 20, 2020 at 9:28 PM Mark Johnston  wrote:
> >
> > Author: markj
> > Date: Thu Aug 20 19:28:19 2020
> > New Revision: 364438
> > URL: https://svnweb.freebsd.org/changeset/base/364438
> >
> > Log:
> >   Enable creation of static userspace probes in incremental builds.
> >
> >   To define USDT probes, dtrace -G makes use of relocations for undefined
> >   symbols: the target address is overwritten with NOPs and the location is
> >   recorded in the DOF section of the output object file.  To avoid link
> >   errors, the original relocation is destroyed.  However, this means that
> >   the same input object file cannot be processed multiple times, as
> >   happens during incremental rebuilds.  Instead, only set the relocation
> >   type to NONE, so that all information required to reconstruct USDT
> >   probes is preserved.
> >
> >   Reported by:  bdrewery
> >   MFC after:3 weeks
> >   Sponsored by: The FreeBSD Foundation
> >
> > Modified:
> >   head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
> >   head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c
> >   head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h
> >   head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
> 
> Hi,
> 
> This change seems broken on i386:
> 
> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-devel-5.33.0.262.log
> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.28-5.28.3.log
> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.30-5.30.3.log
> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-5.32.0.log

The links are dead, but I think the problem should be fixed by r364483.

> 
> Cheers,
> 
> Antoine
___
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: r364483 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2020-08-22 Thread Mark Johnston
Author: markj
Date: Sat Aug 22 14:24:17 2020
New Revision: 364483
URL: https://svnweb.freebsd.org/changeset/base/364483

Log:
  Fix a typo in r364438 affecting 32-bit platforms.
  
  Reported by:  antoine
  MFC with: r364438

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

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cSat Aug 
22 12:05:11 2020(r364482)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cSat Aug 
22 14:24:17 2020(r364483)
@@ -1583,14 +1583,14 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e
 * preserved in order to support incremental rebuilds.
 */
if (shdr_rel.sh_type == SHT_RELA) {
-   rela.r_info =
-   GELF_R_INFO(GELF_R_SYM(rela.r_info), 0);
+   rela.r_info = GELF_R_INFO(
+   GELF_R_SYM(rela.r_info), DT_REL_NONE);
(void) gelf_update_rela(data_rel, i, );
} else {
GElf_Rel rel;
rel.r_offset = rela.r_offset;
-   rela.r_info =
-   GELF_R_INFO(GELF_R_SYM(rela.r_info), 0);
+   rel.r_info = GELF_R_INFO(
+   GELF_R_SYM(rela.r_info), DT_REL_NONE);
(void) gelf_update_rel(data_rel, i, );
}
 
___
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: r364482 - head/lib/libc++

2020-08-22 Thread Shawn Webb
On Sat, Aug 22, 2020 at 04:17:33PM +0200, Dimitry Andric wrote:
> On 22 Aug 2020, at 16:07, Shawn Webb  wrote:
> > 
> > On Sat, Aug 22, 2020 at 12:05:11PM +, Dimitry Andric wrote:
> >> Author: dim
> >> Date: Sat Aug 22 12:05:11 2020
> >> New Revision: 364482
> >> URL: https://svnweb.freebsd.org/changeset/base/364482
> >> 
> >> Log:
> >>  Add a few new source files to libc++, in particular the implementation
> >>  part of std::random_shuffle. These were split off at some point by
> >>  upstream, but I forgot to add them to our Makefile.
> >> 
> >>  This should allow some ports which use std::random_shuffle to correctly
> >>  link again.
> >> 
> >>  Reported by:  thierry
> >>  PR:   248795
> >>  MFC after:6 weeks
> >>  X-MFX-With:   r364284
> >> 
> >> Modified:
> >>  head/lib/libc++/Makefile
> >> 
> >> Modified: head/lib/libc++/Makefile
> >> ==
> >> --- head/lib/libc++/Makefile   Sat Aug 22 11:59:14 2020
> >> (r364481)
> >> +++ head/lib/libc++/Makefile   Sat Aug 22 12:05:11 2020
> >> (r364482)
> >> @@ -16,6 +16,8 @@ SHLIB_LDSCRIPT=  libc++.ldscript
> >> 
> >> SRCS+= algorithm.cpp
> >> SRCS+= any.cpp
> >> +SRCS+=atomic.cpp
> >> +SRCS+=barrier.cpp
> >> SRCS+= bind.cpp
> >> SRCS+= charconv.cpp
> >> SRCS+= chrono.cpp
> >> @@ -38,6 +40,7 @@ SRCS+=   mutex_destructor.cpp
> >> SRCS+= new.cpp
> >> SRCS+= optional.cpp
> >> SRCS+= random.cpp
> >> +SRCS+=random_shuffle.cpp
> >> SRCS+= regex.cpp
> >> SRCS+= shared_mutex.cpp
> >> SRCS+= stdexcept.cpp
> > 
> > There's also these files:
> > 
> > https://github.com/HardenedBSD/hardenedBSD/commit/9410e679cc7888311f6efaf251f8d9a311c5b19d
> 
> We intentionally don't build a number of the lldb plugins, so these
> should not be needed. Did you get build failures otherwise?

We did, likely because we use more llvm tools than our upstream
FreeBSD. We set WITH_CLANG_EXTRAS by default. We also use CFI and
SafeStack.

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2
https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc


signature.asc
Description: PGP signature


Re: svn commit: r364482 - head/lib/libc++

2020-08-22 Thread Dimitry Andric
On 22 Aug 2020, at 16:07, Shawn Webb  wrote:
> 
> On Sat, Aug 22, 2020 at 12:05:11PM +, Dimitry Andric wrote:
>> Author: dim
>> Date: Sat Aug 22 12:05:11 2020
>> New Revision: 364482
>> URL: https://svnweb.freebsd.org/changeset/base/364482
>> 
>> Log:
>>  Add a few new source files to libc++, in particular the implementation
>>  part of std::random_shuffle. These were split off at some point by
>>  upstream, but I forgot to add them to our Makefile.
>> 
>>  This should allow some ports which use std::random_shuffle to correctly
>>  link again.
>> 
>>  Reported by:thierry
>>  PR: 248795
>>  MFC after:  6 weeks
>>  X-MFX-With: r364284
>> 
>> Modified:
>>  head/lib/libc++/Makefile
>> 
>> Modified: head/lib/libc++/Makefile
>> ==
>> --- head/lib/libc++/Makefile Sat Aug 22 11:59:14 2020(r364481)
>> +++ head/lib/libc++/Makefile Sat Aug 22 12:05:11 2020(r364482)
>> @@ -16,6 +16,8 @@ SHLIB_LDSCRIPT=libc++.ldscript
>> 
>> SRCS+=   algorithm.cpp
>> SRCS+=   any.cpp
>> +SRCS+=  atomic.cpp
>> +SRCS+=  barrier.cpp
>> SRCS+=   bind.cpp
>> SRCS+=   charconv.cpp
>> SRCS+=   chrono.cpp
>> @@ -38,6 +40,7 @@ SRCS+= mutex_destructor.cpp
>> SRCS+=   new.cpp
>> SRCS+=   optional.cpp
>> SRCS+=   random.cpp
>> +SRCS+=  random_shuffle.cpp
>> SRCS+=   regex.cpp
>> SRCS+=   shared_mutex.cpp
>> SRCS+=   stdexcept.cpp
> 
> There's also these files:
> 
> https://github.com/HardenedBSD/hardenedBSD/commit/9410e679cc7888311f6efaf251f8d9a311c5b19d

We intentionally don't build a number of the lldb plugins, so these
should not be needed. Did you get build failures otherwise?

In case you require the full lldb functionality, it is better to install
the port.

-Dimitry



signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r364482 - head/lib/libc++

2020-08-22 Thread Shawn Webb
On Sat, Aug 22, 2020 at 12:05:11PM +, Dimitry Andric wrote:
> Author: dim
> Date: Sat Aug 22 12:05:11 2020
> New Revision: 364482
> URL: https://svnweb.freebsd.org/changeset/base/364482
> 
> Log:
>   Add a few new source files to libc++, in particular the implementation
>   part of std::random_shuffle. These were split off at some point by
>   upstream, but I forgot to add them to our Makefile.
>   
>   This should allow some ports which use std::random_shuffle to correctly
>   link again.
>   
>   Reported by:thierry
>   PR: 248795
>   MFC after:  6 weeks
>   X-MFX-With: r364284
> 
> Modified:
>   head/lib/libc++/Makefile
> 
> Modified: head/lib/libc++/Makefile
> ==
> --- head/lib/libc++/Makefile  Sat Aug 22 11:59:14 2020(r364481)
> +++ head/lib/libc++/Makefile  Sat Aug 22 12:05:11 2020(r364482)
> @@ -16,6 +16,8 @@ SHLIB_LDSCRIPT= libc++.ldscript
>  
>  SRCS+=   algorithm.cpp
>  SRCS+=   any.cpp
> +SRCS+=   atomic.cpp
> +SRCS+=   barrier.cpp
>  SRCS+=   bind.cpp
>  SRCS+=   charconv.cpp
>  SRCS+=   chrono.cpp
> @@ -38,6 +40,7 @@ SRCS+=  mutex_destructor.cpp
>  SRCS+=   new.cpp
>  SRCS+=   optional.cpp
>  SRCS+=   random.cpp
> +SRCS+=   random_shuffle.cpp
>  SRCS+=   regex.cpp
>  SRCS+=   shared_mutex.cpp
>  SRCS+=   stdexcept.cpp

There's also these files:

https://github.com/HardenedBSD/hardenedBSD/commit/9410e679cc7888311f6efaf251f8d9a311c5b19d

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2
https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc


signature.asc
Description: PGP signature


Re: svn commit: r364482 - head/lib/libc++

2020-08-22 Thread Dimitry Andric
On 22 Aug 2020, at 14:05, Dimitry Andric  wrote:
> 
> Author: dim
> Date: Sat Aug 22 12:05:11 2020
> New Revision: 364482
> URL: https://svnweb.freebsd.org/changeset/base/364482
> 
> Log:
>  Add a few new source files to libc++, in particular the implementation
>  part of std::random_shuffle. These were split off at some point by
>  upstream, but I forgot to add them to our Makefile.
> 
>  This should allow some ports which use std::random_shuffle to correctly
>  link again.
> 
>  Reported by: thierry
>  PR:  248795

Oops, the first reporter was actually tobik (Tobias Kortkamp)!

-Dimitry



signature.asc
Description: Message signed with OpenPGP


svn commit: r364482 - head/lib/libc++

2020-08-22 Thread Dimitry Andric
Author: dim
Date: Sat Aug 22 12:05:11 2020
New Revision: 364482
URL: https://svnweb.freebsd.org/changeset/base/364482

Log:
  Add a few new source files to libc++, in particular the implementation
  part of std::random_shuffle. These were split off at some point by
  upstream, but I forgot to add them to our Makefile.
  
  This should allow some ports which use std::random_shuffle to correctly
  link again.
  
  Reported by:  thierry
  PR:   248795
  MFC after:6 weeks
  X-MFX-With:   r364284

Modified:
  head/lib/libc++/Makefile

Modified: head/lib/libc++/Makefile
==
--- head/lib/libc++/MakefileSat Aug 22 11:59:14 2020(r364481)
+++ head/lib/libc++/MakefileSat Aug 22 12:05:11 2020(r364482)
@@ -16,6 +16,8 @@ SHLIB_LDSCRIPT=   libc++.ldscript
 
 SRCS+= algorithm.cpp
 SRCS+= any.cpp
+SRCS+= atomic.cpp
+SRCS+= barrier.cpp
 SRCS+= bind.cpp
 SRCS+= charconv.cpp
 SRCS+= chrono.cpp
@@ -38,6 +40,7 @@ SRCS+=mutex_destructor.cpp
 SRCS+= new.cpp
 SRCS+= optional.cpp
 SRCS+= random.cpp
+SRCS+= random_shuffle.cpp
 SRCS+= regex.cpp
 SRCS+= shared_mutex.cpp
 SRCS+= stdexcept.cpp
___
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: r364481 - head/sbin/sysctl

2020-08-22 Thread Fernando ApesteguĂ­a
Author: fernape (ports committer)
Date: Sat Aug 22 11:59:14 2020
New Revision: 364481
URL: https://svnweb.freebsd.org/changeset/base/364481

Log:
  sysctl(8): clarify -n flag
  
  -n omits the name of the variable regardless of the type of information that 
is
  requested. Rephrase to clarify this point.
  
  PR:   242191
  Submitted by: stil...@gmail.com
  Approved by:  emaste@
  Differential Revision:https://reviews.freebsd.org/D26149

Modified:
  head/sbin/sysctl/sysctl.8

Modified: head/sbin/sysctl/sysctl.8
==
--- head/sbin/sysctl/sysctl.8   Sat Aug 22 10:55:55 2020(r364480)
+++ head/sbin/sysctl/sysctl.8   Sat Aug 22 11:59:14 2020(r364481)
@@ -28,7 +28,7 @@
 .\"From: @(#)sysctl.8  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd February 8, 2019
+.Dd August 22, 2020
 .Dt SYSCTL 8
 .Os
 .Sh NAME
@@ -123,7 +123,7 @@ use:
 .Pp
 .Dl "complete sysctl 'n/*/`sysctl -Na`/'"
 .It Fl n
-Show only variable values, not their names.
+Do not show variable names.
 This option is useful for setting shell variables.
 For instance, to save the pagesize in variable
 .Va psize ,
___
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: r364480 - head/contrib/llvm-project/lldb/source/Target

2020-08-22 Thread Dimitry Andric
Author: dim
Date: Sat Aug 22 10:55:55 2020
New Revision: 364480
URL: https://svnweb.freebsd.org/changeset/base/364480

Log:
  Merge commit 1ce07cd614be from llvm git (by me):
  
Instantiate Error in Target::GetEntryPointAddress() only when
necessary
  
When Target::GetEntryPointAddress() calls
exe_module->GetObjectFile()->GetEntryPointAddress(), and the returned
entry_addr is valid, it can immediately be returned.
  
However, just before that, an llvm::Error value has been setup, but
in this case it is not consumed before returning, like is done
further below in the function.
  
In https://bugs.freebsd.org/248745 we got a bug report for this,
where a very simple test case aborts and dumps core:
  
* thread #1, name = 'testcase', stop reason = breakpoint 1.1
frame #0: 0x002018d4 testcase`main(argc=1, 
argv=0x7fffea18) at testcase.c:3:5
   1int main(int argc, char *argv[])
   2{
-> 3return 0;
   4}
(lldb) p argc
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior 
to being destroyed).
  
Thread 1 received signal SIGABRT, Aborted.
thr_kill () at thr_kill.S:3
3   thr_kill.S: No such file or directory.
(gdb) bt
#0  thr_kill () at thr_kill.S:3
#1  0x0008049a0004 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x000804916229 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x0451b5f5 in fatalUncheckedError () at 
/usr/src/contrib/llvm-project/llvm/lib/Support/Error.cpp:112
#4  0x019cf008 in GetEntryPointAddress () at 
/usr/src/contrib/llvm-project/llvm/include/llvm/Support/Error.h:267
#5  0x01bccbd8 in ConstructorSetup () at 
/usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:67
#6  0x01bcd2c0 in ThreadPlanCallFunction () at 
/usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:114
#7  0x020076d4 in InferiorCallMmap () at 
/usr/src/contrib/llvm-project/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp:97
#8  0x01f4be33 in DoAllocateMemory () at 
/usr/src/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:604
#9  0x01fe51b9 in AllocatePage () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:347
#10 0x01fe5385 in AllocateMemory () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:383
#11 0x01974da2 in AllocateMemory () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2301
#12 CanJIT () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2331
#13 0x01a1bf3d in Evaluate () at 
/usr/src/contrib/llvm-project/lldb/source/Expression/UserExpression.cpp:190
#14 0x019ce7a2 in EvaluateExpression () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Target.cpp:2372
#15 0x01ad784c in EvaluateExpression () at 
/usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:414
#16 0x01ad86ae in DoExecute () at 
/usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:646
#17 0x01a5e3ed in Execute () at 
/usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp:1003
#18 0x01a6c4a3 in HandleCommand () at 
/usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1762
#19 0x01a6f98c in IOHandlerInputComplete () at 
/usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760
#20 0x01a90b08 in Run () at 
/usr/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:548
#21 0x019a6c6a in ExecuteIOHandlers () at 
/usr/src/contrib/llvm-project/lldb/source/Core/Debugger.cpp:903
#22 0x01a70337 in RunCommandInterpreter () at 
/usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2946
#23 0x01d9d812 in RunCommandInterpreter () at 
/usr/src/contrib/llvm-project/lldb/source/API/SBDebugger.cpp:1169
#24 0x01918be8 in MainLoop () at 
/usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:675
#25 0x0191a114 in main () at 
/usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:890
  
Fix the incorrect error catch by only instantiating an Error object
if it is necessary.
  
Reviewed By: JDevlieghere
  
Differential Revision: https://reviews.llvm.org/D86355
  
  This should fix lldb aborting as described in the scenario above.
  
  Reported by:  dmgk
  PR:   248745

Modified:
  head/contrib/llvm-project/lldb/source/Target/Target.cpp

Modified: head/contrib/llvm-project/lldb/source/Target/Target.cpp
==
--- head/contrib/llvm-project/lldb/source/Target/Target.cpp Sat Aug 22 
07:43:38 2020

Re: svn commit: r364449 - head/bin/ls

2020-08-22 Thread Hiroki Sato
Hi,

Gordon Bergling  wrote
  in <202008210620.07l6kc6m091...@repo.freebsd.org>:

gb> Author: gbe (doc committer)
gb> Date: Fri Aug 21 06:20:11 2020
gb> New Revision: 364449
gb> URL: https://svnweb.freebsd.org/changeset/base/364449
gb>
gb> Log:
gb>   ls(1): Update POSIX conformance from 2001 to 2008
gb>
gb>   - Update the options that are non-existing in POSIX from 2001 to 2008
gb>   - Update POSIX conformance in the STANDARDS section from 2001 to 2008

 Generally speaking, conformance with POSIX.1-2001 (SUSv3) and
 POSIX.1-2008 (SUSv4) are independent, so a simple replacement by
 s/2001/2008/ removes the former information.  If we want to describe
 -2008, please add it instead of replacing the prior version numbers.

-- Hiroki


pgpiyC5RvlnTz.pgp
Description: PGP signature


Re: svn commit: r364438 - in head/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools

2020-08-22 Thread Antoine Brodin
On Thu, Aug 20, 2020 at 9:28 PM Mark Johnston  wrote:
>
> Author: markj
> Date: Thu Aug 20 19:28:19 2020
> New Revision: 364438
> URL: https://svnweb.freebsd.org/changeset/base/364438
>
> Log:
>   Enable creation of static userspace probes in incremental builds.
>
>   To define USDT probes, dtrace -G makes use of relocations for undefined
>   symbols: the target address is overwritten with NOPs and the location is
>   recorded in the DOF section of the output object file.  To avoid link
>   errors, the original relocation is destroyed.  However, this means that
>   the same input object file cannot be processed multiple times, as
>   happens during incremental rebuilds.  Instead, only set the relocation
>   type to NONE, so that all information required to reconstruct USDT
>   probes is preserved.
>
>   Reported by:  bdrewery
>   MFC after:3 weeks
>   Sponsored by: The FreeBSD Foundation
>
> Modified:
>   head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
>   head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c
>   head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h
>   head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh

Hi,

This change seems broken on i386:

http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-devel-5.33.0.262.log
http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.28-5.28.3.log
http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.30-5.30.3.log
http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-5.32.0.log

Cheers,

Antoine
___
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: r364479 - head/sys/net/route

2020-08-22 Thread Mateusz Guzik
Author: mjg
Date: Sat Aug 22 07:43:38 2020
New Revision: 364479
URL: https://svnweb.freebsd.org/changeset/base/364479

Log:
  Fix tinderbox build after r364465

Modified:
  head/sys/net/route/route_tables.c

Modified: head/sys/net/route/route_tables.c
==
--- head/sys/net/route/route_tables.c   Sat Aug 22 06:56:04 2020
(r364478)
+++ head/sys/net/route/route_tables.c   Sat Aug 22 07:43:38 2020
(r364479)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
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: r364478 - head/sys/kern

2020-08-22 Thread Mateusz Guzik
Author: mjg
Date: Sat Aug 22 06:56:04 2020
New Revision: 364478
URL: https://svnweb.freebsd.org/changeset/base/364478

Log:
  vfs: add a work around for vp_crossmp bug to realpath
  
  The actual bug is not yet addressed as it will get much easier after other
  problems are addressed (most notably rename contract).
  
  The only affected in-tree consumer is realpath. Everyone else happens to be
  performing lookups within a mount point, having a side effect of ni_dvp being
  set to mount point's root vnode in the worst case.
  
  Reported by:  pho

Modified:
  head/sys/kern/vfs_cache.c
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Sat Aug 22 04:07:44 2020(r364477)
+++ head/sys/kern/vfs_cache.c   Sat Aug 22 06:56:04 2020(r364478)
@@ -2811,6 +2811,7 @@ vn_fullpath_hardlink(struct thread *td, struct nameida
size_t addend;
int error;
bool slash_prefixed;
+   enum vtype type;
 
if (*buflen < 2)
return (EINVAL);
@@ -2824,7 +2825,31 @@ vn_fullpath_hardlink(struct thread *td, struct nameida
 
addend = 0;
vp = ndp->ni_vp;
-   if (vp->v_type != VDIR) {
+   /*
+* Check for VBAD to work around the vp_crossmp bug in lookup().
+*
+* For example consider tmpfs on /tmp and realpath /tmp. ni_vp will be
+* set to mount point's root vnode while ni_dvp will be vp_crossmp.
+* If the type is VDIR (like in this very case) we can skip looking
+* at ni_dvp in the first place. However, since vnodes get passed here
+* unlocked the target may transition to doomed state (type == VBAD)
+* before we get to evaluate the condition. If this happens, we will
+* populate part of the buffer and descend to vn_fullpath_dir with
+* vp == vp_crossmp. Prevent the problem by checking for VBAD.
+*
+* This should be atomic_load(>v_type) but it is ilegal to take
+* an address of a bit field, even if said field is sized to char.
+* Work around the problem by reading the value into a full-sized enum
+* and then re-reading it with atomic_load which will still prevent
+* the compiler from re-reading down the road.
+*/
+   type = vp->v_type;
+   type = atomic_load_int();
+   if (type == VBAD) {
+   error = ENOENT;
+   goto out_bad;
+   }
+   if (type != VDIR) {
cnp = >ni_cnd;
addend = cnp->cn_namelen + 2;
if (*buflen < addend) {

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Sat Aug 22 04:07:44 2020(r364477)
+++ head/sys/kern/vfs_lookup.c  Sat Aug 22 06:56:04 2020(r364478)
@@ -1209,6 +1209,11 @@ nextname:
VOP_UNLOCK(dp);
 success:
/*
+* FIXME: for lookups which only cross a mount point to fetch the
+* root vnode, ni_dvp will be set to vp_crossmp. This can be a problem
+* if either WANTPARENT or LOCKPARENT is set.
+*/
+   /*
 * Because of shared lookup we may have the vnode shared locked, but
 * the caller may want it to be exclusively locked.
 */
___
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"