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

2020-05-21 Thread Rodney W. Grimes
Author: rgrimes
Date: Fri May 22 03:13:29 2020
New Revision: 361355
URL: https://svnweb.freebsd.org/changeset/base/361355

Log:
  Include all currently present kernel options for IPFW
  Also fix igor complaint about manpage/s/man page
  
  Reported by: rgri...@freebsd.org
  
  PR:   219075
  Submitted by: Dries Michiels driesm.michiels_gmail.com
  Reported by:  rgrimes
  Reviewed by:  bcr (manpages), 0mp
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D24541

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

Modified: head/share/man/man4/ipfirewall.4
==
--- head/share/man/man4/ipfirewall.4Fri May 22 03:11:33 2020
(r361354)
+++ head/share/man/man4/ipfirewall.4Fri May 22 03:13:29 2020
(r361355)
@@ -1,7 +1,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 25, 2012
+.Dd May 21, 2020
 .Dt IPFW 4
 .Os
 .Sh NAME
@@ -20,8 +20,14 @@ Other related kernel options
 which may also be useful are:
 .Bd -ragged -offset indent
 .Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT"
+.Cd "options IPDIVERT"
+.Cd "options IPFIREWALL_NAT"
+.Cd "options IPFIREWALL_NAT64"
+.Cd "options IPFIREWALL_NPTV6"
+.Cd "options IPFIREWALL_PMOD"
 .Cd "options IPFIREWALL_VERBOSE"
 .Cd "options IPFIREWALL_VERBOSE_LIMIT=100"
+.Cd "options LIBALIAS"
 .Ed
 .Pp
 To load
@@ -57,6 +63,54 @@ If the default
 behavior is to allow everything, it is easier to cope with
 firewall-tuning mistakes which may accidentally block all traffic.
 .Pp
+When using
+.Xr natd 8
+in conjunction with
+.Nm
+as
+.Tn NAT
+facility, the kernel option
+.Dv IPDIVERT
+enables diverting packets to
+.Xr natd 8
+for translation.
+.Pp
+When using the in-kernel
+.Tn NAT
+facility of
+.Nm ,
+the kernel option
+.Dv IPFIREWALL_NAT
+enables basic
+.Xr libalias 3
+functionality in the kernel.
+.Pp
+When using any of the
+.Tn IPv4
+to
+.Tn IPv6
+transition mechanisms in
+.Nm ,
+the kernel option
+.Dv IPFIREWALL_NAT64
+enables all of these
+.Tn NAT64
+methods in the kernel.
+.Pp
+When using the
+.Tn IPv6
+network prefix translation facility of
+.Nm ,
+the kernel option
+.Dv IPFIREWALL_NPTV6
+enables this functionality in the kernel.
+.Pp
+When using the packet modification facility of
+.Nm ,
+the kernel option
+.Dv IPFIREWALL_PMOD
+enables this functionality in the kernel.
+.Pp
 To enable logging of packets passing through
 .Nm ,
 enable the
@@ -70,20 +124,39 @@ from flooding system logs or causing local Denial of S
 This option may be set to the number of packets which will be logged on
 a per-entry basis before the entry is rate-limited.
 .Pp
+When using the in-kernel
+.Tn NAT
+facility of
+.Nm ,
+the kernel option
+.Dv LIBALIAS
+enables full
+.Xr libalias 3
+functionality in the kernel.
+Full functionality refers to included support for cuseeme, ftp, bbt,
+skinny, irc, pptp and smedia packets, which are missing in the basic
+.Xr libalias 3
+functionality accomplished with the
+.Dv IPFIREWALL_NAT
+kernel option.
+.Pp
 The user interface for
 .Nm
 is implemented by the
 .Xr ipfw 8
 utility, so please refer to the
 .Xr ipfw 8
-manpage for a complete description of the
+man page for a complete description of the
 .Nm
 capabilities and how to use it.
 .Sh SEE ALSO
 .Xr setsockopt 2 ,
 .Xr divert 4 ,
 .Xr ip 4 ,
+.Xr ip6 4 ,
 .Xr ipfw 8 ,
+.Xr libalias 3 ,
+.Xr natd 8 ,
 .Xr sysctl 8 ,
 .Xr syslogd 8 ,
 .Xr pfil 9
___
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: r361354 - stable/11/etc/ntp

2020-05-21 Thread Xin LI
Author: delphij
Date: Fri May 22 03:11:33 2020
New Revision: 361354
URL: https://svnweb.freebsd.org/changeset/base/361354

Log:
  MFC r361260: Update leap-seconds to leap-seconds.3676924800.

Modified:
  stable/11/etc/ntp/leap-seconds
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/ntp/leap-seconds
==
--- stable/11/etc/ntp/leap-seconds  Fri May 22 02:06:56 2020
(r361353)
+++ stable/11/etc/ntp/leap-seconds  Fri May 22 03:11:33 2020
(r361354)
@@ -204,10 +204,10 @@
 #  current -- the update time stamp, the data and the name of the file
 #  will not change.
 #
-#  Updated through IERS Bulletin C58
-#  File expires on:  28 June 2020
+#  Updated through IERS Bulletin C59
+#  File expires on:  28 December 2020
 #
-#@ 3802291200
+#@ 3818102400
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -252,4 +252,4 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30
+#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea
___
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: r361353 - stable/12/usr.sbin/ntp/ntpd

2020-05-21 Thread Xin LI
Author: delphij
Date: Fri May 22 02:06:56 2020
New Revision: 361353
URL: https://svnweb.freebsd.org/changeset/base/361353

Log:
  MFC r361260: Update leap-seconds to leap-seconds.3676924800.

Modified:
  stable/12/usr.sbin/ntp/ntpd/leap-seconds
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/ntp/ntpd/leap-seconds
==
--- stable/12/usr.sbin/ntp/ntpd/leap-secondsFri May 22 01:18:55 2020
(r361352)
+++ stable/12/usr.sbin/ntp/ntpd/leap-secondsFri May 22 02:06:56 2020
(r361353)
@@ -204,10 +204,10 @@
 #  current -- the update time stamp, the data and the name of the file
 #  will not change.
 #
-#  Updated through IERS Bulletin C58
-#  File expires on:  28 June 2020
+#  Updated through IERS Bulletin C59
+#  File expires on:  28 December 2020
 #
-#@ 3802291200
+#@ 3818102400
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -252,4 +252,4 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30
+#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea
___
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: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica

