svn commit: r295961 - stable/10/contrib/libarchive/libarchive

2016-02-23 Thread Xin LI
Author: delphij
Date: Wed Feb 24 05:40:03 2016
New Revision: 295961
URL: https://svnweb.freebsd.org/changeset/base/295961

Log:
  MFC r295914: MFV r295913:
  
  Partially apply upstream changeset 6e06b1c8 (kientzle).
  
  Limit filter recursion level to 25 (instead of infinite).  This fixes a
  potential crash issue discovered by Alexander Cherepanov.
  
  PR:   207362
  Reported by:  Robert Clausecker
  Obtained from:libarchive github project
  Approved by:  re (marius)

Modified:
  stable/10/contrib/libarchive/libarchive/archive_read.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/libarchive/libarchive/archive_read.c
==
--- stable/10/contrib/libarchive/libarchive/archive_read.c  Wed Feb 24 
05:17:52 2016(r295960)
+++ stable/10/contrib/libarchive/libarchive/archive_read.c  Wed Feb 24 
05:40:03 2016(r295961)
@@ -545,13 +545,13 @@ archive_read_open1(struct archive *_a)
 static int
 choose_filters(struct archive_read *a)
 {
-   int number_bidders, i, bid, best_bid;
+   int number_bidders, i, bid, best_bid, n;
struct archive_read_filter_bidder *bidder, *best_bidder;
struct archive_read_filter *filter;
ssize_t avail;
int r;
 
-   for (;;) {
+   for (n = 0; n < 25; ++n) {
number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
 
best_bid = 0;
@@ -597,6 +597,9 @@ choose_filters(struct archive_read *a)
return (ARCHIVE_FATAL);
}
}
+   archive_set_error(>archive, ARCHIVE_ERRNO_FILE_FORMAT,
+   "Input requires too many filters for decoding");
+   return (ARCHIVE_FATAL);
 }
 
 /*
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


svn commit: r295951 - in stable/10: sys/compat/linprocfs sys/compat/linsysfs sys/kern sys/sys usr.sbin/jail

2016-02-23 Thread Marcelo Araujo
Author: araujo
Date: Wed Feb 24 02:34:11 2016
New Revision: 295951
URL: https://svnweb.freebsd.org/changeset/base/295951

Log:
  MFH: 285685
  Add support to the jail framework to be able to mount linsysfs(5) and 
linprocfs(5).
  
  PR:   207179
  Requested by: tho...@gibfest.dk
  Reviewed by:  jamie, bapt
  Approved by:  re (gjb)
  Sponsored by: gandi.net
  Differential Revision:https://reviews.freebsd.org/D5390

Modified:
  stable/10/sys/compat/linprocfs/linprocfs.c
  stable/10/sys/compat/linsysfs/linsysfs.c
  stable/10/sys/kern/kern_jail.c
  stable/10/sys/sys/jail.h
  stable/10/usr.sbin/jail/jail.8

Modified: stable/10/sys/compat/linprocfs/linprocfs.c
==
--- stable/10/sys/compat/linprocfs/linprocfs.c  Wed Feb 24 01:58:40 2016
(r295950)
+++ stable/10/sys/compat/linprocfs/linprocfs.c  Wed Feb 24 02:34:11 2016
(r295951)
@@ -1514,7 +1514,7 @@ linprocfs_uninit(PFS_INIT_ARGS)
return (0);
 }
 
-PSEUDOFS(linprocfs, 1, 0);
+PSEUDOFS(linprocfs, 1, PR_ALLOW_MOUNT_LINPROCFS);
 #if defined(__amd64__)
 MODULE_DEPEND(linprocfs, linux_common, 1, 1, 1);
 #else

Modified: stable/10/sys/compat/linsysfs/linsysfs.c
==
--- stable/10/sys/compat/linsysfs/linsysfs.cWed Feb 24 01:58:40 2016
(r295950)
+++ stable/10/sys/compat/linsysfs/linsysfs.cWed Feb 24 02:34:11 2016
(r295951)
@@ -274,7 +274,7 @@ linsysfs_uninit(PFS_INIT_ARGS)
return (0);
 }
 
-PSEUDOFS(linsysfs, 1, 0);
+PSEUDOFS(linsysfs, 1, PR_ALLOW_MOUNT_LINSYSFS);
 #if defined(__amd64__)
 MODULE_DEPEND(linsysfs, linux_common, 1, 1, 1);
 #else

Modified: stable/10/sys/kern/kern_jail.c
==
--- stable/10/sys/kern/kern_jail.c  Wed Feb 24 01:58:40 2016
(r295950)
+++ stable/10/sys/kern/kern_jail.c  Wed Feb 24 02:34:11 2016
(r295951)
@@ -208,6 +208,8 @@ static char *pr_allow_names[] = {
"allow.mount.procfs",
"allow.mount.tmpfs",
"allow.mount.fdescfs",
+   "allow.mount.linprocfs",
+   "allow.mount.linsysfs",
 };
 const size_t pr_allow_names_size = sizeof(pr_allow_names);
 
@@ -225,6 +227,8 @@ static char *pr_allow_nonames[] = {
"allow.mount.noprocfs",
"allow.mount.notmpfs",
"allow.mount.nofdescfs",
+   "allow.mount.nolinprocfs",
+   "allow.mount.nolinsysfs",
 };
 const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames);
 
@@ -4315,6 +4319,14 @@ SYSCTL_PROC(_security_jail, OID_AUTO, mo
 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
 NULL, PR_ALLOW_MOUNT_PROCFS, sysctl_jail_default_allow, "I",
 "Processes in jail can mount the procfs file system");
+SYSCTL_PROC(_security_jail, OID_AUTO, mount_linprocfs_allowed,
+CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
+NULL, PR_ALLOW_MOUNT_LINPROCFS, sysctl_jail_default_allow, "I",
+"Processes in jail can mount the linprocfs file system");
+SYSCTL_PROC(_security_jail, OID_AUTO, mount_linsysfs_allowed,
+CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
+NULL, PR_ALLOW_MOUNT_LINSYSFS, sysctl_jail_default_allow, "I",
+"Processes in jail can mount the linsysfs file system");
 SYSCTL_PROC(_security_jail, OID_AUTO, mount_tmpfs_allowed,
 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
 NULL, PR_ALLOW_MOUNT_TMPFS, sysctl_jail_default_allow, "I",
@@ -4481,6 +4493,10 @@ SYSCTL_JAIL_PARAM(_allow_mount, nullfs, 
 "B", "Jail may mount the nullfs file system");
 SYSCTL_JAIL_PARAM(_allow_mount, procfs, CTLTYPE_INT | CTLFLAG_RW,
 "B", "Jail may mount the procfs file system");
+SYSCTL_JAIL_PARAM(_allow_mount, linprocfs, CTLTYPE_INT | CTLFLAG_RW,
+"B", "Jail may mount the linprocfs file system");
+SYSCTL_JAIL_PARAM(_allow_mount, linsysfs, CTLTYPE_INT | CTLFLAG_RW,
+"B", "Jail may mount the linsysfs file system");
 SYSCTL_JAIL_PARAM(_allow_mount, tmpfs, CTLTYPE_INT | CTLFLAG_RW,
 "B", "Jail may mount the tmpfs file system");
 SYSCTL_JAIL_PARAM(_allow_mount, zfs, CTLTYPE_INT | CTLFLAG_RW,

Modified: stable/10/sys/sys/jail.h
==
--- stable/10/sys/sys/jail.hWed Feb 24 01:58:40 2016(r295950)
+++ stable/10/sys/sys/jail.hWed Feb 24 02:34:11 2016(r295951)
@@ -232,7 +232,9 @@ struct prison_racct {
 #definePR_ALLOW_MOUNT_PROCFS   0x0400
 #definePR_ALLOW_MOUNT_TMPFS0x0800
 #definePR_ALLOW_MOUNT_FDESCFS  0x1000
-#definePR_ALLOW_ALL0x1fff
+#definePR_ALLOW_MOUNT_LINPROCFS0x2000
+#definePR_ALLOW_MOUNT_LINSYSFS 0x4000
+#definePR_ALLOW_ALL0x7fff
 
 /*
  * OSD methods

Modified: stable/10/usr.sbin/jail/jail.8
==
--- 

svn commit: r295948 - in stable/10/sys/dev/hyperv: netvsc vmbus

2016-02-23 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Feb 24 01:30:50 2016
New Revision: 295948
URL: https://svnweb.freebsd.org/changeset/base/295948

Log:
  MFC [Hyper-V]: r294553, r294700
  
  r294553
  
  hyperv/vmbus: Lookup channel through id table
  
  Vmbus event handler will need to find the channel by its relative
  id, when software interrupt for event happens.  The original lookup
  searches the channel list, which is not very efficient.  We now
  create a table indexed by the channel relative id to speed up
  the channel lookup.
  
  Submitted by:   Hongjiang Zhang 
  Reviewed by:delphij, adrain, sephe, Dexuan Cui 
  Approved by:adrian (mentor)
  Sponsored by:   Microsoft OSTC
  Differential Revision:  https://reviews.freebsd.org/D4802
  
  -
  
  r294700
  
  hyperv/hn: Partly rework transmission path
  
  - Avoid unnecessary malloc/free on transmission path.
  - busdma(9)-fy transmission path.
  - Properly handle IFF_DRV_OACTIVE.  This should fix the network
stalls reported by many.
  - Properly setup TSO parameters.
  - Properly handle bpf(4) tapping.  This 5 times the performance
during TCP sending test, when there is one bpf(4) attached.
  - Allow size of chimney sending be tuned on a running system.
Default value still needs more test to determine.
  
  Reviewed by:adrian, delphij
  Approved by:adrian (mentor)
  Sponsored by:   Microsoft OSTC
  Differential Revision:  https://reviews.freebsd.org/D4972
  
  Approved by:  re (marius)
  Sponsored by: Microsoft OSTC

Modified:
  stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c
  stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h
  stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  stable/10/sys/dev/hyperv/netvsc/hv_rndis.h
  stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h
  stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  stable/10/sys/dev/hyperv/vmbus/hv_connection.c
  stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cWed Feb 24 01:11:51 
2016(r295947)
+++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cWed Feb 24 01:30:50 
2016(r295948)
@@ -1027,4 +1027,6 @@ hv_nv_on_channel_callback(void *context)
 
if (bufferlen > NETVSC_PACKET_SIZE)
free(buffer, M_NETVSC);
+
+   hv_rf_channel_rollup(net_dev);
 }

Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Feb 24 01:11:51 
2016(r295947)
+++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Feb 24 01:30:50 
2016(r295948)
@@ -38,12 +38,16 @@
 #ifndef __HV_NET_VSC_H__
 #define __HV_NET_VSC_H__
 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 
@@ -984,6 +988,9 @@ typedef struct {
hv_bool_uint8_t link_state;
 } netvsc_device_info;
 
+struct hn_txdesc;
+SLIST_HEAD(hn_txdesc_list, hn_txdesc);
+
 /*
  * Device-specific softc structure
  */
