svn commit: r343462 - head/sys/ufs/ffs

2019-01-25 Thread Kirk McKusick
Author: mckusick
Date: Sat Jan 26 05:35:24 2019
New Revision: 343462
URL: https://svnweb.freebsd.org/changeset/base/343462

Log:
  Expand DDB's set of printable soft dependency data structures. The
  set of known soft dependency data structures now includes: sd_worklist,
  sd_inodedep, sd_allocdirect, sd_allocindir, and sd_mkdir. DDB can
  also print lists of sd_allinodedeps, sd_mkdir_list, and sd_workhead.
  The sd_workhead script is useful for listing all the dependencies
  associated with a buffer, e.g. bp->b_dep.
  
  Prefix the soft dependency show names with sd_ so that they sort
  together when listed by DDB's "show help" and to distinguish them
  from other data structures printable by DDB.
  
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Sat Jan 26 03:43:12 2019
(r343461)
+++ head/sys/ufs/ffs/ffs_softdep.c  Sat Jan 26 05:35:24 2019
(r343462)
@@ -14406,47 +14406,129 @@ softdep_error(func, error)
 
 #ifdef DDB
 
+/* exported to ffs_vfsops.c */
+extern void db_print_ffs(struct ufsmount *ump);
+void
+db_print_ffs(struct ufsmount *ump)
+{
+   db_printf("mp %p (%s) devvp %p\n", ump->um_mountp,
+   ump->um_mountp->mnt_stat.f_mntonname, ump->um_devvp);
+   db_printf("fs %p su_wl %d su_deps %d su_req %d\n",
+   ump->um_fs, ump->softdep_on_worklist,
+   ump->softdep_deps, ump->softdep_req);
+}
+
 static void
+worklist_print(struct worklist *wk, int verbose)
+{
+
+   if (!verbose) {
+   db_printf("%s: %p state 0x%b\n", TYPENAME(wk->wk_type), wk,
+   (u_int)wk->wk_state, PRINT_SOFTDEP_FLAGS);
+   return;
+   }
+   db_printf("worklist: %p type %s state 0x%b next %p\n", wk,
+   TYPENAME(wk->wk_type), (u_int)wk->wk_state, PRINT_SOFTDEP_FLAGS,
+   LIST_NEXT(wk, wk_list));
+   db_print_ffs(VFSTOUFS(wk->wk_mp));
+}
+
+static void
 inodedep_print(struct inodedep *inodedep, int verbose)
 {
-   db_printf("%p fs %p st %x ino %jd inoblk %jd delta %jd nlink %jd"
-   " saveino %p\n",
-   inodedep, inodedep->id_fs, inodedep->id_state,
+
+   worklist_print(>id_list, 0);
+   db_printf("fs %p ino %jd inoblk %jd delta %jd nlink %jd\n",
+   inodedep->id_fs,
(intmax_t)inodedep->id_ino,
(intmax_t)fsbtodb(inodedep->id_fs,
-   ino_to_fsba(inodedep->id_fs, inodedep->id_ino)),
+   ino_to_fsba(inodedep->id_fs, inodedep->id_ino)),
(intmax_t)inodedep->id_nlinkdelta,
-   (intmax_t)inodedep->id_savednlink,
-   inodedep->id_savedino1);
+   (intmax_t)inodedep->id_savednlink);
 
if (verbose == 0)
return;
 
-   db_printf("\tpendinghd %p, bufwait %p, inowait %p, inoreflst %p, "
-   "mkdiradd %p\n",
+   db_printf("bmsafemap %p, mkdiradd %p, inoreflst %p\n",
+   inodedep->id_bmsafemap,
+   inodedep->id_mkdiradd,
+   TAILQ_FIRST(>id_inoreflst));
+   db_printf("dirremhd %p, pendinghd %p, bufwait %p\n",
+   LIST_FIRST(>id_dirremhd),
LIST_FIRST(>id_pendinghd),
-   LIST_FIRST(>id_bufwait),
+   LIST_FIRST(>id_bufwait));
+   db_printf("inowait %p, inoupdt %p, newinoupdt %p\n",
LIST_FIRST(>id_inowait),
-   TAILQ_FIRST(>id_inoreflst),
-   inodedep->id_mkdiradd);
-   db_printf("\tinoupdt %p, newinoupdt %p, extupdt %p, newextupdt %p\n",
TAILQ_FIRST(>id_inoupdt),
-   TAILQ_FIRST(>id_newinoupdt),
+   TAILQ_FIRST(>id_newinoupdt));
+   db_printf("extupdt %p, newextupdt %p, freeblklst %p\n",
TAILQ_FIRST(>id_extupdt),
-   TAILQ_FIRST(>id_newextupdt));
+   TAILQ_FIRST(>id_newextupdt),
+   TAILQ_FIRST(>id_freeblklst));
+   db_printf("saveino %p, savedsize %jd, savedextsize %jd\n",
+   inodedep->id_savedino1,
+   (intmax_t)inodedep->id_savedsize,
+   (intmax_t)inodedep->id_savedextsize);
 }
 
-DB_SHOW_COMMAND(inodedep, db_show_inodedep)
+static void
+newblk_print(struct newblk *nbp)
 {
 
+   worklist_print(>nb_list, 0);
+   db_printf("newblkno %jd\n", (intmax_t)nbp->nb_newblkno);
+   db_printf("jnewblk %p, bmsafemap %p, freefrag %p\n",
+   >nb_jnewblk,
+   >nb_bmsafemap,
+   >nb_freefrag);
+   db_printf("indirdeps %p, newdirblk %p, jwork %p\n",
+   LIST_FIRST(>nb_indirdeps),
+   LIST_FIRST(>nb_newdirblk),
+   LIST_FIRST(>nb_jwork));
+}
+
+static void
+allocdirect_print(struct allocdirect *adp)
+{
+
+   newblk_print(>ad_block);
+   db_printf("oldblkno %jd, oldsize %ld, newsize %ld\n",
+   adp->ad_oldblkno, adp->ad_oldsize, adp->ad_newsize);
+   db_printf("offset %d, inodedep %p\n",
+   

svn commit: r343461 - head/lib/libc/tests/sys

2019-01-25 Thread Enji Cooper
Author: ngie
Date: Sat Jan 26 03:43:12 2019
New Revision: 343461
URL: https://svnweb.freebsd.org/changeset/base/343461

Log:
  Fix reporting errors with `gai_strerror(..)`
  
  The return value (`err`) should be checked; not the `errno` value.
  
  PR:   235200
  Approved by:  emaste (mentor)
  Reviewed by:  asomers, lwhsu
  MFC after:28 days
  MFC with: r343362, r343365, r343367-r343368
  Differential Revision: https://reviews.freebsd.org/D18969

Modified:
  head/lib/libc/tests/sys/sendfile_test.c

Modified: head/lib/libc/tests/sys/sendfile_test.c
==
--- head/lib/libc/tests/sys/sendfile_test.c Fri Jan 25 22:52:49 2019
(r343460)
+++ head/lib/libc/tests/sys/sendfile_test.c Sat Jan 26 03:43:12 2019
(r343461)
@@ -114,7 +114,7 @@ resolve_localhost(struct addrinfo **res, int domain, i
 
error = getaddrinfo("localhost", serv, , res);
ATF_REQUIRE_EQ_MSG(error, 0,
-   "getaddrinfo failed: %s", gai_strerror(errno));
+   "getaddrinfo failed: %s", gai_strerror(error));
free(serv);
 }
 
___
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: r343440 - head/bin/sh

2019-01-25 Thread Edward Napierala
On 0125T1705, Rodney W. Grimes wrote:
> > > On Jan 25, 2019, at 1:13 AM, Edward Napierala  wrote:
> 
> Chop with the big axe most of this as I need to clarify a miss statement.
> ...
> > > The change we're discussing doesn't affect upgrades at all - it's only
> > > for new installs.
> > 
> > mergemaster, iirc, will merge in changes to etc files after an upgrade.
> > So this would effect anybody that goes through an upgrade and performs 
> > mergemaster.
> 
> Correct, and to my knowledge there is no way to stop that effect.

Won't happen in this case, this doesn't apply to files in /etc
at all; it only applies to the default /root/.shrc and /root/.profile
that get installed on fresh systems.

> > >  And it doesn't affect root by default, you
> > > need to change their shell from csh(1) to sh(1).
> > 
> > By your own commit messages admission, this is for the toor account, so it 
> > does affect a user (and as you were keen to point out, users with the 
> > default shell).
> 
> Further it effects root any time root types "sh" or "/bin/sh"
> and intentially invokes sh interactive for some reason,
> something I do more often than I care to admit simply
> cause I know what I want to do is much easier in that
> shell.

It doesn't.  For sh(1) to read ~/.shrc (/root/.shrc in this case)
you need to have ENV set; the default /root/.profile only sets
it when sh(1) is your login shell.  Which means, this doesn't
change the behaviour when you casually run "sh" or "/bin/sh"
as root; sh needs to be set up as login shell for this to take
effect.

___
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: r343440 - head/bin/sh

2019-01-25 Thread Rodney W. Grimes
> On 0125T1705, Rodney W. Grimes wrote:
> > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala  wrote:
> > 
> > Chop with the big axe most of this as I need to clarify a miss statement.
> > ...
> > > > The change we're discussing doesn't affect upgrades at all - it's only
> > > > for new installs.
> > > 
> > > mergemaster, iirc, will merge in changes to etc files after an upgrade.
> > > So this would effect anybody that goes through an upgrade and performs 
> > > mergemaster.
> > 
> > Correct, and to my knowledge there is no way to stop that effect.
> 
> Won't happen in this case, this doesn't apply to files in /etc
> at all; it only applies to the default /root/.shrc and /root/.profile
> that get installed on fresh systems.

mergemaster is the wrong term here, freebsd-update is
going to want to merge this change.

> > > >  And it doesn't affect root by default, you
> > > > need to change their shell from csh(1) to sh(1).
> > > 
> > > By your own commit messages admission, this is for the toor account, so 
> > > it does affect a user (and as you were keen to point out, users with the 
> > > default shell).
> > 
> > Further it effects root any time root types "sh" or "/bin/sh"
> > and intentially invokes sh interactive for some reason,
> > something I do more often than I care to admit simply
> > cause I know what I want to do is much easier in that
> > shell.
> 
> It doesn't.  For sh(1) to read ~/.shrc (/root/.shrc in this case)
> you need to have ENV set; the default /root/.profile only sets
> it when sh(1) is your login shell.
I do not see any conditional logic in /root/.profile,
what your mis stating is that /root/.profile is not
run for a login shell, so ENV would not be set unless
something else caused /root/.profile to be read, aka
source ~/.profile

>   Which means, this doesn't
> change the behaviour when you casually run "sh" or "/bin/sh"
> as root; sh needs to be set up as login shell for this to take
> effect.

Again I do not see any conditional logic in /root/.profile
that would make that true.  A su - toor would be effected.


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


Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Edward Napierala
Excuse my brevity; I'll address the rest after getting some sleep,
but I'd like to clarify one crucial thing.  I think that's actually
_the_ point where I screwed up: I didn't expect people to actually
care for what I considered a cosmetic change, and I didn't realize
the need to explain what this commit does _not_ affect.

(And I've been reminded by rgrimes@ more than once that I should pay
more attention to my commit messages.  Oh well.  Perhaps I'll learn
this time.)

On 0125T1647, Devin Teske wrote:
> 
> 
> > On Jan 25, 2019, at 1:13 AM, Edward Napierala  wrote:

[..]

>  PS1 should have a reasonable default. If that default is not reasonable, 
>  then we should change the C code.
>  
>  Maybe I see things differently, but I'd rather see PS1 default change so 
>  no profile/shrc change is necessary.
> >>> 
> >>> Thank you, that's actually a valid argument.  I believe that's also what
> >>> bash does.  It would be more intrusive, though, and I kind of don't like
> >>> the idea of hardcoding things that can easily be dealt with with in a more
> >>> "high-level" way.
> >>> 
>  I prefer that sh, in its default configuration, not attempt to read 
>  $HOME/.shrc, for security reasons.
> >>> 
> >>> Can you elaborate?  It already reads $HOME/.profile; how is $HOME/.shrc
> >>> different?
> >> 
> >> If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the 
> >> importance of "one place to exploit versus two."
> >> 
> >> (situation)
> >> 
> >> Say you've been running FreeBSD for 20 years (it turned 25 years old last 
> >> year, so this is not only possible, but plausible).
> >> You know all the areas of interest where an attacker could inject code.
> >> You take care to lock down each one.
> >> But come to your surprise ...
> >> 
> >> (hypothetical)
> >> 
> >> 6 months after you upgraded from 11.2 to the latest 12.x, you find that 
> >> you didn't take into account that $HOME/.profile (which you perhaps locked 
> >> down with a "chflags" command) now branches out to a new file which you've 
> >> never taken steps to lock down, keep an eye on, or audit (e.g., by using 
> >> DTrace remote-logging, tripwire, or other means). You only found out 6 
> >> months after the upgrade because someone exploited it. At that point, the 
> >> security event has already occurred.
> >> 
> >> When I worked at "the banks" shit like this was always on our radar. 
> >> Changes like this were often cited for the reason why one bank moved to 
> >> BoKs for security.
> > 
> > The change we're discussing doesn't affect upgrades at all - it's only
> > for new installs.
> 
> mergemaster, iirc, will merge in changes to etc files after an upgrade.
> So this would effect anybody that goes through an upgrade and performs 
> mergemaster.

No, it won't - it doesn't affect files in /etc at all.  It doesn't
affect stuff that's being installed by mergemaster(8), nor stuff
installed by 'make install'.  It only affects the default /root/.profile
and /root/.shrc, as installed by bsdinstall(8) or shipped as VM or SD
card images.

[..]

> >  And it doesn't affect root by default, you
> > need to change their shell from csh(1) to sh(1).
> 
> By your own commit messages admission, this is for the toor account, so it 
> does affect a user (and as you were keen to point out, users with the default 
> shell).

Yes, but it only affects the toor account for new installs, and the account
is locked by 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"


Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Rodney W. Grimes
> > On Jan 25, 2019, at 1:13 AM, Edward Napierala  wrote:

Chop with the big axe most of this as I need to clarify a miss statement.
...
> > The change we're discussing doesn't affect upgrades at all - it's only
> > for new installs.
> 
> mergemaster, iirc, will merge in changes to etc files after an upgrade.
> So this would effect anybody that goes through an upgrade and performs 
> mergemaster.

Correct, and to my knowledge there is no way to stop that effect.

...
> 
> >  And it doesn't affect root by default, you
> > need to change their shell from csh(1) to sh(1).
> 
> By your own commit messages admission, this is for the toor account, so it 
> does affect a user (and as you were keen to point out, users with the default 
> shell).

Further it effects root any time root types "sh" or "/bin/sh"
and intentially invokes sh interactive for some reason,
something I do more often than I care to admit simply
cause I know what I want to do is much easier in that
shell.

It does not require root change there login shell for
these changes to effect the root account usage.

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


Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 1:13 AM, Edward Napierala  wrote:
> 
> On 0125T1530, Devin Teske wrote:
>> 
>> 
>>> On Jan 25, 2019, at 12:28 AM, Edward Napierala  wrote:
>>> 
>>> On 0125T1441, Devin Teske wrote:
 
 
> On Jan 25, 2019, at 1:37 PM, Edward Napierala  wrote:
> 
> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
> napisał(a):
>> 
>>> Author: trasz
>>> Date: Fri Jan 25 17:09:26 2019
>>> New Revision: 343440
>>> URL: https://svnweb.freebsd.org/changeset/base/343440
>>> 
>>> Log:
>>> Comment out the default sh(1) aliases for root, introduced in r343416.
>>> The rest of this stuff is still to be discussed, but I think at this
>>> point we have the agreement that the aliases should go.
>>> 
>>> MFC after:  2 weeks
>>> Sponsored by:   DARPA, AFRL
>> 
>> Please just revert this and the prior commit out, and when
>> the path forward is clear commit it.  I would not want any of this
>> merged to 12/ or 11/ until the time that it is all settled.
> 
> Oops, my bad - neither this nor the previous commit is supposed
> to be MFC-ed; the "2 weeks" above comes from my default Subversion
> config.
> 
> Regarding the backoff - just a few hours ago you said you don't have
> any problem with this, except for aliases and the default ENV.  The
> aliases problem has been addressed, and you hadn't yet responded
> to my explanations regarding the ENV.  Another committer asked for
> backoff, because "sh is not an interactive shell", while in fact sh(1)
> is FreeBSD's default interactive shell except for root.  Finally, there's
> one person who asked for revert, but without giving any reasons
> whatsoever.
> 
> So far nobody had proposed any scenario where this would break
> anything, or even affect existing users.  It seems like a typical bikeshed
> situation.
 
 It is not clear to me after reading r343416 and D18872 what this change is 
 trying to solve.
>>> 
>>> The idea is to make it easy to replace the default root shell - which
>>> many people consider broken, due to not supporting basic shell syntax - with
>>> something that actually works.
>> 
>> How exactly does changing PS1 or adding 6 aliases fix the "basic shell 
>> syntax" which you claim to be unsupported?
>> 
>> If the number of aliases added to a shell are a measure of its brokenness, 
>> then bash must be hella broken (I have 43 aliases in my bash_profile).
> 
> The aliases are gone.

Fair enough, albeit the topic was r343416 and D18872.


>  Human-friendly PS1 is considered a standard feature
> nowadays.

I fail to see how ''$ " is unfriendly.

In fact, I am a bit amiss how you don't see "\u@\h:\w \\$ " as being unfriendly 
to TCL/Expect.

While it's certainly possible to use "expect -re" and formulate around it, the 
change itself would break existing scripts.



>  But the way it fixes things is that it makes it easy to replace
> csh with a shell which actually groks shell syntax and is reasonably useful
> out of the box,

This sounds like you are claiming csh is broken.

I see where you may be coming from:

+ /bin/sh supports a syntax
+ bash supports nearly all of /bin/sh
+ zsh supports nearly all of /bin/sh

So [t]csh must seem broken to you because it doesn't fall inline.

Being different doesn't mean you are broken. As I have stated previously, I 
know lots of people that would and do set their login shell to tcsh.

I personally have both a .tcshrc and a .bash_profile because I use both. I 
would never consider csh broken because it doesn't "grok shell syntax" -- it 
in-fact groks its own shell syntax just fine and dandy.


> with ~/.shrc you can customize etc.

As can ~/.profile



>  Think of it as a POLA,
> but horizontally, for folks coming from other systems, instead of the usual
> one.

POLA can affect multiple people at the same time.

Someone may be astonished that something is different when coming from anther 
community, but what if addressing this difference causes a POLA violation for 
long-standing users.



> 
>> Also, the perhaps anecdotal consideration of brokenness is nearly laughable 
>> -- these can largely be lumped into one of three categories:
>> 
>> a. Considered broken because it doesn't support bashisms
>> b. Considered broken because lack of syntactical knowledge
>> c. Considered broken because (no reason given)
> 
> It's broken because it doesn't accept what people call the shell syntax.

people from Linux?
people you know?
people in articles?
people on twitter?

I don't have this experience.



> Sure, some folks do realize there used to be something called 'csh',
> and people kept using it even into the nineties.

That's one perspective.

I started using tcsh in 2007.
I keep using it today.
I even use it on my Mac.
I also use it on Linux.
I continue to grow my ~/.tcsh file (currently at 410 lines)

When I use 

Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Edward Napierala
On 0125T1530, Devin Teske wrote:
> 
> 
> > On Jan 25, 2019, at 12:28 AM, Edward Napierala  wrote:
> > 
> > On 0125T1441, Devin Teske wrote:
> >> 
> >> 
> >>> On Jan 25, 2019, at 1:37 PM, Edward Napierala  wrote:
> >>> 
> >>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
> >>> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
> >>> napisał(a):
>  
> > Author: trasz
> > Date: Fri Jan 25 17:09:26 2019
> > New Revision: 343440
> > URL: https://svnweb.freebsd.org/changeset/base/343440
> > 
> > Log:
> > Comment out the default sh(1) aliases for root, introduced in r343416.
> > The rest of this stuff is still to be discussed, but I think at this
> > point we have the agreement that the aliases should go.
> > 
> > MFC after:  2 weeks
> > Sponsored by:   DARPA, AFRL
>  
>  Please just revert this and the prior commit out, and when
>  the path forward is clear commit it.  I would not want any of this
>  merged to 12/ or 11/ until the time that it is all settled.
> >>> 
> >>> Oops, my bad - neither this nor the previous commit is supposed
> >>> to be MFC-ed; the "2 weeks" above comes from my default Subversion
> >>> config.
> >>> 
> >>> Regarding the backoff - just a few hours ago you said you don't have
> >>> any problem with this, except for aliases and the default ENV.  The
> >>> aliases problem has been addressed, and you hadn't yet responded
> >>> to my explanations regarding the ENV.  Another committer asked for
> >>> backoff, because "sh is not an interactive shell", while in fact sh(1)
> >>> is FreeBSD's default interactive shell except for root.  Finally, there's
> >>> one person who asked for revert, but without giving any reasons
> >>> whatsoever.
> >>> 
> >>> So far nobody had proposed any scenario where this would break
> >>> anything, or even affect existing users.  It seems like a typical bikeshed
> >>> situation.
> >> 
> >> It is not clear to me after reading r343416 and D18872 what this change is 
> >> trying to solve.
> > 
> > The idea is to make it easy to replace the default root shell - which
> > many people consider broken, due to not supporting basic shell syntax - with
> > something that actually works.
> 
> How exactly does changing PS1 or adding 6 aliases fix the "basic shell 
> syntax" which you claim to be unsupported?
> 
> If the number of aliases added to a shell are a measure of its brokenness, 
> then bash must be hella broken (I have 43 aliases in my bash_profile).

The aliases are gone.  Human-friendly PS1 is considered a standard feature
nowadays.  But the way it fixes things is that it makes it easy to replace
csh with a shell which actually groks shell syntax and is reasonably useful
out of the box, with ~/.shrc you can customize etc.  Think of it as a POLA,
but horizontally, for folks coming from other systems, instead of the usual
one.

> Also, the perhaps anecdotal consideration of brokenness is nearly laughable 
> -- these can largely be lumped into one of three categories:
> 
> a. Considered broken because it doesn't support bashisms
> b. Considered broken because lack of syntactical knowledge
> c. Considered broken because (no reason given)

It's broken because it doesn't accept what people call the shell syntax.
Sure, some folks do realize there used to be something called 'csh',
and people kept using it even into the nineties.  But most users aren't
actually that much into computing history; they expect the system to just
work like they expect.

> Other languages might fit that description as well, and so we should take 
> this anecdote of "many people consider broken" with a grain of salt.
> 
> I personally have written more than 50,000 lines of shell for the FreeBSD 
> base OS -- all utilizing /bin/sh

And that's one of the reasons why I really apprieciate your response.

> >> PS1 should have a reasonable default. If that default is not reasonable, 
> >> then we should change the C code.
> >> 
> >> Maybe I see things differently, but I'd rather see PS1 default change so 
> >> no profile/shrc change is necessary.
> > 
> > Thank you, that's actually a valid argument.  I believe that's also what
> > bash does.  It would be more intrusive, though, and I kind of don't like
> > the idea of hardcoding things that can easily be dealt with with in a more
> > "high-level" way.
> > 
> >> I prefer that sh, in its default configuration, not attempt to read 
> >> $HOME/.shrc, for security reasons.
> > 
> > Can you elaborate?  It already reads $HOME/.profile; how is $HOME/.shrc
> > different?
> 
> If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the 
> importance of "one place to exploit versus two."
> 
> (situation)
> 
> Say you've been running FreeBSD for 20 years (it turned 25 years old last 
> year, so this is not only possible, but plausible).
> You know all the areas of interest where an attacker could inject code.
> You take care to lock down each one.
> But come to your surprise ...
> 
> 

Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 12:28 AM, Edward Napierala  wrote:
> 
> On 0125T1441, Devin Teske wrote:
>> 
>> 
>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala  wrote:
>>> 
>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>>> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
>>> napisał(a):
 