2020-05-21 Thread Mark Johnston
On Fri, May 22, 2020 at 12:45:03AM +0200, Herbert J. Skuhra wrote:
> On Thu, 21 May 2020 17:28:35 +0200, Mark Johnston wrote:
> > 
> > Author: markj
> > Date: Thu May 21 15:28:35 2020
> > New Revision: 361334
> > URL: https://svnweb.freebsd.org/changeset/base/361334
> > 
> > Log:
> >   MFC r361033:
> >   Call acpi_pxm_set_proximity_info() slightly earlier on x86.
> > 
> > Modified:
> >   stable/12/sys/amd64/amd64/mp_machdep.c
> >   stable/12/sys/arm64/arm64/mp_machdep.c
> >   stable/12/sys/dev/acpica/acpi_pxm.c
> >   stable/12/sys/dev/acpica/acpivar.h
> >   stable/12/sys/i386/i386/mp_machdep.c
> >   stable/12/sys/x86/acpica/srat.c
> > Directory Properties:
> >   stable/12/   (props changed)
> > 
> > Modified: stable/12/sys/amd64/amd64/mp_machdep.c
> > ==
> > --- stable/12/sys/amd64/amd64/mp_machdep.c  Thu May 21 15:18:59 2020
> > (r361333)
> > +++ stable/12/sys/amd64/amd64/mp_machdep.c  Thu May 21 15:28:35 2020
> > (r361334)
> > @@ -265,8 +265,9 @@ cpu_mp_start(void)
> > init_ops.start_all_aps();
> >  
> > set_interrupt_apic_ids();
> > -}
> >  
> > +   acpi_pxm_set_cpu_locality();
> > +}
> >  
> >  /*
> >   * AP CPU's call this to initialize themselves.
> 
> Until now it was possible to build a kernel (amd64) without 'device
> acpi'. After this commit it fails with this error:
> 
> --- kernel.full ---
> linking kernel.full
> ld: error: undefined symbol: acpi_pxm_set_cpu_locality
> >>> referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269)
> >>>   mp_machdep.o:(cpu_mp_start)
> *** [kernel.full] Error code 1
> 
> Was that intended?

It was unintentional.  I committed a fix to head in r361352 and will
merge to stable/12 shortly.
___
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: r361352 - in head/sys: amd64/amd64 i386/i386

2020-05-21 Thread Mark Johnston
Author: markj
Date: Fri May 22 01:18:55 2020
New Revision: 361352
URL: https://svnweb.freebsd.org/changeset/base/361352

Log:
  Fix the build after r361033 when ACPI is disabled.
  
  Reported by:  Herbert J. Skuhra 

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/i386/i386/mp_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Fri May 22 00:00:55 2020
(r361351)
+++ head/sys/amd64/amd64/mp_machdep.c   Fri May 22 01:18:55 2020
(r361352)
@@ -29,6 +29,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_acpi.h"
 #include "opt_cpu.h"
 #include "opt_ddb.h"
 #include "opt_kstack_pages.h"
@@ -78,8 +79,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef DEV_ACPI
 #include 
 #include 
+#endif
 
 #define WARMBOOT_TARGET0
 #define WARMBOOT_OFF   (KERNBASE + 0x0467)
@@ -265,7 +268,9 @@ cpu_mp_start(void)
 
set_interrupt_apic_ids();
 
+#if defined(DEV_ACPI) && MAXMEMDOM > 1
acpi_pxm_set_cpu_locality();
+#endif
 }
 
 /*

Modified: head/sys/i386/i386/mp_machdep.c
==
--- head/sys/i386/i386/mp_machdep.c Fri May 22 00:00:55 2020
(r361351)
+++ head/sys/i386/i386/mp_machdep.c Fri May 22 01:18:55 2020
(r361352)
@@ -28,6 +28,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_acpi.h"
 #include "opt_apic.h"
 #include "opt_cpu.h"
 #include "opt_kstack_pages.h"
@@ -83,8 +84,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef DEV_ACPI
 #include 
 #include 
+#endif
 
 #define WARMBOOT_TARGET0
 #define WARMBOOT_OFF   (PMAP_MAP_LOW + 0x0467)
@@ -202,7 +205,7 @@ cpu_mp_start(void)
 
set_interrupt_apic_ids();
 
-#if MAXMEMDOM > 1
+#if defined(DEV_ACPI) && MAXMEMDOM > 1
acpi_pxm_set_cpu_locality();
 #endif
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361351 - releng/11.4/sys/conf

2020-05-21 Thread Glen Barber
Author: gjb
Date: Fri May 22 00:00:55 2020
New Revision: 361351
URL: https://svnweb.freebsd.org/changeset/base/361351

Log:
  Update releng/11.4 to RC1 as part of the 11.4-RELEASE cycle.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  releng/11.4/sys/conf/newvers.sh

Modified: releng/11.4/sys/conf/newvers.sh
==
--- releng/11.4/sys/conf/newvers.sh Thu May 21 22:47:39 2020
(r361350)
+++ releng/11.4/sys/conf/newvers.sh Fri May 22 00:00:55 2020
(r361351)
@@ -44,7 +44,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.4"
-BRANCH="BETA2"
+BRANCH="RC1"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r361342 - in stable/12/sys/netinet: . tcp_stacks

2020-05-21 Thread Rodney W. Grimes
> Author: rscheff
> Date: Thu May 21 19:46:11 2020
> New Revision: 361342
> URL: https://svnweb.freebsd.org/changeset/base/361342
> 
> Log:
Partial merge of r360477:

>   MFC r360477: Correctly set up the initial TCP congestion window in all cases
>   
>   by not including the SYN bit sequence space in cwnd related calculations.
>   Snd_und is adjusted explicitly in all cases, outside the cwnd update, 
> instead.
>   
>   This fixes an off-by-one conformance issue with regular TCP sessions
>   not  using Appropriate Byte Counting (RFC3465), sending one more
>   packet during  the initial window than expected.

There should of been a note here:
This does NOT contain the merge of the change to bbrv1 since at this
time that code does not exist in stable/12, and there is no plan to
merge that code to stable/12.
>   
>   PR: 235256
>   Reviewed by:tuexen (mentor), rgrimes (mentor, blanket)
>   Approved by:tuexen (mentor), rgrimes (mentor, blanket)
>   MFC after:  3 weeks
>   Sponsored by:   NetApp, Inc.
>   Differential Revision:  https://reviews.freebsd.org/D19000
> 
> Modified:
>   stable/12/sys/netinet/tcp_input.c
>   stable/12/sys/netinet/tcp_stacks/rack.c
> Directory Properties:
>   stable/12/   (props changed)
> 
> Modified: stable/12/sys/netinet/tcp_input.c
> ==
> --- stable/12/sys/netinet/tcp_input.c Thu May 21 19:45:14 2020
> (r361341)
> +++ stable/12/sys/netinet/tcp_input.c Thu May 21 19:46:11 2020
> (r361342)
> @@ -1519,7 +1519,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
>  struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos)
>  {
>   int thflags, acked, ourfinisacked, needoutput = 0, sack_changed;
> - int rstreason, todrop, win;
> + int rstreason, todrop, win, incforsyn = 0;
>   uint32_t tiwin;
>   uint16_t nsegs;
>   char *s;
> @@ -2432,12 +2432,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
>   if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) {
>   tcp_fastopen_decrement_counter(tp->t_tfo_pending);
>   tp->t_tfo_pending = NULL;
> -
> - /*
> -  * Account for the ACK of our SYN prior to
> -  * regular ACK processing below.
> -  */ 
> - tp->snd_una++;
>   }
>   if (tp->t_flags & TF_NEEDFIN) {
>   tcp_state_change(tp, TCPS_FIN_WAIT_1);
> @@ -2458,6 +2452,13 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
>   tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp));
>   }
>   /*
> +  * Account for the ACK of our SYN prior to
> +  * regular ACK processing below, except for
> +  * simultaneous SYN, which is handled later.
> +  */
> + if (SEQ_GT(th->th_ack, tp->snd_una) && !(tp->t_flags & 
> TF_NEEDSYN))
> + incforsyn = 1;
> + /*
>* If segment contains data or ACK, will call tcp_reass()
>* later; if not, do so now to pass queued data to user.
>*/
> @@ -2751,6 +2752,15 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
>  process_ACK:
>   INP_WLOCK_ASSERT(tp->t_inpcb);
>  
> + /*
> +  * Adjust for the SYN bit in sequence space,
> +  * but don't account for it in cwnd calculations.
> +  * This is for the SYN_RECEIVED, non-simultaneous
> +  * SYN case. SYN_SENT and simultaneous SYN are
> +  * treated elsewhere.
> +  */
> + if (incforsyn)
> + tp->snd_una++;
>   acked = BYTES_THIS_ACK(tp, th);
>   KASSERT(acked >= 0, ("%s: acked unexepectedly negative "
>   "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__,
> 
> Modified: stable/12/sys/netinet/tcp_stacks/rack.c
> ==
> --- stable/12/sys/netinet/tcp_stacks/rack.c   Thu May 21 19:45:14 2020
> (r361341)
> +++ stable/12/sys/netinet/tcp_stacks/rack.c   Thu May 21 19:46:11 2020
> (r361342)
> @@ -5580,12 +5580,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
>   if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) {
>   tcp_fastopen_decrement_counter(tp->t_tfo_pending);
>   tp->t_tfo_pending = NULL;
> -
> - /*
> -  * Account for the ACK of our SYN prior to
> -  * regular ACK processing below.
> -  */ 
> - tp->snd_una++;
>   }
>   if (tp->t_flags & TF_NEEDFIN) {
>   tcp_state_change(tp, TCPS_FIN_WAIT_1);
> @@ -5603,6 +5597,13 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
>   if 

Re: svn commit: r361340 - in stable/12/sys/netinet: . tcp_stacks

2020-05-21 Thread Rodney W. Grimes
> Author: rscheff
> Date: Thu May 21 19:41:25 2020
> New Revision: 361340
> URL: https://svnweb.freebsd.org/changeset/base/361340
> 
> Log:
>   MFC r360479: Prevent premature shrinking of the scaled receive window
>   
>   which can cause a TCP client to use invalid or stale TCP sequence numbers 
> for ACK packets.
>   
>   Packets with old sequence numbers are ignored and not used to update the 
> send window size.
>   This might cause the TCP session to hang indefinitely under some 
> circumstances.

There should of been a note here:
This does NOT contain the merge of the change to bbrv1 since at this
time that code does not exist in stable/12, and there is no plan to
merge that code to stable/12.

>   Reported by:Cui Cheng
>   Reviewed by:tuexen (mentor), rgrimes (mentor, blanket)
>   Approved by:tuexen (mentor), rgrimes (mentor, blanket)
>   MFC after:  3 weeks
>   Sponsored by:   NetApp, Inc.
>   Differential Revision:  https://reviews.freebsd.org/D24515
> 
> Modified:
>   stable/12/sys/netinet/tcp_output.c
>   stable/12/sys/netinet/tcp_stacks/rack.c
> Directory Properties:
>   stable/12/   (props changed)
> 
> Modified: stable/12/sys/netinet/tcp_output.c
> ==
> --- stable/12/sys/netinet/tcp_output.cThu May 21 18:50:05 2020
> (r361339)
> +++ stable/12/sys/netinet/tcp_output.cThu May 21 19:41:25 2020
> (r361340)
> @@ -1206,8 +1206,11 @@ send:
>   if (flags & TH_SYN)
>   th->th_win = htons((u_short)
>   (min(sbspace(>so_rcv), TCP_MAXWIN)));
> - else
> + else {
> + /* Avoid shrinking window with window scaling. */
> + recwin = roundup2(recwin, 1 << tp->rcv_scale);
>   th->th_win = htons((u_short)(recwin >> tp->rcv_scale));
> + }
>  
>   /*
>* Adjust the RXWIN0SENT flag - indicate that we have advertised
> 
> Modified: stable/12/sys/netinet/tcp_stacks/rack.c
> ==
> --- stable/12/sys/netinet/tcp_stacks/rack.c   Thu May 21 18:50:05 2020
> (r361339)
> +++ stable/12/sys/netinet/tcp_stacks/rack.c   Thu May 21 19:41:25 2020
> (r361340)
> @@ -8355,8 +8355,11 @@ send:
>   if (flags & TH_SYN)
>   th->th_win = htons((u_short)
>   (min(sbspace(>so_rcv), TCP_MAXWIN)));
> - else
> + else {
> + /* Avoid shrinking window with window scaling. */
> + recwin = roundup2(recwin, 1 << tp->rcv_scale);
>   th->th_win = htons((u_short)(recwin >> tp->rcv_scale));
> + }
>   /*
>* Adjust the RXWIN0SENT flag - indicate that we have advertised a 0
>* window.  This may cause the remote transmitter to stall.  This
> 

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


svn commit: r361350 - in stable/12: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat

2020-05-21 Thread Mark Johnston
Author: markj
Date: Thu May 21 22:47:39 2020
New Revision: 361350
URL: https://svnweb.freebsd.org/changeset/base/361350

Log:
  MFC r347532, r347541
  Provide separate accounting for user-wired pages.

Modified:
  stable/12/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
  stable/12/lib/libc/sys/mlock.2
  stable/12/lib/libc/sys/mlockall.2
  stable/12/lib/libc/tests/sys/mlock_helper.c
  stable/12/sys/amd64/vmm/vmm.c
  stable/12/sys/sys/param.h
  stable/12/sys/sys/vmmeter.h
  stable/12/sys/vm/vm_glue.c
  stable/12/sys/vm/vm_map.c
  stable/12/sys/vm/vm_map.h
  stable/12/sys/vm/vm_meter.c
  stable/12/sys/vm/vm_mmap.c
  stable/12/sys/vm/vm_pageout.c
  stable/12/sys/vm/vm_pageout.h
  stable/12/sys/vm/vm_unix.c
  stable/12/usr.bin/vmstat/vmstat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
==
--- stable/12/contrib/netbsd-tests/lib/libc/sys/t_mlock.c   Thu May 21 
22:24:23 2020(r361349)
+++ stable/12/contrib/netbsd-tests/lib/libc/sys/t_mlock.c   Thu May 21 
22:47:39 2020(r361350)
@@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 12:02:44 
 #define _KMEMUSER
 #include 
 
-void set_vm_max_wired(int);
+void set_vm_max_wired(u_long);
 void restore_vm_max_wired(void);
 #endif
 

Modified: stable/12/lib/libc/sys/mlock.2
==
--- stable/12/lib/libc/sys/mlock.2  Thu May 21 22:24:23 2020
(r361349)
+++ stable/12/lib/libc/sys/mlock.2  Thu May 21 22:47:39 2020
(r361350)
@@ -28,7 +28,7 @@
 .\"@(#)mlock.2 8.2 (Berkeley) 12/11/93
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2018
+.Dd May 13, 2019
 .Dt MLOCK 2
 .Os
 .Sh NAME
@@ -97,13 +97,13 @@ resource limit and the
 system-wide
 .Dq wired pages
 limit
-.Va vm.max_wired .
-.Va vm.max_wired
+.Va vm.max_user_wired .
+.Va vm.max_user_wired
 applies to the system as a whole, so the amount available to a single
 process at any given time is the difference between
-.Va vm.max_wired
+.Va vm.max_user_wired
 and
-.Va vm.stats.vm.v_wire_count .
+.Va vm.stats.vm.v_user_wire_count .
 .Pp
 If
 .Va security.bsd.unprivileged_mlock
@@ -124,13 +124,11 @@ will fail if:
 is set to 0 and the caller is not the super-user.
 .It Bq Er EINVAL
 The address range given wraps around zero.
-.It Bq Er EAGAIN
-Locking the indicated range would exceed the system limit for locked memory.
 .It Bq Er ENOMEM
 Some portion of the indicated address range is not allocated.
 There was an error faulting/mapping a page.
-Locking the indicated range would exceed the per-process limit for locked
-memory.
+Locking the indicated range would exceed the per-process or system-wide limits
+for locked memory.
 .El
 The
 .Fn munlock
@@ -171,11 +169,11 @@ system calls first appeared in
 Allocating too much wired memory can lead to a memory-allocation deadlock
 which requires a reboot to recover from.
 .Pp
-The per-process resource limit is a limit on the amount of virtual
-memory locked, while the system-wide limit is for the number of locked
-physical pages.
-Hence a process with two distinct locked mappings of the same physical page
-counts as 2 pages against the per-process limit and as only a single page
-in the system limit.
+The per-process and system-wide resource limits of locked memory apply
+to the amount of virtual memory locked, not the amount of locked physical
+pages.
+Hence two distinct locked mappings of the same physical page counts as
+2 pages aginst the system limit, and also against the per-process limit
+if both mappings belong to the same physical map.
 .Pp
 The per-process resource limit is not currently supported.

Modified: stable/12/lib/libc/sys/mlockall.2
==
--- stable/12/lib/libc/sys/mlockall.2   Thu May 21 22:24:23 2020
(r361349)
+++ stable/12/lib/libc/sys/mlockall.2   Thu May 21 22:47:39 2020
(r361350)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 25, 2012
+.Dd May 13, 2019
 .Dt MLOCKALL 2
 .Os
 .Sh NAME
@@ -69,7 +69,7 @@ limited in how much they can lock down.
 A single process can lock the minimum of a system-wide
 .Dq wired pages
 limit
-.Va vm.max_wired
+.Va vm.max_user_wired
 and the per-process
 .Dv RLIMIT_MEMLOCK
 resource limit.
@@ -138,9 +138,9 @@ and
 functions first appeared in
 .Fx 5.1 .
 .Sh BUGS
-The per-process resource limit is a limit on the amount of virtual
-memory locked, while the system-wide limit is for the number of locked
-physical pages.
-Hence a process with two distinct locked mappings of the same physical page
-counts as 2 pages against the per-process limit and as only a single page
-in the system limit.
+The per-process and system-wide resource limits of locked memory apply
+to the amount of virtual memory locked, not the amount of locked physical
+pages.
+Hence two distinct locked mappings of 

Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica

2020-05-21 Thread Herbert J. Skuhra
On Thu, 21 May 2020 17:28:35 +0200, Mark Johnston wrote:
> 
> Author: markj
> Date: Thu May 21 15:28:35 2020
> New Revision: 361334
> URL: https://svnweb.freebsd.org/changeset/base/361334
> 
> Log:
>   MFC r361033:
>   Call acpi_pxm_set_proximity_info() slightly earlier on x86.
> 
> Modified:
>   stable/12/sys/amd64/amd64/mp_machdep.c
>   stable/12/sys/arm64/arm64/mp_machdep.c
>   stable/12/sys/dev/acpica/acpi_pxm.c
>   stable/12/sys/dev/acpica/acpivar.h
>   stable/12/sys/i386/i386/mp_machdep.c
>   stable/12/sys/x86/acpica/srat.c
> Directory Properties:
>   stable/12/   (props changed)
> 
> Modified: stable/12/sys/amd64/amd64/mp_machdep.c
> ==
> --- stable/12/sys/amd64/amd64/mp_machdep.cThu May 21 15:18:59 2020
> (r361333)
> +++ stable/12/sys/amd64/amd64/mp_machdep.cThu May 21 15:28:35 2020
> (r361334)
> @@ -265,8 +265,9 @@ cpu_mp_start(void)
>   init_ops.start_all_aps();
>  
>   set_interrupt_apic_ids();
> -}
>  
> + acpi_pxm_set_cpu_locality();
> +}
>  
>  /*
>   * AP CPU's call this to initialize themselves.

Until now it was possible to build a kernel (amd64) without 'device
acpi'. After this commit it fails with this error:

--- kernel.full ---
linking kernel.full
ld: error: undefined symbol: acpi_pxm_set_cpu_locality
>>> referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269)
>>>   mp_machdep.o:(cpu_mp_start)
*** [kernel.full] Error code 1

Was that intended?

--
Herbert
___
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: r361349 - in head: cddl/contrib/opensolaris/lib/libdtrace/common lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Konstantin Belousov
Author: kib
Date: Thu May 21 22:24:23 2020
New Revision: 361349
URL: https://svnweb.freebsd.org/changeset/base/361349

Log:
  Restore the binary compatibility for link_map l_addr.
  
  Keep link_map l_addr binary layout compatible, rename l_addr to l_base
  where rtld returns map base.  Provide relocbase in newly added l_addr.
  
  This effectively reverts the patch to the initial version of D24918.
  
  Reported by: antoine (portmgr)
  Reviewed by:  jhb, markj
  Tested by:markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D24946

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
  head/lib/libc/gen/dlinfo.3
  head/libexec/rtld-elf/rtld.c
  head/sys/sys/link_elf.h

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c   Thu May 21 
21:42:49 2020(r361348)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c   Thu May 21 
22:24:23 2020(r361349)
@@ -143,12 +143,18 @@ dtrace_dof_init(void)
return;
}
 
+#ifdef __FreeBSD__
+   elf = (void *)lmp->l_base;
+#else
elf = (void *)lmp->l_addr;
+#endif
 
dh.dofhp_dof = (uintptr_t)dof;
-   dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0;
 #ifdef __FreeBSD__
+   dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_base : 0;
dh.dofhp_pid = getpid();
+#else
+   dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0;
 #endif
 
if (lmid == 0) {

Modified: head/lib/libc/gen/dlinfo.3
==
--- head/lib/libc/gen/dlinfo.3  Thu May 21 21:42:49 2020(r361348)
+++ head/lib/libc/gen/dlinfo.3  Thu May 21 22:24:23 2020(r361349)
@@ -105,17 +105,16 @@ structure is defined in
 .In link.h
 and has the following members:
 .Bd -literal -offset indent
-caddr_t l_addr;/* Load Offset of library */
+caddr_t l_base;/* Base Address of library */
 const char  *l_name;   /* Absolute Path to Library */
 const void  *l_ld; /* Pointer to .dynamic in memory */
 struct link_map *l_next,   /* linked list of mapped libs */
 *l_prev;
+caddr_t l_addr; /* Load Offset of library */
 .Ed
 .Bl -tag -width ".Va l_addr"
-.It Va l_addr
-The load offset of the object, that is, the difference between
-the actual load address and the base virtual address the object
-was linked at.
+.It Va l_base
+The base address of the object loaded into memory.
 .It Va l_name
 The full name of the loaded shared object.
 .It Va l_ld
@@ -130,6 +129,10 @@ structure on the link-map list.
 The previous
 .Vt Link_map
 structure on the link-map list.
+.It Va l_addr
+The load offset of the object, that is, the difference between
+the actual load address and the base virtual address the object
+was linked at.
 .El
 .It Dv RTLD_DI_SERINFO
 Retrieve the library search paths associated with the given

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cThu May 21 21:42:49 2020
(r361348)
+++ head/libexec/rtld-elf/rtld.cThu May 21 22:24:23 2020
(r361349)
@@ -4032,8 +4032,9 @@ linkmap_add(Obj_Entry *obj)
 struct link_map *prev;
 
 obj->linkmap.l_name = obj->path;
-obj->linkmap.l_addr = obj->relocbase;
+obj->linkmap.l_base = obj->mapbase;
 obj->linkmap.l_ld = obj->dynamic;
+obj->linkmap.l_addr = obj->relocbase;
 
 if (r_debug.r_map == NULL) {
r_debug.r_map = l;

Modified: head/sys/sys/link_elf.h
==
--- head/sys/sys/link_elf.h Thu May 21 21:42:49 2020(r361348)
+++ head/sys/sys/link_elf.h Thu May 21 22:24:23 2020(r361349)
@@ -57,13 +57,14 @@
 #defineLA_SER_SECURE   0x80/* default (secure) path prepended */
 
 typedef struct link_map {
-   caddr_t l_addr; /* Load Offset of library */
+   caddr_t l_base; /* Base Address of library */
 #ifdef __mips__
caddr_t l_xxx;  /* unused */
 #endif
const char  *l_name;/* Absolute Path to Library */
const void  *l_ld;  /* Pointer to .dynamic in 
memory */
struct link_map *l_next, *l_prev;   /* linked list of of mapped 
libs */
+   caddr_t l_addr; /* Load Offset of library */
 } Link_map;
 
 struct r_debug {
___
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: r361348 - head/sys/netinet/cc

2020-05-21 Thread Richard Scheffenegger
Author: rscheff
Date: Thu May 21 21:42:49 2020
New Revision: 361348
URL: https://svnweb.freebsd.org/changeset/base/361348

Log:
  DCTCP: update alpha only once after loss recovery.
  
  In mixed ECN marking and loss scenarios it was found, that
  the alpha value of DCTCP is updated two times. The second
  update happens with freshly initialized counters indicating
  to ECN loss. Overall this leads to alpha not adjusting as
  quickly as expected to ECN markings, and therefore lead to
  excessive loss.
  
  Reported by:  Cheng Cui
  Reviewed by:  chengc_netapp.com, rrs, tuexen (mentor)
  Approved by:  tuexen (mentor)
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D24817

Modified:
  head/sys/netinet/cc/cc_dctcp.c

Modified: head/sys/netinet/cc/cc_dctcp.c
==
--- head/sys/netinet/cc/cc_dctcp.c  Thu May 21 21:33:15 2020
(r361347)
+++ head/sys/netinet/cc/cc_dctcp.c  Thu May 21 21:42:49 2020
(r361348)
@@ -154,10 +154,8 @@ dctcp_ack_received(struct cc_var *ccv, uint16_t type)
 * Update the fraction of marked bytes at the end of
 * current window size.
 */
-   if ((IN_FASTRECOVERY(CCV(ccv, t_flags)) &&
-   SEQ_GEQ(ccv->curack, CCV(ccv, snd_recover))) ||
-   (!IN_FASTRECOVERY(CCV(ccv, t_flags)) &&
-   SEQ_GT(ccv->curack, dctcp_data->save_sndnxt)))
+   if (!IN_FASTRECOVERY(CCV(ccv, t_flags)) &&
+   SEQ_GT(ccv->curack, dctcp_data->save_sndnxt))
dctcp_update_alpha(ccv);
} else
newreno_cc_algo.ack_received(ccv, 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: r361347 - in head/sys/netinet: . tcp_stacks

2020-05-21 Thread Richard Scheffenegger
Author: rscheff
Date: Thu May 21 21:33:15 2020
New Revision: 361347
URL: https://svnweb.freebsd.org/changeset/base/361347

Log:
  With RFC3168 ECN, CWR SHOULD only be sent with new data
  
  Overly conservative data receivers may ignore the CWR flag
  on other packets, and keep ECE latched. This can result in
  continous reduction of the congestion window, and very poor
  performance when ECN is enabled.
  
  Reviewed by:  rgrimes (mentor), rrs
  Approved by:  rgrimes (mentor), tuexen (mentor)
  MFC after:3 days
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D23364

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu May 21 21:26:21 2020
(r361346)
+++ head/sys/netinet/tcp_input.cThu May 21 21:33:15 2020
(r361347)
@@ -447,9 +447,15 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui
}
break;
case CC_ECN:
-   if (!IN_CONGRECOVERY(tp->t_flags)) {
+   if (!IN_CONGRECOVERY(tp->t_flags) ||
+   /*
+* Allow ECN reaction on ACK to CWR, if
+* that data segment was also CE marked.
+*/
+   SEQ_GEQ(th->th_ack, tp->snd_recover)) {
+   EXIT_CONGRECOVERY(tp->t_flags);
TCPSTAT_INC(tcps_ecn_rcwnd);
-   tp->snd_recover = tp->snd_max;
+   tp->snd_recover = tp->snd_max + 1;
if (tp->t_flags2 & TF2_ECN_PERMIT)
tp->t_flags2 |= TF2_ECN_SND_CWR;
}

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Thu May 21 21:26:21 2020
(r361346)
+++ head/sys/netinet/tcp_output.c   Thu May 21 21:33:15 2020
(r361347)
@@ -1170,7 +1170,8 @@ send:
 */
if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) &&
(sack_rxmit == 0) &&
-   !((tp->t_flags & TF_FORCEDATA) && len == 1)) {
+   !((tp->t_flags & TF_FORCEDATA) && len == 1 &&
+   SEQ_LT(tp->snd_una, tp->snd_max))) {
 #ifdef INET6
if (isipv6)
ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20);
@@ -1178,14 +1179,14 @@ send:
 #endif
ip->ip_tos |= IPTOS_ECN_ECT0;
TCPSTAT_INC(tcps_ecn_ect0);
-   }
-
-   /*
-* Reply with proper ECN notifications.
-*/
-   if (tp->t_flags2 & TF2_ECN_SND_CWR) {
-   flags |= TH_CWR;
-   tp->t_flags2 &= ~TF2_ECN_SND_CWR;
+   /*
+* Reply with proper ECN notifications.
+* Only set CWR on new data segments.
+*/
+   if (tp->t_flags2 & TF2_ECN_SND_CWR) {
+   flags |= TH_CWR;
+   tp->t_flags2 &= ~TF2_ECN_SND_CWR;
+   }
}
if (tp->t_flags2 & TF2_ECN_SND_ECE)
flags |= TH_ECE;

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Thu May 21 21:26:21 2020
(r361346)
+++ head/sys/netinet/tcp_stacks/rack.c  Thu May 21 21:33:15 2020
(r361347)
@@ -4095,9 +4095,15 @@ rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, 
}
break;
case CC_ECN:
-   if (!IN_CONGRECOVERY(tp->t_flags)) {
+   if (!IN_CONGRECOVERY(tp->t_flags) ||
+   /*
+* Allow ECN reaction on ACK to CWR, if
+* that data segment was also CE marked.
+*/
+   SEQ_GEQ(th->th_ack, tp->snd_recover)) {
+   EXIT_CONGRECOVERY(tp->t_flags);
KMOD_TCPSTAT_INC(tcps_ecn_rcwnd);
-   tp->snd_recover = tp->snd_max;
+   tp->snd_recover = tp->snd_max + 1;
if (tp->t_flags2 & TF2_ECN_PERMIT)
tp->t_flags2 |= TF2_ECN_SND_CWR;
}
@@ -13556,13 +13562,14 @@ send:
 #endif
ip->ip_tos |= IPTOS_ECN_ECT0;
KMOD_TCPSTAT_INC(tcps_ecn_ect0);
-   }
-   /*
-* Reply with proper ECN notifications.
-*/
-   if (tp->t_flags2 & TF2_ECN_SND_CWR) {
-  

svn commit: r361346 - in head/sys/netinet: . tcp_stacks

2020-05-21 Thread Richard Scheffenegger
Author: rscheff
Date: Thu May 21 21:26:21 2020
New Revision: 361346
URL: https://svnweb.freebsd.org/changeset/base/361346

Log:
  Retain only mutually supported TCP options after simultaneous SYN
  
  When receiving a parallel SYN in SYN-SENT state, remove all the
  options only we supported locally before sending the SYN,ACK.
  
  This addresses a consistency issue on parallel opens.
  
  Also, on such a parallel open, the stack could be coaxed into
  running with timestamps enabled, even if administratively disabled.
  
  Reviewed by:  tuexen (mentor)
  Approved by:  tuexen (mentor)
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D23371

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/bbr.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu May 21 21:15:25 2020
(r361345)
+++ head/sys/netinet/tcp_input.cThu May 21 21:26:21 2020
(r361346)
@@ -1623,17 +1623,20 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
(tp->t_flags & TF_REQ_SCALE)) {
tp->t_flags |= TF_RCVD_SCALE;
tp->snd_scale = to.to_wscale;
-   }
+   } else
+   tp->t_flags &= ~TF_REQ_SCALE;
/*
 * Initial send window.  It will be updated with
 * the next incoming segment to the scaled value.
 */
