svn commit: r344916 - head/sys/powerpc/aim

2019-03-07 Thread Justin Hibbits
Author: jhibbits
Date: Fri Mar  8 04:20:33 2019
New Revision: 344916
URL: https://svnweb.freebsd.org/changeset/base/344916

Log:
  powerpc64: Fix early exit with invalid kernel SLB entries
  
  The check for early exit should be checking the SLB entry itself.  As
  currently written it was checking the address of the SLB, which is always
  non-zero, so would go through the kernel SR restore loop regardless.
  
  Submitted by: mmacy
  MFC after:2 weeks

Modified:
  head/sys/powerpc/aim/trap_subr64.S

Modified: head/sys/powerpc/aim/trap_subr64.S
==
--- head/sys/powerpc/aim/trap_subr64.S  Fri Mar  8 03:59:53 2019
(r344915)
+++ head/sys/powerpc/aim/trap_subr64.S  Fri Mar  8 04:20:33 2019
(r344916)
@@ -89,7 +89,7 @@ restore_kernsrs:
GET_CPUINFO(%r28)
addi%r28,%r28,PC_KERNSLB
ld  %r29,16(%r28)   /* One past USER_SLB_SLOT */
-   cmpdi   %r28,0
+   cmpdi   %r29,0
beqlr   /* If first kernel entry is invalid,
 * SLBs not in use, so exit early */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344915 - head/sys/powerpc/cpufreq

2019-03-07 Thread Justin Hibbits
Author: jhibbits
Date: Fri Mar  8 03:59:53 2019
New Revision: 344915
URL: https://svnweb.freebsd.org/changeset/base/344915

