svn commit: r341510 - head/sbin/fsck_ffs

2018-12-04 Thread Kirk McKusick
Author: mckusick
Date: Wed Dec  5 06:31:50 2018
New Revision: 341510
URL: https://svnweb.freebsd.org/changeset/base/341510

Log:
  Ensure that cylinder-group check-hashes are properly updated when first
  creating them and when correcting them when they are found to be corrupted.
  
  Reported by:  Don Lewis (truckman@)
  Sponsored by: Netflix

Modified:
  head/sbin/fsck_ffs/fsck.h
  head/sbin/fsck_ffs/fsutil.c
  head/sbin/fsck_ffs/inode.c
  head/sbin/fsck_ffs/pass1.c
  head/sbin/fsck_ffs/pass5.c
  head/sbin/fsck_ffs/setup.c

Modified: head/sbin/fsck_ffs/fsck.h
==
--- head/sbin/fsck_ffs/fsck.h   Wed Dec  5 00:46:09 2018(r341509)
+++ head/sbin/fsck_ffs/fsck.h   Wed Dec  5 06:31:50 2018(r341510)
@@ -417,6 +417,7 @@ voidblzero(int fd, ufs2_daddr_t blk, long 
size);
 void   cacheino(union dinode *dp, ino_t inumber);
 void   catch(int);
 void   catchquit(int);
+void   cgdirty(struct bufarea *);
 intchangeino(ino_t dir, const char *name, ino_t newnum);
 intcheck_cgmagic(int cg, struct bufarea *cgbp);
 intchkrange(ufs2_daddr_t blk, int cnt);

Modified: head/sbin/fsck_ffs/fsutil.c
==
--- head/sbin/fsck_ffs/fsutil.c Wed Dec  5 00:46:09 2018(r341509)
+++ head/sbin/fsck_ffs/fsutil.c Wed Dec  5 06:31:50 2018(r341510)
@@ -249,6 +249,24 @@ cglookup(int cg)
 }
 
 /*
+ * Mark a cylinder group buffer as dirty.
+ * Update its check-hash if they are enabled.
+ */
+void
+cgdirty(struct bufarea *cgbp)
+{
+   struct cg *cg;
+
+   cg = cgbp->b_un.b_cg;
+   if ((sblock.fs_metackhash & CK_CYLGRP) != 0) {
+   cg->cg_ckhash = 0;
+   cg->cg_ckhash =
+   calculate_crc32c(~0L, (void *)cg, sblock.fs_cgsize);
+   }
+   dirty(cgbp);
+}
+
+/*
  * Attempt to flush a cylinder group cache entry.
  * Return whether the flush was successful.
  */
@@ -348,11 +366,11 @@ flush(int fd, struct bufarea *bp)
if (bp != )
pfatal("BUFFER %p DOES NOT MATCH SBLK %p\n",
bp, );
-   if (sbput(fd, (struct fs *)bp->b_un.b_buf, 0) == 0)
+   if (sbput(fd, bp->b_un.b_fs, 0) == 0)
fsmodified = 1;
break;
case BT_CYLGRP:
-   if (cgput(, (struct cg *)bp->b_un.b_buf) == 0)
+   if (cgput(, bp->b_un.b_cg) == 0)
fsmodified = 1;
break;
default:
@@ -740,7 +758,7 @@ check_cgmagic(int cg, struct bufarea *cgbp)
cgp->cg_nextfreeoff = cgp->cg_clusteroff +
howmany(fragstoblks(, sblock.fs_fpg), CHAR_BIT);
}
-   dirty(cgbp);
+   cgdirty(cgbp);
return (0);
 }
 
@@ -782,7 +800,7 @@ allocblk(long frags)
cgp->cg_cs.cs_nbfree--;
else
cgp->cg_cs.cs_nffree -= frags;
-   dirty(cgbp);
+   cgdirty(cgbp);
return (i + j);
}
}

Modified: head/sbin/fsck_ffs/inode.c
==
--- head/sbin/fsck_ffs/inode.c  Wed Dec  5 00:46:09 2018(r341509)
+++ head/sbin/fsck_ffs/inode.c  Wed Dec  5 06:31:50 2018(r341510)
@@ -692,7 +692,7 @@ allocino(ino_t request, int type)
default:
return (0);
}
-   dirty(cgbp);
+   cgdirty(cgbp);
dp = ginode(ino);
DIP_SET(dp, di_db[0], allocblk((long)1));
if (DIP(dp, di_db[0]) == 0) {

Modified: head/sbin/fsck_ffs/pass1.c
==
--- head/sbin/fsck_ffs/pass1.c  Wed Dec  5 00:46:09 2018(r341509)
+++ head/sbin/fsck_ffs/pass1.c  Wed Dec  5 06:31:50 2018(r341510)
@@ -200,7 +200,7 @@ pass1(void)
cgp->cg_initediblk = mininos;
pwarn("CYLINDER GROUP %d: RESET FROM %ju TO %d %s\n",
c, i, cgp->cg_initediblk, "VALID INODES");
-   dirty(cgbp);
+   cgdirty(cgbp);
}
if (inosused < sblock.fs_ipg)
continue;

Modified: head/sbin/fsck_ffs/pass5.c
==
--- head/sbin/fsck_ffs/pass5.c  Wed Dec  5 00:46:09 2018(r341509)
+++ head/sbin/fsck_ffs/pass5.c  Wed Dec  5 06:31:50 2018(r341510)
@@ -182,14 +182,19 @@ pass5(void)
ckhash = cg->cg_ckhash;
cg->cg_ckhash = 0;
thishash = calculate_crc32c(~0L, cg, fs->fs_cgsize);
-   if (ckhash != thishash)
+  

Re: svn commit: r341505 - head/share/man/man5

2018-12-04 Thread Kubilay Kocak

On 5/12/2018 9:51 am, Pedro F. Giffuni wrote:

Starting with FreeBSD 12 we fully support writing ext4 filesystems


Can we remove '2' from the module/man/etc name if (since) it supports 
multiple extXfs versions? Is there anything serious preventing it?


Seems minor but I think worth it for discovery/pola/obviousness, and a 
good time (early in the 13.0 cycle).


We get a lot of user questions about ext*fs support on FreeBSD and 
pointing to an ext2fs man page also feels a bit weird.


Happy to get/organise a !committer contributor to take care of this if 
no-one wants to pick it up.


./koobs
___
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: r341509 - in head/lib/libc: amd64 arm i386 mips powerpc powerpc64 sparc64

2018-12-04 Thread Brooks Davis
Author: brooks
Date: Wed Dec  5 00:46:09 2018
New Revision: 341509
URL: https://svnweb.freebsd.org/changeset/base/341509

Log:
  Remove MD __sys_* private symbols.
  
  No references to any of these exist in the tree. The list was also
  erratic with different architectures exporting different things
  (arm64 and riscv exported none).
  
  Reviewed by:  kib
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D18425

Modified:
  head/lib/libc/amd64/Symbol.map
  head/lib/libc/arm/Symbol.map
  head/lib/libc/i386/Symbol.map
  head/lib/libc/mips/Symbol.map
  head/lib/libc/powerpc/Symbol.map
  head/lib/libc/powerpc64/Symbol.map
  head/lib/libc/sparc64/Symbol.map