tp->snd_wnd = th->th_win;
-   if (to.to_flags & TOF_TS) {
+   if ((to.to_flags & TOF_TS) &&
+   (tp->t_flags & TF_REQ_TSTMP)) {
tp->t_flags |= TF_RCVD_TSTMP;
tp->ts_recent = to.to_tsval;
tp->ts_recent_age = tcp_ts_getticks();
-   }
+   } else
+   tp->t_flags &= ~TF_REQ_TSTMP;
if (to.to_flags & TOF_MSS)
tcp_mss(tp, to.to_mss);
if ((tp->t_flags & TF_SACK_PERMIT) &&

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Thu May 21 21:15:25 2020
(r361345)
+++ head/sys/netinet/tcp_stacks/bbr.c   Thu May 21 21:26:21 2020
(r361346)
@@ -11595,17 +11595,20 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr 
(tp->t_flags & TF_REQ_SCALE)) {
tp->t_flags |= TF_RCVD_SCALE;
tp->snd_scale = to.to_wscale;
-   }
+   } else
+   tp->t_flags &= ~TF_REQ_SCALE;
/*
 * Initial send window.  It will be updated with the
 * next incoming segment to the scaled value.
 */
tp->snd_wnd = th->th_win;
-   if (to.to_flags & TOF_TS) {
+   if ((to.to_flags & TOF_TS) &&
+   (tp->t_flags & TF_REQ_TSTMP)) {
tp->t_flags |= TF_RCVD_TSTMP;
tp->ts_recent = to.to_tsval;
tp->ts_recent_age = 
tcp_tv_to_mssectick(>rc_tv);
-   }
+   } else
+   tp->t_flags &= ~TF_REQ_TSTMP;
if (to.to_flags & TOF_MSS)
tcp_mss(tp, to.to_mss);
if ((tp->t_flags & TF_SACK_PERMIT) &&

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Thu May 21 21:15:25 2020
(r361345)
+++ head/sys/netinet/tcp_stacks/rack.c  Thu May 21 21:26:21 2020
(r361346)
@@ -11082,17 +11082,20 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr
(tp->t_flags & TF_REQ_SCALE)) {
tp->t_flags |= TF_RCVD_SCALE;
tp->snd_scale = to.to_wscale;
-   }
+   } else
+   tp->t_flags &= ~TF_REQ_SCALE;
/*
 * Initial send window.  It will be updated with the
 * next incoming segment to the scaled value.
 */
tp->snd_wnd = th->th_win;
-   if (to.to_flags & TOF_TS) {
+   if ((to.to_flags & TOF_TS) &&
+   (tp->t_flags & TF_REQ_TSTMP)) {
tp->t_flags |= TF_RCVD_TSTMP;
tp->ts_recent = 

svn commit: r361345 - in head/sys/netinet: . tcp_stacks

2020-05-21 Thread Richard Scheffenegger
Author: rscheff
Date: Thu May 21 21:15:25 2020
New Revision: 361345
URL: https://svnweb.freebsd.org/changeset/base/361345

Log:
  Handle ECN handshake in simultaneous open
  
  While testing simultaneous open TCP with ECN, found that
  negotiation fails to arrive at the expected final state.
  
  Reviewed by:  tuexen (mentor)
  Approved by:  tuexen (mentor), rgrimes (mentor)
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D23373

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu May 21 21:00:46 2020
(r361344)
+++ head/sys/netinet/tcp_input.cThu May 21 21:15:25 2020
(r361345)
@@ -1611,6 +1611,14 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
 * XXX this is traditional behavior, may need to be cleaned up.
 */
if (tp->t_state == TCPS_SYN_SENT && (thflags & TH_SYN)) {
+   /* Handle parallel SYN for ECN */
+   if (!(thflags & TH_ACK) &&
+   ((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | TH_ECE)) &&
+   ((V_tcp_do_ecn == 1) || (V_tcp_do_ecn == 2))) {
+   tp->t_flags2 |= TF2_ECN_PERMIT;
+   tp->t_flags2 |= TF2_ECN_SND_ECE;
+   TCPSTAT_INC(tcps_ecn_shs);
+   }
if ((to.to_flags & TOF_SCALE) &&
(tp->t_flags & TF_REQ_SCALE)) {
tp->t_flags |= TF_RCVD_SCALE;

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Thu May 21 21:00:46 2020
(r361344)
+++ head/sys/netinet/tcp_output.c   Thu May 21 21:15:25 2020
(r361345)
@@ -1154,6 +1154,12 @@ send:
} else
flags |= TH_ECE|TH_CWR;
}
+   /* Handle parallel SYN for ECN */
+   if ((tp->t_state == TCPS_SYN_RECEIVED) &&
+   (tp->t_flags2 & TF2_ECN_SND_ECE)) {
+   flags |= TH_ECE;
+   tp->t_flags2 &= ~TF2_ECN_SND_ECE;
+   }
 
if (tp->t_state == TCPS_ESTABLISHED &&
(tp->t_flags2 & TF2_ECN_PERMIT)) {

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Thu May 21 21:00:46 2020
(r361344)
+++ head/sys/netinet/tcp_stacks/rack.c  Thu May 21 21:15:25 2020
(r361345)
@@ -11070,6 +11070,14 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr
 * this is traditional behavior, may need to be cleaned up.
 */
if (tp->t_state == TCPS_SYN_SENT && (thflags & TH_SYN)) {
+   /* Handle parallel SYN for ECN */
+   if (!(thflags & TH_ACK) &&
+   ((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | 
TH_ECE)) &&
+   ((V_tcp_do_ecn == 1) || (V_tcp_do_ecn == 2))) {
+   tp->t_flags2 |= TF2_ECN_PERMIT;
+   tp->t_flags2 |= TF2_ECN_SND_ECE;
+   TCPSTAT_INC(tcps_ecn_shs);
+   }
if ((to.to_flags & TOF_SCALE) &&
(tp->t_flags & TF_REQ_SCALE)) {
tp->t_flags |= TF_RCVD_SCALE;
@@ -13522,6 +13530,12 @@ send:
flags |= TH_ECE | TH_CWR;
} else
flags |= TH_ECE | TH_CWR;
+   }
+   /* Handle parallel SYN for ECN */
+   if ((tp->t_state == TCPS_SYN_RECEIVED) &&
+   (tp->t_flags2 & TF2_ECN_SND_ECE)) {
+   flags |= TH_ECE;
+   tp->t_flags2 &= ~TF2_ECN_SND_ECE;
}
if (tp->t_state == TCPS_ESTABLISHED &&
(tp->t_flags2 & TF2_ECN_PERMIT)) {
___
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: r361344 - in head: contrib/unbound contrib/unbound/.github contrib/unbound/cachedb contrib/unbound/compat contrib/unbound/contrib contrib/unbound/daemon contrib/unbound/doc contrib/unbo...

2020-05-21 Thread Cy Schubert
Author: cy
Date: Thu May 21 21:00:46 2020
New Revision: 361344
URL: https://svnweb.freebsd.org/changeset/base/361344

Log:
  MFV r361322:
  
  Update unbound 1.9.6 --> 1.10.1.
  
  Bug Fixes:
   - CVE-2020-12662 Unbound can be tricked into amplifying an incoming
 query into a large number of queries directed to a target.
   - CVE-2020-12663 Malformed answers from upstream name servers can be
 used to make Unbound unresponsive.
  
  Reported by:  emaste
  MFC after:3 days
  Relnotes: yes
  Security: CVE-2020-12662, CVE-2020-12663

Added:
  head/contrib/unbound/.github/
 - copied from r361322, vendor/unbound/dist/.github/
  head/contrib/unbound/contrib/drop2rpz
 - copied unchanged from r361322, vendor/unbound/dist/contrib/drop2rpz
  head/contrib/unbound/contrib/unbound_portable.service.in
 - copied unchanged from r361322, 
vendor/unbound/dist/contrib/unbound_portable.service.in
  head/contrib/unbound/contrib/unbound_smf23.tar.gz
 - copied unchanged from r361322, 
vendor/unbound/dist/contrib/unbound_smf23.tar.gz
  head/contrib/unbound/services/rpz.c
 - copied unchanged from r361322, vendor/unbound/dist/services/rpz.c
  head/contrib/unbound/services/rpz.h
 - copied unchanged from r361322, vendor/unbound/dist/services/rpz.h
Deleted:
  head/contrib/unbound/contrib/unbound_smf22.tar.gz
Modified:
  head/contrib/unbound/Makefile.in
  head/contrib/unbound/README.md
  head/contrib/unbound/aclocal.m4
  head/contrib/unbound/cachedb/cachedb.c
  head/contrib/unbound/compat/getentropy_solaris.c
  head/contrib/unbound/config.guess
  head/contrib/unbound/config.h.in
  head/contrib/unbound/config.sub
  head/contrib/unbound/configure
  head/contrib/unbound/configure.ac
  head/contrib/unbound/contrib/README
  head/contrib/unbound/contrib/fastrpz.patch
  head/contrib/unbound/contrib/libunbound.pc.in
  head/contrib/unbound/contrib/unbound.service.in
  head/contrib/unbound/contrib/unbound_munin_
  head/contrib/unbound/daemon/daemon.c
  head/contrib/unbound/daemon/daemon.h
  head/contrib/unbound/daemon/remote.c
  head/contrib/unbound/daemon/stats.c
  head/contrib/unbound/daemon/unbound.c
  head/contrib/unbound/daemon/worker.c
  head/contrib/unbound/doc/Changelog
  head/contrib/unbound/doc/README
  head/contrib/unbound/doc/example.conf.in
  head/contrib/unbound/doc/libunbound.3.in
  head/contrib/unbound/doc/unbound-anchor.8.in
  head/contrib/unbound/doc/unbound-checkconf.8.in
  head/contrib/unbound/doc/unbound-control.8.in
  head/contrib/unbound/doc/unbound-host.1.in
  head/contrib/unbound/doc/unbound.8.in
  head/contrib/unbound/doc/unbound.conf.5.in
  head/contrib/unbound/edns-subnet/subnetmod.c
  head/contrib/unbound/install-sh
  head/contrib/unbound/iterator/iter_delegpt.c
  head/contrib/unbound/iterator/iter_delegpt.h
  head/contrib/unbound/iterator/iter_scrub.c
  head/contrib/unbound/iterator/iter_utils.c
  head/contrib/unbound/iterator/iterator.c
  head/contrib/unbound/iterator/iterator.h
  head/contrib/unbound/libunbound/context.c
  head/contrib/unbound/libunbound/libworker.c
  head/contrib/unbound/libunbound/unbound.h
  head/contrib/unbound/respip/respip.c
  head/contrib/unbound/respip/respip.h
  head/contrib/unbound/services/authzone.c
  head/contrib/unbound/services/authzone.h
  head/contrib/unbound/services/cache/dns.c
  head/contrib/unbound/services/cache/dns.h
  head/contrib/unbound/services/localzone.c
  head/contrib/unbound/services/localzone.h
  head/contrib/unbound/services/mesh.c
  head/contrib/unbound/services/mesh.h
  head/contrib/unbound/services/outside_network.c
  head/contrib/unbound/services/view.c
  head/contrib/unbound/sldns/parse.c
  head/contrib/unbound/sldns/str2wire.c
  head/contrib/unbound/smallapp/unbound-checkconf.c
  head/contrib/unbound/smallapp/unbound-control.c
  head/contrib/unbound/util/config_file.c
  head/contrib/unbound/util/config_file.h
  head/contrib/unbound/util/configlexer.lex
  head/contrib/unbound/util/configparser.y
  head/contrib/unbound/util/data/dname.c
  head/contrib/unbound/util/data/dname.h
  head/contrib/unbound/util/data/msgencode.c
  head/contrib/unbound/util/data/msgparse.c
  head/contrib/unbound/util/data/msgparse.h
  head/contrib/unbound/util/data/msgreply.c
  head/contrib/unbound/util/data/packed_rrset.c
  head/contrib/unbound/util/data/packed_rrset.h
  head/contrib/unbound/util/fptr_wlist.c
  head/contrib/unbound/util/fptr_wlist.h
  head/contrib/unbound/util/iana_ports.inc
  head/contrib/unbound/util/log.c
  head/contrib/unbound/util/log.h
  head/contrib/unbound/util/module.h
  head/contrib/unbound/util/net_help.c
  head/contrib/unbound/util/net_help.h
  head/contrib/unbound/util/netevent.c
  head/contrib/unbound/util/random.c
  head/contrib/unbound/util/storage/dnstree.c
  head/contrib/unbound/util/storage/dnstree.h
  head/contrib/unbound/validator/val_secalgo.c
  head/contrib/unbound/validator/validator.c
  head/lib/libunbound/Makefile
Directory Properties:
  head/contrib/unbound/   (props changed)

Modified: 

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

2020-05-21 Thread Emmanuel Vadot
Author: manu
Date: Thu May 21 20:18:38 2020
New Revision: 361343
URL: https://svnweb.freebsd.org/changeset/base/361343

Log:
  linuxkpi: Add rcu_work functions
  
  The rcu_work function helps to queue some work after waiting for a grace
  period.
  This is needed by DRM drivers.
  
  Sponsored-by: The FreeBSD Foundation
  Reviewed by:  hselasky
  Differential Revision:https://reviews.freebsd.org/D24942

Modified:
  head/sys/compat/linuxkpi/common/include/linux/workqueue.h
  head/sys/compat/linuxkpi/common/src/linux_work.c

Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h
==
--- head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Thu May 21 
19:46:11 2020(r361342)
+++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Thu May 21 
20:18:38 2020(r361343)
@@ -72,6 +72,13 @@ struct work_struct {
atomic_t state;
 };
 
+struct rcu_work {
+   struct work_struct work;
+   struct rcu_head rcu;
+
+   struct workqueue_struct *wq;
+};
+
 #defineDECLARE_WORK(name, fn)  
\
struct work_struct name;\
static void name##_init(void *arg)  \
@@ -112,6 +119,9 @@ do {
\
TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work));\
 } while (0)
 
+#define INIT_RCU_WORK(_work, _fn) \
+   INIT_WORK(&(_work)->work, (_fn))
+
 #defineINIT_WORK_ONSTACK(work, fn) \
INIT_WORK(work, fn)
 
@@ -192,6 +202,12 @@ do {   
\
 #defineflush_work(work) \
linux_flush_work(work)
 
+#definequeue_rcu_work(wq, rwork) \
+   linux_queue_rcu_work(wq, rwork)
+
+#defineflush_rcu_work(rwork) \
+   linux_flush_rcu_work(rwork)
+
 #defineflush_delayed_work(dwork) \
linux_flush_delayed_work(dwork)
 
@@ -237,5 +253,7 @@ extern bool linux_flush_delayed_work(struct delayed_wo
 extern bool linux_work_pending(struct work_struct *);
 extern bool linux_work_busy(struct work_struct *);
 extern struct work_struct *linux_current_work(void);
+extern bool linux_queue_rcu_work(struct workqueue_struct *wq, struct rcu_work 
*rwork);
+extern bool linux_flush_rcu_work(struct rcu_work *rwork);
 
 #endif /* _LINUX_WORKQUEUE_H_ */

Modified: head/sys/compat/linuxkpi/common/src/linux_work.c
==
--- head/sys/compat/linuxkpi/common/src/linux_work.cThu May 21 19:46:11 
2020(r361342)
+++ head/sys/compat/linuxkpi/common/src/linux_work.cThu May 21 20:18:38 
2020(r361343)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -153,6 +154,53 @@ linux_queue_work_on(int cpu __unused, struct workqueue
default:
return (false); /* already on a queue */
}
+}
+
+/*
+ * Callback func for linux_queue_rcu_work
+ */
+static void
+rcu_work_func(struct rcu_head *rcu)
+{
+   struct rcu_work *rwork;
+
+   rwork = container_of(rcu, struct rcu_work, rcu);
+   linux_queue_work_on(WORK_CPU_UNBOUND, rwork->wq, >work);
+}
+
+/*
+ * This function queue a work after a grace period
+ * If the work was already pending it returns false,
+ * if not it calls call_rcu and returns true.
+ */
+bool
+linux_queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork)
+{
+
+   if (!linux_work_pending(>work)) {
+   rwork->wq = wq;
+   linux_call_rcu(RCU_TYPE_REGULAR, >rcu, rcu_work_func);
+   return (true);
+   }
+   return (false);
+}
+
+/*
+ * This function waits for the last execution of a work and then
+ * flush the work.
+ * It returns true if the work was pending and we waited, it returns
+ * false otherwise.
+ */
+bool
+linux_flush_rcu_work(struct rcu_work *rwork)
+{
+
+   if (linux_work_pending(>work)) {
+   linux_rcu_barrier(RCU_TYPE_REGULAR);
+   linux_flush_work(>work);
+   return (true);
+   }
+   return (linux_flush_work(>work));
 }
 
 /*
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Konstantin Belousov
On Thu, May 21, 2020 at 12:30:47PM -0700, John Baldwin wrote:
> On 5/21/20 9:56 AM, Konstantin Belousov wrote:
> > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote:
> >> On 5/21/20 8:12 AM, Mark Johnston wrote:
> >>> On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote:
>  On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
> > On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov  
> > wrote:
> >>
> >> Author: kib
> >> Date: Wed May 20 22:08:26 2020
> >> New Revision: 361303
> >> URL: https://svnweb.freebsd.org/changeset/base/361303
> >>
> >> Log:
> >>   Change the samantic of struct link_map l_addr member.
> >>
> >>   It previously returned the object map base address, while all other
> >>   ELF operating systems return load offset, i.e. the difference between
> >>   map base and the link base.
> >>
> >>   Explain the meaning of the field in the man page.
> >>
> >>   Stop filling the mips-only l_offs member, which is apparently unused.
> >>
> >>   PR:   246561
> >>   Requested by: Damjan Jovanovic 
> >>   Reviewed by:  emaste, jhb, cem (previous version)
> >>   Sponsored by: The FreeBSD Foundation
> >>   MFC after:1 week
> >>   Differential revision:https://reviews.freebsd.org/D24918
> >>
> >> Modified:
> >>   head/lib/libc/gen/dlinfo.3
> >>   head/libexec/rtld-elf/rtld.c
> >>   head/sys/sys/link_elf.h
> >
> > Hi,
> >
> > After this commit,  some ports fail to build with signal 11.
> > For instance lang/perl5.30 fails to build with default options (DTRACE 
> > on)
> > Disabling the DTRACE option makes it able to build again.
> >
>  I see, thank you for reporting.
> 
>  So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes
>  that l_addr is the base, not relocbase.
> 
>  Mark, was dofhp_addr initialization changed comparing to Solaris ?
> >>>
> >>> It appears it has been the same since DTrace was imported.  illumos
> >>> still has similar code.
> >>>
> >>> Note that drti.o is linked into any executable and shlib that defines
> >>> static probes, so the ABI change affects more than just dtrace(1).
> >>> Would it be possible to define a new value for RTLD_DI_LINKMAP, and
> >>> preserve the old behaviour for the old value?
> >>
> >> I think a bigger question is if Solaris/illumos treat l_addr as mapbase
> >> (absolute address) or relocbase (relative address).  In the discussion
> >> in the phabricator I had assumed that all other OS's treated l_addr as
> >> the relative offset (relocbase).  Does the code for illumos assume an
> >> absolute address or does it assume a relative address in l_addr?
> > 
> > It is rather clear, since the dtrace code was pristine, that Solaris
> > provides the mapbase.  I do not have Solaris/Illumos box anymore
> > (for quite some time), so I cannot check directly.
> > 
> > My current PoV is that l_addr semantic must be restored, and relocbase
> > provided by newly added member.
> 
> I am fine with reverting the l_addr semantic.  I'm still not sure how to
> resolve the original PR, though perhaps Wine just has to carry a local
> patch forever?  GDB will work via the current accident so long as we
> never pre-link libraries.  As long as PIE binaries have a starting VA of
> 0 like our shared libraries then I think GDB will be ok with our PIE
> binaries as well.

Wine should work without patch now, and after the D24918 is applied, too.
I do not intend to revert l_addr to the 'load address' semantic.

I am actually trying to find a solaris box to compile the test program.
___
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: r361342 - in stable/12/sys/netinet: . tcp_stacks

2020-05-21 Thread Richard Scheffenegger
Author: rscheff
Date: Thu May 21 19:46:11 2020
New Revision: 361342
URL: https://svnweb.freebsd.org/changeset/base/361342

Log:
  MFC r360477: Correctly set up the initial TCP congestion window in all cases
  
  by not including the SYN bit sequence space in cwnd related calculations.
  Snd_und is adjusted explicitly in all cases, outside the cwnd update, instead.
  
  This fixes an off-by-one conformance issue with regular TCP sessions
  not  using Appropriate Byte Counting (RFC3465), sending one more
  packet during  the initial window than expected.
  
  PR:   235256
  Reviewed by:  tuexen (mentor), rgrimes (mentor, blanket)
  Approved by:  tuexen (mentor), rgrimes (mentor, blanket)
  MFC after:3 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D19000

Modified:
  stable/12/sys/netinet/tcp_input.c
  stable/12/sys/netinet/tcp_stacks/rack.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/tcp_input.c
==
--- stable/12/sys/netinet/tcp_input.c   Thu May 21 19:45:14 2020
(r361341)
+++ stable/12/sys/netinet/tcp_input.c   Thu May 21 19:46:11 2020
(r361342)
@@ -1519,7 +1519,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
 struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos)
 {
int thflags, acked, ourfinisacked, needoutput = 0, sack_changed;
-   int rstreason, todrop, win;
+   int rstreason, todrop, win, incforsyn = 0;
uint32_t tiwin;
uint16_t nsegs;
char *s;
@@ -2432,12 +2432,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) {
tcp_fastopen_decrement_counter(tp->t_tfo_pending);
tp->t_tfo_pending = NULL;
-
-   /*
-* Account for the ACK of our SYN prior to
-* regular ACK processing below.
-*/ 
-   tp->snd_una++;
}
if (tp->t_flags & TF_NEEDFIN) {
tcp_state_change(tp, TCPS_FIN_WAIT_1);
@@ -2458,6 +2452,13 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp));
}
/*
+* Account for the ACK of our SYN prior to
+* regular ACK processing below, except for
+* simultaneous SYN, which is handled later.
+*/
+   if (SEQ_GT(th->th_ack, tp->snd_una) && !(tp->t_flags & 
TF_NEEDSYN))
+   incforsyn = 1;
+   /*
 * If segment contains data or ACK, will call tcp_reass()
 * later; if not, do so now to pass queued data to user.
 */