Log:
  powerpc: Fix cpufreq statement scoping
  
  The second statements on the lines are not guarded by the `if' condition.
  This triggers a warning with newer gcc.  It's relatively harmless given the
  usage, but incorrect.  Instead, wrap the statements so they're properly
  guarded.
  
  Reported by:  powerpc64-gcc xtoolchain
  MFC after:1 week

Modified:
  head/sys/powerpc/cpufreq/dfs.c
  head/sys/powerpc/cpufreq/pcr.c

Modified: head/sys/powerpc/cpufreq/dfs.c
==
--- head/sys/powerpc/cpufreq/dfs.c  Fri Mar  8 02:00:49 2019
(r344914)
+++ head/sys/powerpc/cpufreq/dfs.c  Fri Mar  8 03:59:53 2019
(r344915)
@@ -157,8 +157,10 @@ dfs_settings(device_t dev, struct cf_setting *sets, in
 
sets[0].freq = 1; sets[0].dev = dev;
sets[1].freq = 5000; sets[1].dev = dev;
-   if (sc->dfs4)
-   sets[2].freq = 2500; sets[2].dev = dev;
+   if (sc->dfs4) {
+   sets[2].freq = 2500;
+   sets[2].dev = dev;
+   }
*count = states;
 
return (0);

Modified: head/sys/powerpc/cpufreq/pcr.c
==
--- head/sys/powerpc/cpufreq/pcr.c  Fri Mar  8 02:00:49 2019
(r344914)
+++ head/sys/powerpc/cpufreq/pcr.c  Fri Mar  8 03:59:53 2019
(r344915)
@@ -251,8 +251,10 @@ pcr_settings(device_t dev, struct cf_setting *sets, in
 
sets[0].freq = 1; sets[0].dev = dev;
sets[1].freq = 5000; sets[1].dev = dev;
-   if (sc->nmodes > 2)
-   sets[2].freq = 2500; sets[2].dev = dev;
+   if (sc->nmodes > 2) {
+   sets[2].freq = 2500;
+   sets[2].dev = dev;
+   }
*count = sc->nmodes;
 
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344913 - head/sys/dev/random

2019-03-07 Thread Shawn Webb
Hey Conrad,

On Fri, Mar 08, 2019 at 01:17:20AM +, Conrad Meyer wrote:
> Author: cem
> Date: Fri Mar  8 01:17:20 2019
> New Revision: 344913
> URL: https://svnweb.freebsd.org/changeset/base/344913
> 
> Log:
>   Fortuna: Add Chacha20 as an alternative stream cipher
>   
>   Chacha20 with a 256 bit key and 128 bit counter size is a good match for an
>   AES256-ICM replacement.
>   
>   In userspace, Chacha20 is typically marginally slower than AES-ICM on
>   machines with AESNI intrinsics, but typically much faster than AES on
>   machines without special intrinsics.  ChaCha20 does well on typical modern
>   architectures with SIMD instructions, which includes most types of machines
>   FreeBSD runs on.
>   
>   In the kernel, we can't (or don't) make use of AESNI intrinsics for
>   random(4) anyway.  So even on amd64, using Chacha provides a modest
>   performance improvement in random device throughput today.
>   
>   This change makes the stream cipher used by random(4) configurable at boot
>   time with the 'kern.random.use_chacha20_cipher' tunable.
>   
>   Very rough, non-scientific measurements at the /dev/random device, on a
>   GENERIC-NODEBUG amd64 VM with 'pv', show a factor of 2.2x higher throughput
>   for Chacha20 over the existing AES-ICM mode.
>   
>   Reviewed by:delphij, markm
>   Approved by:secteam (delphij)
>   Differential Revision:  https://reviews.freebsd.org/D19475
> 
> Modified:
>   head/sys/dev/random/fortuna.c
>   head/sys/dev/random/hash.c
>   head/sys/dev/random/hash.h
>   head/sys/dev/random/uint128.h
>
> Modified: head/sys/dev/random/hash.c
> ==
> --- head/sys/dev/random/hash.cFri Mar  8 01:04:19 2019
> (r344912)
> +++ head/sys/dev/random/hash.cFri Mar  8 01:17:20 2019
> (r344913)
> +/* Validate that full Chacha IV is as large as the 128-bit counter */
> +_Static_assert(CHACHA_STATELEN == RANDOM_BLOCKSIZE, "");
> +
> +/*
> + * Experimental Chacha20-based PRF for Fortuna keystream primitive.  For now,
> + * disabled by default.  But we may enable it in the future.
> + *
> + * Benefits include somewhat faster keystream generation compared with
> + * unaccelerated AES-ICM.
> + */
> +bool random_chachamode = false;
> +#ifdef _KERNEL
> +SYSCTL_BOOL(_kern_random, OID_AUTO, use_chacha20_cipher, CTLFLAG_RDTUN,
> +_chachamode, 0,
> +"If non-zero, use the ChaCha20 cipher for randomdev PRF.  "
> +"If zero, use AES-ICM cipher for randomdev PRF (default).");
> +#endif

I'm curious if that sysctl node could be documented in a manpage,
perhaps the random(4) manpage would be a good candidate for updating.


Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r344913 - head/sys/dev/random

2019-03-07 Thread Conrad Meyer
Author: cem
Date: Fri Mar  8 01:17:20 2019
New Revision: 344913
URL: https://svnweb.freebsd.org/changeset/base/344913

Log:
  Fortuna: Add Chacha20 as an alternative stream cipher
  
  Chacha20 with a 256 bit key and 128 bit counter size is a good match for an
  AES256-ICM replacement.
  
  In userspace, Chacha20 is typically marginally slower than AES-ICM on
  machines with AESNI intrinsics, but typically much faster than AES on
  machines without special intrinsics.  ChaCha20 does well on typical modern
  architectures with SIMD instructions, which includes most types of machines
  FreeBSD runs on.
  
  In the kernel, we can't (or don't) make use of AESNI intrinsics for
  random(4) anyway.  So even on amd64, using Chacha provides a modest
  performance improvement in random device throughput today.
  
  This change makes the stream cipher used by random(4) configurable at boot
  time with the 'kern.random.use_chacha20_cipher' tunable.
  
  Very rough, non-scientific measurements at the /dev/random device, on a
  GENERIC-NODEBUG amd64 VM with 'pv', show a factor of 2.2x higher throughput
  for Chacha20 over the existing AES-ICM mode.
  
  Reviewed by:  delphij, markm
  Approved by:  secteam (delphij)
  Differential Revision:https://reviews.freebsd.org/D19475

Modified:
  head/sys/dev/random/fortuna.c
  head/sys/dev/random/hash.c
  head/sys/dev/random/hash.h
  head/sys/dev/random/uint128.h

Modified: head/sys/dev/random/fortuna.c
==
--- head/sys/dev/random/fortuna.c   Fri Mar  8 01:04:19 2019
(r344912)
+++ head/sys/dev/random/fortuna.c   Fri Mar  8 01:17:20 2019
(r344913)
@@ -109,7 +109,7 @@ static struct fortuna_state {
} fs_pool[RANDOM_FORTUNA_NPOOLS];
u_int fs_reseedcount;   /* ReseedCnt */
uint128_t fs_counter;   /* C */
-   struct randomdev_key fs_key;/* K */
+   union randomdev_key fs_key; /* K */
u_int fs_minpoolsize;   /* Extras */
/* Extras for the OS */
 #ifdef _KERNEL
@@ -271,16 +271,27 @@ random_fortuna_reseed_internal(uint32_t *entropy_data,
 {
struct randomdev_hash context;
uint8_t hash[RANDOM_KEYSIZE];
+   const void *keymaterial;
+   size_t keysz;
+   bool seeded;
 
RANDOM_RESEED_ASSERT_LOCK_OWNED();
+
+   seeded = random_fortuna_seeded();
+   if (seeded) {
+   randomdev_getkey(_state.fs_key, , );
+   KASSERT(keysz == RANDOM_KEYSIZE, ("%s: key size %zu not %u",
+   __func__, keysz, (unsigned)RANDOM_KEYSIZE));
+   }
+
/*-
 * FS - K = Hd(K|s) where Hd(m) is H(H(0^512|m))
 *  - C = C + 1
 */
randomdev_hash_init();
randomdev_hash_iterate(, zero_region, RANDOM_ZERO_BLOCKSIZE);
-   randomdev_hash_iterate(, _state.fs_key.key.keyMaterial,
-   fortuna_state.fs_key.key.keyLen / 8);
+   if (seeded)
+   randomdev_hash_iterate(, keymaterial, keysz);
randomdev_hash_iterate(, entropy_data, 
RANDOM_KEYSIZE*blockcount);
randomdev_hash_finish(, hash);
randomdev_hash_init();

Modified: head/sys/dev/random/hash.c
==
--- head/sys/dev/random/hash.c  Fri Mar  8 01:04:19 2019(r344912)
+++ head/sys/dev/random/hash.c  Fri Mar  8 01:17:20 2019(r344913)
@@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$");
 
 #ifdef _KERNEL
 #include 
+#include 
+#include 
+#include 
 #include 
 #else /* !_KERNEL */
 #include 
@@ -42,14 +45,39 @@ __FBSDID("$FreeBSD$");
 #include "unit_test.h"
 #endif /* _KERNEL */
 
+#define CHACHA_EMBED
+#define KEYSTREAM_ONLY
+#define CHACHA_NONCE0_CTR128
+#include 
 #include 
 #include 
 
 #include 
+#ifdef _KERNEL
+#include 
+#endif
 
 /* This code presumes that RANDOM_KEYSIZE is twice as large as 
RANDOM_BLOCKSIZE */
 CTASSERT(RANDOM_KEYSIZE == 2*RANDOM_BLOCKSIZE);
 
+/* Validate that full Chacha IV is as large as the 128-bit counter */
+_Static_assert(CHACHA_STATELEN == RANDOM_BLOCKSIZE, "");
+
+/*
+ * Experimental Chacha20-based PRF for Fortuna keystream primitive.  For now,
+ * disabled by default.  But we may enable it in the future.
+ *
+ * Benefits include somewhat faster keystream generation compared with
+ * unaccelerated AES-ICM.
+ */
+bool random_chachamode = false;
+#ifdef _KERNEL
+SYSCTL_BOOL(_kern_random, OID_AUTO, use_chacha20_cipher, CTLFLAG_RDTUN,
+_chachamode, 0,
+"If non-zero, use the ChaCha20 cipher for randomdev PRF.  "
+"If zero, use AES-ICM cipher for randomdev PRF (default).");
+#endif
+
 /* Initialise the hash */
 void
 randomdev_hash_init(struct randomdev_hash *context)
@@ -81,11 +109,15 @@ randomdev_hash_finish(struct randomdev_hash *context, 
  * data.
  */
 void
-randomdev_encrypt_init(struct randomdev_key *context, const void *data)
+randomdev_encrypt_init(union randomdev_key *context, const void 

svn commit: r344904 - head/sys/netinet6

2019-03-07 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Mar  7 23:03:39 2019
New Revision: 344904
URL: https://svnweb.freebsd.org/changeset/base/344904

Log:
  Update for IETF draft-ietf-6man-ipv6only-flag.
  
  When we roam between networks and our link-state goes down, automatically 
remove
  the IPv6-Only flag from the interface.  Otherwise we might switch from an
  IPv6-only to and IPv4-only network and the flag would stay and we would 
prevent
  IPv4 from working.
  
  While the actual function call to clear the flag is under EXPERIMENTAL,
  the eventhandler is not as we might want to re-use it for other
  functionality on link-down event (such was re-calculate default routers
  for example if there is more than one).
  
  Reviewed by:  hrs
  Differential Revision:https://reviews.freebsd.org/D19487

Modified:
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6.h
  head/sys/netinet6/nd6_rtr.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Thu Mar  7 22:56:39 2019(r344903)
+++ head/sys/netinet6/nd6.c Thu Mar  7 23:03:39 2019(r344904)
@@ -113,7 +113,7 @@ VNET_DEFINE(int, nd6_debug) = 1;
 VNET_DEFINE(int, nd6_debug) = 0;
 #endif
 
-static eventhandler_tag lle_event_eh, iflladdr_event_eh;
+static eventhandler_tag lle_event_eh, iflladdr_event_eh, ifnet_link_event_eh;
 
 VNET_DEFINE(struct nd_drhead, nd_defrouter);
 VNET_DEFINE(struct nd_prhead, nd_prefix);
@@ -233,6 +233,8 @@ nd6_init(void)
NULL, EVENTHANDLER_PRI_ANY);
iflladdr_event_eh = EVENTHANDLER_REGISTER(iflladdr_event,
nd6_iflladdr, NULL, EVENTHANDLER_PRI_ANY);
+   ifnet_link_event_eh = EVENTHANDLER_REGISTER(ifnet_link_event,
+   nd6_ifnet_link_event, NULL, EVENTHANDLER_PRI_ANY);
}
 }
 
@@ -244,6 +246,7 @@ nd6_destroy()
callout_drain(_nd6_slowtimo_ch);
callout_drain(_nd6_timer_ch);
if (IS_DEFAULT_VNET(curvnet)) {
+   EVENTHANDLER_DEREGISTER(ifnet_link_event, ifnet_link_event_eh);
EVENTHANDLER_DEREGISTER(lle_event, lle_event_eh);
EVENTHANDLER_DEREGISTER(iflladdr_event, iflladdr_event_eh);
}

Modified: head/sys/netinet6/nd6.h
==
--- head/sys/netinet6/nd6.h Thu Mar  7 22:56:39 2019(r344903)
+++ head/sys/netinet6/nd6.h Thu Mar  7 23:03:39 2019(r344904)
@@ -476,6 +476,7 @@ void nd6_dad_stop(struct ifaddr *);
 /* nd6_rtr.c */
 void nd6_rs_input(struct mbuf *, int, int);
 void nd6_ra_input(struct mbuf *, int, int);
+void nd6_ifnet_link_event(void *, struct ifnet *, int);
 void defrouter_reset(void);
 void defrouter_select_fib(int fibnum);
 void defrouter_select(void);

Modified: head/sys/netinet6/nd6_rtr.c
==
--- head/sys/netinet6/nd6_rtr.c Thu Mar  7 22:56:39 2019(r344903)
+++ head/sys/netinet6/nd6_rtr.c Thu Mar  7 23:03:39 2019(r344904)
@@ -285,7 +285,32 @@ defrtr_ipv6_only_ifp(struct ifnet *ifp)
/* Send notification of flag change. */
 #endif
 }
+
+static void
+defrtr_ipv6_only_ipf_down(struct ifnet *ifp)
+{
+
+   IF_AFDATA_WLOCK(ifp);
+   ND_IFINFO(ifp)->flags &= ~ND6_IFF_IPV6_ONLY;
+   IF_AFDATA_WUNLOCK(ifp);
+}
 #endif /* EXPERIMENTAL */
+
+void
+nd6_ifnet_link_event(void *arg __unused, struct ifnet *ifp, int linkstate)
+{
+
+   /*
+* XXX-BZ we might want to trigger re-evaluation of our default router
+* availability. E.g., on link down the default router might be
+* unreachable but a different interface might still have connectivity.
+*/
+
+#ifdef EXPERIMENTAL
+   if (linkstate == LINK_STATE_DOWN)
+   defrtr_ipv6_only_ipf_down(ifp);
+#endif
+}
 
 /*
  * Receive Router Advertisement Message.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344903 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-03-07 Thread Alexander Motin
Author: mav
Date: Thu Mar  7 22:56:39 2019
New Revision: 344903
URL: https://svnweb.freebsd.org/changeset/base/344903

Log:
  Improve entropy for ZFS taskqueue selection.
  
  I just found that at least on Skylake CPUs cpu_ticks() never returns odd
  values, only even, and possibly has even bigger step (176/2?), that makes
  its lower bits very bad entropy source, leaving half of taskqueues unused.
  Switch to sbinuptime(), closer to upstreams, mitigates the problem by the
  rate conversion working as kind of hash function.  In case that is somehow
  not enough (timer rate is too low or too divisible) mix in curcpu.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Thu Mar  7 
22:51:58 2019(r344902)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Thu Mar  7 
22:56:39 2019(r344903)
@@ -1070,7 +1070,8 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_t
tq = tqs->stqs_taskq[0];
} else {
 #ifdef _KERNEL
-   tq = tqs->stqs_taskq[cpu_ticks() % tqs->stqs_count];
+   tq = tqs->stqs_taskq[(u_int)(sbinuptime() + curcpu) %
+   tqs->stqs_count];
 #else
tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count];
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344902 - head/bin/sh/tests/expansion

2019-03-07 Thread Jilles Tjoelker
Author: jilles
Date: Thu Mar  7 22:51:58 2019
New Revision: 344902
URL: https://svnweb.freebsd.org/changeset/base/344902

Log:
  sh/tests: Improve failure messages of expansion/arith15.0

Modified:
  head/bin/sh/tests/expansion/arith15.0

Modified: head/bin/sh/tests/expansion/arith15.0
==
--- head/bin/sh/tests/expansion/arith15.0   Thu Mar  7 22:34:45 2019
(r344901)
+++ head/bin/sh/tests/expansion/arith15.0   Thu Mar  7 22:51:58 2019
(r344902)
@@ -12,9 +12,9 @@ check() {
 XXX=-9223372036854775808
 check "XXX"-9223372036854775808
 check "XXX - 1"9223372036854775807
-check $(($XXX - 1))9223372036854775807
-check $(($XXX - 2))9223372036854775806
-check $((0x8000 == 0x7fff)) \
+check "$XXX - 1"   9223372036854775807
+check "$XXX - 2"   9223372036854775806
+check "0x8000 == 0x7fff" \
0
 
 exit $((failures != 0))
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344901 - head/sys/gnu/gcov

2019-03-07 Thread Brooks Davis
Author: brooks
Date: Thu Mar  7 22:34:45 2019
New Revision: 344901
URL: https://svnweb.freebsd.org/changeset/base/344901

Log:
  Correct my previous correction to the license.  It now matches the text
  in https://spdx.org/licenses/GPL-2.0.html

Modified:
  head/sys/gnu/gcov/gcc_4_7.c
  head/sys/gnu/gcov/gcov_fs.c

Modified: head/sys/gnu/gcov/gcc_4_7.c
==
--- head/sys/gnu/gcov/gcc_4_7.c Thu Mar  7 22:20:20 2019(r344900)
+++ head/sys/gnu/gcov/gcc_4_7.c Thu Mar  7 22:34:45 2019(r344901)
@@ -1,8 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License.
+// as published by the Free Software Foundation; version 2.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of

Modified: head/sys/gnu/gcov/gcov_fs.c
==
--- head/sys/gnu/gcov/gcov_fs.c Thu Mar  7 22:20:20 2019(r344900)
+++ head/sys/gnu/gcov/gcov_fs.c Thu Mar  7 22:34:45 2019(r344901)
@@ -1,8 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License.
+// as published by the Free Software Foundation; version 2.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344900 - head/sys/gnu/gcov

2019-03-07 Thread Brooks Davis
Author: brooks
Date: Thu Mar  7 22:20:20 2019
New Revision: 344900
URL: https://svnweb.freebsd.org/changeset/base/344900

Log:
  Correct license boilerplate, to match the SPDX tag.
  
  The GPL-2.0 tag is a deprecated tag which means that same thing as
  GPL-2.0-only.

Modified:
  head/sys/gnu/gcov/gcc_4_7.c
  head/sys/gnu/gcov/gcov_fs.c

Modified: head/sys/gnu/gcov/gcc_4_7.c
==
--- head/sys/gnu/gcov/gcc_4_7.c Thu Mar  7 21:30:26 2019(r344899)
+++ head/sys/gnu/gcov/gcc_4_7.c Thu Mar  7 22:20:20 2019(r344900)
@@ -2,7 +2,7 @@
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
+// of the License.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of

Modified: head/sys/gnu/gcov/gcov_fs.c
==
--- head/sys/gnu/gcov/gcov_fs.c Thu Mar  7 21:30:26 2019(r344899)
+++ head/sys/gnu/gcov/gcov_fs.c Thu Mar  7 22:20:20 2019(r344900)
@@ -2,7 +2,7 @@
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
+// of the License.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344896 - in head/contrib/llvm/tools/clang: include/clang/AST include/clang/Basic lib/AST lib/CodeGen lib/Sema

2019-03-07 Thread Dimitry Andric
Author: dim
Date: Thu Mar  7 19:33:39 2019
New Revision: 344896
URL: https://svnweb.freebsd.org/changeset/base/344896

Log:
  Pull in r354937 from upstream clang trunk (by Jörg Sonnenberger):
  
Fix inline assembler constraint validation
  
The current constraint logic is both too lax and too strict. It fails
for input outside the [INT_MIN..INT_MAX] range, but it also
implicitly accepts 0 as value when it should not. Adjust logic to
handle both correctly.
  
Differential Revision: https://reviews.llvm.org/D58649
  
  Pull in r355491 from upstream clang trunk (by Hans Wennborg):
  
Inline asm constraints: allow ICE-like pointers for the "n"
constraint (PR40890)
  
Apparently GCC allows this, and there's code relying on it (see bug).
  
The idea is to allow expression that would have been allowed if they
were cast to int. So I based the code on how such a cast would be
done (the CK_PointerToIntegral case in
IntExprEvaluator::VisitCastExpr()).
  
Differential Revision: https://reviews.llvm.org/D58821
  
  These should fix assertions and errors when using the inline assembly
  "n" constraint in certain ways.
  
  In case of devel/valgrind, a pointer was used as the input for the
  constraint, which lead to "Assertion failed: (isInt() && "Invalid
  accessor"), function getInt".
  
  In case of math/secp256k1, a very large integer value was used as input
  for the constraint, which lead to "error: value '4624529908474429119'
  out of range for constraint 'n'".
  
  PR: 236216, 236194
  MFC after:  1 month
  X-MFC-With: r344779

Modified:
  head/contrib/llvm/tools/clang/include/clang/AST/APValue.h
  head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h
  head/contrib/llvm/tools/clang/lib/AST/APValue.cpp
  head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp
  head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaStmtAsm.cpp

Modified: head/contrib/llvm/tools/clang/include/clang/AST/APValue.h
==
--- head/contrib/llvm/tools/clang/include/clang/AST/APValue.h   Thu Mar  7 
19:32:01 2019(r344895)
+++ head/contrib/llvm/tools/clang/include/clang/AST/APValue.h   Thu Mar  7 
19:33:39 2019(r344896)
@@ -257,6 +257,12 @@ class APValue { (public)
 return const_cast(this)->getInt();
   }
 
+  /// Try to convert this value to an integral constant. This works if it's an
+  /// integer, null pointer, or offset from a null pointer. Returns true on
+  /// success.
+  bool toIntegralConstant(APSInt , QualType SrcTy,
+  const ASTContext ) const;
+
   APFloat () {
 assert(isFloat() && "Invalid accessor");
 return *(APFloat*)(char*)Data.buffer;

Modified: head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h
==
--- head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h  Thu Mar 
 7 19:32:01 2019(r344895)
+++ head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h  Thu Mar 
 7 19:33:39 2019(r344896)
@@ -807,6 +807,7 @@ class TargetInfo : public RefCountedBase {
 struct {
   int Min;
   int Max;
+  bool isConstrained;
 } ImmRange;
 llvm::SmallSet ImmSet;
 
@@ -817,6 +818,7 @@ class TargetInfo : public RefCountedBase {
 : Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()),
   Name(Name.str()) {
   ImmRange.Min = ImmRange.Max = 0;
+  ImmRange.isConstrained = false;
 }
 
 const std::string () const { return ConstraintStr; }
@@ -845,8 +847,9 @@ class TargetInfo : public RefCountedBase {
   return (Flags & CI_ImmediateConstant) != 0;
 }
 bool isValidAsmImmediate(const llvm::APInt ) const {
-  return (Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max)) ||
- ImmSet.count(Value.getZExtValue()) != 0;
+  if (!ImmSet.empty())
+return ImmSet.count(Value.getZExtValue()) != 0;
+  return !ImmRange.isConstrained || (Value.sge(ImmRange.Min) && 
Value.sle(ImmRange.Max));
 }
 
 void setIsReadWrite() { Flags |= CI_ReadWrite; }
@@ -858,6 +861,7 @@ class TargetInfo : public RefCountedBase {
   Flags |= CI_ImmediateConstant;
   ImmRange.Min = Min;
   ImmRange.Max = Max;
+  ImmRange.isConstrained = true;
 }
 void setRequiresImmediate(llvm::ArrayRef Exacts) {
   Flags |= CI_ImmediateConstant;
@@ -870,8 +874,6 @@ class TargetInfo : public RefCountedBase {
 }
 void setRequiresImmediate() {
   Flags |= CI_ImmediateConstant;
-  ImmRange.Min = INT_MIN;
-  ImmRange.Max = INT_MAX;
 }
 
 /// Indicate that this is an input operand that is tied to

Modified: head/contrib/llvm/tools/clang/lib/AST/APValue.cpp
==
--- 

svn commit: r344895 - head/sys/arm/allwinner/clkng

2019-03-07 Thread Emmanuel Vadot
Author: manu
Date: Thu Mar  7 19:32:01 2019
New Revision: 344895
URL: https://svnweb.freebsd.org/changeset/base/344895

Log:
  arm64: allwinner: a64: Add TCON clock
  
  The tcon clock need a mux table for it's parent, for now just
  list the parents twice.

Modified:
  head/sys/arm/allwinner/clkng/ccu_a64.c

Modified: head/sys/arm/allwinner/clkng/ccu_a64.c
==
--- head/sys/arm/allwinner/clkng/ccu_a64.c  Thu Mar  7 19:30:37 2019
(r344894)
+++ head/sys/arm/allwinner/clkng/ccu_a64.c  Thu Mar  7 19:32:01 2019
(r344895)
@@ -640,6 +640,15 @@ NM_CLK(de_clk,
 AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */
 
 /* TCON0/1 Needs mux table */
+static const char *tcon1_parents[] = {"pll_video0", "pll_video0", 
"pll_video1"};
+NM_CLK(tcon1_clk,
+  CLK_TCON1, "tcon1", tcon1_parents,
+  0x11C,
+  0, 0, 1, AW_CLK_FACTOR_FIXED,
+  0, 4, 0, 0,
+  24, 2,
+  31,
+  AW_CLK_HAS_MUX | AW_CLK_HAS_GATE);
 
 static const char *deinterlace_parents[] = {"pll_periph0", "pll_periph1"};
 NM_CLK(deinterlace_clk,
@@ -736,6 +745,7 @@ static struct aw_ccung_clk a64_ccu_clks[] = {
{ .type = AW_CLK_NM, .clk.nm = _clk},
{ .type = AW_CLK_NM, .clk.nm = _clk},
{ .type = AW_CLK_NM, .clk.nm = _clk},
+   { .type = AW_CLK_NM, .clk.nm = _clk},
{ .type = AW_CLK_NM, .clk.nm = _clk},
{ .type = AW_CLK_NM, .clk.nm = _sclk_clk},
{ .type = AW_CLK_NM, .clk.nm = _mclk_clk},
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344894 - in head/sys: arm/allwinner/clkng conf

2019-03-07 Thread Emmanuel Vadot
Author: manu
Date: Thu Mar  7 19:30:37 2019
New Revision: 344894
URL: https://svnweb.freebsd.org/changeset/base/344894

Log:
  arm64: allwinner: Add CCU DE2
  
  The Display Engine 2 have it's own Clock and Control Unit, add support
  for it.

Added:
  head/sys/arm/allwinner/clkng/ccu_de2.c   (contents, props changed)
Modified:
  head/sys/arm/allwinner/clkng/ccu_a64.c
  head/sys/conf/files.arm64

Modified: head/sys/arm/allwinner/clkng/ccu_a64.c
==
--- head/sys/arm/allwinner/clkng/ccu_a64.c  Thu Mar  7 19:28:47 2019
(r344893)
+++ head/sys/arm/allwinner/clkng/ccu_a64.c  Thu Mar  7 19:30:37 2019
(r344894)
@@ -289,6 +289,15 @@ NM_CLK_WITH_FRAC(pll_video0_clk,
 AW_CLK_HAS_LOCK,   /* flags */
 27000, 29700,  /* freq0, freq1 */
 24, 25);   /* mode sel, freq sel */
+static const char *pll_video0_2x_parents[] = {"pll_video0"};
+FIXED_CLK(pll_video0_2x_clk,
+CLK_PLL_VIDEO0_2X, /* id */
+"pll_video0-2x",   /* name */
+pll_video0_2x_parents, /* parent */
+0, /* freq */
+2, /* mult */
+1, /* div */
+0);/* flags */
 
 static const char *pll_ve_parents[] = {"osc24M"};
 NM_CLK_WITH_FRAC(pll_ve_clk,
@@ -750,6 +759,7 @@ static struct aw_ccung_clk a64_ccu_clks[] = {
{ .type = AW_CLK_FIXED, .clk.fixed = _audio_2x_clk},
{ .type = AW_CLK_FIXED, .clk.fixed = _audio_4x_clk},
{ .type = AW_CLK_FIXED, .clk.fixed = _audio_8x_clk},
+   { .type = AW_CLK_FIXED, .clk.fixed = _video0_2x_clk},
 };
 
 static struct aw_clk_init a64_init_clks[] = {

Added: head/sys/arm/allwinner/clkng/ccu_de2.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/allwinner/clkng/ccu_de2.c  Thu Mar  7 19:30:37 2019
(r344894)
@@ -0,0 +1,167 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2018 Emmanuel Vadot 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include "opt_soc.h"
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+/* Non exported clocks */
+#defineCLK_MIXER0_DIV  3
+#defineCLK_MIXER1_DIV  4
+#defineCLK_WB_DIV  5
+
+static struct aw_ccung_reset de2_ccu_resets[] = {
+   CCU_RESET(RST_MIXER0, 0x08, 0)
+   CCU_RESET(RST_MIXER1, 0x08, 1)
+   CCU_RESET(RST_WB, 0x08, 2)
+};
+
+static struct aw_ccung_gate de2_ccu_gates[] = {
+   CCU_GATE(CLK_BUS_MIXER0, "mixer0", "mixer0-div", 0x00, 0)
+   CCU_GATE(CLK_BUS_MIXER1, "mixer1", "mixer1-div", 0x00, 1)
+   CCU_GATE(CLK_BUS_WB, "wb", "wb-div", 0x00, 2)
+
+   CCU_GATE(CLK_MIXER0, "bus-mixer0", "bus-de", 0x04, 0)
+   CCU_GATE(CLK_MIXER1, "bus-mixer1", "bus-de", 0x04, 1)
+   CCU_GATE(CLK_WB, "bus-wb", "bus-de", 0x04, 2)
+};
+
+static const char *div_parents[] = {"de"};
+
+NM_CLK(mixer0_div_clk,
+CLK_MIXER0_DIV,/* id */
+"mixer0-div", div_parents, /* names, parents */
+0x0C,  /* offset */
+0, 0, 1, AW_CLK_FACTOR_FIXED,  /* N factor (fake)*/
+0, 4, 0, 0,/* M flags */
+0, 0,  /* mux */
+0, /* gate */
+ 

svn commit: r344893 - head/sys/arm/allwinner/clkng

2019-03-07 Thread Emmanuel Vadot
Author: manu
Date: Thu Mar  7 19:28:47 2019
New Revision: 344893
URL: https://svnweb.freebsd.org/changeset/base/344893

Log:
  arm: allwinner: Fix NM clock recalc
  
  If the NM clock is using a fractional divider the formula isn't the same.

Modified:
  head/sys/arm/allwinner/clkng/aw_clk_nm.c

Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c
==
--- head/sys/arm/allwinner/clkng/aw_clk_nm.cThu Mar  7 18:57:43 2019
(r344892)
+++ head/sys/arm/allwinner/clkng/aw_clk_nm.cThu Mar  7 19:28:47 2019
(r344893)
@@ -300,7 +300,11 @@ aw_clk_nm_recalc(struct clknode *clk, uint64_t *freq)
else
prediv = 1;
 
-   *freq = *freq / prediv / n / m;
+   /* For FRAC NM the formula is freq_parent * n / m */
+   if (sc->flags & AW_CLK_HAS_FRAC)
+   *freq = *freq * n / m;
+   else
+   *freq = *freq / prediv / n / m;
}
 
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344892 - head/stand/common

2019-03-07 Thread Emmanuel Vadot
On Thu, 7 Mar 2019 18:57:43 + (UTC)
Emmanuel Vadot  wrote:

> Author: manu
> Date: Thu Mar  7 18:57:43 2019
> New Revision: 344892
> URL: https://svnweb.freebsd.org/changeset/base/344892
> 
> Log:
>   stand/common/module: Apply style(9)
> 
> Modified:
>   head/stand/common/module.c
> 

 ian@ pointed out to me on irc there is still a lot of style(9)
problems, this was a emacs-auto-generated style.
 As I'm working on this file I applied style(9) in a crude way for now,
I'll do a full style(9) soon but the code burnt my eyes when I started
to read it.

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


svn commit: r344892 - head/stand/common

2019-03-07 Thread Emmanuel Vadot
Author: manu
Date: Thu Mar  7 18:57:43 2019
New Revision: 344892
URL: https://svnweb.freebsd.org/changeset/base/344892

Log:
  stand/common/module: Apply style(9)

Modified:
  head/stand/common/module.c

Modified: head/stand/common/module.c
==
--- head/stand/common/module.c  Thu Mar  7 18:24:16 2019(r344891)
+++ head/stand/common/module.c  Thu Mar  7 18:57:43 2019(r344892)
@@ -102,105 +102,105 @@ COMMAND_SET(load, "load", "load a kernel or module", c
 static int
 command_load(int argc, char *argv[])
 {
-struct preloaded_file *fp;
-char   *typestr;
-char   *prefix;
-char   *skip;
-intdflag, dofile, dokld, ch, error;
+   struct preloaded_file *fp;
+   char*typestr;
+   char*prefix;
+   char*skip;
+   int dflag, dofile, dokld, ch, error;
 
-dflag = dokld = dofile = 0;
-optind = 1;
-optreset = 1;
-typestr = NULL;
-if (argc == 1) {
-   command_errmsg = "no filename specified";
-   return (CMD_CRIT);
-}
-prefix = skip = NULL;
-while ((ch = getopt(argc, argv, "dkp:s:t:")) != -1) {
-   switch(ch) {
-   case 'd':
-   dflag++;
-   break;
-   case 'k':
-   dokld = 1;
-   break;
-   case 'p':
-   prefix = optarg;
-   break;
-   case 's':
-   skip = optarg;
-   break;
-   case 't':
-   typestr = optarg;
-   dofile = 1;
-   break;
-   case '?':
-   default:
-   /* getopt has already reported an error */
-   return (CMD_OK);
+   dflag = dokld = dofile = 0;
+   optind = 1;
+   optreset = 1;
+   typestr = NULL;
+   if (argc == 1) {
+   command_errmsg = "no filename specified";
+   return (CMD_CRIT);
}
-}
-argv += (optind - 1);
-argc -= (optind - 1);
-
-/*
- * Request to load a raw file?
- */
-if (dofile) {
-   if ((argc != 2) || (typestr == NULL) || (*typestr == 0)) {
-   command_errmsg = "invalid load type";
-   return (CMD_CRIT);
+   prefix = skip = NULL;
+   while ((ch = getopt(argc, argv, "dkp:s:t:")) != -1) {
+   switch(ch) {
+   case 'd':
+   dflag++;
+   break;
+   case 'k':
+   dokld = 1;
+   break;
+   case 'p':
+   prefix = optarg;
+   break;
+   case 's':
+   skip = optarg;
+   break;
+   case 't':
+   typestr = optarg;
+   dofile = 1;
+   break;
+   case '?':
+   default:
+   /* getopt has already reported an error */
+   return (CMD_OK);
+   }
}
+   argv += (optind - 1);
+   argc -= (optind - 1);
 
+   /*
+* Request to load a raw file?
+*/
+   if (dofile) {
+   if ((argc != 2) || (typestr == NULL) || (*typestr == 0)) {
+   command_errmsg = "invalid load type";
+   return (CMD_CRIT);
+   }
+
 #ifdef LOADER_VERIEXEC
-   if (strncmp(typestr, "manifest", 8) == 0) {
-   if (dflag > 0)
-   ve_debug_set(dflag);
-   return (load_manifest(argv[1], prefix, skip, NULL));
-   }
+   if (strncmp(typestr, "manifest", 8) == 0) {
+   if (dflag > 0)
+   ve_debug_set(dflag);
+   return (load_manifest(argv[1], prefix, skip, NULL));
+   }
 #endif
 
-   fp = file_findfile(argv[1], typestr);
-   if (fp) {
-   snprintf(command_errbuf, sizeof(command_errbuf),
-   "warning: file '%s' already loaded", argv[1]);
-   return (CMD_WARN);
-   }
+   fp = file_findfile(argv[1], typestr);
+   if (fp) {
+   snprintf(command_errbuf, sizeof(command_errbuf),
+ "warning: file '%s' already loaded", argv[1]);
+   return (CMD_WARN);
+   }
 
-   if (file_loadraw(argv[1], typestr, 1) != NULL)
-   return (CMD_OK);
+   if (file_loadraw(argv[1], typestr, 1) != NULL)
+   return (CMD_OK);
 
-   /* Failing to load mfs_root is never going to end well! */
-   if (strcmp("mfs_root", typestr) == 0)
-   return (CMD_FATAL);
+   /* Failing to load mfs_root is never going to end well! */
+   if (strcmp("mfs_root", typestr) == 0)
+   return (CMD_FATAL);
 
-   return (CMD_ERROR);
-}
-/*
- * Do we have explicit KLD load ?
- */
-if (dokld || 

Re: svn commit: r344857 - head/sys/fs/fuse

2019-03-07 Thread Conrad Meyer
Hi Konstantin,

On Thu, Mar 7, 2019 at 3:00 AM Konstantin Belousov  wrote:
>
> On Wed, Mar 06, 2019 at 10:56:49PM +, Conrad Meyer wrote:
> >   FUSE: Prevent trivial panic
> >
> >   When open(2) was invoked against a FUSE filesystem with an unexpected 
> > flags
> >   value (no O_RDONLY / O_RDWR / O_WRONLY), an assertion fired, causing 
> > panic.
>
> Did you miss O_EXEC ?

Nope.

> O_RDONLY is defined as zero, and we interpret the
> flags as having O_RDONLY if no other flags were passed.

The commit message probably could have been more clear.  The check
that we actually perform (and guard against with this change) is
((flags & (FREAD | FWRITE)) == 0).  FREAD is non-zero.  Alan has
empirically demonstrated that O_EXEC at the open(2) layer does not
translate into a FREAD flag at the VOP_OPEN() layer.

> VFS guarantees that one of the O_EXEC/FREAD/FWRITE flag is always
> there.  If it does not, it is bug.  See the code at the start of
> kern_openat().

Sure.  FUSE is not prepared to handle (flags & (O_EXEC|FREAD|FWRITE))
== O_EXEC at this time.  This revision just changes that
(user-inducible) scenario into an error, instead of a panic.

Like the commit message says, it is not intended to be the correct
long-term solution.

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


svn commit: r344891 - in head/usr.bin/seq: . tests

2019-03-07 Thread Conrad Meyer
Author: cem
Date: Thu Mar  7 18:24:16 2019
New Revision: 344891
URL: https://svnweb.freebsd.org/changeset/base/344891

Log:
  seq(1): Require user-provided format strings to contain a conversion
  
  This matches GNU seq, for example.
  
  For users that are looking for similar functionality, 'jot -b foo N' will
  print 'foo' N times.  See jot(1).
  
  PR:   236347
  Reported by:  
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/seq/seq.c
  head/usr.bin/seq/tests/seq_test.sh

Modified: head/usr.bin/seq/seq.c
==
--- head/usr.bin/seq/seq.c  Thu Mar  7 18:12:34 2019(r344890)
+++ head/usr.bin/seq/seq.c  Thu Mar  7 18:24:16 2019(r344891)
@@ -310,7 +310,8 @@ valid_format(const char *fmt)
}
}
 
-   return (conversions <= 1);
+   /* PR 236347 -- user format strings must have a conversion */
+   return (conversions == 1);
 }
 
 /*

Modified: head/usr.bin/seq/tests/seq_test.sh
==
--- head/usr.bin/seq/tests/seq_test.sh  Thu Mar  7 18:12:34 2019
(r344890)
+++ head/usr.bin/seq/tests/seq_test.sh  Thu Mar  7 18:24:16 2019
(r344891)
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 Conrad Meyer 
+# Copyright (c) 2019 Conrad Meyer 
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,22 @@ float_rounding_body()
atf_check -o inline:'1\n1.1\n1.2\n' seq 1 0.1 1.2
 }
 
+atf_test_case format_includes_conversion
+format_includes_conversion_head()
+{
+   atf_set "descr" "Check for correct user-provided format strings"
+}
+format_includes_conversion_body()
+{
+   # PR 236347
+   atf_check -s exit:1 -o empty -e match:"invalid format string" \
+   seq -f foo 3
+   atf_check -s exit:0 -o inline:'foo1\nfoo2\n' -e empty \
+   seq -f foo%g 2
+}
+
 atf_init_test_cases()
 {
atf_add_test_case float_rounding
+   atf_add_test_case format_includes_conversion
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344869 - head/sys/gnu/gcov

2019-03-07 Thread Brooks Davis
On Thu, Mar 07, 2019 at 03:53:48AM +, Matt Macy wrote:
> Author: mmacy
> Date: Thu Mar  7 03:53:48 2019
> New Revision: 344869
> URL: https://svnweb.freebsd.org/changeset/base/344869
> 
> Log:
>   add GPL text in addition to SPDX tags as requested by core
>   
>   MFC after:  1 week
> 
> Modified:
>   head/sys/gnu/gcov/gcc_4_7.c
>   head/sys/gnu/gcov/gcov_fs.c
> 
> Modified: head/sys/gnu/gcov/gcc_4_7.c
> ==
> --- head/sys/gnu/gcov/gcc_4_7.c   Thu Mar  7 03:50:34 2019
> (r344868)
> +++ head/sys/gnu/gcov/gcc_4_7.c   Thu Mar  7 03:53:48 2019
> (r344869)
> @@ -1,4 +1,18 @@
>  // SPDX-License-Identifier: GPL-2.0
> +// This program is free software; you can redistribute it and/or
> +// modify it under the terms of the GNU General Public License
> +// as published by the Free Software Foundation; either version 2
> +// of the License, or (at your option) any later version.

My apologies.  I provided the wrong text here (I forgot about this
feature of the default boilerplate) and this last line should be:

// of the License.

I'll commit a correction later today if you don't beat me to it.

Sorry for the error,
Brooks


signature.asc
Description: PGP signature


svn commit: r344883 - in head: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys contrib/ntp/libntp contr...

2019-03-07 Thread Cy Schubert
Author: cy
Date: Thu Mar  7 13:36:00 2019
New Revision: 344883
URL: https://svnweb.freebsd.org/changeset/base/344883

Log:
  MFV r344878:
  
  4.2.8p12 --> 4.2.8p13
  
  MFC after:immediately
  Security: CVE-2019-8936
VuXML: c2576e14-36e2-11e9-9eda-206a8a720317
  Obtained from:nwtime.org

Added:
  head/contrib/ntp/libntp/xsbprintf.c
 - copied unchanged from r344878, vendor/ntp/dist/libntp/xsbprintf.c
Modified:
  head/contrib/ntp/COPYRIGHT
  head/contrib/ntp/ChangeLog
  head/contrib/ntp/CommitLog
  head/contrib/ntp/Makefile.in
  head/contrib/ntp/NEWS
  head/contrib/ntp/aclocal.m4
  head/contrib/ntp/adjtimed/Makefile.in
  head/contrib/ntp/build
  head/contrib/ntp/clockstuff/Makefile.in
  head/contrib/ntp/config.h.in
  head/contrib/ntp/configure
  head/contrib/ntp/configure.ac
  head/contrib/ntp/include/Makefile.in
  head/contrib/ntp/include/isc/Makefile.in
  head/contrib/ntp/include/ntp_calendar.h
  head/contrib/ntp/include/ntp_stdlib.h
  head/contrib/ntp/include/ntpd.h
  head/contrib/ntp/include/parse.h
  head/contrib/ntp/kernel/Makefile.in
  head/contrib/ntp/kernel/sys/Makefile.in
  head/contrib/ntp/libntp/Makefile.am
  head/contrib/ntp/libntp/Makefile.in
  head/contrib/ntp/libntp/authreadkeys.c
  head/contrib/ntp/libntp/calyearstart.c
  head/contrib/ntp/libntp/ntp_calendar.c
  head/contrib/ntp/libntp/work_fork.c
  head/contrib/ntp/libparse/Makefile.in
  head/contrib/ntp/libparse/clk_trimtsip.c
  head/contrib/ntp/libparse/gpstolfp.c
  head/contrib/ntp/ntpd/Makefile.in
  head/contrib/ntp/ntpd/invoke-ntp.conf.texi
  head/contrib/ntp/ntpd/invoke-ntp.keys.texi
  head/contrib/ntp/ntpd/invoke-ntpd.texi
  head/contrib/ntp/ntpd/ntp.conf.5man
  head/contrib/ntp/ntpd/ntp.conf.5mdoc
  head/contrib/ntp/ntpd/ntp.conf.html
  head/contrib/ntp/ntpd/ntp.conf.man.in
  head/contrib/ntp/ntpd/ntp.conf.mdoc.in
  head/contrib/ntp/ntpd/ntp.keys.5man
  head/contrib/ntp/ntpd/ntp.keys.5mdoc
  head/contrib/ntp/ntpd/ntp.keys.html
  head/contrib/ntp/ntpd/ntp.keys.man.in
  head/contrib/ntp/ntpd/ntp.keys.mdoc.in
  head/contrib/ntp/ntpd/ntp_config.c
  head/contrib/ntp/ntpd/ntp_control.c
  head/contrib/ntp/ntpd/ntp_crypto.c
  head/contrib/ntp/ntpd/ntp_loopfilter.c
  head/contrib/ntp/ntpd/ntp_proto.c
  head/contrib/ntp/ntpd/ntp_request.c
  head/contrib/ntp/ntpd/ntp_timer.c
  head/contrib/ntp/ntpd/ntpd-opts.c
  head/contrib/ntp/ntpd/ntpd-opts.h
  head/contrib/ntp/ntpd/ntpd.1ntpdman
  head/contrib/ntp/ntpd/ntpd.1ntpdmdoc
  head/contrib/ntp/ntpd/ntpd.c
  head/contrib/ntp/ntpd/ntpd.html
  head/contrib/ntp/ntpd/ntpd.man.in
  head/contrib/ntp/ntpd/ntpd.mdoc.in
  head/contrib/ntp/ntpd/refclock_bancomm.c
  head/contrib/ntp/ntpd/refclock_jupiter.c
  head/contrib/ntp/ntpd/refclock_parse.c
  head/contrib/ntp/ntpdate/Makefile.in
  head/contrib/ntp/ntpdate/ntpdate.c
  head/contrib/ntp/ntpdc/Makefile.in
  head/contrib/ntp/ntpdc/invoke-ntpdc.texi
  head/contrib/ntp/ntpdc/nl.pl
  head/contrib/ntp/ntpdc/ntpdc-opts.c
  head/contrib/ntp/ntpdc/ntpdc-opts.h
  head/contrib/ntp/ntpdc/ntpdc.1ntpdcman
  head/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
  head/contrib/ntp/ntpdc/ntpdc.html
  head/contrib/ntp/ntpdc/ntpdc.man.in
  head/contrib/ntp/ntpdc/ntpdc.mdoc.in
  head/contrib/ntp/ntpdc/ntpdc_ops.c
  head/contrib/ntp/ntpq/Makefile.in
  head/contrib/ntp/ntpq/invoke-ntpq.texi
  head/contrib/ntp/ntpq/ntpq-opts.c
  head/contrib/ntp/ntpq/ntpq-opts.h
  head/contrib/ntp/ntpq/ntpq.1ntpqman
  head/contrib/ntp/ntpq/ntpq.1ntpqmdoc
  head/contrib/ntp/ntpq/ntpq.html
  head/contrib/ntp/ntpq/ntpq.man.in
  head/contrib/ntp/ntpq/ntpq.mdoc.in
  head/contrib/ntp/ntpsnmpd/Makefile.in
  head/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
  head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
  head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.html
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
  head/contrib/ntp/packageinfo.sh
  head/contrib/ntp/parseutil/Makefile.in
  head/contrib/ntp/scripts/Makefile.in
  head/contrib/ntp/scripts/build/Makefile.in
  head/contrib/ntp/scripts/build/check--help
  head/contrib/ntp/scripts/calc_tickadj/Makefile.in
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in
  head/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi
  head/contrib/ntp/scripts/invoke-plot_summary.texi
  head/contrib/ntp/scripts/invoke-summary.texi
  head/contrib/ntp/scripts/lib/Makefile.in
  head/contrib/ntp/scripts/ntp-wait/Makefile.in
  head/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi
  head/contrib/ntp/scripts/ntp-wait/ntp-wait-opts
  head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman
  

svn commit: r344875 - head/usr.bin/ncal

2019-03-07 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Thu Mar  7 11:09:25 2019
New Revision: 344875
URL: https://svnweb.freebsd.org/changeset/base/344875

Log:
  Do not reference deskutils/cal from cal.1.
  
  The ports version of cal is an abandonware so in order to minimize the
  potential bit rot of our documentation let's not mention it at all.
  Interested users are going to find suitable alternatives anyway on their
  own.
  
  Reported by:  bapt
  Approved by:  bapt (src)
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D19492

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

Modified: head/usr.bin/ncal/ncal.1
==
--- head/usr.bin/ncal/ncal.1Thu Mar  7 10:19:40 2019(r344874)
+++ head/usr.bin/ncal/ncal.1Thu Mar  7 11:09:25 2019(r344875)
@@ -202,9 +202,3 @@ will give varying results.
 .Pp
 It is not possible to display Monday as the first day of the week with
 .Nm cal .
-If you want to use
-.Nm cal
-and want to have Mondays to start the week, use the ports version
-.Pq Pa deskutils/cal
-rather than the base system
-.Nm cal .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344876 - head/tests/sys/netpfil/pf

2019-03-07 Thread Kristof Provost
Author: kp
Date: Thu Mar  7 11:09:29 2019
New Revision: 344876
URL: https://svnweb.freebsd.org/changeset/base/344876

Log:
  pf tests: Accelerate tests
  
  Make the tests run slightly faster by having pft_ping.py end the capture
  of packets as soon as it sees the expected packet, rather than
  continuing to sniff.
  
  MFC after:2 weeks

Modified:
  head/tests/sys/netpfil/pf/pft_ping.py

Modified: head/tests/sys/netpfil/pf/pft_ping.py
==
--- head/tests/sys/netpfil/pf/pft_ping.py   Thu Mar  7 11:09:25 2019
(r344875)
+++ head/tests/sys/netpfil/pf/pft_ping.py   Thu Mar  7 11:09:29 2019
(r344876)
@@ -8,26 +8,38 @@ import threading
 PAYLOAD_MAGIC = 0x42c0ffee
 
 class Sniffer(threading.Thread):
-   def __init__(self, recvif):
+   def __init__(self, args, check_function):
threading.Thread.__init__(self)
 
-   self._recvif = recvif
+   self._args = args
+   self._recvif = args.recvif[0]
+   self._check_function = check_function
+   self.foundCorrectPacket = False
 
self.start()
 
+   def _checkPacket(self, packet):
+   ret = self._check_function(self._args, packet)
+   if ret:
+   self.foundCorrectPacket = True
+   return ret
+
def run(self):
-   self.packets = sp.sniff(iface=self._recvif, timeout=3)
+   self.packets = sp.sniff(iface=self._recvif,
+   stop_filter=self._checkPacket, timeout=3)
 
-def check_ping_request(packet, dst_ip, args):
+def check_ping_request(args, packet):
if args.ip6:
-   return check_ping6_request(packet, dst_ip, args)
+   return check_ping6_request(args, packet)
else:
-   return check_ping4_request(packet, dst_ip, args)
+   return check_ping4_request(args, packet)
 
-def check_ping4_request(packet, dst_ip, args):
+def check_ping4_request(args, packet):
"""
Verify that the packet matches what we'd have sent
"""
+   dst_ip = args.to[0]
+
ip = packet.getlayer(sp.IP)
if not ip:
return False
@@ -54,13 +66,14 @@ def check_ping4_request(packet, dst_ip, args):
% (ip.tos, args.expect_tos[0])
return False
 
-
return True
 
-def check_ping6_request(packet, dst_ip, args):
+def check_ping6_request(args, packet):
"""
Verify that the packet matches what we'd have sent
"""
+   dst_ip = args.to[0]
+
ip = packet.getlayer(sp.IPv6)
if not ip:
return False
@@ -124,7 +137,7 @@ def main():
 
sniffer = None
if not args.recvif is None:
-   sniffer = Sniffer(args.recvif[0])
+   sniffer = Sniffer(args, check_ping_request)
 
if args.ip6:
ping6(args.sendif[0], args.to[0], args)
@@ -134,12 +147,10 @@ def main():
if sniffer:
sniffer.join()
 
-   for packet in sniffer.packets:
-   if check_ping_request(packet, args.to[0], args):
-   sys.exit(0)
-
-   # We did not get the packet we expected
-   sys.exit(1)
+   if sniffer.foundCorrectPacket:
+   sys.exit(0)
+   else:
+   sys.exit(1)
 
 if __name__ == '__main__':
main()
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344857 - head/sys/fs/fuse

2019-03-07 Thread Konstantin Belousov
On Wed, Mar 06, 2019 at 10:56:49PM +, Conrad Meyer wrote:
> Author: cem
> Date: Wed Mar  6 22:56:49 2019
> New Revision: 344857
> URL: https://svnweb.freebsd.org/changeset/base/344857
> 
> Log:
>   FUSE: Prevent trivial panic
>   
>   When open(2) was invoked against a FUSE filesystem with an unexpected flags
>   value (no O_RDONLY / O_RDWR / O_WRONLY), an assertion fired, causing panic.
Did you miss O_EXEC ?   O_RDONLY is defined as zero, and we interpret the
flags as having O_RDONLY if no other flags were passed.

VFS guarantees that one of the O_EXEC/FREAD/FWRITE flag is always
there.  If it does not, it is bug.  See the code at the start of
kern_openat().

>   
>   For now, prevent the panic by rejecting such VOP_OPENs with EINVAL.
>   
>   This is not considered the correct long term fix, but does prevent an
>   unprivileged denial-of-service.
>   
>   PR: 236329
>   Reported by:asomers
>   Reviewed by:asomers
>   Sponsored by:   Dell EMC Isilon
> 
> Modified:
>   head/sys/fs/fuse/fuse_vnops.c
> 
> Modified: head/sys/fs/fuse/fuse_vnops.c
> ==
> --- head/sys/fs/fuse/fuse_vnops.c Wed Mar  6 22:13:53 2019
> (r344856)
> +++ head/sys/fs/fuse/fuse_vnops.c Wed Mar  6 22:56:49 2019
> (r344857)
> @@ -1174,6 +1174,9 @@ fuse_vnop_open(struct vop_open_args *ap)
>   if (fuse_isdeadfs(vp)) {
>   return ENXIO;
>   }
> + if ((mode & (FREAD | FWRITE)) == 0)
> + return EINVAL;
> +
>   fvdat = VTOFUD(vp);
>  
>   if (vnode_isdir(vp)) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344874 - head/usr.bin/ncal

2019-03-07 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Thu Mar  7 10:19:40 2019
New Revision: 344874
URL: https://svnweb.freebsd.org/changeset/base/344874

Log:
  Document that cal(1) cannot start a week with Monday.
  
  Reviewed by:  bcr
  Approved by:  bcr (doc)
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D19491

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

Modified: head/usr.bin/ncal/ncal.1
==
--- head/usr.bin/ncal/ncal.1Thu Mar  7 10:01:32 2019(r344873)
+++ head/usr.bin/ncal/ncal.1Thu Mar  7 10:19:40 2019(r344874)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 08, 2018
+.Dd March 7, 2019
 .Dt CAL 1
 .Os
 .Sh NAME
@@ -199,3 +199,12 @@ codes is historically naive for many countries.
 .Pp
 Not all options are compatible and using them in different orders
 will give varying results.
+.Pp
+It is not possible to display Monday as the first day of the week with
+.Nm cal .
+If you want to use
+.Nm cal
+and want to have Mondays to start the week, use the ports version
+.Pq Pa deskutils/cal
+rather than the base system
+.Nm cal .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344873 - in head/sys: amd64/amd64 i386/i386

2019-03-07 Thread Andrey V. Elsukov
Author: ae
Date: Thu Mar  7 10:01:32 2019
New Revision: 344873
URL: https://svnweb.freebsd.org/changeset/base/344873

Log:
  Fix typo.
  
  MFC after:1 week

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

Modified: head/sys/amd64/amd64/vm_machdep.c
==
--- head/sys/amd64/amd64/vm_machdep.c   Thu Mar  7 08:43:20 2019
(r344872)
+++ head/sys/amd64/amd64/vm_machdep.c   Thu Mar  7 10:01:32 2019
(r344873)
@@ -86,7 +86,7 @@ _Static_assert(OFFSETOF_CURTHREAD == offsetof(struct p
 _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb),
 "OFFSETOF_CURPCB does not correspond with offset of pc_curpcb.");
 _Static_assert(OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf),
-"OFFSETOF_MONINORBUF does not correspond with offset of pc_monitorbuf.");
+"OFFSETOF_MONITORBUF does not correspond with offset of pc_monitorbuf.");
 
 struct savefpu *
 get_pcb_user_save_td(struct thread *td)

Modified: head/sys/i386/i386/vm_machdep.c
==
--- head/sys/i386/i386/vm_machdep.c Thu Mar  7 08:43:20 2019
(r344872)
+++ head/sys/i386/i386/vm_machdep.c Thu Mar  7 10:01:32 2019
(r344873)
@@ -95,7 +95,7 @@ _Static_assert(OFFSETOF_CURTHREAD == offsetof(struct p
 _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb),
 "OFFSETOF_CURPCB does not correspond with offset of pc_curpcb.");
 _Static_assert(__OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf),
-"__OFFSETOF_MONINORBUF does not correspond with offset of pc_monitorbuf.");
+"__OFFSETOF_MONITORBUF does not correspond with offset of pc_monitorbuf.");
 
 union savefpu *
 get_pcb_user_save_td(struct thread *td)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344872 - head/sys/netinet

2019-03-07 Thread Michael Tuexen
Author: tuexen
Date: Thu Mar  7 08:43:20 2019
New Revision: 344872
URL: https://svnweb.freebsd.org/changeset/base/344872

Log:
  After removing an entry from the stream scheduler list, set the pointers
  to NULL, since we are checking for it in case the element gets inserted
  again.
  
  This issue was found by running syzkaller.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_ss_functions.c

Modified: head/sys/netinet/sctp_ss_functions.c
==
--- head/sys/netinet/sctp_ss_functions.cThu Mar  7 04:43:08 2019
(r344871)
+++ head/sys/netinet/sctp_ss_functions.cThu Mar  7 08:43:20 2019
(r344872)
@@ -78,9 +78,10 @@ sctp_ss_default_clear(struct sctp_tcb *stcb, struct sc
SCTP_TCB_SEND_LOCK(stcb);
}
while (!TAILQ_EMPTY(>ss_data.out.wheel)) {
-   struct sctp_stream_out *strq = 
TAILQ_FIRST(>ss_data.out.wheel);
+   struct sctp_stream_out *strq;
 
-   TAILQ_REMOVE(>ss_data.out.wheel, 
TAILQ_FIRST(>ss_data.out.wheel), ss_params.rr.next_spoke);
+   strq = TAILQ_FIRST(>ss_data.out.wheel);
+   TAILQ_REMOVE(>ss_data.out.wheel, strq, 
ss_params.rr.next_spoke);
strq->ss_params.rr.next_spoke.tqe_next = NULL;
strq->ss_params.rr.next_spoke.tqe_prev = NULL;
}
@@ -793,12 +794,17 @@ static void
 sctp_ss_fcfs_clear(struct sctp_tcb *stcb, struct sctp_association *asoc,
 int clear_values, int holds_lock)
 {
+   struct sctp_stream_queue_pending *sp;
+
if (clear_values) {
if (holds_lock == 0) {
SCTP_TCB_SEND_LOCK(stcb);
}
while (!TAILQ_EMPTY(>ss_data.out.list)) {
-   TAILQ_REMOVE(>ss_data.out.list, 
TAILQ_FIRST(>ss_data.out.list), ss_next);
+   sp = TAILQ_FIRST(>ss_data.out.list);
+   TAILQ_REMOVE(>ss_data.out.list, sp, ss_next);
+   sp->ss_next.tqe_next = NULL;
+   sp->ss_next.tqe_prev = NULL;
}
if (holds_lock == 0) {
SCTP_TCB_SEND_UNLOCK(stcb);
@@ -861,6 +867,8 @@ sctp_ss_fcfs_remove(struct sctp_tcb *stcb, struct sctp
((sp->ss_next.tqe_next != NULL) ||
(sp->ss_next.tqe_prev != NULL))) {
TAILQ_REMOVE(>ss_data.out.list, sp, ss_next);
+   sp->ss_next.tqe_next = NULL;
+   sp->ss_next.tqe_prev = NULL;
}
if (holds_lock == 0) {
SCTP_TCB_SEND_UNLOCK(stcb);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"