Re: svn commit: r349893 - in head/sys: modules/tcp/rack netinet netinet/tcp_stacks sys

2019-07-10 Thread Randall Stewart via svn-src-all
John:

Thanks for the suggestions.. I have committed changes to the two
nits. As to M_PROTO1, I see that in the NF world we have removed
M_PROTO12 and moved the M_PROTO’s up 1 i.e. M_PROTO1 == 0x2000

So for now it is safe, since the M_TSTMP_LRO is not yet used.. but in
my up and coming commits I will have to address this i.e. either do
the same thing or just make it use M_PROTO12.

There are a couple of places M_PROTO1 is used on the receive path
so that would not work there :o

After I get the DSACK fixes in my next change to get BBR in will
be the LRO work…

So maybe I should just settle on using M_PROTO12 for that 
what do you think?

R

> On Jul 10, 2019, at 7:28 PM, John Baldwin  wrote:
> 
> On 7/10/19 1:40 PM, Randall Stewart wrote:
>> Author: rrs
>> Date: Wed Jul 10 20:40:39 2019
>> New Revision: 349893
>> URL: https://svnweb.freebsd.org/changeset/base/349893
>> 
>> Log:
>>  This commit updates rack to what is basically being used at NF as
>>  well as sets in some of the groundwork for committing BBR. The
>>  hpts system is updated as well as some other needed utilities
>>  for the entrance of BBR. This is actually part 1 of 3 more
>>  needed commits which will finally complete with BBRv1 being
>>  added as a new tcp stack.
>> 
>>  Sponsored by:   Netflix Inc.
>>  Differential Revision:  https://reviews.freebsd.org/D20834
> 
> Is it safe for M_TSTMP_LRO to conflict with M_PROTO1?
> 
> Also, it seems you changed the copyright range on rack.c from
> 2016-2019 to just 2016 which I suspect is an accident.
> 
> I would suggest using #error here:
> 
> #ifndef TCPHPTS
> fatal error missing option TCPHSTS in the build;
> #endif
> 
> -- 
> John Baldwin

--
Randall Stewart
r...@netflix.com



___
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: r349908 - head/sys/netinet/tcp_stacks

2019-07-10 Thread Randall Stewart
Author: rrs
Date: Thu Jul 11 04:40:58 2019
New Revision: 349908
URL: https://svnweb.freebsd.org/changeset/base/349908

Log:
  Update to jhb's other suggestion, use #error when
  we are missing  HPTS.

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

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Thu Jul 11 04:38:33 2019
(r349907)
+++ head/sys/netinet/tcp_stacks/rack.c  Thu Jul 11 04:40:58 2019
(r349908)
@@ -129,7 +129,7 @@ struct sysctl_ctx_list rack_sysctl_ctx;
 struct sysctl_oid *rack_sysctl_root;
 
 #ifndef TCPHPTS
-fatal error missing option TCPHSTS in the build;
+#error "fatal error missing option TCPHSTS in the build"
 #endif
 
 #define CUM_ACKED 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: r349907 - head/sys/netinet/tcp_stacks

2019-07-10 Thread Randall Stewart
Author: rrs
Date: Thu Jul 11 04:38:33 2019
New Revision: 349907
URL: https://svnweb.freebsd.org/changeset/base/349907

Log:
  Update copyright per JBH's suggestions.. thanks.

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

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Thu Jul 11 03:29:25 2019
(r349906)
+++ head/sys/netinet/tcp_stacks/rack.c  Thu Jul 11 04:38:33 2019
(r349907)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016
+ * Copyright (c) 2016-2019
  * Netflix Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -8537,10 +8537,10 @@ out:
 * retransmit.  In persist state, just set snd_max.
 */