@@ -2751,6 +2752,15 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
 process_ACK:
INP_WLOCK_ASSERT(tp->t_inpcb);
 
+   /*
+* Adjust for the SYN bit in sequence space,
+* but don't account for it in cwnd calculations.
+* This is for the SYN_RECEIVED, non-simultaneous
+* SYN case. SYN_SENT and simultaneous SYN are
+* treated elsewhere.
+*/
+   if (incforsyn)
+   tp->snd_una++;
acked = BYTES_THIS_ACK(tp, th);
KASSERT(acked >= 0, ("%s: acked unexepectedly negative "
"(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__,

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==
--- stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:45:14 2020
(r361341)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:46:11 2020
(r361342)
@@ -5580,12 +5580,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) {
tcp_fastopen_decrement_counter(tp->t_tfo_pending);
tp->t_tfo_pending = NULL;
-
-   /*
-* Account for the ACK of our SYN prior to
-* regular ACK processing below.
-*/ 
-   tp->snd_una++;
}
if (tp->t_flags & TF_NEEDFIN) {
tcp_state_change(tp, TCPS_FIN_WAIT_1);
@@ -5603,6 +5597,13 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
if (!IS_FASTOPEN(tp->t_flags))
cc_conn_init(tp);
}
+   /*
+* Account for the ACK of our SYN prior to
+* regular ACK processing below, except for
+* simultaneous SYN, which is handled later.
+*/
+   if (SEQ_GT(th->th_ack, tp->snd_una) && !(tp->t_flags & TF_NEEDSYN))
+   tp->snd_una++;
 

svn commit: r361341 - releng/11.4/secure/caroot/trusted

2020-05-21 Thread Kyle Evans
Author: kevans
Date: Thu May 21 19:45:14 2020
New Revision: 361341
URL: https://svnweb.freebsd.org/changeset/base/361341

Log:
  Revert r360395: MFC r353095, r355376: add root bundle
  
  certctl(8) demonstrably has some logistics issues that still need to be
  worked out, as pointed out in at least PR 228913, 246614. I do not feel
  comfortable with proceeding with my original plan for the impending
  release without resolving at least PR 246614 and being able to get the
  release(7) scripts into a state where they're producing VM images that
  more closesly resemble a bsdinstall-produced install.
  
  11.4 will still maintain the current version of certctl(8) that works well
  for most cases, and it still includes the caroot infrastructure.
  
  I do not currently intend to revert this in stable/11, as I would still
  like folks along stable/11 to be able to participate in Q/A'ing this
  feature.
  
  Approved by:  re (gjb)

Deleted:
  releng/11.4/secure/caroot/trusted/ACCVRAIZ1.pem
  releng/11.4/secure/caroot/trusted/AC_RAIZ_FNMT-RCM.pem
  releng/11.4/secure/caroot/trusted/Actalis_Authentication_Root_CA.pem
  releng/11.4/secure/caroot/trusted/AddTrust_External_Root.pem
  releng/11.4/secure/caroot/trusted/AddTrust_Low-Value_Services_Root.pem
  releng/11.4/secure/caroot/trusted/AffirmTrust_Commercial.pem
  releng/11.4/secure/caroot/trusted/AffirmTrust_Networking.pem
  releng/11.4/secure/caroot/trusted/AffirmTrust_Premium.pem
  releng/11.4/secure/caroot/trusted/AffirmTrust_Premium_ECC.pem
  releng/11.4/secure/caroot/trusted/Amazon_Root_CA_1.pem
  releng/11.4/secure/caroot/trusted/Amazon_Root_CA_2.pem
  releng/11.4/secure/caroot/trusted/Amazon_Root_CA_3.pem
  releng/11.4/secure/caroot/trusted/Amazon_Root_CA_4.pem
  releng/11.4/secure/caroot/trusted/Atos_TrustedRoot_2011.pem
  
releng/11.4/secure/caroot/trusted/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
  releng/11.4/secure/caroot/trusted/Baltimore_CyberTrust_Root.pem
  releng/11.4/secure/caroot/trusted/Buypass_Class_2_Root_CA.pem
  releng/11.4/secure/caroot/trusted/Buypass_Class_3_Root_CA.pem
  releng/11.4/secure/caroot/trusted/CA_Disig_Root_R2.pem
  releng/11.4/secure/caroot/trusted/CFCA_EV_ROOT.pem
  releng/11.4/secure/caroot/trusted/COMODO_Certification_Authority.pem
  releng/11.4/secure/caroot/trusted/COMODO_ECC_Certification_Authority.pem
  releng/11.4/secure/caroot/trusted/COMODO_RSA_Certification_Authority.pem
  releng/11.4/secure/caroot/trusted/Camerfirma_Chambers_of_Commerce_Root.pem
  releng/11.4/secure/caroot/trusted/Camerfirma_Global_Chambersign_Root.pem
  releng/11.4/secure/caroot/trusted/Certigna.pem
  releng/11.4/secure/caroot/trusted/Certigna_Root_CA.pem
  releng/11.4/secure/caroot/trusted/Certum_Root_CA.pem
  releng/11.4/secure/caroot/trusted/Certum_Trusted_Network_CA.pem
  releng/11.4/secure/caroot/trusted/Certum_Trusted_Network_CA_2.pem
  releng/11.4/secure/caroot/trusted/Chambers_of_Commerce_Root_-_2008.pem
  releng/11.4/secure/caroot/trusted/Comodo_AAA_Services_root.pem
  releng/11.4/secure/caroot/trusted/Cybertrust_Global_Root.pem
  releng/11.4/secure/caroot/trusted/D-TRUST_Root_CA_3_2013.pem
  releng/11.4/secure/caroot/trusted/D-TRUST_Root_Class_3_CA_2_2009.pem
  releng/11.4/secure/caroot/trusted/D-TRUST_Root_Class_3_CA_2_EV_2009.pem
  releng/11.4/secure/caroot/trusted/DST_Root_CA_X3.pem
  releng/11.4/secure/caroot/trusted/DigiCert_Assured_ID_Root_CA.pem
  releng/11.4/secure/caroot/trusted/DigiCert_Assured_ID_Root_G2.pem
  releng/11.4/secure/caroot/trusted/DigiCert_Assured_ID_Root_G3.pem
  releng/11.4/secure/caroot/trusted/DigiCert_Global_Root_CA.pem
  releng/11.4/secure/caroot/trusted/DigiCert_Global_Root_G2.pem
  releng/11.4/secure/caroot/trusted/DigiCert_Global_Root_G3.pem
  releng/11.4/secure/caroot/trusted/DigiCert_High_Assurance_EV_Root_CA.pem
  releng/11.4/secure/caroot/trusted/DigiCert_Trusted_Root_G4.pem
  releng/11.4/secure/caroot/trusted/E-Tugra_Certification_Authority.pem
  releng/11.4/secure/caroot/trusted/EC-ACC.pem
  releng/11.4/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem
  releng/11.4/secure/caroot/trusted/Entrust_Root_Certification_Authority.pem
  
releng/11.4/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_EC1.pem
  
releng/11.4/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_G2.pem
  
releng/11.4/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_G4.pem
  
releng/11.4/secure/caroot/trusted/Entrust_net_Premium_2048_Secure_Server_CA.pem
  releng/11.4/secure/caroot/trusted/GDCA_TrustAUTH_R5_ROOT.pem
  releng/11.4/secure/caroot/trusted/GTS_Root_R1.pem
  releng/11.4/secure/caroot/trusted/GTS_Root_R2.pem
  releng/11.4/secure/caroot/trusted/GTS_Root_R3.pem
  releng/11.4/secure/caroot/trusted/GTS_Root_R4.pem
  releng/11.4/secure/caroot/trusted/GeoTrust_Global_CA.pem
  releng/11.4/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority.pem
  
releng/11.4/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G2.pem
  

svn commit: r361340 - in stable/12/sys/netinet: . tcp_stacks

2020-05-21 Thread Richard Scheffenegger
Author: rscheff
Date: Thu May 21 19:41:25 2020
New Revision: 361340
URL: https://svnweb.freebsd.org/changeset/base/361340

Log:
  MFC r360479: Prevent premature shrinking of the scaled receive window
  
  which can cause a TCP client to use invalid or stale TCP sequence numbers for 
ACK packets.
  
  Packets with old sequence numbers are ignored and not used to update the send 
window size.
  This might cause the TCP session to hang indefinitely under some 
circumstances.
  
  Reported by:  Cui Cheng
  Reviewed by:  tuexen (mentor), rgrimes (mentor, blanket)
  Approved by:  tuexen (mentor), rgrimes (mentor, blanket)
  MFC after:3 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D24515

Modified:
  stable/12/sys/netinet/tcp_output.c
  stable/12/sys/netinet/tcp_stacks/rack.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/tcp_output.c
==
--- stable/12/sys/netinet/tcp_output.c  Thu May 21 18:50:05 2020
(r361339)
+++ stable/12/sys/netinet/tcp_output.c  Thu May 21 19:41:25 2020
(r361340)
@@ -1206,8 +1206,11 @@ send:
if (flags & TH_SYN)
th->th_win = htons((u_short)
(min(sbspace(>so_rcv), TCP_MAXWIN)));
-   else
+   else {
+   /* Avoid shrinking window with window scaling. */
+   recwin = roundup2(recwin, 1 << tp->rcv_scale);
th->th_win = htons((u_short)(recwin >> tp->rcv_scale));
+   }
 
/*
 * Adjust the RXWIN0SENT flag - indicate that we have advertised

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==
--- stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 18:50:05 2020
(r361339)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:41:25 2020
(r361340)
@@ -8355,8 +8355,11 @@ send:
if (flags & TH_SYN)
th->th_win = htons((u_short)
(min(sbspace(>so_rcv), TCP_MAXWIN)));
-   else
+   else {
+   /* Avoid shrinking window with window scaling. */
+   recwin = roundup2(recwin, 1 << tp->rcv_scale);
th->th_win = htons((u_short)(recwin >> tp->rcv_scale));
+   }
/*
 * Adjust the RXWIN0SENT flag - indicate that we have advertised a 0
 * window.  This may cause the remote transmitter to stall.  This
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread John Baldwin
On 5/21/20 9:56 AM, Konstantin Belousov wrote:
> On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote:
>> On 5/21/20 8:12 AM, Mark Johnston wrote:
>>> On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote:
 On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov  
> wrote:
>>
>> Author: kib
>> Date: Wed May 20 22:08:26 2020
>> New Revision: 361303
>> URL: https://svnweb.freebsd.org/changeset/base/361303
>>
>> Log:
>>   Change the samantic of struct link_map l_addr member.
>>
>>   It previously returned the object map base address, while all other
>>   ELF operating systems return load offset, i.e. the difference between
>>   map base and the link base.
>>
>>   Explain the meaning of the field in the man page.
>>
>>   Stop filling the mips-only l_offs member, which is apparently unused.
>>
>>   PR:   246561
>>   Requested by: Damjan Jovanovic 
>>   Reviewed by:  emaste, jhb, cem (previous version)
>>   Sponsored by: The FreeBSD Foundation
>>   MFC after:1 week
>>   Differential revision:https://reviews.freebsd.org/D24918
>>
>> Modified:
>>   head/lib/libc/gen/dlinfo.3
>>   head/libexec/rtld-elf/rtld.c
>>   head/sys/sys/link_elf.h
>
> Hi,
>
> After this commit,  some ports fail to build with signal 11.
> For instance lang/perl5.30 fails to build with default options (DTRACE on)
> Disabling the DTRACE option makes it able to build again.
>
 I see, thank you for reporting.

 So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes
 that l_addr is the base, not relocbase.

 Mark, was dofhp_addr initialization changed comparing to Solaris ?
>>>
>>> It appears it has been the same since DTrace was imported.  illumos
>>> still has similar code.
>>>
>>> Note that drti.o is linked into any executable and shlib that defines
>>> static probes, so the ABI change affects more than just dtrace(1).
>>> Would it be possible to define a new value for RTLD_DI_LINKMAP, and
>>> preserve the old behaviour for the old value?
>>
>> I think a bigger question is if Solaris/illumos treat l_addr as mapbase
>> (absolute address) or relocbase (relative address).  In the discussion
>> in the phabricator I had assumed that all other OS's treated l_addr as
>> the relative offset (relocbase).  Does the code for illumos assume an
>> absolute address or does it assume a relative address in l_addr?
> 
> It is rather clear, since the dtrace code was pristine, that Solaris
> provides the mapbase.  I do not have Solaris/Illumos box anymore
> (for quite some time), so I cannot check directly.
> 
> My current PoV is that l_addr semantic must be restored, and relocbase
> provided by newly added member.

I am fine with reverting the l_addr semantic.  I'm still not sure how to
resolve the original PR, though perhaps Wine just has to carry a local
patch forever?  GDB will work via the current accident so long as we
never pre-link libraries.  As long as PIE binaries have a starting VA of
0 like our shared libraries then I think GDB will be ok with our PIE
binaries as well.

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


svn commit: r361339 - releng/11.4/usr.sbin/certctl

2020-05-21 Thread Kyle Evans
Author: kevans
Date: Thu May 21 18:50:05 2020
New Revision: 361339
URL: https://svnweb.freebsd.org/changeset/base/361339

Log:
  MFS r361310: MFC r361022-361023, 361148: certctl(8) fixes
  
  r361022: certctl(8): don't completely nuke $CERTDESTDIR
  
  It's been reported/noted that a well-timed `certctl rehash` will completely
  obliterate $CERTDESTDIR, which may get used by ports or system
  administrators. While we can't guarantee the certctl semantics when other
  non-certctl-controlled bits live here, we should make some amount of effort
  to play nice.
  
  Pruning all existing links, which we'll subsequently rebuild as needed, is
  sufficient for our needs. This can still be destructive, but it's perhaps
  less likely to cause issues.
  
  I also note that we should probably be pruning /etc/ssl/blacklisted upon
  rehash as well.
  
  r361023: certctl: follow-up to r361022, prune blacklist as well
  
  Otherwise, removals from the blacklist may not get processed as they should.
  
  While we're here, restructure these to not bother with mkdir(1) if we've
  already tested them to exist.
  
  r361148: certctl: don't fall over flat with relative DESTDIR
  
  Up until now, all of our DESTDIR use has been with absolute paths. It turned
  out that the cd in/out dance we do here breaks us down later on, as the
  relative path no longer resolves.
  
  Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're
  inspecting, rather than cd'ing into it and globbing it up.
  
  Approved by:  re (kib)

Modified:
  releng/11.4/usr.sbin/certctl/certctl.sh
Directory Properties:
  releng/11.4/   (props changed)

Modified: releng/11.4/usr.sbin/certctl/certctl.sh
==
--- releng/11.4/usr.sbin/certctl/certctl.sh Thu May 21 18:38:41 2020
(r361338)
+++ releng/11.4/usr.sbin/certctl/certctl.sh Thu May 21 18:50:05 2020
(r361339)
@@ -34,7 +34,7 @@
 : 
${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted}
 : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs}
 : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted}
-: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"}
+: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"}
 : ${VERBOSE:=0}
 
  GLOBALS
@@ -104,13 +104,11 @@ do_scan()
for CPATH in "$@"; do
[ -d "$CPATH" ] || continue
echo "Scanning $CPATH for certificates..."
-   cd "$CPATH"
-   for CFILE in $EXTENSIONS; do
-   [ -e "$CFILE" ] || continue
+   for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do
+   [ -e "$CPATH/$CFILE" ] || continue
[ $VERBOSE -gt 0 ] && echo "Reading $CFILE"
"$CFUNC" "$CPATH/$CFILE"
done
-   cd -
done
 }
 
@@ -142,9 +140,18 @@ do_list()
 cmd_rehash()
 {
 
-   [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR"
-   [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR"
-   [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR"
+   if [ $NOOP -eq 0 ]; then
+   if [ -e "$CERTDESTDIR" ]; then
+   find "$CERTDESTDIR" -type link -delete
+   else
+   mkdir -p "$CERTDESTDIR"
+   fi
+   if [ -e "$BLACKLISTDESTDIR" ]; then
+   find "$BLACKLISTDESTDIR" -type link -delete
+   else
+   mkdir -p "$BLACKLISTDESTDIR"
+   fi
+   fi
 
do_scan create_blacklisted "$BLACKLISTPATH"
do_scan create_trusted_link "$TRUSTPATH"
___
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: r361338 - head/sys/sys

2020-05-21 Thread Mark Johnston
Author: markj
Date: Thu May 21 18:38:41 2020
New Revision: 361338
URL: https://svnweb.freebsd.org/changeset/base/361338

Log:
  Fix ACCEPT_FILTER_DEFINE to pass the version to MODULE_VERSION.
  
  MFC with: r361263

Modified:
  head/sys/sys/socketvar.h

Modified: head/sys/sys/socketvar.h
==
--- head/sys/sys/socketvar.hThu May 21 17:34:31 2020(r361337)
+++ head/sys/sys/socketvar.hThu May 21 18:38:41 2020(r361338)
@@ -349,7 +349,7 @@ struct accept_filter {
};  \
DECLARE_MODULE(modname, modname##_mod, SI_SUB_DRIVERS,  \
SI_ORDER_MIDDLE);   \
-   MODULE_VERSION(modname, 1)
+   MODULE_VERSION(modname, ver)
 
 #ifdef MALLOC_DECLARE
 MALLOC_DECLARE(M_ACCF);
___
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: r361337 - head/usr.bin/indent

2020-05-21 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Thu May 21 17:34:31 2020
New Revision: 361337
URL: https://svnweb.freebsd.org/changeset/base/361337

Log:
  indent(1): add fallthrough markers
  
  This silences -Wimplicit-fallthrough warnings.
  
  Submitted by: Michael Paquier
  Obtained from:postgresql.org
  MFC after:3 days

Modified:
  head/usr.bin/indent/indent.c
  head/usr.bin/indent/parse.c

Modified: head/usr.bin/indent/indent.c
==
--- head/usr.bin/indent/indent.cThu May 21 15:53:16 2020
(r361336)
+++ head/usr.bin/indent/indent.cThu May 21 17:34:31 2020
(r361337)
@@ -967,6 +967,7 @@ check_type:
case structure:
if (ps.p_l_follow > 0)
goto copy_id;
+   /* FALLTHROUGH */
case decl:  /* we have a declaration type (int, etc.) */
parse(decl);/* let parser worry about indentation */
if (ps.last_token == rparen && ps.tos <= 1) {

Modified: head/usr.bin/indent/parse.c
==
--- head/usr.bin/indent/parse.c Thu May 21 15:53:16 2020(r361336)
+++ head/usr.bin/indent/parse.c Thu May 21 17:34:31 2020(r361337)
@@ -107,6 +107,7 @@ parse(int tk) /* tk: the code for the construct scanne
 */
ps.i_l_follow = ps.il[ps.tos--];
/* the rest is the same as for dolit and forstmt */
+   /* FALLTHROUGH */
 case dolit:/* 'do' */
 case forstmt:  /* for (...) */
ps.p_stack[++ps.tos] = tk;
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Mark Johnston
On Thu, May 21, 2020 at 08:09:58PM +0300, Konstantin Belousov wrote:
> On Thu, May 21, 2020 at 01:01:24PM -0400, Mark Johnston wrote:
> > On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote:
> > > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote:
> > > > On 5/21/20 8:12 AM, Mark Johnston wrote:
> > > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote:
> > > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
> > > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov 
> > > > >>>  wrote:
> > > > 
> > > >  Author: kib
> > > >  Date: Wed May 20 22:08:26 2020
> > > >  New Revision: 361303
> > > >  URL: https://svnweb.freebsd.org/changeset/base/361303
> > > > 
> > > >  Log:
> > > >    Change the samantic of struct link_map l_addr member.
> > > > 
> > > >    It previously returned the object map base address, while all 
> > > >  other
> > > >    ELF operating systems return load offset, i.e. the difference 
> > > >  between
> > > >    map base and the link base.
> > > > 
> > > >    Explain the meaning of the field in the man page.
> > > > 
> > > >    Stop filling the mips-only l_offs member, which is apparently 
> > > >  unused.
> > > > 
> > > >    PR:   246561
> > > >    Requested by: Damjan Jovanovic 
> > > >    Reviewed by:  emaste, jhb, cem (previous version)
> > > >    Sponsored by: The FreeBSD Foundation
> > > >    MFC after:1 week
> > > >    Differential revision:https://reviews.freebsd.org/D24918
> > > > 
> > > >  Modified:
> > > >    head/lib/libc/gen/dlinfo.3
> > > >    head/libexec/rtld-elf/rtld.c
> > > >    head/sys/sys/link_elf.h
> > > > >>>
> > > > >>> Hi,
> > > > >>>
> > > > >>> After this commit,  some ports fail to build with signal 11.
> > > > >>> For instance lang/perl5.30 fails to build with default options 
> > > > >>> (DTRACE on)
> > > > >>> Disabling the DTRACE option makes it able to build again.
> > > > >>>
> > > > >> I see, thank you for reporting.
> > > > >>
> > > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code 
> > > > >> assumes
> > > > >> that l_addr is the base, not relocbase.
> > > > >>
> > > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ?
> > > > > 
> > > > > It appears it has been the same since DTrace was imported.  illumos
> > > > > still has similar code.
> > > > > 
> > > > > Note that drti.o is linked into any executable and shlib that defines
> > > > > static probes, so the ABI change affects more than just dtrace(1).
> > > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and
> > > > > preserve the old behaviour for the old value?
> > > > 
> > > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase
> > > > (absolute address) or relocbase (relative address).  In the discussion
> > > > in the phabricator I had assumed that all other OS's treated l_addr as
> > > > the relative offset (relocbase).  Does the code for illumos assume an
> > > > absolute address or does it assume a relative address in l_addr?
> > > 
> > > It is rather clear, since the dtrace code was pristine, that Solaris
> > > provides the mapbase.  I do not have Solaris/Illumos box anymore
> > > (for quite some time), so I cannot check directly.
> > > 
> > > My current PoV is that l_addr semantic must be restored, and relocbase
> > > provided by newly added member.
> > > 
> > > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ?
> > 
> > Isn't the problem when perl is *not* linked as PIE?  In this case
> > relocbase is 0, so the ELF header access becomes a NULL pointer
> > dereference.
> drti checks for ET_DYN, only then it uses l_addr at all.

The problem is before that, where it treats l_addr as a pointer to the
ELF header so it can check the type.

> PIE binaries are dso with non-zero base, non-PIE binaries are ET_EXEC,
> which should make dtri.c ignore the l_addr value.
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Konstantin Belousov
On Thu, May 21, 2020 at 01:01:24PM -0400, Mark Johnston wrote:
> On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote:
> > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote:
> > > On 5/21/20 8:12 AM, Mark Johnston wrote:
> > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote:
> > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
> > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov 
> > > >>>  wrote:
> > > 
> > >  Author: kib
> > >  Date: Wed May 20 22:08:26 2020
> > >  New Revision: 361303
> > >  URL: https://svnweb.freebsd.org/changeset/base/361303
> > > 
> > >  Log:
> > >    Change the samantic of struct link_map l_addr member.
> > > 
> > >    It previously returned the object map base address, while all other
> > >    ELF operating systems return load offset, i.e. the difference 
> > >  between
> > >    map base and the link base.
> > > 
> > >    Explain the meaning of the field in the man page.
> > > 
> > >    Stop filling the mips-only l_offs member, which is apparently 
> > >  unused.
> > > 
> > >    PR:   246561
> > >    Requested by: Damjan Jovanovic 
> > >    Reviewed by:  emaste, jhb, cem (previous version)
> > >    Sponsored by: The FreeBSD Foundation
> > >    MFC after:1 week
> > >    Differential revision:https://reviews.freebsd.org/D24918
> > > 
> > >  Modified:
> > >    head/lib/libc/gen/dlinfo.3
> > >    head/libexec/rtld-elf/rtld.c
> > >    head/sys/sys/link_elf.h
> > > >>>
> > > >>> Hi,
> > > >>>
> > > >>> After this commit,  some ports fail to build with signal 11.
> > > >>> For instance lang/perl5.30 fails to build with default options 
> > > >>> (DTRACE on)
> > > >>> Disabling the DTRACE option makes it able to build again.
> > > >>>
> > > >> I see, thank you for reporting.
> > > >>
> > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code 
> > > >> assumes
> > > >> that l_addr is the base, not relocbase.
> > > >>
> > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ?
> > > > 
> > > > It appears it has been the same since DTrace was imported.  illumos
> > > > still has similar code.
> > > > 
> > > > Note that drti.o is linked into any executable and shlib that defines
> > > > static probes, so the ABI change affects more than just dtrace(1).
> > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and
> > > > preserve the old behaviour for the old value?
> > > 
> > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase
> > > (absolute address) or relocbase (relative address).  In the discussion
> > > in the phabricator I had assumed that all other OS's treated l_addr as
> > > the relative offset (relocbase).  Does the code for illumos assume an
> > > absolute address or does it assume a relative address in l_addr?
> > 
> > It is rather clear, since the dtrace code was pristine, that Solaris
> > provides the mapbase.  I do not have Solaris/Illumos box anymore
> > (for quite some time), so I cannot check directly.
> > 
> > My current PoV is that l_addr semantic must be restored, and relocbase
> > provided by newly added member.
> > 
> > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ?
> 
> Isn't the problem when perl is *not* linked as PIE?  In this case
> relocbase is 0, so the ELF header access becomes a NULL pointer
> dereference.
drti checks for ET_DYN, only then it uses l_addr at all.
PIE binaries are dso with non-zero base, non-PIE binaries are ET_EXEC,
which should make dtri.c ignore the l_addr value.
___
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: r361336 - head/sys/powerpc/aim

2020-05-21 Thread Mark Johnston
On Thu, May 21, 2020 at 03:53:17PM +, Brandon Bergren wrote:
> Author: bdragon
> Date: Thu May 21 15:53:16 2020
> New Revision: 361336
> URL: https://svnweb.freebsd.org/changeset/base/361336
> 
> Log:
>   [PowerPC] Fix kernel boot on powerpc
>   
>   Recent changes have caused the vmspace objects to start coming from KVA
>   instead of direct-mapped memory on powerpc. As far as I can tell, this is
>   not actually a problem, so we should stop arbitrarily asserting that it is.
>   
>   I do not know why this was not being triggered before.

UMA was recently changed in r357549 to use multi-page slabs if doing so
would reduce internal fragmentation to a certain degree.  In that case
the slabs will be mapped into KVA. vmspace objects are quite large but
smaller than a page, so they benefit from this.  You can verify by
checking the vm.uma.VMSPACE.keg.ppera sysctl, which gives the number of
pages per slab.
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Mark Johnston
On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote:
> On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote:
> > On 5/21/20 8:12 AM, Mark Johnston wrote:
> > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote:
> > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
> > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov  
> > >>> wrote:
> > 
> >  Author: kib
> >  Date: Wed May 20 22:08:26 2020
> >  New Revision: 361303
> >  URL: https://svnweb.freebsd.org/changeset/base/361303
> > 
> >  Log:
> >    Change the samantic of struct link_map l_addr member.
> > 
> >    It previously returned the object map base address, while all other
> >    ELF operating systems return load offset, i.e. the difference between
> >    map base and the link base.
> > 
> >    Explain the meaning of the field in the man page.
> > 
> >    Stop filling the mips-only l_offs member, which is apparently unused.
> > 
> >    PR:   246561
> >    Requested by: Damjan Jovanovic 
> >    Reviewed by:  emaste, jhb, cem (previous version)
> >    Sponsored by: The FreeBSD Foundation
> >    MFC after:1 week
> >    Differential revision:https://reviews.freebsd.org/D24918
> > 
> >  Modified:
> >    head/lib/libc/gen/dlinfo.3
> >    head/libexec/rtld-elf/rtld.c
> >    head/sys/sys/link_elf.h
> > >>>
> > >>> Hi,
> > >>>
> > >>> After this commit,  some ports fail to build with signal 11.
> > >>> For instance lang/perl5.30 fails to build with default options (DTRACE 
> > >>> on)
> > >>> Disabling the DTRACE option makes it able to build again.
> > >>>
> > >> I see, thank you for reporting.
> > >>
> > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes
> > >> that l_addr is the base, not relocbase.
> > >>
> > >> Mark, was dofhp_addr initialization changed comparing to Solaris ?
> > > 
> > > It appears it has been the same since DTrace was imported.  illumos
> > > still has similar code.
> > > 
> > > Note that drti.o is linked into any executable and shlib that defines
> > > static probes, so the ABI change affects more than just dtrace(1).
> > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and
> > > preserve the old behaviour for the old value?
> > 
> > I think a bigger question is if Solaris/illumos treat l_addr as mapbase
> > (absolute address) or relocbase (relative address).  In the discussion
> > in the phabricator I had assumed that all other OS's treated l_addr as
> > the relative offset (relocbase).  Does the code for illumos assume an
> > absolute address or does it assume a relative address in l_addr?
> 
> It is rather clear, since the dtrace code was pristine, that Solaris
> provides the mapbase.  I do not have Solaris/Illumos box anymore
> (for quite some time), so I cannot check directly.
> 
> My current PoV is that l_addr semantic must be restored, and relocbase
> provided by newly added member.
> 
> BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ?

Isn't the problem when perl is *not* linked as PIE?  In this case
relocbase is 0, so the ELF header access becomes a NULL pointer
dereference.
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Konstantin Belousov
On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote:
> On 5/21/20 8:12 AM, Mark Johnston wrote:
> > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote:
> >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
> >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov  
> >>> wrote:
> 
>  Author: kib
>  Date: Wed May 20 22:08:26 2020
>  New Revision: 361303
>  URL: https://svnweb.freebsd.org/changeset/base/361303
> 
>  Log:
>    Change the samantic of struct link_map l_addr member.
> 
>    It previously returned the object map base address, while all other
>    ELF operating systems return load offset, i.e. the difference between
>    map base and the link base.
> 
>    Explain the meaning of the field in the man page.
> 
>    Stop filling the mips-only l_offs member, which is apparently unused.
> 
>    PR:   246561
>    Requested by: Damjan Jovanovic 
>    Reviewed by:  emaste, jhb, cem (previous version)
>    Sponsored by: The FreeBSD Foundation
>    MFC after:1 week
>    Differential revision:https://reviews.freebsd.org/D24918
> 
>  Modified:
>    head/lib/libc/gen/dlinfo.3
>    head/libexec/rtld-elf/rtld.c
>    head/sys/sys/link_elf.h
> >>>
> >>> Hi,
> >>>
> >>> After this commit,  some ports fail to build with signal 11.
> >>> For instance lang/perl5.30 fails to build with default options (DTRACE on)
> >>> Disabling the DTRACE option makes it able to build again.
> >>>
> >> I see, thank you for reporting.
> >>
> >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes
> >> that l_addr is the base, not relocbase.
> >>
> >> Mark, was dofhp_addr initialization changed comparing to Solaris ?
> > 
> > It appears it has been the same since DTrace was imported.  illumos
> > still has similar code.
> > 
> > Note that drti.o is linked into any executable and shlib that defines
> > static probes, so the ABI change affects more than just dtrace(1).
> > Would it be possible to define a new value for RTLD_DI_LINKMAP, and
> > preserve the old behaviour for the old value?
> 
> I think a bigger question is if Solaris/illumos treat l_addr as mapbase
> (absolute address) or relocbase (relative address).  In the discussion
> in the phabricator I had assumed that all other OS's treated l_addr as
> the relative offset (relocbase).  Does the code for illumos assume an
> absolute address or does it assume a relative address in l_addr?

It is rather clear, since the dtrace code was pristine, that Solaris
provides the mapbase.  I do not have Solaris/Illumos box anymore
(for quite some time), so I cannot check directly.

My current PoV is that l_addr semantic must be restored, and relocbase
provided by newly added member.

BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ?
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Mark Johnston
On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote:
> On 5/21/20 8:12 AM, Mark Johnston wrote:
> > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote:
> >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
> >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov  
> >>> wrote:
> 
>  Author: kib
>  Date: Wed May 20 22:08:26 2020
>  New Revision: 361303
>  URL: https://svnweb.freebsd.org/changeset/base/361303
> 
>  Log:
>    Change the samantic of struct link_map l_addr member.
> 
>    It previously returned the object map base address, while all other
>    ELF operating systems return load offset, i.e. the difference between
>    map base and the link base.
> 
>    Explain the meaning of the field in the man page.
> 
>    Stop filling the mips-only l_offs member, which is apparently unused.
> 
>    PR:   246561
>    Requested by: Damjan Jovanovic 
>    Reviewed by:  emaste, jhb, cem (previous version)
>    Sponsored by: The FreeBSD Foundation
>    MFC after:1 week
>    Differential revision:https://reviews.freebsd.org/D24918
> 
>  Modified:
>    head/lib/libc/gen/dlinfo.3
>    head/libexec/rtld-elf/rtld.c
>    head/sys/sys/link_elf.h
> >>>
> >>> Hi,
> >>>
> >>> After this commit,  some ports fail to build with signal 11.
> >>> For instance lang/perl5.30 fails to build with default options (DTRACE on)
> >>> Disabling the DTRACE option makes it able to build again.
> >>>
> >> I see, thank you for reporting.
> >>
> >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes
> >> that l_addr is the base, not relocbase.
> >>
> >> Mark, was dofhp_addr initialization changed comparing to Solaris ?
> > 
> > It appears it has been the same since DTrace was imported.  illumos
> > still has similar code.
> > 
> > Note that drti.o is linked into any executable and shlib that defines
> > static probes, so the ABI change affects more than just dtrace(1).
> > Would it be possible to define a new value for RTLD_DI_LINKMAP, and
> > preserve the old behaviour for the old value?
> 
> I think a bigger question is if Solaris/illumos treat l_addr as mapbase
> (absolute address) or relocbase (relative address).  In the discussion
> in the phabricator I had assumed that all other OS's treated l_addr as
> the relative offset (relocbase).  Does the code for illumos assume an
> absolute address or does it assume a relative address in l_addr?

It should be an absolute address, since dtrace appears to assume that an
ELF header is mapped at l_addr.

Here, "addr" is the value of l_addr for the RTLD_SELF linkmap:
https://github.com/joyent/illumos-joyent/blob/master/usr/src/lib/libdtrace/common/dlink_common.c#L124
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread John Baldwin
On 5/21/20 8:12 AM, Mark Johnston wrote:
> On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote:
>> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
>>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov  
>>> wrote:

 Author: kib
 Date: Wed May 20 22:08:26 2020
 New Revision: 361303
 URL: https://svnweb.freebsd.org/changeset/base/361303

 Log:
   Change the samantic of struct link_map l_addr member.

   It previously returned the object map base address, while all other
   ELF operating systems return load offset, i.e. the difference between
   map base and the link base.

   Explain the meaning of the field in the man page.

   Stop filling the mips-only l_offs member, which is apparently unused.

   PR:   246561
   Requested by: Damjan Jovanovic 
   Reviewed by:  emaste, jhb, cem (previous version)
   Sponsored by: The FreeBSD Foundation
   MFC after:1 week
   Differential revision:https://reviews.freebsd.org/D24918

 Modified:
   head/lib/libc/gen/dlinfo.3
   head/libexec/rtld-elf/rtld.c
   head/sys/sys/link_elf.h
>>>
>>> Hi,
>>>
>>> After this commit,  some ports fail to build with signal 11.
>>> For instance lang/perl5.30 fails to build with default options (DTRACE on)
>>> Disabling the DTRACE option makes it able to build again.
>>>
>> I see, thank you for reporting.
>>
>> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes
>> that l_addr is the base, not relocbase.
>>
>> Mark, was dofhp_addr initialization changed comparing to Solaris ?
> 
> It appears it has been the same since DTrace was imported.  illumos
> still has similar code.
> 
> Note that drti.o is linked into any executable and shlib that defines
> static probes, so the ABI change affects more than just dtrace(1).
> Would it be possible to define a new value for RTLD_DI_LINKMAP, and
> preserve the old behaviour for the old value?

I think a bigger question is if Solaris/illumos treat l_addr as mapbase
(absolute address) or relocbase (relative address).  In the discussion
in the phabricator I had assumed that all other OS's treated l_addr as
the relative offset (relocbase).  Does the code for illumos assume an
absolute address or does it assume a relative address in l_addr?

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


svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica

2020-05-21 Thread Mark Johnston
Author: markj
Date: Thu May 21 15:28:35 2020
New Revision: 361334
URL: https://svnweb.freebsd.org/changeset/base/361334

Log:
  MFC r361033:
  Call acpi_pxm_set_proximity_info() slightly earlier on x86.

Modified:
  stable/12/sys/amd64/amd64/mp_machdep.c
  stable/12/sys/arm64/arm64/mp_machdep.c
  stable/12/sys/dev/acpica/acpi_pxm.c
  stable/12/sys/dev/acpica/acpivar.h
  stable/12/sys/i386/i386/mp_machdep.c
  stable/12/sys/x86/acpica/srat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/mp_machdep.c
==
--- stable/12/sys/amd64/amd64/mp_machdep.c  Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/amd64/amd64/mp_machdep.c  Thu May 21 15:28:35 2020
(r361334)
@@ -265,8 +265,9 @@ cpu_mp_start(void)
init_ops.start_all_aps();
 
set_interrupt_apic_ids();
-}
 
