svn commit: r345524 - head/contrib/tzdata

2019-03-26 Thread Philip Paeps
Author: philip
Date: Tue Mar 26 08:10:51 2019
New Revision: 345524
URL: https://svnweb.freebsd.org/changeset/base/345524

Log:
  Import tzdata 2019a
  
  Changes: https://github.com/eggert/tz/blob/2019a/NEWS
  
  MFC after:3 days

Modified:
  head/contrib/tzdata/Makefile
  head/contrib/tzdata/NEWS
  head/contrib/tzdata/README
  head/contrib/tzdata/africa
  head/contrib/tzdata/asia
  head/contrib/tzdata/backward
  head/contrib/tzdata/backzone
  head/contrib/tzdata/etcetera
  head/contrib/tzdata/europe
  head/contrib/tzdata/leap-seconds.list
  head/contrib/tzdata/leapseconds
  head/contrib/tzdata/northamerica
  head/contrib/tzdata/theory.html
  head/contrib/tzdata/version
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/Makefile
==
--- head/contrib/tzdata/MakefileTue Mar 26 07:56:17 2019
(r345523)
+++ head/contrib/tzdata/MakefileTue Mar 26 08:10:51 2019
(r345524)
@@ -12,7 +12,10 @@ VERSION= unknown
 # Email address for bug reports.
 BUGEMAIL=  t...@iana.org
 
-# Choose source data features.  To get new features right away, use:
+# DATAFORM selects the data format.
+# Available formats represent essentially the same data, albeit
+# possibly with minor discrepancies that users are not likely to notice.
+# To get new features and the best data right away, use:
 #  DATAFORM=   vanguard
 # To wait a while before using new features, to give downstream users
 # time to upgrade zic (the default), use:
@@ -33,11 +36,11 @@ DATAFORM=   main
 LOCALTIME= GMT
 
 # If you want something other than Eastern United States time as a template
-# for handling POSIX-style timezone environment variables,
+# for handling ruleless POSIX-style timezone environment variables,
 # change the line below (after finding the timezone you want in the
 # one of the $(TDATA) source files, or adding it to a source file).
-# When a POSIX-style environment variable is handled, the rules in the
-# template file are used to determine "spring forward" and "fall back" days and
+# A ruleless environment setting like TZ='CST6CDT' uses the rules in the
+# template file to determine "spring forward" and "fall back" days and
 # times; the environment variable itself specifies UT offsets of standard and
 # daylight saving time.
 # Alternatively, if you discover you've got the wrong timezone, you can just
@@ -46,7 +49,6 @@ LOCALTIME=GMT
 # Use the command
 #  make zonenames
 # to get a list of the values you can use for POSIXRULES.
-# If you want POSIX compatibility, use "America/New_York".
 
 POSIXRULES=America/New_York
 
@@ -113,8 +115,8 @@ TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TI
 TIME_T_ALTERNATIVES_HEAD = int64_t
 TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
 
-# What kind of TZif data files to generate.
-# (TZif is the binary time zone data format that zic generates.)
+# What kind of TZif data files to generate.  (TZif is the binary time
+# zone data format that zic generates; see Internet RFC 8536.)
 # If you want only POSIX time, with time values interpreted as
 # seconds since the epoch (not counting leap seconds), use
 #  REDO=   posix_only
@@ -360,6 +362,9 @@ LEAPSECONDS=
 zic=   ./zic
 ZIC=   $(zic) $(ZFLAGS)
 
+# To shrink the size of installed TZif files,
+# append "-r @N" to omit data before N-seconds-after-the-Epoch.
+# See the zic man page for more about -r.
 ZFLAGS=
 
 # How to use zic to install TZif files.
@@ -491,7 +496,8 @@ MANTXTS=newctime.3.txt newstrftime.3.txt newtzset.3.t
 COMMON=calendars CONTRIBUTING LICENSE Makefile \
NEWS README theory.html version
 WEB_PAGES= tz-art.html tz-how-to.html tz-link.html
-CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html
+CHECK_WEB_PAGES=check_theory.html check_tz-art.html \
+   check_tz-how-to.html check_tz-link.html
 DOCS=  $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
 PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
@@ -804,9 +810,10 @@ check_tzs: $(TZS) $(TZS_NEW)
touch $@
 
 check_web: $(CHECK_WEB_PAGES)
+check_theory.html: theory.html
 check_tz-art.html: tz-art.html
 check_tz-link.html: tz-link.html
