svn commit: r281785 - in head: share/man/man9 sys/kern

2015-04-20 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Apr 20 20:03:26 2015
New Revision: 281785
URL: https://svnweb.freebsd.org/changeset/base/281785

Log:
  Always send log(9) messages to the message buffer.
  
  It is truer to the semantics of logging for messages to *always*
  go to the message buffer, where they can eventually be collected
  and, in fact, be put into a log file.
  
  This restores the behavior prior to r70239, which seems to have
  changed it inadvertently.
  
  Submitted by: Eric Badger 
  Reviewed by:  jhb
  Approved by:  kib (mentor)
  Obtained from:Dell Inc.
  MFC after:1 week

Modified:
  head/share/man/man9/printf.9
  head/sys/kern/subr_prf.c

Modified: head/share/man/man9/printf.9
==
--- head/share/man/man9/printf.9Mon Apr 20 20:03:07 2015
(r281784)
+++ head/share/man/man9/printf.9Mon Apr 20 20:03:26 2015
(r281785)
@@ -67,7 +67,8 @@ The
 .Fn log
 function sends the message to the kernel logging facility, using
 the log level as indicated by
-.Fa pri .
+.Fa pri ,
+and to the console if no process is yet reading the log.
 .Pp
 Each of these related functions use the
 .Fa fmt

Modified: head/sys/kern/subr_prf.c
==
--- head/sys/kern/subr_prf.cMon Apr 20 20:03:07 2015(r281784)
+++ head/sys/kern/subr_prf.cMon Apr 20 20:03:26 2015(r281785)
@@ -295,7 +295,7 @@ log(int level, const char *fmt, ...)
va_list ap;
 
va_start(ap, fmt);
-   (void)_vprintf(level, log_open ? TOLOG : TOCONS, fmt, ap);
+   (void)_vprintf(level, log_open ? TOLOG : TOCONS | TOLOG, fmt, ap);
va_end(ap);
 
msgbuftrigger = 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r281787 - head/sbin/dmesg

2015-04-20 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Apr 20 20:07:39 2015
New Revision: 281787
URL: https://svnweb.freebsd.org/changeset/base/281787

Log:
  dmesg: accommodate message buffer growth between the sysctl calls
  
  Allocate 12.5% extra space to avoid ENOMEM when the message buffer
  is growing steadily.
  
  Reported by:  Steve Wahl  (and tested)
  Approved by:  kib (mentor)
  Obtained from:Dell Inc.
  MFC after:1 week

Modified:
  head/sbin/dmesg/dmesg.c

Modified: head/sbin/dmesg/dmesg.c
==
--- head/sbin/dmesg/dmesg.c Mon Apr 20 20:06:25 2015(r281786)
+++ head/sbin/dmesg/dmesg.c Mon Apr 20 20:07:39 2015(r281787)
@@ -118,6 +118,9 @@ main(int argc, char *argv[])
 */
if (sysctlbyname("kern.msgbuf", NULL, &buflen, NULL, 0) == -1)
err(1, "sysctl kern.msgbuf");
+   /* Allocate extra room for growth between the sysctl calls. */
+   buflen += buflen/8;
+   /* Allocate more than sysctl sees, for room to append \n\0. */
if ((bp = malloc(buflen + 2)) == NULL)
errx(1, "malloc failed");
if (sysctlbyname("kern.msgbuf", bp, &buflen, NULL, 0) == -1)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r281922 - head/usr.bin/nfsstat

2015-04-24 Thread Eric van Gyzen
On 04/24/2015 10:33, John Baldwin wrote:
> On Friday, April 24, 2015 02:31:31 PM Sergey Kandaurov wrote:
>> On 24 April 2015 at 10:58, Edward Tomasz Napierala  wrote:
>>> Author: trasz
>>> Date: Fri Apr 24 07:57:59 2015
>>> New Revision: 281922
>>> URL: https://svnweb.freebsd.org/changeset/base/281922
>>>
>>> Log:
>>>   Make nfsstat(1) build with WARNS=6.
>>>
>>>   Sponsored by: The FreeBSD Foundation
>>>
>>> Modified:
>>>   head/usr.bin/nfsstat/Makefile
>>>   head/usr.bin/nfsstat/nfsstat.c
>>>
>>> Modified: head/usr.bin/nfsstat/Makefile
>>> ==
>>> --- head/usr.bin/nfsstat/Makefile   Fri Apr 24 07:52:21 2015
>>> (r281921)
>>> +++ head/usr.bin/nfsstat/Makefile   Fri Apr 24 07:57:59 2015
>>> (r281922)
>>> @@ -6,6 +6,4 @@ CFLAGS+=-DNFS
>>>
>>>  LIBADD=kvm
>>>
>>> -WARNS?=3
>>> -
>>>  .include 
>>>
>>> Modified: head/usr.bin/nfsstat/nfsstat.c
>>> ==
>>> --- head/usr.bin/nfsstat/nfsstat.c  Fri Apr 24 07:52:21 2015
>>> (r281921)
>>> +++ head/usr.bin/nfsstat/nfsstat.c  Fri Apr 24 07:57:59 2015
>>> (r281922)
>>> @@ -70,15 +70,6 @@ static const char rcsid[] =
>>>  #include 
>>>  #include 
>>>
>>> -struct nlist nl[] = {
>>> -#defineN_NFSSTAT   0
>>> -   { .n_name = "nfsstats" },
>>> -#defineN_NFSRVSTAT 1
>>> -   { .n_name = "nfsrvstats" },
>>> -   { .n_name = NULL },
>>> -};
>>> -kvm_t *kd;
>>> -
>>>  static int widemode = 0;
>>>  static int zflag = 0;
>>>  static int printtitle = 1;
>>>
>>
>> Now that nfsstat no longer uses kvm to extract statistics, it could be
>> further trimmed.
>> - no longer link with kvm
>> - un-document -M/-N options but still kept (?) for backward compatibility
>> - cleanup from the previous sysctl/kvm usage.
> 
> If these are just global structures in the kernel it would be nice to keep
> -N/-M support for use in crash dump reporting.  This just broke crashinfo
> (again), so please either restore KVM support for crash reporting, or
> remove nfsstat from crashinfo.

...or implement debugger scripts that provide similar functionality, and call 
those from crashinfo.

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


Re: svn commit: r282672 - head/etc/rc.d

2015-05-11 Thread Eric van Gyzen
On 05/11/2015 15:37, Devin Teske wrote:
> 
>> On May 11, 2015, at 12:18 PM, Brooks Davis > > wrote:
>>
>> On Sun, May 10, 2015 at 03:45:48PM -0400, John Baldwin wrote:
>>>
 On May 8, 2015, at 19:36, Xin LI >>> > wrote:

 Author: delphij
 Date: Fri May  8 23:36:31 2015
 New Revision: 282672
 URL: https://svnweb.freebsd.org/changeset/base/282672

 Log:
 Always convert uuid to lower case.

 MFC after:2 weeks

 Modified:
 head/etc/rc.d/hostid

 Modified: head/etc/rc.d/hostid
 ==
 --- head/etc/rc.d/hostidFri May  8 23:29:42 2015(r282671)
 +++ head/etc/rc.d/hostidFri May  8 23:36:31 2015(r282672)
 @@ -58,7 +58,7 @@ hostid_set()

 valid_hostid()
 {
 -uuid=$1
 +uuid=$(echo $1 | tr '[:upper:]' '[:lower:]')
>>>
>>> tr is in /usr/bin so this breaks systems with a separate /usr.  Perhaps you 
>>> could use dd with conv=lcase instead?
>>
>> Alterntively, a shell function "ltr" exists in rc.subr for this purpose.
>>
> 
> ltr would not work in this situation, for multiple reasons.
> 
> 1. ltr doesn’t support character classes
> 2. ltr is for replacing one or more characters (cannot be a class) with a 
> single string (of variable length, 0+).
> 
> In /etc/networks.subr you can see an example usage of ltr:
> 
> 287   
> _punct=".-/+"
> 288   
> ltr ${_if} "${_punct}" '_' _if
> 
> 
> The result of this is to take a value of (for example) foo.bar and replace
> any occurrences of period, minus, forward slash, or plus with instead
> a single underscore. The result is stuffed into the variable “_if” (over-
> writing previous contents which may have contained aforementioned
> characters replaced with underscore).
> 
> An attempt to use ltr in the below fashion:
> 
> ltr $string ‘[:lower:]’ ‘[:upper:]’ somevar
> 
> would surely fail.
> 
> While it is indeed *possible* to write a find/replace function in native-
> shell that supports character classes, it would not be a small function.
> The primary issue is that you need to know what the character that
> matched the class and there aren’t any built-ins that provide this info.
> 
> For example:
> 
> case “$src” in *[[:lower:]]*)
> 
> will trigger when you have a lower-case character that needs conversion
> to upper-case (or opposite if using *[[:upper:]]*) BUT you won’t know
> what the character was that you matched (so how can you know which
> upper-case character to supplant)?
> 
> The function will have to resort to complicated substring mechanics or
> any other seldom known procedure.
> 
> I’ll have a noodle on it and see what I can come up with. It’s not exactly
> immediately coming to me how to do this in any simple fashion while
> maintaining efficiency (read: by not iterating over every single character
> and also by not having a giant massive case statement with every letter
> spelled out — coming up with a solution that embraces the use of the
> character class I would believe to be more efficient).

John Baldwin suggested "dd conv=lcase", since dd is in /bin.

$ echo MixedCaseLetters | dd conv=lcase 2>/dev/null
mixedcaseletters

$ type dd
dd is /bin/dd

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

Re: svn commit: r283136 - head/sys/netinet

2015-05-20 Thread Eric van Gyzen
On 05/20/2015 02:33, Lawrence Stewart wrote:
> On 05/20/15 14:24, Hiren Panchasara wrote:
>> On 05/20/15 at 02:13P, Lawrence Stewart wrote:
>>> Hi Hiren,
>>>
>>> On 05/20/15 11:08, Hiren Panchasara wrote:
 Author: hiren Date: Wed May 20 01:08:01 2015 New Revision:
 283136 URL: https://svnweb.freebsd.org/changeset/base/283136

 Log: Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to
 expire and purge all entries in hostcache immediately.

 In collaboration with: bz, rwatson MFC after:  1 week Relnotes:
 yes Sponsored by:  Limelight Networks
>>>
>>> Why introduce a new sysctl and not change the existing behaviour
>>> of net.inet.tcp.hostcache.purge?
>>
>> I thought it'd make more sense to keep the existing behavior as is
>> and provide new knob for the new behavior.
> 
> Don't think so - why would deferring a purge to the next purge run be
> useful compared to purging immediately? I'd strongly suggest you adapt
> this change to the existing purge sysctl. I can't see why anyone would
> miss the old functionality.

I am generally wary of a question such as "Why would anyone want...", because 
as soon as the code is released, someone answers it.

That being said, I have always wanted Hiren's purgenow behavior, and I've 
always been annoyed by the lazy-purge behavior.  I would suggest implementing 
Lawrence's suggestion, but NOT MFC'ing it, since that would be a disruptive 
change.

Thanks for your work, Hiren.

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


Re: svn commit: r283136 - head/sys/netinet

2015-05-21 Thread Eric van Gyzen
On 05/21/2015 16:03, Hiren Panchasara wrote:
> On 05/21/15 at 03:27P, Lawrence Stewart wrote:
>> On 05/20/15 23:19, Eric van Gyzen wrote:
>>> On 05/20/2015 02:33, Lawrence Stewart wrote:
>>>> On 05/20/15 14:24, Hiren Panchasara wrote:
>>>>> On 05/20/15 at 02:13P, Lawrence Stewart wrote:
>>>>>> Hi Hiren,
>>>>>>
>>>>>> On 05/20/15 11:08, Hiren Panchasara wrote:
>>>>>>> Author: hiren Date: Wed May 20 01:08:01 2015 New Revision:
>>>>>>> 283136 URL: https://svnweb.freebsd.org/changeset/base/283136
>>>>>>>
>>>>>>> Log: Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to
>>>>>>> expire and purge all entries in hostcache immediately.
>>>>>>>
>>>>>>> In collaboration with:  bz, rwatson MFC after:  1 week Relnotes:
>>>>>>> yes Sponsored by:   Limelight Networks
>>>>>>
>>>>>> Why introduce a new sysctl and not change the existing behaviour
>>>>>> of net.inet.tcp.hostcache.purge?
>>>>>
>>>>> I thought it'd make more sense to keep the existing behavior as is
>>>>> and provide new knob for the new behavior.
>>>>
>>>> Don't think so - why would deferring a purge to the next purge run be
>>>> useful compared to purging immediately? I'd strongly suggest you adapt
>>>> this change to the existing purge sysctl. I can't see why anyone would
>>>> miss the old functionality.
>>>
>>> I am generally wary of a question such as "Why would anyone want...", 
>>> because as soon as the code is released, someone answers it.
>>>
>>> That being said, I have always wanted Hiren's purgenow behavior, and I've 
>>> always been annoyed by the lazy-purge behavior.  I would suggest 
>>> implementing Lawrence's suggestion, but NOT MFC'ing it, since that would be 
>>> a disruptive change.
>>>
>>> Thanks for your work, Hiren.
>>
>> I see no reason not to MFC it - it's not a POLA violation for a stable
>> branch. When the user requests a purge, it's surely equally as good (and
>> I think anyone of right mind would argue better ;) to purge immediately
>> than some number of seconds "n" in the future, where "n" is between 1
>> and the value of net.inet.tcp.hostcache.prune.
> 
> I *do* want to MFC the change. And if there are no major objections, I'll go
> ahead with what Lawrence is suggesting: changing current purge behavior in 
> -head
> and 10.

I don't strongly object.  I like the new behavior, and I expect most people 
would, as long as it's clearly stated in the Release Notes (as it will be, 
since you tagged it thus).

Thanks for your work,

Eric



signature.asc
Description: OpenPGP digital signature


svn commit: r279857 - head/share/misc

2015-03-10 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Mar 10 17:45:46 2015
New Revision: 279857
URL: https://svnweb.freebsd.org/changeset/base/279857

Log:
  Add myself to the src committers graph, with kib as my mentor.
  
  Approved by:kib (mentor)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Tue Mar 10 17:10:54 2015
(r279856)
+++ head/share/misc/committers-src.dot  Tue Mar 10 17:45:46 2015
(r279857)
@@ -296,6 +296,7 @@ tuexen [label="Michael Tuexen\ntuexen@Fr
 tychon [label="Tycho Nightingale\ntyc...@freebsd.org\n2014/01/21"]
 ume [label="Hajimu UMEMOTO\n...@freebsd.org\n2000/02/26"]
 uqs [label="Ulrich Spoerlein\n...@freebsd.org\n2010/01/28"]
+vangyzen [label="Eric van Gyzen\nvangy...@freebsd.org\n2015/03/08"]
 vanhu [label="Yvan Vanhullebus\nva...@freebsd.org\n2008/07/21"]
 versus [label="Konrad Jankowski\nver...@freebsd.org\n2008/10/27"]
 weongyo [label="Weongyo Jeong\nweon...@freebsd.org\n2007/12/21"]
@@ -560,6 +561,7 @@ kib -> rmh
 kib -> stas
 kib -> tijl
 kib -> trociny
+kib -> vangyzen
 kib -> zont
 
 kmacy -> lstewart
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r280792 - head/sys/kern

2015-03-28 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Mar 28 21:21:40 2015
New Revision: 280792
URL: https://svnweb.freebsd.org/changeset/base/280792

Log:
  Clean up some cosmetic nits in kern_umtx.c, found during recent work
  in this area and by the Clang static analyzer.
  
  Remove some dead assignments.
  
  Fix a typo in a panic string.
  
  Use umtx_pi_disown() instead of duplicate code.
  
  Use an existing variable instead of curthread.
  
  Approved by:  kib (mentor)
  MFC after:3 days
  Sponsored by: Dell Inc

Modified:
  head/sys/kern/kern_umtx.c

Modified: head/sys/kern/kern_umtx.c
==
--- head/sys/kern/kern_umtx.c   Sat Mar 28 19:59:33 2015(r280791)
+++ head/sys/kern/kern_umtx.c   Sat Mar 28 21:21:40 2015(r280792)
@@ -912,7 +912,7 @@ kern_umtx_wake(struct thread *td, void *
is_private ? THREAD_SHARE : AUTO_SHARE, &key)) != 0)
return (ret);
umtxq_lock(&key);
-   ret = umtxq_signal(&key, n_wake);
+   umtxq_signal(&key, n_wake);
umtxq_unlock(&key);
umtx_key_release(&key);
return (0);
@@ -1440,7 +1440,7 @@ umtx_pi_setowner(struct umtx_pi *pi, str
uq_owner = owner->td_umtxq;
mtx_assert(&umtx_lock, MA_OWNED);
if (pi->pi_owner != NULL)
-   panic("pi_ower != NULL");
+   panic("pi_owner != NULL");
pi->pi_owner = owner;
TAILQ_INSERT_TAIL(&uq_owner->uq_pi_contested, pi, pi_link);
 }