+   acpi_pxm_set_cpu_locality();
+}
 
 /*
  * AP CPU's call this to initialize themselves.

Modified: stable/12/sys/arm64/arm64/mp_machdep.c
==
--- stable/12/sys/arm64/arm64/mp_machdep.c  Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/arm64/arm64/mp_machdep.c  Thu May 21 15:28:35 2020
(r361334)
@@ -595,9 +595,7 @@ cpu_init_acpi(void)
acpi_unmap_table(madt);
 
 #if MAXMEMDOM > 1
-   /* set proximity info */
acpi_pxm_set_cpu_locality();
-   acpi_pxm_free();
 #endif
 }
 #endif

Modified: stable/12/sys/dev/acpica/acpi_pxm.c
==
--- stable/12/sys/dev/acpica/acpi_pxm.c Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/dev/acpica/acpi_pxm.c Thu May 21 15:28:35 2020
(r361334)
@@ -628,7 +628,8 @@ srat_walk_table(acpi_subtable_handler *handler, void *
 }
 
 /*
- * Setup per-CPU domain IDs from information saved in 'cpus'.
+ * Set up per-CPU domain IDs from information saved in 'cpus' and tear down 
data
+ * structures allocated by acpi_pxm_init().
  */
 void
 acpi_pxm_set_cpu_locality(void)
