svn commit: r345778 - in head/gnu/usr.bin/gdb: gdb kgdb

2019-09-03 Thread Ed Maste
Author: emaste
Date: Mon Apr  1 19:19:51 2019
New Revision: 345778
URL: https://svnweb.freebsd.org/changeset/base/345778

Log:
  Fix gdb/kgdb build under WITH_PIE
  
  Explicitly specified bare .a libraries need ${PIE_SUFFIX}.
  
  Reported by:  David E. Cross, on twitter
  Sponsored by: The FreeBSD Foundation

Modified:
  head/gnu/usr.bin/gdb/gdb/Makefile
  head/gnu/usr.bin/gdb/kgdb/Makefile

Modified: head/gnu/usr.bin/gdb/gdb/Makefile
==
--- head/gnu/usr.bin/gdb/gdb/Makefile   Mon Apr  1 19:08:05 2019
(r345777)
+++ head/gnu/usr.bin/gdb/gdb/Makefile   Mon Apr  1 19:19:51 2019
(r345778)
@@ -3,9 +3,10 @@
 PROG=  gdb${GDB_SUFFIX}
 SRCS=  gdb.c
 
-BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
-   ${OBJ_BU}/libiberty/libiberty.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
+BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \
+   ${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \
+   ${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a
+GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a
 
 # libthread_db.so calls back into gdb for the proc services.  Make all the
 # global symbols visible.

Modified: head/gnu/usr.bin/gdb/kgdb/Makefile
==
--- head/gnu/usr.bin/gdb/kgdb/Makefile  Mon Apr  1 19:08:05 2019
(r345777)
+++ head/gnu/usr.bin/gdb/kgdb/Makefile  Mon Apr  1 19:19:51 2019
(r345778)
@@ -4,9 +4,10 @@ PROG=  kgdb${GDB_SUFFIX}
 SRCS=  main.c kld.c kthr.c trgt.c trgt_${TARGET_CPUARCH}.c
 WARNS?=2
 
-BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
-   ${OBJ_BU}/libiberty/libiberty.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
+BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \
+   ${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \
+   ${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a
+GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a
 
 DPADD= ${GDBLIBS} ${BULIBS}
 LDADD= ${GDBLIBS} ${BULIBS}


___
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: r345693 - head/libexec/rtld-elf/arm

2019-09-03 Thread Ed Maste
On Fri, 29 Mar 2019 at 10:35, Ed Maste  wrote:
>
> Author: emaste
> Date: Fri Mar 29 14:35:23 2019
> New Revision: 345693
> URL: https://svnweb.freebsd.org/changeset/base/345693
>
> Log:
>   rtld: attempt to fix reloc_nonplt_object TLS allocation

... on arm


___
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: r345693 - head/libexec/rtld-elf/arm

2019-09-03 Thread Ed Maste
Author: emaste
Date: Fri Mar 29 14:35:23 2019
New Revision: 345693
URL: https://svnweb.freebsd.org/changeset/base/345693

Log:
  rtld: attempt to fix reloc_nonplt_object TLS allocation
  
  allocate_tls_offset returns true on success.  This still needs more
  testing and review, but this change is consistent with other archs.
  
  PR:   236880
  Reported by:  Andrew Gierth 
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/libexec/rtld-elf/arm/reloc.c

Modified: head/libexec/rtld-elf/arm/reloc.c
==
--- head/libexec/rtld-elf/arm/reloc.c   Fri Mar 29 14:34:51 2019
(r345692)
+++ head/libexec/rtld-elf/arm/reloc.c   Fri Mar 29 14:35:23 2019
(r345693)
@@ -319,7 +319,7 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel
if (def == NULL)
return -1;
 
-   if (!defobj->tls_done && allocate_tls_offset(obj))
+   if (!defobj->tls_done && !allocate_tls_offset(obj))
return -1;
 
tmp = (Elf_Addr)def->st_value + defobj->tlsoffset;


___
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: r345694 - head/libexec/rtld-elf/mips

2019-09-03 Thread Ed Maste
Author: emaste
Date: Fri Mar 29 15:07:00 2019
New Revision: 345694
URL: https://svnweb.freebsd.org/changeset/base/345694

Log:
  rtld: attempt to fix reloc_non_plt TLS allocation on MIPS
  
  allocate_tls_offset returns true on success.  The same issue existed
  on arm and was fixed in r345693.
  
  PR:   236880
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/libexec/rtld-elf/mips/reloc.c

Modified: head/libexec/rtld-elf/mips/reloc.c
==
--- head/libexec/rtld-elf/mips/reloc.c  Fri Mar 29 14:35:23 2019
(r345693)
+++ head/libexec/rtld-elf/mips/reloc.c  Fri Mar 29 15:07:00 2019
(r345694)
@@ -588,7 +588,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int
if (def == NULL)
return -1;
 
-   if (!defobj->tls_done && allocate_tls_offset(obj))
+   if (!defobj->tls_done && !allocate_tls_offset(obj))
return -1;
 
val += (Elf_Addr)def->st_value - TLS_DTP_OFFSET;
@@ -616,7 +616,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int
if (def == NULL)
return -1;
 
-   if (!defobj->tls_done && allocate_tls_offset(obj))
+   if (!defobj->tls_done && !allocate_tls_offset(obj))
return -1;
 
val += (Elf_Addr)(def->st_value + defobj->tlsoffset


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

2019-09-03 Thread Ed Maste
Author: emaste
Date: Thu Mar 28 10:56:27 2019
New Revision: 345638
URL: https://svnweb.freebsd.org/changeset/base/345638

Log:
  Revert change accidentally committed along with r345625
  
  Reported by:  Oliver Pinter 

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Thu Mar 28 09:51:37 2019(r345637)
+++ head/sys/sys/elf_common.h   Thu Mar 28 10:56:27 2019(r345638)
@@ -763,8 +763,7 @@ typedef struct {
 #defineNT_FREEBSD_FEATURE_CTL  4
 
 /* NT_FREEBSD_FEATURE_CTL desc[0] bits */
-#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
-#defineNT_FREEBSD_FCTL_IMPLIED_MAX_PROT0x0002
+#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
 
 /* Values for n_type.  Used in core files. */
 #defineNT_PRSTATUS 1   /* Process status. */


___
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: r345640 - head/contrib/elftoolchain/readelf

2019-09-03 Thread Ed Maste
Author: emaste
Date: Thu Mar 28 13:27:34 2019
New Revision: 345640
URL: https://svnweb.freebsd.org/changeset/base/345640

Log:
  Revert other accidentally committed part of r345625

Modified:
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 12:28:29 2019
(r345639)
+++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 13:27:34 2019
(r345640)
@@ -3490,7 +3490,6 @@ dump_notes(struct readelf *re)
 
 static struct flag_desc note_feature_ctl_flags[] = {
{ NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" },
-   { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" },
{ 0, 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: r345646 - head/contrib/elftoolchain/readelf

2019-09-03 Thread Ed Maste
Author: emaste
Date: Thu Mar 28 17:30:47 2019
New Revision: 345646
URL: https://svnweb.freebsd.org/changeset/base/345646

Log:
  readelf: add newline after dumping dynamic FLAGS / FLAGS_1
  
  All three dump_flags() callers need a newline after printing the flags.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 17:22:31 2019
(r345645)
+++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 17:30:47 2019
(r345646)
@@ -2741,6 +2741,7 @@ dump_flags(struct flag_desc *desc, uint64_t val)
}
if (val != 0)
printf(" unknown (0x%jx)", (uintmax_t)val);
+   printf("\n");
 }
 
 static struct flag_desc dt_flags[] = {
@@ -3524,7 +3525,6 @@ dump_notes_data(const char *name, uint32_t type, const
goto unknown;
printf("   Features:");
dump_flags(note_feature_ctl_flags, ubuf[0]);
-   printf("\n");
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"


svn commit: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys

2019-09-03 Thread Ed Maste
Author: emaste
Date: Thu Mar 28 02:12:32 2019
New Revision: 345625
URL: https://svnweb.freebsd.org/changeset/base/345625

Log:
  revert r341429 "disable BIND_NOW in libc, libthr, and rtld"
  
  r345620 by kib@ fixed the rtld issue that caused a crash at startup
  during resolution of libc's ifuncs with BIND_NOW.
  
  PR:   23
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/elftoolchain/readelf/readelf.c
  head/lib/libc/Makefile
  head/lib/libthr/Makefile
  head/libexec/rtld-elf/Makefile
  head/sys/sys/elf_common.h

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 01:12:44 2019
(r345624)
+++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 02:12:32 2019
(r345625)
@@ -3490,6 +3490,7 @@ dump_notes(struct readelf *re)
 
 static struct flag_desc note_feature_ctl_flags[] = {
{ NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" },
+   { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" },
{ 0, NULL }
 };
 

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Thu Mar 28 01:12:44 2019(r345624)
+++ head/lib/libc/Makefile  Thu Mar 28 02:12:32 2019(r345625)
@@ -6,8 +6,6 @@ SHLIBDIR?= /lib
 
 .include 
 
-# BIND_NOW in libc results in segfault at startup (PR 23)
-MK_BIND_NOW=   no
 # Force building of libc_pic.a
 MK_TOOLCHAIN=  yes
 

Modified: head/lib/libthr/Makefile
==
--- head/lib/libthr/MakefileThu Mar 28 01:12:44 2019(r345624)
+++ head/lib/libthr/MakefileThu Mar 28 02:12:32 2019(r345625)
@@ -9,7 +9,6 @@ PACKAGE=clibs
 SHLIBDIR?= /lib
 
 .include 
-MK_BIND_NOW= no
 MK_SSP=no
 
 LIB=thr

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Thu Mar 28 01:12:44 2019
(r345624)
+++ head/libexec/rtld-elf/Makefile  Thu Mar 28 02:12:32 2019
(r345625)
@@ -6,7 +6,6 @@
 
 .include 
 PACKAGE=   clibs
-MK_BIND_NOW=   no
 MK_PIE=no # Always position independent using local rules
 MK_SSP=no
 

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Thu Mar 28 01:12:44 2019(r345624)
+++ head/sys/sys/elf_common.h   Thu Mar 28 02:12:32 2019(r345625)
@@ -763,7 +763,8 @@ typedef struct {
 #defineNT_FREEBSD_FEATURE_CTL  4
 
 /* NT_FREEBSD_FEATURE_CTL desc[0] bits */
-#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
+#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
+#defineNT_FREEBSD_FCTL_IMPLIED_MAX_PROT0x0002
 
 /* Values for n_type.  Used in core files. */
 #defineNT_PRSTATUS 1   /* Process status. */


___
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: r345583 - head/tools/tools/makeroot

2019-09-03 Thread Ed Maste
Author: emaste
Date: Wed Mar 27 17:28:23 2019
New Revision: 345583
URL: https://svnweb.freebsd.org/changeset/base/345583

Log:
  revert r302146: makeroot: zero out subsecond component of time= keywords
  
  After r345281 by mhorne subsecond components are supported.
  
  PR:   194703
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tools/tools/makeroot/makeroot.sh

Modified: head/tools/tools/makeroot/makeroot.sh
==
--- head/tools/tools/makeroot/makeroot.sh   Wed Mar 27 16:45:30 2019
(r345582)
+++ head/tools/tools/makeroot/makeroot.sh   Wed Mar 27 17:28:23 2019
(r345583)
@@ -238,9 +238,5 @@ if [ -n "${SIZE}" ]; then
 SIZEFLAG="-s ${SIZE}"
 fi
 
-# Zero out subsecond component of time= keywords as they are currently not
-# supported by makefs
-sed -i '' -E 's/(time=[0-9]*)\.[0-9]*/\1.0/' ${manifest}
-
 cd ${BSDROOT}; makefs ${DUPFLAG} -N ${DBDIR} ${SIZEFLAG} ${BFLAG} \
  -t ffs ${LABELFLAG} -f 256 ${IMGFILE} ${manifest}


___
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: r345574 - vendor-crypto/openssh/dist

2019-09-03 Thread Ed Maste
Author: emaste
Date: Wed Mar 27 14:07:09 2019
New Revision: 345574
URL: https://svnweb.freebsd.org/changeset/base/345574

Log:
  Apply commit 3d896c15 from openssh-portable:
  
  upstream: when checking that filenames sent by the server side
  
  match what the client requested, be prepared to handle shell-style brace
  alternations, e.g. "{foo,bar}".
  
  "looks good to me" millert@ + in snaps for the last week courtesy
  deraadt@
  
  OpenBSD-Commit-ID: 3b1ce7639b0b25b2248e3a30f561a548f6815f3e
  
  Discussed with:   des

Modified:
  vendor-crypto/openssh/dist/scp.c

Modified: vendor-crypto/openssh/dist/scp.c
==
--- vendor-crypto/openssh/dist/scp.cWed Mar 27 12:25:46 2019
(r345573)
+++ vendor-crypto/openssh/dist/scp.cWed Mar 27 14:07:09 2019
(r345574)
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.203 2019/01/27 07:14:11 jmc Exp $ */
+/* $OpenBSD: scp.c,v 1.204 2019/02/10 11:15:52 djm Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -626,6 +626,253 @@ parse_scp_uri(const char *uri, char **userp, char **ho
return r;
 }
 
+/* Appends a string to an array; returns 0 on success, -1 on alloc failure */
+static int
+append(char *cp, char ***ap, size_t *np)
+{
+   char **tmp;
+
+   if ((tmp = reallocarray(*ap, *np + 1, sizeof(*tmp))) == NULL)
+   return -1;
+   tmp[(*np)] = cp;
+   (*np)++;
+   *ap = tmp;
+   return 0;
+}
+
+/*
+ * Finds the start and end of the first brace pair in the pattern.
+ * returns 0 on success or -1 for invalid patterns.
+ */
+static int
+find_brace(const char *pattern, int *startp, int *endp)
+{
+   int i;
+   int in_bracket, brace_level;
+
+   *startp = *endp = -1;
+   in_bracket = brace_level = 0;
+   for (i = 0; i < INT_MAX && *endp < 0 && pattern[i] != '\0'; i++) {
+   switch (pattern[i]) {
+   case '\\':
+   /* skip next character */
+   if (pattern[i + 1] != '\0')
+   i++;
+   break;
+   case '[':
+   in_bracket = 1;
+   break;
+   case ']':
+   in_bracket = 0;
+   break;
+   case '{':
+   if (in_bracket)
+   break;
+   if (pattern[i + 1] == '}') {
+   /* Protect a single {}, for find(1), like csh */
+   i++; /* skip */
+   break;
+   }
+   if (*startp == -1)
+   *startp = i;
+   brace_level++;
+   break;
+   case '}':
+   if (in_bracket)
+   break;
+   if (*startp < 0) {
+   /* Unbalanced brace */
+   return -1;
+   }
+   if (--brace_level <= 0)
+   *endp = i;
+   break;
+   }
+   }
+   /* unbalanced brackets/braces */
+   if (*endp < 0 && (*startp >= 0 || in_bracket))
+   return -1;
+   return 0;
+}
+
+/*
+ * Assembles and records a successfully-expanded pattern, returns -1 on
+ * alloc failure.
+ */
+static int
+emit_expansion(const char *pattern, int brace_start, int brace_end,
+int sel_start, int sel_end, char ***patternsp, size_t *npatternsp)
+{
+   char *cp;
+   int o = 0, tail_len = strlen(pattern + brace_end + 1);
+
+   if ((cp = malloc(brace_start + (sel_end - sel_start) +
+   tail_len + 1)) == NULL)
+   return -1;
+
+   /* Pattern before initial brace */
+   if (brace_start > 0) {
+   memcpy(cp, pattern, brace_start);
+   o = brace_start;
+   }
+   /* Current braced selection */
+   if (sel_end - sel_start > 0) {
+   memcpy(cp + o, pattern + sel_start,
+   sel_end - sel_start);
+   o += sel_end - sel_start;
+   }
+   /* Remainder of pattern after closing brace */
+   if (tail_len > 0) {
+   memcpy(cp + o, pattern + brace_end + 1, tail_len);
+   o += tail_len;
+   }
+   cp[o] = '\0';
+   if (append(cp, patternsp, npatternsp) != 0) {
+   free(cp);
+   return -1;
+   }
+   return 0;
+}
+
+/*
+ * Expand the first encountered brace in pattern, appending the expanded
+ * patterns it yielded to the *patternsp array.
+ *
+ * Returns 0 on success or -1 on allocation failure.
+ *
+ * Signals whether expansion was performed via *expanded and whether
+ * pattern was invalid via *invalid.
+ 

svn commit: r345576 - head/crypto/openssh

2019-09-03 Thread Ed Maste
Author: emaste
Date: Wed Mar 27 14:35:38 2019
New Revision: 345576
URL: https://svnweb.freebsd.org/changeset/base/345576

Log:
  Merge r345574 from vendor-crypto:
  
  upstream: when checking that filenames sent by the server side
  
  match what the client requested, be prepared to handle shell-style brace
  alternations, e.g. "{foo,bar}".
  
  "looks good to me" millert@ + in snaps for the last week courtesy
  deraadt@
  
  OpenBSD-Commit-ID: 3b1ce7639b0b25b2248e3a30f561a548f6815f3e
  
  Discussed with: des
  Obtained from:OpenSSH-portable 
3d896c157c722bc47adca51a58dca859225b5874

Modified:
  head/crypto/openssh/scp.c
Directory Properties:
  head/crypto/openssh/   (props changed)

Modified: head/crypto/openssh/scp.c
==
--- head/crypto/openssh/scp.c   Wed Mar 27 14:15:35 2019(r345575)
+++ head/crypto/openssh/scp.c   Wed Mar 27 14:35:38 2019(r345576)
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.203 2019/01/27 07:14:11 jmc Exp $ */
+/* $OpenBSD: scp.c,v 1.204 2019/02/10 11:15:52 djm Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -626,6 +626,253 @@ parse_scp_uri(const char *uri, char **userp, char **ho
return r;
 }
 
+/* Appends a string to an array; returns 0 on success, -1 on alloc failure */
+static int
+append(char *cp, char ***ap, size_t *np)
+{
+   char **tmp;
+
+   if ((tmp = reallocarray(*ap, *np + 1, sizeof(*tmp))) == NULL)
+   return -1;
+   tmp[(*np)] = cp;
+   (*np)++;
+   *ap = tmp;
+   return 0;
+}
+
+/*
+ * Finds the start and end of the first brace pair in the pattern.
+ * returns 0 on success or -1 for invalid patterns.
+ */
+static int
+find_brace(const char *pattern, int *startp, int *endp)
+{
+   int i;
+   int in_bracket, brace_level;
+
+   *startp = *endp = -1;
+   in_bracket = brace_level = 0;
+   for (i = 0; i < INT_MAX && *endp < 0 && pattern[i] != '\0'; i++) {
+   switch (pattern[i]) {
+   case '\\':
+   /* skip next character */
+   if (pattern[i + 1] != '\0')
+   i++;
+   break;
+   case '[':
+   in_bracket = 1;
+   break;
+   case ']':
+   in_bracket = 0;
+   break;
+   case '{':
+   if (in_bracket)
+   break;
+   if (pattern[i + 1] == '}') {
+   /* Protect a single {}, for find(1), like csh */
+   i++; /* skip */
+   break;
+   }
+   if (*startp == -1)
+   *startp = i;
+   brace_level++;
+   break;
+   case '}':
+   if (in_bracket)
+   break;
+   if (*startp < 0) {
+   /* Unbalanced brace */
+   return -1;
+   }
+   if (--brace_level <= 0)
+   *endp = i;
+   break;
+   }
+   }
+   /* unbalanced brackets/braces */
+   if (*endp < 0 && (*startp >= 0 || in_bracket))
+   return -1;
+   return 0;
+}
+
+/*
+ * Assembles and records a successfully-expanded pattern, returns -1 on
+ * alloc failure.
+ */
+static int
+emit_expansion(const char *pattern, int brace_start, int brace_end,
+int sel_start, int sel_end, char ***patternsp, size_t *npatternsp)
+{
+   char *cp;
+   int o = 0, tail_len = strlen(pattern + brace_end + 1);
+
+   if ((cp = malloc(brace_start + (sel_end - sel_start) +
+   tail_len + 1)) == NULL)
+   return -1;
+
+   /* Pattern before initial brace */
+   if (brace_start > 0) {
+   memcpy(cp, pattern, brace_start);
+   o = brace_start;
+   }
+   /* Current braced selection */
+   if (sel_end - sel_start > 0) {
+   memcpy(cp + o, pattern + sel_start,
+   sel_end - sel_start);
+   o += sel_end - sel_start;
+   }
+   /* Remainder of pattern after closing brace */
+   if (tail_len > 0) {
+   memcpy(cp + o, pattern + brace_end + 1, tail_len);
+   o += tail_len;
+   }
+   cp[o] = '\0';
+   if (append(cp, patternsp, npatternsp) != 0) {
+   free(cp);
+   return -1;
+   }
+   return 0;
+}
+
+/*
+ * Expand the first encountered brace in pattern, appending the expanded
+ * patterns it yielded to the *patternsp array.
+ *
+ * Returns 0 on success or -1 on allocation failure.
+ *
+ * Signals 

svn commit: r351700 - head/lib/libc/string

2019-09-02 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 13:56:44 2019
New Revision: 351700
URL: https://svnweb.freebsd.org/changeset/base/351700

Log:
  libc: Use musl's optimized memchr
  
  Parentheses added to HASZERO macro to avoid a GCC warning.
  
  Reviewed by:  kib, mjg
  Obtained from:musl (snapshot at commit 4d0a82170a)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D17631

Modified:
  head/lib/libc/string/memchr.c

Modified: head/lib/libc/string/memchr.c
==
--- head/lib/libc/string/memchr.c   Mon Sep  2 13:55:31 2019
(r351699)
+++ head/lib/libc/string/memchr.c   Mon Sep  2 13:56:44 2019
(r351700)
@@ -1,55 +1,54 @@
 /*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: MIT
  *
- * Copyright (c) 1990, 1993
- * The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2005-2014 Rich Felker, et al.
  *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
  *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)memchr.c   8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
 #include 
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
 
-void *
-memchr(const void *s, int c, size_t n)
-{
-   if (n != 0) {
-   const unsigned char *p = s;
+#define SS (sizeof(size_t))
+#define ALIGN (sizeof(size_t)-1)
+#define ONES ((size_t)-1/UCHAR_MAX)
+#define HIGHS (ONES * (UCHAR_MAX/2+1))
+#define HASZERO(x) (((x)-ONES) & ~(x) & HIGHS)
 
-   do {
-   if (*p++ == (unsigned char)c)
-   return ((void *)(p - 1));
-   } while (--n != 0);
+void *memchr(const void *src, int c, size_t n)
+{
+   const unsigned char *s = src;
+   c = (unsigned char)c;
+#ifdef __GNUC__
+   for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--);
+   if (n && *s != c) {
+   typedef size_t __attribute__((__may_alias__)) word;
+   const word *w;
+   size_t k = ONES * c;
+   for (w = (const void *)s; n>=SS && !HASZERO(*w^k); w++, n-=SS);
+   s = (const void *)w;
}
-   return (NULL);
+#endif
+   for (; n && *s != c; s++, n--);
+   return n ? (void *)s : 0;
 }

svn commit: r351698 - head/sys/sys

2019-09-02 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 12:48:18 2019
New Revision: 351698
URL: https://svnweb.freebsd.org/changeset/base/351698

Log:
  Belatedly bump __FreeBSD_version for r351659, gets(3) removal
  
  Reported by:  linimon

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hMon Sep  2 12:46:43 2019(r351697)
+++ head/sys/sys/param.hMon Sep  2 12:48:18 2019(r351698)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300042  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300043  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r351680 - stable/11/sys/dev/vnic

2019-09-01 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 00:39:02 2019
New Revision: 351680
URL: https://svnweb.freebsd.org/changeset/base/351680

Log:
  MFC r351603: vnic: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  Sponsored by: The FreeBSD Foundation

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

Modified: stable/11/sys/dev/vnic/thunder_bgx.c
==
--- stable/11/sys/dev/vnic/thunder_bgx.cMon Sep  2 00:37:59 2019
(r351679)
+++ stable/11/sys/dev/vnic/thunder_bgx.cMon Sep  2 00:39:02 2019
(r351680)
@@ -502,9 +502,8 @@ bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx
bgx_idx += node * MAX_BGX_PER_CN88XX;
bgx = bgx_vnic[bgx_idx];
 
-   if (!bgx) {
-   device_printf(bgx->dev,
-   "BGX%d not yet initialized, ignoring DMAC addition\n",
+   if (bgx == NULL) {
+   printf("BGX%d not yet initialized, ignoring DMAC addition\n",
bgx_idx);
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"


svn commit: r351679 - stable/12/sys/dev/vnic

2019-09-01 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 00:37:59 2019
New Revision: 351679
URL: https://svnweb.freebsd.org/changeset/base/351679

Log:
  MFC r351603: vnic: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  Sponsored by: The FreeBSD Foundation

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

Modified: stable/12/sys/dev/vnic/thunder_bgx.c
==
--- stable/12/sys/dev/vnic/thunder_bgx.cMon Sep  2 00:36:26 2019
(r351678)
+++ stable/12/sys/dev/vnic/thunder_bgx.cMon Sep  2 00:37:59 2019
(r351679)
@@ -502,9 +502,8 @@ bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx
bgx_idx += node * MAX_BGX_PER_CN88XX;
bgx = bgx_vnic[bgx_idx];
 
-   if (!bgx) {
-   device_printf(bgx->dev,
-   "BGX%d not yet initialized, ignoring DMAC addition\n",
+   if (bgx == NULL) {
+   printf("BGX%d not yet initialized, ignoring DMAC addition\n",
bgx_idx);
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"


svn commit: r351678 - stable/12/sys/dev/xdma

2019-09-01 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 00:36:26 2019
New Revision: 351678
URL: https://svnweb.freebsd.org/changeset/base/351678

Log:
  MFC r351621: xdma: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  Sponsored by: The FreeBSD Foundation

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

Modified: stable/12/sys/dev/xdma/xdma_sg.c
==
--- stable/12/sys/dev/xdma/xdma_sg.cMon Sep  2 00:31:05 2019
(r351677)
+++ stable/12/sys/dev/xdma/xdma_sg.cMon Sep  2 00:36:26 2019
(r351678)
@@ -183,8 +183,7 @@ xchan_bufs_alloc(xdma_channel_t *xchan)
xdma = xchan->xdma;
 
if (xdma == NULL) {
-   device_printf(xdma->dev,
-   "%s: Channel was not allocated properly.\n", __func__);
+   printf("%s: Channel was not allocated properly.\n", __func__);
return (-1);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351676 - stable/12/sys/dev/qlxgbe

2019-09-01 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 00:31:03 2019
New Revision: 351676
URL: https://svnweb.freebsd.org/changeset/base/351676

Log:
  MFC r351620: qlxgbe: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  Sponsored by: The FreeBSD Foundation

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

Modified: stable/12/sys/dev/qlxgbe/ql_isr.c
==
--- stable/12/sys/dev/qlxgbe/ql_isr.c   Mon Sep  2 00:29:16 2019
(r351675)
+++ stable/12/sys/dev/qlxgbe/ql_isr.c   Mon Sep  2 00:31:03 2019
(r351676)
@@ -793,7 +793,7 @@ ql_mbx_isr(void *arg)
ha = arg;
 
if (ha == NULL) {
-   device_printf(ha->pci_dev, "%s: arg == NULL\n", __func__);
+   printf("%s: arg == NULL\n", __func__);
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"


svn commit: r351677 - stable/11/sys/dev/qlxgbe

2019-09-01 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 00:31:05 2019
New Revision: 351677
URL: https://svnweb.freebsd.org/changeset/base/351677

Log:
  MFC qlxgbe: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  Sponsored by: The FreeBSD Foundation

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

Modified: stable/11/sys/dev/qlxgbe/ql_isr.c
==
--- stable/11/sys/dev/qlxgbe/ql_isr.c   Mon Sep  2 00:31:03 2019
(r351676)
+++ stable/11/sys/dev/qlxgbe/ql_isr.c   Mon Sep  2 00:31:05 2019
(r351677)
@@ -791,7 +791,7 @@ ql_mbx_isr(void *arg)
ha = arg;
 
if (ha == NULL) {
-   device_printf(ha->pci_dev, "%s: arg == NULL\n", __func__);
+   printf("%s: arg == NULL\n", __func__);
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"


svn commit: r351674 - stable/12/sys/arm/samsung/exynos

2019-09-01 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 00:29:14 2019
New Revision: 351674
URL: https://svnweb.freebsd.org/changeset/base/351674

Log:
  MFC r351618, r351619: exynos5: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sys/arm/samsung/exynos/exynos5_combiner.c
  stable/12/sys/arm/samsung/exynos/exynos5_pad.c

Modified: stable/12/sys/arm/samsung/exynos/exynos5_combiner.c
==
--- stable/12/sys/arm/samsung/exynos/exynos5_combiner.c Sun Sep  1 22:22:43 
2019(r351673)
+++ stable/12/sys/arm/samsung/exynos/exynos5_combiner.c Mon Sep  2 00:29:14 
2019(r351674)
@@ -314,7 +314,7 @@ combiner_setup_intr(char *source_name, void (*ih)(void
sc = combiner_sc;
 
if (sc == NULL) {
-   device_printf(sc->dev, "Error: combiner is not attached\n");
+   printf("%s: error: combiner is not attached\n", __func__);
return;
}
 

Modified: stable/12/sys/arm/samsung/exynos/exynos5_pad.c
==
--- stable/12/sys/arm/samsung/exynos/exynos5_pad.c  Sun Sep  1 22:22:43 
2019(r351673)
+++ stable/12/sys/arm/samsung/exynos/exynos5_pad.c  Mon Sep  2 00:29:14 
2019(r351674)
@@ -410,7 +410,7 @@ pad_setup_intr(int gpio_number, void (*ih)(void *), vo
sc = gpio_sc;
 
if (sc == NULL) {
-   device_printf(sc->dev, "Error: pad is not attached\n");
+   printf("%s: Error: pad is not attached\n", __func__);
return (-1);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351675 - stable/11/sys/arm/samsung/exynos

2019-09-01 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 00:29:16 2019
New Revision: 351675
URL: https://svnweb.freebsd.org/changeset/base/351675

Log:
  MFC r351618, r351619: exynos5: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/sys/arm/samsung/exynos/exynos5_combiner.c
  stable/11/sys/arm/samsung/exynos/exynos5_pad.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/samsung/exynos/exynos5_combiner.c
==
--- stable/11/sys/arm/samsung/exynos/exynos5_combiner.c Mon Sep  2 00:29:14 
2019(r351674)
+++ stable/11/sys/arm/samsung/exynos/exynos5_combiner.c Mon Sep  2 00:29:16 
2019(r351675)
@@ -314,7 +314,7 @@ combiner_setup_intr(char *source_name, void (*ih)(void
sc = combiner_sc;
 
if (sc == NULL) {
-   device_printf(sc->dev, "Error: combiner is not attached\n");
+   printf("%s: error: combiner is not attached\n", __func__);
return;
}
 

Modified: stable/11/sys/arm/samsung/exynos/exynos5_pad.c
==
--- stable/11/sys/arm/samsung/exynos/exynos5_pad.c  Mon Sep  2 00:29:14 
2019(r351674)
+++ stable/11/sys/arm/samsung/exynos/exynos5_pad.c  Mon Sep  2 00:29:16 
2019(r351675)
@@ -410,7 +410,7 @@ pad_setup_intr(int gpio_number, void (*ih)(void *), vo
sc = gpio_sc;
 
if (sc == NULL) {
-   device_printf(sc->dev, "Error: pad is not attached\n");
+   printf("%s: Error: pad is not attached\n", __func__);
return (-1);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351665 - in head: sys/fs/msdosfs usr.sbin/makefs usr.sbin/makefs/msdos

2019-09-01 Thread Ed Maste
Author: emaste
Date: Sun Sep  1 16:55:33 2019
New Revision: 351665
URL: https://svnweb.freebsd.org/changeset/base/351665

Log:
  makefs: share msdosfsmount.h between kernel msdosfs and makefs
  
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/usr.sbin/makefs/msdos/msdosfsmount.h
Modified:
  head/sys/fs/msdosfs/msdosfsmount.h
  head/usr.sbin/makefs/msdos.c
  head/usr.sbin/makefs/msdos/msdosfs_conv.c
  head/usr.sbin/makefs/msdos/msdosfs_denode.c
  head/usr.sbin/makefs/msdos/msdosfs_fat.c
  head/usr.sbin/makefs/msdos/msdosfs_lookup.c
  head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
  head/usr.sbin/makefs/msdos/msdosfs_vnops.c

Modified: head/sys/fs/msdosfs/msdosfsmount.h
==
--- head/sys/fs/msdosfs/msdosfsmount.h  Sun Sep  1 16:53:17 2019
(r351664)
+++ head/sys/fs/msdosfs/msdosfsmount.h  Sun Sep  1 16:55:33 2019
(r351665)
@@ -53,7 +53,7 @@
 #ifndef _MSDOSFS_MSDOSFSMOUNT_H_
 #define_MSDOSFS_MSDOSFSMOUNT_H_
 
-#ifdef _KERNEL
+#if defined (_KERNEL) || defined(MAKEFS)
 
 #include 
 #include 
@@ -224,6 +224,7 @@ struct msdosfs_fileno {
 
 #endif /* _KERNEL */
 
+#ifndef MAKEFS
 /*
  *  Arguments to mount MSDOS filesystems.
  */
@@ -241,6 +242,7 @@ struct msdosfs_args {
char*cs_local;  /* Local Charset */
mode_t  dirmask;/* dir  mask to be applied for msdosfs perms */
 };
+#endif /* MAKEFS */
 
 /*
  * Msdosfs mount options:

Modified: head/usr.sbin/makefs/msdos.c
==
--- head/usr.sbin/makefs/msdos.cSun Sep  1 16:53:17 2019
(r351664)
+++ head/usr.sbin/makefs/msdos.cSun Sep  1 16:55:33 2019
(r351665)
@@ -63,9 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "msdos/direntry.h"
 #include 
-
-
-#include "msdos/msdosfsmount.h"
+#include 
 
 static int msdos_populate_dir(const char *, struct denode *, fsnode *,
 fsnode *, fsinfo_t *);

Modified: head/usr.sbin/makefs/msdos/msdosfs_conv.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_conv.c   Sun Sep  1 16:53:17 2019
(r351664)
+++ head/usr.sbin/makefs/msdos/msdosfs_conv.c   Sun Sep  1 16:55:33 2019
(r351665)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include "msdos/direntry.h"
-#include "msdos/msdosfsmount.h"
+#include 
 
 #include "makefs.h"
 #include "msdos.h"

Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_denode.c Sun Sep  1 16:53:17 2019
(r351664)
+++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Sun Sep  1 16:55:33 2019
(r351665)
@@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include "msdos/msdosfsmount.h"
+#include 
 
 #include "makefs.h"
 #include "msdos.h"

Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_fat.cSun Sep  1 16:53:17 2019
(r351664)
+++ head/usr.sbin/makefs/msdos/msdosfs_fat.cSun Sep  1 16:55:33 2019
(r351665)
@@ -64,7 +64,7 @@
 #include "msdos/direntry.h"
 #include 
 #include 
-#include "msdos/msdosfsmount.h"
+#include 
 
 #include "makefs.h"
 #include "msdos.h"

Modified: head/usr.sbin/makefs/msdos/msdosfs_lookup.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_lookup.c Sun Sep  1 16:53:17 2019
(r351664)
+++ head/usr.sbin/makefs/msdos/msdosfs_lookup.c Sun Sep  1 16:55:33 2019
(r351665)
@@ -61,7 +61,7 @@
 #include "msdos/direntry.h"
 #include 
 #include 
-#include "msdos/msdosfsmount.h"
+#include 
 
 #include "makefs.h"
 #include "msdos.h"

Modified: head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Sun Sep  1 16:53:17 2019
(r351664)
+++ head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Sun Sep  1 16:55:33 2019
(r351665)
@@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
 #include "msdos/direntry.h"
 #include 
 #include 
-#include "msdos/msdosfsmount.h"
+#include 
 
 #include 
 

Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_vnops.c  Sun Sep  1 16:53:17 2019
(r351664)
+++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c  Sun Sep  1 16:55:33 2019
(r351665)
@@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$");
 #include "msdos/direntry.h"
 #include 
 #include 
-#include "msdos/msdosfsmount.h"
+#include 
 
 #include "makefs.h"
 #include "msdos.h"
___
svn-src-all@freebsd.org mailing list

svn commit: r351664 - head/sys/dev/vnic

2019-09-01 Thread Ed Maste
Author: emaste
Date: Sun Sep  1 16:53:17 2019
New Revision: 351664
URL: https://svnweb.freebsd.org/changeset/base/351664

Log:
  vnic: correct and simplify SIOCSIFFLAGS
  
  PR:   223573, 223575
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D13028

Modified:
  head/sys/dev/vnic/nicvf_main.c

Modified: head/sys/dev/vnic/nicvf_main.c
==
--- head/sys/dev/vnic/nicvf_main.c  Sun Sep  1 16:51:25 2019
(r351663)
+++ head/sys/dev/vnic/nicvf_main.c  Sun Sep  1 16:53:17 2019
(r351664)
@@ -425,6 +425,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t 
struct nicvf *nic;
struct rcv_queue *rq;
struct ifreq *ifr;
+   uint32_t flags;
int mask, err;
int rq_idx;
 #if defined(INET) || defined(INET6)
@@ -479,10 +480,10 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t 
break;
case SIOCSIFFLAGS:
NICVF_CORE_LOCK(nic);
-   if (if_getflags(ifp) & IFF_UP) {
+   flags = if_getflags(ifp);
+   if (flags & IFF_UP) {
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
-   if ((nic->if_flags & if_getflags(ifp)) &
-   IFF_PROMISC) {
+   if ((flags ^ nic->if_flags) & IFF_PROMISC) {
/* Change promiscous mode */
 #if 0
/* ARM64TODO */
@@ -490,8 +491,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t 
 #endif
}
 
-   if ((nic->if_flags ^ if_getflags(ifp)) &
-   IFF_ALLMULTI) {
+   if ((flags ^ nic->if_flags) & IFF_ALLMULTI) {
/* Change multicasting settings */
 #if 0
/* ARM64TODO */
@@ -504,7 +504,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t 
} else if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
nicvf_stop_locked(nic);
 
-   nic->if_flags = if_getflags(ifp);
+   nic->if_flags = flags;
NICVF_CORE_UNLOCK(nic);
break;
 
___
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: r351663 - head/usr.bin/ar

2019-09-01 Thread Ed Maste
Author: emaste
Date: Sun Sep  1 16:51:25 2019
New Revision: 351663
URL: https://svnweb.freebsd.org/changeset/base/351663

Log:
  ar: use more correct size_t type for loop index
  
  Submitted by: cem
  MFC after:1 week

Modified:
  head/usr.bin/ar/write.c

Modified: head/usr.bin/ar/write.c
==
--- head/usr.bin/ar/write.c Sun Sep  1 16:50:34 2019(r351662)
+++ head/usr.bin/ar/write.c Sun Sep  1 16:51:25 2019(r351663)
@@ -615,9 +615,9 @@ write_objs(struct bsdar *bsdar)
size_t s_sz;/* size of archive symbol table. */
size_t pm_sz;   /* size of pseudo members */
size_t w_sz;/* size of words in symbol table */
+   size_t   i;
uint64_t nr;
uint32_t nr32;
-   int  i;
 
if (elf_version(EV_CURRENT) == EV_NONE)
bsdar_errc(bsdar, EX_SOFTWARE, 0,
@@ -671,7 +671,7 @@ write_objs(struct bsdar *bsdar)
bsdar->s_sn_sz;
pm_sz += s_sz;
/* Convert to big-endian. */
-   for (i = 0; (size_t)i < bsdar->s_cnt; i++)
+   for (i = 0; i < bsdar->s_cnt; i++)
bsdar->s_so[i] =
htobe64(bsdar->s_so[i] + pm_sz);
} else {
@@ -679,7 +679,7 @@ write_objs(struct bsdar *bsdar)
 * Convert to big-endian and shuffle in-place to
 * the front of the allocation. XXX UB
 */
-   for (i = 0; (size_t)i < bsdar->s_cnt; i++)
+   for (i = 0; i < bsdar->s_cnt; i++)
((uint32_t *)(bsdar->s_so))[i] =
htobe32(bsdar->s_so[i] + pm_sz);
}
___
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: r351662 - head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD

2019-09-01 Thread Ed Maste
Author: emaste
Date: Sun Sep  1 16:50:34 2019
New Revision: 351662
URL: https://svnweb.freebsd.org/changeset/base/351662

Log:
  lldb: shorten thread names to make logs easier to follow
  
  lldb prepends the thread name to log entries, and the existing thread
  name for the FreeBSD ProcessMonitor thread was longer than the kernel's
  supported thread name length, and so was truncated.  This made logs hard
  to read, as the truncated thread name ran into the log message.  Shorten
  "lldb.process.freebsd.operation" to just "freebsd.op" so that logs are
  more readable.
  
  (Upstreaming to lldb still to be done).

Modified:
  head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
==
--- 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp  
Sun Sep  1 16:47:48 2019(r351661)
+++ 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp  
Sun Sep  1 16:50:34 2019(r351662)
@@ -809,7 +809,7 @@ ProcessMonitor::~ProcessMonitor() { StopMonitor(); }
 
//--
 // Thread setup and tear down.
 void ProcessMonitor::StartLaunchOpThread(LaunchArgs *args, Status ) {
-  static const char *g_thread_name = "lldb.process.freebsd.operation";
+  static const char *g_thread_name = "freebsd.op";
 
   if (m_operation_thread.IsJoinable())
 return;
@@ -975,7 +975,7 @@ FINISH:
 
 void ProcessMonitor::StartAttachOpThread(AttachArgs *args,
  lldb_private::Status ) {
-  static const char *g_thread_name = "lldb.process.freebsd.operation";
+  static const char *g_thread_name = "freebsd.op";
 
   if (m_operation_thread.IsJoinable())
 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"


svn commit: r351661 - in head: share/mk sys/conf

2019-09-01 Thread Ed Maste
Author: emaste
Date: Sun Sep  1 16:47:48 2019
New Revision: 351661
URL: https://svnweb.freebsd.org/changeset/base/351661

Log:
  Remove CLANG_NO_IAS definition
  
  CLANG_NO_IAS is not used anywhere in the tree.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/mk/bsd.sys.mk
  head/sys/conf/kern.mk

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkSun Sep  1 16:41:24 2019(r351660)
+++ head/share/mk/bsd.sys.mkSun Sep  1 16:47:48 2019(r351661)
@@ -198,13 +198,6 @@ CWARNFLAGS+=   -Wno-unknown-pragmas
 # This warning is utter nonsense
 CFLAGS+=   -Wno-format-zero-length
 
-# We need this conditional because many places that use it
-# only enable it for some files with CLFAGS.$FILE+=${CLANG_NO_IAS}.
-# unconditionally, and can't easily use the CFLAGS.clang=
-# mechanism.
-.if ${COMPILER_TYPE} == "clang"
-CLANG_NO_IAS=   -no-integrated-as
-.endif
 CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\
 -mllvm -simplifycfg-dup-ret
 .if ${COMPILER_VERSION} >= 30500 && ${COMPILER_VERSION} < 30700

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Sun Sep  1 16:41:24 2019(r351660)
+++ head/sys/conf/kern.mk   Sun Sep  1 16:47:48 2019(r351661)
@@ -37,8 +37,6 @@ CWARNEXTRA+=  -Wno-error-shift-negative-value
 .if ${COMPILER_VERSION} >= 4
 CWARNEXTRA+=   -Wno-address-of-packed-member
 .endif
-
-CLANG_NO_IAS= -no-integrated-as
 .endif
 
 .if ${COMPILER_TYPE} == "gcc"
___
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: r351660 - head/contrib/libstdc++/include/c_std

2019-09-01 Thread Ed Maste
Author: emaste
Date: Sun Sep  1 16:41:24 2019
New Revision: 351660
URL: https://svnweb.freebsd.org/changeset/base/351660

Log:
  libstdc++: remove gets
  
  Removed from libc in r351659

Modified:
  head/contrib/libstdc++/include/c_std/std_cstdio.h

Modified: head/contrib/libstdc++/include/c_std/std_cstdio.h
==
--- head/contrib/libstdc++/include/c_std/std_cstdio.h   Sun Sep  1 16:12:05 
2019(r351659)
+++ head/contrib/libstdc++/include/c_std/std_cstdio.h   Sun Sep  1 16:41:24 
2019(r351660)
@@ -74,7 +74,6 @@
 #undef fwrite
 #undef getc
 #undef getchar
-#undef gets
 #undef perror
 #undef printf
 #undef putc
@@ -121,7 +120,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   using ::fwrite;
   using ::getc;
   using ::getchar;
-  using ::gets;
   using ::perror;
   using ::printf;
   using ::putc;
___
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: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio

2019-09-01 Thread Ed Maste
Author: emaste
Date: Sun Sep  1 16:12:05 2019
New Revision: 351659
URL: https://svnweb.freebsd.org/changeset/base/351659

Log:
  libc: remove gets
  
  gets is unsafe and shouldn't be used (for many years now).  Leave it in
  the existing symbol version so anything that previously linked aginst it
  still runs, but do not allow new software to link against it.
  
  (The compatability/legacy implementation must not be static so that
  the symbol and in particular the compat sym gets@FBSD_1.0 make it
  into libc.)
  
  PR:   222796 (exp-run)
  Reported by:  Paul Vixie
  Reviewed by:  allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlier)
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D12298

Modified:
  head/contrib/libc++/include/cstdio
  head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c
  head/gnu/lib/libssp/Makefile
  head/include/stdio.h
  head/lib/libc/stdio/fgets.3
  head/lib/libc/stdio/gets.c
  head/lib/libc/stdio/stdio.3

Modified: head/contrib/libc++/include/cstdio
==
--- head/contrib/libc++/include/cstdio  Sun Sep  1 15:39:28 2019
(r351658)
+++ head/contrib/libc++/include/cstdio  Sun Sep  1 16:12:05 2019
(r351659)
@@ -74,7 +74,6 @@ int fputc(int c, FILE* stream);
 int fputs(const char* restrict s, FILE* restrict stream);
 int getc(FILE* stream);
 int getchar(void);
-char* gets(char* s);  // removed in C++14
 int putc(int c, FILE* stream);
 int putchar(int c);
 int puts(const char* s);
@@ -153,9 +152,6 @@ using ::tmpnam;
 
 #ifndef _LIBCPP_HAS_NO_STDIN
 using ::getchar;
-#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_MSVCRT)
-using ::gets;
-#endif
 using ::scanf;
 using ::vscanf;
 #endif

Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c
==
--- head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c Sun Sep  1 15:39:28 
2019(r351658)
+++ head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c Sun Sep  1 16:12:05 
2019(r351659)
@@ -33,6 +33,24 @@ __RCSID("$NetBSD: h_gets.c,v 1.1 2010/12/27 02:04:19 p
 
 #include 
 
+#ifdef __FreeBSD__
+/*
+ * We want to test the gets() implementation, but cannot simply link against
+ * the gets symbol because it is not in the default version. (We've made it
+ * unavailable by default on FreeBSD because it should not be used.)
+ *
+ * The next two lines create an unsafe_gets() function that resolves to
+ * gets@FBSD_1.0, which we call from our local gets() implementation.
+ */
+__sym_compat(gets, unsafe_gets, FBSD_1.0);
+char *unsafe_gets(char *);
+
+char *gets(char *buf)
+{
+   return unsafe_gets(buf);
+}
+#endif
+
 int
 main(int argc, char *argv[])
 {

Modified: head/gnu/lib/libssp/Makefile
==
--- head/gnu/lib/libssp/MakefileSun Sep  1 15:39:28 2019
(r351658)
+++ head/gnu/lib/libssp/MakefileSun Sep  1 16:12:05 2019
(r351659)
@@ -17,7 +17,7 @@ LIB=  ssp
 SHLIB_MAJOR=   0
 LD_FATAL_WARNINGS= no
 
-SRCS=  ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
+SRCS=  ssp.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \
strcat-chk.c strcpy-chk.c strncat-chk.c strncpy-chk.c \
vsnprintf-chk.c vsprintf-chk.c

Modified: head/include/stdio.h
==
--- head/include/stdio.hSun Sep  1 15:39:28 2019(r351658)
+++ head/include/stdio.hSun Sep  1 16:12:05 2019(r351659)
@@ -269,7 +269,6 @@ long ftell(FILE *);
 size_t  fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
 int getc(FILE *);
 int getchar(void);
-char   *gets(char *);
 #if __EXT1_VISIBLE
 char   *gets_s(char *, rsize_t);
 #endif

Modified: head/lib/libc/stdio/fgets.3
==
--- head/lib/libc/stdio/fgets.3 Sun Sep  1 15:39:28 2019(r351658)
+++ head/lib/libc/stdio/fgets.3 Sun Sep  1 16:12:05 2019(r351659)
@@ -32,12 +32,11 @@
 .\" @(#)fgets.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd April 3, 2018
+.Dd September 1, 2019
 .Dt FGETS 3
 .Os
 .Sh NAME
 .Nm fgets ,
-.Nm gets ,
 .Nm gets_s
 .Nd get a line from a stream
 .Sh LIBRARY
@@ -48,8 +47,6 @@
 .Fn fgets "char * restrict str" "int size" "FILE * restrict stream"
 .Ft char *
 .Fn gets_s "char *str" "rsize_t size"
-.Ft char *
-.Fn gets "char *str"
 .Sh DESCRIPTION
 The
 .Fn fgets
@@ -81,23 +78,12 @@ except that the newline character (if any) is not stor
 The
 .Fn gets
 function
-is equivalent to
-.Fn fgets
-with an infinite
-.Fa size
-and a
-.Fa stream
-of
-.Dv stdin ,
-except that the newline character (if any) is not stored in the string.
-It is the caller's responsibility to 

svn commit: r351621 - head/sys/dev/xdma

2019-08-29 Thread Ed Maste
Author: emaste
Date: Fri Aug 30 00:40:08 2019
New Revision: 351621
URL: https://svnweb.freebsd.org/changeset/base/351621

Log:
  xdma: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/xdma/xdma_sg.c

Modified: head/sys/dev/xdma/xdma_sg.c
==
--- head/sys/dev/xdma/xdma_sg.c Fri Aug 30 00:38:16 2019(r351620)
+++ head/sys/dev/xdma/xdma_sg.c Fri Aug 30 00:40:08 2019(r351621)
@@ -186,8 +186,7 @@ xchan_bufs_alloc(xdma_channel_t *xchan)
xdma = xchan->xdma;
 
if (xdma == NULL) {
-   device_printf(xdma->dev,
-   "%s: Channel was not allocated properly.\n", __func__);
+   printf("%s: Channel was not allocated properly.\n", __func__);
return (-1);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351620 - head/sys/dev/qlxgbe

2019-08-29 Thread Ed Maste
Author: emaste
Date: Fri Aug 30 00:38:16 2019
New Revision: 351620
URL: https://svnweb.freebsd.org/changeset/base/351620

Log:
  qlxgbe: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/qlxgbe/ql_isr.c

Modified: head/sys/dev/qlxgbe/ql_isr.c
==
--- head/sys/dev/qlxgbe/ql_isr.cFri Aug 30 00:36:17 2019
(r351619)
+++ head/sys/dev/qlxgbe/ql_isr.cFri Aug 30 00:38:16 2019
(r351620)
@@ -793,7 +793,7 @@ ql_mbx_isr(void *arg)
ha = arg;
 
if (ha == NULL) {
-   device_printf(ha->pci_dev, "%s: arg == NULL\n", __func__);
+   printf("%s: arg == NULL\n", __func__);
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"


svn commit: r351619 - head/sys/arm/samsung/exynos

2019-08-29 Thread Ed Maste
Author: emaste
Date: Fri Aug 30 00:36:17 2019
New Revision: 351619
URL: https://svnweb.freebsd.org/changeset/base/351619

Log:
  exynos5: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  MFC after:3 days
  MFC with: r351618
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm/samsung/exynos/exynos5_pad.c

Modified: head/sys/arm/samsung/exynos/exynos5_pad.c
==
--- head/sys/arm/samsung/exynos/exynos5_pad.c   Fri Aug 30 00:34:27 2019
(r351618)
+++ head/sys/arm/samsung/exynos/exynos5_pad.c   Fri Aug 30 00:36:17 2019
(r351619)
@@ -410,7 +410,7 @@ pad_setup_intr(int gpio_number, void (*ih)(void *), vo
sc = gpio_sc;
 
if (sc == NULL) {
-   device_printf(sc->dev, "Error: pad is not attached\n");
+   printf("%s: Error: pad is not attached\n", __func__);
return (-1);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351618 - head/sys/arm/samsung/exynos

2019-08-29 Thread Ed Maste
Author: emaste
Date: Fri Aug 30 00:34:27 2019
New Revision: 351618
URL: https://svnweb.freebsd.org/changeset/base/351618

Log:
  exynos5: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm/samsung/exynos/exynos5_combiner.c

Modified: head/sys/arm/samsung/exynos/exynos5_combiner.c
==
--- head/sys/arm/samsung/exynos/exynos5_combiner.c  Fri Aug 30 00:30:03 
2019(r351617)
+++ head/sys/arm/samsung/exynos/exynos5_combiner.c  Fri Aug 30 00:34:27 
2019(r351618)
@@ -314,7 +314,7 @@ combiner_setup_intr(char *source_name, void (*ih)(void
sc = combiner_sc;
 
if (sc == NULL) {
-   device_printf(sc->dev, "Error: combiner is not attached\n");
+   printf("%s: error: combiner is not attached\n", __func__);
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"


svn commit: r351603 - head/sys/dev/vnic

2019-08-29 Thread Ed Maste
Author: emaste
Date: Thu Aug 29 12:05:06 2019
New Revision: 351603
URL: https://svnweb.freebsd.org/changeset/base/351603

Log:
  vnic: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vnic/thunder_bgx.c

Modified: head/sys/dev/vnic/thunder_bgx.c
==
--- head/sys/dev/vnic/thunder_bgx.c Thu Aug 29 09:29:39 2019
(r351602)
+++ head/sys/dev/vnic/thunder_bgx.c Thu Aug 29 12:05:06 2019
(r351603)
@@ -502,9 +502,8 @@ bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx
bgx_idx += node * MAX_BGX_PER_CN88XX;
bgx = bgx_vnic[bgx_idx];
 
-   if (!bgx) {
-   device_printf(bgx->dev,
-   "BGX%d not yet initialized, ignoring DMAC addition\n",
+   if (bgx == NULL) {
+   printf("BGX%d not yet initialized, ignoring DMAC addition\n",
bgx_idx);
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"


svn commit: r351433 - stable/11/contrib/telnet/telnetd

2019-08-23 Thread Ed Maste
Author: emaste
Date: Fri Aug 23 17:43:41 2019
New Revision: 351433
URL: https://svnweb.freebsd.org/changeset/base/351433

Log:
  MFC r331074 (cem): telnetd(8): Fix dereference of uninitialized value 'IF'
  
  Reported by:  Coverity

Modified:
  stable/11/contrib/telnet/telnetd/telnetd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/telnet/telnetd/telnetd.c
==
--- stable/11/contrib/telnet/telnetd/telnetd.c  Fri Aug 23 17:40:47 2019
(r351432)
+++ stable/11/contrib/telnet/telnetd/telnetd.c  Fri Aug 23 17:43:41 2019
(r351433)
@@ -921,7 +921,7 @@ telnet(int f, int p, char *host)
edithost(HE, host_name);
if (hostinfo && *IM)
putf(IM, ptyibuf2);
-   if (IF && if_fd != -1) {
+   if (if_fd != -1) {
if (fstat(if_fd, ) != -1 && statbuf.st_size > 0) {
if_buf = (char *) mmap (0, statbuf.st_size,
PROT_READ, 0, if_fd, 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351432 - in stable/11/contrib/telnet: arpa libtelnet telnet telnetd

2019-08-23 Thread Ed Maste
Author: emaste
Date: Fri Aug 23 17:40:47 2019
New Revision: 351432
URL: https://svnweb.freebsd.org/changeset/base/351432

Log:
  MFC r351070: telnet: remove 3rd clause from Berkeley copyrights
  
  Per the July 22, 1999 letter (in /COPYRIGHT) from
  William Hoskins
  Director, Office of Technology Licensing
  University of California, Berkeley

Modified:
  stable/11/contrib/telnet/arpa/telnet.h
  stable/11/contrib/telnet/libtelnet/auth-proto.h
  stable/11/contrib/telnet/libtelnet/auth.c
  stable/11/contrib/telnet/libtelnet/auth.h
  stable/11/contrib/telnet/libtelnet/enc-proto.h
  stable/11/contrib/telnet/libtelnet/enc_des.c
  stable/11/contrib/telnet/libtelnet/encrypt.c
  stable/11/contrib/telnet/libtelnet/encrypt.h
  stable/11/contrib/telnet/libtelnet/genget.c
  stable/11/contrib/telnet/libtelnet/getent.c
  stable/11/contrib/telnet/libtelnet/kerberos.c
  stable/11/contrib/telnet/libtelnet/kerberos5.c
  stable/11/contrib/telnet/libtelnet/key-proto.h
  stable/11/contrib/telnet/libtelnet/krb4encpwd.c
  stable/11/contrib/telnet/libtelnet/misc-proto.h
  stable/11/contrib/telnet/libtelnet/misc.c
  stable/11/contrib/telnet/libtelnet/misc.h
  stable/11/contrib/telnet/libtelnet/read_password.c
  stable/11/contrib/telnet/libtelnet/rsaencpwd.c
  stable/11/contrib/telnet/telnet/authenc.c
  stable/11/contrib/telnet/telnet/commands.c
  stable/11/contrib/telnet/telnet/defines.h
  stable/11/contrib/telnet/telnet/externs.h
  stable/11/contrib/telnet/telnet/fdset.h
  stable/11/contrib/telnet/telnet/general.h
  stable/11/contrib/telnet/telnet/main.c
  stable/11/contrib/telnet/telnet/network.c
  stable/11/contrib/telnet/telnet/ring.c
  stable/11/contrib/telnet/telnet/ring.h
  stable/11/contrib/telnet/telnet/sys_bsd.c
  stable/11/contrib/telnet/telnet/telnet.1
  stable/11/contrib/telnet/telnet/telnet.c
  stable/11/contrib/telnet/telnet/terminal.c
  stable/11/contrib/telnet/telnet/types.h
  stable/11/contrib/telnet/telnet/utilities.c
  stable/11/contrib/telnet/telnetd/authenc.c
  stable/11/contrib/telnet/telnetd/defs.h
  stable/11/contrib/telnet/telnetd/ext.h
  stable/11/contrib/telnet/telnetd/global.c
  stable/11/contrib/telnet/telnetd/pathnames.h
  stable/11/contrib/telnet/telnetd/slc.c
  stable/11/contrib/telnet/telnetd/state.c
  stable/11/contrib/telnet/telnetd/sys_term.c
  stable/11/contrib/telnet/telnetd/telnetd.8
  stable/11/contrib/telnet/telnetd/telnetd.c
  stable/11/contrib/telnet/telnetd/telnetd.h
  stable/11/contrib/telnet/telnetd/termstat.c
  stable/11/contrib/telnet/telnetd/utility.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/telnet/arpa/telnet.h
==
--- stable/11/contrib/telnet/arpa/telnet.h  Fri Aug 23 17:39:59 2019
(r351431)
+++ stable/11/contrib/telnet/arpa/telnet.h  Fri Aug 23 17:40:47 2019
(r351432)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: stable/11/contrib/telnet/libtelnet/auth-proto.h
==
--- stable/11/contrib/telnet/libtelnet/auth-proto.h Fri Aug 23 17:39:59 
2019(r351431)
+++ stable/11/contrib/telnet/libtelnet/auth-proto.h Fri Aug 23 17:40:47 
2019(r351432)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: stable/11/contrib/telnet/libtelnet/auth.c
==
--- stable/11/contrib/telnet/libtelnet/auth.c   Fri Aug 23 17:39:59 2019
(r351431)
+++ 

svn commit: r351431 - in stable/12/contrib/telnet: arpa libtelnet telnet telnetd

2019-08-23 Thread Ed Maste
Author: emaste
Date: Fri Aug 23 17:39:59 2019
New Revision: 351431
URL: https://svnweb.freebsd.org/changeset/base/351431

Log:
  MFC r351070: telnet: remove 3rd clause from Berkeley copyrights
  
  Per the July 22, 1999 letter (in /COPYRIGHT) from
  William Hoskins
  Director, Office of Technology Licensing
  University of California, Berkeley

Modified:
  stable/12/contrib/telnet/arpa/telnet.h
  stable/12/contrib/telnet/libtelnet/auth-proto.h
  stable/12/contrib/telnet/libtelnet/auth.c
  stable/12/contrib/telnet/libtelnet/auth.h
  stable/12/contrib/telnet/libtelnet/enc-proto.h
  stable/12/contrib/telnet/libtelnet/enc_des.c
  stable/12/contrib/telnet/libtelnet/encrypt.c
  stable/12/contrib/telnet/libtelnet/encrypt.h
  stable/12/contrib/telnet/libtelnet/genget.c
  stable/12/contrib/telnet/libtelnet/getent.c
  stable/12/contrib/telnet/libtelnet/kerberos.c
  stable/12/contrib/telnet/libtelnet/kerberos5.c
  stable/12/contrib/telnet/libtelnet/key-proto.h
  stable/12/contrib/telnet/libtelnet/krb4encpwd.c
  stable/12/contrib/telnet/libtelnet/misc-proto.h
  stable/12/contrib/telnet/libtelnet/misc.c
  stable/12/contrib/telnet/libtelnet/misc.h
  stable/12/contrib/telnet/libtelnet/read_password.c
  stable/12/contrib/telnet/libtelnet/rsaencpwd.c
  stable/12/contrib/telnet/telnet/authenc.c
  stable/12/contrib/telnet/telnet/commands.c
  stable/12/contrib/telnet/telnet/defines.h
  stable/12/contrib/telnet/telnet/externs.h
  stable/12/contrib/telnet/telnet/fdset.h
  stable/12/contrib/telnet/telnet/general.h
  stable/12/contrib/telnet/telnet/main.c
  stable/12/contrib/telnet/telnet/network.c
  stable/12/contrib/telnet/telnet/ring.c
  stable/12/contrib/telnet/telnet/ring.h
  stable/12/contrib/telnet/telnet/sys_bsd.c
  stable/12/contrib/telnet/telnet/telnet.1
  stable/12/contrib/telnet/telnet/telnet.c
  stable/12/contrib/telnet/telnet/terminal.c
  stable/12/contrib/telnet/telnet/types.h
  stable/12/contrib/telnet/telnet/utilities.c
  stable/12/contrib/telnet/telnetd/authenc.c
  stable/12/contrib/telnet/telnetd/defs.h
  stable/12/contrib/telnet/telnetd/ext.h
  stable/12/contrib/telnet/telnetd/global.c
  stable/12/contrib/telnet/telnetd/pathnames.h
  stable/12/contrib/telnet/telnetd/slc.c
  stable/12/contrib/telnet/telnetd/state.c
  stable/12/contrib/telnet/telnetd/sys_term.c
  stable/12/contrib/telnet/telnetd/telnetd.8
  stable/12/contrib/telnet/telnetd/telnetd.c
  stable/12/contrib/telnet/telnetd/telnetd.h
  stable/12/contrib/telnet/telnetd/termstat.c
  stable/12/contrib/telnet/telnetd/utility.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/telnet/arpa/telnet.h
==
--- stable/12/contrib/telnet/arpa/telnet.h  Fri Aug 23 16:42:39 2019
(r351430)
+++ stable/12/contrib/telnet/arpa/telnet.h  Fri Aug 23 17:39:59 2019
(r351431)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: stable/12/contrib/telnet/libtelnet/auth-proto.h
==
--- stable/12/contrib/telnet/libtelnet/auth-proto.h Fri Aug 23 16:42:39 
2019(r351430)
+++ stable/12/contrib/telnet/libtelnet/auth-proto.h Fri Aug 23 17:39:59 
2019(r351431)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: stable/12/contrib/telnet/libtelnet/auth.c
==
--- stable/12/contrib/telnet/libtelnet/auth.c   Fri Aug 23 16:42:39 2019
(r351430)
+++ 

svn commit: r351428 - stable/11/usr.bin/vtfontcvt

2019-08-23 Thread Ed Maste
Author: emaste
Date: Fri Aug 23 16:26:06 2019
New Revision: 351428
URL: https://svnweb.freebsd.org/changeset/base/351428

Log:
  vtfontcvt: improve BDF and hex font parsing
  
  MFC r348661: vtfontcvt: rework height/width setting
  
  Introduce VFNT_MAXDIMENSION to replace bare 128, add set_height, and
  consistently use set_height and set_width.
  
  Submitted by: Dmitry Wagin
  
  MFC r348662: vtfontcvt: include width and height in verbose info
  
  Submitted by: Dmitry Wagin
  
  MFC r348668: vtfontcvt: zero memory allocated by xmalloc
  
  Submitted by: Dmitry Wagin
  
  MFC r348692: vtfontcvt: exit on error if the input font has too many glyphs
  
  The kernel has a limit of 131072 glyphs in a font; add the same check to
  vtfontcvt so that we won't create a font file that the kernel will not
  load.
  
  MFC r348796: vtfontcvt: allow out-of-order glyphs
  
  Reported by:  mi
  
  MFC r349049: vtfontcvt: add comments in add_glyph
  
  MFC r349100: vtfontcvt: improve BDF and hex font parsing
  
  Support larger font sizes.
  
  Submitted by: Dmitry Wagin (original version)
  
  MFC r349101: vtfontcvt: initialize bbwbytes to avoid GCC 4.2.1 warning
  
  MFC r349105: vtfontcvt: initialize another variable to quiet GCC warning
  
  I believe this case could be triggered by a broken .bdf font.
  
  MFC r349107: vtfontcvt: improve .bdf verification
  
  Previously we would crash if the BBX y-offset was outside of the font
  bounding box.
  
  Reported by:  afl fuzzer
  
  MFC r349108: vtfontcvt: improve .bdf validation
  
  Previously if we had a BBX entry that had invalid values (e.g. bounding
  box outside of font bounding box) and failed sscanf (e.g., because it
  had fewer than four values) we skipped the BBX value validation and then
  triggered an assertion failure.
  
  Reported by:  afl fuzzer
  
  MFC r349111: vtfontcvt: correct typo in hex parsing update
  
  Submitted by: Dmitry Wagin
  
  MFC r349333: vtfontcvt: improve .bdf validation
  
  Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing
  or invalid values and and failed sscanf, we would proceeded with
  partially initialized bounding box / device width variables.
  
  Reported by:  afl fuzzer (FONTBOUNDINGBOX)
  
  PR:   205707
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/usr.bin/vtfontcvt/vtfontcvt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/vtfontcvt/vtfontcvt.c
==
--- stable/11/usr.bin/vtfontcvt/vtfontcvt.c Fri Aug 23 16:19:58 2019
(r351427)
+++ stable/11/usr.bin/vtfontcvt/vtfontcvt.c Fri Aug 23 16:26:06 2019
(r351428)
@@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$");
 #define VFNT_MAP_NORMAL_RH 1
 #define VFNT_MAP_BOLD 2
 #define VFNT_MAP_BOLD_RH 3
+#define VFNT_MAXGLYPHS 131072
+#define VFNT_MAXDIMENSION 128
 
 static unsigned int width = 8, wbytes, height = 16;
 
@@ -101,7 +103,7 @@ xmalloc(size_t size)
 {
void *m;
 
-   if ((m = malloc(size)) == NULL)
+   if ((m = calloc(1, size)) == NULL)
errx(1, "memory allocation failure");
return (m);
 }
@@ -109,7 +111,7 @@ xmalloc(size_t size)
 static int
 add_mapping(struct glyph *gl, unsigned int c, unsigned int map_idx)
 {
-   struct mapping *mp;
+   struct mapping *mp, *mp_temp;
struct mapping_list *ml;
 
mapping_total++;
@@ -120,10 +122,19 @@ add_mapping(struct glyph *gl, unsigned int c, unsigned
mp->m_length = 0;
 
ml = [map_idx];
-   if (TAILQ_LAST(ml, mapping_list) != NULL &&
-   TAILQ_LAST(ml, mapping_list)->m_char >= c)
-   errx(1, "Bad ordering at character %u", c);
-   TAILQ_INSERT_TAIL(ml, mp, m_list);
+   if (TAILQ_LAST(ml, mapping_list) == NULL ||
+   TAILQ_LAST(ml, mapping_list)->m_char < c) {
+   /* Common case: empty list or new char at end of list. */
+   TAILQ_INSERT_TAIL(ml, mp, m_list);
+   } else {
+   /* Find insertion point for char; cannot be at end. */
+   TAILQ_FOREACH(mp_temp, ml, m_list) {
+   if (mp_temp->m_char >= c) {
+   TAILQ_INSERT_BEFORE(mp_temp, mp, m_list);
+   break;
+   }
+   }
+   }
 
map_count[map_idx]++;
mapping_unique++;
@@ -165,6 +176,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, 
glyph_total++;
glyph_count[map_idx]++;
 
+   /* Return existing glyph if we have an identical one. */
hash = fnv_32_buf(bytes, wbytes * height, FNV1_32_INIT) % FONTCVT_NHASH;
SLIST_FOREACH(gl, _hash[hash], g_hash) {
if (memcmp(gl->g_data, bytes, wbytes * height) == 0) {
@@ -173,6 +185,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, 
}
}
 
+   /* Allocate new glyph. */
gl = xmalloc(sizeof *gl);
  

svn commit: r351427 - stable/11/usr.bin/vtfontcvt

2019-08-23 Thread Ed Maste
Author: emaste
Date: Fri Aug 23 16:19:58 2019
New Revision: 351427
URL: https://svnweb.freebsd.org/changeset/base/351427

Log:
  MFC r305815: vtfontcvt: remove superfluous newlines in errx messages

Modified:
  stable/11/usr.bin/vtfontcvt/vtfontcvt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/vtfontcvt/vtfontcvt.c
==
--- stable/11/usr.bin/vtfontcvt/vtfontcvt.c Fri Aug 23 16:18:25 2019
(r351426)
+++ stable/11/usr.bin/vtfontcvt/vtfontcvt.c Fri Aug 23 16:19:58 2019
(r351427)
@@ -122,7 +122,7 @@ add_mapping(struct glyph *gl, unsigned int c, unsigned
ml = [map_idx];
if (TAILQ_LAST(ml, mapping_list) != NULL &&
TAILQ_LAST(ml, mapping_list)->m_char >= c)
-   errx(1, "Bad ordering at character %u\n", c);
+   errx(1, "Bad ordering at character %u", c);
TAILQ_INSERT_TAIL(ml, mp, m_list);
 
map_count[map_idx]++;
@@ -143,7 +143,7 @@ dedup_mapping(unsigned int map_idx)
while (mp_normal->m_char < mp_bold->m_char)
mp_normal = TAILQ_NEXT(mp_normal, m_list);
if (mp_bold->m_char != mp_normal->m_char)
-   errx(1, "Character %u not in normal font!\n",
+   errx(1, "Character %u not in normal font!",
mp_bold->m_char);
if (mp_bold->m_glyph != mp_normal->m_glyph)
continue;
@@ -217,7 +217,7 @@ parse_bitmap_line(uint8_t *left, uint8_t *right, unsig
unsigned int i, subline;
 
if (dwidth != width && dwidth != width * 2)
-   errx(1, "Bitmap with unsupported width %u!\n", dwidth);
+   errx(1, "Bitmap with unsupported width %u!", dwidth);
 
/* Move pixel data right to simplify splitting double characters. */
line >>= (howmany(dwidth, 8) * 8) - dwidth;
@@ -234,7 +234,7 @@ parse_bitmap_line(uint8_t *left, uint8_t *right, unsig
*p++ = subline >> 8;
*p = subline;
} else {
-   errx(1, "Unsupported wbytes %u!\n", wbytes);
+   errx(1, "Unsupported wbytes %u!", wbytes);
}
 
line >>= width;
@@ -272,7 +272,7 @@ parse_bdf(FILE *fp, unsigned int map_idx)
 */
for (i = 0; i < height; i++) {
if ((ln = fgetln(fp, )) == NULL)
-   errx(1, "Unexpected EOF!\n");
+   errx(1, "Unexpected EOF!");
ln[length - 1] = '\0';
if (strcmp(ln, "ENDCHAR") == 0) {
memset(bytes + i * wbytes, 0,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351426 - stable/12/usr.bin/vtfontcvt

2019-08-23 Thread Ed Maste
Author: emaste
Date: Fri Aug 23 16:18:25 2019
New Revision: 351426
URL: https://svnweb.freebsd.org/changeset/base/351426

Log:
  vtfontcvt: improve BDF and hex font parsing
  
  MFC r348661: vtfontcvt: rework height/width setting
  
  Introduce VFNT_MAXDIMENSION to replace bare 128, add set_height, and
  consistently use set_height and set_width.
  
  Submitted by: Dmitry Wagin
  
  MFC r348662: vtfontcvt: include width and height in verbose info
  
  Submitted by: Dmitry Wagin
  
  MFC r348668: vtfontcvt: zero memory allocated by xmalloc
  
  Submitted by: Dmitry Wagin
  
  MFC r348692: vtfontcvt: exit on error if the input font has too many glyphs
  
  The kernel has a limit of 131072 glyphs in a font; add the same check to
  vtfontcvt so that we won't create a font file that the kernel will not
  load.
  
  MFC r348796: vtfontcvt: allow out-of-order glyphs
  
  Reported by:  mi
  
  MFC r349049: vtfontcvt: add comments in add_glyph
  
  MFC r349100: vtfontcvt: improve BDF and hex font parsing
  
  Support larger font sizes.
  
  Submitted by: Dmitry Wagin (original version)
  
  MFC r349101: vtfontcvt: initialize bbwbytes to avoid GCC 4.2.1 warning
  
  MFC r349105: vtfontcvt: initialize another variable to quiet GCC warning
  
  I believe this case could be triggered by a broken .bdf font.
  
  MFC r349107: vtfontcvt: improve .bdf verification
  
  Previously we would crash if the BBX y-offset was outside of the font
  bounding box.
  
  Reported by:  afl fuzzer
  
  MFC r349108: vtfontcvt: improve .bdf validation
  
  Previously if we had a BBX entry that had invalid values (e.g. bounding
  box outside of font bounding box) and failed sscanf (e.g., because it
  had fewer than four values) we skipped the BBX value validation and then
  triggered an assertion failure.
  
  Reported by:  afl fuzzer
  
  MFC r349111: vtfontcvt: correct typo in hex parsing update
  
  Submitted by: Dmitry Wagin
  
  MFC r349333: vtfontcvt: improve .bdf validation
  
  Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing
  or invalid values and and failed sscanf, we would proceeded with
  partially initialized bounding box / device width variables.
  
  Reported by:  afl fuzzer (FONTBOUNDINGBOX)
  
  PR:   205707
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/usr.bin/vtfontcvt/vtfontcvt.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/vtfontcvt/vtfontcvt.c
==
--- stable/12/usr.bin/vtfontcvt/vtfontcvt.c Fri Aug 23 16:03:23 2019
(r351425)
+++ stable/12/usr.bin/vtfontcvt/vtfontcvt.c Fri Aug 23 16:18:25 2019
(r351426)
@@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$");
 #define VFNT_MAP_NORMAL_RH 1
 #define VFNT_MAP_BOLD 2
 #define VFNT_MAP_BOLD_RH 3
+#define VFNT_MAXGLYPHS 131072
+#define VFNT_MAXDIMENSION 128
 
 static unsigned int width = 8, wbytes, height = 16;
 
@@ -101,7 +103,7 @@ xmalloc(size_t size)
 {
void *m;
 
-   if ((m = malloc(size)) == NULL)
+   if ((m = calloc(1, size)) == NULL)
errx(1, "memory allocation failure");
return (m);
 }
@@ -109,7 +111,7 @@ xmalloc(size_t size)
 static int
 add_mapping(struct glyph *gl, unsigned int c, unsigned int map_idx)
 {
-   struct mapping *mp;
+   struct mapping *mp, *mp_temp;
struct mapping_list *ml;
 
mapping_total++;
@@ -120,10 +122,19 @@ add_mapping(struct glyph *gl, unsigned int c, unsigned
mp->m_length = 0;
 
ml = [map_idx];
-   if (TAILQ_LAST(ml, mapping_list) != NULL &&
-   TAILQ_LAST(ml, mapping_list)->m_char >= c)
-   errx(1, "Bad ordering at character %u", c);
-   TAILQ_INSERT_TAIL(ml, mp, m_list);
+   if (TAILQ_LAST(ml, mapping_list) == NULL ||
+   TAILQ_LAST(ml, mapping_list)->m_char < c) {
+   /* Common case: empty list or new char at end of list. */
+   TAILQ_INSERT_TAIL(ml, mp, m_list);
+   } else {
+   /* Find insertion point for char; cannot be at end. */
+   TAILQ_FOREACH(mp_temp, ml, m_list) {
+   if (mp_temp->m_char >= c) {
+   TAILQ_INSERT_BEFORE(mp_temp, mp, m_list);
+   break;
+   }
+   }
+   }
 
map_count[map_idx]++;
mapping_unique++;
@@ -165,6 +176,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, 
glyph_total++;
glyph_count[map_idx]++;
 
+   /* Return existing glyph if we have an identical one. */
hash = fnv_32_buf(bytes, wbytes * height, FNV1_32_INIT) % FONTCVT_NHASH;
SLIST_FOREACH(gl, _hash[hash], g_hash) {
if (memcmp(gl->g_data, bytes, wbytes * height) == 0) {
@@ -173,6 +185,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, 
}
}
 
+   /* Allocate new glyph. */
gl = xmalloc(sizeof *gl);
  

svn commit: r351425 - head/usr.bin/vtfontcvt

2019-08-23 Thread Ed Maste
Author: emaste
Date: Fri Aug 23 16:03:23 2019
New Revision: 351425
URL: https://svnweb.freebsd.org/changeset/base/351425

Log:
  vtfontcvt: simplify rshift_row
  
  We don't need to specify the buffer size in both bytes and bits.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

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

Modified: head/usr.bin/vtfontcvt/vtfontcvt.c
==
--- head/usr.bin/vtfontcvt/vtfontcvt.c  Fri Aug 23 15:24:18 2019
(r351424)
+++ head/usr.bin/vtfontcvt/vtfontcvt.c  Fri Aug 23 16:03:23 2019
(r351425)
@@ -224,38 +224,19 @@ add_char(unsigned curchar, unsigned map_idx, uint8_t *
 }
 
 /*
- * Right-shift glyph row by _shift_ bits. Row _len_ bits wide, _size_ bytes.
+ * Right-shift glyph row.
  */
-static int
-rshift_row(uint8_t *line, size_t size, size_t len, size_t shift)
+static void
+rshift_row(uint8_t *buf, size_t len, size_t shift)
 {
-   size_t d, s, i;
-   uint16_t t;
+   ssize_t i, off_byte = shift / 8;
+   size_t off_bit = shift % 8;
 
-   assert(size > 0 && len > 0);
-   assert(size * 8 >= len);
-
if (shift == 0)
-   return (0);
-
-   d = shift / 8;
-   s = 8 - shift % 8;
-   i = howmany(len, 8);
-
-   while (i > 0) {
-   i--;
-
-   t = *(line + i);
-   *(line + i) = 0;
-
-   t <<= s;
-
-   if (i + d + 1 < size)
-   *(line + i + d + 1) |= (uint8_t)t;
-   if (i + d < size)
-   *(line + i + d) = t >> 8;
-   }
-   return (0);
+   return;
+   for (i = len - 1; i >= 0; i--)
+   buf[i] = (i >= off_byte ? buf[i - off_byte] >> off_bit : 0) |
+   (i > off_byte ? buf[i - off_byte - 1] << (8 - off_bit) : 0);
 }
 
 /*
@@ -426,11 +407,7 @@ parse_bdf(FILE *fp, unsigned int map_idx)
*(line + j) = (uint8_t)val;
}
 
-   rv = rshift_row(line, wbytes * 2, bbw,
-   bbox - fbbox);
-   if (rv != 0)
-   goto out;
-
+   rshift_row(line, wbytes * 2, bbox - fbbox);
rv = split_row(bytes + i * wbytes,
 bytes_r + i * wbytes, line, dwidth);
if (rv != 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351396 - head/usr.sbin/makefs/msdos

2019-08-22 Thread Ed Maste
Author: emaste
Date: Thu Aug 22 17:49:34 2019
New Revision: 351396
URL: https://svnweb.freebsd.org/changeset/base/351396

Log:
  makefs: diff reduction to sys/fs/msdosfs
  
  No functional change.

Modified:
  head/usr.sbin/makefs/msdos/direntry.h
  head/usr.sbin/makefs/msdos/msdosfs_conv.c
  head/usr.sbin/makefs/msdos/msdosfs_denode.c
  head/usr.sbin/makefs/msdos/msdosfs_fat.c
  head/usr.sbin/makefs/msdos/msdosfs_lookup.c
  head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
  head/usr.sbin/makefs/msdos/msdosfs_vnops.c
  head/usr.sbin/makefs/msdos/msdosfsmount.h

Modified: head/usr.sbin/makefs/msdos/direntry.h
==
--- head/usr.sbin/makefs/msdos/direntry.h   Thu Aug 22 16:06:52 2019
(r351395)
+++ head/usr.sbin/makefs/msdos/direntry.h   Thu Aug 22 17:49:34 2019
(r351396)
@@ -135,12 +135,12 @@ struct winentry {
 #define DD_YEAR_MASK   0xFE00  /* year - 1980 */
 #define DD_YEAR_SHIFT  9
 
-uint8_t winChksum(uint8_t *name);
-int winSlotCnt(const u_char *un, size_t unlen);
-int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen);
-int winChkName(const u_char *un, size_t unlen, struct winentry *wep,
-int chksum);
-int unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt,
-int chksum);
+intunix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen);
+intunix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int 
cnt,
+   int chksum);
+intwinChkName(const u_char *un, size_t unlen, struct winentry *wep,
+   int chksum);
+uint8_twinChksum(uint8_t *name);
+intwinSlotCnt(const u_char *un, size_t unlen);
 
 #endif /* !_FS_MSDOSFS_DIRENTRY_H_ */

Modified: head/usr.sbin/makefs/msdos/msdosfs_conv.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_conv.c   Thu Aug 22 16:06:52 2019
(r351395)
+++ head/usr.sbin/makefs/msdos/msdosfs_conv.c   Thu Aug 22 17:49:34 2019
(r351396)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-4-Clause
+ *
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
  * Copyright (C) 1994, 1995, 1997 TooLs GmbH.
  * All rights reserved.
@@ -29,7 +31,7 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/*
+/*-
  * Written by Paul Popelka (pa...@uts.amdahl.com)
  *
  * You can do anything you want with this software, just don't say you wrote

Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_denode.c Thu Aug 22 16:06:52 2019
(r351395)
+++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Thu Aug 22 17:49:34 2019
(r351396)
@@ -1,6 +1,8 @@
 /* $NetBSD: msdosfs_denode.c,v 1.7 2015/03/29 05:52:59 agc Exp $   */
 
 /*-
+ * SPDX-License-Identifier: BSD-4-Clause
+ *
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
  * Copyright (C) 1994, 1995, 1997 TooLs GmbH.
  * All rights reserved.
@@ -31,7 +33,7 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/*
+/*-
  * Written by Paul Popelka (pa...@uts.amdahl.com)
  *
  * You can do anything you want with this software, just don't say you wrote
@@ -261,7 +263,7 @@ detrunc(struct denode *dep, u_long length, int flags, 
if (error) {
MSDOSFS_DPRINTF(("detrunc(): pcbmap fails %d\n",
error));
-   return error;
+   return (error);
}
}
 
@@ -282,10 +284,9 @@ detrunc(struct denode *dep, u_long length, int flags, 
MSDOSFS_DPRINTF(("detrunc(): bread fails %d\n",
error));
 
-   return error;
+   return (error);
}
-   memset((char *)bp->b_data + boff, 0,
-   pmp->pm_bpcluster - boff);
+   memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff);
if (flags & IO_SYNC)
bwrite(bp);
else
@@ -326,7 +327,7 @@ detrunc(struct denode *dep, u_long length, int flags, 
if (chaintofree != 0 && !MSDOSFSEOF(pmp, chaintofree))
freeclusterchain(pmp, chaintofree);
 
-   return allerror;
+   return (allerror);
 }
 
 /*
@@ -343,16 +344,16 @@ deextend(struct denode *dep, u_long length, struct ucr
 * The root of a DOS filesystem cannot be extended.
 */
if (dep->de_vnode != NULL && !FAT32(pmp))
-   return EINVAL;
+   return (EINVAL);
 
/*
 * Directories cannot be extended.
 */
if 

svn commit: r351395 - head/sys/fs/msdosfs

2019-08-22 Thread Ed Maste
Author: emaste
Date: Thu Aug 22 16:06:52 2019
New Revision: 351395
URL: https://svnweb.freebsd.org/changeset/base/351395

Log:
  msdosfs_fat: reduce diffs with NetBSD and makefs
  
  Use pointer arithmetic (as now done in makefs, and in NetBSD) instead of
  taking the address of array element.  No functional change, but this
  makes it easier to compare different versions of this file.
  
  Reviewed by:  kib
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21365

Modified:
  head/sys/fs/msdosfs/msdosfs_fat.c

Modified: head/sys/fs/msdosfs/msdosfs_fat.c
==
--- head/sys/fs/msdosfs/msdosfs_fat.c   Thu Aug 22 15:08:04 2019
(r351394)
+++ head/sys/fs/msdosfs/msdosfs_fat.c   Thu Aug 22 16:06:52 2019
(r351395)
@@ -214,9 +214,9 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp
return (EIO);
}
if (FAT32(pmp))
-   cn = getulong(>b_data[bo]);
+   cn = getulong(bp->b_data + bo);
else
-   cn = getushort(>b_data[bo]);
+   cn = getushort(bp->b_data + bo);
if (FAT12(pmp) && (prevcn & 1))
cn >>= 4;
cn &= pmp->pm_fatmask;
@@ -510,9 +510,9 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
 
if (function & FAT_GET) {
if (FAT32(pmp))
-   readcn = getulong(>b_data[bo]);
+   readcn = getulong(bp->b_data + bo);
else
-   readcn = getushort(>b_data[bo]);
+   readcn = getushort(bp->b_data + bo);
if (FAT12(pmp) & (cn & 1))
readcn >>= 4;
readcn &= pmp->pm_fatmask;
@@ -524,7 +524,7 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
if (function & FAT_SET) {
switch (pmp->pm_fatmask) {
case FAT12_MASK:
-   readcn = getushort(>b_data[bo]);
+   readcn = getushort(bp->b_data + bo);
if (cn & 1) {
readcn &= 0x000f;
readcn |= newcontents << 4;
@@ -532,20 +532,20 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
readcn &= 0xf000;
readcn |= newcontents & 0xfff;
}
-   putushort(>b_data[bo], readcn);
+   putushort(bp->b_data + bo, readcn);
break;
case FAT16_MASK:
-   putushort(>b_data[bo], newcontents);
+   putushort(bp->b_data + bo, newcontents);
break;
case FAT32_MASK:
/*
 * According to spec we have to retain the
 * high order bits of the FAT entry.
 */
-   readcn = getulong(>b_data[bo]);
+   readcn = getulong(bp->b_data + bo);
readcn &= ~FAT32_MASK;
readcn |= newcontents & FAT32_MASK;
-   putulong(>b_data[bo], readcn);
+   putulong(bp->b_data + bo, readcn);
break;
}
updatefats(pmp, bp, bn);
@@ -595,7 +595,7 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon
newc = --count > 0 ? start : fillwith;
switch (pmp->pm_fatmask) {
case FAT12_MASK:
-   readcn = getushort(>b_data[bo]);
+   readcn = getushort(bp->b_data + bo);
if (start & 1) {
readcn &= 0xf000;
readcn |= newc & 0xfff;
@@ -603,20 +603,20 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon
readcn &= 0x000f;
readcn |= newc << 4;
}
-   putushort(>b_data[bo], readcn);
+   putushort(bp->b_data + bo, readcn);
bo++;
if (!(start & 1))
bo++;
break;
case FAT16_MASK:
-   putushort(>b_data[bo], newc);
+   putushort(bp->b_data + bo, newc);
bo += 2;
break;
case FAT32_MASK:
-   readcn = getulong(>b_data[bo]);
+

svn commit: r351367 - stable/12/share/man/man7

2019-08-21 Thread Ed Maste
Author: emaste
Date: Thu Aug 22 00:33:22 2019
New Revision: 351367
URL: https://svnweb.freebsd.org/changeset/base/351367

Log:
  arch.7: add default tool chain table
  
  MFC r351035: arch.7: add tool chain table
  MFC r351036: arch.7: add deprecation notice for GCC 4.2.1
  MFC r351037: arch.7: clarify that the table shows the default tool chain
  MFC r351063: arch.7: be explicit about the future for unmigrated GCC 4.2.1 
archs

Modified:
  stable/12/share/man/man7/arch.7
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man7/arch.7
==
--- stable/12/share/man/man7/arch.7 Thu Aug 22 00:19:41 2019
(r351366)
+++ stable/12/share/man/man7/arch.7 Thu Aug 22 00:33:22 2019
(r351367)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 5, 2018
+.Dd August 14, 2019
 .Dt ARCH 7
 .Os
 .Sh NAME
@@ -295,6 +295,50 @@ is 8 bytes on all supported architectures except i386.
 .Fx 11.0 ,
 armv6 used the softfp ABI even though it supported only processors
 with a floating point unit.
+.Ss Default Tool Chain
+.Fx uses a variety of tool chain components for the supported CPU
+architectures:
+.Xr clang 1
+and
+.Xr ld.lld 1
+provided by the base system,
+GNU
+.Xr gcc 1
+and Binutils
+.Xr ld 1 ,
+or an external toolchain compiler and linker provided by a port or package.
+This table shows the default tool chain for each architecture.
+.Bl -column -offset indent "Sy Architecture" "Sy Compiler" "Sy Linker"
+.It Sy Architecture Ta Sy Compiler Ta Sy Linker
+.It aarch64 Ta Clang Ta lld
+.It amd64   Ta Clang Ta lld
+.It arm Ta Clang Ta GNU ld 2.17.50
+.It armv6   Ta Clang Ta GNU ld 2.17.50
+.It armv7   Ta Clang Ta lld
+.It i386Ta Clang Ta lld
+.It mipsTa GCC 4.2.1 Ta GNU ld 2.17.50
+.It mipsel  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mipselhfTa GCC 4.2.1 Ta GNU ld 2.17.50
+.It mipshf  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mipsn32 Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mips64  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mips64elTa GCC 4.2.1 Ta GNU ld 2.17.50
+.It mips64elhf  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mips64hfTa GCC 4.2.1 Ta GNU ld 2.17.50
+.It powerpc Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It powerpcspe  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It powerpc64   Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It riscv64 Ta GCC(1)Ta GNU ld(1)
+.It riscv64sf   Ta GCC(1)Ta GNU ld(1)
+.It sparc64 Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.El
+.Pp
+(1) External toolchain provided by ports/packages.
+.Pp
+Note that GCC 4.2.1 is deprecated, and scheduled for removal on 2020-03-31.
+Any CPU architectures not migrated by then
+(to either base system Clang or external toolchain)
+may be removed from the tree after that date.
 .Ss Predefined Macros
 The compiler provides a number of predefined macros.
 Some of these provide architecture-specific details and are explained below.
___
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: r351347 - head/usr.sbin/makefs/msdos

2019-08-21 Thread Ed Maste
Author: emaste
Date: Wed Aug 21 19:09:40 2019
New Revision: 351347
URL: https://svnweb.freebsd.org/changeset/base/351347

Log:
  makefs: Verify that the BPB media descriptor and FAT ID match
  
  From r322982 in sys/fs/msdosfs.

Modified:
  head/usr.sbin/makefs/msdos/msdosfs_fat.c

Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_fat.cWed Aug 21 19:07:13 2019
(r351346)
+++ head/usr.sbin/makefs/msdos/msdosfs_fat.cWed Aug 21 19:09:40 2019
(r351347)
@@ -887,19 +887,17 @@ fillinusemap(struct msdosfsmount *pmp)
 * zero.  These represent free clusters.
 */
pmp->pm_freeclustercount = 0;
-   for (cn = CLUST_FIRST; cn <= pmp->pm_maxcluster; cn++) {
+   for (cn = 0; cn <= pmp->pm_maxcluster; cn++) {
byteoffset = FATOFS(pmp, cn);
bo = byteoffset % pmp->pm_fatblocksize;
-   if (bo == 0 || bp == NULL) {
+   if (bo == 0) {
/* Read new FAT block */
if (bp != NULL)
brelse(bp);
fatblock(pmp, byteoffset, , , NULL);
error = bread(pmp->pm_devvp, bn, bsize, NOCRED, );
-   if (error != 0) {
-   brelse(bp);
+   if (error != 0)
return (error);
-   }
}
if (FAT32(pmp))
readcn = getulong(bp->b_data + bo);
@@ -909,7 +907,19 @@ fillinusemap(struct msdosfsmount *pmp)
readcn >>= 4;
readcn &= pmp->pm_fatmask;
 
-   if (readcn == CLUST_FREE)
+   /*
+* Check if the FAT ID matches the BPB's media descriptor and
+* all other bits are set to 1.
+*/
+   if (cn == 0 && readcn != ((pmp->pm_fatmask & 0xff00) |
+   pmp->pm_bpb.bpbMedia)) {
+#ifdef MSDOSFS_DEBUG
+   printf("mountmsdosfs(): Media descriptor in BPB"
+   "does not match FAT ID\n");
+#endif
+   brelse(bp);
+   return (EINVAL);
+   } else if (readcn == CLUST_FREE)
usemap_free(pmp, cn);
}
if (bp != 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: r351346 - in head: sys/fs/msdosfs usr.sbin/makefs usr.sbin/makefs/ffs usr.sbin/makefs/msdos

2019-08-21 Thread Ed Maste
Author: emaste
Date: Wed Aug 21 19:07:13 2019
New Revision: 351346
URL: https://svnweb.freebsd.org/changeset/base/351346

Log:
  makefs: share denode.h between kernel msdosfs and makefs
  
  There is no need to duplicate this file when it can be trivially
  shared (just exposing sections previously under #ifdef _KERNEL).
  
  MFC with: r351273
  Differential Revision:The FreeBSD Foundation

Deleted:
  head/usr.sbin/makefs/msdos/denode.h
Modified:
  head/sys/fs/msdosfs/denode.h
  head/usr.sbin/makefs/ffs/buf.h
  head/usr.sbin/makefs/msdos.c
  head/usr.sbin/makefs/msdos/msdosfs_conv.c
  head/usr.sbin/makefs/msdos/msdosfs_denode.c
  head/usr.sbin/makefs/msdos/msdosfs_fat.c
  head/usr.sbin/makefs/msdos/msdosfs_lookup.c
  head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
  head/usr.sbin/makefs/msdos/msdosfs_vnops.c

Modified: head/sys/fs/msdosfs/denode.h
==
--- head/sys/fs/msdosfs/denode.hWed Aug 21 18:28:38 2019
(r351345)
+++ head/sys/fs/msdosfs/denode.hWed Aug 21 19:07:13 2019
(r351346)
@@ -213,7 +213,7 @@ struct denode {
 ((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), 
\
 putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16))
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(MAKEFS)
 
 #defineVTODE(vp)   ((struct denode *)(vp)->v_data)
 #defineDETOV(de)   ((de)->de_vnode)
@@ -262,9 +262,11 @@ struct defid {
 
 extern struct vop_vector msdosfs_vnodeops;
 
+#ifdef _KERNEL
 int msdosfs_lookup(struct vop_cachedlookup_args *);
 int msdosfs_inactive(struct vop_inactive_args *);
 int msdosfs_reclaim(struct vop_reclaim_args *);
+#endif
 
 /*
  * Internal service routine prototypes.
@@ -283,5 +285,5 @@ int deupdat(struct denode *dep, int waitfor);
 int removede(struct denode *pdep, struct denode *dep);
 int detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred);
 int doscheckpath( struct denode *source, struct denode *target);
-#endif /* _KERNEL */
+#endif /* _KERNEL || MAKEFS */
 #endif /* !_FS_MSDOSFS_DENODE_H_ */

Modified: head/usr.sbin/makefs/ffs/buf.h
==
--- head/usr.sbin/makefs/ffs/buf.h  Wed Aug 21 18:28:38 2019
(r351345)
+++ head/usr.sbin/makefs/ffs/buf.h  Wed Aug 21 19:07:13 2019
(r351346)
@@ -45,6 +45,7 @@
 #include 
 #include 
 
+struct componentname;
 struct makefs_fsinfo;
 struct ucred;
 

Modified: head/usr.sbin/makefs/msdos.c
==
--- head/usr.sbin/makefs/msdos.cWed Aug 21 18:28:38 2019
(r351345)
+++ head/usr.sbin/makefs/msdos.cWed Aug 21 19:07:13 2019
(r351346)
@@ -55,17 +55,17 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "ffs/buf.h"
 #include "makefs.h"
 #include "msdos.h"
 
 #include 
 #include 
+#include "msdos/direntry.h"
+#include 
 
-#include "ffs/buf.h"
 
 #include "msdos/msdosfsmount.h"
-#include "msdos/direntry.h"
-#include "msdos/denode.h"
 
 static int msdos_populate_dir(const char *, struct denode *, fsnode *,
 fsnode *, fsinfo_t *);

Modified: head/usr.sbin/makefs/msdos/msdosfs_conv.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_conv.c   Wed Aug 21 18:28:38 2019
(r351345)
+++ head/usr.sbin/makefs/msdos/msdosfs_conv.c   Wed Aug 21 19:07:13 2019
(r351346)
@@ -56,13 +56,11 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include "msdos/direntry.h"
+#include "msdos/msdosfsmount.h"
 
 #include "makefs.h"
 #include "msdos.h"
-
-#include "msdos/denode.h"
-#include "msdos/direntry.h"
-#include "msdos/msdosfsmount.h"
 
 static int char8ucs2str(const uint8_t *in, int n, uint16_t *out, int m);
 static void ucs2pad(uint16_t *buf, int len, int size);

Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Aug 21 18:28:38 2019
(r351345)
+++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Aug 21 19:07:13 2019
(r351346)
@@ -59,18 +59,18 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "ffs/buf.h"
+
 #include 
-#include "msdos/denode.h"
-#include "msdos/msdosfsmount.h"
+#include 
+#include 
 #include 
+#include "msdos/msdosfsmount.h"
 
 #include "makefs.h"
 #include "msdos.h"
 
-#include "ffs/buf.h"
 
-#include "msdos/direntry.h"
-
 /*
  * If deget() succeeds it returns with the gotten denode locked().
  *
@@ -208,7 +208,7 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_lon
  * Truncate the file described by dep to the length specified by length.
  */
 int
-detrunc(struct denode *dep, u_long length, int flags)
+detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred)
 {
int error;
int allerror;
@@ 

svn commit: r351321 - in head: sys/fs/msdosfs usr.sbin/makefs/msdos

2019-08-20 Thread Ed Maste
Author: emaste
Date: Wed Aug 21 02:21:40 2019
New Revision: 351321
URL: https://svnweb.freebsd.org/changeset/base/351321

Log:
  makefs: share fat.h between kernel msdosfs and makefs
  
  There is no reason to duplicate this file when it can be trivially
  shared (just exposing one section previously under #ifdef _KERNEL).
  
  Reviewed by:  imp, cem
  MFC with: r351273
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21346

Deleted:
  head/usr.sbin/makefs/msdos/fat.h
Modified:
  head/sys/fs/msdosfs/fat.h
  head/usr.sbin/makefs/msdos/Makefile.inc
  head/usr.sbin/makefs/msdos/msdosfs_conv.c
  head/usr.sbin/makefs/msdos/msdosfs_denode.c
  head/usr.sbin/makefs/msdos/msdosfs_fat.c
  head/usr.sbin/makefs/msdos/msdosfs_lookup.c
  head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
  head/usr.sbin/makefs/msdos/msdosfs_vnops.c

Modified: head/sys/fs/msdosfs/fat.h
==
--- head/sys/fs/msdosfs/fat.h   Wed Aug 21 02:17:39 2019(r351320)
+++ head/sys/fs/msdosfs/fat.h   Wed Aug 21 02:21:40 2019(r351321)
@@ -82,7 +82,7 @@
 
 #defineMSDOSFSEOF(pmp, cn) cn) | ~(pmp)->pm_fatmask) & 
CLUST_EOFS) == CLUST_EOFS)
 
-#ifdef _KERNEL
+#if defined (_KERNEL) || defined(MAKEFS)
 /*
  * These are the values for the function argument to the function
  * fatentry().
@@ -105,5 +105,5 @@ int extendfile(struct denode *dep, u_long count, struc
 void fc_purge(struct denode *dep, u_int frcn);
 int markvoldirty(struct msdosfsmount *pmp, int dirty);
 
-#endif /* _KERNEL */
+#endif /* _KERNEL || MAKEFS */
 #endif /* !_FS_MSDOSFS_FAT_H_ */

Modified: head/usr.sbin/makefs/msdos/Makefile.inc
==
--- head/usr.sbin/makefs/msdos/Makefile.inc Wed Aug 21 02:17:39 2019
(r351320)
+++ head/usr.sbin/makefs/msdos/Makefile.inc Wed Aug 21 02:21:40 2019
(r351321)
@@ -6,7 +6,7 @@ MSDOS_NEWFS=${SRCTOP}/sbin/newfs_msdos
 
 .PATH: ${SRCDIR}/msdos ${MSDOS} ${MSDOS_NEWFS}
 
-CFLAGS+= -I${MSDOS} -I${MSDOS_NEWFS}
+CFLAGS+= -DMAKEFS -I${MSDOS} -I${MSDOS_NEWFS}
 
 SRCS+= mkfs_msdos.c
 SRCS+= msdosfs_conv.c msdosfs_denode.c msdosfs_fat.c msdosfs_lookup.c

Modified: head/usr.sbin/makefs/msdos/msdosfs_conv.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_conv.c   Wed Aug 21 02:17:39 2019
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_conv.c   Wed Aug 21 02:21:40 2019
(r351321)
@@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$");
 
 #include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
 #include "msdos/msdosfsmount.h"
 
 static int char8ucs2str(const uint8_t *in, int n, uint16_t *out, int m);

Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Aug 21 02:17:39 2019
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Aug 21 02:21:40 2019
(r351321)
@@ -60,16 +60,16 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include "msdos/denode.h"
+#include "msdos/msdosfsmount.h"
+#include 
 
 #include "makefs.h"
 #include "msdos.h"
 
 #include "ffs/buf.h"
 
-#include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
-#include "msdos/msdosfsmount.h"
 
 /*
  * If deget() succeeds it returns with the gotten denode locked().

Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_fat.cWed Aug 21 02:17:39 2019
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_fat.cWed Aug 21 02:21:40 2019
(r351321)
@@ -59,13 +59,13 @@
 #include 
 
 #include 
+#include "msdos/denode.h"
+#include "msdos/msdosfsmount.h"
+#include 
 
 #include "ffs/buf.h"
 
-#include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
-#include "msdos/msdosfsmount.h"
 
 #include "makefs.h"
 #include "msdos.h"

Modified: head/usr.sbin/makefs/msdos/msdosfs_lookup.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_lookup.c Wed Aug 21 02:17:39 2019
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_lookup.c Wed Aug 21 02:21:40 2019
(r351321)
@@ -57,13 +57,13 @@
 #include 
 
 #include 
+#include "msdos/denode.h"
+#include "msdos/msdosfsmount.h"
+#include 
 
 #include "ffs/buf.h"
 
-#include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
-#include "msdos/msdosfsmount.h"
 
 #include "makefs.h"
 #include "msdos.h"

Modified: head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Wed Aug 21 02:17:39 2019
(r351320)
+++ 

svn commit: r351319 - in head/usr.sbin/makefs: ffs msdos

2019-08-20 Thread Ed Maste
Author: emaste
Date: Wed Aug 21 01:45:29 2019
New Revision: 351319
URL: https://svnweb.freebsd.org/changeset/base/351319

Log:
  makefs: use `char *` not `void *` for buf b_data, drop casts in msdos
  
  (The kernel uses caddr_t.)
  
  Suggested by: cem
  Reviewed by:  cem
  MFC with: r351273
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21348

Modified:
  head/usr.sbin/makefs/ffs/buf.h
  head/usr.sbin/makefs/msdos/msdosfs_fat.c

Modified: head/usr.sbin/makefs/ffs/buf.h
==
--- head/usr.sbin/makefs/ffs/buf.h  Tue Aug 20 21:59:48 2019
(r351318)
+++ head/usr.sbin/makefs/ffs/buf.h  Wed Aug 21 01:45:29 2019
(r351319)
@@ -54,7 +54,7 @@ struct vnode {
 };
 
 struct buf {
-   void *  b_data;
+   char *  b_data;
longb_bufsize;
longb_bcount;
daddr_t b_blkno;

Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_fat.cTue Aug 20 21:59:48 2019
(r351318)
+++ head/usr.sbin/makefs/msdos/msdosfs_fat.cWed Aug 21 01:45:29 2019
(r351319)
@@ -220,9 +220,9 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp
return (EIO);
}
if (FAT32(pmp))
-   cn = getulong((char *)bp->b_data + bo);
+   cn = getulong(bp->b_data + bo);
else
-   cn = getushort((char *)bp->b_data + bo);
+   cn = getushort(bp->b_data + bo);
if (FAT12(pmp) && (prevcn & 1))
cn >>= 4;
cn &= pmp->pm_fatmask;
@@ -502,9 +502,9 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
 
if (function & FAT_GET) {
if (FAT32(pmp))
-   readcn = getulong((char *)bp->b_data + bo);
+   readcn = getulong(bp->b_data + bo);
else
-   readcn = getushort((char *)bp->b_data + bo);
+   readcn = getushort(bp->b_data + bo);
if (FAT12(pmp) & (cn & 1))
readcn >>= 4;
readcn &= pmp->pm_fatmask;
@@ -516,7 +516,7 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
if (function & FAT_SET) {
switch (pmp->pm_fatmask) {
case FAT12_MASK:
-   readcn = getushort((char *)bp->b_data + bo);
+   readcn = getushort(bp->b_data + bo);
if (cn & 1) {
readcn &= 0x000f;
readcn |= newcontents << 4;
@@ -524,20 +524,20 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
readcn &= 0xf000;
readcn |= newcontents & 0xfff;
}
-   putushort((char *)bp->b_data + bo, readcn);
+   putushort(bp->b_data + bo, readcn);
break;
case FAT16_MASK:
-   putushort((char *)bp->b_data + bo, newcontents);
+   putushort(bp->b_data + bo, newcontents);
break;
case FAT32_MASK:
/*
 * According to spec we have to retain the
 * high order bits of the FAT entry.
 */
-   readcn = getulong((char *)bp->b_data + bo);
+   readcn = getulong(bp->b_data + bo);
readcn &= ~FAT32_MASK;
readcn |= newcontents & FAT32_MASK;
-   putulong((char *)bp->b_data + bo, readcn);
+   putulong(bp->b_data + bo, readcn);
break;
}
updatefats(pmp, bp, bn);
@@ -587,7 +587,7 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon
newc = --count > 0 ? start : fillwith;
switch (pmp->pm_fatmask) {
case FAT12_MASK:
-   readcn = getushort((char *)bp->b_data + bo);
+   readcn = getushort(bp->b_data + bo);
if (start & 1) {
readcn &= 0xf000;
readcn |= newc & 0xfff;
@@ -595,20 +595,20 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon
readcn &= 0x000f;
readcn |= newc << 4;
}
-   putushort((char *)bp->b_data + bo, readcn);
+   

svn commit: r351302 - head/usr.sbin/makefs

2019-08-20 Thread Ed Maste
Author: emaste
Date: Tue Aug 20 21:14:44 2019
New Revision: 351302
URL: https://svnweb.freebsd.org/changeset/base/351302

Log:
  makefs.8: update history
  
  - ported to FreeBSD and first appeared in 8.0
  - Christos Zoulas added the FAT support that I imported

Modified:
  head/usr.sbin/makefs/makefs.8

Modified: head/usr.sbin/makefs/makefs.8
==
--- head/usr.sbin/makefs/makefs.8   Tue Aug 20 20:59:44 2019
(r351301)
+++ head/usr.sbin/makefs/makefs.8   Tue Aug 20 21:14:44 2019
(r351302)
@@ -499,6 +499,10 @@ The
 .Nm
 utility appeared in
 .Nx 1.6 .
+It was ported to
+.Fx
+and first appeared in
+.Fx 8.0 .
 .Sh AUTHORS
 .An Luke Mewburn
 .Aq Mt lu...@netbsd.org
@@ -508,4 +512,6 @@ utility appeared in
 .An Ryan Gabrys ,
 .An Alan Perez-Rathke ,
 .An Ram Vedam
-(cd9660 support)
+(cd9660 support),
+.An Christos Zoulas
+(msdos support).
___
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: r351275 - head/usr.sbin/makefs/msdos

2019-08-20 Thread Ed Maste
Author: emaste
Date: Tue Aug 20 20:04:16 2019
New Revision: 351275
URL: https://svnweb.freebsd.org/changeset/base/351275

Log:
  makefs: avoid "dereferencing 'void *' pointer" warnings
  
  On GCC 4.2.1 archs
  
  MFC with: r351273
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/makefs/msdos/msdosfs_fat.c

Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c
==
--- head/usr.sbin/makefs/msdos/msdosfs_fat.cTue Aug 20 19:31:11 2019
(r351274)
+++ head/usr.sbin/makefs/msdos/msdosfs_fat.cTue Aug 20 20:04:16 2019
(r351275)
@@ -220,9 +220,9 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp
return (EIO);
}
if (FAT32(pmp))
-   cn = getulong(>b_data[bo]);
+   cn = getulong((char *)bp->b_data + bo);
else
-   cn = getushort(>b_data[bo]);
+   cn = getushort((char *)bp->b_data + bo);
if (FAT12(pmp) && (prevcn & 1))
cn >>= 4;
cn &= pmp->pm_fatmask;
@@ -502,9 +502,9 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
 
if (function & FAT_GET) {
if (FAT32(pmp))
-   readcn = getulong(>b_data[bo]);
+   readcn = getulong((char *)bp->b_data + bo);
else
-   readcn = getushort(>b_data[bo]);
+   readcn = getushort((char *)bp->b_data + bo);
if (FAT12(pmp) & (cn & 1))
readcn >>= 4;
readcn &= pmp->pm_fatmask;
@@ -516,7 +516,7 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
if (function & FAT_SET) {
switch (pmp->pm_fatmask) {
case FAT12_MASK:
-   readcn = getushort(>b_data[bo]);
+   readcn = getushort((char *)bp->b_data + bo);
if (cn & 1) {
readcn &= 0x000f;
readcn |= newcontents << 4;
@@ -524,20 +524,20 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon
readcn &= 0xf000;
readcn |= newcontents & 0xfff;
}
-   putushort(>b_data[bo], readcn);
+   putushort((char *)bp->b_data + bo, readcn);
break;
case FAT16_MASK:
-   putushort(>b_data[bo], newcontents);
+   putushort((char *)bp->b_data + bo, newcontents);
break;
case FAT32_MASK:
/*
 * According to spec we have to retain the
 * high order bits of the FAT entry.
 */
-   readcn = getulong(>b_data[bo]);
+   readcn = getulong((char *)bp->b_data + bo);
readcn &= ~FAT32_MASK;
readcn |= newcontents & FAT32_MASK;
-   putulong(>b_data[bo], readcn);
+   putulong((char *)bp->b_data + bo, readcn);
break;
}
updatefats(pmp, bp, bn);
@@ -587,7 +587,7 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon
newc = --count > 0 ? start : fillwith;
switch (pmp->pm_fatmask) {
case FAT12_MASK:
-   readcn = getushort(>b_data[bo]);
+   readcn = getushort((char *)bp->b_data + bo);
if (start & 1) {
readcn &= 0xf000;
readcn |= newc & 0xfff;
@@ -595,20 +595,20 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon
readcn &= 0x000f;
readcn |= newc << 4;
}
-   putushort(>b_data[bo], readcn);
+   putushort((char *)bp->b_data + bo, readcn);
bo++;
if (!(start & 1))
bo++;
break;
case FAT16_MASK:
-   putushort(>b_data[bo], newc);
+   putushort((char *)bp->b_data + bo, newc);
bo += 2;
break;
case FAT32_MASK:
-   readcn = getulong(>b_data[bo]);
+   readcn = getulong((char *)bp->b_data + bo);
readcn &= ~pmp->pm_fatmask;
 

svn commit: r351273 - in head/usr.sbin/makefs: . msdos

2019-08-20 Thread Ed Maste
Author: emaste
Date: Tue Aug 20 18:20:45 2019
New Revision: 351273
URL: https://svnweb.freebsd.org/changeset/base/351273

Log:
  makefs: add msdosfs (FAT) support
  
  Add FAT support to makefs by copying some files from sys/fs/msdosfs/ and
  updating others with changes from NetBSD.
  
  The six files copied from sys/fs/msdosfs at r348251 and modified are:
  denode.h direntry.h fat.h msdosfs_fat.c msdosfs_lookup.c msdosfsmount.h
  
  I would prefer to avoid the duplication, but reluctance to doing so was
  expressed in a previous review (D11197); for now copy the files and
  revisit in the future.
  
  Submitted by: Siva Mahadevan
  Discussed with:   cem, imp
  MFC after:1 month
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D16438

Added:
  head/usr.sbin/makefs/msdos/Makefile.inc   (contents, props changed)
  head/usr.sbin/makefs/msdos/denode.h
 - copied, changed from r351251, head/sys/fs/msdosfs/denode.h
  head/usr.sbin/makefs/msdos/direntry.h
 - copied, changed from r351251, head/sys/fs/msdosfs/direntry.h
  head/usr.sbin/makefs/msdos/fat.h
 - copied, changed from r351251, head/sys/fs/msdosfs/fat.h
  head/usr.sbin/makefs/msdos/msdosfs_conv.c   (contents, props changed)
  head/usr.sbin/makefs/msdos/msdosfs_fat.c
 - copied, changed from r351251, head/sys/fs/msdosfs/msdosfs_fat.c
  head/usr.sbin/makefs/msdos/msdosfs_lookup.c
 - copied, changed from r351251, head/sys/fs/msdosfs/msdosfs_lookup.c
  head/usr.sbin/makefs/msdos/msdosfsmount.h
 - copied, changed from r351251, head/sys/fs/msdosfs/msdosfsmount.h
Modified:
  head/usr.sbin/makefs/Makefile
  head/usr.sbin/makefs/makefs.8
  head/usr.sbin/makefs/makefs.c
  head/usr.sbin/makefs/makefs.h
  head/usr.sbin/makefs/msdos.c
  head/usr.sbin/makefs/msdos.h
  head/usr.sbin/makefs/msdos/msdosfs_denode.c
  head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
  head/usr.sbin/makefs/msdos/msdosfs_vnops.c

Modified: head/usr.sbin/makefs/Makefile
==
--- head/usr.sbin/makefs/Makefile   Tue Aug 20 18:02:37 2019
(r351272)
+++ head/usr.sbin/makefs/Makefile   Tue Aug 20 18:20:45 2019
(r351273)
@@ -8,8 +8,10 @@ PROG=  makefs
 
 CFLAGS+=-I${SRCDIR}
 
-SRCS=  cd9660.c ffs.c \
+SRCS=  cd9660.c \
+   ffs.c \
makefs.c \
+   msdos.c \
mtree.c \
walk.c
 MAN=   makefs.8
@@ -18,6 +20,7 @@ WARNS?=   2
 
 .include "${SRCDIR}/cd9660/Makefile.inc"
 .include "${SRCDIR}/ffs/Makefile.inc"
+.include "${SRCDIR}/msdos/Makefile.inc"
 
 CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1
 

Modified: head/usr.sbin/makefs/makefs.8
==
--- head/usr.sbin/makefs/makefs.8   Tue Aug 20 18:02:37 2019
(r351272)
+++ head/usr.sbin/makefs/makefs.8   Tue Aug 20 18:20:45 2019
(r351273)
@@ -35,7 +35,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 19, 2019
+.Dd August 20, 2019
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -198,7 +198,9 @@ and
 Instead of creating the filesystem at the beginning of the file, start
 at offset.
 Valid only for
-.Sy ffs .
+.Sy ffs
+and
+.Sy msdos .
 .It Fl o Ar fs-options
 Set file system specific options.
 .Ar fs-options
@@ -232,10 +234,14 @@ and the maximum
 sizes to the same value.
 For
 .Sy ffs
+and
+.Sy msdos
 the
 .Ar image-size
 does not include the
 .Ar offset .
+.Ar offset
+is not included in that size.
 .It Fl T Ar timestamp
 Specify a timestamp to be set for all filesystem files and directories
 created so that repeatable builds are possible.
@@ -258,6 +264,8 @@ The following file system types are supported:
 BSD fast file system (default).
 .It Sy cd9660
 ISO 9660 file system.
+.It Sy msdos
+FAT12, FAT16, or FAT32 file system.
 .El
 .It Fl x
 Exclude file system nodes not explicitly listed in the specfile.
@@ -420,6 +428,67 @@ Use RockRidge extensions (for longer filenames, etc.).
 Turns on verbose output.
 .It Sy volumeid
 Volume set identifier of the image.
+.El
+.Ss msdos-specific options
+.Sy msdos
+images have MS-DOS-specific optional parameters that may be
+provided.
+The arguments consist of a keyword, an equal sign
+.Pq Ql = ,
+and a value.
+The following keywords are supported (see
+.Xr newfs_msdos 8
+for more details):
+.Pp
+.Bl -tag -width omit-trailing-period -offset indent -compact
+.It Cm backup_sector
+Location of the backup boot sector.
+.It Cm block_size
+Block size.
+.It Cm bootstrap
+Bootstrap file.
+.It Cm bytes_per_sector
+Bytes per sector.
+.It Cm create_size
+Create file size.
+.It Cm directory_entries
+Directory entries.
+.It Cm drive_heads
+Drive heads.
+.It Cm fat_type
+FAT type (12, 16, or 32).
+.It Cm floppy
+Preset drive parameters for standard format floppy disks
+(160, 180, 320, 360, 640, 720, 1200, 1232, 1440, or 2880).
+.It Cm hidden_sectors
+Hidden sectors.
+.It Cm info_sector
+Location of the info sector.
+.It Cm media_descriptor
+Media 

svn commit: r351257 - stable/11/sys/kern

2019-08-20 Thread Ed Maste
Author: emaste
Date: Tue Aug 20 17:46:22 2019
New Revision: 351257
URL: https://svnweb.freebsd.org/changeset/base/351257

Log:
  MFC r351254: mqueuefs: fix compat32 struct file leak
  
  In a compat32 error case we previously leaked a struct file.
  
  Submitted by: Karsten König, Secfault Security
  Security: CVE-2019-5603

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

Modified: stable/11/sys/kern/uipc_mqueue.c
==
--- stable/11/sys/kern/uipc_mqueue.cTue Aug 20 17:45:44 2019
(r351256)
+++ stable/11/sys/kern/uipc_mqueue.cTue Aug 20 17:46:22 2019
(r351257)
@@ -2788,7 +2788,7 @@ freebsd32_kmq_timedsend(struct thread *td,
if (uap->abs_timeout != NULL) {
error = copyin(uap->abs_timeout, , sizeof(ets32));
if (error != 0)
-   return (error);
+   goto out;
CP(ets32, ets, tv_sec);
CP(ets32, ets, tv_nsec);
abs_timeout = 
@@ -2797,6 +2797,7 @@ freebsd32_kmq_timedsend(struct thread *td,
waitok = !(fp->f_flag & O_NONBLOCK);
error = mqueue_send(mq, uap->msg_ptr, uap->msg_len,
uap->msg_prio, waitok, abs_timeout);
+out:
fdrop(fp, td);
return (error);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351255 - stable/12/sys/kern

2019-08-20 Thread Ed Maste
Author: emaste
Date: Tue Aug 20 17:45:22 2019
New Revision: 351255
URL: https://svnweb.freebsd.org/changeset/base/351255

Log:
  MFC r351254: mqueuefs: fix compat32 struct file leak
  
  In a compat32 error case we previously leaked a struct file.
  
  Submitted by: Karsten König, Secfault Security
  Security: CVE-2019-5603

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

Modified: stable/12/sys/kern/uipc_mqueue.c
==
--- stable/12/sys/kern/uipc_mqueue.cTue Aug 20 17:44:03 2019
(r351254)
+++ stable/12/sys/kern/uipc_mqueue.cTue Aug 20 17:45:22 2019
(r351255)
@@ -2798,7 +2798,7 @@ freebsd32_kmq_timedsend(struct thread *td,
if (uap->abs_timeout != NULL) {
error = copyin(uap->abs_timeout, , sizeof(ets32));
if (error != 0)
-   return (error);
+   goto out;
CP(ets32, ets, tv_sec);
CP(ets32, ets, tv_nsec);
abs_timeout = 
@@ -2807,6 +2807,7 @@ freebsd32_kmq_timedsend(struct thread *td,
waitok = !(fp->f_flag & O_NONBLOCK);
error = mqueue_send(mq, uap->msg_ptr, uap->msg_len,
uap->msg_prio, waitok, abs_timeout);
+out:
fdrop(fp, td);
return (error);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351254 - head/sys/kern

2019-08-20 Thread Ed Maste
Author: emaste
Date: Tue Aug 20 17:44:03 2019
New Revision: 351254
URL: https://svnweb.freebsd.org/changeset/base/351254

Log:
  mqueuefs: fix compat32 struct file leak
  
  In a compat32 error case we previously leaked a struct file.
  
  Submitted by: Karsten König, Secfault Security
  Security: CVE-2019-5603

Modified:
  head/sys/kern/uipc_mqueue.c

Modified: head/sys/kern/uipc_mqueue.c
==
--- head/sys/kern/uipc_mqueue.c Tue Aug 20 17:39:32 2019(r351253)
+++ head/sys/kern/uipc_mqueue.c Tue Aug 20 17:44:03 2019(r351254)
@@ -2806,7 +2806,7 @@ freebsd32_kmq_timedsend(struct thread *td,
if (uap->abs_timeout != NULL) {
error = copyin(uap->abs_timeout, , sizeof(ets32));
if (error != 0)
-   return (error);
+   goto out;
CP(ets32, ets, tv_sec);
CP(ets32, ets, tv_nsec);
abs_timeout = 
@@ -2815,6 +2815,7 @@ freebsd32_kmq_timedsend(struct thread *td,
waitok = !(fp->f_flag & O_NONBLOCK);
error = mqueue_send(mq, uap->msg_ptr, uap->msg_len,
uap->msg_prio, waitok, abs_timeout);
+out:
fdrop(fp, td);
return (error);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351232 - head/usr.sbin/makefs

2019-08-19 Thread Ed Maste
Author: emaste
Date: Mon Aug 19 21:38:10 2019
New Revision: 351232
URL: https://svnweb.freebsd.org/changeset/base/351232

Log:
  makefs.8: expand description of image size
  
  Submitted by: ryan_freqlabs.com, Siva Mahadevan
  Differential Revision:https://reviews.freebsd.org/D21316

Modified:
  head/usr.sbin/makefs/makefs.8

Modified: head/usr.sbin/makefs/makefs.8
==
--- head/usr.sbin/makefs/makefs.8   Mon Aug 19 21:30:12 2019
(r351231)
+++ head/usr.sbin/makefs/makefs.8   Mon Aug 19 21:38:10 2019
(r351232)
@@ -35,7 +35,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2018
+.Dd August 19, 2019
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -225,6 +225,17 @@ Defaults to 512.
 .It Fl s Ar image-size
 Set the size of the file system image to
 .Ar image-size .
+This is equivalent to setting both the minimum
+.Fl ( M )
+and the maximum
+.Fl ( m )
+sizes to the same value.
+For
+.Sy ffs
+the
+.Ar image-size
+does not include the
+.Ar offset .
 .It Fl T Ar timestamp
 Specify a timestamp to be set for all filesystem files and directories
 created so that repeatable builds are possible.
___
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: r351230 - head/usr.sbin/makefs

2019-08-19 Thread Ed Maste
Author: emaste
Date: Mon Aug 19 21:21:32 2019
New Revision: 351230
URL: https://svnweb.freebsd.org/changeset/base/351230

Log:
  makefs.8: style updates from igor
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/makefs/makefs.8

Modified: head/usr.sbin/makefs/makefs.8
==
--- head/usr.sbin/makefs/makefs.8   Mon Aug 19 19:01:59 2019
(r351229)
+++ head/usr.sbin/makefs/makefs.8   Mon Aug 19 21:21:32 2019
(r351230)
@@ -119,7 +119,7 @@ XXX: document these
 .It Fl F Ar mtree-specfile
 .Em This is almost certainly not the option you are looking for.
 To create an image from a list of files in an mtree format manifest,
-specify it as the last argument on the commandline, not as a the
+specify it as the last argument on the command line, not as a the
 argument to
 .Fl F .
 .Pp
@@ -160,10 +160,10 @@ and
 (in the case of symbolic links).
 If
 .Sy time
-isn't provided, the current time will be used.
+is not provided, the current time will be used.
 If
 .Sy flags
-isn't provided, the current file flags will be used.
+is not provided, the current file flags will be used.
 Missing regular file entries will be created as zero-length files.
 .It Fl f Ar free-files
 Ensure that a minimum of
@@ -331,9 +331,11 @@ The following keywords are supported:
 Allow the directory structure to exceed the maximum specified in
 the spec.
 .It Sy allow-illegal-chars
-Allow illegal characters in filenames. This option is not implemented.
+Allow illegal characters in filenames.
+This option is not implemented.
 .It Sy allow-lowercase
-Allow lowercase characters in filenames. This option is not implemented.
+Allow lowercase characters in filenames.
+This option is not implemented.
 .It Sy allow-max-name
 Allow 37 instead of 33 characters for filenames by omitting the
 version id.
@@ -348,7 +350,8 @@ extension to encode
 .Tn RISC OS
 metadata.
 .It Sy bootimagedir
-Boot image directory. This option is not implemented.
+Boot image directory.
+This option is not implemented.
 .It Sy chrp-boot
 Write an MBR partition table to the image to allow older CHRP hardware to
 boot.
___
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: r351131 - in head/sys/arm64: arm64 include

2019-08-16 Thread Ed Maste
Author: emaste
Date: Fri Aug 16 18:21:31 2019
New Revision: 351131
URL: https://svnweb.freebsd.org/changeset/base/351131

Log:
  aarch64: make pmap_change_attr public like on other platforms
  
  Submitted by: Greg V 
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D20787

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

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Fri Aug 16 17:10:38 2019(r351130)
+++ head/sys/arm64/arm64/pmap.c Fri Aug 16 18:21:31 2019(r351131)
@@ -295,7 +295,6 @@ static void pmap_pvh_free(struct md_page *pvh, pmap_t 
 static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap,
vm_offset_t va);
 
-static int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode);
 static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode);
 static pt_entry_t *pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va);
 static pt_entry_t *pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2,
@@ -5263,7 +5262,7 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
  * latter case, the memory type may have been changed on some part of the
  * virtual address range or the direct map.
  */
-static int
+int
 pmap_change_attr(vm_offset_t va, vm_size_t size, int mode)
 {
int error;

Modified: head/sys/arm64/include/pmap.h
==
--- head/sys/arm64/include/pmap.h   Fri Aug 16 17:10:38 2019
(r351130)
+++ head/sys/arm64/include/pmap.h   Fri Aug 16 18:21:31 2019
(r351131)
@@ -143,6 +143,7 @@ extern vm_offset_t virtual_end;
va) | (pa)) & L1_OFFSET) == 0 && (size) >= L1_SIZE)
 
 void   pmap_bootstrap(vm_offset_t, vm_offset_t, vm_paddr_t, vm_size_t);
+intpmap_change_attr(vm_offset_t va, vm_size_t size, int mode);
 void   pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode);
 void   pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t);
 vm_paddr_t pmap_kextract(vm_offset_t va);
___
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: r351122 - head/lib/libc/sys

2019-08-16 Thread Ed Maste
Author: emaste
Date: Fri Aug 16 14:14:57 2019
New Revision: 351122
URL: https://svnweb.freebsd.org/changeset/base/351122

Log:
  Add @generated tag to libc syscall asm wrappers
  
  Although libc syscall wrappers do not get checked in this can aid in
  finding the source of generated files when spelunking in the objdir.
  
  Multiple tools use @generated to identify generated files (for example,
  in a review Phabricator will by default hide diffs in generated files).
  For consistency use the @generated tag in makesyscalls.sh as we've done
  for other generated files, even though these wrappers aren't checked in
  to the tree.

Modified:
  head/lib/libc/sys/Makefile.inc

Modified: head/lib/libc/sys/Makefile.inc
==
--- head/lib/libc/sys/Makefile.inc  Fri Aug 16 14:06:04 2019
(r351121)
+++ head/lib/libc/sys/Makefile.inc  Fri Aug 16 14:14:57 2019
(r351122)
@@ -134,12 +134,14 @@ NOTE_GNU_STACK=''
 .endif
 
 ${SASM}:
-   printf '#include "compat.h"\n' > ${.TARGET}
+   printf '/* %sgenerated by libc/sys/Makefile.inc */\n' @ > ${.TARGET}
+   printf '#include "compat.h"\n' >> ${.TARGET}
printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET}
printf  ${NOTE_GNU_STACK} >>${.TARGET}
 
 ${SPSEUDO}:
-   printf '#include "compat.h"\n' > ${.TARGET}
+   printf '/* %sgenerated by libc/sys/Makefile.inc */\n' @ > ${.TARGET}
+   printf '#include "compat.h"\n' >> ${.TARGET}
printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \
>> ${.TARGET}
printf ${NOTE_GNU_STACK} >>${.TARGET}
___
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: r351121 - head/share/man/man7

2019-08-16 Thread Ed Maste
Author: emaste
Date: Fri Aug 16 14:06:04 2019
New Revision: 351121
URL: https://svnweb.freebsd.org/changeset/base/351121

Log:
  arch.7: indicate expectation that arm (i.e., v5) will be removed before 13.0
  
  MFC after:1 week

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Fri Aug 16 13:50:44 2019(r351120)
+++ head/share/man/man7/arch.7  Fri Aug 16 14:06:04 2019(r351121)
@@ -93,7 +93,7 @@ architectures, the final release.
 .It aarch64 Ta 11.0
 .It alpha   Ta 3.2   Ta 6.4
 .It amd64   Ta 5.1
-.It arm Ta 6.0
+.It arm Ta 6.0   Ta 12.x
 .It armeb   Ta 8.0   Ta 11.x
 .It armv6   Ta 10.0
 .It armv7   Ta 12.0
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351120 - head/share/man/man5

2019-08-16 Thread Ed Maste
Author: emaste
Date: Fri Aug 16 13:50:44 2019
New Revision: 351120
URL: https://svnweb.freebsd.org/changeset/base/351120

Log:
  Regen src.conf.5 after r351027 (enable BSD_CRTBEGIN on powerpc)

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Fri Aug 16 13:22:57 2019
(r351119)
+++ head/share/man/man5/src.conf.5  Fri Aug 16 13:50:44 2019
(r351120)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd August 13, 2019
+.Dd August 16, 2019
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -260,7 +260,7 @@ and
 .Pa crtend.o .
 .Pp
 This is a default setting on
-powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
+sparc64/sparc64.
 .It Va WITH_BSD_CRTBEGIN
 Enable the BSD licensed
 .Pa crtbegin.o
@@ -268,7 +268,7 @@ and
 .Pa crtend.o .
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64.
+amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64, powerpc/powerpcspe and riscv/riscv64.
 .It Va WITH_BSD_GREP
 Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
 .It Va WITHOUT_BSNMP
___
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: r351097 - head/stand/i386/gptzfsboot

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 18:43:01 2019
New Revision: 351097
URL: https://svnweb.freebsd.org/changeset/base/351097

Log:
  gptzfsboot: remove CLANG_NO_IAS
  
  Many components under stand/ had CLANG_NO_IAS added when Clang's
  Integrated Assembler did not handle .codeNN directives.  Clang gained
  support quite some time ago, so we can build stand/ with IAS.
  
  In some cases there were small differences in generated object output.
  In the case of gptzfsboot however using GNU as or Clang IAS to assemble
  gptldr.S resulted in identical final gptzfsboot binary output.
  
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5

Modified:
  head/stand/i386/gptzfsboot/Makefile

Modified: head/stand/i386/gptzfsboot/Makefile
==
--- head/stand/i386/gptzfsboot/Makefile Thu Aug 15 17:59:22 2019
(r351096)
+++ head/stand/i386/gptzfsboot/Makefile Thu Aug 15 18:43:01 2019
(r351097)
@@ -71,6 +71,3 @@ gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o 
 zfsboot.o: ${ZFSSRC}/zfsimpl.c
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.gptldr.S=   ${CLANG_NO_IAS}
___
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: r351096 - head/stand/i386/pxeldr

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 17:59:22 2019
New Revision: 351096
URL: https://svnweb.freebsd.org/changeset/base/351096

Log:
  stand: remove CLANG_NO_IAS from pxeldr
  
  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.  In most cases IAS- and GNU as-assembled boot components were
  identical, and CLANG_NO_IAS was already removed from other components.
  
  Clang IAS produces different output for some components, including
  pxeldr, so CLANG_NO_IAS was not previously removed for those.
  
  In the case of pxeldr the difference is that IAS adds a size override
  prefix (67h) to three instructions to specify a 32-bit address, even
  though the two high bytes are zero and the address fits in 16 bits.
  this wastes three bytes per instruction and causes some additional nop
  npadding to be required elsewhere in the object, but pxeboot is not
  size-constrained so it doesn't matter.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/stand/i386/pxeldr/Makefile

Modified: head/stand/i386/pxeldr/Makefile
==
--- head/stand/i386/pxeldr/Makefile Thu Aug 15 17:43:36 2019
(r351095)
+++ head/stand/i386/pxeldr/Makefile Thu Aug 15 17:59:22 2019
(r351096)
@@ -43,6 +43,3 @@ ${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN}
-b ${BTXKERN} ${LOADERBIN}
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.pxeldr.S=   ${CLANG_NO_IAS}
___
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: r351092 - head/stand/i386/cdboot

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 17:32:39 2019
New Revision: 351092
URL: https://svnweb.freebsd.org/changeset/base/351092

Log:
  stand: remove CLANG_NO_IAS from cdboot
  
  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.  In most cases IAS- and GNU as-assembled boot components were
  identical, and CLANG_NO_IAS was already removed from other components.
  
  Clang IAS produces different output for some components, including
  cdboot, so CLANG_NO_IAS was not previously removed for those.
  
  In the case of cdboot the difference is that IAS adds a size override
  prefix (67h) to many instructions to specify a 32-bit address, even
  though the two high bytes are zero.  This wastes three bytes per
  instance, but as cdboot is not size-constrained it doesn't matter.
  Padding is also different in one case; Clang used two one-byte nops
  while GNU as used a single two-byte xchg %eax, %eax.  In any case, there
  is no functional change.
  
  Sponsored by:   The FreeBSD Foundation

Modified:
  head/stand/i386/cdboot/Makefile

Modified: head/stand/i386/cdboot/Makefile
==
--- head/stand/i386/cdboot/Makefile Thu Aug 15 17:31:11 2019
(r351091)
+++ head/stand/i386/cdboot/Makefile Thu Aug 15 17:32:39 2019
(r351092)
@@ -14,6 +14,3 @@ ORG=  0x7c00
 LDFLAGS+=${LDFLAGS_BIN}
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.cdboot.S=   ${CLANG_NO_IAS}
___
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: r351073 - head/stand/i386/boot2

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 14:54:18 2019
New Revision: 351073
URL: https://svnweb.freebsd.org/changeset/base/351073

Log:
  stand: remove CLANG_NO_IAS from boot2
  
  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.  In most cases IAS- and GNU as-assembled boot components were
  identical, and CLANG_NO_IAS was already removed from other components.
  
  Clang IAS produces different output for some components, including
  boot2, so CLANG_NO_IAS was not previously removed for those.
  
  In the case of boot2 the difference is that IAS produces a larger
  encoding for one instruction (the testb at the beginning of read).
  
  GNU as produces:
  
  2ef6 06 b0 08   80
  
  while IAS includes an address size override prefix (67) and produces:
  
  2e 67 f6 05 b3 08 00 00 80
  
  This results in three fewer NOPs elsewhere in boot2 but no functional
  change, so switch to IAS for boot2.
  
  (We can separately pursue improved 16-bit IAS support with the LLVM
  developers.)
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/stand/i386/boot2/Makefile

Modified: head/stand/i386/boot2/Makefile
==
--- head/stand/i386/boot2/Makefile  Thu Aug 15 14:11:11 2019
(r351072)
+++ head/stand/i386/boot2/Makefile  Thu Aug 15 14:54:18 2019
(r351073)
@@ -91,6 +91,3 @@ boot2.h: boot1.out
REL1=`printf "%d" ${REL1}` > ${.TARGET}
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.boot1.S=${CLANG_NO_IAS}
___
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: r351070 - in head/contrib/telnet: arpa libtelnet telnet telnetd

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 13:27:57 2019
New Revision: 351070
URL: https://svnweb.freebsd.org/changeset/base/351070

Log:
  telnet: remove 3rd clause from Berkeley copyrights
  
  Per the July 22, 1999 letter (in /COPYRIGHT) from
  William Hoskins
  Director, Office of Technology Licensing
  University of California, Berkeley
  
  MFC after:1 week

Modified:
  head/contrib/telnet/arpa/telnet.h
  head/contrib/telnet/libtelnet/auth-proto.h
  head/contrib/telnet/libtelnet/auth.c
  head/contrib/telnet/libtelnet/auth.h
  head/contrib/telnet/libtelnet/enc-proto.h
  head/contrib/telnet/libtelnet/enc_des.c
  head/contrib/telnet/libtelnet/encrypt.c
  head/contrib/telnet/libtelnet/encrypt.h
  head/contrib/telnet/libtelnet/genget.c
  head/contrib/telnet/libtelnet/getent.c
  head/contrib/telnet/libtelnet/kerberos.c
  head/contrib/telnet/libtelnet/kerberos5.c
  head/contrib/telnet/libtelnet/key-proto.h
  head/contrib/telnet/libtelnet/krb4encpwd.c
  head/contrib/telnet/libtelnet/misc-proto.h
  head/contrib/telnet/libtelnet/misc.c
  head/contrib/telnet/libtelnet/misc.h
  head/contrib/telnet/libtelnet/read_password.c
  head/contrib/telnet/libtelnet/rsaencpwd.c
  head/contrib/telnet/telnet/authenc.c
  head/contrib/telnet/telnet/commands.c
  head/contrib/telnet/telnet/defines.h
  head/contrib/telnet/telnet/externs.h
  head/contrib/telnet/telnet/fdset.h
  head/contrib/telnet/telnet/general.h
  head/contrib/telnet/telnet/main.c
  head/contrib/telnet/telnet/network.c
  head/contrib/telnet/telnet/ring.c
  head/contrib/telnet/telnet/ring.h
  head/contrib/telnet/telnet/sys_bsd.c
  head/contrib/telnet/telnet/telnet.1
  head/contrib/telnet/telnet/telnet.c
  head/contrib/telnet/telnet/terminal.c
  head/contrib/telnet/telnet/types.h
  head/contrib/telnet/telnet/utilities.c
  head/contrib/telnet/telnetd/authenc.c
  head/contrib/telnet/telnetd/defs.h
  head/contrib/telnet/telnetd/ext.h
  head/contrib/telnet/telnetd/global.c
  head/contrib/telnet/telnetd/pathnames.h
  head/contrib/telnet/telnetd/slc.c
  head/contrib/telnet/telnetd/state.c
  head/contrib/telnet/telnetd/sys_term.c
  head/contrib/telnet/telnetd/telnetd.8
  head/contrib/telnet/telnetd/telnetd.c
  head/contrib/telnet/telnetd/telnetd.h
  head/contrib/telnet/telnetd/termstat.c
  head/contrib/telnet/telnetd/utility.c

Modified: head/contrib/telnet/arpa/telnet.h
==
--- head/contrib/telnet/arpa/telnet.h   Thu Aug 15 12:48:17 2019
(r351069)
+++ head/contrib/telnet/arpa/telnet.h   Thu Aug 15 13:27:57 2019
(r351070)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/contrib/telnet/libtelnet/auth-proto.h
==
--- head/contrib/telnet/libtelnet/auth-proto.h  Thu Aug 15 12:48:17 2019
(r351069)
+++ head/contrib/telnet/libtelnet/auth-proto.h  Thu Aug 15 13:27:57 2019
(r351070)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/contrib/telnet/libtelnet/auth.c
==
--- head/contrib/telnet/libtelnet/auth.cThu Aug 15 12:48:17 2019
(r351069)
+++ head/contrib/telnet/libtelnet/auth.cThu Aug 15 13:27:57 2019
(r351070)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the 

svn commit: r351069 - head/share/mk

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 12:48:17 2019
New Revision: 351069
URL: https://svnweb.freebsd.org/changeset/base/351069

Log:
  do not enable userland retpoline if not supported by compiler/linker
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21101

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.prog.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkThu Aug 15 12:00:59 2019(r351068)
+++ head/share/mk/bsd.lib.mkThu Aug 15 12:48:17 2019(r351069)
@@ -3,6 +3,8 @@
 #
 
 .include 
+.include 
+.include 
 
 .if defined(LIB_CXX) || defined(SHLIB_CXX)
 _LD=   ${CXX}
@@ -74,9 +76,13 @@ TAG_ARGS=-T ${TAGS:[*]:S/ /,/g}
 LDFLAGS+= -Wl,-znow
 .endif
 .if ${MK_RETPOLINE} != "no"
+.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
 CFLAGS+= -mretpoline
 CXXFLAGS+= -mretpoline
 LDFLAGS+= -Wl,-zretpolineplt
+.else
+.warning Retpoline requested but not supported by compiler or linker
+.endif
 .endif
 
 .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Thu Aug 15 12:00:59 2019(r351068)
+++ head/share/mk/bsd.prog.mk   Thu Aug 15 12:48:17 2019(r351069)
@@ -3,6 +3,7 @@
 
 .include 
 .include 
+.include 
 
 .SUFFIXES: .out .o .bc .c .cc .cpp .cxx .C .m .y .l .ll .ln .s .S .asm
 
@@ -44,11 +45,15 @@ CXXFLAGS+= -fPIE
 LDFLAGS+= -pie
 .endif
 .if ${MK_RETPOLINE} != "no"
+.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
 CFLAGS+= -mretpoline
 CXXFLAGS+= -mretpoline
 # retpolineplt is broken with static linking (PR 26)
 .if !defined(NO_SHARED) || ${NO_SHARED:tl} == "no"
 LDFLAGS+= -Wl,-zretpolineplt
+.endif
+.else
+.warning Retpoline requested but not supported by compiler or linker
 .endif
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351063 - head/share/man/man7

2019-08-14 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 02:14:44 2019
New Revision: 351063
URL: https://svnweb.freebsd.org/changeset/base/351063

Log:
  arch.7: be explicit about the future for unmigrated GCC 4.2.1 archs
  
  Reported by:  imp
  MFC after:1 week
  MFC with: r351036

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Thu Aug 15 00:39:53 2019(r351062)
+++ head/share/man/man7/arch.7  Thu Aug 15 02:14:44 2019(r351063)
@@ -336,8 +336,9 @@ This table shows the default tool chain for each archi
 (1) External toolchain provided by ports/packages.
 .Pp
 Note that GCC 4.2.1 is deprecated, and scheduled for removal on 2020-03-31.
-CPU architectures not migrated to either base system Clang or external
-toolchain by then will be desupported.
+Any CPU architectures not migrated by then
+(to either base system Clang or external toolchain)
+may be removed from the tree after that date.
 .Ss Predefined Macros
 The compiler provides a number of predefined macros.
 Some of these provide architecture-specific details and are explained below.
___
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: r351036 - head/share/man/man7

2019-08-14 Thread Ed Maste
On Wed, 14 Aug 2019 at 13:25, Warner Losh  wrote:
>
> would using 'removed from the tree' be better here? Because that's the 
> current plan of record.

I originally had "removed" but then noticed your mail had 05-31 as the
date for "svn rm all non-clang platforms not supported by in-tree LLVM
or converted to ext toolchain". I didn't want to overwhelm with dates
that might change.  Maybe something like "may be removed from the tree
after that date"?
___
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: r351040 - head/lib/libcompiler_rt

2019-08-14 Thread Ed Maste
Author: emaste
Date: Wed Aug 14 18:41:28 2019
New Revision: 351040
URL: https://svnweb.freebsd.org/changeset/base/351040

Log:
  compiler-rt: enable __bswapsi2/__bswapdi2 for RISC-V
  
  As with other archs the compiler may emit calls to the byte swap routines
  under certain conditions.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libcompiler_rt/Makefile.inc

Modified: head/lib/libcompiler_rt/Makefile.inc
==
--- head/lib/libcompiler_rt/Makefile.incWed Aug 14 18:04:04 2019
(r351039)
+++ head/lib/libcompiler_rt/Makefile.incWed Aug 14 18:41:28 2019
(r351040)
@@ -234,7 +234,8 @@ SRCS+=  sync_synchronize.S
 .endif
 
 # On some archs GCC-6.3 requires bswap32 built-in.
-.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \
+${MACHINE_CPUARCH} == "sparc64"
 SRCS+= bswapdi2.c
 SRCS+= bswapsi2.c
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351037 - head/share/man/man7

2019-08-14 Thread Ed Maste
Author: emaste
Date: Wed Aug 14 17:17:52 2019
New Revision: 351037
URL: https://svnweb.freebsd.org/changeset/base/351037

Log:
  arch.7: clarify that the table shows the default tool chain
  
  Reported by:  jhb
  MFC after:1 week
  MFC with: r351035
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Aug 14 17:13:36 2019(r351036)
+++ head/share/man/man7/arch.7  Wed Aug 14 17:17:52 2019(r351037)
@@ -295,7 +295,7 @@ is 8 bytes on all supported architectures except i386.
 .Fx 11.0 ,
 armv6 used the softfp ABI even though it supported only processors
 with a floating point unit.
-.Ss Tool Chain
+.Ss Default Tool Chain
 .Fx uses a variety of tool chain components for the supported CPU
 architectures:
 .Xr clang 1
@@ -307,6 +307,7 @@ GNU
 and Binutils
 .Xr ld 1 ,
 or an external toolchain compiler and linker provided by a port or package.
+This table shows the default tool chain for each architecture.
 .Bl -column -offset indent "Sy Architecture" "Sy Compiler" "Sy Linker"
 .It Sy Architecture Ta Sy Compiler Ta Sy Linker
 .It aarch64 Ta Clang Ta lld
___
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: r351036 - head/share/man/man7

2019-08-14 Thread Ed Maste
Author: emaste
Date: Wed Aug 14 17:13:36 2019
New Revision: 351036
URL: https://svnweb.freebsd.org/changeset/base/351036

Log:
  arch.7: add deprecation notice for GCC 4.2.1
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Aug 14 17:04:28 2019(r351035)
+++ head/share/man/man7/arch.7  Wed Aug 14 17:13:36 2019(r351036)
@@ -333,6 +333,10 @@ or an external toolchain compiler and linker provided 
 .El
 .Pp
 (1) External toolchain provided by ports/packages.
+.Pp
+Note that GCC 4.2.1 is deprecated, and scheduled for removal on 2020-03-31.
+CPU architectures not migrated to either base system Clang or external
+toolchain by then will be desupported.
 .Ss Predefined Macros
 The compiler provides a number of predefined macros.
 Some of these provide architecture-specific details and are explained below.
___
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: r351035 - head/share/man/man7

2019-08-14 Thread Ed Maste
Author: emaste
Date: Wed Aug 14 17:04:28 2019
New Revision: 351035
URL: https://svnweb.freebsd.org/changeset/base/351035

Log:
  arch.7: add tool chain table
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Aug 14 17:02:36 2019(r351034)
+++ head/share/man/man7/arch.7  Wed Aug 14 17:04:28 2019(r351035)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 5, 2018
+.Dd August 14, 2019
 .Dt ARCH 7
 .Os
 .Sh NAME
@@ -295,6 +295,44 @@ is 8 bytes on all supported architectures except i386.
 .Fx 11.0 ,
 armv6 used the softfp ABI even though it supported only processors
 with a floating point unit.
+.Ss Tool Chain
+.Fx uses a variety of tool chain components for the supported CPU
+architectures:
+.Xr clang 1
+and
+.Xr ld.lld 1
+provided by the base system,
+GNU
+.Xr gcc 1
+and Binutils
+.Xr ld 1 ,
+or an external toolchain compiler and linker provided by a port or package.
+.Bl -column -offset indent "Sy Architecture" "Sy Compiler" "Sy Linker"
+.It Sy Architecture Ta Sy Compiler Ta Sy Linker
+.It aarch64 Ta Clang Ta lld
+.It amd64   Ta Clang Ta lld
+.It arm Ta Clang Ta GNU ld 2.17.50
+.It armv6   Ta Clang Ta GNU ld 2.17.50
+.It armv7   Ta Clang Ta lld
+.It i386Ta Clang Ta lld
+.It mipsTa GCC 4.2.1 Ta GNU ld 2.17.50
+.It mipsel  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mipselhfTa GCC 4.2.1 Ta GNU ld 2.17.50
+.It mipshf  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mipsn32 Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mips64  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mips64elTa GCC 4.2.1 Ta GNU ld 2.17.50
+.It mips64elhf  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It mips64hfTa GCC 4.2.1 Ta GNU ld 2.17.50
+.It powerpc Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It powerpcspe  Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It powerpc64   Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.It riscv64 Ta GCC(1)Ta GNU ld(1)
+.It riscv64sf   Ta GCC(1)Ta GNU ld(1)
+.It sparc64 Ta GCC 4.2.1 Ta GNU ld 2.17.50
+.El
+.Pp
+(1) External toolchain provided by ports/packages.
 .Ss Predefined Macros
 The compiler provides a number of predefined macros.
 Some of these provide architecture-specific details and are explained below.
___
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: r351026 - stable/11/sys/net

2019-08-14 Thread Ed Maste
Author: emaste
Date: Wed Aug 14 13:15:38 2019
New Revision: 351026
URL: https://svnweb.freebsd.org/changeset/base/351026

Log:
  MFC r350497: ppp: correct echo-req magic number on big endian archs
  
  The magic number is a 32-bit quantity; use uint32_t to match hton's
  return type and avoid sending zeros (upper 32 bits) on big-endian
  architectures.
  
  PR:   184141
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/sys/net/if_spppsubr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net/if_spppsubr.c
==
--- stable/11/sys/net/if_spppsubr.c Wed Aug 14 13:14:47 2019
(r351025)
+++ stable/11/sys/net/if_spppsubr.c Wed Aug 14 13:15:38 2019
(r351026)
@@ -4807,7 +4807,7 @@ sppp_keepalive(void *dummy)
sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ,
 ++sp->pp_seq[IDX_LCP], sp->pp_rseq[IDX_LCP]);
else if (sp->pp_phase >= PHASE_AUTHENTICATE) {
-   long nmagic = htonl (sp->lcp.magic);
+   uint32_t nmagic = htonl(sp->lcp.magic);
sp->lcp.echoid = ++sp->pp_seq[IDX_LCP];
sppp_cp_send (sp, PPP_LCP, ECHO_REQ,
sp->lcp.echoid, 4, );
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351025 - stable/12/sys/net

2019-08-14 Thread Ed Maste
Author: emaste
Date: Wed Aug 14 13:14:47 2019
New Revision: 351025
URL: https://svnweb.freebsd.org/changeset/base/351025

Log:
  MFC r350497: ppp: correct echo-req magic number on big endian archs
  
  The magic number is a 32-bit quantity; use uint32_t to match hton's
  return type and avoid sending zeros (upper 32 bits) on big-endian
  architectures.
  
  PR:   184141
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sys/net/if_spppsubr.c

Modified: stable/12/sys/net/if_spppsubr.c
==
--- stable/12/sys/net/if_spppsubr.c Wed Aug 14 09:56:58 2019
(r351024)
+++ stable/12/sys/net/if_spppsubr.c Wed Aug 14 13:14:47 2019
(r351025)
@@ -4807,7 +4807,7 @@ sppp_keepalive(void *dummy)
sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ,
 ++sp->pp_seq[IDX_LCP], sp->pp_rseq[IDX_LCP]);
else if (sp->pp_phase >= PHASE_AUTHENTICATE) {
-   long nmagic = htonl (sp->lcp.magic);
+   uint32_t nmagic = htonl(sp->lcp.magic);
sp->lcp.echoid = ++sp->pp_seq[IDX_LCP];
sppp_cp_send (sp, PPP_LCP, ECHO_REQ,
sp->lcp.echoid, 4, );
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351000 - in head/sys: amd64/vmm/io x86/x86

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 19:39:36 2019
New Revision: 351000
URL: https://svnweb.freebsd.org/changeset/base/351000

Log:
  sys/{x86,amd64}: remove one of doubled ;s
  
  MFC after:1 week

Modified:
  head/sys/amd64/vmm/io/vlapic.c
  head/sys/x86/x86/local_apic.c

Modified: head/sys/amd64/vmm/io/vlapic.c
==
--- head/sys/amd64/vmm/io/vlapic.c  Tue Aug 13 19:29:33 2019
(r350999)
+++ head/sys/amd64/vmm/io/vlapic.c  Tue Aug 13 19:39:36 2019
(r351000)
@@ -316,7 +316,7 @@ vlapic_get_lvtptr(struct vlapic *vlapic, uint32_t offs
return (>lvt_cmci);
case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT:
i = (offset - APIC_OFFSET_TIMER_LVT) >> 2;
-   return ((>lvt_timer) + i);;
+   return ((>lvt_timer) + i);
default:
panic("vlapic_get_lvt: invalid LVT\n");
}

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Tue Aug 13 19:29:33 2019
(r350999)
+++ head/sys/x86/x86/local_apic.c   Tue Aug 13 19:39:36 2019
(r351000)
@@ -130,7 +130,7 @@ struct lvt {
 
 struct lapic {
struct lvt la_lvts[APIC_LVT_MAX + 1];
-   struct lvt la_elvts[APIC_ELVT_MAX + 1];;
+   struct lvt la_elvts[APIC_ELVT_MAX + 1];
u_int la_id:8;
u_int la_cluster:4;
u_int la_cluster_id:2;
___
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: r350989 - in head/share/man: man4 man5

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 15:41:36 2019
New Revision: 350989
URL: https://svnweb.freebsd.org/changeset/base/350989

Log:
  Remove some more leftover rlogin man page xrefs
  
  rcmds were removed in r32435 and these three man pages can trivially
  drop the references.
  
  There's still a reference in pts.4 because it describes a mode
  (TIOCPKT_NOSTOP), and only lists rlogin/rlogind as examples of programs
  that use that mode.  To update later.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man4/termios.4
  head/share/man/man4/tty.4
  head/share/man/man5/hosts.equiv.5

Modified: head/share/man/man4/termios.4
==
--- head/share/man/man4/termios.4   Tue Aug 13 15:38:05 2019
(r350988)
+++ head/share/man/man4/termios.4   Tue Aug 13 15:41:36 2019
(r350989)
@@ -58,9 +58,7 @@ a connection being present.
 In practice, applications
 seldom open these files; they are opened by special programs, such
 as
-.Xr getty 8
-or
-.Xr rlogind 8 ,
+.Xr getty 8 ,
 and become
 an application's standard input, output, and error files.
 .Ss Job Control in a Nutshell

Modified: head/share/man/man4/tty.4
==
--- head/share/man/man4/tty.4   Tue Aug 13 15:38:05 2019(r350988)
+++ head/share/man/man4/tty.4   Tue Aug 13 15:41:36 2019(r350989)
@@ -54,8 +54,6 @@ These special terminal devices are called
 .Em ptys
 and provide the mechanism necessary to give users the same interface to the
 system when logging in over a network (using
-.Xr rlogin 1 ,
-or
 .Xr telnet 1
 for example).
 Even in these cases the details of how the terminal

Modified: head/share/man/man5/hosts.equiv.5
==
--- head/share/man/man5/hosts.equiv.5   Tue Aug 13 15:38:05 2019
(r350988)
+++ head/share/man/man5/hosts.equiv.5   Tue Aug 13 15:41:36 2019
(r350989)
@@ -127,8 +127,6 @@ except users from netgroup
 .Dq dau .
 .Sh SEE ALSO
 .Xr rcp 1 ,
-.Xr rlogin 1 ,
-.Xr rsh 1 ,
 .Xr gethostbyname 3 ,
 .Xr inet 3 ,
 .Xr innetgr 3 ,
___
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: r350983 - head/usr.sbin/crunch/examples

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 15:23:14 2019
New Revision: 350983
URL: https://svnweb.freebsd.org/changeset/base/350983

Log:
  crunch: remove rsh and rlogin from example config file
  
  rcmds removed in r324351.
  
  Historical references in the README are maintained.  There's a paragraph
  describing a "980K crunched 'fixit'" that references rsh and rlogin.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/crunch/examples/fixit.conf

Modified: head/usr.sbin/crunch/examples/fixit.conf
==
--- head/usr.sbin/crunch/examples/fixit.confTue Aug 13 15:16:42 2019
(r350982)
+++ head/usr.sbin/crunch/examples/fixit.confTue Aug 13 15:23:14 2019
(r350983)
@@ -29,7 +29,7 @@ ln restore rrestore
 
 # /usr/bin stuff
 
-progs ftp rsh sed telnet rlogin common find
+progs ftp sed telnet common find
 ln common vi
 ln common view
 ln common ex
___
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: r350981 - head/share/man/man5

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 14:57:04 2019
New Revision: 350981
URL: https://svnweb.freebsd.org/changeset/base/350981

Log:
  Regen src.conf.5 after r350980 (remove rsh/rlogin references)
  
  Also pick up changes to LLVM_TARGET_RISCV, NAND, NVME, OPENM
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue Aug 13 14:51:16 2019
(r350980)
+++ head/share/man/man5/src.conf.5  Tue Aug 13 14:57:04 2019
(r350981)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd March 29, 2019
+.Dd August 13, 2019
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -233,8 +233,6 @@ Set to build some programs without
 support, like
 .Xr fingerd 8 ,
 .Xr ftpd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8 ,
 and
 .Xr sshd 8 .
 .It Va WITHOUT_BLUETOOTH
@@ -399,10 +397,6 @@ is set explicitly)
 (unless
 .Va WITH_LLVM_TARGET_POWERPC
 is set explicitly)
-.It Va WITHOUT_LLVM_TARGET_RISCV
-(unless
-.Va WITH_LLVM_TARGET_RISCV
-is set explicitly)
 .It Va WITHOUT_LLVM_TARGET_SPARC
 (unless
 .Va WITH_LLVM_TARGET_SPARC
@@ -1214,20 +1208,11 @@ option should be used rather than this in most cases.
 .Pp
 This is a default setting on
 amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and 
powerpc/powerpcspe.
-.It Va WITHOUT_LLVM_TARGET_RISCV
-Set to not build LLVM target support for RISC-V.
-The
-.Va LLVM_TARGET_ALL
-option should be used rather than this in most cases.
-.Pp
-This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64, powerpc/powerpcspe, and sparc/sparc64.
 .It Va WITH_LLVM_TARGET_RISCV
 Set to build LLVM target support for RISC-V.
 The
 .Va LLVM_TARGET_ALL
 option should be used rather than this in most cases.
-.Pp
 .It Va WITHOUT_LLVM_TARGET_SPARC
 Set to not build LLVM target support for SPARC.
 The
@@ -1469,8 +1454,6 @@ Set to build
 .Pp
 This is a default setting on
 amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64.
-.It Va WITH_NAND
-Set to build the NAND Flash components.
 .It Va WITHOUT_NDIS
 Set to not build programs and libraries
 related to NDIS emulation support.
@@ -1535,13 +1518,13 @@ and related programs.
 Set to not build nvme related tools and kernel modules.
 .Pp
 This is a default setting on
-arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, 
riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, 
mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and 
sparc64/sparc64.
 .It Va WITH_NVME
 Set to build nvme related tools and kernel modules.
 
 .Pp
 This is a default setting on
-amd64/amd64, i386/i386 and powerpc/powerpc64.
+amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64.
 .It Va WITH_OFED
 Set to build the
 .Dq "OpenFabrics Enterprise Distribution"
@@ -1556,12 +1539,12 @@ Enable building openldap support for kerberos.
 Set to not build LLVM's OpenMP runtime.
 .Pp
 This is a default setting on
-arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, 
mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, 
mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_OPENMP
 Set to build LLVM's OpenMP runtime.
 .Pp
 This is a default setting on
-amd64/amd64.
+amd64/amd64 and i386/i386.
 .It Va WITHOUT_OPENSSH
 Set to not build OpenSSH.
 .It Va WITHOUT_OPENSSL
@@ -1674,10 +1657,10 @@ by proxy.
 .It Va WITHOUT_RBOOTD
 Set to not build or install
 .Xr rbootd 8 .
-.It Va WITHOUT_REPRODUCIBLE_BUILD
-Set to include build metadata (such as the build time, user, and host)
-in the kernel, boot loaders, and uname output.
-Successive builds will not be bit-for-bit identical.
+.It Va WITH_REPRODUCIBLE_BUILD
+Set to exclude build metadata (such as the build time, user, or host)
+from the kernel, boot loaders, and uname output, so that builds produce
+bit-for-bit identical output.
 .It Va WITHOUT_RESCUE
 Set to not 

svn commit: r350980 - head/tools/build/options

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 14:51:16 2019
New Revision: 350980
URL: https://svnweb.freebsd.org/changeset/base/350980

Log:
  Remove rlogin/rsh references from src.conf(5) WITHOUT_BLACKLIST_SUPPORT
  
  rcmds were removed in r324351
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT

Modified: head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT
==
--- head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT  Tue Aug 13 14:47:24 
2019(r350979)
+++ head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT  Tue Aug 13 14:51:16 
2019(r350980)
@@ -4,7 +4,5 @@ Set to build some programs without
 support, like
 .Xr fingerd 8 ,
 .Xr ftpd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8 ,
 and
 .Xr sshd 8 .
___
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: r350979 - head/share/man/man7

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 14:47:24 2019
New Revision: 350979
URL: https://svnweb.freebsd.org/changeset/base/350979

Log:
  Remove rsh/rlogin references from security man page
  
  More extensive changes to this page are certainly needed, but at least
  remove references to binaries that no longer exist.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man7/security.7

Modified: head/share/man/man7/security.7
==
--- head/share/man/man7/security.7  Tue Aug 13 13:48:44 2019
(r350978)
+++ head/share/man/man7/security.7  Tue Aug 13 14:47:24 2019
(r350979)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 27, 2019
+.Dd August 13, 2019
 .Dt SECURITY 7
 .Os
 .Sh NAME
@@ -99,9 +99,7 @@ pipe.
 A user account compromise is even more common than a DoS attack.
 Many
 sysadmins still run standard
-.Xr telnetd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8 ,
+.Xr telnetd 8
 and
 .Xr ftpd 8
 servers on their machines.
@@ -186,8 +184,6 @@ in the
 file
 so that direct root logins via
 .Xr telnet 1
-or
-.Xr rlogin 1
 are disallowed.
 If using
 other login services such as
@@ -342,10 +338,7 @@ virtually every server ever run as root, including bas
 If you are running a machine through which people only log in via
 .Xr sshd 8
 and never log in via
-.Xr telnetd 8 ,
-.Xr rshd 8 ,
-or
-.Xr rlogind 8 ,
+.Xr telnetd 8
 then turn off those services!
 .Pp
 .Fx
@@ -378,7 +371,7 @@ occur through them.
 The other big potential root hole in a system are the SUID-root and SGID
 binaries installed on the system.
 Most of these binaries, such as
-.Xr rlogin 1 ,
+.Xr su 1 ,
 reside in
 .Pa /bin , /sbin , /usr/bin ,
 or
@@ -905,8 +898,6 @@ if you intend to use them.
 Kerberos5 is an excellent authentication
 protocol but the kerberized
 .Xr telnet 1
-and
-.Xr rlogin 1
 suck rocks.
 There are bugs that make them unsuitable for dealing with binary streams.
 Also, 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"


svn commit: r350903 - stable/12/sys/fs/nandfs

2019-08-12 Thread Ed Maste
Author: emaste
Date: Mon Aug 12 17:25:32 2019
New Revision: 350903
URL: https://svnweb.freebsd.org/changeset/base/350903

Log:
  nandfs: avoid integer overflow in nandfs_get_dat_bdescs_ioctl
  
  nandfs was removed in head in r349352 and in any case was not built by
  default, but address the potential integer overflow in case someone does
  enable it and manages to avoid a panic from other nandfs issues.
  
  admbugs:  815
  Reported by:  Ilja Van Sprundel 
  Reviewed by:  imp
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21232

Modified:
  stable/12/sys/fs/nandfs/nandfs_dat.c

Modified: stable/12/sys/fs/nandfs/nandfs_dat.c
==
--- stable/12/sys/fs/nandfs/nandfs_dat.cMon Aug 12 17:18:20 2019
(r350902)
+++ stable/12/sys/fs/nandfs/nandfs_dat.cMon Aug 12 17:25:32 2019
(r350903)
@@ -298,6 +298,9 @@ nandfs_get_dat_bdescs_ioctl(struct nandfs_device *nffs
size_t size;
int error;
 
+   if (nargv->nv_nmembs >= SIZE_MAX / sizeof(struct nandfs_bdesc))
+   return (EINVAL);
+   
size = nargv->nv_nmembs * sizeof(struct nandfs_bdesc);
bd = malloc(size, M_NANDFSTEMP, M_WAITOK);
error = copyin((void *)(uintptr_t)nargv->nv_base, bd, size);
___
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: r350901 - stable/11/contrib/telnet/telnet

2019-08-12 Thread Ed Maste
Author: emaste
Date: Mon Aug 12 15:54:30 2019
New Revision: 350901
URL: https://svnweb.freebsd.org/changeset/base/350901

Log:
  MFC r350498: telnet: use asprintf for r350140 [MFC of r349890] change
  
  Sponsored by:   The FreeBSD Foundation

Modified:
  stable/11/contrib/telnet/telnet/commands.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/telnet/telnet/commands.c
==
--- stable/11/contrib/telnet/telnet/commands.c  Mon Aug 12 15:52:21 2019
(r350900)
+++ stable/11/contrib/telnet/telnet/commands.c  Mon Aug 12 15:54:30 2019
(r350901)
@@ -1655,14 +1655,11 @@ env_init(void)
|| (strncmp((char *)ep->value, "unix:", 5) == 0))) {
char hbuf[256+1];
char *cp2 = strchr((char *)ep->value, ':');
-size_t buflen;
 
gethostname(hbuf, sizeof(hbuf));
hbuf[sizeof(hbuf)-1] = '\0';
-   buflen = strlen(hbuf) + strlen(cp2) + 1;
-   cp = (char *)malloc(sizeof(char)*buflen);
+   asprintf(, "%s%s", hbuf, cp2);
assert(cp != NULL);
-   snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);
free(ep->value);
ep->value = (unsigned char *)cp;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350900 - stable/12/contrib/telnet/telnet

2019-08-12 Thread Ed Maste
Author: emaste
Date: Mon Aug 12 15:52:21 2019
New Revision: 350900
URL: https://svnweb.freebsd.org/changeset/base/350900

Log:
  MFC r350498: telnet: use asprintf for r350139 [MFC of r349890] change
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/contrib/telnet/telnet/commands.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/telnet/telnet/commands.c
==
--- stable/12/contrib/telnet/telnet/commands.c  Mon Aug 12 12:51:47 2019
(r350899)
+++ stable/12/contrib/telnet/telnet/commands.c  Mon Aug 12 15:52:21 2019
(r350900)
@@ -1655,14 +1655,11 @@ env_init(void)
|| (strncmp((char *)ep->value, "unix:", 5) == 0))) {
char hbuf[256+1];
char *cp2 = strchr((char *)ep->value, ':');
-size_t buflen;
 
gethostname(hbuf, sizeof(hbuf));
hbuf[sizeof(hbuf)-1] = '\0';
-   buflen = strlen(hbuf) + strlen(cp2) + 1;
-   cp = (char *)malloc(sizeof(char)*buflen);
+   asprintf(, "%s%s", hbuf, cp2);
assert(cp != NULL);
-   snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);
free(ep->value);
ep->value = (unsigned char *)cp;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r350678 - head/share/mk

2019-08-08 Thread Ed Maste
On Wed, 7 Aug 2019 at 12:19, Warner Losh  wrote:
>
> Author: imp
> Date: Wed Aug  7 16:19:06 2019
> New Revision: 350678
> URL: https://svnweb.freebsd.org/changeset/base/350678
>
> Log:
>   Enable nvme on aarch64
>
>   Don't mark nvme as broken on aarch64. It compiles, at least, and people are
>   testing it out. This only enables the userland parts of the nvme stack.

For BROKEN_OPTIONS we should probably list the archs where it is known
to be broken instead?
___
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: r350750 - head/sys/crypto/armv8

2019-08-08 Thread Ed Maste
Author: emaste
Date: Thu Aug  8 14:34:53 2019
New Revision: 350750
URL: https://svnweb.freebsd.org/changeset/base/350750

Log:
  armv8crypto: add missing unlock for session (after r336439)
  
  Attempts to use cryptodev (e.g. tests at /usr/src/tests/sys/opencrypto
  with armv8crypto added to the module lists) were causing a panic.
  
  Submitted by: Greg V 
  Differential Revision:https://reviews.freebsd.org/D21012

Modified:
  head/sys/crypto/armv8/armv8_crypto.c

Modified: head/sys/crypto/armv8/armv8_crypto.c
==
--- head/sys/crypto/armv8/armv8_crypto.cThu Aug  8 11:43:09 2019
(r350749)
+++ head/sys/crypto/armv8/armv8_crypto.cThu Aug  8 14:34:53 2019
(r350750)
@@ -274,9 +274,11 @@ armv8_crypto_newsession(device_t dev, crypto_session_t
error = armv8_crypto_cipher_setup(ses, encini);
if (error != 0) {
CRYPTDEB("setup failed");
+   rw_wunlock(>lock);
return (error);
}
 
+   rw_wunlock(>lock);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350637 - stable/12/contrib/bsnmp/lib

2019-08-06 Thread Ed Maste
Author: emaste
Date: Tue Aug  6 16:11:16 2019
New Revision: 350637
URL: https://svnweb.freebsd.org/changeset/base/350637

Log:
  MFC r350635: bsnmp: add asn1 message length validation
  
  admbugs:  780
  Submitted by: Guido Vranken, bz
  Reported by:  Guido Vranken
  Approved by:  so
  Security:   CVE-2019-5610

Modified:
  stable/12/contrib/bsnmp/lib/asn1.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/bsnmp/lib/asn1.c
==
--- stable/12/contrib/bsnmp/lib/asn1.c  Tue Aug  6 16:11:00 2019
(r350636)
+++ stable/12/contrib/bsnmp/lib/asn1.c  Tue Aug  6 16:11:16 2019
(r350637)
@@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le
*len = *b->asn_cptr++;
b->asn_len--;
}
+   if (*len > b->asn_len) {
+   asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len);
+   return (ASN_ERR_EOBUF);
+   }
+   
return (ASN_ERR_OK);
 }
 
___
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: r350648 - stable/12/sys/netinet6

2019-08-06 Thread Ed Maste
Author: emaste
Date: Tue Aug  6 17:13:41 2019
New Revision: 350648
URL: https://svnweb.freebsd.org/changeset/base/350648

Log:
  MFC r350645: Correct ICMPv6/MLDv2 out-of-bounds memory access
  
  Previously the ICMPv6 input path incorrectly handled cases where an
  MLDv2 listener query packet was internally fragmented across multiple
  mbufs.
  
  admbugs:  921
  Submitted by: jtl
  Reported by:  CJD of Apple
  Approved by:  so
  Security: CVE-2019-5608

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

Modified: stable/12/sys/netinet6/mld6.c
==
--- stable/12/sys/netinet6/mld6.c   Tue Aug  6 17:13:17 2019
(r350647)
+++ stable/12/sys/netinet6/mld6.c   Tue Aug  6 17:13:41 2019
(r350648)
@@ -139,14 +139,15 @@ static intmld_v2_enqueue_group_record(struct 
mbufq *,
struct in6_multi *, const int, const int, const int,
const int);
 static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *,
-   struct mbuf *, const int, const int);
+   struct mbuf *, struct mldv2_query *, const int, const int);
 static int mld_v2_merge_state_changes(struct in6_multi *,
struct mbufq *);
 static voidmld_v2_process_group_timers(struct in6_multi_head *,
struct mbufq *, struct mbufq *,
struct in6_multi *, const int);
 static int mld_v2_process_group_query(struct in6_multi *,
-   struct mld_ifsoftc *mli, int, struct mbuf *, const int);
+   struct mld_ifsoftc *mli, int, struct mbuf *,
+   struct mldv2_query *, const int);
 static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS);
 static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS);
 
@@ -803,16 +804,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t
  * Process a received MLDv2 general, group-specific or
  * group-and-source-specific query.
  *
- * Assumes that the query header has been pulled up to sizeof(mldv2_query).
+ * Assumes that mld points to a struct mldv2_query which is stored in
+ * contiguous memory.
  *
  * Return 0 if successful, otherwise an appropriate error code is returned.
  */
 static int
 mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6,
-struct mbuf *m, const int off, const int icmp6len)
+struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len)
 {
struct mld_ifsoftc  *mli;
-   struct mldv2_query  *mld;
struct in6_multi*inm;
uint32_t maxdelay, nsrc, qqi;
int  is_general_query;
@@ -844,8 +845,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6
 
CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp));
 
-   mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off);
-
maxdelay = ntohs(mld->mld_maxdelay);/* in 1/10ths of a second */
if (maxdelay >= 32768) {
maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) <<
@@ -970,7 +969,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6
 * group-specific or group-and-source query.
 */
if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer)
-   mld_v2_process_group_query(inm, mli, timer, m, off);
+   mld_v2_process_group_query(inm, mli, timer, m, mld, 
off);
 
/* XXX Clear embedded scope ID as userland won't expect it. */
in6_clearscope(>mld_addr);
@@ -991,9 +990,8 @@ out_locked:
  */
 static int
 mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli,
-int timer, struct mbuf *m0, const int off)
+int timer, struct mbuf *m0, struct mldv2_query *mld, const int off)
 {
-   struct mldv2_query  *mld;
int  retval;
uint16_t nsrc;
 
@@ -1001,7 +999,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru
MLD_LOCK_ASSERT();
 
retval = 0;
-   mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off);
 
switch (inm->in6m_state) {
case MLD_NOT_MEMBER:
@@ -1021,6 +1018,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru
 
nsrc = ntohs(mld->mld_numsrc);
 
+   /* Length should be checked by calling function. */
+   KASSERT((m0->m_flags & M_PKTHDR) == 0 ||
+   m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) +
+   nsrc * sizeof(struct in6_addr),
+   ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)",
+   m0->m_pkthdr.len, off + sizeof(struct mldv2_query) +
+   nsrc * sizeof(struct in6_addr), m0));
+
+
/*
 * Deal with group-specific queries upfront.
 * If any group query is already pending, purge any recorded
@@ -1062,28 +1068,20 @@ 

svn commit: r350635 - head/contrib/bsnmp/lib

2019-08-06 Thread Ed Maste
Author: emaste
Date: Tue Aug  6 16:09:06 2019
New Revision: 350635
URL: https://svnweb.freebsd.org/changeset/base/350635

Log:
  bsnmp: add asn1 message length validation
  
  admbugs:  780
  Submitted by: Guido Vranken, bz
  Reported by:  Guido Vranken
  Security: CVE-2019-5610

Modified:
  head/contrib/bsnmp/lib/asn1.c

Modified: head/contrib/bsnmp/lib/asn1.c
==
--- head/contrib/bsnmp/lib/asn1.c   Tue Aug  6 14:39:02 2019
(r350634)
+++ head/contrib/bsnmp/lib/asn1.c   Tue Aug  6 16:09:06 2019
(r350635)
@@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le
*len = *b->asn_cptr++;
b->asn_len--;
}
+   if (*len > b->asn_len) {
+   asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len);
+   return (ASN_ERR_EOBUF);
+   }
+   
return (ASN_ERR_OK);
 }
 
___
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: r350650 - stable/11/sys/netinet6

2019-08-06 Thread Ed Maste
Author: emaste
Date: Tue Aug  6 17:15:46 2019
New Revision: 350650
URL: https://svnweb.freebsd.org/changeset/base/350650

Log:
  MFC r350645: Correct ICMPv6/MLDv2 out-of-bounds memory access
  
  Previously the ICMPv6 input path incorrectly handled cases where an
  MLDv2 listener query packet was internally fragmented across multiple
  mbufs.
  
  admbugs:  921
  Submitted by: jtl
  Reported by:  CJD of Apple
  Approved by:  so
  MFC after:0 minutes
  Security: CVE-2019-5608

Modified:
  stable/11/sys/netinet6/mld6.c

Modified: stable/11/sys/netinet6/mld6.c
==
--- stable/11/sys/netinet6/mld6.c   Tue Aug  6 17:14:09 2019
(r350649)
+++ stable/11/sys/netinet6/mld6.c   Tue Aug  6 17:15:46 2019
(r350650)
@@ -137,14 +137,15 @@ static intmld_v2_enqueue_group_record(struct 
mbufq *,
struct in6_multi *, const int, const int, const int,
const int);
 static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *,
-   struct mbuf *, const int, const int);
+   struct mbuf *, struct mldv2_query *, const int, const int);
 static int mld_v2_merge_state_changes(struct in6_multi *,
struct mbufq *);
 static voidmld_v2_process_group_timers(struct mld_ifsoftc *,
struct mbufq *, struct mbufq *,
struct in6_multi *, const int);
 static int mld_v2_process_group_query(struct in6_multi *,
-   struct mld_ifsoftc *mli, int, struct mbuf *, const int);
+   struct mld_ifsoftc *mli, int, struct mbuf *,
+   struct mldv2_query *, const int);
 static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS);
 static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS);
 
@@ -794,16 +795,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t
  * Process a received MLDv2 general, group-specific or
  * group-and-source-specific query.
  *
- * Assumes that the query header has been pulled up to sizeof(mldv2_query).
+ * Assumes that mld points to a struct mldv2_query which is stored in
+ * contiguous memory.
  *
  * Return 0 if successful, otherwise an appropriate error code is returned.
  */
 static int
 mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6,
-struct mbuf *m, const int off, const int icmp6len)
+struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len)
 {
struct mld_ifsoftc  *mli;
-   struct mldv2_query  *mld;
struct in6_multi*inm;
uint32_t maxdelay, nsrc, qqi;
int  is_general_query;
@@ -828,8 +829,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6
 
CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp));
 
-   mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off);
-
maxdelay = ntohs(mld->mld_maxdelay);/* in 1/10ths of a second */
if (maxdelay >= 32768) {
maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) <<
@@ -954,7 +953,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6
 * group-specific or group-and-source query.
 */
if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer)
-   mld_v2_process_group_query(inm, mli, timer, m, off);
+   mld_v2_process_group_query(inm, mli, timer, m, mld, 
off);
 
/* XXX Clear embedded scope ID as userland won't expect it. */
in6_clearscope(>mld_addr);
@@ -975,9 +974,8 @@ out_locked:
  */
 static int
 mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli,
-int timer, struct mbuf *m0, const int off)
+int timer, struct mbuf *m0, struct mldv2_query *mld, const int off)
 {
-   struct mldv2_query  *mld;
int  retval;
uint16_t nsrc;
 
@@ -985,7 +983,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru
MLD_LOCK_ASSERT();
 
retval = 0;
-   mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off);
 
switch (inm->in6m_state) {
case MLD_NOT_MEMBER:
@@ -1005,6 +1002,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru
 
nsrc = ntohs(mld->mld_numsrc);
 
+   /* Length should be checked by calling function. */
+   KASSERT((m0->m_flags & M_PKTHDR) == 0 ||
+   m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) +
+   nsrc * sizeof(struct in6_addr),
+   ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)",
+   m0->m_pkthdr.len, off + sizeof(struct mldv2_query) +
+   nsrc * sizeof(struct in6_addr), m0));
+
+
/*
 * Deal with group-specific queries upfront.
 * If any group query is already pending, purge any recorded
@@ -1046,28 +1052,20 @@ mld_v2_process_group_query(struct in6_multi 

svn commit: r350645 - head/sys/netinet6

2019-08-06 Thread Ed Maste
Author: emaste
Date: Tue Aug  6 17:11:30 2019
New Revision: 350645
URL: https://svnweb.freebsd.org/changeset/base/350645

Log:
  Correct ICMPv6/MLDv2 out-of-bounds memory access
  
  Previously the ICMPv6 input path incorrectly handled cases where an
  MLDv2 listener query packet was internally fragmented across multiple
  mbufs.
  
  admbugs:  921
  Submitted by: jtl
  Reported by:  CJD of Apple
  Approved by:  so
  MFC after:0 minutes
  Security: CVE-2019-5608

Modified:
  head/sys/netinet6/mld6.c

Modified: head/sys/netinet6/mld6.c
==
--- head/sys/netinet6/mld6.cTue Aug  6 17:11:17 2019(r350644)
+++ head/sys/netinet6/mld6.cTue Aug  6 17:11:30 2019(r350645)
@@ -139,14 +139,15 @@ static intmld_v2_enqueue_group_record(struct 
mbufq *,
struct in6_multi *, const int, const int, const int,
const int);
 static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *,
-   struct mbuf *, const int, const int);
+   struct mbuf *, struct mldv2_query *, const int, const int);
 static int mld_v2_merge_state_changes(struct in6_multi *,
struct mbufq *);
 static voidmld_v2_process_group_timers(struct in6_multi_head *,
struct mbufq *, struct mbufq *,
struct in6_multi *, const int);
 static int mld_v2_process_group_query(struct in6_multi *,
-   struct mld_ifsoftc *mli, int, struct mbuf *, const int);
+   struct mld_ifsoftc *mli, int, struct mbuf *,
+   struct mldv2_query *, const int);
 static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS);
 static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS);
 
@@ -804,16 +805,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t
  * Process a received MLDv2 general, group-specific or
  * group-and-source-specific query.
  *
- * Assumes that the query header has been pulled up to sizeof(mldv2_query).
+ * Assumes that mld points to a struct mldv2_query which is stored in
+ * contiguous memory.
  *
  * Return 0 if successful, otherwise an appropriate error code is returned.
  */
 static int
 mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6,
-struct mbuf *m, const int off, const int icmp6len)
+struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len)
 {
struct mld_ifsoftc  *mli;
-   struct mldv2_query  *mld;
struct in6_multi*inm;
uint32_t maxdelay, nsrc, qqi;
int  is_general_query;
@@ -845,8 +846,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6
 
CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp));
 
-   mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off);
-
maxdelay = ntohs(mld->mld_maxdelay);/* in 1/10ths of a second */
if (maxdelay >= 32768) {
maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) <<
@@ -973,7 +972,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6
 * group-specific or group-and-source query.
 */
if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer)
-   mld_v2_process_group_query(inm, mli, timer, m, off);
+   mld_v2_process_group_query(inm, mli, timer, m, mld, 
off);
 
/* XXX Clear embedded scope ID as userland won't expect it. */
in6_clearscope(>mld_addr);
@@ -994,9 +993,8 @@ out_locked:
  */
 static int
 mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli,
-int timer, struct mbuf *m0, const int off)
+int timer, struct mbuf *m0, struct mldv2_query *mld, const int off)
 {
-   struct mldv2_query  *mld;
int  retval;
uint16_t nsrc;
 
@@ -1004,7 +1002,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru
MLD_LOCK_ASSERT();
 
retval = 0;
-   mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off);
 
switch (inm->in6m_state) {
case MLD_NOT_MEMBER:
@@ -1024,6 +1021,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru
 
nsrc = ntohs(mld->mld_numsrc);
 
+   /* Length should be checked by calling function. */
+   KASSERT((m0->m_flags & M_PKTHDR) == 0 ||
+   m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) +
+   nsrc * sizeof(struct in6_addr),
+   ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)",
+   m0->m_pkthdr.len, off + sizeof(struct mldv2_query) +
+   nsrc * sizeof(struct in6_addr), m0));
+
+
/*
 * Deal with group-specific queries upfront.
 * If any group query is already pending, purge any recorded
@@ -1065,28 +1071,20 @@ mld_v2_process_group_query(struct in6_multi *inm, stru
 * report for those 

svn commit: r350638 - stable/11/contrib/bsnmp/lib

2019-08-06 Thread Ed Maste
Author: emaste
Date: Tue Aug  6 16:12:43 2019
New Revision: 350638
URL: https://svnweb.freebsd.org/changeset/base/350638

Log:
  MFC r350635: bsnmp: add asn1 message length validation
  
  admbugs:  780
  Submitted by: Guido Vranken, bz
  Reported by:  Guido Vranken
  Approved by:  so
  Security: CVE-2019-5610

Modified:
  stable/11/contrib/bsnmp/lib/asn1.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/bsnmp/lib/asn1.c
==
--- stable/11/contrib/bsnmp/lib/asn1.c  Tue Aug  6 16:11:16 2019
(r350637)
+++ stable/11/contrib/bsnmp/lib/asn1.c  Tue Aug  6 16:12:43 2019
(r350638)
@@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le
*len = *b->asn_cptr++;
b->asn_len--;
}
+   if (*len > b->asn_len) {
+   asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len);
+   return (ASN_ERR_EOBUF);
+   }
+   
return (ASN_ERR_OK);
 }
 
___
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: r350574 - in stable/12: contrib/binutils/gas/doc gnu/usr.bin/binutils/as

2019-08-04 Thread Ed Maste
Author: emaste
Date: Sun Aug  4 20:40:47 2019
New Revision: 350574
URL: https://svnweb.freebsd.org/changeset/base/350574

Log:
  MFC r350518: as: add deprecation notice to the man page
  
  In the future FreeBSD will ship without GNU binutils 2.17.50.  Add a
  note advising users who require GNU as to install the binutils port
  or package.
  
  Note that on armv7, arm64, amd64, i386 we currently ship only two
  binutils tools (as and objdump).  A deprecation notice was added to
  objdump's man page some time ago.
  
  PR:   233611
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/contrib/binutils/gas/doc/as.texinfo
  stable/12/gnu/usr.bin/binutils/as/as.1
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/binutils/gas/doc/as.texinfo
==
--- stable/12/contrib/binutils/gas/doc/as.texinfo   Sun Aug  4 20:00:39 
2019(r350573)
+++ stable/12/contrib/binutils/gas/doc/as.texinfo   Sun Aug  4 20:40:47 
2019(r350574)
@@ -1295,6 +1295,9 @@ computer-readable series of instructions.  Different v
 @section The GNU Assembler
 
 @c man begin DESCRIPTION
+@sc{gnu} @command{as} will be removed from a future version of the
+FreeBSD base system.  Users who require
+@sc{gnu} @command{as} are advised to install the binutils port or package.
 
 @sc{gnu} @command{as} is really a family of assemblers.
 @ifclear GENERIC

Modified: stable/12/gnu/usr.bin/binutils/as/as.1
==
--- stable/12/gnu/usr.bin/binutils/as/as.1  Sun Aug  4 20:00:39 2019
(r350573)
+++ stable/12/gnu/usr.bin/binutils/as/as.1  Sun Aug  4 20:40:47 2019
(r350574)
@@ -293,6 +293,10 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-\-alte
  [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR]
 .SH "DESCRIPTION"
 .IX Header "DESCRIPTION"
+\&\s-1GNU\s0 \fBas\fR will be removed from a future version of the
+FreeBSD base system.  Users who require
+\&\s-1GNU\s0 \fBas\fR are advised to install the binutils port or package.
+.PP
 \&\s-1GNU\s0 \fBas\fR is really a family of assemblers.
 If you use (or have used) the \s-1GNU\s0 assembler on one architecture, you
 should find a fairly similar environment when you use it on another
___
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: r350565 - in stable/12: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-03 Thread Ed Maste
Author: emaste
Date: Sun Aug  4 01:18:50 2019
New Revision: 350565
URL: https://svnweb.freebsd.org/changeset/base/350565

Log:
  objdump: update deprecation notice
  
  MFC r350503: objdump: move deprecation notice to indended spot
  
  r335217 added a deprecation notice to the source file for the objdump
  man page, and r335219 added it to the rendered objdump.1, but in the
  wrong spot.
  
  MFC r350505: objdump: be explicit that GNU objdump that will be removed
  
  We may install llvm-objdump as objdump (see review D18307) or just
  provide no /usr/bin/objdump, but either way GNU objdump won't be
  installed in the future.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/contrib/binutils/binutils/doc/binutils.texi
  stable/12/gnu/usr.bin/binutils/objdump/objdump.1
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/binutils/binutils/doc/binutils.texi
==
--- stable/12/contrib/binutils/binutils/doc/binutils.texi   Sat Aug  3 
22:41:29 2019(r350564)
+++ stable/12/contrib/binutils/binutils/doc/binutils.texi   Sun Aug  4 
01:18:50 2019(r350565)
@@ -1624,8 +1624,8 @@ program to compile and work.
 specify archives, @command{objdump} shows information on each of the member
 object files.
 
-@command{objdump} will be removed from a future version of the
-FreeBSD base system.  Users who require @command{objdump} are advised
+GNU @command{objdump} will be removed from a future version of the
+FreeBSD base system.  Users who require GNU @command{objdump} are advised
 to install the binutils port or package.
 
 @c man end

Modified: stable/12/gnu/usr.bin/binutils/objdump/objdump.1
==
--- stable/12/gnu/usr.bin/binutils/objdump/objdump.1Sat Aug  3 22:41:29 
2019(r350564)
+++ stable/12/gnu/usr.bin/binutils/objdump/objdump.1Sun Aug  4 01:18:50 
2019(r350565)
@@ -179,13 +179,13 @@ information is mostly useful to programmers who are wo
 compilation tools, as opposed to programmers who just want their
 program to compile and work.
 .PP
-\&\fBobjdump\fR will be removed from a future version of the
-FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
-to install the binutils port or package.
-.PP
 \&\fIobjfile\fR... are the object files to be examined.  When you
 specify archives, \fBobjdump\fR shows information on each of the member
 object files.
+.PP
+GNU \&\fBobjdump\fR will be removed from a future version of the
+FreeBSD base system.  Users who require GNU \&\fBobjdump\fR are advised
+to install the binutils port or package.
 .SH "OPTIONS"
 .IX Header "OPTIONS"
 The long and short forms of options, shown here as alternatives, are
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
On Thu, 1 Aug 2019 at 18:54, Enji Cooper  wrote:
>
> Thought: could this be modified in an iterative manner, like “objdump” -> 
> “gobjdump” / “llvm-objdump” -> “objdump”, etc (assuming llvm and gnu objdump 
> are largely compatible)?

It could, and we have done that sort of thing in the past. But here we
should be retiring the old binutils tools well before 13.0 and I don't
think it's worth the extra complexity.
___
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: r350518 - in head: contrib/binutils/gas/doc gnu/usr.bin/binutils/as

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 19:01:27 2019
New Revision: 350518
URL: https://svnweb.freebsd.org/changeset/base/350518

Log:
  as: add deprecation notice to the man page
  
  In the future FreeBSD will ship without GNU binutils 2.17.50.  Add a
  note advising users who require GNU as to install the binutils port
  or package.
  
  Note that on armv7, arm64, amd64, i386 we currently ship only two
  binutils tools (as and objdump).  A deprecation notice was added to
  objdump's man page some time ago.
  
  PR:   233611
  Discussed with:   jhb
  MFC after:1 week
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/binutils/gas/doc/as.texinfo
  head/gnu/usr.bin/binutils/as/as.1

Modified: head/contrib/binutils/gas/doc/as.texinfo
==
--- head/contrib/binutils/gas/doc/as.texinfoThu Aug  1 18:57:37 2019
(r350517)
+++ head/contrib/binutils/gas/doc/as.texinfoThu Aug  1 19:01:27 2019
(r350518)
@@ -1295,6 +1295,9 @@ computer-readable series of instructions.  Different v
 @section The GNU Assembler
 
 @c man begin DESCRIPTION
+@sc{gnu} @command{as} will be removed from a future version of the
+FreeBSD base system.  Users who require
+@sc{gnu} @command{as} are advised to install the binutils port or package.
 
 @sc{gnu} @command{as} is really a family of assemblers.
 @ifclear GENERIC

Modified: head/gnu/usr.bin/binutils/as/as.1
==
--- head/gnu/usr.bin/binutils/as/as.1   Thu Aug  1 18:57:37 2019
(r350517)
+++ head/gnu/usr.bin/binutils/as/as.1   Thu Aug  1 19:01:27 2019
(r350518)
@@ -293,6 +293,10 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-\-alte
  [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR]
 .SH "DESCRIPTION"
 .IX Header "DESCRIPTION"
+\&\s-1GNU\s0 \fBas\fR will be removed from a future version of the
+FreeBSD base system.  Users who require
+\&\s-1GNU\s0 \fBas\fR are advised to install the binutils port or package.
+.PP
 \&\s-1GNU\s0 \fBas\fR is really a family of assemblers.
 If you use (or have used) the \s-1GNU\s0 assembler on one architecture, you
 should find a fairly similar environment when you use it on another
___
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: r350511 - head/contrib/elftoolchain/readelf

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 17:59:56 2019
New Revision: 350511
URL: https://svnweb.freebsd.org/changeset/base/350511

Log:
  readelf: decode NT_GNU_PROPERTY_TYPE_0 / GNU_PROPERTY_X86_FEATURE_1_AND
  
  These bits are used for Intel CET IBT/Shadow Stack.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20516

Modified:
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Thu Aug  1 17:45:43 2019
(r350510)
+++ head/contrib/elftoolchain/readelf/readelf.c Thu Aug  1 17:59:56 2019
(r350511)
@@ -322,11 +322,13 @@ static void dump_mips_specific_info(struct readelf *re
 static void dump_notes(struct readelf *re);
 static void dump_notes_content(struct readelf *re, const char *buf, size_t sz,
 off_t off);
-static void dump_notes_data(const char *name, uint32_t type, const char *buf,
-size_t sz);
+static void dump_notes_data(struct readelf *re, const char *name,
+uint32_t type, const char *buf, size_t sz);
 static void dump_svr4_hash(struct section *s);
 static void dump_svr4_hash64(struct readelf *re, struct section *s);
 static void dump_gnu_hash(struct readelf *re, struct section *s);
+static void dump_gnu_property_type_0(struct readelf *re, const char *buf,
+size_t sz);
 static void dump_hash(struct readelf *re);
 static void dump_phdr(struct readelf *re);
 static void dump_ppc_attributes(uint8_t *p, uint8_t *pe);
@@ -3517,7 +3519,63 @@ dump_gnu_hash(struct readelf *re, struct section *s)
free(bl);
 }
 
+static struct flag_desc gnu_property_x86_feature_1_and_bits[] = {
+   { GNU_PROPERTY_X86_FEATURE_1_IBT,   "IBT" },
+   { GNU_PROPERTY_X86_FEATURE_1_SHSTK, "SHSTK" },
+   { 0, NULL }
+};
+
 static void
+dump_gnu_property_type_0(struct readelf *re, const char *buf, size_t sz)
+{
+   size_t i;
+   uint32_t type, prop_sz;
+
+   printf("  Properties: ");
+   while (sz > 0) {
+   if (sz < 8)
+   goto bad;
+
+   type = *(const uint32_t *)(const void *)buf;
+   prop_sz = *(const uint32_t *)(const void *)(buf + 4);
+   buf += 8;
+   sz -= 8;
+
+   if (prop_sz > sz)
+   goto bad;
+
+   if (type >= GNU_PROPERTY_LOPROC &&
+   type <= GNU_PROPERTY_HIPROC) {
+   if (re->ehdr.e_machine != EM_X86_64) {
+   printf("machine type %x unknown\n",
+   re->ehdr.e_machine);
+   goto unknown;
+   }
+   switch (type) {
+   case GNU_PROPERTY_X86_FEATURE_1_AND:
+   printf("x86 features:");
+   if (prop_sz != 4)
+   goto bad;
+   dump_flags(gnu_property_x86_feature_1_and_bits,
+   *(const uint32_t *)(const void *)buf);
+   break;
+   }
+   }
+
+   buf += roundup2(prop_sz, 8);
+   sz -= roundup2(prop_sz, 8);
+   }
+   return;
+bad:
+   printf("corrupt GNU property\n");
+unknown:
+   printf("remaining description data:");
+   for (i = 0; i < sz; i++)
+   printf(" %02x", (unsigned char)buf[i]);
+   printf("\n");
+}
+
+static void
 dump_hash(struct readelf *re)
 {
struct section  *s;
@@ -3608,7 +3666,8 @@ static struct flag_desc note_feature_ctl_flags[] = {
 };
 
 static void
-dump_notes_data(const char *name, uint32_t type, const char *buf, size_t sz)
+dump_notes_data(struct readelf *re, const char *name, uint32_t type,
+const char *buf, size_t sz)
 {
size_t i;
const uint32_t *ubuf;
@@ -3640,6 +3699,12 @@ dump_notes_data(const char *name, uint32_t type, const
dump_flags(note_feature_ctl_flags, ubuf[0]);
return;
}
+   } else if (strcmp(name, "GNU") == 0) {
+   switch (type) {
+   case NT_GNU_PROPERTY_TYPE_0:
+   dump_gnu_property_type_0(re, buf, sz);
+   return;
+   }
}
 unknown:
printf("   description data:");
@@ -3684,7 +3749,7 @@ dump_notes_content(struct readelf *re, const char *buf
printf("  %-13s %#010jx", name, (uintmax_t) note->n_descsz);
printf("  %s\n", note_type(name, re->ehdr.e_type,
note->n_type));
-   dump_notes_data(name, note->n_type, buf, note->n_descsz);
+   dump_notes_data(re, name, note->n_type, buf, note->n_descsz);
buf += 

Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
On Thu, 1 Aug 2019 at 12:51, Rodney W. Grimes  wrote:
>
> That would be fine, the important thing is that the
> r350505 gets listed in the file,

I don't see any reason that r350505 specifically should be in a
release note - this is a minor clarification of an existing
deprecation notice. It seems having an overall "deprecation notices"
section in the release notes would make sense, but they should really
persist from version to version. Should we add a top-level
DEPRECATION_NOTICES file perhaps? Or tag deprecation notices with some
sort of comment in the source so they can be found with a 'grep'
during release preparation?
___
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: r350506 - head/tools/debugscripts

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 17:02:58 2019
New Revision: 350506
URL: https://svnweb.freebsd.org/changeset/base/350506

Log:
  remove obsolete kernel debugging script
  
  For quite some time kgdb has been internally handling FreeBSD kernel
  module state; add-on scripts and tools are not needed.  asf(8) served
  a similar purpose to this script and was removed in r335222.
  
  PR:   229046
  Reported by:  jhb
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/tools/debugscripts/kld_deb.py
___
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: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
On Thu, 1 Aug 2019 at 12:35, Ian Lepore  wrote:
>
> Why would we provide no objdump?  I use it quite frequently; it seems
> like an essential part of the toolchain to me.

I don't want us to provide no objdump, but providing GNU objdump
2.17.50 indefinitely is not a viable option; see PR 218387[1] for an
example of the kind of issue we have with providing obsolete software.

We have a choice of:
1. provide llvm-objdump, and no /usr/bin/objdump in the base system
2. install llvm-objdump as /usr/bin/objdump
3. require that users who want an objdump install the binutils port

/usr/bin/objdump is not required by the base system build and not
required by most ports. exp-run details with no /usr/bin/objdump can
be found in PR 212319[2], and PR 229046[3] is a tracking PR for
removing dependencies on objdump.

Option 1 (removing /usr/bin/objdump) is proposed in review D7338[4]
while option 2 is (installing llvm-objdump as objdump) is proposed in
review D18307. llvm-objdump is roughly compatible with GNU objdump
(command line and output format) but there are a large number of small
issues that will likely trip up scripted or automated objdump use.
(Scripts should probably just use readelf instead, though.) D18307 has
a list of LLVM bug reports for known issues in llvm-objdump.

Note also that we currently provide only two or three obsolete
binutils, depending on the CPU architecture:
- as
- ld
- objdump

[1] https://bugs.freebsd.org/218387
[2] https://bugs.freebsd.org/212319
[3] https://bugs.freebsd.org/229046
[4] https://reviews.freebsd.org/D7338
[5] https://reviews.freebsd.org/D18307
___
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: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
On Thu, 1 Aug 2019 at 12:00, Rodney W. Grimes  wrote:
>
> > Author: emaste
> > Date: Thu Aug  1 14:42:41 2019
> > New Revision: 350505
> > URL: https://svnweb.freebsd.org/changeset/base/350505
> >
> > Log:
> >   objdump: be explicit that GNU objdump that will be removed
> >
> >   We may install llvm-objdump as objdump (see review D18307) or just
> >   provide no /usr/bin/objdump, but either way GNU objdump won't be
> >   installed in the future.
> >
> >   MFC after:  3 days
>
> Can we get a RELNOTES entry for this please?

Can you suggest wording for such a note? Something like:

The deprecation notice in the GNU objdump man page was clarified to
indicate that it is GNU objdump which will be removed; an objdump from
the LLVM project may be provided in its place.
___
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: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 14:42:41 2019
New Revision: 350505
URL: https://svnweb.freebsd.org/changeset/base/350505

Log:
  objdump: be explicit that GNU objdump that will be removed
  
  We may install llvm-objdump as objdump (see review D18307) or just
  provide no /usr/bin/objdump, but either way GNU objdump won't be
  installed in the future.
  
  MFC after:3 days

Modified:
  head/contrib/binutils/binutils/doc/binutils.texi
  head/gnu/usr.bin/binutils/objdump/objdump.1

Modified: head/contrib/binutils/binutils/doc/binutils.texi
==
--- head/contrib/binutils/binutils/doc/binutils.texiThu Aug  1 14:40:37 
2019(r350504)
+++ head/contrib/binutils/binutils/doc/binutils.texiThu Aug  1 14:42:41 
2019(r350505)
@@ -1624,8 +1624,8 @@ program to compile and work.
 specify archives, @command{objdump} shows information on each of the member
 object files.
 
-@command{objdump} will be removed from a future version of the
-FreeBSD base system.  Users who require @command{objdump} are advised
+GNU @command{objdump} will be removed from a future version of the
+FreeBSD base system.  Users who require GNU @command{objdump} are advised
 to install the binutils port or package.
 
 @c man end

Modified: head/gnu/usr.bin/binutils/objdump/objdump.1
==
--- head/gnu/usr.bin/binutils/objdump/objdump.1 Thu Aug  1 14:40:37 2019
(r350504)
+++ head/gnu/usr.bin/binutils/objdump/objdump.1 Thu Aug  1 14:42:41 2019
(r350505)
@@ -183,8 +183,8 @@ program to compile and work.
 specify archives, \fBobjdump\fR shows information on each of the member
 object files.
 .PP
-\&\fBobjdump\fR will be removed from a future version of the
-FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
+GNU \&\fBobjdump\fR will be removed from a future version of the
+FreeBSD base system.  Users who require GNU \&\fBobjdump\fR are advised
 to install the binutils port or package.
 .SH "OPTIONS"
 .IX Header "OPTIONS"
___
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: r350503 - head/gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 14:39:26 2019
New Revision: 350503
URL: https://svnweb.freebsd.org/changeset/base/350503

Log:
  objdump: move deprecation notice to indended spot in the man page
  
  r335217 added a deprecation notice to the source file for the objdump
  man page, and r335219 added it to the rendered objdump.1, but in the
  wrong spot.
  
  MFC after:3 days

Modified:
  head/gnu/usr.bin/binutils/objdump/objdump.1

Modified: head/gnu/usr.bin/binutils/objdump/objdump.1
==
--- head/gnu/usr.bin/binutils/objdump/objdump.1 Thu Aug  1 14:34:27 2019
(r350502)
+++ head/gnu/usr.bin/binutils/objdump/objdump.1 Thu Aug  1 14:39:26 2019
(r350503)
@@ -179,13 +179,13 @@ information is mostly useful to programmers who are wo
 compilation tools, as opposed to programmers who just want their
 program to compile and work.
 .PP
-\&\fBobjdump\fR will be removed from a future version of the
-FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
-to install the binutils port or package.
-.PP
 \&\fIobjfile\fR... are the object files to be examined.  When you
 specify archives, \fBobjdump\fR shows information on each of the member
 object files.
+.PP
+\&\fBobjdump\fR will be removed from a future version of the
+FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
+to install the binutils port or package.
 .SH "OPTIONS"
 .IX Header "OPTIONS"
 The long and short forms of options, shown here as alternatives, are
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


<    4   5   6   7   8   9   10   11   12   13   >