@@ -1464,9 +1464,8 @@ umtx_pi_disown(struct umtx_pi *pi)
 static int
 umtx_pi_claim(struct umtx_pi *pi, struct thread *owner)
 {
-   struct umtx_q *uq, *uq_owner;
+   struct umtx_q *uq;
 
-   uq_owner = owner->td_umtxq;
mtx_lock(&umtx_lock);
if (pi->pi_owner == owner) {
mtx_unlock(&umtx_lock);
@@ -1612,11 +1611,8 @@ umtx_pi_unref(struct umtx_pi *pi)
KASSERT(pi->pi_refcount > 0, ("invalid reference count"));
if (--pi->pi_refcount == 0) {
mtx_lock(&umtx_lock);
-   if (pi->pi_owner != NULL) {
-   TAILQ_REMOVE(&pi->pi_owner->td_umtxq->uq_pi_contested,
-   pi, pi_link);
-   pi->pi_owner = NULL;
-   }
+   if (pi->pi_owner != NULL)
+   umtx_pi_disown(pi);
KASSERT(TAILQ_EMPTY(&pi->pi_blocked),
("blocked queue not empty"));
mtx_unlock(&umtx_lock);
@@ -1876,7 +1872,7 @@ do_unlock_pi(struct thread *td, struct u
mtx_lock(&umtx_lock);
pi = uq_first->uq_pi_blocked;
KASSERT(pi != NULL, ("pi == NULL?"));
-   if (pi->pi_owner != curthread) {
+   if (pi->pi_owner != td) {
mtx_unlock(&umtx_lock);
umtxq_unbusy(&key);
umtxq_unlock(&key);
@@ -1884,7 +1880,7 @@ do_unlock_pi(struct thread *td, struct u
/* userland messed the mutex */
return (EPERM);
}
-   uq_me = curthread->td_umtxq;
+   uq_me = td->td_umtxq;
umtx_pi_disown(pi);
/* get highest priority thread which is still sleeping. */
uq_first = TAILQ_FIRST(&pi->pi_blocked);
@@ -1900,9 +1896,9 @@ do_unlock_pi(struct thread *td, struct u
pri = UPRI(uq_first2->uq_thread);
}
}
-   thread_lock(curthread);
-   sched_lend_user_prio(curthread, pri);
-   thread_unlock(curthread);
+   thread_lock(td);
+   sched_lend_user_prio(td, pri);
+   thread_unlock(td);
mtx_unlock(&umtx_lock);
if (uq_first)
umtxq_signal_thread(uq_first);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r280793 - head/usr.sbin/pmcstat

2015-03-28 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Mar 28 21:28:22 2015
New Revision: 280793
URL: https://svnweb.freebsd.org/changeset/base/280793

Log:
  pmcstat.8: fix -a flag description; improve -m flag to match
  
  The -a flag reads a file saved by -O, not -o.
  
  The -m flag requires the -R flag.  Copy that paragraph from -a.
  
  Reviewed by:  adrian
  Approved by:  kib (mentor)
  MFC after:1 week
  Sponsored by: Dell Inc

Modified:
  head/usr.sbin/pmcstat/pmcstat.8
  head/usr.sbin/pmcstat/pmcstat.c

Modified: head/usr.sbin/pmcstat/pmcstat.8
==
--- head/usr.sbin/pmcstat/pmcstat.8 Sat Mar 28 21:21:40 2015
(r280792)
+++ head/usr.sbin/pmcstat/pmcstat.8 Sat Mar 28 21:28:22 2015
(r280793)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Oct 27, 2014
+.Dd March 27, 2015
 .Dt PMCSTAT 8
 .Os
 .Sh NAME
@@ -236,7 +236,7 @@ This option requires the
 .Fl R
 option to read in samples that were previously collected and
 saved with the
-.Fl o
+.Fl O
 option.
 .It Fl c Ar cpu-spec
 Set the cpus for subsequent system mode PMCs specified on the
@@ -301,6 +301,12 @@ is a
 this information is sent to the output file specified by the
 .Fl o
 option.
+This option requires the
+.Fl R
+option to read in samples that were previously collected and
+saved with the
+.Fl O
+option.
 .It Fl n Ar rate
 Set the default sampling rate for subsequent sampling mode
 PMCs specified on the command line.

Modified: head/usr.sbin/pmcstat/pmcstat.c
==
--- head/usr.sbin/pmcstat/pmcstat.c Sat Mar 28 21:21:40 2015
(r280792)
+++ head/usr.sbin/pmcstat/pmcstat.c Sat Mar 28 21:28:22 2015
(r280793)
@@ -940,7 +940,7 @@ main(int argc, char **argv)
errx(EX_USAGE, "ERROR: options -T and -l are mutually "
"exclusive.");
 
-   /* -m option is allowed with -R only. */
+   /* -a and -m require -R */
if (args.pa_flags & FLAG_DO_ANNOTATE && args.pa_inputpath == NULL)
errx(EX_USAGE, "ERROR: option %s requires an input file",
args.pa_plugin == PMCSTAT_PL_ANNOTATE ? "-m" : "-a");
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r280785 - in head/sys: kern netgraph/atm/sscop netgraph/atm/uni sys

2015-03-31 Thread Eric van Gyzen
>> Now as to the 
>>
>> -1 -> NOCPU
>>
>> This is like pulling on a string on your sweater.. the only sensible 
>> solution that
>> I could come up with after chatting with Lawrence is to add 
>> #include 
>> to everyone that uses the callout.h and does not have it already… (putting 
>> it into callout.h does not work) .. sigh..
>>
>> Now for this cosmetic change I end up with the following changes (and as yet 
>> I have
>> not built LINT or universe so there may be more).. I have spent about 2 
>> hours on this
>> so far and I can at least build a kernel with the change for amd64 :-0
>>
>> Here is what has to change, do you really think that this is worth it?
>>
>> Note I did not look into moving NOCPU in proc.h it says it means no CPU is 
>> present
>> which is sort of the meaning we want.. I am not sure if the define could be 
>> moved .. but
>> that too may be yet another string...
>>
>> Is this worth it, or do you have another idea on how best to do this???
> 
> Ugh. :(  I guess leave it at -1 for now.

If you leave it as -1, you might add a /* NOCPU */ comment, for the sake of
grep.  (This could be a lost cause, for all I know, but it can't hurt.)

> Another alternative would be to
> move NOCPU to  (at least for the kernel) if bde@ would allow it.
> I don't think changing all those files is appropriate.
> 
> (Also,  seems like an odd place for NOCPU now, it should really be
> in  if not param.h.  I understand why it was first added in proc.h,
> but it is now used in many more places than just td_oncpu.)

+1

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

svn commit: r349278 - head/usr.sbin/bhyve

2019-06-21 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 21 18:57:33 2019
New Revision: 349278
URL: https://svnweb.freebsd.org/changeset/base/349278

Log:
  bhyve: Fix vtscsi maximum segment config
  
  The seg_max value reported to the guest should be two less than the
  host's maximum, in order to leave room for the request and the
  response.  This is analogous to r347033 for virtio_block.
  
  We hit the "too many segments to enqueue" assertion on OneFS because
  we increase MAXPHYS to 256 KB.
  
  Reviewed by:  bryanv
  Discussed with:   cem jhb rgrimes
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20529

Modified:
  head/usr.sbin/bhyve/pci_virtio_scsi.c

Modified: head/usr.sbin/bhyve/pci_virtio_scsi.c
==
--- head/usr.sbin/bhyve/pci_virtio_scsi.c   Fri Jun 21 18:48:07 2019
(r349277)
+++ head/usr.sbin/bhyve/pci_virtio_scsi.c   Fri Jun 21 18:57:33 2019
(r349278)
@@ -309,7 +309,8 @@ pci_vtscsi_reset(void *vsc)
/* initialize config structure */
sc->vss_config = (struct pci_vtscsi_config){
.num_queues = VTSCSI_REQUESTQ,
-   .seg_max = VTSCSI_MAXSEG,
+   /* Leave room for the request and the response. */
+   .seg_max = VTSCSI_MAXSEG - 2,
.max_sectors = 2,
.cmd_per_lun = 1,
.event_info_size = sizeof(struct pci_vtscsi_event),
___
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: r349285 - head/sys/dev/virtio/scsi

2019-06-21 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Jun 22 01:20:45 2019
New Revision: 349285
URL: https://svnweb.freebsd.org/changeset/base/349285

Log:
  VirtIO SCSI:  validate seg_max on attach
  
  Until r349278, bhyve presented a seg_max to the guest that was too large.
  Detect this case and clamp it to the virtqueue size.  Otherwise, we would
  fail the "too many segments to enqueue" assertion in virtqueue_enqueue().
  
  I hit this by running a guest with a MAXPHYS of 256 KB.
  
  Reviewed by:  bryanv cem
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20703

Modified:
  head/sys/dev/virtio/scsi/virtio_scsi.c

Modified: head/sys/dev/virtio/scsi/virtio_scsi.c
==
--- head/sys/dev/virtio/scsi/virtio_scsi.c  Sat Jun 22 01:06:41 2019
(r349284)
+++ head/sys/dev/virtio/scsi/virtio_scsi.c  Sat Jun 22 01:20:45 2019
(r349285)
@@ -81,6 +81,7 @@ static void   vtscsi_read_config(struct vtscsi_softc *,
struct virtio_scsi_config *);
 static int vtscsi_maximum_segments(struct vtscsi_softc *, int);
 static int vtscsi_alloc_virtqueues(struct vtscsi_softc *);
+static voidvtscsi_check_sizes(struct vtscsi_softc *);
 static voidvtscsi_write_device_config(struct vtscsi_softc *);
 static int vtscsi_reinit(struct vtscsi_softc *);
 
@@ -311,6 +312,8 @@ vtscsi_attach(device_t dev)
goto fail;
}
 
+   vtscsi_check_sizes(sc);
+
error = vtscsi_init_event_vq(sc);
if (error) {
device_printf(dev, "cannot populate the eventvq\n");
@@ -475,6 +478,26 @@ vtscsi_alloc_virtqueues(struct vtscsi_softc *sc)
"%s request", device_get_nameunit(dev));
 
return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info));
+}
+
+static void
+vtscsi_check_sizes(struct vtscsi_softc *sc)
+{
+   int rqsize;
+
+   if ((sc->vtscsi_flags & VTSCSI_FLAG_INDIRECT) == 0) {
+   /*
+* Ensure the assertions in virtqueue_enqueue(),
+* even if the hypervisor reports a bad seg_max.
+*/
+   rqsize = virtqueue_size(sc->vtscsi_request_vq);
+   if (sc->vtscsi_max_nsegs > rqsize) {
+   device_printf(sc->vtscsi_dev,
+   "clamping seg_max (%d %d)\n", sc->vtscsi_max_nsegs,
+   rqsize);
+   sc->vtscsi_max_nsegs = rqsize;
+   }
+   }
 }
 
 static void
___
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: r349677 - in head: sys/kern tools/test/callout_free

2019-07-03 Thread Eric van Gyzen
   }
+   cpu++;
+   }
 }
 #endif /* DDB */

Added: head/tools/test/callout_free/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/test/callout_free/Makefile   Wed Jul  3 19:22:44 2019
(r349677)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+KMOD=  callout_free
+SRCS=  callout_free.c
+
+.include 

Added: head/tools/test/callout_free/callout_free.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/test/callout_free/callout_free.c Wed Jul  3 19:22:44 2019    
(r349677)
@@ -0,0 +1,87 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2019 Eric van Gyzen
+ *
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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$
+ */
+
+/*
+ * Free a pending callout.  This was useful for testing the
+ * "show callout_last" ddb command.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct callout callout_free;
+static struct mtx callout_free_mutex;
+static int callout_free_arg;
+
+static void
+callout_free_func(void *arg)
+{
+   printf("squirrel!\n");
+   mtx_destroy(&callout_free_mutex);
+   memset(&callout_free, 'C', sizeof(callout_free));
+}
+
+static int
+callout_free_load(module_t mod, int cmd, void *arg)
+{
+   int error;
+
+   switch (cmd) {
+   case MOD_LOAD:
+   mtx_init(&callout_free_mutex, "callout_free", NULL, MTX_DEF);
+   /*
+* Do not pass CALLOUT_RETURNUNLOCKED so the callout
+* subsystem will unlock the "destroyed" mutex.
+*/
+   callout_init_mtx(&callout_free, &callout_free_mutex, 0);
+   printf("callout_free_func = %p\n", callout_free_func);
+   printf("callout_free_arg = %p\n", &callout_free_arg);
+   callout_reset(&callout_free, hz/10, callout_free_func,
+   &callout_free_arg);
+   error = 0;
+   break;
+
+   case MOD_UNLOAD:
+   error = 0;
+   break;
+
+   default:
+   error = EOPNOTSUPP;
+   break;
+   }
+
+   return (error);
+}
+
+DEV_MODULE(callout_free, callout_free_load, 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"


svn commit: r349690 - stable/12/usr.sbin/bhyve

2019-07-03 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jul  3 19:50:22 2019
New Revision: 349690
URL: https://svnweb.freebsd.org/changeset/base/349690

Log:
  MFC r349278
  
  bhyve: Fix vtscsi maximum segment config
  
  The seg_max value reported to the guest should be two less than the
  host's maximum, in order to leave room for the request and the
  response.  This is analogous to r347033 for virtio_block.
  
  We hit the "too many segments to enqueue" assertion on OneFS because
  we increase MAXPHYS to 256 KB.
  
  Reviewed by:  bryanv
  Discussed with:   cem jhb rgrimes
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20529

Modified:
  stable/12/usr.sbin/bhyve/pci_virtio_scsi.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/pci_virtio_scsi.c
==
--- stable/12/usr.sbin/bhyve/pci_virtio_scsi.c  Wed Jul  3 19:46:05 2019
(r349689)
+++ stable/12/usr.sbin/bhyve/pci_virtio_scsi.c  Wed Jul  3 19:50:22 2019
(r349690)
@@ -309,7 +309,8 @@ pci_vtscsi_reset(void *vsc)
/* initialize config structure */
sc->vss_config = (struct pci_vtscsi_config){
.num_queues = VTSCSI_REQUESTQ,
-   .seg_max = VTSCSI_MAXSEG,
+   /* Leave room for the request and the response. */
+   .seg_max = VTSCSI_MAXSEG - 2,
.max_sectors = 2,
.cmd_per_lun = 1,
.event_info_size = sizeof(struct pci_vtscsi_event),
___
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: r349691 - stable/12/sys/dev/virtio/scsi

2019-07-03 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jul  3 19:52:24 2019
New Revision: 349691
URL: https://svnweb.freebsd.org/changeset/base/349691

Log:
  MFC r349285
  
  VirtIO SCSI:  validate seg_max on attach
  
  Until head r349278 (stable/12 r349690), bhyve presented a seg_max
  to the guest that was too large.  Detect this case and clamp it to
  the virtqueue size.  Otherwise, we would fail the "too many segments
  to enqueue" assertion in virtqueue_enqueue().
  
  I hit this by running a guest with a MAXPHYS of 256 KB.
  
  Reviewed by:  bryanv cem
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20703

Modified:
  stable/12/sys/dev/virtio/scsi/virtio_scsi.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/virtio/scsi/virtio_scsi.c
==
--- stable/12/sys/dev/virtio/scsi/virtio_scsi.c Wed Jul  3 19:50:22 2019
(r349690)
+++ stable/12/sys/dev/virtio/scsi/virtio_scsi.c Wed Jul  3 19:52:24 2019
(r349691)
@@ -81,6 +81,7 @@ static void   vtscsi_read_config(struct vtscsi_softc *,
struct virtio_scsi_config *);
 static int vtscsi_maximum_segments(struct vtscsi_softc *, int);
 static int vtscsi_alloc_virtqueues(struct vtscsi_softc *);
+static voidvtscsi_check_sizes(struct vtscsi_softc *);
 static voidvtscsi_write_device_config(struct vtscsi_softc *);
 static int vtscsi_reinit(struct vtscsi_softc *);
 
@@ -314,6 +315,8 @@ vtscsi_attach(device_t dev)
goto fail;
}
 
+   vtscsi_check_sizes(sc);
+
error = vtscsi_init_event_vq(sc);
if (error) {
device_printf(dev, "cannot populate the eventvq\n");
@@ -478,6 +481,26 @@ vtscsi_alloc_virtqueues(struct vtscsi_softc *sc)
"%s request", device_get_nameunit(dev));
 
return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info));
+}
+
+static void
+vtscsi_check_sizes(struct vtscsi_softc *sc)
+{
+   int rqsize;
+
+   if ((sc->vtscsi_flags & VTSCSI_FLAG_INDIRECT) == 0) {
+   /*
+* Ensure the assertions in virtqueue_enqueue(),
+* even if the hypervisor reports a bad seg_max.
+*/
+   rqsize = virtqueue_size(sc->vtscsi_request_vq);
+   if (sc->vtscsi_max_nsegs > rqsize) {
+   device_printf(sc->vtscsi_dev,
+   "clamping seg_max (%d %d)\n", sc->vtscsi_max_nsegs,
+   rqsize);
+   sc->vtscsi_max_nsegs = rqsize;
+   }
+   }
 }
 
 static void
___
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: r349693 - stable/11/sys/dev/virtio/scsi

2019-07-03 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jul  3 19:54:56 2019
New Revision: 349693
URL: https://svnweb.freebsd.org/changeset/base/349693

Log:
  MFC r349285
  
  VirtIO SCSI:  validate seg_max on attach
  
  Until head r349278 (stable/12 r349690), bhyve presented a seg_max
  to the guest that was too large.  Detect this case and clamp it to
  the virtqueue size.  Otherwise, we would fail the "too many segments
  to enqueue" assertion in virtqueue_enqueue().
  
  I hit this by running a guest with a MAXPHYS of 256 KB.
  
  Reviewed by:  bryanv cem
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20703

Modified:
  stable/11/sys/dev/virtio/scsi/virtio_scsi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/virtio/scsi/virtio_scsi.c
==
--- stable/11/sys/dev/virtio/scsi/virtio_scsi.c Wed Jul  3 19:54:37 2019
(r349692)
+++ stable/11/sys/dev/virtio/scsi/virtio_scsi.c Wed Jul  3 19:54:56 2019
(r349693)
@@ -79,6 +79,7 @@ static void   vtscsi_read_config(struct vtscsi_softc *,
struct virtio_scsi_config *);
 static int vtscsi_maximum_segments(struct vtscsi_softc *, int);
 static int vtscsi_alloc_virtqueues(struct vtscsi_softc *);
+static voidvtscsi_check_sizes(struct vtscsi_softc *);
 static voidvtscsi_write_device_config(struct vtscsi_softc *);
 static int vtscsi_reinit(struct vtscsi_softc *);
 
@@ -312,6 +313,8 @@ vtscsi_attach(device_t dev)
goto fail;
}
 
+   vtscsi_check_sizes(sc);
+
error = vtscsi_init_event_vq(sc);
if (error) {
device_printf(dev, "cannot populate the eventvq\n");
@@ -476,6 +479,26 @@ vtscsi_alloc_virtqueues(struct vtscsi_softc *sc)
"%s request", device_get_nameunit(dev));
 
return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info));
+}
+
+static void
+vtscsi_check_sizes(struct vtscsi_softc *sc)
+{
+   int rqsize;
+
+   if ((sc->vtscsi_flags & VTSCSI_FLAG_INDIRECT) == 0) {
+   /*
+* Ensure the assertions in virtqueue_enqueue(),
+* even if the hypervisor reports a bad seg_max.
+*/
+   rqsize = virtqueue_size(sc->vtscsi_request_vq);
+   if (sc->vtscsi_max_nsegs > rqsize) {
+   device_printf(sc->vtscsi_dev,
+   "clamping seg_max (%d %d)\n", sc->vtscsi_max_nsegs,
+   rqsize);
+   sc->vtscsi_max_nsegs = rqsize;
+   }
+   }
 }
 
 static void
___
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: r349834 - head/sys/dev/vt

2019-07-08 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Jul  8 13:46:26 2019
New Revision: 349834
URL: https://svnweb.freebsd.org/changeset/base/349834

Log:
  Ignore kern.vt.splash_cpu without graphics
  
  When the system has no graphical console, such as bhyve in common
  configurations, ignore kern.vt.splash_cpu, instead of panicking
  on INVARIANTS kernels.
  
  Reviewed by:  cem dumbbell
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20877

Modified:
  head/sys/dev/vt/vt_cpulogos.c

Modified: head/sys/dev/vt/vt_cpulogos.c
==
--- head/sys/dev/vt/vt_cpulogos.c   Mon Jul  8 13:01:54 2019
(r349833)
+++ head/sys/dev/vt/vt_cpulogos.c   Mon Jul  8 13:46:26 2019
(r349834)
@@ -229,9 +229,8 @@ vt_init_logos(void *dummy)
return;
 
VT_LOCK(vd);
-   KASSERT((vd->vd_flags & VDF_INITIALIZED) != 0,
-   ("vd %p not initialized", vd));
-
+   if ((vd->vd_flags & VDF_INITIALIZED) == 0)
+   goto out;
if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0)
goto out;
if (vd->vd_height <= vt_logo_sprite_height)
___
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: r350043 - in head: share/man/man5 sys/kern

2019-07-16 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Jul 16 15:51:09 2019
New Revision: 350043
URL: https://svnweb.freebsd.org/changeset/base/350043

Log:
  Adds signal number format to kern.corefile
  
  Add format capability to core file names to include signal
  that generated the core. This can help various validation workflows
  where all cores should not be considered equally (SIGQUIT is often
  intentional and not an error unlike SIGSEGV or SIGBUS)
  
  Submitted by: David Leimbach (leim...@gmail.com)
  Reviewed by:  markj
  MFC after:1 week
  Relnotes: sysctl kern.corefile can now include the signal number
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20970

Modified:
  head/share/man/man5/core.5
  head/sys/kern/kern_sig.c

Modified: head/share/man/man5/core.5
==
--- head/share/man/man5/core.5  Tue Jul 16 15:49:43 2019(r350042)
+++ head/share/man/man5/core.5  Tue Jul 16 15:51:09 2019(r350043)
@@ -82,6 +82,8 @@ generated by a particular process.
 process name.
 .It Em \&%P
 processes PID.
+.It Em \&%S
+signal during core.
 .It Em \&%U
 process UID.
 .El

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cTue Jul 16 15:49:43 2019(r350042)
+++ head/sys/kern/kern_sig.cTue Jul 16 15:51:09 2019(r350043)
@@ -3433,7 +3433,7 @@ corefile_open_last(struct thread *td, char *name, int 
  */
 static int
 corefile_open(const char *comm, uid_t uid, pid_t pid, struct thread *td,
-int compress, struct vnode **vpp, char **namep)
+int compress, int signum, struct vnode **vpp, char **namep)
 {
struct sbuf sb;
struct nameidata nd;
@@ -3482,6 +3482,9 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, 
case 'P':   /* process id */
sbuf_printf(&sb, "%u", pid);
break;
+   case 'S':   /* signal number */
+   sbuf_printf(&sb, "%i", signum);
+   break;
case 'U':   /* user id */
sbuf_printf(&sb, "%u", uid);
break;
@@ -3599,7 +3602,7 @@ coredump(struct thread *td)
PROC_UNLOCK(p);
 
error = corefile_open(p->p_comm, cred->cr_uid, p->p_pid, td,
-   compress_user_cores, &vp, &name);
+   compress_user_cores, p->p_sig, &vp, &name);
if (error != 0)
return (error);
 
___
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: r350050 - stable/12/sys/dev/vt

2019-07-16 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Jul 16 16:05:42 2019
New Revision: 350050
URL: https://svnweb.freebsd.org/changeset/base/350050

Log:
  MFC r349834
  
  Ignore kern.vt.splash_cpu without graphics
  
  When the system has no graphical console, such as bhyve in common
  configurations, ignore kern.vt.splash_cpu, instead of panicking
  on INVARIANTS kernels.
  
  Reviewed by:  cem dumbbell
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20877

Modified:
  stable/12/sys/dev/vt/vt_cpulogos.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/vt/vt_cpulogos.c
==
--- stable/12/sys/dev/vt/vt_cpulogos.c  Tue Jul 16 16:03:08 2019
(r350049)
+++ stable/12/sys/dev/vt/vt_cpulogos.c  Tue Jul 16 16:05:42 2019
(r350050)
@@ -227,9 +227,8 @@ vt_init_logos(void *dummy)
return;
 
VT_LOCK(vd);
-   KASSERT((vd->vd_flags & VDF_INITIALIZED) != 0,
-   ("vd %p not initialized", vd));
-
+   if ((vd->vd_flags & VDF_INITIALIZED) == 0)
+   goto out;
if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0)
goto out;
if (vd->vd_height <= vt_logo_sprite_height)
___
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: r350056 - stable/11/sys/dev/vt

2019-07-16 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Jul 16 16:49:11 2019
New Revision: 350056
URL: https://svnweb.freebsd.org/changeset/base/350056

Log:
  MFC r349834
  
  Ignore kern.vt.splash_cpu without graphics
  
  When the system has no graphical console, such as bhyve in common
  configurations, ignore kern.vt.splash_cpu, instead of panicking
  on INVARIANTS kernels.
  
  Reviewed by:  cem dumbbell
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20877

Modified:
  stable/11/sys/dev/vt/vt_cpulogos.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/vt/vt_cpulogos.c
==
--- stable/11/sys/dev/vt/vt_cpulogos.c  Tue Jul 16 16:33:44 2019
(r350055)
+++ stable/11/sys/dev/vt/vt_cpulogos.c  Tue Jul 16 16:49:11 2019
(r350056)
@@ -227,9 +227,8 @@ vt_init_logos(void *dummy)
return;
 
VT_LOCK(vd);
-   KASSERT((vd->vd_flags & VDF_INITIALIZED) != 0,
-   ("vd %p not initialized", vd));
-
+   if ((vd->vd_flags & VDF_INITIALIZED) == 0)
+   goto out;
if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0)
goto out;
if (vd->vd_height <= vt_logo_sprite_height)
___
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: r350620 - head/contrib/netbsd-tests/lib/libpthread

2019-08-05 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Aug  5 22:59:35 2019
New Revision: 350620
URL: https://svnweb.freebsd.org/changeset/base/350620

Log:
  Relax time constraint in pthread_cond_timedwait unit test
  
  pthread_cond_timedwait() should wait _at least_ until the timeout,
  but it might appear to wait longer due to system activity and
  scheduling.  The test ignored fractional seconds when comparing the
  actual and expected timeouts, so it allowed anywhere between zero
  and one extra second of wait time.  Zero is a bit unreasonable.
  Compare fractional seconds so we always allow up to one extra second.
  
  Reviewed by:  ngie
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/contrib/netbsd-tests/lib/libpthread/t_condwait.c

Modified: head/contrib/netbsd-tests/lib/libpthread/t_condwait.c
==
--- head/contrib/netbsd-tests/lib/libpthread/t_condwait.c   Mon Aug  5 
22:04:16 2019(r350619)
+++ head/contrib/netbsd-tests/lib/libpthread/t_condwait.c   Mon Aug  5 
22:59:35 2019(r350620)
@@ -51,6 +51,9 @@ static void *
 run(void *param)
 {
struct timespec ts, to, te;
+#ifdef __FreeBSD__
+   struct timespec tw;
+#endif
clockid_t clck;
pthread_condattr_t attr;
pthread_cond_t cond;
@@ -91,7 +94,15 @@ run(void *param)
/* Loose upper limit because of qemu timing bugs */
ATF_REQUIRE(to_seconds < WAITTIME * 2.5);
} else {
+#ifdef __FreeBSD__
+   tw.tv_sec = WAITTIME;
+   tw.tv_nsec = 0;
+   ATF_REQUIRE(timespeccmp(&to, &tw, >=));
+   tw.tv_sec++;
+   ATF_REQUIRE(timespeccmp(&to, &tw, <=));
+#else
ATF_REQUIRE_EQ(to.tv_sec, WAITTIME);
+#endif
}
break;
default:
___
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: r301532 - head/usr.sbin/newsyslog

2016-06-06 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Jun  6 22:54:08 2016
New Revision: 301532
URL: https://svnweb.freebsd.org/changeset/base/301532

Log:
  newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specified
  
  After going through the signal work list, during which do_sigwork()
  is called and essentially does nothing because -s and -R were
  specified on the command line, newsyslog will sleep for 10 seconds
  as the (verbose) code says: "Pause 10 seconds to allow daemon(s)
  to close log file(s)".
  
  However, the man page verbiage for -R (and -s) seems quite clear
  that this sleep() is unnecessary because the daemon was expected
  to have already closed the log file before calling newsyslog.
  
  PR:   210020
  Submitted by: David A. Bright 
  MFC after:1 week
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D6727

Modified:
  head/usr.sbin/newsyslog/newsyslog.c