@@ -651,6 +652,10 @@ acpi_pxm_set_cpu_locality(void)
printf("SRAT: CPU %u has memory domain %d\n", i,
pc->pc_domain);
}
+   /* XXXMJ the page is leaked. */
+   pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus);
+   srat_physaddr = 0;
+   cpus = NULL;
 }
 
 int
@@ -662,20 +667,6 @@ acpi_pxm_get_cpu_locality(int apic_id)
if (cpu == NULL)
panic("SRAT: CPU with ID %u is not known", apic_id);
return (cpu->domain);
-}
-
-/*
- * Free data structures allocated during acpi_pxm_init.
- */
-void
-acpi_pxm_free(void)
-{
-
-   if (srat_physaddr == 0)
-   return;
-   pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus);
-   srat_physaddr = 0;
-   cpus = NULL;
 }
 
 /*

Modified: stable/12/sys/dev/acpica/acpivar.h
==
--- stable/12/sys/dev/acpica/acpivar.h  Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/dev/acpica/acpivar.h  Thu May 21 15:28:35 2020
(r361334)
@@ -536,7 +536,6 @@ voidacpi_pxm_parse_tables(void);
 void   acpi_pxm_set_mem_locality(void);
 void   acpi_pxm_set_cpu_locality(void);
 intacpi_pxm_get_cpu_locality(int apic_id);
-void   acpi_pxm_free(void);
 
 /*
  * Map a PXM to a VM domain.

Modified: stable/12/sys/i386/i386/mp_machdep.c
==
--- stable/12/sys/i386/i386/mp_machdep.cThu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/i386/i386/mp_machdep.cThu May 21 15:28:35 2020
(r361334)
@@ -199,6 +199,8 @@ cpu_mp_start(void)
start_all_aps();
 
set_interrupt_apic_ids();
+
+   acpi_pxm_set_cpu_locality();
 }
 
 /*

Modified: stable/12/sys/x86/acpica/srat.c
==
--- stable/12/sys/x86/acpica/srat.c Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/x86/acpica/srat.c Thu May 21 15:28:35 2020
(r361334)
@@ -56,13 +56,4 @@ parse_acpi_tables(void *dummy)
 SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables,
 NULL);
 
-static void
-srat_set_cpus(void *dummy)
-{
-
-   acpi_pxm_set_cpu_locality();
-   acpi_pxm_free();
-}
-SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL);
-
 #endif /* MAXMEMDOM > 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: r361332 - head/bin/ls

2020-05-21 Thread Kyle Evans
Author: kevans
Date: Thu May 21 15:15:50 2020
New Revision: 361332
URL: https://svnweb.freebsd.org/changeset/base/361332

Log:
  ls: fix WITHOUT_LS_COLORS build
  
  *sigh* references to colorflags should be gated by COLORLS.
  
  Pointy hat to:kevans
  Reported by:  jenkins (rescue build)
  X-MFC-With:   r361318

Modified:
  head/bin/ls/ls.c

Modified: head/bin/ls/ls.c
==
--- head/bin/ls/ls.cThu May 21 14:39:00 2020(r361331)
+++ head/bin/ls/ls.cThu May 21 15:15:50 2020(r361332)
@@ -270,8 +270,10 @@ main(int argc, char *argv[])
 * For historical compatibility, we'll use our autodetection if CLICOLOR
 * is set.
 */