@@ -1002,6 +1009,18 @@ typedef struct hn_softc {
struct hv_device  *hn_dev_obj;
netvsc_dev  *net_dev;
 
+   int hn_txdesc_cnt;
+   struct hn_txdesc *hn_txdesc;
+   bus_dma_tag_t   hn_tx_data_dtag;
+   bus_dma_tag_t   hn_tx_rndis_dtag;
+   int hn_tx_chimney_size;
+   int hn_tx_chimney_max;
+
+   struct mtx  hn_txlist_spin;
+   struct hn_txdesc_list hn_txlist;
+   int hn_txdesc_avail;
+   int hn_txeof;
+
struct lro_ctrl hn_lro;
int hn_lro_hiwat;
 
@@ -1013,6 +1032,11 @@ typedef struct hn_softc {
u_long  hn_csum_trusted;
u_long  hn_lro_tried;
u_long  hn_small_pkts;
+   u_long  hn_no_txdescs;
+   u_long  hn_send_failed;
+   u_long  hn_txdma_failed;
+   u_long  hn_tx_collapsed;
+   u_long  hn_tx_chimney;
 } hn_softc_t;
 
 

Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Feb 24 
01:11:51 2016(r295947)
+++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Feb 24 
01:30:50 2016(r295948)
@@ -129,6 +129,41 @@ __FBSDID("$FreeBSD$");
 #define HV_NV_SC_PTR_OFFSET_IN_BUF 0
 #define HV_NV_PACKET_OFFSET_IN_BUF 16
 
+/* YYY should get it from the underlying channel */
+#define HN_TX_DESC_CNT 512
+
+#define HN_RNDIS_MSG_LEN   \
+