Modified: head/usr.sbin/newsyslog/newsyslog.c
==
--- head/usr.sbin/newsyslog/newsyslog.c Mon Jun  6 22:51:44 2016
(r301531)
+++ head/usr.sbin/newsyslog/newsyslog.c Mon Jun  6 22:54:08 2016
(r301532)
@@ -333,13 +333,15 @@ main(int argc, char **argv)
printf("Signal all daemon process(es)...\n");
SLIST_FOREACH(stmp, &swhead, sw_nextp)
do_sigwork(stmp);
-   if (noaction)
-   printf("\tsleep 10\n");
-   else {
-   if (verbose)
-   printf("Pause 10 seconds to allow daemon(s)"
-   " to close log file(s)\n");
-   sleep(10);
+   if (!(rotatereq && nosignal)) {
+   if (noaction)
+   printf("\tsleep 10\n");
+   else {
+   if (verbose)
+   printf("Pause 10 seconds to allow "
+   "daemon(s) to close log file(s)\n");
+   sleep(10);
+   }
}
}
/*
___
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: r301926 - stable/10/usr.sbin/newsyslog

2016-06-15 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jun 15 14:11:49 2016
New Revision: 301926
URL: https://svnweb.freebsd.org/changeset/base/301926

Log:
  MFC r301532
  
  newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specified
  
  After going through the signal work list, during which do_sigwork()
  is called and essentially does nothing because -s and -R were
  specified on the command line, newsyslog will sleep for 10 seconds
  as the (verbose) code says: "Pause 10 seconds to allow daemon(s)
  to close log file(s)".
  
  However, the man page verbiage for -R (and -s) seems quite clear
  that this sleep() is unnecessary because the daemon was expected
  to have already closed the log file before calling newsyslog.
  
  PR:   210020
  Submitted by: David A. Bright 
  Sponsored by: Dell Inc.

Modified:
  stable/10/usr.sbin/newsyslog/newsyslog.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/newsyslog/newsyslog.c
==
--- stable/10/usr.sbin/newsyslog/newsyslog.cWed Jun 15 09:52:01 2016
(r301925)
+++ stable/10/usr.sbin/newsyslog/newsyslog.cWed Jun 15 14:11:49 2016
(r301926)
@@ -333,13 +333,15 @@ main(int argc, char **argv)
printf("Signal all daemon process(es)...\n");
SLIST_FOREACH(stmp, &swhead, sw_nextp)
do_sigwork(stmp);
-   if (noaction)
-   printf("\tsleep 10\n");
-   else {
-   if (verbose)
-   printf("Pause 10 seconds to allow daemon(s)"
-   " to close log file(s)\n");
-   sleep(10);
+   if (!(rotatereq && nosignal)) {
+   if (noaction)
+   printf("\tsleep 10\n");
+   else {
+   if (verbose)
+   printf("Pause 10 seconds to allow "
+   "daemon(s) to close log file(s)\n");
+   sleep(10);
+   }
}
}
/*
___
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: r301927 - stable/9/usr.sbin/newsyslog

2016-06-15 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jun 15 14:12:22 2016
New Revision: 301927
URL: https://svnweb.freebsd.org/changeset/base/301927

Log:
  MFC r301532
  
  newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specified
  
  After going through the signal work list, during which do_sigwork()
  is called and essentially does nothing because -s and -R were
  specified on the command line, newsyslog will sleep for 10 seconds
  as the (verbose) code says: "Pause 10 seconds to allow daemon(s)
  to close log file(s)".
  
  However, the man page verbiage for -R (and -s) seems quite clear
  that this sleep() is unnecessary because the daemon was expected
  to have already closed the log file before calling newsyslog.
  
  PR:   210020
  Submitted by: David A. Bright 
  Sponsored by: Dell Inc.

Modified:
  stable/9/usr.sbin/newsyslog/newsyslog.c
Directory Properties:
  stable/9/usr.sbin/newsyslog/   (props changed)

Modified: stable/9/usr.sbin/newsyslog/newsyslog.c
==
--- stable/9/usr.sbin/newsyslog/newsyslog.c Wed Jun 15 14:11:49 2016
(r301926)
+++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed Jun 15 14:12:22 2016
(r301927)
@@ -330,13 +330,15 @@ main(int argc, char **argv)
printf("Signal all daemon process(es)...\n");
SLIST_FOREACH(stmp, &swhead, sw_nextp)
do_sigwork(stmp);
-   if (noaction)
-   printf("\tsleep 10\n");
-   else {
-   if (verbose)
-   printf("Pause 10 seconds to allow daemon(s)"
-   " to close log file(s)\n");
-   sleep(10);
+   if (!(rotatereq && nosignal)) {
+   if (noaction)
+   printf("\tsleep 10\n");
+   else {
+   if (verbose)
+   printf("Pause 10 seconds to allow "
+   "daemon(s) to close log file(s)\n");
+   sleep(10);
+   }
}
}
/*
___
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: r302014 - head/sys/dev/ntb/if_ntb

2016-06-18 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Jun 18 23:18:04 2016
New Revision: 302014
URL: https://svnweb.freebsd.org/changeset/base/302014

Log:
  Fix if_ntb interface setup to include IFF_MULTICAST.
  
  This allows IPv6 link local addresses (and other IPv6 functionality) to work.
  
  PR:   210355
  Submitted by: Steve Wahl and David Bright (both at Dell Inc.)
  Reviewed by:  cem, mav
  Tested by:mav (on Intel hardware)
  Approved by:  re (kib)
  MFC after:5 days
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D6885

Modified:
  head/sys/dev/ntb/if_ntb/if_ntb.c

Modified: head/sys/dev/ntb/if_ntb/if_ntb.c
==
--- head/sys/dev/ntb/if_ntb/if_ntb.cSat Jun 18 20:22:53 2016
(r302013)
+++ head/sys/dev/ntb/if_ntb/if_ntb.cSat Jun 18 23:18:04 2016
(r302014)
@@ -427,7 +427,7 @@ ntb_setup_interface(void)
&handlers);
ifp->if_init = ntb_net_init;
ifp->if_softc = &net_softc;
-   ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
+   ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = ntb_ioctl;
ifp->if_start = ntb_start;
IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
___
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: r302787 - head/cddl/contrib/opensolaris/cmd/zpool

2016-07-13 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jul 13 21:27:10 2016
New Revision: 302787
URL: https://svnweb.freebsd.org/changeset/base/302787

Log:
  zpool(8): update Hot Spares section to mention zfsd(8)
  
  Reviewed and reworded by: asomers
  MFC after:3 days
  Sponsored by: Dell Inc.

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Jul 13 20:46:54 
2016(r302786)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Jul 13 21:27:10 
2016(r302787)
@@ -465,6 +465,15 @@ place in the configuration, and is remov
 pools.
 .Pp
 Spares cannot replace log devices.
+.Pp
+This feature requires a userland helper.
+FreeBSD provides
+.Xr zfsd 8
+for this purpose.
+It must be manually enabled by adding
+.Va zfsd_enable="YES"
+to
+.Pa /etc/rc.conf .
 .Ss Intent Log
 The
 .Tn ZFS
@@ -2023,7 +2032,8 @@ Discarded approximately 29 seconds of tr
 .El
 .Sh SEE ALSO
 .Xr zpool-features 7 ,
-.Xr zfs 8
+.Xr zfs 8 ,
+.Xr zfsd 8
 .Sh AUTHORS
 This manual page is a
 .Xr mdoc 7
@@ -2040,9 +2050,3 @@ The
 .Xr mdoc 7
 implementation of this manual page was initially written by
 .An Martin Matuska Aq m...@freebsd.org .
-.Sh CAVEATS
-The
-.Cm spare
-feature requires a utility to detect zpool degradation and initiate
-disk replacement within the zpool.
-FreeBSD does not provide such a utility at this time.
___
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: r302938 - stable/11/cddl/contrib/opensolaris/cmd/zpool

2016-07-16 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Jul 16 15:52:14 2016
New Revision: 302938
URL: https://svnweb.freebsd.org/changeset/base/302938

Log:
  MFC r302787
  
  zpool(8): update Hot Spares section to mention zfsd(8)
  
  Approved by:  re (gjb)

Modified:
  stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8Sat Jul 16 
13:26:18 2016(r302937)
+++ stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8Sat Jul 16 
15:52:14 2016(r302938)
@@ -465,6 +465,15 @@ place in the configuration, and is remov
 pools.
 .Pp
 Spares cannot replace log devices.
+.Pp
+This feature requires a userland helper.
+FreeBSD provides
+.Xr zfsd 8
+for this purpose.
+It must be manually enabled by adding
+.Va zfsd_enable="YES"
+to
+.Pa /etc/rc.conf .
 .Ss Intent Log
 The
 .Tn ZFS
@@ -2023,7 +2032,8 @@ Discarded approximately 29 seconds of tr
 .El
 .Sh SEE ALSO
 .Xr zpool-features 7 ,
-.Xr zfs 8
+.Xr zfs 8 ,
+.Xr zfsd 8
 .Sh AUTHORS
 This manual page is a
 .Xr mdoc 7
@@ -2040,9 +2050,3 @@ The
 .Xr mdoc 7
 implementation of this manual page was initially written by
 .An Martin Matuska Aq m...@freebsd.org .
-.Sh CAVEATS
-The
-.Cm spare
-feature requires a utility to detect zpool degradation and initiate
-disk replacement within the zpool.
-FreeBSD does not provide such a utility at this time.
___
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: r340994 - in head/sys: amd64/ia32 mips/mips powerpc/powerpc

2018-11-26 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Nov 26 20:50:55 2018
New Revision: 340994
URL: https://svnweb.freebsd.org/changeset/base/340994

Log:
  Prevent kernel stack disclosure in getcontext/swapcontext
  
  Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.
  
  MFC after:2 days
  Security: FreeBSD-EN-18:12.mem
  Security: CVE-2018-17155
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/mips/mips/freebsd32_machdep.c
  head/sys/powerpc/powerpc/exec_machdep.c

Modified: head/sys/amd64/ia32/ia32_signal.c
==
--- head/sys/amd64/ia32/ia32_signal.c   Mon Nov 26 19:41:13 2018
(r340993)
+++ head/sys/amd64/ia32/ia32_signal.c   Mon Nov 26 20:50:55 2018
(r340994)
@@ -261,6 +261,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -301,6 +302,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;

Modified: head/sys/mips/mips/freebsd32_machdep.c
==
--- head/sys/mips/mips/freebsd32_machdep.c  Mon Nov 26 19:41:13 2018
(r340993)
+++ head/sys/mips/mips/freebsd32_machdep.c  Mon Nov 26 20:50:55 2018
(r340994)
@@ -294,6 +294,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -333,6 +334,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;

Modified: head/sys/powerpc/powerpc/exec_machdep.c
==
--- head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 26 19:41:13 2018
(r340993)
+++ head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 26 20:50:55 2018
(r340994)
@@ -785,6 +785,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -824,6 +825,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
___
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: r340995 - in head/sys: arm/arm arm64/arm64 riscv/riscv

2018-11-26 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Nov 26 20:52:53 2018
New Revision: 340995
URL: https://svnweb.freebsd.org/changeset/base/340995

Log:
  Prevent kernel stack disclosure in signal delivery
  
  On arm64 and riscv platforms, sendsig() failed to zero the signal
  frame before copying it out to userspace.  Zero it.
  
  On arm, I believe all the contents of the frame were initialized,
  so there was no disclosure.  However, explicitly zero the whole frame
  because that fact could inadvertently change in the future,
  it's more clear to the reader, and I could be wrong in the first place.
  
  MFC after:2 days
  Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/arm/arm/machdep.c
  head/sys/arm64/arm64/machdep.c
  head/sys/riscv/riscv/machdep.c

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Mon Nov 26 20:50:55 2018(r340994)
+++ head/sys/arm/arm/machdep.c  Mon Nov 26 20:52:53 2018(r340995)
@@ -641,6 +641,7 @@ sendsig(catcher, ksi, mask)
/* make the stack aligned */
fp = (struct sigframe *)STACKALIGN(fp);
/* Populate the siginfo frame. */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
 #ifdef VFP
get_vfpcontext(td, &frame.sf_vfp);

Modified: head/sys/arm64/arm64/machdep.c
==
--- head/sys/arm64/arm64/machdep.c  Mon Nov 26 20:50:55 2018
(r340994)
+++ head/sys/arm64/arm64/machdep.c  Mon Nov 26 20:52:53 2018
(r340995)
@@ -656,6 +656,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
fp = (struct sigframe *)STACKALIGN(fp);
 
/* Fill in the frame to copy out */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;

Modified: head/sys/riscv/riscv/machdep.c
==
--- head/sys/riscv/riscv/machdep.c  Mon Nov 26 20:50:55 2018
(r340994)
+++ head/sys/riscv/riscv/machdep.c  Mon Nov 26 20:52:53 2018
(r340995)
@@ -582,6 +582,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
fp = (struct sigframe *)STACKALIGN(fp);
 
/* Fill in the frame to copy out */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;
___
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: r340996 - in head/sys: amd64/amd64 amd64/ia32 i386/i386 kern

2018-11-26 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Nov 26 20:56:05 2018
New Revision: 340996
URL: https://svnweb.freebsd.org/changeset/base/340996

Log:
  Remove superfluous bzero in getcontext/swapcontext/sendsig
  
  We zero the whole structure; we don't need to zero the __spare__ field again.
  
  Remove trailing whitespace.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/i386/i386/machdep.c
  head/sys/kern/kern_context.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Mon Nov 26 20:52:53 2018
(r340995)
+++ head/sys/amd64/amd64/machdep.c  Mon Nov 26 20:56:05 2018
(r340996)
@@ -392,7 +392,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
sf.sf_uc.uc_mcontext.mc_gsbase = pcb->pcb_gsbase;
bzero(sf.sf_uc.uc_mcontext.mc_spare,
sizeof(sf.sf_uc.uc_mcontext.mc_spare));
-   bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
 
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&

Modified: head/sys/amd64/ia32/ia32_signal.c
==
--- head/sys/amd64/ia32/ia32_signal.c   Mon Nov 26 20:52:53 2018
(r340995)
+++ head/sys/amd64/ia32/ia32_signal.c   Mon Nov 26 20:56:05 2018
(r340996)
@@ -266,7 +266,6 @@ freebsd32_getcontext(struct thread *td, struct freebsd
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
PROC_UNLOCK(td->td_proc);
-   bzero(&uc.__spare__, sizeof(uc.__spare__));
ret = copyout(&uc, uap->ucp, UC_COPY_SIZE);
}
return (ret);
@@ -276,7 +275,7 @@ int
 freebsd32_setcontext(struct thread *td, struct freebsd32_setcontext_args *uap)
 {
struct ia32_ucontext uc;
-   int ret;
+   int ret;
 
if (uap->ucp == NULL)
ret = EINVAL;
@@ -297,7 +296,7 @@ int
 freebsd32_swapcontext(struct thread *td, struct freebsd32_swapcontext_args 
*uap)
 {
struct ia32_ucontext uc;
-   int ret;
+   int ret;
 
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
@@ -622,7 +621,6 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t 
fpstate_drop(td);
sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase;
sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase;
-   bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
 
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cMon Nov 26 20:52:53 2018
(r340995)
+++ head/sys/i386/i386/machdep.cMon Nov 26 20:56:05 2018
(r340996)
@@ -645,7 +645,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
sdp->sd_lobase;
bzero(sf.sf_uc.uc_mcontext.mc_spare2,
sizeof(sf.sf_uc.uc_mcontext.mc_spare2));
-   bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
 
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&

Modified: head/sys/kern/kern_context.c
==
--- head/sys/kern/kern_context.cMon Nov 26 20:52:53 2018
(r340995)
+++ head/sys/kern/kern_context.cMon Nov 26 20:56:05 2018
(r340996)
@@ -75,7 +75,6 @@ sys_getcontext(struct thread *td, struct getcontext_ar
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
PROC_UNLOCK(td->td_proc);
-   bzero(uc.__spare__, sizeof(uc.__spare__));
ret = copyout(&uc, uap->ucp, UC_COPY_SIZE);
}
return (ret);
@@ -85,7 +84,7 @@ int
 sys_setcontext(struct thread *td, struct setcontext_args *uap)
 {
ucontext_t uc;
-   int ret;
+   int ret;
 
if (uap->ucp == NULL)
ret = EINVAL;
@@ -106,14 +105,13 @@ int
 sys_swapcontext(struct thread *td, struct swapcontext_args *uap)
 {
ucontext_t uc;
-   int ret;
+   int ret;
 
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
bzero(&uc, sizeof(ucontext_t));
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
-   bzero(uc.__spare__, sizeof(uc.__spare__));
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
PROC_UNLOCK(td->td_proc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.or

svn commit: r341086 - stable/12/sys/netinet6

2018-11-27 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Nov 27 19:40:07 2018
New Revision: 341086
URL: https://svnweb.freebsd.org/changeset/base/341086

Log:
  MFC r340257
  
  in6_ifattach_linklocal: handle immediate removal of the new LLA
  
  If another thread immediately removes the link-local address
  added by in6_update_ifa(), in6ifa_ifpforlinklocal() can return NULL,
  so the following assertion (or dereference) is wrong.
  Remove the assertion, and handle NULL somewhat better than panicking.
  This matches all of the other callers of in6_update_ifa().
  
  PR:   219250
  Reviewed by:  bz, dab (both an earlier version)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D17898

Modified:
  stable/12/sys/netinet6/in6_ifattach.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet6/in6_ifattach.c
==
--- stable/12/sys/netinet6/in6_ifattach.c   Tue Nov 27 17:58:25 2018
(r341085)
+++ stable/12/sys/netinet6/in6_ifattach.c   Tue Nov 27 19:40:07 2018
(r341086)
@@ -481,9 +481,16 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet
return (-1);
}
 
-   ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */
-   KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp));
-
+   ia = in6ifa_ifpforlinklocal(ifp, 0);
+   if (ia == NULL) {
+   /*
+* Another thread removed the address that we just added.
+* This should be rare, but it happens.
+*/
+   nd6log((LOG_NOTICE, "%s: %s: new link-local address "
+   "disappeared\n", __func__, if_name(ifp)));
+   return (-1);
+   }
ifa_free(&ia->ia_ifa);
 
/*
___
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: r341087 - stable/11/sys/netinet6

2018-11-27 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Nov 27 19:40:18 2018
New Revision: 341087
URL: https://svnweb.freebsd.org/changeset/base/341087

Log:
  MFC r340257
  
  in6_ifattach_linklocal: handle immediate removal of the new LLA
  
  If another thread immediately removes the link-local address
  added by in6_update_ifa(), in6ifa_ifpforlinklocal() can return NULL,
  so the following assertion (or dereference) is wrong.
  Remove the assertion, and handle NULL somewhat better than panicking.
  This matches all of the other callers of in6_update_ifa().
  
  PR:   219250
  Reviewed by:  bz, dab (both an earlier version)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D17898

Modified:
  stable/11/sys/netinet6/in6_ifattach.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/in6_ifattach.c
==
--- stable/11/sys/netinet6/in6_ifattach.c   Tue Nov 27 19:40:07 2018
(r341086)
+++ stable/11/sys/netinet6/in6_ifattach.c   Tue Nov 27 19:40:18 2018
(r341087)
@@ -502,9 +502,16 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet
return (-1);
}
 
-   ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */
-   KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp));
-
+   ia = in6ifa_ifpforlinklocal(ifp, 0);
+   if (ia == NULL) {
+   /*
+* Another thread removed the address that we just added.
+* This should be rare, but it happens.
+*/
+   nd6log((LOG_NOTICE, "%s: %s: new link-local address "
+   "disappeared\n", __func__, if_name(ifp)));
+   return (-1);
+   }
ifa_free(&ia->ia_ifa);
 
/*
___
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: r341090 - stable/12

2018-11-27 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Nov 27 19:44:04 2018
New Revision: 341090
URL: https://svnweb.freebsd.org/changeset/base/341090

Log:
  MFC r340328
  
  Update comment about 'universe' disk usage
  
  It's 167 GB now (or 81 GB with ZFS lz4).
  
  Sponsored by: Dell EMC Isilon

Modified:
  stable/12/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/Makefile
==
--- stable/12/Makefile  Tue Nov 27 19:43:16 2018(r341089)
+++ stable/12/Makefile  Tue Nov 27 19:44:04 2018(r341090)
@@ -61,9 +61,10 @@
 # Most of the user-driven targets (as listed above) are implemented in
 # Makefile.inc1.  The exceptions are universe, tinderbox and targets.
 #
-# If you want to build your system from source be sure that /usr/obj has
-# at least 6GB of diskspace available.  A complete 'universe' build requires
-# about 100GB of space.
+# If you want to build your system from source, be sure that /usr/obj has
+# at least 6 GB of disk space available.  A complete 'universe' build of
+# r340283 (2018-11) required 167 GB of space.  ZFS lz4 compression
+# achieved a 2.18x ratio, reducing actual space to 81 GB.
 #
 # For individuals wanting to build from the sources currently on their
 # system, the simple instructions are:
___
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: r341092 - stable/12/usr.sbin/periodic/etc/daily

2018-11-27 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Nov 27 19:45:24 2018
New Revision: 341092
URL: https://svnweb.freebsd.org/changeset/base/341092

Log:
  MFC r340345
  
  Fix daily mailq script for Postfix and daily_show_success="NO"
  
  Exit with a zero status when Postfix reports "Mail queue is empty" so this
  section won't appear in the report at all when daily_show_success="NO".
  
  Sponsored by: Dell EMC Isilon

Modified:
  stable/12/usr.sbin/periodic/etc/daily/440.status-mailq
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/periodic/etc/daily/440.status-mailq
==
--- stable/12/usr.sbin/periodic/etc/daily/440.status-mailq  Tue Nov 27 
19:44:39 2018(r341091)
+++ stable/12/usr.sbin/periodic/etc/daily/440.status-mailq  Tue Nov 27 
19:45:24 2018(r341092)
@@ -33,7 +33,7 @@ case "$daily_status_mailq_enable" in
*)
mailq;;
esac | tee /dev/stderr |
-   egrep -v '(mqueue is empty|Total requests)' | wc -l)
+   egrep -v '((Mail |m)queue is empty|Total requests)' | wc -l)
[ $rc -gt 0 ] && rc=1 || rc=0
 
case "$daily_status_include_submit_mailq" in
___
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: r341099 - stable/12/sys/kern

2018-11-27 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Nov 27 22:32:34 2018
New Revision: 341099
URL: https://svnweb.freebsd.org/changeset/base/341099

Log:
  MFC r340409
  
  Make no assertions about lock state when the scheduler is stopped.
  
  Change the assert paths in rm, rw, and sx locks to match the lock
  and unlock paths.  I did this for mutexes in r306346.
  
  Reported by:  Travis Lane 
  Sponsored by: Dell EMC Isilon

Modified:
  stable/12/sys/kern/kern_rmlock.c
  stable/12/sys/kern/kern_rwlock.c
  stable/12/sys/kern/kern_sx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_rmlock.c
==
--- stable/12/sys/kern/kern_rmlock.cTue Nov 27 22:02:54 2018
(r341098)
+++ stable/12/sys/kern/kern_rmlock.cTue Nov 27 22:32:34 2018
(r341099)
@@ -742,7 +742,7 @@ _rm_assert(const struct rmlock *rm, int what, const ch
 {
int count;
 
-   if (panicstr != NULL)
+   if (SCHEDULER_STOPPED())
return;
switch (what) {
case RA_LOCKED:

Modified: stable/12/sys/kern/kern_rwlock.c
==
--- stable/12/sys/kern/kern_rwlock.cTue Nov 27 22:02:54 2018
(r341098)
+++ stable/12/sys/kern/kern_rwlock.cTue Nov 27 22:32:34 2018
(r341099)
@@ -1439,7 +1439,7 @@ __rw_assert(const volatile uintptr_t *c, int what, con
 {
const struct rwlock *rw;
 
-   if (panicstr != NULL)
+   if (SCHEDULER_STOPPED())
return;
 
rw = rwlock2rw(c);

Modified: stable/12/sys/kern/kern_sx.c
==
--- stable/12/sys/kern/kern_sx.cTue Nov 27 22:02:54 2018
(r341098)
+++ stable/12/sys/kern/kern_sx.cTue Nov 27 22:32:34 2018
(r341099)
@@ -1416,7 +1416,7 @@ _sx_assert(const struct sx *sx, int what, const char *
int slocked = 0;
 #endif
 
-   if (panicstr != NULL)
+   if (SCHEDULER_STOPPED())
return;
switch (what) {
case SA_SLOCKED:
___
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: r341100 - stable/11/sys/kern

2018-11-27 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Nov 27 22:33:58 2018
New Revision: 341100
URL: https://svnweb.freebsd.org/changeset/base/341100

Log:
  MFC r340409
  
  Make no assertions about lock state when the scheduler is stopped.
  
  Change the assert paths in rm, rw, and sx locks to match the lock
  and unlock paths.  I did this for mutexes in r306346.
  
  Reported by:  Travis Lane 
  Sponsored by: Dell EMC Isilon

Modified:
  stable/11/sys/kern/kern_rmlock.c
  stable/11/sys/kern/kern_rwlock.c
  stable/11/sys/kern/kern_sx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_rmlock.c
==
--- stable/11/sys/kern/kern_rmlock.cTue Nov 27 22:32:34 2018
(r341099)
+++ stable/11/sys/kern/kern_rmlock.cTue Nov 27 22:33:58 2018
(r341100)
@@ -740,7 +740,7 @@ _rm_assert(const struct rmlock *rm, int what, const ch
 {
int count;
 
-   if (panicstr != NULL)
+   if (SCHEDULER_STOPPED())
return;
switch (what) {
case RA_LOCKED:

Modified: stable/11/sys/kern/kern_rwlock.c
==
--- stable/11/sys/kern/kern_rwlock.cTue Nov 27 22:32:34 2018
(r341099)
+++ stable/11/sys/kern/kern_rwlock.cTue Nov 27 22:33:58 2018
(r341100)
@@ -1378,7 +1378,7 @@ __rw_assert(const volatile uintptr_t *c, int what, con
 {
const struct rwlock *rw;
 
-   if (panicstr != NULL)
+   if (SCHEDULER_STOPPED())
return;
 
rw = rwlock2rw(c);

Modified: stable/11/sys/kern/kern_sx.c
==
--- stable/11/sys/kern/kern_sx.cTue Nov 27 22:32:34 2018
(r341099)
+++ stable/11/sys/kern/kern_sx.cTue Nov 27 22:33:58 2018
(r341100)
@@ -1312,7 +1312,7 @@ _sx_assert(const struct sx *sx, int what, const char *
int slocked = 0;
 #endif
 
-   if (panicstr != NULL)
+   if (SCHEDULER_STOPPED())
return;
switch (what) {
case SA_SLOCKED:
___
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: r341146 - in stable/12/sys: amd64/ia32 mips/mips powerpc/powerpc

2018-11-28 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Nov 28 15:31:05 2018
New Revision: 341146
URL: https://svnweb.freebsd.org/changeset/base/341146

Log:
  MFC r340994
  
  Prevent kernel stack disclosure in getcontext/swapcontext
  
  Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.
  
  Security: FreeBSD-EN-18:12.mem
  Security: CVE-2018-17155
  Sponsored by: Dell EMC Isilon

Modified:
  stable/12/sys/amd64/ia32/ia32_signal.c
  stable/12/sys/mips/mips/freebsd32_machdep.c
  stable/12/sys/powerpc/powerpc/exec_machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/ia32/ia32_signal.c
==
--- stable/12/sys/amd64/ia32/ia32_signal.c  Wed Nov 28 15:29:58 2018
(r341145)
+++ stable/12/sys/amd64/ia32/ia32_signal.c  Wed Nov 28 15:31:05 2018
(r341146)
@@ -261,6 +261,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -301,6 +302,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;

Modified: stable/12/sys/mips/mips/freebsd32_machdep.c
==
--- stable/12/sys/mips/mips/freebsd32_machdep.c Wed Nov 28 15:29:58 2018
(r341145)
+++ stable/12/sys/mips/mips/freebsd32_machdep.c Wed Nov 28 15:31:05 2018
(r341146)
@@ -294,6 +294,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -333,6 +334,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;

Modified: stable/12/sys/powerpc/powerpc/exec_machdep.c
==
--- stable/12/sys/powerpc/powerpc/exec_machdep.cWed Nov 28 15:29:58 
2018(r341145)
+++ stable/12/sys/powerpc/powerpc/exec_machdep.cWed Nov 28 15:31:05 
2018(r341146)
@@ -783,6 +783,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -822,6 +823,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
___
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: r341147 - in stable/12/sys: arm/arm arm64/arm64 riscv/riscv

2018-11-28 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Nov 28 15:34:46 2018
New Revision: 341147
URL: https://svnweb.freebsd.org/changeset/base/341147

Log:
  MFC r340995
  
  Prevent kernel stack disclosure in signal delivery
  
  On arm64 and riscv platforms, sendsig() failed to zero the signal
  frame before copying it out to userspace.  Zero it.
  
  On arm, I believe all the contents of the frame were initialized,
  so there was no disclosure.  However, explicitly zero the whole frame
  because that fact could inadvertently change in the future,
  it's more clear to the reader, and I could be wrong in the first place.
  
  Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
  Sponsored by: Dell EMC Isilon

Modified:
  stable/12/sys/arm/arm/machdep.c
  stable/12/sys/arm64/arm64/machdep.c
  stable/12/sys/riscv/riscv/machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/arm/machdep.c
==
--- stable/12/sys/arm/arm/machdep.c Wed Nov 28 15:31:05 2018
(r341146)
+++ stable/12/sys/arm/arm/machdep.c Wed Nov 28 15:34:46 2018
(r341147)
@@ -641,6 +641,7 @@ sendsig(catcher, ksi, mask)
/* make the stack aligned */
fp = (struct sigframe *)STACKALIGN(fp);
/* Populate the siginfo frame. */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
 #ifdef VFP