+#ifdef COLORLS
if (getenv("CLICOLOR"))
colorflag = COLORFLAG_AUTO;
+#endif
while ((ch = getopt_long(argc, argv,
"+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts,
NULL)) != -1) {
@@ -355,7 +357,9 @@ main(int argc, char *argv[])
 * stdout isn't a tty.
 */
setenv("CLICOLOR", "", 1);
+#ifdef COLORLS
colorflag = COLORFLAG_AUTO;
+#endif
break;
case 'H':
fts_options |= FTS_COMFOLLOW;
___
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: r361331 - head/bin/ls

2020-05-21 Thread Kyle Evans
Author: kevans
Date: Thu May 21 14:39:00 2020
New Revision: 361331
URL: https://svnweb.freebsd.org/changeset/base/361331

Log:
  ls(1): actually restore proper behavior
  
  Highlights:
  - CLICOLOR in the environment should imply --color=auto to maintain
compatibility with historical behavior
  - -G should set CLICOLOR and imply --color=auto
  
  The manpage has been updated to draw the connection between -G and --color;
  the former is in-fact a sort of compromise between --color=always and
  --color=auto, where we'll output color regardless of the environment lacking
  CLICOLOR/COLORTERM assuming stdout is a tty.
  
  X-MFC-With: r361318

Modified:
  head/bin/ls/ls.1
  head/bin/ls/ls.c

Modified: head/bin/ls/ls.1
==
--- head/bin/ls/ls.1Thu May 21 13:46:30 2020(r361330)
+++ head/bin/ls/ls.1Thu May 21 14:39:00 2020(r361331)
@@ -32,7 +32,7 @@
 .\" @(#)ls.1   8.7 (Berkeley) 7/29/94
 .\" $FreeBSD$
 .\"
-.Dd May 20, 2020
+.Dd May 21, 2020
 .Dt LS 1
 .Os
 .Sh NAME
@@ -135,7 +135,8 @@ This option is equivalent to defining
 .Ev CLICOLOR
 or
 .Ev COLORTERM
-in the environment.
+in the environment and setting
+.Fl -color Ns = Ns Ar auto .
 (See below.)
 This functionality can be compiled out by removing the definition of
 .Ev COLORLS .

Modified: head/bin/ls/ls.c
==
--- head/bin/ls/ls.cThu May 21 13:46:30 2020(r361330)
+++ head/bin/ls/ls.cThu May 21 14:39:00 2020(r361331)
@@ -265,6 +265,13 @@ main(int argc, char *argv[])
fts_options = FTS_PHYSICAL;
if (getenv("LS_SAMESORT"))
f_samesort = 1;
+
+   /*
+* For historical compatibility, we'll use our autodetection if CLICOLOR
+* is set.
+*/
+   if (getenv("CLICOLOR"))
+   colorflag = COLORFLAG_AUTO;
while ((ch = getopt_long(argc, argv,
"+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts,
NULL)) != -1) {
@@ -342,7 +349,13 @@ main(int argc, char *argv[])
f_slash = 0;
break;
case 'G':
+   /*
+* We both set CLICOLOR here and set colorflag to
+* COLORFLAG_AUTO, because -G should not force color if
+* stdout isn't a tty.
+*/
setenv("CLICOLOR", "", 1);
+   colorflag = COLORFLAG_AUTO;
break;
case 'H':
fts_options |= FTS_COMFOLLOW;
___
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: r361330 - head/lib/libprocstat

2020-05-21 Thread Andriy Gapon
Author: avg
Date: Thu May 21 13:46:30 2020
New Revision: 361330
URL: https://svnweb.freebsd.org/changeset/base/361330

Log:
  libprocstat: fix reading of file descriptor table via kvm
  
  This seems to have been broken since r247602 (from year 2013!).
  Can be easily tested with
fstat -N /boot/kernel/kernel -M /var/crash/vmcore.last
  
  MFC after:1 week
  Sponsored by: Panzura

Modified:
  head/lib/libprocstat/libprocstat.c

Modified: head/lib/libprocstat/libprocstat.c
==
--- head/lib/libprocstat/libprocstat.c  Thu May 21 12:43:34 2020
(r361329)
+++ head/lib/libprocstat/libprocstat.c  Thu May 21 13:46:30 2020
(r361330)
@@ -467,7 +467,7 @@ procstat_getfiles_kvm(struct procstat *procstat, struc
vm_map_entry_t entryp;
vm_object_t objp;
struct vnode *vp;
-   struct file **ofiles;
+   struct filedescent *ofiles;
struct filestat *entry;
struct filestat_list *head;
kvm_t *kd;
@@ -554,25 +554,25 @@ procstat_getfiles_kvm(struct procstat *procstat, struc
}
 
nfiles = filed.fd_lastfile + 1;
-   ofiles = malloc(nfiles * sizeof(struct file *));
+   ofiles = malloc(nfiles * sizeof(struct filedescent));
if (ofiles == NULL) {
-   warn("malloc(%zu)", nfiles * sizeof(struct file *));
+   warn("malloc(%zu)", nfiles * sizeof(struct filedescent));
goto do_mmapped;
}
if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles,
-   nfiles * sizeof(struct file *))) {
+   nfiles * sizeof(struct filedescent))) {
warnx("cannot read file structures at %p",
(void *)filed.fd_ofiles);
free(ofiles);
goto do_mmapped;
}
for (i = 0; i <= filed.fd_lastfile; i++) {
-   if (ofiles[i] == NULL)
+   if (ofiles[i].fde_file == NULL)
continue;
-   if (!kvm_read_all(kd, (unsigned long)ofiles[i], ,
+   if (!kvm_read_all(kd, (unsigned long)ofiles[i].fde_file, ,
sizeof(struct file))) {
warnx("can't read file %d at %p", i,
-   (void *)ofiles[i]);
+   (void *)ofiles[i].fde_file);
continue;
}
switch (file.f_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"


Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Konstantin Belousov
On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote:
> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov  wrote:
> >
> > Author: kib
> > Date: Wed May 20 22:08:26 2020
> > New Revision: 361303
> > URL: https://svnweb.freebsd.org/changeset/base/361303
> >
> > Log:
> >   Change the samantic of struct link_map l_addr member.
> >
> >   It previously returned the object map base address, while all other
> >   ELF operating systems return load offset, i.e. the difference between
> >   map base and the link base.
> >
> >   Explain the meaning of the field in the man page.
> >
> >   Stop filling the mips-only l_offs member, which is apparently unused.
> >
> >   PR:   246561
> >   Requested by: Damjan Jovanovic 
> >   Reviewed by:  emaste, jhb, cem (previous version)
> >   Sponsored by: The FreeBSD Foundation
> >   MFC after:1 week
> >   Differential revision:https://reviews.freebsd.org/D24918
> >
> > Modified:
> >   head/lib/libc/gen/dlinfo.3
> >   head/libexec/rtld-elf/rtld.c
> >   head/sys/sys/link_elf.h
> 
> Hi,
> 
> After this commit,  some ports fail to build with signal 11.
> For instance lang/perl5.30 fails to build with default options (DTRACE on)
> Disabling the DTRACE option makes it able to build again.
> 
I see, thank you for reporting.

So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes
that l_addr is the base, not relocbase.

Mark, was dofhp_addr initialization changed comparing to Solaris ?
___
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: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys

2020-05-21 Thread Peter Holm
On Thu, May 21, 2020 at 01:01:18PM +, Wei Hu wrote:
> > -Original Message-
> > From: Peter Holm 
> > Sent: Thursday, May 21, 2020 8:24 PM
> > To: Wei Hu 
> > Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src-
> > h...@freebsd.org
> > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock
> > dev/hyperv/include dev/hyperv/vmbus modules/hyperv
> > modules/hyperv/hvsock sys
> > 
> > On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote:
> > > Author: whu
> > > Date: Wed May 20 11:03:59 2020
> > > New Revision: 361275
> > > URL:
> > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsvnweb
> > .freebsd.org%2Fchangeset%2Fbase%2F361275data=02%7C01%7Cweh%
> > 40microsoft.com%7C61c524b5022b47b2c4e108d7fd81e75f%7C72f988bf86f14
> > 1af91ab2d7cd011db47%7C1%7C0%7C637256606689750658sdata=mw
> > 4IXP3DnxICnK4U%2F8MzLbvMAzCuxih2f0waDyMSCTE%3Dreserved=0
> > >
> > > Log:
> > >   HyperV socket implementation for FreeBSD
> > >
> > >   This change adds Hyper-V socket feature in FreeBSD. New socket address
> > >   family AF_HYPERV and its kernel support are added.
> > >
> > 
> > Found this with a syscall fuzz test:
> > 
> > panic: page fault
> > cpuid = 2
> > time = 1590050529
> > KDB: stack backtrace:
> > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
> > 0xfe033d21d530
> > vpanic() at vpanic+0x182/frame 0xfe033d21d580
> > panic() at panic+0x43/frame 0xfe033d21d5e0
> > trap_fatal() at trap_fatal+0x387/frame 0xfe033d21d640
> > trap_pfault() at trap_pfault+0x99/frame 0xfe033d21d6a0
> > trap() at trap+0x2a5/frame 0xfe033d21d7b0
> > calltrap() at calltrap+0x8/frame 0xfe033d21d7b0
> > --- trap 0xc, rip = 0x80bcd3ba, rsp = 0xfe033d21d880, rbp =
> > 0xfe033d21d910 ---
> > _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfe033d21d910
> > _sx_xlock() at _sx_xlock+0xba/frame 0xfe033d21d950
> > hvs_trans_close() at hvs_trans_close+0x42/frame 0xfe033d21d970
> > soclose() at soclose+0x161/frame 0xfe033d21d9e0
> > _fdrop() at _fdrop+0x1a/frame 0xfe033d21da00
> > closef() at closef+0x1db/frame 0xfe033d21da90
> > closefp() at closefp+0x96/frame 0xfe033d21dad0
> > amd64_syscall() at amd64_syscall+0x159/frame 0xfe033d21dbf0
> > fast_syscall_common() at fast_syscall_common+0x101/frame
> > 0xfe033d21dbf0
> > --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8004283ca, rsp = 
> > 0x7fffe328,
> > rbp = 0x7fffe460 ---
> > 
> > https://nam06.safelinks.protection.outlook.com/?url=https:%2F%2Fpeople.free
> > bsd.org%2F~pho%2Fstress%2Flog%2Fsetsockopt2-
> > 2.txtdata=02%7C01%7Cweh%40microsoft.com%7C61c524b5022b47b2c
> > 4e108d7fd81e75f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63
> > 7256606689750658sdata=RuBmWrBv7lGnhF2IHZ5NOP2rmV0c%2BJXuk
> > RZl260KSIw%3Dreserved=0
> > 
> > Could this be yours?
> 
> 
> Yes. Looks the lock was not initialized. The lock only gets initialized when 
> it is running
> on HyperV. This type of socket only works on HyperV. 
> 
> How to reproduce it? Was it on HyperV? I am not sure how it can enter this 
> state.
> 
> Wei

The test is syscall() fuzzing, which typically flushes out missing
parameter validations.
This was *not* run on HyperV.

You can find the test case here:
https://svnweb.freebsd.org/base/user/pho/stress2/misc/setsockopt2.sh

- Peter
___
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: r361318 - head/bin/ls

2020-05-21 Thread Kyle Evans
On Thu, May 21, 2020 at 7:59 AM Rodney W. Grimes
 wrote:
>
> > Author: kevans
> > Date: Thu May 21 03:50:56 2020
> > New Revision: 361318
> > URL: https://svnweb.freebsd.org/changeset/base/361318
> >
> > Log:
> >   ls: fix a --color regression from r337956
> >
> >   The regression is in-fact that I flipped the default from never to auto. 
> > The
> >   incorrect impression was based on an alias that I failed to notice,
> >   installed by the Linux distribution that I used for testing compatibility
> >   here. Users that want the old default should be doing so with a shell 
> > alias
> >   as is done elsewhere, rather than making this decision in ls(1).
> >
> >   Many thanks to rgrimes for pointing out the alias that I clearly 
> > overlooked
> >   that resulted in this; if you despised colors in your terminal from this,
> >   consider buying him a beer at the next venue that you see him at.
>
> Thanks Kyle, but this is likely to get me more rocks than beers :-)
>

FWIW- I received a not-insignificant number of valid complaints about
the original default change because default color schemes are hard,
and continued to receive an insignificant number of complaints as
recent as a couple months ago (~2 years after the change?). This is
considerably more flack than I expect to receive from other
controversial proposals I've made and it was based on a fundamental
misunderstanding of coreutils.

Thanks,

Kyle Evans
___
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: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys

2020-05-21 Thread Antoine Brodin
On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov  wrote:
>
> Author: kib
> Date: Wed May 20 22:08:26 2020
> New Revision: 361303
> URL: https://svnweb.freebsd.org/changeset/base/361303
>
> Log:
>   Change the samantic of struct link_map l_addr member.
>
>   It previously returned the object map base address, while all other
>   ELF operating systems return load offset, i.e. the difference between
>   map base and the link base.
>
>   Explain the meaning of the field in the man page.
>
>   Stop filling the mips-only l_offs member, which is apparently unused.
>
>   PR:   246561
>   Requested by: Damjan Jovanovic 
>   Reviewed by:  emaste, jhb, cem (previous version)
>   Sponsored by: The FreeBSD Foundation
>   MFC after:1 week
>   Differential revision:https://reviews.freebsd.org/D24918
>
> Modified:
>   head/lib/libc/gen/dlinfo.3
>   head/libexec/rtld-elf/rtld.c
>   head/sys/sys/link_elf.h

Hi,

After this commit,  some ports fail to build with signal 11.
For instance lang/perl5.30 fails to build with default options (DTRACE on)
Disabling the DTRACE option makes it able to build again.

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"


RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys

2020-05-21 Thread Wei Hu via svn-src-all
> -Original Message-
> From: Peter Holm 
> Sent: Thursday, May 21, 2020 8:24 PM
> To: Wei Hu 
> Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src-
> h...@freebsd.org
> Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock
> dev/hyperv/include dev/hyperv/vmbus modules/hyperv
> modules/hyperv/hvsock sys
> 
> On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote:
> > Author: whu
> > Date: Wed May 20 11:03:59 2020
> > New Revision: 361275
> > URL:
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsvnweb
> .freebsd.org%2Fchangeset%2Fbase%2F361275data=02%7C01%7Cweh%
> 40microsoft.com%7C61c524b5022b47b2c4e108d7fd81e75f%7C72f988bf86f14
> 1af91ab2d7cd011db47%7C1%7C0%7C637256606689750658sdata=mw
> 4IXP3DnxICnK4U%2F8MzLbvMAzCuxih2f0waDyMSCTE%3Dreserved=0
> >
> > Log:
> >   HyperV socket implementation for FreeBSD
> >
> >   This change adds Hyper-V socket feature in FreeBSD. New socket address
> >   family AF_HYPERV and its kernel support are added.
> >
> 
> Found this with a syscall fuzz test:
> 
> panic: page fault
> cpuid = 2
> time = 1590050529
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
> 0xfe033d21d530
> vpanic() at vpanic+0x182/frame 0xfe033d21d580
> panic() at panic+0x43/frame 0xfe033d21d5e0
> trap_fatal() at trap_fatal+0x387/frame 0xfe033d21d640
> trap_pfault() at trap_pfault+0x99/frame 0xfe033d21d6a0
> trap() at trap+0x2a5/frame 0xfe033d21d7b0
> calltrap() at calltrap+0x8/frame 0xfe033d21d7b0
> --- trap 0xc, rip = 0x80bcd3ba, rsp = 0xfe033d21d880, rbp =
> 0xfe033d21d910 ---
> _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfe033d21d910
> _sx_xlock() at _sx_xlock+0xba/frame 0xfe033d21d950
> hvs_trans_close() at hvs_trans_close+0x42/frame 0xfe033d21d970
> soclose() at soclose+0x161/frame 0xfe033d21d9e0
> _fdrop() at _fdrop+0x1a/frame 0xfe033d21da00
> closef() at closef+0x1db/frame 0xfe033d21da90
> closefp() at closefp+0x96/frame 0xfe033d21dad0
> amd64_syscall() at amd64_syscall+0x159/frame 0xfe033d21dbf0
> fast_syscall_common() at fast_syscall_common+0x101/frame
> 0xfe033d21dbf0
> --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8004283ca, rsp = 
> 0x7fffe328,
> rbp = 0x7fffe460 ---
> 
> https://nam06.safelinks.protection.outlook.com/?url=https:%2F%2Fpeople.free
> bsd.org%2F~pho%2Fstress%2Flog%2Fsetsockopt2-
> 2.txtdata=02%7C01%7Cweh%40microsoft.com%7C61c524b5022b47b2c
> 4e108d7fd81e75f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63
> 7256606689750658sdata=RuBmWrBv7lGnhF2IHZ5NOP2rmV0c%2BJXuk
> RZl260KSIw%3Dreserved=0
> 
> Could this be yours?


Yes. Looks the lock was not initialized. The lock only gets initialized when it 
is running
on HyperV. This type of socket only works on HyperV. 

How to reproduce it? Was it on HyperV? I am not sure how it can enter this 
state.

Wei

___
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: r361318 - head/bin/ls

2020-05-21 Thread Rodney W. Grimes
> Author: kevans
> Date: Thu May 21 03:50:56 2020
> New Revision: 361318
> URL: https://svnweb.freebsd.org/changeset/base/361318
> 
> Log:
>   ls: fix a --color regression from r337956
>   
>   The regression is in-fact that I flipped the default from never to auto. The
>   incorrect impression was based on an alias that I failed to notice,
>   installed by the Linux distribution that I used for testing compatibility
>   here. Users that want the old default should be doing so with a shell alias
>   as is done elsewhere, rather than making this decision in ls(1).
>   
>   Many thanks to rgrimes for pointing out the alias that I clearly overlooked
>   that resulted in this; if you despised colors in your terminal from this,
>   consider buying him a beer at the next venue that you see him at.

Thanks Kyle, but this is likely to get me more rocks than beers :-)

>   
>   MFC after:  1 week
>   Relnotes:   yes
> 
> Modified:
>   head/bin/ls/ls.1
>   head/bin/ls/ls.c
> 
> Modified: head/bin/ls/ls.1
> ==
> --- head/bin/ls/ls.1  Thu May 21 03:33:20 2020(r361317)
> +++ head/bin/ls/ls.1  Thu May 21 03:50:56 2020(r361318)
> @@ -32,7 +32,7 @@
>  .\" @(#)ls.1 8.7 (Berkeley) 7/29/94
>  .\" $FreeBSD$
>  .\"
> -.Dd August 18, 2018
> +.Dd May 20, 2020
>  .Dt LS 1
>  .Os
>  .Sh NAME
> @@ -216,8 +216,8 @@ Output colored escape sequences based on
>  .Ar when ,
>  which may be set to either
>  .Cm always ,
> -.Cm auto
> -(default), or
> +.Cm auto ,
> +or
>  .Cm never .
>  .Pp
>  .Cm always
> @@ -252,6 +252,12 @@ environment variable is set and not empty.
>  .Pp
>  .Cm never
>  will disable color regardless of environment variables.
> +.Cm never
> +is the default when neither
> +.Fl -color
> +nor
> +.Fl G
> +is specified.
>  .Pp
>  For compatibility with GNU coreutils,
>  .Nm
> 
> Modified: head/bin/ls/ls.c
> ==
> --- head/bin/ls/ls.c  Thu May 21 03:33:20 2020(r361317)
> +++ head/bin/ls/ls.c  Thu May 21 03:50:56 2020(r361318)
> @@ -152,7 +152,7 @@ static int f_timesort;/* sort by time vice 
> name */
> int f_type;   /* add type character for non-regular files */
>  static int f_whiteout;   /* show whiteout entries */
>  #ifdef COLORLS
> -   int colorflag = COLORFLAG_AUTO;   /* passed in colorflag 
> */
> +   int colorflag = COLORFLAG_NEVER;  /* passed in colorflag 
> */
> int f_color;  /* add type in color for non-regular files */
> bool explicitansi;/* Explicit ANSI sequences, no termcap(5) */
>  char *ansi_bgcol;/* ANSI sequence to set background colour */
> 

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


svn commit: r361329 - releng/11.4/sys/kern

2020-05-21 Thread Konstantin Belousov
Author: kib
Date: Thu May 21 12:43:34 2020
New Revision: 361329
URL: https://svnweb.freebsd.org/changeset/base/361329

Log:
  MFC r361037, r361056:
  Fix spurious ENOTCONN from closed unix domain socket other' side.
  
  Approved by: re (gjb)

Modified:
  releng/11.4/sys/kern/uipc_socket.c
Directory Properties:
  releng/11.4/   (props changed)

Modified: releng/11.4/sys/kern/uipc_socket.c
==
--- releng/11.4/sys/kern/uipc_socket.c  Thu May 21 11:14:13 2020
(r361328)
+++ releng/11.4/sys/kern/uipc_socket.c  Thu May 21 12:43:34 2020
(r361329)
@@ -1565,8 +1565,9 @@ restart:
m = so->so_rcv.sb_mb;
goto dontblock;
}
-   if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
-   (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
+   if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED |
+   SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 &&
+   (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) {
SOCKBUF_UNLOCK(>so_rcv);
error = ENOTCONN;
goto release;
@@ -3516,8 +3517,17 @@ soisdisconnected(struct socket *so)
 * SOCKBUF_LOCK(>so_rcv) are the same.
 */
SOCKBUF_LOCK(>so_rcv);
-   so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
+
+   /*
+* There is at least one reader of so_state that does not
+* acquire socket lock, namely soreceive_generic().  Ensure
+* that it never sees all flags that track connection status
+* cleared, by ordering the update with a barrier semantic of
+* our release thread fence.
+*/
so->so_state |= SS_ISDISCONNECTED;
+   atomic_thread_fence_rel();
+   so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
socantrcvmore_locked(so);
SOCKBUF_LOCK(>so_snd);
sbdrop_locked(>so_snd, sbused(>so_snd));
___
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: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys

2020-05-21 Thread Peter Holm
On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote:
> Author: whu
> Date: Wed May 20 11:03:59 2020
> New Revision: 361275
> URL: https://svnweb.freebsd.org/changeset/base/361275
> 
> Log:
>   HyperV socket implementation for FreeBSD
>   
>   This change adds Hyper-V socket feature in FreeBSD. New socket address
>   family AF_HYPERV and its kernel support are added.
>   

Found this with a syscall fuzz test:

panic: page fault
cpuid = 2
time = 1590050529
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe033d21d530
vpanic() at vpanic+0x182/frame 0xfe033d21d580
panic() at panic+0x43/frame 0xfe033d21d5e0
trap_fatal() at trap_fatal+0x387/frame 0xfe033d21d640
trap_pfault() at trap_pfault+0x99/frame 0xfe033d21d6a0
trap() at trap+0x2a5/frame 0xfe033d21d7b0
calltrap() at calltrap+0x8/frame 0xfe033d21d7b0
--- trap 0xc, rip = 0x80bcd3ba, rsp = 0xfe033d21d880, rbp = 
0xfe033d21d910 ---
_sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfe033d21d910
_sx_xlock() at _sx_xlock+0xba/frame 0xfe033d21d950
hvs_trans_close() at hvs_trans_close+0x42/frame 0xfe033d21d970
soclose() at soclose+0x161/frame 0xfe033d21d9e0
_fdrop() at _fdrop+0x1a/frame 0xfe033d21da00
closef() at closef+0x1db/frame 0xfe033d21da90
closefp() at closefp+0x96/frame 0xfe033d21dad0
amd64_syscall() at amd64_syscall+0x159/frame 0xfe033d21dbf0
fast_syscall_common() at fast_syscall_common+0x101/frame 0xfe033d21dbf0
--- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8004283ca, rsp = 
0x7fffe328, rbp = 0x7fffe460 ---

https://people.freebsd.org/~pho/stress/log/setsockopt2-2.txt

Could this be yours?

- Peter

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


Hot sale: 18W PD Charger ---From Andar Technology YolandaTung

2020-05-21 Thread Yolanda Tung


___
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: r361328 - stable/11/sys/kern

2020-05-21 Thread Konstantin Belousov
Author: kib
Date: Thu May 21 11:14:13 2020
New Revision: 361328
URL: https://svnweb.freebsd.org/changeset/base/361328

Log:
  MFC r361037, r361056:
  Fix spurious ENOTCONN from closed unix domain socket other' side.

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

Modified: stable/11/sys/kern/uipc_socket.c
==
--- stable/11/sys/kern/uipc_socket.cThu May 21 11:12:27 2020
(r361327)
+++ stable/11/sys/kern/uipc_socket.cThu May 21 11:14:13 2020
(r361328)
@@ -1565,8 +1565,9 @@ restart:
m = so->so_rcv.sb_mb;
goto dontblock;
}
-   if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
-   (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
+   if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED |
+   SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 &&
+   (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) {
SOCKBUF_UNLOCK(>so_rcv);
error = ENOTCONN;
goto release;
@@ -3516,8 +3517,17 @@ soisdisconnected(struct socket *so)
 * SOCKBUF_LOCK(>so_rcv) are the same.
 */
SOCKBUF_LOCK(>so_rcv);
-   so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
+
+   /*
+* There is at least one reader of so_state that does not
+* acquire socket lock, namely soreceive_generic().  Ensure
+* that it never sees all flags that track connection status
+* cleared, by ordering the update with a barrier semantic of
+* our release thread fence.
+*/
so->so_state |= SS_ISDISCONNECTED;
+   atomic_thread_fence_rel();
+   so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
socantrcvmore_locked(so);
SOCKBUF_LOCK(>so_snd);
sbdrop_locked(>so_snd, sbused(>so_snd));
___
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: r361327 - stable/12/sys/kern

2020-05-21 Thread Konstantin Belousov
Author: kib
Date: Thu May 21 11:12:27 2020
New Revision: 361327
URL: https://svnweb.freebsd.org/changeset/base/361327

Log:
  MFC r361037, r361056:
  Fix spurious ENOTCONN from closed unix domain socket other' side.

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

Modified: stable/12/sys/kern/uipc_socket.c
==
--- stable/12/sys/kern/uipc_socket.cThu May 21 06:40:51 2020
(r361326)
+++ stable/12/sys/kern/uipc_socket.cThu May 21 11:12:27 2020
(r361327)
@@ -1792,8 +1792,9 @@ restart:
m = so->so_rcv.sb_mb;
goto dontblock;
}
-   if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
-   (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
+   if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED |
+   SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 &&
+   (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) {
SOCKBUF_UNLOCK(>so_rcv);
error = ENOTCONN;
goto release;
@@ -3814,8 +3815,17 @@ soisdisconnected(struct socket *so)
 {
 
SOCK_LOCK(so);
-   so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
+
+   /*
+* There is at least one reader of so_state that does not
+* acquire socket lock, namely soreceive_generic().  Ensure
+* that it never sees all flags that track connection status
+* cleared, by ordering the update with a barrier semantic of
+* our release thread fence.
+*/
so->so_state |= SS_ISDISCONNECTED;
+   atomic_thread_fence_rel();
+   so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
 
if (!SOLISTENING(so)) {
SOCK_UNLOCK(so);
___
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: r361326 - head/sys/arm/xilinx

2020-05-21 Thread John-Mark Gurney
Author: jmg
Date: Thu May 21 06:40:51 2020
New Revision: 361326
URL: https://svnweb.freebsd.org/changeset/base/361326

Log:
  Bring in support for single core Zynq devices.  Turns out that real
  hardware, the registers appear like there's two cores, but the second
  core does not work, so base the number of cores upon the chip id.
  
  Tested on a XC7Z007S.
  
  also, previous commit was suppose to be D14429.
  
  Submitted by:   Thomas Skibo
  Differential Revision:  https://reviews.freebsd.org/D14429

Modified:
  head/sys/arm/xilinx/zy7_mp.c
  head/sys/arm/xilinx/zy7_slcr.h

Modified: head/sys/arm/xilinx/zy7_mp.c
==
--- head/sys/arm/xilinx/zy7_mp.cThu May 21 06:17:54 2020
(r361325)
+++ head/sys/arm/xilinx/zy7_mp.cThu May 21 06:40:51 2020
(r361326)
@@ -44,18 +44,59 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
-#defineZYNQ7_CPU1_ENTRY0xfff0
+#defineZYNQ7_CPU1_ENTRY0xfff0
 
-#defineSCU_CONTROL_REG 0xf8f0
-#define   SCU_CONTROL_ENABLE   (1 << 0)
+#defineSCU_CONTROL_REG 0xf8f0
+#define   SCU_CONTROL_ENABLE   1
+#defineSCU_CONFIG_REG  0xf8f4
+#define   SCU_CONFIG_N_CPUS_MASK   3
 
+#define SLCR_PSS_IDCODE0xf8000530
+
 void
 zynq7_mp_setmaxid(platform_t plat)
 {
+   bus_space_handle_t slcr_handle;
+   int device_id;
+   bus_space_handle_t scu_handle;
 
-   mp_maxid = 1;
-   mp_ncpus = 2;
+   if (mp_ncpus != 0)
+   return;
+
+   /* Map in SLCR PSS_IDCODE register. */
+   if (bus_space_map(fdtbus_bs_tag, SLCR_PSS_IDCODE, 4, 0,
+   _handle) != 0)
+   panic("%s: Could not map SLCR IDCODE reg.\n", __func__);
+
+   device_id = bus_space_read_4(fdtbus_bs_tag, slcr_handle, 0) &
+   ZY7_SLCR_PSS_IDCODE_DEVICE_MASK;
+
+   bus_space_unmap(fdtbus_bs_tag, slcr_handle, 4);
+
+   /*
+* Zynq XC7z0xxS single core chips indicate incorrect number of CPUs in
+* SCU configuration register.
+*/
+   if (device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z007S ||
+   device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z012S ||
+   device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z014S) {
+   mp_maxid = 0;
+   mp_ncpus = 1;
+   return;
+   }
+
+   /* Map in SCU config register. */
+   if (bus_space_map(fdtbus_bs_tag, SCU_CONFIG_REG, 4, 0,
+   _handle) != 0)
+   panic("zynq7_mp_setmaxid: Could not map SCU config reg.\n");
+
+   mp_maxid = bus_space_read_4(fdtbus_bs_tag, scu_handle, 0) &
+   SCU_CONFIG_N_CPUS_MASK;
+   mp_ncpus = mp_maxid + 1;
+
+   bus_space_unmap(fdtbus_bs_tag, scu_handle, 4);
 }
 
 void

Modified: head/sys/arm/xilinx/zy7_slcr.h
==
--- head/sys/arm/xilinx/zy7_slcr.h  Thu May 21 06:17:54 2020
(r361325)
+++ head/sys/arm/xilinx/zy7_slcr.h  Thu May 21 06:40:51 2020
(r361326)
@@ -53,91 +53,91 @@
 #define ZY7_SLCR_ARM_PLL_CTRL  0x0100
 #define ZY7_SLCR_DDR_PLL_CTRL  0x0104
 #define ZY7_SLCR_IO_PLL_CTRL   0x0108
-#define   ZY7_SLCR_PLL_CTRL_RESET  (1<<0)
-#define   ZY7_SLCR_PLL_CTRL_PWRDWN (1<<1)
-#define   ZY7_SLCR_PLL_CTRL_BYPASS_QUAL(1<<3)
-#define   ZY7_SLCR_PLL_CTRL_BYPASS_FORCE   (1<<4)
+#define   ZY7_SLCR_PLL_CTRL_RESET  (1 << 0)
+#define   ZY7_SLCR_PLL_CTRL_PWRDWN (1 << 1)
+#define   ZY7_SLCR_PLL_CTRL_BYPASS_QUAL(1 << 3)
+#define   ZY7_SLCR_PLL_CTRL_BYPASS_FORCE   (1 << 4)
 #define   ZY7_SLCR_PLL_CTRL_FDIV_SHIFT 12
-#define   ZY7_SLCR_PLL_CTRL_FDIV_MASK  (0x7f<<12)
+#define   ZY7_SLCR_PLL_CTRL_FDIV_MASK  (0x7f << 12)
 #define ZY7_SLCR_PLL_STATUS0x010c
-#define   ZY7_SLCR_PLL_STAT_ARM_PLL_LOCK   (1<<0)
-#define   ZY7_SLCR_PLL_STAT_DDR_PLL_LOCK   (1<<1)
-#define   ZY7_SLCR_PLL_STAT_IO_PLL_LOCK(1<<2)
-#define   ZY7_SLCR_PLL_STAT_ARM_PLL_STABLE (1<<3)
-#define   ZY7_SLCR_PLL_STAT_DDR_PLL_STABLE (1<<4)
-#define   ZY7_SLCR_PLL_STAT_IO_PLL_STABLE  (1<<5)
+#define   ZY7_SLCR_PLL_STAT_ARM_PLL_LOCK   (1 << 0)
+#define   ZY7_SLCR_PLL_STAT_DDR_PLL_LOCK   (1 << 1)
+#define   ZY7_SLCR_PLL_STAT_IO_PLL_LOCK(1 << 2)
+#define   ZY7_SLCR_PLL_STAT_ARM_PLL_STABLE (1 << 3)
+#define   ZY7_SLCR_PLL_STAT_DDR_PLL_STABLE (1 << 4)
+#define   ZY7_SLCR_PLL_STAT_IO_PLL_STABLE  (1 << 5)
 #define ZY7_SLCR_ARM_PLL_CFG   0x0110
 #define ZY7_SLCR_DDR_PLL_CFG 

svn commit: r361325 - head/sys/arm/xilinx

2020-05-21 Thread John-Mark Gurney
Author: jmg
Date: Thu May 21 06:17:54 2020
New Revision: 361325
URL: https://svnweb.freebsd.org/changeset/base/361325

Log:
  minor cleanup of white space, and function name in panic...
  
  This is a partial commit of the review.
  
  Submitted by:   Thomas Skibo
  Differential Revision:  https://reviews.freebsd.org/D23319
  Reviewed by:  andrew

Modified:
  head/sys/arm/xilinx/zy7_mp.c

Modified: head/sys/arm/xilinx/zy7_mp.c
==
--- head/sys/arm/xilinx/zy7_mp.cThu May 21 05:34:02 2020
(r361324)
+++ head/sys/arm/xilinx/zy7_mp.cThu May 21 06:17:54 2020
(r361325)
@@ -58,7 +58,7 @@ zynq7_mp_setmaxid(platform_t plat)
mp_ncpus = 2;
 }
 
-void
+void
 zynq7_mp_start_ap(platform_t plat)
 {
bus_space_handle_t scu_handle;
@@ -67,8 +67,8 @@ zynq7_mp_start_ap(platform_t plat)
 
/* Map in SCU control register. */
if (bus_space_map(fdtbus_bs_tag, SCU_CONTROL_REG, 4,
- 0, _handle) != 0)
-   panic("platform_mp_start_ap: Couldn't map SCU config reg\n");
+   0, _handle) != 0)
+   panic("%s: Could not map SCU control reg.\n", __func__);
 
/* Set SCU enable bit. */
scu_ctrl = bus_space_read_4(fdtbus_bs_tag, scu_handle, 0);
@@ -80,7 +80,7 @@ zynq7_mp_start_ap(platform_t plat)
/* Map in magic location to give entry address to CPU1. */
if (bus_space_map(fdtbus_bs_tag, ZYNQ7_CPU1_ENTRY, 4,
0, _handle) != 0)
-   panic("platform_mp_start_ap: Couldn't map OCM\n");
+   panic("%s: Could not map OCM\n", __func__);
 
/* Write start address for CPU1. */
bus_space_write_4(fdtbus_bs_tag, ocm_handle, 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"