> Author: trasz
> Date: Fri Jan 25 17:09:26 2019
> New Revision: 343440
> URL: https://svnweb.freebsd.org/changeset/base/343440
> 
> Log:
> Comment out the default sh(1) aliases for root, introduced in r343416.
> The rest of this stuff is still to be discussed, but I think at this
> point we have the agreement that the aliases should go.
> 
> MFC after:  2 weeks
> Sponsored by:   DARPA, AFRL
 
 Please just revert this and the prior commit out, and when
 the path forward is clear commit it.  I would not want any of this
 merged to 12/ or 11/ until the time that it is all settled.
>>> 
>>> Oops, my bad - neither this nor the previous commit is supposed
>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion
>>> config.
>>> 
>>> Regarding the backoff - just a few hours ago you said you don't have
>>> any problem with this, except for aliases and the default ENV.  The
>>> aliases problem has been addressed, and you hadn't yet responded
>>> to my explanations regarding the ENV.  Another committer asked for
>>> backoff, because "sh is not an interactive shell", while in fact sh(1)
>>> is FreeBSD's default interactive shell except for root.  Finally, there's
>>> one person who asked for revert, but without giving any reasons
>>> whatsoever.
>>> 
>>> So far nobody had proposed any scenario where this would break
>>> anything, or even affect existing users.  It seems like a typical bikeshed
>>> situation.
>> 
>> It is not clear to me after reading r343416 and D18872 what this change is 
>> trying to solve.
> 
> The idea is to make it easy to replace the default root shell - which
> many people consider broken, due to not supporting basic shell syntax - with
> something that actually works.

How exactly does changing PS1 or adding 6 aliases fix the "basic shell syntax" 
which you claim to be unsupported?

If the number of aliases added to a shell are a measure of its brokenness, then 
bash must be hella broken (I have 43 aliases in my bash_profile).

Also, the perhaps anecdotal consideration of brokenness is nearly laughable -- 
these can largely be lumped into one of three categories:

a. Considered broken because it doesn't support bashisms
b. Considered broken because lack of syntactical knowledge
c. Considered broken because (no reason given)

Other languages might fit that description as well, and so we should take this 
anecdote of "many people consider broken" with a grain of salt.

I personally have written more than 50,000 lines of shell for the FreeBSD base 
OS -- all utilizing /bin/sh


> 
>> PS1 should have a reasonable default. If that default is not reasonable, 
>> then we should change the C code.
>> 
>> Maybe I see things differently, but I'd rather see PS1 default change so no 
>> profile/shrc change is necessary.
> 
> Thank you, that's actually a valid argument.  I believe that's also what
> bash does.  It would be more intrusive, though, and I kind of don't like
> the idea of hardcoding things that can easily be dealt with with in a more
> "high-level" way.
> 
>> I prefer that sh, in its default configuration, not attempt to read 
>> $HOME/.shrc, for security reasons.
> 
> Can you elaborate?  It already reads $HOME/.profile; how is $HOME/.shrc
> different?

If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the 
importance of "one place to exploit versus two."

(situation)

Say you've been running FreeBSD for 20 years (it turned 25 years old last year, 
so this is not only possible, but plausible).
You know all the areas of interest where an attacker could inject code.
You take care to lock down each one.
But come to your surprise ...

(hypothetical)

6 months after you upgraded from 11.2 to the latest 12.x, you find that you 
didn't take into account that $HOME/.profile (which you perhaps locked down 
with a "chflags" command) now branches out to a new file which you've never 
taken steps to lock down, keep an eye on, or audit (e.g., by using DTrace 
remote-logging, tripwire, or other means). You only found out 6 months after 
the upgrade because someone exploited it. At that point, the security event has 
already occurred.

When I worked at "the banks" shit like this was always on our radar. Changes 
like this were often cited for the reason why one bank moved to BoKs for 
security.


> 
>> Further, it is documented that the contents of ENV may be ignored in 
>> privileged mode, negating these changes.
> 
> True - so if someone finds the idea of having a suid shell useful - from
> what I undestand that's what the privileged mode boils down to - this
> change will be a no-op.  I seriously hope nobody does, though.
> 


Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Edward Napierala
On 0125T1441, Devin Teske wrote:
> 
> 
> > On Jan 25, 2019, at 1:37 PM, Edward Napierala  wrote:
> > 
> > pt., 25 sty 2019 o 19:57 Rodney W. Grimes
> > mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
> > napisał(a):
> >> 
> >>> Author: trasz
> >>> Date: Fri Jan 25 17:09:26 2019
> >>> New Revision: 343440
> >>> URL: https://svnweb.freebsd.org/changeset/base/343440
> >>> 
> >>> Log:
> >>>  Comment out the default sh(1) aliases for root, introduced in r343416.
> >>>  The rest of this stuff is still to be discussed, but I think at this
> >>>  point we have the agreement that the aliases should go.
> >>> 
> >>>  MFC after:  2 weeks
> >>>  Sponsored by:   DARPA, AFRL
> >> 
> >> Please just revert this and the prior commit out, and when
> >> the path forward is clear commit it.  I would not want any of this
> >> merged to 12/ or 11/ until the time that it is all settled.
> > 
> > Oops, my bad - neither this nor the previous commit is supposed
> > to be MFC-ed; the "2 weeks" above comes from my default Subversion
> > config.
> > 
> > Regarding the backoff - just a few hours ago you said you don't have
> > any problem with this, except for aliases and the default ENV.  The
> > aliases problem has been addressed, and you hadn't yet responded
> > to my explanations regarding the ENV.  Another committer asked for
> > backoff, because "sh is not an interactive shell", while in fact sh(1)
> > is FreeBSD's default interactive shell except for root.  Finally, there's
> > one person who asked for revert, but without giving any reasons
> > whatsoever.
> > 
> > So far nobody had proposed any scenario where this would break
> > anything, or even affect existing users.  It seems like a typical bikeshed
> > situation.
> 
> It is not clear to me after reading r343416 and D18872 what this change is 
> trying to solve.

The idea is to make it easy to replace the default root shell - which
many people consider broken, due to not supporting basic shell syntax - with
something that actually works.

> PS1 should have a reasonable default. If that default is not reasonable, then 
> we should change the C code.
> 
> Maybe I see things differently, but I'd rather see PS1 default change so no 
> profile/shrc change is necessary.

Thank you, that's actually a valid argument.  I believe that's also what
bash does.  It would be more intrusive, though, and I kind of don't like
the idea of hardcoding things that can easily be dealt with with in a more
"high-level" way.

> I prefer that sh, in its default configuration, not attempt to read 
> $HOME/.shrc, for security reasons.

Can you elaborate?  It already reads $HOME/.profile; how is $HOME/.shrc
different?

> Further, it is documented that the contents of ENV may be ignored in 
> privileged mode, negating these changes.

True - so if someone finds the idea of having a suid shell useful - from
what I undestand that's what the privileged mode boils down to - this
change will be a no-op.  I seriously hope nobody does, though.

> If you wanted your new shiny default PS1 to actually have an effect in all 
> modes (including privileged mode, where you probably want it), you would have 
> put it in /etc/profile and not in a file that is wholly ignored by some modes 
> (e.g., privileged mode).
> So the solution is not even the right one for the desired result.

I would, if only it didn't break zsh, and perhaps others.  The
problem here is that zsh uses different syntax for PS1, _and_
it also parses /etc/profile.

And no, I don't care at all about privileged mode, I can't imagine
a situation when using it would be a good idea.

___
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: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 2:41 PM, Devin Teske  wrote:
> 
> 
> 
>> On Jan 25, 2019, at 1:37 PM, Edward Napierala > > wrote:
>> 
>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
>> napisał(a):
>>> 
 Author: trasz
 Date: Fri Jan 25 17:09:26 2019
 New Revision: 343440
 URL: https://svnweb.freebsd.org/changeset/base/343440 
 
 
 Log:
  Comment out the default sh(1) aliases for root, introduced in r343416.
  The rest of this stuff is still to be discussed, but I think at this
  point we have the agreement that the aliases should go.
 
  MFC after:  2 weeks
  Sponsored by:   DARPA, AFRL
>>> 
>>> Please just revert this and the prior commit out, and when
>>> the path forward is clear commit it.  I would not want any of this
>>> merged to 12/ or 11/ until the time that it is all settled.
>> 
>> Oops, my bad - neither this nor the previous commit is supposed
>> to be MFC-ed; the "2 weeks" above comes from my default Subversion
>> config.
>> 
>> Regarding the backoff - just a few hours ago you said you don't have
>> any problem with this, except for aliases and the default ENV.  The
>> aliases problem has been addressed, and you hadn't yet responded
>> to my explanations regarding the ENV.  Another committer asked for
>> backoff, because "sh is not an interactive shell", while in fact sh(1)
>> is FreeBSD's default interactive shell except for root.  Finally, there's
>> one person who asked for revert, but without giving any reasons
>> whatsoever.
>> 
>> So far nobody had proposed any scenario where this would break
>> anything, or even affect existing users.  It seems like a typical bikeshed
>> situation.
> 
> It is not clear to me after reading r343416 and D18872 what this change is 
> trying to solve.
> 
> PS1 should have a reasonable default. If that default is not reasonable, then 
> we should change the C code.
> 
> Maybe I see things differently, but I'd rather see PS1 default change so no 
> profile/shrc change is necessary.
> 
> I prefer that sh, in its default configuration, not attempt to read 
> $HOME/.shrc, for security reasons.
> 
> Further, it is documented that the contents of ENV may be ignored in 
> privileged mode, negating these changes.
> 
> If you wanted your new shiny default PS1 to actually have an effect in all 
> modes (including privileged mode, where you probably want it), you would have 
> put it in /etc/profile and not in a file that is wholly ignored by some modes 
> (e.g., privileged mode).
> 
> So the solution is not even the right one for the desired result.

I would also like to add, that the current default for PS1 is static for a 
reason.

Long ago, people used to write things in TCL/Expect. If PS1 is not static, you 
either have to override it or account for the variance (# for root, $ for 
others).

This is an important distinction specifically because TCL/Expect is used in the 
control of interactive shells.
-- 
Devin
___
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: r343460 - stable/11/lib/libedit

2019-01-25 Thread Jilles Tjoelker
Author: jilles
Date: Fri Jan 25 22:52:49 2019
New Revision: 343460
URL: https://svnweb.freebsd.org/changeset/base/343460

Log:
  MFC r343105: libedit: Avoid out of bounds read in 'bind' command
  
  This is CVS revision 1.31 from NetBSD lib/libedit/chartype.c:
  Make sure that argv is NULL terminated since functions like tty_stty rely
  on it to be so (Gerry Swinslow)
  
  This broke when the wide-character support was enabled in libedit. The
  conversion from multibyte to wide-character did not supply the apparently
  expected terminating NULL in the new argv array.
  
  PR:   233343

Modified:
  stable/11/lib/libedit/chartype.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libedit/chartype.c
==
--- stable/11/lib/libedit/chartype.cFri Jan 25 22:22:29 2019
(r343459)
+++ stable/11/lib/libedit/chartype.cFri Jan 25 22:52:49 2019
(r343460)
@@ -157,7 +157,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer
if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1)
return NULL;
 
-   wargv = el_malloc((size_t)argc * sizeof(*wargv));
+   wargv = el_malloc((size_t)(argc + 1) * sizeof(*wargv));
 
for (i = 0, p = conv->wbuff; i < argc; ++i) {
if (!argv[i]) {   /* don't pass null pointers to mbstowcs */
@@ -175,6 +175,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer
bufspace -= (size_t)bytes;
p += bytes;
}
+   wargv[i] = NULL;
 
return wargv;
 }
___
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: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 2:47 PM, Devin Teske  wrote:
> 
> 
> 
>> On Jan 25, 2019, at 2:41 PM, Devin Teske > > wrote:
>> 
>> 
>> 
>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala >> > wrote:
>>> 
>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>>> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
>>> napisał(a):
 
> Author: trasz
> Date: Fri Jan 25 17:09:26 2019
> New Revision: 343440
> URL: https://svnweb.freebsd.org/changeset/base/343440 
> 
> 
> Log:
>  Comment out the default sh(1) aliases for root, introduced in r343416.
>  The rest of this stuff is still to be discussed, but I think at this
>  point we have the agreement that the aliases should go.
> 
>  MFC after:  2 weeks
>  Sponsored by:   DARPA, AFRL
 
 Please just revert this and the prior commit out, and when
 the path forward is clear commit it.  I would not want any of this
 merged to 12/ or 11/ until the time that it is all settled.
>>> 
>>> Oops, my bad - neither this nor the previous commit is supposed
>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion
>>> config.
>>> 
>>> Regarding the backoff - just a few hours ago you said you don't have
>>> any problem with this, except for aliases and the default ENV.  The
>>> aliases problem has been addressed, and you hadn't yet responded
>>> to my explanations regarding the ENV.  Another committer asked for
>>> backoff, because "sh is not an interactive shell", while in fact sh(1)
>>> is FreeBSD's default interactive shell except for root.  Finally, there's
>>> one person who asked for revert, but without giving any reasons
>>> whatsoever.
>>> 
>>> So far nobody had proposed any scenario where this would break
>>> anything, or even affect existing users.  It seems like a typical bikeshed
>>> situation.
>> 
>> It is not clear to me after reading r343416 and D18872 what this change is 
>> trying to solve.
>> 
>> PS1 should have a reasonable default. If that default is not reasonable, 
>> then we should change the C code.
>> 
>> Maybe I see things differently, but I'd rather see PS1 default change so no 
>> profile/shrc change is necessary.
>> 
>> I prefer that sh, in its default configuration, not attempt to read 
>> $HOME/.shrc, for security reasons.
>> 
>> Further, it is documented that the contents of ENV may be ignored in 
>> privileged mode, negating these changes.
>> 
>> If you wanted your new shiny default PS1 to actually have an effect in all 
>> modes (including privileged mode, where you probably want it), you would 
>> have put it in /etc/profile and not in a file that is wholly ignored by some 
>> modes (e.g., privileged mode).
>> 
>> So the solution is not even the right one for the desired result.
> 
> I would also like to add, that the current default for PS1 is static for a 
> reason.
> 
> Long ago, people used to write things in TCL/Expect. If PS1 is not static, 
> you either have to override it or account for the variance (# for root, $ for 
> others).
> 
> This is an important distinction specifically because TCL/Expect is used in 
> the control of interactive shells.

And an aside:

I still program in TCL/Expect. I have been known to customize PS2 and PS4.

I may have neglected to give reasons previously, but that's because I was in a 
meeting and unable to expand on the particular technical intricacies:

1. The relationship default PS1, PS2, and PS4 have with software like TCL/Expect
2. The fact that ENV is wholly ignored in privileged mode
3. The fact that introducing ~/.shrc as a runnable file for interactive sh 
globally and by-default is something that should be run by secteam
-- 
Devin

___
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: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 1:37 PM, Edward Napierala  wrote:
> 
> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
> napisał(a):
>> 
>>> Author: trasz
>>> Date: Fri Jan 25 17:09:26 2019
>>> New Revision: 343440
>>> URL: https://svnweb.freebsd.org/changeset/base/343440
>>> 
>>> Log:
>>>  Comment out the default sh(1) aliases for root, introduced in r343416.
>>>  The rest of this stuff is still to be discussed, but I think at this
>>>  point we have the agreement that the aliases should go.
>>> 
>>>  MFC after:  2 weeks
>>>  Sponsored by:   DARPA, AFRL
>> 
>> Please just revert this and the prior commit out, and when
>> the path forward is clear commit it.  I would not want any of this
>> merged to 12/ or 11/ until the time that it is all settled.
> 
> Oops, my bad - neither this nor the previous commit is supposed
> to be MFC-ed; the "2 weeks" above comes from my default Subversion
> config.
> 
> Regarding the backoff - just a few hours ago you said you don't have
> any problem with this, except for aliases and the default ENV.  The
> aliases problem has been addressed, and you hadn't yet responded
> to my explanations regarding the ENV.  Another committer asked for
> backoff, because "sh is not an interactive shell", while in fact sh(1)
> is FreeBSD's default interactive shell except for root.  Finally, there's
> one person who asked for revert, but without giving any reasons
> whatsoever.
> 
> So far nobody had proposed any scenario where this would break
> anything, or even affect existing users.  It seems like a typical bikeshed
> situation.

It is not clear to me after reading r343416 and D18872 what this change is 
trying to solve.

PS1 should have a reasonable default. If that default is not reasonable, then 
we should change the C code.

Maybe I see things differently, but I'd rather see PS1 default change so no 
profile/shrc change is necessary.

I prefer that sh, in its default configuration, not attempt to read 
$HOME/.shrc, for security reasons.

Further, it is documented that the contents of ENV may be ignored in privileged 
mode, negating these changes.

If you wanted your new shiny default PS1 to actually have an effect in all 
modes (including privileged mode, where you probably want it), you would have 
put it in /etc/profile and not in a file that is wholly ignored by some modes 
(e.g., privileged mode).

So the solution is not even the right one for the desired result.
-- 
Devin


___
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: r343440 - head/bin/sh

2019-01-25 Thread Rodney W. Grimes
> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>  napisa?(a):
> >
> > > Author: trasz
> > > Date: Fri Jan 25 17:09:26 2019
> > > New Revision: 343440
> > > URL: https://svnweb.freebsd.org/changeset/base/343440
> > >
> > > Log:
> > >   Comment out the default sh(1) aliases for root, introduced in r343416.
> > >   The rest of this stuff is still to be discussed, but I think at this
> > >   point we have the agreement that the aliases should go.
> > >
> > >   MFC after:  2 weeks
> > >   Sponsored by:   DARPA, AFRL
> >
> > Please just revert this and the prior commit out, and when
> > the path forward is clear commit it.  I would not want any of this
> > merged to 12/ or 11/ until the time that it is all settled.
> 
> Oops, my bad - neither this nor the previous commit is supposed
> to be MFC-ed; the "2 weeks" above comes from my default Subversion
> config.
> 
> Regarding the backoff - just a few hours ago you said you don't have
> any problem with this, except for aliases and the default ENV.  The
> aliases problem has been addressed, and you hadn't yet responded
> to my explanations regarding the ENV.  Another committer asked for
> backoff, because "sh is not an interactive shell", while in fact sh(1)
> is FreeBSD's default interactive shell except for root.  Finally, there's
> one person who asked for revert, but without giving any reasons
> whatsoever.
> 
> So far nobody had proposed any scenario where this would break
> anything, or even affect existing users.  It seems like a typical bikeshed
> situation.

Within hours of your initial commit you had myself, ian and cy all in
opposition to this change , devin asked for a revert, first privately to me
which I encouraged a public posting of.
Thats four people who want this removed.
I have now asked publically for a revert.
Thats 2 public request for revert.
The hat was only about the MFC statement which you have retracted.

Just back it out and we can come to a better solution.
Especially dependent on the outcome of Bapts mksh proposal.

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


svn commit: r343459 - head/sys/fs/ext2fs

2019-01-25 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Jan 25 22:22:29 2019
New Revision: 343459
URL: https://svnweb.freebsd.org/changeset/base/343459

Log:
  ext2fs: Add some extra consistency checks for the superblock.
  
  Maliciously formed, or badly corrupted, filesystems can cause kernel
  panics.  In general, such acts of foot-shooting can only be accomplished
  by root, but in a world with VM images that is  moving towards automated
  mounts it is important to have some form of prevention.
  
  Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert
  of Fraunhofer FKIE.
  Incidentaly this should also fix a memory corruption issue reported by
  Dr Silvio Cesare of InfoSect.
  
  Huge thanks to all reseachers for making us aware of the issue.
  
  admbug:   872, 891
  Reviewed by:  fsu
  Obtained from:NetBSD (with minor changes)
  MFC after:3 days

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==
--- head/sys/fs/ext2fs/ext2_vfsops.cFri Jan 25 21:38:28 2019
(r343458)
+++ head/sys/fs/ext2fs/ext2_vfsops.cFri Jan 25 22:22:29 2019
(r343459)
@@ -416,7 +416,16 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es
es->e3fs_desc_size);
return (EINVAL);
}
+   /* Check for block size = 1K|2K|4K */
+   if (es->e2fs_log_bsize > 2) {
+   printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize);
+   return (EINVAL);
+   }
/* Check for group size */
+   if (fs->e2fs_bpg == 0) {
+   printf("ext2fs: zero blocks per group\n");
+   return (EINVAL);
+   }
if (fs->e2fs_bpg != fs->e2fs_bsize * 8) {
printf("ext2fs: non-standard group size unsupported %d\n",
fs->e2fs_bpg);
@@ -424,7 +433,21 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es
}
 
fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs);
+   if (fs->e2fs_ipg == 0) {
+   printf("ext2fs: zero inodes per group\n");
+   return (EINVAL);
+   }
fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb;
+   /* Check for block consistency */
+   if (es->e2fs_first_dblock >= fs->e2fs_bcount) {
+   printf("ext2fs: invalid first data block\n");
+   return (EINVAL);
+   }
+   if (fs->e2fs_rbcount > fs->e2fs_bcount ||
+   fs->e2fs_fbcount > fs->e2fs_bcount) {
+   printf("ext2fs: invalid block count\n");
+   return (EINVAL);
+   }
/* s_resuid / s_resgid ? */
fs->e2fs_gcount = howmany(fs->e2fs_bcount - es->e2fs_first_dblock,
EXT2_BLOCKS_PER_GROUP(fs));
___
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: r343458 - head/sys/dev/bhnd/cores/pmu

2019-01-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Jan 25 21:38:28 2019
New Revision: 343458
URL: https://svnweb.freebsd.org/changeset/base/343458

Log:
  Fix format/arg mismatch
  
  USe correct format for int arguments
  
  PR:   229549
  Submitted by: David Binderman 
  MFC after:1 week

Modified:
  head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c

Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c
==
--- head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Fri Jan 25 21:24:09 2019
(r343457)
+++ head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Fri Jan 25 21:38:28 2019
(r343458)
@@ -1036,7 +1036,7 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc *sc)
return (error);
}
 
-   PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_updn_timer\n",
+   PMU_DEBUG(sc, "Applying %s=%d to rsrc %d res_updn_timer\n",
name, val, i);
 
BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i);
@@ -,7 +,7 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc *sc)
return (error);
}
 
-   PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_dep_mask\n", name,
+   PMU_DEBUG(sc, "Applying %s=%d to rsrc %d res_dep_mask\n", name,
val, i);
 
BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Edward Napierala
pt., 25 sty 2019 o 19:57 Rodney W. Grimes
 napisał(a):
>
> > Author: trasz
> > Date: Fri Jan 25 17:09:26 2019
> > New Revision: 343440
> > URL: https://svnweb.freebsd.org/changeset/base/343440
> >
> > Log:
> >   Comment out the default sh(1) aliases for root, introduced in r343416.
> >   The rest of this stuff is still to be discussed, but I think at this
> >   point we have the agreement that the aliases should go.
> >
> >   MFC after:  2 weeks
> >   Sponsored by:   DARPA, AFRL
>
> Please just revert this and the prior commit out, and when
> the path forward is clear commit it.  I would not want any of this
> merged to 12/ or 11/ until the time that it is all settled.

Oops, my bad - neither this nor the previous commit is supposed
to be MFC-ed; the "2 weeks" above comes from my default Subversion
config.

Regarding the backoff - just a few hours ago you said you don't have
any problem with this, except for aliases and the default ENV.  The
aliases problem has been addressed, and you hadn't yet responded
to my explanations regarding the ENV.  Another committer asked for
backoff, because "sh is not an interactive shell", while in fact sh(1)
is FreeBSD's default interactive shell except for root.  Finally, there's
one person who asked for revert, but without giving any reasons
whatsoever.

So far nobody had proposed any scenario where this would break
anything, or even affect existing users.  It seems like a typical bikeshed
situation.
___
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: r343457 - in head/sys: kern sys