get_vfpcontext(td, &frame.sf_vfp);

Modified: stable/12/sys/arm64/arm64/machdep.c
==
--- stable/12/sys/arm64/arm64/machdep.c Wed Nov 28 15:31:05 2018
(r341146)
+++ stable/12/sys/arm64/arm64/machdep.c Wed Nov 28 15:34:46 2018
(r341147)
@@ -656,6 +656,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
fp = (struct sigframe *)STACKALIGN(fp);
 
/* Fill in the frame to copy out */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;

Modified: stable/12/sys/riscv/riscv/machdep.c
==
--- stable/12/sys/riscv/riscv/machdep.c Wed Nov 28 15:31:05 2018
(r341146)
+++ stable/12/sys/riscv/riscv/machdep.c Wed Nov 28 15:34:46 2018
(r341147)
@@ -583,6 +583,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
fp = (struct sigframe *)STACKALIGN(fp);
 
/* Fill in the frame to copy out */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;
___
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: r341149 - in releng/12.0/sys: amd64/ia32 mips/mips powerpc/powerpc

2018-11-28 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Nov 28 16:20:04 2018
New Revision: 341149
URL: https://svnweb.freebsd.org/changeset/base/341149

Log:
  MFS r341146
  
  MFC r340994
  
  Prevent kernel stack disclosure in getcontext/swapcontext
  
  Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.
  
  Approved by:  re (gjb)
  Security: FreeBSD-EN-18:12.mem
  Security: CVE-2018-17155
  Sponsored by: Dell EMC Isilon

Modified:
  releng/12.0/sys/amd64/ia32/ia32_signal.c
  releng/12.0/sys/mips/mips/freebsd32_machdep.c
  releng/12.0/sys/powerpc/powerpc/exec_machdep.c
Directory Properties:
  releng/12.0/   (props changed)

Modified: releng/12.0/sys/amd64/ia32/ia32_signal.c
==
--- releng/12.0/sys/amd64/ia32/ia32_signal.cWed Nov 28 16:00:52 2018
(r341148)
+++ releng/12.0/sys/amd64/ia32/ia32_signal.cWed Nov 28 16:20:04 2018
(r341149)
@@ -261,6 +261,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -301,6 +302,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;

Modified: releng/12.0/sys/mips/mips/freebsd32_machdep.c
==
--- releng/12.0/sys/mips/mips/freebsd32_machdep.c   Wed Nov 28 16:00:52 
2018(r341148)
+++ releng/12.0/sys/mips/mips/freebsd32_machdep.c   Wed Nov 28 16:20:04 
2018(r341149)
@@ -294,6 +294,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -333,6 +334,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;

Modified: releng/12.0/sys/powerpc/powerpc/exec_machdep.c
==
--- releng/12.0/sys/powerpc/powerpc/exec_machdep.c  Wed Nov 28 16:00:52 
2018(r341148)
+++ releng/12.0/sys/powerpc/powerpc/exec_machdep.c  Wed Nov 28 16:20:04 
2018(r341149)
@@ -783,6 +783,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -822,6 +823,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
___
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: r341153 - in releng/12.0/sys: arm/arm arm64/arm64 riscv/riscv

2018-11-28 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Nov 28 16:58:35 2018
New Revision: 341153
URL: https://svnweb.freebsd.org/changeset/base/341153

Log:
  MFS r341147
  
  MFC r340995
  
  Prevent kernel stack disclosure in signal delivery
  
  On arm64 and riscv platforms, sendsig() failed to zero the signal
  frame before copying it out to userspace.  Zero it.
  
  On arm, I believe all the contents of the frame were initialized,
  so there was no disclosure.  However, explicitly zero the whole frame
  because that fact could inadvertently change in the future,
  it's more clear to the reader, and I could be wrong in the first place.
  
  Approved by:  re (gjb)
  Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
  Sponsored by: Dell EMC Isilon

Modified:
  releng/12.0/sys/arm/arm/machdep.c
  releng/12.0/sys/arm64/arm64/machdep.c
  releng/12.0/sys/riscv/riscv/machdep.c
Directory Properties:
  releng/12.0/   (props changed)

Modified: releng/12.0/sys/arm/arm/machdep.c
==
--- releng/12.0/sys/arm/arm/machdep.c   Wed Nov 28 16:52:41 2018
(r341152)
+++ releng/12.0/sys/arm/arm/machdep.c   Wed Nov 28 16:58:35 2018
(r341153)
@@ -641,6 +641,7 @@ sendsig(catcher, ksi, mask)
/* make the stack aligned */
fp = (struct sigframe *)STACKALIGN(fp);
/* Populate the siginfo frame. */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
 #ifdef VFP
get_vfpcontext(td, &frame.sf_vfp);

Modified: releng/12.0/sys/arm64/arm64/machdep.c
==
--- releng/12.0/sys/arm64/arm64/machdep.c   Wed Nov 28 16:52:41 2018
(r341152)
+++ releng/12.0/sys/arm64/arm64/machdep.c   Wed Nov 28 16:58:35 2018
(r341153)
@@ -656,6 +656,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
fp = (struct sigframe *)STACKALIGN(fp);
 
/* Fill in the frame to copy out */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;

Modified: releng/12.0/sys/riscv/riscv/machdep.c
==
--- releng/12.0/sys/riscv/riscv/machdep.c   Wed Nov 28 16:52:41 2018
(r341152)
+++ releng/12.0/sys/riscv/riscv/machdep.c   Wed Nov 28 16:58:35 2018
(r341153)
@@ -583,6 +583,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
fp = (struct sigframe *)STACKALIGN(fp);
 
/* Fill in the frame to copy out */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;
___
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: r341165 - in stable/11/sys: amd64/ia32 mips/mips powerpc/powerpc

2018-11-28 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Nov 28 21:19:58 2018
New Revision: 341165
URL: https://svnweb.freebsd.org/changeset/base/341165

Log:
  MFC r340994
  
  Prevent kernel stack disclosure in getcontext/swapcontext
  
  Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.
  
  Security: FreeBSD-EN-18:12.mem
  Security: CVE-2018-17155
  Sponsored by: Dell EMC Isilon

Modified:
  stable/11/sys/amd64/ia32/ia32_signal.c
  stable/11/sys/mips/mips/freebsd32_machdep.c
  stable/11/sys/powerpc/powerpc/exec_machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/ia32/ia32_signal.c
==
--- stable/11/sys/amd64/ia32/ia32_signal.c  Wed Nov 28 20:03:53 2018
(r341164)
+++ stable/11/sys/amd64/ia32/ia32_signal.c  Wed Nov 28 21:19:58 2018
(r341165)
@@ -260,6 +260,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -300,6 +301,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;

Modified: stable/11/sys/mips/mips/freebsd32_machdep.c
==
--- stable/11/sys/mips/mips/freebsd32_machdep.c Wed Nov 28 20:03:53 2018
(r341164)
+++ stable/11/sys/mips/mips/freebsd32_machdep.c Wed Nov 28 21:19:58 2018
(r341165)
@@ -290,6 +290,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -329,6 +330,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;