-check_tz-art.html check_tz-link.html:
+check_theory.html check_tz-art.html check_tz-link.html:
$(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \
-F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \
  test ! -s $@.out || { cat $@.out; exit 1; }
@@ -840,11 +847,13 @@ check_zishrink_posix check_zishrink_right: \
touch $@
 
 clean_misc:
+   rm -fr check_*.dir
rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
  check_* core typecheck_* \
  date tzselect version.h zdump 

svn commit: r345525 - head/sys/netinet

2019-03-26 Thread Michael Tuexen
Author: tuexen
Date: Tue Mar 26 08:27:00 2019
New Revision: 345525
URL: https://svnweb.freebsd.org/changeset/base/345525

Log:
  Fix a double free of an SCTP association in an error path.
  This is joint work with rrs@. The issue was found by running
  syzkaller.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Tue Mar 26 08:10:51 2019
(r345524)
+++ head/sys/netinet/sctp_usrreq.c  Tue Mar 26 08:27:00 2019
(r345525)
@@ -1481,8 +1481,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb
sctp_connectx_helper_add(stcb, sa, (totaddr - 1), &error);
/* Fill in the return id */
if (error) {
-   (void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE,
-   SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7);
goto out_now;
}
a_id = (sctp_assoc_t *)optval;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345526 - head/share/misc

2019-03-26 Thread Philip Paeps
Author: philip
Date: Tue Mar 26 09:46:17 2019
New Revision: 345526
URL: https://svnweb.freebsd.org/changeset/base/345526

Log:
  SZ has been known as Eswatini since April 2018 (formerly Swaziland).
  
  Sources:
  https://www.iso.org/obp/ui/#iso:code:3166:SZ
  http://www.un.org/en/member-states/index.html#gotoE
  
http://www.times.co.sz/news/118373-kingdom-of-eswatini-change-now-official.html
  
  MFC after:3 days

Modified:
  head/share/misc/iso3166

Modified: head/share/misc/iso3166
==
--- head/share/misc/iso3166 Tue Mar 26 08:27:00 2019(r345525)
+++ head/share/misc/iso3166 Tue Mar 26 09:46:17 2019(r345526)
@@ -232,7 +232,7 @@ LK  LKA 144 Sri Lanka
 SD SDN 729 Sudan
 SR SUR 740 Suriname
 SJ SJM 744 Svalbard and Jan Mayen
-SZ SWZ 748 Swaziland
+SZ SWZ 748 Eswatini
 SE SWE 752 Sweden
 CH CHE 756 Switzerland
 SY SYR 760 Syrian Arab Republic
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345527 - head/sys/netinet

2019-03-26 Thread Randall Stewart
Author: rrs
Date: Tue Mar 26 10:41:27 2019
New Revision: 345527
URL: https://svnweb.freebsd.org/changeset/base/345527

Log:
  Fix a small bug in the tcp_log_id where the bucket
  was unlocked and yet the bucket-unlock flag was not
  changed to false. This can cause a panic if INVARIANTS
  is on and we go through the right path (though rare).
  
  Reported by:  syzbot+179a1ad49f3c4c215...@syzkaller.appspotmail.com
  Reviewed by:  tuexen@
  MFC after:1 week

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Tue Mar 26 09:46:17 2019
(r345526)
+++ head/sys/netinet/tcp_output.c   Tue Mar 26 10:41:27 2019
(r345527)
@@ -138,7 +138,8 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto_lowat
  * non-ACK.
  */
 #define TCP_XMIT_TIMER_ASSERT(tp, len, th_flags)   \
-   KASSERT(((len) == 0 && ((th_flags) & (TH_SYN | TH_FIN)) == 0) ||\
+   KASSERT(((len) == 0 && ((th_flags) &\
+   (TH_SYN | TH_FIN | TH_RST)) != 0) ||\
tcp_timer_active((tp), TT_REXMT) || \
tcp_timer_active((tp), TT_PERSIST), \
("neither rexmt nor persist timer is set"))
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344067 - head/sbin/bectl/tests

2019-03-26 Thread Kyle Evans
On Tue, Feb 12, 2019 at 5:36 PM Enji Cooper  wrote:
>
> Author: ngie
> Date: Tue Feb 12 23:35:46 2019
> New Revision: 344067
> URL: https://svnweb.freebsd.org/changeset/base/344067
>
> Log:
>   Fix up concurrent test zpool setup and teardown
>
>   Set up zpools with a more unique name, stash the zpool name away in a file 
> pointed
>   to by `$ZPOOL_NAME_FILE` (which is relative to a per-testcase generated 
> temporary
>   directory), then remove the file based on `$ZPOOL_NAME_FILE` in the cleanup
>   routines.
>
>   This is a more concurrency-safe solution and will allow the testcases to be 
> safely
>   executed in parallel.
>
>   Reviewed by:  kevans, jtl
>   Approved by:  jtl (mentor)
>   MFC after:1 week
>   Differential Revision: https://reviews.freebsd.org/D19024
>

Hi,

Any objections if I MFC this with some other bectl(8)/libbe(3) MFCs
that I'll be doing soon?

Thanks,

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


Re: svn commit: r344067 - head/sbin/bectl/tests

2019-03-26 Thread Enji Cooper

> On Mar 26, 2019, at 06:12, Kyle Evans  wrote:
> 
>> On Tue, Feb 12, 2019 at 5:36 PM Enji Cooper  wrote:
>> 
>> Author: ngie
>> Date: Tue Feb 12 23:35:46 2019
>> New Revision: 344067
>> URL: https://svnweb.freebsd.org/changeset/base/344067
>> 
>> Log:
>>  Fix up concurrent test zpool setup and teardown
>> 
>>  Set up zpools with a more unique name, stash the zpool name away in a file 
>> pointed
>>  to by `$ZPOOL_NAME_FILE` (which is relative to a per-testcase generated 
>> temporary
>>  directory), then remove the file based on `$ZPOOL_NAME_FILE` in the cleanup
>>  routines.
>> 
>>  This is a more concurrency-safe solution and will allow the testcases to be 
>> safely
>>  executed in parallel.
>> 
>>  Reviewed by:  kevans, jtl
>>  Approved by:  jtl (mentor)
>>  MFC after:1 week
>>  Differential Revision: https://reviews.freebsd.org/D19024
>> 
> 
> Hi,
> 
> Any objections if I MFC this with some other bectl(8)/libbe(3) MFCs
> that I'll be doing soon?

Hi Kyle,
Please go ahead. I was waiting for mentor approval of 
https://reviews.freebsd.org/D19546 over the past few weeks and haven’t received 
it. I didn’t press hard enough :/.
Thank you for being patient!
-Enji
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345547 - head/sys/kern

2019-03-26 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 26 15:35:49 2019
New Revision: 345547
URL: https://svnweb.freebsd.org/changeset/base/345547

Log:
  Factor out resource limit enforcement code in the ELF loader.
  It makes the code slightly easier to follow, and might make
  it easier to fix the resouce accounting to also account for
  the interpreter.
  
  The PROC_UNLOCK() is moved earlier - I don't see anything
  it should protect; the lim_max() is a wrapper around lim_rlimit(),
  and that, differently from lim_rlimit_proc(), doesn't require
  the proc lock to be held.
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D19689

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Tue Mar 26 13:53:33 2019(r345546)
+++ head/sys/kern/imgact_elf.c  Tue Mar 26 15:35:49 2019(r345547)
@@ -812,6 +812,83 @@ __CONCAT(rnd_, __elfN(base))(vm_map_t map __unused, u_
return (res);
 }
 
+static int
+__elfN(enforce_limits)(struct image_params *imgp, const Elf_Ehdr *hdr,
+const Elf_Phdr *phdr, u_long et_dyn_addr)
+{
+   struct vmspace *vmspace;
+   const char *err_str;
+   u_long text_size, data_size, total_size, text_addr, data_addr;
+   u_long seg_size, seg_addr;
+   int i;
+
+   err_str = NULL;
+   text_size = data_size = total_size = text_addr = data_addr = 0;
+
+   for (i = 0; i < hdr->e_phnum; i++) {
+   if (phdr[i].p_type != PT_LOAD || phdr[i].p_memsz == 0)
+   continue;
+
+   seg_addr = trunc_page(phdr[i].p_vaddr + et_dyn_addr);
+   seg_size = round_page(phdr[i].p_memsz +
+   phdr[i].p_vaddr + et_dyn_addr - seg_addr);
+
+   /*
+* Make the largest executable segment the official
+* text segment and all others data.
+*
+* Note that obreak() assumes that data_addr + data_size == end
+* of data load area, and the ELF file format expects segments
+* to be sorted by address.  If multiple data segments exist,
+* the last one will be used.
+*/
+
+   if ((phdr[i].p_flags & PF_X) != 0 && text_size < seg_size) {
+   text_size = seg_size;
+   text_addr = seg_addr;
+   } else {
+   data_size = seg_size;
+   data_addr = seg_addr;
+   }
+   total_size += seg_size;
+   }
+   
+   if (data_addr == 0 && data_size == 0) {
+   data_addr = text_addr;
+   data_size = text_size;
+   }
+
+   /*
+* Check limits.  It should be safe to check the
+* limits after loading the segments since we do
+* not actually fault in all the segments pages.
+*/
+   PROC_LOCK(imgp->proc);
+   if (data_size > lim_cur_proc(imgp->proc, RLIMIT_DATA))
+   err_str = "Data segment size exceeds process limit";
+   else if (text_size > maxtsiz)
+   err_str = "Text segment size exceeds system limit";
+   else if (total_size > lim_cur_proc(imgp->proc, RLIMIT_VMEM))
+   err_str = "Total segment size exceeds process limit";
+   else if (racct_set(imgp->proc, RACCT_DATA, data_size) != 0)
+   err_str = "Data segment size exceeds resource limit";
+   else if (racct_set(imgp->proc, RACCT_VMEM, total_size) != 0)
+   err_str = "Total segment size exceeds resource limit";
+   PROC_UNLOCK(imgp->proc);
+   if (err_str != NULL) {
+   uprintf("%s\n", err_str);
+   return (ENOMEM);
+   }
+
+   vmspace = imgp->proc->p_vmspace;
+   vmspace->vm_tsize = text_size >> PAGE_SHIFT;
+   vmspace->vm_taddr = (caddr_t)(uintptr_t)text_addr;
+   vmspace->vm_dsize = data_size >> PAGE_SHIFT;
+   vmspace->vm_daddr = (caddr_t)(uintptr_t)data_addr;
+
+   return (0);
+}
+
 /*
  * Impossible et_dyn_addr initial value indicating that the real base
  * must be calculated later with some randomization applied.
@@ -827,13 +904,12 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
Elf_Auxargs *elf_auxargs;
struct vmspace *vmspace;
vm_map_t map;
-   const char *err_str, *newinterp;
+   const char *newinterp;
char *interp, *interp_buf, *path;
Elf_Brandinfo *brand_info;
struct sysentvec *sv;
vm_prot_t prot;
-   u_long text_size, data_size, total_size, text_addr, data_addr;
-   u_long seg_size, seg_addr, addr, baddr, et_dyn_addr, entry, proghdr;
+   u_long addr, baddr, et_dyn_addr, entry, proghdr;
u_long maxalign, mapsz, maxv, maxv1;
uint32_t fctl0;
int32_t osrel;
@@ -872,10 +948,9 @@ __CONCAT(exec_, __el

svn commit: r345548 - head/bin/dd

2019-03-26 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 26 15:44:06 2019
New Revision: 345548
URL: https://svnweb.freebsd.org/changeset/base/345548

Log:
  .Xr trim(8) from dd(1).
  
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/bin/dd/dd.1

Modified: head/bin/dd/dd.1
==
--- head/bin/dd/dd.1Tue Mar 26 15:35:49 2019(r345547)
+++ head/bin/dd/dd.1Tue Mar 26 15:44:06 2019(r345548)
@@ -32,7 +32,7 @@
 .\" @(#)dd.1   8.2 (Berkeley) 1/13/94
 .\" $FreeBSD$
 .\"
-.Dd August 8, 2018
+.Dd March 26, 2019
 .Dt DD 1
 .Os
 .Sh NAME
@@ -427,7 +427,8 @@ if necessary, to a 1MiB boundary:
 .Xr mt 1 ,
 .Xr recoverdisk 1 ,
 .Xr tr 1 ,
-.Xr geom 4
+.Xr geom 4 ,
+.Xr trim 8
 .Sh STANDARDS
 The
 .Nm
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345549 - head/sys/dev/smartpqi

2019-03-26 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 26 15:47:13 2019
New Revision: 345549
URL: https://svnweb.freebsd.org/changeset/base/345549

Log:
  Make smartpqi(4) behave better when running out of memory, by returning
  CAM_RESRC_UNAVAIL instead of CAM_REQUEUE_REQ.  This makes CAM delay a bit
  before retrying, so that the retries actually get a chance to succeed.
  
  Reviewed by:  sbruno
  MFC after:2 weeks
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D19696

Modified:
  head/sys/dev/smartpqi/smartpqi_cam.c

Modified: head/sys/dev/smartpqi/smartpqi_cam.c
==
--- head/sys/dev/smartpqi/smartpqi_cam.cTue Mar 26 15:44:06 2019
(r345548)
+++ head/sys/dev/smartpqi/smartpqi_cam.cTue Mar 26 15:47:13 2019
(r345549)
@@ -458,6 +458,15 @@ void os_aio_response_error(rcb_t *rcb, aio_path_error_
DBG_IO("OUT\n");
 }
 
+static void
+pqi_freeze_ccb(union ccb *ccb)
+{
+   if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
+   ccb->ccb_h.status |= CAM_DEV_QFRZN;
+   xpt_freeze_devq(ccb->ccb_h.path, 1);
+   }
+}
+
 /*
  * Command-mapping helper function - populate this command's s/g table.
  */
@@ -472,9 +481,8 @@ pqi_request_map_helper(void *arg, bus_dma_segment_t *s
 
if(  error || nseg > softs->pqi_cap.max_sg_elem )
{
-   xpt_freeze_simq(softs->os_specific.sim, 1);
-   rcb->cm_ccb->ccb_h.status |= (CAM_REQUEUE_REQ|
-   CAM_RELEASE_SIMQ);
+   rcb->cm_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+   pqi_freeze_ccb(rcb->cm_ccb);
DBG_ERR_BTL(rcb->dvp, "map failed err = %d or nseg(%d) > 
sgelem(%d)\n", 
error, nseg, softs->pqi_cap.max_sg_elem);
pqi_unmap_request(rcb);
@@ -484,9 +492,8 @@ pqi_request_map_helper(void *arg, bus_dma_segment_t *s
 
rcb->sgt = os_mem_alloc(softs, nseg * sizeof(rcb_t));
if (rcb->sgt == NULL) {
-   xpt_freeze_simq(softs->os_specific.sim, 1);
-   rcb->cm_ccb->ccb_h.status |= (CAM_REQUEUE_REQ|
-   CAM_RELEASE_SIMQ);
+   rcb->cm_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+   pqi_freeze_ccb(rcb->cm_ccb);
DBG_ERR_BTL(rcb->dvp, "os_mem_alloc() failed; nseg = %d\n", 
nseg);
pqi_unmap_request(rcb);
xpt_done((union ccb *)rcb->cm_ccb);
@@ -514,9 +521,8 @@ pqi_request_map_helper(void *arg, bus_dma_segment_t *s
 
if (error) {
rcb->req_pending = false;
-   xpt_freeze_simq(softs->os_specific.sim, 1);
-   rcb->cm_ccb->ccb_h.status |= (CAM_REQUEUE_REQ
-   |CAM_RELEASE_SIMQ);
+   rcb->cm_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+   pqi_freeze_ccb(rcb->cm_ccb);
DBG_ERR_BTL(rcb->dvp, "Build IO failed, error = %d\n", error);
pqi_unmap_request(rcb);
xpt_done((union ccb *)rcb->cm_ccb);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345550 - head/sys/kern

2019-03-26 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Mar 26 18:03:18 2019
New Revision: 345550
URL: https://svnweb.freebsd.org/changeset/base/345550

Log:
  Change default value of kern.bootfile to reflect reality
  
  In most cases kernel.bootfile is populated from the information
  provided by loader(8). There are certain scenarios when loader
  is not available, for instance when kernel is loaded by u-boot
  or some other BootROM directly. In this case the default value
  "/kernel" points to invalid location and breaks some functinality,
  like using installkernel on self-hosted system or dtrace's CTF
  lookup. This can be fixed by setting the value manually but the
  default that reflects correct location is better than default that
  points to invalid one.
  
  Current default was set around FreeBSD 1, when "/kernel" was the
  actual path. Transition to /boot/kernel/kernel happened circa FreeBSD 3.
  
  PR:   221550
  Reviewed by:  ian, imp
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18902

Modified:
  head/sys/kern/kern_mib.c

Modified: head/sys/kern/kern_mib.c
==
--- head/sys/kern/kern_mib.cTue Mar 26 15:47:13 2019(r345549)
+++ head/sys/kern/kern_mib.cTue Mar 26 18:03:18 2019(r345550)
@@ -136,7 +136,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_R
 SYSCTL_NULL_INT_PTR, 0, "Whether saved set-group/user ID is available");
 #endif
 
-char kernelname[MAXPATHLEN] = "/kernel";   /* XXX bloat */
+char kernelname[MAXPATHLEN] = "/boot/kernel/kernel";   /* XXX bloat */
 
 SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE,
 kernelname, sizeof kernelname, "Name of kernel file booted");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345551 - head/sys/vm

2019-03-26 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 26 19:11:15 2019
New Revision: 345551
URL: https://svnweb.freebsd.org/changeset/base/345551

Log:
  Improve error reporting when the swap pager runs out of memory.
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D19699

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cTue Mar 26 18:03:18 2019(r345550)
+++ head/sys/vm/swap_pager.cTue Mar 26 19:11:15 2019(r345551)
@@ -1510,9 +1510,10 @@ swp_pager_async_iodone(struct buf *bp)
vm_object_t object = NULL;
 
/*
-* report error
+* Report error - unless we ran out of memory, in which case
+* we've already logged it in swapgeom_strategy().
 */
-   if (bp->b_ioflags & BIO_ERROR) {
+   if (bp->b_ioflags & BIO_ERROR && bp->b_error != ENOMEM) {
printf(
"swap_pager: I/O error - %s failed; blkno %ld,"
"size %ld, error %d\n",
@@ -2692,6 +2693,7 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp)
mtx_unlock(&sw_dev_mtx);
bp->b_error = ENOMEM;
bp->b_ioflags |= BIO_ERROR;
+   printf("swap_pager: cannot allocate bio\n");
bufdone(bp);
return;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2019-03-26 Thread Ed Maste
Author: emaste
Date: Tue Mar 26 19:35:41 2019
New Revision: 345552
URL: https://svnweb.freebsd.org/changeset/base/345552

Log:
  DTF_REWIND does nothing (since r247236) so retire its use
  
  Reviewed by:  cem
  Differential Revision:https://reviews.freebsd.org/D19663

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

Modified: head/lib/libc/gen/fts-compat.c
==
--- head/lib/libc/gen/fts-compat.c  Tue Mar 26 19:11:15 2019
(r345551)
+++ head/lib/libc/gen/fts-compat.c  Tue Mar 26 19:35:41 2019
(r345552)
@@ -647,9 +647,9 @@ fts_build(FTS *sp, int type)
 */
 #ifdef FTS_WHITEOUT
if (ISSET(FTS_WHITEOUT))
-   oflag = DTF_NODUP | DTF_REWIND;
+   oflag = DTF_NODUP;
else
-   oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
+   oflag = DTF_HIDEW | DTF_NODUP;
 #else
 #define __opendir2(path, flag) opendir(path)
 #endif

Modified: head/lib/libc/gen/fts-compat11.c
==
--- head/lib/libc/gen/fts-compat11.cTue Mar 26 19:11:15 2019
(r345551)
+++ head/lib/libc/gen/fts-compat11.cTue Mar 26 19:35:41 2019
(r345552)
@@ -644,9 +644,9 @@ fts_build(FTS11 *sp, int type)
 */
 #ifdef FTS_WHITEOUT
if (ISSET(FTS_WHITEOUT))
-   oflag = DTF_NODUP | DTF_REWIND;
+   oflag = DTF_NODUP;
else
-   oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
+   oflag = DTF_HIDEW | DTF_NODUP;
 #else
 #define __opendir2(path, flag) opendir(path)
 #endif

Modified: head/lib/libc/gen/fts.c
==
--- head/lib/libc/gen/fts.c Tue Mar 26 19:11:15 2019(r345551)
+++ head/lib/libc/gen/fts.c Tue Mar 26 19:35:41 2019(r345552)
@@ -641,9 +641,9 @@ fts_build(FTS *sp, int type)
 */
 #ifdef FTS_WHITEOUT
if (ISSET(FTS_WHITEOUT))
-   oflag = DTF_NODUP | DTF_REWIND;
+   oflag = DTF_NODUP;
else
-   oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
+   oflag = DTF_HIDEW | DTF_NODUP;
 #else
 #define __opendir2(path, flag) opendir(path)
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345553 - head/sbin/init

2019-03-26 Thread Ed Maste
Author: emaste
Date: Tue Mar 26 19:38:25 2019
New Revision: 345553
URL: https://svnweb.freebsd.org/changeset/base/345553

Log:
  init: pedantic correction to "can't exec" script warning
  
  Direct /etc/rc exec was introduced in r337321, with a fallback to
  passing it to sh if direct exec fails.  "Can't exec" is slightly
  misleading in this case (the script is still executed, just not
  directly).

Modified:
  head/sbin/init/init.c

Modified: head/sbin/init/init.c
==
--- head/sbin/init/init.c   Tue Mar 26 19:35:41 2019(r345552)
+++ head/sbin/init/init.c   Tue Mar 26 19:38:25 2019(r345553)
@@ -1083,7 +1083,7 @@ execute_script(char *argv[])
error = access(script, X_OK);
if (error == 0) {
execv(script, argv + 1);
-   warning("can't exec %s: %m", script);
+   warning("can't directly exec %s: %m", script);
} else if (errno != EACCES) {
warning("can't access %s: %m", script);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345554 - head/stand/i386/zfsboot

2019-03-26 Thread Ed Maste
Author: emaste
Date: Tue Mar 26 20:32:05 2019
New Revision: 345554
URL: https://svnweb.freebsd.org/changeset/base/345554

Log:
  stand: remove CLANG_NO_IAS from zfsldr
  
  Many components under stand/ had CLANG_NO_IAS added when Clang's
  Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
  gained support quite some time ago, and we can now build stand/ with
  IAS.
  
  Note that in some cases there are small differences in the generated
  output, so CLANG_NO_IAS should be removed only after testing (or after
  finding no differences in the output).  For zfsldr I compared objdump
  output between GNU as- and Clang IAS-built zfsldr and .text was
  identical (changes were limited to the object's ELF headers and debug
  info).
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/stand/i386/zfsboot/Makefile

Modified: head/stand/i386/zfsboot/Makefile
==
--- head/stand/i386/zfsboot/MakefileTue Mar 26 19:38:25 2019
(r345553)
+++ head/stand/i386/zfsboot/MakefileTue Mar 26 20:32:05 2019
(r345554)
@@ -78,6 +78,3 @@ zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o
 SRCS=  zfsboot.c
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.zfsldr.S=   ${CLANG_NO_IAS}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345555 - head/share/mk

2019-03-26 Thread John Baldwin
Author: jhb
Date: Tue Mar 26 20:44:02 2019
New Revision: 34
URL: https://svnweb.freebsd.org/changeset/base/34

Log:
  Remove the TIMED src option from the list of options.
  
  This was missed in r342139 when timed(8) was removed and fixes a
  warning when running makeman to regenerate src.conf.5.
  
  Differential Revision:https://reviews.freebsd.org/D19486

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Tue Mar 26 20:32:05 2019(r345554)
+++ head/share/mk/src.opts.mk   Tue Mar 26 20:44:02 2019(r34)
@@ -182,7 +182,6 @@ __DEFAULT_YES_OPTIONS = \
 TELNET \
 TEXTPROC \
 TFTP \
-TIMED \
 UNBOUND \
 USB \
 UTMPX \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345557 - head/tools/build/mk

2019-03-26 Thread John Baldwin
Author: jhb
Date: Tue Mar 26 20:56:12 2019
New Revision: 345557
URL: https://svnweb.freebsd.org/changeset/base/345557

Log:
  Add special psuedo-options for the base/{binutils,gcc} ports.
  
  The WITH_PORT_BASE_{BINUTILS,GCC} options are used to prevent 'make check-old'
  and 'make delete-old' from deleting files installed by the base/binutils
  and base/gcc packages as normally one disables the in-tree variants
  (e.g. WITHOUT_BINUTILS) when using these packages.
  
  Reviewed by:  bapt (earlier version)
  Differential Revision:https://reviews.freebsd.org/D19483

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Tue Mar 26 20:47:30 
2019(r345556)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Tue Mar 26 20:56:12 
2019(r345557)
@@ -225,12 +225,14 @@ OLD_DIRS+=usr/share/examples/bhyve
 .endif
 
 .if ${MK_BINUTILS} == no
+.if !defined(WITH_PORT_BASE_BINUTILS)
 OLD_FILES+=usr/bin/as
 .if ${MK_LLD_IS_LD} == no
 OLD_FILES+=usr/bin/ld
 OLD_FILES+=usr/share/man/man1/ld.1.gz
 .endif
 OLD_FILES+=usr/bin/objdump
+.endif
 OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.x
 OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xbn
 OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xc
@@ -426,6 +428,7 @@ OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xsc
 OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xsw
 OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xu
 OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xw
+.if !defined(WITH_PORT_BASE_BINUTILS)
 OLD_FILES+=usr/share/man/man1/as.1.gz
 OLD_FILES+=usr/share/man/man1/objdump.1.gz
 OLD_FILES+=usr/share/man/man7/as.7.gz
@@ -433,9 +436,12 @@ OLD_FILES+=usr/share/man/man7/ld.7.gz
 OLD_FILES+=usr/share/man/man7/ldint.7.gz
 OLD_FILES+=usr/share/man/man7/binutils.7.gz
 .endif
+.endif
+.if !defined(WITH_PORT_BASE_BINUTILS)
 .if ${MK_BINUTILS} == no || ${MK_LLD_IS_LD} == yes
 OLD_FILES+=usr/bin/ld.bfd
 .endif
+.endif
 
 .if ${MK_BLACKLIST} == no
 OLD_FILES+=etc/blacklistd.conf
@@ -1700,7 +1706,9 @@ OLD_FILES+=usr/share/man/man8/ftpd.8.gz
 .endif
 
 .if ${MK_GNUCXX} == no
+.if !defined(WITH_PORT_BASE_GCC)
 OLD_FILES+=usr/bin/g++
+.endif
 OLD_FILES+=usr/include/c++/4.2/algorithm
 OLD_FILES+=usr/include/c++/4.2/backward/algo.h
 OLD_FILES+=usr/include/c++/4.2/backward/algobase.h
@@ -2708,8 +2716,10 @@ OLD_FILES+=usr/share/man/man8/unstr.8.gz
 .endif
 
 .if ${MK_GCC} == no
+.if !defined(WITH_PORT_BASE_GCC)
 OLD_FILES+=usr/bin/g++
 OLD_FILES+=usr/bin/gcc
+.endif
 OLD_FILES+=usr/bin/gcpp
 OLD_FILES+=usr/bin/gperf
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
@@ -2746,14 +2756,17 @@ OLD_LIBS+=usr/lib32/libgomp.so.1
 OLD_FILES+=usr/lib32/libgomp_p.a
 OLD_FILES+=usr/libexec/cc1
 OLD_FILES+=usr/libexec/cc1plus
+.if !defined(WITH_PORT_BASE_GCC)
 OLD_FILES+=usr/share/man/man1/g++.1.gz
 OLD_FILES+=usr/share/man/man1/gcc.1.gz
+.endif
 OLD_FILES+=usr/share/man/man1/gcpp.1.gz
 OLD_FILES+=usr/share/man/man1/gperf.1.gz
 OLD_FILES+=usr/share/man/man1/gperf.7.gz
 .endif
 
-.if (${MK_GCOV} == no || ${MK_GCC} == no) && ${MK_LLVM_COV} == no
+.if (${MK_GCOV} == no || ${MK_GCC} == no) && ${MK_LLVM_COV} == no && \
+!defined(WITH_PORT_BASE_GCC)
 OLD_FILES+=usr/bin/gcov
 OLD_FILES+=usr/share/man/man1/gcov.1.gz
 .endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345558 - head/sys/netpfil/pf

2019-03-26 Thread Ed Maste
Author: emaste
Date: Tue Mar 26 21:20:42 2019
New Revision: 345558
URL: https://svnweb.freebsd.org/changeset/base/345558

Log:
  pf: use UID_ROOT and GID_WHEEL named constants in make_dev
  
  No functional change but improves consistency and greppability of
  make_dev calls.
  
  Discussed with: kp

Modified:
  head/sys/netpfil/pf/pf_ioctl.c

Modified: head/sys/netpfil/pf/pf_ioctl.c
==
--- head/sys/netpfil/pf/pf_ioctl.c  Tue Mar 26 20:56:12 2019
(r345557)
+++ head/sys/netpfil/pf/pf_ioctl.c  Tue Mar 26 21:20:42 2019
(r345558)
@@ -4353,7 +4353,7 @@ pf_load(void)
 
pf_mtag_initialize();
 
-   pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME);
+   pf_dev = make_dev(&pf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, PF_NAME);
if (pf_dev == NULL)
return (ENOMEM);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345560 - head/sys/netinet

2019-03-26 Thread Mark Johnston
Author: markj
Date: Tue Mar 26 22:14:50 2019
New Revision: 345560
URL: https://svnweb.freebsd.org/changeset/base/345560

Log:
  Add CTLFLAG_VNET to the net.inet.icmp.tstamprepl definition.
  
  Reported by:  Hans Fiedler 
  MFC after:3 days

Modified:
  head/sys/netinet/ip_icmp.c

Modified: head/sys/netinet/ip_icmp.c
==
--- head/sys/netinet/ip_icmp.c  Tue Mar 26 21:30:26 2019(r345559)
+++ head/sys/netinet/ip_icmp.c  Tue Mar 26 22:14:50 2019(r345560)
@@ -154,7 +154,7 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFL
 
 VNET_DEFINE_STATIC(int, icmptstamprepl) = 1;
 #defineV_icmptstampreplVNET(icmptstamprepl)
-SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW,
+SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmptstamprepl), 0,
"Respond to ICMP Timestamp packets");
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2019-03-26 Thread Conrad Meyer
Author: cem
Date: Tue Mar 26 22:45:41 2019
New Revision: 345562
URL: https://svnweb.freebsd.org/changeset/base/345562

Log:
  x86: Use XSAVEOPT for fpusave(), when available
  
  Remove redundant npxsave_core definition while here.
  
  Suggested by: Anton Rang
  Reviewed by:  kib, Anton Rang 
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D19665

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/i386/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Tue Mar 26 22:34:07 2019(r345561)
+++ head/sys/amd64/amd64/fpu.c  Tue Mar 26 22:45:41 2019(r345562)
@@ -100,6 +100,17 @@ xsave(char *addr, uint64_t mask)
"memory");
 }
 
+static __inline void
+xsaveopt(char *addr, uint64_t mask)
+{
+   uint32_t low, hi;
+
+   low = mask;
+   hi = mask >> 32;
+   __asm __volatile("xsaveopt %0" : "=m" (*addr) : "a" (low), "d" (hi) :
+   "memory");
+}
+
 #else  /* !(__GNUCLIKE_ASM && !lint) */
 
 void   fldcw(u_short cw);
@@ -113,6 +124,7 @@ voidldmxcsr(u_int csr);
 void   stmxcsr(u_int *csr);
 void   xrstor(char *addr, uint64_t mask);
 void   xsave(char *addr, uint64_t mask);
+void   xsaveopt(char *addr, uint64_t mask);
 
 #endif /* __GNUCLIKE_ASM && !lint */
 
@@ -158,6 +170,13 @@ struct xsave_area_elm_descr {
 } *xsave_area_desc;
 
 static void
+fpusave_xsaveopt(void *addr)
+{
+
+   xsaveopt((char *)addr, xsave_mask);
+}
+
+static void
 fpusave_xsave(void *addr)
 {
 
@@ -201,7 +220,10 @@ DEFINE_IFUNC(, void, fpusave, (void *), static)
 {
 
init_xsave();
-   return (use_xsave ? fpusave_xsave : fpusave_fxsave);
+   if (use_xsave)
+   return ((cpu_stdext_feature & CPUID_EXTSTATE_XSAVEOPT) != 0 ?
+   fpusave_xsaveopt : fpusave_xsave);
+   return (fpusave_fxsave);
 }
 
 DEFINE_IFUNC(, void, fpurestore, (void *), static)
@@ -356,7 +378,7 @@ fpuinitstate(void *arg __unused)
saveintr = intr_disable();
stop_emulating();
 
-   fpusave(fpu_initialstate);
+   fpusave_fxsave(fpu_initialstate);
if (fpu_initialstate->sv_env.en_mxcsr_mask)
cpu_mxcsr_mask = fpu_initialstate->sv_env.en_mxcsr_mask;
else

Modified: head/sys/i386/i386/npx.c
==
--- head/sys/i386/i386/npx.cTue Mar 26 22:34:07 2019(r345561)
+++ head/sys/i386/i386/npx.cTue Mar 26 22:45:41 2019(r345562)
@@ -313,7 +313,7 @@ cleanup:
 }
 
 static void
-npxsave_xsaveopt(union savefpu *addr)
+fpusave_xsaveopt(union savefpu *addr)
 {
 
xsaveopt((char *)addr, xsave_mask);
@@ -352,29 +352,18 @@ init_xsave(void)
TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave);
 }
 
-DEFINE_IFUNC(, void, npxsave_core, (union savefpu *), static)
+DEFINE_IFUNC(, void, fpusave, (union savefpu *), static)
 {
 
init_xsave();
if (use_xsave)
return ((cpu_stdext_feature & CPUID_EXTSTATE_XSAVEOPT) != 0 ?
-   npxsave_xsaveopt : fpusave_xsave);
+   fpusave_xsaveopt : fpusave_xsave);
if (cpu_fxsr)
return (fpusave_fxsave);
return (fpusave_fnsave);
 }
 
-DEFINE_IFUNC(, void, fpusave, (union savefpu *), static)
-{
-
-   init_xsave();
-   if (use_xsave)
-   return (fpusave_xsave);
-   if (cpu_fxsr)
-   return (fpusave_fxsave);
-   return (fpusave_fnsave);
-}
-
 /*
  * Enable XSAVE if supported and allowed by user.
  * Calculate the xsave_mask.
@@ -494,7 +483,10 @@ npxinitstate(void *arg __unused)
saveintr = intr_disable();
stop_emulating();
 
-   fpusave(npx_initialstate);
+   if (cpu_fxsr)
+   fpusave_fxsave(npx_initialstate);
+   else
+   fpusave_fnsave(npx_initialstate);
if (cpu_fxsr) {
if (npx_initialstate->sv_xmm.sv_env.en_mxcsr_mask)
cpu_mxcsr_mask = 
@@ -922,7 +914,7 @@ npxsave(union savefpu *addr)
 {
 
stop_emulating();
-   npxsave_core(addr);
+   fpusave(addr);
 }
 
 void npxswitch(struct thread *td, struct pcb *pcb);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"