2019-01-25 Thread Kirk McKusick
Author: mckusick
Date: Fri Jan 25 21:24:09 2019
New Revision: 343457
URL: https://svnweb.freebsd.org/changeset/base/343457

Log:
  Add printing of b_ioflags to DDB `show buffer' command.
  
  Sponsored by: Netflix

Modified:
  head/sys/kern/vfs_bio.c
  head/sys/sys/bio.h

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Fri Jan 25 20:54:18 2019(r343456)
+++ head/sys/kern/vfs_bio.c Fri Jan 25 21:24:09 2019(r343457)
@@ -5329,9 +5329,12 @@ DB_SHOW_COMMAND(buffer, db_show_buffer)
}
 
db_printf("buf at %p\n", bp);
-   db_printf("b_flags = 0x%b, b_xflags=0x%b, b_vflags=0x%b\n",
-   (u_int)bp->b_flags, PRINT_BUF_FLAGS, (u_int)bp->b_xflags,
-   PRINT_BUF_XFLAGS, (u_int)bp->b_vflags, PRINT_BUF_VFLAGS);
+   db_printf("b_flags = 0x%b, b_xflags=0x%b\n",
+   (u_int)bp->b_flags, PRINT_BUF_FLAGS,
+   (u_int)bp->b_xflags, PRINT_BUF_XFLAGS);
+   db_printf("b_vflags=0x%b b_ioflags0x%b\n",
+   (u_int)bp->b_vflags, PRINT_BUF_VFLAGS,
+   (u_int)bp->b_ioflags, PRINT_BIO_FLAGS);
db_printf(
"b_error = %d, b_bufsize = %ld, b_bcount = %ld, b_resid = %ld\n"
"b_bufobj = (%p), b_data = %p, b_blkno = %jd, b_lblkno = %jd, "

Modified: head/sys/sys/bio.h
==
--- head/sys/sys/bio.h  Fri Jan 25 20:54:18 2019(r343456)
+++ head/sys/sys/bio.h  Fri Jan 25 21:24:09 2019(r343457)
@@ -67,6 +67,9 @@
 #defineBIO_TRANSIENT_MAPPING   0x20
 #defineBIO_VLIST   0x40
 
+#definePRINT_BIO_FLAGS "\20\7vlist\6transient_mapping\5unmapped" \
+   "\4ordered\3onqueue\2done\1error"
+
 #ifdef _KERNEL
 struct disk;
 struct bio;
___
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: r343456 - head/sys/dev/cxgbe

2019-01-25 Thread John Baldwin
Author: jhb
Date: Fri Jan 25 20:54:18 2019
New Revision: 343456
URL: https://svnweb.freebsd.org/changeset/base/343456

Log:
  Fix a few more places to handle ofld tx queues for RATELIMIT.
  
  - Drain offload transmit queues when RATELIMIT is enabled but
TCP_OFFLOAD is not.
  - Expose the per-VI nofldtxq and first_ofld_txq sysctls when
RATELIMIT is enabled but TCP_OFFLOAD is not.
  - Clear offload transmit queue stats as part of a 'cxgbetool clearstats'
request when RATELIMIT is enabled but TCP_OFFLOAD is not.
  
  Reviewed by:  np
  MFC after:2 weeks
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D18966

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cFri Jan 25 20:53:29 2019
(r343455)
+++ head/sys/dev/cxgbe/t4_main.cFri Jan 25 20:54:18 2019
(r343456)
@@ -5524,6 +5524,8 @@ vi_full_uninit(struct vi_info *vi)
struct sge_txq *txq;
 #ifdef TCP_OFFLOAD
struct sge_ofld_rxq *ofld_rxq;
+#endif
+#if defined(TCP_OFFLOAD) || defined(RATELIMIT)
struct sge_wrq *ofld_txq;
 #endif
 
@@ -5539,7 +5541,7 @@ vi_full_uninit(struct vi_info *vi)
quiesce_txq(sc, txq);
}
 
-#ifdef TCP_OFFLOAD
+#if defined(TCP_OFFLOAD) || defined(RATELIMIT)
for_each_ofld_txq(vi, i, ofld_txq) {
quiesce_wrq(sc, ofld_txq);
}
@@ -6327,15 +6329,9 @@ vi_sysctls(struct vi_info *vi)
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldrxq", CTLFLAG_RD,
>nofldrxq, 0,
"# of rx queues for offloaded TCP connections");
-   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldtxq", CTLFLAG_RD,
-   >nofldtxq, 0,
-   "# of tx queues for offloaded TCP connections");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_rxq",
CTLFLAG_RD, >first_ofld_rxq, 0,
"index of first TOE rx queue");
-   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_txq",
-   CTLFLAG_RD, >first_ofld_txq, 0,
-   "index of first TOE tx queue");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx_ofld",
CTLTYPE_INT | CTLFLAG_RW, vi, 0,
sysctl_holdoff_tmr_idx_ofld, "I",
@@ -6346,6 +6342,16 @@ vi_sysctls(struct vi_info *vi)
"holdoff packet counter index for TOE queues");
}
 #endif
+#if defined(TCP_OFFLOAD) || defined(RATELIMIT)
+   if (vi->nofldtxq != 0) {
+   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldtxq", CTLFLAG_RD,
+   >nofldtxq, 0,
+   "# of tx queues for TOE/ETHOFLD");
+   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_txq",
+   CTLFLAG_RD, >first_ofld_txq, 0,
+   "index of first TOE/ETHOFLD tx queue");
+   }
+#endif
 #ifdef DEV_NETMAP
if (vi->nnmrxq != 0) {
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nnmrxq", CTLFLAG_RD,
@@ -10011,7 +10017,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t 
mp_ring_reset_stats(txq->r);
}
 
-#ifdef TCP_OFFLOAD
+#if defined(TCP_OFFLOAD) || defined(RATELIMIT)
/* nothing to clear for each ofld_rxq */
 
for_each_ofld_txq(vi, i, wrq) {
___
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: r343455 - head/usr.sbin/acpi/acpidump

2019-01-25 Thread Cy Schubert
Author: cy
Date: Fri Jan 25 20:53:29 2019
New Revision: 343455
URL: https://svnweb.freebsd.org/changeset/base/343455

Log:
  Fix 32-bit buildworld broken by r343438.

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Fri Jan 25 20:24:53 2019
(r343454)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Fri Jan 25 20:53:29 2019
(r343455)
@@ -977,7 +977,7 @@ static void acpi_handle_tpm2(ACPI_TABLE_HEADER *sdp)
printf (BEGIN_COMMENT);
acpi_print_sdt(sdp);
tpm2 = (ACPI_TABLE_TPM2 *) sdp;
-   printf ("\t\tControlArea=%lx\n", tpm2->ControlAddress);
+   printf ("\t\tControlArea=%jx\n", tpm2->ControlAddress);
printf ("\t\tStartMethod=%x\n", tpm2->StartMethod); 
printf (END_COMMENT);
 }
___
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: r343454 - in stable/12/sys: netinet netinet6

2019-01-25 Thread Mark Johnston
Author: markj
Date: Fri Jan 25 20:24:53 2019
New Revision: 343454
URL: https://svnweb.freebsd.org/changeset/base/343454

Log:
  MFC r343363, r343364:
  Fix an LLE lookup race.
  
  PR:   234296

Modified:
  stable/12/sys/netinet/in.c
  stable/12/sys/netinet6/in6.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/in.c
==
--- stable/12/sys/netinet/in.c  Fri Jan 25 20:20:27 2019(r343453)
+++ stable/12/sys/netinet/in.c  Fri Jan 25 20:24:53 2019(r343454)
@@ -1378,15 +1378,13 @@ in_lltable_lookup(struct lltable *llt, u_int flags, co
IF_AFDATA_LOCK_ASSERT(llt->llt_ifp);
KASSERT(l3addr->sa_family == AF_INET,
("sin_family %d", l3addr->sa_family));
-   lle = in_lltable_find_dst(llt, sin->sin_addr);
+   KASSERT((flags & (LLE_UNLOCKED | LLE_EXCLUSIVE)) !=
+   (LLE_UNLOCKED | LLE_EXCLUSIVE),
+   ("wrong lle request flags: %#x", flags));
 
+   lle = in_lltable_find_dst(llt, sin->sin_addr);
if (lle == NULL)
return (NULL);
-
-   KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) !=
-   (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X",
-   flags));
-
if (flags & LLE_UNLOCKED)
return (lle);
 
@@ -1395,6 +1393,17 @@ in_lltable_lookup(struct lltable *llt, u_int flags, co
else
LLE_RLOCK(lle);
 
+   /*
+* If the afdata lock is not held, the LLE may have been unlinked while
+* we were blocked on the LLE lock.  Check for this case.
+*/
+   if (__predict_false((lle->la_flags & LLE_LINKED) == 0)) {
+   if (flags & LLE_EXCLUSIVE)
+   LLE_WUNLOCK(lle);
+   else
+   LLE_RUNLOCK(lle);
+   return (NULL);
+   }
return (lle);
 }
 

Modified: stable/12/sys/netinet6/in6.c
==
--- stable/12/sys/netinet6/in6.cFri Jan 25 20:20:27 2019
(r343453)
+++ stable/12/sys/netinet6/in6.cFri Jan 25 20:24:53 2019
(r343454)
@@ -2315,16 +2315,13 @@ in6_lltable_lookup(struct lltable *llt, u_int flags,
IF_AFDATA_LOCK_ASSERT(llt->llt_ifp);
KASSERT(l3addr->sa_family == AF_INET6,
("sin_family %d", l3addr->sa_family));
+   KASSERT((flags & (LLE_UNLOCKED | LLE_EXCLUSIVE)) !=
+   (LLE_UNLOCKED | LLE_EXCLUSIVE),
+   ("wrong lle request flags: %#x", flags));
 
lle = in6_lltable_find_dst(llt, >sin6_addr);
-
if (lle == NULL)
return (NULL);
-
-   KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) !=
-   (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X",
-   flags));
-
if (flags & LLE_UNLOCKED)
return (lle);
 
@@ -2332,6 +2329,18 @@ in6_lltable_lookup(struct lltable *llt, u_int flags,
LLE_WLOCK(lle);
else
LLE_RLOCK(lle);
+
+   /*
+* If the afdata lock is not held, the LLE may have been unlinked while
+* we were blocked on the LLE lock.  Check for this case.
+*/
+   if (__predict_false((lle->la_flags & LLE_LINKED) == 0)) {
+   if (flags & LLE_EXCLUSIVE)
+   LLE_WUNLOCK(lle);
+   else
+   LLE_RUNLOCK(lle);
+   return (NULL);
+   }
return (lle);
 }
 
___
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: r343453 - in head/sys/dev/usb: . quirk

2019-01-25 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 25 20:20:27 2019
New Revision: 343453
URL: https://svnweb.freebsd.org/changeset/base/343453

Log:
  Add new USB quirk.
  
  PR:   235202
  Differential Revision:https://reviews.freebsd.org/D18917
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Fri Jan 25 20:14:28 2019
(r343452)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Fri Jan 25 20:20:27 2019
(r343453)
@@ -171,6 +171,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(CORSAIR, K70_RGB, 0x, 0x, UQ_KBD_BOOTPROTO),
/* Quirk for Corsair STRAFE Gaming keyboard */
USB_QUIRK(CORSAIR, STRAFE, 0x, 0x, UQ_KBD_BOOTPROTO),
+   USB_QUIRK(CORSAIR, STRAFE2, 0x, 0x, UQ_KBD_BOOTPROTO),
/* umodem(4) device quirks */
USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA),
USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsFri Jan 25 20:14:28 2019(r343452)
+++ head/sys/dev/usb/usbdevsFri Jan 25 20:20:27 2019(r343453)
@@ -1583,7 +1583,8 @@ product COREGA FETHER_USB_TXC 0x9601  FEther USB-TXC
 product CORSAIR K600x0a60  Corsair Vengeance K60 keyboard
 product CORSAIR K700x1b09  Corsair Vengeance K70 keyboard
 product CORSAIR K70_RGB0x1b13  Corsair K70 RGB Keyboard
-product CORSAIR STRAFE 0x1b15  Cossair STRAFE Gaming keyboard
+product CORSAIR STRAFE 0x1b15  Corsair STRAFE Gaming keyboard
+product CORSAIR STRAFE20x1b44  Corsair STRAFE Gaming keyboard
 
 /* Creative products */
 product CREATIVE NOMAD_II  0x1002  Nomad II MP3 player
___
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: r343449 - in head/sbin: newfs tunefs

2019-01-25 Thread Rodney W. Grimes
> Author: mckusick
> Date: Fri Jan 25 20:07:18 2019
> New Revision: 343449
> URL: https://svnweb.freebsd.org/changeset/base/343449
> 
> Log:
>   Allow tunefs to include '_' as a legal character in label names
>   to make it consistent with newfs. Document the legality of '_'
>   in label names in both tunefs(8) and newfs(8).
>   
>   PR:   235182
>   Submitted by: dar...@dons.net.au
>   Reviewed by:  Conrad Meyer
>   MFC after:3 days
>   Sponsored by: Netflix
> 
> Modified:
>   head/sbin/newfs/newfs.8
>   head/sbin/tunefs/tunefs.8
>   head/sbin/tunefs/tunefs.c
> 
> Modified: head/sbin/newfs/newfs.8
> ==
> --- head/sbin/newfs/newfs.8   Fri Jan 25 20:02:55 2019(r343448)
> +++ head/sbin/newfs/newfs.8   Fri Jan 25 20:07:18 2019(r343449)
> @@ -89,6 +89,7 @@ See
>  for details.
>  .It Fl L Ar volname
>  Add a volume label to the new file system.
> +Legal characters are alphanumerics and underscores.
>  .It Fl N
>  Cause the file system parameters to be printed out
>  without really creating the file system.
> 
> Modified: head/sbin/tunefs/tunefs.8
> ==
> --- head/sbin/tunefs/tunefs.8 Fri Jan 25 20:02:55 2019(r343448)
> +++ head/sbin/tunefs/tunefs.8 Fri Jan 25 20:07:18 2019(r343449)
> @@ -112,6 +112,7 @@ By default
>  sets it to half of the space reserved to minfree.
>  .It Fl L Ar volname
>  Add/modify an optional file system volume label.
> +Legal characters are alphanumerics and underscores.
>  .It Fl l Cm enable | disable
>  Turn on/off MAC multilabel flag.
>  .It Fl m Ar minfree
> 
> Modified: head/sbin/tunefs/tunefs.c
> ==
> --- head/sbin/tunefs/tunefs.c Fri Jan 25 20:02:55 2019(r343448)
> +++ head/sbin/tunefs/tunefs.c Fri Jan 25 20:07:18 2019(r343449)
> @@ -189,7 +189,7 @@ main(int argc, char *argv[])
>   name = "volume label";
>   Lvalue = optarg;
>   i = -1;
> - while (isalnum(Lvalue[++i]));
> + while (isalnum(Lvalue[++i]) || Lvalue[i] == '_');
>   if (Lvalue[i] != '\0') {
>   errx(10,
>   "bad %s. Valid characters are alphanumerics.",
  
This message is now incorrect.

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


svn commit: r343452 - head/sys/mips/nlm

2019-01-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Jan 25 20:14:28 2019
New Revision: 343452
URL: https://svnweb.freebsd.org/changeset/base/343452

Log:
  [mips] Fix error condition check that always evaluates to false
  
  Use proper logical operand when checking the value of srcid
  
  PR:   200988
  Submitted by: David Binderman 
  MFC after:1 week

Modified:
  head/sys/mips/nlm/cms.c

Modified: head/sys/mips/nlm/cms.c
==
--- head/sys/mips/nlm/cms.c Fri Jan 25 20:13:28 2019(r343451)
+++ head/sys/mips/nlm/cms.c Fri Jan 25 20:14:28 2019(r343452)
@@ -204,7 +204,7 @@ xlp_handle_msg_vc(u_int vcmask, int max_msgs)
nlm_restore_flags(mflags);
if (status != 0)/*  no msg or error */
continue;
-   if (srcid < 0 && srcid >= 1024) {
+   if (srcid < 0 || srcid >= 1024) {
printf("[%s]: bad src id %d\n", __func__,
srcid);
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: r343451 - in head/sys/compat/linuxkpi/common: include/linux src

2019-01-25 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 25 20:13:28 2019
New Revision: 343451
URL: https://svnweb.freebsd.org/changeset/base/343451

Log:
  Add full support for PCI_ANY_ID when matching PCI IDs in the LinuxKPI.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h
  head/sys/compat/linuxkpi/common/src/linux_pci.c

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==
--- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Jan 25 20:10:57 
2019(r343450)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Jan 25 20:13:28 
2019(r343451)
@@ -71,7 +71,7 @@ struct pci_device_id {
 #definePCI_BASE_CLASS_BRIDGE   0x06
 #definePCI_CLASS_BRIDGE_ISA0x0601
 
-#definePCI_ANY_ID  (-1)
+#definePCI_ANY_ID  -1U
 #definePCI_VENDOR_ID_APPLE 0x106b
 #definePCI_VENDOR_ID_ASUSTEK   0x1043
 #definePCI_VENDOR_ID_ATI   0x1002

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==
--- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Jan 25 20:10:57 
2019(r343450)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Jan 25 20:13:28 
2019(r343451)
@@ -82,14 +82,21 @@ linux_pci_find(device_t dev, const struct pci_device_i
struct pci_driver *pdrv;
uint16_t vendor;
uint16_t device;
+   uint16_t subvendor;
+   uint16_t subdevice;
 
vendor = pci_get_vendor(dev);
device = pci_get_device(dev);
+   subvendor = pci_get_subvendor(dev);
+   subdevice = pci_get_subdevice(dev);
 
spin_lock(_lock);
list_for_each_entry(pdrv, _drivers, links) {
for (id = pdrv->id_table; id->vendor != 0; id++) {
-   if (vendor == id->vendor && device == id->device) {
+   if (vendor == id->vendor &&
+   (PCI_ANY_ID == id->device || device == id->device) 
&&
+   (PCI_ANY_ID == id->subvendor || subvendor == 
id->subvendor) &&
+   (PCI_ANY_ID == id->subdevice || subdevice == 
id->subdevice)) {
*idp = id;
spin_unlock(_lock);
return (pdrv);
@@ -145,8 +152,8 @@ linux_pci_attach(device_t dev)
pdev->dev.bsddev = dev;
INIT_LIST_HEAD(>dev.irqents);
pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev));
-   pdev->device = id->device;
-   pdev->vendor = id->vendor;
+   pdev->device = dinfo->cfg.device;
+   pdev->vendor = dinfo->cfg.vendor;
pdev->subsystem_vendor = dinfo->cfg.subvendor;
pdev->subsystem_device = dinfo->cfg.subdevice;
pdev->class = pci_get_class(dev);
___
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: r343450 - head/sys/mips/ingenic

2019-01-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Jan 25 20:10:57 2019
New Revision: 343450
URL: https://svnweb.freebsd.org/changeset/base/343450

Log:
  [mips] Unbreak kernel build for CI20
  
  - Include header required for boot_parse_XXX functions
  - Use boot_parse_args when parsing argc/argv style arguments
  - Remove unused function

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

Modified: head/sys/mips/ingenic/jz4780_machdep.c
==
--- head/sys/mips/ingenic/jz4780_machdep.c  Fri Jan 25 20:07:18 2019
(r343449)
+++ head/sys/mips/ingenic/jz4780_machdep.c  Fri Jan 25 20:10:57 2019
(r343450)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -173,20 +174,6 @@ mips_init(void)
 #endif
 }
 
-#ifdef FDT
-static void
-_parse_bootargs(char *cmdline)
-{
-   char *v;
-
-   while ((v = strsep(, " \n")) != NULL) {
-   if (*v == '\0')
-   continue;
-   boothowto |= boot_parse_arg(v);
-   }
-}
-#endif
-
 void
 platform_start(__register_t a0,  __register_t a1,
 __register_t a2 __unused, __register_t a3 __unused)
@@ -247,7 +234,7 @@ platform_start(__register_t a0,  __register_t a1,
/* Parse cmdline from U-Boot */
argc = a0;
argv = (char **)a1;
-   boothowto |= boot_parse_cmdline(argc, argv);
+   boothowto |= boot_parse_args(argc, argv);
 
mips_init();
 }
___
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: r343449 - in head/sbin: newfs tunefs

2019-01-25 Thread Kirk McKusick
Author: mckusick
Date: Fri Jan 25 20:07:18 2019
New Revision: 343449
URL: https://svnweb.freebsd.org/changeset/base/343449

Log:
  Allow tunefs to include '_' as a legal character in label names
  to make it consistent with newfs. Document the legality of '_'
  in label names in both tunefs(8) and newfs(8).
  
  PR:   235182
  Submitted by: dar...@dons.net.au
  Reviewed by:  Conrad Meyer
  MFC after:3 days
  Sponsored by: Netflix

Modified:
  head/sbin/newfs/newfs.8
  head/sbin/tunefs/tunefs.8
  head/sbin/tunefs/tunefs.c

Modified: head/sbin/newfs/newfs.8
==
--- head/sbin/newfs/newfs.8 Fri Jan 25 20:02:55 2019(r343448)
+++ head/sbin/newfs/newfs.8 Fri Jan 25 20:07:18 2019(r343449)
@@ -89,6 +89,7 @@ See
 for details.
 .It Fl L Ar volname
 Add a volume label to the new file system.
+Legal characters are alphanumerics and underscores.
 .It Fl N
 Cause the file system parameters to be printed out
 without really creating the file system.

Modified: head/sbin/tunefs/tunefs.8
==
--- head/sbin/tunefs/tunefs.8   Fri Jan 25 20:02:55 2019(r343448)
+++ head/sbin/tunefs/tunefs.8   Fri Jan 25 20:07:18 2019(r343449)
@@ -112,6 +112,7 @@ By default
 sets it to half of the space reserved to minfree.
 .It Fl L Ar volname
 Add/modify an optional file system volume label.
+Legal characters are alphanumerics and underscores.
 .It Fl l Cm enable | disable
 Turn on/off MAC multilabel flag.
 .It Fl m Ar minfree

Modified: head/sbin/tunefs/tunefs.c
==
--- head/sbin/tunefs/tunefs.c   Fri Jan 25 20:02:55 2019(r343448)
+++ head/sbin/tunefs/tunefs.c   Fri Jan 25 20:07:18 2019(r343449)
@@ -189,7 +189,7 @@ main(int argc, char *argv[])
name = "volume label";
Lvalue = optarg;
i = -1;
-   while (isalnum(Lvalue[++i]));
+   while (isalnum(Lvalue[++i]) || Lvalue[i] == '_');
if (Lvalue[i] != '\0') {
errx(10,
"bad %s. Valid characters are alphanumerics.",
___
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: r343448 - head/sys/mips/ingenic

2019-01-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Jan 25 20:02:55 2019
New Revision: 343448
URL: https://svnweb.freebsd.org/changeset/base/343448

Log:
  [mips] Fix counter mask in jz4780 timer driver
  
  Fix dublicate value in what is apparent copypaste mistake. The last value
  in mask is supposed to be for counter 7, not counter 3.
  
  PR:   229790
  Submitted by: David Binderman 
  MFC after:1 week

Modified:
  head/sys/mips/ingenic/jz4780_timer.c

Modified: head/sys/mips/ingenic/jz4780_timer.c
==
--- head/sys/mips/ingenic/jz4780_timer.cFri Jan 25 20:00:59 2019
(r343447)
+++ head/sys/mips/ingenic/jz4780_timer.cFri Jan 25 20:02:55 2019
(r343448)
@@ -185,7 +185,7 @@ jz4780_timer_attach(device_t dev)
CSR_WRITE_4(sc, JZ_TC_TECR, TESR_OST);
/* Stop all other channels as well */
CSR_WRITE_4(sc, JZ_TC_TECR, TESR_TCST0 | TESR_TCST1 | TESR_TCST2 |
-   TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST3);
+   TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST7);
/* Clear detect mask flags */
CSR_WRITE_4(sc, JZ_TC_TFCR, 0x);
/* Mask all interrupts */
___
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: r343447 - stable/11/sys/dev/nvd

2019-01-25 Thread Alexander Motin
Author: mav
Date: Fri Jan 25 20:00:59 2019
New Revision: 343447
URL: https://svnweb.freebsd.org/changeset/base/343447

Log:
  MFC r342557, r342559: Reimplement nvd(4) detach handling.
  
  Previous code typically crashed in case of NVMe device unplug or even clean
  detach while some I/Os are still in flight.  To fix this the new code calls
  disk_gone() and waits for confirmation of all references gone before calling
  disk_destroy(), freeing other resources and allowing controller detach.
  
  While there, fix disk lists locking and reimplement unit numbers assignment.

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

Modified: stable/11/sys/dev/nvd/nvd.c
==
--- stable/11/sys/dev/nvd/nvd.c Fri Jan 25 19:58:56 2019(r343446)
+++ stable/11/sys/dev/nvd/nvd.c Fri Jan 25 20:00:59 2019(r343447)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (C) 2012-2016 Intel Corporation
  * All rights reserved.
+ * Copyright (C) 2018 Alexander Motin 
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,9 +33,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -44,15 +47,16 @@ __FBSDID("$FreeBSD$");
 #define NVD_STR"nvd"
 
 struct nvd_disk;
+struct nvd_controller;
 
 static disk_ioctl_t nvd_ioctl;
 static disk_strategy_t nvd_strategy;
 static dumper_t nvd_dump;
 
 static void nvd_done(void *arg, const struct nvme_completion *cpl);
+static void nvd_gone(struct nvd_disk *ndisk);
 
 static void *nvd_new_disk(struct nvme_namespace *ns, void *ctrlr);
-static void destroy_geom_disk(struct nvd_disk *ndisk);
 
 static void *nvd_new_controller(struct nvme_controller *ctrlr);
 static void nvd_controller_fail(void *ctrlr);
@@ -65,6 +69,7 @@ MALLOC_DEFINE(M_NVD, "nvd", "nvd(4) allocations");
 struct nvme_consumer *consumer_handle;
 
 struct nvd_disk {
+   struct nvd_controller   *ctrlr;
 
struct bio_queue_head   bioq;
struct task bioqtask;
@@ -76,6 +81,7 @@ struct nvd_disk {
 
uint32_tcur_depth;
uint32_tordered_in_flight;
+   u_int   unit;
 
TAILQ_ENTRY(nvd_disk)   global_tailq;
TAILQ_ENTRY(nvd_disk)   ctrlr_tailq;
@@ -87,6 +93,7 @@ struct nvd_controller {
TAILQ_HEAD(, nvd_disk)  disk_head;
 };
 
+static struct mtx  nvd_lock;
 static TAILQ_HEAD(, nvd_controller)ctrlr_head;
 static TAILQ_HEAD(disk_list, nvd_disk) disk_head;
 
@@ -137,6 +144,7 @@ nvd_load()
if (!nvme_use_nvd)
return 0;
 
+   mtx_init(_lock, "nvd_lock", NULL, MTX_DEF);
TAILQ_INIT(_head);
TAILQ_INIT(_head);
 
@@ -150,25 +158,25 @@ static void
 nvd_unload()
 {
struct nvd_controller   *ctrlr;
-   struct nvd_disk *disk;
+   struct nvd_disk *ndisk;
 
if (!nvme_use_nvd)
return;
 
-   while (!TAILQ_EMPTY(_head)) {
-   ctrlr = TAILQ_FIRST(_head);
+   mtx_lock(_lock);
+   while ((ctrlr = TAILQ_FIRST(_head)) != NULL) {
TAILQ_REMOVE(_head, ctrlr, tailq);
+   TAILQ_FOREACH(ndisk, >disk_head, ctrlr_tailq)
+   nvd_gone(ndisk);
+   while (!TAILQ_EMPTY(>disk_head))
+   msleep(>disk_head, _lock, 0, "nvd_unload",0);
free(ctrlr, M_NVD);
}
+   mtx_unlock(_lock);
 
-   while (!TAILQ_EMPTY(_head)) {
-   disk = TAILQ_FIRST(_head);
-   TAILQ_REMOVE(_head, disk, global_tailq);
-   destroy_geom_disk(disk);
-   free(disk, M_NVD);
-   }
-
nvme_unregister_consumer(consumer_handle);
+
+   mtx_destroy(_lock);
 }
 
 static int
@@ -218,6 +226,42 @@ nvd_strategy(struct bio *bp)
taskqueue_enqueue(ndisk->tq, >bioqtask);
 }
 
+static void
+nvd_gone(struct nvd_disk *ndisk)
+{
+   struct bio  *bp;
+
+   printf(NVD_STR"%u: detached\n", ndisk->unit);
+   mtx_lock(>bioqlock);
+   disk_gone(ndisk->disk);
+   while ((bp = bioq_takefirst(>bioq)) != NULL) {
+   if (__predict_false(bp->bio_flags & BIO_ORDERED))
+   atomic_add_int(>ordered_in_flight, -1);
+   bp->bio_error = ENXIO;
+   bp->bio_flags |= BIO_ERROR;
+   bp->bio_resid = bp->bio_bcount;
+   biodone(bp);
+   }
+   mtx_unlock(>bioqlock);
+}
+
+static void
+nvd_gonecb(struct disk *dp)
+{
+   struct nvd_disk *ndisk = (struct nvd_disk *)dp->d_drv1;
+
+   disk_destroy(ndisk->disk);
+   mtx_lock(_lock);
+   TAILQ_REMOVE(_head, ndisk, global_tailq);
+   TAILQ_REMOVE(>ctrlr->disk_head, ndisk, ctrlr_tailq);
+   if (TAILQ_EMPTY(>ctrlr->disk_head))
+   

svn commit: r343446 - head/sys/mips/mips

2019-01-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Jan 25 19:58:56 2019
New Revision: 343446
URL: https://svnweb.freebsd.org/changeset/base/343446

Log:
  [mips] remove check that is always false (unsinged < 0)
  
  cpuid and local cpu variable are unsigned so checking if value is less than 
zero
  always yields false.
  
  PR:   211088
  Submitted by: David Binderman 
  MFC after:1 week

Modified:
  head/sys/mips/mips/tlb.c

Modified: head/sys/mips/mips/tlb.c
==
--- head/sys/mips/mips/tlb.cFri Jan 25 19:56:06 2019(r343445)
+++ head/sys/mips/mips/tlb.cFri Jan 25 19:58:56 2019(r343446)
@@ -348,7 +348,7 @@ DB_SHOW_COMMAND(tlb, ddb_dump_tlb)
else
cpu = PCPU_GET(cpuid);
 
-   if (cpu < 0 || cpu >= mp_ncpus) {
+   if (cpu >= mp_ncpus) {
db_printf("Invalid CPU %u\n", cpu);
return;
}
___
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: r343440 - head/bin/sh

2019-01-25 Thread Rodney W. Grimes
> Author: trasz
> Date: Fri Jan 25 17:09:26 2019
> New Revision: 343440
> URL: https://svnweb.freebsd.org/changeset/base/343440
> 
> Log:
>   Comment out the default sh(1) aliases for root, introduced in r343416.
>   The rest of this stuff is still to be discussed, but I think at this
>   point we have the agreement that the aliases should go.
>   
>   MFC after:  2 weeks
>   Sponsored by:   DARPA, AFRL

Please just revert this and the prior commit out, and when
the path forward is clear commit it.  I would not want any of this
merged to 12/ or 11/ until the time that it is all settled.

Rod  
> Modified:
>   head/bin/sh/dot.shrc
> 
> Modified: head/bin/sh/dot.shrc
> ==
> --- head/bin/sh/dot.shrc  Fri Jan 25 17:08:28 2019(r343439)
> +++ head/bin/sh/dot.shrc  Fri Jan 25 17:09:26 2019(r343440)
> @@ -18,13 +18,13 @@
>  # set -o vi
>  
>  
> -# some useful aliases
> -alias h='fc -l'
> -alias j=jobs
> -alias m="$PAGER"
> -alias ll='ls -laFo'
> -alias l='ls -l'
> -alias g='egrep -i'
> +# # some useful aliases
> +# alias h='fc -l'
> +# alias j=jobs
> +# alias m="$PAGER"
> +# alias ll='ls -laFo'
> +# alias l='ls -l'
> +# alias g='egrep -i'
>   
>  # # be paranoid
>  # alias cp='cp -ip'
> 
> 

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


svn commit: r343445 - stable/12/sys/dev/nvd

2019-01-25 Thread Alexander Motin
Author: mav
Date: Fri Jan 25 19:56:06 2019
New Revision: 343445
URL: https://svnweb.freebsd.org/changeset/base/343445

Log:
  MFC r342557, r342559: Reimplement nvd(4) detach handling.
  
  Previous code typically crashed in case of NVMe device unplug or even clean
  detach while some I/Os are still in flight.  To fix this the new code calls
  disk_gone() and waits for confirmation of all references gone before calling
  disk_destroy(), freeing other resources and allowing controller detach.
  
  While there, fix disk lists locking and reimplement unit numbers assignment.

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

Modified: stable/12/sys/dev/nvd/nvd.c
==
--- stable/12/sys/dev/nvd/nvd.c Fri Jan 25 19:56:02 2019(r343444)
+++ stable/12/sys/dev/nvd/nvd.c Fri Jan 25 19:56:06 2019(r343445)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2012-2016 Intel Corporation
  * All rights reserved.
+ * Copyright (C) 2018 Alexander Motin 
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,9 +35,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -46,15 +49,16 @@ __FBSDID("$FreeBSD$");
 #define NVD_STR"nvd"
 
 struct nvd_disk;
+struct nvd_controller;
 
 static disk_ioctl_t nvd_ioctl;
 static disk_strategy_t nvd_strategy;
 static dumper_t nvd_dump;
 
 static void nvd_done(void *arg, const struct nvme_completion *cpl);
+static void nvd_gone(struct nvd_disk *ndisk);
 
 static void *nvd_new_disk(struct nvme_namespace *ns, void *ctrlr);
-static void destroy_geom_disk(struct nvd_disk *ndisk);
 
 static void *nvd_new_controller(struct nvme_controller *ctrlr);
 static void nvd_controller_fail(void *ctrlr);
@@ -67,6 +71,7 @@ MALLOC_DEFINE(M_NVD, "nvd", "nvd(4) allocations");
 struct nvme_consumer *consumer_handle;
 
 struct nvd_disk {
+   struct nvd_controller   *ctrlr;
 
struct bio_queue_head   bioq;
struct task bioqtask;
@@ -78,6 +83,7 @@ struct nvd_disk {
 
uint32_tcur_depth;
uint32_tordered_in_flight;
+   u_int   unit;
 
TAILQ_ENTRY(nvd_disk)   global_tailq;
TAILQ_ENTRY(nvd_disk)   ctrlr_tailq;
@@ -89,6 +95,7 @@ struct nvd_controller {
TAILQ_HEAD(, nvd_disk)  disk_head;
 };
 
+static struct mtx  nvd_lock;
 static TAILQ_HEAD(, nvd_controller)ctrlr_head;
 static TAILQ_HEAD(disk_list, nvd_disk) disk_head;
 
@@ -139,6 +146,7 @@ nvd_load()
if (!nvme_use_nvd)
return 0;
 
+   mtx_init(_lock, "nvd_lock", NULL, MTX_DEF);
TAILQ_INIT(_head);
TAILQ_INIT(_head);
 
@@ -152,25 +160,25 @@ static void
 nvd_unload()
 {
struct nvd_controller   *ctrlr;
-   struct nvd_disk *disk;
+   struct nvd_disk *ndisk;
 
if (!nvme_use_nvd)
return;
 
-   while (!TAILQ_EMPTY(_head)) {
-   ctrlr = TAILQ_FIRST(_head);
+   mtx_lock(_lock);
+   while ((ctrlr = TAILQ_FIRST(_head)) != NULL) {
TAILQ_REMOVE(_head, ctrlr, tailq);
+   TAILQ_FOREACH(ndisk, >disk_head, ctrlr_tailq)
+   nvd_gone(ndisk);
+   while (!TAILQ_EMPTY(>disk_head))
+   msleep(>disk_head, _lock, 0, "nvd_unload",0);
free(ctrlr, M_NVD);
}
+   mtx_unlock(_lock);
 
-   while (!TAILQ_EMPTY(_head)) {
-   disk = TAILQ_FIRST(_head);
-   TAILQ_REMOVE(_head, disk, global_tailq);
-   destroy_geom_disk(disk);
-   free(disk, M_NVD);
-   }
-
nvme_unregister_consumer(consumer_handle);
+
+   mtx_destroy(_lock);
 }
 
 static int
@@ -220,6 +228,42 @@ nvd_strategy(struct bio *bp)
taskqueue_enqueue(ndisk->tq, >bioqtask);
 }
 
+static void
+nvd_gone(struct nvd_disk *ndisk)
+{
+   struct bio  *bp;
+
+   printf(NVD_STR"%u: detached\n", ndisk->unit);
+   mtx_lock(>bioqlock);
+   disk_gone(ndisk->disk);
+   while ((bp = bioq_takefirst(>bioq)) != NULL) {
+   if (__predict_false(bp->bio_flags & BIO_ORDERED))
+   atomic_add_int(>ordered_in_flight, -1);
+   bp->bio_error = ENXIO;
+   bp->bio_flags |= BIO_ERROR;
+   bp->bio_resid = bp->bio_bcount;
+   biodone(bp);
+   }
+   mtx_unlock(>bioqlock);
+}
+
+static void
+nvd_gonecb(struct disk *dp)
+{
+   struct nvd_disk *ndisk = (struct nvd_disk *)dp->d_drv1;
+
+   disk_destroy(ndisk->disk);
+   mtx_lock(_lock);
+   TAILQ_REMOVE(_head, ndisk, global_tailq);
+   TAILQ_REMOVE(>ctrlr->disk_head, ndisk, ctrlr_tailq);
+   if (TAILQ_EMPTY(>ctrlr->disk_head))
+

svn commit: r343444 - head/lib/libc/sys

2019-01-25 Thread Enji Cooper
Author: ngie
Date: Fri Jan 25 19:56:02 2019
New Revision: 343444
URL: https://svnweb.freebsd.org/changeset/base/343444

Log:
  Document that `sendfile` will return an invalid value for `sbytes` if 
provided an invalid address
  
  This is meant to clarify the fact that the system call will not fail
  with -1/EFAULT, as one might expect, when reading the sendfile(2)
  manpage today.
  
  While here, pet the mandoc linter, when dealing with the section that
  describes valid values for `flags`.
  
  PR:   232210
  MFC after:2 weeks
  Approved by:  emaste (mentor)
  Reviewed by:  glebius, 0mp
  Differential Revision: https://reviews.freebsd.org/D18949

Modified:
  head/lib/libc/sys/sendfile.2

Modified: head/lib/libc/sys/sendfile.2
==
--- head/lib/libc/sys/sendfile.2Fri Jan 25 19:36:20 2019
(r343443)
+++ head/lib/libc/sys/sendfile.2Fri Jan 25 19:56:02 2019
(r343444)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 12, 2018
+.Dd January 25, 2019
 .Dt SENDFILE 2
 .Os
 .Sh NAME
@@ -104,7 +104,7 @@ variable pointed to by
 The least significant 16 bits of
 .Fa flags
 argument is a bitmap of these values:
-.Bl -tag -offset indent
+.Bl -tag -offset indent -width "SF_USER_READAHEAD"
 .It Dv SF_NODISKIO
 This flag causes
 .Nm
@@ -403,3 +403,14 @@ The
 .Fx 11
 implementation was written by
 .An Gleb Smirnoff Aq Mt gleb...@freebsd.org .
+.Sh BUGS
+The
+.Fn sendfile
+system call will not fail, i.e., return
+.Dv -1
+and set
+.Va errno
+to
+.Er EFAULT ,
+if provided an invalid address for
+.Fa sbytes .
___
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: r343443 - head/sys/mips/nlm

2019-01-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Jan 25 19:36:20 2019
New Revision: 343443
URL: https://svnweb.freebsd.org/changeset/base/343443

Log:
  [mips] remove dublicate values in enable mask in nlm_usb_intr_en
  
  PR:   230572
  Submitted by: David Binderman 
  MFC after:1 week

Modified:
  head/sys/mips/nlm/usb_init.c

Modified: head/sys/mips/nlm/usb_init.c
==
--- head/sys/mips/nlm/usb_init.cFri Jan 25 18:48:20 2019
(r343442)
+++ head/sys/mips/nlm/usb_init.cFri Jan 25 19:36:20 2019
(r343443)
@@ -52,8 +52,7 @@ nlm_usb_intr_en(int node, int port)
port_addr = nlm_get_usb_regbase(node, port);
val = nlm_read_usb_reg(port_addr, USB_INT_EN);
val = USB_CTRL_INTERRUPT_EN  | USB_OHCI_INTERRUPT_EN |
-   USB_OHCI_INTERRUPT1_EN | USB_CTRL_INTERRUPT_EN  |
-   USB_OHCI_INTERRUPT_EN | USB_OHCI_INTERRUPT2_EN;
+   USB_OHCI_INTERRUPT1_EN | USB_OHCI_INTERRUPT2_EN;
 nlm_write_usb_reg(port_addr, USB_INT_EN, val);
 }
 
___
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: r343442 - in head: contrib/netbsd-tests/lib/libm lib/msun/tests

2019-01-25 Thread Li-Wen Hsu
Author: lwhsu
Date: Fri Jan 25 18:48:20 2019
New Revision: 343442
URL: https://svnweb.freebsd.org/changeset/base/343442

Log:
  Temporarily mark lib.msun.{cbrt_test.cbrtl_powl,trig_test.reduction}
  expected failure after clang700-import merge
  
  PR:   234040
  Reviewed by:  ngie, markj
  Approved by:  markj (mentor)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D18938

Modified:
  head/contrib/netbsd-tests/lib/libm/t_cbrt.c
  head/lib/msun/tests/trig_test.c

Modified: head/contrib/netbsd-tests/lib/libm/t_cbrt.c
==
--- head/contrib/netbsd-tests/lib/libm/t_cbrt.c Fri Jan 25 18:30:12 2019
(r343441)
+++ head/contrib/netbsd-tests/lib/libm/t_cbrt.c Fri Jan 25 18:48:20 2019
(r343442)
@@ -268,6 +268,10 @@ ATF_TC_BODY(cbrtl_powl, tc)
long double y, z;
size_t i;
 
+#if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7
+   atf_tc_expect_fail("test fails with clang 7+ - bug 234040");
+#endif
+
for (i = 0; i < __arraycount(x); i++) {
 
y = cbrtl(x[i]);

Modified: head/lib/msun/tests/trig_test.c
==
--- head/lib/msun/tests/trig_test.c Fri Jan 25 18:30:12 2019
(r343441)
+++ head/lib/msun/tests/trig_test.c Fri Jan 25 18:48:20 2019
(r343442)
@@ -160,6 +160,10 @@ ATF_TC_BODY(reduction, tc)
 
unsigned i;
 
+#if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7
+   atf_tc_expect_fail("test fails with clang 7+ - bug 234040");
+#endif
+
for (i = 0; i < nitems(f_pi_odd); i++) {
ATF_CHECK(fabs(sinf(f_pi_odd[i])) < FLT_EPSILON);
ATF_CHECK(cosf(f_pi_odd[i]) == -1.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"


Re: svn commit: r343416 - head/bin/sh

2019-01-25 Thread Edward Tomasz Napierała
On 0125T1813, Alexey Dokuchaev wrote:
> On Fri, Jan 25, 2019 at 06:02:58AM +, Edward Napierala wrote:
> > The aliases are gone, let's continue on the remaining bits below.
> 
> They are not gone, they were commented out; also, bogus double linefeeds
> are not gone.

Yeah, I've matched the existing comment style in that file.

> But most importantly, this whole file is useless and IMHO
> should just be removed.  /bin/sh is not supposed to be one's interactive
> shell.

Of course it is an interactive shell.  We've been using it as the
default interactive shell for non-root accounts since... ages.

> > It is alien, because it's different from their experience
> > from other systems they are used to.
> 
> This argument does not really hold because /bin/sh is not... see above.
> 
> > It doesn't affect existing installs.  It doesn't affect people
> > who run the default root shell (tcsh), nor folks who use shells
> 
> AFAICT default root shell is /bin/csh, not tcsh. ;-)  But that also

Our csh _is_ tcsh.

> means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who
> change the root shell should either pick another interactive shell,
> or if they want /bin/sh be ready to deal with sanitary environment.

See above.

> > And for folks who do have their own tree with their preferred
> > /root/.shrc to "make distribution" from, it should actually make
> > their diff to upstream smaller.
> 
> I don't like extra files, esp. configuration files that look like they
> are for interactive shell while our /bin/sh is in fact not.  This is
> confusing, and FreeBSD is not supposed to be confusing.

Again, sh(1) is an interactive shell.

> > It is a syntax problem:
> > 
> > trasz@v2:~ % while :; do date; sleep 1; done
> > while: Expression Syntax.
> > do: Command not found.
> > done: Command not found.
> 
> Are you trying to use sh(1) loop in (t)csh?  Why?  And what does it have
> to do with the /usr/src/bin/sh/dot.shrc issue?

I'm trying to explain the basic problem with our default shell:
it doesn't work, because it can't handle what people call the
shell syntax.

___
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: r343441 - stable/12/sys/netinet

2019-01-25 Thread Stephen Hurd
Author: shurd
Date: Fri Jan 25 18:30:12 2019
New Revision: 343441
URL: https://svnweb.freebsd.org/changeset/base/343441

Log:
  MFC r343047:
  
  Fix window update issue when scaling disabled
  
  When the TCP window scale option is not used, and the window
  opens up enough in one soreceive, a window update will not be sent.
  
  For example, if recwin == 65535, so->so_rcv.sb_hiwat >= 262144, and
  so->so_rcv.sb_hiwat <= 524272, the window update will never be sent.
  This is because recwin and adv are clamped to TCP_MAXWIN << tp->rcv_scale,
  and so will never be >= so->so_rcv.sb_hiwat / 4
  or <= so->so_rcv.sb_hiwat / 8.
  
  This patch ensures a window update is sent if the window opens by
  TCP_MAXWIN << tp->rcv_scale, which should only happen when the window
  size goes from zero to the max expressible.
  
  This issue looks like it was introduced in r306769 when recwin was clamped
  to TCP_MAXWIN << tp->rcv_scale.
  
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D18821

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

Modified: stable/12/sys/netinet/tcp_output.c
==
--- stable/12/sys/netinet/tcp_output.c  Fri Jan 25 17:09:26 2019
(r343440)
+++ stable/12/sys/netinet/tcp_output.c  Fri Jan 25 18:30:12 2019
(r343441)
@@ -656,7 +656,8 @@ after_sack_rexmit:
if (adv >= (int32_t)(2 * tp->t_maxseg) &&
(adv >= (int32_t)(so->so_rcv.sb_hiwat / 4) ||
 recwin <= (so->so_rcv.sb_hiwat / 8) ||
-so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg))
+so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg ||
+adv >= TCP_MAXWIN << tp->rcv_scale))
goto send;
if (2 * adv >= (int32_t)so->so_rcv.sb_hiwat)
goto send;
___
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: r343416 - head/bin/sh

2019-01-25 Thread Oliver Pinter
On Friday, January 25, 2019, Alexey Dokuchaev  wrote:

> On Fri, Jan 25, 2019 at 06:02:58AM +, Edward Napierala wrote:
> > The aliases are gone, let's continue on the remaining bits below.
>
> They are not gone, they were commented out; also, bogus double linefeeds
> are not gone.  But most importantly, this whole file is useless and IMHO
> should just be removed.  /bin/sh is not supposed to be one's interactive
> shell.


False. Since the ability to install the system from pkg, and the ability to
remove the tcsh package easily, someone really want to or try to use sh as
their default interactive shell.

>From other hand there are no clear communication about the fact that the
/bin/sh isn't suitable for interactive in non-developer visible place -
like in motd or in official documentations, fix me if I'm wrong.


>
> > It is alien, because it's different from their experience
> > from other systems they are used to.
>
> This argument does not really hold because /bin/sh is not... see above.
>
> > It doesn't affect existing installs.  It doesn't affect people
> > who run the default root shell (tcsh), nor folks who use shells
>
> AFAICT default root shell is /bin/csh, not tcsh. ;-)  But that also
> means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who
> change the root shell should either pick another interactive shell,
> or if they want /bin/sh be ready to deal with sanitary environment.
>
> > And for folks who do have their own tree with their preferred
> > /root/.shrc to "make distribution" from, it should actually make
> > their diff to upstream smaller.
>
> I don't like extra files, esp. configuration files that look like they
> are for interactive shell while our /bin/sh is in fact not.  This is
> confusing, and FreeBSD is not supposed to be confusing.
>
> > It is a syntax problem:
> >
> > trasz@v2:~ % while :; do date; sleep 1; done
> > while: Expression Syntax.
> > do: Command not found.
> > done: Command not found.
>
> Are you trying to use sh(1) loop in (t)csh?  Why?  And what does it have
> to do with the /usr/src/bin/sh/dot.shrc issue?
>
> ./danfe
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
>
___
svn-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: r343416 - head/bin/sh

2019-01-25 Thread Alexey Dokuchaev
On Fri, Jan 25, 2019 at 06:02:58AM +, Edward Napierala wrote:
> The aliases are gone, let's continue on the remaining bits below.

They are not gone, they were commented out; also, bogus double linefeeds
are not gone.  But most importantly, this whole file is useless and IMHO
should just be removed.  /bin/sh is not supposed to be one's interactive
shell.

> It is alien, because it's different from their experience
> from other systems they are used to.

This argument does not really hold because /bin/sh is not... see above.

> It doesn't affect existing installs.  It doesn't affect people
> who run the default root shell (tcsh), nor folks who use shells

AFAICT default root shell is /bin/csh, not tcsh. ;-)  But that also
means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who
change the root shell should either pick another interactive shell,
or if they want /bin/sh be ready to deal with sanitary environment.

> And for folks who do have their own tree with their preferred
> /root/.shrc to "make distribution" from, it should actually make
> their diff to upstream smaller.

I don't like extra files, esp. configuration files that look like they
are for interactive shell while our /bin/sh is in fact not.  This is
confusing, and FreeBSD is not supposed to be confusing.

> It is a syntax problem:
> 
> trasz@v2:~ % while :; do date; sleep 1; done
> while: Expression Syntax.
> do: Command not found.
> done: Command not found.

Are you trying to use sh(1) loop in (t)csh?  Why?  And what does it have
to do with the /usr/src/bin/sh/dot.shrc issue?

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


Re: svn commit: r343416 - head/bin/sh

2019-01-25 Thread Edward Napierala
The aliases are gone, let's continue on the remaining bits below.

On 0125T0539, Rodney W. Grimes wrote:
> > pt., 25 sty 2019 o 11:24 Rodney W. Grimes
> >  napisa?(a):
> > >
> > > > On 0124T1555, Rodney W. Grimes wrote:
> > > > > > Author: trasz
> > > > > > Date: Thu Jan 24 23:34:51 2019
> > > > > > New Revision: 343416

[..]

> > > People that want a Borne shell type interactive shell
> > > invariable choose bash, ksh or some other shell, not
> > > our /bin/sh which is lean mean and a fast machine
> > > because the base system uses it so much.
> > 
> > That's true.  But we discourage using shells from ports/packages
> > as root shell. 
> 
> I am not so sure on that, it use to be more so because /bin/sh
> was statically linked and needed no lib's to run, well that
> is gone out the window.  There is also the issue that other
> shells are installed into /usr/local/bin, which may or may
> not be mounted (less likely now that zfs and be's are all
> the rage.)  Most of the reasons to discourage a pkg root
> shell are now gone.

Yeah.  Still, the commit doesn't make it in any way harder,
and provides a more familiar default.

> > The easiest thing for a new user to do if they want
> > a Bourne-compatible shell for root is to just use chsh(1).  And
> > here's what happens: you get greeted with an alien-looking
> > (new folks usually come from Linux or OSX background) '$'
> If that is alien looking then they need some education on
> how the tool they are using works and how to use it.

It is alien, because it's different from their experience
from other systems they are used to.  Sure, they will know
it is _a_ prompt.  It's just that they'll consider it quite
weird and not very useful, in particular the lack of directory
part.

There's also the consistency argument - our tcsh doesn't use
a plain '%'.

> > prompt.  Which is not a problem, of course, just define PS1,
> > and perhaps some aliases, in a newly created /root/.shrc.
> > Except... that doesn't work, despite the fact that it works just
> > fine for accounts other than root, and that's also how you would
> > fix it with bash.  And then you end up having to read the sh(1)
> > manual page to discover the ENV.
> Or read the .profile of there user account and actually
> understand some of these details.  IMHO this is about user
> education and rather than dumb the system down we should
> try to raise the level of knowledge.

I think this is the main point of disagreement.  Sure, learning
is good, but I'm a big fan of providing useful defaults if possible.
Our default csh prompt - now also used by sh - is a pretty good,
imho.  And it's not just FreeBSD that's been using it (with csh)
for years - Ubuntu comes with something pretty close.

[..]

> > > I am sure there are a few of us around that would actually
> > > like to see the ones left go away and view them as contamination
> > > to what should be the domain of a site administrator or
> > > personal taste.
> > >
> > > Just as some of us would really rather have
> > > cd home
> > > return the proper error rather than doing some
> > > magic when there is not a ./home to cd into.
> > > And having ls .. ; cd ..; ls give 2 different outputs
> > > is just.. well something that should confuse the
> > > heck out of a new user, yet seems completely fine
> > > to have in the system.  Note the above becomes
> > > a fatal mistake when the second ls is a rm
> > > with wild cards.
> > 
> > That's a historical mistake we can't really fix, I'm afraid,
> > unless we want to break compatibility with other systems.
> 
> I seriously doubt that are a lot of people depending
> on cd home to do what it does, most would be lazy
> like me and type cd ~.

This is somewhat orthogonal to the main topic.  But it's not
about 'cd home' at all; it's the result of an architectural
problem in Unix kernel that most shells try to work around.

> > > Howerver I do understand the need to assist the new person
> > > or less informed that do not pack an emacs size environment
> > > with them that there are nifty things they can do
> > > to make life easier.  Perhaps making more extensive
> > > comments in the skel files, or even adding pointers in them
> > > to a set of /usr/share/example/ files?  Perhaps pointers
> > > in roots .files to the skel files as "for a better example
> > > of what can be done in this file see foo".
> > 
> > I'd expect pretty much every user new to FreeBSD to already
> > know about what they can do with shell files.  And there's
> > plenty of advice for that too, including the sources mentioned
> > by Cy.
> > 
> > There are two things, however: first, they don't neccessarily
> > know about things specific to FreeBSD sh(1), such as requiring
> > the ENV to be set to actually read the ~/.shrc.
> 
> Is that only the freebsd shell, I thought most shells need
> special stuff done to get them to do much more than processes
> .profile.

Bash - which is what I'd expect most new users to have experience
with - reads 

svn commit: r343440 - head/bin/sh

2019-01-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jan 25 17:09:26 2019
New Revision: 343440
URL: https://svnweb.freebsd.org/changeset/base/343440

Log:
  Comment out the default sh(1) aliases for root, introduced in r343416.
  The rest of this stuff is still to be discussed, but I think at this
  point we have the agreement that the aliases should go.
  
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/bin/sh/dot.shrc

Modified: head/bin/sh/dot.shrc
==
--- head/bin/sh/dot.shrcFri Jan 25 17:08:28 2019(r343439)
+++ head/bin/sh/dot.shrcFri Jan 25 17:09:26 2019(r343440)
@@ -18,13 +18,13 @@
 # set -o vi
 
 
-# some useful aliases
-alias h='fc -l'
-alias j=jobs
-alias m="$PAGER"
-alias ll='ls -laFo'
-alias l='ls -l'
-alias g='egrep -i'
+# # some useful aliases
+# alias h='fc -l'
+# alias j=jobs
+# alias m="$PAGER"
+# alias ll='ls -laFo'
+# alias l='ls -l'
+# alias g='egrep -i'
  
 # # be paranoid
 # alias cp='cp -ip'
___
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: r343439 - head/sys/netinet

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 17:08:28 2019
New Revision: 343439
URL: https://svnweb.freebsd.org/changeset/base/343439

Log:
  Don't include two header files when not needed.
  
  This allows the part of the rewrite of TCP reassembly in this
  files to be MFCed to stable/11 with manual change.
  
  MFC after:3 days
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/netinet/tcp_reass.c

Modified: head/sys/netinet/tcp_reass.c
==
--- head/sys/netinet/tcp_reass.cFri Jan 25 16:16:10 2019
(r343438)
+++ head/sys/netinet/tcp_reass.cFri Jan 25 17:08:28 2019
(r343439)
@@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet6.h"
 #include "opt_tcpdebug.h"
 
+/* For debugging we want counters and BB logging */
+/* #define TCP_REASS_COUNTERS 1 */
+/* #define TCP_REASS_LOGGING 1 */
+
 #include 
 #include 
 #include 
@@ -72,8 +76,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef TCP_REASS_LOGGING
 #include 
 #include 
+#endif
 #include 
 #include 
 #ifdef TCPDEBUG
@@ -91,10 +97,6 @@ __FBSDID("$FreeBSD$");
 #define TCP_R_LOG_ZERO 9
 #define TCP_R_LOG_DUMP 10
 #define TCP_R_LOG_TRIM 11
-
-/* For debugging we want counters and BB logging */
-/* #define TCP_REASS_COUNTERS 1 */
-/* #define TCP_REASS_LOGGING 1 */
 
 static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0,
 "TCP Segment Reassembly Queue");
___
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: r343438 - in head: sys/dev/tpm usr.sbin/acpi/acpidump

2019-01-25 Thread Takanori Watanabe
Author: takawata
Date: Fri Jan 25 16:16:10 2019
New Revision: 343438
URL: https://svnweb.freebsd.org/changeset/base/343438

Log:
  Use ACPI TPM2 table to probe tpmtis and tpmcrb device.
  
  Differential Revision: https://reviews.freebsd.org/D18937

Modified:
  head/sys/dev/tpm/tpm20.h
  head/sys/dev/tpm/tpm_crb.c
  head/sys/dev/tpm/tpm_tis.c
  head/usr.sbin/acpi/acpidump/acpi.c

Modified: head/sys/dev/tpm/tpm20.h
==
--- head/sys/dev/tpm/tpm20.hFri Jan 25 15:48:00 2019(r343437)
+++ head/sys/dev/tpm/tpm20.hFri Jan 25 16:16:10 2019(r343438)
@@ -93,6 +93,12 @@ __FBSDID("$FreeBSD$");
 #defineTPM_CDEV_NAME   "tpm0"
 #defineTPM_CDEV_PERM_FLAG  0600
 
+
+#define TPM2_START_METHOD_ACPI 2
+#define TPM2_START_METHOD_TIS 6
+#define TPM2_START_METHOD_CRB 7
+#define TPM2_START_METHOD_CRB_ACPI 8
+
 struct tpm_sc {
device_tdev;
 

Modified: head/sys/dev/tpm/tpm_crb.c
==
--- head/sys/dev/tpm/tpm_crb.c  Fri Jan 25 15:48:00 2019(r343437)
+++ head/sys/dev/tpm/tpm_crb.c  Fri Jan 25 16:16:10 2019(r343438)
@@ -104,27 +104,20 @@ char *tpmcrb_ids[] = {"MSFT0101", NULL};
 static int
 tpmcrb_acpi_probe(device_t dev)
 {
-   struct resource *res;
-   int err, rid = 0;
-   uint32_t caps;
-
+   int err;
+   ACPI_TABLE_TPM23 *tbl;
+   ACPI_STATUS status;
err = ACPI_ID_PROBE(device_get_parent(dev), dev, tpmcrb_ids, NULL);
if (err > 0)
return (err);
+   /*Find TPM2 Header*/
+   status = AcpiGetTable(ACPI_SIG_TPM2, 1, (ACPI_TABLE_HEADER **) );
+   if(ACPI_FAILURE(status) ||
+  tbl->StartMethod != TPM2_START_METHOD_CRB)
+   err = ENXIO;
 
-   /* Check if device is in CRB mode */
-   res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, , RF_ACTIVE);
-   if (res == NULL)
-   return (ENXIO);
-
-   caps = bus_read_4(res, TPM_CRB_INTF_ID);
-   bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
-
-   if ((caps & TPM_CRB_INTF_ID_TYPE) != TPM_CRB_INTF_ID_TYPE_CRB)
-   return (ENXIO);
-
device_set_desc(dev, "Trusted Platform Module 2.0, CRB mode");
-   return (BUS_PROBE_DEFAULT);
+   return (err);
 }
 
 static ACPI_STATUS

Modified: head/sys/dev/tpm/tpm_tis.c
==
--- head/sys/dev/tpm/tpm_tis.c  Fri Jan 25 15:48:00 2019(r343437)
+++ head/sys/dev/tpm/tpm_tis.c  Fri Jan 25 16:16:10 2019(r343438)
@@ -100,26 +100,21 @@ char *tpmtis_ids[] = {"MSFT0101", NULL};
 static int
 tpmtis_acpi_probe(device_t dev)
 {
-   struct resource *res;
-   int err, rid = 0;
-   uint32_t caps;
+   int err;
+   ACPI_TABLE_TPM23 *tbl;
+   ACPI_STATUS status;
 
err = ACPI_ID_PROBE(device_get_parent(dev), dev, tpmtis_ids, NULL);
if (err > 0)
return (err);
+   /*Find TPM2 Header*/
+   status = AcpiGetTable(ACPI_SIG_TPM2, 1, (ACPI_TABLE_HEADER **) );
+   if(ACPI_FAILURE(status) ||
+  tbl->StartMethod != TPM2_START_METHOD_TIS)
+   err = ENXIO;
 
-   /* Check if device is in TPM 2.0 TIS mode */
-   res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, , RF_ACTIVE);
-   if (res == NULL)
-   return (ENXIO);
-
-   caps = bus_read_4(res, TPM_INTF_CAPS);
-   bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
-   if ((caps & TPM_INTF_CAPS_VERSION) != TPM_INTF_CAPS_TPM20)
-   return (ENXIO);
-
device_set_desc(dev, "Trusted Platform Module 2.0, FIFO mode");
-   return (BUS_PROBE_DEFAULT);
+   return (err);
 }
 
 static int

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Fri Jan 25 15:48:00 2019
(r343437)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Fri Jan 25 16:16:10 2019
(r343438)
@@ -970,7 +970,18 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp)
 
printf(END_COMMENT);
 }
-
+static void acpi_handle_tpm2(ACPI_TABLE_HEADER *sdp)
+{
+   ACPI_TABLE_TPM2 *tpm2;
+   
+   printf (BEGIN_COMMENT);
+   acpi_print_sdt(sdp);
+   tpm2 = (ACPI_TABLE_TPM2 *) sdp;
+   printf ("\t\tControlArea=%lx\n", tpm2->ControlAddress);
+   printf ("\t\tStartMethod=%x\n", tpm2->StartMethod); 
+   printf (END_COMMENT);
+}
+   
 static const char *
 devscope_type2str(int type)
 {
@@ -1769,6 +1780,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp)
acpi_handle_wddt(sdp);
else if (!memcmp(sdp->Signature, ACPI_SIG_LPIT, 4))
acpi_handle_lpit(sdp);
+   else if (!memcmp(sdp->Signature, ACPI_SIG_TPM2, 4))
+   acpi_handle_tpm2(sdp);
else {

svn commit: r343437 - stable/11/sys/netinet

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 15:48:00 2019
New Revision: 343437
URL: https://svnweb.freebsd.org/changeset/base/343437

Log:
  MFC r343089:
  
  Limit the user-controllable amount of memory the kernel allocates
  via IPPROTO_SCTP level socket options.
  
  This issue was found by running syzkaller.

Modified:
  stable/11/sys/netinet/sctp_constants.h
  stable/11/sys/netinet/sctp_usrreq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_constants.h
==
--- stable/11/sys/netinet/sctp_constants.h  Fri Jan 25 15:46:30 2019
(r343436)
+++ stable/11/sys/netinet/sctp_constants.h  Fri Jan 25 15:48:00 2019
(r343437)
@@ -977,6 +977,9 @@ __FBSDID("$FreeBSD$");
 uint8_t *)&(a)->s_addr)[0] == 169) && \
  (((uint8_t *)&(a)->s_addr)[1] == 254))
 
+/* Maximum size of optval for IPPROTO_SCTP level socket options. */
+#define SCTP_SOCKET_OPTION_LIMIT (64 * 1024)
+
 
 #if defined(_KERNEL)
 #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x))

Modified: stable/11/sys/netinet/sctp_usrreq.c
==
--- stable/11/sys/netinet/sctp_usrreq.c Fri Jan 25 15:46:30 2019
(r343436)
+++ stable/11/sys/netinet/sctp_usrreq.c Fri Jan 25 15:48:00 2019
(r343437)
@@ -6812,6 +6812,10 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt
return (error);
}
optsize = sopt->sopt_valsize;
+   if (optsize > SCTP_SOCKET_OPTION_LIMIT) {
+   SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, 
SCTP_FROM_SCTP_USRREQ, ENOBUFS);
+   return (ENOBUFS);
+   }
if (optsize) {
SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT);
if (optval == 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: r343436 - stable/12/sys/netinet

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 15:46:30 2019
New Revision: 343436
URL: https://svnweb.freebsd.org/changeset/base/343436

Log:
  MFC r343089:
  
  Limit the user-controllable amount of memory the kernel allocates
  via IPPROTO_SCTP level socket options.
  
  This issue was found by running syzkaller.

Modified:
  stable/12/sys/netinet/sctp_constants.h
  stable/12/sys/netinet/sctp_usrreq.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_constants.h
==
--- stable/12/sys/netinet/sctp_constants.h  Fri Jan 25 15:44:53 2019
(r343435)
+++ stable/12/sys/netinet/sctp_constants.h  Fri Jan 25 15:46:30 2019
(r343436)
@@ -983,6 +983,9 @@ __FBSDID("$FreeBSD$");
 uint8_t *)&(a)->s_addr)[0] == 169) && \
  (((uint8_t *)&(a)->s_addr)[1] == 254))
 
+/* Maximum size of optval for IPPROTO_SCTP level socket options. */
+#define SCTP_SOCKET_OPTION_LIMIT (64 * 1024)
+
 
 #if defined(_KERNEL)
 #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x))

Modified: stable/12/sys/netinet/sctp_usrreq.c
==
--- stable/12/sys/netinet/sctp_usrreq.c Fri Jan 25 15:44:53 2019
(r343435)
+++ stable/12/sys/netinet/sctp_usrreq.c Fri Jan 25 15:46:30 2019
(r343436)
@@ -6828,6 +6828,10 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt
return (error);
}
optsize = sopt->sopt_valsize;
+   if (optsize > SCTP_SOCKET_OPTION_LIMIT) {
+   SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, 
SCTP_FROM_SCTP_USRREQ, ENOBUFS);
+   return (ENOBUFS);
+   }
if (optsize) {
SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT);
if (optval == 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: r343435 - stable/12/sys/netinet

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 15:44:53 2019
New Revision: 343435
URL: https://svnweb.freebsd.org/changeset/base/343435

Log:
  MFC r342879:
  
  Fix getsockopt() for IP_OPTIONS/IP_RETOPTS.
  
  r336616 copies inp->inp_options using the m_dup() function.
  However, this function expects an mbuf packet header at the beginning,
  which is not true in this case.
  Therefore, use m_copym() instead of m_dup().
  
  This issue was found by syzkaller.
  
  Reviewed by:  mmacy@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18753

Modified:
  stable/12/sys/netinet/ip_output.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/ip_output.c
==
--- stable/12/sys/netinet/ip_output.c   Fri Jan 25 15:40:51 2019
(r343434)
+++ stable/12/sys/netinet/ip_output.c   Fri Jan 25 15:44:53 2019
(r343435)
@@ -1262,7 +1262,8 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
if (inp->inp_options) {
struct mbuf *options;
 
-   options = m_dup(inp->inp_options, M_NOWAIT);
+   options = m_copym(inp->inp_options, 0,
+   M_COPYALL, M_NOWAIT);
INP_RUNLOCK(inp);
if (options != NULL) {
error = sooptcopyout(sopt,
___
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: r343434 - stable/11/sys/kern

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 15:40:51 2019
New Revision: 343434
URL: https://svnweb.freebsd.org/changeset/base/343434

Log:
  MFC r342857:
  
  Avoid overfow in vtruncbuf()
  
  Using daddr_t instead of int avoids trunclbn to become negative when it
  shouldn't.
  This isssue was found by running syzkaller.
  
  Reviewed by:  mckusick, kib, markj
  Differential Revision:https://reviews.freebsd.org/D18763

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

Modified: stable/11/sys/kern/vfs_subr.c
==
--- stable/11/sys/kern/vfs_subr.c   Fri Jan 25 15:39:33 2019
(r343433)
+++ stable/11/sys/kern/vfs_subr.c   Fri Jan 25 15:40:51 2019
(r343434)
@@ -1791,7 +1791,7 @@ vtruncbuf(struct vnode *vp, struct ucred *cred, off_t 
 {
struct buf *bp, *nbp;
int anyfreed;
-   int trunclbn;
+   daddr_t trunclbn;
struct bufobj *bo;
 
CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__,
___
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: r343433 - stable/12/sys/kern

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 15:39:33 2019
New Revision: 343433
URL: https://svnweb.freebsd.org/changeset/base/343433

Log:
  MFC r342857:
  
  Avoid overfow in vtruncbuf()
  
  Using daddr_t instead of int avoids trunclbn to become negative when it
  shouldn't.
  This isssue was found by running syzkaller.
  
  Reviewed by:  mckusick, kib, markj
  Differential Revision:https://reviews.freebsd.org/D18763

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

Modified: stable/12/sys/kern/vfs_subr.c
==
--- stable/12/sys/kern/vfs_subr.c   Fri Jan 25 15:25:53 2019
(r343432)
+++ stable/12/sys/kern/vfs_subr.c   Fri Jan 25 15:39:33 2019
(r343433)
@@ -1858,7 +1858,7 @@ vtruncbuf(struct vnode *vp, struct ucred *cred, off_t 
 {
struct buf *bp, *nbp;
int anyfreed;
-   int trunclbn;
+   daddr_t trunclbn;
struct bufobj *bo;
 
CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__,
___
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: r343432 - stable/11/sys/netinet

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 15:25:53 2019
New Revision: 343432
URL: https://svnweb.freebsd.org/changeset/base/343432

Log:
  MFC r338138:
  
  Enabling the IPPROTO_IPV6 level socket option IPV6_USE_MIN_MTU on a TCP
  socket resulted in sending fragmented IPV6 packets.
  
  This is fixes by reducing the MSS to the appropriate value. In addtion,
  if the socket option is set before the handshake happens, announce this
  MSS to the peer. This is not stricly required, but done since TCP
  is conservative.
  
  PR:   173444
  Reviewed by:  bz@, rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D16796

Modified:
  stable/11/sys/netinet/in_pcb.h
  stable/11/sys/netinet/tcp_input.c
  stable/11/sys/netinet/tcp_subr.c
  stable/11/sys/netinet/tcp_usrreq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/in_pcb.h
==
--- stable/11/sys/netinet/in_pcb.h  Fri Jan 25 15:21:42 2019
(r343431)
+++ stable/11/sys/netinet/in_pcb.h  Fri Jan 25 15:25:53 2019
(r343432)
@@ -120,6 +120,7 @@ struct in_conninfo {
  * Flags for inc_flags.
  */
 #defineINC_ISIPV6  0x01
+#defineINC_IPV6MINMTU  0x02
 
 #defineinc_isipv6  inc_flags   /* temp compatibility */
 #defineinc_fport   inc_ie.ie_fport

Modified: stable/11/sys/netinet/tcp_input.c
==
--- stable/11/sys/netinet/tcp_input.c   Fri Jan 25 15:21:42 2019
(r343431)
+++ stable/11/sys/netinet/tcp_input.c   Fri Jan 25 15:25:53 2019
(r343432)
@@ -1080,6 +1080,8 @@ relocked:
 #ifdef INET6
if (isipv6) {
inc.inc_flags |= INC_ISIPV6;
+   if (inp->inp_inc.inc_flags & INC_IPV6MINMTU)
+   inc.inc_flags |= INC_IPV6MINMTU;
inc.inc6_faddr = ip6->ip6_src;
inc.inc6_laddr = ip6->ip6_dst;
} else

Modified: stable/11/sys/netinet/tcp_subr.c
==
--- stable/11/sys/netinet/tcp_subr.cFri Jan 25 15:21:42 2019
(r343431)
+++ stable/11/sys/netinet/tcp_subr.cFri Jan 25 15:25:53 2019
(r343432)
@@ -2429,6 +2429,9 @@ tcp_maxmtu6(struct in_conninfo *inc, struct tcp_ifcap 
 
KASSERT(inc != NULL, ("tcp_maxmtu6 with NULL in_conninfo pointer"));
 
+   if (inc->inc_flags & INC_IPV6MINMTU)
+   return (IPV6_MMTU);
+
if (!IN6_IS_ADDR_UNSPECIFIED(>inc6_faddr)) {
in6_splitscope(>inc6_faddr, , );
if (fib6_lookup_nh_ext(inc->inc_fibnum, , scopeid, 0,

Modified: stable/11/sys/netinet/tcp_usrreq.c
==
--- stable/11/sys/netinet/tcp_usrreq.c  Fri Jan 25 15:21:42 2019
(r343431)
+++ stable/11/sys/netinet/tcp_usrreq.c  Fri Jan 25 15:25:53 2019
(r343432)
@@ -1445,6 +1445,42 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt)
if (inp->inp_vflag & INP_IPV6PROTO) {
INP_WUNLOCK(inp);
error = ip6_ctloutput(so, sopt);
+   /*
+* In case of the IPV6_USE_MIN_MTU socket option,
+* the INC_IPV6MINMTU flag to announce a corresponding
+* MSS during the initial handshake.
+* If the TCP connection is not in the front states,
+* just reduce the MSS being used.
+* This avoids the sending of TCP segments which will
+* be fragmented at the IPv6 layer.
+*/
+   if ((error == 0) &&
+   (sopt->sopt_dir == SOPT_SET) &&
+   (sopt->sopt_level == IPPROTO_IPV6) &&
+   (sopt->sopt_name == IPV6_USE_MIN_MTU)) {
+   INP_WLOCK(inp);
+   if ((inp->inp_flags &
+   (INP_TIMEWAIT | INP_DROPPED))) {
+   INP_WUNLOCK(inp);
+   return (ECONNRESET);
+   }
+   inp->inp_inc.inc_flags |= INC_IPV6MINMTU;
+   tp = intotcpcb(inp);
+   if ((tp->t_state >= TCPS_SYN_SENT) &&
+   (inp->inp_inc.inc_flags & INC_ISIPV6)) {
+   struct ip6_pktopts *opt;
+
+   opt = inp->in6p_outputopts;
+   if ((opt != NULL) &&
+   (opt->ip6po_minmtu ==
+  

svn commit: r343431 - stable/11/sys/netinet

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 15:21:42 2019
New Revision: 343431
URL: https://svnweb.freebsd.org/changeset/base/343431

Log:
  MFC r338137:
  
  Fix the inheritance of IPv6 level socket options on TCP sockets.
  
  This was broken for IPv6 listening socket, which are not IPV6_ONLY,
  and the accepted TCP connection was using IPv4.
  
  Reviewed by:  bz@, rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D16792

Modified:
  stable/11/sys/netinet/tcp_syncache.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_syncache.c
==
--- stable/11/sys/netinet/tcp_syncache.cFri Jan 25 15:02:18 2019
(r343430)
+++ stable/11/sys/netinet/tcp_syncache.cFri Jan 25 15:21:42 2019
(r343431)
@@ -761,10 +761,9 @@ syncache_socket(struct syncache *sc, struct socket *ls
goto abort;
}
 #ifdef INET6
-   if (sc->sc_inc.inc_flags & INC_ISIPV6) {
+   if (inp->inp_vflag & INP_IPV6PROTO) {
struct inpcb *oinp = sotoinpcb(lso);
-   struct in6_addr laddr6;
-   struct sockaddr_in6 sin6;
+
/*
 * Inherit socket options from the listening socket.
 * Note that in6p_inputopts are not (and should not be)
@@ -778,6 +777,11 @@ syncache_socket(struct syncache *sc, struct socket *ls
if (oinp->in6p_outputopts)
inp->in6p_outputopts =
ip6_copypktopts(oinp->in6p_outputopts, M_NOWAIT);
+   }
+
+   if (sc->sc_inc.inc_flags & INC_ISIPV6) {
+   struct in6_addr laddr6;
+   struct sockaddr_in6 sin6;
 
sin6.sin6_family = AF_INET6;
sin6.sin6_len = sizeof(sin6);
___
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: r343430 - head/sys/net

2019-01-25 Thread Andrew Gallatin
Author: gallatin
Date: Fri Jan 25 15:02:18 2019
New Revision: 343430
URL: https://svnweb.freebsd.org/changeset/base/343430

Log:
  Fix an iflib driver unload panic introduced in r343085
  
  The new loop to sync and unload descriptors was indexed
  by "i", rather than "j".   The panic was caused by "i"
  being advanced rather than "j", and eventually becoming
  out of bounds.
  
  Reviewed by:  kib
  MFC after:3 days
  Sponsored by: Netflix

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cFri Jan 25 14:46:13 2019(r343429)
+++ head/sys/net/iflib.cFri Jan 25 15:02:18 2019(r343430)
@@ -2197,17 +2197,17 @@ iflib_rx_sds_free(iflib_rxq_t rxq)
fl = >ifr_fl[i];
if (fl->ifl_desc_tag != NULL) {
if (fl->ifl_sds.ifsd_map != NULL) {
-   for (j = 0; j < fl->ifl_size; i++) {
-   if (fl->ifl_sds.ifsd_map[i] ==
+   for (j = 0; j < fl->ifl_size; j++) {
+   if (fl->ifl_sds.ifsd_map[j] ==
NULL)
-   continue;
+   continue;
bus_dmamap_sync(
fl->ifl_desc_tag,
-   fl->ifl_sds.ifsd_map[i],
+   fl->ifl_sds.ifsd_map[j],
BUS_DMASYNC_POSTREAD);
bus_dmamap_unload(
fl->ifl_desc_tag,
-   fl->ifl_sds.ifsd_map[i]);
+   fl->ifl_sds.ifsd_map[j]);
}
}
bus_dma_tag_destroy(fl->ifl_desc_tag);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343429 - head/contrib/llvm/tools/clang/lib/Driver/ToolChains

2019-01-25 Thread Ed Maste
Author: emaste
Date: Fri Jan 25 14:46:13 2019
New Revision: 343429
URL: https://svnweb.freebsd.org/changeset/base/343429

Log:
  clang: default to DWARF 4 as of FreeBSD 13
  
  FreeBSD previously defaulted to DWARF 2 because several tools (gdb,
  ctfconvert, etc.) did not support later versions.  These have either
  been fixed or are deprecated.
  
  Note that gdb 6 still exists but has been moved out of $PATH into
  /usr/libexec and is intended only for use by crashinfo(8).  The kernel
  build sets the DWARF version explicitly via -gdwarf2, so this should
  have no effect there.
  
  PR:   234887 [exp-run]
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D17930

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h

Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp
==
--- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Fri Jan 
25 13:57:09 2019(r343428)
+++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Fri Jan 
25 14:46:13 2019(r343429)
@@ -357,6 +357,13 @@ ToolChain::CXXStdlibType FreeBSD::GetDefaultCXXStdlibT
   return ToolChain::CST_Libstdcxx;
 }
 
+unsigned FreeBSD::GetDefaultDwarfVersion() const {
+  // Default to use DWARF 2 before FreeBSD 13.
+  if (getTriple().getOSMajorVersion() < 13)
+return 2;
+  return 4;
+}
+
 void FreeBSD::addLibStdCxxIncludePaths(
 const llvm::opt::ArgList ,
 llvm::opt::ArgStringList ) const {

Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h
==
--- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h   Fri Jan 
25 13:57:09 2019(r343428)
+++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h   Fri Jan 
25 14:46:13 2019(r343429)
@@ -70,7 +70,7 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic
   const llvm::opt::ArgList ) const override;
   bool isPIEDefault() const override;
   SanitizerMask getSupportedSanitizers() const override;
-  unsigned GetDefaultDwarfVersion() const override { return 2; }
+  unsigned GetDefaultDwarfVersion() const override;
   // Until dtrace (via CTF) and LLDB can deal with distributed debug info,
   // FreeBSD defaults to standalone/full debug info.
   bool GetDefaultStandaloneDebug() const override { return true; }
___
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: r343349 - head/sys/dev/ocs_fc

2019-01-25 Thread Rodney W. Grimes
> On Fri, Jan 25, 2019 at 7:44 AM Rodney W. Grimes
>  wrote:
> >
> > > Hi Rodney,
> > >
> > > I fixed many coverity tool warnings as part of this commit. Adding all the
> > > warnings and fix details seemed over kill.
> >
> > It seems like overkill when your commiting, but if you have
> > have to go digging through commit history trying to find
> > something it helps a great deal to have good information
> > present there.
> >
> > You do not need to include the output from coverty,
> > but some amount of detail is very helpful.
> >
> 
> We do have a tendency to note CIDs in commit messages and that's pretty
> helpful -- I don't know that omitting them will generally ruffle any
> feathers, though.

yes, CIDs are fine, I should of clarified that, I would not
want to see the full output from  coverty in a commit message
unless it was needed to express what was fixed and why in
some way.


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


svn commit: r343428 - in head/sys/netinet: . cc tcp_stacks

2019-01-25 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 25 13:57:09 2019
New Revision: 343428
URL: https://svnweb.freebsd.org/changeset/base/343428

Log:
  Fix a bug in the restart window computation of TCP New Reno
  
  When implementing support for IW10, an update in the computation
  of the restart window used after an idle phase was missed. To
  minimize code duplication, implement the logic in tcp_compute_initwnd()
  and call it. This fixes a bug in NewReno, which was not aware of
  IW10.
  
  Submitted by: Richard Scheffenegger
  Reviewed by:  tuexen@
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18940

Modified:
  head/sys/netinet/cc/cc_newreno.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/rack.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/cc/cc_newreno.c
==
--- head/sys/netinet/cc/cc_newreno.cFri Jan 25 13:48:40 2019
(r343427)
+++ head/sys/netinet/cc/cc_newreno.cFri Jan 25 13:57:09 2019
(r343428)
@@ -199,7 +199,7 @@ newreno_ack_received(struct cc_var *ccv, uint16_t type
 static void
 newreno_after_idle(struct cc_var *ccv)
 {
-   int rw;
+   uint32_t rw;
 
/*
 * If we've been idle for more than one retransmit timeout the old
@@ -214,11 +214,7 @@ newreno_after_idle(struct cc_var *ccv)
 *
 * See RFC5681 Section 4.1. "Restarting Idle Connections".
 */
-   if (V_tcp_do_rfc3390)
-   rw = min(4 * CCV(ccv, t_maxseg),
-   max(2 * CCV(ccv, t_maxseg), 4380));
-   else
-   rw = CCV(ccv, t_maxseg) * 2;
+   rw = tcp_compute_initwnd(tcp_maxseg(ccv->ccvc.tcp));
 
CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd));
 }

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cFri Jan 25 13:48:40 2019
(r343427)
+++ head/sys/netinet/tcp_input.cFri Jan 25 13:57:09 2019
(r343428)
@@ -371,31 +371,14 @@ cc_conn_init(struct tcpcb *tp)
/*
 * Set the initial slow-start flight size.
 *
-* RFC5681 Section 3.1 specifies the default conservative values.
-* RFC3390 specifies slightly more aggressive values.
-* RFC6928 increases it to ten segments.
-* Support for user specified value for initial flight size.
-*
 * If a SYN or SYN/ACK was lost and retransmitted, we have to
 * reduce the initial CWND to one segment as congestion is likely
 * requiring us to be cautious.
 */
if (tp->snd_cwnd == 1)
tp->snd_cwnd = maxseg;  /* SYN(-ACK) lost */
-   else if (V_tcp_initcwnd_segments)
-   tp->snd_cwnd = min(V_tcp_initcwnd_segments * maxseg,
-   max(2 * maxseg, V_tcp_initcwnd_segments * 1460));
-   else if (V_tcp_do_rfc3390)
-   tp->snd_cwnd = min(4 * maxseg, max(2 * maxseg, 4380));
-   else {
-   /* Per RFC5681 Section 3.1 */
-   if (maxseg > 2190)
-   tp->snd_cwnd = 2 * maxseg;
-   else if (maxseg > 1095)
-   tp->snd_cwnd = 3 * maxseg;
-   else
-   tp->snd_cwnd = 4 * maxseg;
-   }
+   else
+   tp->snd_cwnd = tcp_compute_initwnd(maxseg);
 
if (CC_ALGO(tp)->conn_init != NULL)
CC_ALGO(tp)->conn_init(tp->ccv);
@@ -3817,4 +3800,31 @@ tcp_compute_pipe(struct tcpcb *tp)
return (tp->snd_max - tp->snd_una +
tp->sackhint.sack_bytes_rexmit -
tp->sackhint.sacked_bytes);
+}
+
+uint32_t
+tcp_compute_initwnd(uint32_t maxseg)
+{
+   /*
+* Calculate the Initial Window, also used as Restart Window
+*
+* RFC5681 Section 3.1 specifies the default conservative values.
+* RFC3390 specifies slightly more aggressive values.
+* RFC6928 increases it to ten segments.
+* Support for user specified value for initial flight size.
+*/
+   if (V_tcp_initcwnd_segments)
+   return min(V_tcp_initcwnd_segments * maxseg,
+   max(2 * maxseg, V_tcp_initcwnd_segments * 1460));
+   else if (V_tcp_do_rfc3390)
+   return min(4 * maxseg, max(2 * maxseg, 4380));
+   else {
+   /* Per RFC5681 Section 3.1 */
+   if (maxseg > 2190)
+   return (2 * maxseg);
+   else if (maxseg > 1095)
+   return (3 * maxseg);
+   else
+   return (4 * maxseg);
+   }
 }

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Fri Jan 25 13:48:40 2019
(r343427)
+++ head/sys/netinet/tcp_stacks/rack.c  Fri Jan 25 

Re: svn commit: r343349 - head/sys/dev/ocs_fc

2019-01-25 Thread Kyle Evans
On Fri, Jan 25, 2019 at 7:44 AM Rodney W. Grimes
 wrote:
>
> > Hi Rodney,
> >
> > I fixed many coverity tool warnings as part of this commit. Adding all the
> > warnings and fix details seemed over kill.
>
> It seems like overkill when your commiting, but if you have
> have to go digging through commit history trying to find
> something it helps a great deal to have good information
> present there.
>
> You do not need to include the output from coverty,
> but some amount of detail is very helpful.
>

We do have a tendency to note CIDs in commit messages and that's pretty
helpful -- I don't know that omitting them will generally ruffle any
feathers, though.
___
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: r343427 - in head: share/man/man4 sys/amd64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/ath_hal_ar5416 sys/powerpc/conf sys/sparc64/conf tools/tools/ath/ath_ee_9300_print tool...

2019-01-25 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Jan 25 13:48:40 2019
New Revision: 343427
URL: https://svnweb.freebsd.org/changeset/base/343427

Log:
  Garbage collect AH_SUPPORT_AR5416 config option.
  
  It does nothing since r318857.

Modified:
  head/share/man/man4/ath.4
  head/share/man/man4/ath_hal.4
  head/sys/amd64/conf/GENERIC
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/i386/conf/GENERIC
  head/sys/mips/conf/ERL
  head/sys/mips/conf/OCTEON1
  head/sys/mips/conf/PB92
  head/sys/mips/conf/std.AR_MIPS_BASE
  head/sys/modules/ath_hal_ar5416/Makefile
  head/sys/powerpc/conf/GENERIC
  head/sys/powerpc/conf/GENERIC64
  head/sys/sparc64/conf/GENERIC
  head/tools/tools/ath/ath_ee_9300_print/Makefile
  head/tools/tools/ath/athaggrstats/Makefile
  head/tools/tools/ath/athdecode/Makefile
  head/tools/tools/ath/athkey/Makefile
  head/tools/tools/ath/athpoke/Makefile
  head/tools/tools/ath/athprom/Makefile
  head/tools/tools/ath/athradar/Makefile
  head/tools/tools/ath/athratestats/Makefile
  head/tools/tools/ath/athregs/Makefile
  head/tools/tools/ath/athspectral/Makefile
  head/tools/tools/ath/athstats/Makefile
  head/tools/tools/ath/athsurvey/Makefile
  head/tools/tools/nanobsd/pcengines/ALIX_DSK

Modified: head/share/man/man4/ath.4
==
--- head/share/man/man4/ath.4   Fri Jan 25 11:46:07 2019(r343426)
+++ head/share/man/man4/ath.4   Fri Jan 25 13:48:40 2019(r343427)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd April 14, 2014
+.Dd January 25, 2019
 .Dt ATH 4
 .Os
 .Sh NAME
@@ -42,7 +42,6 @@ kernel configuration file:
 .Cd "device ath"
 .Cd "device ath_pci"
 .Cd "device ath_hal"
-.Cd "options AH_SUPPORT_AR5416"
 .Cd "device ath_rate_sample"
 .Cd "device wlan"
 .Ed

Modified: head/share/man/man4/ath_hal.4
==
--- head/share/man/man4/ath_hal.4   Fri Jan 25 11:46:07 2019
(r343426)
+++ head/share/man/man4/ath_hal.4   Fri Jan 25 13:48:40 2019
(r343427)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd July 22, 2013
+.Dd January 25, 2019
 .Dt ATH_HAL 4
 .Os
 .Sh NAME
@@ -36,7 +36,6 @@
 .Nd "Atheros Hardware Access Layer (HAL)"
 .Sh SYNOPSIS
 .Cd "device ath_hal"
-.Cd "options AH_SUPPORT_AR5416"
 or
 .Cd "device ath_ar5210"
 .Cd "device ath_ar5211"
@@ -57,12 +56,11 @@ or
 .Cd "device ath_ar9285"
 .Cd "device ath_ar9287"
 .Cd "device ath_ar9300"
-.Cd "options AH_SUPPORT_AR5416"
 .Sh DESCRIPTION
 The hal provides hardware support for wireless network adapters based on
 the Atheros AR5210, AR5211, AR5212, AR5213, AR2413, AR2417, AR2425,
-AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285, AR9287,
-AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565
+AR5413, AR5416, AR5418, AR5424, AR9130, AR9160, AR9220, AR9280, AR9285,
+AR9287, AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565
 chips (and companion RF/baseband parts).
 This code is part of the
 .Xr ath 4
@@ -71,11 +69,6 @@ over the set of chips supported.
 Selecting
 .Nm
 enables support for all PCI and Cardbus devices.
-Note this includes AR5416, AR5418, AR9130, AR9160, AR9220, AR9280, AR9285
-and AR9287 devices and must be accompanied by the
-AH_SUPPORT_AR5416
-option to enable the extended hardware descriptor format used by
-AR5416 and later devices.
 .Pp
 Some devices come in Cardbus/MiniPCI/PCI format.
 Others (for example AR2413, AR2427, AR5418, AR9280, AR9285, AR9287) come in

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Fri Jan 25 11:46:07 2019(r343426)
+++ head/sys/amd64/conf/GENERIC Fri Jan 25 13:48:40 2019(r343427)
@@ -293,7 +293,6 @@ device  an  # Aironet 
4500/4800 802.11 wireless NICs.
 device ath # Atheros NICs
 device ath_pci # Atheros pci/cardbus glue
 device ath_hal # pci/cardbus chip support
-optionsAH_SUPPORT_AR5416   # enable AR5416 tx/rx descriptors
 optionsAH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation
 optionsATH_ENABLE_11N  # Enable 802.11n support for AR5416 and 
later
 device ath_rate_sample # SampleRate tx rate control for ath

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Fri Jan 25 11:46:07 2019(r343426)
+++ head/sys/conf/NOTES Fri Jan 25 13:48:40 2019(r343427)
@@ -2121,7 +2121,6 @@ deviceath_hal # pci/cardbus chip 
support
 #deviceath_rf5112
 #deviceath_rf5413
 #deviceath_ar5416  # AR5416 chips
-optionsAH_SUPPORT_AR5416   # enable AR5416 tx/rx descriptors
 # All of the AR5212 parts have a problem when paired with the AR71xx
 # CPUS.  These parts have a bug that triggers a 

Re: svn commit: r343349 - head/sys/dev/ocs_fc

2019-01-25 Thread Rodney W. Grimes
> Hi Rodney,
> 
> I fixed many coverity tool warnings as part of this commit. Adding all the
> warnings and fix details seemed over kill.

It seems like overkill when your commiting, but if you have
have to go digging through commit history trying to find
something it helps a great deal to have good information
present there.

You do not need to include the output from coverty,
but some amount of detail is very helpful.

Seeing returns 0 changed into return -1 just seems
a strange thing to need to do to fix a static analysis issue.

> 
> I will use a better commit message when I do MFC commit of this revision.
Those commits should usually just duplicate the ^head
message with a 1 liner at the top that is a
MFC: rXX one line summary of original commit.

  Original commit message here

> Thanks,
> Ram
> 
> 
> 
> On Thu, Jan 24, 2019 at 12:28 AM Rodney W. Grimes <
> free...@pdx.rh.cn85.dnsmgr.net> wrote:
> 
> > > Author: ram
> > > Date: Wed Jan 23 17:34:01 2019
> > > New Revision: 343349
> > > URL: https://svnweb.freebsd.org/changeset/base/343349
> > >
> > > Log:
> > >   Fixed issues reported by coverity scan.
> >
> > The quality of this commit message is rather low,
> > it should of at least included some details about
> > what was wrong, why it was wrong, and how it was
> > fixed.
> >
> > Thanks,
> > Rod
> > >
> > >   Approved by: mav
> > >   MFC after: 3 weeks
> > >
> > > Modified:
> > >   head/sys/dev/ocs_fc/ocs_cam.c
> > >   head/sys/dev/ocs_fc/ocs_hw.c
> > >   head/sys/dev/ocs_fc/ocs_hw_queues.c
> > >   head/sys/dev/ocs_fc/ocs_ioctl.c
> > >   head/sys/dev/ocs_fc/ocs_mgmt.c
> > >   head/sys/dev/ocs_fc/ocs_node.c
> > >   head/sys/dev/ocs_fc/ocs_pci.c
> > >   head/sys/dev/ocs_fc/ocs_xport.c
> > >   head/sys/dev/ocs_fc/sli4.c
> > >
> > > Modified: head/sys/dev/ocs_fc/ocs_cam.c
> > >
> > ==
> > > --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019
> > (r343348)
> > > +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019
> > (r343349)
> > > @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node,
> > ocs_scsi_del_tar
> > >   struct ocs_softc *ocs = node->ocs;
> > >   ocs_fcport  *fcp = NULL;
> > >   ocs_fc_target_t *tgt = NULL;
> > > - uint32_ttgt_id;
> > > + int32_t tgt_id;
> > >
> > > + if (ocs == NULL) {
> > > + ocs_log_err(ocs,"OCS is NULL \n");
> > > + return -1;
> > > + }
> > > +
> > >   fcp = node->sport->tgt_data;
> > >   if (fcp == NULL) {
> > >   ocs_log_err(ocs,"FCP is NULL \n");
> > > - return 0;
> > > + return -1;
> > >   }
> > >
> > >   tgt_id = ocs_tgt_find(fcp, node);
> > > + if (tgt_id == -1) {
> > > + ocs_log_err(ocs,"target is invalid\n");
> > > + return -1;
> > > + }
> > >
> > >   tgt = >tgt[tgt_id];
> > >
> > > @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb
> > *ccb
> > >   ocs_io_t *io = NULL;
> > >   ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL];
> > >   int32_t sgl_count;
> > > + ocs_fcport  *fcp;
> > >
> > > - ocs_fcport  *fcp = NULL;
> > >   fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path)));
> > > - if (fcp == NULL) {
> > > - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__);
> > > - return -1;
> > > - }
> > >
> > >   if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) {
> > >   device_printf(ocs->dev, "%s: device LOST %d\n", __func__,
> > > @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb)
> > >   }
> > >   case XPT_RESET_BUS:
> > >   if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE)
> > == 0) {
> > > - ocs_xport_control(ocs->xport,
> > OCS_XPORT_PORT_ONLINE);
> > > -
> > > + rc = ocs_xport_control(ocs->xport,
> > OCS_XPORT_PORT_ONLINE);
> > > + if (rc) {
> > > + ocs_log_debug(ocs, "Failed to bring port
> > online"
> > > + " : %d\n",
> > rc);
> > > + }
> > >   ocs_set_ccb_status(ccb, CAM_REQ_CMP);
> > >   } else {
> > >   ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR);
> > >
> > > Modified: head/sys/dev/ocs_fc/ocs_hw.c
> > >
> > ==
> > > --- head/sys/dev/ocs_fc/ocs_hw.c  Wed Jan 23 17:28:39 2019
> > (r343348)
> > > +++ head/sys/dev/ocs_fc/ocs_hw.c  Wed Jan 23 17:34:01 2019
> > (r343349)
> > > @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw)
> > >  static ocs_hw_rtn_e
> > >  ocs_hw_link_event_init(ocs_hw_t *hw)
> > >  {
> > > - if (hw == NULL) {
> > > - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw);
> > > - return OCS_HW_RTN_ERROR;

Re: svn commit: r343416 - head/bin/sh

2019-01-25 Thread Rodney W. Grimes
> pt., 25 sty 2019 o 11:24 Rodney W. Grimes
>  napisa?(a):
> >
> > > On 0124T1555, Rodney W. Grimes wrote:
> > > > > Author: trasz
> > > > > Date: Thu Jan 24 23:34:51 2019
> > > > > New Revision: 343416
> > > > > URL: https://svnweb.freebsd.org/changeset/base/343416
> > > > >
> > > > > Log:
> > > > >   Install .shrc for root, and set PS1 for the toor account.
> > > >
> > > > And a dozen other aliases :-(
> > >
> > > Six, and they are exactly the same as for ordinary users.
> >
> > Your right, I drifted to hyperbolie on that,
> > but 1 is too many in this case.
> 
> Okay, I don't have a problem with removing the default aliases.
> (And from all the aliases that are actually there in the default shrc,
> the only one I actually do like and use is "ll").
> 
> > > But yeah, I can see the point of not defining any aliases
> > > by default for the root user.  Would the change be acceptable
> > > if the aliases were commented out?  This would be still quite
> > > close to the situation for csh.
> >
> > There is also the issue that we are now going to open 1
> > more file every time an interactive /bin/sh is spawned,
> > and that file is full of comments, to me thats a waste
> > of cycles for probably 95% of the systems out there.
> 
> True, but I don't think that's even measurable, at least for
> interactive shells (as opposed to shells used to run scripts,
> for which the commit changes nothing).
> 
> > People that want a Borne shell type interactive shell
> > invariable choose bash, ksh or some other shell, not
> > our /bin/sh which is lean mean and a fast machine
> > because the base system uses it so much.
> 
> That's true.  But we discourage using shells from ports/packages
> as root shell. 

I am not so sure on that, it use to be more so because /bin/sh
was statically linked and needed no lib's to run, well that
is gone out the window.  There is also the issue that other
shells are installed into /usr/local/bin, which may or may
not be mounted (less likely now that zfs and be's are all
the rage.)  Most of the reasons to discourage a pkg root
shell are now gone.

> The easiest thing for a new user to do if they want
> a Bourne-compatible shell for root is to just use chsh(1).  And
> here's what happens: you get greeted with an alien-looking
> (new folks usually come from Linux or OSX background) '$'
If that is alien looking then they need some education on
how the tool they are using works and how to use it.

> prompt.  Which is not a problem, of course, just define PS1,
> and perhaps some aliases, in a newly created /root/.shrc.
> Except... that doesn't work, despite the fact that it works just
> fine for accounts other than root, and that's also how you would
> fix it with bash.  And then you end up having to read the sh(1)
> manual page to discover the ENV.
Or read the .profile of there user account and actually
understand some of these details.  IMHO this is about user
education and rather than dumb the system down we should
try to raise the level of knowledge.

> 
> > > > Please do not contaiminate the prestine environment with
> > > > personal preferences.  In the start of the project we
> > > > did a great deal of work to remove and eliminate these
> > > > types of things, only the few csh aliases where retained.
> > >
> > > Indeed, and those are pretty much the same aliases.
> >
> > But those alias have never been there for sh, the few
> > we did keep was for historerical history, they had been
> > in roots .cshrc for a decade and people got upset when
> > we tried to remove them, thus we settled on just the
> > few people stated as being the most wanted and used.
> 
> They are there in share/skel/dot.shrc, just not for root.
> But again - I agree regarding the aliases.
> 
> > I am sure there are a few of us around that would actually
> > like to see the ones left go away and view them as contamination
> > to what should be the domain of a site administrator or
> > personal taste.
> >
> > Just as some of us would really rather have
> > cd home
> > return the proper error rather than doing some
> > magic when there is not a ./home to cd into.
> > And having ls .. ; cd ..; ls give 2 different outputs
> > is just.. well something that should confuse the
> > heck out of a new user, yet seems completely fine
> > to have in the system.  Note the above becomes
> > a fatal mistake when the second ls is a rm
> > with wild cards.
> 
> That's a historical mistake we can't really fix, I'm afraid,
> unless we want to break compatibility with other systems.

I seriously doubt that are a lot of people depending
on cd home to do what it does, most would be lazy
like me and type cd ~.

> 
> > Howerver I do understand the need to assist the new person
> > or less informed that do not pack an emacs size environment
> > with them that there are nifty things they can do
> > to make life easier.  Perhaps making more extensive
> > comments in the skel files, or even adding pointers in them
> > to a set of 

Re: svn commit: r343349 - head/sys/dev/ocs_fc

2019-01-25 Thread Ram Kishore Vegesna via svn-src-all
Hi Rodney,

I fixed many coverity tool warnings as part of this commit. Adding all the
warnings and fix details seemed over kill.

I will use a better commit message when I do MFC commit of this revision.

Thanks,
Ram



On Thu, Jan 24, 2019 at 12:28 AM Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> > Author: ram
> > Date: Wed Jan 23 17:34:01 2019
> > New Revision: 343349
> > URL: https://svnweb.freebsd.org/changeset/base/343349
> >
> > Log:
> >   Fixed issues reported by coverity scan.
>
> The quality of this commit message is rather low,
> it should of at least included some details about
> what was wrong, why it was wrong, and how it was
> fixed.
>
> Thanks,
> Rod
> >
> >   Approved by: mav
> >   MFC after: 3 weeks
> >
> > Modified:
> >   head/sys/dev/ocs_fc/ocs_cam.c
> >   head/sys/dev/ocs_fc/ocs_hw.c
> >   head/sys/dev/ocs_fc/ocs_hw_queues.c
> >   head/sys/dev/ocs_fc/ocs_ioctl.c
> >   head/sys/dev/ocs_fc/ocs_mgmt.c
> >   head/sys/dev/ocs_fc/ocs_node.c
> >   head/sys/dev/ocs_fc/ocs_pci.c
> >   head/sys/dev/ocs_fc/ocs_xport.c
> >   head/sys/dev/ocs_fc/sli4.c
> >
> > Modified: head/sys/dev/ocs_fc/ocs_cam.c
> >
> ==
> > --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019
> (r343348)
> > +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019
> (r343349)
> > @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node,
> ocs_scsi_del_tar
> >   struct ocs_softc *ocs = node->ocs;
> >   ocs_fcport  *fcp = NULL;
> >   ocs_fc_target_t *tgt = NULL;
> > - uint32_ttgt_id;
> > + int32_t tgt_id;
> >
> > + if (ocs == NULL) {
> > + ocs_log_err(ocs,"OCS is NULL \n");
> > + return -1;
> > + }
> > +
> >   fcp = node->sport->tgt_data;
> >   if (fcp == NULL) {
> >   ocs_log_err(ocs,"FCP is NULL \n");
> > - return 0;
> > + return -1;
> >   }
> >
> >   tgt_id = ocs_tgt_find(fcp, node);
> > + if (tgt_id == -1) {
> > + ocs_log_err(ocs,"target is invalid\n");
> > + return -1;
> > + }
> >
> >   tgt = >tgt[tgt_id];
> >
> > @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb
> *ccb
> >   ocs_io_t *io = NULL;
> >   ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL];
> >   int32_t sgl_count;
> > + ocs_fcport  *fcp;
> >
> > - ocs_fcport  *fcp = NULL;
> >   fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path)));
> > - if (fcp == NULL) {
> > - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__);
> > - return -1;
> > - }
> >
> >   if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) {
> >   device_printf(ocs->dev, "%s: device LOST %d\n", __func__,
> > @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb)
> >   }
> >   case XPT_RESET_BUS:
> >   if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE)
> == 0) {
> > - ocs_xport_control(ocs->xport,
> OCS_XPORT_PORT_ONLINE);
> > -
> > + rc = ocs_xport_control(ocs->xport,
> OCS_XPORT_PORT_ONLINE);
> > + if (rc) {
> > + ocs_log_debug(ocs, "Failed to bring port
> online"
> > + " : %d\n",
> rc);
> > + }
> >   ocs_set_ccb_status(ccb, CAM_REQ_CMP);
> >   } else {
> >   ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR);
> >
> > Modified: head/sys/dev/ocs_fc/ocs_hw.c
> >
> ==
> > --- head/sys/dev/ocs_fc/ocs_hw.c  Wed Jan 23 17:28:39 2019
> (r343348)
> > +++ head/sys/dev/ocs_fc/ocs_hw.c  Wed Jan 23 17:34:01 2019
> (r343349)
> > @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw)
> >  static ocs_hw_rtn_e
> >  ocs_hw_link_event_init(ocs_hw_t *hw)
> >  {
> > - if (hw == NULL) {
> > - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw);
> > - return OCS_HW_RTN_ERROR;
> > - }
> > + ocs_hw_assert(hw);
> >
> >   hw->link.status = SLI_LINK_STATUS_MAX;
> >   hw->link.topology = SLI_LINK_TOPO_NONE;
> > @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop,
> uint3
> >   break;
> >   case OCS_HW_MAX_VPORTS:
> >   *value = sli_get_max_rsrc(>sli, SLI_RSRC_FCOE_VPI);
> > + break;
> >   default:
> >   ocs_log_test(hw->os, "unsupported property %#x\n", prop);
> >   rc = OCS_HW_RTN_ERROR;
> > @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop,
> uint3
> >   break;
> >   case OCS_ESOC:
> >   hw->config.esoc = value;
> > + break;
> >   case OCS_HW_HIGH_LOGIN_MODE:
> >   rc = sli_set_hlm(>sli, value);
> >   break;
> > @@ 

Re: svn commit: r343416 - head/bin/sh

2019-01-25 Thread Edward Napierala
pt., 25 sty 2019 o 11:24 Rodney W. Grimes
 napisał(a):
>
> > On 0124T1555, Rodney W. Grimes wrote:
> > > > Author: trasz
> > > > Date: Thu Jan 24 23:34:51 2019
> > > > New Revision: 343416
> > > > URL: https://svnweb.freebsd.org/changeset/base/343416
> > > >
> > > > Log:
> > > >   Install .shrc for root, and set PS1 for the toor account.
> > >
> > > And a dozen other aliases :-(
> >
> > Six, and they are exactly the same as for ordinary users.
>
> Your right, I drifted to hyperbolie on that,
> but 1 is too many in this case.

Okay, I don't have a problem with removing the default aliases.
(And from all the aliases that are actually there in the default shrc,
the only one I actually do like and use is "ll").

> > But yeah, I can see the point of not defining any aliases
> > by default for the root user.  Would the change be acceptable
> > if the aliases were commented out?  This would be still quite
> > close to the situation for csh.
>
> There is also the issue that we are now going to open 1
> more file every time an interactive /bin/sh is spawned,
> and that file is full of comments, to me thats a waste
> of cycles for probably 95% of the systems out there.

True, but I don't think that's even measurable, at least for
interactive shells (as opposed to shells used to run scripts,
for which the commit changes nothing).

> People that want a Borne shell type interactive shell
> invariable choose bash, ksh or some other shell, not
> our /bin/sh which is lean mean and a fast machine
> because the base system uses it so much.

That's true.  But we discourage using shells from ports/packages
as root shell.  The easiest thing for a new user to do if they want
a Bourne-compatible shell for root is to just use chsh(1).  And
here's what happens: you get greeted with an alien-looking
(new folks usually come from Linux or OSX background) '$'
prompt.  Which is not a problem, of course, just define PS1,
and perhaps some aliases, in a newly created /root/.shrc.
Except... that doesn't work, despite the fact that it works just
fine for accounts other than root, and that's also how you would
fix it with bash.  And then you end up having to read the sh(1)
manual page to discover the ENV.

> > > Please do not contaiminate the prestine environment with
> > > personal preferences.  In the start of the project we
> > > did a great deal of work to remove and eliminate these
> > > types of things, only the few csh aliases where retained.
> >
> > Indeed, and those are pretty much the same aliases.
>
> But those alias have never been there for sh, the few
> we did keep was for historerical history, they had been
> in roots .cshrc for a decade and people got upset when
> we tried to remove them, thus we settled on just the
> few people stated as being the most wanted and used.

They are there in share/skel/dot.shrc, just not for root.
But again - I agree regarding the aliases.

> I am sure there are a few of us around that would actually
> like to see the ones left go away and view them as contamination
> to what should be the domain of a site administrator or
> personal taste.
>
> Just as some of us would really rather have
> cd home
> return the proper error rather than doing some
> magic when there is not a ./home to cd into.
> And having ls .. ; cd ..; ls give 2 different outputs
> is just.. well something that should confuse the
> heck out of a new user, yet seems completely fine
> to have in the system.  Note the above becomes
> a fatal mistake when the second ls is a rm
> with wild cards.

That's a historical mistake we can't really fix, I'm afraid,
unless we want to break compatibility with other systems.

> Howerver I do understand the need to assist the new person
> or less informed that do not pack an emacs size environment
> with them that there are nifty things they can do
> to make life easier.  Perhaps making more extensive
> comments in the skel files, or even adding pointers in them
> to a set of /usr/share/example/ files?  Perhaps pointers
> in roots .files to the skel files as "for a better example
> of what can be done in this file see foo".

I'd expect pretty much every user new to FreeBSD to already
know about what they can do with shell files.  And there's
plenty of advice for that too, including the sources mentioned
by Cy.

There are two things, however: first, they don't neccessarily
know about things specific to FreeBSD sh(1), such as requiring
the ENV to be set to actually read the ~/.shrc.

And second, it's just nice to new users to make stuff just a tiny
bit more familiar looking.  This includes installing the file they can
edit (/root/.shrc), and setting the prompt to something that
resembles other systems.  That's exactly what we do for csh(1).

> > > This is really the domain of a systems administrator to
> > > decide and making work for them to clean this out is
> > > not going to make them happy.
> >
> > Problem is, we're in a strage situation where we ship with
> > root shell which is 

svn commit: r343426 - in stable/11: contrib/netbsd-tests/kernel lib/libc/sys sys/kern sys/sys sys/vm

2019-01-25 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 25 11:46:07 2019
New Revision: 343426
URL: https://svnweb.freebsd.org/changeset/base/343426

Log:
  MFC r343082:
  Implement shmat(2) flag SHM_REMAP.

Modified:
  stable/11/contrib/netbsd-tests/kernel/t_sysv.c
  stable/11/lib/libc/sys/shmat.2
  stable/11/sys/kern/sysv_shm.c
  stable/11/sys/sys/shm.h
  stable/11/sys/vm/vm_map.c
  stable/11/sys/vm/vm_map.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/netbsd-tests/kernel/t_sysv.c
==
--- stable/11/contrib/netbsd-tests/kernel/t_sysv.c  Fri Jan 25 11:26:05 
2019(r343425)
+++ stable/11/contrib/netbsd-tests/kernel/t_sysv.c  Fri Jan 25 11:46:07 
2019(r343426)
@@ -47,6 +47,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -774,19 +775,27 @@ ATF_TC_BODY(shm, tc)
atf_tc_fail("sender: received unexpected signal");
 }
 
-ATF_TC_CLEANUP(shm, tc)
+static void
+shmid_cleanup(const char *name)
 {
-   int sender_shmid;
+   int shmid;
 
/*
 * Remove the shared memory area if it exists.
 */
-   sender_shmid = read_int("sender_shmid");
-   if (sender_shmid != -1)
-   if (shmctl(sender_shmid, IPC_RMID, NULL) == -1)
+   shmid = read_int(name);
+   if (shmid != -1) {
+   if (shmctl(shmid, IPC_RMID, NULL) == -1)
err(1, "shmctl IPC_RMID");
+   }
 }
 
+ATF_TC_CLEANUP(shm, tc)
+{
+
+   shmid_cleanup("sender_shmid");
+}
+
 void
 print_shmid_ds(struct shmid_ds *sp, mode_t mode)
 {
@@ -839,12 +848,53 @@ sharer(void)
exit(0);
 }
 
+#ifdef SHM_REMAP
+ATF_TC_WITH_CLEANUP(shm_remap);
+ATF_TC_HEAD(shm_remap, tc)
+{
+
+   atf_tc_set_md_var(tc, "descr", "Checks SHM_REMAP");
+}
+
+ATF_TC_BODY(shm_remap, tc)
+{
+   char *shm_buf;
+   int shmid_remap;
+
+   pgsize = sysconf(_SC_PAGESIZE);
+
+   shmkey = get_ftok(4160);
+   ATF_REQUIRE_MSG(shmkey != (key_t)-1, "get_ftok failed");
+
+   ATF_REQUIRE_MSG((shmid_remap = shmget(shmkey, pgsize,
+   IPC_CREAT | 0640)) != -1, "shmget: %d", errno);
+   write_int("shmid_remap", shmid_remap);
+
+   ATF_REQUIRE_MSG((shm_buf = mmap(NULL, pgsize, PROT_READ | PROT_WRITE,
+   MAP_ANON | MAP_PRIVATE, -1, 0)) != MAP_FAILED, "mmap: %d", errno);
+
+   ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, 0) == (void *)-1,
+   "shmat without MAP_REMAP succeeded");
+   ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, SHM_REMAP) == shm_buf,
+   "shmat(SHM_REMAP): %d", errno);
+}
+
+ATF_TC_CLEANUP(shm_remap, tc)
+{
+
+   shmid_cleanup("shmid_remap");
+}
+#endif /* SHM_REMAP */
+
 ATF_TP_ADD_TCS(tp)
 {
 
ATF_TP_ADD_TC(tp, msg);
ATF_TP_ADD_TC(tp, sem);
ATF_TP_ADD_TC(tp, shm);
+#ifdef SHM_REMAP
+   ATF_TP_ADD_TC(tp, shm_remap);
+#endif
 
return atf_no_error();
 }

Modified: stable/11/lib/libc/sys/shmat.2
==
--- stable/11/lib/libc/sys/shmat.2  Fri Jan 25 11:26:05 2019
(r343425)
+++ stable/11/lib/libc/sys/shmat.2  Fri Jan 25 11:46:07 2019
(r343426)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2018
+.Dd January 14, 2019
 .Dt SHMAT 2
 .Os
 .Sh NAME
@@ -64,17 +64,38 @@ kernel.
 .It
 If
 .Fa addr
-is nonzero and SHM_RND is not specified in
+is nonzero and
+.Va SHM_RND
+is not specified in
 .Fa flag ,
 the segment is attached the specified address.
 .It
 If
 .Fa addr
-is specified and SHM_RND is specified,
+is specified and
+.Va SHM_RND
+is specified,
 .Fa addr
 is rounded down to the nearest multiple of SHMLBA.
 .El
 .Pp
+If the
+.Va SHM_REMAP
+flag is specified and the passed
+.Fa addr
+is not
+.Dv NULL ,
+any existing mappings in the virtual addresses range are
+cleared before the segment is attached.
+If the flag is not specified,
+.Fa addr
+is not
+.Dv NULL ,
+and the virtual address range contains
+some pre-existing mappings, the
+.Fn shmat
+call fails.
+.Pp
 The
 .Fn shmdt
 system call
@@ -104,6 +125,14 @@ The
 .Fa addr
 argument
 was not an acceptable address.
+.It Bq Er ENOMEM
+The specified
+.Fa addr
+cannot be used for mapping, for instance due to the amount of available
+space being smaller than the segment size,
+or because pre-existing mappings are in the range and no
+.Va SHM_REMAP
+flag was provided.
 .It Bq Er EMFILE
 Failed to attach the shared memory segment because the per-process
 .Va kern.ipc.shmseg

Modified: stable/11/sys/kern/sysv_shm.c
==
--- stable/11/sys/kern/sysv_shm.c   Fri Jan 25 11:26:05 2019
(r343425)
+++ stable/11/sys/kern/sysv_shm.c   Fri Jan 25 11:46:07 2019
(r343426)
@@ -379,7 +379,7 @@ kern_shmat_locked(struct thread *td, int shmid, const 
vm_offset_t attach_va;
vm_prot_t prot;
vm_size_t size;
- 

svn commit: r343425 - stable/11/lib/libc/sys

2019-01-25 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 25 11:26:05 2019
New Revision: 343425
URL: https://svnweb.freebsd.org/changeset/base/343425

Log:
  MFC r328433:
  EMFILE errno documented.

Modified:
  stable/11/lib/libc/sys/shmat.2
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/sys/shmat.2
==
--- stable/11/lib/libc/sys/shmat.2  Fri Jan 25 11:14:20 2019
(r343424)
+++ stable/11/lib/libc/sys/shmat.2  Fri Jan 25 11:26:05 2019
(r343425)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 2, 1995
+.Dd January 25, 2018
 .Dt SHMAT 2
 .Os
 .Sh NAME
@@ -104,6 +104,11 @@ The
 .Fa addr
 argument
 was not an acceptable address.
+.It Bq Er EMFILE
+Failed to attach the shared memory segment because the per-process
+.Va kern.ipc.shmseg
+.Xr sysctl 3
+limit was reached.
 .El
 .Pp
 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"


Re: svn commit: r343416 - head/bin/sh

2019-01-25 Thread Rodney W. Grimes
> On 0124T1555, Rodney W. Grimes wrote:
> > > Author: trasz
> > > Date: Thu Jan 24 23:34:51 2019
> > > New Revision: 343416
> > > URL: https://svnweb.freebsd.org/changeset/base/343416
> > > 
> > > Log:
> > >   Install .shrc for root, and set PS1 for the toor account.
> > 
> > And a dozen other aliases :-(
> 
> Six, and they are exactly the same as for ordinary users.

Your right, I drifted to hyperbolie on that,
but 1 is too many in this case.

> But yeah, I can see the point of not defining any aliases
> by default for the root user.  Would the change be acceptable
> if the aliases were commented out?  This would be still quite
> close to the situation for csh.

There is also the issue that we are now going to open 1
more file every time an interactive /bin/sh is spawned,
and that file is full of comments, to me thats a waste
of cycles for probably 95% of the systems out there.

People that want a Borne shell type interactive shell
invariable choose bash, ksh or some other shell, not
our /bin/sh which is lean mean and a fast machine
because the base system uses it so much.

> 
> > Please do not contaiminate the prestine environment with
> > personal preferences.  In the start of the project we
> > did a great deal of work to remove and eliminate these
> > types of things, only the few csh aliases where retained.
> 
> Indeed, and those are pretty much the same aliases.

But those alias have never been there for sh, the few
we did keep was for historerical history, they had been
in roots .cshrc for a decade and people got upset when
we tried to remove them, thus we settled on just the
few people stated as being the most wanted and used.

I am sure there are a few of us around that would actually
like to see the ones left go away and view them as contamination
to what should be the domain of a site administrator or
personal taste.

Just as some of us would really rather have
cd home
return the proper error rather than doing some
magic when there is not a ./home to cd into.
And having ls .. ; cd ..; ls give 2 different outputs 
is just.. well something that should confuse the
heck out of a new user, yet seems completely fine
to have in the system.  Note the above becomes
a fatal mistake when the second ls is a rm
with wild cards.

Howerver I do understand the need to assist the new person
or less informed that do not pack an emacs size environment
with them that there are nifty things they can do
to make life easier.  Perhaps making more extensive
comments in the skel files, or even adding pointers in them
to a set of /usr/share/example/ files?  Perhaps pointers
in roots .files to the skel files as "for a better example
of what can be done in this file see foo".

> 
> > This is really the domain of a systems administrator to
> > decide and making work for them to clean this out is
> > not going to make them happy.
> 
> Problem is, we're in a strage situation where we ship with
> root shell which is just broken - basic shell syntax doesn't
> work - and the out-of-box alternative provides you with
> a VMS prompt.  Not the best first impression to make, I'd say.

Huh?  Now I think you have gone off the other end,
would you please explain how some alias in .shrc fix anything
broken with /bin/sh or roots use of it?

Can you expand on exactly what syntax this commit fixes please?

And FYI, the $ prompt from a unix /bin/sh predates VMS
by a decade or so, so VMS copied unix on that one.  And
historically interactive prompts have been 1 character
since.. well.. interactive prompts appeared.

.
.
.r pip/l
I miss my OS/8 ".".  :-)


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


svn commit: r343424 - stable/12/sys/vm

2019-01-25 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 25 11:14:20 2019
New Revision: 343424
URL: https://svnweb.freebsd.org/changeset/base/343424

Log:
  MFC r343145:
  MI VM: Make it possible to set size of superpage at boot instead of compile
  time.

Modified:
  stable/12/sys/vm/vm_phys.c
  stable/12/sys/vm/vm_phys.h
  stable/12/sys/vm/vm_reserv.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_phys.c
==
--- stable/12/sys/vm/vm_phys.c  Fri Jan 25 11:12:22 2019(r343423)
+++ stable/12/sys/vm/vm_phys.c  Fri Jan 25 11:14:20 2019(r343424)
@@ -106,7 +106,8 @@ static struct rwlock_padalign vm_phys_fictitious_reg_l
 MALLOC_DEFINE(M_FICT_PAGES, "vm_fictitious", "Fictitious VM pages");
 
 static struct vm_freelist __aligned(CACHE_LINE_SIZE)
-vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL][VM_NFREEORDER];
+vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL]
+[VM_NFREEORDER_MAX];
 
 static int __read_mostly vm_nfreelists;
 

Modified: stable/12/sys/vm/vm_phys.h
==
--- stable/12/sys/vm/vm_phys.h  Fri Jan 25 11:12:22 2019(r343423)
+++ stable/12/sys/vm/vm_phys.h  Fri Jan 25 11:14:20 2019(r343424)
@@ -42,6 +42,10 @@
 
 #ifdef _KERNEL
 
+#ifndef VM_NFREEORDER_MAX
+#defineVM_NFREEORDER_MAX   VM_NFREEORDER
+#endif
+
 /* Domains must be dense (non-sparse) and zero-based. */
 struct mem_affinity {
vm_paddr_t start;
@@ -63,7 +67,7 @@ struct vm_phys_seg {
vm_paddr_t  end;
vm_page_t   first_page;
int domain;
-   struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER];
+   struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX];
 };
 
 extern struct vm_phys_seg vm_phys_segs[];

Modified: stable/12/sys/vm/vm_reserv.c
==
--- stable/12/sys/vm/vm_reserv.cFri Jan 25 11:12:22 2019
(r343423)
+++ stable/12/sys/vm/vm_reserv.cFri Jan 25 11:14:20 2019
(r343424)
@@ -77,10 +77,15 @@ __FBSDID("$FreeBSD$");
 
 #if VM_NRESERVLEVEL > 0
 
+#ifndef VM_LEVEL_0_ORDER_MAX
+#defineVM_LEVEL_0_ORDER_MAXVM_LEVEL_0_ORDER
+#endif
+
 /*
  * The number of small pages that are contained in a level 0 reservation
  */
 #defineVM_LEVEL_0_NPAGES   (1 << VM_LEVEL_0_ORDER)
+#defineVM_LEVEL_0_NPAGES_MAX   (1 << VM_LEVEL_0_ORDER_MAX)
 
 /*
  * The number of bits by which a physical address is shifted to obtain the
@@ -114,6 +119,7 @@ typedef u_long  popmap_t;
  * The number of population map entries in a reservation
  */
 #defineNPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP)
+#defineNPOPMAP_MAX howmany(VM_LEVEL_0_NPAGES_MAX, NBPOPMAP)
 
 /*
  * Number of elapsed ticks before we update the LRU queue position.  Used
@@ -191,7 +197,7 @@ struct vm_reserv {
uint16_tpopcnt; /* (r) # of pages in use */
int lasttick;   /* (r) last pop update tick. */
charinpartpopq; /* (d) */
-   popmap_tpopmap[NPOPMAP];/* (r) bit vector, used pages */
+   popmap_tpopmap[NPOPMAP_MAX];/* (r) bit vector, used pages */
 };
 
 #definevm_reserv_lockptr(rv)   (&(rv)->lock)
___
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: r343423 - stable/12/sys/dev/nvdimm

2019-01-25 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 25 11:12:22 2019
New Revision: 343423
URL: https://svnweb.freebsd.org/changeset/base/343423

Log:
  MFC r343144:
  nvdimm: initialize SPA uuids statically.

Modified:
  stable/12/sys/dev/nvdimm/nvdimm_spa.c
  stable/12/sys/dev/nvdimm/nvdimm_var.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/nvdimm/nvdimm_spa.c
==
--- stable/12/sys/dev/nvdimm/nvdimm_spa.c   Fri Jan 25 11:11:28 2019
(r343422)
+++ stable/12/sys/dev/nvdimm/nvdimm_spa.c   Fri Jan 25 11:12:22 2019
(r343423)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2017, 2018 The FreeBSD Foundation
  * All rights reserved.
+ * Copyright (c) 2018, 2019 Intel Corporation
  *
  * This software was developed by Konstantin Belousov 
  * under sponsorship from the FreeBSD Foundation.
@@ -64,6 +65,23 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#define UUID_INITIALIZER_VOLATILE_MEMORY \
+{0x7305944f,0xfdda,0x44e3,0xb1,0x6c,{0x3f,0x22,0xd2,0x52,0xe5,0xd0}}
+#define UUID_INITIALIZER_PERSISTENT_MEMORY \
+{0x66f0d379,0xb4f3,0x4074,0xac,0x43,{0x0d,0x33,0x18,0xb7,0x8c,0xdb}}
+#define UUID_INITIALIZER_CONTROL_REGION \
+{0x92f701f6,0x13b4,0x405d,0x91,0x0b,{0x29,0x93,0x67,0xe8,0x23,0x4c}}
+#define UUID_INITIALIZER_DATA_REGION \
+{0x91af0530,0x5d86,0x470e,0xa6,0xb0,{0x0a,0x2d,0xb9,0x40,0x82,0x49}}
+#define UUID_INITIALIZER_VOLATILE_VIRTUAL_DISK \
+{0x77ab535a,0x45fc,0x624b,0x55,0x60,{0xf7,0xb2,0x81,0xd1,0xf9,0x6e}}
+#define UUID_INITIALIZER_VOLATILE_VIRTUAL_CD \
+{0x3d5abd30,0x4175,0x87ce,0x6d,0x64,{0xd2,0xad,0xe5,0x23,0xc4,0xbb}}
+#define UUID_INITIALIZER_PERSISTENT_VIRTUAL_DISK \
+{0x5cea02c9,0x4d07,0x69d3,0x26,0x9f,{0x44,0x96,0xfb,0xe0,0x96,0xf9}}
+#define UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD \
+{0x08018188,0x42cd,0xbb48,0x10,0x0f,{0x53,0x87,0xd5,0x3d,0xed,0x3d}}
+
 struct SPA_mapping *spa_mappings;
 int spa_mappings_cnt;
 
@@ -79,52 +97,64 @@ nvdimm_spa_count(void *nfitsubtbl __unused, void *arg)
 
 static struct nvdimm_SPA_uuid_list_elm {
const char  *u_name;
-   const char  *u_id_str;
struct uuid u_id;
const bool  u_usr_acc;
 } nvdimm_SPA_uuid_list[] = {
[SPA_TYPE_VOLATILE_MEMORY] = {
.u_name =   "VOLA MEM ",
-   .u_id_str = UUID_VOLATILE_MEMORY,
+   .u_id = UUID_INITIALIZER_VOLATILE_MEMORY,
.u_usr_acc =true,
},
[SPA_TYPE_PERSISTENT_MEMORY] = {
.u_name =   "PERS MEM",
-   .u_id_str = UUID_PERSISTENT_MEMORY,
+   .u_id = UUID_INITIALIZER_PERSISTENT_MEMORY,
.u_usr_acc =true,
},
[SPA_TYPE_CONTROL_REGION] = {
.u_name =   "CTRL RG ",
-   .u_id_str = UUID_CONTROL_REGION,
+   .u_id = UUID_INITIALIZER_CONTROL_REGION,
.u_usr_acc =false,
},
[SPA_TYPE_DATA_REGION] = {
.u_name =   "DATA RG ",
-   .u_id_str = UUID_DATA_REGION,
+   .u_id = UUID_INITIALIZER_DATA_REGION,
.u_usr_acc =true,
},
[SPA_TYPE_VOLATILE_VIRTUAL_DISK] = {
.u_name =   "VIRT DSK",
-   .u_id_str = UUID_VOLATILE_VIRTUAL_DISK,
+   .u_id = UUID_INITIALIZER_VOLATILE_VIRTUAL_DISK,
.u_usr_acc =true,
},
[SPA_TYPE_VOLATILE_VIRTUAL_CD] = {
.u_name =   "VIRT CD ",
-   .u_id_str = UUID_VOLATILE_VIRTUAL_CD,
+   .u_id = UUID_INITIALIZER_VOLATILE_VIRTUAL_CD,
.u_usr_acc =true,
},
[SPA_TYPE_PERSISTENT_VIRTUAL_DISK] = {
.u_name =   "PV DSK  ",
-   .u_id_str = UUID_PERSISTENT_VIRTUAL_DISK,
+   .u_id = UUID_INITIALIZER_PERSISTENT_VIRTUAL_DISK,
.u_usr_acc =true,
},
[SPA_TYPE_PERSISTENT_VIRTUAL_CD] = {
.u_name =   "PV CD   ",
-   .u_id_str = UUID_PERSISTENT_VIRTUAL_CD,
+   .u_id = UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD,
.u_usr_acc =true,
},
 };
 
+enum SPA_mapping_type
+nvdimm_spa_type_from_uuid(struct uuid *uuid)
+{
+   int j;
+
+   for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) {
+   if (uuidcmp(uuid, _SPA_uuid_list[j].u_id) != 0)
+   continue;
+   return (j);
+   }
+   return (SPA_TYPE_UNKNOWN);
+}
+
 static vm_memattr_t
 nvdimm_spa_memattr(struct SPA_mapping *spa)
 {
@@ -538,48 +568,30 @@ nvdimm_spa_parse(void *nfitsubtbl, void *arg)
 {
ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr;
struct SPA_mapping *spa;
-   int error, *i, j;
+   enum SPA_mapping_type spa_type;
+   

svn commit: r343422 - stable/12/sys/dev/nvdimm

2019-01-25 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 25 11:11:28 2019
New Revision: 343422
URL: https://svnweb.freebsd.org/changeset/base/343422

Log:
  MFC r343143:
  nvdimm: add a driver for the NVDIMM root device

Modified:
  stable/12/sys/dev/nvdimm/nvdimm.c
  stable/12/sys/dev/nvdimm/nvdimm_var.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/nvdimm/nvdimm.c
==
--- stable/12/sys/dev/nvdimm/nvdimm.c   Fri Jan 25 11:05:32 2019
(r343421)
+++ stable/12/sys/dev/nvdimm/nvdimm.c   Fri Jan 25 11:11:28 2019
(r343422)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2017 The FreeBSD Foundation
  * All rights reserved.
+ * Copyright (c) 2018, 2019 Intel Corporation
  *
  * This software was developed by Konstantin Belousov 
  * under sponsorship from the FreeBSD Foundation.
@@ -51,28 +52,27 @@ __FBSDID("$FreeBSD$");
 ACPI_MODULE_NAME("NVDIMM")
 
 static devclass_t nvdimm_devclass;
-static device_t *nvdimm_devs;
-static int nvdimm_devcnt;
+static devclass_t nvdimm_root_devclass;
 MALLOC_DEFINE(M_NVDIMM, "nvdimm", "NVDIMM driver memory");
 
 struct nvdimm_dev *
 nvdimm_find_by_handle(nfit_handle_t nv_handle)
 {
-   device_t dev;
-   struct nvdimm_dev *res, *nv;
-   int i;
+   struct nvdimm_dev *res;
+   device_t *dimms;
+   int i, error, num_dimms;
 
res = NULL;
-   for (i = 0; i < nvdimm_devcnt; i++) {
-   dev = nvdimm_devs[i];
-   if (dev == NULL)
-   continue;
-   nv = device_get_softc(dev);
-   if (nv->nv_handle == nv_handle) {
-   res = nv;
+   error = devclass_get_devices(nvdimm_devclass, , _dimms);
+   if (error != 0)
+   return (NULL);
+   for (i = 0; i < num_dimms; i++) {
+   if (nvdimm_root_get_device_handle(dimms[i]) == nv_handle) {
+   res = device_get_softc(dimms[i]);
break;
}
}
+   free(dimms, M_TEMP);
return (res);
 }
 
@@ -89,8 +89,8 @@ nvdimm_parse_flush_addr(void *nfitsubtbl, void *arg)
return (0);
 
MPASS(nv->nv_flush_addr == NULL && nv->nv_flush_addr_cnt == 0);
-   nv->nv_flush_addr = malloc(nfitflshaddr->HintCount * sizeof(uint64_t *),
-   M_NVDIMM, M_WAITOK);
+   nv->nv_flush_addr = mallocarray(nfitflshaddr->HintCount,
+   sizeof(uint64_t *), M_NVDIMM, M_WAITOK);
for (i = 0; i < nfitflshaddr->HintCount; i++)
nv->nv_flush_addr[i] = (uint64_t *)nfitflshaddr->HintAddress[i];
nv->nv_flush_addr_cnt = nfitflshaddr->HintCount;
@@ -169,206 +169,166 @@ nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum Acpi
return (error);
 }
 
-static ACPI_STATUS
-nvdimm_walk_dev(ACPI_HANDLE handle, UINT32 level, void *ctx, void **st)
+static int
+nvdimm_probe(device_t dev)
 {
-   ACPI_STATUS status;
-   struct nvdimm_ns_walk_ctx *wctx;
 
-   wctx = ctx;
-   status = wctx->func(handle, wctx->arg);
-   return_ACPI_STATUS(status);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
-static ACPI_STATUS
-nvdimm_walk_root(ACPI_HANDLE handle, UINT32 level, void *ctx, void **st)
+static int
+nvdimm_attach(device_t dev)
 {
+   struct nvdimm_dev *nv;
+   ACPI_TABLE_NFIT *nfitbl;
+   ACPI_HANDLE handle;
ACPI_STATUS status;
 
-   if (!acpi_MatchHid(handle, "ACPI0012"))
-   return_ACPI_STATUS(AE_OK);
-   status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 100,
-   nvdimm_walk_dev, NULL, ctx, NULL);
-   if (ACPI_FAILURE(status))
-   return_ACPI_STATUS(status);
-   return_ACPI_STATUS(AE_CTRL_TERMINATE);
+   nv = device_get_softc(dev);
+   handle = nvdimm_root_get_acpi_handle(dev);
+   if (handle == NULL)
+   return (EINVAL);
+   nv->nv_dev = dev;
+   nv->nv_handle = nvdimm_root_get_device_handle(dev);
+
+   status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **));
+   if (ACPI_FAILURE(status)) {
+   if (bootverbose)
+   device_printf(dev, "cannot get NFIT\n");
+   return (ENXIO);
+   }
+   nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_FLUSH_ADDRESS,
+   nvdimm_parse_flush_addr, nv);
+   AcpiPutTable(>Header);
+   return (0);
 }
 
-static ACPI_STATUS
-nvdimm_foreach_acpi(ACPI_STATUS (*func)(ACPI_HANDLE, void *), void *arg)
+static int
+nvdimm_detach(device_t dev)
 {
-   struct nvdimm_ns_walk_ctx wctx;
-   ACPI_STATUS status;
+   struct nvdimm_dev *nv;
 
-   wctx.func = func;
-   wctx.arg = arg;
-   status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 100,
-   nvdimm_walk_root, NULL, , NULL);
-   return_ACPI_STATUS(status);
+   nv = device_get_softc(dev);
+   free(nv->nv_flush_addr, M_NVDIMM);
+   return (0);
 }
 
-static ACPI_STATUS
-nvdimm_count_devs(ACPI_HANDLE handle 

svn commit: r343421 - stable/12/sys/dev/nvdimm

2019-01-25 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 25 11:05:32 2019
New Revision: 343421
URL: https://svnweb.freebsd.org/changeset/base/343421

Log:
  MFC r339461:
  nvdimm(4): Fix GCC 6.4.0 build

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

Modified: stable/12/sys/dev/nvdimm/nvdimm.c
==
--- stable/12/sys/dev/nvdimm/nvdimm.c   Fri Jan 25 11:01:11 2019
(r343420)
+++ stable/12/sys/dev/nvdimm/nvdimm.c   Fri Jan 25 11:05:32 2019
(r343421)
@@ -222,7 +222,7 @@ nvdimm_count_devs(ACPI_HANDLE handle __unused, void *a
status = AcpiGetName(handle, ACPI_FULL_PATHNAME, );
if (ACPI_FAILURE(status))
return_ACPI_STATUS(status);
-   printf("nvdimm: enumerated %s\n", name.Pointer);
+   printf("nvdimm: enumerated %s\n", (char *)name.Pointer);
AcpiOsFree(name.Pointer);
}
 
___
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: r343420 - stable/11/sys/sys

2019-01-25 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 25 11:01:11 2019
New Revision: 343420
URL: https://svnweb.freebsd.org/changeset/base/343420

Log:
  MFC r343302:
  Remove unused *_sysinit_flags() declarations.

Modified:
  stable/11/sys/sys/rmlock.h
  stable/11/sys/sys/rwlock.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sys/rmlock.h
==
--- stable/11/sys/sys/rmlock.h  Fri Jan 25 10:58:34 2019(r343419)
+++ stable/11/sys/sys/rmlock.h  Fri Jan 25 11:01:11 2019(r343420)
@@ -52,7 +52,6 @@ void  rm_init_flags(struct rmlock *rm, const char *name
 void   rm_destroy(struct rmlock *rm);
 intrm_wowned(const struct rmlock *rm);
 void   rm_sysinit(void *arg);
-void   rm_sysinit_flags(void *arg);
 
 void   _rm_wlock_debug(struct rmlock *rm, const char *file, int line);
 void   _rm_wunlock_debug(struct rmlock *rm, const char *file, int line);

Modified: stable/11/sys/sys/rwlock.h
==
--- stable/11/sys/sys/rwlock.h  Fri Jan 25 10:58:34 2019(r343419)
+++ stable/11/sys/sys/rwlock.h  Fri Jan 25 11:01:11 2019(r343420)
@@ -128,7 +128,6 @@
 void   _rw_init_flags(volatile uintptr_t *c, const char *name, int opts);
 void   _rw_destroy(volatile uintptr_t *c);
 void   rw_sysinit(void *arg);
-void   rw_sysinit_flags(void *arg);
 int_rw_wowned(const volatile uintptr_t *c);
 void   _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line);
 int__rw_try_wlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF);
___
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: r343419 - stable/12/sys/sys

2019-01-25 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 25 10:58:34 2019
New Revision: 343419
URL: https://svnweb.freebsd.org/changeset/base/343419

Log:
  MFC r343302:
  Remove unused *_sysinit_flags() declarations.

Modified:
  stable/12/sys/sys/rmlock.h
  stable/12/sys/sys/rwlock.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/sys/rmlock.h
==
--- stable/12/sys/sys/rmlock.h  Fri Jan 25 01:06:06 2019(r343418)
+++ stable/12/sys/sys/rmlock.h  Fri Jan 25 10:58:34 2019(r343419)
@@ -54,7 +54,6 @@ void  rm_init_flags(struct rmlock *rm, const char *name
 void   rm_destroy(struct rmlock *rm);
 intrm_wowned(const struct rmlock *rm);
 void   rm_sysinit(void *arg);
-void   rm_sysinit_flags(void *arg);
 
 void   _rm_wlock_debug(struct rmlock *rm, const char *file, int line);
 void   _rm_wunlock_debug(struct rmlock *rm, const char *file, int line);

Modified: stable/12/sys/sys/rwlock.h
==
--- stable/12/sys/sys/rwlock.h  Fri Jan 25 01:06:06 2019(r343418)
+++ stable/12/sys/sys/rwlock.h  Fri Jan 25 10:58:34 2019(r343419)
@@ -130,7 +130,6 @@
 void   _rw_init_flags(volatile uintptr_t *c, const char *name, int opts);
 void   _rw_destroy(volatile uintptr_t *c);
 void   rw_sysinit(void *arg);
-void   rw_sysinit_flags(void *arg);
 int_rw_wowned(const volatile uintptr_t *c);
 void   _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line);
 int__rw_try_wlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF);
___
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: r343416 - head/bin/sh

2019-01-25 Thread Edward Tomasz Napierala
On 0124T1555, Rodney W. Grimes wrote:
> > Author: trasz
> > Date: Thu Jan 24 23:34:51 2019
> > New Revision: 343416
> > URL: https://svnweb.freebsd.org/changeset/base/343416
> > 
> > Log:
> >   Install .shrc for root, and set PS1 for the toor account.
> 
> And a dozen other aliases :-(

Six, and they are exactly the same as for ordinary users.
But yeah, I can see the point of not defining any aliases
by default for the root user.  Would the change be acceptable
if the aliases were commented out?  This would be still quite
close to the situation for csh.

> Please do not contaiminate the prestine environment with
> personal preferences.  In the start of the project we
> did a great deal of work to remove and eliminate these
> types of things, only the few csh aliases where retained.

Indeed, and those are pretty much the same aliases.

> This is really the domain of a systems administrator to
> decide and making work for them to clean this out is
> not going to make them happy.

Problem is, we're in a strage situation where we ship with
root shell which is just broken - basic shell syntax doesn't
work - and the out-of-box alternative provides you with
a VMS prompt.  Not the best first impression to make, I'd say.

[..]

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