Modified: stable/11/sys/powerpc/powerpc/exec_machdep.c
==
--- stable/11/sys/powerpc/powerpc/exec_machdep.cWed Nov 28 20:03:53 
2018(r341164)
+++ stable/11/sys/powerpc/powerpc/exec_machdep.cWed Nov 28 21:19:58 
2018(r341165)
@@ -801,6 +801,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd
if (uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -840,6 +841,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+   bzero(&uc, sizeof(uc));
get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
___
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: r341166 - in stable/11/sys: arm/arm arm64/arm64 riscv/riscv

2018-11-28 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Nov 28 21:20:51 2018
New Revision: 341166
URL: https://svnweb.freebsd.org/changeset/base/341166

Log:
  MFC r340995
  
  Prevent kernel stack disclosure in signal delivery
  
  On arm64 and riscv platforms, sendsig() failed to zero the signal
  frame before copying it out to userspace.  Zero it.
  
  On arm, I believe all the contents of the frame were initialized,
  so there was no disclosure.  However, explicitly zero the whole frame
  because that fact could inadvertently change in the future,
  it's more clear to the reader, and I could be wrong in the first place.
  
  Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
  Sponsored by: Dell EMC Isilon

Modified:
  stable/11/sys/arm/arm/machdep.c
  stable/11/sys/arm64/arm64/machdep.c
  stable/11/sys/riscv/riscv/machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/arm/machdep.c
==
--- stable/11/sys/arm/arm/machdep.c Wed Nov 28 21:19:58 2018
(r341165)
+++ stable/11/sys/arm/arm/machdep.c Wed Nov 28 21:20:51 2018
(r341166)
@@ -609,6 +609,7 @@ sendsig(catcher, ksi, mask)
/* make the stack aligned */
fp = (struct sigframe *)STACKALIGN(fp);
/* Populate the siginfo frame. */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
 #ifdef VFP
get_vfpcontext(td, &frame.sf_vfp);

Modified: stable/11/sys/arm64/arm64/machdep.c
==
--- stable/11/sys/arm64/arm64/machdep.c Wed Nov 28 21:19:58 2018
(r341165)
+++ stable/11/sys/arm64/arm64/machdep.c Wed Nov 28 21:20:51 2018
(r341166)
@@ -590,6 +590,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
fp = (struct sigframe *)STACKALIGN(fp);
 
/* Fill in the frame to copy out */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;

Modified: stable/11/sys/riscv/riscv/machdep.c
==
--- stable/11/sys/riscv/riscv/machdep.c Wed Nov 28 21:19:58 2018
(r341165)
+++ stable/11/sys/riscv/riscv/machdep.c Wed Nov 28 21:20:51 2018
(r341166)
@@ -522,6 +522,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
fp = (struct sigframe *)STACKALIGN(fp);
 
/* Fill in the frame to copy out */
+   bzero(&frame, sizeof(frame));
get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;
___
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: r341277 - head/lib/libthr/thread

2018-11-29 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Nov 30 03:01:32 2018
New Revision: 341277
URL: https://svnweb.freebsd.org/changeset/base/341277

Log:
  _thr_setthreaded() cannot fail; change return type to void
  
  Also remove logic to avoid unnecessary stores to the global variable.
  Thread creation and destruction are heavy enough that any supposed savings
  is in the noise.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libthr/thread/thr_create.c
  head/lib/libthr/thread/thr_kern.c
  head/lib/libthr/thread/thr_private.h

Modified: head/lib/libthr/thread/thr_create.c
==
--- head/lib/libthr/thread/thr_create.c Fri Nov 30 02:14:41 2018
(r341276)
+++ head/lib/libthr/thread/thr_create.c Fri Nov 30 03:01:32 2018
(r341277)
@@ -73,8 +73,7 @@ _pthread_create(pthread_t * __restrict thread,
 */
if (_thr_isthreaded() == 0) {
_malloc_first_thread();
-   if (_thr_setthreaded(1))
-   return (EAGAIN);
+   _thr_setthreaded(1);
}
 
curthread = _get_curthread();

Modified: head/lib/libthr/thread/thr_kern.c
==
--- head/lib/libthr/thread/thr_kern.c   Fri Nov 30 02:14:41 2018
(r341276)
+++ head/lib/libthr/thread/thr_kern.c   Fri Nov 30 03:01:32 2018
(r341277)
@@ -53,14 +53,10 @@ static struct wake_addr default_wake_addr;
  * This is called when the first thread (other than the initial
  * thread) is created.
  */
-int
+void
 _thr_setthreaded(int threaded)
 {
-   if (((threaded == 0) ^ (__isthreaded == 0)) == 0)
-   return (0);
-
__isthreaded = threaded;
-   return (0);
 }
 
 void

Modified: head/lib/libthr/thread/thr_private.h
==
--- head/lib/libthr/thread/thr_private.hFri Nov 30 02:14:41 2018
(r341276)
+++ head/lib/libthr/thread/thr_private.hFri Nov 30 03:01:32 2018
(r341277)
@@ -776,7 +776,7 @@ extern struct pthread   *_single_thread __hidden;
  * Function prototype definitions.
  */
 __BEGIN_DECLS
-int_thr_setthreaded(int) __hidden;
+void   _thr_setthreaded(int) __hidden;
 int_mutex_cv_lock(struct pthread_mutex *, int, bool) __hidden;
 int_mutex_cv_unlock(struct pthread_mutex *, int *, int *) __hidden;
 int _mutex_cv_attach(struct pthread_mutex *, int) __hidden;
___
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: r341278 - head/lib/libthr/thread

2018-11-29 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Nov 30 03:02:49 2018
New Revision: 341278
URL: https://svnweb.freebsd.org/changeset/base/341278

Log:
  Use _thr_isthreaded() and _thr_setthreaded() wrappers
  
  ...instead of directly using the global variable.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libthr/thread/thr_fork.c
  head/lib/libthr/thread/thr_spinlock.c

Modified: head/lib/libthr/thread/thr_fork.c
==
--- head/lib/libthr/thread/thr_fork.c   Fri Nov 30 03:01:32 2018
(r341277)
+++ head/lib/libthr/thread/thr_fork.c   Fri Nov 30 03:02:49 2018
(r341278)
@@ -219,9 +219,9 @@ __thr_fork(void)
_thr_rwl_rdlock(&_thr_atfork_lock);
 
if (was_threaded) {
-   __isthreaded = 1;
+   _thr_setthreaded(1);
_malloc_postfork();
-   __isthreaded = 0;
+   _thr_setthreaded(0);
}
 
/* Ready to continue, unblock signals. */ 

Modified: head/lib/libthr/thread/thr_spinlock.c
==
--- head/lib/libthr/thread/thr_spinlock.c   Fri Nov 30 03:01:32 2018
(r341277)
+++ head/lib/libthr/thread/thr_spinlock.c   Fri Nov 30 03:02:49 2018
(r341278)
@@ -58,7 +58,7 @@ static intinitialized;
 static voidinit_spinlock(spinlock_t *lck);
 
 /*
- * These are for compatability only.  Spinlocks of this type
+ * These are for compatibility only.  Spinlocks of this type
  * are deprecated.
  */
 
@@ -76,7 +76,7 @@ __thr_spinlock(spinlock_t *lck)
 {
struct spinlock_extra *_extra;
 
-   if (!__isthreaded)
+   if (!_thr_isthreaded())
PANIC("Spinlock called when not threaded.");
if (!initialized)
PANIC("Spinlocks not initialized.");
___
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: r341281 - head/sys/vm

2018-11-29 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Nov 30 04:18:31 2018
New Revision: 341281
URL: https://svnweb.freebsd.org/changeset/base/341281

Log:
  Add assertions and comment to vm_object_vnode()
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D2724

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==
--- head/sys/vm/vm_object.c Fri Nov 30 04:15:56 2018(r341280)
+++ head/sys/vm/vm_object.c Fri Nov 30 04:18:31 2018(r341281)
@@ -2306,16 +2306,28 @@ next_page:
}
 }
 
+/*
+ * Return the vnode for the given object, or NULL if none exists.
+ * For tmpfs objects, the function may return NULL if there is
+ * no vnode allocated at the time of the call.
+ */
 struct vnode *
 vm_object_vnode(vm_object_t object)
 {
+   struct vnode *vp;
 
VM_OBJECT_ASSERT_LOCKED(object);
-   if (object->type == OBJT_VNODE)
-   return (object->handle);
-   if (object->type == OBJT_SWAP && (object->flags & OBJ_TMPFS) != 0)
-   return (object->un_pager.swp.swp_tmpfs);
-   return (NULL);
+   if (object->type == OBJT_VNODE) {
+   vp = object->handle;
+   KASSERT(vp != NULL, ("%s: OBJT_VNODE has no vnode", __func__));
+   } else if (object->type == OBJT_SWAP &&
+   (object->flags & OBJ_TMPFS) != 0) {
+   vp = object->un_pager.swp.swp_tmpfs;
+   KASSERT(vp != NULL, ("%s: OBJT_TMPFS has no vnode", __func__));
+   } else {
+   vp = NULL;
+   }
+   return (vp);
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341282 - in head/sys: kern vm

2018-11-29 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Nov 30 04:59:43 2018
New Revision: 341282
URL: https://svnweb.freebsd.org/changeset/base/341282

Log:
  Include path for tmpfs objects in vm.objects sysctl
  
  This applies the fix in r283924 to the vm.objects sysctl
  added by r283624 so the output will include the vnode
  information (i.e. path) for tmpfs objects.
  
  Reviewed by:  kib, dab
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D2724

Modified:
  head/sys/kern/kern_proc.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_object.h

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Fri Nov 30 04:18:31 2018(r341281)
+++ head/sys/kern/kern_proc.c   Fri Nov 30 04:59:43 2018(r341282)
@@ -2219,43 +2219,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS)
freepath = NULL;
fullpath = "";
if (lobj) {
-   vp = NULL;
-   switch (lobj->type) {
-   case OBJT_DEFAULT:
-   kve->kve_type = KVME_TYPE_DEFAULT;
-   break;
-   case OBJT_VNODE:
-   kve->kve_type = KVME_TYPE_VNODE;
-   vp = lobj->handle;
-   vref(vp);
-   break;
-   case OBJT_SWAP:
-   if ((lobj->flags & OBJ_TMPFS_NODE) != 0) {
-   kve->kve_type = KVME_TYPE_VNODE;
-   if ((lobj->flags & OBJ_TMPFS) != 0) {
-   vp = 
lobj->un_pager.swp.swp_tmpfs;
-   vref(vp);
-   }
-   } else {
-   kve->kve_type = KVME_TYPE_SWAP;
-   }
-   break;
-   case OBJT_DEVICE:
-   kve->kve_type = KVME_TYPE_DEVICE;
-   break;
-   case OBJT_PHYS:
-   kve->kve_type = KVME_TYPE_PHYS;
-   break;
-   case OBJT_DEAD:
-   kve->kve_type = KVME_TYPE_DEAD;
-   break;
-   case OBJT_SG:
-   kve->kve_type = KVME_TYPE_SG;
-   break;
-   default:
+   kve->kve_type = vm_object_kvme_type(lobj, &vp);
+   if (kve->kve_type == KVME_TYPE_MGTDEVICE)
kve->kve_type = KVME_TYPE_UNKNOWN;
-   break;
-   }
+   if (vp != NULL)
+   vref(vp);
if (lobj != obj)
VM_OBJECT_RUNLOCK(lobj);
 
@@ -2463,46 +2431,9 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, s
freepath = NULL;
fullpath = "";
if (lobj != NULL) {
-   vp = NULL;
-   switch (lobj->type) {
-   case OBJT_DEFAULT:
-   kve->kve_type = KVME_TYPE_DEFAULT;
-   break;
-   case OBJT_VNODE:
-   kve->kve_type = KVME_TYPE_VNODE;
-   vp = lobj->handle;
+   kve->kve_type = vm_object_kvme_type(lobj, &vp);
+   if (vp != NULL)
vref(vp);
-   break;
-   case OBJT_SWAP:
-   if ((lobj->flags & OBJ_TMPFS_NODE) != 0) {
-   kve->kve_type = KVME_TYPE_VNODE;
-   if ((lobj->flags & OBJ_TMPFS) != 0) {
-   vp = 
lobj->un_pager.swp.swp_tmpfs;
-   vref(vp);
-   }
-   } else {
-   kve->kve_type = KVME_TYPE_SWAP;
-   }
-   break;
-   case OBJT_DEVICE:
-   kve->kve_type = KVME_TYPE_DEVICE;
-   break;
-   case OBJT_PHYS:
-   kve->kve_type = KVME_TYPE_PHYS;
-   break;
-   case OBJT_DEAD:
-   kve->kve_type = KVME_TYPE_DEAD;
-   break;

svn commit: r341353 - in head: sys/arm/arm sys/arm64/arm64 sys/riscv/riscv tests/sys/kern

2018-11-30 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Nov 30 22:44:33 2018
New Revision: 341353
URL: https://svnweb.freebsd.org/changeset/base/341353

Log:
  Fix reporting of SS_ONSTACK
  
  Fix reporting of SS_ONSTACK in nested signal delivery when sigaltstack()
  is used on some architectures.
  
  Add a unit test for this.  I tested the test by introducing the bug
  on amd64.  I did not test it on other architectures.
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D18347

Added:
  head/tests/sys/kern/sigaltstack.c   (contents, props changed)
Modified:
  head/sys/arm/arm/machdep.c
  head/sys/arm64/arm64/machdep.c
  head/sys/riscv/riscv/machdep.c
  head/tests/sys/kern/Makefile

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Fri Nov 30 21:57:02 2018(r341352)
+++ head/sys/arm/arm/machdep.c  Fri Nov 30 22:44:33 2018(r341353)
@@ -653,9 +653,9 @@ sendsig(catcher, ksi, mask)
 #endif
frame.sf_si = ksi->ksi_info;
frame.sf_uc.uc_sigmask = *mask;
-   frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK )
-   ? ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE;
frame.sf_uc.uc_stack = td->td_sigstk;
+   frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ?
+   (onstack ? SS_ONSTACK : 0) : SS_DISABLE;
mtx_unlock(&psp->ps_mtx);
PROC_UNLOCK(td->td_proc);
 

Modified: head/sys/arm64/arm64/machdep.c
==
--- head/sys/arm64/arm64/machdep.c  Fri Nov 30 21:57:02 2018
(r341352)
+++ head/sys/arm64/arm64/machdep.c  Fri Nov 30 22:44:33 2018
(r341353)
@@ -661,9 +661,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;
frame.sf_uc.uc_sigmask = *mask;
-   frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ?
-   ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE;
frame.sf_uc.uc_stack = td->td_sigstk;
+   frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ?
+   (onstack ? SS_ONSTACK : 0) : SS_DISABLE;
mtx_unlock(&psp->ps_mtx);
PROC_UNLOCK(td->td_proc);
 

Modified: head/sys/riscv/riscv/machdep.c
==
--- head/sys/riscv/riscv/machdep.c  Fri Nov 30 21:57:02 2018
(r341352)
+++ head/sys/riscv/riscv/machdep.c  Fri Nov 30 22:44:33 2018
(r341353)
@@ -587,9 +587,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
get_fpcontext(td, &frame.sf_uc.uc_mcontext);
frame.sf_si = ksi->ksi_info;
frame.sf_uc.uc_sigmask = *mask;
-   frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ?
-   ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE;
frame.sf_uc.uc_stack = td->td_sigstk;
+   frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ?
+   (onstack ? SS_ONSTACK : 0) : SS_DISABLE;
mtx_unlock(&psp->ps_mtx);
PROC_UNLOCK(td->td_proc);
 

Modified: head/tests/sys/kern/Makefile
==
--- head/tests/sys/kern/MakefileFri Nov 30 21:57:02 2018
(r341352)
+++ head/tests/sys/kern/MakefileFri Nov 30 22:44:33 2018
(r341353)
@@ -10,6 +10,7 @@ ATF_TESTS_C+= kern_descrip_test
 ATF_TESTS_C+=  ptrace_test
 TEST_METADATA.ptrace_test+=timeout="15"
 ATF_TESTS_C+=  reaper
+ATF_TESTS_C+=  sigaltstack
 PLAIN_TESTS_C+=subr_unit_test
 ATF_TESTS_C+=  sys_getrandom
 ATF_TESTS_C+=  unix_passfd_test

Added: head/tests/sys/kern/sigaltstack.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/kern/sigaltstack.c   Fri Nov 30 22:44:33 2018    
(r341353)
@@ -0,0 +1,115 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2018 Eric van Gyzen
+ *
+ * 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 AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T

svn commit: r341354 - head/tests/sys/kern

2018-11-30 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Nov 30 23:47:57 2018
New Revision: 341354
URL: https://svnweb.freebsd.org/changeset/base/341354

Log:
  Maybe make gcc happy
  
  According to Jenkins, the GCC architectures were unhappy because:
  
  sigaltstack.c:82: warning: missing initializer
  sigaltstack.c:82: warning: (near initialization for 'oss.ss_size')
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/kern/sigaltstack.c

Modified: head/tests/sys/kern/sigaltstack.c
==
--- head/tests/sys/kern/sigaltstack.c   Fri Nov 30 22:44:33 2018
(r341353)
+++ head/tests/sys/kern/sigaltstack.c   Fri Nov 30 23:47:57 2018
(r341354)
@@ -79,7 +79,9 @@ ATF_TC_BODY(ss_onstack, tc)
stack_t ss = {
.ss_size = SIGSTKSZ,
};
-   stack_t oss = {0};
+   stack_t oss = {
+   .ss_size = 0,
+   };
 
ss.ss_sp = malloc(ss.ss_size);
ATF_REQUIRE(ss.ss_sp != 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"


svn commit: r341507 - head/sys/net/altq

2018-12-04 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Dec  4 23:46:43 2018
New Revision: 341507
URL: https://svnweb.freebsd.org/changeset/base/341507

Log:
  altq: remove ALTQ3_COMPAT code
  
  This code has apparently never compiled on FreeBSD since its
  introduction in 2004 (r130365).  It has certainly not compiled
  since 2006, when r164033 added #elsif [sic] preprocessor directives.
  The code was left in the tree to reduce the diff from upstream (KAME).
  Since that upstream is no longer relevant, remove the long-dead code.
  
  This commit is the direct result of:
  
  unifdef -m -UALTQ3_COMPAT sys/net/altq/*
  
  A later commit will do some manual cleanup.
  
  I do not plan to MFC this.  If that would help you, go for it.

Modified:
  head/sys/net/altq/altq.h
  head/sys/net/altq/altq_cbq.c
  head/sys/net/altq/altq_cbq.h
  head/sys/net/altq/altq_cdnr.c
  head/sys/net/altq/altq_hfsc.c
  head/sys/net/altq/altq_hfsc.h
  head/sys/net/altq/altq_priq.c
  head/sys/net/altq/altq_priq.h
  head/sys/net/altq/altq_red.c
  head/sys/net/altq/altq_red.h
  head/sys/net/altq/altq_rio.c
  head/sys/net/altq/altq_rio.h
  head/sys/net/altq/altq_rmclass.c
  head/sys/net/altq/altq_subr.c

Modified: head/sys/net/altq/altq.h
==
--- head/sys/net/altq/altq.hTue Dec  4 22:52:15 2018(r341506)
+++ head/sys/net/altq/altq.hTue Dec  4 23:46:43 2018(r341507)
@@ -38,17 +38,7 @@
 #define ALTQ3_CLFIER_COMPAT/* for compatibility with altq-3 classifier */
 #endif
 
-#ifdef ALTQ3_COMPAT
-#include 
-#include 
-#include 
-#include 
 
-#ifndef IFNAMSIZ
-#defineIFNAMSIZ16
-#endif
-#endif /* ALTQ3_COMPAT */
-
 /* altq discipline type */
 #defineALTQT_NONE  0   /* reserved */
 #defineALTQT_CBQ   1   /* cbq */
@@ -67,12 +57,6 @@
 #defineALTQT_CODEL 14  /* CoDel */
 #defineALTQT_MAX   15  /* should be max discipline 
type + 1 */
 
-#ifdef ALTQ3_COMPAT
-struct altqreq {
-   charifname[IFNAMSIZ];   /* if name, e.g. "en0" */
-   u_long  arg;/* request-specific argument */
-};
-#endif
 
 /* simple token backet meter profile */
 struct tb_profile {
@@ -80,87 +64,8 @@ struct   tb_profile {
u_int32_t   depth;  /* depth in bytes */
 };
 
-#ifdef ALTQ3_COMPAT
-struct tbrreq {
-   charifname[IFNAMSIZ];   /* if name, e.g. "en0" */
-   struct  tb_profile tb_prof; /* token bucket profile */
-};
 
-#ifdef ALTQ3_CLFIER_COMPAT
 /*
- * common network flow info structure
- */
-struct flowinfo {
-   u_char  fi_len; /* total length */
-   u_char  fi_family;  /* address family */
-   u_int8_tfi_data[46];/* actually longer; address family
-  specific flow info. */
-};
-
-/*
- * flow info structure for internet protocol family.
- * (currently this is the only protocol family supported)
- */
-struct flowinfo_in {
-   u_char  fi_len; /* sizeof(struct flowinfo_in) */
-   u_char  fi_family;  /* AF_INET */
-   u_int8_tfi_proto;   /* IPPROTO_XXX */
-   u_int8_tfi_tos; /* type-of-service */
-   struct in_addr  fi_dst; /* dest address */
-   struct in_addr  fi_src; /* src address */
-   u_int16_t   fi_dport;   /* dest port */
-   u_int16_t   fi_sport;   /* src port */
-   u_int32_t   fi_gpi; /* generalized port id for ipsec */
-   u_int8_t_pad[28];   /* make the size equal to
-  flowinfo_in6 */
-};
-
-#ifdef SIN6_LEN
-struct flowinfo_in6 {
-   u_char  fi6_len;/* sizeof(struct flowinfo_in6) */
-   u_char  fi6_family; /* AF_INET6 */
-   u_int8_tfi6_proto;  /* IPPROTO_XXX */
-   u_int8_tfi6_tclass; /* traffic class */
-   u_int32_t   fi6_flowlabel;  /* ipv6 flowlabel */
-   u_int16_t   fi6_dport;  /* dest port */
-   u_int16_t   fi6_sport;  /* src port */
-   u_int32_t   fi6_gpi;/* generalized port id */
-   struct in6_addr fi6_dst;/* dest address */
-   struct in6_addr fi6_src;/* src address */
-};
-#endif /* INET6 */
-
-/*
- * flow filters for AF_INET and AF_INET6
- */
-struct flow_filter {
-   int ff_ruleno;
-   struct flowinfo_in  ff_flow;
-   struct {
-   struct in_addr  mask_dst;
-   struct in_addr  mask_src;
-   u_int8_tmask_tos;
-   u_int8_t_pad[3];
-   } ff_mask;
-   u_int8_t _pad2[24]; /* make the size equal to flow_filter6 */
-};
-
-#ifdef SIN6_LEN
-struct flow_filter6 {
-   int ff_ruleno;
-   struct flowinfo_in6 ff_flow6;
-   struct {
-  

svn commit: r341508 - in head/sys: conf net/altq

2018-12-04 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Dec  4 23:53:42 2018
New Revision: 341508
URL: https://svnweb.freebsd.org/changeset/base/341508

Log:
  altq:  manual cleanup after r341507
  
  Remove a file that became practically empty.
  Fix indentation.
  
  Like r341507, I do not plan to MFC, but anyone else can.

Deleted:
  head/sys/net/altq/altq_cdnr.c
Modified:
  head/sys/conf/files
  head/sys/net/altq/altq_cbq.c
  head/sys/net/altq/altq_hfsc.c
  head/sys/net/altq/altq_priq.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Dec  4 23:46:43 2018(r341507)
+++ head/sys/conf/files Tue Dec  4 23:53:42 2018(r341508)
@@ -4058,7 +4058,6 @@ libkern/timingsafe_bcmp.c standard
 libkern/zlib.c optional crypto | geom_uzip | ipsec | \
ipsec_support | mxge | netgraph_deflate | ddb_ctf | gzio
 net/altq/altq_cbq.coptional altq
-net/altq/altq_cdnr.c   optional altq
 net/altq/altq_codel.c  optional altq
 net/altq/altq_hfsc.c   optional altq
 net/altq/altq_fairq.c  optional altq

Modified: head/sys/net/altq/altq_cbq.c
==
--- head/sys/net/altq/altq_cbq.cTue Dec  4 23:46:43 2018
(r341507)
+++ head/sys/net/altq/altq_cbq.cTue Dec  4 23:53:42 2018
(r341508)
@@ -483,7 +483,7 @@ cbq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct
return (ENOBUFS);
}
}
-   cl->pktattr_ = NULL;
+   cl->pktattr_ = NULL;
len = m_pktlen(m);
if (rmc_queue_packet(cl, m) != 0) {
/* drop occurred.  some mbuf was freed in rmc_queue_packet. */

Modified: head/sys/net/altq/altq_hfsc.c
==
--- head/sys/net/altq/altq_hfsc.c   Tue Dec  4 23:46:43 2018
(r341507)
+++ head/sys/net/altq/altq_hfsc.c   Tue Dec  4 23:53:42 2018
(r341508)
@@ -689,7 +689,7 @@ hfsc_enqueue(struct ifaltq *ifq, struct mbuf *m, struc
return (ENOBUFS);
}
}
-   cl->cl_pktattr = NULL;
+   cl->cl_pktattr = NULL;
len = m_pktlen(m);
if (hfsc_addq(cl, m) != 0) {
/* drop occurred.  mbuf was freed in hfsc_addq. */

Modified: head/sys/net/altq/altq_priq.c
==
--- head/sys/net/altq/altq_priq.c   Tue Dec  4 23:46:43 2018
(r341507)
+++ head/sys/net/altq/altq_priq.c   Tue Dec  4 23:53:42 2018
(r341508)
@@ -473,7 +473,7 @@ priq_enqueue(struct ifaltq *ifq, struct mbuf *m, struc
return (ENOBUFS);
}
}
-   cl->cl_pktattr = NULL;
+   cl->cl_pktattr = NULL;
len = m_pktlen(m);
if (priq_addq(cl, m) != 0) {
/* drop occurred.  mbuf was freed in priq_addq. */
___
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: r306652 - head/usr.sbin/arp

2016-10-03 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Oct  3 19:02:22 2016
New Revision: 306652
URL: https://svnweb.freebsd.org/changeset/base/306652

Log:
  Update arp(4) to document the net.link.ether.inet.garp_rexmit_count sysctl.
  
  Submitted by: David A. Bright 
  Requested by: markj
  Reviewed by:  markj, badger
  MFC after:4 weeks
  X-MFC with:   r306577
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D8136

Modified:
  head/usr.sbin/arp/arp.4

Modified: head/usr.sbin/arp/arp.4
==
--- head/usr.sbin/arp/arp.4 Mon Oct  3 18:20:58 2016(r306651)
+++ head/usr.sbin/arp/arp.4 Mon Oct  3 19:02:22 2016(r306652)
@@ -28,7 +28,7 @@
 .\"@(#)arp4.4  6.5 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd November 5, 2013
+.Dd October 3, 2016
 .Dt ARP 4
 .Os
 .Sh NAME
@@ -126,6 +126,24 @@ the hardware address.
 Installing such entries is RFC 1812 violation, but some prorietary
 load balancing techniques require routers on network to do so.
 Turned off by default.
+.It Va garp_rexmit_count
+Should the kernel retransmit gratuitous ARP (GARP) packets when an IPv4 address
+is added to an interface.
+A GARP is always transmitted when an IPv4 address is added to an interface.
+A non-zero value of this sysctl will cause the GARP packet to be retransmitted
+the stated number of times.
+The interval between retransmissions is doubled each time, so the
+retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds).
+The default value of zero means only the initial GARP is sent; no
+additional GARP packets are retransmitted.
+The maximum value is sixteen.
+.Pp
+Although a single GARP packet (the default behavior) is usually sufficient, in
+some circumstances, such as when a shared address is passed between cluster
+nodes, this single GARP may be dropped or lost.
+This can lead to neighbors on the network link working with a stale ARP cache
+and sending packets destined for that address to the node that previously owned
+the address, which may not respond.
 .It Va log_arp_movements
 Should the kernel log movements of IP addresses from one hardware
 address to an other.
___
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: r306652 - head/usr.sbin/arp

2016-10-03 Thread Eric van Gyzen
On 10/03/2016 14:11, Bruce Simpson wrote:
> On 03/10/16 20:02, Eric van Gyzen wrote:
>> Author: vangyzen
>> Date: Mon Oct  3 19:02:22 2016
>> New Revision: 306652
>> URL: https://svnweb.freebsd.org/changeset/base/306652
>>
>> Log:
>>   Update arp(4) to document the net.link.ether.inet.garp_rexmit_count
>> sysctl.
> 
> Meh, acronym collision.
> 
> It's probably obvious in this context that GARP stands here for
> Gratuitous ARP, but my mental autocomplete reads it as Generic Attribute
> Registration Protocol (GARP).

The collision is unfortunate, but I agree that the context should be enough.

> However, that GARP -- 802.1ak -- is due to be replaced with MRP.

The "Mental-map Rewriting Protocol"?  ;-)

Cheers,

Eric
___
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: r306830 - head/usr.sbin/arp

2016-10-07 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Oct  7 22:17:25 2016
New Revision: 306830
URL: https://svnweb.freebsd.org/changeset/base/306830

Log:
  Additional cleanup of the arp(4) man page after r306652
  
  Submitted by: David A. Bright 
  Requested by: wblock
  Reviewed by:  wblock
  MFC after:23 days
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D8183

Modified:
  head/usr.sbin/arp/arp.4

Modified: head/usr.sbin/arp/arp.4
==
--- head/usr.sbin/arp/arp.4 Fri Oct  7 21:10:53 2016(r306829)
+++ head/usr.sbin/arp/arp.4 Fri Oct  7 22:17:25 2016(r306830)
@@ -28,7 +28,7 @@
 .\"@(#)arp4.4  6.5 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd October 3, 2016
+.Dd October 7, 2016
 .Dt ARP 4
 .Os
 .Sh NAME
@@ -121,67 +121,65 @@ of the
 MIB.
 .Bl -tag -width "log_arp_permanent_modify"
 .It Va allow_multicast
-Should the kernel install ARP entries with multicast bit set in
-the hardware address.
-Installing such entries is RFC 1812 violation, but some prorietary
-load balancing techniques require routers on network to do so.
+Install ARP entries with the multicast bit set in the hardware address.
+Installing such entries is an RFC 1812 violation, but some proprietary load
+balancing techniques require routers to do so.
 Turned off by default.
 .It Va garp_rexmit_count
-Should the kernel retransmit gratuitous ARP (GARP) packets when an IPv4 address
-is added to an interface.
+Retransmit gratuitous ARP (GARP) packets when an IPv4 address is added to an
+interface.
 A GARP is always transmitted when an IPv4 address is added to an interface.
-A non-zero value of this sysctl will cause the GARP packet to be retransmitted
-the stated number of times.
+A non-zero value causes the GARP packet to be retransmitted the stated number
+of times.
 The interval between retransmissions is doubled each time, so the
 retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds).
 The default value of zero means only the initial GARP is sent; no
 additional GARP packets are retransmitted.
 The maximum value is sixteen.
 .Pp
-Although a single GARP packet (the default behavior) is usually sufficient, in
-some circumstances, such as when a shared address is passed between cluster
-nodes, this single GARP may be dropped or lost.
-This can lead to neighbors on the network link working with a stale ARP cache
-and sending packets destined for that address to the node that previously owned
-the address, which may not respond.
+The default behavior of a single GARP packet is usually sufficient.
+However, a single GARP might be dropped or lost in some circumstances.
+This is particularly harmful when a shared address is passed between cluster
+nodes.
+Neighbors on the network link might then work with a stale ARP cache and send
+packets destined for that address to the node that previously owned the
+address, which might not respond.
 .It Va log_arp_movements
-Should the kernel log movements of IP addresses from one hardware
-address to an other.
+Log movements of IP addresses from one hardware address to another.
 See
 .Sx DIAGNOSTICS
 below.
 Turned on by default.
 .It Va log_arp_permanent_modify
-Should the kernel log attempts of remote host on network to modify a
-permanent ARP entry.
+Log attempts by a remote host to modify a permanent ARP entry.
 See
 .Sx DIAGNOSTICS
 below.
 Turned on by default.
 .It Va log_arp_wrong_iface
-Should the kernel log attempts to insert an ARP entry on an interface
-when the IP network the address belongs to is connected to an other
-interface.
+Log attempts to insert an ARP entry on an interface when the IP network to
+which the address belongs is connected to another interface.
 See
 .Sx DIAGNOSTICS
 below.
 Turned on by default.
 .It Va max_log_per_second
-Limit number of remotely triggered logging events to a configured value
-per second.
+Limit the number of remotely triggered logging events to a configured value per
+second.
 Default is 1 log message per second.
 .It Va max_age
 How long an ARP entry is held in the cache until it needs to be refreshed.
 Default is 1200 seconds.
 .It Va maxhold
-How many packets hold in the per-entry output queue while the entry
+How many packets to hold in the per-entry output queue while the entry
 is being resolved.
 Default is one packet.
 .It Va maxtries
-Number of retransmits before host is considered down and error is returned.
+Number of retransmits before a host is considered down and an error is
+returned.
 Default is 5 tries.
 .It Va proxyall
-Enables ARP proxying for all hosts on net.
+Enables ARP proxying.
 Turned off by default.
 .It Va wait
 Lifetime of an incomplete ARP entry.
___
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: r306844 - stable/11/sys/dev/lmc

2016-10-08 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Oct  8 13:49:40 2016
New Revision: 306844
URL: https://svnweb.freebsd.org/changeset/base/306844

Log:
  lmc(4): fix the build without the bpf device
  
  Reported by:  Dave Mischler 
  Sponsored by: Dell EMC

Modified:
  stable/11/sys/dev/lmc/if_lmc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/lmc/if_lmc.c
==
--- stable/11/sys/dev/lmc/if_lmc.c  Sat Oct  8 13:40:12 2016
(r306843)
+++ stable/11/sys/dev/lmc/if_lmc.c  Sat Oct  8 13:49:40 2016
(r306844)
@@ -91,7 +91,11 @@
 # define  P2P 0/* not in FreeBSD */
 # define NSPPP 1   /* No count devices in FreeBSD 5 */
 # include "opt_bpf.h"  /* DEV_BPF */
-# define NBPFILTER DEV_BPF
+# ifdef DEV_BPF
+#  define NBPFILTER 1
+# else
+#  define NBPFILTER 0
+# endif
 # define  GEN_HDLC 0   /* not in FreeBSD */
 #
 # 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: r306845 - stable/11/include

2016-10-08 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Oct  8 14:07:34 2016
New Revision: 306845
URL: https://svnweb.freebsd.org/changeset/base/306845

Log:
  MFC r306568, r306569
  
  Add the __printflike attribute to the declarations of
  dprintf(3) and vdprintf(3).
  
  Sponsored by: Dell EMC

Modified:
  stable/11/include/stdio.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/include/stdio.h
==
--- stable/11/include/stdio.h   Sat Oct  8 13:49:40 2016(r306844)
+++ stable/11/include/stdio.h   Sat Oct  8 14:07:34 2016(r306845)
@@ -356,7 +356,7 @@ ssize_t  getdelim(char ** __restrict, si
FILE * __restrict);
 FILE   *open_memstream(char **, size_t *);
 int renameat(int, const char *, int, const char *);
-int vdprintf(int, const char * __restrict, __va_list);
+int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0);
 
 /*
  * Every programmer and his dog wrote functions called getline() and dprintf()
@@ -392,7 +392,7 @@ ssize_t  getline(char ** __restrict, siz
 #endif
 
 #ifdef _WITH_DPRINTF
-int (dprintf)(int, const char * __restrict, ...);
+int (dprintf)(int, const char * __restrict, ...) __printflike(2, 3);
 #endif
 
 #endif /* __POSIX_VISIBLE >= 200809 */
___
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: r306846 - stable/10/include

2016-10-08 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Oct  8 14:10:45 2016
New Revision: 306846
URL: https://svnweb.freebsd.org/changeset/base/306846

Log:
  MFC r306568, r306569
  
  Add the __printflike attribute to the declarations of
  dprintf(3) and vdprintf(3).
  
  Sponsored by: Dell EMC

Modified:
  stable/10/include/stdio.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/include/stdio.h
==
--- stable/10/include/stdio.h   Sat Oct  8 14:07:34 2016(r306845)
+++ stable/10/include/stdio.h   Sat Oct  8 14:10:45 2016(r306846)
@@ -351,7 +351,7 @@ ssize_t  getdelim(char ** __restrict, si
FILE * __restrict);
 FILE   *open_memstream(char **, size_t *);
 int renameat(int, const char *, int, const char *);
-int vdprintf(int, const char * __restrict, __va_list);
+int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0);
 
 /*
  * Every programmer and his dog wrote functions called getline() and dprintf()
@@ -387,7 +387,7 @@ ssize_t  getline(char ** __restrict, siz
 #endif
 
 #ifdef _WITH_DPRINTF
-int (dprintf)(int, const char * __restrict, ...);
+int (dprintf)(int, const char * __restrict, ...) __printflike(2, 3);
 #endif
 
 #endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 */
___
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: r306346 - head/sys/kern

2016-10-15 Thread Eric van Gyzen
On 10/04/2016 15:56, Gleb Smirnoff wrote:
>   Eric,
>
> E> @@ -924,7 +924,7 @@ __mtx_assert(const volatile uintptr_t *c
> E>  {
> E>const struct mtx *m;
> E>  
> E> -  if (panicstr != NULL || dumping)
> E> +  if (panicstr != NULL || dumping || SCHEDULER_STOPPED())
> E>return;
>
> I wonder if all this disjunct can be reduced just to SCHEDULER_STOPPED()?
> Positive panicstr and dumping imply scheduler stopped.

If I read correctly, that's /almost/ true, but the scheduler is only stopped
#ifdef SMP and we're panicking, so we need the full expression to cover the !SMP
and reboot(RB_DUMP) cases.

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

2016-10-18 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Oct 19 00:14:20 2016
New Revision: 307587
URL: https://svnweb.freebsd.org/changeset/base/307587

Log:
  MFC r306346
  
  Make no assertions about mutex state when the scheduler is stopped.
  
  This changes the assert path to match the lock and unlock paths.
  
  Sponsored by: Dell EMC

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

Modified: stable/11/sys/kern/kern_mutex.c
==
--- stable/11/sys/kern/kern_mutex.c Tue Oct 18 23:48:47 2016
(r307586)
+++ stable/11/sys/kern/kern_mutex.c Wed Oct 19 00:14:20 2016
(r307587)
@@ -887,7 +887,7 @@ __mtx_assert(const volatile uintptr_t *c
 {
const struct mtx *m;
 
-   if (panicstr != NULL || dumping)
+   if (panicstr != NULL || dumping || SCHEDULER_STOPPED())
return;
 
m = mtxlock2mtx(c);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r307588 - stable/10/sys/kern

2016-10-18 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Oct 19 00:14:22 2016
New Revision: 307588
URL: https://svnweb.freebsd.org/changeset/base/307588

Log:
  MFC r306346
  
  Make no assertions about mutex state when the scheduler is stopped.
  
  This changes the assert path to match the lock and unlock paths.
  
  Sponsored by: Dell EMC

Modified:
  stable/10/sys/kern/kern_mutex.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_mutex.c
==
--- stable/10/sys/kern/kern_mutex.c Wed Oct 19 00:14:20 2016
(r307587)
+++ stable/10/sys/kern/kern_mutex.c Wed Oct 19 00:14:22 2016
(r307588)
@@ -848,7 +848,7 @@ __mtx_assert(const volatile uintptr_t *c
 {
const struct mtx *m;
 
-   if (panicstr != NULL || dumping)
+   if (panicstr != NULL || dumping || SCHEDULER_STOPPED())
return;
 
m = mtxlock2mtx(c);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r307727 - head/share/man/man4

2016-10-21 Thread Eric van Gyzen
On 10/21/2016 09:28, hiren panchasara wrote:
> On 10/21/16 at 11:29P, Michael Tuexen wrote:
>> Author: tuexen
>> Date: Fri Oct 21 11:29:25 2016
>> New Revision: 307727
>> URL: https://svnweb.freebsd.org/changeset/base/307727
>>
>> Log:
>>   Document the TCP sysctl variables insecure_rst and insecure_syn.
>>   
>>   MFC after: 1 month
>>   Sponsored by: netflix
>>
>> Modified:
>>   head/share/man/man4/tcp.4
>>
>> Modified: head/share/man/man4/tcp.4
>> ==
>> --- head/share/man/man4/tcp.4Fri Oct 21 10:32:57 2016
>> (r307726)
>> +++ head/share/man/man4/tcp.4Fri Oct 21 11:29:25 2016
>> (r307727)
>> @@ -34,7 +34,7 @@
>>  .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93
>>  .\" $FreeBSD$
>>  .\"
>> -.Dd June 28, 2016
>> +.Dd October 21, 2016
>>  .Dt TCP 4
>>  .Os
>>  .Sh NAME
>> @@ -586,6 +586,12 @@ downshift.
>>  List of available TCP function blocks (TCP stacks).
>>  .It Va functions_default
>>  The default TCP function block (TCP stack).
>> +.It Va insecure_rst
>> +Use criterias defined in RFC793 instead of RFC5961 for accepting RST 
>> segments.
> 
> I am not a native speaker but should we s/criterias /criteria / ?

I am a native speaker.  Yes, these should be "criteria", which is the plural of
"criterion".

>> +Default is false.
>> +.It Va insecure_syn
>> +Use criterias defined in RFC793 instead of RFC5961 for accepting SYN 
>> segments.
> 
> Same.
>> +Default is false.
>>  .El
>>  .Sh ERRORS
>>  A socket operation may fail with one of the following errors returned:
>>
> 
> Cheers,
> Hiren
> 
___
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: r307895 - svnadmin/conf

2016-10-24 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Oct 25 03:26:00 2016
New Revision: 307895
URL: https://svnweb.freebsd.org/changeset/base/307895

Log:
  Add David Bright (dab) as a src committer, with me as his mentor.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessTue Oct 25 03:03:34 2016(r307894)
+++ svnadmin/conf/accessTue Oct 25 03:26:00 2016(r307895)
@@ -60,6 +60,7 @@ cperciva
 cracauer
 csjp
 cy
+dab
 das
 davidch
 davidcs

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Tue Oct 25 03:03:34 2016(r307894)
+++ svnadmin/conf/mentors   Tue Oct 25 03:26:00 2016(r307895)
@@ -17,6 +17,7 @@ badgerkib Co-mentor: vangyzen
 benl   philip  Co-mentor: simon
 carl   jimharris
 cherry gibbs
+dabvangyzen
 dexuan sephe
 erignn Co-mentor: thompsa
 ivadaszadrian  Co-mentor: cognet
___
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: r306577 - head/sys/netinet

2016-10-29 Thread Eric van Gyzen
On 10/29/2016 11:50, Hans Petter Selasky wrote:
> On 10/02/16 03:42, Eric van Gyzen wrote:
>> +if (callout_reset(&ia->ia_garp_timer, (1 << ia->ia_garp_count) * hz,
>> +garp_rexmit, ia) == 0) {
>> +ifa_ref(ifa);
>> +}
> 
> Hi,
> 
> Be careful when you MFC this, because the return values of callout_reset() and
> callout_stop() are not the same in FreeBSD-9, -10 and 11/12.

Thanks for your keen eye, Hans.  Indeed, the submitter (David Bright) discovered
this The Hard Way when porting this forward from 10 to head.  Luckily, though,
that means we already have a version of this patch for 10.

Thanks again,

Eric (and David)
___
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: r306577 - head/sys/netinet

2016-10-30 Thread Eric van Gyzen

On 10/30/16 4:44 AM, Kubilay Kocak wrote:

On 2/10/2016 12:42 PM, Eric van Gyzen wrote:

Author: vangyzen Date: Sun Oct  2 01:42:45 2016 New Revision: 306577
URL: https://svnweb.freebsd.org/changeset/base/306577

Log: Add GARP retransmit capability


Thanks for this David & Eric

I presume this is (or would be) quite complementary to D4111 [1]
(Gratuitous ARP's for lagg(4) failover) when it lands? I'm thinking
particularly given the various states upstream switch ports can have
during topology changes.

[1] https://reviews.freebsd.org/D4111


Yes, I expect it would be nicely complementary.  The disruption of a 
topology change increases the chance of a dropped packet, so it would be 
wise to retransmit the GARP sent by lagg(4).


Eric
___
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: r334238 - head/sys/kern

2018-05-26 Thread Eric van Gyzen
Author: vangyzen
Date: Sat May 26 14:01:44 2018
New Revision: 334238
URL: https://svnweb.freebsd.org/changeset/base/334238

Log:
  kdb_trap: Fix use of uninitialized data
  
  In some cases, other_cpus was used without being initialized.
  Thankfully, it was harmless.
  
  Reported by:  Coverity
  CID:  1385265
  Sponsored by: Dell EMC

Modified:
  head/sys/kern/subr_kdb.c

Modified: head/sys/kern/subr_kdb.c
==
--- head/sys/kern/subr_kdb.cSat May 26 11:13:17 2018(r334237)
+++ head/sys/kern/subr_kdb.cSat May 26 14:01:44 2018(r334238)
@@ -708,9 +708,10 @@ kdb_trap(int type, int code, struct trapframe *tf)
kdb_active--;
 
 #ifdef SMP
-   CPU_AND(&other_cpus, &stopped_cpus);
-   if (did_stop_cpus)
+   if (did_stop_cpus) {
+   CPU_AND(&other_cpus, &stopped_cpus);
restart_cpus(other_cpus);
+   }
 #endif
 
intr_restore(intr);
___
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: r334239 - head/sys/dev/hyperv/netvsc

2018-05-26 Thread Eric van Gyzen
Author: vangyzen
Date: Sat May 26 14:14:56 2018
New Revision: 334239
URL: https://svnweb.freebsd.org/changeset/base/334239

Log:
  if_hn: fix use of uninitialized variable
  
  omcast was used without being initialized in the non-multicast case.
  The only effect was that the interface's multicast output counter could be
  incorrect.
  
  Reported by:  Coverity
  CID:  1379662
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/sys/dev/hyperv/netvsc/if_hn.c

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==
--- head/sys/dev/hyperv/netvsc/if_hn.c  Sat May 26 14:01:44 2018
(r334238)
+++ head/sys/dev/hyperv/netvsc/if_hn.c  Sat May 26 14:14:56 2018
(r334239)
@@ -5939,8 +5939,7 @@ hn_transmit(struct ifnet *ifp, struct mbuf *m)
int obytes, omcast;
 
obytes = m->m_pkthdr.len;
-   if (m->m_flags & M_MCAST)
-   omcast = 1;
+   omcast = (m->m_flags & M_MCAST) != 0;
 
if (sc->hn_xvf_flags & HN_XVFFLAG_ACCBPF) {
if (bpf_peers_present(ifp->if_bpf)) {
___
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: r334240 - head/sys/kern

2018-05-26 Thread Eric van Gyzen
Author: vangyzen
Date: Sat May 26 14:23:11 2018
New Revision: 334240
URL: https://svnweb.freebsd.org/changeset/base/334240

Log:
  kern_cpuset: fix small leak on error path
  
  The "mask" was leaked on some error paths.
  
  Reported by:  Coverity
  CID:  1384683
  Sponsored by: Dell EMC

Modified:
  head/sys/kern/kern_cpuset.c

Modified: head/sys/kern/kern_cpuset.c
==
--- head/sys/kern/kern_cpuset.c Sat May 26 14:14:56 2018(r334239)
+++ head/sys/kern/kern_cpuset.c Sat May 26 14:23:11 2018(r334240)
@@ -2038,6 +2038,9 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t le
if (domainsetsize < sizeof(domainset_t) ||
domainsetsize > DOMAINSET_MAXSIZE / NBBY)
return (ERANGE);
+   if (policy <= DOMAINSET_POLICY_INVALID ||
+   policy > DOMAINSET_POLICY_MAX)
+   return (EINVAL);
/* In Capability mode, you can only set your own CPU set. */
if (IN_CAPABILITY_MODE(td)) {
if (level != CPU_LEVEL_WHICH)
@@ -2071,15 +2074,14 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t le
}
DOMAINSET_COPY(mask, &domain.ds_mask);
domain.ds_policy = policy;
-   if (policy <= DOMAINSET_POLICY_INVALID ||
-   policy > DOMAINSET_POLICY_MAX)
-   return (EINVAL);
 
/* Translate preferred policy into a mask and fallback. */
if (policy == DOMAINSET_POLICY_PREFER) {
/* Only support a single preferred domain. */
-   if (DOMAINSET_COUNT(&domain.ds_mask) != 1)
-   return (EINVAL);
+   if (DOMAINSET_COUNT(&domain.ds_mask) != 1) {
+   error = EINVAL;
+   goto out;
+   }
domain.ds_prefer = DOMAINSET_FFS(&domain.ds_mask) - 1;
/* This will be constrained by domainset_shadow(). */
DOMAINSET_FILL(&domain.ds_mask);
___
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: r334104 - in head/sys: netinet sys

2018-05-26 Thread Eric van Gyzen

On 05/23/2018 23:47, Gleb Smirnoff wrote:

On Thu, May 24, 2018 at 06:44:20AM +0200, Mateusz Guzik wrote:
M> I fundamentally disagree with this part.
M>
M> If a known value of a given field is needed for assertion purposes, you
M> can add (possibly conditional) code setting this specific value. It
M> probably should not be zero if it can be helped.
M>
M> Conditional zeroing of the *whole* struct depending on invariants will
M> *hide* uninitialized memory read bugs - production kernel will have
M> whatever it happens to find, while *debug* kernel will guarantee to
M> have all the values zeroed. In fact the flag actively combats redzoning.
M> if the resulting allocation is zeroed, poisoning is actively neutered.
M> But only if debug is enabled.
M>
M> That said, I find the change harmful.

+1 on fundamentally disagree with M_ZERO_INVARIANTS. It makes the
INVARIANTS-enabled kernels to crash _later_ than production kernels,
since instead of uma_junk it places clean zeroes.


Matt,

Mateusz and Gleb raise very good points.  This operates contrary to the 
whole idea of INVARIANTS.  Please revisit this.


Eric
___
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: r334265 - head/usr.sbin/tcpdrop

2018-05-27 Thread Eric van Gyzen
Author: vangyzen
Date: Mon May 28 01:58:49 2018
New Revision: 334265
URL: https://svnweb.freebsd.org/changeset/base/334265

Log:
  tcpdrop: ensure NUL termination of a string
  
  strncpy did not guarantee NUL termination of the "stack" string.
  Use strlcpy instead.  While I'm here, avoid unnecessary memset
  and strnlen calls.
  
  Reported by:  Coverity
  CID:  1381035
  Sponsored by: Dell EMC

Modified:
  head/usr.sbin/tcpdrop/tcpdrop.c

Modified: head/usr.sbin/tcpdrop/tcpdrop.c
==
--- head/usr.sbin/tcpdrop/tcpdrop.c Mon May 28 00:19:08 2018
(r334264)
+++ head/usr.sbin/tcpdrop/tcpdrop.c Mon May 28 01:58:49 2018
(r334265)
@@ -73,7 +73,7 @@ main(int argc, char *argv[])
 
dropall = false;
dropallstack = false;
-   memset(stack, 0, TCP_FUNCTION_NAME_LEN_MAX);
+   stack[0] = '\0';
state = -1;
 
while ((ch = getopt(argc, argv, "alS:s:")) != -1) {
@@ -86,7 +86,7 @@ main(int argc, char *argv[])
break;
case 'S':
dropallstack = true;
-   strncpy(stack, optarg, TCP_FUNCTION_NAME_LEN_MAX);
+   strlcpy(stack, optarg, sizeof(stack));
break;
case 's':
dropallstack = true;
@@ -260,7 +260,7 @@ tcpdropall(const char *stack, int state)
continue;
 
/* If requested, skip sockets not having the requested stack. */
-   if (strnlen(stack, TCP_FUNCTION_NAME_LEN_MAX) > 0 &&
+   if (stack[0] != '\0' &&
strncmp(xtp->xt_stack, stack, TCP_FUNCTION_NAME_LEN_MAX))
continue;
 
___
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: r334267 - head/lib/libprocstat

2018-05-27 Thread Eric van Gyzen
Author: vangyzen
Date: Mon May 28 02:10:35 2018
New Revision: 334267
URL: https://svnweb.freebsd.org/changeset/base/334267

Log:
  libprocstat: fix memory leak
  
  Free the rlimits array on the happy path in procstat_getrlimit_core().
  
  Reported by:  Coverity
  CID:  1373328
  Sponsored by: Dell EMC

Modified:
  head/lib/libprocstat/libprocstat.c

Modified: head/lib/libprocstat/libprocstat.c
==
--- head/lib/libprocstat/libprocstat.c  Mon May 28 01:59:48 2018
(r334266)
+++ head/lib/libprocstat/libprocstat.c  Mon May 28 02:10:35 2018
(r334267)
@@ -2192,6 +2192,7 @@ procstat_getrlimit_core(struct procstat_core *core, in
return (-1);
}
*rlimit = rlimits[which];
+   free(rlimits);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334268 - head/lib/libc/gen

2018-05-27 Thread Eric van Gyzen
Author: vangyzen
Date: Mon May 28 02:31:49 2018
New Revision: 334268
URL: https://svnweb.freebsd.org/changeset/base/334268

Log:
  fts_stat: fix buffer overrun on error path
  
  Reported by:  Coverity
  CID:  1375582
  MFC after:1 week
  Sponsored by: Dell EMC

Modified:
  head/lib/libc/gen/fts-compat.c

Modified: head/lib/libc/gen/fts-compat.c
==
--- head/lib/libc/gen/fts-compat.c  Mon May 28 02:10:35 2018
(r334267)
+++ head/lib/libc/gen/fts-compat.c  Mon May 28 02:31:49 2018
(r334268)
@@ -934,7 +934,7 @@ fts_stat(FTS *sp, FTSENT *p, int follow)
}
} else if (freebsd11_lstat(p->fts_accpath, sbp)) {
p->fts_errno = errno;
-err:   memset(sbp, 0, sizeof(struct stat));
+err:   memset(sbp, 0, sizeof(*sbp));
return (FTS_NS);
}
 
___
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: r334269 - head/sys/dev/drm

2018-05-27 Thread Eric van Gyzen
Author: vangyzen
Date: Mon May 28 02:34:38 2018
New Revision: 334269
URL: https://svnweb.freebsd.org/changeset/base/334269

Log:
  drm: fix memory leak on error path
  
  Reported by:  Coverity
  CID:  1368753
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/sys/dev/drm/drm_ioctl.c

Modified: head/sys/dev/drm/drm_ioctl.c
==
--- head/sys/dev/drm/drm_ioctl.cMon May 28 02:31:49 2018
(r334268)
+++ head/sys/dev/drm/drm_ioctl.cMon May 28 02:34:38 2018
(r334269)
@@ -105,6 +105,7 @@ int drm_setunique(struct drm_device *dev, void *data,
DRM_LOCK();
if (dev->unique_len || dev->unique) {
DRM_UNLOCK();
+   free(busid, DRM_MEM_DRIVER);
return EBUSY;
}
 
___
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: r334270 - head/usr.bin/logger

2018-05-27 Thread Eric van Gyzen
Author: vangyzen
Date: Mon May 28 02:40:06 2018
New Revision: 334270
URL: https://svnweb.freebsd.org/changeset/base/334270

Log:
  logger: fix memory leak and use-after-free
  
  This one call to getaddrinfo() did not adhere to the common idiom
  of storing the result into a second res0 variable, which is later freed.
  
  Reported by:  Coverity
  CID:  1368069 1368071
  Sponsored by: Dell EMC

Modified:
  head/usr.bin/logger/logger.c

Modified: head/usr.bin/logger/logger.c
==
--- head/usr.bin/logger/logger.cMon May 28 02:34:38 2018
(r334269)
+++ head/usr.bin/logger/logger.cMon May 28 02:40:06 2018
(r334270)
@@ -298,7 +298,7 @@ socksetup(const char *src, const char *dst, const char
error = getaddrinfo(dst, svcname, &hints, &res0);
if (error == EAI_SERVICE) {
warnx("%s/udp: unknown service", svcname);
-   error = getaddrinfo(dst, "514", &hints, &res);
+   error = getaddrinfo(dst, "514", &hints, &res0);
}   
if (error)
errx(1, "%s: %s", gai_strerror(error), dst);
___
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: r334271 - head/usr.sbin/bhyve

2018-05-27 Thread Eric van Gyzen
Author: vangyzen
Date: Mon May 28 03:05:01 2018
New Revision: 334271
URL: https://svnweb.freebsd.org/changeset/base/334271

Log:
  bhyve: fix small memory leak in virtio console
  
  Reported by:  Coverity
  CID:  1363284
  Sponsored by: Dell EMC

Modified:
  head/usr.sbin/bhyve/pci_virtio_console.c

Modified: head/usr.sbin/bhyve/pci_virtio_console.c
==
--- head/usr.sbin/bhyve/pci_virtio_console.cMon May 28 02:40:06 2018
(r334270)
+++ head/usr.sbin/bhyve/pci_virtio_console.cMon May 28 03:05:01 2018
(r334271)
@@ -651,7 +651,7 @@ pci_vtcon_init(struct vmctx *ctx, struct pci_devinst *
 
while ((opt = strsep(&opts, ",")) != NULL) {
portname = strsep(&opt, "=");
-   portpath = strdup(opt);
+   portpath = opt;
 
/* create port */
if (pci_vtcon_sock_add(sc, portname, portpath) < 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334272 - head/usr.sbin/bhyve

2018-05-27 Thread Eric van Gyzen
Author: vangyzen
Date: Mon May 28 03:09:09 2018
New Revision: 334272
URL: https://svnweb.freebsd.org/changeset/base/334272

Log:
  bhyve: guarantee NUL termination
  
  Use strlcpy to guarantee NUL termination of the path to a
  virtio console socket.
  
  Reported by:  Coverity
  CID:  1362874
  Sponsored by: Dell EMC

Modified:
  head/usr.sbin/bhyve/pci_virtio_console.c

Modified: head/usr.sbin/bhyve/pci_virtio_console.c
==
--- head/usr.sbin/bhyve/pci_virtio_console.cMon May 28 03:05:01 2018
(r334271)
+++ head/usr.sbin/bhyve/pci_virtio_console.cMon May 28 03:09:09 2018
(r334272)
@@ -306,7 +306,7 @@ pci_vtcon_sock_add(struct pci_vtcon_softc *sc, const c
sun.sun_family = AF_UNIX;
sun.sun_len = sizeof(struct sockaddr_un);
strcpy(pathcopy, path);
-   strncpy(sun.sun_path, basename(pathcopy), sizeof(sun.sun_path));
+   strlcpy(sun.sun_path, basename(pathcopy), sizeof(sun.sun_path));
free(pathcopy);
 
if (bindat(fd, s, (struct sockaddr *)&sun, sun.sun_len) < 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334273 - head/sys/cam/nvme

2018-05-27 Thread Eric van Gyzen
Author: vangyzen
Date: Mon May 28 03:14:36 2018
New Revision: 334273
URL: https://svnweb.freebsd.org/changeset/base/334273

Log:
  cam nvme: fix array overrun
  
  Fix a classic array overrun where the index could be one past the end.
  
  Reported by:  Coverity
  CID:  1356596
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/sys/cam/nvme/nvme_all.c

Modified: head/sys/cam/nvme/nvme_all.c
==
--- head/sys/cam/nvme/nvme_all.cMon May 28 03:09:09 2018
(r334272)
+++ head/sys/cam/nvme/nvme_all.cMon May 28 03:14:36 2018
(r334273)
@@ -120,7 +120,7 @@ nvme_op_string(const struct nvme_command *cmd)
uint8_t opc;
 
opc = (cmd->opc_fuse >> NVME_CMD_OPC_SHIFT) & NVME_CMD_OPC_MASK;
-   if (opc > nitems(nvme_opc2str))
+   if (opc >= nitems(nvme_opc2str))
return "UNKNOWN";
 
return nvme_opc2str[opc];
___
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: r334306 - in head: lib/libc/stdlib share/man/man3

2018-05-28 Thread Eric van Gyzen
Author: vangyzen
Date: Tue May 29 01:16:00 2018
New Revision: 334306
URL: https://svnweb.freebsd.org/changeset/base/334306

Log:
  Cross-reference abort2(2) from a few man pages
  
  I didn't know abort2 existed until it was mentioned on a mailing list.
  Mention it in related pages so others can find it easily.
  
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/lib/libc/stdlib/abort.3
  head/lib/libc/stdlib/exit.3
  head/share/man/man3/assert.3

Modified: head/lib/libc/stdlib/abort.3
==
--- head/lib/libc/stdlib/abort.3Tue May 29 00:53:53 2018
(r334305)
+++ head/lib/libc/stdlib/abort.3Tue May 29 01:16:00 2018
(r334306)
@@ -64,6 +64,7 @@ The
 function
 never returns.
 .Sh SEE ALSO
+.Xr abort2 2 ,
 .Xr sigaction 2 ,
 .Xr exit 3
 .Sh STANDARDS

Modified: head/lib/libc/stdlib/exit.3
==
--- head/lib/libc/stdlib/exit.3 Tue May 29 00:53:53 2018(r334305)
+++ head/lib/libc/stdlib/exit.3 Tue May 29 01:16:00 2018(r334306)
@@ -116,6 +116,7 @@ functions
 never return.
 .Sh SEE ALSO
 .Xr _exit 2 ,
+.Xr abort2 2 ,
 .Xr wait 2 ,
 .Xr at_quick_exit 3 ,
 .Xr atexit 3 ,

Modified: head/share/man/man3/assert.3
==
--- head/share/man/man3/assert.3Tue May 29 00:53:53 2018
(r334305)
+++ head/share/man/man3/assert.3Tue May 29 01:16:00 2018
(r334306)
@@ -85,6 +85,7 @@ generates a diagnostic message similar to the followin
 .Pp
 .Dl "Assertion failed: (1 == 0), function main, file assertion.c, line 100."
 .Sh SEE ALSO
+.Xr abort2 2 ,
 .Xr abort 3
 .Sh STANDARDS
 The
___
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: r334308 - in head: lib/libc/stdlib share/man/man3

2018-05-28 Thread Eric van Gyzen
Author: vangyzen
Date: Tue May 29 02:41:32 2018
New Revision: 334308
URL: https://svnweb.freebsd.org/changeset/base/334308

Log:
  Bump the date on man pages in r334306
  
  It seems a shame to ruin the patina of the June 4, 1993 date
  on abort.3, especially since it still matched the date of
  the SCCS ID, but those are the rules.
  
  Reported by:  araujo
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/lib/libc/stdlib/abort.3
  head/lib/libc/stdlib/exit.3
  head/share/man/man3/assert.3

Modified: head/lib/libc/stdlib/abort.3
==
--- head/lib/libc/stdlib/abort.3Tue May 29 01:46:00 2018
(r334307)
+++ head/lib/libc/stdlib/abort.3Tue May 29 02:41:32 2018
(r334308)
@@ -32,7 +32,7 @@
 .\" @(#)abort.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd May 28, 2018
 .Dt ABORT 3
 .Os
 .Sh NAME

Modified: head/lib/libc/stdlib/exit.3
==
--- head/lib/libc/stdlib/exit.3 Tue May 29 01:46:00 2018(r334307)
+++ head/lib/libc/stdlib/exit.3 Tue May 29 02:41:32 2018(r334308)
@@ -32,7 +32,7 @@
 .\" @(#)exit.3 8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd September 9, 2002
+.Dd May 28, 2018
 .Dt EXIT 3
 .Os
 .Sh NAME

Modified: head/share/man/man3/assert.3
==
--- head/share/man/man3/assert.3Tue May 29 01:46:00 2018
(r334307)
+++ head/share/man/man3/assert.3Tue May 29 02:41:32 2018
(r334308)
@@ -28,7 +28,7 @@
 .\" @(#)assert.3   8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd January 1, 2018
+.Dd May 28, 2018
 .Dt ASSERT 3
 .Os
 .Sh NAME
___
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: r334345 - head/lib/libpmc

2018-05-29 Thread Eric van Gyzen
On 05/29/2018 13:26, Matt Macy wrote:
>   if (pmc_pmu_pmcallocate(ctrname, &pmc_config) == 0) {
>   if (PMC_CALL(PMCALLOCATE, &pmc_config) < 0)
>   return (errno);

^^
spec_copy is still leaked here.

> + free(spec_copy);
>   *pmcid = pmc_config.pm_pmcid;
>   return (0);
>   } else {
> 
___
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: r334347 - head/lib/libpmc

2018-05-29 Thread Eric van Gyzen
On 05/29/2018 14:07, Matt Macy wrote:
>   if (pmc_pmu_pmcallocate(ctrname, &pmc_config) == 0) {
> - if (PMC_CALL(PMCALLOCATE, &pmc_config) < 0)
> - return (errno);
> - free(spec_copy);
> + if (PMC_CALL(PMCALLOCATE, &pmc_config) < 0) {
> + retval = errno;
> + goto out;
> + }
>   *pmcid = pmc_config.pm_pmcid;
> - return (0);
> + goto out;

This now returns -1 on the successful path.

Feel free to start throwing things at me now.  ;)

Eric
___
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: r334351 - head/lib/libpmc

2018-05-29 Thread Eric van Gyzen
Author: vangyzen
Date: Tue May 29 20:30:46 2018
New Revision: 334351
URL: https://svnweb.freebsd.org/changeset/base/334351

Log:
  pmc_annotate: adhere to the API
  
  If the 'mode' parameter was invalid, pmc_annotate() would
  return EINVAL instead of setting errno and returning -1.
  
  Sponsored by: Dell EMC

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==
--- head/lib/libpmc/libpmc.cTue May 29 20:28:34 2018(r334350)
+++ head/lib/libpmc/libpmc.cTue May 29 20:30:46 2018(r334351)
@@ -2781,7 +2781,8 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode,
 
if (mode != PMC_MODE_SS && mode != PMC_MODE_TS &&
mode != PMC_MODE_SC && mode != PMC_MODE_TC) {
-   return (EINVAL);
+   errno = EINVAL;
+   goto out;
}
bzero(&pmc_config, sizeof(pmc_config));
pmc_config.pm_cpu   = cpu;
___
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: r334545 - in head/sys: contrib/zstd/lib/freebsd kern netinet/libalias sys

2018-06-05 Thread Eric van Gyzen
On 06/02/2018 17:20, Mateusz Guzik wrote:
> +#ifdef _KERNEL
> +#define  malloc(size, type, flags) ({\
> + void *_malloc_item; \
> + size_t _size = (size);  \
> + if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\
> + ((flags) & M_ZERO)) {   \
> + _malloc_item = malloc(_size, type, (flags) &~ M_ZERO);  \
> + if (((flags) & M_WAITOK) || _malloc_item != NULL)   \
> + bzero(_malloc_item, _size); \
> + } else {\
> + _malloc_item = malloc(_size, type, flags);  \
> + }   \
> + _malloc_item;   \
> +})
> +#endif

Mateusz,

Thank you for this and for all of your performance work.  It is all very
interesting stuff.

Coverity complains about this line:

if (((flags) & M_WAITOK) || _malloc_item != NULL)

saying:

The expression
1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL
is suspicious because it performs a Boolean operation
on a constant other than 0 or 1.

Would you mind adding != 0 to appease Coverity?

Thanks,

Eric
___
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: r334669 - head/sys/sys

2018-06-05 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Jun  5 20:34:11 2018
New Revision: 334669
URL: https://svnweb.freebsd.org/changeset/base/334669

Log:
  Make Coverity more happy with r334545
  
  Coverity complains about:
  
if (((flags) & M_WAITOK) || _malloc_item != NULL)
  
  saying:
  
The expression
1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL
is suspicious because it performs a Boolean operation
on a constant other than 0 or 1.
  
  Although the code is correct, add "!= 0" to make it slightly
  more legible and to silence hundreds(?) of Coverity warnings.
  
  Reported by:  Coverity
  Discussed with:   mjg
  Sponsored by: Dell EMC

Modified:
  head/sys/sys/malloc.h

Modified: head/sys/sys/malloc.h
==
--- head/sys/sys/malloc.h   Tue Jun  5 20:13:24 2018(r334668)
+++ head/sys/sys/malloc.h   Tue Jun  5 20:34:11 2018(r334669)
@@ -191,9 +191,9 @@ void*malloc(size_t size, struct malloc_type *type, 
in
void *_malloc_item; \
size_t _size = (size);  \
if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\
-   ((flags) & M_ZERO)) {   \
+   ((flags) & M_ZERO) != 0) {  \
_malloc_item = malloc(_size, type, (flags) &~ M_ZERO);  \
-   if (((flags) & M_WAITOK) || _malloc_item != NULL)   \
+   if (((flags) & M_WAITOK) != 0 || _malloc_item != NULL)  \
bzero(_malloc_item, _size); \
} else {\
_malloc_item = malloc(_size, type, flags);  \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334669 - head/sys/sys

2018-06-05 Thread Eric van Gyzen
On 06/05/2018 15:53, Ian Lepore wrote:
> On Tue, 2018-06-05 at 20:34 +0000, Eric van Gyzen wrote:
>> Author: vangyzen
>> Date: Tue Jun  5 20:34:11 2018
>> New Revision: 334669
>> URL: https://svnweb.freebsd.org/changeset/base/334669
>>
>> Log:
>>   Make Coverity more happy with r334545
>>   
>>   Coverity complains about:
>>   
>>      if (((flags) & M_WAITOK) || _malloc_item != NULL)
>>   
>>   saying:
>>   
>>      The expression
>>      1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL
>>      is suspicious because it performs a Boolean operation
>>      on a constant other than 0 or 1.
>>   
>>   Although the code is correct, add "!= 0" to make it slightly
>>   more legible and to silence hundreds(?) of Coverity warnings.
>>   
> 
> This is a sad sad thing. Treating (bits & flagconstants) as boolean has
> a long long history in C. Surely there are literally thousand of
> occurrances in freebsd code already, so why did this one get flagged?

I agree, and I tend to avoid adding "!= 0" unnecessarily, but I don't
feel very strongly about it.  This macro is expanded in many locations,
so the number of Coverity warnings increased by hundreds in the most
recent run.  I care about that more than avoiding "!= 0".  I don't
sprinkle crap all over the code just to appease Coverity, but this one
seemed perfectly reasonable.  It makes the code slightly more clear and
legible for some readers, and I imagine it doesn't hurt the others.

Yes, there are probably many old occurrences of this, and there might be
many old corresponding warnings, but I tend to focus on the recently
added ones, just because they're more likely relevant.

/me opens the static analysis can of worms...again

Eric
___
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: r335206 - head/cddl/contrib/opensolaris/cmd/zfs

2018-06-15 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 15 15:28:31 2018
New Revision: 335206
URL: https://svnweb.freebsd.org/changeset/base/335206

Log:
  Fix markup in zfs(8); no content change
  
  Sponsored by: Dell EMC

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs.8

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Jun 15 15:22:27 2018
(r335205)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Jun 15 15:28:31 2018
(r335206)
@@ -2674,7 +2674,9 @@ feature.
 .It Fl c, -compressed
 Generate a more compact stream by using compressed WRITE records for blocks
 which are compressed on disk and in memory (see the
-.Sy compression property for details).  If the
+.Sy compression
+property for details).
+If the
 .Sy lz4_compress
 feature is active on the sending system, then the receiving system must have 
that
 feature enabled as well. If the
___
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: r303519 - head/share/man/man9

2016-07-29 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jul 29 21:12:48 2016
New Revision: 303519
URL: https://svnweb.freebsd.org/changeset/base/303519

Log:
  Fix two return types in the cpuset(9) and bitset(9) man pages
  
  The *_FFS() and *_COUNT() functions return int, not size_t.
  
  MFC after:3 days
  Sponsored by: Dell Inc.

Modified:
  head/share/man/man9/bitset.9
  head/share/man/man9/cpuset.9

Modified: head/share/man/man9/bitset.9
==
--- head/share/man/man9/bitset.9Fri Jul 29 21:11:32 2016
(r303518)
+++ head/share/man/man9/bitset.9Fri Jul 29 21:12:48 2016
(r303519)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 20, 2015
+.Dd July 29, 2016
 .Dt BITSET 9
 .Os
 .Sh NAME
@@ -77,9 +77,9 @@
 .Fn BIT_EMPTY "const SETSIZE" "struct STRUCTNAME *bitset"
 .Ft bool
 .Fn BIT_ISFULLSET "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft size_t
+.Ft int
 .Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft size_t
+.Ft int
 .Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset"
 .\"
 .Ft bool

Modified: head/share/man/man9/cpuset.9
==
--- head/share/man/man9/cpuset.9Fri Jul 29 21:11:32 2016
(r303518)
+++ head/share/man/man9/cpuset.9Fri Jul 29 21:12:48 2016
(r303519)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 20, 2015
+.Dd July 29, 2016
 .Dt CPUSET 9
 .Os
 .Sh NAME
@@ -75,9 +75,9 @@
 .Fn CPU_EMPTY "cpuset_t *cpuset"
 .Ft bool
 .Fn CPU_ISFULLSET "cpuset_t *cpuset"
-.Ft size_t
+.Ft int
 .Fn CPU_FFS "cpuset_t *cpuset"
-.Ft size_t
+.Ft int
 .Fn CPU_COUNT "cpuset_t *cpuset"
 .\"
 .Ft bool
___
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: r303520 - head/usr.bin/cpuset

2016-07-29 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jul 29 21:18:20 2016
New Revision: 303520
URL: https://svnweb.freebsd.org/changeset/base/303520

Log:
  Fix markup for -j in cpuset(1) synopsis
  
  MFC after:3 days
  Sponsored by: Dell Inc.

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

Modified: head/usr.bin/cpuset/cpuset.1
==
--- head/usr.bin/cpuset/cpuset.1Fri Jul 29 21:12:48 2016
(r303519)
+++ head/usr.bin/cpuset/cpuset.1Fri Jul 29 21:18:20 2016
(r303520)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 8, 2015
+.Dd July 29, 2016
 .Dt CPUSET 1
 .Os
 .Sh NAME
@@ -52,7 +52,7 @@
 .Nm
 .Fl g
 .Op Fl cir
-.Op Fl d Ar domain | j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | 
Fl x Ar irq
+.Op Fl d Ar domain | Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar 
setid | Fl x Ar irq
 .Sh DESCRIPTION
 The
 .Nm
___
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: r303620 - stable/11/share/man/man9

2016-08-01 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Aug  1 16:24:46 2016
New Revision: 303620
URL: https://svnweb.freebsd.org/changeset/base/303620

Log:
  MFC r303519
  
  Fix two return types in the cpuset(9) and bitset(9) man pages
  
  The *_FFS() and *_COUNT() functions return int, not size_t.
  
  Approved by:  re (gjb)
  Sponsored by: Dell Inc.

Modified:
  stable/11/share/man/man9/bitset.9
  stable/11/share/man/man9/cpuset.9
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man9/bitset.9
==
--- stable/11/share/man/man9/bitset.9   Mon Aug  1 16:18:01 2016
(r303619)
+++ stable/11/share/man/man9/bitset.9   Mon Aug  1 16:24:46 2016
(r303620)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 20, 2015
+.Dd August 1, 2016
 .Dt BITSET 9
 .Os
 .Sh NAME
@@ -77,9 +77,9 @@
 .Fn BIT_EMPTY "const SETSIZE" "struct STRUCTNAME *bitset"
 .Ft bool
 .Fn BIT_ISFULLSET "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft size_t
+.Ft int
 .Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft size_t
+.Ft int
 .Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset"
 .\"
 .Ft bool

Modified: stable/11/share/man/man9/cpuset.9
==
--- stable/11/share/man/man9/cpuset.9   Mon Aug  1 16:18:01 2016
(r303619)
+++ stable/11/share/man/man9/cpuset.9   Mon Aug  1 16:24:46 2016
(r303620)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 20, 2015
+.Dd August 1, 2016
 .Dt CPUSET 9
 .Os
 .Sh NAME
@@ -75,9 +75,9 @@
 .Fn CPU_EMPTY "cpuset_t *cpuset"
 .Ft bool
 .Fn CPU_ISFULLSET "cpuset_t *cpuset"
-.Ft size_t
+.Ft int
 .Fn CPU_FFS "cpuset_t *cpuset"
-.Ft size_t
+.Ft int
 .Fn CPU_COUNT "cpuset_t *cpuset"
 .\"
 .Ft bool
___
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: r303624 - stable/11/usr.bin/cpuset

2016-08-01 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Aug  1 16:39:40 2016
New Revision: 303624
URL: https://svnweb.freebsd.org/changeset/base/303624

Log:
  MFC r303520
  
  Fix markup for -j in cpuset(1) synopsis
  
  Approved by:  re (kib)
  Sponsored by: Dell Inc.

Modified:
  stable/11/usr.bin/cpuset/cpuset.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/cpuset/cpuset.1
==
--- stable/11/usr.bin/cpuset/cpuset.1   Mon Aug  1 16:29:32 2016
(r303623)
+++ stable/11/usr.bin/cpuset/cpuset.1   Mon Aug  1 16:39:40 2016
(r303624)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 8, 2015
+.Dd August 1, 2016
 .Dt CPUSET 1
 .Os
 .Sh NAME
@@ -52,7 +52,7 @@
 .Nm
 .Fl g
 .Op Fl cir
-.Op Fl d Ar domain | j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | 
Fl x Ar irq
+.Op Fl d Ar domain | Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar 
setid | Fl x Ar irq
 .Sh DESCRIPTION
 The
 .Nm
___
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: r303788 - in head: sys/dev/pci usr.sbin/pciconf

2016-08-05 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Aug  5 23:23:48 2016
New Revision: 303788
URL: https://svnweb.freebsd.org/changeset/base/303788

Log:
  Fix some logic in PCIe HotPlug; display EI status
  
  The interpretation of the Electromechanical Interlock Status was
  inverted, so we disengaged the EI if a card was inserted.
  Fix it to engage the EI if a card is inserted.
  
  When displaying the slot capabilites/status with pciconf:
  
  - We inverted the sense of the Power Controller Control bit,
saying the power was off when it was really on (according to
this bit).  Fix that.
  
  - Display the status of the Electromechanical Interlock:
  EI(engaged)
  EI(disengaged)
  
  Reviewed by:  jhb
  MFC after:3 days
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D7426

Modified:
  head/sys/dev/pci/pci_pci.c
  head/usr.sbin/pciconf/cap.c

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Fri Aug  5 22:23:04 2016(r303787)
+++ head/sys/dev/pci/pci_pci.c  Fri Aug  5 23:23:48 2016(r303788)
@@ -1057,7 +1057,7 @@ static void
 pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask,
 bool schedule_task)
 {
-   bool card_inserted;
+   bool card_inserted, ei_engaged;
 
/* Clear DETACHING if Present Detect has cleared. */
if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) ==
@@ -1094,8 +1094,8 @@ pcib_pcie_hotplug_update(struct pcib_sof
 */
if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP) {
mask |= PCIEM_SLOT_CTL_EIC;
-   if (card_inserted !=
-   !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS))
+   ei_engaged = (sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS) != 0;
+   if (card_inserted != ei_engaged)
val |= PCIEM_SLOT_CTL_EIC;
}
 
@@ -1122,7 +1122,7 @@ pcib_pcie_hotplug_update(struct pcib_sof
pcib_pcie_hotplug_command(sc, val, mask);
 
/*
-* During attach the child "pci" device is added sychronously;
+* During attach the child "pci" device is added synchronously;
 * otherwise, the task is scheduled to manage the child
 * device.
 */

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Fri Aug  5 22:23:04 2016(r303787)
+++ head/usr.sbin/pciconf/cap.c Fri Aug  5 23:23:48 2016(r303788)
@@ -529,10 +529,13 @@ cap_express(int fd, struct pci_conf *p, 
if (cap & PCIEM_SLOT_CAP_APB)
printf(" Attn Button");
if (cap & PCIEM_SLOT_CAP_PCP)
-   printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "on" : "off");
+   printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "off" : "on");
if (cap & PCIEM_SLOT_CAP_MRLSP)
printf(" MRL(%s)", sta & PCIEM_SLOT_STA_MRLSS ? "open" :
"closed");
+   if (cap & PCIEM_SLOT_CAP_EIP)
+   printf(" EI(%s)", sta & PCIEM_SLOT_STA_EIS ? "engaged" :
+   "disengaged");
 }
 
 static void
___
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: r303835 - in stable/11: sys/dev/pci usr.sbin/pciconf

2016-08-08 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Aug  8 15:07:38 2016
New Revision: 303835
URL: https://svnweb.freebsd.org/changeset/base/303835

Log:
  MFC r303788
  
  Fix some logic in PCIe HotPlug; display EI status
  
  The interpretation of the Electromechanical Interlock Status was
  inverted, so we disengaged the EI if a card was inserted.
  Fix it to engage the EI if a card is inserted.
  
  When displaying the slot capabilites/status with pciconf:
  
  - We inverted the sense of the Power Controller Control bit,
saying the power was off when it was really on (according to
this bit).  Fix that.
  
  - Display the status of the Electromechanical Interlock:
EI(engaged)
EI(disengaged)
  
  Approved by:  re (gjb)
  Sponsored by: Dell Inc.

Modified:
  stable/11/sys/dev/pci/pci_pci.c
  stable/11/usr.sbin/pciconf/cap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/pci/pci_pci.c
==
--- stable/11/sys/dev/pci/pci_pci.c Mon Aug  8 13:52:18 2016
(r303834)
+++ stable/11/sys/dev/pci/pci_pci.c Mon Aug  8 15:07:38 2016
(r303835)
@@ -1057,7 +1057,7 @@ static void
 pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask,
 bool schedule_task)
 {
-   bool card_inserted;
+   bool card_inserted, ei_engaged;
 
/* Clear DETACHING if Present Detect has cleared. */
if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) ==
@@ -1094,8 +1094,8 @@ pcib_pcie_hotplug_update(struct pcib_sof
 */
if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP) {
mask |= PCIEM_SLOT_CTL_EIC;
-   if (card_inserted !=
-   !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS))
+   ei_engaged = (sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS) != 0;
+   if (card_inserted != ei_engaged)
val |= PCIEM_SLOT_CTL_EIC;
}
 
@@ -1122,7 +1122,7 @@ pcib_pcie_hotplug_update(struct pcib_sof
pcib_pcie_hotplug_command(sc, val, mask);
 
/*
-* During attach the child "pci" device is added sychronously;
+* During attach the child "pci" device is added synchronously;
 * otherwise, the task is scheduled to manage the child
 * device.
 */

Modified: stable/11/usr.sbin/pciconf/cap.c
==
--- stable/11/usr.sbin/pciconf/cap.cMon Aug  8 13:52:18 2016
(r303834)
+++ stable/11/usr.sbin/pciconf/cap.cMon Aug  8 15:07:38 2016
(r303835)
@@ -529,10 +529,13 @@ cap_express(int fd, struct pci_conf *p, 
if (cap & PCIEM_SLOT_CAP_APB)
printf(" Attn Button");
if (cap & PCIEM_SLOT_CAP_PCP)
-   printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "on" : "off");
+   printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "off" : "on");
if (cap & PCIEM_SLOT_CAP_MRLSP)
printf(" MRL(%s)", sta & PCIEM_SLOT_STA_MRLSS ? "open" :
"closed");
+   if (cap & PCIEM_SLOT_CAP_EIP)
+   printf(" EI(%s)", sta & PCIEM_SLOT_STA_EIS ? "engaged" :
+   "disengaged");
 }
 
 static void
___
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: r304046 - in head: sbin/ipfw sys/conf sys/modules sys/modules/ipfw_nat64 sys/netinet sys/netinet6 sys/netpfil/ipfw/nat64

2016-08-14 Thread Eric van Gyzen
On 08/13/16 11:09 AM, Andrey V. Elsukov wrote:
> Author: ae
> Date: Sat Aug 13 16:09:49 2016
> New Revision: 304046
> URL: https://svnweb.freebsd.org/changeset/base/304046
> 
> Log:
>   Add ipfw_nat64 module that implements stateless and stateful NAT64.

Thanks for contributing this.  When you get a moment, "make universe" is now 
broken:

/usr/src/sys/amd64/conf/LINT: unknown option "IPFIREWALL_NAT64"
*** [buildkernel] Error code 1

Cheers,

Eric
___
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: r304246 - head/sys/dev/pci

2016-08-16 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Aug 17 01:24:34 2016
New Revision: 304246
URL: https://svnweb.freebsd.org/changeset/base/304246

Log:
  PCIe HotPlug: Detect bridges that are not really HotPlug capable
  
  Some devices report that they have an MRL when they actually
  do not.  Since they always report that the MRL is open, child
  devices would be ignored.  Try to detect these devices and
  ignore their claim of HotPlug support.  Specifically,
  if there is an open MRL but the Data Link Layer is active,
  the MRL is not real.
  
  Revert r303645 to re-enable HotPlug support for slots with
  power controllers, since it works correctly in my testing.
  
  Start the DLL state-change timer if Presence /or/ MRL state changes,
  along with other conditions.  Previously, we started the timer iff
  Presence changed.  If there is an MRL, it must be closed for power
  to be turned on, so Presence is unlikely to change on an MRL-close event.
  
  Add a printf() of interesting registers on HotPlug interrupts and
  commands (one from erj@).  These were very useful for debugging.
  Guard them with bootverbose, since they're spam in normal operation.
  
  In collaboration with:jhb
  Reviewed by:  jhb
  MFC after:1 day
  Relnotes: yes (re-enable HotPlug support for slots with power controllers)
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D7509

Modified:
  head/sys/dev/pci/pci_pci.c

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Tue Aug 16 23:00:22 2016(r304245)
+++ head/sys/dev/pci/pci_pci.c  Wed Aug 17 01:24:34 2016(r304246)
@@ -918,6 +918,7 @@ static void
 pcib_probe_hotplug(struct pcib_softc *sc)
 {
device_t dev;
+   uint16_t link_sta, slot_sta;
 
if (!pci_enable_pcie_hp)
return;
@@ -932,15 +933,29 @@ pcib_probe_hotplug(struct pcib_softc *sc
sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4);
sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4);
 
+   if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0)
+   return;
+
/*
-* XXX: Handling of slots with a power controller needs to be
-* reexamined.  Ignore hotplug on such slots for now.
+* Some devices report that they have an MRL when they actually
+* do not.  Since they always report that the MRL is open, child
+* devices would be ignored.  Try to detect these devices and
+* ignore their claim of HotPlug support.
+*
+* If there is an open MRL but the Data Link Layer is active,
+* the MRL is not real.
 */
-   if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP)
-   return;
-   
-   if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC)
-   sc->flags |= PCIB_HOTPLUG;
+   if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0 &&
+   (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) != 0) {
+   link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2);
+   slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2);
+   if ((slot_sta & PCIEM_SLOT_STA_MRLSS) != 0 &&
+   (link_sta & PCIEM_LINK_STA_DL_ACTIVE) != 0) {
+   return;
+   }
+   }
+
+   sc->flags |= PCIB_HOTPLUG;
 }
 
 /*
@@ -966,6 +981,8 @@ pcib_pcie_hotplug_command(struct pcib_so
new = (ctl & ~mask) | val;
if (new == ctl)
return;
+   if (bootverbose)
+   device_printf(dev, "HotPlug command: %04x -> %04x\n", ctl, new);
pcie_write_config(dev, PCIER_SLOT_CTL, new, 2);
if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) &&
(ctl & new) & PCIEM_SLOT_CTL_CCIE) {
@@ -1028,9 +1045,6 @@ pcib_hotplug_inserted(struct pcib_softc 
 static int
 pcib_hotplug_present(struct pcib_softc *sc)
 {
-   device_t dev;
-
-   dev = sc->dev;
 
/* Card must be inserted. */
if (!pcib_hotplug_inserted(sc))
@@ -1059,7 +1073,7 @@ pcib_pcie_hotplug_update(struct pcib_sof
 {
bool card_inserted, ei_engaged;
 
-   /* Clear DETACHING if Present Detect has cleared. */
+   /* Clear DETACHING if Presence Detect has cleared. */
if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) ==
PCIEM_SLOT_STA_PDC)
sc->flags &= ~PCIB_DETACHING;
@@ -1101,14 +1115,15 @@ pcib_pcie_hotplug_update(struct pcib_sof
 
/*
 * Start a timer to see if the Data Link Layer times out.
-* Note that we only start the timer if Presence Detect
+* Note that we only start the timer if Presence Detect or MRL Sensor
 * changed on this interrupt.  Stop any scheduled timer if
 * the Data Link Layer is active.
 */
if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) {
if (card_inserted &&
!(sc->pcie_link_

svn commit: r304433 - stable/11/sys/dev/pci

2016-08-18 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Aug 18 21:47:00 2016
New Revision: 304433
URL: https://svnweb.freebsd.org/changeset/base/304433

Log:
  MFC r304246
  
  PCIe HotPlug: Detect bridges that are not really HotPlug capable
  
  Some devices report that they have an MRL when they actually
  do not.  Since they always report that the MRL is open, child
  devices would be ignored.  Try to detect these devices and
  ignore their claim of HotPlug support.  Specifically,
  if there is an open MRL but the Data Link Layer is active,
  the MRL is not real.
  
  Revert r303645 to re-enable HotPlug support for slots with
  power controllers, since it works correctly in my testing.
  
  Start the DLL state-change timer if Presence /or/ MRL state changes,
  along with other conditions.  Previously, we started the timer iff
  Presence changed.  If there is an MRL, it must be closed for power
  to be turned on, so Presence is unlikely to change on an MRL-close event.
  
  Add a printf() of interesting registers on HotPlug interrupts and
  commands (one from erj@).  These were very useful for debugging.
  Guard them with bootverbose, since they're spam in normal operation.
  
  In collaboration with:jhb
  Relnotes: yes (re-enable HotPlug support for slots with power controllers)
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D7509

Modified:
  stable/11/sys/dev/pci/pci_pci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/pci/pci_pci.c
==
--- stable/11/sys/dev/pci/pci_pci.c Thu Aug 18 19:18:40 2016
(r304432)
+++ stable/11/sys/dev/pci/pci_pci.c Thu Aug 18 21:47:00 2016
(r304433)
@@ -918,6 +918,7 @@ static void
 pcib_probe_hotplug(struct pcib_softc *sc)
 {
device_t dev;
+   uint16_t link_sta, slot_sta;
 
if (!pci_enable_pcie_hp)
return;
@@ -932,15 +933,29 @@ pcib_probe_hotplug(struct pcib_softc *sc
sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4);
sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4);
 
+   if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0)
+   return;
+
/*
-* XXX: Handling of slots with a power controller needs to be
-* reexamined.  Ignore hotplug on such slots for now.
+* Some devices report that they have an MRL when they actually
+* do not.  Since they always report that the MRL is open, child
+* devices would be ignored.  Try to detect these devices and
+* ignore their claim of HotPlug support.
+*
+* If there is an open MRL but the Data Link Layer is active,
+* the MRL is not real.
 */
-   if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP)
-   return;
-   
-   if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC)
-   sc->flags |= PCIB_HOTPLUG;
+   if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0 &&
+   (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) != 0) {
+   link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2);
+   slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2);
+   if ((slot_sta & PCIEM_SLOT_STA_MRLSS) != 0 &&
+   (link_sta & PCIEM_LINK_STA_DL_ACTIVE) != 0) {
+   return;
+   }
+   }
+
+   sc->flags |= PCIB_HOTPLUG;
 }
 
 /*
@@ -966,6 +981,8 @@ pcib_pcie_hotplug_command(struct pcib_so
new = (ctl & ~mask) | val;
if (new == ctl)
return;
+   if (bootverbose)
+   device_printf(dev, "HotPlug command: %04x -> %04x\n", ctl, new);
pcie_write_config(dev, PCIER_SLOT_CTL, new, 2);
if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) &&
(ctl & new) & PCIEM_SLOT_CTL_CCIE) {
@@ -1028,9 +1045,6 @@ pcib_hotplug_inserted(struct pcib_softc 
 static int
 pcib_hotplug_present(struct pcib_softc *sc)
 {
-   device_t dev;
-
-   dev = sc->dev;
 
/* Card must be inserted. */
if (!pcib_hotplug_inserted(sc))
@@ -1059,7 +1073,7 @@ pcib_pcie_hotplug_update(struct pcib_sof
 {
bool card_inserted, ei_engaged;
 
-   /* Clear DETACHING if Present Detect has cleared. */
+   /* Clear DETACHING if Presence Detect has cleared. */
if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) ==
PCIEM_SLOT_STA_PDC)
sc->flags &= ~PCIB_DETACHING;
@@ -1101,14 +1115,15 @@ pcib_pcie_hotplug_update(struct pcib_sof
 
/*
 * Start a timer to see if the Data Link Layer times out.
-* Note that we only start the timer if Presence Detect
+* Note that we only start the timer if Presence Detect or MRL Sensor
 * changed on this interrupt.  Stop any scheduled timer if
 * the Data Link Layer is active.
 */
if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) {
i

svn commit: r304434 - releng/11.0/sys/dev/pci

2016-08-18 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Aug 18 22:01:52 2016
New Revision: 304434
URL: https://svnweb.freebsd.org/changeset/base/304434

Log:
  MFC r304433
  
  PCIe HotPlug: Detect bridges that are not really HotPlug capable
  
  Some devices report that they have an MRL when they actually
  do not.  Since they always report that the MRL is open, child
  devices would be ignored.  Try to detect these devices and
  ignore their claim of HotPlug support.  Specifically,
  if there is an open MRL but the Data Link Layer is active,
  the MRL is not real.
  
  Revert r303645 to re-enable HotPlug support for slots with
  power controllers, since it works correctly in my testing.
  
  Start the DLL state-change timer if Presence /or/ MRL state changes,
  along with other conditions.  Previously, we started the timer iff
  Presence changed.  If there is an MRL, it must be closed for power
  to be turned on, so Presence is unlikely to change on an MRL-close event.
  
  Add a printf() of interesting registers on HotPlug interrupts and
  commands (one from erj@).  These were very useful for debugging.
  Guard them with bootverbose, since they're spam in normal operation.
  
  In collaboration with:jhb
  Relnotes: yes (re-enable HotPlug support for slots with power controllers)
  Approved by:  re (gjb)
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D7509

Modified:
  releng/11.0/sys/dev/pci/pci_pci.c
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/sys/dev/pci/pci_pci.c
==
--- releng/11.0/sys/dev/pci/pci_pci.c   Thu Aug 18 21:47:00 2016
(r304433)
+++ releng/11.0/sys/dev/pci/pci_pci.c   Thu Aug 18 22:01:52 2016
(r304434)
@@ -918,6 +918,7 @@ static void
 pcib_probe_hotplug(struct pcib_softc *sc)
 {
device_t dev;
+   uint16_t link_sta, slot_sta;
 
if (!pci_enable_pcie_hp)
return;
@@ -932,15 +933,29 @@ pcib_probe_hotplug(struct pcib_softc *sc
sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4);
sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4);
 
+   if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0)
+   return;
+
/*
-* XXX: Handling of slots with a power controller needs to be
-* reexamined.  Ignore hotplug on such slots for now.
+* Some devices report that they have an MRL when they actually
+* do not.  Since they always report that the MRL is open, child
+* devices would be ignored.  Try to detect these devices and
+* ignore their claim of HotPlug support.
+*
+* If there is an open MRL but the Data Link Layer is active,
+* the MRL is not real.
 */