if (error == 0) {
-/* if (TCPS_HAVEESTABLISHED(tp->t_state) &&
+   if (TCPS_HAVEESTABLISHED(tp->t_state) &&
(tp->t_flags & TF_SACK_PERMIT) &&
tp->rcv_numsacks > 0)
-   tcp_clean_dsack_blocks(tp);*/
+   tcp_clean_dsack_blocks(tp);
if (len == 0)
counter_u64_add(rack_out_size[TCP_MSS_ACCT_SNDACK], 1);
else if (len == 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: r349906 - head/sys/powerpc/powerpc

2019-07-10 Thread Justin Hibbits
Author: jhibbits
Date: Thu Jul 11 03:29:25 2019
New Revision: 349906
URL: https://svnweb.freebsd.org/changeset/base/349906

Log:
  powerpc: Only worry about the lower 32 bits of SP in a 32-bit process
  
  Summary:
  Running a 32-bit process on a 64-bit POWER CPU may still use all 64-bits
  in calculations, while ignoring the upper 32 bits for addressing
  storage.  It so happens that some processes end up with r1 (SP) having
  bit 31 set in some cases (33-bit address).  Writing out to this 33-bit
  address obviosly fails.  Since the CPU ignores the upper bits, we should
  as well.
  
  sendsig() and cpu_fetch_syscall_args() appear to be the only functions
  that actually rely on userspace register values for copy in/out, and
  cpu_fetch_syscall_args() doesn't seem to be bitten in practice yet.
  
  Reviewed By: luporl
  Differential Revision: https://reviews.freebsd.org/D20896

Modified:
  head/sys/powerpc/powerpc/exec_machdep.c

Modified: head/sys/powerpc/powerpc/exec_machdep.c
==
--- head/sys/powerpc/powerpc/exec_machdep.c Thu Jul 11 02:43:23 2019
(r349905)
+++ head/sys/powerpc/powerpc/exec_machdep.c Thu Jul 11 03:29:25 2019
(r349906)
@@ -144,6 +144,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
#endif
size_t sfpsize;
caddr_t sfp, usfp;
+   register_t sp;
int oonstack, rndfsize;
int sig;
int code;
@@ -155,7 +156,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
psp = p->p_sigacts;
mtx_assert(>ps_mtx, MA_OWNED);
tf = td->td_frame;
-   oonstack = sigonstack(tf->fixreg[1]);
 
/*
 * Fill siginfo structure.
@@ -173,6 +173,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
sfp = (caddr_t)
sfpsize = sizeof(sf32);
rndfsize = roundup(sizeof(sf32), 16);
+   sp = (uint32_t)tf->fixreg[1];
+   oonstack = sigonstack(sp);
 
/*
 * Save user context
@@ -203,6 +205,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
#else
rndfsize = roundup(sizeof(sf), 16);
#endif
+   sp = tf->fixreg[1];
+   oonstack = sigonstack(sp);
 
/*
 * Save user context
@@ -232,7 +236,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
usfp = (void *)(((uintptr_t)td->td_sigstk.ss_sp +
   td->td_sigstk.ss_size - rndfsize) & ~0xFul);
} else {
-   usfp = (void *)((tf->fixreg[1] - rndfsize) & ~0xFul);
+   usfp = (void *)((sp - rndfsize) & ~0xFul);
}
 
/*
___
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: r349905 - head/sys/arm64/arm64

2019-07-10 Thread Alan Cox
Author: alc
Date: Thu Jul 11 02:43:23 2019
New Revision: 349905
URL: https://svnweb.freebsd.org/changeset/base/349905

Log:
  According to Section D5.10.3 "Maintenance requirements on changing System
  register values" of the architecture manual, an isb instruction should be
  executed after updating ttbr0_el1 and before invalidating the TLB.  The
  lack of this instruction in pmap_activate() appears to be the reason why
  andrew@ and I have observed an unexpected TLB entry for an invalid PTE on
  entry to pmap_enter_quick_locked().  Thus, we should now be able to revert
  the workaround committed in r349442.
  
  Reviewed by:  markj
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D20904

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

Modified: head/sys/arm64/arm64/efirt_machdep.c
==
--- head/sys/arm64/arm64/efirt_machdep.cThu Jul 11 02:15:50 2019
(r349904)
+++ head/sys/arm64/arm64/efirt_machdep.cThu Jul 11 02:43:23 2019
(r349905)
@@ -239,6 +239,7 @@ efi_arch_enter(void)
 
__asm __volatile(
"msr ttbr0_el1, %0  \n"
+   "isb\n"
"dsb  ishst \n"
"tlbi vmalle1is \n"
"dsb  ish   \n"
@@ -266,6 +267,7 @@ efi_arch_leave(void)
td = curthread;
__asm __volatile(
"msr ttbr0_el1, %0  \n"
+   "isb\n"
"dsb  ishst \n"
"tlbi vmalle1is \n"
"dsb  ish   \n"

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Thu Jul 11 02:15:50 2019(r349904)
+++ head/sys/arm64/arm64/pmap.c Thu Jul 11 02:43:23 2019(r349905)
@@ -5484,8 +5484,10 @@ pmap_activate(struct thread *td)
critical_enter();
pmap = vmspace_pmap(td->td_proc->p_vmspace);
td->td_proc->p_md.md_l0addr = vtophys(pmap->pm_l0);
-   __asm __volatile("msr ttbr0_el1, %0" : :
-   "r"(td->td_proc->p_md.md_l0addr));
+   __asm __volatile(
+   "msr ttbr0_el1, %0  \n"
+   "isb\n"
+   : : "r"(td->td_proc->p_md.md_l0addr));
pmap_invalidate_all(pmap);
critical_exit();
 }
___
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: r349904 - head

2019-07-10 Thread Mark Johnston
Author: markj
Date: Thu Jul 11 02:15:50 2019
New Revision: 349904
URL: https://svnweb.freebsd.org/changeset/base/349904

Log:
  Add vm_page_hold.9 to ObsoleteFiles.inc.
  
  Add a missing .gz suffix to pwm.9 while here.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Jul 11 00:44:09 2019(r349903)
+++ head/ObsoleteFiles.inc  Thu Jul 11 02:15:50 2019(r349904)
@@ -38,10 +38,12 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20190708: vm_page_hold() and _unhold() removed
+OLD_FILES+=usr/share/man/man9/vm_page_hold.9.gz
 # 20190618: sys/capability.h removed (sys/capsicum.h is the one to use)
 OLD_FILES+=usr/include/sys/capability.h
 # 20190615: sys/pwm.h renamed to dev/pwmc.h and pwm(9) removed
-OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9
+OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9.gz
 # 20190612: new clang import which bumps version from 8.0.0 to 8.0.1.
 OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h
 OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Cy Schubert
In message <20190711014729.gb23...@freebsd.org>, Alexey Dokuchaev 
writes:
> On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> > New Revision: 349890
> > URL: https://svnweb.freebsd.org/changeset/base/349890
> > 
> > Log:
> >   telnet: fix a couple of snprintf() buffer overflows
> >   
> > Modified: head/contrib/telnet/telnet/commands.c
> > @@ -1655,10 +1655,11 @@ env_init(void)
> > char hbuf[256+1];
> > char *cp2 = strchr((char *)ep->value, ':');
> >  
> > -   gethostname(hbuf, 256);
> > -   hbuf[256] = '\0';
> > -   cp = (char *)malloc(strlen(hbuf) + strlen(cp2) + 1);
> > -   sprintf((char *)cp, "%s%s", hbuf, cp2);
>
> Would it make sense to add something like __attribute__ ((deprecated))
> to those unsafe functions like gets(), sprintf(), etc.?  Or it would
> cause too much PITA?

sprintf() is not deprecated (https://en.cppreference.com/w/c/io/fprintf)
. gets() is removed in C11 (https://en.cppreference.com/w/c/io/gets), 
replaced by gets_s().

We already have gets_s(). We need printf_s(), sprintf_s() and 
snprintf_s().


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
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: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Alexey Dokuchaev
On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> New Revision: 349890
> URL: https://svnweb.freebsd.org/changeset/base/349890
> 
> Log:
>   telnet: fix a couple of snprintf() buffer overflows
>   
> Modified: head/contrib/telnet/telnet/commands.c
> @@ -1655,10 +1655,11 @@ env_init(void)
>   char hbuf[256+1];
>   char *cp2 = strchr((char *)ep->value, ':');
>  
> - gethostname(hbuf, 256);
> - hbuf[256] = '\0';
> - cp = (char *)malloc(strlen(hbuf) + strlen(cp2) + 1);
> - sprintf((char *)cp, "%s%s", hbuf, cp2);

Would it make sense to add something like __attribute__ ((deprecated))
to those unsafe functions like gets(), sprintf(), etc.?  Or it would
cause too much PITA?

./danfe
___
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: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Alexey Dokuchaev
On Wed, Jul 10, 2019 at 04:45:06PM -0600, Warner Losh wrote:
> On Wed, Jul 10, 2019 at 4:43 PM Shawn Webb 
> > ...
> > Because the existing code already used malloc + snprintf. And this is
> > contrib/telnet/telnet, which arguably should be `rm -rf`ed. ;)
> >
> > The bike shed is now glow-in-the-dark neon green.
> 
> I'm not in the rm-rf telnet camp... I use it far too often to connect
> to a port with good terminal support to want to do that...

Seconded.  Having telnet(1) in the base is so fucking convenient compared
to GNU/Linux or Windoze where they've removed it from the default install.

./danfe
___
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: r349903 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-10 Thread Cy Schubert
Author: cy
Date: Thu Jul 11 00:44:09 2019
New Revision: 349903
URL: https://svnweb.freebsd.org/changeset/base/349903

Log:
  MFC 349843:
  
  Update frtuc struct comments. It not only defines TCP things we are
  interested in but also UDP.
  
  While at it document the source and destination port variables.

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:38:10 
2019(r349902)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:44:09 
2019(r349903)
@@ -600,14 +600,14 @@ typedef   struct  frpcmp  {
 
 
 /*
- * Structure containing all the relevant TCP things that can be checked in
+ * Structure containing all the relevant TCP/UDP things that can be checked in
  * a filter rule.
  */
 typedefstruct  frtuc   {
u_char  ftu_tcpfm;  /* tcp flags mask */
u_char  ftu_tcpf;   /* tcp flags */
-   frpcmp_tftu_src;
-   frpcmp_tftu_dst;
+   frpcmp_tftu_src;/* source port */
+   frpcmp_tftu_dst;/* destination port */
 } frtuc_t;
 
 #defineftu_scmpftu_src.frp_cmp
___
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: r349903 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-10 Thread Cy Schubert
Author: cy
Date: Thu Jul 11 00:44:09 2019
New Revision: 349903
URL: https://svnweb.freebsd.org/changeset/base/349903

Log:
  MFC 349843:
  
  Update frtuc struct comments. It not only defines TCP things we are
  interested in but also UDP.
  
  While at it document the source and destination port variables.

Modified:
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:38:10 
2019(r349902)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:44:09 
2019(r349903)
@@ -590,14 +590,14 @@ typedef   struct  frpcmp  {
 
 
 /*
- * Structure containing all the relevant TCP things that can be checked in
+ * Structure containing all the relevant TCP/UDP things that can be checked in
  * a filter rule.
  */
 typedefstruct  frtuc   {
u_char  ftu_tcpfm;  /* tcp flags mask */
u_char  ftu_tcpf;   /* tcp flags */
-   frpcmp_tftu_src;
-   frpcmp_tftu_dst;
+   frpcmp_tftu_src;/* source port */
+   frpcmp_tftu_dst;/* destination port */
 } frtuc_t;
 
 #defineftu_scmpftu_src.frp_cmp
___
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: r349903 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-10 Thread Cy Schubert
Author: cy
Date: Thu Jul 11 00:44:09 2019
New Revision: 349903
URL: https://svnweb.freebsd.org/changeset/base/349903

Log:
  MFC 349843:
  
  Update frtuc struct comments. It not only defines TCP things we are
  interested in but also UDP.
  
  While at it document the source and destination port variables.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:38:10 
2019(r349902)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:44:09 
2019(r349903)
@@ -590,14 +590,14 @@ typedef   struct  frpcmp  {
 
 
 /*
- * Structure containing all the relevant TCP things that can be checked in
+ * Structure containing all the relevant TCP/UDP things that can be checked in
  * a filter rule.
  */
 typedefstruct  frtuc   {
u_char  ftu_tcpfm;  /* tcp flags mask */
u_char  ftu_tcpf;   /* tcp flags */
-   frpcmp_tftu_src;
-   frpcmp_tftu_dst;
+   frpcmp_tftu_src;/* source port */
+   frpcmp_tftu_dst;/* destination port */
 } frtuc_t;
 
 #defineftu_scmpftu_src.frp_cmp
___
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: r349902 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-10 Thread Cy Schubert
Author: cy
Date: Thu Jul 11 00:38:10 2019
New Revision: 349902
URL: https://svnweb.freebsd.org/changeset/base/349902

Log:
  MFC r349842:
  
  Correct the description for the low port in the port compare struct.
  
  Adjust the high port description to match that of the low port
  description.

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:22:10 
2019(r349901)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:38:10 
2019(r349902)
@@ -594,8 +594,8 @@ typedef enum fr_ctypes_e {
  */
 typedefstruct  frpcmp  {
fr_ctypes_t frp_cmp;/* data for port comparisons */
-   u_32_t  frp_port;   /* top port for <> and >< */
-   u_32_t  frp_top;/* top port for <> and >< */
+   u_32_t  frp_port;   /* low port for <> and >< */
+   u_32_t  frp_top;/* high port for <> and >< */
 } frpcmp_t;
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349902 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-10 Thread Cy Schubert
Author: cy
Date: Thu Jul 11 00:38:10 2019
New Revision: 349902
URL: https://svnweb.freebsd.org/changeset/base/349902

Log:
  MFC r349842:
  
  Correct the description for the low port in the port compare struct.
  
  Adjust the high port description to match that of the low port
  description.

Modified:
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:22:10 
2019(r349901)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:38:10 
2019(r349902)
@@ -584,8 +584,8 @@ typedef enum fr_ctypes_e {
  */
 typedefstruct  frpcmp  {
fr_ctypes_t frp_cmp;/* data for port comparisons */
-   u_32_t  frp_port;   /* top port for <> and >< */
-   u_32_t  frp_top;/* top port for <> and >< */
+   u_32_t  frp_port;   /* low port for <> and >< */
+   u_32_t  frp_top;/* high port for <> and >< */
 } frpcmp_t;
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349902 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-10 Thread Cy Schubert
Author: cy
Date: Thu Jul 11 00:38:10 2019
New Revision: 349902
URL: https://svnweb.freebsd.org/changeset/base/349902

Log:
  MFC r349842:
  
  Correct the description for the low port in the port compare struct.
  
  Adjust the high port description to match that of the low port
  description.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:22:10 
2019(r349901)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jul 11 00:38:10 
2019(r349902)
@@ -584,8 +584,8 @@ typedef enum fr_ctypes_e {
  */
 typedefstruct  frpcmp  {
fr_ctypes_t frp_cmp;/* data for port comparisons */
-   u_32_t  frp_port;   /* top port for <> and >< */
-   u_32_t  frp_top;/* top port for <> and >< */
+   u_32_t  frp_port;   /* low port for <> and >< */
+   u_32_t  frp_top;/* high port for <> and >< */
 } frpcmp_t;
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349901 - in stable/10: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests

2019-07-10 Thread Martin Matuska
Author: mm
Date: Thu Jul 11 00:22:10 2019
New Revision: 349901
URL: https://svnweb.freebsd.org/changeset/base/349901

Log:
  MFC r349527,349538:
  Sync libarchive with vendor.
  
  Relevant vendor changes:
PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary
  (OSS-Fuzz 15431)
PR #1218: Fixes to sparse file handling

Added:
  
stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
 - copied unchanged from r349527, 
head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
Modified:
  stable/10/contrib/libarchive/libarchive/archive_read.c
  stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c
  stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
  stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c
  stable/10/lib/libarchive/tests/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/libarchive/libarchive/archive_read.c
==
--- stable/10/contrib/libarchive/libarchive/archive_read.c  Thu Jul 11 
00:21:47 2019(r349900)
+++ stable/10/contrib/libarchive/libarchive/archive_read.c  Thu Jul 11 
00:22:10 2019(r349901)
@@ -844,7 +844,8 @@ archive_read_data(struct archive *_a, void *buff, size
dest = (char *)buff;
 
while (s > 0) {
-   if (a->read_data_remaining == 0) {
+   if (a->read_data_offset == a->read_data_output_offset &&
+   a->read_data_remaining == 0) {
read_buf = a->read_data_block;
a->read_data_is_posix_read = 1;
a->read_data_requested = s;

Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c
==
--- stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c   Thu Jul 
11 00:21:47 2019(r349900)
+++ stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c   Thu Jul 
11 00:22:10 2019(r349901)
@@ -1143,6 +1143,8 @@ _archive_read_next_header2(struct archive *_a, struct 
t->entry_fd = -1;
}
 
+   archive_entry_clear(entry);
+
for (;;) {
r = next_entry(a, t, entry);
if (t->entry_fd >= 0) {

Modified: 
stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
==
--- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c  
Thu Jul 11 00:21:47 2019(r349900)
+++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c  
Thu Jul 11 00:22:10 2019(r349901)
@@ -623,9 +623,9 @@ static int run_arm_filter(struct rar5* rar, struct fil
for(i = 0; i < flt->block_length - 3; i += 4) {
uint8_t* b = >cstate.window_buf[
(rar->cstate.solid_offset +
-   flt->block_start + i) & rar->cstate.window_mask];
+   flt->block_start + i + 3) & rar->cstate.window_mask];
 
-   if(b[3] == 0xEB) {
+   if(*b == 0xEB) {
/* 0xEB = ARM's BL (branch + link) instruction. */
offset = read_filter_data(rar,
(rar->cstate.solid_offset + flt->block_start + i) &

Modified: stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c
==
--- stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c
Thu Jul 11 00:21:47 2019(r349900)
+++ stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c
Thu Jul 11 00:22:10 2019(r349901)
@@ -1215,3 +1215,18 @@ DEFINE_TEST(test_read_format_rar5_different_window_siz
 
EPILOGUE();
 }
+
+DEFINE_TEST(test_read_format_rar5_arm_filter_on_window_boundary)
+{
+   char buf[4096];
+   PROLOGUE("test_read_format_rar5_arm_filter_on_window_boundary.rar");
+
+   /* Return codes of those calls are ignored, because this sample file
+* is invalid. However, the unpacker shouldn't produce any SIGSEGV
+* errors during processing. */
+
+   (void) archive_read_next_header(a, );
+   while(0 != archive_read_data(a, buf, sizeof(buf))) {}
+
+   EPILOGUE();
+}

Copied: 
stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
 (from r349527, 
head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 

svn commit: r349900 - in stable/11: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests

2019-07-10 Thread Martin Matuska
Author: mm
Date: Thu Jul 11 00:21:47 2019
New Revision: 349900
URL: https://svnweb.freebsd.org/changeset/base/349900

Log:
  MFC r349527,349538:
  Sync libarchive with vendor.
  
  Relevant vendor changes:
PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary
  (OSS-Fuzz 15431)
PR #1218: Fixes to sparse file handling

Added:
  
stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
 - copied unchanged from r349527, 
head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
Modified:
  stable/11/contrib/libarchive/libarchive/archive_read.c
  stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c
  stable/11/lib/libarchive/tests/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/libarchive/libarchive/archive_read.c
==
--- stable/11/contrib/libarchive/libarchive/archive_read.c  Thu Jul 11 
00:21:15 2019(r349899)
+++ stable/11/contrib/libarchive/libarchive/archive_read.c  Thu Jul 11 
00:21:47 2019(r349900)
@@ -844,7 +844,8 @@ archive_read_data(struct archive *_a, void *buff, size
dest = (char *)buff;
 
while (s > 0) {
-   if (a->read_data_remaining == 0) {
+   if (a->read_data_offset == a->read_data_output_offset &&
+   a->read_data_remaining == 0) {
read_buf = a->read_data_block;
a->read_data_is_posix_read = 1;
a->read_data_requested = s;

Modified: stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c
==
--- stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c   Thu Jul 
11 00:21:15 2019(r349899)
+++ stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c   Thu Jul 
11 00:21:47 2019(r349900)
@@ -1143,6 +1143,8 @@ _archive_read_next_header2(struct archive *_a, struct 
t->entry_fd = -1;
}
 
+   archive_entry_clear(entry);
+
for (;;) {
r = next_entry(a, t, entry);
if (t->entry_fd >= 0) {

Modified: 
stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
==
--- stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c  
Thu Jul 11 00:21:15 2019(r349899)
+++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c  
Thu Jul 11 00:21:47 2019(r349900)
@@ -623,9 +623,9 @@ static int run_arm_filter(struct rar5* rar, struct fil
for(i = 0; i < flt->block_length - 3; i += 4) {
uint8_t* b = >cstate.window_buf[
(rar->cstate.solid_offset +
-   flt->block_start + i) & rar->cstate.window_mask];
+   flt->block_start + i + 3) & rar->cstate.window_mask];
 
-   if(b[3] == 0xEB) {
+   if(*b == 0xEB) {
/* 0xEB = ARM's BL (branch + link) instruction. */
offset = read_filter_data(rar,
(rar->cstate.solid_offset + flt->block_start + i) &

Modified: stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c
==
--- stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c
Thu Jul 11 00:21:15 2019(r349899)
+++ stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c
Thu Jul 11 00:21:47 2019(r349900)
@@ -1215,3 +1215,18 @@ DEFINE_TEST(test_read_format_rar5_different_window_siz
 
EPILOGUE();
 }
+
+DEFINE_TEST(test_read_format_rar5_arm_filter_on_window_boundary)
+{
+   char buf[4096];
+   PROLOGUE("test_read_format_rar5_arm_filter_on_window_boundary.rar");
+
+   /* Return codes of those calls are ignored, because this sample file
+* is invalid. However, the unpacker shouldn't produce any SIGSEGV
+* errors during processing. */
+
+   (void) archive_read_next_header(a, );
+   while(0 != archive_read_data(a, buf, sizeof(buf))) {}
+
+   EPILOGUE();
+}

Copied: 
stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
 (from r349527, 
head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 

svn commit: r349899 - in stable/12: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests

2019-07-10 Thread Martin Matuska
Author: mm
Date: Thu Jul 11 00:21:15 2019
New Revision: 349899
URL: https://svnweb.freebsd.org/changeset/base/349899

Log:
  MFC r349527,349538:
  Sync libarchive with vendor.
  
  Relevant vendor changes:
PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary
  (OSS-Fuzz 15431)
PR #1218: Fixes to sparse file handling

Added:
  
stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
 - copied unchanged from r349527, 
head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
Modified:
  stable/12/contrib/libarchive/libarchive/archive_read.c
  stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c
  stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
  stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c
  stable/12/lib/libarchive/tests/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/libarchive/libarchive/archive_read.c
==
--- stable/12/contrib/libarchive/libarchive/archive_read.c  Thu Jul 11 
00:08:46 2019(r349898)
+++ stable/12/contrib/libarchive/libarchive/archive_read.c  Thu Jul 11 
00:21:15 2019(r349899)
@@ -844,7 +844,8 @@ archive_read_data(struct archive *_a, void *buff, size
dest = (char *)buff;
 
while (s > 0) {
-   if (a->read_data_remaining == 0) {
+   if (a->read_data_offset == a->read_data_output_offset &&
+   a->read_data_remaining == 0) {
read_buf = a->read_data_block;
a->read_data_is_posix_read = 1;
a->read_data_requested = s;

Modified: stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c
==
--- stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c   Thu Jul 
11 00:08:46 2019(r349898)
+++ stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c   Thu Jul 
11 00:21:15 2019(r349899)
@@ -1143,6 +1143,8 @@ _archive_read_next_header2(struct archive *_a, struct 
t->entry_fd = -1;
}
 
+   archive_entry_clear(entry);
+
for (;;) {
r = next_entry(a, t, entry);
if (t->entry_fd >= 0) {

Modified: 
stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
==
--- stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c  
Thu Jul 11 00:08:46 2019(r349898)
+++ stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c  
Thu Jul 11 00:21:15 2019(r349899)
@@ -623,9 +623,9 @@ static int run_arm_filter(struct rar5* rar, struct fil
for(i = 0; i < flt->block_length - 3; i += 4) {
uint8_t* b = >cstate.window_buf[
(rar->cstate.solid_offset +
-   flt->block_start + i) & rar->cstate.window_mask];
+   flt->block_start + i + 3) & rar->cstate.window_mask];
 
-   if(b[3] == 0xEB) {
+   if(*b == 0xEB) {
/* 0xEB = ARM's BL (branch + link) instruction. */
offset = read_filter_data(rar,
(rar->cstate.solid_offset + flt->block_start + i) &

Modified: stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c
==
--- stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c
Thu Jul 11 00:08:46 2019(r349898)
+++ stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c
Thu Jul 11 00:21:15 2019(r349899)
@@ -1215,3 +1215,18 @@ DEFINE_TEST(test_read_format_rar5_different_window_siz
 
EPILOGUE();
 }
+
+DEFINE_TEST(test_read_format_rar5_arm_filter_on_window_boundary)
+{
+   char buf[4096];
+   PROLOGUE("test_read_format_rar5_arm_filter_on_window_boundary.rar");
+
+   /* Return codes of those calls are ignored, because this sample file
+* is invalid. However, the unpacker shouldn't produce any SIGSEGV
+* errors during processing. */
+
+   (void) archive_read_next_header(a, );
+   while(0 != archive_read_data(a, buf, sizeof(buf))) {}
+
+   EPILOGUE();
+}

Copied: 
stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
 (from r349527, 
head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 

svn commit: r349898 - head/sys/contrib/ipfilter/netinet

2019-07-10 Thread Cy Schubert
Author: cy
Date: Thu Jul 11 00:08:46 2019
New Revision: 349898
URL: https://svnweb.freebsd.org/changeset/base/349898

Log:
  ipfilter commands, in this case ipf(8), passes its operations and rules
  via an ioctl interface. Rules can be added or removed and stats and
  counters can be zeroed out. As the ipfilter interprets these
  instructions or operations they are stored in an integer called
  addrem (add/remove). 1 is add, 2 is remove, and 3 is clear stats and
  counters. Much of this is not documented. This commit documents these
  operations by replacing simple integers with a self documenting
  enum along with a few basic comments.
  
  MFC after:1 week

Modified:
  head/sys/contrib/ipfilter/netinet/fil.c

Modified: head/sys/contrib/ipfilter/netinet/fil.c
==
--- head/sys/contrib/ipfilter/netinet/fil.c Wed Jul 10 22:52:26 2019
(r349897)
+++ head/sys/contrib/ipfilter/netinet/fil.c Thu Jul 11 00:08:46 2019
(r349898)
@@ -4472,7 +4472,12 @@ frrequest(softc, unit, req, data, set, makecopy)
int set, makecopy;
caddr_t data;
 {
-   int error = 0, in, family, addrem, need_free = 0;
+   int error = 0, in, family, need_free = 0;
+   enum {  OP_UNDEF,   /* undefined */
+   OP_ADD, /* add rule */
+   OP_REM, /* remove rule */
+   OP_ZERO /* zero statistics and counters */ }
+   addrem = OP_UNDEF;
frentry_t frd, *fp, *f, **fprev, **ftail;
void *ptr, *uptr, *cptr;
u_int *p, *pp;
@@ -4540,11 +4545,11 @@ frrequest(softc, unit, req, data, set, makecopy)
 
if (req == (ioctlcmd_t)SIOCINAFR || req == (ioctlcmd_t)SIOCINIFR ||
req == (ioctlcmd_t)SIOCADAFR || req == (ioctlcmd_t)SIOCADIFR)
-   addrem = 0;
+   addrem = OP_ADD;/* Add rule */
else if (req == (ioctlcmd_t)SIOCRMAFR || req == (ioctlcmd_t)SIOCRMIFR)
-   addrem = 1;
+   addrem = OP_REM;/* Remove rule */
else if (req == (ioctlcmd_t)SIOCZRLST)
-   addrem = 2;
+   addrem = OP_ZERO;   /* Zero statistics and counters */
else {
IPFERROR(9);
error = EINVAL;
@@ -4578,7 +4583,7 @@ frrequest(softc, unit, req, data, set, makecopy)
goto donenolock;
}
 
-   if (addrem == 0) {
+   if (addrem == OP_UNDEF) {
error = ipf_funcinit(softc, fp);
if (error != 0)
goto donenolock;
@@ -4642,7 +4647,7 @@ frrequest(softc, unit, req, data, set, makecopy)
 * them to be created if they don't already exit.
 */
group = FR_NAME(fp, fr_group);
-   if (addrem == 0) {
+   if (addrem == OP_UNDEF) {
fg = ipf_group_add(softc, group, NULL,
   fp->fr_flags, unit, set);
fp->fr_grp = fg;
@@ -4947,7 +4952,7 @@ frrequest(softc, unit, req, data, set, makecopy)
/*
 * If zero'ing statistics, copy current to caller and zero.
 */
-   if (addrem == 2) {
+   if (addrem == OP_ZERO) {
if (f == NULL) {
IPFERROR(27);
error = ESRCH;
@@ -5040,7 +5045,7 @@ frrequest(softc, unit, req, data, set, makecopy)
/*
 * Request to remove a rule.
 */
-   if (addrem == 1) {
+   if (addrem == OP_REM) {
if (f == NULL) {
IPFERROR(29);
error = ESRCH;
@@ -5106,7 +5111,7 @@ frrequest(softc, unit, req, data, set, makecopy)
if (fp->fr_next != NULL)
fp->fr_next->fr_pnext = >fr_next;
*ftail = fp;
-   if (addrem == 0)
+   if (addrem == OP_UNDEF)
ipf_fixskip(ftail, fp, 1);
 
fp->fr_icmpgrp = NULL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349893 - in head/sys: modules/tcp/rack netinet netinet/tcp_stacks sys

2019-07-10 Thread John Baldwin
On 7/10/19 1:40 PM, Randall Stewart wrote:
> Author: rrs
> Date: Wed Jul 10 20:40:39 2019
> New Revision: 349893
> URL: https://svnweb.freebsd.org/changeset/base/349893
> 
> Log:
>   This commit updates rack to what is basically being used at NF as
>   well as sets in some of the groundwork for committing BBR. The
>   hpts system is updated as well as some other needed utilities
>   for the entrance of BBR. This is actually part 1 of 3 more
>   needed commits which will finally complete with BBRv1 being
>   added as a new tcp stack.
>   
>   Sponsored by:   Netflix Inc.
>   Differential Revision:  https://reviews.freebsd.org/D20834

Is it safe for M_TSTMP_LRO to conflict with M_PROTO1?

Also, it seems you changed the copyright range on rack.c from
2016-2019 to just 2016 which I suspect is an accident.

I would suggest using #error here:

#ifndef TCPHPTS
fatal error missing option TCPHSTS in the build;
#endif

-- 
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: r349897 - head/sys/arm64/arm64

2019-07-10 Thread Mark Johnston
Author: markj
Date: Wed Jul 10 22:52:26 2019
New Revision: 349897
URL: https://svnweb.freebsd.org/changeset/base/349897

Log:
  Rename pmap_page_dirty() to pmap_pte_dirty().
  
  This is a precursor to implementing dirty bit management.
  
  Discussed with:   alc
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Jul 10 22:36:14 2019(r349896)
+++ head/sys/arm64/arm64/pmap.c Wed Jul 10 22:52:26 2019(r349897)
@@ -536,7 +536,7 @@ CTASSERT(L1_BLOCK == L2_BLOCK);
  * arm64 so for now assume is a page mapped as rw was accessed it is.
  */
 static inline int
-pmap_page_dirty(pt_entry_t pte)
+pmap_pte_dirty(pt_entry_t pte)
 {
 
return ((pte & (ATTR_AF | ATTR_AP_RW_BIT)) ==
@@ -1952,7 +1952,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l
tpte = pmap_load_clear(pte);
pmap_invalidate_page(pmap, va);
m = PHYS_TO_VM_PAGE(tpte & ~ATTR_MASK);
-   if (pmap_page_dirty(tpte))
+   if (pmap_pte_dirty(tpte))
vm_page_dirty(m);
if ((tpte & ATTR_AF) != 0)
vm_page_aflag_set(m, PGA_REFERENCED);
@@ -2449,7 +2449,7 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_
eva = sva + L2_SIZE;
for (va = sva, m = PHYS_TO_VM_PAGE(old_l2 & ~ATTR_MASK);
va < eva; va += PAGE_SIZE, m++) {
-   if (pmap_page_dirty(old_l2))
+   if (pmap_pte_dirty(old_l2))
vm_page_dirty(m);
if (old_l2 & ATTR_AF)
vm_page_aflag_set(m, PGA_REFERENCED);
@@ -2494,7 +2494,7 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_
pmap_resident_count_dec(pmap, 1);
if (old_l3 & ATTR_SW_MANAGED) {
m = PHYS_TO_VM_PAGE(old_l3 & ~ATTR_MASK);
-   if (pmap_page_dirty(old_l3))
+   if (pmap_pte_dirty(old_l3))
vm_page_dirty(m);
if (old_l3 & ATTR_AF)
vm_page_aflag_set(m, PGA_REFERENCED);
@@ -2542,7 +2542,7 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_o
pmap_resident_count_dec(pmap, 1);
if ((old_l3 & ATTR_SW_MANAGED) != 0) {
m = PHYS_TO_VM_PAGE(old_l3 & ~ATTR_MASK);
-   if (pmap_page_dirty(old_l3))
+   if (pmap_pte_dirty(old_l3))
vm_page_dirty(m);
if ((old_l3 & ATTR_AF) != 0)
vm_page_aflag_set(m, PGA_REFERENCED);
@@ -2771,7 +2771,7 @@ retry:
/*
 * Update the vm_page_t clean and reference bits.
 */
-   if (pmap_page_dirty(tpte))
+   if (pmap_pte_dirty(tpte))
vm_page_dirty(m);
pmap_unuse_pt(pmap, pv->pv_va, tpde, );
TAILQ_REMOVE(>md.pv_list, pv, pv_next);
@@ -2814,7 +2814,7 @@ pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset
 */
if ((nbits & ATTR_AP(ATTR_AP_RO)) != 0 &&
(old_l2 & ATTR_SW_MANAGED) != 0 &&
-   pmap_page_dirty(old_l2)) {
+   pmap_pte_dirty(old_l2)) {
m = PHYS_TO_VM_PAGE(old_l2 & ~ATTR_MASK);
for (mt = m; mt < [L2_SIZE / PAGE_SIZE]; mt++)
vm_page_dirty(mt);
@@ -2922,7 +2922,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t
 */
if ((nbits & ATTR_AP(ATTR_AP_RO)) != 0 &&
(l3 & ATTR_SW_MANAGED) != 0 &&
-   pmap_page_dirty(l3))
+   pmap_pte_dirty(l3))
vm_page_dirty(PHYS_TO_VM_PAGE(l3 & ~ATTR_MASK));
 
pmap_set(l3p, nbits);
@@ -3279,7 +3279,7 @@ havel3:
 * concurrent calls to pmap_page_test_mappings() and
 * pmap_ts_referenced().
 */
-   if (pmap_page_dirty(orig_l3))
+   if (pmap_pte_dirty(orig_l3))
vm_page_dirty(om);
if ((orig_l3 & ATTR_AF) != 0)
vm_page_aflag_set(om, PGA_REFERENCED);
@@ -3344,7 +3344,7 @@ validate:
/* same PA, different attributes */
pmap_load_store(l3, new_l3);
pmap_invalidate_page(pmap, va);
-   if (pmap_page_dirty(orig_l3) &&
+   if 

Re: svn commit: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Warner Losh
On Wed, Jul 10, 2019 at 4:43 PM Shawn Webb 
wrote:

> On Wed, Jul 10, 2019 at 04:40:25PM -0600, Warner Losh wrote:
> > On Wed, Jul 10, 2019 at 4:29 PM Shawn Webb 
> > wrote:
> >
> > > On Wed, Jul 10, 2019 at 04:22:18PM -0400, Shawn Webb wrote:
> > > > On Wed, Jul 10, 2019 at 03:19:44PM -0500, Justin Hibbits wrote:
> > > > > On Wed, 10 Jul 2019 15:55:48 -0400
> > > > > Shawn Webb  wrote:
> > > > >
> > > > > > On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> > > > > > > Author: philip
> > > > > > > Date: Wed Jul 10 17:42:04 2019
> > > > > > > New Revision: 349890
> > > > > > > URL: https://svnweb.freebsd.org/changeset/base/349890
> > > > > > >
> > > > > > > Log:
> > > > > > >   telnet: fix a couple of snprintf() buffer overflows
> > > > > > >
> > > > > > >   Obtained from:Juniper Networks
> > > > > > >   MFC after:1 week
> > > > > > >
> > > > > > > Modified:
> > > > > > >   head/contrib/telnet/telnet/commands.c
> > > > > > >   head/contrib/telnet/telnet/telnet.c
> > > > > > >   head/contrib/telnet/telnet/utilities.c
> > > > > > >
> > > > > > > Modified: head/contrib/telnet/telnet/commands.c
> > > > > > >
> > >
> ==
> > > > > > > --- head/contrib/telnet/telnet/commands.c   Wed Jul 10
> > > > > > > 17:21:59 2019   (r349889) +++
> > > > > > > head/contrib/telnet/telnet/commands.c   Wed Jul 10 17:42:04
> > > > > > > 2019(r349890) @@ -1655,10 +1655,11 @@ env_init(void) char
> > > > > > > hbuf[256+1]; char *cp2 = strchr((char *)ep->value, ':');
> > > > > > >
> > > > > > > -   gethostname(hbuf, 256);
> > > > > > > -   hbuf[256] = '\0';
> > > > > > > -   cp = (char *)malloc(strlen(hbuf) + strlen(cp2)
> +
> > > > > > > 1);
> > > > > > > -   sprintf((char *)cp, "%s%s", hbuf, cp2);
> > > > > > > +   gethostname(hbuf, sizeof(hbuf));
> > > > > > > +   hbuf[sizeof(hbuf)-1] = '\0';
> > > > > > > +unsigned int buflen = strlen(hbuf) +
> strlen(cp2) +
> > > > > > > 1;
> > > > > >
> > > > > > buflen should be defined with the rest of the variables in the
> code
> > > > > > block above this one.
> > > > >
> > > > > Agreed.
> > > > >
> > > > > >
> > > > > > > +   cp = (char *)malloc(sizeof(char)*buflen);
> > > > > >
> > > > > > Lack of NULL check here leads to
> > > > > >
> > > > > > > +   snprintf((char *)cp, buflen, "%s%s", hbuf,
> cp2);
> > > > > >
> > > > > > potential NULL pointer deref here.
> > > > >
> > > > > I'm not sure if this is actually a problem.  env_init() is called
> > > > > exactly once, at the beginning of main(), and the environment size
> is
> > > > > fully constrained by the OS.
> > > > >
> > > > > That said, this file it the only one in this component that does
> not
> > > > > check the return value of malloc().  All other uses, outside of
> this
> > > > > file, check and error.
> > > >
> > > > While fixing the style(9) violation above, we could still take care
> of
> > > > the potential NULL deref at the same time. If anything, just for code
> > > > correctness reasons?
> > >
> > > Here's a patch:
> > >
> > > https://gist.github.com/579685c0252673c3ad92d2536c3486c7
> >
> >
> > Any reason to not use asprintf instead of malloc + snprintf?
>
> Because the existing code already used malloc + snprintf. And this is
> contrib/telnet/telnet, which arguably should be `rm -rf`ed. ;)
>
> The bike shed is now glow-in-the-dark neon green.
>

I'm not in the rm-rf telnet camp... I use it far too often to connect to a
port with good terminal support to want to do that...

Warner
___
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: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Shawn Webb
On Wed, Jul 10, 2019 at 04:40:25PM -0600, Warner Losh wrote:
> On Wed, Jul 10, 2019 at 4:29 PM Shawn Webb 
> wrote:
> 
> > On Wed, Jul 10, 2019 at 04:22:18PM -0400, Shawn Webb wrote:
> > > On Wed, Jul 10, 2019 at 03:19:44PM -0500, Justin Hibbits wrote:
> > > > On Wed, 10 Jul 2019 15:55:48 -0400
> > > > Shawn Webb  wrote:
> > > >
> > > > > On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> > > > > > Author: philip
> > > > > > Date: Wed Jul 10 17:42:04 2019
> > > > > > New Revision: 349890
> > > > > > URL: https://svnweb.freebsd.org/changeset/base/349890
> > > > > >
> > > > > > Log:
> > > > > >   telnet: fix a couple of snprintf() buffer overflows
> > > > > >
> > > > > >   Obtained from:Juniper Networks
> > > > > >   MFC after:1 week
> > > > > >
> > > > > > Modified:
> > > > > >   head/contrib/telnet/telnet/commands.c
> > > > > >   head/contrib/telnet/telnet/telnet.c
> > > > > >   head/contrib/telnet/telnet/utilities.c
> > > > > >
> > > > > > Modified: head/contrib/telnet/telnet/commands.c
> > > > > >
> > ==
> > > > > > --- head/contrib/telnet/telnet/commands.c   Wed Jul 10
> > > > > > 17:21:59 2019   (r349889) +++
> > > > > > head/contrib/telnet/telnet/commands.c   Wed Jul 10 17:42:04
> > > > > > 2019(r349890) @@ -1655,10 +1655,11 @@ env_init(void) char
> > > > > > hbuf[256+1]; char *cp2 = strchr((char *)ep->value, ':');
> > > > > >
> > > > > > -   gethostname(hbuf, 256);
> > > > > > -   hbuf[256] = '\0';
> > > > > > -   cp = (char *)malloc(strlen(hbuf) + strlen(cp2) +
> > > > > > 1);
> > > > > > -   sprintf((char *)cp, "%s%s", hbuf, cp2);
> > > > > > +   gethostname(hbuf, sizeof(hbuf));
> > > > > > +   hbuf[sizeof(hbuf)-1] = '\0';
> > > > > > +unsigned int buflen = strlen(hbuf) + strlen(cp2) +
> > > > > > 1;
> > > > >
> > > > > buflen should be defined with the rest of the variables in the code
> > > > > block above this one.
> > > >
> > > > Agreed.
> > > >
> > > > >
> > > > > > +   cp = (char *)malloc(sizeof(char)*buflen);
> > > > >
> > > > > Lack of NULL check here leads to
> > > > >
> > > > > > +   snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);
> > > > >
> > > > > potential NULL pointer deref here.
> > > >
> > > > I'm not sure if this is actually a problem.  env_init() is called
> > > > exactly once, at the beginning of main(), and the environment size is
> > > > fully constrained by the OS.
> > > >
> > > > That said, this file it the only one in this component that does not
> > > > check the return value of malloc().  All other uses, outside of this
> > > > file, check and error.
> > >
> > > While fixing the style(9) violation above, we could still take care of
> > > the potential NULL deref at the same time. If anything, just for code
> > > correctness reasons?
> >
> > Here's a patch:
> >
> > https://gist.github.com/579685c0252673c3ad92d2536c3486c7
> 
> 
> Any reason to not use asprintf instead of malloc + snprintf?

Because the existing code already used malloc + snprintf. And this is
contrib/telnet/telnet, which arguably should be `rm -rf`ed. ;)

The bike shed is now glow-in-the-dark neon green.

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2


signature.asc
Description: PGP signature


Re: svn commit: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Warner Losh
On Wed, Jul 10, 2019 at 4:29 PM Shawn Webb 
wrote:

> On Wed, Jul 10, 2019 at 04:22:18PM -0400, Shawn Webb wrote:
> > On Wed, Jul 10, 2019 at 03:19:44PM -0500, Justin Hibbits wrote:
> > > On Wed, 10 Jul 2019 15:55:48 -0400
> > > Shawn Webb  wrote:
> > >
> > > > On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> > > > > Author: philip
> > > > > Date: Wed Jul 10 17:42:04 2019
> > > > > New Revision: 349890
> > > > > URL: https://svnweb.freebsd.org/changeset/base/349890
> > > > >
> > > > > Log:
> > > > >   telnet: fix a couple of snprintf() buffer overflows
> > > > >
> > > > >   Obtained from:Juniper Networks
> > > > >   MFC after:1 week
> > > > >
> > > > > Modified:
> > > > >   head/contrib/telnet/telnet/commands.c
> > > > >   head/contrib/telnet/telnet/telnet.c
> > > > >   head/contrib/telnet/telnet/utilities.c
> > > > >
> > > > > Modified: head/contrib/telnet/telnet/commands.c
> > > > >
> ==
> > > > > --- head/contrib/telnet/telnet/commands.c   Wed Jul 10
> > > > > 17:21:59 2019   (r349889) +++
> > > > > head/contrib/telnet/telnet/commands.c   Wed Jul 10 17:42:04
> > > > > 2019(r349890) @@ -1655,10 +1655,11 @@ env_init(void) char
> > > > > hbuf[256+1]; char *cp2 = strchr((char *)ep->value, ':');
> > > > >
> > > > > -   gethostname(hbuf, 256);
> > > > > -   hbuf[256] = '\0';
> > > > > -   cp = (char *)malloc(strlen(hbuf) + strlen(cp2) +
> > > > > 1);
> > > > > -   sprintf((char *)cp, "%s%s", hbuf, cp2);
> > > > > +   gethostname(hbuf, sizeof(hbuf));
> > > > > +   hbuf[sizeof(hbuf)-1] = '\0';
> > > > > +unsigned int buflen = strlen(hbuf) + strlen(cp2) +
> > > > > 1;
> > > >
> > > > buflen should be defined with the rest of the variables in the code
> > > > block above this one.
> > >
> > > Agreed.
> > >
> > > >
> > > > > +   cp = (char *)malloc(sizeof(char)*buflen);
> > > >
> > > > Lack of NULL check here leads to
> > > >
> > > > > +   snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);
> > > >
> > > > potential NULL pointer deref here.
> > >
> > > I'm not sure if this is actually a problem.  env_init() is called
> > > exactly once, at the beginning of main(), and the environment size is
> > > fully constrained by the OS.
> > >
> > > That said, this file it the only one in this component that does not
> > > check the return value of malloc().  All other uses, outside of this
> > > file, check and error.
> >
> > While fixing the style(9) violation above, we could still take care of
> > the potential NULL deref at the same time. If anything, just for code
> > correctness reasons?
>
> Here's a patch:
>
> https://gist.github.com/579685c0252673c3ad92d2536c3486c7


Any reason to not use asprintf instead of malloc + snprintf?

Warner
___
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: r349896 - head/contrib/telnet/telnet

2019-07-10 Thread Philip Paeps
Author: philip
Date: Wed Jul 10 22:36:14 2019
New Revision: 349896
URL: https://svnweb.freebsd.org/changeset/base/349896

Log:
  telnet: fix minor style violation
  
  While here also fix a very unlikely NULL pointer dereference.
  
  Submitted by: Shawn Webb 

Modified:
  head/contrib/telnet/telnet/commands.c

Modified: head/contrib/telnet/telnet/commands.c
==
--- head/contrib/telnet/telnet/commands.c   Wed Jul 10 22:23:59 2019
(r349895)
+++ head/contrib/telnet/telnet/commands.c   Wed Jul 10 22:36:14 2019
(r349896)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1654,11 +1655,13 @@ env_init(void)
|| (strncmp((char *)ep->value, "unix:", 5) == 0))) {
char hbuf[256+1];
char *cp2 = strchr((char *)ep->value, ':');
+size_t buflen;
 
gethostname(hbuf, sizeof(hbuf));
hbuf[sizeof(hbuf)-1] = '\0';
-unsigned int buflen = strlen(hbuf) + strlen(cp2) + 1;
+   buflen = strlen(hbuf) + strlen(cp2) + 1;
cp = (char *)malloc(sizeof(char)*buflen);
+   assert(cp != NULL);
snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);
free(ep->value);
ep->value = (unsigned char *)cp;
___
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: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Shawn Webb
On Wed, Jul 10, 2019 at 04:22:18PM -0400, Shawn Webb wrote:
> On Wed, Jul 10, 2019 at 03:19:44PM -0500, Justin Hibbits wrote:
> > On Wed, 10 Jul 2019 15:55:48 -0400
> > Shawn Webb  wrote:
> > 
> > > On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> > > > Author: philip
> > > > Date: Wed Jul 10 17:42:04 2019
> > > > New Revision: 349890
> > > > URL: https://svnweb.freebsd.org/changeset/base/349890
> > > > 
> > > > Log:
> > > >   telnet: fix a couple of snprintf() buffer overflows
> > > >   
> > > >   Obtained from:Juniper Networks
> > > >   MFC after:1 week
> > > > 
> > > > Modified:
> > > >   head/contrib/telnet/telnet/commands.c
> > > >   head/contrib/telnet/telnet/telnet.c
> > > >   head/contrib/telnet/telnet/utilities.c
> > > > 
> > > > Modified: head/contrib/telnet/telnet/commands.c
> > > > ==
> > > > --- head/contrib/telnet/telnet/commands.c   Wed Jul 10
> > > > 17:21:59 2019   (r349889) +++
> > > > head/contrib/telnet/telnet/commands.c   Wed Jul 10 17:42:04
> > > > 2019(r349890) @@ -1655,10 +1655,11 @@ env_init(void) char
> > > > hbuf[256+1]; char *cp2 = strchr((char *)ep->value, ':');
> > > >  
> > > > -   gethostname(hbuf, 256);
> > > > -   hbuf[256] = '\0';
> > > > -   cp = (char *)malloc(strlen(hbuf) + strlen(cp2) +
> > > > 1);
> > > > -   sprintf((char *)cp, "%s%s", hbuf, cp2);
> > > > +   gethostname(hbuf, sizeof(hbuf));
> > > > +   hbuf[sizeof(hbuf)-1] = '\0';
> > > > +unsigned int buflen = strlen(hbuf) + strlen(cp2) +
> > > > 1;  
> > > 
> > > buflen should be defined with the rest of the variables in the code
> > > block above this one.
> > 
> > Agreed.
> > 
> > > 
> > > > +   cp = (char *)malloc(sizeof(char)*buflen);  
> > > 
> > > Lack of NULL check here leads to
> > > 
> > > > +   snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);  
> > > 
> > > potential NULL pointer deref here.
> > 
> > I'm not sure if this is actually a problem.  env_init() is called
> > exactly once, at the beginning of main(), and the environment size is
> > fully constrained by the OS.
> > 
> > That said, this file it the only one in this component that does not
> > check the return value of malloc().  All other uses, outside of this
> > file, check and error.
> 
> While fixing the style(9) violation above, we could still take care of
> the potential NULL deref at the same time. If anything, just for code
> correctness reasons?

Here's a patch:

https://gist.github.com/579685c0252673c3ad92d2536c3486c7

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2


signature.asc
Description: PGP signature


svn commit: r349895 - head/sys/dev/isci

2019-07-10 Thread Warner Losh
Author: imp
Date: Wed Jul 10 22:23:59 2019
New Revision: 349895
URL: https://svnweb.freebsd.org/changeset/base/349895

Log:
  Enforce a 4GB DMA boundary on isci(4)
  
  This device cannot cross a 4GB boundary with DMA.  Removing the
  boundary in r346386 resulted in low frequency memory corruption on
  machines with isci(4) controllers.
  
  Submitted by: gallatin@
  Sponsored by: Netflix
  Differential Revision: https://reviews.freebsd.org/D20910

Modified:
  head/sys/dev/isci/isci.c
  head/sys/dev/isci/isci.h
  head/sys/dev/isci/isci_controller.c

Modified: head/sys/dev/isci/isci.c
==
--- head/sys/dev/isci/isci.cWed Jul 10 21:35:55 2019(r349894)
+++ head/sys/dev/isci/isci.cWed Jul 10 22:23:59 2019(r349895)
@@ -414,7 +414,8 @@ isci_allocate_dma_buffer(device_t device, struct ISCI_
uint32_t status;
 
status = bus_dma_tag_create(bus_get_dma_tag(device),
-   0x40 /* cacheline alignment */, 0x0, BUS_SPACE_MAXADDR,
+   0x40 /* cacheline alignment */,
+   ISCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR,
BUS_SPACE_MAXADDR, NULL, NULL, memory->size,
0x1 /* we want physically contiguous */,
memory->size, 0, busdma_lock_mutex, >lock,

Modified: head/sys/dev/isci/isci.h
==
--- head/sys/dev/isci/isci.hWed Jul 10 21:35:55 2019(r349894)
+++ head/sys/dev/isci/isci.hWed Jul 10 22:23:59 2019(r349895)
@@ -75,6 +75,9 @@
 #define ISCI_NUM_PCI_BARS  2
 #define ISCI_MAX_LUN8
 
+/* This device cannot DMA across a 4GB boundary */
+#defineISCI_DMA_BOUNDARY   ((bus_addr_t)((uint64_t)1 << 
32))
+
 MALLOC_DECLARE(M_ISCI);
 
 struct ISCI_TIMER {

Modified: head/sys/dev/isci/isci_controller.c
==
--- head/sys/dev/isci/isci_controller.c Wed Jul 10 21:35:55 2019
(r349894)
+++ head/sys/dev/isci/isci_controller.c Wed Jul 10 22:23:59 2019
(r349895)
@@ -477,9 +477,9 @@ int isci_controller_allocate_memory(struct ISCI_CONTRO
 *  will enable better performance than creating the DMA maps every 
time we get
 *  an I/O.
 */
-   status = bus_dma_tag_create(bus_get_dma_tag(device), 0x1, 0x0,
-   BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
-   isci_io_request_get_max_io_size(),
+   status = bus_dma_tag_create(bus_get_dma_tag(device), 0x1,
+   ISCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
+   NULL, NULL, isci_io_request_get_max_io_size(),
SCI_MAX_SCATTER_GATHER_ELEMENTS, max_segment_size, 0,
busdma_lock_mutex, >lock,
>buffer_dma_tag);
___
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: r349894 - in stable/12/lib/libsecureboot: . h openpgp

2019-07-10 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jul 10 21:35:55 2019
New Revision: 349894
URL: https://svnweb.freebsd.org/changeset/base/349894

Log:
  libsecureboot: allow OpenPGP support to be dormant
  
  Since we can now add OpenPGP trust anchors at runtime,
  ensure the latent support is available.
  
  Ensure we do not add duplicate keys to trust store.
  
  Also allow reporting names of trust anchors added/revoked
  
  We only do this for loader and only after initializing trust store.
  Thus only changes to initial trust store will be logged.
  
  MFC of r349446
  
  Reviewed by:stevek
  Differential Revision:  https://reviews.freebsd.org/D20700

Modified:
  stable/12/lib/libsecureboot/h/libsecureboot.h
  stable/12/lib/libsecureboot/libsecureboot-priv.h
  stable/12/lib/libsecureboot/local.trust.mk
  stable/12/lib/libsecureboot/openpgp/opgp_key.c
  stable/12/lib/libsecureboot/readfile.c
  stable/12/lib/libsecureboot/verify_file.c
  stable/12/lib/libsecureboot/vets.c

Modified: stable/12/lib/libsecureboot/h/libsecureboot.h
==
--- stable/12/lib/libsecureboot/h/libsecureboot.h   Wed Jul 10 20:40:39 
2019(r349893)
+++ stable/12/lib/libsecureboot/h/libsecureboot.h   Wed Jul 10 21:35:55 
2019(r349894)
@@ -42,6 +42,7 @@
 
 #include 
 
+unsigned char * read_fd(int, size_t);
 #ifndef NEED_BRSSL_H
 unsigned char * read_file(const char *, size_t *);
 #endif
@@ -51,8 +52,12 @@ extern int DebugVe;
 #define DEBUG_PRINTF(n, x) if (DebugVe >= n) printf x
 
 int ve_trust_init(void);
+size_t ve_trust_anchors_add_buf(unsigned char *, size_t);
+size_t ve_trust_anchors_revoke(unsigned char *, size_t);
 int ve_trust_add(const char *);
 void ve_debug_set(int);
+void ve_anchor_verbose_set(int);
+int ve_anchor_verbose_get(void);
 void ve_utc_set(time_t utc);
 char *ve_error_get(void);
 int ve_error_set(const char *, ...) __printflike(1,2);

Modified: stable/12/lib/libsecureboot/libsecureboot-priv.h
==
--- stable/12/lib/libsecureboot/libsecureboot-priv.hWed Jul 10 20:40:39 
2019(r349893)
+++ stable/12/lib/libsecureboot/libsecureboot-priv.hWed Jul 10 21:35:55 
2019(r349894)
@@ -56,6 +56,8 @@ int is_verified(struct stat *stp);
 void add_verify_status(struct stat *stp, int status);
 
 int openpgp_trust_init(void);
+int openpgp_trust_add_buf(unsigned char *, size_t);
+int openpgp_trust_revoke(const char *);
 int openpgp_self_tests(void);
 
 int efi_secure_boot_enabled(void);

Modified: stable/12/lib/libsecureboot/local.trust.mk
==
--- stable/12/lib/libsecureboot/local.trust.mk  Wed Jul 10 20:40:39 2019
(r349893)
+++ stable/12/lib/libsecureboot/local.trust.mk  Wed Jul 10 21:35:55 2019
(r349894)
@@ -33,6 +33,10 @@ VE_SIGNATURE_EXT_LIST+= \
sig
 .endif
 
+# add OpenPGP support - possibly dormant
+VE_SIGNATURE_LIST+= OPENPGP
+VE_SIGNATURE_EXT_LIST+= asc
+
 SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py
 
 .if exists(${SIGNER})
@@ -42,7 +46,12 @@ SIGN_ECDSA= ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${ECDS
 RSA2_PORT:= ${163%y:L:gmtime}
 SIGN_RSA2=   ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${RSA2_PORT} -h sha256
 
+# deal with quirk of our .esig format
+XCFLAGS.vets+= -DVE_ECDSA_HASH_AGAIN
+
 .if !empty(OPENPGP_SIGN_URL)
+XCFLAGS.opgp_key+= -DHAVE_TA_ASC_H
+
 VE_SIGNATURE_LIST+= OPENPGP
 VE_SIGNATURE_EXT_LIST+= asc
 

Modified: stable/12/lib/libsecureboot/openpgp/opgp_key.c
==
--- stable/12/lib/libsecureboot/openpgp/opgp_key.c  Wed Jul 10 20:40:39 
2019(r349893)
+++ stable/12/lib/libsecureboot/openpgp/opgp_key.c  Wed Jul 10 21:35:55 
2019(r349894)
@@ -209,13 +209,54 @@ openpgp_trust_add(OpenPGP_key *key)
 
LIST_INIT(_list);
}
-   if (key) {
-   DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id));
+   if (key && openpgp_trust_get(key->id) == NULL) {
+   if (ve_anchor_verbose_get())
+   printf("openpgp_trust_add(%s)\n", key->id);
LIST_INSERT_HEAD(_list, key, entries);
}
 }
 
 /**
+ * @brief add trust anchor from buf
+ */
+int
+openpgp_trust_add_buf(unsigned char *buf, size_t nbytes)
+{
+   OpenPGP_key *key;
+
+   if ((key = load_key_buf(buf, nbytes))) {
+   openpgp_trust_add(key);
+   }
+   return (key != NULL);
+}
+
+
+/**
+ * @brief if keyID is in our list clobber it
+ *
+ * @return true if keyID removed
+ */
+int
+openpgp_trust_revoke(const char *keyID)
+{
+   OpenPGP_key *key, *tkey;
+
+   openpgp_trust_add(NULL);/* initialize if needed */
+
+   LIST_FOREACH(key, _list, entries) {
+   if (strcmp(key->id, keyID) == 0) {
+   tkey = key;
+   

svn commit: r349893 - in head/sys: modules/tcp/rack netinet netinet/tcp_stacks sys

2019-07-10 Thread Randall Stewart
Author: rrs
Date: Wed Jul 10 20:40:39 2019
New Revision: 349893
URL: https://svnweb.freebsd.org/changeset/base/349893

Log:
  This commit updates rack to what is basically being used at NF as
  well as sets in some of the groundwork for committing BBR. The
  hpts system is updated as well as some other needed utilities
  for the entrance of BBR. This is actually part 1 of 3 more
  needed commits which will finally complete with BBRv1 being
  added as a new tcp stack.
  
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D20834

Added:
  head/sys/netinet/tcp_stacks/rack_bbr_common.c   (contents, props changed)
Modified:
  head/sys/modules/tcp/rack/Makefile
  head/sys/netinet/in_pcb.h
  head/sys/netinet/tcp.h
  head/sys/netinet/tcp_hpts.c
  head/sys/netinet/tcp_hpts.h
  head/sys/netinet/tcp_log_buf.h
  head/sys/netinet/tcp_stacks/rack.c
  head/sys/netinet/tcp_stacks/rack_bbr_common.h
  head/sys/netinet/tcp_var.h
  head/sys/sys/mbuf.h

Modified: head/sys/modules/tcp/rack/Makefile
==
--- head/sys/modules/tcp/rack/Makefile  Wed Jul 10 19:57:48 2019
(r349892)
+++ head/sys/modules/tcp/rack/Makefile  Wed Jul 10 20:40:39 2019
(r349893)
@@ -6,7 +6,7 @@
 
 STACKNAME= rack
 KMOD=  tcp_${STACKNAME}
-SRCS=  rack.c sack_filter.c
+SRCS=  rack.c sack_filter.c rack_bbr_common.c
 
 SRCS+= opt_inet.h opt_inet6.h opt_ipsec.h
 SRCS+= opt_tcpdebug.h

Modified: head/sys/netinet/in_pcb.h
==
--- head/sys/netinet/in_pcb.h   Wed Jul 10 19:57:48 2019(r349892)
+++ head/sys/netinet/in_pcb.h   Wed Jul 10 20:40:39 2019(r349893)
@@ -759,7 +759,9 @@ int inp_so_options(const struct inpcb *inp);
 #defineINP_ORIGDSTADDR 0x0800 /* receive IP dst 
address/port */
 #define INP_CANNOT_DO_ECN  0x1000 /* The stack does not do ECN */
 #defineINP_REUSEPORT_LB0x2000 /* SO_REUSEPORT_LB option is 
set */
-
+#define INP_SUPPORTS_MBUFQ 0x4000 /* Supports the mbuf queue method of 
LRO */
+#define INP_MBUF_QUEUE_READY   0x8000 /* The transport is pacing, inputs 
can be queued */
+#define INP_DONT_SACK_QUEUE0x0001 /* If a sack arrives do not wake me 
*/
 /*
  * Flags passed to in_pcblookup*() functions.
  */

Modified: head/sys/netinet/tcp.h
==
--- head/sys/netinet/tcp.h  Wed Jul 10 19:57:48 2019(r349892)
+++ head/sys/netinet/tcp.h  Wed Jul 10 20:40:39 2019(r349893)
@@ -201,9 +201,8 @@ struct tcphdr {
 #define TCP_RACK_TLP_THRESH   1063 /* RACK TLP theshold i.e. srtt+(srtt/N) */
 #define TCP_RACK_PKT_DELAY1064 /* RACK added ms i.e. rack-rtt + reord + N 
*/
 #define TCP_RACK_TLP_INC_VAR  1065 /* Does TLP include rtt variance in t-o */
-#define TCP_RACK_SESS_CWV 1066 /* Enable RFC7611 cwnd validation on sess */
 #define TCP_BBR_IWINTSO  1067 /* Initial TSO window for BBRs first 
sends */
-#define TCP_BBR_RECFORCE  1068 /* Enter recovery force out a segment 
disregard pacer */
+#define TCP_BBR_RECFORCE  1068 /* Enter recovery force out a segment 
disregard pacer no longer valid */
 #define TCP_BBR_STARTUP_PG1069 /* Startup pacing gain */
 #define TCP_BBR_DRAIN_PG  1070 /* Drain pacing gain */
 #define TCP_BBR_RWND_IS_APP   1071 /* Rwnd limited is considered app limited */
@@ -211,14 +210,18 @@ struct tcphdr {
 #define TCP_BBR_ONE_RETRAN1073 /* Is only one segment allowed out during 
retran */
 #define TCP_BBR_STARTUP_LOSS_EXIT 1074 /* Do we exit a loss during startup if 
not 20% incr */
 #define TCP_BBR_USE_LOWGAIN   1075 /* lower the gain in PROBE_BW enable */
-#define TCP_BBR_LOWGAIN_THRESH 1076 /* How many cycles do we stay in lowgain */
-#define TCP_BBR_LOWGAIN_HALF  1077 /* Do we halfstep lowgain down */
-#define TCP_BBR_LOWGAIN_FD1078 /* Do we force a drain when lowgain in 
place */
+#define TCP_BBR_LOWGAIN_THRESH 1076 /* Unused after 2.3 morphs to TSLIMITS >= 
2.3 */
+#define TCP_BBR_TSLIMITS 1076 /* Do we use experimental Timestamp limiting 
for our algo */
+#define TCP_BBR_LOWGAIN_HALF  1077 /* Unused after 2.3 */
+#define TCP_BBR_PACE_OH1077 /* Reused in 4.2 for pacing overhead 
setting */
+#define TCP_BBR_LOWGAIN_FD1078 /* Unused after 2.3 */
+#define TCP_BBR_HOLD_TARGET 1078   /* For 4.3 on */
 #define TCP_BBR_USEDEL_RATE   1079 /* Enable use of delivery rate for loss 
recovery */
 #define TCP_BBR_MIN_RTO   1080 /* Min RTO in milliseconds */
 #define TCP_BBR_MAX_RTO  1081 /* Max RTO in milliseconds */
 #define TCP_BBR_REC_OVER_HPTS 1082 /* Recovery override htps settings 0/1/3 */
-#define TCP_BBR_UNLIMITED 1083 /* Does BBR, in non-recovery not use cwnd */
+#define TCP_BBR_UNLIMITED 1083 /* Not used before 2.3 and morphs to 
algorithm >= 2.3 */
+#define TCP_BBR_ALGORITHM 

Re: svn commit: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Shawn Webb
On Wed, Jul 10, 2019 at 03:19:44PM -0500, Justin Hibbits wrote:
> On Wed, 10 Jul 2019 15:55:48 -0400
> Shawn Webb  wrote:
> 
> > On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> > > Author: philip
> > > Date: Wed Jul 10 17:42:04 2019
> > > New Revision: 349890
> > > URL: https://svnweb.freebsd.org/changeset/base/349890
> > > 
> > > Log:
> > >   telnet: fix a couple of snprintf() buffer overflows
> > >   
> > >   Obtained from:  Juniper Networks
> > >   MFC after:  1 week
> > > 
> > > Modified:
> > >   head/contrib/telnet/telnet/commands.c
> > >   head/contrib/telnet/telnet/telnet.c
> > >   head/contrib/telnet/telnet/utilities.c
> > > 
> > > Modified: head/contrib/telnet/telnet/commands.c
> > > ==
> > > --- head/contrib/telnet/telnet/commands.c Wed Jul 10
> > > 17:21:59 2019 (r349889) +++
> > > head/contrib/telnet/telnet/commands.c Wed Jul 10 17:42:04
> > > 2019  (r349890) @@ -1655,10 +1655,11 @@ env_init(void) char
> > > hbuf[256+1]; char *cp2 = strchr((char *)ep->value, ':');
> > >  
> > > - gethostname(hbuf, 256);
> > > - hbuf[256] = '\0';
> > > - cp = (char *)malloc(strlen(hbuf) + strlen(cp2) +
> > > 1);
> > > - sprintf((char *)cp, "%s%s", hbuf, cp2);
> > > + gethostname(hbuf, sizeof(hbuf));
> > > + hbuf[sizeof(hbuf)-1] = '\0';
> > > +unsigned int buflen = strlen(hbuf) + strlen(cp2) +
> > > 1;  
> > 
> > buflen should be defined with the rest of the variables in the code
> > block above this one.
> 
> Agreed.
> 
> > 
> > > + cp = (char *)malloc(sizeof(char)*buflen);  
> > 
> > Lack of NULL check here leads to
> > 
> > > + snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);  
> > 
> > potential NULL pointer deref here.
> 
> I'm not sure if this is actually a problem.  env_init() is called
> exactly once, at the beginning of main(), and the environment size is
> fully constrained by the OS.
> 
> That said, this file it the only one in this component that does not
> check the return value of malloc().  All other uses, outside of this
> file, check and error.

While fixing the style(9) violation above, we could still take care of
the potential NULL deref at the same time. If anything, just for code
correctness reasons?

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2


signature.asc
Description: PGP signature


Re: svn commit: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Justin Hibbits
On Wed, 10 Jul 2019 15:55:48 -0400
Shawn Webb  wrote:

> On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> > Author: philip
> > Date: Wed Jul 10 17:42:04 2019
> > New Revision: 349890
> > URL: https://svnweb.freebsd.org/changeset/base/349890
> > 
> > Log:
> >   telnet: fix a couple of snprintf() buffer overflows
> >   
> >   Obtained from:Juniper Networks
> >   MFC after:1 week
> > 
> > Modified:
> >   head/contrib/telnet/telnet/commands.c
> >   head/contrib/telnet/telnet/telnet.c
> >   head/contrib/telnet/telnet/utilities.c
> > 
> > Modified: head/contrib/telnet/telnet/commands.c
> > ==
> > --- head/contrib/telnet/telnet/commands.c   Wed Jul 10
> > 17:21:59 2019   (r349889) +++
> > head/contrib/telnet/telnet/commands.c   Wed Jul 10 17:42:04
> > 2019(r349890) @@ -1655,10 +1655,11 @@ env_init(void) char
> > hbuf[256+1]; char *cp2 = strchr((char *)ep->value, ':');
> >  
> > -   gethostname(hbuf, 256);
> > -   hbuf[256] = '\0';
> > -   cp = (char *)malloc(strlen(hbuf) + strlen(cp2) +
> > 1);
> > -   sprintf((char *)cp, "%s%s", hbuf, cp2);
> > +   gethostname(hbuf, sizeof(hbuf));
> > +   hbuf[sizeof(hbuf)-1] = '\0';
> > +unsigned int buflen = strlen(hbuf) + strlen(cp2) +
> > 1;  
> 
> buflen should be defined with the rest of the variables in the code
> block above this one.

Agreed.

> 
> > +   cp = (char *)malloc(sizeof(char)*buflen);  
> 
> Lack of NULL check here leads to
> 
> > +   snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);  
> 
> potential NULL pointer deref here.

I'm not sure if this is actually a problem.  env_init() is called
exactly once, at the beginning of main(), and the environment size is
fully constrained by the OS.

That said, this file it the only one in this component that does not
check the return value of malloc().  All other uses, outside of this
file, check and error.

> 
> Thanks,
> 

- Justin
___
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: r349892 - head/sys/kern

2019-07-10 Thread Mark Johnston
Author: markj
Date: Wed Jul 10 19:57:48 2019
New Revision: 349892
URL: https://svnweb.freebsd.org/changeset/base/349892

Log:
  Inherit P2_PROTMAX_{ENABLE,DISABLE} across fork().
  
  Thus, when using proccontrol(1) to disable implicit application of
  PROT_MAX within a process, child processes will inherit this setting.
  
  Discussed with:   kib
  MFC with: r349609
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_fork.c

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Wed Jul 10 19:32:50 2019(r349891)
+++ head/sys/kern/kern_fork.c   Wed Jul 10 19:57:48 2019(r349892)
@@ -465,7 +465,8 @@ do_fork(struct thread *td, struct fork_req *fr, struct
 */
p2->p_flag = P_INMEM;
p2->p_flag2 = p1->p_flag2 & (P2_ASLR_DISABLE | P2_ASLR_ENABLE |
-   P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC | P2_TRAPCAP);
+   P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC |
+   P2_PROTMAX_ENABLE | P2_PROTMAX_DISABLE | P2_TRAPCAP);
p2->p_swtick = ticks;
if (p1->p_flag & P_PROFIL)
startprofclock(p2);
___
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: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Shawn Webb
On Wed, Jul 10, 2019 at 05:42:04PM +, Philip Paeps wrote:
> Author: philip
> Date: Wed Jul 10 17:42:04 2019
> New Revision: 349890
> URL: https://svnweb.freebsd.org/changeset/base/349890
> 
> Log:
>   telnet: fix a couple of snprintf() buffer overflows
>   
>   Obtained from:  Juniper Networks
>   MFC after:  1 week
> 
> Modified:
>   head/contrib/telnet/telnet/commands.c
>   head/contrib/telnet/telnet/telnet.c
>   head/contrib/telnet/telnet/utilities.c
> 
> Modified: head/contrib/telnet/telnet/commands.c
> ==
> --- head/contrib/telnet/telnet/commands.c Wed Jul 10 17:21:59 2019
> (r349889)
> +++ head/contrib/telnet/telnet/commands.c Wed Jul 10 17:42:04 2019
> (r349890)
> @@ -1655,10 +1655,11 @@ env_init(void)
>   char hbuf[256+1];
>   char *cp2 = strchr((char *)ep->value, ':');
>  
> - gethostname(hbuf, 256);
> - hbuf[256] = '\0';
> - cp = (char *)malloc(strlen(hbuf) + strlen(cp2) + 1);
> - sprintf((char *)cp, "%s%s", hbuf, cp2);
> + gethostname(hbuf, sizeof(hbuf));
> + hbuf[sizeof(hbuf)-1] = '\0';
> +unsigned int buflen = strlen(hbuf) + strlen(cp2) + 1;

buflen should be defined with the rest of the variables in the code
block above this one.

> + cp = (char *)malloc(sizeof(char)*buflen);

Lack of NULL check here leads to

> + snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);

potential NULL pointer deref here.

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2


signature.asc
Description: PGP signature


svn commit: r349891 - head/lib/libc/arm/gen

2019-07-10 Thread Ian Lepore
Author: ian
Date: Wed Jul 10 19:32:50 2019
New Revision: 349891
URL: https://svnweb.freebsd.org/changeset/base/349891

Log:
  Reorganize the SRCS lists as one file per line, and then alphabetize them.
  No functional changes.

Modified:
  head/lib/libc/arm/gen/Makefile.inc

Modified: head/lib/libc/arm/gen/Makefile.inc
==
--- head/lib/libc/arm/gen/Makefile.inc  Wed Jul 10 17:42:04 2019
(r349890)
+++ head/lib/libc/arm/gen/Makefile.inc  Wed Jul 10 19:32:50 2019
(r349891)
@@ -1,13 +1,31 @@
 #  @(#)Makefile.inc8.1 (Berkeley) 6/4/93
 # $FreeBSD$
 
-SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \
-   infinity.c ldexp.c makecontext.c \
-   __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c \
+SRCS+= \
+   __aeabi_read_tp.S \
+   _ctx_start.S \
+   _set_tp.c \
+   _setjmp.S \
+   alloca.S \
arm_initfini.c \
-   getcontextx.c
+   fabs.c \
+   flt_rounds.c \
+   getcontextx.c \
+   infinity.c \
+   ldexp.c \
+   makecontext.c \
+   setjmp.S \
+   signalcontext.c \
+   sigsetjmp.S \
 
 .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == 
"")
-SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \
-   fpsetround_vfp.c fpsetsticky_vfp.c
+
+SRCS+= \
+   fpgetmask_vfp.c \
+   fpgetround_vfp.c \
+   fpgetsticky_vfp.c \
+   fpsetmask_vfp.c \
+   fpsetround_vfp.c \
+   fpsetsticky_vfp.c \
+
 .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: r349890 - head/contrib/telnet/telnet

2019-07-10 Thread Philip Paeps
Author: philip
Date: Wed Jul 10 17:42:04 2019
New Revision: 349890
URL: https://svnweb.freebsd.org/changeset/base/349890

Log:
  telnet: fix a couple of snprintf() buffer overflows
  
  Obtained from:Juniper Networks
  MFC after:1 week

Modified:
  head/contrib/telnet/telnet/commands.c
  head/contrib/telnet/telnet/telnet.c
  head/contrib/telnet/telnet/utilities.c

Modified: head/contrib/telnet/telnet/commands.c
==
--- head/contrib/telnet/telnet/commands.c   Wed Jul 10 17:21:59 2019
(r349889)
+++ head/contrib/telnet/telnet/commands.c   Wed Jul 10 17:42:04 2019
(r349890)
@@ -1655,10 +1655,11 @@ env_init(void)
char hbuf[256+1];
char *cp2 = strchr((char *)ep->value, ':');
 
-   gethostname(hbuf, 256);
-   hbuf[256] = '\0';
-   cp = (char *)malloc(strlen(hbuf) + strlen(cp2) + 1);
-   sprintf((char *)cp, "%s%s", hbuf, cp2);
+   gethostname(hbuf, sizeof(hbuf));
+   hbuf[sizeof(hbuf)-1] = '\0';
+unsigned int buflen = strlen(hbuf) + strlen(cp2) + 1;
+   cp = (char *)malloc(sizeof(char)*buflen);
+   snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);
free(ep->value);
ep->value = (unsigned char *)cp;
}

Modified: head/contrib/telnet/telnet/telnet.c
==
--- head/contrib/telnet/telnet/telnet.c Wed Jul 10 17:21:59 2019
(r349889)
+++ head/contrib/telnet/telnet/telnet.c Wed Jul 10 17:42:04 2019
(r349890)
@@ -785,7 +785,7 @@ suboption(void)
name = gettermname();
len = strlen(name) + 4 + 2;
if (len < NETROOM()) {
-   sprintf(temp, "%c%c%c%c%s%c%c", IAC, SB, TELOPT_TTYPE,
+   snprintf(temp, sizeof(temp), "%c%c%c%c%s%c%c", IAC, SB, 
TELOPT_TTYPE,
TELQUAL_IS, name, IAC, SE);
ring_supply_data(, temp, len);
printsub('>', [2], len-2);
@@ -807,7 +807,7 @@ suboption(void)
 
TerminalSpeeds(, );
 
-   sprintf((char *)temp, "%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED,
+   snprintf((char *)temp, sizeof(temp), "%c%c%c%c%ld,%ld%c%c", IAC, 
SB, TELOPT_TSPEED,
TELQUAL_IS, ospeed, ispeed, IAC, SE);
len = strlen((char *)temp+4) + 4;   /* temp[3] is 0 ... */
 

Modified: head/contrib/telnet/telnet/utilities.c
==
--- head/contrib/telnet/telnet/utilities.c  Wed Jul 10 17:21:59 2019
(r349889)
+++ head/contrib/telnet/telnet/utilities.c  Wed Jul 10 17:42:04 2019
(r349890)
@@ -629,7 +629,7 @@ printsub(char direction, unsigned char *pointer, int l
}
{
char tbuf[64];
-   sprintf(tbuf, "%s%s%s%s%s",
+   snprintf(tbuf, sizeof(tbuf), "%s%s%s%s%s",
pointer[2]_EDIT ? "|EDIT" : "",
pointer[2]_TRAPSIG ? "|TRAPSIG" : "",
pointer[2]_SOFT_TAB ? "|SOFT_TAB" : "",
___
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: r349889 - head/sys/mips/ingenic

2019-07-10 Thread Warner Losh
Author: imp
Date: Wed Jul 10 17:21:59 2019
New Revision: 349889
URL: https://svnweb.freebsd.org/changeset/base/349889

Log:
  Fix compile errors with the CI20
  
  Fix mutex includes and fix a typo. The CI20 kernel is not built as
  part of universe.
  
  PR: 239115
  Submitted by: Kai Nacke

Modified:
  head/sys/mips/ingenic/jz4780_machdep.c
  head/sys/mips/ingenic/jz4780_mmc.c
  head/sys/mips/ingenic/jz4780_smb.c

Modified: head/sys/mips/ingenic/jz4780_machdep.c
==
--- head/sys/mips/ingenic/jz4780_machdep.c  Wed Jul 10 14:46:18 2019
(r349888)
+++ head/sys/mips/ingenic/jz4780_machdep.c  Wed Jul 10 17:21:59 2019
(r349889)
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #ifdef FDT

Modified: head/sys/mips/ingenic/jz4780_mmc.c
==
--- head/sys/mips/ingenic/jz4780_mmc.c  Wed Jul 10 14:46:18 2019
(r349888)
+++ head/sys/mips/ingenic/jz4780_mmc.c  Wed Jul 10 17:21:59 2019
(r349889)
@@ -775,7 +775,7 @@ jz4780_mmc_read_ivar(device_t bus, device_t child, int
*(int *)result = sc->sc_host.ios.power_mode;
break;
case MMCBR_IVAR_RETUNE_REQ:
-   *(int *)result = return_req_none;
+   *(int *)result = retune_req_none;
break;
case MMCBR_IVAR_VDD:
*(int *)result = sc->sc_host.ios.vdd;

Modified: head/sys/mips/ingenic/jz4780_smb.c
==
--- head/sys/mips/ingenic/jz4780_smb.c  Wed Jul 10 14:46:18 2019
(r349888)
+++ head/sys/mips/ingenic/jz4780_smb.c  Wed Jul 10 17:21:59 2019
(r349889)
@@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349888 - stable/11/release/doc/share/xml

2019-07-10 Thread Glen Barber
Author: gjb
Date: Wed Jul 10 14:46:18 2019
New Revision: 349888
URL: https://svnweb.freebsd.org/changeset/base/349888

Log:
  Prune leftover security/errata information from 11.2 that was supposed
  to be removed when regenerating the 11.3 errata page.
  
  Reported by:  Terry Kennedy
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/release/doc/share/xml/errata.xml
  stable/11/release/doc/share/xml/security.xml

Modified: stable/11/release/doc/share/xml/errata.xml
==
--- stable/11/release/doc/share/xml/errata.xml  Wed Jul 10 14:34:52 2019
(r349887)
+++ stable/11/release/doc/share/xml/errata.xml  Wed Jul 10 14:46:18 2019
(r349888)
@@ -19,136 +19,9 @@
 
 
   
-   FreeBSD-EN-18:08.lazyfpu
-   12September2018
-   Regression in Lazy FPU remediation
-  
-
-  
-   FreeBSD-EN-18:09.ip
-   27September2018
-   IP fragment remediation causes
- IPv6 reassembly failure
-  
-
-  
-   FreeBSD-EN-18:10.syscall
-   27September2018
-   Null pointer dereference in
-   freebsd4_getfsstat system
-   call
-  
-
-  
-   FreeBSD-EN-18:11.listen
-   27September2018
-   Denial of service in listen
-   system call
-  
-
-  
-   FreeBSD-EN-18:12.mem
-   27September2018
-   Small kernel memory disclosures in two system
-   calls
-  
-
-  
-   FreeBSD-EN-18:13.icmp
-   27November2018
-   ICMP buffer underwrite
-  
-
-  
-   FreeBSD-EN-18:14.tzdata
-   27November2018
-   Timezone database information
-   update
-  
-
-  
-   FreeBSD-EN-18:15.loader
-   27November2018
-   Deferred kernel loading breaks loader
-   password
-  
-
-  
-   FreeBSD-EN-18:16.ptrace
-   19December2018
-   Kernel panic when attaching to stopped
-   process
-  
-
-  
-   FreeBSD-EN-18:17.vm
-   19December2018
-   Kernel panic under load on  Skylake
-   CPUs
-  
-
-  
-   FreeBSD-EN-18:18.zfs
-   19December2018
-   ZFS vnode reclaim deadlock
-  
-
-  
-   FreeBSD-EN-19:03.sqlite
-   9January2019
-   sqlite update
-  
-
-  
-   FreeBSD-EN-19:04.tzdata
-   9January2019
-   Timezone database information
-   update
-  
-
-  
-   FreeBSD-EN-19:05.kqueue
-   9January2019
-   kqueue race condition and kernel
-   panic
-  
-
-  
-   FreeBSD-EN-19:08.tzdata
-   14May2019
-   Timezone database information
-   update
-  
-
-  
-   FreeBSD-EN-19:09.xinstall
-   14May2019
-broken with partially matching
-   relative paths
-  
-
-  
-   FreeBSD-EN-19:12.tzdata
-   2July2019
-   Timezone database information
-   update
+   No errata notices.
+   
+   
   
 
   

Modified: stable/11/release/doc/share/xml/security.xml
==
--- stable/11/release/doc/share/xml/security.xmlWed Jul 10 14:34:52 
2019(r349887)
+++ stable/11/release/doc/share/xml/security.xmlWed Jul 10 14:46:18 
2019(r349888)
@@ -19,137 +19,9 @@
 
 
   
-   FreeBSD-SA-18:08.tcp
-   06August2018
-   Resource exhaustion in TCP
-   reassembly
-  
-
-  
-   FreeBSD-SA-18:09.l1tf
-   14August2018
-   L1 Terminal Fault (L1TF) Kernel Information
-   Disclosure
-  
-
-  
-   FreeBSD-SA-18:10.ip
-   14August2018
-   Resource exhaustion in IP fragment
-   reassembly
-  
-
-  
-   FreeBSD-SA-18:11.hostapd
-   14August2018
-   Unauthenticated EAPOL-Key Decryption
-   Vulnerability
-  
-
-  
-   FreeBSD-SA-18:12.elf
-   12September2018
-   Improper ELF header parsing
-  
-
-  
-   FreeBSD-SA-18:13.nfs
-   27November2018
-   Multiple vulnerabilities
-  
-
-  
-   FreeBSD-SA-18:14.bhyve
-   4December2018
-   Insufficient bounds checking
-  
-
-  
-   FreeBSD-SA-18:15.bootpd
-   19December2018
-   Buffer overflow
-  
-
-  
-   FreeBSD-SA-19:01.syscall
-   5February2019
-   Kernel data register leak
-  
-
-  
-   FreeBSD-SA-19:02.fd
-   5February2019
-   File description reference count
-   leak
-  
-
-  
-   FreeBSD-SA-19:03.wpa
-   14May2019
-   Multiple vulnerabilities
-  
-
-  
-   FreeBSD-SA-19:04.ntp
-   14May2019
-   Authenticated denial of service in
-   
-  
-
-  
-   FreeBSD-SA-19:05.pf
-   14May2019
-   IPv6 fragment reassembly panic in
-   
-  
-
-  
-   FreeBSD-SA-19:06.pf
-   14May2019
-   ICMP/ICMP6 

svn commit: r349887 - head/sys/arm/include

2019-07-10 Thread Ian Lepore
Author: ian
Date: Wed Jul 10 14:34:52 2019
New Revision: 349887
URL: https://svnweb.freebsd.org/changeset/base/349887

Log:
  De-pollute arm's sysarch.h.
  
  Instead of including stdint.h for uintptr_t, include sys/_types.h and use
  __types for everything that isn't a native C keyword type.
  
  Remove the #include of cdefs.h.  It appears after the include of armreg.h
  which has a precondition of cdefs.h being included before it, so everyone
  including sysarch.h is already including cdefs.h.  (When armv5 support
  goes away, there will be no need include armreg.h here either.)
  
  Unfortunately, the unprefixed struct member names "addr" and "len" cannot
  be changed, because 3rd-party software is relying on them (libcompiler_rt
  is one known consumer).

Modified:
  head/sys/arm/include/sysarch.h

Modified: head/sys/arm/include/sysarch.h
==
--- head/sys/arm/include/sysarch.h  Wed Jul 10 13:47:10 2019
(r349886)
+++ head/sys/arm/include/sysarch.h  Wed Jul 10 14:34:52 2019
(r349887)
@@ -65,12 +65,10 @@
 #ifndef LOCORE
 #ifndef __ASSEMBLER__
 
-#include 
-
 /*
- * Pickup definition of uintptr_t
+ * Pickup definition of various __types.
  */
-#include 
+#include 
 
 /*
  * Architecture specific syscalls (arm)
@@ -83,19 +81,19 @@
 #define ARM_GET_VFPSTATE   4
 
 struct arm_sync_icache_args {
-   uintptr_t   addr;   /* Virtual start address */
-   size_t  len;/* Region size */
+   __uintptr_t addr;   /* Virtual start address */
+   __size_tlen;/* Region size */
 };
 
 struct arm_get_vfpstate_args {
-   size_t  mc_vfp_size;
+   __size_tmc_vfp_size;
void*mc_vfp;
 };
 
 #ifndef _KERNEL
 __BEGIN_DECLS
-intarm_sync_icache (u_int addr, int len);
-intarm_drain_writebuf (void);
+intarm_sync_icache(unsigned int, int);
+intarm_drain_writebuf(void);
 intsysarch(int, void *);
 __END_DECLS
 #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: r349886 - head/sys/compat/linux

2019-07-10 Thread Andriy Gapon
Author: avg
Date: Wed Jul 10 13:47:10 2019
New Revision: 349886
URL: https://svnweb.freebsd.org/changeset/base/349886

Log:
  linuxcommon: add module version
  
  MFC after:2 weeks

Modified:
  head/sys/compat/linux/linux_common.c

Modified: head/sys/compat/linux/linux_common.c
==
--- head/sys/compat/linux/linux_common.cWed Jul 10 13:36:17 2019
(r349885)
+++ head/sys/compat/linux/linux_common.cWed Jul 10 13:47:10 2019
(r349886)
@@ -98,3 +98,4 @@ static moduledata_t linux_common_mod = {
 };
 
 DECLARE_MODULE(linuxcommon, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+MODULE_VERSION(linuxcommon, 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: r349885 - head/sys/powerpc/pseries

2019-07-10 Thread Leandro Lupori
Author: luporl
Date: Wed Jul 10 13:36:17 2019
New Revision: 349885
URL: https://svnweb.freebsd.org/changeset/base/349885

Log:
  [PPC64] pseries: fix realmaxaddr calculation
  
  On POWER9/pseries, QEMU passes several regions of memory,
  instead of a single region containing all memory, as the
  code was expecting.
  
  Reviewed by:  jhibbits
  Differential Revision:https://reviews.freebsd.org/D20857

Modified:
  head/sys/powerpc/pseries/platform_chrp.c

Modified: head/sys/powerpc/pseries/platform_chrp.c
==
--- head/sys/powerpc/pseries/platform_chrp.cWed Jul 10 13:35:01 2019
(r349884)
+++ head/sys/powerpc/pseries/platform_chrp.cWed Jul 10 13:36:17 2019
(r349885)
@@ -140,8 +140,15 @@ chrp_attach(platform_t plat)
if (!(mfmsr() & PSL_HV)) {
struct mem_region *phys, *avail;
int nphys, navail;
+   vm_offset_t off;
+
mem_regions(, , , );
-   realmaxaddr = phys[0].mr_size;
+
+   realmaxaddr = 0;
+   for (i = 0; i < nphys; i++) {
+   off = phys[i].mr_start + phys[i].mr_size;
+   realmaxaddr = MAX(off, realmaxaddr);
+   }
 
pmap_mmu_install("mmu_phyp", BUS_PROBE_SPECIFIC);
cpu_idle_hook = phyp_cpu_idle;
___
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: r349884 - stable/11/sys/conf

2019-07-10 Thread Glen Barber
Author: gjb
Date: Wed Jul 10 13:35:01 2019
New Revision: 349884
URL: https://svnweb.freebsd.org/changeset/base/349884

Log:
  Call stable/11 -STABLE now that 11.3-RELEASE is out.
  
  Reminded by:  marck
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sys/conf/newvers.sh

Modified: stable/11/sys/conf/newvers.sh
==
--- stable/11/sys/conf/newvers.sh   Wed Jul 10 12:40:07 2019
(r349883)
+++ stable/11/sys/conf/newvers.sh   Wed Jul 10 13:35:01 2019
(r349884)
@@ -44,7 +44,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.3"
-BRANCH="PRERELEASE"
+BRANCH="STABLE"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349883 - head/sys/dev/ow

2019-07-10 Thread Andriy Gapon
Author: avg
Date: Wed Jul 10 12:40:07 2019
New Revision: 349883
URL: https://svnweb.freebsd.org/changeset/base/349883

Log:
  owc_gpiobus: small formatting cleanup
  
  MFC after:1 week

Modified:
  head/sys/dev/ow/owc_gpiobus.c

Modified: head/sys/dev/ow/owc_gpiobus.c
==
--- head/sys/dev/ow/owc_gpiobus.c   Wed Jul 10 12:15:07 2019
(r349882)
+++ head/sys/dev/ow/owc_gpiobus.c   Wed Jul 10 12:40:07 2019
(r349883)
@@ -191,7 +191,7 @@ owc_gpiobus_write_one(device_t dev, struct ow_timing *
sc = device_get_softc(dev);
error = GETBUS(sc);
if (error != 0)
-   return error;
+   return (error);
 
critical_enter();
 
@@ -205,10 +205,10 @@ owc_gpiobus_write_one(device_t dev, struct ow_timing *
DELAY(t->t_slot - t->t_low1 + t->t_rec);
 
critical_exit();
-   
+
RELBUS(sc);
-   
-   return 0;
+
+   return (0);
 }
 
 /*
@@ -232,7 +232,7 @@ owc_gpiobus_write_zero(device_t dev, struct ow_timing 
sc = device_get_softc(dev);
error = GETBUS(sc);
if (error != 0)
-   return error;
+   return (error);
 
critical_enter();
 
@@ -248,8 +248,8 @@ owc_gpiobus_write_zero(device_t dev, struct ow_timing 
critical_exit();
 
RELBUS(sc);
-   
-   return 0;
+
+   return (0);
 }
 
 /*
@@ -277,7 +277,7 @@ owc_gpiobus_read_data(device_t dev, struct ow_timing *
sc = device_get_softc(dev);
error = GETBUS(sc);
if (error != 0)
-   return error;
+   return (error);
 
/* Force low for t_lowr microseconds */
then = sbinuptime();
@@ -309,8 +309,8 @@ owc_gpiobus_read_data(device_t dev, struct ow_timing *
} while ((now - then) / SBT_1US < t->t_slot);
 
RELBUS(sc);
-   
-   return 0;
+
+   return (error);
 }
 
 /*
@@ -338,10 +338,9 @@ owc_gpiobus_reset_and_presence(device_t dev, struct ow
sc = device_get_softc(dev);
error = GETBUS(sc);
if (error != 0)
-   return error;
-   
+   return (error);
 
-   /* 
+   /*
 * Read the current state of the bus. The steady state of an idle bus is
 * high. Badly wired buses that are missing the required pull up, or
 * that have a short circuit to ground cause all kinds of mischief when
@@ -353,7 +352,7 @@ owc_gpiobus_reset_and_presence(device_t dev, struct ow
if (buf == 0) {
*bit = -1;
RELBUS(sc);
-   return EIO;
+   return (EIO);
}
 
critical_enter();
@@ -384,12 +383,12 @@ owc_gpiobus_reset_and_presence(device_t dev, struct ow
if (buf == 0) {
*bit = -1;
RELBUS(sc);
-   return EIO;
+   return (EIO);
}
 
RELBUS(sc);
 
-   return 0;
+   return (0);
 }
 
 static devclass_t owc_gpiobus_devclass;
___
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: r349882 - stable/12/share/man/man4

2019-07-10 Thread Alexander Motin
Author: mav
Date: Wed Jul 10 12:15:07 2019
New Revision: 349882
URL: https://svnweb.freebsd.org/changeset/base/349882

Log:
  MFC r340093 (by imp): Document disbale_phy in ahcich sysctls.

Modified:
  stable/12/share/man/man4/ahci.4
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/ahci.4
==
--- stable/12/share/man/man4/ahci.4 Wed Jul 10 12:10:10 2019
(r349881)
+++ stable/12/share/man/man4/ahci.4 Wed Jul 10 12:15:07 2019
(r349882)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 22, 2013
+.Dd November 2, 2018
 .Dt AHCI 4
 .Os
 .Sh NAME
@@ -162,6 +162,13 @@ fault LED device nodes
 .It Pa /dev/led/ahci*.*.locate
 locate LED device nodes
 .El
+.Sh SYSCTL
+.Bl -tag
+.It Pa dev.ahcich.X.disable_phy
+Set to 1 to disable the phy for the drive on channel X.
+Set to 0 to enable the phy.
+Useful for turning off troublemakers.
+Also useful for debugging when you need the ada drive to come and go.
 .Sh SEE ALSO
 .Xr ada 4 ,
 .Xr ata 4 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349881 - stable/12/sys/conf

2019-07-10 Thread Alexander Motin
Author: mav
Date: Wed Jul 10 12:10:10 2019
New Revision: 349881
URL: https://svnweb.freebsd.org/changeset/base/349881

Log:
  MFC r349418: Fix qlxgbe(4) static build.

Modified:
  stable/12/sys/conf/files.amd64
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/files.amd64
==
--- stable/12/sys/conf/files.amd64  Wed Jul 10 08:19:33 2019
(r349880)
+++ stable/12/sys/conf/files.amd64  Wed Jul 10 12:10:10 2019
(r349881)
@@ -383,6 +383,9 @@ dev/qlxgbe/ql_isr.c optionalqlxgbe pci
 dev/qlxgbe/ql_misc.c   optionalqlxgbe pci
 dev/qlxgbe/ql_os.c optionalqlxgbe pci
 dev/qlxgbe/ql_reset.c  optionalqlxgbe pci
+dev/qlxgbe/ql_fw.c optionalqlxgbe pci
+dev/qlxgbe/ql_boot.c   optionalqlxgbe pci
+dev/qlxgbe/ql_minidump.c   optionalqlxgbe pci
 dev/qlnx/qlnxe/ecore_cxt.c optionalqlnxe pci \
compile-with "${LINUXKPI_C}"
 dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c optional   qlnxe pci \
___
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: r349880 - head/sys/compat/linux

2019-07-10 Thread Tijl Coosemans
Author: tijl
Date: Wed Jul 10 08:19:33 2019
New Revision: 349880
URL: https://svnweb.freebsd.org/changeset/base/349880

Log:
  Let linuxulator mprotect mask unsupported bits before calling kern_mprotect.
  
  After r349240 kern_mprotect returns EINVAL for unsupported bits in the prot
  argument.  Linux rtld uses PROT_GROWSDOWN and PROT_GROWS_UP when marking the
  stack executable.  Mask these bits like kern_mprotect used to do.  For other
  unsupported bits EINVAL is returned like Linux does.
  
  Reviewed by:  trasz, brooks
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D20864

Modified:
  head/sys/compat/linux/linux_mmap.c
  head/sys/compat/linux/linux_mmap.h

Modified: head/sys/compat/linux/linux_mmap.c
==
--- head/sys/compat/linux/linux_mmap.c  Wed Jul 10 08:08:14 2019
(r349879)
+++ head/sys/compat/linux/linux_mmap.c  Wed Jul 10 08:19:33 2019
(r349880)
@@ -228,6 +228,11 @@ int
 linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot)
 {
 
+   /* XXX Ignore PROT_GROWSDOWN and PROT_GROWSUP for now. */
+   prot &= ~(LINUX_PROT_GROWSDOWN | LINUX_PROT_GROWSUP);
+   if ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0)
+   return (EINVAL);
+
 #if defined(__amd64__)
linux_fixup_prot(td, );
 #endif

Modified: head/sys/compat/linux/linux_mmap.h
==
--- head/sys/compat/linux/linux_mmap.h  Wed Jul 10 08:08:14 2019
(r349879)
+++ head/sys/compat/linux/linux_mmap.h  Wed Jul 10 08:19:33 2019
(r349880)
@@ -41,6 +41,8 @@
 #defineLINUX_MAP_ANON  0x0020
 #defineLINUX_MAP_GROWSDOWN 0x0100
 
+#defineLINUX_PROT_GROWSDOWN0x0100
+#defineLINUX_PROT_GROWSUP  0x0200
 
 int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int,
int, off_t);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349879 - stable/11/tools/build/mk

2019-07-10 Thread Tijl Coosemans
Author: tijl
Date: Wed Jul 10 08:08:14 2019
New Revision: 349879
URL: https://svnweb.freebsd.org/changeset/base/349879

Log:
  MFC r349641:
  
  Also remove lib32 versions of libradius.

Modified:
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Wed Jul 10 08:07:33 
2019(r349878)
+++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Wed Jul 10 08:08:14 
2019(r349879)
@@ -7284,6 +7284,12 @@ OLD_LIBS+=usr/lib/libradius.so.4
 OLD_FILES+=usr/lib/libradius_p.a
 OLD_FILES+=usr/lib/pam_radius.so
 OLD_LIBS+=usr/lib/pam_radius.so.6
+OLD_FILES+=usr/lib32/libradius.a
+OLD_FILES+=usr/lib32/libradius.so
+OLD_LIBS+=usr/lib32/libradius.so.4
+OLD_FILES+=usr/lib32/libradius_p.a
+OLD_FILES+=usr/lib32/pam_radius.so
+OLD_LIBS+=usr/lib32/pam_radius.so.6
 OLD_FILES+=usr/include/radlib.h
 OLD_FILES+=usr/include/radlib_vs.h
 OLD_FILES+=usr/share/man/man3/libradius.3.gz
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349878 - stable/12/tools/build/mk

2019-07-10 Thread Tijl Coosemans
Author: tijl
Date: Wed Jul 10 08:07:33 2019
New Revision: 349878
URL: https://svnweb.freebsd.org/changeset/base/349878

Log:
  MFC r349641:
  
  Also remove lib32 versions of libradius.

Modified:
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/12/tools/build/mk/OptionalObsoleteFiles.inc  Wed Jul 10 08:05:13 
2019(r349877)
+++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc  Wed Jul 10 08:07:33 
2019(r349878)
@@ -7893,6 +7893,12 @@ OLD_LIBS+=usr/lib/libradius.so.4
 OLD_FILES+=usr/lib/libradius_p.a
 OLD_FILES+=usr/lib/pam_radius.so
 OLD_LIBS+=usr/lib/pam_radius.so.6
+OLD_FILES+=usr/lib32/libradius.a
+OLD_FILES+=usr/lib32/libradius.so
+OLD_LIBS+=usr/lib32/libradius.so.4
+OLD_FILES+=usr/lib32/libradius_p.a
+OLD_FILES+=usr/lib32/pam_radius.so
+OLD_LIBS+=usr/lib32/pam_radius.so.6
 OLD_FILES+=usr/include/radlib.h
 OLD_FILES+=usr/include/radlib_vs.h
 OLD_FILES+=usr/share/man/man3/libradius.3.gz
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349877 - stable/12

2019-07-10 Thread Tijl Coosemans
Author: tijl
Date: Wed Jul 10 08:05:13 2019
New Revision: 349877
URL: https://svnweb.freebsd.org/changeset/base/349877

Log:
  MFC r349640, r349706:
  
  Also remove lib32 version of libcasper.so.0.

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

Modified: stable/12/ObsoleteFiles.inc
==
--- stable/12/ObsoleteFiles.inc Wed Jul 10 05:57:37 2019(r349876)
+++ stable/12/ObsoleteFiles.inc Wed Jul 10 08:05:13 2019(r349877)
@@ -585,6 +585,7 @@ OLD_FILES+=usr/share/man/man3/arc4random_stir.3.gz
 OLD_FILES+=usr/bin/send-pr
 # 20180725: Cleanup old libcasper.so.0
 OLD_LIBS+=lib/libcasper.so.0
+OLD_LIBS+=usr/lib32/libcasper.so.0
 # 20180722: indent(1) option renamed, test files follow
 OLD_FILES+=usr/bin/indent/tests/nsac.0
 OLD_FILES+=usr/bin/indent/tests/nsac.0.pro
___
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"