Modified: head/lib/libc/amd64/Symbol.map
==
--- head/lib/libc/amd64/Symbol.map  Tue Dec  4 23:53:42 2018
(r341508)
+++ head/lib/libc/amd64/Symbol.map  Wed Dec  5 00:46:09 2018
(r341509)
@@ -51,9 +51,7 @@ FBSD_1.0 {
  */
 FBSDprivate_1.0 {
/* PSEUDO syscalls */
-   __sys_getlogin;
_getlogin;
-   __sys_exit;
 
_set_tp;
___longjmp;
@@ -63,6 +61,5 @@ FBSDprivate_1.0 {
signalcontext;
__siglongjmp;
_brk;
-   __sys_vfork;
_vfork;
 };

Modified: head/lib/libc/arm/Symbol.map
==
--- head/lib/libc/arm/Symbol.mapTue Dec  4 23:53:42 2018
(r341508)
+++ head/lib/libc/arm/Symbol.mapWed Dec  5 00:46:09 2018
(r341509)
@@ -43,9 +43,7 @@ FBSD_1.4 {
 
 FBSDprivate_1.0 {
/* PSEUDO syscalls */
-   __sys_getlogin;
_getlogin;
-   __sys_exit;
 
_set_tp;
__aeabi_read_tp;
@@ -55,7 +53,6 @@ FBSDprivate_1.0 {
signalcontext;
_signalcontext;
__siglongjmp;
-   __sys_vfork;
_vfork;
_brk;
_sbrk;

Modified: head/lib/libc/i386/Symbol.map
==
--- head/lib/libc/i386/Symbol.map   Tue Dec  4 23:53:42 2018
(r341508)
+++ head/lib/libc/i386/Symbol.map   Wed Dec  5 00:46:09 2018
(r341509)
@@ -48,9 +48,7 @@ FBSD_1.0 {
 
 FBSDprivate_1.0 {
/* PSEUDO syscalls */
-   __sys_getlogin;
_getlogin;
-   __sys_exit;
 
_set_tp;
___longjmp;
@@ -59,7 +57,6 @@ FBSDprivate_1.0 {
__signalcontext;
signalcontext;
__siglongjmp;
-   __sys_vfork;
_vfork;
_brk;
 };

Modified: head/lib/libc/mips/Symbol.map
==
--- head/lib/libc/mips/Symbol.map   Tue Dec  4 23:53:42 2018
(r341508)
+++ head/lib/libc/mips/Symbol.map   Wed Dec  5 00:46:09 2018
(r341509)
@@ -37,9 +37,7 @@ FBSD_1.3 {
 
 FBSDprivate_1.0 {
/* PSEUDO syscalls */
-   __sys_getlogin;
_getlogin;
-   __sys_exit;
 
_set_tp;
___longjmp;
@@ -48,7 +46,6 @@ FBSDprivate_1.0 {
signalcontext;
_signalcontext;
__siglongjmp;
-   __sys_vfork;
_vfork;
_brk;
_sbrk;

Modified: head/lib/libc/powerpc/Symbol.map
==
--- head/lib/libc/powerpc/Symbol.mapTue Dec  4 23:53:42 2018
(r341508)
+++ head/lib/libc/powerpc/Symbol.mapWed Dec  5 00:46:09 2018
(r341509)
@@ -43,9 +43,7 @@ FBSD_1.3 {
 
 FBSDprivate_1.0 {
/* PSEUDO syscalls */
-   __sys_getlogin;
_getlogin;
-   __sys_exit;
 
_set_tp;
_fpgetsticky;

Modified: head/lib/libc/powerpc64/Symbol.map
==
--- head/lib/libc/powerpc64/Symbol.map  Tue Dec  4 23:53:42 2018
(r341508)
+++ head/lib/libc/powerpc64/Symbol.map  Wed Dec  5 00:46:09 2018
(r341509)
@@ -39,9 +39,7 @@ FBSD_1.0 {
 
 FBSDprivate_1.0 {
/* PSEUDO syscalls */
-   __sys_getlogin;
_getlogin;
-   __sys_exit;
 
_set_tp;
_fpgetsticky;

Modified: head/lib/libc/sparc64/Symbol.map
==
--- head/lib/libc/sparc64/Symbol.mapTue Dec  4 23:53:42 2018
(r341508)
+++ head/lib/libc/sparc64/Symbol.mapWed Dec  5 00:46:09 2018
(r341509)
@@ -68,9 +68,7 @@ FBSD_1.0 {
 
 FBSDprivate_1.0 {
/* PSEUDO syscalls */
-   __sys_getlogin;
_getlogin;
-   __sys_exit;
 
_set_tp;
___longjmp;
@@ -79,11 +77,8 @@ FBSDprivate_1.0 {
signalcontext;
__signalcontext;
__siglongjmp;
-   __sys_brk;
_brk;
-   __sys_sbrk;
_sbrk;
-   __sys_vfork;
_vfork;
 
/* used in src/lib/csu/sparc64/crt1.c */
___
svn-src-all@freebsd.org mailing list

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

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

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

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

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

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

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

Modified: head/sys/net/altq/altq_priq.c
==
--- head/sys/net/altq/altq_priq.c   Tue Dec  4 23:46:43 2018
(r341507)
+++ head/sys/net/altq/altq_priq.c   Tue Dec  4 23:53:42 2018
(r341508)
@@ -473,7 +473,7 @@ priq_enqueue(struct ifaltq *ifq, struct mbuf *m, struc
return (ENOBUFS);
}
}
-   cl->cl_pktattr = NULL;
+   cl->cl_pktattr = NULL;
len = m_pktlen(m);
if (priq_addq(cl, m) != 0) {
/* drop occurred.  mbuf was freed in priq_addq. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

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

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

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

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

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

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:52:15 2018
New Revision: 341506
URL: https://svnweb.freebsd.org/changeset/base/341506

Log:
  MFC r339042:
  
  Mitigate providing a timing signal if the COOKIE or AUTH
  validation fails.
  Thanks to jmg@ for reporting the issue, which was discussed in
  https://admbugs.freebsd.org/show_bug.cgi?id=878

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

Modified: stable/11/sys/netinet/sctp_auth.c
==
--- stable/11/sys/netinet/sctp_auth.c   Tue Dec  4 22:51:13 2018
(r341505)
+++ stable/11/sys/netinet/sctp_auth.c   Tue Dec  4 22:52:15 2018
(r341506)
@@ -1735,7 +1735,7 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_au
m, offset, computed_digest);
 
/* compare the computed digest with the one in the AUTH chunk */
-   if (memcmp(digest, computed_digest, digestlen) != 0) {
+   if (timingsafe_bcmp(digest, computed_digest, digestlen) != 0) {
SCTP_STAT_INCR(sctps_recvauthfailed);
SCTPDBG(SCTP_DEBUG_AUTH1,
"SCTP Auth: HMAC digest check failed\n");

Modified: stable/11/sys/netinet/sctp_input.c
==
--- stable/11/sys/netinet/sctp_input.c  Tue Dec  4 22:51:13 2018
(r341505)
+++ stable/11/sys/netinet/sctp_input.c  Tue Dec  4 22:52:15 2018
(r341506)
@@ -2552,7 +2552,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in
return (NULL);
}
/* compare the received digest with the computed digest */
-   if (memcmp(calc_sig, sig, SCTP_SIGNATURE_SIZE) != 0) {
+   if (timingsafe_bcmp(calc_sig, sig, SCTP_SIGNATURE_SIZE) != 0) {
/* try the old cookie? */
if ((cookie->time_entered.tv_sec == 
(long)ep->time_of_secret_change) &&
(ep->current_secret_number != ep->last_secret_number)) {
@@ -2561,7 +2561,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in
(uint8_t 
*)ep->secret_key[(int)ep->last_secret_number],
SCTP_SECRET_SIZE, m, cookie_offset, calc_sig, 0);
/* compare */
-   if (memcmp(calc_sig, sig, SCTP_SIGNATURE_SIZE) == 0)
+   if (timingsafe_bcmp(calc_sig, sig, SCTP_SIGNATURE_SIZE) 
== 0)
cookie_ok = 1;
}
} else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2018-12-04 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec  4 22:51:13 2018
New Revision: 341505
URL: https://svnweb.freebsd.org/changeset/base/341505

Log:
  ext2fs.4: basic updates.
  
  Starting with FreeBSD 12 we fully support writing ext4 filesystems.
  Mention some features that we don't support while here.
  
  MFC after:3 days

Modified:
  head/share/man/man5/ext2fs.5

Modified: head/share/man/man5/ext2fs.5
==
--- head/share/man/man5/ext2fs.5Tue Dec  4 22:46:58 2018
(r341504)
+++ head/share/man/man5/ext2fs.5Tue Dec  4 22:51:13 2018
(r341505)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2016
+.Dd December 4, 2018
 .Dt EXT2FS 5
 .Os
 .Sh NAME
@@ -52,9 +52,10 @@ kernel to access
 and
 .Tn ext4
 file systems.
-The
+Support for Extended Attributes in
 .Tn ext4
-support is read-only.
+is experimental.
+Journalling and encryption are currently not supported.
 .Sh EXAMPLES
 To mount a
 .Nm
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341504 - stable/12/sys/netinet

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:46:58 2018
New Revision: 341504
URL: https://svnweb.freebsd.org/changeset/base/341504

Log:
  MFC r339989, r339991:
  
  Improve a comment to refer to the actual sections in the TCP
  specification for the comparisons made.
  Thanks to lstewart@ for the suggestion.
  
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D17595

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

Modified: stable/12/sys/netinet/tcp_syncache.c
==
--- stable/12/sys/netinet/tcp_syncache.cTue Dec  4 22:25:24 2018
(r341503)
+++ stable/12/sys/netinet/tcp_syncache.cTue Dec  4 22:46:58 2018
(r341504)
@@ -581,15 +581,28 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr
/*
 * If the RST bit is set, check the sequence number to see
 * if this is a valid reset segment.
+*
 * RFC 793 page 37:
 *   In all states except SYN-SENT, all reset (RST) segments
 *   are validated by checking their SEQ-fields.  A reset is
 *   valid if its sequence number is in the window.
 *
-*   The sequence number in the reset segment is normally an
-*   echo of our outgoing acknowlegement numbers, but some hosts
-*   send a reset with the sequence number at the rightmost edge
-*   of our receive window, and we have to handle this case.
+* RFC 793 page 69:
+*   There are four cases for the acceptability test for an incoming
+*   segment:
+*
+* Segment Receive  Test
+* Length  Window
+* --- ---  ---
+*0   0 SEG.SEQ = RCV.NXT
+*0  >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+*   >0   0 not acceptable
+*   >0  >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+*   or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND
+*
+* Note that when receiving a SYN segment in the LISTEN state,
+* IRS is set to SEG.SEQ and RCV.NXT is set to SEG.SEQ+1, as
+* described in RFC 793, page 66.
 */
if ((SEQ_GEQ(th->th_seq, sc->sc_irs + 1) &&
SEQ_LT(th->th_seq, sc->sc_irs + 1 + sc->sc_wnd)) ||
___
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: r341503 - in stable/11/sys/netinet: . cc

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:25:24 2018
New Revision: 341503
URL: https://svnweb.freebsd.org/changeset/base/341503

Log:
  MFC r341335:
  
  Limit option_len for the TCP_CCALGOOPT.
  
  Limiting the length to 2048 bytes seems to be acceptable, since
  the values used right now are using 8 bytes.
  This issue was found by using syzkaller.
  
  Reviewed by:  glebius, bz, rrs
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18366

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

Modified: stable/11/sys/netinet/cc/cc.h
==
--- stable/11/sys/netinet/cc/cc.h   Tue Dec  4 22:15:56 2018
(r341502)
+++ stable/11/sys/netinet/cc/cc.h   Tue Dec  4 22:25:24 2018
(r341503)
@@ -175,4 +175,6 @@ extern struct rwlock cc_list_lock;
 #defineCC_LIST_WUNLOCK()   rw_wunlock(_list_lock)
 #defineCC_LIST_LOCK_ASSERT()   rw_assert(_list_lock, RA_LOCKED)
 
+#define CC_ALGOOPT_LIMIT   2048
+
 #endif /* _NETINET_CC_CC_H_ */

Modified: stable/11/sys/netinet/tcp_usrreq.c
==
--- stable/11/sys/netinet/tcp_usrreq.c  Tue Dec  4 22:15:56 2018
(r341502)
+++ stable/11/sys/netinet/tcp_usrreq.c  Tue Dec  4 22:25:24 2018
(r341503)
@@ -1549,6 +1549,8 @@ tcp_default_ctloutput(struct socket *so, struct sockop
switch (sopt->sopt_name) {
case TCP_CCALGOOPT:
INP_WUNLOCK(inp);
+   if (sopt->sopt_valsize > CC_ALGOOPT_LIMIT)
+   return (EINVAL);
pbuf = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK | M_ZERO);
error = sooptcopyin(sopt, pbuf, sopt->sopt_valsize,
sopt->sopt_valsize);
___
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: r341502 - in stable/12/sys/netinet: . cc

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:15:56 2018
New Revision: 341502
URL: https://svnweb.freebsd.org/changeset/base/341502

Log:
  MFC r341335:
  
  Limit option_len for the TCP_CCALGOOPT.
  
  Limiting the length to 2048 bytes seems to be acceptable, since
  the values used right now are using 8 bytes.
  This issue was found by using syzkaller.
  
  Reviewed by:  glebius, bz, rrs
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18366

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

Modified: stable/12/sys/netinet/cc/cc.h
==
--- stable/12/sys/netinet/cc/cc.h   Tue Dec  4 22:14:18 2018
(r341501)
+++ stable/12/sys/netinet/cc/cc.h   Tue Dec  4 22:15:56 2018
(r341502)
@@ -184,4 +184,6 @@ extern struct rwlock cc_list_lock;
 #defineCC_LIST_WUNLOCK()   rw_wunlock(_list_lock)
 #defineCC_LIST_LOCK_ASSERT()   rw_assert(_list_lock, RA_LOCKED)
 
+#define CC_ALGOOPT_LIMIT   2048
+
 #endif /* _NETINET_CC_CC_H_ */

Modified: stable/12/sys/netinet/tcp_usrreq.c
==
--- stable/12/sys/netinet/tcp_usrreq.c  Tue Dec  4 22:14:18 2018
(r341501)
+++ stable/12/sys/netinet/tcp_usrreq.c  Tue Dec  4 22:15:56 2018
(r341502)
@@ -1769,6 +1769,8 @@ tcp_default_ctloutput(struct socket *so, struct sockop
switch (sopt->sopt_name) {
case TCP_CCALGOOPT:
INP_WUNLOCK(inp);
+   if (sopt->sopt_valsize > CC_ALGOOPT_LIMIT)
+   return (EINVAL);
pbuf = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK | M_ZERO);
error = sooptcopyin(sopt, pbuf, sopt->sopt_valsize,
sopt->sopt_valsize);
___
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: r341501 - stable/12/sys/netinet/tcp_stacks

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:14:18 2018
New Revision: 341501
URL: https://svnweb.freebsd.org/changeset/base/341501

Log:
  MFC r340782:
  
  A TCP stack is required to check SEG.ACK first, when processing a
  segment in the SYN-SENT state as stated in Section 3.9 of RFC 793,
  page 66. Ensure this is also done by the TCP RACK stack.
  
  Reviewed by:  rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18034

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

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==
--- stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:13:05 2018
(r341500)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:14:18 2018
(r341501)
@@ -6533,6 +6533,15 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th
goto done_with_input;
}
/*
+* If a segment with the ACK-bit set arrives in the SYN-SENT state
+* check SEQ.ACK first as described on page 66 of RFC 793, section 3.9.
+*/
+   if ((tp->t_state == TCPS_SYN_SENT) && (thflags & TH_ACK) &&
+   (SEQ_LEQ(th->th_ack, tp->iss) || SEQ_GT(th->th_ack, tp->snd_max))) {
+   rack_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen);
+   return;
+   }
+   /*
 * Segment received on connection. Reset idle time and keep-alive
 * timer. XXX: This should be done after segment validation to
 * ignore broken/spoofed segs.
___
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: r341500 - stable/12/sys/netinet/tcp_stacks

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:13:05 2018
New Revision: 341500
URL: https://svnweb.freebsd.org/changeset/base/341500

Log:
  MFC r340781:
  
  Ensure that the TCP RACK stack honours the setting of the
  net.inet.tcp.drop_synfin sysctl-variable.
  
  Reviewed by:  rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18033

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

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==
--- stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:11:41 2018
(r341499)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:13:05 2018
(r341500)
@@ -6528,6 +6528,10 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th
TCP_LOG_EVENT(tp, th, >so_rcv, >so_snd, TCP_LOG_IN, 0,
tlen, , true);
}
+   if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) {
+   way_out = 4;
+   goto done_with_input;
+   }
/*
 * Segment received on connection. Reset idle time and keep-alive
 * timer. XXX: This should be done after segment validation to
___
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: r341499 - stable/12/sys/netinet/tcp_stacks

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:11:41 2018
New Revision: 341499
URL: https://svnweb.freebsd.org/changeset/base/341499

Log:
  MFC r340777:
  
  Ensure that the default RTT stack can make an RTT measurement if
  the TCP connection was initiated using the RACK stack, but the
  peer does not support the TCP RACK extension.
  
  This ensures that the TCP behaviour on the wire is the same if
  the TCP connection is initated using the RACK stack or the default
  stack.
  
  Reviewed by:  rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18032

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

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==
--- stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:10:09 2018
(r341498)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:11:41 2018
(r341499)
@@ -8493,9 +8493,7 @@ out:
pass, rsm);
if ((tp->t_flags & TF_FORCEDATA) == 0 ||
(rack->rc_in_persist == 0)) {
-#ifdef NETFLIX_STATS
tcp_seq startseq = tp->snd_nxt;
-#endif
 
/*
 * Advance snd_nxt over sequence space of this segment.
@@ -8527,6 +8525,17 @@ out:
tp->t_acktime = ticks;
}
tp->snd_max = tp->snd_nxt;
+   /*
+* Time this transmission if not a retransmission and
+* not currently timing anything.
+* This is only relevant in case of switching back to
+* the base stack.
+*/
+   if (tp->t_rtttime == 0) {
+   tp->t_rtttime = ticks;
+   tp->t_rtseq = startseq;
+   TCPSTAT_INC(tcps_segstimed);
+   }
 #ifdef NETFLIX_STATS
if (!(tp->t_flags & TF_GPUTINPROG) && len) {
tp->t_flags |= TF_GPUTINPROG;
___
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: r341498 - in stable/12/sys/netinet: . tcp_stacks

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:10:09 2018
New Revision: 341498
URL: https://svnweb.freebsd.org/changeset/base/341498

Log:
  MFC r340774:
  
  Ensure that TCP RST-segments announce consistently a receiver window of
  zero. This was already done when sending them via tcp_respond().
  
  Reviewed by:  rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D17949

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

Modified: stable/12/sys/netinet/tcp_output.c
==
--- stable/12/sys/netinet/tcp_output.c  Tue Dec  4 22:05:36 2018
(r341497)
+++ stable/12/sys/netinet/tcp_output.c  Tue Dec  4 22:10:09 2018
(r341498)
@@ -1171,14 +1171,18 @@ send:
/*
 * Calculate receive window.  Don't shrink window,
 * but avoid silly window syndrome.
+* If a RST segment is sent, advertise a window of zero.
 */
-   if (recwin < (so->so_rcv.sb_hiwat / 4) &&
-   recwin < tp->t_maxseg)
+   if (flags & TH_RST) {
recwin = 0;
-   if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) &&
-   recwin < (tp->rcv_adv - tp->rcv_nxt))
-   recwin = (tp->rcv_adv - tp->rcv_nxt);
-
+   } else {
+   if (recwin < (so->so_rcv.sb_hiwat / 4) &&
+   recwin < tp->t_maxseg)
+   recwin = 0;
+   if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) &&
+   recwin < (tp->rcv_adv - tp->rcv_nxt))
+   recwin = (tp->rcv_adv - tp->rcv_nxt);
+   }
/*
 * According to RFC1323 the window field in a SYN (i.e., a 
 * or ) segment itself is never scaled.  The 

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==
--- stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:05:36 2018
(r341497)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:10:09 2018
(r341498)
@@ -8189,15 +8189,20 @@ send:
/*
 * Calculate receive window.  Don't shrink window, but avoid silly
 * window syndrome.
+* If a RST segment is sent, advertise a window of zero.
 */
-   if (recwin < (long)(so->so_rcv.sb_hiwat / 4) &&
-   recwin < (long)tp->t_maxseg)
+   if (flags & TH_RST) {
recwin = 0;
-   if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) &&
-   recwin < (long)(tp->rcv_adv - tp->rcv_nxt))
-   recwin = (long)(tp->rcv_adv - tp->rcv_nxt);
-   if (recwin > (long)TCP_MAXWIN << tp->rcv_scale)
-   recwin = (long)TCP_MAXWIN << tp->rcv_scale;
+   } else {
+   if (recwin < (long)(so->so_rcv.sb_hiwat / 4) &&
+   recwin < (long)tp->t_maxseg)
+   recwin = 0;
+   if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) &&
+   recwin < (long)(tp->rcv_adv - tp->rcv_nxt))
+   recwin = (long)(tp->rcv_adv - tp->rcv_nxt);
+   if (recwin > (long)TCP_MAXWIN << tp->rcv_scale)
+   recwin = (long)TCP_MAXWIN << tp->rcv_scale;
+   }
 
/*
 * According to RFC1323 the window field in a SYN (i.e., a  or
___
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: r341497 - stable/12/sys/netinet/tcp_stacks

2018-12-04 Thread Michael Tuexen
Author: tuexen
Date: Tue Dec  4 22:05:36 2018
New Revision: 341497
URL: https://svnweb.freebsd.org/changeset/base/341497

Log:
  MFC r340738:
  
  Improve two KASSERTs in the TCP RACK stack.
  
  There are two locations where an always true comparison was made in
  a KASSERT. Replace this by an appropriate check and use a consistent
  panic message. Also use this code when checking a similar condition.
  
  PR:   229664
  Reviewed by:  rrs@
  MFC after:1 week
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18021

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

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==
--- stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 21:57:26 2018
(r341496)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Tue Dec  4 22:05:36 2018
(r341497)
@@ -7053,12 +7053,10 @@ again:
tlen = rsm->r_end - rsm->r_start;
if (tlen > tp->t_maxseg)
tlen = tp->t_maxseg;
-#ifdef INVARIANTS
-   if (SEQ_GT(tp->snd_una, rsm->r_start)) {
-   panic("tp:%p rack:%p snd_una:%u rsm:%p r_start:%u",
-   tp, rack, tp->snd_una, rsm, rsm->r_start);
-   }
-#endif
+   KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start),
+   ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p",
+   __func__, __LINE__,
+   rsm->r_start, tp->snd_una, tp, rack, rsm));
sb_offset = rsm->r_start - tp->snd_una;
cwin = min(tp->snd_wnd, tlen);
len = cwin;
@@ -7069,12 +7067,14 @@ again:
len = rsm->r_end - rsm->r_start;
sack_rxmit = 1;
sendalot = 0;
+   KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start),
+   ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p",
+   __func__, __LINE__,
+   rsm->r_start, tp->snd_una, tp, rack, rsm));
sb_offset = rsm->r_start - tp->snd_una;
if (len >= tp->t_maxseg) {
len = tp->t_maxseg;
}
-   KASSERT(sb_offset >= 0, ("%s: sack block to the left of una : 
%d",
-   __func__, sb_offset));
} else if ((rack->rc_in_persist == 0) &&
((rsm = tcp_rack_output(tp, rack, cts)) != NULL)) {
long tlen;
@@ -7099,6 +7099,10 @@ again:
}
 #endif
tlen = rsm->r_end - rsm->r_start;
+   KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start),
+   ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p",
+   __func__, __LINE__,
+   rsm->r_start, tp->snd_una, tp, rack, rsm));
sb_offset = rsm->r_start - tp->snd_una;
if (tlen > rack->r_ctl.rc_prr_sndcnt) {
len = rack->r_ctl.rc_prr_sndcnt;
@@ -7120,8 +7124,6 @@ again:
goto just_return_nolock;
}
}
-   KASSERT(sb_offset >= 0, ("%s: sack block to the left of una : 
%d",
-   __func__, sb_offset));
if (len > 0) {
sub_from_prr = 1;
sack_rxmit = 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: r341496 - head/sys/sys

2018-12-04 Thread Brooks Davis
Author: brooks
Date: Tue Dec  4 21:57:26 2018
New Revision: 341496
URL: https://svnweb.freebsd.org/changeset/base/341496

Log:
  Regen after r341495: Remove NOARGS from oaccept.

Modified:
  head/sys/sys/sysproto.h

Modified: head/sys/sys/sysproto.h
==
--- head/sys/sys/sysproto.h Tue Dec  4 21:56:45 2018(r341495)
+++ head/sys/sys/sysproto.h Tue Dec  4 21:57:26 2018(r341496)
@@ -2205,6 +2205,11 @@ struct osethostname_args {
char hostname_l_[PADL_(char *)]; char * hostname; char 
hostname_r_[PADR_(char *)];
char len_l_[PADL_(u_int)]; u_int len; char len_r_[PADR_(u_int)];
 };
+struct oaccept_args {
+   char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
+   char name_l_[PADL_(struct sockaddr *)]; struct sockaddr * name; char 
name_r_[PADR_(struct sockaddr *)];
+   char anamelen_l_[PADL_(int *)]; int * anamelen; char 
anamelen_r_[PADR_(int *)];
+};
 struct osend_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
char buf_l_[PADL_(const void *)]; const void * buf; char 
buf_r_[PADR_(const void *)];
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341495 - head/sys/kern

2018-12-04 Thread Brooks Davis
Author: brooks
Date: Tue Dec  4 21:56:45 2018
New Revision: 341495
URL: https://svnweb.freebsd.org/changeset/base/341495

Log:
  Remove NOARGS from oaccept.
  
  This was in the orignal patch, but lost in a rebase.
  
  Reported by:  andrew
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D15816

Modified:
  head/sys/kern/syscalls.master

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Tue Dec  4 21:48:56 2018
(r341494)
+++ head/sys/kern/syscalls.master   Tue Dec  4 21:56:45 2018
(r341495)
@@ -632,7 +632,7 @@
int namelen
);
}
-99 AUE_ACCEPT  COMPAT|NOARGS {
+99 AUE_ACCEPT  COMPAT {
int accept(
int s,
_Out_writes_bytes_opt_(*anamelen) struct sockaddr *name,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341494 - head/sys/geom

2018-12-04 Thread Maxim Sobolev
Author: sobomax
Date: Tue Dec  4 21:48:56 2018
New Revision: 341494
URL: https://svnweb.freebsd.org/changeset/base/341494

Log:
  Another attempt to fix issue with the DIOCGDELETE ioctl(2) not
  handling slightly out-of-bound requests properly (r340187).
  Perform range check here rather then rely on g_delete_data() to DTRT.
  
  The g_delete_data() would always return success for requests
  starting just the next byte after providers media boundary.
  
  MFC after:4 weeks

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==
--- head/sys/geom/geom_dev.cTue Dec  4 20:40:28 2018(r341493)
+++ head/sys/geom/geom_dev.cTue Dec  4 21:48:56 2018(r341494)
@@ -583,6 +583,20 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data
error = EINVAL;
break;
}
+   if ((cp->provider->mediasize > 0) &&
+   (offset >= cp->provider->mediasize)) {
+   /*
+* Catch out-of-bounds requests here. The problem is
+* that due to historical GEOM I/O implementation
+* peculatities, g_delete_data() would always return
+* success for requests starting just the next byte
+* after providers media boundary. Condition check on
+* non-zero media size, since that condition would
+* (most likely) cause ENXIO instead.
+*/
+   error = EIO;
+   break;
+   }
while (length > 0) {
chunk = length;
if (g_dev_del_max_sectors != 0 && chunk >
___
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: r341464 - head/sbin/savecore

2018-12-04 Thread Renato Botelho
On 04/12/18 17:59, Ed Maste wrote:
> On Tue, 4 Dec 2018 at 07:34, Renato Botelho  wrote:
>>
>> Author: garga (ports committer)
>> Date: Tue Dec  4 12:34:22 2018
>> New Revision: 341464
>> URL: https://svnweb.freebsd.org/changeset/base/341464
>>
>> Log:
>>   Restore /var/crash permissions to 0750, as declared in mtree file. After
>>   r337337 it changed to 0755.
>>
>>   Reviewed by:  loos
>>   Approved by:  loos
>>   MFC after:3 days
>>   Sponsored by: Rubicon Communications, LLC (Netgate)
>>   Differential Revision:https://reviews.freebsd.org/D18355
> 
> Please insta-MFC this to stable/12 (while folks sort out the 12.0 question).

Done in r341493

-- 
Renato Botelho
___
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: r341493 - stable/12/sbin/savecore

2018-12-04 Thread Renato Botelho
Author: garga (ports committer)
Date: Tue Dec  4 20:40:28 2018
New Revision: 341493
URL: https://svnweb.freebsd.org/changeset/base/341493

Log:
  MFC r341464:
  
  Restore /var/crash permissions to 0750, as declared in mtree file. After
  r337337 it changed to 0755.
  
  Reviewed by:  loos
  Approved by:  loos
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D18355

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

Modified: stable/12/sbin/savecore/Makefile
==
--- stable/12/sbin/savecore/MakefileTue Dec  4 19:55:39 2018
(r341492)
+++ stable/12/sbin/savecore/MakefileTue Dec  4 20:40:28 2018
(r341493)
@@ -2,7 +2,9 @@
 
 PACKAGE=runtime
 CONFS= minfree
-CONFSDIR=  /var/crash
+VAR_CRASH= /var/crash
+VAR_CRASH_MODE=0750
+CONFSDIR=  VAR_CRASH
 PROG=  savecore
 LIBADD=z xo
 MAN=   savecore.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"


Re: svn commit: r341464 - head/sbin/savecore

2018-12-04 Thread Renato Botelho
On 04/12/18 17:59, Ed Maste wrote:
> On Tue, 4 Dec 2018 at 07:34, Renato Botelho  wrote:
>>
>> Author: garga (ports committer)
>> Date: Tue Dec  4 12:34:22 2018
>> New Revision: 341464
>> URL: https://svnweb.freebsd.org/changeset/base/341464
>>
>> Log:
>>   Restore /var/crash permissions to 0750, as declared in mtree file. After
>>   r337337 it changed to 0755.
>>
>>   Reviewed by:  loos
>>   Approved by:  loos
>>   MFC after:3 days
>>   Sponsored by: Rubicon Communications, LLC (Netgate)
>>   Differential Revision:https://reviews.freebsd.org/D18355
> 
> Please insta-MFC this to stable/12 (while folks sort out the 12.0 question).

Sure. I'll just do it.

-- 
Renato Botelho
___
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: r341492 - stable/11/release/doc/share/xml

2018-12-04 Thread Glen Barber
Author: gjb
Date: Tue Dec  4 19:55:39 2018
New Revision: 341492
URL: https://svnweb.freebsd.org/changeset/base/341492

Log:
  Document SA-18:14.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/release/doc/share/xml/security.xml

Modified: stable/11/release/doc/share/xml/security.xml
==
--- stable/11/release/doc/share/xml/security.xmlTue Dec  4 19:07:10 
2018(r341491)
+++ stable/11/release/doc/share/xml/security.xmlTue Dec  4 19:55:39 
2018(r341492)
@@ -63,6 +63,13 @@
27November2018
Multiple vulnerabilities
   
+
+  
+   FreeBSD-SA-18:14.bhyve
+   4December2018
+   Insufficient bounds checking
+  
 
   
 
___
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: r341464 - head/sbin/savecore

2018-12-04 Thread Ed Maste
On Tue, 4 Dec 2018 at 07:34, Renato Botelho  wrote:
>
> Author: garga (ports committer)
> Date: Tue Dec  4 12:34:22 2018
> New Revision: 341464
> URL: https://svnweb.freebsd.org/changeset/base/341464
>
> Log:
>   Restore /var/crash permissions to 0750, as declared in mtree file. After
>   r337337 it changed to 0755.
>
>   Reviewed by:  loos
>   Approved by:  loos
>   MFC after:3 days
>   Sponsored by: Rubicon Communications, LLC (Netgate)
>   Differential Revision:https://reviews.freebsd.org/D18355

Please insta-MFC this to stable/12 (while folks sort out the 12.0 question).
___
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: r341491 - in stable/11/sys: amd64/amd64 amd64/ia32 arm/arm fs/procfs i386/i386 kern sparc64/sparc64

2018-12-04 Thread Mark Johnston
Author: markj
Date: Tue Dec  4 19:07:10 2018
New Revision: 341491
URL: https://svnweb.freebsd.org/changeset/base/341491

Log:
  MFC r341442, r341443:
  Plug memory disclosures via ptrace(2).

Modified:
  stable/11/sys/amd64/amd64/machdep.c
  stable/11/sys/amd64/ia32/ia32_reg.c
  stable/11/sys/arm/arm/machdep_kdb.c
  stable/11/sys/fs/procfs/procfs_dbregs.c
  stable/11/sys/fs/procfs/procfs_fpregs.c
  stable/11/sys/fs/procfs/procfs_regs.c
  stable/11/sys/i386/i386/machdep.c
  stable/11/sys/kern/sys_process.c
  stable/11/sys/sparc64/sparc64/machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/machdep.c
==
--- stable/11/sys/amd64/amd64/machdep.c Tue Dec  4 19:06:11 2018
(r341490)
+++ stable/11/sys/amd64/amd64/machdep.c Tue Dec  4 19:07:10 2018
(r341491)
@@ -2025,6 +2025,7 @@ fill_regs(struct thread *td, struct reg *regs)
 int
 fill_frame_regs(struct trapframe *tp, struct reg *regs)
 {
+
regs->r_r15 = tp->tf_r15;
regs->r_r14 = tp->tf_r14;
regs->r_r13 = tp->tf_r13;
@@ -2056,6 +2057,8 @@ fill_frame_regs(struct trapframe *tp, struct reg *regs
regs->r_fs = 0;
regs->r_gs = 0;
}
+   regs->r_err = 0;
+   regs->r_trapno = 0;
return (0);
 }
 

Modified: stable/11/sys/amd64/ia32/ia32_reg.c
==
--- stable/11/sys/amd64/ia32/ia32_reg.c Tue Dec  4 19:06:11 2018
(r341490)
+++ stable/11/sys/amd64/ia32/ia32_reg.c Tue Dec  4 19:07:10 2018
(r341491)
@@ -105,6 +105,8 @@ fill_regs32(struct thread *td, struct reg32 *regs)
regs->r_eflags = tp->tf_rflags;
regs->r_esp = tp->tf_rsp;
regs->r_ss = tp->tf_ss;
+   regs->r_err = 0;
+   regs->r_trapno = 0;
return (0);
 }
 

Modified: stable/11/sys/arm/arm/machdep_kdb.c
==
--- stable/11/sys/arm/arm/machdep_kdb.c Tue Dec  4 19:06:11 2018
(r341490)
+++ stable/11/sys/arm/arm/machdep_kdb.c Tue Dec  4 19:07:10 2018
(r341491)
@@ -104,6 +104,7 @@ fill_regs(struct thread *td, struct reg *regs)
regs->r_cpsr = tf->tf_spsr;
return (0);
 }
+
 int
 fill_fpregs(struct thread *td, struct fpreg *regs)
 {
@@ -134,8 +135,11 @@ set_fpregs(struct thread *td, struct fpreg *regs)
 int
 fill_dbregs(struct thread *td, struct dbreg *regs)
 {
+
+   bzero(regs, sizeof(*regs));
return (0);
 }
+
 int
 set_dbregs(struct thread *td, struct dbreg *regs)
 {

Modified: stable/11/sys/fs/procfs/procfs_dbregs.c
==
--- stable/11/sys/fs/procfs/procfs_dbregs.c Tue Dec  4 19:06:11 2018
(r341490)
+++ stable/11/sys/fs/procfs/procfs_dbregs.c Tue Dec  4 19:07:10 2018
(r341491)
@@ -112,8 +112,10 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
return (EINVAL);
}
wrap32 = 1;
-   }
+   memset(, 0, sizeof(r32));
+   } else
 #endif
+   memset(, 0, sizeof(r));
error = PROC(read, dbregs, td2, );
if (error == 0) {
PROC_UNLOCK(p);

Modified: stable/11/sys/fs/procfs/procfs_fpregs.c
==
--- stable/11/sys/fs/procfs/procfs_fpregs.c Tue Dec  4 19:06:11 2018
(r341490)
+++ stable/11/sys/fs/procfs/procfs_fpregs.c Tue Dec  4 19:07:10 2018
(r341491)
@@ -102,7 +102,6 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
return (EBUSY);
}
 
-   /* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
 #ifdef COMPAT_FREEBSD32
if (SV_CURPROC_FLAG(SV_ILP32)) {
@@ -111,8 +110,10 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
return (EINVAL);
}
wrap32 = 1;
-   }
+   memset(, 0, sizeof(r32));
+   } else
 #endif
+   memset(, 0, sizeof(r));
error = PROC(read, fpregs, td2, );
if (error == 0) {
PROC_UNLOCK(p);

Modified: stable/11/sys/fs/procfs/procfs_regs.c
==
--- stable/11/sys/fs/procfs/procfs_regs.c   Tue Dec  4 19:06:11 2018
(r341490)
+++ stable/11/sys/fs/procfs/procfs_regs.c   Tue Dec  4 19:07:10 2018
(r341491)
@@ -102,7 +102,6 @@ procfs_doprocregs(PFS_FILL_ARGS)
return (EBUSY);
}
 
-   /* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
 #ifdef COMPAT_FREEBSD32
if (SV_CURPROC_FLAG(SV_ILP32)) {
@@ -111,8 +110,10 @@ procfs_doprocregs(PFS_FILL_ARGS)
return (EINVAL);
}
wrap32 = 1;
-   }
+   memset(, 0, sizeof(r32));
+   } else
 #endif
+   memset(, 0, 

svn commit: r341490 - in stable/12/sys: amd64/amd64 amd64/ia32 arm/arm fs/procfs i386/i386 kern sparc64/sparc64

2018-12-04 Thread Mark Johnston
Author: markj
Date: Tue Dec  4 19:06:11 2018
New Revision: 341490
URL: https://svnweb.freebsd.org/changeset/base/341490

Log:
  MFC r341442, r341443:
  Plug memory disclosures via ptrace(2).

Modified:
  stable/12/sys/amd64/amd64/machdep.c
  stable/12/sys/amd64/ia32/ia32_reg.c
  stable/12/sys/arm/arm/machdep_kdb.c
  stable/12/sys/fs/procfs/procfs_dbregs.c
  stable/12/sys/fs/procfs/procfs_fpregs.c
  stable/12/sys/fs/procfs/procfs_regs.c
  stable/12/sys/i386/i386/machdep.c
  stable/12/sys/kern/sys_process.c
  stable/12/sys/sparc64/sparc64/machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/machdep.c
==
--- stable/12/sys/amd64/amd64/machdep.c Tue Dec  4 18:51:28 2018
(r341489)
+++ stable/12/sys/amd64/amd64/machdep.c Tue Dec  4 19:06:11 2018
(r341490)
@@ -2046,6 +2046,7 @@ fill_regs(struct thread *td, struct reg *regs)
 int
 fill_frame_regs(struct trapframe *tp, struct reg *regs)
 {
+
regs->r_r15 = tp->tf_r15;
regs->r_r14 = tp->tf_r14;
regs->r_r13 = tp->tf_r13;
@@ -2077,6 +2078,8 @@ fill_frame_regs(struct trapframe *tp, struct reg *regs
regs->r_fs = 0;
regs->r_gs = 0;
}
+   regs->r_err = 0;
+   regs->r_trapno = 0;
return (0);
 }
 

Modified: stable/12/sys/amd64/ia32/ia32_reg.c
==
--- stable/12/sys/amd64/ia32/ia32_reg.c Tue Dec  4 18:51:28 2018
(r341489)
+++ stable/12/sys/amd64/ia32/ia32_reg.c Tue Dec  4 19:06:11 2018
(r341490)
@@ -105,6 +105,8 @@ fill_regs32(struct thread *td, struct reg32 *regs)
regs->r_eflags = tp->tf_rflags;
regs->r_esp = tp->tf_rsp;
regs->r_ss = tp->tf_ss;
+   regs->r_err = 0;
+   regs->r_trapno = 0;
return (0);
 }
 

Modified: stable/12/sys/arm/arm/machdep_kdb.c
==
--- stable/12/sys/arm/arm/machdep_kdb.c Tue Dec  4 18:51:28 2018
(r341489)
+++ stable/12/sys/arm/arm/machdep_kdb.c Tue Dec  4 19:06:11 2018
(r341490)
@@ -104,6 +104,7 @@ fill_regs(struct thread *td, struct reg *regs)
regs->r_cpsr = tf->tf_spsr;
return (0);
 }
+
 int
 fill_fpregs(struct thread *td, struct fpreg *regs)
 {
@@ -134,8 +135,11 @@ set_fpregs(struct thread *td, struct fpreg *regs)
 int
 fill_dbregs(struct thread *td, struct dbreg *regs)
 {
+
+   bzero(regs, sizeof(*regs));
return (0);
 }
+
 int
 set_dbregs(struct thread *td, struct dbreg *regs)
 {

Modified: stable/12/sys/fs/procfs/procfs_dbregs.c
==
--- stable/12/sys/fs/procfs/procfs_dbregs.c Tue Dec  4 18:51:28 2018
(r341489)
+++ stable/12/sys/fs/procfs/procfs_dbregs.c Tue Dec  4 19:06:11 2018
(r341490)
@@ -112,8 +112,10 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
return (EINVAL);
}
wrap32 = 1;
-   }
+   memset(, 0, sizeof(r32));
+   } else
 #endif
+   memset(, 0, sizeof(r));
error = PROC(read, dbregs, td2, );
if (error == 0) {
PROC_UNLOCK(p);

Modified: stable/12/sys/fs/procfs/procfs_fpregs.c
==
--- stable/12/sys/fs/procfs/procfs_fpregs.c Tue Dec  4 18:51:28 2018
(r341489)
+++ stable/12/sys/fs/procfs/procfs_fpregs.c Tue Dec  4 19:06:11 2018
(r341490)
@@ -102,7 +102,6 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
return (EBUSY);
}
 
-   /* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
 #ifdef COMPAT_FREEBSD32
if (SV_CURPROC_FLAG(SV_ILP32)) {
@@ -111,8 +110,10 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
return (EINVAL);
}
wrap32 = 1;
-   }
+   memset(, 0, sizeof(r32));
+   } else
 #endif
+   memset(, 0, sizeof(r));
error = PROC(read, fpregs, td2, );
if (error == 0) {
PROC_UNLOCK(p);

Modified: stable/12/sys/fs/procfs/procfs_regs.c
==
--- stable/12/sys/fs/procfs/procfs_regs.c   Tue Dec  4 18:51:28 2018
(r341489)
+++ stable/12/sys/fs/procfs/procfs_regs.c   Tue Dec  4 19:06:11 2018
(r341490)
@@ -102,7 +102,6 @@ procfs_doprocregs(PFS_FILL_ARGS)
return (EBUSY);
}
 
-   /* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
 #ifdef COMPAT_FREEBSD32
if (SV_CURPROC_FLAG(SV_ILP32)) {
@@ -111,8 +110,10 @@ procfs_doprocregs(PFS_FILL_ARGS)
return (EINVAL);
}
wrap32 = 1;
-   }
+   memset(, 0, sizeof(r32));
+   } else
 #endif
+   memset(, 0, 

Re: svn commit: r341464 - head/sbin/savecore

2018-12-04 Thread Warner Losh
On Tue, Dec 4, 2018 at 11:14 AM Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> > On Tue, Dec 4, 2018 at 9:28 AM Rodney W. Grimes
> > >
> > > > Author: garga (ports committer)
> > > > Date: Tue Dec  4 12:34:22 2018
> > > > New Revision: 341464
> > > > URL: https://svnweb.freebsd.org/changeset/base/341464
> > > >
> > > > Log:
> > > >   Restore /var/crash permissions to 0750, as declared in mtree file.
> After
> > > >   r337337 it changed to 0755.
> > > >
> > > >   Reviewed by:loos
> > > >   Approved by:loos
> > > >   MFC after:  3 days
> > > >   Sponsored by:   Rubicon Communications, LLC (Netgate)
> > > >   Differential Revision:  https://reviews.freebsd.org/D18355
> > >
> > > This probably warrants an EN against 12.0 release.
> >
> > Can we just fix it before 12.0-RELEASE builds starts?  It would be
> > much more robust compared to delivering a "fixit" script though
> > freebsd-update...
>
> Thats Glens call, but normal procedure is 0 change between
> last RC and release.
>

Let's not be too pedantic here: This is a security issue and let's not let
our process get in the way of fixing a simple security issue.

Warner


> (Bcc:'ed to gjb@, and trimmed a bit)
>
> Rod
> > > > +++ head/sbin/savecore/Makefile   Tue Dec  4 12:34:22 2018
>   (r341464)
> > > > @@ -2,7 +2,9 @@
> > > >
> > > >  PACKAGE=runtime
> > > >  CONFS=   minfree
> > > > -CONFSDIR=/var/crash
> > > > +VAR_CRASH=   /var/crash
> > > > +VAR_CRASH_MODE=  0750
> > > > +CONFSDIR=VAR_CRASH
> > > >  PROG=savecore
> > > >  LIBADD=  z xo
> > > >  MAN= savecore.8
> --
> Rod Grimes
> rgri...@freebsd.org
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341489 - head

2018-12-04 Thread Andrew Turner
Author: andrew
Date: Tue Dec  4 18:51:28 2018
New Revision: 341489
URL: https://svnweb.freebsd.org/changeset/base/341489

Log:
  Only gnu/lib/csu when MK_BSD_CRTBEGIN is off.
  
  We were still building it from Makefile.inc1. Disable it there so we don't
  try to build the GNU crtbegin/crtend when the BSD version was asked for.
  
  PR:   233733
  Reported by:  lwhsu
  Reviewed by:  emaste
  MFC with: r339738
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D18428

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Dec  4 18:38:32 2018(r341488)
+++ head/Makefile.inc1  Tue Dec  4 18:51:28 2018(r341489)
@@ -2689,8 +2689,10 @@ _prereq_libs+= gnu/lib/libssp/libssp_nonshared
 # gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
 # all shared libraries for ELF.
 #
-_startup_libs= gnu/lib/csu
-_startup_libs+=lib/csu
+_startup_libs= lib/csu
+.if ${MK_BSD_CRTBEGIN} == "no"
+_startup_libs+=gnu/lib/csu
+.endif
 _startup_libs+=lib/libcompiler_rt
 _startup_libs+=lib/libc
 _startup_libs+=lib/libc_nonshared
___
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: r341446 - head/release/amd64

2018-12-04 Thread Ed Maste
On Tue, 4 Dec 2018 at 03:38, Oliver Pinter
 wrote:
>
> No problem. Ed was directly CCd and notified on IRC.

Sorry for losing track of this one.

(If there's anything else that you expect I'm looking at but haven't
seen an update in a while please feel free to ping me.)
___
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: r341487 - releng/12.0/usr.sbin/bhyve

2018-12-04 Thread Gordon Tetlow
Author: gordon
Date: Tue Dec  4 18:38:03 2018
New Revision: 341487
URL: https://svnweb.freebsd.org/changeset/base/341487

Log:
  Fix insufficient bounds checking in bhyve(8) device model. [SA-18:14.bhyve]
  
  Submitted by: jhb
  Reported by:  Reno Robert
  Approved by:  so
  Approved by:  re (implicit)
  Security: FreeBSD-SA-18:14.bhyve
  Security: CVE-2018-17160

Modified:
  releng/12.0/usr.sbin/bhyve/fwctl.c

Modified: releng/12.0/usr.sbin/bhyve/fwctl.c
==
--- releng/12.0/usr.sbin/bhyve/fwctl.c  Tue Dec  4 18:32:50 2018
(r341486)
+++ releng/12.0/usr.sbin/bhyve/fwctl.c  Tue Dec  4 18:38:03 2018
(r341487)
@@ -79,8 +79,8 @@ static u_int ident_idx;
 
 struct op_info {
int op;
-   int  (*op_start)(int len);
-   void (*op_data)(uint32_t data, int len);
+   int  (*op_start)(uint32_t len);
+   void (*op_data)(uint32_t data, uint32_t len);
int  (*op_result)(struct iovec **data);
void (*op_done)(struct iovec *data);
 };
@@ -119,7 +119,7 @@ errop_set(int err)
 }
 
 static int
-errop_start(int len)
+errop_start(uint32_t len)
 {
errop_code = ENOENT;
 
@@ -128,7 +128,7 @@ errop_start(int len)
 }
 
 static void
-errop_data(uint32_t data, int len)
+errop_data(uint32_t data, uint32_t len)
 {
 
/* ignore */
@@ -188,7 +188,7 @@ static int fget_cnt;
 static size_t fget_size;
 
 static int
-fget_start(int len)
+fget_start(uint32_t len)
 {
 
if (len > FGET_STRSZ)
@@ -200,7 +200,7 @@ fget_start(int len)
 }
 
 static void
-fget_data(uint32_t data, int len)
+fget_data(uint32_t data, uint32_t len)
 {
 
*((uint32_t *) _str[fget_cnt]) = data;
@@ -285,8 +285,8 @@ static struct req_info {
struct op_info *req_op;
int  resp_error;
int  resp_count;
-   int  resp_size;
-   int  resp_off;
+   size_t   resp_size;
+   size_t   resp_off;
struct iovec *resp_biov;
 } rinfo;
 
@@ -346,13 +346,14 @@ fwctl_request_start(void)
 static int
 fwctl_request_data(uint32_t value)
 {
-   int remlen;
 
/* Make sure remaining size is >= 0 */
-   rinfo.req_size -= sizeof(uint32_t);
-   remlen = MAX(rinfo.req_size, 0);
+   if (rinfo.req_size <= sizeof(uint32_t))
+   rinfo.req_size = 0;
+   else
+   rinfo.req_size -= sizeof(uint32_t);
 
-   (*rinfo.req_op->op_data)(value, remlen);
+   (*rinfo.req_op->op_data)(value, rinfo.req_size);
 
if (rinfo.req_size < sizeof(uint32_t)) {
fwctl_request_done();
@@ -401,7 +402,7 @@ static int
 fwctl_response(uint32_t *retval)
 {
uint32_t *dp;
-   int remlen;
+   ssize_t remlen;
 
switch(rinfo.resp_count) {
case 0:
@@ -436,7 +437,7 @@ fwctl_response(uint32_t *retval)
}
 
if (rinfo.resp_count > 3 &&
-   rinfo.resp_size - rinfo.resp_off <= 0) {
+   rinfo.resp_off >= rinfo.resp_size) {
fwctl_response_done();
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: r341488 - in releng/11.2: . sys/conf usr.sbin/bhyve

2018-12-04 Thread Gordon Tetlow
Author: gordon
Date: Tue Dec  4 18:38:32 2018
New Revision: 341488
URL: https://svnweb.freebsd.org/changeset/base/341488

Log:
  Fix insufficient bounds checking in bhyve(8) device model. [SA-18:14.bhyve]
  
  Submitted by:   jhb
  Reported by:Reno Robert
  Approved by:so
  Security:   FreeBSD-SA-18:14.bhyve
  Security:   CVE-2018-17160

Modified:
  releng/11.2/UPDATING
  releng/11.2/sys/conf/newvers.sh
  releng/11.2/usr.sbin/bhyve/fwctl.c

Modified: releng/11.2/UPDATING
==
--- releng/11.2/UPDATINGTue Dec  4 18:38:03 2018(r341487)
+++ releng/11.2/UPDATINGTue Dec  4 18:38:32 2018(r341488)
@@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20181204   p6  FreeBSD-SA-18:14.bhyve
+
+   Fix insufficient bounds checking in bhyve(8) device model.
+   [SA-18:14.bhyve]
+
 20181127   p5  FreeBSD-SA-18:13.nfs
FreeBSD-EN-18:13.icmp
FreeBSD-EN-18:14.tzdata

Modified: releng/11.2/sys/conf/newvers.sh
==
--- releng/11.2/sys/conf/newvers.sh Tue Dec  4 18:38:03 2018
(r341487)
+++ releng/11.2/sys/conf/newvers.sh Tue Dec  4 18:38:32 2018
(r341488)
@@ -44,7 +44,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.2"
-BRANCH="RELEASE-p5"
+BRANCH="RELEASE-p6"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/11.2/usr.sbin/bhyve/fwctl.c
==
--- releng/11.2/usr.sbin/bhyve/fwctl.c  Tue Dec  4 18:38:03 2018
(r341487)
+++ releng/11.2/usr.sbin/bhyve/fwctl.c  Tue Dec  4 18:38:32 2018
(r341488)
@@ -77,8 +77,8 @@ static u_int ident_idx;
 
 struct op_info {
int op;
-   int  (*op_start)(int len);
-   void (*op_data)(uint32_t data, int len);
+   int  (*op_start)(uint32_t len);
+   void (*op_data)(uint32_t data, uint32_t len);
int  (*op_result)(struct iovec **data);
void (*op_done)(struct iovec *data);
 };
@@ -117,7 +117,7 @@ errop_set(int err)
 }
 
 static int
-errop_start(int len)
+errop_start(uint32_t len)
 {
errop_code = ENOENT;
 
@@ -126,7 +126,7 @@ errop_start(int len)
 }
 
 static void
-errop_data(uint32_t data, int len)
+errop_data(uint32_t data, uint32_t len)
 {
 
/* ignore */
@@ -186,7 +186,7 @@ static int fget_cnt;
 static size_t fget_size;
 
 static int
-fget_start(int len)
+fget_start(uint32_t len)
 {
 
if (len > FGET_STRSZ)
@@ -198,7 +198,7 @@ fget_start(int len)
 }
 
 static void
-fget_data(uint32_t data, int len)
+fget_data(uint32_t data, uint32_t len)
 {
 
*((uint32_t *) _str[fget_cnt]) = data;
@@ -283,8 +283,8 @@ static struct req_info {
struct op_info *req_op;
int  resp_error;
int  resp_count;
-   int  resp_size;
-   int  resp_off;
+   size_t   resp_size;
+   size_t   resp_off;
struct iovec *resp_biov;
 } rinfo;
 
@@ -344,13 +344,14 @@ fwctl_request_start(void)
 static int
 fwctl_request_data(uint32_t value)
 {
-   int remlen;
 
/* Make sure remaining size is >= 0 */
-   rinfo.req_size -= sizeof(uint32_t);
-   remlen = MAX(rinfo.req_size, 0);
+   if (rinfo.req_size <= sizeof(uint32_t))
+   rinfo.req_size = 0;
+   else
+   rinfo.req_size -= sizeof(uint32_t);
 
-   (*rinfo.req_op->op_data)(value, remlen);
+   (*rinfo.req_op->op_data)(value, rinfo.req_size);
 
if (rinfo.req_size < sizeof(uint32_t)) {
fwctl_request_done();
@@ -399,7 +400,7 @@ static int
 fwctl_response(uint32_t *retval)
 {
uint32_t *dp;
-   int remlen;
+   ssize_t remlen;
 
switch(rinfo.resp_count) {
case 0:
@@ -434,7 +435,7 @@ fwctl_response(uint32_t *retval)
}
 
if (rinfo.resp_count > 3 &&
-   rinfo.resp_size - rinfo.resp_off <= 0) {
+   rinfo.resp_off >= rinfo.resp_size) {
fwctl_response_done();
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: r341486 - stable/11/usr.sbin/bhyve

2018-12-04 Thread Gordon Tetlow
Author: gordon
Date: Tue Dec  4 18:32:50 2018
New Revision: 341486
URL: https://svnweb.freebsd.org/changeset/base/341486

Log:
  MFC r341484
  
  Always treat firmware request and response sizes as unsigned.
  
  This fixes an incomplete bounds check on the guest-supplied request
  size where a very large request size could be interpreted as a negative
  value and not be caught by the bounds check.
  
  Submitted by: jhb
  Reported by:  Reno Robert
  Approved by:  so
  Security: FreeBSD-SA-18:14.bhyve
  Security: CVE-2018-17160

Modified:
  stable/11/usr.sbin/bhyve/fwctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bhyve/fwctl.c
==
--- stable/11/usr.sbin/bhyve/fwctl.cTue Dec  4 18:31:21 2018
(r341485)
+++ stable/11/usr.sbin/bhyve/fwctl.cTue Dec  4 18:32:50 2018
(r341486)
@@ -79,8 +79,8 @@ static u_int ident_idx;
 
 struct op_info {
int op;
-   int  (*op_start)(int len);
-   void (*op_data)(uint32_t data, int len);
+   int  (*op_start)(uint32_t len);
+   void (*op_data)(uint32_t data, uint32_t len);
int  (*op_result)(struct iovec **data);
void (*op_done)(struct iovec *data);
 };
@@ -119,7 +119,7 @@ errop_set(int err)
 }
 
 static int
-errop_start(int len)
+errop_start(uint32_t len)
 {
errop_code = ENOENT;
 
@@ -128,7 +128,7 @@ errop_start(int len)
 }
 
 static void
-errop_data(uint32_t data, int len)
+errop_data(uint32_t data, uint32_t len)
 {
 
/* ignore */
@@ -188,7 +188,7 @@ static int fget_cnt;
 static size_t fget_size;
 
 static int
-fget_start(int len)
+fget_start(uint32_t len)
 {
 
if (len > FGET_STRSZ)
@@ -200,7 +200,7 @@ fget_start(int len)
 }
 
 static void
-fget_data(uint32_t data, int len)
+fget_data(uint32_t data, uint32_t len)
 {
 
*((uint32_t *) _str[fget_cnt]) = data;
@@ -285,8 +285,8 @@ static struct req_info {
struct op_info *req_op;
int  resp_error;
int  resp_count;
-   int  resp_size;
-   int  resp_off;
+   size_t   resp_size;
+   size_t   resp_off;
struct iovec *resp_biov;
 } rinfo;
 
@@ -346,13 +346,14 @@ fwctl_request_start(void)
 static int
 fwctl_request_data(uint32_t value)
 {
-   int remlen;
 
/* Make sure remaining size is >= 0 */
-   rinfo.req_size -= sizeof(uint32_t);
-   remlen = MAX(rinfo.req_size, 0);
+   if (rinfo.req_size <= sizeof(uint32_t))
+   rinfo.req_size = 0;
+   else
+   rinfo.req_size -= sizeof(uint32_t);
 
-   (*rinfo.req_op->op_data)(value, remlen);
+   (*rinfo.req_op->op_data)(value, rinfo.req_size);
 
if (rinfo.req_size < sizeof(uint32_t)) {
fwctl_request_done();
@@ -401,7 +402,7 @@ static int
 fwctl_response(uint32_t *retval)
 {
uint32_t *dp;
-   int remlen;
+   ssize_t remlen;
 
switch(rinfo.resp_count) {
case 0:
@@ -436,7 +437,7 @@ fwctl_response(uint32_t *retval)
}
 
if (rinfo.resp_count > 3 &&
-   rinfo.resp_size - rinfo.resp_off <= 0) {
+   rinfo.resp_off >= rinfo.resp_size) {
fwctl_response_done();
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: r341485 - stable/12/usr.sbin/bhyve

2018-12-04 Thread Gordon Tetlow
Author: gordon
Date: Tue Dec  4 18:31:21 2018
New Revision: 341485
URL: https://svnweb.freebsd.org/changeset/base/341485

Log:
  MFC r341484
  
  Always treat firmware request and response sizes as unsigned.
  
  This fixes an incomplete bounds check on the guest-supplied request
  size where a very large request size could be interpreted as a negative
  value and not be caught by the bounds check.
  
  Submitted by: jhb
  Reported by:  Reno Robert
  Approved by:  so
  Security: FreeBSD-SA-18:14.bhyve
  Security: CVE-2018-17160

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

Modified: stable/12/usr.sbin/bhyve/fwctl.c
==
--- stable/12/usr.sbin/bhyve/fwctl.cTue Dec  4 18:28:25 2018
(r341484)
+++ stable/12/usr.sbin/bhyve/fwctl.cTue Dec  4 18:31:21 2018
(r341485)
@@ -79,8 +79,8 @@ static u_int ident_idx;
 
 struct op_info {
int op;
-   int  (*op_start)(int len);
-   void (*op_data)(uint32_t data, int len);
+   int  (*op_start)(uint32_t len);
+   void (*op_data)(uint32_t data, uint32_t len);
int  (*op_result)(struct iovec **data);
void (*op_done)(struct iovec *data);
 };
@@ -119,7 +119,7 @@ errop_set(int err)
 }
 
 static int
-errop_start(int len)
+errop_start(uint32_t len)
 {
errop_code = ENOENT;
 
@@ -128,7 +128,7 @@ errop_start(int len)
 }
 
 static void
-errop_data(uint32_t data, int len)
+errop_data(uint32_t data, uint32_t len)
 {
 
/* ignore */
@@ -188,7 +188,7 @@ static int fget_cnt;
 static size_t fget_size;
 
 static int
-fget_start(int len)
+fget_start(uint32_t len)
 {
 
if (len > FGET_STRSZ)
@@ -200,7 +200,7 @@ fget_start(int len)
 }
 
 static void
-fget_data(uint32_t data, int len)
+fget_data(uint32_t data, uint32_t len)
 {
 
*((uint32_t *) _str[fget_cnt]) = data;
@@ -285,8 +285,8 @@ static struct req_info {
struct op_info *req_op;
int  resp_error;
int  resp_count;
-   int  resp_size;
-   int  resp_off;
+   size_t   resp_size;
+   size_t   resp_off;
struct iovec *resp_biov;
 } rinfo;
 
@@ -346,13 +346,14 @@ fwctl_request_start(void)
 static int
 fwctl_request_data(uint32_t value)
 {
-   int remlen;
 
/* Make sure remaining size is >= 0 */
-   rinfo.req_size -= sizeof(uint32_t);
-   remlen = MAX(rinfo.req_size, 0);
+   if (rinfo.req_size <= sizeof(uint32_t))
+   rinfo.req_size = 0;
+   else
+   rinfo.req_size -= sizeof(uint32_t);
 
-   (*rinfo.req_op->op_data)(value, remlen);
+   (*rinfo.req_op->op_data)(value, rinfo.req_size);
 
if (rinfo.req_size < sizeof(uint32_t)) {
fwctl_request_done();
@@ -401,7 +402,7 @@ static int
 fwctl_response(uint32_t *retval)
 {
uint32_t *dp;
-   int remlen;
+   ssize_t remlen;
 
switch(rinfo.resp_count) {
case 0:
@@ -436,7 +437,7 @@ fwctl_response(uint32_t *retval)
}
 
if (rinfo.resp_count > 3 &&
-   rinfo.resp_size - rinfo.resp_off <= 0) {
+   rinfo.resp_off >= rinfo.resp_size) {
fwctl_response_done();
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: r341484 - head/usr.sbin/bhyve

2018-12-04 Thread Gordon Tetlow
Author: gordon
Date: Tue Dec  4 18:28:25 2018
New Revision: 341484
URL: https://svnweb.freebsd.org/changeset/base/341484

Log:
  Always treat firmware request and response sizes as unsigned.
  
  This fixes an incomplete bounds check on the guest-supplied request
  size where a very large request size could be interpreted as a negative
  value and not be caught by the bounds check.
  
  Submitted by: jhb
  Reported by:  Reno Robert
  Approved by:  so
  Security: FreeBSD-SA-18:14.bhyve
  Security: CVE-2018-17160

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

Modified: head/usr.sbin/bhyve/fwctl.c
==
--- head/usr.sbin/bhyve/fwctl.c Tue Dec  4 17:57:01 2018(r341483)
+++ head/usr.sbin/bhyve/fwctl.c Tue Dec  4 18:28:25 2018(r341484)
@@ -79,8 +79,8 @@ static u_int ident_idx;
 
 struct op_info {
int op;
-   int  (*op_start)(int len);
-   void (*op_data)(uint32_t data, int len);
+   int  (*op_start)(uint32_t len);
+   void (*op_data)(uint32_t data, uint32_t len);
int  (*op_result)(struct iovec **data);
void (*op_done)(struct iovec *data);
 };
@@ -119,7 +119,7 @@ errop_set(int err)
 }
 
 static int
-errop_start(int len)
+errop_start(uint32_t len)
 {
errop_code = ENOENT;
 
@@ -128,7 +128,7 @@ errop_start(int len)
 }
 
 static void
-errop_data(uint32_t data, int len)
+errop_data(uint32_t data, uint32_t len)
 {
 
/* ignore */
@@ -188,7 +188,7 @@ static int fget_cnt;
 static size_t fget_size;
 
 static int
-fget_start(int len)
+fget_start(uint32_t len)
 {
 
if (len > FGET_STRSZ)
@@ -200,7 +200,7 @@ fget_start(int len)
 }
 
 static void
-fget_data(uint32_t data, int len)
+fget_data(uint32_t data, uint32_t len)
 {
 
*((uint32_t *) _str[fget_cnt]) = data;
@@ -285,8 +285,8 @@ static struct req_info {
struct op_info *req_op;
int  resp_error;
int  resp_count;
-   int  resp_size;
-   int  resp_off;
+   size_t   resp_size;
+   size_t   resp_off;
struct iovec *resp_biov;
 } rinfo;
 
@@ -346,13 +346,14 @@ fwctl_request_start(void)
 static int
 fwctl_request_data(uint32_t value)
 {
-   int remlen;
 
/* Make sure remaining size is >= 0 */
-   rinfo.req_size -= sizeof(uint32_t);
-   remlen = MAX(rinfo.req_size, 0);
+   if (rinfo.req_size <= sizeof(uint32_t))
+   rinfo.req_size = 0;
+   else
+   rinfo.req_size -= sizeof(uint32_t);
 
-   (*rinfo.req_op->op_data)(value, remlen);
+   (*rinfo.req_op->op_data)(value, rinfo.req_size);
 
if (rinfo.req_size < sizeof(uint32_t)) {
fwctl_request_done();
@@ -401,7 +402,7 @@ static int
 fwctl_response(uint32_t *retval)
 {
uint32_t *dp;
-   int remlen;
+   ssize_t remlen;
 
switch(rinfo.resp_count) {
case 0:
@@ -436,7 +437,7 @@ fwctl_response(uint32_t *retval)
}
 
if (rinfo.resp_count > 3 &&
-   rinfo.resp_size - rinfo.resp_off <= 0) {
+   rinfo.resp_off >= rinfo.resp_size) {
fwctl_response_done();
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"


Re: svn commit: r341464 - head/sbin/savecore

2018-12-04 Thread Rodney W. Grimes
> On Tue, Dec 4, 2018 at 9:28 AM Rodney W. Grimes
> >
> > > Author: garga (ports committer)
> > > Date: Tue Dec  4 12:34:22 2018
> > > New Revision: 341464
> > > URL: https://svnweb.freebsd.org/changeset/base/341464
> > >
> > > Log:
> > >   Restore /var/crash permissions to 0750, as declared in mtree file. After
> > >   r337337 it changed to 0755.
> > >
> > >   Reviewed by:loos
> > >   Approved by:loos
> > >   MFC after:  3 days
> > >   Sponsored by:   Rubicon Communications, LLC (Netgate)
> > >   Differential Revision:  https://reviews.freebsd.org/D18355
> >
> > This probably warrants an EN against 12.0 release.
> 
> Can we just fix it before 12.0-RELEASE builds starts?  It would be
> much more robust compared to delivering a "fixit" script though
> freebsd-update...

Thats Glens call, but normal procedure is 0 change between
last RC and release.

(Bcc:'ed to gjb@, and trimmed a bit)

Rod
> > > +++ head/sbin/savecore/Makefile   Tue Dec  4 12:34:22 2018
> > > (r341464)
> > > @@ -2,7 +2,9 @@
> > >
> > >  PACKAGE=runtime
> > >  CONFS=   minfree
> > > -CONFSDIR=/var/crash
> > > +VAR_CRASH=   /var/crash
> > > +VAR_CRASH_MODE=  0750
> > > +CONFSDIR=VAR_CRASH
> > >  PROG=savecore
> > >  LIBADD=  z xo
> > >  MAN= savecore.8
-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341464 - head/sbin/savecore

2018-12-04 Thread Xin LI
On Tue, Dec 4, 2018 at 9:28 AM Rodney W. Grimes
 wrote:
>
> > Author: garga (ports committer)
> > Date: Tue Dec  4 12:34:22 2018
> > New Revision: 341464
> > URL: https://svnweb.freebsd.org/changeset/base/341464
> >
> > Log:
> >   Restore /var/crash permissions to 0750, as declared in mtree file. After
> >   r337337 it changed to 0755.
> >
> >   Reviewed by:loos
> >   Approved by:loos
> >   MFC after:  3 days
> >   Sponsored by:   Rubicon Communications, LLC (Netgate)
> >   Differential Revision:  https://reviews.freebsd.org/D18355
>
> This probably warrants an EN against 12.0 release.

Can we just fix it before 12.0-RELEASE builds starts?  It would be
much more robust compared to delivering a "fixit" script though
freebsd-update...

Cheers,

>
> > Modified:
> >   head/sbin/savecore/Makefile
> >
> > Modified: head/sbin/savecore/Makefile
> > ==
> > --- head/sbin/savecore/Makefile   Tue Dec  4 10:30:31 2018
> > (r341463)
> > +++ head/sbin/savecore/Makefile   Tue Dec  4 12:34:22 2018
> > (r341464)
> > @@ -2,7 +2,9 @@
> >
> >  PACKAGE=runtime
> >  CONFS=   minfree
> > -CONFSDIR=/var/crash
> > +VAR_CRASH=   /var/crash
> > +VAR_CRASH_MODE=  0750
> > +CONFSDIR=VAR_CRASH
> >  PROG=savecore
> >  LIBADD=  z xo
> >  MAN= savecore.8
> >
> >
>
> --
> Rod Grimes rgri...@freebsd.org
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341483 - stable/12/share/man/man4

2018-12-04 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Dec  4 17:57:01 2018
New Revision: 341483
URL: https://svnweb.freebsd.org/changeset/base/341483

Log:
  MFC r341430
  
  netmap(4): improve man page
  
  Reviewed by:bcr
  Differential Revision:  https://reviews.freebsd.org/D18057

Modified:
  stable/12/share/man/man4/netmap.4
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/netmap.4
==
--- stable/12/share/man/man4/netmap.4   Tue Dec  4 17:53:56 2018
(r341482)
+++ stable/12/share/man/man4/netmap.4   Tue Dec  4 17:57:01 2018
(r341483)
@@ -27,17 +27,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 28, 2018
+.Dd November 20, 2018
 .Dt NETMAP 4
 .Os
 .Sh NAME
 .Nm netmap
 .Nd a framework for fast packet I/O
-.Nm VALE
-.Nd a fast VirtuAl Local Ethernet using the netmap API
-.Pp
-.Nm netmap pipes
-.Nd a shared memory packet transport channel
 .Sh SYNOPSIS
 .Cd device netmap
 .Sh DESCRIPTION
@@ -79,7 +74,7 @@ with much less than one core on 10 Gbit/s NICs;
 35-40 Mpps on 40 Gbit/s NICs (limited by the hardware);
 about 20 Mpps per core for VALE ports;
 and over 100 Mpps for
-.Nm netmap pipes.
+.Nm netmap pipes .
 NICs without native
 .Nm
 support can still use the API in emulated mode,
@@ -108,9 +103,9 @@ synchronization and blocking I/O through a file descri
 and standard OS mechanisms such as
 .Xr select 2 ,
 .Xr poll 2 ,
-.Xr epoll 2 ,
+.Xr kqueue 2
 and
-.Xr kqueue 2 .
+.Xr epoll 7 .
 All types of
 .Nm netmap ports
 and the
@@ -218,12 +213,6 @@ Non-blocking I/O is done with special
 and
 .Xr poll 2
 on the file descriptor permit blocking I/O.
-.Xr epoll 2
-and
-.Xr kqueue 2
-are not supported on
-.Nm
-file descriptors.
 .Pp
 While a NIC is in
 .Nm
@@ -244,7 +233,7 @@ which is the ultimate reference for the
 API.
 The main structures and fields are indicated below:
 .Bl -tag -width XXX
-.It Dv struct netmap_if (one per interface)
+.It Dv struct netmap_if (one per interface )
 .Bd -literal
 struct netmap_if {
 ...
@@ -267,14 +256,30 @@ NICs also have an extra tx/rx ring pair connected to t
 .Em NIOCREGIF
 can also request additional unbound buffers in the same memory space,
 to be used as temporary storage for packets.
+The number of extra
+buffers is specified in the
+.Va arg.nr_arg3
+field.
+On success, the kernel writes back to
+.Va arg.nr_arg3
+the number of extra buffers actually allocated (they may be less
+than the amount requested if the memory space ran out of buffers).
 .Pa ni_bufs_head
-contains the index of the first of these free rings,
+contains the index of the first of these extra buffers,
 which are connected in a list (the first uint32_t of each
 buffer being the index of the next buffer in the list).
 A
 .Dv 0
 indicates the end of the list.
-.It Dv struct netmap_ring (one per ring)
+The application is free to modify
+this list and use the buffers (i.e., binding them to the slots of a
+netmap ring).
+When closing the netmap file descriptor,
+the kernel frees the buffers contained in the list pointed by
+.Pa ni_bufs_head
+, irrespectively of the buffers originally provided by the kernel on
+.Em NIOCREGIF .
+.It Dv struct netmap_ring (one per ring )
 .Bd -literal
 struct netmap_ring {
 ...
@@ -296,7 +301,7 @@ Implements transmit and receive rings, with read/write
 pointers, metadata and an array of
 .Em slots
 describing the buffers.
-.It Dv struct netmap_slot (one per buffer)
+.It Dv struct netmap_slot (one per buffer )
 .Bd -literal
 struct netmap_slot {
 uint32_t buf_idx;   /* buffer index */
@@ -371,7 +376,6 @@ during the execution of a netmap-related system call.
 The only exception are slots (and buffers) in the range
 .Va tail\  . . . head-1 ,
 that are explicitly assigned to the kernel.
-.Pp
 .Ss TRANSMIT RINGS
 On transmit rings, after a
 .Nm
@@ -498,10 +502,9 @@ can be delayed indefinitely.
 This flag helps detect
 when packets have been sent and a file descriptor can be closed.
 .It NS_FORWARD
-When a ring is in 'transparent' mode (see
-.Sx TRANSPARENT MODE ) ,
-packets marked with this flag are forwarded to the other endpoint
-at the next system call, thus restoring (in a selective way)
+When a ring is in 'transparent' mode,
+packets marked with this flag by the user application are forwarded to the
+other endpoint at the next system call, thus restoring (in a selective way)
 the connection between a NIC and the host stack.
 .It NS_NO_LEARN
 tells the forwarding code that the source MAC address for this
@@ -669,7 +672,7 @@ and does not need to be sequential.
 On return the pipe
 will only have a single ring pair with index 0,
 irrespective of the value of
-.Va i.
+.Va i .
 .El
 .Pp
 By default, a
@@ -681,11 +684,14 @@ no write events are specified.
 The feature can be disabled by or-ing
 .Va NETMAP_NO_TX_POLL
 to the value written to
-.Va nr_ringid.
+.Va nr_ringid .
 When this feature is used,
 packets are transmitted only on
 .Va 

svn commit: r341482 - stable/11/share/man/man4

2018-12-04 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Dec  4 17:53:56 2018
New Revision: 341482
URL: https://svnweb.freebsd.org/changeset/base/341482

Log:
  MFC r341430
  
  netmap(4): improve man page
  
  Reviewed by:bcr
  Differential Revision:  https://reviews.freebsd.org/D18057

Modified:
  stable/11/share/man/man4/netmap.4
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/netmap.4
==
--- stable/11/share/man/man4/netmap.4   Tue Dec  4 17:49:44 2018
(r341481)
+++ stable/11/share/man/man4/netmap.4   Tue Dec  4 17:53:56 2018
(r341482)
@@ -27,45 +27,60 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 28, 2018
+.Dd November 20, 2018
 .Dt NETMAP 4
 .Os
 .Sh NAME
 .Nm netmap
 .Nd a framework for fast packet I/O
-.Pp
-.Nm VALE
-.Nd a fast VirtuAl Local Ethernet using the netmap API
-.Pp
-.Nm netmap pipes
-.Nd a shared memory packet transport channel
 .Sh SYNOPSIS
 .Cd device netmap
 .Sh DESCRIPTION
 .Nm
 is a framework for extremely fast and efficient packet I/O
-for both userspace and kernel clients.
+for userspace and kernel clients, and for Virtual Machines.
 It runs on
 .Fx
-and Linux, and includes
-.Nm VALE ,
-a very fast and modular in-kernel software switch/dataplane,
-and
-.Nm netmap pipes ,
-a shared memory packet transport channel.
-All these are accessed interchangeably with the same API.
+Linux and some versions of Windows, and supports a variety of
+.Nm netmap ports ,
+including
+.Bl -tag -width 
+.It Nm physical NIC ports
+to access individual queues of network interfaces;
+.It Nm host ports
+to inject packets into the host stack;
+.It Nm VALE ports
+implementing a very fast and modular in-kernel software switch/dataplane;
+.It Nm netmap pipes
+a shared memory packet transport channel;
+.It Nm netmap monitors
+a mechanism similar to
+.Xr bpf 4
+to capture traffic
+.El
 .Pp
-.Nm ,
-.Nm VALE
-and
-.Nm netmap pipes
-are at least one order of magnitude faster than
+All these
+.Nm netmap ports
+are accessed interchangeably with the same API,
+and are at least one order of magnitude faster than
 standard OS mechanisms
-(sockets, bpf, tun/tap interfaces, native switches, pipes),
-reaching 14.88 million packets per second (Mpps)
-with much less than one core on a 10 Gbit NIC,
-about 20 Mpps per core for VALE ports,
-and over 100 Mpps for netmap pipes.
+(sockets, bpf, tun/tap interfaces, native switches, pipes).
+With suitably fast hardware (NICs, PCIe buses, CPUs),
+packet I/O using
+.Nm
+on supported NICs
+reaches 14.88 million packets per second (Mpps)
+with much less than one core on 10 Gbit/s NICs;
+35-40 Mpps on 40 Gbit/s NICs (limited by the hardware);
+about 20 Mpps per core for VALE ports;
+and over 100 Mpps for
+.Nm netmap pipes .
+NICs without native
+.Nm
+support can still use the API in emulated mode,
+which uses unmodified device drivers and is 3-5 times faster than
+.Xr bpf 4
+or raw sockets.
 .Pp
 Userspace clients can dynamically switch NICs into
 .Nm
@@ -73,8 +88,10 @@ mode and send and receive raw packets through
 memory mapped buffers.
 Similarly,
 .Nm VALE
-switch instances and ports, and
+switch instances and ports,
 .Nm netmap pipes
+and
+.Nm netmap monitors
 can be created dynamically,
 providing high speed packet I/O between processes,
 virtual machines, NICs and the host stack.
@@ -86,20 +103,20 @@ synchronization and blocking I/O through a file descri
 and standard OS mechanisms such as
 .Xr select 2 ,
 .Xr poll 2 ,
-.Xr epoll 2 ,
+.Xr kqueue 2
 and
-.Xr kqueue 2 .
-.Nm VALE
-and
-.Nm netmap pipes
+.Xr epoll 7 .
+All types of
+.Nm netmap ports
+and the
+.Nm VALE switch
 are implemented by a single kernel module, which also emulates the
 .Nm
-API over standard drivers for devices without native
-.Nm
-support.
+API over standard drivers.
 For best performance,
 .Nm
-requires explicit support in device drivers.
+requires native support in device drivers.
+A list of such devices is at the end of this document.
 .Pp
 In the rest of this (long) manual page we document
 various aspects of the
@@ -116,7 +133,7 @@ which can be connected to a physical interface
 to the host stack,
 or to a
 .Nm VALE
-switch).
+switch.
 Ports use preallocated circular queues of buffers
 .Em ( rings )
 residing in an mmapped region.
@@ -152,8 +169,9 @@ ports (including
 and
 .Nm netmap pipe
 ports).
-Simpler, higher level functions are described in section
-.Xr LIBRARIES .
+Simpler, higher level functions are described in the
+.Sx LIBRARIES
+section.
 .Pp
 Ports and rings are created and controlled through a file descriptor,
 created by opening a special device
@@ -166,16 +184,18 @@ has multiple modes of operation controlled by the
 .Vt struct nmreq
 argument.
 .Va arg.nr_name
-specifies the port name, as follows:
+specifies the netmap port name, as follows:
 .Bl -tag -width 
-.It Dv OS network interface name (e.g. 'em0', 'eth1', ... )
+.It Dv OS network interface name (e.g., 'em0', 'eth1', ... )
 

svn commit: r341481 - stable/11/sys/dev/cxgbe

2018-12-04 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Dec  4 17:49:44 2018
New Revision: 341481
URL: https://svnweb.freebsd.org/changeset/base/341481

Log:
  MFC r341145
  
  cxgbe: revert r309725
  
  After the fix contained in r341144, cxgbe does not need anymore
  to set the IFCAP_NETMAP flag manually.
  
  Reviewed by:np
  Approved by:gnn (mentor)
  Differential Revision:  https://reviews.freebsd.org/D17987

Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Tue Dec  4 17:47:43 2018
(r341480)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Tue Dec  4 17:49:44 2018
(r341481)
@@ -1480,10 +1480,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
if (vi->nofldrxq != 0)
ifp->if_capabilities |= IFCAP_TOE;
 #endif
-#ifdef DEV_NETMAP
-   if (vi->nnmrxq != 0)
-   ifp->if_capabilities |= IFCAP_NETMAP;
-#endif
ifp->if_capenable = T4_CAP_ENABLE;
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
CSUM_UDP_IPV6 | CSUM_TCP_IPV6;
@@ -1497,7 +1493,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
 
ether_ifattach(ifp, vi->hw_addr);
 #ifdef DEV_NETMAP
-   if (ifp->if_capabilities & IFCAP_NETMAP)
+   if (vi->nnmrxq != 0)
cxgbe_nm_attach(vi);
 #endif
sb = sbuf_new_auto();

Modified: stable/11/sys/dev/cxgbe/t4_netmap.c
==
--- stable/11/sys/dev/cxgbe/t4_netmap.c Tue Dec  4 17:47:43 2018
(r341480)
+++ stable/11/sys/dev/cxgbe/t4_netmap.c Tue Dec  4 17:49:44 2018
(r341481)
@@ -864,7 +864,7 @@ cxgbe_nm_attach(struct vi_info *vi)
na.nm_register = cxgbe_netmap_reg;
na.num_tx_rings = vi->nnmtxq;
na.num_rx_rings = vi->nnmrxq;
-   netmap_attach();
+   netmap_attach(); /* This adds IFCAP_NETMAP to if_capabilities */
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341479 - stable/11/share/man/man9

2018-12-04 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Dec  4 17:46:06 2018
New Revision: 341479
URL: https://svnweb.freebsd.org/changeset/base/341479

Log:
  MFC r340475
  
  ifnet(9): Add description of IFCAP_NETMAP
  
  Describe IFCAP_NETMAP adding a cross reference to netmap(4).
  
  Reviewed by:bcr, 0mp
  Approved by:gnn (mentor)
  Differential Revision:  https://reviews.freebsd.org/D17988

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

Modified: stable/11/share/man/man9/ifnet.9
==
--- stable/11/share/man/man9/ifnet.9Tue Dec  4 17:44:12 2018
(r341478)
+++ stable/11/share/man/man9/ifnet.9Tue Dec  4 17:46:06 2018
(r341479)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 22, 2017
+.Dd November 14, 2018
 .Dt IFNET 9
 .Os
 .Sh NAME
@@ -762,6 +762,9 @@ interfaces (implies
 .Dv IFCAP_TSO ) .
 .It Dv IFCAP_LINKSTATE
 This Ethernet interface supports dynamic link state changes.
+.It Dv IFCAP_NETMAP
+This Ethernet interface supports
+.Xr netmap  4 .
 .El
 .Pp
 The ability of advanced network interfaces to offload certain
___
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: r341478 - in stable/11/sys/dev: netmap virtio/network

2018-12-04 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Dec  4 17:44:12 2018
New Revision: 341478
URL: https://svnweb.freebsd.org/changeset/base/341478

Log:
  MFC r340436
  
  vtnet: fix netmap support
  
  netmap(4) support for vtnet(4) was incomplete and had multiple bugs.
  This commit fixes those bugs to bring netmap on vtnet in a functional state.
  
  Changelist:
- handle errors returned by virtqueue_enqueue() properly (they were
  previously ignored)
- make sure netmap XOR rest of the kernel access each virtqueue.
- compute the number of netmap slots for TX and RX separately, according to
  whether indirect descriptors are used or not for a given virtqueue.
- make sure sglist are freed according to their type (mbufs or netmap
  buffers)
- add support for mulitiqueue and netmap host (aka sw) rings.
- intercept VQ interrupts directly instead of intercepting them in txq_eof
  and rxq_eof. This simplifies the code and makes it easier to make sure
  taskqueues are not running for a VQ while it is in netmap mode.
- implement vntet_netmap_config() to cope with changes in the number of 
queues.
  
  Reviewed by:bryanv
  Approved by:gnn (mentor)
  Sponsored by:   Sunny Valley Networks
  Differential Revision:  https://reviews.freebsd.org/D17916

Modified:
  stable/11/sys/dev/netmap/if_vtnet_netmap.h
  stable/11/sys/dev/virtio/network/if_vtnet.c
  stable/11/sys/dev/virtio/network/if_vtnetvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/netmap/if_vtnet_netmap.h
==
--- stable/11/sys/dev/netmap/if_vtnet_netmap.h  Tue Dec  4 17:40:56 2018
(r341477)
+++ stable/11/sys/dev/netmap/if_vtnet_netmap.h  Tue Dec  4 17:44:12 2018
(r341478)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Vincenzo Maffione, Luigi Rizzo. All rights reserved.
+ * Copyright (C) 2014-2018 Vincenzo Maffione, Luigi Rizzo.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,74 +33,148 @@
 #include /* vtophys ? */
 #include 
 
+/*
+ * Return 1 if the queue identified by 't' and 'idx' is in netmap mode.
+ */
+static int
+vtnet_netmap_queue_on(struct vtnet_softc *sc, enum txrx t, int idx)
+{
+   struct netmap_adapter *na = NA(sc->vtnet_ifp);
 
-#define SOFTC_Tvtnet_softc
+   if (!nm_native_on(na))
+   return 0;
 
-/* Free all the unused buffer in all the RX virtqueues.
- * This function is called when entering and exiting netmap mode.
- * - buffers queued by the virtio driver return skbuf/mbuf pointer
- *   and need to be freed;
- * - buffers queued by netmap return the txq/rxq, and do not need work
- */
+   if (t == NR_RX)
+   return !!(idx < na->num_rx_rings &&
+   na->rx_rings[idx]->nr_mode == NKR_NETMAP_ON);
+
+   return !!(idx < na->num_tx_rings &&
+   na->tx_rings[idx]->nr_mode == NKR_NETMAP_ON);
+}
+
 static void
-vtnet_netmap_free_bufs(struct SOFTC_T* sc)
+vtnet_free_used(struct virtqueue *vq, int netmap_bufs, enum txrx t, int idx)
 {
-   int i, nmb = 0, n = 0, last;
+   void *cookie;
+   int deq = 0;
 
-   for (i = 0; i < sc->vtnet_max_vq_pairs; i++) {
-   struct vtnet_rxq *rxq = >vtnet_rxqs[i];
-   struct virtqueue *vq;
-   struct mbuf *m;
-   struct vtnet_txq *txq = >vtnet_txqs[i];
-struct vtnet_tx_header *txhdr;
+   while ((cookie = virtqueue_dequeue(vq, NULL)) != NULL) {
+   if (netmap_bufs) {
+   /* These are netmap buffers: there is nothing to do. */
+   } else {
+   /* These are mbufs that we need to free. */
+   struct mbuf *m;
 
-   last = 0;
-   vq = rxq->vtnrx_vq;
-   while ((m = virtqueue_drain(vq, )) != NULL) {
-   n++;
-   if (m != (void *)rxq)
+   if (t == NR_TX) {
+   struct vtnet_tx_header *txhdr = cookie;
+   m = txhdr->vth_mbuf;
m_freem(m);
-   else
-   nmb++;
-   }
-
-   last = 0;
-   vq = txq->vtntx_vq;
-   while ((txhdr = virtqueue_drain(vq, )) != NULL) {
-   n++;
-   if (txhdr != (void *)txq) {
-   m_freem(txhdr->vth_mbuf);
uma_zfree(vtnet_tx_header_zone, txhdr);
-   } else
-   nmb++;
+   } else {
+   m = cookie;
+   m_freem(m);
+   }
}
+   deq++;
}
-   D("freed %d 

svn commit: r341480 - stable/11/sys/dev/netmap

2018-12-04 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Dec  4 17:47:43 2018
New Revision: 341480
URL: https://svnweb.freebsd.org/changeset/base/341480

Log:
  MFC r341144
  
  netmap: set IFCAP_NETMAP in if_capabilities
  
  Revision r307394 removed (by mistake) the code that sets IFCAP_NETMAP
  in if_capabilities on netmap_attach. This patch reverts this change.
  
  Reviewed by:np
  Approved by:gnn (mentor)
  Differential Revision:  https://reviews.freebsd.org/D17987

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

Modified: stable/11/sys/dev/netmap/netmap_freebsd.c
==
--- stable/11/sys/dev/netmap/netmap_freebsd.c   Tue Dec  4 17:46:06 2018
(r341479)
+++ stable/11/sys/dev/netmap/netmap_freebsd.c   Tue Dec  4 17:47:43 2018
(r341480)
@@ -1547,6 +1547,7 @@ out:
 void
 nm_os_onattach(struct ifnet *ifp)
 {
+   ifp->if_capabilities |= IFCAP_NETMAP;
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341477 - in stable/11/sys: conf dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/netmap dev/re modules/netmap net

2018-12-04 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Dec  4 17:40:56 2018
New Revision: 341477
URL: https://svnweb.freebsd.org/changeset/base/341477

Log:
  MFC r339639
  
  netmap: align codebase to the current upstream (sha 8374e1a7e6941)
  
  Changelist:
  - Move large parts of VALE code to a new file and header netmap_bdg.[ch].
This is useful to reuse the code within upcoming projects.
  - Improvements and bug fixes to pipes and monitors.
  - Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to
handle differences between FreeBSD and Linux.
  - Introduce some new helper functions to handle more host rings and fake
rings (netmap_all_rings(), netmap_real_rings(), ...)
  - Added new sysctl to enable/disable hw checksum in emulated netmap mode.
  - nm_inject: add support for NS_MOREFRAG
  
  Approved by:gnn (mentor)
  Differential Revision:  https://reviews.freebsd.org/D17364

Added:
  stable/11/sys/dev/netmap/netmap_bdg.c   (contents, props changed)
  stable/11/sys/dev/netmap/netmap_bdg.h   (contents, props changed)
  stable/11/sys/dev/netmap/netmap_legacy.c   (contents, props changed)
  stable/11/sys/dev/netmap/netmap_pt.c   (contents, props changed)
  stable/11/sys/net/netmap_legacy.h   (contents, props changed)
  stable/11/sys/net/netmap_virt.h   (contents, props changed)
Modified:
  stable/11/sys/conf/files
  stable/11/sys/dev/cxgbe/t4_netmap.c
  stable/11/sys/dev/e1000/if_em.c
  stable/11/sys/dev/e1000/if_igb.c
  stable/11/sys/dev/e1000/if_lem.c
  stable/11/sys/dev/ixgbe/if_ix.c
  stable/11/sys/dev/ixgbe/if_ixv.c
  stable/11/sys/dev/ixgbe/ix_txrx.c
  stable/11/sys/dev/ixgbe/ixgbe_netmap.c
  stable/11/sys/dev/ixl/ixl_pf_main.c
  stable/11/sys/dev/ixl/ixl_txrx.c
  stable/11/sys/dev/netmap/if_em_netmap.h
  stable/11/sys/dev/netmap/if_igb_netmap.h
  stable/11/sys/dev/netmap/if_ixl_netmap.h
  stable/11/sys/dev/netmap/if_lem_netmap.h
  stable/11/sys/dev/netmap/if_re_netmap.h
  stable/11/sys/dev/netmap/if_vtnet_netmap.h
  stable/11/sys/dev/netmap/ixgbe_netmap.h
  stable/11/sys/dev/netmap/netmap.c
  stable/11/sys/dev/netmap/netmap_freebsd.c
  stable/11/sys/dev/netmap/netmap_generic.c
  stable/11/sys/dev/netmap/netmap_kern.h
  stable/11/sys/dev/netmap/netmap_mbq.c
  stable/11/sys/dev/netmap/netmap_mbq.h
  stable/11/sys/dev/netmap/netmap_mem2.c
  stable/11/sys/dev/netmap/netmap_mem2.h
  stable/11/sys/dev/netmap/netmap_monitor.c
  stable/11/sys/dev/netmap/netmap_offloadings.c
  stable/11/sys/dev/netmap/netmap_pipe.c
  stable/11/sys/dev/netmap/netmap_vale.c
  stable/11/sys/dev/re/if_re.c
  stable/11/sys/modules/netmap/Makefile
  stable/11/sys/net/iflib.c
  stable/11/sys/net/netmap.h
  stable/11/sys/net/netmap_user.h

Modified: stable/11/sys/conf/files
==
--- stable/11/sys/conf/filesTue Dec  4 16:53:28 2018(r341476)
+++ stable/11/sys/conf/filesTue Dec  4 17:40:56 2018(r341477)
@@ -2476,7 +2476,10 @@ dev/netmap/netmap_mem2.c optional netmap
 dev/netmap/netmap_monitor.coptional netmap
 dev/netmap/netmap_offloadings.coptional netmap
 dev/netmap/netmap_pipe.c   optional netmap
+dev/netmap/netmap_pt.c optional netmap
 dev/netmap/netmap_vale.c   optional netmap
+dev/netmap/netmap_legacy.c optional netmap
+dev/netmap/netmap_bdg.coptional netmap
 # compile-with "${NORMAL_C} -Wconversion -Wextra"
 dev/nfsmb/nfsmb.c  optional nfsmb pci
 dev/nge/if_nge.c   optional nge

Modified: stable/11/sys/dev/cxgbe/t4_netmap.c
==
--- stable/11/sys/dev/cxgbe/t4_netmap.c Tue Dec  4 16:53:28 2018
(r341476)
+++ stable/11/sys/dev/cxgbe/t4_netmap.c Tue Dec  4 17:40:56 2018
(r341477)
@@ -909,7 +909,7 @@ t4_nm_intr(void *arg)
struct adapter *sc = vi->pi->adapter;
struct ifnet *ifp = vi->ifp;
struct netmap_adapter *na = NA(ifp);
-   struct netmap_kring *kring = >rx_rings[nm_rxq->nid];
+   struct netmap_kring *kring = na->rx_rings[nm_rxq->nid];
struct netmap_ring *ring = kring->ring;
struct iq_desc *d = _rxq->iq_desc[nm_rxq->iq_cidx];
const void *cpl;
@@ -950,7 +950,7 @@ t4_nm_intr(void *arg)
case CPL_RX_PKT:
ring->slot[fl_cidx].len = G_RSPD_LEN(lq) -
sc->params.sge.fl_pktshift;
-   ring->slot[fl_cidx].flags = 
kring->nkr_slot_flags;
+   ring->slot[fl_cidx].flags = 0;
fl_cidx += (lq & F_RSPD_NEWBUF) ? 1 : 0;
fl_credits += (lq & F_RSPD_NEWBUF) ? 1 : 0;
if (__predict_false(fl_cidx == nm_rxq->fl_sidx))

Modified: stable/11/sys/dev/e1000/if_em.c
==
--- 

Re: svn commit: r341446 - head/release/amd64

2018-12-04 Thread Rodney W. Grimes
> Alexey Dokuchaev wrote:
> > On Mon, Dec 03, 2018 at 10:31:57PM +, Yuri Pankov wrote:
> >> New Revision: 341446
> >> URL: https://svnweb.freebsd.org/changeset/base/341446
> >>
> >> Log:
> >>   mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
> >>   
> >>   This fixes 'cdrom' target in the case when world was built by user,
> >>   and not root.
> > 
> > Could you please explain why -p should not have been used here?  I fail
> > to understand this from the commit log.  I've always considered preserving
> > various file metadata as a good thing to do, and this commit puzzles me.
> 
> Because the target is on msdosfs, and the only metadata that can be
> preserved is modification time which isn't that useful with the file
> being hidden in ESP.  OTOH, 'cp -p' fails trying to preserve owner/group
> if source is not owned by root (as commit message says).  Additional
> 'chmod' call done in HBSD doesn't do much as well -- it seems we can
> only set/unset owner's 'write' flag which corresponds to DOS 'readonly'
> attribute.
> 

I agree with this assesment, and the present state of the script,
besides cp followed by chmod is usually spelled ${INSTALL}.


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


Re: svn commit: r341464 - head/sbin/savecore

2018-12-04 Thread Rodney W. Grimes
> Author: garga (ports committer)
> Date: Tue Dec  4 12:34:22 2018
> New Revision: 341464
> URL: https://svnweb.freebsd.org/changeset/base/341464
> 
> Log:
>   Restore /var/crash permissions to 0750, as declared in mtree file. After
>   r337337 it changed to 0755.
>   
>   Reviewed by:loos
>   Approved by:loos
>   MFC after:  3 days
>   Sponsored by:   Rubicon Communications, LLC (Netgate)
>   Differential Revision:  https://reviews.freebsd.org/D18355

This probably warrants an EN against 12.0 release.

> Modified:
>   head/sbin/savecore/Makefile
> 
> Modified: head/sbin/savecore/Makefile
> ==
> --- head/sbin/savecore/Makefile   Tue Dec  4 10:30:31 2018
> (r341463)
> +++ head/sbin/savecore/Makefile   Tue Dec  4 12:34:22 2018
> (r341464)
> @@ -2,7 +2,9 @@
>  
>  PACKAGE=runtime
>  CONFS=   minfree
> -CONFSDIR=/var/crash
> +VAR_CRASH=   /var/crash
> +VAR_CRASH_MODE=  0750
> +CONFSDIR=VAR_CRASH
>  PROG=savecore
>  LIBADD=  z xo
>  MAN= savecore.8
> 
> 

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


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

2018-12-04 Thread Konstantin Belousov
Author: kib
Date: Tue Dec  4 16:53:28 2018
New Revision: 341476
URL: https://svnweb.freebsd.org/changeset/base/341476

Log:
  MFC r341094:
  Improve sigonstack().

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

Modified: stable/11/sys/kern/kern_sig.c
==
--- stable/11/sys/kern/kern_sig.c   Tue Dec  4 16:49:14 2018
(r341475)
+++ stable/11/sys/kern/kern_sig.c   Tue Dec  4 16:53:28 2018
(r341476)
@@ -617,20 +617,25 @@ signotify(struct thread *td)
}
 }
 
+/*
+ * Returns 1 (true) if altstack is configured for the thread, and the
+ * passed stack bottom address falls into the altstack range.  Handles
+ * the 43 compat special case where the alt stack size is zero.
+ */
 int
 sigonstack(size_t sp)
 {
-   struct thread *td = curthread;
+   struct thread *td;
 
-   return ((td->td_pflags & TDP_ALTSTACK) ?
+   td = curthread;
+   if ((td->td_pflags & TDP_ALTSTACK) == 0)
+   return (0);
 #if defined(COMPAT_43)
-   ((td->td_sigstk.ss_size == 0) ?
-   (td->td_sigstk.ss_flags & SS_ONSTACK) :
-   ((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size))
-#else
-   ((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size)
+   if (td->td_sigstk.ss_size == 0)
+   return ((td->td_sigstk.ss_flags & SS_ONSTACK) != 0);
 #endif
-   : 0);
+   return (sp >= (size_t)td->td_sigstk.ss_sp &&
+   sp < td->td_sigstk.ss_size + (size_t)td->td_sigstk.ss_sp);
 }
 
 static __inline int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341475 - in head/sys: kern sys

2018-12-04 Thread Brooks Davis
Author: brooks
Date: Tue Dec  4 16:49:14 2018
New Revision: 341475
URL: https://svnweb.freebsd.org/changeset/base/341475

Log:
  Regen after r341474: Normalize COMPAT_43 syscall declarations.

Modified:
  head/sys/kern/init_sysent.c
  head/sys/sys/sysproto.h

Modified: head/sys/kern/init_sysent.c
==
--- head/sys/kern/init_sysent.c Tue Dec  4 16:48:47 2018(r341474)
+++ head/sys/kern/init_sysent.c Tue Dec  4 16:49:14 2018(r341475)
@@ -112,7 +112,7 @@ struct sysent sysent[] = {
{ AS(umask_args), (sy_call_t *)sys_umask, AUE_UMASK, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },   /* 60 = umask */
{ AS(chroot_args), (sy_call_t *)sys_chroot, AUE_CHROOT, NULL, 0, 0, 0, 
SY_THR_STATIC }, /* 61 = chroot */
{ compat(AS(ofstat_args),fstat), AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, 
SY_THR_STATIC },/* 62 = old fstat */
-   { compat(AS(getkerninfo_args),getkerninfo), AUE_NULL, NULL, 0, 0, 0, 
SY_THR_STATIC },   /* 63 = old getkerninfo */
+   { compat(AS(ogetkerninfo_args),getkerninfo), AUE_NULL, NULL, 0, 0, 0, 
SY_THR_STATIC },  /* 63 = old getkerninfo */
{ compat(0,getpagesize), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, 
SY_THR_STATIC }, /* 64 = old getpagesize */
{ AS(msync_args), (sy_call_t *)sys_msync, AUE_MSYNC, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },   /* 65 = msync */
{ 0, (sy_call_t *)sys_vfork, AUE_VFORK, NULL, 0, 0, 0, SY_THR_STATIC }, 
/* 66 = vfork */
@@ -136,8 +136,8 @@ struct sysent sysent[] = {
{ compat(0,wait), AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC },
/* 84 = old wait */
{ AS(swapon_args), (sy_call_t *)sys_swapon, AUE_SWAPON, NULL, 0, 0, 0, 
SY_THR_STATIC }, /* 85 = swapon */
{ AS(getitimer_args), (sy_call_t *)sys_getitimer, AUE_GETITIMER, NULL, 
0, 0, SYF_CAPENABLED, SY_THR_STATIC },   /* 86 = getitimer */
-   { compat(AS(gethostname_args),gethostname), AUE_SYSCTL, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },/* 87 = old gethostname */
-   { compat(AS(sethostname_args),sethostname), AUE_SYSCTL, NULL, 0, 0, 0, 
SY_THR_STATIC }, /* 88 = old sethostname */
+   { compat(AS(ogethostname_args),gethostname), AUE_SYSCTL, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },   /* 87 = old gethostname */
+   { compat(AS(osethostname_args),sethostname), AUE_SYSCTL, NULL, 0, 0, 0, 
SY_THR_STATIC },/* 88 = old sethostname */
{ 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },/* 89 = getdtablesize */
{ AS(dup2_args), (sy_call_t *)sys_dup2, AUE_DUP2, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },  /* 90 = dup2 */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },  
/* 91 = getdopt */
@@ -148,7 +148,7 @@ struct sysent sysent[] = {
{ AS(setpriority_args), (sy_call_t *)sys_setpriority, AUE_SETPRIORITY, 
NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 96 = setpriority */
{ AS(socket_args), (sy_call_t *)sys_socket, AUE_SOCKET, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },/* 97 = socket */
{ AS(connect_args), (sy_call_t *)sys_connect, AUE_CONNECT, NULL, 0, 0, 
0, SY_THR_STATIC },  /* 98 = connect */
-   { compat(AS(accept_args),accept), AUE_ACCEPT, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },  /* 99 = old accept */
+   { compat(AS(oaccept_args),accept), AUE_ACCEPT, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC }, /* 99 = old accept */
{ AS(getpriority_args), (sy_call_t *)sys_getpriority, AUE_GETPRIORITY, 
NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 100 = getpriority */
{ compat(AS(osend_args),send), AUE_SEND, NULL, 0, 0, SYF_CAPENABLED, 
SY_THR_STATIC },   /* 101 = old send */
{ compat(AS(orecv_args),recv), AUE_RECV, NULL, 0, 0, SYF_CAPENABLED, 
SY_THR_STATIC },   /* 102 = old recv */

Modified: head/sys/sys/sysproto.h
==
--- head/sys/sys/sysproto.h Tue Dec  4 16:48:47 2018(r341474)
+++ head/sys/sys/sysproto.h Tue Dec  4 16:49:14 2018(r341475)
@@ -247,7 +247,7 @@ struct umask_args {
 struct chroot_args {
char path_l_[PADL_(const char *)]; const char * path; char 
path_r_[PADR_(const char *)];
 };
-struct getpagesize_args {
+struct ogetpagesize_args {
register_t dummy;
 };
 struct msync_args {
@@ -2183,7 +2183,7 @@ struct ofstat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char sb_l_[PADL_(struct ostat *)]; struct ostat * sb; char 
sb_r_[PADR_(struct ostat *)];
 };
-struct getkerninfo_args {
+struct ogetkerninfo_args {
char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
char where_l_[PADL_(char *)]; char * where; char where_r_[PADR_(char 
*)];
char size_l_[PADL_(size_t *)]; size_t * size; char size_r_[PADR_(size_t 
*)];
@@ -2197,11 

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

2018-12-04 Thread Brooks Davis
Author: brooks
Date: Tue Dec  4 16:48:47 2018
New Revision: 341474
URL: https://svnweb.freebsd.org/changeset/base/341474

Log:
  Normalize COMPAT_43 syscall declarations.
  
  Have ogetkerninfo, ogetpagesize, ogethostname, osethostname, and oaccept
  declare o_args structs rather than non-compat ones. Due to a
  failure to use NOARGS in most cases this adds only one new declaration.
  
  No changes required in freebsd32 as only ogetpagesize() is implemented
  and it has a 32-bit specific implementation.
  
  Reviewed by:  kib
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D15816

Modified:
  head/sys/kern/kern_xxx.c
  head/sys/kern/syscalls.master
  head/sys/kern/uipc_syscalls.c
  head/sys/vm/vm_mmap.c

Modified: head/sys/kern/kern_xxx.c
==
--- head/sys/kern/kern_xxx.cTue Dec  4 16:43:50 2018(r341473)
+++ head/sys/kern/kern_xxx.cTue Dec  4 16:48:47 2018(r341474)
@@ -50,15 +50,8 @@ __FBSDID("$FreeBSD$");
 
 #if defined(COMPAT_43)
 
-#ifndef _SYS_SYSPROTO_H_
-struct gethostname_args {
-   char*hostname;
-   u_int   len;
-};
-#endif
-/* ARGSUSED */
 int
-ogethostname(struct thread *td, struct gethostname_args *uap)
+ogethostname(struct thread *td, struct ogethostname_args *uap)
 {
int name[2];
size_t len = uap->len;
@@ -69,15 +62,8 @@ ogethostname(struct thread *td, struct gethostname_arg
1, 0, 0, 0, 0));
 }
 
-#ifndef _SYS_SYSPROTO_H_
-struct sethostname_args {
-   char*hostname;
-   u_int   len;
-};
-#endif
-/* ARGSUSED */
 int
-osethostname(struct thread *td, struct sethostname_args *uap)
+osethostname(struct thread *td, struct osethostname_args *uap)
 {
int name[2];
 
@@ -104,15 +90,7 @@ ogethostid(struct thread *td, struct ogethostid_args *
return (kernel_sysctl(td, name, 2, (long *)td->td_retval, ,
NULL, 0, NULL, 0));
 }
-#endif /* COMPAT_43 */
 
-#ifdef COMPAT_43
-#ifndef _SYS_SYSPROTO_H_
-struct osethostid_args {
-   longhostid;
-};
-#endif
-/* ARGSUSED */
 int
 osethostid(struct thread *td, struct osethostid_args *uap)
 {
@@ -187,16 +165,8 @@ static struct {
  */
 static char bsdi_strings[80];  /* It had better be less than this! */
 
-#ifndef _SYS_SYSPROTO_H_
-struct getkerninfo_args {
-   int op;
-   char*where;
-   size_t  *size;
-   int arg;
-};
-#endif
 int
-ogetkerninfo(struct thread *td, struct getkerninfo_args *uap)
+ogetkerninfo(struct thread *td, struct ogetkerninfo_args *uap)
 {
int error, name[6];
size_t size;

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Tue Dec  4 16:43:50 2018
(r341473)
+++ head/sys/kern/syscalls.master   Tue Dec  4 16:48:47 2018
(r341474)
@@ -453,10 +453,10 @@
_Inout_opt_ size_t *size,
int arg
);
-   } getkerninfo getkerninfo_args int
+   }
 64 AUE_NULLCOMPAT {
int getpagesize(void);
-   } getpagesize getpagesize_args int
+   }
 65 AUE_MSYNC   STD {
int msync(
_In_ void *addr,
@@ -570,13 +570,13 @@
_Out_writes_z_(len) char *hostname,
u_int len
);
-   } gethostname gethostname_args int
+   }
 88 AUE_SYSCTL  COMPAT {
int sethostname(
_In_reads_z_(len) char *hostname,
u_int len
);
-   } sethostname sethostname_args int
+   }
 89 AUE_GETDTABLESIZE   STD {
int getdtablesize(void);
}
@@ -638,7 +638,7 @@
_Out_writes_bytes_opt_(*anamelen) struct sockaddr *name,
int *anamelen
);
-   } accept accept_args int
+   }
 100AUE_GETPRIORITY STD {
int getpriority(
int which,

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Tue Dec  4 16:43:50 2018
(r341473)
+++ head/sys/kern/uipc_syscalls.c   Tue Dec  4 16:48:47 2018
(r341474)
@@ -455,9 +455,7 @@ sys_accept4(td, uap)
 
 #ifdef COMPAT_OLDSOCK
 int
-oaccept(td, uap)
-   struct thread *td;
-   struct accept_args *uap;
+oaccept(struct thread *td, struct oaccept_args *uap)
 {
 
return (accept1(td, uap->s, uap->name, uap->anamelen,

Modified: head/sys/vm/vm_mmap.c
==
--- head/sys/vm/vm_mmap.c   Tue Dec  4 16:43:50 2018(r341473)
+++ head/sys/vm/vm_mmap.c   Tue Dec  4 16:48:47 2018(r341474)
@@ -129,14 +129,8 @@ sys_sstk(struct thread *td, struct sstk_args *uap)
 }
 
 #if 

svn commit: r341473 - in head/stand/i386: common gptboot loader

2018-12-04 Thread Ian Lepore
Author: ian
Date: Tue Dec  4 16:43:50 2018
New Revision: 341473
URL: https://svnweb.freebsd.org/changeset/base/341473

Log:
  Fix args cross-threading between gptboot(8) and loader(8) with zfs support.
  
  When loader(8) is built with zfs support enabled, it assumes that any extarg
  data present is a zfs_boot_args struct, but if the first-stage loader was
  gptboot(8) the extarg data is actually a geli_boot_args struct.  Luckily,
  zfsboot(8) and gptzfsboot(8) have always passed KARGS_FLAGS_ZFS along with
  KARGS_FLAGS_EXTARG, so we can use KARGS_FLAGS_ZFS to decide whether the
  extarg data is a zfs_boot_args struct.
  
  To avoid similar problems in the future, gptboot(8) now passes a new
  KARGS_FLAGS_GELI to indicate that extarg data is geli_boot_args.  In
  loader(8), if the neither KARGS_FLAGS_ZFS nor KARGS_FLAGS_GELI is set but
  extarg data is present (which will be the case for gptboot compiled before
  this change), we now check for the known size of the geli_boot_args struct
  passed by the older versions of gptboot as a way of confirming what type of
  extarg data is present.
  
  In a semi-related tidying up, since loader's main() has already decided
  what type of extarg data is present and set the global 'zargs' var
  accordingly, don't repeat the check in extract_currdev, just check whether
  zargs is NULL or not.
  
  X-MFC after:  a few days, along with prior related changes.

Modified:
  head/stand/i386/common/bootargs.h
  head/stand/i386/gptboot/gptboot.c
  head/stand/i386/loader/main.c

Modified: head/stand/i386/common/bootargs.h
==
--- head/stand/i386/common/bootargs.h   Tue Dec  4 16:12:43 2018
(r341472)
+++ head/stand/i386/common/bootargs.h   Tue Dec  4 16:43:50 2018
(r341473)
@@ -18,10 +18,11 @@
 #ifndef _BOOT_I386_ARGS_H_
 #define_BOOT_I386_ARGS_H_
 
-#defineKARGS_FLAGS_CD  0x1
-#defineKARGS_FLAGS_PXE 0x2
-#defineKARGS_FLAGS_ZFS 0x4
-#defineKARGS_FLAGS_EXTARG  0x8 /* variably sized extended 
argument */
+#defineKARGS_FLAGS_CD  0x0001  /* .bootdev is a bios CD dev */
+#defineKARGS_FLAGS_PXE 0x0002  /* .pxeinfo is valid */
+#defineKARGS_FLAGS_ZFS 0x0004  /* .zfspool is valid, EXTARG is 
zfs_boot_args */
+#defineKARGS_FLAGS_EXTARG  0x0008  /* variably sized extended 
argument */
+#defineKARGS_FLAGS_GELI0x0010  /* EXTARG is geli_boot_args */
 
 #defineBOOTARGS_SIZE   24  /* sizeof(struct bootargs) */
 #defineBA_BOOTFLAGS8   /* offsetof(struct bootargs, bootflags) 
*/

Modified: head/stand/i386/gptboot/gptboot.c
==
--- head/stand/i386/gptboot/gptboot.c   Tue Dec  4 16:12:43 2018
(r341472)
+++ head/stand/i386/gptboot/gptboot.c   Tue Dec  4 16:43:50 2018
(r341473)
@@ -490,7 +490,7 @@ load(void)
__exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
MAKEBOOTDEV(dev_maj[gdsk.dsk.type], gdsk.dsk.part + 1, 
gdsk.dsk.unit, 0xff),
 #ifdef LOADER_GELI_SUPPORT
-   KARGS_FLAGS_EXTARG, 0, 0, VTOP(), geliargs
+   KARGS_FLAGS_GELI | KARGS_FLAGS_EXTARG, 0, 0, VTOP(), 
geliargs
 #else
0, 0, 0, VTOP()
 #endif

Modified: head/stand/i386/loader/main.c
==
--- head/stand/i386/loader/main.c   Tue Dec  4 16:12:43 2018
(r341472)
+++ head/stand/i386/loader/main.c   Tue Dec  4 16:43:50 2018
(r341473)
@@ -73,6 +73,7 @@ void  exit(int code);
 #ifdef LOADER_GELI_SUPPORT
 #include "geliboot.h"
 struct geli_boot_args  *gargs;
+struct geli_boot_data  *gbdata;
 #endif
 #ifdef LOADER_ZFS_SUPPORT
 struct zfs_boot_args   *zargs;
@@ -169,24 +170,46 @@ main(void)
 #ifdef LOADER_ZFS_SUPPORT
 archsw.arch_zfs_probe = i386_zfs_probe;
 
-#ifdef LOADER_GELI_SUPPORT
-if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) {
+/*
+ * zfsboot and gptzfsboot have always passed KARGS_FLAGS_ZFS, so if that is
+ * set along with KARGS_FLAGS_EXTARG we know we can interpret the extarg
+ * data as a struct zfs_boot_args.
+ */
+#defineKARGS_EXTARGS_ZFS   (KARGS_FLAGS_EXTARG | KARGS_FLAGS_ZFS)
+
+if ((kargs->bootflags & KARGS_EXTARGS_ZFS) == KARGS_EXTARGS_ZFS) {
zargs = (struct zfs_boot_args *)(kargs + 1);
-   if (zargs->size > offsetof(struct zfs_boot_args, gelidata)) {
-   import_geli_boot_data(>gelidata);
-   }
 }
-#endif /* LOADER_GELI_SUPPORT */
-#else /* !LOADER_ZFS_SUPPORT */
+#endif /* LOADER_ZFS_SUPPORT */
+
 #ifdef LOADER_GELI_SUPPORT
-if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) {
+/*
+ * If we decided earlier that we have zfs_boot_args extarg data, and it is
+ * big enough to contain the embedded geli data (the early 

svn commit: r341472 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw

2018-12-04 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  4 16:12:43 2018
New Revision: 341472
URL: https://svnweb.freebsd.org/changeset/base/341472

Log:
  Add ability to request listing and deleting only for dynamic states.
  
  This can be useful, when net.inet.ip.fw.dyn_keep_states is enabled, but
  after rules reloading some state must be deleted. Added new flag '-D'
  for such purpose.
  
  Retire '-e' flag, since there can not be expired states in the meaning
  that this flag historically had.
  
  Also add "verbose" mode for listing of dynamic states, it can be enabled
  with '-v' flag and adds additional information to states list. This can
  be useful for debugging.
  
  Obtained from:Yandex LLC
  MFC after:2 months
  Sponsored by: Yandex LLC

Modified:
  head/sbin/ipfw/ipfw.8
  head/sbin/ipfw/ipfw2.c
  head/sbin/ipfw/ipfw2.h
  head/sbin/ipfw/main.c
  head/sys/netinet/ip_fw.h
  head/sys/netpfil/ipfw/ip_fw_dynamic.c
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Tue Dec  4 16:01:25 2018(r341471)
+++ head/sbin/ipfw/ipfw.8   Tue Dec  4 16:12:43 2018(r341472)
@@ -1,7 +1,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 13, 2018
+.Dd December 4, 2018
 .Dt IPFW 8
 .Os
 .Sh NAME
@@ -310,10 +310,9 @@ i.e., omitting the "ip from any to any" string
 when this does not carry any additional information.
 .It Fl d
 When listing, show dynamic rules in addition to static ones.
-.It Fl e
-When listing and
-.Fl d
-is specified, also show expired dynamic rules.
+.It Fl D
+When listing, show only dynamic states.
+When deleting, delete only dynamic states.
 .It Fl f
 Run without prompting for confirmation for commands that can cause problems if 
misused,
 i.e.,

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Tue Dec  4 16:01:25 2018(r341471)
+++ head/sbin/ipfw/ipfw2.c  Tue Dec  4 16:12:43 2018(r341472)
@@ -2247,10 +2247,9 @@ show_dyn_state(struct cmdline_opts *co, struct format_
uint16_t rulenum;
char buf[INET6_ADDRSTRLEN];
 
-   if (!co->do_expired) {
-   if (!d->expire && !(d->dyn_type == O_LIMIT_PARENT))
-   return;
-   }
+   if (d->expire == 0 && d->dyn_type != O_LIMIT_PARENT)
+   return;
+
bcopy(>rule, , sizeof(rulenum));
bprintf(bp, "%05d", rulenum);
if (fo->pcwidth > 0 || fo->bcwidth > 0) {
@@ -2292,6 +2291,33 @@ show_dyn_state(struct cmdline_opts *co, struct format_
if (d->kidx != 0)
bprintf(bp, " :%s", object_search_ctlv(fo->tstate,
d->kidx, IPFW_TLV_STATE_NAME));
+
+#defineBOTH_SYN(TH_SYN | (TH_SYN << 8))
+#defineBOTH_FIN(TH_FIN | (TH_FIN << 8))
+   if (co->verbose) {
+   bprintf(bp, " state 0x%08x%s", d->state,
+   d->state ? " ": ",");
+   if (d->state & IPFW_DYN_ORPHANED)
+   bprintf(bp, "ORPHANED,");
+   if ((d->state & BOTH_SYN) == BOTH_SYN)
+   bprintf(bp, "BOTH_SYN,");
+   else {
+   if (d->state & TH_SYN)
+   bprintf(bp, "F_SYN,");
+   if (d->state & (TH_SYN << 8))
+   bprintf(bp, "R_SYN,");
+   }
+   if ((d->state & BOTH_FIN) == BOTH_FIN)
+   bprintf(bp, "BOTH_FIN,");
+   else {
+   if (d->state & TH_FIN)
+   bprintf(bp, "F_FIN,");
+   if (d->state & (TH_FIN << 8))
+   bprintf(bp, "R_FIN,");
+   }
+   bprintf(bp, " f_ack 0x%x, r_ack 0x%x", d->ack_fwd,
+   d->ack_rev);
+   }
 }
 
 static int
@@ -2695,7 +2721,8 @@ ipfw_list(int ac, char *av[], int show_counters)
cfg = NULL;
sfo.show_counters = show_counters;
sfo.show_time = co.do_time;
-   sfo.flags = IPFW_CFG_GET_STATIC;
+   if (co.do_dynamic != 2)
+   sfo.flags |= IPFW_CFG_GET_STATIC;
if (co.do_dynamic != 0)
sfo.flags |= IPFW_CFG_GET_STATES;
if ((sfo.show_counters | sfo.show_time) != 0)
@@ -2740,17 +2767,15 @@ ipfw_show_config(struct cmdline_opts *co, struct forma
fo->set_mask = cfg->set_mask;
 
ctlv = (ipfw_obj_ctlv *)(cfg + 1);
+   if (ctlv->head.type == IPFW_TLV_TBLNAME_LIST) {
+   object_sort_ctlv(ctlv);
+   fo->tstate = ctlv;
+   readsz += ctlv->head.length;
+   ctlv = (ipfw_obj_ctlv *)((caddr_t)ctlv + ctlv->head.length);
+   }
 
if (cfg->flags & IPFW_CFG_GET_STATIC) {
/* We've requested static rules */
-   if (ctlv->head.type == IPFW_TLV_TBLNAME_LIST) {
-  

svn commit: r341471 - in head/sys/netpfil/ipfw: . nat64 nptv6

2018-12-04 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  4 16:01:25 2018
New Revision: 341471
URL: https://svnweb.freebsd.org/changeset/base/341471

Log:
  Reimplement how net.inet.ip.fw.dyn_keep_states works.
  
  Turning on of this feature allows to keep dynamic states when parent
  rule is deleted. But it works only when the default rule is
  "allow from any to any".
  
  Now when rule with dynamic opcode is going to be deleted, and
  net.inet.ip.fw.dyn_keep_states is enabled, existing states will reference
  named objects corresponding to this rule, and also reference the rule.
  And when ipfw_dyn_lookup_state() will find state for deleted parent rule,
  it will return the pointer to the deleted rule, that is still valid.
  This implementation doesn't support O_LIMIT_PARENT rules.
  
  The refcnt field was added to struct ip_fw to keep reference, also
  next pointer added to be able iterate rules and not damage the content
  when deleted rules are chained.
  
  Named objects are referenced only when states are going to be deleted to
  be able reuse kidx of named objects when new parent rules will be
  installed.
  
  ipfw_dyn_get_count() function was modified and now it also looks into
  dynamic states and constructs maps of existing named objects. This is
  needed to correctly export orphaned states into userland.
  
  ipfw_free_rule() was changed to be global, since now dynamic state can
  free rule, when it is expired and references counters becomes 1.
  
  External actions subsystem also modified, since external actions can be
  deregisterd and instances can be destroyed. In these cases deleted rules,
  that are referenced by orphaned states, must be modified to prevent access
  to freed memory. ipfw_dyn_reset_eaction(), ipfw_reset_eaction_instance()
  functions added for these purposes.
  
  Obtained from:Yandex LLC
  MFC after:2 months
  Sponsored by: Yandex LLC
  Differential Revision:https://reviews.freebsd.org/D17532

Modified:
  head/sys/netpfil/ipfw/ip_fw_dynamic.c
  head/sys/netpfil/ipfw/ip_fw_eaction.c
  head/sys/netpfil/ipfw/ip_fw_private.h
  head/sys/netpfil/ipfw/ip_fw_sockopt.c
  head/sys/netpfil/ipfw/nat64/nat64lsn_control.c
  head/sys/netpfil/ipfw/nat64/nat64stl_control.c
  head/sys/netpfil/ipfw/nptv6/nptv6.c

Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c
==
--- head/sys/netpfil/ipfw/ip_fw_dynamic.c   Tue Dec  4 15:25:15 2018
(r341470)
+++ head/sys/netpfil/ipfw/ip_fw_dynamic.c   Tue Dec  4 16:01:25 2018
(r341471)
@@ -122,6 +122,12 @@ __FBSDID("$FreeBSD$");
(d)->bcnt_ ## dir += pktlen;\
} while (0)
 
+#defineDYN_REFERENCED  0x01
+/*
+ * DYN_REFERENCED flag is used to show that state keeps reference to named
+ * object, and this reference should be released when state becomes expired.
+ */
+
 struct dyn_data {
void*parent;/* pointer to parent rule */
uint32_tchain_id;   /* cached ruleset id */
@@ -129,7 +135,8 @@ struct dyn_data {
 
uint32_thashval;/* hash value used for hash resize */
uint16_tfibnum; /* fib used to send keepalives */
-   uint8_t _pad[3];
+   uint8_t _pad[2];
+   uint8_t flags;  /* internal flags */
uint8_t set;/* parent rule set number */
uint16_trulenum;/* parent rule number */
uint32_truleid; /* parent rule id */
@@ -1399,20 +1406,29 @@ ipfw_dyn_lookup_state(const struct ip_fw_args *args, c
 * should be deleted by dyn_expire_states().
 *
 * In case when dyn_keep_states is enabled, return
-* pointer to default rule and corresponding f_pos
-* value.
-* XXX: In this case we lose the cache efficiency,
-*  since f_pos is not cached, because it seems
-*  there is no easy way to atomically switch
-*  all fields related to parent rule of given
-*  state.
+* pointer to deleted rule and f_pos value
+* corresponding to penultimate rule.
+* When we have enabled V_dyn_keep_states, states
+* that become orphaned will get the DYN_REFERENCED
+* flag and rule will keep around. So we can return
+* it. But since it is not in the rules map, we need
+* return such f_pos value, so after the state
+* handling if the search will continue, the next rule
+* will be the last one - the default rule.
 */
if (V_layer3_chain.map[data->f_pos] 

svn commit: r341470 - head/sbin/ggate/ggated

2018-12-04 Thread Ed Maste
Author: emaste
Date: Tue Dec  4 15:25:15 2018
New Revision: 341470
URL: https://svnweb.freebsd.org/changeset/base/341470

Log:
  ggated: do not expose stack data in sendfail()
  
  admbugs:  590
  Submitted by: Fabian Keil 
  Obtained from:ElectroBSD

Modified:
  head/sbin/ggate/ggated/ggated.c

Modified: head/sbin/ggate/ggated/ggated.c
==
--- head/sbin/ggate/ggated/ggated.c Tue Dec  4 15:12:28 2018
(r341469)
+++ head/sbin/ggate/ggated/ggated.c Tue Dec  4 15:25:15 2018
(r341470)
@@ -591,6 +591,7 @@ sendfail(int sfd, int error, const char *fmt, ...)
va_list ap;
ssize_t data;
 
+   memset(, 0, sizeof(sinit));
sinit.gs_error = error;
g_gate_swap2n_sinit();
data = g_gate_send(sfd, , sizeof(sinit), 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: r341469 - head/sys/netpfil/ipfw

2018-12-04 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  4 15:12:28 2018
New Revision: 341469
URL: https://svnweb.freebsd.org/changeset/base/341469

Log:
  Add assertion to check that named object has correct type.
  
  Obtained from:Yandex LLC
  MFC after:1 week

Modified:
  head/sys/netpfil/ipfw/ip_fw_dynamic.c

Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c
==
--- head/sys/netpfil/ipfw/ip_fw_dynamic.c   Tue Dec  4 15:06:24 2018
(r341468)
+++ head/sys/netpfil/ipfw/ip_fw_dynamic.c   Tue Dec  4 15:12:28 2018
(r341469)
@@ -708,6 +708,8 @@ dyn_destroy(struct ip_fw_chain *ch, struct named_objec
 
IPFW_UH_WLOCK_ASSERT(ch);
 
+   KASSERT(no->etlv == IPFW_TLV_STATE_NAME,
+   ("%s: wrong object type %u", __func__, no->etlv));
KASSERT(no->refcnt == 1,
("Destroying object '%s' (type %u, idx %u) with refcnt %u",
no->name, no->etlv, no->kidx, no->refcnt));
___
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: r341468 - stable/12/sys/amd64/amd64

2018-12-04 Thread Konstantin Belousov
Author: kib
Date: Tue Dec  4 15:06:24 2018
New Revision: 341468
URL: https://svnweb.freebsd.org/changeset/base/341468

Log:
  MFC r341096:
  Fix assert condition in pmap_large_unmap().

Modified:
  stable/12/sys/amd64/amd64/pmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/pmap.c
==
--- stable/12/sys/amd64/amd64/pmap.cTue Dec  4 15:04:48 2018
(r341467)
+++ stable/12/sys/amd64/amd64/pmap.cTue Dec  4 15:06:24 2018
(r341468)
@@ -8441,9 +8441,10 @@ pmap_large_unmap(void *svaa, vm_size_t len)
KASSERT((va & PDPMASK) == 0,
("PDPMASK bit set, va %#lx pdpe %#lx pdp %#lx", va,
(u_long)pdpe, pdp));
-   KASSERT(len <= NBPDP,
-   ("len < NBPDP, sva %#lx va %#lx pdpe %#lx pdp %#lx "
-   "len %#lx", sva, va, (u_long)pdpe, pdp, len));
+   KASSERT(va + NBPDP <= sva + len,
+   ("unmap covers partial 1GB page, sva %#lx va %#lx "
+   "pdpe %#lx pdp %#lx len %#lx", sva, va,
+   (u_long)pdpe, pdp, len));
*pdpe = 0;
inc = NBPDP;
continue;
@@ -8457,9 +8458,10 @@ pmap_large_unmap(void *svaa, vm_size_t len)
KASSERT((va & PDRMASK) == 0,
("PDRMASK bit set, va %#lx pde %#lx pd %#lx", va,
(u_long)pde, pd));
-   KASSERT(len <= NBPDR,
-   ("len < NBPDR, sva %#lx va %#lx pde %#lx pd %#lx "
-   "len %#lx", sva, va, (u_long)pde, pd, len));
+   KASSERT(va + NBPDR <= sva + len,
+   ("unmap covers partial 2MB page, sva %#lx va %#lx "
+   "pde %#lx pd %#lx len %#lx", sva, va, (u_long)pde,
+   pd, len));
pde_store(pde, 0);
inc = NBPDR;
m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde));
___
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: r341467 - stable/11/sys/vm

2018-12-04 Thread Ed Maste
Author: emaste
Date: Tue Dec  4 15:04:48 2018
New Revision: 341467
URL: https://svnweb.freebsd.org/changeset/base/341467

Log:
  MFC r327860: ANSIfy function definitions in sys/vm/

Modified:
  stable/11/sys/vm/vm_glue.c
  stable/11/sys/vm/vm_unix.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_glue.c
==
--- stable/11/sys/vm/vm_glue.c  Tue Dec  4 15:02:19 2018(r341466)
+++ stable/11/sys/vm/vm_glue.c  Tue Dec  4 15:04:48 2018(r341467)
@@ -111,9 +111,7 @@ __FBSDID("$FreeBSD$");
  * space.
  */
 int
-kernacc(addr, len, rw)
-   void *addr;
-   int len, rw;
+kernacc(void *addr, int len, int rw)
 {
boolean_t rv;
vm_offset_t saddr, eaddr;
@@ -145,9 +143,7 @@ kernacc(addr, len, rw)
  * used in conjunction with this call.
  */
 int
-useracc(addr, len, rw)
-   void *addr;
-   int len, rw;
+useracc(void *addr, int len, int rw)
 {
boolean_t rv;
vm_prot_t prot;
@@ -532,12 +528,8 @@ intr_prof_stack_use(struct thread *td, struct trapfram
  * to user mode to avoid stack copying and relocation problems.
  */
 int
-vm_forkproc(td, p2, td2, vm2, flags)
-   struct thread *td;
-   struct proc *p2;
-   struct thread *td2;
-   struct vmspace *vm2;
-   int flags;
+vm_forkproc(struct thread *td, struct proc *p2, struct thread *td2,
+struct vmspace *vm2, int flags)
 {
struct proc *p1 = td->td_proc;
int error;

Modified: stable/11/sys/vm/vm_unix.c
==
--- stable/11/sys/vm/vm_unix.c  Tue Dec  4 15:02:19 2018(r341466)
+++ stable/11/sys/vm/vm_unix.c  Tue Dec  4 15:04:48 2018(r341467)
@@ -71,9 +71,7 @@ struct obreak_args {
  */
 /* ARGSUSED */
 int
-sys_obreak(td, uap)
-   struct thread *td;
-   struct obreak_args *uap;
+sys_obreak(struct thread *td, struct obreak_args *uap)
 {
struct vmspace *vm = td->td_proc->p_vmspace;
vm_map_t map = >vm_map;
@@ -245,9 +243,7 @@ struct ovadvise_args {
  */
 /* ARGSUSED */
 int
-sys_ovadvise(td, uap)
-   struct thread *td;
-   struct ovadvise_args *uap;
+sys_ovadvise(struct thread *td, struct ovadvise_args *uap)
 {
/* START_GIANT_OPTIONAL */
/* END_GIANT_OPTIONAL */
___
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: r341466 - stable/12/sys/kern

2018-12-04 Thread Konstantin Belousov
Author: kib
Date: Tue Dec  4 15:02:19 2018
New Revision: 341466
URL: https://svnweb.freebsd.org/changeset/base/341466

Log:
  MFC r341094:
  Improve sigonstack().

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

Modified: stable/12/sys/kern/kern_sig.c
==
--- stable/12/sys/kern/kern_sig.c   Tue Dec  4 14:07:45 2018
(r341465)
+++ stable/12/sys/kern/kern_sig.c   Tue Dec  4 15:02:19 2018
(r341466)
@@ -615,20 +615,25 @@ signotify(struct thread *td)
}
 }
 
+/*
+ * Returns 1 (true) if altstack is configured for the thread, and the
+ * passed stack bottom address falls into the altstack range.  Handles
+ * the 43 compat special case where the alt stack size is zero.
+ */
 int
 sigonstack(size_t sp)
 {
-   struct thread *td = curthread;
+   struct thread *td;
 
-   return ((td->td_pflags & TDP_ALTSTACK) ?
+   td = curthread;
+   if ((td->td_pflags & TDP_ALTSTACK) == 0)
+   return (0);
 #if defined(COMPAT_43)
-   ((td->td_sigstk.ss_size == 0) ?
-   (td->td_sigstk.ss_flags & SS_ONSTACK) :
-   ((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size))
-#else
-   ((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size)
+   if (td->td_sigstk.ss_size == 0)
+   return ((td->td_sigstk.ss_flags & SS_ONSTACK) != 0);
 #endif
-   : 0);
+   return (sp >= (size_t)td->td_sigstk.ss_sp &&
+   sp < td->td_sigstk.ss_size + (size_t)td->td_sigstk.ss_sp);
 }
 
 static __inline int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341465 - stable/10/share/man/man4

2018-12-04 Thread Ed Maste
Author: emaste
Date: Tue Dec  4 14:07:45 2018
New Revision: 341465
URL: https://svnweb.freebsd.org/changeset/base/341465

Log:
  MFC r323010: hv_vss.4: Fix spelling of 'responsibility'
  
  PR:   221300
  Submitted by: Fabian Keil
  Obtained from:ElectroBSD

Modified:
  stable/10/share/man/man4/hv_vss.4
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/hv_vss.4
==
--- stable/10/share/man/man4/hv_vss.4   Tue Dec  4 12:34:22 2018
(r341464)
+++ stable/10/share/man/man4/hv_vss.4   Tue Dec  4 14:07:45 2018
(r341465)
@@ -66,7 +66,7 @@ VM, and sends the result back to Hyper-V host.
 .Pp
 Generally,
 .Xr hv_vss_daemon 8
-takes the responsiblity to freeze/thaw UFS file system,
+takes the responsibility to freeze/thaw UFS file system,
 and it is automatically launched after system boots. When Hyper-V host wants to
 take a snapshot of the
 .Fx
___
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: r341464 - head/sbin/savecore

2018-12-04 Thread Renato Botelho
Author: garga (ports committer)
Date: Tue Dec  4 12:34:22 2018
New Revision: 341464
URL: https://svnweb.freebsd.org/changeset/base/341464

Log:
  Restore /var/crash permissions to 0750, as declared in mtree file. After
  r337337 it changed to 0755.
  
  Reviewed by:  loos
  Approved by:  loos
  MFC after:3 days
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D18355

Modified:
  head/sbin/savecore/Makefile

Modified: head/sbin/savecore/Makefile
==
--- head/sbin/savecore/Makefile Tue Dec  4 10:30:31 2018(r341463)
+++ head/sbin/savecore/Makefile Tue Dec  4 12:34:22 2018(r341464)
@@ -2,7 +2,9 @@
 
 PACKAGE=runtime
 CONFS= minfree
-CONFSDIR=  /var/crash
+VAR_CRASH= /var/crash
+VAR_CRASH_MODE=0750
+CONFSDIR=  VAR_CRASH
 PROG=  savecore
 LIBADD=z xo
 MAN=   savecore.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"


Re: svn commit: r339008 - in stable/11: include/rpcsvc lib/libutil libexec/rpc.rquotad sys/cddl/contrib/opensolaris/uts/common/fs/zfs usr.bin/quota

2018-12-04 Thread Andre Albsmeier
On Sat, 29-Sep-2018 at 00:44:23 +, Sean Eric Fagan wrote:
> Author: sef
> Date: Sat Sep 29 00:44:23 2018
> New Revision: 339008
> URL: https://svnweb.freebsd.org/changeset/base/339008
> 
> Log:
>   MFC r336017,r338799
>   
>   r336017
>   This exposes ZFS user and group quotas via the normal
>   quatactl(2) mechanism.  (Read-only at this point, however.)
>   In particular, this is to allow rpc.rquotad query quotas
>   for NFS mounts, allowing users to see their quotas on the
>   hosts using the datasets.
>   
>   The changes specifically:
>   
>   * Add new RPC entry points for querying quotas.
>   * Changes the library routines to allow non-UFS quotas.

This broke repquota on my UFS. I fixed it with:

--- lib/libutil/quotafile.c.ORI 2018-09-29 11:56:05.0 +0200
+++ lib/libutil/quotafile.c 2018-12-04 13:00:04.450826000 +0100
@@ -125,18 +125,18 @@
strlcpy(qf->fsname, fs->fs_file, sizeof(qf->fsname));
if (stat(qf->fsname, ) != 0)
goto error;
qf->dev = st.st_dev;
qcmd = QCMD(Q_GETQUOTASIZE, quotatype);
+   serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname));
if (quotactl(qf->fsname, qcmd, 0, >wordsize) == 0)
return (qf);
/* We only check the quota file for ufs */
if (strcmp(fs->fs_vfstype, "ufs")) {
errno = 0;
goto error;
}
-   serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname));
if (serrno == 0) {
errno = EOPNOTSUPP;
goto error;
}
qf->accmode = openflags & O_ACCMODE;


Apparently it wants qf->qfname to be filled in by hasquota(). No idea
if calling hasquota() hurts for non-UFS...

-Andre
___
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: r341463 - svnadmin/conf

2018-12-04 Thread Joseph Mingrone
Author: jrm (ports committer)
Date: Tue Dec  4 10:30:31 2018
New Revision: 341463
URL: https://svnweb.freebsd.org/changeset/base/341463

Log:
  Take in jimharris's commit bit for safekeeping at his request
  
  Approved by:  core
  With hat: core-secretary

Modified:
  svnadmin/conf/access

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessTue Dec  4 09:18:28 2018(r341462)
+++ svnadmin/conf/accessTue Dec  4 10:30:31 2018(r341463)
@@ -110,7 +110,6 @@ jeff
 jhb
 jhibbits
 jilles
-jimharris
 jkim
 jlh
 jmallett
___
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: r341462 - stable/11/sys/netpfil/ipfw

2018-12-04 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  4 09:18:28 2018
New Revision: 341462
URL: https://svnweb.freebsd.org/changeset/base/341462

Log:
  MFC r341073:
Do not limit the mbuf queue length for keepalive packets.
  
It was unlimited before overhaul, and one user reported that this limit
can be reached easily.
  
PR: 233562

Modified:
  stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c
==
--- stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c  Tue Dec  4 09:16:20 2018
(r341461)
+++ stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c  Tue Dec  4 09:18:28 2018
(r341462)
@@ -348,7 +348,6 @@ static VNET_DEFINE(uint32_t, dyn_short_lifetime);
  * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower
  * than dyn_keepalive_period.
  */
-#defineDYN_KEEPALIVE_MAXQ  512
 static VNET_DEFINE(uint32_t, dyn_keepalive_interval);
 static VNET_DEFINE(uint32_t, dyn_keepalive_period);
 static VNET_DEFINE(uint32_t, dyn_keepalive);
@@ -2350,7 +2349,7 @@ dyn_send_keepalive_ipv4(struct ip_fw_chain *chain)
struct dyn_ipv4_state *s;
uint32_t bucket;
 
-   mbufq_init(, DYN_KEEPALIVE_MAXQ);
+   mbufq_init(, INT_MAX);
IPFW_UH_RLOCK(chain);
/*
 * It is safe to not use hazard pointer and just do lockless
@@ -2457,7 +2456,7 @@ dyn_send_keepalive_ipv6(struct ip_fw_chain *chain)
struct dyn_ipv6_state *s;
uint32_t bucket;
 
-   mbufq_init(, DYN_KEEPALIVE_MAXQ);
+   mbufq_init(, INT_MAX);
IPFW_UH_RLOCK(chain);
/*
 * It is safe to not use hazard pointer and just do lockless
___
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: r341461 - stable/12/sys/netpfil/ipfw

2018-12-04 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  4 09:16:20 2018
New Revision: 341461
URL: https://svnweb.freebsd.org/changeset/base/341461

Log:
  MFC r341073:
Do not limit the mbuf queue length for keepalive packets.
  
It was unlimited before overhaul, and one user reported that this limit
can be reached easily.
  
PR: 233562

Modified:
  stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c
==
--- stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c  Tue Dec  4 07:48:43 2018
(r341460)
+++ stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c  Tue Dec  4 09:16:20 2018
(r341461)
@@ -349,7 +349,6 @@ VNET_DEFINE_STATIC(uint32_t, dyn_short_lifetime);
  * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower
  * than dyn_keepalive_period.
  */
-#defineDYN_KEEPALIVE_MAXQ  512
 VNET_DEFINE_STATIC(uint32_t, dyn_keepalive_interval);
 VNET_DEFINE_STATIC(uint32_t, dyn_keepalive_period);
 VNET_DEFINE_STATIC(uint32_t, dyn_keepalive);
@@ -2351,7 +2350,7 @@ dyn_send_keepalive_ipv4(struct ip_fw_chain *chain)
struct dyn_ipv4_state *s;
uint32_t bucket;
 
-   mbufq_init(, DYN_KEEPALIVE_MAXQ);
+   mbufq_init(, INT_MAX);
IPFW_UH_RLOCK(chain);
/*
 * It is safe to not use hazard pointer and just do lockless
@@ -2458,7 +2457,7 @@ dyn_send_keepalive_ipv6(struct ip_fw_chain *chain)
struct dyn_ipv6_state *s;
uint32_t bucket;
 
-   mbufq_init(, DYN_KEEPALIVE_MAXQ);
+   mbufq_init(, INT_MAX);
IPFW_UH_RLOCK(chain);
/*
 * It is safe to not use hazard pointer and just do lockless
___
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: r341446 - head/release/amd64

2018-12-04 Thread Alexey Dokuchaev
On Tue, Dec 04, 2018 at 11:52:34AM +0300, Yuri Pankov wrote:
> Alexey Dokuchaev wrote:
> > On Mon, Dec 03, 2018 at 10:31:57PM +, Yuri Pankov wrote:
> >> New Revision: 341446
> >> URL: https://svnweb.freebsd.org/changeset/base/341446
> >>
> >> Log:
> >>   mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
> >>   
> >>   This fixes 'cdrom' target in the case when world was built by user,
> >>   and not root.
> > 
> > Could you please explain why -p should not have been used here?  I fail
> > to understand this from the commit log.  I've always considered preserving
> > various file metadata as a good thing to do, and this commit puzzles me.
> 
> Because the target is on msdosfs, and the only metadata that can be
> preserved is modification time which isn't that useful with the file
> being hidden in ESP.  OTOH, 'cp -p' fails trying to preserve owner/group
> if source is not owned by root (as commit message says).  Additional
> 'chmod' call done in HBSD doesn't do much as well -- it seems we can
> only set/unset owner's 'write' flag which corresponds to DOS 'readonly'
> attribute.

Ah, I see now, so cp(1) was failing and that upset 'set -e'.  Thanks for
explanation.

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


Re: svn commit: r341446 - head/release/amd64

2018-12-04 Thread Yuri Pankov
Alexey Dokuchaev wrote:
> On Mon, Dec 03, 2018 at 10:31:57PM +, Yuri Pankov wrote:
>> New Revision: 341446
>> URL: https://svnweb.freebsd.org/changeset/base/341446
>>
>> Log:
>>   mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
>>   
>>   This fixes 'cdrom' target in the case when world was built by user,
>>   and not root.
> 
> Could you please explain why -p should not have been used here?  I fail
> to understand this from the commit log.  I've always considered preserving
> various file metadata as a good thing to do, and this commit puzzles me.

Because the target is on msdosfs, and the only metadata that can be
preserved is modification time which isn't that useful with the file
being hidden in ESP.  OTOH, 'cp -p' fails trying to preserve owner/group
if source is not owned by root (as commit message says).  Additional
'chmod' call done in HBSD doesn't do much as well -- it seems we can
only set/unset owner's 'write' flag which corresponds to DOS 'readonly'
attribute.



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r341446 - head/release/amd64

2018-12-04 Thread Alexey Dokuchaev
On Mon, Dec 03, 2018 at 10:31:57PM +, Yuri Pankov wrote:
> New Revision: 341446
> URL: https://svnweb.freebsd.org/changeset/base/341446
> 
> Log:
>   mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
>   
>   This fixes 'cdrom' target in the case when world was built by user,
>   and not root.

Could you please explain why -p should not have been used here?  I fail
to understand this from the commit log.  I've always considered preserving
various file metadata as a good thing to do, and this commit puzzles me.

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


Re: svn commit: r341446 - head/release/amd64

2018-12-04 Thread Oliver Pinter
On Tuesday, December 4, 2018, Yuri Pankov  wrote:

> Oliver Pinter wrote:
> >
> >
> > On Monday, December 3, 2018, Yuri Pankov  > > wrote:
> >
> > Author: yuripv
> > Date: Mon Dec  3 22:31:57 2018
> > New Revision: 341446
> > URL: https://svnweb.freebsd.org/changeset/base/341446
> > 
> >
> > Log:
> >   mkisoimages.sh: don't use -p flag when copying loader.efi to
> msdosfs.
> >
> >   This fixes 'cdrom' target in the case when world was built by user,
> >   and not root.
> >
> >   Reviewed by:  imp
> >   Differential revision:https://reviews.freebsd.org/D18414
> > 
> >
> >
> > This was a known issue
> > : https://lists.freebsd.org/pipermail/svn-src-head/2018-
> November/119689.html
>
> Sorry, I missed that.



No problem. Ed was directly CCd and notified on IRC.


>
> Looking at the HBSD change, does chmod step have any significance?



 It just ensures the correct file permissions.


> > Modified:
> >   head/release/amd64/mkisoimages.sh
> >
> > Modified: head/release/amd64/mkisoimages.sh
> > 
> ==
> > --- head/release/amd64/mkisoimages.sh   Mon Dec  3 22:09:23 2018
> > (r341445)
> > +++ head/release/amd64/mkisoimages.sh   Mon Dec  3 22:31:57 2018
> > (r341446)
> > @@ -49,7 +49,7 @@ if [ "$1" = "-b" ]; then
> > mkdir efi
> > mount -t msdosfs /dev/$device efi
> > mkdir -p efi/efi/boot
> > -   cp -p "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> > +   cp "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> > umount efi
> > rmdir efi
> > mdconfig -d -u $device
> > ___
> > svn-src-h...@freebsd.org  mailing
> list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-head
> > 
> > To unsubscribe, send any mail to
> > "svn-src-head-unsubscr...@freebsd.org
> > "
> >
>
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"