-   if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP)
-   return;
-   
-   if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC)
-   sc->flags |= PCIB_HOTPLUG;
+   if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0 &&
+   (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) != 0) {
+   link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2);
+   slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2);
+   if ((slot_sta & PCIEM_SLOT_STA_MRLSS) != 0 &&
+   (link_sta & PCIEM_LINK_STA_DL_ACTIVE) != 0) {
+   return;
+   }
+   }
+
+   sc->flags |= PCIB_HOTPLUG;
 }
 
 /*
@@ -966,6 +981,8 @@ pcib_pcie_hotplug_command(struct pcib_so
new = (ctl & ~mask) | val;
if (new == ctl)
return;
+   if (bootverbose)
+   device_printf(dev, "HotPlug command: %04x -> %04x\n", ctl, new);
pcie_write_config(dev, PCIER_SLOT_CTL, new, 2);
if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) &&
(ctl & new) & PCIEM_SLOT_CTL_CCIE) {
@@ -1028,9 +1045,6 @@ pcib_hotplug_inserted(struct pcib_softc 
 static int
 pcib_hotplug_present(struct pcib_softc *sc)
 {
-   device_t dev;
-
-   dev = sc->dev;
 
/* Card must be inserted. */
if (!pcib_hotplug_inserted(sc))
@@ -1059,7 +1073,7 @@ pcib_pcie_hotplug_update(struct pcib_sof
 {
bool card_inserted, ei_engaged;
 
-   /* Clear DETACHING if Present Detect has cleared. */
+   /* Clear DETACHING if Presence Detect has cleared. */
if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) ==
PCIEM_SLOT_STA_PDC)
sc->flags &= ~PCIB_DETACHING;
@@ -1101,14 +1115,15 @@ pcib_pcie_hotplug_update(struct pcib_sof
 
/*
 * Start a timer to see if the Data Link Layer times out.
-* Note that we only start the timer if Presence Detect
+* Note that we only start the timer if Presence Detect or MRL Sensor
 * changed on this interrupt.  Stop any scheduled timer if
 * the Data Link Layer is active.
 */
if (sc->pcie_link_cap & PCIEM_LINK_CAP

Re: svn commit: r303988 - head/lib/libc/gen

2016-08-24 Thread Eric van Gyzen
On 08/24/2016 15:01, Ed Schouten wrote:
> 2016-08-24 21:53 GMT+02:00 Bryan Drewery :
>> Is it possible to cause the use of these old prototypes to print a
>> warning and note that they are deprecated/unsafe?
> 
> That's a good question. In theory, we could annotate these functions
> with __attribute__((__deprecated__)):
> 
> https://gcc.gnu.org/onlinedocs/gcc-3.3.4/gcc/Type-Attributes.html
> 
> But I'm actually too afraid to use it. In the worst case it may cause
> the compiler to generate a warning even when basename()/dirname() is
> used correctly, as __old_* will still be part of the compiled
> expression.

Could __warn_references() be used, as libc currently does for gets() and
others?

Eric
___
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: r303988 - head/lib/libc/gen

2016-08-24 Thread Eric van Gyzen
On 08/24/2016 15:16, Bryan Drewery wrote:
> On 8/24/16 1:12 PM, Eric van Gyzen wrote:
>> On 08/24/2016 15:01, Ed Schouten wrote:
>>> 2016-08-24 21:53 GMT+02:00 Bryan Drewery :
>>>> Is it possible to cause the use of these old prototypes to print a
>>>> warning and note that they are deprecated/unsafe?
>>>
>>> That's a good question. In theory, we could annotate these functions
>>> with __attribute__((__deprecated__)):
>>>
>>> https://gcc.gnu.org/onlinedocs/gcc-3.3.4/gcc/Type-Attributes.html
>>>
>>> But I'm actually too afraid to use it. In the worst case it may cause
>>> the compiler to generate a warning even when basename()/dirname() is
>>> used correctly, as __old_* will still be part of the compiled
>>> expression.
>>
>> Could __warn_references() be used, as libc currently does for gets() and
>> others?
>>
>> Eric
>>
> 
> /usr/include/stdio.h:extern char *gets (char *__s) __wur
> __attribute_deprecated__;
> /usr/include/x86_64-linux-gnu/sys/cdefs.h:# define
> __attribute_deprecated__ __attribute__ ((__deprecated__))
> 
> __wur being warning about unused result.

/usr/src/lib/libc/stdio/gets.c:__warn_references(gets, "warning: this
program uses gets(), which is unsafe.");

> As for actually using it here, I tried adding it onto the
> _old_dirname/basename prototypes.  It produces an error, fine, in the
> bootstrap build for xinstall it would not error, great.  However, for
> building xinstall on head where it will not use the __old_dirname and
> will use the new dirname@FBSD_1.5, it _still_ complains about using the
> __old_dirname() prototype via __generic and errors in the wrong case.
___
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: r304815 - in head: lib lib/libifc share/examples/libifc share/mk

2016-08-25 Thread Eric van Gyzen
On 08/25/2016 15:20, Kristof Provost wrote:
> On 25 Aug 2016, at 22:14, John Baldwin wrote:
>> On Thursday, August 25, 2016 07:40:25 PM Kristof Provost wrote:
>>> Author: kp
>>> Date: Thu Aug 25 19:40:25 2016
>>> New Revision: 304815
>>> URL: https://svnweb.freebsd.org/changeset/base/304815
>>>
>>> Log:
>>>   Add libifc, a library implementing core functionality that exists
>>> in ifconfig(8) today.
>>>
>>>   libifc (pronounced lib-ifconfig) aims to be a light abstraction
>>> layer between
>>>   programs and the kernel APIs for managing the network configuration.
>>>   This should hopefully make programs easier to maintain, and reduce
>>> code
>>>   duplication.
>>>
>>>   Work will begin on making ifconfig(8) use this library in the near
>>> future.
>>>
>>>   This code is still evolving. The interface should not be considered
>>> stable until
>>>   it is announced as such.
>>
>> I hate even writing this mail, and it looks like the topic wasn't really
>> discussed in the review, but I think libifconfig is probably the "better"
>> name if the goal is to move most of ifconfig into it.  Certainly if a
>> developer is looking for a library that provides a programmatic interface
>> to the same operations a user does via ifconfig, libifconfig is the name
>> they will look for first.
>>
>> One thing I did see in the review is that the APIs use 'ifc_*' and
>> that was
>> the reason given for renaming the library.  If you really want those
>> to be
>> in sync, I actually think the longer 'ifconfig_*' prefix isn't that
>> terrible.
>> We have other libraries that use similar length names and namespace
>> prefixes
>> already (libarchive, libdevctl, libdevinfo, libpthread).
>>
>> Hmm, it seems you are 'libifc_*'.  Most of our libraries do not include
>> 'lib' in the namespace prefix (see above examples that all use the
>> name of
>> the library without 'lib' as the prefix).  If nothing else I'd suggest
>> dropping 'lib' to be consistent with most other libraries in the tree.
> 
> This is the right time to bring this sort of thing up. One of the reasons
> I pushed to get this in the tree in this very early state was to provoke
> exactly this sort of response. Right now the work is still in an early
> state
> and changing this sort of thing is still possible.
> 
> The name was in fact discussed privately, and we figured libifconfig was
> a bit
> on the long side.
> 
> I certainly take your point about libifc_. Does anyone else have any
> views regarding
> the naming (or other subjects)?

I'm on the same page as John about the naming:  The library should be
libifconfig, and the functions should begin with "ifconfig_".

Thanks for this contribution, Marie.  I've wanted it many times in the past.

Eric
___
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: r344567 - in head: etc/mtree include sbin sbin/veriexec

2019-02-27 Thread Eric van Gyzen

> On Feb 26, 2019, at 10:17 PM, Warner Losh  wrote:
> 
> 
> 
> On Tue, Feb 26, 2019, 6:50 AM Alexey Dokuchaev  > wrote:
> On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote:
> > > Author: sjg
> > > Date: Tue Feb 26 06:17:23 2019
> > > New Revision: 344567
> > > URL: https://svnweb.freebsd.org/changeset/base/344567 
> > > 
> > > 
> > > Log:
> > >   Add verifying manifest loader for mac_veriexec
> > >   
> > >   This tool will verify a signed manifest and load contents into
> > >   mac_veriexec for storage
> > >   
> > >   Sponsored by: Juniper Networks
> > >   Differential Revision:D16575
> > 
> > Just a small nit, for future reference, from the template:
> > > Differential Revision:https://reviews.freebsd.org/D### 
> > > 
> > (*full* phabric URL needed).
> 
> IMHO we should just fix the scripts to accept D alone, without
> the URL.  We don't do that for PR (bugzilla) references, and the fact
> that we do for the phab is both needless and confusing.  Also, that
> URL might change one day while we could probably keep the old numbers
> if we move.
> 
> When this came up before, it was an upstream decision to require the full 
> path. The reasoning is that D space isn't unique and the review may 
> happen in a different instance of phab than the default one. When those exact 
> objections were raised, the experience of moving to bugzilla was cited to 
> show the URL can remain stable. And if we went to another system's, we could 
> keep the old in place and then we would need a new URL to disambiguate. There 
> were good reasons we decided this before.
> 
> So this has been litigated before, and the consensus was we needed to break 
> with the practice of not putting URLs in commit messages for these reasons.

I completely agree.  In fact, I’d like to see full bugzilla URLs in commit logs 
instead of just the bug number.  Every app I use to read commit logs will make 
URLs clickable, even my terminal emulator.  The fact that I have to manually 
open bugzilla and copy/type the bug number is annoying.

And yes, I volunteer to make the necessary changes to accept URLs in the PR 
field.  We just need consensus.

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


URLs in the PR field of commit logs

2019-03-07 Thread Eric van Gyzen
(I apologize for the massive cross-post.  There was no obvious place to
announce this.)

I plan to change the Subversion commit hooks to accept URLs in the PR
field of commit logs.  See

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236229

If you anticipate specific problems this might cause, or have any other
relevant discussion, please comment on that bug.

Thanks,

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


URLs in the PR field of commit logs

2019-03-27 Thread Eric van Gyzen
(I apologize for the massive cross-post.  There was no obvious place to
announce this.)

I plan to change the Subversion commit hooks to accept URLs in the PR
field of commit logs.  See

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236229

If you anticipate specific problems this might cause, or have any other
relevant discussion, please comment on that bug.

Thanks,

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


  1   2   3   4   >